* cofflink.c: New file.
* libcoff-in.h: Include bfdlink.h.
(obj_coff_external_syms, obj_coff_strings): Define accessor macro.
(obj_coff_sym_hashes): Define accessor macro.
(struct coff_tdata): Add fields external_syms, strings, and
sym_hashes.
(struct coff_link_hash_entry): Define.
(struct coff_link_hash_table): Define.
(coff_link_hash_lookup, coff_link_hash_traverse): Define.
(coff_hash_table): Define.
(_bfd_coff_link_hash_table_create): Declare.
(_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare.
* coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz,
_bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global,
_bfd_coff_compute_section_file_positions,
_bfd_coff_relocate_section.
(bfd_coff_relsz, bfd_coff_swap_reloc_in): Define.
(bfd_coff_sym_is_global): Define.
(bfd_coff_compute_section_file_positions): Define.
(bfd_coff_relocate_section): Define.
(coff_mkobject_hook): Initialize obj_raw_syment_count and
obj_conv_table_size.
(coff_compute_section_file_positions): Set target_index of all
sections. Set output_has_begun field.
(coff_write_object_contents): Don't set target_index; now done by
coff_compute_section_file_positions. Remove obsolete handling of
scn_base and data_base. Don't bother to check that target_index
is positive, since it always is. Remove use of pad, which is
always zero. Check obj_raw_syment_count, not bfd_get_symcount,
for the number of symbols, but only write them out if
bfd_get_symcount is non-zero.
(coff_slurp_symbol_table): Use obj_raw_syment_count, not
bfd_get_symcount for the number of symbols. Don't set
obj_conv_table_size.
(coff_sym_is_global): New static function or macro.
(coff_slurp_reloc_table): Call coff_swap_reloc_in, not
bfd_swap_reloc_in.
(coff_bfd_link_hash_table_create): If coff_relocate_section is
defined, define as _bfd_coff_link_hash_table_create.
(coff_bfd_link_add_symbols): Similar change.
(coff_bfd_final_link): Similar change.
(coff_relocate_section): Define as NULL if not defined.
(bfd_coff_std_swap_table): Initialize new fields.
* coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count
and obj_conv_table_size here.
(coff_count_linenumbers): Reindent. If bfd_get_symcount is zero,
add up the line numbers from the sections.
(coff_write_symbols): Don't set bfd_get_symcount.
(coff_pointerize_aux): Don't pointerize a nonpositive x_endndx
field.
(coff_get_normalized_symtab): Use obj_raw_syment_count, not
bfd_get_symcount.
(coff_print_symbol): If auxp->fix_end, print x_endndx value.
* coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in.
Reindent. Change argument type to PTR.
* coff-a29k.c (coff_a29k_relocate_section): New static function.
(coff_relocate_section): Define.
* configure.in (a29kcoff_big_vec): Compile cofflink.o.
* coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
* libcoff.h: Rebuilt.
* Makefile.in: Rebuilt dependencies.
(BFD32_BACKENDS): Add cofflink.o.
(CFILES): Add cofflink.c.
are recognized, chose section flags based on the name.
(bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add
name argument.
(bfd_coff_styp_to_sec_flags_hook): Add name argument.
(coff_compute_section_file_positions): Don't adjust the section
position by COFF_PAGE_SIZE unless SEC_ALLOC is set.
* libcoff.h: Rebuilt.
* coffgen.c (make_a_section_from_file): Pass section name to
bfd_coff_styp_to_sec_flags_hook.
* ecoff.c (_bfd_ecoff_styp_to_sec_flags): Add unused name
argument.
* libecoff.h (_bfd_ecoff_styp_to_sec_flags): Add name argument to
prototype.
fields to bitfields. Added fields fix_value and fix_scnlen.
(sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than
STYP_INFO for the type of a section named .debug.
(coff_add_missing_symbols): Don't define if RS6000COFF_C.
(coff_write_object_contents): If RS6000COFF_C, don't call
coff_add_missing_symbols.
(coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux
entry has type STY_LD change the x_scnlen into a pointer to a
symbol and set fix_scnlen. Also, for a C_BSTAT symbol, change the
value into a pointer to a symbol and set fix_value.
* libcoff.h: Rebuilt.
* coffgen.c (coff_mangle_symbols): Reindent. If fix_value is set,
get the symbol offset. Likewise for fix_scnlen.
(string_size): Change type to bfd_size_type.
(debug_string_size, debug_string_section): New static variables.
(coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true,
write the symbol name into the .debug section; assume that the
section has already been created with the right size.
(coff_write_symbols): Initialize debug_string_size to 0. If
bfd_coff_symname_in_debug returns true, don't put symbol name in
usual string table. After writing out all symbols, if
debug_string_size is not 0, check that it matches the size of the
.debug section.
(coff_get_normalized_symtab): Clear new fix_value and fix_scnlen
fields. If the string offset is 0, always use an empty string as
the name.
(coff_make_empty_symbol): Zero out the symbol structure.
_bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number
and number of aux entries.
(bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed
accordingly.
* libcoff.h: Rebuilt.
* coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new
arguments. If RS6000COFF_C, only treat C_EXT and C_HIDEXT
specially if this is the last aux entry.
* coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass
new arguments to swap_aux functions.
Somewhat more could be done.
Fri Jan 8 15:47:53 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* coffcode.h: Moved many generic functions into coffgen.c. Moved
swapping functions into coffswap.h for ECOFF use. Moved
relocation functions, only used by h8300 and z8k, into reloc16.c.
Added hooks for coffgen.c functions to backend data structure, and
added hook functions. Still more could be done.
* coffswap.h: New file to hold COFF swapping routines.
* coffgen.c: New file to hold generic COFF functions.
* reloc16.c: New file to hold h8300 and z8k specific relocation
functions.
* libcoff-in.h: Added declarations for functions in coffgen.c.
* libcoff.h: Rebuilt to incorporate changes.
* coff-h8300.c: Function name changes.
* coff-z8k.c: Function name changes. Use coff_reloc16_extra_cases
hook rather than defining EXTRA_CASES.
* Makefile.in: Build new files coffgen and reloc16. Added
dependencies of coff-*.o on coffswap.h and seclet.h.
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
"done_lineno" so that a symbol which appears twice in the symbol
table only gets it's linenumbers relocated once. Modifed
(coff_write_native_symbol) and (coff_make_empty_symbol) to make
* configure.in: now h8 is a coff target
* cpu-h8300.c: fix various disassembly problems
* libcoff.h: took out some code which has been #0ed for a long
time.
* targets.c: added h8 coff
* coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c
added new macro RTYPE2HOWTO to take a load of #ifdefs out of
coffcode.h
* coffcode.h: Started to change the way machine dependencies are
handled, from the nest of #ifdefs to macros defined in the
including coff-<foo>.c
* aoutx.h, archive.c, archures.c, bfd.c, bfd.texinfo, cache.c,
coffcode.h, core.c, format.c, libbfd.c, libbfd.h, libcoff.h,
opncls.c, reloc.c, section.c, syms.c, targets.c (documentation
segments): used BFD (caps) more consistently as a name in
discourse, fixed a few other minor typos and uses of fonts
Install header comments and attribute most modules to their
authors. BFD's name is now officially "Binary File Descriptor",
so remove any conflicting perjoratives.
alignments of structures on disk and structures in memory. #ifed out
all the code in coffswap.c, since it should be done using the target
swap routines now.
Remove obstack.h to ../include and obstack.c to ../libiberty.
Move COFF symbol swapping code to coffswap.c where GDB can call it but it
won't be duplicated if we have N different COFF targets.
Add support for traditional Unix core files (with a upage). This support
is from an Ultrix port, but is probably slightly broken now.
Improve bfd_release's of obstack'd items on error returns.
gcc -Wall fixes.
Handle section alignment slightly better in coff, and comment where it
needs more work (on page-aligning virtual vs file addresses for DPAGED).
Use set_tdata everywhere that tdata is set, to avoid "cast to the left
of assignment" problems with some compilers.
Move bfd_alloc, bfd_zalloc, bfd_realloc, and bfd_release into libbfd.h
(from bfd.h) since they are internal routines.
Remove the redundant suffix "_struct" from struct tags.
Set symbol count early in file reading, before slurping in the syms,
for GDB's use.