binutils-gdb/bfd/libcoff.h

162 lines
3.7 KiB
C
Raw Normal View History

/* BFD COFF object file private structure.
Copyright (C) 1990-1991 Free Software Foundation, Inc.
Written by Cygnus Support.
1991-03-22 05:11:25 +08:00
This file is part of BFD, the Binary File Descriptor library.
1991-03-22 05:11:25 +08:00
This program is free software; you can redistribute it and/or modify
1991-03-22 05:11:25 +08:00
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
1991-03-22 05:11:25 +08:00
This program is distributed in the hope that it will be useful,
1991-03-22 05:11:25 +08: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
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
1991-03-22 05:11:25 +08:00
/* $Id$ */
/* 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)
#if CFILE_STUFF
1991-03-22 05:11:25 +08:00
#define obj_symbol_slew(bfd) (obj_icof(bfd)->symbol_index_slew)
#else
#define obj_symbol_slew(bfd) 0
#endif
1991-03-22 05:11:25 +08:00
#define obj_string_table(bfd) (obj_icof(bfd)->string_table)
#if 0
typedef struct coff_ptr_struct
{
unsigned int offset;
char fix_tag;
char fix_end;
union {
union internal_auxent auxent;
struct internal_syment syment;
} u;
} combined_entry_type;
typedef struct
{
1991-03-22 05:11:25 +08:00
asymbol symbol;
combined_entry_type *native;
1991-03-22 05:11:25 +08:00
struct lineno_cache_entry *lineno;
} coff_symbol_type;
#endif
1991-03-22 05:11:25 +08:00
1991-04-24 01:02:09 +09:00
typedef struct icofdata
{
struct coff_symbol_struct *symbols; /* symtab for input bfd */
1991-03-22 05:11:25 +08: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. */
struct coff_ptr_struct *raw_syments;
1991-03-22 05:11:25 +08:00
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)))
1991-08-17 09:17:15 +09:00
/*THE FOLLOWING IS EXTRACTED FROM THE SOURCE*/
1991-08-17 09:17:15 +09:00
/* FROM coffcode.h*/
/* ------------------------------START FROM coffcode.h
1991-08-17 09:17:15 +09:00
The hidden information for an asymbol is:
*/
1991-08-17 09:17:15 +09:00
typedef struct coff_ptr_struct
{
1991-08-17 09:17:15 +09:00
/*
Remembers the offset from the first symbol in the file for this
symbol. Generated by @code{coff_renumber_symbols}.
*/
unsigned int offset;
1991-08-17 09:17:15 +09:00
/*
Should the tag field of this symbol be renumbered.
Created by @code{coff_pointerize_aux}.
*/
char fix_tag;
1991-08-17 09:17:15 +09:00
/*
Should the endidx field of this symbol be renumbered.
Created by @code{coff_pointerize_aux}.
*/
char fix_end;
1991-08-17 09:17:15 +09:00
/*
The container for the symbol structure as read and translated from the file.
*/
union {
union internal_auxent auxent;
struct internal_syment syment;
} u;
} combined_entry_type;
1991-08-17 09:17:15 +09:00
/*
1991-08-17 09:17:15 +09:00
Each canonical asymbol really looks like this:
*/
1991-08-17 09:17:15 +09:00
typedef struct coff_symbol_struct
{
1991-08-17 09:17:15 +09:00
/*
The actual symbol which the rest of bfd works with
*/
asymbol symbol;
1991-08-17 09:17:15 +09:00
/*
A pointer to the hidden information for this symbol
*/
combined_entry_type *native;
1991-08-17 09:17:15 +09:00
/*
A pointer to the linenumber information for this symbol
*/
struct lineno_cache_entry *lineno;
} coff_symbol_type;
1991-08-17 09:17:15 +09:00
/*
--------------------------------END FROM coffcode.h*/