binutils-gdb/bfd/libcoff.h

71 lines
2.4 KiB
C
Raw Normal View History

1991-03-22 05:11:25 +08:00
/* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Diddler.
BFD is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
BFD is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BFD; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* $Id$ */
/* BFD COFF object file private structure. */
/* Object file tdata; access macros */
#define obj_icof(bfd) ((struct icofdata *) ((bfd)->tdata))
1991-04-24 01:02:09 +09:00
#define coff_data(bfd) ((struct icofdata *) ((bfd)->tdata))
1991-03-22 05:11:25 +08:00
#define exec_hdr(bfd) (obj_icof(bfd)->hdr)
#define obj_symbols(bfd) (obj_icof(bfd)->symbols)
#define obj_sym_filepos(bfd) (obj_icof(bfd)->sym_filepos)
#define obj_relocbase(bfd) (obj_icof(bfd)->relocbase)
#define obj_raw_syments(bfd) (obj_icof(bfd)->raw_syments)
#define obj_convert(bfd) (obj_icof(bfd)->conversion_table)
#define obj_symbol_slew(bfd) (obj_icof(bfd)->symbol_index_slew)
#define obj_string_table(bfd) (obj_icof(bfd)->string_table)
typedef struct {
asymbol symbol;
struct syment *native;
struct lineno_cache_entry *lineno;
} coff_symbol_type;
1991-04-24 01:02:09 +09:00
typedef struct icofdata
{
struct aouthdr hdr; /* exec file header */
1991-03-22 05:11:25 +08:00
coff_symbol_type *symbols; /* symtab for input bfd */
unsigned int *conversion_table;
file_ptr sym_filepos;
long symbol_index_slew; /* used during read to mark whether a
C_FILE symbol as been added. */
struct syment *raw_syments;
struct lineno *raw_linenos;
unsigned int raw_syment_count;
char *string_table;
1991-04-24 01:02:09 +09:00
unsigned short flags;
1991-03-22 05:11:25 +08:00
/* These are only valid once writing has begun */
long int relocbase;
1991-04-24 01:02:09 +09:00
} coff_data_type;
1991-03-22 05:11:25 +08:00
/* We take the address of the first element of a asymbol to ensure that the
1991-03-22 05:11:25 +08:00
* macro is only ever applied to an asymbol. */
#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
/* Generic COFF swapping routines -- also used by GDB. */
PROTO (void, bfd_coff_swap_sym, (bfd *, SYMENT *));
PROTO (void, bfd_coff_swap_aux, (bfd *, AUXENT *, int, int));
PROTO (void, bfd_coff_swap_lineno, (bfd *, LINENO *));