1991-07-31 16:58:05 +00:00
|
|
|
/* BFD COFF object file private structure.
|
|
|
|
Copyright (C) 1990-1991 Free Software Foundation, Inc.
|
|
|
|
Written by Cygnus Support.
|
1991-03-21 21:11:25 +00:00
|
|
|
|
1991-07-31 16:58:05 +00:00
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
1991-03-21 21:11:25 +00:00
|
|
|
|
1991-07-31 16:58:05 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
1991-03-21 21:11:25 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
1991-07-31 16:58:05 +00:00
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1991-03-21 21:11:25 +00:00
|
|
|
|
1991-07-31 16:58:05 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
1991-03-21 21:11:25 +00:00
|
|
|
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
|
1991-07-31 16:58:05 +00:00
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
1991-03-21 21:11:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Object file tdata; access macros */
|
|
|
|
|
1991-11-27 16:56:08 +00:00
|
|
|
#define coff_data(bfd) ((coff_data_type *) ((bfd)->tdata))
|
|
|
|
#define exec_hdr(bfd) (coff_data(bfd)->hdr)
|
|
|
|
#define obj_symbols(bfd) (coff_data(bfd)->symbols)
|
|
|
|
#define obj_sym_filepos(bfd) (coff_data(bfd)->sym_filepos)
|
1991-07-31 16:58:05 +00:00
|
|
|
|
1991-11-27 16:56:08 +00:00
|
|
|
#define obj_relocbase(bfd) (coff_data(bfd)->relocbase)
|
|
|
|
#define obj_raw_syments(bfd) (coff_data(bfd)->raw_syments)
|
|
|
|
#define obj_convert(bfd) (coff_data(bfd)->conversion_table)
|
1991-12-01 00:39:12 +00:00
|
|
|
#if CFILE_STUFF
|
|
|
|
#define obj_symbol_slew(bfd) (coff_data(bfd)->symbol_index_slew)
|
|
|
|
#else
|
|
|
|
#define obj_symbol_slew(bfd) 0
|
|
|
|
#endif
|
|
|
|
|
1991-03-21 21:11:25 +00:00
|
|
|
|
1991-11-27 16:56:08 +00:00
|
|
|
/* `Tdata' information kept for COFF files. */
|
1991-07-31 16:58:05 +00:00
|
|
|
|
1991-11-27 16:56:08 +00:00
|
|
|
typedef struct coff_tdata
|
|
|
|
{
|
|
|
|
struct coff_symbol_struct *symbols; /* symtab for input bfd */
|
1991-03-21 21:11:25 +00:00
|
|
|
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. */
|
|
|
|
|
1991-11-27 16:56:08 +00:00
|
|
|
struct coff_ptr_struct *raw_syments;
|
1991-03-21 21:11:25 +00:00
|
|
|
struct lineno *raw_linenos;
|
|
|
|
unsigned int raw_syment_count;
|
1991-04-23 16:02:09 +00:00
|
|
|
unsigned short flags;
|
1991-11-27 16:56:08 +00:00
|
|
|
|
1991-03-21 21:11:25 +00:00
|
|
|
/* These are only valid once writing has begun */
|
|
|
|
long int relocbase;
|
1991-11-27 16:56:08 +00:00
|
|
|
|
|
|
|
/* These members communicate important constants about the symbol table
|
|
|
|
to GDB's symbol-reading code. These `constants' unfortunately vary
|
|
|
|
from coff implementation to implementation... */
|
|
|
|
unsigned local_n_btmask;
|
|
|
|
unsigned local_n_btshft;
|
|
|
|
unsigned local_n_tmask;
|
|
|
|
unsigned local_n_tshift;
|
|
|
|
unsigned local_symesz;
|
|
|
|
unsigned local_auxesz;
|
|
|
|
unsigned local_linesz;
|
1991-04-23 16:02:09 +00:00
|
|
|
} coff_data_type;
|
1991-03-21 21:11:25 +00:00
|
|
|
|
1991-05-02 04:11:40 +00:00
|
|
|
/* We take the address of the first element of a asymbol to ensure that the
|
1991-03-21 21:11:25 +00:00
|
|
|
* macro is only ever applied to an asymbol. */
|
|
|
|
#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
|
1991-05-02 04:11:40 +00:00
|
|
|
|
|
|
|
|
1991-07-31 16:58:05 +00:00
|
|
|
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
/* And more taken from the source .. */
|
1991-07-31 16:58:05 +00:00
|
|
|
|
1991-12-01 00:39:12 +00:00
|
|
|
{
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
|
|
|
|
/* Remembers the offset from the first symbol in the file for
|
|
|
|
this symbol. Generated by coff_renumber_symbols. */
|
1991-12-01 00:39:12 +00:00
|
|
|
unsigned int offset;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
|
|
|
|
/* Should the tag field of this symbol be renumbered.
|
|
|
|
Created by coff_pointerize_aux. */
|
1991-12-01 00:39:12 +00:00
|
|
|
char fix_tag;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
|
|
|
|
/* Should the endidx field of this symbol be renumbered.
|
|
|
|
Created by coff_pointerize_aux. */
|
1991-12-01 00:39:12 +00:00
|
|
|
char fix_end;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
|
|
|
|
/* The container for the symbol structure as read and translated
|
|
|
|
from the file. */
|
|
|
|
|
1991-12-01 00:39:12 +00:00
|
|
|
union {
|
|
|
|
union internal_auxent auxent;
|
|
|
|
struct internal_syment syment;
|
|
|
|
} u;
|
|
|
|
} combined_entry_type;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Each canonical asymbol really looks like this: */
|
|
|
|
|
1991-12-01 00:39:12 +00:00
|
|
|
typedef struct coff_symbol_struct
|
|
|
|
{
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
/* The actual symbol which the rest of BFD works with */
|
1991-12-01 00:39:12 +00:00
|
|
|
asymbol symbol;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
|
|
|
|
/* A pointer to the hidden information for this symbol */
|
1991-12-01 00:39:12 +00:00
|
|
|
combined_entry_type *native;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
|
|
|
|
/* A pointer to the linenumber information for this symbol */
|
1991-12-01 00:39:12 +00:00
|
|
|
struct lineno_cache_entry *lineno;
|
1991-08-17 00:17:15 +00:00
|
|
|
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 00:56:56 +00:00
|
|
|
} coff_symbol_type;
|