(SEC_LINK_DUPLICATES): Define.
(SEC_LINK_DUPLICATES_DISCARD): Define.
(SEC_LINK_DUPLICATES_ONE_ONLY): Define.
(SEC_LINK_DUPLICATES_SAME_SIZE): Define.
(SEC_LINK_DUPLICATES_SAME_CONTENTS): Define.
* bfd-in2.h: Rebuild.
* coffcode.h (sec_to_styp_flags): If COFF_WITH_PE, turn
SEC_LINK_ONCE into IMAGE_SCN_LNK_COMDAT.
(styp_to_sec_flags): If COFF_WITH_PE, turn IMAGE_SCN_LNK_REMOVE
into SEC_EXCLUDE. If IMAGE_SCN_LNK_COMDAT is set, set
SEC_LINK_ONCE, and look through the symbol table for the setting
for SEC_LINK_DUPLICATES.
(coff_write_object_contents): If COFF_WITH_PE, if SEC_LINK_ONCE is
set for a section, find the section symbol in the symbol table,
and set the aux entry based on SEC_LINK_DUPLICATES.
* coffgen.c (coff_print_symbol): Add a space before "checksum".
* coff-arm.c (armcoff_big_vec): If COFF_WITH_PE is defined, add
SEC_LINK_ONCE and SEC_LINK_DUPLICATES to section_flags.
* coff-i386.c (i386coff_vec): Likewise.
* coff-ppc.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
* libbfd.h: Rebuilt.
* linker.c (generic_link_hash_newfunc): No longer static.
* coffcode.h (coff_bfd_link_hash_create): Allow specific targets
to override.
* coff-h8300.c: Add two derived hash tables and their associated
funtions and #defines for use by the h8300 linker.
(h8300_reloc16_extra_cases, case R_MEM_INDIRECT): Create entries in
the function vector as needed. Place the address of the function
vector entry in the location specified by the R_MEM_INDIRECT reloc.
Rewrite the vectors section contents as necessary.
(h8300_bfd_link_add_symbols): New function for the h8300 linker.
(coff_bfd_link_add_symbols): Define to use h8300 specific version.
(coff_bfd_link_hash_table_create): Likewise.
Linker changes for function vectors. HMSE.
.lib section to work even if the entire section contents are
written at once. From Gvran Uddeborg <gvran@uddeborg.pp.se> and
Robert Lipe <robertl@arnet.com>.
obstack_alloc fails.
(bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish
fails.
* libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails.
* Many files: don't set bfd_error_no_memory if one of the above
routines fails.
* coff-rs6000.c (rs6000coff_vec): Add conditional defines
TARGET_SYM and TARGET_NAME for vector and BFD name.
* coff-pmac.c (pmac_xcoff_vec): Remove.
(TARGET_SYM, TARGET_NAME): Define.
* coffcode.h (coff_set_arch_mach_hook) [POWERMAC]: Set the
machine to 0, not all PowerMacs are 601s.
* coff-m88k.c (rtype2howto): New static function.
(RTYPE2HOWTO): Use it rather than a macro definition.
* coffcode.h (coff_write_object_contents): set internal_a.magic
to PAGEMAGICPEXECPAGED #if defined (M68) && !defined (LYNXOS).
* configure.in: m68*-motorola-sysv3* does not use ptrace-core.o;
define TRAD_HEADER to new file hosts/delta68.h.
m88*-motorola-sysv*, however, does use ptrace-core.o.
* hosts/delta68.h: New file.
* ptrace-core.c (ptrace_unix_core_file_p): change bfd_zmalloc to
bfd_zalloc; provide proper parm abfd to calls to bfd_zalloc.
linker.
* libcoff-in.h (struct xcoff_tdata): Add full_aouthdr,
toc_section, and entry_section fields.
(struct xcoff_section_tdata): Remove ldrel_count field.
* libcoff.h: Rebuild.
* coffcode.h (coff_mkobject_hook): Initialize new xcoff_data
fields.
(coff_compute_section_file_positions): If RS6000COFF_C, generate
full a.out header if full_aouthdr is set in xcoff_data.
(coff_write_object_contents): Likewise. Set o_snentry and o_sntoc
based on sections stored in xcoff_data.
* coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data
fields.
* coffgen.c (coff_get_symbol_info): If fix_value is set, fix the
value stored in ret rather than returning a pointer value.
(coff_slurp_line_table): Warn if we try to set the lineno field of
a symbol twice.
(coff_slurp_symbol_table): If RS6000COFF_C, handle C_BINCL and
C_EINCL by setting fix_line. Fix C_BSTAT symbol value.
* coffgen.c (coff_mangle_symbols): Handle fix_line.
(coff_write_symbol): Only use N_DEBUG if the symbol is in the
absolute section.
(coff_print_symbol): Print fix_value symbols in a useful fashion.
* libcoff.h: Rebuild.
(xcoff_data): Define.
* bfd.c (struct _bfd): Add xcoff_obj_data field to tdata union.
* bfd-in2.h, libcoff.h: Rebuild.
* coff-rs6000.c (xcoff_mkobject): New static function.
(coff_mkobject): Define.
(xcoff_copy_private_bfd_data): New static function.
(coff_bfd_copy_private_bfd_data): Define.
(rs6000coff_howto_table): Change R_TOC complain_on_overflow from
signed to bitfield.
(rs6000coff_vec): Add DYNAMIC to object_flags.
* coffcode.h (sec_to_styp_flags): If RS6000COFF_C, handle .pad and
.loader sections specially.
(coff_new_section_hook): If RS6000COFF_C, get the .text and .data
section alignment from the XCOFF tdata information.
(coff_mkobject_hook): If RS6000COFF_C, set DYNAMIC based on
F_SHROBJ, and copy the extra a.out header information into the
XCOFF tdata structure.
(coff_write_object_contents): If RS6000COFF_C, set F_SHROBJ,
F_DYNLOAD and the extra a.out header information.
(coff_slurp_symbol_table): Set BSF_NOT_AT_END for a C_EXT or
C_HIDEXT symbol with attached csect information.
* coffswap.h (coff_swap_aouthdr_in): If RS6000COFF_C, swap
in the o_maxdata field.
(coff_swap_aouthdr_out): If RS6000COFF_C, swap extra XCOFF fields.
* coffgen.c (coff_renumber_symbols): Don't move any symbol to the
end if BSF_NOT_AT_END is set.
_bfd_coff_print_aux.
(bfd_coff_print_aux): New static function.
(coff_pointerize_aux_hook (RS6000COFF_C version)): Pointerize the
scnlen field of an XTY_LD csect aux entry.
(coff_print_aux): New static function.
(coff_slurp_symbol_table): Don't pointerize scnlen field; now done
in coff_pointerize_aux_hook.
(bfd_coff_std_swap_table): Initialize new field.
* coffgen.c (coff_print_symbol): Call bfd_coff_print_aux.
* libcoff.h: Rebuild.
* coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
_bfd_coff_pointerize_aux_hook.
(coff_pointerize_aux_hook): Define as a function if RS6000COFF_C
or I960, and as 0 otherwise.
(bfd_coff_std_swap_table): Initialize new field.
* libcoff.h: Rebuild.
* coffgen.c (coff_pointerize_aux): Change parameters to take
symbol pointer instead of type and class, and to take aux index.
Call _bfd_coff_pointerize_aux_hook if it is defined.
(coff_get_normalized_symtab): Always call coff_pointerize_aux.
* coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
* coffcode.h (coff_bfd_copy_private_symbol_data,
coff_bfd_copy_private_section_data,
coff_bfd_copy_private_bfd_data): ifdef to allow overrides.
* peicode.h (coff_bfd_copy_private_bfd_data): New
(pe_bfd_copy_private_bfd_data): New.
(coff_swap_scnhdr_in): Swap bss size into the right place.
(pe_print_private_bfd_data): Add some newlines.
* coff-i960.c (coff_i960_relocate): Use a coff_section_data
structure to store the symbol being used.
(coff_i960_start_final_link): New static function.
(coff_i960_relocate_section): New static function.
(coff_i960_adjust_symndx): New static function.
(coff_start_final_link): Define.
(coff_relocate_section): Define.
(coff_adjust_symndx): Define.
* coffcode.h (bfd_coff_backend_data): Add new callback function
_bfd_coff_start_final_link.
(bfd_coff_start_final_link): Define.
(coff_start_final_link): Define if not defined.
(bfd_coff_std_swap_table): Add coff_start_final_link.
* cofflink.c (_bfd_coff_internal_syment_name): Make globally
visible.
(_bfd_coff_final_link): Call bfd_coff_start_final_link if the
function callback is not NULL.
* libcoff-in.h (struct coff_section_tdata): Add tdata field.
(_bfd_coff_internal_syment_name): Declare.
* libcoff.h: Rebuild.
* configure.in (icoff_big_vec): Add cofflink.o.
(icoff_little_vec): Likewise.
* configure: Rebuild.
* coffcode.h (coff_compute_section_file_positions): Keep the
raw size safe.
(coff_write_object_contents): Remember if it's a relocatable
file.
* libcoff-in.h (pe_data_type): New member 'has_reloc_section'
* peicode.h (coff_swap_filehdr_out): Clear not-reloc flag
if relocatable file. Swap out saved raw size.