blob: 63015db2a252659e08f2f5824d6659200316f96a [file] [log] [blame]
2001-12-31 Jakub Jelinek <jakub@redhat.com>
* elflink.h (elf_bfd_final_link): Check if dynobj is not NULL
before looking for .eh_frame_hdr section.
* elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): If
.eh_frame_hdr section is being stripped from output, don't do
anything.
2001-12-27 Tom Rix <trix@redhat.com>
* coff-rs6000.c (xcoff_generate_rtinit): Clean data_buffer alloc/free.
* coff64-rs6000.c (xcoff64_generate_rtinit): Same.
(xcoff_write_archive_contents_big): Rewrite.
(xcoff_write_armap_big): Rewrite.
(xcoff_write_one_armap_big): Delete.
* libxcoff.h : Clean up.
2001-12-21 Tom Rix <trix@redhat.com>
* xcofflink.c (bfd_xcoff_link_generate_rtinit): New function.
Interface to linker for generation of __rtinit.
* libxcoff.h (struct xcoff_backend_data_rec): Add new ops to xcoff
backend to generate special linker symbol __rtinit.
* coff-rs6000.c (bfd_xcoff_backend_data, bfd_pmac_xcoff_backend_data)
: Add new rtinit ops
* coff64-rs6000.c (bfd_xcoff_aix5_backend_data,
bfd_xcoff_backend_data): Same.
* bfd-in.h: Add bfd_xcoff_link_generate_rtinit.
* bfd-in2.h : Regenerate.
2001-12-21 Jakub Jelinek <jakub@redhat.com>
* elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix dst_mask for
R_SPARC_DISP32. Support R_SPARC_PLT32.
(sparc_reloc_map): Add BFD_RELOC_16_PCREL and BFD_RELOC_SPARC_PLT32.
(elf32_sparc_check_relocs): Handle R_SPARC_PLT32.
(elf32_sparc_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_howto_table): Fix dst_mask for
R_SPARC_DISP32. Support R_SPARC_PLT32 and R_SPARC_PLT64.
(sparc_reloc_map): Add BFD_RELOC_16_PCREL, BFD_RELOC_64_PCREL
and BFD_RELOC_SPARC_PLT32.
(sparc64_elf_check_relocs): Handle R_SPARC_PLT32 and R_SPARC_PLT64.
(sparc64_elf_relocate_section): Likewise.
* reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SPARC_PLT32.
* bfd-in2.h, libbfd.h: Rebuilt.
2001-12-20 Tom Rix <trix@redhat.com>
* coffcode.h (coff_compute_section_file_positions): Add special AIX
loader alignment of text section.
2001-12-20 Jason Thorpe <thorpej@wasabisystems.com>
* config.bfd (mips-dec-netbsd*): Delete alias for mips*el-*-netbsd*.
* config.bfd (arm-*-netbsdelf*): Add target.
* configure.in: Include netbsd-core.lo for native arm-*-netbsd*.
* configure: Regenerate.
2001-12-20 Alan Modra <amodra@bigpond.net.au>
* elfcode.h (elf_slurp_symbol_table): Test elf_elfsections for NULL,
as can happen with a core file, before dereferencing.
2001-12-19 Michael Snyder <msnyder@redhat.com>
* elf32-i386.c (elf_i386_grok_psinfo): Fix copy-and-paste error:
target is i386 (not mips), and size of descdata is 124 (not 128).
2001-12-19 Jakub Jelinek <jakub@redhat.com>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): If new_size
is 0, temporarily grow it to minimal CIE size.
(_bfd_elf_write_section_eh_frame): If input .eh_frame section would
end up empty, build a fake minimal CIE.
2001-12-19 Steve Ellcey <sje@cup.hp.com>
* config.bfd (bfd_elf32_ia64_hpux_big_vec): New vector for
ia64*-*-hpux* target.
(bfd_elf64_ia64_hpux_big_vec): Likewise.
* targets.c: Ditto.
* configure.in: Ditto.
* configure: Regenerate
* elfxx-ia64.c (elfNN_ia64_final_write_processing): Replace use of
alloca with bfd_malloc.
(get_local_sym_hash): Likewise.
(elfNN_hpux_post_process_headers): New function.
#include elfNN-target.h again with values for IA64 HP-UX vector.
2001-12-18 Michael Snyder <msnyder@redhat.com>
* elf.c (assign_file_positions_for_segments): Don't sort PT_NOTE
sections of corefiles. Also it makes no sense to sort if count == 1.
2001-12-18 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_copy_private_bfd_data): Also copy GP.
2001-12-18 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_copy_private_bfd_data): Update comments.
2001-12-18 H.J. Lu <hjl@gnu.org>
* elf-bfd.h (_bfd_elf_copy_private_bfd_data): New. Prototype.
(_bfd_mips_elf_copy_private_bfd_data): Removed.
* elf.c (_bfd_elf_copy_private_bfd_data): New. Copy e_flags in
the ELF header.
* elf32-i370.c (??_elf_copy_private_bfd_data): Removed.
(bfd_elf??_bfd_copy_private_bfd_data): Removed.
* elf32-m32r.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-mcore.c: Likewise.
* elf32-mips.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-v850.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-sparc.c: Likewise.
* elfxx-ia64.c: Likewise.
* elf64-mips.c (bfd_elf64_bfd_copy_private_bfd_data): Removed.
* elfxx-target.h (bfd_elfNN_bfd_copy_private_bfd_data): Defined
to _bfd_elf_copy_private_bfd_data.
2001-12-18 Martin Schwidefsky <schwidefsky@de.ibm.com>
* elf32-s390 (elf_s390_check_relocs): Pass addend to
gc_record_vtentry.
* elf64-s390 (elf_s390_check_relocs): Likewise.
Fix by Andreas Jaeger <aj@suse.de>.
2001-12-18 Jason Thorpe <thorpej@wasabisystems.com>
* configure.host: Correctly match all NetBSD/mips
hosts.
2001-12-18 matthew green <mrg@eterna.com.au>
* config.bfd (m68*-*-netbsdelf*): New target.
(m68*-*-netbsd): Also include bfd_elf32_m68k_vec.
(m68*-*-netbsdaout*): New alias for m68*-*-netbsd.
2001-12-18 Jakub Jelinek <jakub@redhat.com>
* elflink.h (size_dynamic_sections): Skip anonymous version tag.
(elf_link_assign_sym_version): Don't count anonymous version tag.
2001-12-18 Jakub Jelinek <jakub@redhat.com>
* elf-eh-frame.c (struct cie): Add make_lsda_relative.
(struct eh_cie_fde): Add lsda_encoding, lsda_offset,
make_lsda_relative.
(read_value, write_value): New.
(_bfd_elf_discard_section_eh_frame): Inicialize
lsda_encoding, lsda_offset and make_lsda_relative.
(_bfd_elf_eh_frame_section_offset): If make_lsda_relative,
request no dynamic reloc for LSDA field of FDE.
(_bfd_elf_write_section_eh_frame): Handle make_lsda_relative.
If a non-DW_EH_PE_absptr value is 0, don't adjust it by base
or pcrel. Fix address computation for DW_EH_PE_pcrel relocs.
Update LSDA field if LSDA encoding is DW_EH_PE_pcrel, because
. might have changed due to deleted FDE or CIEs.
2001-12-18 Jakub Jelinek <jakub@redhat.com>
* elf-strtab.c (struct elf_strtab_hash_entry): Add u.next.
(last_eq): Remove.
(_bfd_elf_strtab_finalize): Don't use a hash table for last
character chains, instead use an array.
2001-12-18 Jason Thorpe <thorpej@wasabisystems.com>
* elf.c (elfcore_netbsd_get_lwpid): New function.
(elfcore_grok_netbsd_procinfo): New function.
(elfcore_grok_netbsd_note): New function.
(elfcore_read_notes): Call elfcore_grok_netbsd_note to process
NetBSD ELF core file notes.
2001-12-18 Alan Modra <amodra@bigpond.net.au>
* elfcode.h (struct bfd_preserve): New.
(elf_object_p): Replace preserved_* vars with instance of above.
Save and restore arch_info pointer rather than arch, mach so that
more cases can be restored. Save and restore new section_tail,
section_htab structure, and init appropriately. Move "rest of
section header" code so that i_shdrp needs no NULL initialisation.
Free old section_htab on success.
* elfcore.h (elf_core_file_p): Likewise.
2001-12-17 Tom Rix <trix@redhat.com>
* coffcode.h (sec_to_styp_flags): Add STYP_EXCEPT and STYP_TYPCHK for
xcoff.
2001-12-17 Jakub Jelinek <jakub@redhat.com>
* elf-bfd.h (elf_discarded_section): Define.
* elflink.h (elf_link_input_bfd): Use it.
(elf_reloc_symbol_deleted_p): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Don't warn about
overflows for pc relative relocs against discarded sections.
2001-12-17 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf32-mips.c (_bfd_mips_elf_relocate_section): Formatting.
* elf64-mips.c: Add most of the fixes and tweaks done in elf32-mips.c
over the last months. Add some code for mips16 handling.
(mips_elf64_check_mips16_stubs): New function.
(mips_elf64_stub_section_p): Likewise.
(mips_elf64_calculate_relocation): Change interface to support mips16.
(mips_elf64_perform_relocation): Likewise.
2001-12-17 Alan Modra <amodra@bigpond.net.au>
Support for more than 64k ELF sections.
* elf-bfd.h (elf_size_info <swap_symbol_out>): Add shndx param.
(bfd_elf32_swap_symbol_in): Likewise.
(bfd_elf32_swap_symbol_out): Likewise.
(bfd_elf64_swap_symbol_in): Likewise.
(bfd_elf64_swap_symbol_out): Likewise.
(elf_reloc_cookie): Add locsym_shndx field. Make locsyms a PTR.
(elf_obj_tdata): Add num_elf_sections, symtab_shndx_hdr and
symtab_shndx_section.
(elf_numsections): Define.
(elf_symtab_shndx): Define.
* elf.c (setup_group): Use elf_numsections rather than header e_shnum.
(bfd_elf_find_section): Likewise.
(bfd_section_from_elf_index): Likewise.
(bfd_section_from_shdr): Likewise. Handle SHT_SYMTAB_SHNDX.
(bfd_section_from_r_symndx): Read symbol shndx extension, and
translate st_shndx for > SHN_HIRESERVE.
(assign_section_numbers): Skip reserved sections. Assign
symtab_shndx_section and elf_numsections. Exclude reserved
sections from e_shnum. Set up symtab_shndx_hdr.
(_bfd_elf_compute_section_file_positions): Handle symtab_shndx_hdr.
(map_sections_to_segments): Don't map eh_frame_hdr unless required.
(assign_file_positions_except_relocs): Use elf_numsections rather
than header e_shnum. Skip reserved sections and symtab_shndx_section.
(prep_headers): Set name for symtab_shndx_hdr.
(_bfd_elf_assign_file_positions_for_relocs): Use elf_numsections.
(_bfd_elf_write_object_contents): Likewise. Skip reserved sections.
(_bfd_elf_section_from_bfd_section): Check bfd_{abs,com,und}_section
first. Use elf_section_data if available. Use elf_numsections.
Start scan at index 1.
(copy_private_bfd_data ): Comment fixes.
(MAP_ONESYMTAB): Define above SHN_HIOS.
(MAP_DYNSYMTAB): Likewise.
(MAP_STRTAB): Likewise.
(MAP_SHSTRTAB): Likewise.
(MAP_SYM_SHNDX): New define.
(_bfd_elf_copy_private_symbol_data): Handle symtab_shndx_section.
(swap_out_syms): Swap out SHT_SYMTAB_SHNDX section too.
* elfcode.h (elf_swap_symbol_in): Add shndx param, and handle shndx
extension.
(elf_swap_symbol_out): Likewise.
(elf_object_p): Set elf_numsections, and use instead of e_shnum.
Initialialise reserved elf_elfsections to point at shdr[0]. Remove
redundant bfd_release calls.
(elf_slurp_symbol_table): Read symbol shndx extension, and use with
elf_swap_symbol_in. Translate st_shndx for > SHN_HIRESERVE too.
* elflink.h (elf_link_is_defined_archive_symbol): Read symbol shndx
extension, and use with elf_swap_symbol_in.
(elf_link_record_local_dynamic_symbol): Likewise.
(elf_link_add_object_symbols): Likewise. Also translate st_shndx
for elf sections > SHN_HIRESERVE.
(NAME(bfd_elf,size_dynamic_sections)): Adjust elf_swap_symbol_out
call.
(struct elf_final_link_info): Add locsym_shndx and symshndxbuf.
(elf_bfd_final_link): Allocate the above, and tidy code allocating
other buffers. Use elf_numsections instead of e_shnum. Adjust
elf_swap_symbol_out calls.
(elf_link_output_sym): Swap out symbol shndx extension too.
(elf_link_flush_output_syms): And flush them to disk.
(elf_link_output_extsym): Use SHN_BAD. Adjust elf_swap_symbol_out
calls.
(elf_gc_mark): Read symbol shndx extension, and use with
elf_swap_symbol_in.
(elf_link_input_bfd): Likewise, Translate st_shndx for elf sections
> SHN_HIRESERVE too. Use SHN_BAD.
(elf_reloc_symbol_deleted_p): Use symbol shndx extensions with
elf_swap_symbol_in. Translate st_shndx > SHN_HIRESERVE too.
(elf_bfd_discard_info): Read symbol shndx extension. Don't attempt
to continue after a bfd error.
* elf-m10200.c (mn10200_elf_relax_section): Only read local syms.
Stash them immediately to symtab_hdr->contents rather than later
in multiple places. Clean up afterwards. Read symbol shndx
extension, and use with swap_symbol_in. Translate SHN_UNDEF,
SHN_ABS, SHN_COMMON and elf sections > SHN_HIRESERVE to bfd
sections too. Remove dead code.
(mn10200_elf_relax_delete_bytes): Use symbol shndx extension
when swapping in symbols. Tidy code adjusting global syms.
Don't swap in global syms.
(mn10200_elf_symbol_address_p): Likewise. Remove extsyms param.
(mn10200_elf_get_relocated_section_contents): Read symbol shndx
extension, and use with swap_symbol_in. Rename "size" -> "amt"
to maximize code in common with other files. Translate st_shndx
for > SHN_HIRESERVE too. Remove dead code.
* elf-m10300.c (mn10300_elf_relax_section): Only read local syms.
Stash them immediately to symtab_hdr->contents rather than later
in multiple places. Clean up afterwards. Read symbol shndx
extension, and use with swap_symbol_in. Remove dead code.
(mn10300_elf_relax_delete_bytes): As for elf-m10200.c.
(mn10300_elf_symbol_address_p): Likewise.
(mn10300_elf_get_relocated_section_contents): Likewise.
* elf32-h8300.c (elf32_h8_relax_section): As for elf-m10300.c.
(elf32_h8_relax_delete_bytes): Likewise.
(elf32_h8_symbol_address_p): Likewise.
(elf32_h8_get_relocated_section_contents): Likewise.
* elf32-hppa.c (elf32_hppa_size_stubs): Read symbol shndx
extension, and use with swap_symbol_in.
* elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
* elf32-i370.c (i370_elf_finish_dynamic_sections): Adjust call to
bfd_elf32_swap_symbol_out.
* elf32-m32r.c (m32r_elf_get_relocated_section_contents): Translate
elf sections > SHN_HIRESERVE too.
* elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Only read
local syms. Read symbol shndx extension, and use with swap_symbol_in.
* elf32-mips.c (_bfd_mips_elf_final_write_processing): Use
elf_numsections rather than header e_shnum.
* elf32-sh.c (sh_elf_relax_section): As for elf-m10300.c.
(sh_elf_relax_delete_bytes): Likewise.
(sh_elf_get_relocated_section_contents): Likewise. Only read local
symbols.
* elf32-v850.c (v850_elf_symbol_processing): Use an unsigned int to
hold section index. Use elf_numsections rather than e_shnum.
Rename "index" -> "indx" to avoid shadowing warning.
(v850_elf_add_symbol_hook): Likewise.
* elf64-alpha.c (elf64_alpha_relax_section): Only read local syms.
Read symbol shndx extension, and use with swap_symbol_in.
* elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
Translate SHN_COMMON and elf sections > SHN_HIRESERVE too.
* elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
(elfNN_ia64_aix_add_symbol_hook): Use elf_numsections.
* elf-m10300.c (mn10300_elf_gc_mark_hook): Remove unnecessary checks
before calling bfd_section_from_elf_index on local syms.
* elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
* elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
* elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
* elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
* elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
* elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
* elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
* elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
* elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
* elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
* elf32-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
* elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
* elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
* elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
* elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
* elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
* elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
* elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
* elf64-mips.c (mips_elf64_gc_mark_hook): Likewise.
* elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
* elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
* elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
* elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
2001-12-17 Alan Modra <amodra@bigpond.net.au>
Hash bfd sections for fast lookup and create.
* bfd.c (struct _bfd): Add section_htab, section_tail.
* libbfd-in.h (_bfd_delete_bfd): Declare.
(bfd_section_hash_newfunc): Declare.
* opncls.c (_bfd_new_bfd): Free memory on failure. Init
section_htab and section_tail.
(_bfd_delete_bfd): New function.
(bfd_openr): Use it.
(bfd_fdopenr): Likewise.
(bfd_openstreamr): Likewise.
(bfd_openw): Likewise.
(bfd_close): Likewise.
(bfd_close_all_done): Likewise.
(bfd_release): Comment.
* section.c (struct section_hash_entry): New.
(bfd_section_hash_newfunc): New function.
(section_hash_lookup): Define.
(bfd_section_init): New function, split out from
bfd_make_section_anyway.
(bfd_get_section_by_name): Lookup via hash table.
(bfd_get_unique_section_name): Likewise.
(bfd_make_section_old_way): Rewrite to use hash table.
(bfd_make_section_anyway): Likewise.
(bfd_make_section): Likewise. Return NULL for attempts to make
BFD_{ABS,COM,UND,IND}_SECTION_NAME.
(_bfd_strip_section_from_output): Adjust section_tail if needed.
* configure.in: Bump bfd version.
* configure: Regenerate.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
2001-12-15 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf64-mips.c (mips_elf64_link_hash_entry): New link hash.
(mips_elf64_high): New Function.
(mips_elf64_higher): Likewise.
(mips_elf64_highest): Likewise.
(mips_elf64_info_to_howto_rel): Likewise.
(mips_elf64_info_to_howto_rela): Likewise.
(mips_elf64_write_rel): Likewise.
(mips_elf64_write_rela): Likewise.
(mips_elf64_link_hash_newfunc): Likewise.
(mips_elf64_hi16_reloc): Likewise.
(mips_elf64_higher_reloc): Likewise.
(mips_elf64_highest_reloc): Likewise.
(mips_elf64_gprel16_reloc): Likewise.
(mips_elf64_gprel16_reloca): Likewise.
(mips_elf64_literal_reloc): Likewise.
(mips_elf64_gprel32_reloc): Likewise.
(mips_elf64_shift6_reloc): Likewise.
(mips_elf64_got16_reloc): Likewise.
(mips_elf64_assign_gp): Likewise.
(mips_elf64_final_gp): Likewise.
(gprel16_with_gp): Likewise.
(mips_elf64_additional_program_headers): Likewise.
(mips_elf64_link_hash_table_create): Likewise.
(mips_elf64_got_offset_from_index): Likewise.
(_mips_elf64_got_info): Likewise.
(mips_elf64_sign_extend): Likewise.
(mips_elf64_overflow_p): Likewise.
(mips_elf64_global_got_index): Likewise.
(mips_elf64_sort_hash_table_f): Likewise.
(mips_elf64_sort_hash_table): Likewise.
(mips_elf64_swap_msym_out): Likewise.
(mips_elf64_create_local_got_entry): Likewise.
(mips_elf64_local_got_index): Likewise.
(mips_elf64_got_page): Likewise.
(mips_elf64_got16_entry): Likewise.
(mips_elf64_local_relocation_p): Likewise.
(mips_elf64_next_relocation): Likewise.
(mips_elf64_create_dynamic_relocation): Likewise.
(mips_elf64_calculate_relocation): Likewise.
(mips_elf64_obtain_contents): Likewise.
(mips_elf64_perform_relocation): Likewise.
(mips_elf64_relocate_section): Likewise.
(mips_elf64_create_dynamic_sections): Likewise.
(mips_elf64_adjust_dynamic_symbol): Likewise.
(mips_elf64_always_size_sections): Likewise.
(mips_elf64_size_dynamic_sections): Likewise.
(mips_elf64_finish_dynamic_symbol): Likewise.
(mips_elf64_finish_dynamic_sections): Likewise.
(mips_elf64_gc_mark_hook): Likewise.
(mips_elf64_gc_sweep_hook): Likewise.
(mips_elf64_create_got_section): Likewise.
(mips_elf64_record_global_got_symbol): Likewise.
(mips_elf64_create_msym_section): Likewise.
(mips_elf64_allocate_dynamic_relocations): Likewise.
(mips_elf64_check_relocs): Likewise.
(mips_elf64_output_extsym): Likewise.
(mips_elf64_swap_gptab_in): Likewise.
(mips_elf64_swap_gptab_out): Likewise.
(gptab_compare): Likewise.
(mips_elf64_final_link): Likewise.
(prev_reloc_addend): Remenber addend of previous parts of a combined
reloc.
(ELF_MIPS_GP_OFFSET): New define.
(STUB_LW,STUB_MOVE,STUB_JALR,STUB_LI16): Likewise.
(MIPS_FUNCTION_STUB_SIZE): Likewise.
(mips_elf64_howto_rel): Fix HOWTO defines.
(mips_elf64_howto_rela): Likewise.
(mips_elf64_swap_reloca_out): Fix signedness.
(mips_elf64_be_swap_reloc_in): Use ELF64* instead of ELF32*.
(mips_elf64_be_swap_reloca_in): Likewise.
(mips_elf64_be_swap_reloc_out): Likewise. Preserve extended type info.
(mips_elf64_be_swap_reloca_out): Likewise.
2001-12-15 Jakub Jelinek <jakub@redhat.com>
* elf-bfd.h (_bfd_elf_maybe_strip_eh_frame_hdr): New prototype.
* elf-eh-frame.c (struct eh_frame_hdr_info): Add strip.
(_bfd_elf_discard_section_eh_frame): Don't create .eh_frame_hdr
sec_info here. Free ehbuf.
(_bfd_elf_discard_section_eh_frame_hdr): Don't size the section
if hdr_info->strip.
(_bfd_elf_maybe_strip_eh_frame_hdr): New.
* elflink.h (size_dynamic_sections): Call it.
2001-12-14 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_bfd_discard_info): Fix segfault when dynobj NULL.
2001-12-13 Jakub Jelinek <jakub@redhat.com>
* elf-bfd.h (enum elf_link_info_type): New.
(struct bfd_elf_section_data): Remove stab_info and merge_info
fields, add sec_info and sec_info_type.
(struct elf_obj_tdata): Add eh_frame_hdr field.
(_bfd_elf_discard_section_eh_frame): New prototype.
(_bfd_elf_discard_section_eh_frame_hdr): Likewise.
(_bfd_elf_eh_frame_section_offset): Likewise.
(_bfd_elf_write_section_eh_frame): Likewise.
(_bfd_elf_write_section_eh_frame_hdr): Likewise.
* Makefile.am (BFD32_BACKENDS): Add elf-eh-frame.lo.
(BFD32_BACKENDS_CFILES): Add elf-eh-frame.c.
(elf-eh-frame.lo): New.
* Makefile.in: Rebuilt.
* configure.in (elf): Add elf-eh-frame.lo.
* configure: Rebuilt.
* elf.c (_bfd_elf_print_private_bfd_data): Support PT_GNU_EH_FRAME.
(map_sections_to_segments): Create PT_GNU_EH_FRAME if requested.
(get_program_header_size): Take into account PT_GNU_EH_FRAME
segment.
(_bfd_elf_rela_local_sym): Use sec_info_type and sec_info.
(_bfd_elf_rel_local_sym): Likewise.
(_bfd_elf_section_offset): Likewise. Call
_bfd_elf_eh_frame_section_offset too.
* elfxx-ia64.c (elfNN_ia64_relocate_section): Use sec_info_type and
sec_info.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf-eh-frame.c: New file.
* elflink.h (elf_link_add_object_symbols): Don't optimize SHF_MERGE
.stab sections. Set sec_info_type, use sec_info instead
of merge_info and stab_info.
(elf_link_create_dynamic_sections): Create .eh_frame_hdr section
if --eh-frame-hdr.
(elf_bfd_final_link): Write .eh_frame_hdr section.
(elf_link_sec_merge_syms): Use sec_info_type and sec_info.
(elf_link_input_bfd): Likewise.
Call _bfd_elf_write_section_eh_frame to write .eh_frame sections.
(elf_bfd_discard_info): Add output_bfd argument.
Call _bfd_elf_discard_section_eh_frame and
_bfd_elf_discard_section_eh_frame_hdr.
(elf_section_ignore_discarded_relocs): Use sec_info_type, not section
names.
* bfd-in.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Adjust
prototypes.
* bfd-in2.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Likewise.
2001-12-12 Richard Henderson <rth@redhat.com>
* syms.c (_bfd_generic_read_minisymbols): Early return for
no symbols. Patch from FreeBSD folk; exact origin unknown.
2001-12-11 Alan Modra <amodra@bigpond.net.au>
* elfcode.h (elf_swap_ehdr_out): Adjust value written for e_shnum
and e_shstrndx if out of range.
(elf_object_p): Read extended values for e_shnum and e_shstrndx
from the first section header. Allocate space in elf_elfsections
for reserved sections and set to NULLs.
(elf_write_shdrs_and_ehdr): Set overflow fields in first section
header. Skip reserved sections in elf_elfsections. Remove
duplicate size calculation.
2001-12-07 Geoffrey Keating <geoffk@redhat.com>
Richard Henderson <rth@redhat.com>
Corinna Vinschen <vinschen@redhat.com>
* Makefile.am: Add support for xstormy16.
* archures.c: Add support for xstormy16.
* config.bfd: Add support for xstormy16.
* configure.in: Add support for xstormy16.
* reloc.c: Add support for xstormy16.
* targets.c: Add support for xstormy16.
* cpu-xstormy16.c: New file.
* elf32-xstormy16.c: New file.
* Makefile.in: Regenerated.
* bfd-in2.h: Regenerated.
* configure: Regenerated.
* libbfd.h: Regenerated.
2001-12-07 Nick Clifton <nickc@cambridge.redhat.com>
* elf.c (assign_file_positions_for_segments): Combine sentance
fragments into a single sentance in order to permit better
translation into foreign languages.
2001-12-07 Jim Blandy <jimb@redhat.com>
* elf32-s390.c (elf32_s390_grok_prstatus): New function.
(elf_backend_grok_prstatus): Define.
2001-12-07 Jakub Jelinek <jakub@redhat.com>
* elf32-sparc.c (elf32_sparc_relocate_section): Revert
2001-09-14 change.
2001-12-07 Jakub Jelinek <jakub@redhat.com>
* elf.c (_bfd_elf_rela_local_sym): Only call
_bfd_merged_section_offset if merge_info is non-NULL.
(_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New.
* elf-bfd.h (_bfd_elf_rel_local_sym, _bfd_elf_section_offset): New
prototypes.
* elf32-arm.h (elf32_arm_final_link_relocate): Use
_bfd_elf_section_offset.
(elf32_arm_relocate_section): Use _bfd_elf_rel_local_sym.
* elf32-i386.c (elf_i386_relocate_section): Use
_bfd_elf_section_offset and _bfd_elf_rel_local_sym.
* elf32-sh.c (sh_elf_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Use
_bfd_elf_section_offset.
* elf32-cris.c (cris_elf_relocate_section): Likewise.
* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
* elf32-i370.c (i370_elf_relocate_section): Likewise.
* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
* elf32-mips.c (mips_elf_create_dynamic_relocation): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
* elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
2001-12-07 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (clobber_millicode_symbols): Don't do anything if
already forced local.
2001-12-05 Nick Clifton <nickc@cambridge.redhat.com>
* elf32-arm.h (elf32_arm_merge_private_bfd_data): Combine
fragmented sentence parts into a whole sentence to permit
better translation into foreign languages.
2001-12-06 Hans-Peter Nilsson <hp@bitrange.com>
* configure: Regenerate.
* Makefile.in: Regenerate.
2001-12-05 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* Makefile.am: split up BFD_LIBS like statements in BFD32_LIBS and
BFD64_LIBS, make the latter depending on the availability of BFD64.
Add archive64.c source file.
* archive64.c: New file implementing bfd_elf64_archive_slurp_armap
and bfd_elf64_archive_write_armap, code from elf64-mips.c
* archive.c (bfd_slurp_armap): Add ELF64 archive support.
* config.bfd (mips*-*-irix6*): Allow with BFD64 only.
(mips64*el-*-linux*): Likewise.
(mips*el-*-linux*): Likewise. Reorder entries.
* configure.in (bfd_libs): Define in dependency of BFD64 and
AC_SUBST it.
* elf64-mips.c (mips_elf64_slurp_armap): Remove, use
bfd_elf64_archive_slurp_armap instead.
(mips_elf64_write_armap): Remove, use bfd_elf64_archive_write_armap
instead.
2001-12-04 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* config.bfd: Remove trailing blanks.
* elf32-mips.c (gprel16_with_gp): Remove superfluous casts.
2001-12-04 Alexandre Oliva <aoliva@redhat.com>
* elf32-d10v.c (elf_d10v_howto_table): Adjust bit-size of
R_D10V_10_PCREL_L, R_D10V_10_PCREL_R, R_D10V_18,
R_D10V_18_PCREL. Check 10_PCREL relocations as signed.
Disable pointless overflow checking of NONE and 32.
2001-12-04 Alan Modra <amodra@bigpond.net.au>
* reloc.c (bfd_install_relocation): Correct reloc address test.
(bfd_perform_relocation): Formatting fix.
* bfd-in2.h: Regenerate for 2001-12-02 reloc.c change.
2001-12-03 Nick Clifton <nickc@cambridge.redhat.com>
* configure.in (LINGUAS): Add tr.
* configure: Regenerate.
* po/tr.po: Import from translation project's web site.
2001-12-03 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (hppa_get_stub_entry): Remove debug message that
happens to trigger on undefined symbols.
(final_link_relocate): Return bfd_reloc_undefined for undefined
stubs.
(elf32_hppa_relocate_section): Don't say we can't handle a reloc
if we have already warned about an undefined symbol.
2001-12-02 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf32-mips.c (NEWABI_P): New define.
(USE_REL): Remove, replaced by
(elf_backend_may_use_rel_p): New define.
(elf_backend_may_use_rela_p): Likewise.
(elf_backend_default_use_rela_p): Likewise.
(elf_mips_howto_table): Rename to elf_mips_howto_table_rel.
Fix some relocation definitions.
(elf_mips_howto_table_rela): New RELA relocation definitions for
NewABI support.
(mips32_64bit_reloc): Use the renamed elf_mips_howto_table_rel.
(bfd_elf32_bfd_reloc_type_lookup): Likewise.
(mips_rtype_to_howto): Likewise.
(_bfd_mips_elf_relocate_section): Likewise.
(_bfd_mips_elf_object_p): Typo.
(elf_backend_sign_extend_vma): Reordered together with many other
defines nearby to resemble the order of declaration in the header
file.
2001-12-02 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* coff-mips.c (mips_bfd_reloc_type_lookup): Replace
BFD_RELOC_MIPS_GPREL by BFD_RELOC_GPREL16.
* pe-mips.c (mips_bfd_reloc_type_lookup): Likewise.
* elf32-mips.c (mips_reloc_map): Likewise. Replace
BFD_RELOC_MIPS_GPREL32 by BFD_RELOC_GPREL32.
* elf64-mips.c (mips_reloc_map): Likewise.
* reloc.c (BFD_RELOC_MIPS_GPREL): Remove.
(BFD_RELOC_MIPS_GPREL32): Remove.
2001-11-30 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_add_default_symbol): New.
(elf_link_add_object_symbols): Call elf_add_default_symbol ()
to create an indirect symbol from the default for the symbol
with the default version if needed.
2001-11-29 "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
* elf.c (elfcore_grok_prstatus): Do not overwite the core signal
if it has already been set by another thread.
2001-11-28 Jakub Jelinek <jakub@redhat.com>
* elf64-alpha.c (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Defined.
(elf64_alpha_relocate_section): Translate local_got_entries
for STT_SECTION symbol to SHF_MERGE section the first time
we see it.
* elfxx-ia64.c (struct elfNN_ia64_local_hash_entry): Add
sec_merge_done.
(get_local_sym_hash): New, extracted from get_dyn_sym_info.
(get_dyn_sym_info): Use it.
(elfNN_ia64_relocate_section): Translate local dyn entries
for STT_SECTION symbol to SHF_MERGE section the first time
we see it.
2001-11-27 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_bfd_discard_info): Skip if the input bfd isn't
ELF.
2001-11-26 Jeffrey A Law (law@cygnus.com)
* stabs.c (_bfd_discard_section_stabs): Use PARAMS in function
prototypes.
2001-11-24 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (elf32_hppa_size_stubs): Decrease default stub
group sizes to accommodate c++.
2001-11-23 Jakub Jelinek <jakub@redhat.com>
* elf32-sparc.c (elf32_sparc_relocate_section): Don't clear
relocations in non-alloced sections against global symbols
defined in shared library being built.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2001-11-23 Jakub Jelinek <jakub@redhat.com>
* elf.c (_bfd_elf_rela_local_sym): New.
* elflink.h (elf_link_input_bfd): Don't consider empty
merged sections as removed in relocation tests.
* elf-bfd.h (_bfd_elf_rela_local_sym): Add prototype.
* elf32-i386.c (elf_i386_relocate_section): Handle relocs
against STT_SECTION symbol of SHF_MERGE section.
* elf32-arm.h (elf32_arm_relocate_section): Likewise.
* elf32-avr.c (elf32_avr_relocate_section): Call
_bfd_elf_rela_local_sym.
* elf32-cris.c (cris_elf_relocate_section): Likewise.
* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
* elf32-fr30.c (fr30_final_link_relocate): Likewise.
* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
* elf32-i370.c (i370_elf_relocate_section): Likewise.
* elf32-i860.c (elf32_i860_relocate_section): Likewise.
* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
* elf32-v850.c (v850_elf_relocate_section): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
* elf-hppa.h (elf_hppa_relocate_section): Likewise.
* elf-m10200.c (mn10200_elf_relocate_section): Likewise.
* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
* elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
* elf32-sh.c (sh_elf_relocate_section): Likewise for
!partial_inplace relocs. Handle relocs against STT_SECTION
symbol of SHF_MERGE for partial_inplace relocs.
2001-11-21 Nick Clifton <nickc@cambridge.redhat.com>
* po/Make-in (distclean): Move SRC-POTFILES.in and
BLD-POTFILES.in to maintainer-clean target.
2001-11-21 Alan Modra <amodra@bigpond.net.au>
* elfxx-ia64.c (elfNN_ia64_relocate_section): Test r_symndx rather
than sym_sec->output_section to detect relocs against discarded
sections.
2001-11-19 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_input_bfd): Assert r_symndx != 0 when
discarding relocations.
2001-11-19 Nick Clifton <nickc@cambridge.redhat.com>
* section.c (bfd_is_const_section): New macro. Return true if the
given seciton is one of the special, constant, sections.
* bfd-in2.h: Regenerate.
* coffgen.c (coff_count_linenumbers): Use bfd_is_const_section.
(coff_write_native_symbol): Use bfd_is_const_section.
2001-11-19 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (clobber_millicode_symbols): Dec dynstr refcount.
* elf32-hppa.c (elf32_hppa_size_stubs): Don't consider undefined
millicode syms as candidates for import stubs.
* elf32-hppa.c (PLABEL_PLT_ENTRY_SIZE): Delete.
(allocate_PIC_calls): Rename to allocate_plt_static.
(allocate_dynrelocs): Move most of code handling .plt entries to..
(allocate_plt_static): ..here. Don't drop plabel entries.
2001-11-19 Hans-Peter Nilsson <hp@bitrange.com>
* mmo.c: Adjust documentation tags to use texinfo 4 features.
2001-11-16 Nick Clifton <nickc@cambridge.redhat.com>
* section.c (bfd_is_const_section): New macro. Return true if the
section pointer refers to one of the special, constant sections.
* bfd-in2.h: Regenerate.
* coffgen.c (coff_count_linenumbers): Only update the line number
count in non-special sections.
(coff_write_native_symbol): Only update the line number file
position in non-special sections.
2001-11-15 Daniel Jacobowitz <drow@mvista.com>
* elflink.h (elf_reloc_symbol_deleted_p): Catch all relocs against
local syms from discarded sections. Update comment.
2001-11-15 Alan Modra <amodra@bigpond.net.au>
* po/SRC-POTFILES.in: Regenerate.
* elflink.h (elf_link_input_bfd): Complain about all relocs
against local syms from discarded sections. K&R fixes.
(elf_reloc_symbol_deleted_p): Don't try to swap in external syms.
K&R fixes.
2001-11-15 Alexandre Oliva <aoliva@redhat.com>
* elf64-sparc.c (sparc64_elf_relocate_section): Disregard
overflows in the .stab section.
2001-11-14 Daniel Jacobowitz <drow@mvista.com>
* bfd-in.h (bfd_elf32_discard_info): Add prototype.
(bfd_elf64_discard_info): Likewise.
* bfd-in2.h: Regenerate.
* elf-bfd.h (struct elf_reloc_cookie): New.
(struct elf_backend_data): Add elf_backend_discard_info,
elf_backend_ignore_discarded_relocs, and elf_backend_write_section.
(_bfd_elf32_reloc_symbol_deleted_p): Add prototype.
(_bfd_elf64_reloc_symbol_deleted_p): Likewise.
* elf32-mips.c (_bfd_elf32_mips_discard_info): New.
(_bfd_elf32_mips_ignore_discarded_relocs): New.
(_bfd_elf32_mips_write_section): New.
(elf_backend_discard_info): Define.
(elf_backend_ignore_discarded_relocs): Define.
(elf_backend_write_section): Define.
* elfcode.h (elf_bfd_discard_info): Define.
(elf_reloc_symbol_deleted_p): Define.
* elflink.h (elf_link_input_bfd): Check
elf_section_ignore_discarded_relocs. Call
bed->elf_backend_write_section if available.
(elf_reloc_symbol_deleted_p): New.
(elf_bfd_discard_info): New.
(elf_section_ignore_discarded_relocs): New.
* elfxx-target.h (elf_backend_discard_info): Define.
(elf_backend_ignore_discarded_relocs): Define.
(elf_backend_write_section): Define.
(elfNN_bed): Add elf_backend_discard_info,
elf_backend_ignore_discarded_relocs, and
elf_backend_write_section.
* libbfd-in.h (_bfd_discard_section_stabs): Add prototype.
* libbfd.h: Regenerate.
* stabs.c (_bfd_discard_section_stabs): New.
2001-11-14 Martin Schwidefsky <schwidefsky@de.ibm.com>
* elf32-s390.c (elf_s390_relocate_section): Use the "unresolved_reloc"
scheme to get rid of an ugly complicated test.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
2001-11-14 Andreas Jaeger <aj@suse.de>
* cpu-i386.c (bfd_x86_64_arch_intel_syntax,bfd_x86_64_arch): Use
x86-64 for display.
2001-11-14 Jakub Jelinek <jakub@redhat.com>
* dwarf2.c (struct line_head) [total_length]: Change type to
bfd_vma.
(struct dwarf2_debug): Add dwarf_str_buffer and dwarf_str_size.
(struct comp_unit): Add stash and offset_size.
(read_8_bytes): Return bfd_vma.
(read_indirect_string): New.
(read_attribute): Handle DW_FORM_strp.
(decode_line_info): Support 64-bit DWARF format.
(_bfd_dwarf2_find_nearest_line): Likewise.
(parse_comp_unit): Set offset_size and stash.
2001-11-13 Keith Walker <keith.walker@arm.com>
* dwarf2.c (read_attribute_value): New function to handle
DW_FORM_indirect.
(read_attribute): Use it.
2001-11-13 Geoffrey Keating <geoffk@redhat.com>
* dwarf2.c (decode_line_info): Properly deal with unknown standard
opcodes.
2001-11-13 John Marshall <jmarshall@acm.org>
Alan Modra <amodra@bigpond.net.au>
* section.c (bfd_make_section_anyway): Don't increment section_id
and the BFD's section_count if adding the section failed.
* vms.c (vms_new_section_hook): Adjust for bfd_make_section_anyway
change.
2001-11-12 Orjan Friberg <orjanf@axis.com>
* elf32-cris.c (cris_elf_grok_prstatus): Adjust values to match new
core dump format.
2001-11-11 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Call
_bfd_elf_strtab_size instead of _bfd_stringtab_size.
* elf64-sparc.c (sparc64_elf_size_dynamic_sections): Change
dynstr type to `struct elf_strtab_hash *'.
2001-11-11 Hans-Peter Nilsson <hp@bitrange.com>
* elf-strtab.c (_bfd_elf_strtab_finalize): Make first variable i
size_t. Rename second i to j.
2001-11-10 Jeffrey A Law (law@cygnus.com)
* binary.c: Include safe-ctype.h after bfd.h and sysdep.h.
2001-11-10 Alan Modra <amodra@bigpond.net.au>
* elf32-arm.h (elf32_arm_final_link_relocate): Don't copy STN_UNDEF
relocs into shared libs.
* elf32-cris.c (cris_elf_relocate_section): Likewise.
* elf32-i370.c (i370_elf_relocate_section): Likewise.
* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
* elf32-mips.c (mips_elf_calculate_relocation): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
* elf32-sh.c (sh_elf_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
* elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
* elf.c (bfd_section_from_r_symndx): New function.
* elf-bfd.h (LOCAL_SYM_CACHE_SIZE): Define.
(struct sym_sec_cache): New.
(bfd_section_from_r_symndx): Declare.
(struct bfd_elf_section_data): Change local_dynrel type to PTR.
* elflink.h (elf_link_input_bfd): Don't test for removed linkonce
relocs when relocatable. Don't zero entire reloc, just zero the
addend and sym.
* elf32-hppa.c (struct elf32_hppa_link_hash_table): Add sym_sec.
(elf32_hppa_link_hash_table_create): Init it.
(elf32_hppa_check_relocs): Track dynamic relocs needed for local
syms on a per-section basis as we do for globals.
(elf32_hppa_gc_sweep_hook): Update for local_dynrel change.
(allocate_dynrelocs): Warning fix.
(elf32_hppa_size_dynamic_sections): Don't allocate relocs when
section has been discarded.
(elf32_hppa_relocate_section): Don't copy STN_UNDEF relocs
into shared libs.
* elf32-i386.c (struct elf_i386_link_hash_table): Add sym_sec.
(elf_i386_link_hash_table_create): Init it.
(elf_i386_check_relocs): Track dynamic relocs needed for local
syms on a per-section basis as we do for globals.
(elf_i386_gc_sweep_hook): Update for local_dynrel change.
Remove dead code.
(allocate_dynrelocs): Warning fix.
(elf_i386_size_dynamic_sections): Don't allocate relocs when
section has been discarded.
(elf_i386_relocate_section): Don't copy STN_UNDEF relocs
into shared libs.
* elf32-s390.c (struct elf_s390_link_hash_table): Add sym_sec.
(elf_s390_link_hash_table_create): Init it.
(elf_s390_check_relocs): Track dynamic relocs needed for local
syms on a per-section basis as we do for globals.
(elf_s390_gc_sweep_hook): Update for local_dynrel change.
Remove dead code.
(allocate_dynrelocs): Warning fix.
(elf_s390_size_dynamic_sections): Don't allocate relocs when
section has been discarded.
(elf_s390_relocate_section): Don't copy STN_UNDEF relocs
into shared libs.
* elf64-ppc.c (struct ppc_link_hash_table): Add sym_sec.
(ppc64_link_hash_table_create): Init it.
(ppc64_elf_check_relocs): Track dynamic relocs needed for local
syms on a per-section basis as we do for globals.
(ppc64_elf_gc_sweep_hook): Update for local_dynrel change.
(allocate_dynrelocs): Call the correct record_dynamic_dymbol
function. Warning fix.
(ppc64_elf_size_dynamic_sections): Don't allocate relocs when
section has been discarded.
(ppc64_elf_relocate_section): Don't copy STN_UNDEF relocs
into shared libs.
* elf64-s390.c (struct elf_s390_link_hash_table): Add sym_sec.
(elf_s390_link_hash_table_create): Init it.
(elf_s390_check_relocs): Track dynamic relocs needed for local
syms on a per-section basis as we do for globals.
(elf_s390_gc_sweep_hook): Update for local_dynrel change.
Remove dead code.
(allocate_dynrelocs): Warning fix.
(elf_s390_size_dynamic_sections): Don't allocate relocs when
section has been discarded.
(elf_s390_relocate_section): Don't copy STN_UNDEF relocs
into shared libs.
2001-11-08 Martin Schwidefsky <schwidefsky@de.ibm.com>
* elf32-s390: Major rework that introduces all recent changes to
the s390 backends. Get a closer match to elf32-i386.
(elf_s390_relocate_section): Make use of dynamic section short-cuts.
Localise vars, and delay setting. Better error reporting, replace
BFD_ASSERT with abort. Check ELF_LINK_HASH_DEF_DYNAMIC to see if a
symbol is not defined in the regular object file and tread the weak
definition as the normal one. Don't discard relocs for undefweak or
undefined symbols and check !DEF_REGULAR as well as DEF_DYNAMIC in
test for avoided copy relocs. Reinstate fudge for unresolved relocs
in debugging sections.
(elf32_s390_adjust_dynamic_symbol): Handle nocopyreloc. Don't do copy
reloc processing for weakdefs. Remove redundant casts and aborts.
Delay setting of vars until needed. Move creation of dynamic symbols
and allocation of .plt and .rela.plt to allocate_dynrelocs. Replace
BFD_ASSERT with abort. Discard .plt entries for everything with
plt.refcount <= 0.
(elf_s390_check_relocs): Don't allocate space for dynamic relocs,
.got or .relgot here but do it in allocate_dynrelocs. Reference count
possible .plt and .got entries. Don't test input section SEC_READONLY
here to try to avoid copy relocs, and keep dyn_relocs regardless of
ELF_LINK_NON_GOT_REF. Don't set DF_TEXTREL here. Delay setting of
variables until needed. Remove separate switch stmt for creating .got
section. Initialise local_got_refcounts to 0. Cache pointer to
"sreloc" section in elf_section_data. Tweak condition under which .got
created. Report files with bad relocation section names.
(elf_s390_finish_dynamic_symbol): Don't copy relocs for symbols that
have been forced local. Use same test to decide if we can use a
relative reloc for got as elf_s390_relocate_section. Expand SHN_UNDEF
comment. Move expressions out of function calls. Replace BFD_ASSERT
with abort.
(elf_s390_finish_dynamic_sections): Migrate common code out of switch
statement. Replace BFD_ASSERT with abort.
(elf_s390_size_dynamic_sections): Call readonly_dynrelocs. Rename "i"
to "ibfd". Allocate space for local dyn relocs. Use DF_TEXTREL flag
instead of looking up section names for DT_TEXTREL. Replace
BFD_ASSERT with abort. Zero out the dynamic allocated content space.
Add a comment to remind us that one day this ought to be fixed.
(struct elf_s390_link_hash_entry): Rename "root" to "elf".
(struct elf_s390_link_hash_table): Likewise.
(elf_s390_link_hash_newfunc): Rename to link_hash_newfunc and get
rid of unnecessary casts.
(struct elf_s390_dyn_relocs): Add "sec", and "pc_count" fields.
Remove "section" field.
(elf_s390_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
Reference count possible .plt entries. Don't deallocate .got and
.relgot space here.
(struct elf_s390_pcrel_relocs_copied): Rename to elf_s390_dyn_relocs.
Update comment.
(struct elf_s390_link_hash_entry): Rename pcrel_relocs_copied to
dyn_relocs.
(elf_s390_discard_copies): Delete.
(elf_s390_link_hash_traverse): Delete.
(bfd_elf32_bfd_final_link): Delete. (ie. use regular final link
rather than gc variety).
(struct elf_s390_link_hash_table): Add sgot, sgotplt, srelgot, splt,
srelplt, sdynbss, srelbss fields.
(elf_s390_link_hash_table_create): Init them.
(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
(allocate_dynrelocs): New function.
(create_got_section): New function.
(elf_backend_can_refcount): Define.
(elf_backend_copy_indirect_symbol): Define.
(elf_s390_copy_indirect_symbol): New function.
(elf_s390_create_dynamic_sections): New function.
(readonly_dynrelocs): New function.
* elf64-s390.c: Likewise.
2001-11-07 Jakub Jelinek <jakub@redhat.com>
* Makefile.am (BFD32_BACKENDS): Add elf-strtab.lo.
(BFD32_BACKENDS_CFILES): Add elf-strtab.c.
(elf-strtab.lo): Add rule.
* Makefile.in: Rebuilt.
* configure.in (elf): Add elf-strtab.lo.
* configure: Rebuilt.
* elf-bfd.h (elf_strtab_hash): Forward declare.
(struct elf_link_hash_table): Change dynstr type to
struct elf_strtab_hash *.
(struct elf_obj_tdata): Change strtab_ptr type to
struct elf_strtab_hash *.
(_bfd_elf_strtab_init, _bfd_elf_strtab_free, _bfd_elf_strtab_add,
_bfd_elf_strtab_addref, _bfd_elf_strtab_delref,
_bfd_elf_strtab_clear_all_refs, _bfd_elf_strtab_size,
_bfd_elf_strtab_offset, _bfd_elf_strtab_emit,
_bfd_elf_strtab_finalize): New prototypes.
* elf-strtab.c: New file.
* elflink.h (elf_link_add_object_symbols): Use _bfd_elf_strtab_add
and _bfd_elf_strtab_size instead of _bfd_stringtab calls.
Call _bfd_elf_strtab_delref if DT_NEEDED entry is not needed or
when forcing dynamic symbol to local.
(elf_link_create_dynamic_sections): Call
_bfd_elf_strtab_init instead of elf_stringtab_init.
(elf_link_record_local_dynamic_symbol): Likewise, change
dynstr type. Use _bfd_elf_strtab functions instead of
_bfd_stringtab calls.
(size_dynamic_sections): Use _bfd_elf_strtab functions instead of
_bfd_stringtab calls. For DT_RUNPATH and Verdaux vda_name fields,
call _bfd_elf_strtab_addref. Call elf_finalize_dynstr.
(elf_adjust_dynstr_offsets, elf_finalize_dynstr): New functions.
(elf_fix_symbol_flags): Call _bfd_elf_strtab_delref when forcing
dynamic symbol to local.
(elf_link_assign_sym_version): Likewise.
(elf_bfd_final_link): Call _bfd_elf_strtab_emit instead of
_bfd_stringtab_emit.
* elflink.c (_bfd_elf_link_record_dynamic_symbol): Change dynstr
type. Call _bfd_elf_strtab functions instead of
_bfd_stringtab functions.
* elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.
* elf.c (_bfd_elf_init_reloc_shdr): Likewise.
(elf_fake_sections): Likewise.
(assign_section_numbers): Call _bfd_elf_strtab_clear_all_refs
on shstrtab hash table, call _bfd_elf_strtab_addref on each section
name in the output. Call _bfd_elf_strtab_finalize and
use _bfd_elf_strtab_offset to finalize sh_name section header fields.
(_bfd_elf_compute_section_file_positions): Use _bfd_elf_strtab_size
instead of _bfd_stringtab_size.
(prep_headers): Change shstrtab type.
Use _bfd_elf_strtab calls instead of _bfd_stringtab calls.
2001-11-07 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_link_input_bfd <removed linkonce relocs>): Fix
bad symtab segfault. Formatting and warning fixes. Improve
error message for internationalisation.
2001-11-06 H.J. Lu (hjl@gnu.org)
* elflink.h (elf_link_input_bfd): Complain about relocs against
discarded sections.
2001-11-03 Alan Modra <amodra@bigpond.net.au>
* elfxx-target.h (elfNN_bed): Correct want_got_sym, want_dynbss order.
2001-11-02 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_calculate_relocation): Don't create
dynamic relocation for symbols defined in regular objects when
creating executables.
2001-11-02 Nick Clifton <nickc@cambridge.redhat.com>
* configure.in (ALL_LINGUAS): Add "fr".
* configure: Regenerate.
* po/fr.po: New file.
* coffgen.c (coff_object_p): Add comment to H.J.'s recent patch.
2001-11-02 John David Anglin <dave@hiauly1.hia.nrc.ca>
* som.c (setup_sections): Initialize subspace_sections.
2001-11-02 H.J. Lu (hjl@gnu.org)
* coffgen.c (coff_object_p): Return 0 if the header is too big.
2001-11-02 Hans-Peter Nilsson <hp@axis.com>
* elfcore.h (elf_core_file_p): Preserve and clear abfd section
information. Save bfd arch and mach values. Restore on error.
2001-11-02 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (hppa_handle_PIC_calls): Rename to mark_PIC_calls.
(allocate_PIC_calls): New function.
(allocate_dynrelocs): Don't allocate pic_call plt entries here.
(elf32_hppa_size_dynamic_sections): Call allocate_PIC_calls.
(elf32_hppa_finish_dynamic_symbol): Remove dead code.
2001-11-02 Hans-Peter Nilsson <hp@axis.com>
* elf32-cris.c (cris_elf_grok_prstatus): New function.
(cris_elf_grok_psinfo): New function.
(elf_backend_grok_prstatus): Define.
(elf_backend_grok_psinfo): Define.
2001-11-01 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (ppc64_elf_relocate_section): Correct branch
prediction bits.
2001-10-31 Chris Demetriou <cgd@demetriou.com>
* elf32-mips.c (_bfd_mips_elf_hi16_reloc): Handle PC-relative
relocations properly.
2001-10-31 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_output_extsym): Don't clear the visibility
field for relocateable.
2001-11-01 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Don't count
.plt relocs in DT_RELASZ.
2001-10-29 NIIBE Yutaka <gniibe@m17n.org>
* config.bfd: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu
targets.
2001-10-31 Nick Clifton <nickc@cambridge.redhat.com>
* targets.c: Fix typo: bfd_mmo_mmix_vec => bfd_mmo_vec.
2001-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* Makefile.am (ALL_MACHINES): Add cpu-mmix.lo.
(BFD64_BACKENDS): Add elf64-mmix.lo and mmo.lo.
(BFD64_BACKENDS_CFILES): Add elf64-mmix.c and mmo.c.
Regenerate dependencies.
* configure.in (bfd_elf64_mmix_vec, bfd_mmo_vec): New vectors.
* config.bfd: [BFD64] (mmix-*-*): New case.
* cpu-mmix.c, mmo.c, elf64-mmix.c: New files.
* archures.c (enum bfd_architecture): Add bfd_arch_mmix.
(bfd_mmix_arch): Declare.
(bfd_archures_list): Add bfd_mmix_arch.
* targets.c (enum bfd_flavour): Add bfd_target_mmo_flavour.
(bfd_elf64_mmix_vec, bfd_mmo_vec): Declare.
(bfd_target_vect) [BFD64]: Add bfd_elf64_mmix_vec and
bfd_mmo_mmix_vec.
* reloc.c: Add MMIX relocations.
* bfd.c (struct _bfd, tdata): Add mmo_data.
* Makefile.in: Regenerate.
* configure: Regenerate.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* configure: Rebuild.
2001-10-30 Richard Earnshaw (rearnsha@arm.com)
* elf.c (_bfd_elf_make_section_from_shdr): Set the LMA based on the
p_paddr of the segment that contains it.
(copy_private_bfd_data): If the LMA for a segment is known, use it
for matching sections to segments.
(assign_file_positions_for_segments): Use the LMA when adjusting
for inter-section alignment padding.
2001-10-29 Kazu Hirata <kazu@hxi.com>
* README: Fix a typo.
2001-10-24 Richard Henderson <rth@redhat.com>
* peXXigen.c (_bfd_XX_print_private_bfd_data_common): Copy
timestamp to time_t for ctime.
2001-10-24 Hans-Peter Nilsson <hp@axis.com>
* elf32-cris.c (cris_reloc_type_lookup): Change loop to use
unsigned, increasing index.
2001-10-23 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_modify_segment_map): Check
m != NULL before accessing it.
2001-10-23 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_link_input_bfd): Zero the reloc instead of doing
bfd_reloc_type_lookup (bfd, BFD_RELOC_NONE) as bfd_reloc_type_lookup
doesn't accept BFD_RELOC_* on some targets, eg. hppa.
* elf32-hppa.c (elf32_hppa_link_hash_entry): Remove plt_abs.
(hppa_link_hash_newfunc): Likewise.
(elf32_hppa_finish_dynamic_symbol): Likewise.
(allocate_dynrelocs): Always allocate .got relocs if shared.
(elf32_hppa_relocate_section): Output them too. Similarly
consolidate .plt reloc code, and no longer initialise .plt
when a reloc is output.
(elf32_hppa_finish_dynamic_symbol): Only initialise .plt entries
when no reloc is output.
From Herbert Xu <herbert@gondor.apana.org.au>
* elf32-hppa.c (final_link_relocate): Call bfd_set_error for
unreachable branches.
2001-10-22 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Use -L../libiberty for
mips*-*-linux*.
* configure: Rebuild.
2001-10-21 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty
if shared library is enabled only for Linux hosts.
* configure: Rebuild.
2001-10-21 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Check if PICFLAG is defined in
../libiberty/Makefile instead of $enable_shared.
* configure: Rebuild.
2001-10-21 H.J. Lu <hjl@gnu.org>
* elf32-cris.c (cris_reloc_type_lookup): Use int for index. Cover
index 0.
2001-10-20 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty
if shared library is enabled.
* configure: Rebuild.
2001-10-20 H.J. Lu <hjl@gnu.org>
* elf32-cris.c (cris_reloc_type_lookup): Allow index 0.
2001-10-19 H.J. Lu <hjl@gnu.org>
* elfcode.h (elf_object_p): Don't clear D_PAGED if the section
size is empty.
2001-10-18 H.J. Lu <hjl@gnu.org>
* elf32-i370.c (i370_elf_relocate_section): Ignore R_XXX_NONE.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2001-10-18 Jakub Jelinek <jakub@redhat.com>
* section.c (_bfd_strip_section_from_output): Don't count
SEC_EXCLUDE sections as references. Set SEC_EXCLUDE.
2001-10-17 Alan Modra <amodra@bigpond.net.au>
* elf-m10200.c (mn10200_elf_relax_section): Cast assignment to
Elf_Internal_Shdr.contents now that it's no longer a PTR.
* elf-m10300.c (mn10300_elf_relax_section): Likewise.
* elf32-h8300.c (elf32_h8_relax_section): Likewise.
* elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
* elf32-sh.c (sh_elf_relax_section): Likewise.
* elf64-alpha.c (elf64_alpha_relax_section): Likewise.
* elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
* elf.c (setup_group): Warning fixes.
* elflink.h (elf_link_sort_relocs): Likewise.
* pdp11.c (slurp_reloc_table): Likewise.
2001-10-16 Jeff Holcomb <jeffh@redhat.com>
* elflink.h (elf_link_sort_relocs): Remove unnecessary pointer
casts.
2001-10-15 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_input_bfd): Set type to BFD_RELOC_NONE
for relocations against discarded link-once section.
2001-10-15 Alan Modra <amodra@bigpond.net.au>
* elf32-i386.c (elf_i386_relocate_section): Report some detail on
bfd_reloc_outofrange and similar errors.
* elf.c (_bfd_elf_link_hash_copy_indirect): Test ind->root.type
rather than ind->weakdef.
* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
* elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
* elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
* elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
2001-10-15 Alan Modra <amodra@bigpond.net.au>
H.J. Lu <hjl@gnu.org>
* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc
counts for aliases instead of aborting.
* elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset
to -1 for non-function symbols.
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
* elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
* elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
* elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to
plt.offset instead of plt.refcount when setting to -1.
2001-10-12 Nick Clifton <nickc@cambridge.redhat.com>
* elf32-arm.h (elf32_arm_relocate_section): Treat R_ARM_THM_PC22
like R_ARM_PC24. Include reloc number in error message about
unresolvable relocs.
2001-10-10 Jakub Jelinek <jakub@redhat.com>
* elflink.h (elf_link_sort_cmp2): Don't mix PLT and non-PLT
relocations against the same symbol in .rel{,a}.dyn section.
2001-10-10 Kazu Hirata <kazu@hxi.com>
* aout-encap.c: Fix comment typos.
* aoutx.h: Likewise.
* archive.c: Likewise.
* bout.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coff-mips.c: Likewise.
* ecoff.c: Likewise.
* elf32-m32r.c: Likewise.
* libcoff-in.h: Likewise.
* libecoff.h: Likewise.
* libxcoff.h: Likewise.
* nlm32-i386.c: Likewise.
* pdp11.c: Likewise.
* section.c: Likewise.
* som.c: Likewise.
* som.h: Likewise.
* bfd-in2.h: Regenerate.
* libcoff.h: Likewise.
2001-10-10 Alan Modra <amodra@bigpond.net.au>
* elf.c (elf_map_symbols): Don't create new section symbols; Use
existing section syms. Update comments.
(copy_private_bfd_data): Formatting fixes.
(elfcore_grok_win32pstatus): Likewise.
(swap_out_syms): Likewise. Remove unnecessary level of braces.
2001-10-09 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (struct bfd_elf_section_data): Rename "group" to
"group_name".
(elf_group_name): Define.
(elf_next_in_group): Define.
* elf.c: Make use of elf_group_name and elf_next_in_group throughout.
(setup_group): Don't use sec->lineno for SHT_GROUP section to store
first member section; Instead use elf_next_in_group.
(bfd_section_from_shdr): Likewise.
(set_group_contents): Likewise. Use elf_section_syms, not sec->symbol.
2001-10-09 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (struct bfd_elf_section_data): Add "group" and
"next_in_group". Fix gp and gp_size comments.
* elf.c (union elf_internal_group): New.
(setup_group): New function.
(_bfd_elf_make_section_from_shdr): Set BFD flags for SHT_GROUP.
Call setup_group for SHF_GROUP sections.
(bfd_section_from_shdr): Build a BFD section for SHT_GROUP.
(elf_fake_sections): Set header type for SEC_GROUP, and header
flags for sections in a group.
(set_group_contents): New function.
(_bfd_elf_compute_section_file_positions): Call it.
(assign_section_numbers): Set sh_link for SHT_GROUP.
* elflink.h (gc_mark_hook): Handle section groups.
* elfxx-target.h: Add SEC_GROUP to applicable_flags.
* section.c (SEC_GROUP): Define.
(struct sec): Comment fixes.
* bfd-in2.h: Regenerate.
* elf.c (bfd_elf_print_symbol): Formatting fix; migrate expression
out of function args.
(_bfd_elf_canonicalize_reloc): Similarly.
(_bfd_elf_get_symtab): Here too.
(_bfd_elf_canonicalize_dynamic_symtab): And here.
* elfcode.h (elf_slurp_symbol_table): Don't recalculate size for
bfd_bread, and remove unnecessary cast.
2001-10-08 Aldy Hernandez <aldyh@redhat.com>
* config.bfd (targ_cpu): Add arm9e-*-elf.
2001-10-06 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* dwarf2.c (comp_unit_find_nearest_line): Check for end of
compilation unit.
2001-10-06 Alan Modra <amodra@bigpond.net.au>
* bfd.c (bfd_assert): Report bfd version.
(_bfd_abort): Likewise.
* elflink.h (elf_link_input_bfd): Don't zero discarded link-once
section sym values. Instead replace any relocs against them with
relocs against STN_UNDEF, which has a zero value.
* elf32-arc.c (elf_arc_howto_table): Set partial_inplace for all
relocs.
2001-10-05 Jeff Law <law@redhat.com>
* som.h (som_exec_data): New field "version_id".
* som.c (som_object_setup): Record the version_id if it
exists.
(som_prep_headers): Do not initialize version_id here.
(som_finish_writing): Initialize version_id here.
2000-10-05 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf32-mips.c (elf_mips_howto_table): Fix some relocation howtos
according to the MIPS/SGI ELF64 ABI Draft.
(mips_elf_sort_hash_table): Typo.
2001-10-04 Alan Modra <amodra@bigpond.net.au>
* elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Comment typo.
* elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Bail out after
copying flags if this is a weakdef.
2001-10-04 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (struct elf_link_hash_entry): Reorganise for better
packing.
* elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset
to 1 rather than 0 to avoid confusing copy_indirect_symbol.
(mips_elf_sort_hash_table_f): Compare got.offset against 1.
* Makefile.am (BFD_H_DEPS): Add symcat.h. Ensure everything
depends on $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS), not just those
backends we configure. Run "make dep-am".
(install-data-local): Install symcat.h.
* dep-in.sed: Remove symcat.h from dependencies.
* Makefile.in: Regenerate.
2001-10-03 Vassili Karpov <malc@pulsesoft.com>
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Handle nocopyreloc.
2001-10-03 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf64-mips.c (elf_backend_may_use_rela_p): New define.
(elf_backend_default_use_rela_p): New define.
2001-10-03 Alan Modra <amodra@bigpond.net.au>
* elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Fix typos in last
change.
* configure.in (AC_OUTPUT <bfd-in3.h>): Remove version.h.
* configure: Regenerate.
* Makefile.am (BFD_H_FILES): Add version.h.
* Makefile.in: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
* elflink.h (elf_fix_symbol_flags): Copy flags to weakdef using
elf_backend_copy_indirect_symbol so that backend has a chance to
copy other necessary fields.
* elf-bfd.h (struct elf_backend_data): Update description of
elf_backend_copy_indirect_symbol.
* elf.c (_bfd_elf_link_hash_copy_indirect): Bail out after
copying flags if this is a weakdef.
* elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
(elfNN_ia64_aix_add_symbol_hook): Use elf_link_hash_lookup rather
than bfd_link_hash_lookup.
* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't do copy
reloc processing for weakdefs.
* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
2001-10-02 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (ppc64_elf_check_relocs): Use a local var and cast
result of ELF64_R_TYPE to enum before using in a switch.
(ppc64_elf_gc_mark_hook): Likewise.
(ppc64_elf_gc_sweep_hook): Likewise.
(ppc64_elf_reloc_type_class): Likewise.
2001-10-02 Alan Modra <amodra@bigpond.net.au>
* version.h: New file.
* bfd-in.h: (BFD_VERSION): Substitute bfd_version.
(BFD_VERSION_DATE): Define.
(BFD_VERSION_STRING): Define.
* configure.in: AC_SUBST bfd_version, bfd_version_date and
bfd_version_string.
(AC_OUTPUT <bfd-in3.h>): Depend on version.h.
* bfd-in2.h: Regenerate.
* configure: Regenerate.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
* bfd-in.h: Include "symcat.h".
(CONCAT4): Redefine as for old CAT4.
* aout-arm.c: Use equivalent CONCAT* macro in place of CAT* macros.
Add warning regarding whitespace.
* aout-cris.c: Likewise.
* aout-ns32k.c: Likewise.
* aout-sparcle.c: Likewise.
* aout-tic30.c: Likewise.
* aout0.c: Likewise.
* armnetbsd.c: Likewise.
* demo64.c: Likewise.
* elf-bfd.h: Likewise.
* gen-aout.c: Likewise.
* host-aout.c: Likewise.
* hp300bsd.c: Likewise.
* hp300hpux.c: Likewise.
* i386aout.c: Likewise.
* i386bsd.c: Likewise.
* i386dynix.c: Likewise.
* i386freebsd.c: Likewise.
* i386linux.c: Likewise.
* i386lynx.c: Likewise.
* i386mach3.c: Likewise.
* i386netbsd.c: Likewise.
* libaout.h: Likewise.
* m68k4knetbsd.c: Likewise.
* m68klinux.c: Likewise.
* m68klynx.c: Likewise.
* m68knetbsd.c: Likewise.
* m88kmach3.c: Likewise.
* mipsbsd.c: Likewise.
* newsos3.c: Likewise.
* ns32knetbsd.c: Likewise.
* pc532-mach.c: Likewise.
* pdp11.c: Likewise.
* riscix.c: Likewise.
* sparclinux.c: Likewise.
* sparclynx.c: Likewise.
* sparcnetbsd.c: Likewise.
* sunos.c: Likewise.
* targets.c: Likewise.
* vaxnetbsd.c: Likewise.
* vms-hdr.c: Likewise.
2001-10-01 Alan Modra <amodra@bigpond.net.au>
* bfd-in.h: Remove comments regarding generated files.
* libbfd-in.h: Likewise.
* libcoff-in.h: Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Likewise.
* libcoff.h: Likewise.
2001-09-30 kaz Kojima <kkojima@rr.iij4u.or.jp>
Hans-Peter Nilsson <hp@bitrange.com>
* elf32-sh.c (sh_elf_howto_table, R_SH_REL32): Make
partial_inplace, matching assembler output. Set src_mask to
all ones.
(sh_elf_relocate_section): Delete misplaced comment.
For relocatable linking against section symbol, call
_bfd_relocate_contents for partial_inplace relocs and adjust
rel->r_addend for others.
<case R_SH_DIR32, R_SH_REL32>: Fetch partial_inplace addend with
bfd_get_32, not at rel->r_addend.
2001-09-30 Alan Modra <amodra@bigpond.net.au>
* elf.c (_bfd_elf_link_hash_copy_indirect): Set ind refcounts to
the old dir refcount, so we indirectly set them to init_refcount.
Short-circuit asserts when we've just verified they are true.
2001-09-29 Alan Modra <amodra@bigpond.net.au>
* section.c (struct sec): Remove kept_section.
(STD_SECTION): Remove kept_section initialisation.
(bfd_make_section_anyway): Here too.
* ecoff.c (bfd_debug_section): Remove kept_section initialisation.
* cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section.
* elflink.h (elf_link_input_bfd): Set discarded link-once section
symbols to zero, and remove all code involved with kept_section
and tracking section symbol values.
* bfd-in2.h: Regenerate.
* configure.in: Bump version number.
* configure: Regenerate.
2001-09-29 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (struct ppc_dyn_relocs): New.
(IS_ABSOLUTE_RELOC): Define.
(struct ppc_link_hash_entry): New.
(struct ppc_link_hash_table): New.
(ppc_hash_table): Define.
(link_hash_newfunc): New function.
(ppc64_elf_link_hash_table_create): New function.
(create_got_section): New function.
(ppc64_elf_create_dynamic_sections): Call create_got_section. Stash
pointers to our dynamic sections in hash table.
(ppc64_elf_copy_indirect_symbol): New function.
(ppc64_elf_check_relocs): Remove DEBUG code. Use short-cuts to
dynamic sections. Localise vars. Modify code for refcounts
starting from zero. Don't allocate here, or force symbols dynamic.
Don't copy all relocs if shared, select ones we need. Add code
to track possible copy relocs for non-shared link.
(ppc64_elf_gc_mark_hook): Update comment.
(ppc64_elf_gc_sweep_hook): Sweep dynrelocs too.
(ppc64_elf_adjust_dynamic_symbol): Remove DEBUG code. Rewrite .plt
code for reference counting garbage collection. Don't create .plt
entries for functions that don't comply with ABI naming convention,
and don't allocate .plt space here. Use short-cuts to dynamic
sections. If possible, keep dynamic relocations instead of using
copy relocs. Remove confused comments.
(ppc_adjust_dynindx): Delete.
(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
(allocate_dynrelocs): New function.
(readonly_dynrelocs): New function.
(ppc64_elf_size_dynamic_sections): Rewrite. Allocate local .got
space here, and call allocate_dynrelocs to allocate space for
global .plt, .got and reloc sections. Use short-cuts to dynamic
sections. Call readonly_dynrelocs to determine whether we need
DT_TEXTREL. Don't generate section symbols here, the generic
ELF linker code does it for us.
(ppc64_elf_final_link): Call regular ELF backend linker rather than
gc variety, since we do our own .got handling.
(ppc64_elf_relocate_section): Remove DEBUG code. Make use of
dynamic section short-cuts. Localise vars, and delay setting.
Handle unknown relocs in main switch statement. Replace ugly
complicated tests for unresolvable relocs with a simple direct
scheme using "unresolved_reloc" var. Test ELF_ST_VISIBILITY
before allowing an undefined sym in a shared lib. Do R_*_DS tests
after main switch, when we've set addend. Do non-addend insn
tweaks before main swithc. Ignore input_section->vma when
calculating reloc offsets as it's always zero. Rewrite dynamic
reloc handling. Consolidate R_*_HA handling. Handle more relocs.
(ppc64_elf_finish_dynamic_symbol): Remove DEBUG code. Make use
of dynamic section short-cuts. Reorganise .plt handling code.
Remove confused comments. Take note of ELF_LINK_FORCED_LOCAL.
Move expressions out of swap_reloca_out function calls.
(ppc64_elf_reloc_type_class): New function.
(ppc64_elf_info_to_howto): Move common expression to local var.
(ppc64_elf_finish_dynamic_sections): Remove DEBUG code. Make use
of dynamic section short-cuts. Don't fiddle with section syms
here as the ELF linker does it for us.
(elf_backend_can_refcount): Define.
(bfd_elf64_bfd_link_hash_table_create): Define.
(elf_backend_copy_indirect_symbol): Define.
(elf_backend_reloc_type_class): Define.
(elf_backend_*, bfd_elf64_bfd_* defines): Sort.
2001-09-29 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (struct elf_link_local_dynamic_entry): Add init_refcount.
(struct elf_backend_data): Add can_refcount.
* elf.c (_bfd_elf_link_hash_newfunc): Get rid of a few casts. Set
got.refcount and plt.refcount from init_refcount.
(_bfd_elf_link_hash_table_init): Set up init_refcount.
(_bfd_elf_link_hash_copy_indirect): Reference got/plt.refcount
rather than got/plt.offset, and test for <= 0 rather than -1.
* elflink.h (size_dynamic_sections): Set init_refcount to -1.
* elfxx-target.h (elf_backend_can_refcount): Define.
(elfNN_bed): Init can_refcount.
* linker.c (_bfd_link_hash_newfunc): Get rid of a few casts.
(_bfd_generic_link_hash_newfunc): Likewise.
* elf32-cris.c (cris_elf_check_relocs): Modify for refcounts
starting from zero.
(elf_backend_can_refcount): Define.
* elf32-hppa.c (elf32_hppa_check_relocs): Modify for refcounts
starting from zero.
(elf32_hppa_copy_indirect_symbol): Make static to agree with
prototype.
(elf_backend_can_refcount): Define.
* elf32-i386.c (elf_i386_check_relocs): Modify for refcounts
starting from zero.
(allocate_dynrelocs): Set plt/got.offset rather than *.refcount.
(elf_i386_finish_dynamic_symbol): Expand SHN_UNDEF comment.
(elf_i386_finish_dynamic_sections): Use local var so line < 80 chars.
(elf_backend_can_refcount): Define.
(elf_i386_copy_indirect_symbol): Make static to agree with
prototype. Formatting fix.
* elf32-m68k.c (elf_m68k_check_relocs): Modify for refcounts
starting from zero.
(elf_backend_can_refcount): Define.
* elf32-ppc.c (ppc_elf_check_relocs): Modify for refcounts
starting from zero.
(elf_backend_can_refcount): Define.
* elf32-s390.c (elf_s390_check_relocs): Modify for refcounts
starting from zero.
(elf_backend_can_refcount): Define.
* elf64-s390.c (elf_s390_check_relocs): Modify for refcounts
starting from zero.
(elf_backend_can_refcount): Define.
* elf64-x86-64.c (elf64_x86_64_check_relocs): Modify for refcounts
starting from zero.
(elf_backend_can_refcount): Define.
* som.c (som_write_symbol_strings): Cast current_offset in
bfd_seek call to match param type.
2001-09-28 J. Brobecker <brobecker@gnat.com>
* som.c (som_write_symbol_strings): Fix incorrect type of
current_offset to match the function definition. Fixes a build
failure on HPUX-11.00.
2001-09-28 Richard Henderson <rth@redhat.com>
* elfxx-target.h [section_flags]: Add SEC_ARCH_BIT_0, SEC_SMALL_DATA,
SEC_MERGE, SEC_STRINGS.
* section.c (SEC_ARCH_BIT_0): New; replace unused SEC_BALIGN.
* bfd-in2.h: Rebuild.
2001-09-28 Alan Modra <amodra@bigpond.net.au>
* elf64-x86-64.c (elf64_x86_64_reloc_type_lookup): Don't map bfd
reloc code using x86_64_reloc_map.
* elf32-hppa.c (elf32_hppa_check_relocs): Update comment since we
no longer allocate here. Localise some vars to blocks where they
are used.
(elf32_hppa_adjust_dynamic_symbol): Correct a comment. Delay
setting of vars until needed.
(allocate_dynrelocs): Don't create a .plt entry without a reloc
when symbol visibilty makes a function local.
(elf32_hppa_finish_dynamic_symbol): Move expressions out of
swap_reloca_out function calls.
(elf32_hppa_relocate_section): Likewies. Comment typo fix.
(elf32_hppa_finish_dynamic_sections): Migrate common code out of
switch statement.
* elf32-i386.c (elf_i386_check_relocs): Update comment since we
no longer allocate here. Localise some vars to blocks where they
are used. Remove separate switch stmt for creating .got sec.
(elf_i386_adjust_dynamic_symbol): Correct a comment. Remove
redundant casts and aborts. Delay setting of vars until needed.
(allocate_dynrelocs): Remove redundant casts and aborts.
(elf_i386_size_dynamic_sections): Move comment.
(elf_i386_finish_dynamic_symbol): Move expressions out of function
calls.
(elf_i386_relocate_section): Likewise. Comment typo fix.
(elf_i386_finish_dynamic_sections): Migrate common code out of
switch statement.
(elf_backend_* defines): Sort.
* elf32-i386.c (allocate_dynrelocs): Don't create a .plt entry
without a reloc when symbol visibilty makes a function local.
2001-09-27 Nick Clifton <nickc@cambridge.redhat.com>
* elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix detection of
conflicting float flags.
2001-09-26 Alan Modra <amodra@bigpond.net.au>
* elf32-i386 (elf_i386_copy_indirect_symbol): New function.
(elf_backend_copy_indirect_symbol): Define.
(struct elf_i386_link_hash_entry): Rename "root" to "elf".
(struct elf_i386_link_hash_table): Likewise.
(link_hash_newfunc): Get rid of unnecessary casts.
(elf_i386_link_hash_table_create): Likewise.
(elf_i386_check_relocs): Initialise local_got_refcounts to 0.
Don't test input section SEC_READONLY here to try to avoid copy
relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF.
(elf_i386_adjust_dynamic_symbol): Check output section SEC_READONLY
here to properly test whether we need copy relocs. Do so for weak
syms too.
* elf32-hppa (elf32_hppa_copy_indirect_symbol): New function.
(elf_backend_copy_indirect_symbol): Define.
(struct elf32_hppa_link_hash_table): Rename "root" to "elf".
(stub_hash_newfunc): Get rid of unnecessary casts.
(hppa_link_hash_newfunc): Likewise.
(elf32_hppa_check_relocs): Initialise local_got_refcounts to 0.
Don't test input section SEC_READONLY here to try to avoid copy
relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF.
(elf32_hppa_adjust_dynamic_symbol): Check output section SEC_READONLY
here to properly test whether we need copy relocs. Do so for weak
syms too.
2001-09-26 Alan Modra <amodra@bigpond.net.au>
* bfd.c (_bfd_default_error_handlerl): Define using VPARAMS,
VA_OPEN, VA_FIXEDARG, VA_CLOSE.
(bfd_archive_filename): Cast bfd_malloc arg to the correct size.
2001-09-25 Jakub Jelinek <jakub@redhat.com>
* elf64-sparc.c (sparc64_elf_build_plt): Fix .plt[32768+] slot
computation.
2001-09-25 H.J. Lu <hjl@gnu.org>
* bfd-in2.h: Regenerated.
2001-09-25 Alan Modra <amodra@bigpond.net.au>
* elf32-i386.c: Add comment re linker function names and ordering.
(elf_i386_link_hash_newfunc): Rename to link_hash_newfunc.
(elf_i386_grok_prstatus): Move before linker functions.
(elf_i386_grok_psinfo): Likewise.
(elf_i386_fake_sections): Move so that functions are ordered.
(elf_i386_reloc_type_class): Likewise. Comment function purpose.
2001-09-25 Alan Modra <amodra@bigpond.net.au>
* elf32-hppa.c: Rename occurrences of "hplink" to "htab"
throughout file.
* elf32-hppa.c: (LONG_BRANCH_PIC_IN_SHLIB): Delete. Remove all
code handling this option.
(LONG_BRANCH_VIA_PLT): Likewise.
(RELATIVE_DYNRELOCS): Define as zero.
(struct elf32_hppa_dyn_reloc_entry): Add "sec", and
"pc_count" fields. Remove "section" field.
(elf32_hppa_link_hash_entry): Rename reloc_entries to dyn_relocs.
(elf32_hppa_check_relocs): Don't allocate space for dynamic
relocs here. Instead, record all needed dynamic relocs via
dyn_relocs and local_dynrel. Cache pointer to "sreloc" section
in elf_section_data.
(elf32_hppa_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
(allocate_plt_and_got_and_discard_relocs): Rename to
allocate_dynrelocs. Allocate rather than discarding dyn relocs.
(readonly_dynrelocs): New function.
(elf32_hppa_size_dynamic_sections): Mark output_bfd unused.
Call readonly_dynrelocs to determine need for DT_TEXTREL.
Rename "i" to "ibfd". Allocate space for local dyn relocs.
(elf32_hppa_relocate_section): Make use of cached sreloc.
(elf32_hppa_reloc_type_class): New function.
(elf_backend_reloc_type_class): Define.
2001-09-25 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (struct bfd_elf_section_data): Add "local_dynrel"
and "sreloc" fields.
* elf32-i386.c (struct elf_i386_dyn_relocs): Add "sec", and
"pc_count" fields. Remove "section" field.
(elf_i386_check_relocs): Don't set DF_TEXTREL here. Don't
allocate space for dynamic relocs here. Instead, record all
needed dynamic relocs via dyn_relocs and local_dynrel. Cache
pointer to "sreloc" section in elf_section_data.
(elf_i386_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
(allocate_plt_and_got_and_discard_relocs): Rename to
allocate_dynrelocs. Allocate rather than discarding dyn relocs.
(readonly_dynrelocs): New function.
(elf_i386_size_dynamic_sections): Call readonly_dynrelocs.
Rename "i" to "ibfd". Allocate space for local dyn relocs.
(elf_i386_relocate_section): Make use of cached sreloc.
2001-09-24 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire
reloc rather than just the type.
(_bfd_elf_reloc_type_class): Likewise.
* elf.c (_bfd_elf_reloc_type_class): Likewise.
* elf32-arm.h (elf32_arm_reloc_type_class): Likewise.
* elf32-cris.c (elf_cris_reloc_type_class): Likewise.
* elf32-i386.c (elf_i386_reloc_type_class): Likewise.
* elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise.
* elf32-ppc.c (ppc_elf_reloc_type_class): Likewise.
* elf32-s390.c (elf_s390_reloc_type_class): Likewise.
* elf32-sh.c (sh_elf_reloc_type_class): Likewise.
* elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise.
* elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise.
* elf64-s390.c (elf_s390_reloc_type_class): Likewise.
* elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise.
* elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise.
* elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise.
* elflink.h: Formatting fixes.
(elf_link_sort_relocs): Make "count" and "size" bfd_size_type.
Call bfd_zmalloc rather than calloc. Remove unnecessary cast of
o->contents to PTR. Update call to elf_backend_reloc_type_class.
2001-09-22 John Reiser <jreiser@BitWagon.com>
* elfcode.h (elf_object_p): Allow for no section header at all in
non-ET_REL files. Honor 0 for e_shnum, e_shstrndx, e_shoff.
2001-09-21 Nick Clifton <nickc@cambridge.redhat.com>
* elfxx-ia64.c: Fix compile time warning messages.
* coff-mcore.c: Fix compile time warning messages.
* coff-ppc.c: Fix compile time warning messages.
* coffcode.h: Fix compile time warning messages.
* elf32-mips.c: Fix compile time warning messages.
* elf64-alpha.c: Fix compile time warning messages.
* libbfd.c: Fix compile time warning messages.
* bfd-in2.h: Regenerate.
2001-09-21 Alan Modra <amodra@bigpond.net.au>
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
* aoutx.h: Formatting fixes.
* merge.c (_bfd_merged_section_offset): Break line at 80 chars.
* linker.c: Replace bfd_get_filename with bfd_archive_filename
in error message.
2001-09-21 Alan Modra <amodra@bigpond.net.au>
* bfd.c (bfd_archive_filename): New function.
* bfd-in2.h: Regenerate.
* aout-adobe.c: Replace bfd_get_filename with bfd_archive_filename
in error messages where the bfd is an input bfd.
* aout-cris.c: Likewise.
* coff-arm.c: Likewise.
* coff-mcore.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-tic80.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* ecofflink.c: Likewise.
* elf-hppa.h: Likewise.
* elf.c: Likewise.
* elf32-arm.h: Likewise.
* elf32-cris.c: Likewise.
* elf32-gen.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-i370.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-mcore.c: Likewise.
* elf32-mips.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-sparc.c: Likewise.
* elf32-v850.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-gen.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
* elflink.h: Likewise.
* elfxx-ia64.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* libbfd.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* peicode.h: Likewise.
* srec.c: Likewise.
* xcofflink.c: Likewise.
* elf32-arm.h: Make _bfd_error_handler calls K&R compatible.
* elflink.c (_bfd_elf_create_linker_section): Better grammar for
error message.
* coff-mcore.c (coff_mcore_relocate_section): Internalionalise
error message.
* elf64-sparc.c (sparc64_elf_add_symbol_hook): Constify stt_types.
Consolidate error messages, and split long messages to two lines.
2001-09-20 John Reiser <jreiser@BitWagon.com>
* elf32-i386.c (elf_i386_relocate_section): Coordinate info->symbolic
and info->allow_shlib_undefined.
* elf32-cris.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-mips.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-sparc.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
* elfxx-ia64.c: Likewise.
2001-09-18 Bruno Haible <haible@clisp.cons.org>
* aoutx.h: Include "safe-ctype.h" instead of <ctype.h>.
(aout_link_write_symbols): Use ISDIGIT instead of isdigit.
* archive.c: Include "safe-ctype.h" instead of <ctype.h>.
(_bfd_generic_read_ar_hdr_mag): Use ISDIGIT instead of isdigit.
* archures.c: Include "safe-ctype.h" instead of <ctype.h>.
(bfd_default_scan): Use ISDIGIT instead of isdigit.
* bfd.c: Include "safe-ctype.h" instead of <ctype.h>.
(bfd_scan_vma): Use ISXDIGIT/ISDIGIT/ISLOWER instead of
isxdigit/isdigit/islower.
* binary.c: Include "safe-ctype.h" instead of <ctype.h>.
(mangle_name): Use ISALNUM instead of isalnum.
* cpu-v850.c: Include "safe-ctype.h" instead of <ctype.h>.
(scan): Use ISDIGIT instead of isdigit.
* hosts/alphavms.h: Don't include <ctype.h>.
* ieee.c: Include "safe-ctype.h" instead of <ctype.h>.
(ieee_object_p): Use TOUPPER instead of toupper.
* ihex.c: Include "safe-ctype.h" instead of <ctype.h>.
(ihex_bad_byte): Use ISPRINT instead of isprint.
* merge.c: Don't include <ctype.h>.
* oasys.c: Include "safe-ctype.h" instead of <ctype.h>.
(oasys_write_sections): Use ISDIGIT instead of isdigit.
* pdp11.c: Include "safe-ctype.h" instead of <ctype.h>.
(aout_link_write_symbols): Use ISDIGIT instead of isdigit.
* ppcboot.c: Include "safe-ctype.h" instead of <ctype.h>.
(mangle_name): Use ISALNUM instead of isalnum.
* som.c: Include "safe-ctype.h" instead of <ctype.h>.
(som_set_reloc_info): Use ISUPPER/ISLOWER/ISDIGIT instead of
isupper/islower/isdigit.
(som_decode_symclass): Use TOUPPER instead of toupper.
* srec.c: Include "safe-ctype.h" instead of <ctype.h>.
(srec_bad_byte): Use ISPRINT instead of isprint.
(srec_scan): Use ISSPACE instead of isspace.
* stabs.c: Include "safe-ctype.h" instead of <ctype.h>.
(_bfd_link_section_stabs): Use ISDIGIT instead of isdigit.
* syms.c: Include "safe-ctype.h"
(islower, toupper): Remove macro definitions.
(bfd_decode_symclass): Use TOUPPER instead of toupper.
* vms-gsd.c: Don't include <ctype.h>.
* vms-hdr.c: Include "safe-ctype.h" instead of <ctype.h>.
(_bfd_vms_write_hdr): Use ISLOWER/TOUPPER instead of
islower/toupper.
* vms-tir.c: Don't include <ctype.h>.
2001-09-18 Alan Modra <amodra@bigpond.net.au>
* libbfd.c (bfd_bread): New function replacing bfd_read without
redundant params. Allow reads up to (size_t) -2 in length.
(bfd_bwrite): Similarly for bfd_write.
(real_read): Return a size_t.
(bfd_read): Call bfd_bread.
(bfd_write): Call bfd_bwrite.
(warn_deprecated): New function to annoy everybody.
(bfd_get_file_window): Don't call bfd_set_error unnecessarily.
* bfd-in.h (bfd_bread, bfd_bwrite, warn_deprecated): Declare.
(bfd_read, bfd_write): Define as macro.
* aix386-core.c: Replace calls to bfd_read with bfd_bread, and
likewise for bfd_write. Ensure function args are correct size by
using casts or local vars. In some cases, remove unnecessary
casts. Formatting fixes, in some cases removing a large expression
from function args by using a local var. Replace CONST with const.
Modify variable types to avoid warings. Use casts to avoid
warnings when using negative numbers in unsigned expressions.
* aout-adobe.c: Likewise.
* aout-arm.c: Likewise.
* aout-cris.c: Likewise.
* aout-encap.c: Likewise.
* aout-ns32k.c: Likewise.
* aout-target.h: Likewise.
* aout-tic30.c: Likewise.
* aoutf1.h: Likewise.
* aoutx.h: Likewise.
* archive.c: Likewise.
* archures.c: Likewise.
* bfd-in.h: Likewise.
* bfd.c: Likewise.
* binary.c: Likewise.
* bout.c: Likewise.
* cache.c: Likewise.
* cisco-core.c: Likewise.
* coff-a29k.c: Likewise.
* coff-alpha.c: Likewise.
* coff-arm.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-i386.c: Likewise.
* coff-i860.c: Likewise.
* coff-i960.c: Likewise.
* coff-ia64.c: Likewise.
* coff-m68k.c: Likewise.
* coff-m88k.c: Likewise.
* coff-mcore.c: Likewise.
* coff-mips.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-sparc.c: Likewise.
* coff-stgo32.c: Likewise.
* coff-tic30.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-tic80.c: Likewise.
* coff-w65.c: Likewise.
* coff-z8k.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coffswap.h: Likewise.
* corefile.c: Likewise.
* cpu-arc.c: Likewise.
* cpu-h8300.c: Likewise.
* cpu-h8500.c: Likewise.
* cpu-i960.c: Likewise.
* cpu-ia64-opc.c: Likewise.
* cpu-ns32k.c: Likewise.
* cpu-pdp11.c: Likewise.
* cpu-pj.c: Likewise.
* cpu-sh.c: Likewise.
* cpu-w65.c: Likewise.
* cpu-z8k.c: Likewise.
* dwarf1.c: Likewise.
* dwarf2.c: Likewise.
* ecoff.c: Likewise.
* ecofflink.c: Likewise.
* ecoffswap.h: Likewise.
* elf-bfd.h: Likewise.
* elf-hppa.h: Likewise.
* elf-m10200.c: Likewise.
* elf-m10300.c: Likewise.
* elf.c: Likewise.
* elf32-arc.c: Likewise.
* elf32-arm.h: Likewise.
* elf32-avr.c: Likewise.
* elf32-cris.c: Likewise.
* elf32-fr30.c: Likewise.
* elf32-gen.c: Likewise.
* elf32-h8300.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-i370.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-i860.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-mcore.c: Likewise.
* elf32-mips.c: Likewise.
* elf32-openrisc.c: Likewise.
* elf32-pj.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-sh-lin.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-sparc.c: Likewise.
* elf32-v850.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-mips.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
* elfarm-nabi.c: Likewise.
* elfcode.h: Likewise.
* elfcore.h: Likewise.
* elflink.c: Likewise.
* elflink.h: Likewise.
* elfxx-ia64.c: Likewise.
* elfxx-target.h: Likewise.
* format.c: Likewise.
* hash.c: Likewise.
* hp300hpux.c: Likewise.
* hppabsd-core.c: Likewise.
* hpux-core.c: Likewise.
* i386aout.c: Likewise.
* i386dynix.c: Likewise.
* i386linux.c: Likewise.
* i386lynx.c: Likewise.
* i386mach3.c: Likewise.
* i386msdos.c: Likewise.
* i386os9k.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* irix-core.c: Likewise.
* libaout.h: Likewise.
* libbfd-in.h: Likewise.
* libbfd.c: Likewise.
* libcoff-in.h: Likewise.
* libecoff.h: Likewise.
* libieee.h: Likewise.
* libnlm.h: Likewise.
* libpei.h: Likewise.
* libxcoff.h: Likewise.
* linker.c: Likewise.
* lynx-core.c: Likewise.
* m68klinux.c: Likewise.
* merge.c: Likewise.
* mipsbsd.c: Likewise.
* netbsd-core.c: Likewise.
* nlm.c: Likewise.
* nlm32-alpha.c: Likewise.
* nlm32-i386.c: Likewise.
* nlm32-ppc.c: Likewise.
* nlm32-sparc.c: Likewise.
* nlmcode.h: Likewise.
* nlmswap.h: Likewise.
* ns32k.h: Likewise.
* oasys.c: Likewise.
* opncls.c: Likewise.
* osf-core.c: Likewise.
* pc532-mach.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* peXXigen.c: Likewise.
* peicode.h: Likewise.
* ppcboot.c: Likewise.
* ptrace-core.c: Likewise.
* reloc.c: Likewise.
* reloc16.c: Likewise.
* riscix.c: Likewise.
* rs6000-core.c: Likewise.
* sco5-core.c: Likewise.
* section.c: Likewise.
* som.c: Likewise.
* sparclinux.c: Likewise.
* sparclynx.c: Likewise.
* srec.c: Likewise.
* stabs.c: Likewise.
* sunos.c: Likewise.
* syms.c: Likewise.
* targets.c: Likewise.
* tekhex.c: Likewise.
* trad-core.c: Likewise.
* versados.c: Likewise.
* vms-gsd.c: Likewise.
* vms-hdr.c: Likewise.
* vms-misc.c: Likewise.
* vms-tir.c: Likewise.
* vms.c: Likewise.
* vms.h: Likewise.
* xcofflink.c: Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
* bfd.c (struct _bfd): Make "where" and "origin" unsigned.
* bfd-in.h (file_ptr): Change from a long int to a bfd_signed_vma.
(ufile_ptr): Define.
(bfd_tell): Return a ufile_ptr.
* libbfd.c (bfd_tell): Likewise.
(bfd_seek): Use bfd_size_type locals. Don't call bfd_set_error
unnecessarily.
* aix386-core.c: Test != 0 for bfd_seek errors rather than < 0.
* aoutf1.h: Likewise.
* som.c: Likewise.
* cache.c (bfd_cache_lookup_worker): Guard against abfd->where
larger than unsigned long can represent.
* libbfd.c (bfd_malloc): Take a bfd_size_type arg. Error if
size overflows size_t.
(bfd_realloc): Likewise.
(bfd_zmalloc): Likewise.
* opncls.c (bfd_alloc): Likewise.
(bfd_zalloc): Likewise.
* libbfd-in.h (bfd_malloc, bfd_realloc, bfd_zmalloc): Update.
(bfd_alloc, bfd_zalloc): Update.
* libbfd.c (bfd_get_8): Mask with 0xff in case char is more than
8 bits.
(bfd_get_signed_8): Likewise.
(H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8,
H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8,
H_GET_64, H_GET_32, H_GET_16, H_GET_8,
H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Define and use.
* libaout.h: Likewise define and use here.
* aout-adobe.c: Use H_GET_* and H_PUT_* macros.
* aout-arm.c: Likewise.
* aout-encap.c: Likewise.
* aout-ns32k.c: Likewise.
* aout-tic30.c: Likewise.
* aoutf1.h: Likewise.
* aoutx.h: Likewise.
* bout.c: Likewise.
* coff-alpha.c: Likewise.
* coff-h8300.c: Likewise.
* coff-h8500.c: Likewise.
* coff-i960.c: Likewise.
* coff-ia64.c: Likewise.
* coff-m88k.c: Likewise.
* coff-mips.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-sparc.c: Likewise.
* coff-stgo32.c: Likewise.
* coff-tic30.c: Likewise.
* coff-tic80.c: Likewise.
* coff-w65.c: Likewise.
* coff-z8k.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coffswap.h: Likewise.
* ecoff.c: Likewise.
* ecoffswap.h: Likewise.
* elf.c: Likewise.
* elf32-mips.c: Likewise.
* elf64-mips.c: Likewise.
* hp300hpux.c: Likewise.
* i386dynix.c: Likewise.
* i386lynx.c: Likewise.
* i386msdos.c: Likewise.
* i386os9k.c: Likewise.
* libpei.h: Likewise.
* nlm32-alpha.c: Likewise.
* nlm32-i386.c: Likewise.
* nlm32-ppc.c: Likewise.
* nlmcode.h: Likewise.
* nlmswap.h: Likewise.
* oasys.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* peXXigen.c: Likewise.
* peicode.h: Likewise.
* riscix.c: Likewise.
* sunos.c: Likewise.
* xcofflink.c: Likewise.
* elfcode.h: (put_word, get_word, put_signed_word, get_signed_word):
Rename to H_PUT_WORD, H_GET_WORD, H_PUT_SIGNED_WORD, H_GET_SIGNED_WORD.
* coff-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Don't define. Use
equivalent H_PUT_* macro instead.
(GETWORD, GETHALF, GETBYTE): Similarly.
* coff64-rs6000.c (PUTWORD, PUTHALF, PUTBYTE): Likewise.
(GETWORD, GETHALF, GETBYTE): Likewise.
* coffswap.h (PUTWORD, PUTHALF, PUTBYTE): Likewise.
* bfd-in.h (struct orl): Change "pos" to a union.
* archive.c (_bfd_compute_and_write_armap): Use it instead of casts.
(bsd_write_armap): Here too.
(coff_write_armap): And here.
* coff-rs6000.c (xcoff_write_armap_old): And here.
(xcoff_write_one_armap_big): And here.
(xcoff_write_armap_big): And here.
* ecoff.c (_bfd_ecoff_write_armap): And here.
* elf64-mips.c (mips_elf64_write_armap): And here.
* aoutf1.h (sunos_set_arch_mach): Make "mach" param an enum.
* elf-m10300.c (elf_mn10300_mach): Return an unsigned long.
* elf32-h8300.c (elf32_h8_mach): Likewise.
* elf32-mips.c (elf_mips_mach): Likewise.
* sparclynx.c (NAME(lynx,set_arch_mach)): Likewise.
* aix386-core.c (aix386_core_file_p): Remove redundant bfd_release
calls.
(aix386_core_vec): Typo fix.
* aout-arm.c: Include libaout.h and aout/aout64.h after N_TXTADDR
etc. to avoid redefined macro warning.
(MY(put_reloc)): Use bfd_vma for "value" rather than long.
(MY(fix_pcrel_26)): Likewise.
* aout-ns32k.c (MY(put_reloc)): Likewise.
* aout-cris.c (MY(swap_ext_reloc_out)): Likewise for r_addend.
* aoutx.h (NAME(aout,swap_ext_reloc_out)): Likewise.
* coff-arm.c (coff_arm_relocate_section): Likewise for my_offset.
* aout-encap.c: Include "file", not <file> for binutils headers.
(encap_object_p): Half baked attempt to fix compile errors in
code dealing with "magic".
* aout-ns32k.c: Include "file", not <file> for binutils headers.
(_bfd_ns32k_relocate_contents): get_data and put_data manipulate
bfd_vma's rather than longs.
* cpu-ns32k.c (ns32k_sign_extend): Delete.
(_bfd_ns32k_get_displacement): Return a bfd_vma, don't pass in offset.
(_bfd_ns32k_get_immediate): Likewise. Add code for 8 byte values,
remove case 3.
(_bfd_ns32k_put_displacement): Accept a bfd_vma, don't pass in offset.
Use unsigned comparisons.
(bfd_ns32k_put_immediate): Likewise, and add code for 8 byte values.
(do_ns32k_reloc): get_data and put_data operate on bfd_vma's.
(_bfd_do_ns32k_reloc_contents): Likewise.
* ns32k.h (_bfd_ns32k_get_displacement): Update prototype.
(_bfd_ns32k_get_immediate): Likewise.
(_bfd_ns32k_put_displacement): Likewise.
(_bfd_ns32k_put_immediate): Likewise.
(bfd_reloc_status_type): Likewise.
* aoutx.h (NAME(aout,find_nearest_line)): Rename 'p' to 'colon'
to avoid shadowing.
* pdp11.c (NAME(aout,find_nearest_line)): Likewise.
* coff-h8300.c (h8300_reloc16_extra_cases): Remove shadowing "value".
* coff-ppc.c (enum ref_category): Rename "data" to "tocdata" to
avoid shadowing.
(record_toc): Use a bfd_signed_vma for our_toc_offset.
* coffcode.h (coff_write_relocs): Rename "i" to avoid shadowing.
* elf.c (bfd_elf_get_bfd_needed_list): Rename "link" var to avoid
shadow warning.
(_bfd_elfcore_strndup): Likewise for "dup".
* elf32-cris.c (cris_elf_relocate_section): "symname" instead of
"name" to avoid shadowing.
* elf32-hppa.c (elf32_hppa_relocate_section): Remove duplicate
definition of "off".
* elf32-i386.c (elf_i386_relocate_section): Likewise.
* elf32-mips.c (_bfd_mips_elf_modify_segment_map): Remove duplicate
definition of "s".
(_bfd_mips_elf_final_link): Rename "i" to "j". Remove duplicate
"secpp".
* elf64-x86-64.c (elf64_x86_64_relocate_section): Rename inner "indx"
to avoid shadowing.
* elflink.h (elf_link_add_object_symbols): Rename "link" to "shlink"
to avoid shadowing.
(elf_link_input_bfd): Likewise.
(elf_bfd_final_link): Remove duplicate innermost "off" var.
* oasys.c (oasys_write_data): Rename innermost "p" to "sym".
* reloc16.c (bfd_coff_reloc16_relax_section): Rename "i" param to
"input_section".
* som.c (som_prep_for_fixups): Rename inner "i" to "j".
* sunos.c (sunos_add_dynamic_symbols): Localise "s" var.
(sunos_write_dynamic_symbol): Remove unused vars.
* syms.c (_bfd_stab_section_find_nearest_line): Remove duplicate
innermost "directory_name" and "file_name" vars.
* tekhex.c (first_phase): Rename local var "type" to "stype".
(tekhex_write_object_contents): Rename innermost "s" to "sym".
* vms-gsd.c (vms_secflag_by_name): Change "size" param to "hassize",
doing comparison at caller.
(vms_esecflag_by_name): Likewise.
* vms-tir.c (etir_sto): Rename innermost "psect" to "psect1".
* xcofflink.c (xcoff_link_input_bfd): Delete duplicate innermost "o".
(xcoff_write_global_symbol): Rename "p" param to "inf".
* cisco-core.c: Add missing prototypes.
(cisco_core_file_failing_command): Add ATTRIBUTE_UNUSED.
(cisco_core_file_failing_signal): Likewise.
(cisco_core_file_matches_executable_p): Likewise.
* hpux-core.c (hpux_core_core_file_failing_signal): Likewise.
* netbsd-core.c (netbsd_core_file_matches_executable_p): Likewise.
* osf-core.c (osf_core_core_file_matches_executable_p): Likewise.
* sco5-core.c (sco5_core_file_matches_executable_p): Likewise.
* coff-arm.c (coff_arm_link_hash_table): Use bfd_size_type for
thumb_glue_size and arm_glue_size.
* elf32-arm.h (elf32_arm_link_hash_table): Likewise here.
* coff64-rs6000.c: Group prototypes together.
* coffcode.h (coff_set_arch_mach): Add ATTRIBUTE_UNUSED.
(buy_and_read): Remove "seek" param. Change "size" to bfd_size_type.
* cpu-arc.c: Add missing prototypes.
* cpu-h8500.c: Likewise.
* cpu-i960.c: Likewise.
* cpu-pj.c: Likewise.
* cpu-sh.c: Likewise.
* cpu-w65.c: Likewise.
* cpu-z8k.c: Likewise.
* elf32-fr30.c: Likewise.
* elf32-h8300.c: Likewise.
* elf32-i370.c: Likewise.
* hpux-core.c: Likewise.
* versados.c: Likewise.
* cpu-h8300.c (bfd_default_scan_num_mach): Don't declare.
* cpu-h8500.c: Likewise.
* cpu-i960.c: Likewise.
* cpu-z8k.c: Likewise.
* cpu-ia64-opc.c: Correct comment.
* dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove unused var.
* elf-bfd.h (elf_size_info): Change count param of write_out_phdrs
to unsigned.
(bfd_elf32_write_out_phdrs): Likewise.
(bfd_elf64_write_out_phdrs): Likewise.
(elf_linker_section_pointers): Change addend to bfd_vma.
(_bfd_elf_find_pointer_linker_section): Likewise.
(_bfd_elfcore_make_pseudosection): Change size param to size_t and
filepos to unsigned file_ptr.
(_bfd_elfcore_strndup): Change max param to size_t.
* elf.c (_bfd_elfcore_make_pseudosection): As above.
(_bfd_elfcore_strndup): Likewise.
(_bfd_elf_find_pointer_linker_section): Likewise.
* elf-hppa.h (elf_hppa_relocate_insn): Return an int, and change
insn and sym_value to ints.
* elf.c (elf_read): Make "offset" param a file_ptr, "size" a
bfd_size_type.
(elfcore_read_notes): Likewise.
* elf32-arm.h (elf32_arm_final_link_relocate): Change sym_flags
param from unsigned char to int.
(elf32_arm_relocate_section): If USE_REL, cast "rel" appropriately
for info_to_howto call.
(add_dynamic_entry): Define macro.
(elf32_arm_size_dynamic_sections): Use add_dynamic_entry.
* elf32-cris.c (add_dynamic_entry): Define macro.
(elf_cris_size_dynamic_sections): Use add_dynamic_entry.
* elf32-h8300.c (elf32_h8_final_write_processing): Make static.
(elf32_h8_object_p): Likewise.
(elf32_h8_merge_private_bfd_data): Likewise.
(elf32_h8_relax_section): Cast gap to int so signed comparisons work.
* elf32-hppa.c (add_dynamic_entry): Define macro.
(elf32_hppa_size_dynamic_sections): Use it.
* elf32-i370.c (add_dynamic_entry): Define macro.
(i370_elf_size_dynamic_sections): Use it.
(i370_noop): Make static.
* elf32-i386.c (add_dynamic_entry): Define macro.
(elf_i386_size_dynamic_sections): Use it.
* elf32-m68k.c (add_dynamic_entry): Define macro.
(elf_m68k_size_dynamic_sections): Use it.
* elf32-ppc.c (add_dynamic_entry): Define macro.
(ppc_elf_size_dynamic_sections): Use it.
* elf32-s390.c (add_dynamic_entry): Define macro.
(elf_s390_size_dynamic_sections): Use it.
* elf64-alpha.c (add_dynamic_entry): Define macro.
(elf64_alpha_size_dynamic_sections): Use it.
* elf64-hppa.c (add_dynamic_entry): Define macro.
(elf64_hppa_size_dynamic_sections): Use it.
* elf64-ppc.c (add_dynamic_entry): Define macro.
(ppc64_elf_size_dynamic_sections): Use it.
* elf64-s390.c (add_dynamic_entry): Define macro.
(elf_s390_size_dynamic_sections): Use it.
* elf64-sparc.c (add_dynamic_entry): Define macro.
(sparc64_elf_size_dynamic_sections): Use it.
* elf64-x86-64.c (add_dynamic_entry): Define macro.
(elf64_x86_64_size_dynamic_sections): Use it.
* elfxx-ia64.c (add_dynamic_entry): Define macro.
(elfNN_ia64_size_dynamic_sections): Use it.
* elf32-v850.c (SEXT24): Modify to avoid signed/unsigned warning.
(v850_elf_perform_relocation): Make "r_type" param unsigned.
* elf64-mips.c (mips_elf64_slurp_one_reloc_table): Just return
false if the first malloc fails rather than going via error_return.
* elf64-sparc.c (sparc64_elf_plt_entry_offset): Use a bfd_vma for
"index" param.
(sparc64_elf_plt_ptr_offset): Likewise, and for "max" param too.
* elflink.h (elf_link_input_bfd): s/ingored/ignored/ in error message.
* elfxx-ia64.c (global_sym_index): Return a long.
* ieee.c (get_symbol): Use int rather than char param.
(ieee_slurp_sections): Move "section" var to inner blocks.
(copy_expression): Don't init "value" to zero or worry about
clearing to zero after using.
(ieee_write_debug_part): Rename "output_buffer" to "obuff" to avoid
shadowing.
* ihex.c (ihex_write_record): Make "count" var a size_t, "addr" an
unsigned int.
* libbfd-in.h (BFD_ALIGN): Add cast to avoid signed/unsigned warning.
(bfd_write_bigendian_4byte_int): Pass an unsigned int value param.
* mipsbsd.c (mips_fix_jmp_addr): Add "error_message" param.
* pc532-mach.c (MYNSX): Delete.
(ns32kaout_bfd_reloc_type_lookup): Define prototype without MYNSX.
(write_object_contents): Correct prototype.
* peicode.h (pe_ILF_build_a_bfd): Use an unsigned int param rather
than unsigned short.
* section.c (bfd_set_section_contents): Remove redundant
"offset < 0" test. Check that "count" doesn't overflow size_t.
(bfd_get_section_contents): Likewise.
* som.c (som_fixup_formats): Add missing braces.
(som_reloc_addend): Pass a bfd_vma for "addend".
* srec.c (srec_write_record): Pass "type" as an unsigned int.
(srec_write_symbols): Remove an unnecessary var.
* targets.c (_bfd_target_vector): Sort entries. Sort externs
to match.
* configure.in: Sort to match. Bump version number.
* configure: Regenerate.
* tekhex.c (move_section_contents): Assert offset == 0.
* versados.c (new_symbol_string): Constify arg.
(process_esd): Use bfd_und_section_ptr rather than &bfd_und_section.
(versados_get_symbol_info): Make static.
(versados_print_symbol): Likewise.
(versados_get_reloc_upper_bound): Likewise.
(versados_canonicalize_reloc): Likewise.
2001-09-18 Nick Clifton <nickc@cambridge.redhat.com>
* elflink.h (elf_link_input_bfd): Fix typo in error message.
2001-09-17 H.J. Lu <hjl@gnu.org>
* dwarf1.c (parse_die): Take a new arg for the end of the
section. Return false if die is beyond the section.
(parse_functions_in_unit): Pass the end of the section to
parse_die ().
(_bfd_dwarf1_find_nearest_line): Likewise.
2001-09-14 Michael Rauch <mrauch@netbsd.org>
* elf32-sparc.c (elf32_sparc_relocate_section): Treat R_SPARC_UA32
just like R_SPARC_32.
2001-09-14 Kevin Lo <kevlo@openbsd.org>
* configure.bfd: Add arm-openbsd target.
2001-09-14 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* config.bfd: Change machine triplets from mips*el*-* to mips*el-*.
Add support for mips64.
2001-09-13 Alexandre Oliva <aoliva@redhat.com>
* elf32-openrisc.c (ELF_MACHINE_ALT1): Define as EM_OPENRISC_OLD.
2001-09-12 Alexandre Oliva <aoliva@redhat.com>
* elf.c (prep_headers): Get the machine code from the elf
backend data.
* elf-m10200.c (ELF_MACHINE_CODE): Redefine to EM_MN10200.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10200.
* elf-m10300.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
* elf-arc.c (arc_elf_final_write_processing): Don't override
e_machine, it's now properly set in prep_headers.
* elf32-avr.c (elf32_avr_object_p): Accept both EM_AVR and
EM_AVR_OLD.
(ELF_MACHINE_ALT1): Define to EM_AVR_OLD.
* elf-d10v.c (ELF_MACHINE_CODE): Redefine to EM_D10V.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D10V.
* elf-d30v.c (ELF_MACHINE_CODE): Redefine to EM_D30V.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D30V.
* elf-fr30.c (ELF_MACHINE_CODE): Redefine to EM_FR30.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_FR30.
* elf-m32r.c (ELF_MACHINE_CODE): Redefine to EM_M32R.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_M32R.
* elf32-pj.c (ELF_MACHINE_ALT1): DEfine to EM_PJ_OLD.
* elf-v850.c (ELF_MACHINE_CODE): Redefine to EM_V850.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_V850.
2001-09-11 Richard Henderson <rth@redhat.com>
* elf64-alpha.c (elf64_alpha_section_flags): New.
(elf64_alpha_fake_sections): Map SEC_SMALL_DATA to SHF_ALPHA_GPREL.
2001-09-11 Richard Henderson <rth@redhat.com>
* elf64-alpha.c (elf64_alpha_relocate_section): Do not
apply HINT relocations against dynamic symbols.
2001-09-11 H.J. Lu <hjl@gnu.org>
* linker.c (link_action): Change COMMON_ROW\defw from CREF to COM.
2001-09-09 Richard Henderson <rth@redhat.com>
* elf64-alpha.c: Delete all unused ERIC_neverdef and rth_notdef code.
* elf64-alpha.c (elf64_alpha_relax_with_lituse): Nop out gpdisp
following a call to a near function.
2001-09-08 Richard Henderson <rth@redhat.com>
* elf64-alpha.c (elf64_alpha_relocate_section): Soft fail
relocation errors. Fail gp-relative relocations against
dynamic symbols.
2001-09-08 Alan Modra <amodra@bigpond.net.au>
* elf32-i386.c (elf_i386_relocate_section): Check !DEF_REGULAR
as well as DEF_DYNAMIC in test for avoided copy relocs.
(allocate_plt_and_got_and_discard_relocs): Likewise.
* elf32-hppa.c (elf_i386_relocate_section): Likewise.
(allocate_plt_and_got_and_discard_relocs): Likewise.
2001-09-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handling
of R_MIPS_PC16.
2001-09-06 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf64-mips.c (mips_elf64_howto_table_rel): Fix relocation HOWTO
definitions.
(mips_elf64_howto_table_rel): Likewise.
2001-09-05 Tom Rix <trix@redhat.com>
* xcofflink.c (bfd_xcoff_import_symbol): Handle import file XMC_XO
and syscall symbols.
(write_global_symbol) : Same.
(bfd_xcoff_export_symbol): Remove unused syscall param.
* libxcoff.h: Change prototype of bfd_xcoff_export symbol and
bfd_xcoff_import_symbol.
* bfd-in.h: Same.
* bfd-in2.h : Regenerate.
2001-09-04 Richard Henderson <rth@redhat.com>
* elf64-alpha.c (SKIP_HOWTO): New.
(elf64_alpha_howto_table): Use it to remove dead ECOFF relocs.
Fix sizes of 16-bit mem format relocs.
(elf64_alpha_reloc_map): Update to match.
(elf64_alpha_relax_with_lituse): Use GPREL16 as appropriate.
(elf64_alpha_relax_without_lituse): Likewise.
(elf64_alpha_check_relocs): Handle GPREL16.
(elf64_alpha_relocate_section): Likewise.
* reloc.c (BFD_RELOC_ALPHA_USER_*): Remove.
(BFD_RELOC_ALPHA_GPREL_HI16, BFD_RELOC_ALPHA_GPREL_LO16): New.
* bfd-in2.h, libbfd.h: Rebuild.
2001-09-04 Jeff Law <law@redhat.com>
* elf32-h8300.c (elf32_h8_relax_section): New function.
(elf32_h8_relax_delete_bytes): Likewise.
(elf32_h8_symbol_address_p): Likewise.
(elf32_h8_get_relocated_section_contents): Likewise.
(bfd_elf32_bfd_relax_section): Define.
(bfd_elf32_bfd_get_relocated_section_contents): Likewise.
* elf32-h8300.c (special): New function.
(h8_elf_howto_table): Use it for SPECIAL_FUNCTION field in
all relocations.
(elf32_h8_final_link_relocate): Treat R_H8_DIR24A8 like 32bit
relocations. Fix problems with the true 24bit reloc R_H8_DIR24R8.
Fix minor problems with 8bit and 16bit PC relative relocations.
2001-09-01 Andreas Jaeger <aj@suse.de>
* vms-tir.c: Add missing prototypes.
* vms-hdr.c: Likewise.
* vms-gsd.c: Likewise.
* vms-misc.c: Likewise.
2001-08-31 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_check_relocs): Report filename
with bad relocation.
2001-08-31 Eric Christopher <echristo@redhat.com>
Jason Eckhardt <jle@redhat.com>
* archures.c: Add mipsisa32 and mipsisa64. Remove mips32,
mips32_4k and mips64.
* aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k,
bfd_mach_mips64. Add bfd_mach_mipsisa32, bfd_mach_mipsisa64.
* cpu-mips.c: Ditto.
* elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto.
* bfd-in2.h: Regenerate.
2001-08-31 Jakub Jelinek <jakub@redhat.com>
* elf64-alpha.c (elf64_alpha_relocate_section): Duplicate memory
value into R_ALPHA_RELATIVE's addend.
(elf64_alpha_finish_dynamic_symbol): Likewise.
2001-08-31 Nick Clifton <nickc@cambridge.redhat.com>
* elf32-arm.h (elf32_arm_relocate_section): Do not rightshift
recomputed addend during relocatable link if not USE_REL.
* elflink.h (elf_gc_propagate_vtable_entries_used): Fix off-by-one
error.
2001-08-30 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_calculate_relocation): Revert the last
2 changes.
(_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic
relocations for weak definitions.
2001-08-30 H.J. Lu <hjl@gnu.org>
* Makefile.am (BFD32_BACKENDS): Add elf32-h8300.lo.
(BFD32_BACKENDS_CFILES): Add elf32-h8300.c.
* Makefile.in: Rebuild.
2001-08-30 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_calculate_relocation): Don't create
dynamic relocation for undefined weak symbols when creating
executables. Check h->root.root.type, instead of h->root.type.
2001-08-29 Joel Sherrill <joel@OARcorp.com>
* config.bfd (i[3456]86-*-rtems*, m68*-*-rtems*): Change
default from coff to elf.
2001-08-29 Jeff Law <law@redhat.com>
* elf32-h8300.c (h8_elf_howto_table): Add new PC relative
relocations.
(h8_reloc_map): Similarly.
(elf32_h8_final_link_relocate): Remove incorrect overflow tests.
Add support for PC relative relocations.
* elf32-h8300.c: Put all prototypes together.
(elf32_h8_info_to_howto): Parameter elf_reloc is used.
(elf32_h8_final_link_relocate): New function for linker.
(elf32_h8_relocate_section): Similarly.
(elf_backend_relocate_section): Define.
* cpu-h8300.c (h8300_scan, compatible): Prototype.
(h8300_scan): Handle architecture:machine encodings typically
found in linker scripts.
* elf.c (prep_headers): Do not try to do H8 machine recognition
here.
* elf32-h8300.c: Add some missing prototypes.
(elf32_h8_mach, elf32_h8_final_write_processing): New functions.
(elf32_h8_object_p): Similarly.
2001-08-29 Tom Rix <trix@redhat.com>
* xcofflink.c (xcoff_link_add_symbols): Fix XTY_LD symbol that
does not follow a XTY_SD.
2001-08-29 Alan Modra <amodra@bigpond.net.au>
* targmatch.sed: Delete case statements.
* config.bfd <powerpc-*-aix* entry>: Select 64 bit xcoff for
aix4.3 and above.
2001-08-29 J"orn Rennecke <amylaar@redhat.com>
* Makefile.am (elf32-h8300.lo): New target.
* config.bfd (h8300*-*-elf): New case.
* configure.in (bfd_elf32_h8300_vec): New case.
* elf.c (prep_headers): Add case for bfd_arch_h8300.
* reloc.c (BFD_RELOC_H8_DIR16A8): New relocation.
(BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8): Likewise.
(BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16): Likewise.
* targets.c (bfd_target bfd_elf32_h8300_vec): New extern declaration.
* elf32-h8300.c: New file.
* Makefile.in, bfd-in2.h, libbfd.h, configure: Regenerated.
2001-08-28 Nick Clifton <nickc@cambridge.redhat.com>
* sparclynx.c: Add missing prototypes.
* coff-mcore.c: Add missing prototypes.
* elf32-pj.c: Add missing prototypes.
* nlm32-sparc.c: Add missing prototypes.
* oasys.c: Add missing prototypes.
* pdp11.c: Add missing prototypes.
* pe-mips.c: Add missing prototypes.
* riscix.c: Add missing prototypes.
2001-08-27 Daniel Jacobowitz <drow@mvista.com>
* elf32-i386.c: Add missing prototypes.
* elf32-ppc.c: Likewise.
* elf32-sh-lin.c: Likewise.
* elfarm-nabi.c: Likewise.
2001-08-27 Daniel Jacobowitz <drow@mvista.com>
* elf32-i386.c (elf_i386_grok_prstatus): New function.
(elf_i386_grok_psinfo): New function.
(elf_backend_grok_prstatus): Define.
(elf_backend_grok_psinfo): Likewise.
* elf32-ppc.c (ppc_elf_grok_prstatus): New function.
(ppc_elf_grok_psinfo): New function.
(elf_backend_grok_prstatus): Define.
(elf_backend_grok_psinfo): Likewise.
* elf32-sh-lin.c (elf32_shlin_grok_prstatus): New function.
(elf32_shlin_grok_psinfo): New function.
(elf_backend_grok_prstatus): Define.
(elf_backend_grok_psinfo): Likewise.
* elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): New function.
(elf32_arm_nabi_grok_psinfo): New function.
(elf_backend_grok_prstatus): Define.
(elf_backend_grok_psinfo): Likewise.
2001-08-27 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_create_dynamic_relocation): Add more
sanity check.
(mips_elf_calculate_relocation): Create dynamic relocation for
symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR
bit is not set.
2001-08-27 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype.
(_bfd_mips_elf_copy_indirect_symbol): Likewise.
(_bfd_elf32_mips_grok_prstatus): Likewise.
(_bfd_elf32_mips_grok_psinfo): Likewise.
(_bfd_mips_elf_hide_symbol): Make it static and cast to
`struct mips_elf_link_hash_entry *'.
(_bfd_mips_elf_copy_indirect_symbol): Make it static.
2001-08-27 Nick Clifton <nickc@cambridge.redhat.com>
* mipsbsd.c: Add missing prototypes.
* hp300hpux.c: Add missing prototypes.
* i386aout.c: Add missing prototypes.
* i386lynx.c: Add missing prototypes.
* i386mach3.c: Add missing prototypes.
* i386msdos.c: Add missing prototypes.
* i386os9k.c: Add missing prototypes.
2001-08-27 Linus Nordberg <linus@swox.se>
Torbjorn Granlund <tege@swox.com>
Staffan Ulfberg <staffanu@swox.se>
Alan Modra <amodra@bigpond.net.au>
* config.bfd: Add powerpc64 target. Add powerpc64 vectors to
targ64_selvecs for 32 bit powerpc targets.
* Makefile.am (BFD64_BACKENDS): Add elf64-ppc.lo.
(BFD64_BACKENDS_CFILES): Add elf64-ppc.c.
Run "make dep-am".
* Makefile.in: Regenerate.
* configure.in: Add elf64_powerpc vecs.
* configure: Regenerate.
* cpu-powerpc.c: Default to bfd_mach_ppc_620 entry for 64 bit.
* elf.c (prep_headers): EM_PPC64 for 64 bit ppc elf target.
* targets.c: Add bfd_elf64_powerpc_vec and bfd_elf64_powerpcle_vec.
* elf64-ppc.c: New file.
* reloc.c: Add powerpc64 relocs.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
2001-08-27 Andreas Schwab <schwab@suse.de>
* elf32-m68k.c (elf32_m68k_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
(elf32_m68k_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(elf32_m68k_reloc_type_class): New function.
(elf_backend_reloc_type_class): Define.
2001-08-27 Andreas Jaeger <aj@suse.de>
* elf64-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
(elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(elf_s390_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
* elf32-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
(elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(elf_s390_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
* elf32-ppc.c (ppc_elf_check_relocs): Set DF_TEXTREL if the reloc
is against read-only section.
(ppc_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(ppc_elf_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
2001-08-26 Andreas Jaeger <aj@suse.de>
* elf32-cris.c (cris_elf_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
(elf_cris_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(elf_cris_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
* elf32-sh.c (sh_elf_check_relocs): Set DF_TEXTREL if the reloc is
against read-only section.
(elf_backend_reloc_type_class): Define.
(sh_elf_reloc_type_class): New.
(sh_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
* elf32-arm.h (elf32_arm_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
(elf32_arm_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(elf32_arm_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
2001-08-25 Andreas Jaeger <aj@suse.de>
* oasys.c: Add missing prototypes.
* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Add unused
attribute for parameter.
* elf.c (_bfd_elf_reloc_type_class): Likewise.
* versados.c (get_4): Make static.
(get_10): Make static.
Add missing prototypes.
(process_esd): Fix call to versados_new_symbol.
2001-08-25 Nick Clifton <nickc@cambridge.redhat.com>
* coff-a29k.c: Add missing prototypes.
* coff-apollo.c: Add missing prototypes.
* coff-arm.c: Add missing prototypes.
* coff-i860.c: Add missing prototypes.
* coff-rs6000.c: Add missing prototypes.
* coff-tic80.c: Add missing prototypes.
* elf-m10200.c: Add missing prototypes.
* elf-m10300.c: Add missing prototypes.
* elf32-arm.h: Add missing prototypes.
* elf32-d10v.c: Add missing prototypes.
* elf32-m32r.c: Add missing prototypes.
* elf32-mcore.c: Add missing prototypes.
* elf32-openrisc.c: Add missing prototypes.
* elf32-sh.c: Add missing prototypes.
* elf32-sparc.c: Add missing prototypes.
* elf32-v850.c: Add missing prototypes.
* elfarm-nabi.c: Add missing prototypes.
* elfarm-oabi.c: Add missing prototypes.
2001-08-25 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf32-mips.c (elf_mips_abi_name): Return the right ABI string for
E_MIPS_ABI_O64 and E_MIPS_ABI_EABI64
2001-08-24 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_merge_sections): Fail if not using an ELF
hash structure.
2001-08-24 Nick Clifton <nickc@cambridge.redhat.com>
* elf-bfd.h (elf_hash_table): Revert definition.
(is_elf_hash_table): New macro.
* elflink.h (elf_link_add_object_symbols): Test
is_elf_hash_table before accessing ELF only fields in hash
structure.
(elf_link_create_dynamic_sections): Fail if not using an ELF
hash structure.
(elf_add_dynamic_entry): Fail if not using an ELF hash
structure.
(elf_link_record_local_dynamic_symbol): Fail if not using an
ELF hash structure.
(size_dynamic_sections): Fail if not using an ELF hash
structure.
(elf_adjust_dynamic_symbol): Fail if not using an ELF
hash structure.
(elf_bfd_final_link): Fail if not using an ELF hash
structure.
2001-08-24 H.J. Lu <hjl@gnu.org>
* elf-bfd.h (elf_hash_table): Return NULL if the linker hash
table is not an ELF linker hash table.
* elf.c (_bfd_elf_link_hash_table_init): Set the linker hash
table type to bfd_link_elf_hash_table.
* elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Revert
the last change.
* linker.c (_bfd_link_hash_table_init): Set the linker hash
table type to bfd_link_generic_hash_table.
2001-08-24 Alexandre Oliva <aoliva@redhat.com>
* bfd.c (bfd_alt_mach_code): New function.
* bfd-in2.h: Rebuilt.
2001-08-24 Alexandre Oliva <aoliva@redhat.com>
* elf-m10300.c (mn10300_elf_relocate_section): Test the right
`type' field in the hash entry when deciding whether to follow a
link.
2001-08-24 Jakub Jelinek <jakub@redhat.com>
* elflink.h (elf_link_sort_cmp1): Sort RELATIVE relocs first, not
last.
(elf_link_sort_relocs): Adjust accordingly.
* elf64-alpha.c (struct alpha_elf_link_hash_entry): Add reltext flag.
(elf64_alpha_check_relocs): Set it if section this reloc is against
is read-only. Set DF_TEXTREL if a RELATIVE reloc is needed against
read-only section.
(elf64_alpha_calc_dynrel_sizes): Set DF_TEXTREL flag if relocation
is is against read-only section.
(elf64_alpha_size_dynamic_sections): Use DF_TEXTREL flag, don't
check section names.
(elf64_alpha_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
2001-08-24 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca()
by bfd_malloc().
2001-08-23 Andreas Jaeger <aj@suse.de>
* elf64-x86-64.c (elf64_x86_64_check_relocs): Set DF_TEXTREL if
the reloc is against read-only section.
(elf64_x86_64_size_dynamic_sections): Use DF_TEXTREL flag instead
of looking up section names for DT_TEXTREL.
(elf64_x86_64_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
2001-08-23 H.J. Lu <hjl@gnu.org>
* syms.c (bfd_print_symbol_vandf): Add abfd to arg.
* bfd-in2.h (bfd_print_symbol_vandf): Regenerated.
* aoutx.h (NAME(aout,print_symbol)): Pass abfd to
bfd_print_symbol_vandf.
* coffgen.c (coff_print_symbol): Likewise.
* elf.c (bfd_elf_print_symbol): Likewise.
* ieee.c (ieee_print_symbol): Likewise.
* nlmcode.h (nlm_print_symbol): Likewise.
* oasys.c (oasys_print_symbol): Likewise.
* pdp11.c (NAME(aout,print_symbol)): Likewise.
* som.c (som_print_symbol): Likewise.
* srec.c (srec_print_symbol): Likewise.
* tekhex.c (tekhex_print_symbol): Likewise.
* versados.c (versados_print_symbol): Likewise.
* vms.c (vms_print_symbol): Likewise.
* elf.c (_bfd_elf_print_private_bfd_data): Replace fprintf_vma
with bfd_fprintf_vma.
(bfd_elf_print_symbol): Likewise.
* syms.c (bfd_print_symbol_vandf): Likewise.
2001-08-23 Nick Clifton <nickc@cambridge.redhat.com>
* aoutf1.h (sunos_write_object_contents): Silence compile time
warning.
* libaout.h (N_SET_DYNAMIC): Silence compile time warning.
* bout.c: Add missing function prototypes. Fix formatting.
* coff-z8k.c: Add missing function prototypes. Fix formatting.
* coff-w65.c: Add missing function prototypes. Fix formatting.
* coff-h8500.c: Add missing function prototypes. Fix formatting.
* coff-h8300.c: Add missing function prototypes. Fix formatting.
* coff-tic54x.c: Add missing function prototypes. Fix formatting.
* coff-tic30.c: Add missing function prototypes. Fix formatting.
* coff-m68k.c: Add missing function prototypes. Fix formatting.
* coff-rs6000.c: Add missing function prototypes. Fix formatting.
* coff-sh.c: Add missing function prototypes. Fix formatting.
2001-08-23 Jakub Jelinek <jakub@redhat.com>
* elf-bfd.h (enum elf_reloc_type_class): New.
(struct elf_backend_data): Add elf_backend_reloc_type_class.
(_bfd_elf_reloc_type_class): New.
* elfxx-target.h (elf_backend_reloc_type_class): Define.
(elfNN_bed): Add elf_backend_reloc_type_class.
* elf.c (_bfd_elf_reloc_type_class): New.
* elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc
is against read-only section.
(elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(elf_i386_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
* elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
(elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(elf32_sparc_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
* elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
(sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
looking up section names for DT_TEXTREL.
(sparc64_elf_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
* elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field.
(elfNN_ia64_hash_table_create): Clear ia64_info.
(get_reloc_section): Set DF_TEXTREL if the reloc is against read-only
section.
(elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag
instead of looking up section names for DT_TEXTREL.
(elfNN_ia64_reloc_type_class): New.
(elf_backend_reloc_type_class): Define.
* elflink.h (size_dynamic_sections): Add spare DT_NULL tags.
(struct elf_link_sort_rela): New.
(elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New.
(elf_bfd_final_link): Call elf_link_sort_relocs.
Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if
necessary.
2001-08-23 Nick Clifton <nickc@cambridge.redhat.com>
* configure.in (x86-bsdi): No corefile support.
* configure: Regenerate.
2001-08-22 Nick Clifton <nickc@cambridge.redhat.com>
* coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add missing
comma.
2001-08-21 Mark Elbrecht <snowball3@bigfoot.com>
* coff-go32.c: Make DWARF2 sections use an alignment of 0. Set
the alignment of dwarf2 linkonce sections to 0.
* coff-sto32.c: Likewise.
2001-08-20 Andreas Jaeger <aj@suse.de>
* coff-sparc.c: Add missing prototypes.
* elf32-s390.c: Likewise.
* elf32-i960.c: Likewise.
* aout-target.h: Likewise.
2001-08-20 H.J. Lu <hjl@gnu.org>
* elf-bfd.h (elf_obj_tdata): Add num_section_syms.
(elf_num_section_syms): New for num_section_syms.
* elf.c (elf_map_symbols): Set num_section_syms.
(_bfd_elf_symbol_from_bfd_symbol): Check num_section_syms for
the section symbol index.
2001-08-20 Nick Clifton <nickc@cambridge.redhat.com>
* elfxx-target.h (bfd_elfNN_bfd_link_hash_table_create): Never
select the generic has table creator. All elf backends need elf
specific fields in the hash table.
2001-08-20 Alan Modra <amodra@bigpond.net.au>
* archive.c (offsetof): Remove define.
* elf.c: Likewise.
* oasys.c: Likewise
* sysdep.h (offsetof): Define.
2001-08-17 Alan Modra <amodra@bigpond.net.au>
* bfd.c (bfd_get_gp_size): Return an unsigned int.
(bfd_set_gp_size): Make param unsigned.
* bfd-in2.h: Regenerate.
* elf32-ppc.c (ppc_elf_add_symbol_hook): Use elf_gp_size rather
than calling bfd_get_gp_size.
* elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
* elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
2001-08-17 Alan Modra <amodra@bigpond.net.au>
* linker.c (default_fill_link_order): Handle four byte fill value.
2001-08-17 Alan Modra <amodra@bigpond.net.au>
* elf64-sparc.c (sparc64_elf_output_arch_syms): Add missing
prototype.
* nlm32-alpha.c (nlm_alpha_write_external): Fix warning.
* elf64-mips.c (UNUSED_RELOC): Define.
(mips_elf64_howto_table_rel): Use it.
(mips_elf64_howto_table_rela): Here too.
(mips_elf64_write_relocs): Fix signed/unsigned warning.
* coffcode.h (coff_write_object_contents): Add ATTRIBUTE_UNUSED to
silence warning.
* coffgen.c (coff_print_symbol): Fix warnings.
(coff_find_nearest_line): Likewise.
* cofflink.c (_bfd_coff_link_input_bfd): Likewise.
* coff-alpha.c (alpha_convert_external_reloc): Likewise.
* format.c (bfd_check_format_matches): Likewise.
(bfd_set_format): Likewise.
* coff-ia64.c: Add missing prototypes.
* elf64-alpha.c (struct alpha_elf_link_hash_entry): Make addend
signed to silence warnings.
(elf64_alpha_relocate_section): Likewise.
(elf64_alpha_find_reloc_at_ofs): Fix warnings.
(elf64_alpha_add_symbol_hook): Likewise.
(elf64_alpha_final_link): Likewise.
(elf64_alpha_relax_section): Remove redundant assign to info.gotent.
(elf64_alpha_merge_gots): Add ATTRIBUTE_UNUSED to unused args.
(elf64_alpha_size_got_sections): Likewise.
* elfxx-ia64.c: Add missing prototypes.
(elfNN_ia64_relocate_section): Fix warning.
(elfNN_ia64_unwind_entry_compare): Make params const.
2001-08-17 Alan Modra <amodra@bigpond.net.au>
* config.bfd (targ64_selvecs): New.
<powerpc-*-aix* entry>: Use it here instead of ineffectual #ifdef.
* bfd-in.h (BFD_VERSION): Remove wrong comment.
(BFD_DEFAULT_TARGET_SIZE): New.
(BFD_ARCH_SIZE): Comment.
* configure.in (target_size): New. Set instead of target64 in
selvecs case statement. Set target64 from it.
(bfd_default_target_size): New. Set from taget_size. AC_SUBST.
* bfd-in2.h: Regenerate.
* configure: Regenerate.
2001-08-17 Alan Modra <amodra@bigpond.net.au>
* bfd.c (enum bfd_error): Add bfd_error_wrong_object_format.
(bfd_errmsgs): Add corresponding message.
* archive.c (bfd_generic_archive_p): Don't release bfd_ardata when
finding an archive that contains different format object files.
Return bfd_error_wrong_object_format for this case.
* format.c: Formatting fixes. s/CONST/const/.
(bfd_check_format_matches): Accept archives that give
bfd_error_wrong_object_format if no full match is found. Tidy
code handling matching_vector. Don't return a pointer to freed
memory in `matching'. Handle ambiguous matches as for partial
archive matches.
* bfd-in2.h: Regenerate.
2001-08-15 Alan Modra <amodra@bigpond.net.au>
* libieee.h (common_header_type): Add last_byte field.
* ieee.c: Add missing prototypes. Some format fixes.
(struct output_buffer_struct): Move for availability to prototypes.
(ieee_part_after): New function.
(ieee_slurp_debug): Use it here.
(ieee_seek): Pass in ieee_data_struct rather than bfd. Use
ieee_part_after to set last_byte to one past end of current part.
Update callers.
(ieee_pos): Pass in ieee_data_struct rather than bfd.
Update callers.
(parse_expression): Don't go beyond the end of the current part.
(ieee_slurp_external_symbols): Correct type passed to read_2bytes.
(ieee_get_symtab_upper_bound, ieee_get_symtab,
ieee_get_symbol_info, ieee_print_symbol, ieee_new_section_hook,
ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, block,
ieee_set_section_contents, ieee_write_object_contents,
ieee_make_empty_symbol): Make static.
(ieee_archive_p): Correct comments regarding bfd_read.
(ieee_object_p): Similarly.
(ieee_mkobject): Move it. Clear output_ptr_start, output_ptr,
output_ptr_end, input_ptr_start, input_ptr, input_ptr_end,
input_bfd, output_bfd, output_buffer.
(do_as_repeat): Write out ieee_set_current_pc_enum value as for
do_with_relocs, ie. as a symbol for relocatable files.
(ieee_vec): Add comments showing functions referenced by macros.
2001-08-14 Nick Clifton <nickc@cambridge.redhat.com>
* aout-tic30.c: Add missing prototypes. Fix formatting.
* aout-ns32k.c: Add missing prototypes. Fix formatting.
* peXXigen.c: Add missining prototypes. Fix formatting.
* aout-adobe.c: Add missining prototypes. Fix formatting.
2001-08-13 Nick Clifton <nickc@cambridge.redhat.com>
* elf32-v850.c: Add missing function prototypes.
Fix some formatting.
* cpu-v850.c: Add missing function prototype.
Fix some formatting.
2001-08-11 Nick Clifton <nickc@cambridge.redhat.com>
* elf-bfd.h (struct elf_backend_data): Add new fields
'elf_backend_sprintf_vma' and 'elf_backend_fprintf_vma'.
(bfd_elf_sprintf_vma): Rename function prototype to
'_bfd_elf_sprintf_vma'.
(bfd_elf_fprintf_vma): Rename function prototype to
'_bfd_elf_fprintf_vma'.
* bfd.c (bfd_sprintf_vma): Do not invoke bfd_elf_sprintf_vma
directly, instead indirect via the elf_backend_data structure.
(bfd_fprintf_vma): Do not invoke bfd_elf_fprintf_vma directly,
instead indirect via the elf_backend_data structure.
* elf.c (bfd_elf_sprintf_vma): Rename to _bfd_elf_sprintf_vma.
(bfd_elf_fprintf_vma): Rename to _bfd_elf_fprintf_vma.
* elfxx-target.h (elf_backend_sprintf_vma): Initialise if not
already defined.
(elf_backend_fprintf_vma): Initialise if not already defined.
(struct elf_backend_data): Initialise the
elf_backend_sprintf_vma and elf_backend_fprintf_vma fields.
2001-08-10 Andreas Jaeger <aj@suse.de>
* elf64-sparc.c: Add missing prototypes.
* elf32-cris.c: Likewise.
* elf32-i370.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-s390.c: Likewise.
2001-08-10 Andreas Jaeger <aj@suse.de>
* elf64-x86-64.c (elf64_x86_64_elf_object_p): Make static.
Add prototypes where needed.
2001-08-10 H.J. Lu <hjl@gnu.org>
* bfd.c (bfd_sprintf_vma): Fix a typo in the last change.
(bfd_fprintf_vma): Likewise.
2001-08-10 H.J. Lu <hjl@gnu.org>
* bfd.c (bfd_sprintf_vma): Don't return void.
(bfd_fprintf_vma): Likewise.
2001-08-10 Andreas Jaeger <aj@suse.de>
* configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes
to build warnings.
* configure: Regenerate.
2001-08-10 Alan Modra <amodra@bigpond.net.au>
* elf.c (bfd_elf_sprintf_vma): Add ATTRIBUTE_UNUSED to quiet
warning if not BFD64. Add braces so emacs auto format works.
(bfd_elf_fprintf_vma): Likewise.
* libxcoff.h (struct xcoff_backend_data_rec): Constify src param
of _xcoff_swap_ld*.
* coff-rs6000.c (xcoff_swap_ldhdr_in): Modify type of external
param to agree with libxcoff.h.
(xcoff_swap_ldhdr_out): Likewise.
(xcoff_swap_ldsym_in): Likewise.
(xcoff_swap_ldsym_out): Likewise.
(xcoff_swap_ldrel_in): Likewise.
(xcoff_swap_ldrel_out): Likewise.
(xcoff_create_csect_from_smclas): Likewise.
* coff64-rs6000.c: Add missing prototypes.
(xcoff64_swap_ldhdr_in): Modify type of external param to agree
with libxcoff.h.
(xcoff64_swap_ldhdr_out): Likewise.
(xcoff64_swap_ldsym_in): Likewise.
(xcoff64_swap_ldsym_out): Likewise.
(xcoff64_swap_ldrel_in): Likewise.
(xcoff64_swap_ldrel_out): Likewise.
(xcoff64_ppc_relocate_section): Make static.
(xcoff64_slurp_armap): Likewise.
(xcoff64_archive_p): Likewise.
(xcoff64_openr_next_archived_file): Likewise.
(xcoff64_sizeof_headers): Likewise.
(xcoff64_is_lineno_count_overflow): Likewise.
(xcoff64_is_reloc_count_overflow): Likewise.
(xcoff64_loader_symbol_offset): Likewise.
(xcoff64_loader_reloc_offset): Likewise.
* elf64-gen.c: Add missing prototypes.
2001-08-09 H.J. Lu <hjl@gnu.org>
* elf.c (bfd_elf_sprintf_vma): Check ELFCLASS64 only in BFD64.
(bfd_elf_fprintf_vma): Likewise.
2001-08-09 H.J. Lu <hjl@gnu.org>
* bfd-in.h (bfd_elf_sprintf_vma, bfd_elf_fprintf_vma): Moved
to ...
* elf-bfd.h: Here.
* bfd-in2.h: Regenerated.
2001-08-09 H.J. Lu <hjl@gnu.org>
* bfd-in.h (bfd_sprintf_vma): New prototype.
(bfd_fprintf_vma): Likewise.
(bfd_elf_sprintf_vma): Likewise.
(bfd_elf_fprintf_vma): Likewise.
(bfd_printf_vma): New. Defined with bfd_fprintf_vma.
* bfd-in2.h: Regenerated.
* bfd.c (bfd_sprintf_vma): New. Defined.
(bfd_fprintf_vma): Likewise.
* elf.c (bfd_elf_sprintf_vma): New. Defined.
(bfd_elf_fprintf_vma): Likewise.
2001-08-09 Alan Modra <amodra@bigpond.net.au>
* coff-rs6000.c: Add missing prototypes.
(xcoff_ppc_relocate_section, xcoff_is_lineno_count_overflow,
xcoff_is_reloc_count_overflow, xcoff_loader_symbol_offset,
xcoff_loader_reloc_offset): Make static.
* dwarf1.c: Add missing prototypes.
* dwarf2.c: Add missing prototypes.
(struct abbrev_info): Move definition.
(struct attr_abbrev, ABBREV_HASH_SIZE, ATTR_ALLOC_CHUNK): Likewise.
* elf.c: Add missing prototypes.
* elf32-gen.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-ppc.c: Likewise.
(ppc_elf_sort_rela): Use PTR instead of "void *".
* elflink.h: Add missing prototypes. Formatting fixes.
* merge.c: Add missing prototypes.
(last4_eq): Use PTR instead of "void *".
(last_eq): Likewise.
* syms.c: Add missing prototypes.
2001-08-09 Nick Clifton <nickc@cambridge.redhat.com>
* bfd.c: Fix formatting.
* bfd-in2.h: Regenerate.
2001-08-09 Nick Clifton <nickc@cambridge.redhat.com>
* elf32-arc.c (R_ARC_B22_PCREL): Change 'partial_inplace' to
true (this target uses REL relocations) and 'pcrel_offset' to
false (the PC is implied, not stored in the offset).
2001-08-08 Alan Modra <amodra@bigpond.net.au>
1999-10-19 Linus Nordberg <linus@swox.se>
* elf-bfd.h (struct elf_backend_data): Add want_got_sym.
* elfxx-target.h (elf_backend_want_got_sym): Define.
(elfNN_bed): Add elf_backend_want_got_sym.
* elflink.c (_bfd_elf_create_got_section): Define
_GLOBAL_OFFSET_TABLE_ only if bed->want_got_sym.
2001-08-08 Alexandre Oliva <aoliva@redhat.com>
* dwarf2.c (struct dwarf2_debug): Add sec, sec_info_ptr and syms.
(find_rela_addend): New function.
(parse_comp_unit): Call it to find the abbrev offset addend.
(_bfd_dwarf2_find_nearest_line): Initialize and maintain the new
members of dwarf2_debug as debugging information is read.
2001-08-07 Nick Clifton <nickc@cambridge.redhat.com>
* coff-sh.c (sh_coff_reloc_type_lookup): Provide for sh-coff
targets as well as sh-pe.
2001-08-03 Ben Harris <bjh21@netbsd.org>
* elf32-arm.h (elf32_arm_final_link_relocate): Include offset of
reloc from start of section when computing value for R_ARM_REL32
reloc.
2001-08-03 Alan Modra <amodra@bigpond.net.au>
From H.J. Lu <hjl@gnu.org>
* elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't
keep relocs for undefined syms if there are no dynamic sections in
executable.
* elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise.
2001-08-02 Paul Sokolovsky <paul.sokolovsky@technologist.com>
* cofflink.c (coff_link_check_ar_symbols): also search for
__imp__symbol as well as _symbol.
* linker.c (_bfd_generic_link_add_archive_symbols): also
search for __imp__symbol as well as _symbol.
2001-08-01 Adam Nemet <anemet@lnxw.com>
* elf.c (elf_sort_sections): Return zero only as the last step.
2001-08-01 Nick Clifton <nickc@cambridge.redhat.com>
* config.bfd (arm-vxworks): Change name of define from VXWORKS to
ARM_COFF_BUGFIX.
(arm-epoc-pe): Define ARM_COFF_BUGFIX.
coff-arm.c (coff_arm_relocate_section): Replace VXWORKS with
ARM_COFF_BUGFIX.
2001-07-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>