Tidy up formatting in bfd-in2.h

This commit is contained in:
Nick Clifton 2002-01-30 18:12:17 +00:00
parent 6eb69eab29
commit b5f79c764c
9 changed files with 784 additions and 788 deletions

View file

@ -1,3 +1,18 @@
2002-01-30 Nick Clifton <nickc@cambridge.redhat.com>
* doc/proto.str (ENUMDOC): Place two spaces between the end of
the text and the closing comment marker.
* archures.c: Tidy up formatting of embedded comments.
* bfd.c: Tidy up formatting of embedded comments.
* bfd-in.h: Fix formatting of comments.
* reloc.c: Tidy up formatting of ordinary & embedded comments.
* section.c: Tidy up formatting of embedded comments.
* syms.c: Tidy up formatting of embedded comments.
* targets.c: Tidy up formatting of embedded comments.
* bfd-in2.h: Regenerate.
2002-01-30 Nick Clifton <nickc@cambridge.redhat.com>
* vms-tir.c (cmd_name): New function.

View file

@ -1,6 +1,6 @@
/* Main header file for the bfd library -- portable access to object files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by Cygnus Support.
@ -71,7 +71,7 @@ extern "C" {
#endif
#endif
/* forward declaration */
/* Forward declaration. */
typedef struct _bfd bfd;
/* To squelch erroneous compiler warnings ("illegal pointer
@ -191,15 +191,17 @@ extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma));
typedef unsigned int flagword; /* 32 bits of flags */
typedef unsigned char bfd_byte;
/** File formats */
/* File formats. */
typedef enum bfd_format {
bfd_unknown = 0, /* file format is unknown */
bfd_object, /* linker/assember/compiler output */
bfd_archive, /* object archive file */
bfd_core, /* core dump */
bfd_type_end} /* marks the end; don't use it! */
bfd_format;
typedef enum bfd_format
{
bfd_unknown = 0, /* File format is unknown. */
bfd_object, /* Linker/assember/compiler output. */
bfd_archive, /* Object archive file. */
bfd_core, /* Core dump. */
bfd_type_end /* Marks the end; don't use it! */
}
bfd_format;
/* Values that may appear in the flags field of a BFD. These also
appear in the object_flags field of the bfd_target structure, where
@ -258,7 +260,7 @@ typedef enum bfd_format {
memory. If this is set, iostream points to a bfd_in_memory struct. */
#define BFD_IN_MEMORY 0x800
/* symbols and relocation */
/* Symbols and relocation. */
/* A count of carsyms (canonical archive symbols). */
typedef unsigned long symindex;
@ -282,33 +284,40 @@ typedef const struct reloc_howto_struct reloc_howto_type;
#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
/* A canonical archive symbol. */
/* This is a type pun with struct ranlib on purpose! */
typedef struct carsym {
/* This is a type pun with struct ranlib on purpose! */
typedef struct carsym
{
char *name;
file_ptr file_offset; /* look here to find the file */
} carsym; /* to make these you call a carsymogen */
file_ptr file_offset; /* Look here to find the file. */
}
carsym; /* To make these you call a carsymogen. */
/* Used in generating armaps (archive tables of contents).
Perhaps just a forward definition would do? */
struct orl { /* output ranlib */
char **name; /* symbol name */
union {
Perhaps just a forward definition would do? */
struct orl /* Output ranlib. */
{
char **name; /* Symbol name. */
union
{
file_ptr pos;
bfd *abfd;
} u; /* bfd* or file position */
int namidx; /* index into string table */
} u; /* bfd* or file position. */
int namidx; /* Index into string table. */
};
/* Linenumber stuff */
typedef struct lineno_cache_entry {
unsigned int line_number; /* Linenumber from start of function*/
union {
struct symbol_cache_entry *sym; /* Function name */
bfd_vma offset; /* Offset into section */
/* Linenumber stuff. */
typedef struct lineno_cache_entry
{
unsigned int line_number; /* Linenumber from start of function. */
union
{
struct symbol_cache_entry *sym; /* Function name. */
bfd_vma offset; /* Offset into section. */
} u;
} alent;
}
alent;
/* object and core file sections */
/* Object and core file sections. */
#define align_power(addr, align) \
( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
@ -447,7 +456,7 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
/* User program access to BFD facilities */
/* User program access to BFD facilities. */
/* Direct I/O routines, for programs which know more about the object
file than BFD does. Use higher level routines if possible. */
@ -691,7 +700,8 @@ extern boolean bfd_sparclinux_size_dynamic_sections
struct _bfd_window_internal;
typedef struct _bfd_window_internal bfd_window_internal;
typedef struct _bfd_window {
typedef struct _bfd_window
{
/* What the user asked for. */
PTR data;
bfd_size_type size;
@ -702,7 +712,8 @@ typedef struct _bfd_window {
application; don't want to give the same region back when the
application wants two writable copies! */
struct _bfd_window_internal *i;
} bfd_window;
}
bfd_window;
extern void bfd_init_window PARAMS ((bfd_window *));
extern void bfd_free_window PARAMS ((bfd_window *));

File diff suppressed because it is too large Load diff

195
bfd/bfd.c
View file

@ -1,6 +1,6 @@
/* Generic BFD library interface and support routines.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -36,127 +36,118 @@ CODE_FRAGMENT
.
.struct _bfd
.{
. {* The filename the application opened the BFD with. *}
. const char *filename;
. {* The filename the application opened the BFD with. *}
. const char *filename;
.
. {* A pointer to the target jump table. *}
. const struct bfd_target *xvec;
. {* A pointer to the target jump table. *}
. const struct bfd_target *xvec;
.
. {* To avoid dragging too many header files into every file that
. includes `<<bfd.h>>', IOSTREAM has been declared as a "char
. *", and MTIME as a "long". Their correct types, to which they
. are cast when used, are "FILE *" and "time_t". The iostream
. is the result of an fopen on the filename. However, if the
. BFD_IN_MEMORY flag is set, then iostream is actually a pointer
. to a bfd_in_memory struct. *}
. PTR iostream;
. {* To avoid dragging too many header files into every file that
. includes `<<bfd.h>>', IOSTREAM has been declared as a "char *",
. and MTIME as a "long". Their correct types, to which they
. are cast when used, are "FILE *" and "time_t". The iostream
. is the result of an fopen on the filename. However, if the
. BFD_IN_MEMORY flag is set, then iostream is actually a pointer
. to a bfd_in_memory struct. *}
. PTR iostream;
.
. {* Is the file descriptor being cached? That is, can it be closed as
. needed, and re-opened when accessed later? *}
. {* Is the file descriptor being cached? That is, can it be closed as
. needed, and re-opened when accessed later? *}
. boolean cacheable;
.
. boolean cacheable;
. {* Marks whether there was a default target specified when the
. BFD was opened. This is used to select which matching algorithm
. to use to choose the back end. *}
. boolean target_defaulted;
.
. {* Marks whether there was a default target specified when the
. BFD was opened. This is used to select which matching algorithm
. to use to choose the back end. *}
. {* The caching routines use these to maintain a
. least-recently-used list of BFDs. *}
. struct _bfd *lru_prev, *lru_next;
.
. boolean target_defaulted;
. {* When a file is closed by the caching routines, BFD retains
. state information on the file here... *}
. ufile_ptr where;
.
. {* The caching routines use these to maintain a
. least-recently-used list of BFDs *}
. {* ... and here: (``once'' means at least once). *}
. boolean opened_once;
.
. struct _bfd *lru_prev, *lru_next;
. {* Set if we have a locally maintained mtime value, rather than
. getting it from the file each time. *}
. boolean mtime_set;
.
. {* When a file is closed by the caching routines, BFD retains
. state information on the file here: *}
. {* File modified time, if mtime_set is true. *}
. long mtime;
.
. ufile_ptr where;
. {* Reserved for an unimplemented file locking extension. *}
. int ifd;
.
. {* and here: (``once'' means at least once) *}
. {* The format which belongs to the BFD. (object, core, etc.) *}
. bfd_format format;
.
. boolean opened_once;
. {* The direction with which the BFD was opened. *}
. enum bfd_direction
. {
. no_direction = 0,
. read_direction = 1,
. write_direction = 2,
. both_direction = 3
. }
. direction;
.
. {* Set if we have a locally maintained mtime value, rather than
. getting it from the file each time: *}
. {* Format_specific flags. *}
. flagword flags;
.
. boolean mtime_set;
. {* Currently my_archive is tested before adding origin to
. anything. I believe that this can become always an add of
. origin, with origin set to 0 for non archive files. *}
. ufile_ptr origin;
.
. {* File modified time, if mtime_set is true: *}
. {* Remember when output has begun, to stop strange things
. from happening. *}
. boolean output_has_begun;
.
. long mtime;
. {* A hash table for section names. *}
. struct bfd_hash_table section_htab;
.
. {* Reserved for an unimplemented file locking extension.*}
. {* Pointer to linked list of sections. *}
. struct sec *sections;
.
. int ifd;
. {* The place where we add to the section list. *}
. struct sec **section_tail;
.
. {* The format which belongs to the BFD. (object, core, etc.) *}
. {* The number of sections. *}
. unsigned int section_count;
.
. bfd_format format;
. {* Stuff only useful for object files:
. The start address. *}
. bfd_vma start_address;
.
. {* The direction the BFD was opened with*}
. {* Used for input and output. *}
. unsigned int symcount;
.
. enum bfd_direction {no_direction = 0,
. read_direction = 1,
. write_direction = 2,
. both_direction = 3} direction;
. {* Symbol table for output BFD (with symcount entries). *}
. struct symbol_cache_entry **outsymbols;
.
. {* Format_specific flags*}
. {* Pointer to structure which contains architecture information. *}
. const struct bfd_arch_info *arch_info;
.
. flagword flags;
. {* Stuff only useful for archives. *}
. PTR arelt_data;
. struct _bfd *my_archive; {* The containing archive BFD. *}
. struct _bfd *next; {* The next BFD in the archive. *}
. struct _bfd *archive_head; {* The first BFD in the archive. *}
. boolean has_armap;
.
. {* Currently my_archive is tested before adding origin to
. anything. I believe that this can become always an add of
. origin, with origin set to 0 for non archive files. *}
. {* A chain of BFD structures involved in a link. *}
. struct _bfd *link_next;
.
. ufile_ptr origin;
. {* A field used by _bfd_generic_link_add_archive_symbols. This will
. be used only for archive elements. *}
. int archive_pass;
.
. {* Remember when output has begun, to stop strange things
. from happening. *}
. boolean output_has_begun;
.
. {* A hash table for section names. *}
. struct bfd_hash_table section_htab;
.
. {* Pointer to linked list of sections. *}
. struct sec *sections;
.
. {* The place where we add to the section list. *}
. struct sec **section_tail;
.
. {* The number of sections *}
. unsigned int section_count;
.
. {* Stuff only useful for object files:
. The start address. *}
. bfd_vma start_address;
.
. {* Used for input and output*}
. unsigned int symcount;
.
. {* Symbol table for output BFD (with symcount entries) *}
. struct symbol_cache_entry **outsymbols;
.
. {* Pointer to structure which contains architecture information*}
. const struct bfd_arch_info *arch_info;
.
. {* Stuff only useful for archives:*}
. PTR arelt_data;
. struct _bfd *my_archive; {* The containing archive BFD. *}
. struct _bfd *next; {* The next BFD in the archive. *}
. struct _bfd *archive_head; {* The first BFD in the archive. *}
. boolean has_armap;
.
. {* A chain of BFD structures involved in a link. *}
. struct _bfd *link_next;
.
. {* A field used by _bfd_generic_link_add_archive_symbols. This will
. be used only for archive elements. *}
. int archive_pass;
.
. {* Used by the back end to hold private data. *}
.
. union
. {
. {* Used by the back end to hold private data. *}
. union
. {
. struct aout_data_struct *aout_data;
. struct artdata *aout_ar_data;
. struct _oasys_data *oasys_obj_data;
@ -187,15 +178,16 @@ CODE_FRAGMENT
. struct versados_data_struct *versados_data;
. struct netbsd_core_struct *netbsd_core_data;
. PTR any;
. } tdata;
. }
. tdata;
.
. {* Used by the application to hold private data*}
. PTR usrdata;
. {* Used by the application to hold private data. *}
. PTR usrdata;
.
. {* Where all the allocated stuff under this BFD goes. This is a
. struct objalloc *, but we use PTR to avoid requiring the inclusion of
. objalloc.h. *}
. PTR memory;
. PTR memory;
.};
.
*/
@ -270,7 +262,8 @@ CODE_FRAGMENT
. bfd_error_file_truncated,
. bfd_error_file_too_big,
. bfd_error_invalid_error_code
.} bfd_error_type;
.}
.bfd_error_type;
.
*/
@ -632,7 +625,7 @@ FUNCTION
SYNOPSIS
void bfd_set_reloc
(bfd *abfd, asection *sec, arelent **rel, unsigned int count)
(bfd *abfd, asection *sec, arelent **rel, unsigned int count);
DESCRIPTION
Set the relocation pointer and count within

View file

@ -114,7 +114,7 @@
skip_past_newline
get_stuff_in_command
strip_trailing_newlines
"\n{* " swap catstr " *}\n" catstr
"\n{* " swap catstr " *}\n" catstr
translatecomments
- discard it if we're doing internal mode
"" swap 0 internalmode maybecatstr

View file

@ -65,25 +65,25 @@ CODE_FRAGMENT
.
.typedef enum bfd_reloc_status
.{
. {* No errors detected *}
. {* No errors detected. *}
. bfd_reloc_ok,
.
. {* The relocation was performed, but there was an overflow. *}
. {* The relocation was performed, but there was an overflow. *}
. bfd_reloc_overflow,
.
. {* The address to relocate was not within the section supplied. *}
. {* The address to relocate was not within the section supplied. *}
. bfd_reloc_outofrange,
.
. {* Used by special functions *}
. {* Used by special functions. *}
. bfd_reloc_continue,
.
. {* Unsupported relocation size requested. *}
. {* Unsupported relocation size requested. *}
. bfd_reloc_notsupported,
.
. {* Unused *}
. {* Unused. *}
. bfd_reloc_other,
.
. {* The symbol to relocate against was undefined. *}
. {* The symbol to relocate against was undefined. *}
. bfd_reloc_undefined,
.
. {* The relocation was performed, but may not be ok - presently
@ -97,20 +97,21 @@ CODE_FRAGMENT
.
.typedef struct reloc_cache_entry
.{
. {* A pointer into the canonical table of pointers *}
. {* A pointer into the canonical table of pointers. *}
. struct symbol_cache_entry **sym_ptr_ptr;
.
. {* offset in section *}
. {* offset in section. *}
. bfd_size_type address;
.
. {* addend for relocation value *}
. {* addend for relocation value. *}
. bfd_vma addend;
.
. {* Pointer to how to perform the required relocation *}
. {* Pointer to how to perform the required relocation. *}
. reloc_howto_type *howto;
.
.} arelent;
.}
.arelent;
.
*/
/*
@ -250,19 +251,19 @@ CODE_FRAGMENT
.
.enum complain_overflow
.{
. {* Do not complain on overflow. *}
. {* Do not complain on overflow. *}
. complain_overflow_dont,
.
. {* Complain if the bitfield overflows, whether it is considered
. as signed or unsigned. *}
. as signed or unsigned. *}
. complain_overflow_bitfield,
.
. {* Complain if the value overflows when considered as signed
. number. *}
. number. *}
. complain_overflow_signed,
.
. {* Complain if the value overflows when considered as an
. unsigned number. *}
. unsigned number. *}
. complain_overflow_unsigned
.};
@ -276,7 +277,7 @@ SUBSUBSECTION
information that libbfd needs to know to tie up a back end's data.
CODE_FRAGMENT
.struct symbol_cache_entry; {* Forward declaration *}
.struct symbol_cache_entry; {* Forward declaration. *}
.
.struct reloc_howto_struct
.{
@ -366,7 +367,7 @@ CODE_FRAGMENT
. empty (e.g., m88k bcs); this flag signals the fact. *}
. boolean pcrel_offset;
.};
.
*/
/*
@ -413,7 +414,7 @@ DESCRIPTION
. } \
. } \
. }
.
*/
/*
@ -457,8 +458,9 @@ DESCRIPTION
.{
. arelent relent;
. struct relent_chain *next;
.} arelent_chain;
.}
.arelent_chain;
.
*/
/* N_ONES produces N one bits, without overflowing machine arithmetic. */
@ -819,11 +821,9 @@ space consuming. For each target:
bfd_arch_bits_per_address (abfd),
relocation);
/*
Either we are relocating all the way, or we don't want to apply
the relocation to the reloc entry (probably because there isn't
any room in the output format to describe addends to relocs)
*/
/* Either we are relocating all the way, or we don't want to apply
the relocation to the reloc entry (probably because there isn't
any room in the output format to describe addends to relocs). */
/* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
(OSF version 1.3, compiler version 3.11). It miscompiles the
@ -850,11 +850,10 @@ space consuming. For each target:
relocation >>= (bfd_vma) howto->rightshift;
/* Shift everything up to where it's going to be used */
/* Shift everything up to where it's going to be used. */
relocation <<= (bfd_vma) howto->bitpos;
/* Wait for the day when all have the mask in them */
/* Wait for the day when all have the mask in them. */
/* What we do:
i instruction to be left alone
@ -975,7 +974,6 @@ DESCRIPTION
For now, this function should be considered reserved for the
assembler.
*/
bfd_reloc_status_type
@ -1105,7 +1103,6 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
If we've relocated with a symbol with a section, change
into a ref to the section belonging to the symbol. */
reloc_entry->address += input_section->output_offset;
/* WTF?? */
@ -1181,8 +1178,7 @@ space consuming. For each target:
6) if the resulting object files are the same, you have at least
made it no worse
7) if they are different you have to figure out which version is
right
*/
right. */
relocation -= reloc_entry->addend;
#endif
reloc_entry->addend = 0;
@ -1207,11 +1203,9 @@ space consuming. For each target:
bfd_arch_bits_per_address (abfd),
relocation);
/*
Either we are relocating all the way, or we don't want to apply
the relocation to the reloc entry (probably because there isn't
any room in the output format to describe addends to relocs)
*/
/* Either we are relocating all the way, or we don't want to apply
the relocation to the reloc entry (probably because there isn't
any room in the output format to describe addends to relocs). */
/* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
(OSF version 1.3, compiler version 3.11). It miscompiles the
@ -1238,11 +1232,10 @@ space consuming. For each target:
relocation >>= (bfd_vma) howto->rightshift;
/* Shift everything up to where it's going to be used */
/* Shift everything up to where it's going to be used. */
relocation <<= (bfd_vma) howto->bitpos;
/* Wait for the day when all have the mask in them */
/* Wait for the day when all have the mask in them. */
/* What we do:
i instruction to be left alone
@ -3374,7 +3367,6 @@ DESCRIPTION
don't do relaxing -- i.e., does nothing.
*/
/*ARGSUSED*/
boolean
bfd_generic_relax_section (abfd, section, link_info, again)
bfd *abfd ATTRIBUTE_UNUSED;
@ -3399,7 +3391,6 @@ DESCRIPTION
don't do section gc -- i.e., does nothing.
*/
/*ARGSUSED*/
boolean
bfd_generic_gc_sections (abfd, link_info)
bfd *abfd ATTRIBUTE_UNUSED;
@ -3421,7 +3412,6 @@ DESCRIPTION
which don't have SEC_MERGE support -- i.e., does nothing.
*/
/*ARGSUSED*/
boolean
bfd_generic_merge_sections (abfd, link_info)
bfd *abfd ATTRIBUTE_UNUSED;
@ -3459,7 +3449,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
boolean relocateable;
asymbol **symbols;
{
/* Get enough memory to hold the stuff */
/* Get enough memory to hold the stuff. */
bfd *input_bfd = link_order->u.indirect.section->owner;
asection *input_section = link_order->u.indirect.section;
@ -3474,7 +3464,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
if (reloc_vector == NULL && reloc_size != 0)
goto error_return;
/* read in the section */
/* Read in the section. */
if (!bfd_get_section_contents (input_bfd,
input_section,
(PTR) data,
@ -3482,7 +3472,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
input_section->_raw_size))
goto error_return;
/* We're not relaxing the section, so just copy the size info */
/* We're not relaxing the section, so just copy the size info. */
input_section->_cooked_size = input_section->_raw_size;
input_section->reloc_done = true;
@ -3512,7 +3502,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
{
asection *os = input_section->output_section;
/* A partial link, so keep the relocs */
/* A partial link, so keep the relocs. */
os->orelocation[os->reloc_count] = *parent;
os->reloc_count++;
}

View file

@ -170,25 +170,20 @@ CODE_FRAGMENT
.{
. {* The name of the section; the name isn't a copy, the pointer is
. the same as that passed to bfd_make_section. *}
.
. const char *name;
.
. {* A unique sequence number. *}
.
. int id;
.
. {* Which section in the bfd; 0..n-1 as sections are created in a bfd. *}
.
. int index;
.
. {* The next section in the list belonging to the BFD, or NULL. *}
.
. struct sec *next;
.
. {* The field flags contains attributes of the section. Some
. flags are read in from the object file, and some are
. synthesized from other information. *}
.
. flagword flags;
.
.#define SEC_NO_FLAGS 0x000
@ -397,25 +392,21 @@ CODE_FRAGMENT
. backend can assign addresses (for example, in <<a.out>>, where
. the default address for <<.data>> is dependent on the specific
. target and various flags). *}
.
. bfd_vma vma;
.
. {* The load address of the section - where it would be in a
. rom image; really only used for writing section header
. information. *}
.
. information. *}
. bfd_vma lma;
.
. {* The size of the section in octets, as it will be output.
. Contains a value even if the section has no contents (e.g., the
. size of <<.bss>>). This will be filled in after relocation. *}
.
. bfd_size_type _cooked_size;
.
. {* The original size on disk of the section, in octets. Normally this
. value is the same as the size, but if some relaxing has
. been done, then this value will be bigger. *}
.
. bfd_size_type _raw_size;
.
. {* If this section is going to be output, then this value is the
@ -425,49 +416,39 @@ CODE_FRAGMENT
. 100th octet (8-bit quantity) in the output section, this value
. would be 100. However, if the target byte size is 16 bits
. (bfd_octets_per_byte is "2"), this value would be 50. *}
.
. bfd_vma output_offset;
.
. {* The output section through which to map on output. *}
.
. struct sec *output_section;
.
. {* The alignment requirement of the section, as an exponent of 2 -
. e.g., 3 aligns to 2^3 (or 8). *}
.
. unsigned int alignment_power;
.
. {* If an input section, a pointer to a vector of relocation
. records for the data in this section. *}
.
. struct reloc_cache_entry *relocation;
.
. {* If an output section, a pointer to a vector of pointers to
. relocation records for the data in this section. *}
.
. struct reloc_cache_entry **orelocation;
.
. {* The number of relocation records in one of the above *}
.
. {* The number of relocation records in one of the above. *}
. unsigned reloc_count;
.
. {* Information below is back end specific - and not always used
. or updated. *}
.
. {* File position of section data. *}
.
. file_ptr filepos;
.
. {* File position of relocation info. *}
.
. file_ptr rel_filepos;
.
. {* File position of line data. *}
.
. file_ptr line_filepos;
.
. {* Pointer to data for applications. *}
.
. PTR userdata;
.
. {* If the SEC_IN_MEMORY flag is set, this points to the actual
@ -475,48 +456,40 @@ CODE_FRAGMENT
. unsigned char *contents;
.
. {* Attached line number information. *}
.
. alent *lineno;
.
. {* Number of line number records. *}
.
. unsigned int lineno_count;
.
. {* Entity size for merging purposes. *}
.
. unsigned int entsize;
.
. {* Optional information about a COMDAT entry; NULL if not COMDAT. *}
.
. struct bfd_comdat_info *comdat;
.
. {* When a section is being output, this value changes as more
. linenumbers are written out. *}
.
. file_ptr moving_line_filepos;
.
. {* What the section number is in the target world. *}
.
. int target_index;
.
. PTR used_by_bfd;
.
. {* If this is a constructor section then here is a list of the
. relocations created to relocate items within it. *}
.
. struct relent_chain *constructor_chain;
.
. {* The BFD which owns the section. *}
.
. bfd *owner;
.
. {* A symbol which points at this section only *}
. {* A symbol which points at this section only. *}
. struct symbol_cache_entry *symbol;
. struct symbol_cache_entry **symbol_ptr_ptr;
.
. struct bfd_link_order *link_order_head;
. struct bfd_link_order *link_order_tail;
.} asection ;
.} asection;
.
.{* These sections are global, and are managed by BFD. The application
. and target back end are not permitted to change the values in
@ -528,18 +501,18 @@ CODE_FRAGMENT
.#define BFD_COM_SECTION_NAME "*COM*"
.#define BFD_IND_SECTION_NAME "*IND*"
.
.{* the absolute section *}
.{* The absolute section. *}
.extern const asection bfd_abs_section;
.#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
.#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
.{* Pointer to the undefined section *}
.{* Pointer to the undefined section. *}
.extern const asection bfd_und_section;
.#define bfd_und_section_ptr ((asection *) &bfd_und_section)
.#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
.{* Pointer to the common section *}
.{* Pointer to the common section. *}
.extern const asection bfd_com_section;
.#define bfd_com_section_ptr ((asection *) &bfd_com_section)
.{* Pointer to the indirect section *}
.{* Pointer to the indirect section. *}
.extern const asection bfd_ind_section;
.#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
.#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)

View file

@ -1,6 +1,6 @@
/* Generic symbol-table support for the BFD library.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001
2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -183,126 +183,125 @@ CODE_FRAGMENT
.
.typedef struct symbol_cache_entry
.{
. {* A pointer to the BFD which owns the symbol. This information
. is necessary so that a back end can work out what additional
. information (invisible to the application writer) is carried
. with the symbol.
. {* A pointer to the BFD which owns the symbol. This information
. is necessary so that a back end can work out what additional
. information (invisible to the application writer) is carried
. with the symbol.
.
. This field is *almost* redundant, since you can use section->owner
. instead, except that some symbols point to the global sections
. bfd_{abs,com,und}_section. This could be fixed by making
. these globals be per-bfd (or per-target-flavor). FIXME. *}
. This field is *almost* redundant, since you can use section->owner
. instead, except that some symbols point to the global sections
. bfd_{abs,com,und}_section. This could be fixed by making
. these globals be per-bfd (or per-target-flavor). FIXME. *}
. struct _bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *}
.
. struct _bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *}
.
. {* The text of the symbol. The name is left alone, and not copied; the
. application may not alter it. *}
. {* The text of the symbol. The name is left alone, and not copied; the
. application may not alter it. *}
. const char *name;
.
. {* The value of the symbol. This really should be a union of a
. numeric value with a pointer, since some flags indicate that
. a pointer to another symbol is stored here. *}
. {* The value of the symbol. This really should be a union of a
. numeric value with a pointer, since some flags indicate that
. a pointer to another symbol is stored here. *}
. symvalue value;
.
. {* Attributes of a symbol: *}
.
. {* Attributes of a symbol. *}
.#define BSF_NO_FLAGS 0x00
.
. {* The symbol has local scope; <<static>> in <<C>>. The value
. is the offset into the section of the data. *}
. {* The symbol has local scope; <<static>> in <<C>>. The value
. is the offset into the section of the data. *}
.#define BSF_LOCAL 0x01
.
. {* The symbol has global scope; initialized data in <<C>>. The
. value is the offset into the section of the data. *}
. {* The symbol has global scope; initialized data in <<C>>. The
. value is the offset into the section of the data. *}
.#define BSF_GLOBAL 0x02
.
. {* The symbol has global scope and is exported. The value is
. the offset into the section of the data. *}
.#define BSF_EXPORT BSF_GLOBAL {* no real difference *}
. {* The symbol has global scope and is exported. The value is
. the offset into the section of the data. *}
.#define BSF_EXPORT BSF_GLOBAL {* No real difference. *}
.
. {* A normal C symbol would be one of:
. <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
. <<BSF_GLOBAL>> *}
. {* A normal C symbol would be one of:
. <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
. <<BSF_GLOBAL>>. *}
.
. {* The symbol is a debugging record. The value has an arbitary
. meaning, unless BSF_DEBUGGING_RELOC is also set. *}
. {* The symbol is a debugging record. The value has an arbitary
. meaning, unless BSF_DEBUGGING_RELOC is also set. *}
.#define BSF_DEBUGGING 0x08
.
. {* The symbol denotes a function entry point. Used in ELF,
. perhaps others someday. *}
. {* The symbol denotes a function entry point. Used in ELF,
. perhaps others someday. *}
.#define BSF_FUNCTION 0x10
.
. {* Used by the linker. *}
. {* Used by the linker. *}
.#define BSF_KEEP 0x20
.#define BSF_KEEP_G 0x40
.
. {* A weak global symbol, overridable without warnings by
. a regular global symbol of the same name. *}
. {* A weak global symbol, overridable without warnings by
. a regular global symbol of the same name. *}
.#define BSF_WEAK 0x80
.
. {* This symbol was created to point to a section, e.g. ELF's
. STT_SECTION symbols. *}
. {* This symbol was created to point to a section, e.g. ELF's
. STT_SECTION symbols. *}
.#define BSF_SECTION_SYM 0x100
.
. {* The symbol used to be a common symbol, but now it is
. allocated. *}
. {* The symbol used to be a common symbol, but now it is
. allocated. *}
.#define BSF_OLD_COMMON 0x200
.
. {* The default value for common data. *}
. {* The default value for common data. *}
.#define BFD_FORT_COMM_DEFAULT_VALUE 0
.
. {* In some files the type of a symbol sometimes alters its
. location in an output file - ie in coff a <<ISFCN>> symbol
. which is also <<C_EXT>> symbol appears where it was
. declared and not at the end of a section. This bit is set
. by the target BFD part to convey this information. *}
.
. {* In some files the type of a symbol sometimes alters its
. location in an output file - ie in coff a <<ISFCN>> symbol
. which is also <<C_EXT>> symbol appears where it was
. declared and not at the end of a section. This bit is set
. by the target BFD part to convey this information. *}
.#define BSF_NOT_AT_END 0x400
.
. {* Signal that the symbol is the label of constructor section. *}
. {* Signal that the symbol is the label of constructor section. *}
.#define BSF_CONSTRUCTOR 0x800
.
. {* Signal that the symbol is a warning symbol. The name is a
. warning. The name of the next symbol is the one to warn about;
. if a reference is made to a symbol with the same name as the next
. symbol, a warning is issued by the linker. *}
. {* Signal that the symbol is a warning symbol. The name is a
. warning. The name of the next symbol is the one to warn about;
. if a reference is made to a symbol with the same name as the next
. symbol, a warning is issued by the linker. *}
.#define BSF_WARNING 0x1000
.
. {* Signal that the symbol is indirect. This symbol is an indirect
. pointer to the symbol with the same name as the next symbol. *}
. {* Signal that the symbol is indirect. This symbol is an indirect
. pointer to the symbol with the same name as the next symbol. *}
.#define BSF_INDIRECT 0x2000
.
. {* BSF_FILE marks symbols that contain a file name. This is used
. for ELF STT_FILE symbols. *}
. {* BSF_FILE marks symbols that contain a file name. This is used
. for ELF STT_FILE symbols. *}
.#define BSF_FILE 0x4000
.
. {* Symbol is from dynamic linking information. *}
. {* Symbol is from dynamic linking information. *}
.#define BSF_DYNAMIC 0x8000
.
. {* The symbol denotes a data object. Used in ELF, and perhaps
. others someday. *}
. {* The symbol denotes a data object. Used in ELF, and perhaps
. others someday. *}
.#define BSF_OBJECT 0x10000
.
. {* This symbol is a debugging symbol. The value is the offset
. into the section of the data. BSF_DEBUGGING should be set
. as well. *}
. {* This symbol is a debugging symbol. The value is the offset
. into the section of the data. BSF_DEBUGGING should be set
. as well. *}
.#define BSF_DEBUGGING_RELOC 0x20000
.
. flagword flags;
.
. {* A pointer to the section to which this symbol is
. relative. This will always be non NULL, there are special
. sections for undefined and absolute symbols. *}
. {* A pointer to the section to which this symbol is
. relative. This will always be non NULL, there are special
. sections for undefined and absolute symbols. *}
. struct sec *section;
.
. {* Back end special data. *}
. {* Back end special data. *}
. union
. {
. PTR p;
. bfd_vma i;
. } udata;
. }
. udata;
.}
.asymbol;
.
.} asymbol;
*/
#include "bfd.h"
@ -335,7 +334,7 @@ DESCRIPTION
.#define bfd_get_symtab_upper_bound(abfd) \
. BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
.
*/
/*
@ -380,6 +379,7 @@ DESCRIPTION
.#define bfd_is_local_label_name(abfd, name) \
. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
.
*/
/*
@ -396,7 +396,7 @@ DESCRIPTION
.#define bfd_canonicalize_symtab(abfd, location) \
. BFD_SEND (abfd, _bfd_canonicalize_symtab,\
. (abfd, location))
.
*/
/*
@ -492,6 +492,7 @@ DESCRIPTION
.#define bfd_make_empty_symbol(abfd) \
. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
.
*/
/*
@ -530,6 +531,7 @@ DESCRIPTION
.#define bfd_make_debug_symbol(abfd,ptr,size) \
. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
.
*/
struct section_to_type
@ -716,7 +718,7 @@ DESCRIPTION
.#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
. (ibfd, isymbol, obfd, osymbol))
.
*/
/* The generic version of the function which returns mini symbols.

View file

@ -125,7 +125,7 @@ DESCRIPTION
. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
. (bfd_assert (__FILE__,__LINE__), NULL))
.#endif
.
This is the structure which defines the type of BFD this is. The
<<xvec>> member of the struct <<bfd>> itself points here. Each
module that implements access to a different target under BFD,
@ -135,7 +135,8 @@ DESCRIPTION
the entry points which call them. Too bad we can't have one
macro to define them both!
.enum bfd_flavour {
.enum bfd_flavour
.{
. bfd_target_unknown_flavour,
. bfd_target_aout_flavour,
. bfd_target_coff_flavour,
@ -164,51 +165,40 @@ DESCRIPTION
.
.typedef struct bfd_target
.{
Identifies the kind of target, e.g., SunOS4, Ultrix, etc.
. {* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. *}
. char *name;
The "flavour" of a back end is a general indication about the contents
of a file.
.
. {* The "flavour" of a back end is a general indication about
. the contents of a file. *}
. enum bfd_flavour flavour;
The order of bytes within the data area of a file.
.
. {* The order of bytes within the data area of a file. *}
. enum bfd_endian byteorder;
The order of bytes within the header parts of a file.
.
. {* The order of bytes within the header parts of a file. *}
. enum bfd_endian header_byteorder;
A mask of all the flags which an executable may have set -
from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.
.
. {* A mask of all the flags which an executable may have set -
. from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. *}
. flagword object_flags;
A mask of all the flags which a section may have set - from
the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.
.
. {* A mask of all the flags which a section may have set - from
. the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. *}
. flagword section_flags;
The character normally found at the front of a symbol
(if any), perhaps `_'.
.
. {* The character normally found at the front of a symbol.
. (if any), perhaps `_'. *}
. char symbol_leading_char;
The pad character for file names within an archive header.
.
. {* The pad character for file names within an archive header. *}
. char ar_pad_char;
The maximum number of characters in an archive header.
.
. {* The maximum number of characters in an archive header. *}
. unsigned short ar_max_namelen;
Entries for byte swapping for data. These are different from the other
entry points, since they don't take a BFD asthe first argument.
Certain other handlers could do the same.
.
. {* Entries for byte swapping for data. These are different from the
. other entry points, since they don't take a BFD asthe first argument.
. Certain other handlers could do the same. *}
. bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
. void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
@ -218,9 +208,8 @@ Certain other handlers could do the same.
. bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
. void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
Byte swapping for the headers
.
. {* Byte swapping for the headers. *}
. bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
. void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
@ -230,25 +219,21 @@ Byte swapping for the headers
. bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
. void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
Format dependent routines: these are vectors of entry points
within the target vector structure, one for each format to check.
Check the format of a file being read. Return a <<bfd_target *>> or zero.
.
. {* Format dependent routines: these are vectors of entry points
. within the target vector structure, one for each format to check. *}
.
. {* Check the format of a file being read. Return a <<bfd_target *>> or zero. *}
. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
Set the format of a file being written.
.
. {* Set the format of a file being written. *}
. boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
Write cached information into a file being written, at <<bfd_close>>.
.
. {* Write cached information into a file being written, at <<bfd_close>>. *}
. boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
.
The general target vector. These vectors are initialized using the
BFD_JUMP_TABLE macros.
.
. {* Generic entry points. *}
Do not "beautify" the CONCAT* macro args. Traditional C will not
@ -295,10 +280,10 @@ the tokens.
. to another. *}
. boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
. bfd *, asymbol *));
. {* Called to set private backend flags *}
. {* Called to set private backend flags. *}
. boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
.
. {* Called to print private BFD data *}
. {* Called to print private BFD data. *}
. boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
.
. {* Core file entry points. *}
@ -448,7 +433,7 @@ the tokens.
.CONCAT2 (NAME,_canonicalize_dynamic_symtab), \
.CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \
.CONCAT2 (NAME,_canonicalize_dynamic_reloc)
. {* Get the amount of memory required to hold the dynamic symbols. *}
. {* Get the amount of memory required to hold the dynamic symbols. *}
. long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
. {* Read in the dynamic symbols. *}
. long (*_bfd_canonicalize_dynamic_symtab)
@ -466,17 +451,16 @@ and little endian code, and target chosen by the linker has the wrong
endianness. The function open_output() in ld/ldlang.c uses this field
to find an alternative output format that is suitable.
. {* Opposite endian version of this target. *}
. const struct bfd_target * alternative_target;
. {* Opposite endian version of this target. *}
. const struct bfd_target * alternative_target;
.
Data for use by back-end routines, which isn't generic enough to belong
in this structure.
. PTR backend_data;
. {* Data for use by back-end routines, which isn't
. generic enough to belong in this structure. *}
. PTR backend_data;
.
.} bfd_target;
.
*/
/* All known xvecs (even those that don't compile on all systems).