diff options
Diffstat (limited to 'bfd')
169 files changed, 22754 insertions, 13148 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c4b7cc7..50e2546 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,1939 @@ +2002-08-23 Nick Clifton <nickc@redhat.com> + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo + previous change. Add comment explaining why. + +2002-08-23 Stephen Clarke <stephen.clarke@superh.com> + + * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy + contents of .got.plt[2] to tr0, not address of .got.plt. + (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, set bottom bit + of branch to plt0 as this is a branch to an shmedia instruction. + * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le): + Copy contents of .got.plt[2] to tr0, not address of .got.plt. + (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to + branch to plt0. + (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, branch to + plt0 is now ptrel, so use relative offset. Set bottom bit of + branch target as it is a branch to an shmedia instruction. + +2002-08-23 Stephen Clarke <stephen.clarke@superh.com>, + Richard Shann <richard.shann@superh.com> + + * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT + value if .init is an SHmedia function. Similarly for DT_FINI. + * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise. + +2002-08-23 Stephen Clarke <stephen.clarke@superh.com> + + * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize + dynamic section. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + +2002-08-22 Kaz Kojima <kkojima@rr.iij4u.or.jp> + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple + byte read when reading the return address register column. + +2002-08-22 Nick Clifton <nickc@redhat.com> + + * config.bfd: Add powepc64-*-*bsd* target. + +2002-08-22 Graeme Peterson <gp@qnx.com> + + * Makefile.am: Add entries for elf32-shqnx.c + * Makefile.in: Regenerate. + * config.bfd: Add support sh-*-nto* target. + * configure.in: Add support for bfd_elf32_sh{l}qnx_vec. + * configure: Regenerate. + * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" . + * elf32-sh.c: Do not include elf32-target.h if + ELF32_SH_C_INCLUDED is defined. + * elf32-shqnx.c: New file: Support for QNX. + * targets.c: Add bfd_elf32_sh{l}qnx_vec. + +2002-08-22 Nick Clifton <nickc@redhat.com> + + * po/tr.po: Updated Turkish translation. + + * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the + symbols are not read. + +2002-08-22 Alan Modra <amodra@bigpond.net.au> + + * elf32-m68hc11.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + * elf32-m68hc12.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + +2002-08-22 Alan Modra <amodra@bigpond.net.au> + + * coff-rs6000.c (rs6000coff_vec <object_flags>): Add SEC_CODE and + SEC_DATA. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + +2002-08-22 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data + param to elf_backend_copy_indirect_symbol. + (_bfd_elf_link_hash_copy_indirect): Likewise. + * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust + calls to copy_indirect_symbol. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Properly + test refcounts for "used" values. + +2002-08-21 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to + argument declaration. + +2002-08-19 Elena Zannoni <ezannoni@redhat.com> + + * archures.c (bfd_mach_ppc_e500): Added. + * bfd-in2.h: Rebuilt. + * cpu-powerpc.c (bfd_powerpc_archs): Added e500. + +2002-08-19 Alan Modra <amodra@bigpond.net.au> + + * elf32-m68hc12.c (elf_backend_can_gc_sections): False. + +2002-08-17 Andrew Cagney <ac131313@redhat.com> + + * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to + `bfd_byte'. + +2002-08-17 Stan Cox <scox@redhat.com> + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the + IRIX 6 segment layout for NEWABI. + +2002-08-16 Stephen Clarke <stephen.clarke@superh.com> + + * bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect + symbols when looking for section referred to by a relocation. + * bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise. + +2002-08-15 Alan Modra <amodra@bigpond.net.au> + + * elf32-i370.c: Move reloc enum to include/elf/i370.h. + +2002-08-15 Hans-Peter Nilsson <hp@axis.com> + + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add + missing check for whether the symbol is referenced by DSO before + unexporting it as an unneeded dynamic symbol. + +2002-08-14 H.J. Lu <hjl@gnu.org> + + * libbfd.h: Regenerate. + +2002-08-14 H.J. Lu <hjl@gnu.org> + + * config.bfd: Always add 64bit vectors to 32bit Linux/mips. + +2002-08-14 Stephane Carrez <stcarrez@nerim.fr> + + * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of + instructions. + (m68hc11_direct_relax): New to define table of relaxable instructions. + (find_relaxable_insn): New, find a relaxable insn. + (compare_reloc): New to compare two relocs. + (m68hc11_elf_relax_section): New, relax text sections. + (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs. + (elf32_m68hc11_check_relocs): New function for GC support. + (elf32_m68hc11_relocate_section): New function for GC support. + (bfd_elf32_bfd_relax_section): Define to support linker relaxation. + (elf_backend_check_relocs): Likewise. + (elf_backend_relocate_section): Likewise. + +2002-08-13 H.J. Lu <hjl@gnu.org> + + * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count + definitions in shared objects when checking symbol with + undefined version. + +2002-08-13 Stephane Carrez <stcarrez@nerim.fr> + + * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC. + (elf32_m68hc11_gc_sweep_hook): Likewise. + (elf_backend_gc_mark_hook): Define for GC section support. + (elf_backend_gc_sweep_hook): Likewise. + (elf_backend_can_gc_sections): Likewise. + + * elf32-m68hc12.c: Likewise. + +2002-08-13 Stephane Carrez <stcarrez@nerim.fr> + + * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New. + (_bfd_m68hc11_elf_merge_private_bfd_data): New function. + (_bfd_m68hc11_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC11. + + * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New. + (_bfd_m68hc12_elf_merge_private_bfd_data): New function. + (_bfd_m68hc12_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC12. + +2002-08-13 Stephane Carrez <stcarrez@nerim.fr> + + * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs; + fix masks for PC-rel relocs. + (m68hc11_elf_ignore_reloc): New function. + + * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific + 68HC12 banked addressing relocs. + (m68hc12_phys_addr): New to compute physical address of banked memory. + (m68hc12_phys_page): Likewise for page. + (m68hc12_addr_is_banked): New to see if address is in banked area. + (elf_m68hc12_howto_table): Add new relocs and rename to xx12. + +2002-08-13 Stephane Carrez <stcarrez@nerim.fr> + + * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP, + BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE, + BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12. + * bfd-in2.h: Regenerate. + +2002-08-12 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_add_default_symbol): Preserve section across + elf_merge_symbol. + +2002-08-09 Graeme Peterson <gp@qnx.com> + + * Makefile.am: Add entries for elf32-ppcqnx.c, and add + elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c. + * Makefile.in: Regenerate. + * config.bfd: Add support for powerpc{le}-*-nto targets. + * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec. + * configure: Regenerate. + * elf32-i386qnx.c: Moved backend functions into a QNX specific + common file "elf32-qnx.h", and now include that file. + * elf32-qnx.h: New file: QNX specific common elf backend. + * elf32-ppc.c: Do not include elf32-target.h if + ELF32_PPC_C_INCLUDED is defined. + * elf32-ppcqnx.c: New file: Support for QNX. + * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend. + * targets.c: Add bfd_elf32_powerpc{le}qnx_vec. + +2002-08-09 Nick Clifton <nickc@redhat.com> + + * po/sv.po: Updated Swedish translation. + +2002-08-09 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if + g->global_gotsym is NULL. + +2002-08-08 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_add_default_symbol): Don't warn if a definition + overrides an indirect versioned symbol. + +2002-08-08 Jakub Jelinek <jakub@redhat.com> + + * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend + for R_386_TLS_TPOFF32 relocs against symndx 0. + +2002-08-07 H.J. Lu <hjl@gnu.org> + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol + with undefined version if needed. + (elf_link_assign_sym_version): Match a default symbol with a + version without definition. No need to hide the default + definition separately. + +2002-08-08 Alan Modra <amodra@bigpond.net.au> + + * elflink.h (elf_link_output_extsym): Don't output symbols from + SEC_EXCLUDE sections. + + * aoutx.h (aout_link_write_symbols): Correct handling of warning syms. + +2002-08-07 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd + entries. + +2002-08-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness + mismatch. + +2002-08-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elfxx-mips.c (ABI_64_P): Remove superfluous check. + +2002-08-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elf32-mips.c (mips_reloc_map): Fix typo. + +2002-08-06 Alan Modra <amodra@bigpond.net.au> + + * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section. + +2002-08-06 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries. + +2002-08-06 Alan Modra <amodra@bigpond.net.au> + + * libxcoff.h: Use PARAMS on function declarations. + * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc. + * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. + + * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in + addend. + * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise. + +2002-08-06 Alan Modra <amodra@bigpond.net.au> + + * coff-rs6000.c: Formatting fixes. + (xcoff_calculate_relocation): Use PARAMS in declaration. + (xcoff_complain_overflow): Likewise. + (xcoff_ppc_relocate_section): Use old-style function pointer call. + (bfd_xcoff_backend_data): Remove useless comments. + (rs6000coff_vec): Likewise. + (bfd_pmac_xcoff_backend_data): Likewise. + (pmac_xcoff_vec): Likewise. + + * coff64-rs6000.c: Formatting fixes. + (xcoff64_calculate_relocation): Use PARAMS in declaration. + (xcoff64_ppc_relocate_section): Use old-style function pointer call. + (bfd_xcoff_backend_data): Remove useless comments. + (rs6000coff64_vec): Likewise. + (bfd_xcoff_aix5_backend_data): Likewise. + (aix5coff64_vec): Likewise. + +2002-08-06 Alan Modra <amodra@bigpond.net.au> + + * coff-rs6000.c (xcoff_howto_table): Revert some of last change to + mask entries. Use complain_overflow_dont for R_REF. + (xcoff_reloc_type_ba): Revert last change. + (xcoff_reloc_type_br): Likewise. + (xcoff_reloc_type_crel): Likewise. + (xcoff_ppc_relocate_section): Likewise. + * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise. + (xcoff64_ppc_relocate_section): Likewise. + (xcoff64_howto_table): Revert some of last change to mask entries. + Use complain_overflow_dont for R_REF. + + * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries. Make all + relocs with bitsize == 16 have size = 1. + (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment. + (xcoff_reloc_type_br): Likewise. + (xcoff_reloc_type_crel): Likewise. + (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly. + * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and + dst_mask adjustment. + (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly. + (xcoff64_howto_table): Fix src_mask entries. Make all relocs with + bitsize == 16 have size = 1. + +2002-08-01 Denis Chertykov <denisc@overta.ru> + + * elf32-ip2k.c: Processor manufacturer changed to Ubicom. + (struct misc): New field isymbuf. All free_* fields removed. + (symbol_value): Pass in internal syms. No need to swap syms in. + (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free + possibly cached info. + (tidyup_after_error): Removed. + (ip2k_elf_relax_section_pass1): Don't use removed fields of struct + misc. Use new field. + (adjust_all_relocations): Use internal syms. No need to swap syms + in and out. + (add_page_insn): Don't use removed fields of struct misc. + +2002-08-01 Nick Clifton <nickc@redhat.com> + + * elf32-arm.h: Revert previous delta. + +2002-08-01 Nick Clifton <nickc@redhat.com> + + * configure.in (AM_INIT_AUTOMAKE): Bump version number. + * configure: Regenerate. + +2002-07-31 H.J. Lu <hjl@gnu.org> + + * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is + selected. + +2002-07-31 H.J. Lu <hjl@gnu.org> + + * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD + is selected. + +2002-07-31 Jakub Jelinek <jakub@redhat.com> + + * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type + if _bfd_elf_link_hash_copy_indirect will swap got.refcount. + +2002-07-31 Ian Dall <ian@sibyl.beware.dropbear.id.au> + + * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate): + There is no 8 byte relocation type for this architecture. + (do_ns32k_reloc): Use bfd_vma instead of native types. + (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data + returns void. + (_bfd_ns32k_put_displacement): Don't check for overflow. We can + rely on generic code to do that. + * aout-ns32k.c (howto_table): Add appropriate overflow detection + to all table entries. + (_bfd_ns32k_relocate_contents): put_data returns void. + * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate) + (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions + return void. + +2002-07-31 Ian Dall <ian@sibyl.beware.dropbear.id.au> + + * aoutx.h (aout_link_check_ar_symbols): Whether to include an + archive object is target dependant. + +2002-07-31 Adam Nemet <anemet@lnxw.com> + + * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE. + (THUMB_PLT_ENTRY_SIZE): New macro. + (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE. + (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to + ARM_PLT_ENTRY_SIZE. + (elf32_arm_plt_entry): Likewise. + (elf_backend_plt_header_size): Likewise. + (elf32_thumb_plt0_entry): New global. + (elf32_arm_finish_dynamic_sections): Use it. Put Thumb entries + into .plt.thumb. + (elf32_thumb_plt_entry): New global. + (elf32_arm_finish_dynamic_symbol): Use it. Use .thumb.plt for + Thumb entries. Set the bottom bit of the corresponding GOT entry + for a Thumb PLT entry. + (struct elf32_arm_plt_entry_info): New structure. + (struct elf32_arm_link_hash_entry, plt_info): New member of this + type. + (elf32_arm_link_hash_newfunc): Initialize new member. + (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle + relocations against the PLT. + (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set + first_rel_type if this is the first time we encounter the symbol. + (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case. + Determine if relocation needs a PLT entry. Set first_rel_type if + this is the first time we encounter the symbol + (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb + functions as well. + (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt. + (elf32_arm_create_dynamic_sections): New function. Create the + .plt.thumb section. + (elf_backend_create_dynamic_sections): Call it. + +2002-07-31 Nick Clifton <nickc@redhat.com> + + * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to + 'alternative' in order to avoid shadowing global symbol of the + same name. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2002-07-31 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * Makefile.am: Add n32 ABI support. + * Makefile.in: Regenerate. + * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64 + bit vectors for mips*-*-linux targets as optional. + * configure.in: Add n32 ABI vectors. + * configure: Regenerate. + * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files. + * elfn32-mips.c: New file, n32 ABI support. + * targets.c: Add n32 ABI vectors. + +2002-07-30 Graeme Peterson <gp@qnx.com> + + * elfarmqnx-nabi.c: New file: Support for QNX. + * config.bfd: Add support for arm-*-nto target. + * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec. + * configure: Regenerate. + * Makefile.am: Add entries for elfarmqnx-nabi.c. + * Makefile.in: Regenerate. + * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined. + Do not define global function if ELFARM_NABI_C_INCLUDED is defined. + * elfarm-nabi.c: Do not include elf32-arm.h if + ELFARM_NABI_C_INCLUDED is defined. + * targets.c: Add bfd_elf32_{big|little}armqnx_vec. + +2002-07-30 Nick Clifton <nickc@redhat.com> + + * po/sv.po: Updated Swedish translation. + +2002-07-30 Jakub Jelinek <jakub@redhat.com> + + * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type. + +2002-07-30 Alan Modra <amodra@bigpond.net.au> + + * aoutx.h (some_aout_object_p): Clean up tdata properly on error. + * archive.c (bfd_generic_archive_p): Likewise. + * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise. + (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol. + * coff64-rs6000.c (xcoff64_slurp_armap): Likewise. + (xcoff64_archive_p): Likewise. + (xcoff64_openr_next_archived_file): Likewise. + (xcoff64_archive_p): Clean up tdata properly on error. + * coffgen.c (coff_real_object_p): Likewise. + (coff_object_p): Release filehdr and opthdr. + * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error. + * ieee.c (ieee_archive_p): Likewise. + * ihex.c (ihex_object_p): Likewise. + (ihex_mkobject): Always allocate tdata. + * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error. + * srec.c (srec_mkobject): Always allocate tdata. + (srec_object_p): Clean up tdata properly on error. + (symbolsrec_object_p): Likewise. + * versados.c (versados_object_p): Likewise. + * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc, + and bfd_realloc instead of realloc. + (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections. + * vms.c (vms_initialize): Always allocate tdata. Use bfd_alloc in + place of bfd_malloc, simplifying error freeing. Free hash table too. + (vms_object_p): Clean up tdata on error. + (vms_mkobject): Don't complain on stderr if vms_initialize fails. + (vms_close_and_cleanup): Adjust for bfd_alloc use. + +2002-07-30 Alan Modra <amodra@bigpond.net.au> + + * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags. + +2002-07-26 Chris Demetriou <cgd@broadcom.com> + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE + flags into resulting BFD. + +2002-07-26 Alan Modra <amodra@bigpond.net.au> + + From John Reiser <jreiser@BitWagon.com> + * elf32-i386.c (elf_i386_link_hash_table_create): Clear + tls_ldm_got.refcount. + +2002-07-25 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elf64-mips.c: Update TODO comment. + (mips_elf64_higher_reloc,mips_elf64_highest_reloc, + mips_elf64_gprel16_reloca): Remove prototypes. + (mips16_jump_reloc,mips16_gprel_reloc): Add functions. + (UNUSED_RELOC): Replace by EMPTY_RELOC. + (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove + wrong comments. Remove disfunctional support of R_MIPS_HIGHER and + R_MIPS_HIGHEST. + (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and + R_MIPS_GOT16. Remove wrong comments. + (elf_mips16_jump_howto,elf_mips16_gprel_howto, + elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code + from elf32-mips.c. + (mips_elf64_hi16_reloc): Fix formatting. + (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove. + (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code. + Better comment. Fall back to R_MIPS_GOT_DISP instead of abort(). + (mips_elf64_gprel16_reloc): Make static. Add check for + partial_inplace. + (mips_elf64_gprel16_reloca): Remove. + (mips_elf64_literal_reloc): New function. + (mips_elf64_gprel32_reloc): Fix formatting. + (mips_elf64_shift6_reloc): Fix comment. Make static. + (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from + elf32-mips.c. + (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in + elf32-mips.c + (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU + specific relocations. + (mips_elf64_rtype_to_howto): Enable GNU specific relocations. + (mips_elf64_object_p): Invert logic to check for SGI-ish ABI. + (ELF_MAXPAGESIZE): Add comment. + +2002-07-25 Nick Clifton <nickc@redhat.com> + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + * po/fr.po: Updated French translation. + +2002-07-25 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define + as elf_link_record_local_dynamic_symbol. + (_bfd_elf64_link_record_local_dynamic_symbol): Likewise. + (elf_link_record_local_dynamic_symbol): Declare. Now returns int. + * elflink.h (elf_link_record_local_dynamic_symbol): Move to.. + * elflink.c: .. here. Use bfd_elf_get_elf_syms. Check whether an + attempt is made to record a symbol in a discarded section, and + return `2' in that case. + +2002-07-24 Nick Clifton <nickc@redhat.com> + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + +2002-07-23 Alan Modra <amodra@bigpond.net.au> + + * po/SRC-POTFILES.in: Regenerate. + + * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return + immediately. Remove code handling relocatable linking. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-fr30.c (elf32_frv_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf32-avr.c (elf_backend_rela_normal): Define. + * elf32-cris.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-sparc.c: Likewise. + * elf32-fr30.c (elf32_frv_relocate_section): Edit comment. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf-m10200.c (USE_RELA): Don't define. + * elf-m10300.c: Likewise. + * elfarm-oabi.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elf32-avr.c (USE_REL): Don't undef. + * elf32-ip2k.c: Likewise. + +2002-07-23 Nick Clifton <nickc@redhat.com> + + * elf-bfd.h (struct elf_backend_data): Add new bitfield + 'want_p_paddr_set_to_zero'. + * elfxx-target.h: Set default value for want_p_paddr_set_to_zero + to false; + * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target. + * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero. + +2002-07-23 Gabor Keresztfalvi <keresztg@mail.com> + + * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of + the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to + show the Copyright string. + Minor formatting tidy ups. + +2002-07-23 Nick Clifton <nickc@redhat.com> + + * po/fr.po: Updated French translation. + * po/sv.po: Updated Swedish translation. + +2002-07-23 Alan Modra <amodra@bigpond.net.au> + + * elflink.h (elf_link_input_bfd): Don't change internal symbols + when outputting relocs. + +2002-07-20 Jason Thorpe <thorpej@wasabisystems.com> + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert + DT_PLTGOT into the dynamic section if there is a PLT. + +2002-07-19 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from + elf32-mips.c. + (_bfd_mips_elf_write_section): Likewise. + * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype. + (_bfd_mips_elf_write_section): Likewise. + * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c. + (elf32_mips_write_section): Likewise. + * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it. + (_bfd_mips_elf_write_section): Likewise. + +2002-07-19 Alan Modra <amodra@bigpond.net.au> + + * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan + PT_IA_64_UNWIND segments for a given section. + +2002-07-17 H.J. Lu <hjl@gnu.org> + + * Makefile.am: Fix a typo. + * Makefile.in: Regenerate. + +2002-07-15 Denis Chertykov <denisc@overta.ru> + Frank Ch. Eigler <fche@redhat.com> + Ben Elliston <bje@redhat.com> + Alan Lehotsky <alehotsky@cygnus.com> + John Healy <jhealy@redhat.com> + Graham Stott <grahams@redhat.com> + Jeff Johnston <jjohnstn@redhat.com> + + * Makefile.am: Add support for ip2k. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * archures.c: Add support for ip2k. + * config.bfd: Add support for ip2k. + * configure.in: Add support for ip2k. + * configure: Regenerate. + * reloc.c: Add support for ip2k. + * targets.c: Add support for ip2k. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * cpu-ip2k.c: New file. + * elf32-ip2k.c: New file. + +2002-07-17 Ian Rickards <irickard@arm.com> + + * dwarf2.c (concat_filename): If we can't establish the directory + just return the filename. + +2002-07-16 Moritz Jodeit <moritz@jodeit.org> + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args. + +2002-07-16 Alan Modra <amodra@bigpond.net.au> + + * elflink.h: Formatting fixes, tidy prototypes. + (elf_link_assign_sym_version): Move common code out of loop. + +2002-07-16 Alan Modra <amodra@bigpond.net.au> + + * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when + reloc section size is zero. Correct reloc output location. + +2002-07-16 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as + the final type for the e_fsel selector when generating PA2.0W code. + (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1 + relocations. + +2002-07-14 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_link_assign_sym_version): Hide the default + definition if there is a hidden versioned definition. + +2002-07-12 Hans-Peter Nilsson <hp@axis.com> + + * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical + dynamic reference test in assertion when initializing GOT with + static contents. Just assert that there are either no dynamic + sections, the symbol is defined in the regular objects or that the + symbol is undef weak. Tweak comment. + (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program + only if the symbol isn't defined in the program and isn't undef + weak. + (elf_cris_adjust_dynamic_symbol): Simplify condition for getting + rid of PLT entry: only do it if the symbol isn't defined in a DSO. + When doing so, clear ELF_LINK_HASH_NEEDS_PLT. Tweak comments. + (elf_cris_discard_excess_program_dynamics): Don't consider + ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs. + +2002-07-11 Alan Modra <amodra@bigpond.net.au> + + * elf32-i386.c (elf_i386_relocate_section): Don't complain about + unresolved debugging relocs in dynamic applications. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_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. + +2002-07-10 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ONES): Define. + (ppc64_elf_howto_table): Use ONES here to avoid warnings. Fill in + missing src_mask fields. Tweak R_PPC64_NONE, R_PPC64_COPY. Fill + in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32. + + * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete. + (ppc64_elf_set_private_flags): Delete. + (ppc64_elf_section_from_shdr): Delete. + (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code. + (ppc64_elf_fake_sections): Delete. + (bfd_elf64_bfd_set_private_flags): Don't define. + (bfd_elf64_get_symbol_info): Likewise. + (elf_backend_section_from_shdr): Likewise. + (elf_backend_fake_sections): Likewise. + +2002-07-10 Marco Walther <Marco.Walther@sun.com> + + * elf.c: (assign_section_numbers) Set sh_entsize for .stab only + when not already set. + * elf64-sparc.c: (sparc64_elf_fake_sections): New function. + (elf_backend_fake_sections): Define. + +2002-07-10 Alan Modra <amodra@bigpond.net.au> + + * merge.c (_bfd_merge_section): Remove redundant output_section check. + Formatting. + (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections. + +2002-07-09 Hans-Peter Nilsson <hp@axis.com> + + * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for + NULL sym_hashes to just before use. + <case R_CRIS_32_GOTREL>: In test for local symbol, accept also + symbol with non-default visibility. + <case R_CRIS_32_GOTREL, case R_CRIS_32_PLT_GOTREL>: Ditto. + <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>: + Ditto. + (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for + symbol with non-default visibility. + (cris_elf_check_relocs): At tests for local symbol before + increasing h->plt.refcount, also check for non-default + visibility. Ditto when checking for local symbol to eliminate + pc-relative runtime relocs. + +2002-07-08 Alan Modra <amodra@bigpond.net.au> + + * elf.c: Formatting. + (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks. + (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP. + (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP + segments. + +2002-07-07 Mark Mitchell <mark@codesourcery.com> + Alan Modra <amodra@bigpond.net.au> + + * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into + account the impact of relocation count overflow when computing + section offsets. + * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether + or not to apply the PE COFF reloc overflow handling. Fix a + fencepost error in deciding whether or not to use that technique. + +2002-07-07 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, + change type of locsyms. + (bfd_elf_get_elf_syms): Declare. + * elf.c (bfd_elf_get_elf_syms): New function. + (group_signature): Use bfd_elf_get_elf_syms. + (bfd_section_from_r_symndx): Likewise. + * elfcode.h (elf_slurp_symbol_table): Likewise. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. Reorganise to increase + locality of various data structures. Properly free internal relocs. + (elf_bfd_final_link): Properly free internal relocs. + (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. Properly free internal relocs. + (elf_gc_sweep): Properly free internal relocs. + (elf_reloc_symbol_deleted_p): No need to swap syms in. + (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free + internal relocs. + * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. + Properly free possibly cached info. + (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. + (mn10200_elf_symbol_address_p): Pass in internal syms. Remove + symbol swapping code. + (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. + Properly free possibly cached info. + * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. + (m32r_elf_relax_delete_bytes): Likewise. + (m32r_elf_get_relocated_section_contents): Likewise. + * elf32-sh.c (sh_elf_reloc_loop): Free section contents using + elf_section_data to determine whether cached. + (sh_elf_relax_section): As above for elf-m10200.c. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. + * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay + reading of local syms. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. + * elfxx-ia64.c (elfNN_ia64_relax_section): As above. + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal + relocs. + * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly + free internal relocs and section contents. Don't read symbols. + * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. + (elf32_hppa_size_stubs): Don't free local syms. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay + reading of local syms. Use bfd_elf_get_elf_syms. Properly free + possibly cached info. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. + * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and + all_local_syms. + (get_local_syms): Delete function. + (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache + on exit. + (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit. + +2002-07-05 Jim Wilson <wilson@redhat.com> + + * syms.c (decode_section_type): New. + (bfd_decode_symclass): Call decode_section_type. + +2002-07-04 Jakub Jelinek <jakub@redhat.com> + + * merge.c (_bfd_merged_section_offset): Avoid accessing byte before + section content start. + Reported by Michael Schumacher <mike@hightec-rt.com>. + +2002-07-04 Alan Modra <amodra@bigpond.net.au> + + * section.c (_bfd_strip_section_from_output): Remove unnecessary + link order code. Don't actually remove the output section here; + Just set a flag for the linker to do so. + * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed + sections when setting up output section dynsyms. + +2002-07-04 Alan Modra <amodra@bigpond.net.au> + + * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux + fudge. + * elf.c (bfd_section_from_shdr): Work around broken hpux shared + libs here instead. + +2002-07-02 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * elf64-s390.c (create_got_section): Set .got section alignment to + 8 bytes. + (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes. + +2002-07-02 Alan Modra <amodra@bigpond.net.au> + + * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar. + +2002-07-01 Matt Thomas <matt@3am-software.com> + + * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_* + to EF_VAX_*. + +2002-07-01 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elfxx-mips.c (ABI_64_P): Fix comment. + (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the + new section names for N64 ABI. + (mips_elf_output_extsym): No special _gp_disp handling for NewABI. + (mips_elf_calculate_relocation): Code formatting. + (mips_elf_create_dynamic_relocation): Likewise. + (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too. + (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI. + (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64 + in any NewABI. + (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling + for NewABI. + (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI. + (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled + here, too. + +2002-07-01 Andreas Schwab <schwab@suse.de> + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert + R_X86_64_64 to R_X86_64_RELATIVE. + +2002-07-01 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * vaxbsd.c: New BFD backend for VAX BSD and Ultrix. + * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend. + Run "make dep-am". + * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of + host_aout_vec. + * configure.in (vaxbsd_vec): Add. + * targets.c (vaxbsd_vec): Add. + * Makefile.in: Rebuild. + * configure: Rebuild. + * po/SRC-POTFILES.in: Rebuild. + +2002-07-01 Alan Modra <amodra@bigpond.net.au> + + * elflink.h (elf_gc_mark): Pass in the section whose relocs we are + examining to gc_mark_hook, rather than the bfd. + (elf_gc_sections): Adjust. + * elf-bfd.h (struct elf_backend_data <gc_mark_hook>): Likewise. + * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise. + * 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-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-vax.c (elf_vax_gc_mark_hook): Likewise. + * elf32-xstormy16.c (xstormy16_elf_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-sh64.c (sh_elf64_gc_mark_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise. Also remove + redundant local sym tests. + * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry. + (link_hash_newfunc): Init is_entry. + (ppc64_elf_copy_indirect_symbol): Copy is_entry. + (ppc64_elf_link_hash_table_create): Init all_local_syms. + (create_linkage_sections): Use bfd_make_section_anyway rather than + bfd_make_section. + (ppc64_elf_mark_entry_syms): New function. + (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab. Set + up opd entry to function section map. + (ppc64_elf_gc_mark_hook): Special case opd section relocs, and + relocs that reference the opd section. + (edit_opd): New function. + (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd. + (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here. + (get_local_syms): Do so here. Exit if we already have local syms. + Remove bogus comment imported from elf32-hppa.c. Don't attempt to + read local syms on non-ELF input. + (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather + than duplicating it's function here. Adjust free of internal + relocs to suit. + (ppc64_elf_relocate_section): Adjust local syms in opd section. + * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare. + * elf32-hppa.c (elf32_hppa_size_stubs): Call + _bfd_elf32_link_read_relocs rather than duplicating it's function + here. Adjust free of internal relocs to suit. + +2002-07-01 Andreas Jaeger <aj@suse.de> + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations + are not allowed in shared libs code, enforce -fPIC. + +2002-06-29 Hans-Peter Nilsson <hp@bitrange.com> + + * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and + trailing zero-sequences when there's previous left-over data. + +2002-06-27 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. + (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec + and opd_rel_sec in order for starting rela section. Check _raw_size. + (elf_backend_reloc_type_class): Define. + +2002-06-27 Kevin Buettner <kevinb@redhat.com> + + * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit + DWARF2 formats. + +2002-06-27 Alan Modra <amodra@bigpond.net.au> + + * cpu-powerpc.c: Comment on ordering of arch_info. + * elf32-ppc.c (ppc_elf_object_p): New function. + (elf_backend_object_p): Define. + * elf64-ppc.c (ppc64_elf_object_p): New function. + (elf_backend_object_p): Define. + +2002-06-26 Jason Thorpe <thorpej@wasabisystems.com> + + * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2002-06-25 Jason Eckhardt <jle@rice.edu> + + * dwarf2.c (decode_line_info): Check unit->addr_size + to read in the proper number of prologue bytes. + +2002-06-25 Nick Clifton <nickc@cambridge.redhat.com> + + * config.bfd (powerpc-*-aix5*): Only create a selvecs for + aix5coff64_vec if 64-bit bfd support has been enabled. + (powerpc64-*-aix5*): Only define if 64-bit bfd support has + been enabled. + + * targets.c (_bfd_target_vector[]): Only include + aix5coff64_vec if 64-bit bfd support has been enabled. + +2002-06-25 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy. + * elf32-hppa.c (hppa_add_stub): Likewise. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. + * elflink.h (elf_add_default_symbol): Fix comment typo. + (elf_add_default_symbol): Replace strcpy and strncpy with memcpy. + (elf_link_add_object_symbols): Likewise. + (elf_link_assign_sym_version): Likewise. + * hash.c (bfd_hash_lookup): Likewise. + * linker.c (_bfd_generic_link_add_one_symbol): Likewise. + * section.c (bfd_get_unique_section_name): Likewise. + * syms.c (_bfd_stab_section_find_nearest_line): Likewise. + * elf.c (_bfd_elf_make_section_from_phdr): Likewise. + (assign_section_numbers): Likewise. + (_bfd_elfcore_make_pseudosection): Likewise. + (elfcore_grok_lwpstatus): Likewise. + (elfcore_grok_win32pstatus): Likewise. + (elfcore_write_note): Constify input params. Use PTR instead of + void *. Include terminating NUL in namesz. Correct padding. + Support NULL "name" param. Use memcpy instead of strcpy. + (elfcore_write_prpsinfo): Constify input params. + (elfcore_write_prstatus): Likewise. Use PTR instead of void *. + (elfcore_write_lwpstatus): Likewise. + (elfcore_write_pstatus): Likewise. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_prxfpreg): Likewise. + * elf-bfd.h (elfcore_write_note): Update declaration. + (elfcore_write_prpsinfo): Likewise. + (elfcore_write_prstatus): Likewise. + (elfcore_write_pstatus): Likewise. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_prxfpreg): Likewise. + (elfcore_write_lwpstatus): Likewise. + +2002-06-25 Jason Eckhardt <jle@rice.edu> + + * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for + symbols of type stProc and stStaticProc. + +2002-06-25 Nick Clifton <nickc@redhat.com> + + * ecoff.c: VArious formatting fixes. + +2002-06-25 Alan Modra <amodra@bigpond.net.au> + + * coff-rs6000.c (xcoff_generate_rtinit): Fix typo. + +2002-06-25 Alan Modra <amodra@bigpond.net.au> + + * aout-adobe.c: Don't compare against "true" or "false. + * aout-target.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bout.c: Likewise. + * cache.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-i386.c: Likewise. + * coff-mips.c: Likewise. + * coff-or32.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-d30v.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sh64.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.h: Likewise. + * elfxx-mips.c: Likewise. + * i386os9k.c: Likewise. + * ieee.c: Likewise. + * libbfd.c: Likewise. + * linker.c: Likewise. + * mmo.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * oasys.c: Likewise. + * pdp11.c: Likewise. + * peicode.h: Likewise. + * reloc.c: Likewise. + * som.c: Likewise. + * srec.c: Likewise. + * tekhex.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * elf64-sparc.c: Edit comment to not use "== false". + + * aoutf1.h: Don't use "? true : false". + * ecoff.c: Likewise. + * format.c: Likewise. + * ieee.c: Likewise. + * linker.c: Likewise. + * mmo.c: Likewise. + * oasys.c: Likewise. + +2002-06-23 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_link_add_archive_symbols): For the default + version, check references with only one `@' first. + +2002-06-23 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New + function. + (allocate_global_data_dlt): Don't add millicode symbols to dynamic + symbol table. + (allocate_global_data_opd, allocate_dynrel_entries): Likewise. + (elf64_hppa_size_dynamic_sections): Revise to use + elf64_hppa_mark_milli_and_exported_functions. + (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode + symbols out of dynamic symbol table. + +2002-06-23 Alan Modra <amodra@bigpond.net.au> + + * Makefile.in: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elflink.h: Comment typo fixes. + +2002-06-23 H.J. Lu <hjl@gnu.org> + + * elf-bfd.h (elf_link_loaded_list): New structure. + (elf_link_hash_table): Add "loaded". + * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded". + * elflink.h (elf_link_check_versioned_symbol): New function. + (elf_link_output_extsym): Call elf_link_check_versioned_symbol. + +2002-06-19 Nick Clifton <nickc@cambridge.redhat.com> + + * elflink.h (size_dynamic_sections): If the target does not + support an ELF style hash table, return true, indicating that + nothing needed to be done, rather than false, indicating that the + section's size could not be computed. + +2002-06-18 Dave Brolley <brolley@redhat.com> + + From Catherine Moore, Michael Meissner, Dave Brolley: + * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c + * targets.c: Support bfd_elf32_frv_vec. + * reloc.c: Add FRV relocs. + * configure.in: Add support for bfd-elf32-frv-vec. + * config.bfd (targ_cpu): Add support for frv-*-elf. + * archures.c: Add frv arch and machines. + * Makefile.am (ALL_MACHINES): Add cpu-frv.lo. + (ALL_MACHINES_CFILES): Add cpu-frv.c. + (BFD32_BACKENDS): Add elf32-frv.lo. + (BFD32_BACKENDS_CFILES): Add elf32-frv.c + (cpu-frv.lo): New target. + (elf32-frv.lo): New target. + * cpu-frv.c: New file. + * elf32-frv.c: New file. + +2002-06-18 Jakub Jelinek <jakub@redhat.com> + + * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies + e_shnum == 0. + Only read the first section header if e_shoff is non-zero. + Don't consider e_shstrndx if there are no sections. + +2002-06-17 Tom Rix <trix@redhat.com> + + * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R, + R_D10V_10_PCREL_L and R_D10V_18_PCREL to use + complain_overflow_bitfield. + +2002-06-17 Alan Modra <amodra@bigpond.net.au> + + * opncls.c (bfd_openr): Remove redundant bfd_set_error. + (bfd_fdopenr): Likewise. + (bfd_openstreamr): Likewise. + (bfd_openw): Likewise. + + * targets.c: Sort target vecs. + (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec, + bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec, + bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec, + bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec. + * configure.in: Sort target vecs. Add m88kmach3_vec. + * configure: Regenerate. + +2002-06-16 Hans-Peter Nilsson <hp@bitrange.com> + + * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member + bpo_reloc_no to break sort order ties, not address of items. + +2002-06-16 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment. + Skip excluded sections in determing __gp value. + (elf_hppa_final_link_relocate): Use the symbol's address in + R_PARISC_FPTR64 relocations that don't need an opd entry. + * elf64-hppa.c (allocate_dynrel_entries): Simplify code. + (elf64_hppa_finalize_dynreloc): Likewise. + (elf64_hppa_size_dynamic_sections): Move comments and fix typo. + (elf64_hppa_finish_dynamic_symbol): Break up assert. + +2002-06-14 Sergey Grigoriev <serge@leopold.Physik.Uni-Augsburg.DE> + + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte + alignment for .bss, .data and .text sections so that sse and sse2 + code will work. + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2002-06013 J"orn Rennecke <joern.rennecke@superh.com> + + config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*, + sh[1234]*-elf*. + +2002-06-12 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * elflink.h (elf_bfd_final_link): Improve error handling for missing + dynamic sections. + + * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry + for a symbol that has no output section. + (allocate_dynrel_entries): Correct comment. + (elf64_hppa_finalize_dynreloc): Likewise. Don't create an opd entry + unless we want one. + (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL. + (elf64_hppa_finalize_dlt): Likewise. Prevent segfault for symbols + with no section. Remove unnecessary parentheses. + +2002-06-11 Tom Rix <trix@redhat.com> + + * coffcode.h (coff_compute_section_file_positions): Add data + section to AIX loader alignment check. + + * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section + alignment to 4 bytes. + (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment + power accessor macro. + (do_shared_object_padding): Remove invalid assertion. + +2002-06-10 Richard Sandiford <rsandifo@redhat.com> + + * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE + for removed output sections. + +2002-06-10 Geoffrey Keating <geoffk@redhat.com> + + * merge.c (merge_strings): Use htab_create_alloc with calloc, not + htab_alloc. + * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise. + +2002-06-08 H.J. Lu <hjl@gnu.org> + + * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to + work around a long long bug in gcc 2.96 on mips. + +2002-06-08 Jason Thorpe <thorpej@wasabisystems.com> + + * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo. + (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c. + Regenerate dependency lists. + * Makefile.in: Regenerate. + * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add + vax1knetbsd_vec to targ_selvecs. + * configure.in: Add vax1knetbsd_vec. + * configure: Regenerate. + * targets.c (_bfd_target_vector): Add vax1knetbsd_vec. + * vax1knetbsd.c: New file. + * vaxnetbsd.c: Update copyright years. + (TARGET_PAGE_SIZE): Set to 0x1000. + (DEFAULT_MID): Set to M_VAX4K_NETBSD. + +2002-06-08 Matt Thomas <matt@3am-software.com> + + * libaout.h (enum machine_type): Add M_VAX4K_NETBSD. + +2002-06-08 Alan Modra <amodra@bigpond.net.au> + + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static. + +2002-06-08 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * armnetbsd.c: Replace CONST with const. + * corefile.c: Likewise. + * elf32-dlx.c: Likewise. + * elf64-mips.c: Likewise. + * mmo.c: Likewise. + * ns32knetbsd.c: Likewise. + + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash + table is elf64-sparc. + +2002-06-08 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code. + Fix RELA addends to get not shifted in the result. Don't do special + handling of R_MIPS_64 for NewABI. + +2002-06-07 Alan Modra <amodra@bigpond.net.au> + + * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. + (NAME(aout,slurp_reloc_table)): Likewise. + * coff-mips.c (mips_relax_section): Use bfd_zalloc. + * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc. + (xcoff_write_archive_contents_big): Likewise. + (xcoff_generate_rtinit): Likewise. + (xcoff_generate_rtinit): Likewise, and check error return. + * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. + * coffgen.c (coff_section_symbol): Use bfd_zalloc. + (coff_get_normalized_symtab): Likewise. + (coff_make_empty_symbol): Likewise. + (bfd_coff_set_symbol_class): Likewise. + * cofflink.c (coff_link_add_symbols): Likewise. + * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise. + * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc. + (bfd_ecoff_write_accumulated_debug): Likewise. + * elf64-alpha.c (get_got_entry): Use bfd_zalloc. + * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise. + * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc. + * ieee.c (do_with_relocs): Use bfd_zalloc. + * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise. + * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. + (NAME(aout,slurp_reloc_table)): Likewise. + (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd. + * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc. + * som.c (som_build_and_write_symbol_table): Likewise. + (som_slurp_string_table): Likewise. + (som_slurp_symbol_table): Likewise. + (som_bfd_ar_write_symbol_stuff): Likewise. + * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc. + * sunos.c (bfd_sunos_size_dynamic_sections): Likewise. + * tekhex.c (find_chunk): Likewise. Get rid of unused "sname". + * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc. + * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc. + +2002-06-07 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with + "group" union. + (elf_group_name): Update. + (elf_group_id): Define. + (bfd_elf_set_group_contents): Declare. + * elf.c (elf_fake_sections): Qualify use of elf_group_name. + (set_group_contents): Rename to bfd_elf_set_group_contents. Remove + ATTRIBUTE_UNUSED from failedptrarg. If elf_group_id is set, use + that sym for the signature. + (_bfd_elf_compute_section_file_positions): Don't call + set_group_contents for "ld -r" case. + (swap_out_syms): Use bfd_zalloc. + * elflink.h (elf_link_add_archive_symbols): Likewise. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. + (elf_bfd_final_link): Call bfd_elf_set_group_contents. + +2002-06-07 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved + relocs in opd for non-shared too. + +2002-06-06 Jeffrey Law <law@redhat.com + + * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting + relocations. + +2002-06-06 Nick Clifton <nickc@cambridge.redhat.com> + + * merge.c: Include libiberty.h. + * elf-strtab.c: Include libiberty.h. + +2002-06-06 Elias Athanasopoulos <eathan@otenet.gr> + + * peXXigen.c (pe_print_idata): Remove unused variable. + +2002-06-06 David Heine <dlheine@tensilica.com> + + * elf.c (assign_file_positions_for_segments): Remove unallocated + sections from the section to segment mapping for PT_LOAD segments. + Update comment about empty loadable segments. + +2002-06-06 Richard Sandiford <rsandifo@redhat.com> + + * stabs.c (_bfd_link_section_stabs): Check that the symbol offset + is within the .stabstr section. + +2002-06-06 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h (struct elf_size_info <swap_symbol_in>): Function args + are "const PTR", not "const PTR *". + (bfd_elf32_swap_symbol_in): Likewise. + (bfd_elf64_swap_symbol_in): Likewise. + * elfcode.h (elf_swap_symbol_in): Change input args to const PTR. + (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_reloc_symbol_deleted_p): Likewise. + * elf-m10200.c (mn10200_elf_relax_section): Likewise. + (mn10200_elf_relax_delete_bytes): Likewise. + (mn10200_elf_symbol_address_p): Likewise. + (mn10200_elf_get_relocated_section_contents): Likewise. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (get_local_syms): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-ppc.c (get_local_syms): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + +2002-06-05 J"orn Rennecke <joern.rennecke@superh.com> + + * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations. + +2002-06-05 Alan Modra <amodra@bigpond.net.au> + + * elf.c (group_signature): Swap in the whole symbol, and handle + extracting section symbol names. + (setup_group): Add comment. + (set_group_contents): When called from objcopy or ld, arrange for + section contents to be written. Write group member output section + indices to allow objcopy to reorganize sections. + (_bfd_elf_copy_private_section_data): Copy group info. + + * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field. + (bfd_elf32_swap_symbol_in): Update prototype. + (bfd_elf64_swap_symbol_in): Likewise. + * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *. + (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_reloc_symbol_deleted_p): Likewise. + * elf-m10200.c (mn10200_elf_relax_section): Likewise. + (mn10200_elf_relax_delete_bytes): Likewise. + (mn10200_elf_symbol_address_p): Likewise. + (mn10200_elf_get_relocated_section_contents): Likewise. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (get_local_syms): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-ppc.c (get_local_syms): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser. + * elf64-alpha.c (alpha_elf_size_info): Likewise. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-mips.c (mips_elf64_size_info): Likewise. + * elf64-s390.c (s390_elf64_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2002-06-05 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to... + elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here. + elf64-mips.c (elf_backend_ignore_discarded_relocs): Use + _bfd_mips_elf_ignore_discarded_relocs. + elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare. + +2002-06-05 H.J. Lu <hjl@gnu.org> + + * elfxx-mips.c (mips_elf_calculate_relocation): Call + _bfd_elf_rel_local_sym for STT_SECTION relocations against + the SEC_MERGE section. + +2002-06-05 Alan Modra <amodra@bigpond.net.au> + + * coff-alpha.c: Update copyright date. + * coff-mips.c: Likewise. + * xcoff-target.h: Likewise. + + * bfd-in.h: Remove "taken from the source" comment. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + + * elf.c (bfd_elf_discard_group): Return true. + * elf-bfd.h (bfd_elf_discard_group): Declare. + * bfd-in.h (bfd_elf_discard_group): Don't declare here. + * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. + * bfd.c (bfd_discard_group): Define. + * targets.c (struct bfd_target): Add _bfd_discard_group. + (BFD_JUMP_TABLE_LINK): Here too. + * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. + * aout-adobe.c (aout_32_bfd_discard_group): Define. + * aout-target.h (MY_bfd_discard_group): Define. + * aout-tic30.c (MY_bfd_discard_group): Define. + * binary.c (binary_bfd_discard_group): Define. + * bout.c (b_out_bfd_discard_group): Define. + * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. + * coffcode.h (coff_bfd_discard_group): Define. + * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. + * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. + * i386msdos.c (msdos_bfd_discard_group): Define. + * i386os9k.c (os9k_bfd_discard_group): Define. + * ieee.c (ieee_bfd_discard_group): Define. + * ihex.c (ihex_bfd_discard_group): Define. + * mmo.c (mmo_bfd_discard_group): Define. + * nlm-target.h (nlm_bfd_discard_group): Define. + * oasys.c (oasys_bfd_discard_group): Define. + * ppcboot.c (ppcboot_bfd_discard_group): Define. + * som.c (som_bfd_discard_group): Define. + * srec.c (srec_bfd_discard_group): Define. + * tekhex.c (tekhex_bfd_discard_group): Define. + * versados.c (versados_bfd_discard_group): Define. + * vms.c (vms_bfd_discard_group): Define. + * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. + * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. + (aix5coff64_vec): Likewise. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. + +2002-06-04 Jason Thorpe <thorpej@wasabisystems.com> + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c. + (elf32-sh64-com.lo): New dependency list. + * Makefile.in: Regenerate. + * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec) + (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add + elf32-sh64-com.lo. + * configure: Regenerate. + * elf32-sh64.c (sh64_address_in_cranges) + (sh64_get_contents_type, sh64_address_is_shmedia): Move to... + (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb): + (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to... + * elf32-sh64-com.c: ...here. New file. + +2002-06-04 Alan Modra <amodra@bigpond.net.au> + + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove + ATTRIBUTE_UNUSED on used params. + * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks + before calling bfd_section_from_elf_index on local syms. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise. + +2002-06-04 Jason Thorpe <thorpej@wasabisystems.com> + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c. + (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo. + (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c. + (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules. + * Makefile.in: Regenerate. + * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*) + (sh64-*-netbsd*): New targets. + * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec, + bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec. + * configure: Regenerate. + * elf32-sh64-nbsd.c: New file. + * elf64-sh64-nbsd.c: New file. + * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec, + bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and + bfd_elf64_sh64lnbsd_vec. + +2002-06-04 Alan Modra <amodra@bigpond.net.au> + + * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups. + (bfd_section_from_shdr): Likewise. Set section name of group + sections from signature. + (group_signature): Split out from setup_group. Ensure symbol table + is available. + (bfd_elf_discard_group): New function. + (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on + .gnu.linkonce* sections if they are members of a group. + (set_group_contents): Set GRP_COMDAT flag. + * section.c (bfd_discard_group): New function. + * bfd-in.h (bfd_elf_discard_group): Declare. + * bfd-in2.h: Regenerate. + * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field. + (elf_linkonce_p): Define. + +2002-06-04 Alan Modra <amodra@bigpond.net.au> + + * elf.c (bfd_section_from_shdr): Make "name" const. + * elf-bfd.h (elf_backend_section_from_shdr): Likewise. + * elf32-i370.c (i370_elf_section_from_shdr): Likewise. + * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise. + * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise. + * elf32-v850.c (v850_elf_section_from_shdr): Likewise. + * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise. + * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise. + * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise. + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise. + * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise. + * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise. + +2002-06-03 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * elfxx-mips.c (ABI_64_P): Use backend's data to determine the + ABI. + +2002-06-02 Kazu Hirata <kazu@cs.umass.edu> + + * elf32-arc.c: Fix formatting. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-dlx.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i386qnx.c: Likewise. + * elf32-or32.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + +2002-06-02 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference + null when there are no got entries for a symbol. + (elf64_alpha_relax_find_tls_segment): Rearrange to avoid + uninitialized variable warning. + +2002-06-01 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for + undefined symbols here. + (elf64_alpha_relax_section): Do it here. Also test for not + defined in the current module. + (elf64_alpha_relocate_section_r): Split out of ... + (elf64_alpha_relocate_section): ... here. Don't dereference + NULL when looking up local got entries. + +2002-06-01 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined + symbols from JSR relaxation. + (elf64_alpha_size_plt_section_1): New. + (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ... + (elf64_alpha_size_rela_got_1): ... here. + (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ... + (elf64_alpha_size_rela_got_section): ... here. + (elf64_alpha_size_plt_section): New. + (elf64_alpha_relax_section): Call them. + (elf64_alpha_size_got_sections): Remove output_bfd arg. + (elf64_alpha_finish_dynamic_symbol): Check gotent use_count. + +2002-06-01 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New. + (elf64_alpha_relocate_section): Use them. Reject LE TLS relocs + in shared libraries. Fix DTPRELHI and TPRELHI value. + (INSN_ADDQ, INSN_RDUNIQ): New. + (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent. + (elf64_alpha_relax_with_lituse): Return boolean. Remove irelend + argument. Reject dynamic symbols. Use LITUSE symbolic constants. + (elf64_alpha_relax_got_load): Rename from relax_without_lituse. + Handle GOTDTPREL and GOTTPREL relocations. + (elf64_alpha_relax_gprelhilo): New. + (elf64_alpha_relax_tls_get_addr): New. + (elf64_alpha_relax_find_tls_segment): New. + (elf64_alpha_relax_section): Handle TLS relocations. + (ALPHA_ELF_LINK_HASH_TLS_IE): New. + (elf64_alpha_check_relocs): Set it. + +2002-06-01 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp. + + * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic + check; don't suppress dynamic relocs for non-allocated sections. + + * elf64-alpha.c: Remove dead code. + +2002-05-31 Alan Modra <amodra@bigpond.net.au> + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate + space for bss .plt. + +2002-05-31 Graeme Peterson <gp@qnx.com> + + * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo. + (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * config.bfd: Add i[3456]86-*-nto-qnx* support. + * configure.in: Add bfd_elf32_i386qnx_vec support. + * configure: Regenerate. + * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf.c (assign_file_positions_for_segments): Call backend + set_nonloadable_filepos. Fix non-K&R call to _bfd_error_handler. + (IS_CONTAINED_BY_FILEPOS): Define. + (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS. + (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS. Typo fix. + Fix non-K&R call to _bfd_error_handler. + (_bfd_elf_copy_private_section_data): Use backend + copy_private_bfd_data_p. + * elf32-i386.c: Don't include elfxx-target.h when + ELF32_I386_C_INCLUDED is defined. + * elf32-i386qnx.c: New QNX elf backend file. + * elfxx-target.h: Add elf_backend_set_nonloadable_filepos, + elf_backend_is_contained_by_filepos, and + elf_backend_do_copy_private_bfd_data. + * targets.c: Add bfd_target bfd_elf32_i386qnx_vec. + +2002-05-31 Alan Modra <amodra@bigpond.net.au> + + * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define. + Move other similar defines to start of file. + +2002-05-30 Tom Rix <trix@redhat.com> + + * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA. + * coff64-rs6000.c (xcoff64_rtype2howto): Same. + +2002-05-30 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD, + ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New. + (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove. + (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove. + (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated. + (struct alpha_elf_obj_tdata): Rename total_got_entries and + n_local_got_entries to total_got_size and local_got_size. + (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs. + (alpha_got_entry_size): New. + (elf64_alpha_relax_with_lituse): Use it. + (elf64_alpha_relax_without_lituse): Likewise. + (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES. + (get_got_entry): New. + (elf64_alpha_check_relocs): Handle TLS relocs. Reorganize. + (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask. + (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type. + (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise. + (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size. + (elf64_alpha_calc_got_offsets): Likewise. + (alpha_dynamic_entries_for_reloc): New. + (elf64_alpha_calc_dynrel_sizes): Use it. + (elf64_alpha_size_dynamic_sections): Likewise. + (elf64_alpha_relocate_section): Handle TLS relocations. + * reloc.c: Add Alpha TLS relocations. + * bfd-in2.h, libbfd.h: Rebuild. + +2002-05-29 Ralf Habacker <ralf.habacker@freenet.de> + + * peXXigen.c (pe_print_idata): Remove double printed + import table lines; add Bound-To comment. + +2002-05-29 Matt Thomas <matt@3am-software.com> + + * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo. + (BFD32_BACKENDS_CFILES): Add elf32-vax.c. + (elf32-vax.lo): New rule. + * Makefile.in: Regenerate. + * configure.in (bfd_elf32_vax_vec) + (vaxnetbsd_vec): New vectors. + * configure: Regenerate. + * config.bfd (vax-*-netbsdelf*) + (vax-*-netbsdaout*) + (vax-*-netbsd*): New targets. + * elf32-vax.c: New file. + * reloc.c: Add VAX relocations. + * bfd-in2.h: Regenerate. + * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec. + +2002-05-29 Jason Thorpe <thorpej@wasabisystems.com> + + * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec + and bfd_elf32_bigarm_vec to targ_selvecs. + +2002-05-29 Ralf Habacker <ralf.habacker@freenet.de> + + * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables + with auto-imported symbols. + +2002-05-29 Adam Nemet <anemet@lnxw.com> + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue + sections only record bfd. + (bfd_elf32_arm_add_glue_sections_to_bfd): New function. + * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it. + * bfd-in2.h: Regenerate. + +2002-05-28 Nick Clifton <nickc@cambridge.redhat.com> + + * syms.c (_bfd_stab_section_find_nearest_line): Move + declaration and initialisation of saw_line and saw_func out of + for loop. + +2002-05-29 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c (ppc64_elf_get_symbol_info): New function. + (bfd_elf64_get_symbol_info): Define. + * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef. + +2002-05-29 Andrey Volkov <avolkov@transas.com> + + * cpu-h8300.c: Make default h8300 machine first in machine list. + 2002-05-28 Kuang Hwa Lin <kuang@sbcglobal.net> * config.bfd: Added DLX configuraton. @@ -120,7 +2056,7 @@ 2002-05-21 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> - * bfd/bfd.c (bfd_get_arch_size): Remove bfd_set_error call for + * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for non-ELF targets. 2002-05-21 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> @@ -309,7 +2245,7 @@ 2002-05-10 Alan Modra <amodra@bigpond.net.au> * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks - addend in 2002-05-09 commit. + added in 2002-05-09 commit. * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04, don't look for stubs on all undefined syms. @@ -566,7 +2502,7 @@ 2002-04-30 Mark Mitchell <mark@codesourcery.com> - * bfd/config.bfd: Add support for powerpc-*-windiss. + * config.bfd: Add support for powerpc-*-windiss. 2002-04-30 Tom Rix <trix@redhat.com> @@ -2216,7 +4152,7 @@ 2002-01-25 Steve Ellcey <sje@cup.hp.com> - * bfd/elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. + * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. 2002-01-25 Philipp Thomas <pthomas@suse.de> @@ -2250,8 +4186,7 @@ 2002-01-23 Steve Ellcey <sje@cup.hp.com> - * bfd/targets.c (bfd_elf32_ia64_hpux_big_vec): Add to - DEFAULT_VECTOR. + * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR. (bfd_elf64_ia64_hpux_big_vec): Ditto. (bfd_elf32_h8300_vec): Ditto. diff --git a/bfd/ChangeLog-0001 b/bfd/ChangeLog-0001 index 3000c03..b5a3475 100644 --- a/bfd/ChangeLog-0001 +++ b/bfd/ChangeLog-0001 @@ -1514,7 +1514,7 @@ 2001-10-08 Aldy Hernandez <aldyh@redhat.com> - * bfd/config.bfd (targ_cpu): Add arm9e-*-elf. + * config.bfd (targ_cpu): Add arm9e-*-elf. 2001-10-06 Stephane Carrez <Stephane.Carrez@worldnet.fr> @@ -2858,13 +2858,13 @@ 2001-08-31 Eric Christopher <echristo@redhat.com> Jason Eckhardt <jle@redhat.com> - * bfd/archures.c: Add mipsisa32 and mipsisa64. Remove mips32, + * archures.c: Add mipsisa32 and mipsisa64. Remove mips32, mips32_4k and mips64. - * bfd/aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, + * aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, bfd_mach_mips64. Add bfd_mach_mipsisa32, bfd_mach_mipsisa64. - * bfd/cpu-mips.c: Ditto. - * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. - * bfd/bfd-in2.h: Regenerate. + * 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> @@ -3726,7 +3726,7 @@ 2001-07-04 H.J. Lu <hjl@gnu.org> - * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4400, bfd_mach_mips4600 and bfd_mach_mips5000. @@ -4529,7 +4529,7 @@ * elf32-openrisc.c (openrisc_elf_howto_table): Do not complain about overflow in R_OPENRISC_LO_16_IN_INSN and - R_OPENRISC_HI_16_IN_INSN.Index: bfd/elf32-openrisc.c + R_OPENRISC_HI_16_IN_INSN. 2001-04-30 H.J. Lu <hjl@gnu.org> diff --git a/bfd/Makefile.am b/bfd/Makefile.am index e8e0cc0..d945dc3 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -58,6 +58,7 @@ ALL_MACHINES = \ cpu-d30v.lo \ cpu-dlx.lo \ cpu-fr30.lo \ + cpu-frv.lo \ cpu-h8300.lo \ cpu-h8500.lo \ cpu-hppa.lo \ @@ -66,6 +67,7 @@ ALL_MACHINES = \ cpu-i386.lo \ cpu-i860.lo \ cpu-i960.lo \ + cpu-ip2k.lo \ cpu-m32r.lo \ cpu-m68hc11.lo \ cpu-m68hc12.lo \ @@ -107,6 +109,7 @@ ALL_MACHINES_CFILES = \ cpu-d30v.c \ cpu-dlx.c \ cpu-fr30.c \ + cpu-frv.c \ cpu-h8300.c \ cpu-h8500.c \ cpu-hppa.c \ @@ -115,6 +118,7 @@ ALL_MACHINES_CFILES = \ cpu-i386.c \ cpu-i860.c \ cpu-i960.c \ + cpu-ip2k.c \ cpu-m32r.c \ cpu-m68hc11.c \ cpu-m68hc12.c \ @@ -196,20 +200,24 @@ BFD32_BACKENDS = \ elf32-arc.lo \ elfarm-oabi.lo \ elfarm-nabi.lo \ + elfarmqnx-nabi.lo \ elf32-avr.lo \ elf32-cris.lo \ elf32-d10v.lo \ elf32-d30v.lo \ elf32-dlx.lo \ elf32-fr30.lo \ + elf32-frv.lo \ elf32-gen.lo \ elf32-h8300.lo \ elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ + elf32-i386qnx.lo \ elf32-i860.lo \ elf32-i960.lo \ elf32-ia64.lo \ + elf32-ip2k.lo \ elf32-m32r.lo \ elf32-m68hc11.lo \ elf32-m68hc12.lo \ @@ -224,13 +232,18 @@ BFD32_BACKENDS = \ elf32-or32.lo \ elf32-pj.lo \ elf32-ppc.lo \ + elf32-ppcqnx.lo \ elf32-s390.lo \ elf32-sh.lo \ elf32-sh-lin.lo \ elf32-sh64.lo \ + elf32-sh64-com.lo \ elf32-sh-nbsd.lo \ + elf32-sh64-nbsd.lo \ + elf32-shqnx.lo \ elf32-sparc.lo \ elf32-v850.lo \ + elf32-vax.lo \ elf32-xstormy16.lo \ elf32.lo \ elflink.lo \ @@ -289,6 +302,8 @@ BFD32_BACKENDS = \ sparcnetbsd.lo \ sunos.lo \ vaxnetbsd.lo \ + vax1knetbsd.lo \ + vaxbsd.lo \ versados.lo \ vms.lo \ vms-gsd.lo \ @@ -346,19 +361,23 @@ BFD32_BACKENDS_CFILES = \ elf32-arc.c \ elfarm-oabi.c \ elfarm-nabi.c \ + elfarmqnx-nabi.c \ elf32-avr.c \ elf32-cris.c \ elf32-d10v.c \ elf32-d30v.c \ elf32-dlx.c \ elf32-fr30.c \ + elf32-frv.c \ elf32-gen.c \ elf32-h8300.c \ elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ + elf32-i386qnx.c \ elf32-i860.c \ elf32-i960.c \ + elf32-ip2k.c \ elf32-m32r.c \ elf32-m68k.c \ elf32-m68hc11.c \ @@ -373,13 +392,18 @@ BFD32_BACKENDS_CFILES = \ elf32-or32.c \ elf32-pj.c \ elf32-ppc.c \ + elf32-ppcqnx.c \ elf32-sh64.c \ + elf32-sh64-com.c \ elf32-s390.c \ elf32-sh.c \ elf32-sh-lin.c \ elf32-sh-nbsd.c \ + elf32-sh64-nbsd.c \ + elf32-shqnx.c \ elf32-sparc.c \ elf32-v850.c \ + elf32-vax.c \ elf32-xstormy16.c \ elf32.c \ elflink.c \ @@ -437,6 +461,8 @@ BFD32_BACKENDS_CFILES = \ sparcnetbsd.c \ sunos.c \ vaxnetbsd.c \ + vax1knetbsd.c \ + vaxbsd.c \ versados.c \ vms.c \ vms-gsd.c \ @@ -460,9 +486,11 @@ BFD64_BACKENDS = \ elf64-hppa.lo \ elf64-ia64.lo \ elf64-gen.lo \ + elfn32-mips.lo \ elf64-mips.lo \ elf64-mmix.lo \ elf64-sh64.lo \ + elf64-sh64-nbsd.lo \ elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ @@ -483,11 +511,13 @@ BFD64_BACKENDS_CFILES = \ elf64-alpha.c \ elf64-hppa.c \ elf64-gen.c \ + elfn32-mips.c \ elf64-mips.c \ elf64-mmix.c \ elf64-ppc.c \ elf64-s390.c \ elf64-sh64.c \ + elf64-sh64-nbsd.c \ elf64-sparc.c \ elf64.c \ mmo.c \ @@ -818,7 +848,6 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host $(SHELL) ./config.status --recheck - # What appears below is generated by a hacked mkdep using gcc -MM. # DO NOT DELETE THIS LINE -- mkdep uses it. @@ -858,7 +887,8 @@ stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def -merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + $(INCDIR)/libiberty.h dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h @@ -871,8 +901,9 @@ cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h -cpu-dlx.lo: cpu-d30v.c $(INCDIR)/filenames.h +cpu-dlx.lo: cpu-dlx.c $(INCDIR)/filenames.h cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h +cpu-frv.lo: cpu-frv.c $(INCDIR)/filenames.h cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h cpu-hppa.lo: cpu-hppa.c $(INCDIR)/filenames.h @@ -882,6 +913,7 @@ cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-ip2k.lo: cpu-ip2k.c $(INCDIR)/filenames.h cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h @@ -1072,6 +1104,10 @@ elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-arm.h elf32-target.h +elfarmqnx-nabi.lo: elfarmqnx-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/filenames.h elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf32-arm.h elf32-target.h elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ @@ -1096,6 +1132,10 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-frv.lo: elf32-frv.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1114,6 +1154,10 @@ elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-i386qnx.lo: elf32-i386qnx.c elf32-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ @@ -1122,6 +1166,10 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1180,11 +1228,19 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-ppcqnx.lo: elf32-ppcqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ @@ -1201,6 +1257,15 @@ elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-shqnx.lo: elf32-shqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ @@ -1210,6 +1275,10 @@ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/libiberty.h elf32-target.h +elf32-vax.lo: elf32-vax.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/vax.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ @@ -1224,7 +1293,7 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/external.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-eh-frame.lo: elf-eh-frame.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h @@ -1394,6 +1463,12 @@ sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ vaxnetbsd.lo: vaxnetbsd.c netbsd.h $(INCDIR)/filenames.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +vax1knetbsd.lo: vax1knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +vaxbsd.lo: vaxbsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h versados.lo: versados.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h @@ -1447,6 +1522,12 @@ elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf64-target.h +elfn32-mips.lo: elfn32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h elf-bfd.h elfxx-mips.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/mips.h ecoffswap.h elf32-target.h elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ @@ -1470,6 +1551,10 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h +elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \ + $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index cffcb07..6a137cd 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -184,6 +184,7 @@ ALL_MACHINES = \ cpu-d30v.lo \ cpu-dlx.lo \ cpu-fr30.lo \ + cpu-frv.lo \ cpu-h8300.lo \ cpu-h8500.lo \ cpu-hppa.lo \ @@ -192,6 +193,7 @@ ALL_MACHINES = \ cpu-i386.lo \ cpu-i860.lo \ cpu-i960.lo \ + cpu-ip2k.lo \ cpu-m32r.lo \ cpu-m68hc11.lo \ cpu-m68hc12.lo \ @@ -234,6 +236,7 @@ ALL_MACHINES_CFILES = \ cpu-d30v.c \ cpu-dlx.c \ cpu-fr30.c \ + cpu-frv.c \ cpu-h8300.c \ cpu-h8500.c \ cpu-hppa.c \ @@ -242,6 +245,7 @@ ALL_MACHINES_CFILES = \ cpu-i386.c \ cpu-i860.c \ cpu-i960.c \ + cpu-ip2k.c \ cpu-m32r.c \ cpu-m68hc11.c \ cpu-m68hc12.c \ @@ -324,20 +328,24 @@ BFD32_BACKENDS = \ elf32-arc.lo \ elfarm-oabi.lo \ elfarm-nabi.lo \ + elfarmqnx-nabi.lo \ elf32-avr.lo \ elf32-cris.lo \ elf32-d10v.lo \ elf32-d30v.lo \ elf32-dlx.lo \ elf32-fr30.lo \ + elf32-frv.lo \ elf32-gen.lo \ elf32-h8300.lo \ elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ + elf32-i386qnx.lo \ elf32-i860.lo \ elf32-i960.lo \ elf32-ia64.lo \ + elf32-ip2k.lo \ elf32-m32r.lo \ elf32-m68hc11.lo \ elf32-m68hc12.lo \ @@ -352,13 +360,18 @@ BFD32_BACKENDS = \ elf32-or32.lo \ elf32-pj.lo \ elf32-ppc.lo \ + elf32-ppcqnx.lo \ elf32-s390.lo \ elf32-sh.lo \ elf32-sh-lin.lo \ elf32-sh64.lo \ + elf32-sh64-com.lo \ elf32-sh-nbsd.lo \ + elf32-sh64-nbsd.lo \ + elf32-shqnx.lo \ elf32-sparc.lo \ elf32-v850.lo \ + elf32-vax.lo \ elf32-xstormy16.lo \ elf32.lo \ elflink.lo \ @@ -417,6 +430,8 @@ BFD32_BACKENDS = \ sparcnetbsd.lo \ sunos.lo \ vaxnetbsd.lo \ + vax1knetbsd.lo \ + vaxbsd.lo \ versados.lo \ vms.lo \ vms-gsd.lo \ @@ -475,19 +490,23 @@ BFD32_BACKENDS_CFILES = \ elf32-arc.c \ elfarm-oabi.c \ elfarm-nabi.c \ + elfarmqnx-nabi.c \ elf32-avr.c \ elf32-cris.c \ elf32-d10v.c \ elf32-d30v.c \ elf32-dlx.c \ elf32-fr30.c \ + elf32-frv.c \ elf32-gen.c \ elf32-h8300.c \ elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ + elf32-i386qnx.c \ elf32-i860.c \ elf32-i960.c \ + elf32-ip2k.c \ elf32-m32r.c \ elf32-m68k.c \ elf32-m68hc11.c \ @@ -502,13 +521,18 @@ BFD32_BACKENDS_CFILES = \ elf32-or32.c \ elf32-pj.c \ elf32-ppc.c \ + elf32-ppcqnx.c \ elf32-sh64.c \ + elf32-sh64-com.c \ elf32-s390.c \ elf32-sh.c \ elf32-sh-lin.c \ elf32-sh-nbsd.c \ + elf32-sh64-nbsd.c \ + elf32-shqnx.c \ elf32-sparc.c \ elf32-v850.c \ + elf32-vax.c \ elf32-xstormy16.c \ elf32.c \ elflink.c \ @@ -566,6 +590,8 @@ BFD32_BACKENDS_CFILES = \ sparcnetbsd.c \ sunos.c \ vaxnetbsd.c \ + vax1knetbsd.c \ + vaxbsd.c \ versados.c \ vms.c \ vms-gsd.c \ @@ -590,9 +616,11 @@ BFD64_BACKENDS = \ elf64-hppa.lo \ elf64-ia64.lo \ elf64-gen.lo \ + elfn32-mips.lo \ elf64-mips.lo \ elf64-mmix.lo \ elf64-sh64.lo \ + elf64-sh64-nbsd.lo \ elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ @@ -614,11 +642,13 @@ BFD64_BACKENDS_CFILES = \ elf64-alpha.c \ elf64-hppa.c \ elf64-gen.c \ + elfn32-mips.c \ elf64-mips.c \ elf64-mmix.c \ elf64-ppc.c \ elf64-s390.c \ elf64-sh64.c \ + elf64-sh64-nbsd.c \ elf64-sparc.c \ elf64.c \ mmo.c \ @@ -1387,7 +1417,8 @@ stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def -merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h +merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ + $(INCDIR)/libiberty.h dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h @@ -1400,8 +1431,9 @@ cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h -cpu-dlx.lo: cpu-d30v.c $(INCDIR)/filenames.h +cpu-dlx.lo: cpu-dlx.c $(INCDIR)/filenames.h cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h +cpu-frv.lo: cpu-frv.c $(INCDIR)/filenames.h cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h cpu-hppa.lo: cpu-hppa.c $(INCDIR)/filenames.h @@ -1411,6 +1443,7 @@ cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-ip2k.lo: cpu-ip2k.c $(INCDIR)/filenames.h cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h @@ -1601,6 +1634,10 @@ elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-arm.h elf32-target.h +elfarmqnx-nabi.lo: elfarmqnx-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/filenames.h elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf32-arm.h elf32-target.h elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ @@ -1625,6 +1662,10 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-frv.lo: elf32-frv.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1643,6 +1684,10 @@ elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-i386qnx.lo: elf32-i386qnx.c elf32-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ @@ -1651,6 +1696,10 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1709,11 +1758,19 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-ppcqnx.lo: elf32-ppcqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ @@ -1730,6 +1787,15 @@ elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-shqnx.lo: elf32-shqnx.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h elf32-qnx.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ @@ -1739,6 +1805,10 @@ elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/libiberty.h elf32-target.h +elf32-vax.lo: elf32-vax.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/vax.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ @@ -1753,7 +1823,7 @@ elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/external.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h + $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h elf-eh-frame.lo: elf-eh-frame.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h @@ -1923,6 +1993,12 @@ sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ vaxnetbsd.lo: vaxnetbsd.c netbsd.h $(INCDIR)/filenames.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +vax1knetbsd.lo: vax1knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +vaxbsd.lo: vaxbsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h versados.lo: versados.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h @@ -1976,6 +2052,12 @@ elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf64-target.h +elfn32-mips.lo: elfn32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h elf-bfd.h elfxx-mips.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/mips.h ecoffswap.h elf32-target.h elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ @@ -1999,6 +2081,10 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h +elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \ + $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index c11c504..11f1ca3 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -416,7 +416,7 @@ aout_adobe_set_section_contents (abfd, section, location, offset, count) sec_ptr sect; /* Set by bfd.c handler. */ - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { /* Assign file offsets to sections. Text sections are first, and are contiguous. Then data sections. Everything else at the end. */ @@ -510,6 +510,7 @@ aout_adobe_sizeof_headers (ignore_abfd, ignore) #define aout_32_bfd_relax_section bfd_generic_relax_section #define aout_32_bfd_gc_sections bfd_generic_gc_sections #define aout_32_bfd_merge_sections bfd_generic_merge_sections +#define aout_32_bfd_discard_group bfd_generic_discard_group #define aout_32_bfd_link_hash_table_create \ _bfd_generic_link_hash_table_create #define aout_32_bfd_link_hash_table_free \ diff --git a/bfd/aout-ns32k.c b/bfd/aout-ns32k.c index e16388b..8456e80 100644 --- a/bfd/aout-ns32k.c +++ b/bfd/aout-ns32k.c @@ -1,23 +1,23 @@ /* BFD back-end for ns32k a.out-ish binaries. - Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000, 2001 + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Ian Dall (idall@eleceng.adelaide.edu.au). -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define BYTES_IN_WORD 4 @@ -49,16 +49,16 @@ void bfd_ns32k_arch PARAMS ((void)); #define MY(OP) MYNS(OP) -#define MY_swap_std_reloc_in MY(swap_std_reloc_in) +#define MY_swap_std_reloc_in MY(swap_std_reloc_in) #define MY_swap_std_reloc_out MY(swap_std_reloc_out) static void -MY_swap_std_reloc_in PARAMS ((bfd *abfd, struct reloc_std_external *bytes, - arelent *cache_ptr, asymbol **symbols, - bfd_size_type symcount)); +MY_swap_std_reloc_in PARAMS ((bfd *, struct reloc_std_external *, + arelent *, asymbol **, + bfd_size_type)); static void -MY_swap_std_reloc_out PARAMS ((bfd *abfd, arelent *g, - struct reloc_std_external *natptr)); +MY_swap_std_reloc_out PARAMS ((bfd *, arelent *, + struct reloc_std_external *)); reloc_howto_type * MY(reloc_howto) PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *)); @@ -94,47 +94,48 @@ MY(put_reloc) PARAMS ((bfd *, int, int, bfd_vma, reloc_howto_type *, In addition, for historical reasons the encoding of the relocation types in the a.out format relocation entries is such that even the relocation - methods which are standard are not encoded the standard way. */ + methods which are standard are not encoded the standard way. */ reloc_howto_type MY(howto_table)[] = { + /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ /* ns32k immediate operands. */ - HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, true, + HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, complain_overflow_signed, _bfd_ns32k_reloc_imm, "NS32K_IMM_8", true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, false, 0, true, + HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, false, 0, complain_overflow_signed, _bfd_ns32k_reloc_imm, "NS32K_IMM_16", true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, false, 0, true, + HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, false, 0, complain_overflow_signed, _bfd_ns32k_reloc_imm, "NS32K_IMM_32", true, 0xffffffff,0xffffffff, false), - HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, true, 0, false, + HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, true, 0, complain_overflow_signed, _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_8", true, 0x000000ff, 0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, true, 0, false, + HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, true, 0, complain_overflow_signed, _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_16", true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, true, 0, false, + HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, true, 0, complain_overflow_signed, _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_32", true, 0xffffffff,0xffffffff, false), /* ns32k displacements. */ - HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 8, false, 0, true, + HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 7, false, 0, complain_overflow_signed, _bfd_ns32k_reloc_disp, "NS32K_DISP_8", true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 16, false, 0, true, + HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 14, false, 0, complain_overflow_signed, _bfd_ns32k_reloc_disp, "NS32K_DISP_16", true, 0x0000ffff, 0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 32, false, 0, true, + HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 30, false, 0, complain_overflow_signed, _bfd_ns32k_reloc_disp, "NS32K_DISP_32", true, 0xffffffff, 0xffffffff, false), - HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 8, true, 0, false, + HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 7, true, 0, complain_overflow_signed, _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_8", true, 0x000000ff,0x000000ff, false), - HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 16, true, 0, false, + HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 14, true, 0, complain_overflow_signed, _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_16", true, 0x0000ffff,0x0000ffff, false), - HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 32, true, 0, false, + HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 30, true, 0, complain_overflow_signed, _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_32", true, 0xffffffff,0xffffffff, false), @@ -355,7 +356,7 @@ _bfd_ns32k_relocate_contents (howto, input_bfd, relocation, location) { int r_ns32k_type = (howto - MY(howto_table)) / 6; bfd_vma (*get_data) PARAMS ((bfd_byte *, int)); - int (*put_data) PARAMS ((bfd_vma, bfd_byte *, int)); + void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int)); switch (r_ns32k_type) { diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 15a2568..b2acc09 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -207,7 +207,7 @@ static boolean MY(mkobject) (abfd) bfd *abfd; { - if (NAME(aout,mkobject) (abfd) == false) + if (! NAME(aout,mkobject) (abfd)) return false; #if 0 /* Sizes get set in set_sizes callback, later, after we know the architecture and machine. */ @@ -513,6 +513,9 @@ MY_bfd_final_link (abfd, info) #ifndef MY_bfd_merge_sections #define MY_bfd_merge_sections bfd_generic_merge_sections #endif +#ifndef MY_bfd_discard_group +#define MY_bfd_discard_group bfd_generic_discard_group +#endif #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup) #endif diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index e00c137..a39a5b1 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -965,6 +965,9 @@ tic30_aout_set_arch_mach (abfd, arch, machine) #ifndef MY_bfd_merge_sections #define MY_bfd_merge_sections bfd_generic_merge_sections #endif +#ifndef MY_bfd_discard_group +#define MY_bfd_discard_group bfd_generic_discard_group +#endif #ifndef MY_bfd_reloc_type_lookup #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup #endif diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h index 0f773a1..80d69d9 100644 --- a/bfd/aoutf1.h +++ b/bfd/aoutf1.h @@ -748,7 +748,7 @@ sunos4_core_file_matches_executable_p (core_bfd, exec_bfd) return (memcmp ((char *) &((core_hdr (core_bfd)->hdr)->c_aouthdr), (char *) exec_hdr (exec_bfd), - sizeof (struct internal_exec)) == 0) ? true : false; + sizeof (struct internal_exec)) == 0); } #define MY_set_sizes sunos4_set_sizes diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 3c9cd4f..7eebb16 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -4,21 +4,21 @@ Free Software Foundation, Inc. Written by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* SECTION @@ -193,7 +193,7 @@ DESCRIPTION reloc_howto_type howto_table_ext[] = { - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ + /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ HOWTO(RELOC_8, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", false, 0,0x000000ff, false), HOWTO(RELOC_16, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", false, 0,0x0000ffff, false), HOWTO(RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", false, 0,0xffffffff, false), @@ -227,7 +227,7 @@ reloc_howto_type howto_table_ext[] = /* Convert standard reloc records to "arelent" format (incl byte swap). */ reloc_howto_type howto_table_std[] = { - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ + /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ HOWTO ( 0, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", true, 0x000000ff,0x000000ff, false), HOWTO ( 1, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", true, 0x0000ffff,0x0000ffff, false), HOWTO ( 2, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", true, 0xffffffff,0xffffffff, false), @@ -281,6 +281,7 @@ NAME(aout,reloc_type_lookup) (abfd,code) #define EXT(i, j) case i: return &howto_table_ext[j] #define STD(i, j) case i: return &howto_table_std[j] int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE; + if (code == BFD_RELOC_CTOR) switch (bfd_get_arch_info (abfd)->bits_per_address) { @@ -291,6 +292,7 @@ NAME(aout,reloc_type_lookup) (abfd,code) code = BFD_RELOC_64; break; } + if (ext) switch (code) { @@ -313,7 +315,7 @@ NAME(aout,reloc_type_lookup) (abfd,code) default: return (reloc_howto_type *) NULL; } else - /* std relocs */ + /* std relocs. */ switch (code) { STD (BFD_RELOC_16, 1); @@ -474,14 +476,15 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) *abfd->tdata.aout_data = *oldrawptr; abfd->tdata.aout_data->a.hdr = &rawptr->e; - *(abfd->tdata.aout_data->a.hdr) = *execp; /* Copy in the internal_exec struct */ + /* Copy in the internal_exec struct. */ + *(abfd->tdata.aout_data->a.hdr) = *execp; execp = abfd->tdata.aout_data->a.hdr; - /* Set the file flags */ + /* Set the file flags. */ abfd->flags = BFD_NO_FLAGS; if (execp->a_drsize || execp->a_trsize) abfd->flags |= HAS_RELOC; - /* Setting of EXEC_P has been deferred to the bottom of this function */ + /* Setting of EXEC_P has been deferred to the bottom of this function. */ if (execp->a_syms) abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS; if (N_DYNAMIC (*execp)) @@ -533,7 +536,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) obj_aout_sym_hashes (abfd) = NULL; if (! NAME(aout,make_sections) (abfd)) - return NULL; + goto error_ret; obj_datasec (abfd)->_raw_size = execp->a_data; obj_bsssec (abfd)->_raw_size = execp->a_bss; @@ -563,18 +566,18 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) obj_textsec (abfd)->size = N_TXTSIZE (*execp); obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp); - /* data and bss are already filled in since they're so standard */ + /* Data and bss are already filled in since they're so standard. */ - /* The virtual memory addresses of the sections */ + /* The virtual memory addresses of the sections. */ obj_textsec (abfd)->vma = N_TXTADDR (*execp); obj_datasec (abfd)->vma = N_DATADDR (*execp); obj_bsssec (abfd)->vma = N_BSSADDR (*execp); - /* The file offsets of the sections */ + /* The file offsets of the sections. */ obj_textsec (abfd)->filepos = N_TXTOFF (*execp); obj_datasec (abfd)->filepos = N_DATOFF (*execp); - /* The file offsets of the relocation info */ + /* The file offsets of the relocation info. */ obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp); obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp); @@ -655,13 +658,13 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) obj_textsec (abfd)->next = obj_datasec (abfd); obj_datasec (abfd)->next = obj_bsssec (abfd); #endif + return result; } - else - { - free (rawptr); - abfd->tdata.aout_data = oldrawptr; - } - return result; + + error_ret: + bfd_release (abfd, rawptr); + abfd->tdata.aout_data = oldrawptr; + return NULL; } /* @@ -865,7 +868,7 @@ NAME(aout,set_arch_mach) (abfd, arch, machine) return false; } - /* Determine the size of a relocation entry */ + /* Determine the size of a relocation entry. */ switch (arch) { case bfd_arch_sparc: @@ -903,7 +906,7 @@ adjust_o_magic (abfd, execp) /* Data. */ if (!obj_datasec (abfd)->user_set_vma) { -#if 0 /* ?? Does alignment in the file image really matter? */ +#if 0 /* ?? Does alignment in the file image really matter? */ pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma; #endif obj_textsec (abfd)->_raw_size += pad; @@ -1220,35 +1223,34 @@ NAME(aout,new_section_hook) (abfd, newsect) bfd *abfd; asection *newsect; { - /* align to double at least */ + /* Align to double at least. */ newsect->alignment_power = bfd_get_arch_info (abfd)->section_align_power; if (bfd_get_format (abfd) == bfd_object) - { - if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text")) - { - obj_textsec (abfd)= newsect; - newsect->target_index = N_TEXT; - return true; - } - - if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) - { - obj_datasec (abfd) = newsect; - newsect->target_index = N_DATA; - return true; - } + { + if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text")) + { + obj_textsec (abfd)= newsect; + newsect->target_index = N_TEXT; + return true; + } - if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) - { - obj_bsssec (abfd) = newsect; - newsect->target_index = N_BSS; - return true; - } + if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) + { + obj_datasec (abfd) = newsect; + newsect->target_index = N_DATA; + return true; + } - } + if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) + { + obj_bsssec (abfd) = newsect; + newsect->target_index = N_BSS; + return true; + } + } - /* We allow more than three sections internally */ + /* We allow more than three sections internally. */ return true; } @@ -1310,9 +1312,9 @@ aout_get_external_symbols (abfd) count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE; #ifdef USE_MMAP - if (bfd_get_file_window (abfd, - obj_sym_filepos (abfd), exec_hdr (abfd)->a_syms, - &obj_aout_sym_window (abfd), true) == false) + if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), + exec_hdr (abfd)->a_syms, + &obj_aout_sym_window (abfd), true)) return false; syms = (struct external_nlist *) obj_aout_sym_window (abfd).data; #else @@ -1352,8 +1354,8 @@ aout_get_external_symbols (abfd) stringsize = GET_WORD (abfd, string_chars); #ifdef USE_MMAP - if (bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize, - &obj_aout_string_window (abfd), true) == false) + if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize, + &obj_aout_string_window (abfd), true)) return false; strings = (char *) obj_aout_string_window (abfd).data; #else @@ -1401,7 +1403,6 @@ translate_from_native_sym_flags (abfd, cache_ptr) asection *sec; /* This is a debugging symbol. */ - cache_ptr->symbol.flags = BSF_DEBUGGING; /* Work out the symbol section. */ @@ -1702,7 +1703,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) return false; } - /* Turn the symbol from section relative to absolute again */ + /* Turn the symbol from section relative to absolute again. */ value += sec->vma + off; if ((cache_ptr->flags & BSF_WARNING) != 0) @@ -1718,6 +1719,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) if ((cache_ptr->flags & BSF_CONSTRUCTOR) != 0) { int type = ((aout_symbol_type *) cache_ptr)->type; + switch (type) { case N_ABS: type = N_SETA; break; @@ -1826,7 +1828,7 @@ NAME(aout,slurp_symbol_table) (abfd) aout_symbol_type *cached; bfd_size_type cached_size; - /* If there's no work to be done, don't do any */ + /* If there's no work to be done, don't do any. */ if (obj_aout_symbols (abfd) != (aout_symbol_type *) NULL) return true; @@ -1837,11 +1839,9 @@ NAME(aout,slurp_symbol_table) (abfd) cached_size = obj_aout_external_sym_count (abfd); cached_size *= sizeof (aout_symbol_type); - cached = (aout_symbol_type *) bfd_malloc (cached_size); + cached = (aout_symbol_type *) bfd_zmalloc (cached_size); if (cached == NULL && cached_size != 0) return false; - if (cached_size != 0) - memset (cached, 0, (size_t) cached_size); /* Convert from external symbol information to internal. */ if (! (NAME(aout,translate_symbol_table) @@ -2025,7 +2025,7 @@ NAME(aout,get_symtab) (abfd, location) return bfd_get_symcount (abfd); } -/* Standard reloc stuff */ +/* Standard reloc stuff. */ /* Output standard relocation information to a file in target byte order. */ extern void NAME(aout,swap_std_reloc_out) @@ -2047,8 +2047,8 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) PUT_WORD (abfd, g->address, natptr->r_address); - r_length = g->howto->size ; /* Size as a power of two */ - r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ + r_length = g->howto->size ; /* Size as a power of two. */ + r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ /* XXX This relies on relocs coming from a.out files. */ r_baserel = (g->howto->type & 8) != 0; r_jmptable = (g->howto->type & 16) != 0; @@ -2059,43 +2059,41 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma; #endif - /* name was clobbered by aout_write_syms to be symbol index */ + /* Name was clobbered by aout_write_syms to be symbol index. */ /* If this relocation is relative to a symbol then set the r_index to the symbols index, and the r_extern bit. Absolute symbols can come in in two ways, either as an offset from the abs section, or as a symbol which has an abs value. - check for that here - */ + check for that here. */ if (bfd_is_com_section (output_section) || bfd_is_abs_section (output_section) || bfd_is_und_section (output_section)) { if (bfd_abs_section_ptr->symbol == sym) - { - /* Whoops, looked like an abs symbol, but is really an offset - from the abs section */ - r_index = N_ABS; - r_extern = 0; - } + { + /* Whoops, looked like an abs symbol, but is + really an offset from the abs section. */ + r_index = N_ABS; + r_extern = 0; + } else - { - /* Fill in symbol */ - r_extern = 1; - r_index = (*(g->sym_ptr_ptr))->KEEPIT; - - } + { + /* Fill in symbol. */ + r_extern = 1; + r_index = (*(g->sym_ptr_ptr))->KEEPIT; + } } else { - /* Just an ordinary section */ + /* Just an ordinary section. */ r_extern = 0; r_index = output_section->target_index; } - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { natptr->r_index[0] = r_index >> 16; @@ -2122,7 +2120,7 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) } } -/* Extended stuff */ +/* Extended stuff. */ /* Output extended relocation information to a file in target byte order. */ extern void NAME(aout,swap_ext_reloc_out) @@ -2155,7 +2153,6 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) Absolute symbols can come in in two ways, either as an offset from the abs section, or as a symbol which has an abs value. check for that here. */ - if (bfd_is_abs_section (bfd_get_section (sym))) { r_extern = 0; @@ -2172,12 +2169,12 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) } else { - /* Just an ordinary section */ + /* Just an ordinary section. */ r_extern = 0; r_index = output_section->target_index; } - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { natptr->r_index[0] = r_index >> 16; @@ -2258,7 +2255,7 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) cache_ptr->address = (GET_SWORD (abfd, bytes->r_address)); - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { r_index = ((bytes->r_index[0] << 16) @@ -2317,7 +2314,7 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) cache_ptr->address = H_GET_32 (abfd, bytes->r_address); - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { r_index = ((bytes->r_index[0] << 16) @@ -2411,10 +2408,9 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) count = reloc_size / each_size; amt = count * sizeof (arelent); - reloc_cache = (arelent *) bfd_malloc (amt); + reloc_cache = (arelent *) bfd_zmalloc (amt); if (reloc_cache == NULL && count != 0) return false; - memset (reloc_cache, 0, (size_t) amt); relocs = bfd_malloc (reloc_size); if (relocs == NULL && reloc_size != 0) @@ -2508,7 +2504,8 @@ NAME(aout,squirt_out_relocs) (abfd, section) return true; } -/* This is stupid. This function should be a boolean predicate */ +/* This is stupid. This function should be a boolean predicate. */ + long NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols) bfd *abfd; @@ -2561,10 +2558,9 @@ NAME(aout,get_reloc_upper_bound) (abfd, asect) bfd_set_error (bfd_error_invalid_operation); return -1; } + if (asect->flags & SEC_CONSTRUCTOR) - { - return (sizeof (arelent *) * (asect->reloc_count+1)); - } + return (sizeof (arelent *) * (asect->reloc_count+1)); if (asect == obj_datasec (abfd)) return (sizeof (arelent *) @@ -2742,11 +2738,9 @@ NAME(aout,minisymbol_to_symbol) (abfd, dynamic, minisym, sym) return sym; } -/* - provided a BFD, a section and an offset into the section, calculate - and return the name of the source file and the line nearest to the - wanted location. -*/ +/* Provided a BFD, a section and an offset into the section, calculate + and return the name of the source file and the line nearest to the + wanted location. */ boolean NAME(aout,find_nearest_line) @@ -2759,7 +2753,7 @@ NAME(aout,find_nearest_line) const char **functionname_ptr; unsigned int *line_ptr; { - /* Run down the file looking for the filename, function and linenumber */ + /* Run down the file looking for the filename, function and linenumber. */ asymbol **p; const char *directory_name = NULL; const char *main_file_name = NULL; @@ -2775,6 +2769,7 @@ NAME(aout,find_nearest_line) *filename_ptr = abfd->filename; *functionname_ptr = 0; *line_ptr = 0; + if (symbols != (asymbol **)NULL) { for (p = symbols; *p; p++) @@ -2862,12 +2857,13 @@ NAME(aout,find_nearest_line) break; case N_FUN: { - /* We'll keep this if it is nearer than the one we have already */ + /* We'll keep this if it is nearer than the one we have already. */ if (q->symbol.value >= low_func_vma && - q->symbol.value <= offset) { - low_func_vma = q->symbol.value; - func = (asymbol *)q; - } + q->symbol.value <= offset) + { + low_func_vma = q->symbol.value; + func = (asymbol *)q; + } else if (q->symbol.value > offset) goto done; } @@ -2889,6 +2885,7 @@ NAME(aout,find_nearest_line) filelen = 0; else filelen = strlen (directory_name) + strlen (main_file_name); + if (func == NULL) funclen = 0; else @@ -2896,6 +2893,7 @@ NAME(aout,find_nearest_line) if (adata (abfd).line_buf != NULL) free (adata (abfd).line_buf); + if (filelen + funclen == 0) adata (abfd).line_buf = buf = NULL; else @@ -2933,7 +2931,7 @@ NAME(aout,find_nearest_line) buf[0] = bfd_get_symbol_leading_char (abfd); strcpy (buf + 1, function); } - /* Have to remove : stuff */ + /* Have to remove : stuff. */ colon = strchr (buf, ':'); if (colon != NULL) *colon = '\0'; @@ -3227,19 +3225,43 @@ aout_link_check_ar_symbols (abfd, info, pneeded) { /* This object file defines this symbol. We must link it in. This is true regardless of whether the current - definition of the symbol is undefined or common. If the - current definition is common, we have a case in which we - have already seen an object file including + definition of the symbol is undefined or common. + + If the current definition is common, we have a case in + which we have already seen an object file including: int a; - and this object file from the archive includes + and this object file from the archive includes: int a = 5; - In such a case we must include this object file. + In such a case, whether to include this object is target + dependant for backward compatability. FIXME: The SunOS 4.1.3 linker will pull in the archive element if the symbol is defined in the .data section, but not if it is defined in the .text section. That - seems a bit crazy to me, and I haven't implemented it. - However, it might be correct. */ + seems a bit crazy to me, and it has not been implemented + yet. However, it might be correct. */ + if (h->type == bfd_link_hash_common) + { + int skip = 0; + + switch (info->common_skip_ar_aymbols) + { + case bfd_link_common_skip_text: + skip = (type == (N_TEXT | N_EXT)); + break; + case bfd_link_common_skip_data: + skip = (type == (N_DATA | N_EXT)); + break; + default: + case bfd_link_common_skip_all: + skip = 1; + break; + } + + if (skip) + continue; + } + if (! (*info->callbacks->add_archive_element) (info, abfd, name)) return false; *pneeded = true; @@ -4189,7 +4211,8 @@ aout_link_write_symbols (finfo, input_bfd) /* Use the name from the hash table, in case the symbol was wrapped. */ - if (h != NULL) + if (h != NULL + && h->root.type != bfd_link_hash_warning) name = h->root.root.string; /* If this is an indirect or warning symbol, then change @@ -4211,7 +4234,6 @@ aout_link_write_symbols (finfo, input_bfd) /* If the symbol has already been written out, skip it. */ if (h != (struct aout_link_hash_entry *) NULL - && h->root.type != bfd_link_hash_warning && h->written) { if ((type & N_TYPE) == N_INDR diff --git a/bfd/archive.c b/bfd/archive.c index e9e07c5..d7ac214 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -603,8 +603,6 @@ bfd_generic_archive_p (abfd) char armag[SARMAG + 1]; bfd_size_type amt; - tdata_hold = abfd->tdata.aout_ar_data; - if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG) { if (bfd_get_error () != bfd_error_system_call) @@ -621,13 +619,15 @@ bfd_generic_archive_p (abfd) return 0; #endif - /* We are setting bfd_ardata(abfd) here, but since bfd_ardata - involves a cast, we can't do it as the left operand of assignment. */ - amt = sizeof (struct artdata); - abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); + tdata_hold = bfd_ardata (abfd); + amt = sizeof (struct artdata); + bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == NULL) - return NULL; + { + bfd_ardata (abfd) = tdata_hold; + return NULL; + } bfd_ardata (abfd)->first_file_filepos = SARMAG; bfd_ardata (abfd)->cache = NULL; @@ -636,21 +636,13 @@ bfd_generic_archive_p (abfd) bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->tdata = NULL; - if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd))) + if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd)) + || !BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd))) { - bfd_release (abfd, bfd_ardata (abfd)); - abfd->tdata.aout_ar_data = tdata_hold; if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - if (!BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd))) - { bfd_release (abfd, bfd_ardata (abfd)); - abfd->tdata.aout_ar_data = tdata_hold; - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); + bfd_ardata (abfd) = tdata_hold; return NULL; } @@ -686,9 +678,9 @@ bfd_generic_archive_p (abfd) release bfd_ardata. FIXME. */ (void) bfd_close (first); bfd_release (abfd, bfd_ardata (abfd)); - abfd->tdata.aout_ar_data = tdata_hold; #endif bfd_set_error (bfd_error_wrong_object_format); + bfd_ardata (abfd) = tdata_hold; return NULL; } /* And we ought to close `first' here too. */ @@ -1746,7 +1738,7 @@ _bfd_write_archive_contents (arch) if (makemap && hasobjects) { - if (_bfd_compute_and_write_armap (arch, (unsigned int) elength) != true) + if (! _bfd_compute_and_write_armap (arch, (unsigned int) elength)) return false; } @@ -1876,8 +1868,8 @@ _bfd_compute_and_write_armap (arch, elength) current != (bfd *) NULL; current = current->next, elt_no++) { - if ((bfd_check_format (current, bfd_object) == true) - && ((bfd_get_file_flags (current) & HAS_SYMS))) + if (bfd_check_format (current, bfd_object) + && (bfd_get_file_flags (current) & HAS_SYMS) != 0) { long storage; long symcount; diff --git a/bfd/archures.c b/bfd/archures.c index 36fc568..dd51ec7 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -182,6 +182,7 @@ DESCRIPTION .#define bfd_mach_ppc_rs64ii 642 .#define bfd_mach_ppc_rs64iii 643 .#define bfd_mach_ppc_7400 7400 +.#define bfd_mach_ppc_e500 500 . bfd_arch_rs6000, {* IBM RS/6000 *} .#define bfd_mach_rs6k 0 .#define bfd_mach_rs6k_rs1 6001 @@ -247,10 +248,20 @@ DESCRIPTION .#define bfd_mach_am33 330 . bfd_arch_fr30, .#define bfd_mach_fr30 0x46523330 +. bfd_arch_frv, +.#define bfd_mach_frv 0 +.#define bfd_mach_frvsimple 1 +.#define bfd_mach_fr300 300 +.#define bfd_mach_fr400 400 +.#define bfd_mach_frvtomcat 499 {* fr500 prototype *} +.#define bfd_mach_fr500 500 . bfd_arch_mcore, . bfd_arch_ia64, {* HP/Intel ia64 *} .#define bfd_mach_ia64_elf64 0 .#define bfd_mach_ia64_elf32 1 +. bfd_arch_ip2k, {* Ubicom IP2K microcontrollers. *} +.#define bfd_mach_ip2022 0 +.#define bfd_mach_ip2022ext 1 . bfd_arch_pj, . bfd_arch_avr, {* Atmel AVR microcontrollers. *} .#define bfd_mach_avr1 1 @@ -315,6 +326,7 @@ extern const bfd_arch_info_type bfd_d10v_arch; extern const bfd_arch_info_type bfd_d30v_arch; extern const bfd_arch_info_type bfd_dlx_arch; extern const bfd_arch_info_type bfd_fr30_arch; +extern const bfd_arch_info_type bfd_frv_arch; extern const bfd_arch_info_type bfd_h8300_arch; extern const bfd_arch_info_type bfd_h8500_arch; extern const bfd_arch_info_type bfd_hppa_arch; @@ -323,6 +335,7 @@ extern const bfd_arch_info_type bfd_i386_arch; extern const bfd_arch_info_type bfd_i860_arch; extern const bfd_arch_info_type bfd_i960_arch; extern const bfd_arch_info_type bfd_ia64_arch; +extern const bfd_arch_info_type bfd_ip2k_arch; extern const bfd_arch_info_type bfd_m32r_arch; extern const bfd_arch_info_type bfd_m68hc11_arch; extern const bfd_arch_info_type bfd_m68hc12_arch; @@ -369,6 +382,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_d30v_arch, &bfd_dlx_arch, &bfd_fr30_arch, + &bfd_frv_arch, &bfd_h8300_arch, &bfd_h8500_arch, &bfd_hppa_arch, @@ -377,6 +391,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_i860_arch, &bfd_i960_arch, &bfd_ia64_arch, + &bfd_ip2k_arch, &bfd_m32r_arch, &bfd_m68hc11_arch, &bfd_m68hc12_arch, diff --git a/bfd/armnetbsd.c b/bfd/armnetbsd.c index e899adb..d82e98f 100644 --- a/bfd/armnetbsd.c +++ b/bfd/armnetbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for NetBSD/ARM a.out-ish binaries. - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" /* To ensure following declaration is OK */ -CONST struct reloc_howto_struct * +const struct reloc_howto_struct * MY_bfd_reloc_type_lookup PARAMS ((bfd * abfd AND bfd_reloc_code_real_type code)); diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 8c36c67..19fd107 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -4,21 +4,21 @@ Free Software Foundation, Inc. Contributed by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ @@ -803,6 +803,9 @@ extern boolean bfd_elf32_arm_process_before_allocation extern boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf32_arm_add_glue_sections_to_bfd + PARAMS ((bfd *, struct bfd_link_info *)); + /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page PARAMS ((struct sec *, int)); @@ -810,4 +813,3 @@ extern void bfd_ticoff_set_section_load_page extern int bfd_ticoff_get_section_load_page PARAMS ((struct sec *)); -/* And more from the source. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 1dd397a..1a869f6 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -10,21 +10,21 @@ Free Software Foundation, Inc. Contributed by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ @@ -809,6 +809,9 @@ extern boolean bfd_elf32_arm_process_before_allocation extern boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf32_arm_add_glue_sections_to_bfd + PARAMS ((bfd *, struct bfd_link_info *)); + /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page PARAMS ((struct sec *, int)); @@ -816,10 +819,11 @@ extern void bfd_ticoff_set_section_load_page extern int bfd_ticoff_get_section_load_page PARAMS ((struct sec *)); -/* And more from the source. */ +/* Extracted from init.c. */ void bfd_init PARAMS ((void)); +/* Extracted from opncls.c. */ bfd * bfd_openr PARAMS ((const char *filename, const char *target)); @@ -847,6 +851,7 @@ bfd_make_writable PARAMS ((bfd *abfd)); boolean bfd_make_readable PARAMS ((bfd *abfd)); +/* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -987,6 +992,7 @@ bfd_make_readable PARAMS ((bfd *abfd)); #define H_GET_S8 bfd_h_get_signed_8 +/* Extracted from section.c. */ /* This structure is used for a comdat section, as in PE. A comdat section is associated with a particular symbol. When the linker sees a comdat section, it keeps only one of the sections with a @@ -1447,6 +1453,10 @@ bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, void _bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section)); +boolean +bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group)); + +/* Extracted from archures.c. */ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ @@ -1562,6 +1572,7 @@ enum bfd_architecture #define bfd_mach_ppc_rs64ii 642 #define bfd_mach_ppc_rs64iii 643 #define bfd_mach_ppc_7400 7400 +#define bfd_mach_ppc_e500 500 bfd_arch_rs6000, /* IBM RS/6000 */ #define bfd_mach_rs6k 0 #define bfd_mach_rs6k_rs1 6001 @@ -1627,10 +1638,20 @@ enum bfd_architecture #define bfd_mach_am33 330 bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 + bfd_arch_frv, +#define bfd_mach_frv 0 +#define bfd_mach_frvsimple 1 +#define bfd_mach_fr300 300 +#define bfd_mach_fr400 400 +#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_fr500 500 bfd_arch_mcore, bfd_arch_ia64, /* HP/Intel ia64 */ #define bfd_mach_ia64_elf64 0 #define bfd_mach_ia64_elf32 1 + bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ +#define bfd_mach_ip2022 0 +#define bfd_mach_ip2022ext 1 bfd_arch_pj, bfd_arch_avr, /* Atmel AVR microcontrollers. */ #define bfd_mach_avr1 1 @@ -1720,6 +1741,7 @@ unsigned int bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch, unsigned long machine)); +/* Extracted from reloc.c. */ typedef enum bfd_reloc_status { /* No errors detected. */ @@ -2145,6 +2167,21 @@ share a common GP, and the target address is adjusted for STO_ALPHA_STD_GPLOAD. */ BFD_RELOC_ALPHA_BRSGP, +/* Alpha thread-local storage relocations. */ + BFD_RELOC_ALPHA_TLSGD, + BFD_RELOC_ALPHA_TLSLDM, + BFD_RELOC_ALPHA_DTPMOD64, + BFD_RELOC_ALPHA_GOTDTPREL16, + BFD_RELOC_ALPHA_DTPREL64, + BFD_RELOC_ALPHA_DTPREL_HI16, + BFD_RELOC_ALPHA_DTPREL_LO16, + BFD_RELOC_ALPHA_DTPREL16, + BFD_RELOC_ALPHA_GOTTPREL16, + BFD_RELOC_ALPHA_TPREL64, + BFD_RELOC_ALPHA_TPREL_HI16, + BFD_RELOC_ALPHA_TPREL_LO16, + BFD_RELOC_ALPHA_TPREL16, + /* Bits 27..2 of the relocation address shifted right 2 bits; simple reloc otherwise. */ BFD_RELOC_MIPS_JMP, @@ -2199,6 +2236,17 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MIPS_RELGOT, BFD_RELOC_MIPS_JALR, +/* Fujitsu Frv Relocations. */ + BFD_RELOC_FRV_LABEL16, + BFD_RELOC_FRV_LABEL24, + BFD_RELOC_FRV_LO16, + BFD_RELOC_FRV_HI16, + BFD_RELOC_FRV_GPREL12, + BFD_RELOC_FRV_GPRELU12, + BFD_RELOC_FRV_GPREL32, + BFD_RELOC_FRV_GPRELHI, + BFD_RELOC_FRV_GPRELLO, + /* i386/elf relocations */ BFD_RELOC_386_GOT32, @@ -2857,6 +2905,40 @@ into 22 bits. */ /* 32 bit rel. offset to GOT entry. */ BFD_RELOC_390_GOTENT, +/* Scenix IP2K - 9-bit register number / data address */ + BFD_RELOC_IP2K_FR9, + +/* Scenix IP2K - 4-bit register/data bank number */ + BFD_RELOC_IP2K_BANK, + +/* Scenix IP2K - low 13 bits of instruction word address */ + BFD_RELOC_IP2K_ADDR16CJP, + +/* Scenix IP2K - high 3 bits of instruction word address */ + BFD_RELOC_IP2K_PAGE3, + +/* Scenix IP2K - ext/low/high 8 bits of data address */ + BFD_RELOC_IP2K_LO8DATA, + BFD_RELOC_IP2K_HI8DATA, + BFD_RELOC_IP2K_EX8DATA, + +/* Scenix IP2K - low/high 8 bits of instruction word address */ + BFD_RELOC_IP2K_LO8INSN, + BFD_RELOC_IP2K_HI8INSN, + +/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */ + BFD_RELOC_IP2K_PC_SKIP, + +/* Scenix IP2K - 16 bit word address in text section. */ + BFD_RELOC_IP2K_TEXT, + +/* Scenix IP2K - 7-bit sp or dp offset */ + BFD_RELOC_IP2K_FR_OFFSET, + +/* Scenix VPE4K coprocessor - data/insn-space addressing */ + BFD_RELOC_VPE4KMATH_DATA, + BFD_RELOC_VPE4KMATH_INSN, + /* These two relocations are used by the linker to determine which of the entries in a C++ virtual function table are actually used. When the --gc-sections option is given, the linker will zero out the entries @@ -2959,17 +3041,48 @@ this offset in the reloc's section offset. */ BFD_RELOC_IA64_LTOFF_DTPREL22, /* Motorola 68HC11 reloc. -This is the 8 bits high part of an absolute address. */ +This is the 8 bit high part of an absolute address. */ BFD_RELOC_M68HC11_HI8, /* Motorola 68HC11 reloc. -This is the 8 bits low part of an absolute address. */ +This is the 8 bit low part of an absolute address. */ BFD_RELOC_M68HC11_LO8, /* Motorola 68HC11 reloc. -This is the 3 bits of a value. */ +This is the 3 bit of a value. */ BFD_RELOC_M68HC11_3B, +/* Motorola 68HC11 reloc. +This reloc marks the beginning of a jump/call instruction. +It is used for linker relaxation to correctly identify beginning +of instruction and change some branchs to use PC-relative +addressing mode. */ + BFD_RELOC_M68HC11_RL_JUMP, + +/* Motorola 68HC11 reloc. +This reloc marks a group of several instructions that gcc generates +and for which the linker relaxation pass can modify and/or remove +some of them. */ + BFD_RELOC_M68HC11_RL_GROUP, + +/* Motorola 68HC11 reloc. +This is the 16-bit lower part of an address. It is used for 'call' +instruction to specify the symbol address without any special +transformation (due to memory bank window). */ + BFD_RELOC_M68HC11_LO16, + +/* Motorola 68HC11 reloc. +This is a 8-bit reloc that specifies the page number of an address. +It is used by 'call' instruction to specify the page number of +the symbol. */ + BFD_RELOC_M68HC11_PAGE, + +/* Motorola 68HC11 reloc. +This is a 24-bit reloc that represents the address with a 16-bit +value and a 8-bit page number. The symbol address is transformed +to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ + BFD_RELOC_M68HC11_24, + /* These relocs are only used within the CRIS assembler. They are not (at present) written to any object files. */ BFD_RELOC_CRIS_BDISP8, @@ -3054,6 +3167,11 @@ This is the 3 bits of a value. */ BFD_RELOC_XSTORMY16_REL_12, BFD_RELOC_XSTORMY16_24, BFD_RELOC_XSTORMY16_FPTR16, + +/* Relocations used by VAX ELF. */ + BFD_RELOC_VAX_GLOB_DAT, + BFD_RELOC_VAX_JMP_SLOT, + BFD_RELOC_VAX_RELATIVE, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type * @@ -3062,6 +3180,7 @@ bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); const char * bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); +/* Extracted from syms.c. */ typedef struct symbol_cache_entry { @@ -3234,6 +3353,7 @@ bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymb BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ (ibfd, isymbol, obfd, osymbol)) +/* Extracted from bfd.c. */ struct _bfd { /* The filename the application opened the BFD with. */ @@ -3533,6 +3653,9 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_merge_sections(abfd, link_info) \ BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) +#define bfd_discard_group(abfd, sec) \ + BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) + #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) @@ -3572,8 +3695,9 @@ extern bfd_byte *bfd_get_relocated_section_contents boolean, asymbol **)); boolean -bfd_alt_mach_code PARAMS ((bfd *abfd, int index)); +bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative)); +/* Extracted from archive.c. */ symindex bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); @@ -3583,6 +3707,7 @@ bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); bfd * bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); +/* Extracted from corefile.c. */ const char * bfd_core_file_failing_command PARAMS ((bfd *abfd)); @@ -3592,6 +3717,7 @@ bfd_core_file_failing_signal PARAMS ((bfd *abfd)); boolean core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); +/* Extracted from targets.c. */ #define BFD_SEND(bfd, message, arglist) \ ((*((bfd)->xvec->message)) arglist) @@ -3873,7 +3999,8 @@ CONCAT2 (NAME,_bfd_link_just_syms), \ CONCAT2 (NAME,_bfd_final_link), \ CONCAT2 (NAME,_bfd_link_split_section), \ CONCAT2 (NAME,_bfd_gc_sections), \ -CONCAT2 (NAME,_bfd_merge_sections) +CONCAT2 (NAME,_bfd_merge_sections), \ +CONCAT2 (NAME,_bfd_discard_group) int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); bfd_byte *(*_bfd_get_relocated_section_contents) PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, @@ -3908,6 +4035,9 @@ CONCAT2 (NAME,_bfd_merge_sections) /* Attempt to merge SEC_MERGE sections. */ boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); + /* Discard members of a group. */ + boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ @@ -3946,6 +4076,7 @@ bfd_target_list PARAMS ((void)); const bfd_target * bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); +/* Extracted from format.c. */ boolean bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); @@ -1185,6 +1185,9 @@ DESCRIPTION .#define bfd_merge_sections(abfd, link_info) \ . BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) . +.#define bfd_discard_group(abfd, sec) \ +. BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) +. .#define bfd_link_hash_table_create(abfd) \ . BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) . @@ -1331,27 +1334,27 @@ FUNCTION bfd_alt_mach_code SYNOPSIS - boolean bfd_alt_mach_code(bfd *abfd, int index); + boolean bfd_alt_mach_code(bfd *abfd, int alternative); DESCRIPTION When more than one machine code number is available for the same machine type, this function can be used to switch between - the preferred one (index == 0) and any others. Currently, + the preferred one (alternative == 0) and any others. Currently, only ELF supports this feature, with up to two alternate machine codes. */ boolean -bfd_alt_mach_code (abfd, index) +bfd_alt_mach_code (abfd, alternative) bfd *abfd; - int index; + int alternative; { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) { int code; - switch (index) + switch (alternative) { case 0: code = get_elf_backend_data (abfd)->elf_machine_code; diff --git a/bfd/binary.c b/bfd/binary.c index 3a03901..fc972b2 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -337,6 +337,7 @@ binary_sizeof_headers (abfd, exec) #define binary_bfd_relax_section bfd_generic_relax_section #define binary_bfd_gc_sections bfd_generic_gc_sections #define binary_bfd_merge_sections bfd_generic_merge_sections +#define binary_bfd_discard_group bfd_generic_discard_group #define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define binary_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define binary_bfd_link_just_syms _bfd_generic_link_just_syms @@ -956,7 +956,7 @@ b_out_set_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { /* Set by bfd.c handler. */ if (! aout_32_make_sections (abfd)) @@ -1456,6 +1456,7 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order, #define b_out_bfd_link_split_section _bfd_generic_link_split_section #define b_out_bfd_gc_sections bfd_generic_gc_sections #define b_out_bfd_merge_sections bfd_generic_merge_sections +#define b_out_bfd_discard_group bfd_generic_discard_group #define aout_32_get_section_contents_in_window \ _bfd_generic_get_section_contents_in_window diff --git a/bfd/cache.c b/bfd/cache.c index 4e5ef2e..df01a1f9 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -1,5 +1,5 @@ /* BFD library -- caching of file descriptors. - Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). @@ -277,7 +277,7 @@ bfd_open_file (abfd) break; case both_direction: case write_direction: - if (abfd->opened_once == true) + if (abfd->opened_once) { abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_RUB); if (abfd->iostream == NULL) diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index e1e193a..7c921ca 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -1,5 +1,5 @@ /* BFD back-end for AMD 29000 COFF binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Wood at New York University 7/8/91. @@ -175,7 +175,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, insn = bfd_get_32 (abfd, hit_data); /* consth, part 2 Now relocate the reference. */ - if (part1_consth_active == false) + if (! part1_consth_active) { *error_message = (char *) _("Missing IHIHALF"); return bfd_reloc_dangerous; diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 4056e2c..6d5ac17 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -1,5 +1,5 @@ /* BFD back-end for ALPHA Extended-Coff files. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and Ian Lance Taylor <ian@cygnus.com>. @@ -795,7 +795,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, gp = _bfd_get_gp_value (abfd); if (gp == 0) { - if (relocateable != false) + if (relocateable) { asection *sec; bfd_vma lo; @@ -2356,6 +2356,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = #define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section #define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections #define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections +#define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group const bfd_target ecoffalpha_little_vec = { diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 72c58a4..dbeaef1 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 386 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -117,7 +117,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, When we link PE and non-PE object files together to generate a non-PE executable, we have to compensate it here. */ - if (howto->pc_relative == true && howto->pcrel_offset == true) + if (howto->pc_relative && howto->pcrel_offset) diff = -(1 << howto->size); else diff = -reloc_entry->addend; diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 672b07f..69fcc69 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS Extended-Coff files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -819,8 +819,7 @@ mips_gprel_reloc (abfd, output_bfd = symbol->section->output_section->owner; } - if (bfd_is_und_section (symbol->section) - && relocateable == false) + if (bfd_is_und_section (symbol->section) && ! relocateable) return bfd_reloc_undefined; /* We have to figure out the gp value, so that we can adjust the @@ -830,10 +829,10 @@ mips_gprel_reloc (abfd, external symbol if we are producing relocateable output. */ gp = _bfd_get_gp_value (output_bfd); if (gp == 0 - && (relocateable == false + && (! relocateable || (symbol->flags & BSF_SECTION_SYM) != 0)) { - if (relocateable != false) + if (relocateable) { /* Make up a value. */ gp = symbol->section->output_section->vma + 0x4000; @@ -899,14 +898,14 @@ mips_gprel_reloc (abfd, /* Adjust val for the final section location and GP value. If we are producing relocateable output, we don't want to do this for an external symbol. */ - if (relocateable == false + if (! relocateable || (symbol->flags & BSF_SECTION_SYM) != 0) val += relocation - gp; insn = (insn &~ (unsigned) 0xffff) | (val & 0xffff); bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + reloc_entry->address); - if (relocateable != false) + if (relocateable) reloc_entry->address += input_section->output_offset; /* Make sure it fit in 16 bits. */ @@ -2116,10 +2115,9 @@ mips_relax_section (abfd, sec, info, again) bfd_size_type size; size = (bfd_size_type) sec->reloc_count * sizeof (long); - offsets = (long *) bfd_alloc (abfd, size); + offsets = (long *) bfd_zalloc (abfd, size); if (offsets == (long *) NULL) goto error_return; - memset (offsets, 0, (size_t) size); section_tdata->offsets = offsets; } @@ -2602,6 +2600,8 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = /* Merging of sections is not done. */ #define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections +#define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group + extern const bfd_target ecoff_big_vec; const bfd_target ecoff_little_vec = diff --git a/bfd/coff-or32.c b/bfd/coff-or32.c index eafd9af..c82b9af 100644 --- a/bfd/coff-or32.c +++ b/bfd/coff-or32.c @@ -187,7 +187,7 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, /* consth, part 2 Now relocate the reference. */ - if (part1_consth_active == false) + if (! part1_consth_active) { *error_message = (char *) "Missing IHIHALF"; return bfd_reloc_dangerous; diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index f560c7f..ebed743 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -83,7 +83,7 @@ void xcoff_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup #ifdef AIX_CORE extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); -extern boolean rs6000coff_core_file_matches_executable_p +extern boolean rs6000coff_core_file_matches_executable_p PARAMS ((bfd *cbfd, bfd *ebfd)); extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); @@ -148,16 +148,16 @@ static bfd_vma xcoff_loader_symbol_offset PARAMS ((bfd *, struct internal_ldhdr *)); static bfd_vma xcoff_loader_reloc_offset PARAMS ((bfd *, struct internal_ldhdr *)); -static boolean xcoff_generate_rtinit - PARAMS((bfd *, const char *, const char *, boolean)); -static boolean do_pad PARAMS((bfd *, unsigned int)); -static boolean do_copy PARAMS((bfd *, bfd *)); +static boolean xcoff_generate_rtinit + PARAMS ((bfd *, const char *, const char *, boolean)); +static boolean do_pad PARAMS ((bfd *, unsigned int)); +static boolean do_copy PARAMS ((bfd *, bfd *)); static boolean do_shared_object_padding PARAMS ((bfd *, bfd *, ufile_ptr *, int)); /* Relocation functions */ static boolean xcoff_reloc_type_br PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); -static boolean xcoff_complain_overflow_dont_func +static boolean xcoff_complain_overflow_dont_func PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); static boolean xcoff_complain_overflow_bitfield_func PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); @@ -167,40 +167,40 @@ static boolean xcoff_complain_overflow_unsigned_func PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); boolean (*xcoff_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) - (XCOFF_RELOC_FUNCTION_ARGS) = + PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)) = { - xcoff_reloc_type_pos, /* R_POS (0x00) */ - xcoff_reloc_type_neg, /* R_NEG (0x01) */ - xcoff_reloc_type_rel, /* R_REL (0x02) */ - xcoff_reloc_type_toc, /* R_TOC (0x03) */ + xcoff_reloc_type_pos, /* R_POS (0x00) */ + xcoff_reloc_type_neg, /* R_NEG (0x01) */ + xcoff_reloc_type_rel, /* R_REL (0x02) */ + xcoff_reloc_type_toc, /* R_TOC (0x03) */ xcoff_reloc_type_fail, /* R_RTB (0x04) */ - xcoff_reloc_type_toc, /* R_GL (0x05) */ - xcoff_reloc_type_toc, /* R_TCL (0x06) */ - xcoff_reloc_type_fail, /* (0x07) */ - xcoff_reloc_type_ba, /* R_BA (0x08) */ - xcoff_reloc_type_fail, /* (0x09) */ - xcoff_reloc_type_br, /* R_BR (0x0a) */ - xcoff_reloc_type_fail, /* (0x0b) */ - xcoff_reloc_type_pos, /* R_RL (0x0c) */ - xcoff_reloc_type_pos, /* R_RLA (0x0d) */ - xcoff_reloc_type_fail, /* (0x0e) */ + xcoff_reloc_type_toc, /* R_GL (0x05) */ + xcoff_reloc_type_toc, /* R_TCL (0x06) */ + xcoff_reloc_type_fail, /* (0x07) */ + xcoff_reloc_type_ba, /* R_BA (0x08) */ + xcoff_reloc_type_fail, /* (0x09) */ + xcoff_reloc_type_br, /* R_BR (0x0a) */ + xcoff_reloc_type_fail, /* (0x0b) */ + xcoff_reloc_type_pos, /* R_RL (0x0c) */ + xcoff_reloc_type_pos, /* R_RLA (0x0d) */ + xcoff_reloc_type_fail, /* (0x0e) */ xcoff_reloc_type_noop, /* R_REF (0x0f) */ - xcoff_reloc_type_fail, /* (0x10) */ - xcoff_reloc_type_fail, /* (0x11) */ - xcoff_reloc_type_toc, /* R_TRL (0x12) */ - xcoff_reloc_type_toc, /* R_TRLA (0x13) */ + xcoff_reloc_type_fail, /* (0x10) */ + xcoff_reloc_type_fail, /* (0x11) */ + xcoff_reloc_type_toc, /* R_TRL (0x12) */ + xcoff_reloc_type_toc, /* R_TRLA (0x13) */ xcoff_reloc_type_fail, /* R_RRTBI (0x14) */ xcoff_reloc_type_fail, /* R_RRTBA (0x15) */ - xcoff_reloc_type_ba, /* R_CAI (0x16) */ + xcoff_reloc_type_ba, /* R_CAI (0x16) */ xcoff_reloc_type_crel, /* R_CREL (0x17) */ - xcoff_reloc_type_ba, /* R_RBA (0x18) */ - xcoff_reloc_type_ba, /* R_RBAC (0x19) */ - xcoff_reloc_type_br, /* R_RBR (0x1a) */ - xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ + xcoff_reloc_type_ba, /* R_RBA (0x18) */ + xcoff_reloc_type_ba, /* R_RBAC (0x19) */ + xcoff_reloc_type_br, /* R_RBR (0x1a) */ + xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ }; boolean (*xcoff_complain_overflow[XCOFF_MAX_COMPLAIN_OVERFLOW]) - (XCOFF_COMPLAIN_FUNCTION_ARGS) = + PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)) = { xcoff_complain_overflow_dont_func, xcoff_complain_overflow_bitfield_func, @@ -237,7 +237,7 @@ _bfd_xcoff_mkobject (abfd) xcoff_data (abfd)->debug_indices = NULL; /* text section alignment is different than the default */ - /* xcoff_data (abfd)->text_align_power = 5; */ + bfd_xcoff_text_align_power (abfd) = 2; return true; } @@ -278,8 +278,8 @@ _bfd_xcoff_copy_private_bfd_data (ibfd, obfd) else ox->snentry = sec->output_section->target_index; } - ox->text_align_power = ix->text_align_power; - ox->data_align_power = ix->data_align_power; + bfd_xcoff_text_align_power (obfd) = bfd_xcoff_text_align_power (ibfd); + bfd_xcoff_data_align_power (obfd) = bfd_xcoff_data_align_power (ibfd); ox->modtype = ix->modtype; ox->cputype = ix->cputype; ox->maxdata = ix->maxdata; @@ -302,7 +302,7 @@ _bfd_xcoff_is_local_label_name (abfd, name) void _bfd_xcoff_swap_sym_in (abfd, ext1, in1) - bfd *abfd; + bfd *abfd; PTR ext1; PTR in1; { @@ -311,7 +311,7 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1) if (ext->e.e_name[0] != 0) { - memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); + memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); } else { @@ -328,16 +328,16 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1) unsigned int _bfd_xcoff_swap_sym_out (abfd, inp, extp) - bfd *abfd; - PTR inp; - PTR extp; + bfd *abfd; + PTR inp; + PTR extp; { struct internal_syment *in = (struct internal_syment *)inp; SYMENT *ext =(SYMENT *)extp; if (in->_n._n_name[0] != 0) { - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); } else { @@ -355,13 +355,13 @@ _bfd_xcoff_swap_sym_out (abfd, inp, extp) void _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) - bfd *abfd; - PTR ext1; - int type; - int class; - int indx; - int numaux; - PTR in1; + bfd *abfd; + PTR ext1; + int type; + int class; + int indx; + int numaux; + PTR in1; { AUXENT * ext = (AUXENT *)ext1; union internal_auxent *in = (union internal_auxent *)in1; @@ -418,7 +418,7 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) in->x_scn.x_nreloc = H_GET_16 (abfd, ext->x_scn.x_nreloc); in->x_scn.x_nlinno = H_GET_16 (abfd, ext->x_scn.x_nlinno); /* PE defines some extra fields; we zero them out for - safety. */ + safety. */ in->x_scn.x_checksum = 0; in->x_scn.x_associated = 0; in->x_scn.x_comdat = 0; @@ -483,7 +483,7 @@ _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) union internal_auxent *in = (union internal_auxent *)inp; AUXENT *ext = (AUXENT *)extp; - memset((PTR)ext, 0, bfd_coff_auxesz (abfd)); + memset ((PTR)ext, 0, bfd_coff_auxesz (abfd)); switch (class) { case C_FILE: @@ -578,375 +578,390 @@ end: reloc_howto_type xcoff_howto_table[] = { /* Standard 32 bit relocation. */ - HOWTO (R_POS, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_POS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_POS", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* 32 bit relocation, but store negative value. */ - HOWTO (R_NEG, /* type */ - 0, /* rightshift */ - -2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_NEG, /* type */ + 0, /* rightshift */ + -2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_NEG", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_NEG", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* 32 bit PC relative relocation. */ - HOWTO (R_REL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_REL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_REL", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_REL", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* 16 bit TOC relative relocation. */ - HOWTO (R_TOC, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_TOC, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_TOC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_TOC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ /* I don't really know what this is. */ - HOWTO (R_RTB, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RTB, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RTB", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RTB", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* External TOC relative symbol. */ - HOWTO (R_GL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_GL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_GL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Local TOC relative symbol. */ - HOWTO (R_TCL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 0, /* special_function */ + "R_GL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Local TOC relative symbol. */ + HOWTO (R_TCL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_TCL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_TCL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ EMPTY_HOWTO (7), /* Non modifiable absolute branch. */ - HOWTO (R_BA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_BA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_BA_26", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_BA_26", /* name */ + true, /* partial_inplace */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ + false), /* pcrel_offset */ EMPTY_HOWTO (9), /* Non modifiable relative branch. */ - HOWTO (R_BR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_BR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_BR", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_BR", /* name */ + true, /* partial_inplace */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ + false), /* pcrel_offset */ EMPTY_HOWTO (0xb), /* Indirect load. */ - HOWTO (R_RL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ /* Load address. */ - HOWTO (R_RLA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RLA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RLA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ EMPTY_HOWTO (0xe), /* Non-relocating reference. */ - HOWTO (R_REF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_REF", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ + HOWTO (R_REF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + 0, /* special_function */ + "R_REF", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ EMPTY_HOWTO (0x10), EMPTY_HOWTO (0x11), /* TOC relative indirect load. */ - HOWTO (R_TRL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_TRL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_TRL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_TRL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ /* TOC relative load address. */ - HOWTO (R_TRLA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_TRLA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_TRLA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_TRLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable relative branch. */ - HOWTO (R_RRTBI, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RRTBI, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RRTBI", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RRTBI", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable absolute branch. */ - HOWTO (R_RRTBA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RRTBA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RRTBA", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RRTBA", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable call absolute indirect. */ - HOWTO (R_CAI, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_CAI, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_CAI", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_CAI", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable call relative. */ - HOWTO (R_CREL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_CREL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_CREL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_CREL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable branch absolute. */ - HOWTO (R_RBA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBA", /* name */ + true, /* partial_inplace */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable branch absolute. */ - HOWTO (R_RBAC, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBAC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBAC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBAC", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable branch relative. */ - HOWTO (R_RBR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBR_26", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBR_26", /* name */ + true, /* partial_inplace */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable branch absolute. */ - HOWTO (R_RBRC, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBRC, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBRC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBRC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ /* 16 bit Non modifiable absolute branch. */ - HOWTO (R_BA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_BA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_BA_16", /* name */ - true, /* partial_inplace */ - 0xfffc, /* src_mask */ - 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_BA_16", /* name */ + true, /* partial_inplace */ + 0xfffc, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ /* Modifiable branch relative. */ - HOWTO (R_RBR, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBR, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBR_16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBR_16", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable branch relative. */ + HOWTO (R_RBA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "R_RBA_16", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ }; @@ -960,16 +975,18 @@ xcoff_rtype2howto (relent, internal) /* Default howto layout works most of the time */ relent->howto = &xcoff_howto_table[internal->r_type]; - + /* Special case some 16 bit reoloc */ if (15 == (internal->r_size & 0x1f)) { - if (R_BA == internal->r_type) + if (R_BA == internal->r_type) relent->howto = &xcoff_howto_table[0x1c]; - else if (R_RBR == internal->r_type) + else if (R_RBR == internal->r_type) relent->howto = &xcoff_howto_table[0x1d]; + else if (R_RBA == internal->r_type) + relent->howto = &xcoff_howto_table[0x1e]; } - + /* The r_size field of an XCOFF reloc encodes the bitsize of the relocation, as well as indicating whether it is signed or not. Doublecheck that the relocation information gathered from the @@ -979,10 +996,6 @@ xcoff_rtype2howto (relent, internal) && (relent->howto->bitsize != ((unsigned int) internal->r_size & 0x1f) + 1)) abort (); - - /* Put a meaningful value in addend */ - relent->addend = (internal->r_size & 0x80) ? - internal->r_vaddr - : internal->r_vaddr; } reloc_howto_type * @@ -1226,10 +1239,11 @@ const bfd_target * _bfd_xcoff_archive_p (abfd) bfd *abfd; { + struct artdata *tdata_hold; char magic[SXCOFFARMAG]; - bfd_size_type amt; + bfd_size_type amt = SXCOFFARMAG; - if (bfd_bread ((PTR) magic, (bfd_size_type) SXCOFFARMAG, abfd) != SXCOFFARMAG) + if (bfd_bread ((PTR) magic, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -1243,13 +1257,12 @@ _bfd_xcoff_archive_p (abfd) return NULL; } - /* We are setting bfd_ardata(abfd) here, but since bfd_ardata - involves a cast, we can't do it as the left operand of - assignment. */ + tdata_hold = bfd_ardata (abfd); + amt = sizeof (struct artdata); - abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); + bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == (struct artdata *) NULL) - return NULL; + goto error_ret_restore; bfd_ardata (abfd)->cache = NULL; bfd_ardata (abfd)->archive_head = NULL; @@ -1266,13 +1279,12 @@ _bfd_xcoff_archive_p (abfd) memcpy (hdr.magic, magic, SXCOFFARMAG); /* Now read the rest of the file header. */ - if (bfd_bread ((PTR) &hdr.memoff, - (bfd_size_type) SIZEOF_AR_FILE_HDR - SXCOFFARMAG, abfd) - != SIZEOF_AR_FILE_HDR - SXCOFFARMAG) + amt = SIZEOF_AR_FILE_HDR - SXCOFFARMAG; + if (bfd_bread ((PTR) &hdr.memoff, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return NULL; + goto error_ret; } bfd_ardata (abfd)->first_file_filepos = strtol (hdr.firstmemoff, @@ -1281,7 +1293,7 @@ _bfd_xcoff_archive_p (abfd) amt = SIZEOF_AR_FILE_HDR; bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd)->tdata == NULL) - return NULL; + goto error_ret; memcpy (bfd_ardata (abfd)->tdata, &hdr, SIZEOF_AR_FILE_HDR); } @@ -1294,33 +1306,32 @@ _bfd_xcoff_archive_p (abfd) memcpy (hdr.magic, magic, SXCOFFARMAG); /* Now read the rest of the file header. */ - if (bfd_bread ((PTR) &hdr.memoff, - (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG, abfd) - != SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG) + amt = SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG; + if (bfd_bread ((PTR) &hdr.memoff, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return NULL; + goto error_ret; } - /* XXX This actually has to be a call to strtoll (at least on 32-bit - machines) since the field width is 20 and there numbers with more - than 32 bits can be represented. */ - bfd_ardata (abfd)->first_file_filepos = strtol (hdr.firstmemoff, - (char **) NULL, 10); + bfd_ardata (abfd)->first_file_filepos = bfd_scan_vma (hdr.firstmemoff, + (const char **) 0, + 10); amt = SIZEOF_AR_FILE_HDR_BIG; bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd)->tdata == NULL) - return NULL; + goto error_ret; memcpy (bfd_ardata (abfd)->tdata, &hdr, SIZEOF_AR_FILE_HDR_BIG); } if (! _bfd_xcoff_slurp_armap (abfd)) { + error_ret: bfd_release (abfd, bfd_ardata (abfd)); - abfd->tdata.aout_ar_data = (struct artdata *) NULL; + error_ret_restore: + bfd_ardata (abfd) = tdata_hold; return NULL; } @@ -1633,7 +1644,7 @@ static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define PRINT12(d, v) \ sprintf (buff20, FMT12, (int)(v)), \ - memcpy ((void *) (d), buff20, 12) + memcpy ((void *) (d), buff20, 12) #define PRINT12_OCTAL(d, v) \ sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ @@ -1641,7 +1652,7 @@ static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define PRINT4(d, v) \ sprintf (buff20, FMT4, (int)(v)), \ - memcpy ((void *) (d), buff20, 4) + memcpy ((void *) (d), buff20, 4) #define READ20(d, v) \ buff20[20] = 0, \ @@ -1690,7 +1701,7 @@ do_copy (out_bfd, in_bfd) if (remaining) { - if (bfd_bread (buffer, remaining, in_bfd) != remaining + if (bfd_bread (buffer, remaining, in_bfd) != remaining || bfd_bwrite (buffer, remaining, out_bfd) != remaining) return false; } @@ -1698,7 +1709,7 @@ do_copy (out_bfd, in_bfd) return true; } -static boolean +static boolean do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size) bfd *out_bfd; bfd *in_bfd; @@ -1713,7 +1724,6 @@ do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size) int text_align_power; text_align_power = bfd_xcoff_text_align_power (in_bfd); - BFD_ASSERT (2 < text_align_power); pad = 1 << text_align_power; pad -= (*offset + ar_header_size) & (pad - 1); @@ -1741,7 +1751,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd *current_bfd; size_t string_length; ufile_ptr nextoff, prevoff; - + /* First, we look through the symbols and work out which are from 32-bit objects and which from 64-bit ones. */ sym_32 = sym_64 = str_32 = str_64 = 0; @@ -1786,51 +1796,50 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) BFD_ASSERT (nextoff == bfd_tell (abfd)); - /* Write out the symbol table. - Layout : - + /* Write out the symbol table. + Layout : + standard big archive header - 0x0000 ar_size [0x14] - 0x0014 ar_nxtmem [0x14] - 0x0028 ar_prvmem [0x14] - 0x003C ar_date [0x0C] - 0x0048 ar_uid [0x0C] - 0x0054 ar_gid [0x0C] - 0x0060 ar_mod [0x0C] - 0x006C ar_namelen[0x04] - 0x0070 ar_fmag [SXCOFFARFMAG] - - Symbol table - 0x0072 num_syms [0x08], binary - 0x0078 offsets [0x08 * num_syms], binary - 0x0086 + 0x08 * num_syms names [??] - ?? pad to even bytes. + 0x0000 ar_size [0x14] + 0x0014 ar_nxtmem [0x14] + 0x0028 ar_prvmem [0x14] + 0x003C ar_date [0x0C] + 0x0048 ar_uid [0x0C] + 0x0054 ar_gid [0x0C] + 0x0060 ar_mod [0x0C] + 0x006C ar_namelen[0x04] + 0x0070 ar_fmag [SXCOFFARFMAG] + + Symbol table + 0x0072 num_syms [0x08], binary + 0x0078 offsets [0x08 * num_syms], binary + 0x0086 + 0x08 * num_syms names [??] + ?? pad to even bytes. */ - if (sym_32) + if (sym_32) { struct xcoff_ar_hdr_big *hdr; bfd_byte *symbol_table; bfd_byte *st; file_ptr fileoff; - bfd_vma symbol_table_size = + bfd_vma symbol_table_size = SIZEOF_AR_HDR_BIG + SXCOFFARFMAG - + 8 - + 8 * sym_32 + + 8 + + 8 * sym_32 + str_32 + (str_32 & 1); symbol_table = NULL; - symbol_table = (bfd_byte *) bfd_malloc (symbol_table_size); + symbol_table = (bfd_byte *) bfd_zmalloc (symbol_table_size); if (symbol_table == NULL) return false; - memset (symbol_table, 0, symbol_table_size); hdr = (struct xcoff_ar_hdr_big *) symbol_table; - + PRINT20 (hdr->size, 8 + 8 * sym_32 + str_32 + (str_32 & 1)); - + if (sym_64) PRINT20 (hdr->nextoff, nextoff + symbol_table_size); else @@ -1849,7 +1858,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd_h_put_64 (abfd, sym_32, st); st += 8; - + /* loop over the 32 bit offsets */ current_bfd = abfd->archive_head; if (current_bfd != NULL) @@ -1908,28 +1917,27 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) prevoff = nextoff; nextoff = nextoff + symbol_table_size; } - else + else PRINT20 (fhdr->symoff, 0); - - if (sym_64) + + if (sym_64) { struct xcoff_ar_hdr_big *hdr; bfd_byte *symbol_table; bfd_byte *st; file_ptr fileoff; - bfd_vma symbol_table_size = + bfd_vma symbol_table_size = SIZEOF_AR_HDR_BIG + SXCOFFARFMAG - + 8 - + 8 * sym_64 + + 8 + + 8 * sym_64 + str_64 + (str_64 & 1); symbol_table = NULL; - symbol_table = (bfd_byte *) bfd_malloc (symbol_table_size); + symbol_table = (bfd_byte *) bfd_zmalloc (symbol_table_size); if (symbol_table == NULL) return false; - memset (symbol_table, 0, symbol_table_size); hdr = (struct xcoff_ar_hdr_big *) symbol_table; @@ -1948,7 +1956,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd_h_put_64 (abfd, sym_64, st); st += 8; - + /* loop over the 64 bit offsets */ current_bfd = abfd->archive_head; if (current_bfd != NULL) @@ -2006,9 +2014,9 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) PRINT20 (fhdr->symoff64, nextoff); } - else + else PRINT20 (fhdr->symoff64, 0); - + return true; } @@ -2124,7 +2132,7 @@ xcoff_write_archive_contents_old (abfd) sprintf (ahdrp->namlen, "%ld", (long) namlen); /* If the length of the name is odd, we write out the null byte - after the name as well. */ + after the name as well. */ namlen = (namlen + 1) &~ (bfd_size_type) 1; remaining = arelt_size (sub); @@ -2159,7 +2167,7 @@ xcoff_write_archive_contents_old (abfd) if (! do_copy (abfd, sub)) return false; - + if (! do_pad (abfd, size & 1)) return false; } @@ -2172,9 +2180,9 @@ xcoff_write_archive_contents_old (abfd) sprintf (fhdr.memoff, "%ld", (long) nextoff); memset (&ahdr, 0, sizeof ahdr); - sprintf (ahdr.size, "%ld", (long) (XCOFFARMAG_ELEMENT_SIZE + - count * XCOFFARMAG_ELEMENT_SIZE + - total_namlen)); + sprintf (ahdr.size, "%ld", (long) (XCOFFARMAG_ELEMENT_SIZE + + count * XCOFFARMAG_ELEMENT_SIZE + + total_namlen)); sprintf (ahdr.prevoff, "%ld", (long) prevoff); sprintf (ahdr.date, "%d", 0); sprintf (ahdr.uid, "%d", 0); @@ -2214,7 +2222,7 @@ xcoff_write_archive_contents_old (abfd) for (i = 0; i < (size_t) count; i++) { sprintf (decbuf, "%-12ld", (long) offsets[i]); - if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, + if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, abfd) != XCOFFARMAG_ELEMENT_SIZE) return false; } @@ -2282,12 +2290,12 @@ xcoff_write_archive_contents_big (abfd) if (bfd_seek (abfd, (file_ptr) SIZEOF_AR_FILE_HDR_BIG, SEEK_SET) != 0) return false; - + /* Calculate count and total_namlen. */ makemap = bfd_has_map (abfd); hasobjects = false; - for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0; - current_bfd != NULL; + for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0; + current_bfd != NULL; current_bfd = current_bfd->next, count++) { total_namlen += strlen (normalize_filename (current_bfd)) + 1; @@ -2308,8 +2316,8 @@ xcoff_write_archive_contents_big (abfd) prevoff = 0; nextoff = SIZEOF_AR_FILE_HDR_BIG; - for (current_bfd = abfd->archive_head, i = 0; - current_bfd != NULL; + for (current_bfd = abfd->archive_head, i = 0; + current_bfd != NULL; current_bfd = current_bfd->next, i++) { const char *name; @@ -2331,7 +2339,7 @@ xcoff_write_archive_contents_big (abfd) ahdrp = &ahdr; /* XXX This should actually be a call to stat64 (at least on - 32-bit machines). + 32-bit machines). XXX This call will fail if the original object is not found. */ if (stat (bfd_get_filename (current_bfd), &s) != 0) { @@ -2360,7 +2368,7 @@ xcoff_write_archive_contents_big (abfd) PRINT4 (ahdrp->namlen, namlen); /* If the length of the name is odd, we write out the null byte - after the name as well. */ + after the name as well. */ namlen = (namlen + 1) &~ (bfd_size_type) 1; remaining = arelt_size (current_bfd); @@ -2375,7 +2383,7 @@ xcoff_write_archive_contents_big (abfd) Their text section needs to be aligned wrt the archive file position. This requires extra padding before the archive header. */ if (! do_shared_object_padding (abfd, current_bfd, & nextoff, - SIZEOF_AR_HDR_BIG + namlen + SIZEOF_AR_HDR_BIG + namlen + SXCOFFARFMAG)) return false; @@ -2389,7 +2397,7 @@ xcoff_write_archive_contents_big (abfd) if ((bfd_bwrite ((PTR) ahdrp, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG) || bfd_bwrite ((PTR) name, (bfd_size_type) namlen, abfd) != namlen - || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, + || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) != SXCOFFARFMAG)) return false; @@ -2397,8 +2405,8 @@ xcoff_write_archive_contents_big (abfd) return false; if (! do_copy (abfd, current_bfd)) - return false; - + return false; + if (! do_pad (abfd, size & 1)) return false; } @@ -2409,25 +2417,25 @@ xcoff_write_archive_contents_big (abfd) PRINT20 (fhdr.lastmemoff, prevoff); } - /* Write out the member table. - Layout : + /* Write out the member table. + Layout : standard big archive header - 0x0000 ar_size [0x14] - 0x0014 ar_nxtmem [0x14] - 0x0028 ar_prvmem [0x14] - 0x003C ar_date [0x0C] - 0x0048 ar_uid [0x0C] - 0x0054 ar_gid [0x0C] - 0x0060 ar_mod [0x0C] - 0x006C ar_namelen[0x04] - 0x0070 ar_fmag [0x02] - - Member table - 0x0072 count [0x14] - 0x0086 offsets [0x14 * counts] - 0x0086 + 0x14 * counts names [??] - ?? pad to even bytes. + 0x0000 ar_size [0x14] + 0x0014 ar_nxtmem [0x14] + 0x0028 ar_prvmem [0x14] + 0x003C ar_date [0x0C] + 0x0048 ar_uid [0x0C] + 0x0054 ar_gid [0x0C] + 0x0060 ar_mod [0x0C] + 0x006C ar_namelen[0x04] + 0x0070 ar_fmag [0x02] + + Member table + 0x0072 count [0x14] + 0x0086 offsets [0x14 * counts] + 0x0086 + 0x14 * counts names [??] + ?? pad to even bytes. */ BFD_ASSERT (nextoff == bfd_tell (abfd)); @@ -2440,17 +2448,16 @@ xcoff_write_archive_contents_big (abfd) member_table_size += member_table_size & 1; member_table = NULL; - member_table = (bfd_byte *) bfd_malloc (member_table_size); + member_table = (bfd_byte *) bfd_zmalloc (member_table_size); if (member_table == NULL) return false; - memset (member_table, 0, member_table_size); hdr = (struct xcoff_ar_hdr_big *) member_table; - PRINT20 (hdr->size, (XCOFFARMAGBIG_ELEMENT_SIZE + - count * XCOFFARMAGBIG_ELEMENT_SIZE + - total_namlen + (total_namlen & 1))); - if (makemap && hasobjects) + PRINT20 (hdr->size, (XCOFFARMAGBIG_ELEMENT_SIZE + + count * XCOFFARMAGBIG_ELEMENT_SIZE + + total_namlen + (total_namlen & 1))); + if (makemap && hasobjects) PRINT20 (hdr->nextoff, nextoff + member_table_size); else PRINT20 (hdr->nextoff, 0); @@ -2460,7 +2467,7 @@ xcoff_write_archive_contents_big (abfd) PRINT12 (hdr->gid, 0); PRINT12 (hdr->mode, 0); PRINT4 (hdr->namlen, 0); - + mt = member_table + SIZEOF_AR_HDR_BIG; memcpy (mt, XCOFFARFMAG, SXCOFFARFMAG); mt += SXCOFFARFMAG; @@ -2473,23 +2480,23 @@ xcoff_write_archive_contents_big (abfd) mt += XCOFFARMAGBIG_ELEMENT_SIZE; } - if (count) + if (count) { free (offsets); offsets = NULL; } - for (current_bfd = abfd->archive_head; current_bfd != NULL; + for (current_bfd = abfd->archive_head; current_bfd != NULL; current_bfd = current_bfd->next) { const char *name; size_t namlen; name = normalize_filename (current_bfd); - namlen = sprintf(mt, "%s", name); + namlen = sprintf (mt, "%s", name); mt += namlen + 1; } - + if (bfd_bwrite (member_table, member_table_size, abfd) != member_table_size) return false; @@ -2503,7 +2510,7 @@ xcoff_write_archive_contents_big (abfd) /* Write out the armap, if appropriate. */ - if (! makemap || ! hasobjects) + if (! makemap || ! hasobjects) PRINT20 (fhdr.symoff, 0); else { @@ -2511,7 +2518,7 @@ xcoff_write_archive_contents_big (abfd) /* Save nextoff in fhdr.symoff so the armap routine can use it. */ PRINT20 (fhdr.symoff, nextoff); - + bfd_ardata (abfd)->tdata = (PTR) &fhdr; if (! _bfd_compute_and_write_armap (abfd, 0)) return false; @@ -2520,10 +2527,10 @@ xcoff_write_archive_contents_big (abfd) /* Write out the archive file header. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG, + || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG, abfd) != SIZEOF_AR_FILE_HDR_BIG)) return false; - + return true; } @@ -2718,8 +2725,8 @@ xcoff_swap_ldrel_out (abfd, src, d) } -boolean -xcoff_reloc_type_noop (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_noop (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2735,8 +2742,8 @@ xcoff_reloc_type_noop (input_bfd, input_section, output_bfd, rel, sym, howto, return true; } -boolean -xcoff_reloc_type_fail (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_fail (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section ATTRIBUTE_UNUSED; @@ -2756,8 +2763,8 @@ xcoff_reloc_type_fail (input_bfd, input_section, output_bfd, rel, sym, howto, return false; } -boolean -xcoff_reloc_type_pos (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_pos (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2774,8 +2781,8 @@ xcoff_reloc_type_pos (input_bfd, input_section, output_bfd, rel, sym, howto, return true; } -boolean -xcoff_reloc_type_neg (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_neg (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2792,8 +2799,8 @@ xcoff_reloc_type_neg (input_bfd, input_section, output_bfd, rel, sym, howto, return true; } -boolean -xcoff_reloc_type_rel (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_rel (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section; @@ -2812,13 +2819,13 @@ xcoff_reloc_type_rel (input_bfd, input_section, output_bfd, rel, sym, howto, addend += input_section->vma; *relocation = val + addend; - *relocation -= (input_section->output_section->vma + - input_section->output_offset); + *relocation -= (input_section->output_section->vma + + input_section->output_offset); return true; } -boolean -xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section ATTRIBUTE_UNUSED; @@ -2833,7 +2840,7 @@ xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, { struct xcoff_link_hash_entry *h; - if (0 > rel->r_symndx) + if (0 > rel->r_symndx) return false; h = obj_xcoff_sym_hashes (input_bfd)[rel->r_symndx]; @@ -2849,19 +2856,19 @@ xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, bfd_set_error (bfd_error_bad_value); return false; } - + BFD_ASSERT ((h->flags & XCOFF_SET_TOC) == 0); val = (h->toc_section->output_section->vma + h->toc_section->output_offset); } - - *relocation = ((val - xcoff_data (output_bfd)->toc) - - (sym->n_value - xcoff_data (input_bfd)->toc)); + + *relocation = ((val - xcoff_data (output_bfd)->toc) + - (sym->n_value - xcoff_data (input_bfd)->toc)); return true; } -boolean -xcoff_reloc_type_ba (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_ba (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2882,8 +2889,8 @@ xcoff_reloc_type_ba (input_bfd, input_section, output_bfd, rel, sym, howto, return true; } -static boolean -xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, +static boolean +xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section; @@ -2898,7 +2905,7 @@ xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, { struct xcoff_link_hash_entry *h; - if (0 > rel->r_symndx) + if (0 > rel->r_symndx) return false; h = obj_xcoff_sym_hashes (input_bfd)[rel->r_symndx]; @@ -2910,59 +2917,60 @@ xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, call is followed by a lwz r2,20(r1), but the call is not going to global linkage code, we can replace the load with a cror. */ - if (NULL != h - && bfd_link_hash_defined == h->root.type - && (rel->r_vaddr - input_section->vma + 8 <= - input_section->_cooked_size)) + if (NULL != h + && bfd_link_hash_defined == h->root.type + && (rel->r_vaddr - input_section->vma + 8 + <= input_section->_cooked_size)) { bfd_byte *pnext; unsigned long next; - + pnext = contents + (rel->r_vaddr - input_section->vma) + 4; next = bfd_get_32 (input_bfd, pnext); - + /* The _ptrgl function is magic. It is used by the AIX compiler to call a function through a pointer. */ if (h->smclas == XMC_GL || strcmp (h->root.root.string, "._ptrgl") == 0) { - if (next == 0x4def7b82 /* cror 15,15,15 */ - || next == 0x4ffffb82 /* cror 31,31,31 */ - || next == 0x60000000) /* ori r0,r0,0 */ - bfd_put_32 (input_bfd, 0x80410014, pnext); /* lwz r1,20(r1) */ - - } else - { - if (next == 0x80410014) /* lwz r1,20(r1) */ - bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ - } - } - else if (NULL != h && bfd_link_hash_undefined == h->root.type) + if (next == 0x4def7b82 /* cror 15,15,15 */ + || next == 0x4ffffb82 /* cror 31,31,31 */ + || next == 0x60000000) /* ori r0,r0,0 */ + bfd_put_32 (input_bfd, 0x80410014, pnext); /* lwz r1,20(r1) */ + + } + else + { + if (next == 0x80410014) /* lwz r1,20(r1) */ + bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ + } + } + else if (NULL != h && bfd_link_hash_undefined == h->root.type) { /* Normally, this relocation is against a defined symbol. In the case where this is a partial link and the output section offset - is greater than 2^25, the linker will return an invalid error + is greater than 2^25, the linker will return an invalid error message that the relocation has been truncated. Yes it has been - truncated but no it not important. For this case, disable the + truncated but no it not important. For this case, disable the overflow checking. */ - + howto->complain_on_overflow = complain_overflow_dont; } - + howto->pc_relative = true; howto->src_mask &= ~3; howto->dst_mask = howto->src_mask; /* A PC relative reloc includes the section address. */ addend += input_section->vma; - + *relocation = val + addend; - *relocation -= (input_section->output_section->vma + - input_section->output_offset); + *relocation -= (input_section->output_section->vma + + input_section->output_offset); return true; } -boolean -xcoff_reloc_type_crel (input_bfd, input_section, output_bfd, rel, sym, howto, +boolean +xcoff_reloc_type_crel (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section; @@ -2983,13 +2991,13 @@ xcoff_reloc_type_crel (input_bfd, input_section, output_bfd, rel, sym, howto, addend += input_section->vma; *relocation = val + addend; - *relocation -= (input_section->output_section->vma + - input_section->output_offset); + *relocation -= (input_section->output_section->vma + + input_section->output_offset); return true; } -static boolean -xcoff_complain_overflow_dont_func (input_bfd, val, relocation, howto) +static boolean +xcoff_complain_overflow_dont_func (input_bfd, val, relocation, howto) bfd *input_bfd ATTRIBUTE_UNUSED; bfd_vma val ATTRIBUTE_UNUSED; bfd_vma relocation ATTRIBUTE_UNUSED; @@ -2998,16 +3006,16 @@ xcoff_complain_overflow_dont_func (input_bfd, val, relocation, howto) return false; } -static boolean -xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) +static boolean +xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) bfd *input_bfd; bfd_vma val; bfd_vma relocation; - struct reloc_howto_struct *howto; + struct reloc_howto_struct *howto; { bfd_vma addrmask, fieldmask, signmask, ss; bfd_vma a, b, sum; - + /* Get the values to be added together. For signed and unsigned relocations, we assume that all values should be truncated to the size of an address. For bitfields, all the bits matter. @@ -3023,7 +3031,7 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) operand. */ a >>= howto->rightshift; b >>= howto->bitpos; - + /* Bitfields are sometimes used for signed numbers; for example, a 13-bit field sometimes represents values in 0..8191 and sometimes represents values in -4096..4095. @@ -3035,7 +3043,7 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) assumed that it was fully sign extended, and we will keep that assumption. */ signmask = (fieldmask >> 1) + 1; - + if ((a & ~ fieldmask) != 0) { /* Some bits out of the field are set. This might not @@ -3049,9 +3057,9 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) return true; a &= fieldmask; } - + /* We just assume (b & ~ fieldmask) == 0. */ - + /* We explicitly permit wrap around if this relocation covers the high bit of an address. The Linux kernel relies on it, and it is the only way to write assembler @@ -3060,7 +3068,7 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) if (howto->bitsize + howto->rightshift == bfd_arch_bits_per_address (input_bfd)) return false; - + sum = a + b; if (sum < a || (sum & ~ fieldmask) != 0) { @@ -3070,12 +3078,12 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) if (((~ (a ^ b)) & (a ^ sum)) & signmask) return true; } - + return false; } -static boolean -xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) +static boolean +xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) bfd *input_bfd; bfd_vma val; bfd_vma relocation; @@ -3083,7 +3091,7 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) { bfd_vma addrmask, fieldmask, signmask, ss; bfd_vma a, b, sum; - + /* Get the values to be added together. For signed and unsigned relocations, we assume that all values should be truncated to the size of an address. For bitfields, all the bits matter. @@ -3094,7 +3102,7 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) b = val & howto->src_mask; a = (a & addrmask) >> howto->rightshift; - + /* If any sign bits are set, all sign bits must be set. That is, A must be a valid negative address after shifting. */ @@ -3102,7 +3110,7 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) ss = a & signmask; if (ss != 0 && ss != ((addrmask >> howto->rightshift) & signmask)) return true; - + /* We only need this next bit of code if the sign bit of B is below the sign bit of A. This would only happen if SRC_MASK had fewer bits than BITSIZE. Note that if @@ -3115,12 +3123,12 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) /* Set all the bits above the sign bit. */ b -= signmask <<= 1; } - + b = (b & addrmask) >> howto->bitpos; - + /* Now we can do the addition. */ sum = a + b; - + /* See if the result has the correct sign. Bits above the sign bit are junk now; ignore them. If the sum is positive, make sure we did not have all negative inputs; @@ -3132,20 +3140,20 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) signmask = (fieldmask >> 1) + 1; if (((~ (a ^ b)) & (a ^ sum)) & signmask) return true; - + return false; } -static boolean -xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) +static boolean +xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) bfd *input_bfd; bfd_vma val; bfd_vma relocation; - struct reloc_howto_struct *howto; + struct reloc_howto_struct *howto; { bfd_vma addrmask, fieldmask; bfd_vma a, b, sum; - + /* Get the values to be added together. For signed and unsigned relocations, we assume that all values should be truncated to the size of an address. For bitfields, all the bits matter. @@ -3171,31 +3179,31 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) sum = (a + b) & addrmask; if ((a | b | sum) & ~ fieldmask) return true; - + return false; } /* This is the relocation function for the RS/6000/POWER/PowerPC. This is currently the only processor which uses XCOFF; I hope that - will never change. + will never change. I took the relocation type definitions from two documents: the PowerPC AIX Version 4 Application Binary Interface, First Edition (April 1992), and the PowerOpen ABI, Big-Endian 32-Bit Hardware Implementation (June 30, 1994). Differences - between the documents are noted below. + between the documents are noted below. - Unsupported r_type's + Unsupported r_type's R_RTB: R_RRTBI: R_RRTBA: - + These relocs are defined by the PowerPC ABI to be relative branches which use half of the difference between the symbol and the program counter. I can't quite figure out when this is useful. These relocs are - not defined by the PowerOpen ABI. + not defined by the PowerOpen ABI. Supported r_type's @@ -3203,7 +3211,7 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) Simple positive relocation. R_NEG: - Simple negative relocation. + Simple negative relocation. R_REL: Simple PC relative relocation. @@ -3221,16 +3229,16 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) R_GL: GL linkage relocation. The value of this relocation - is the address of the entry in the TOC section. + is the address of the entry in the TOC section. R_TCL: Local object TOC address. I can't figure out the - difference between this and case R_GL. + difference between this and case R_GL. R_TRL: TOC relative relocation. A TOC relative load instruction which may be changed to a load address instruction. - FIXME: We don't currently implement this optimization. + FIXME: We don't currently implement this optimization. R_TRLA: TOC relative relocation. This is a TOC relative load @@ -3240,52 +3248,52 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) R_BA: Absolute branch. We don't want to mess with the lower - two bits of the instruction. + two bits of the instruction. R_CAI: The PowerPC ABI defines this as an absolute call which may be modified to become a relative call. The PowerOpen - ABI does not define this relocation type. - + ABI does not define this relocation type. + R_RBA: Absolute branch which may be modified to become a - relative branch. + relative branch. R_RBAC: The PowerPC ABI defines this as an absolute branch to a fixed address which may be modified to an absolute branch to a symbol. The PowerOpen ABI does not define this - relocation type. + relocation type. R_RBRC: The PowerPC ABI defines this as an absolute branch to a fixed address which may be modified to a relative branch. - The PowerOpen ABI does not define this relocation type. + The PowerOpen ABI does not define this relocation type. R_BR: Relative branch. We don't want to mess with the lower - two bits of the instruction. + two bits of the instruction. R_CREL: The PowerPC ABI defines this as a relative call which may be modified to become an absolute call. The PowerOpen - ABI does not define this relocation type. + ABI does not define this relocation type. R_RBR: A relative branch which may be modified to become an absolute branch. FIXME: We don't implement this, although we should for symbols of storage mapping class - XMC_XO. + XMC_XO. R_RL: The PowerPC AIX ABI describes this as a load which may be changed to a load address. The PowerOpen ABI says this - is the same as case R_POS. + is the same as case R_POS. R_RLA: The PowerPC AIX ABI describes this as a load address which may be changed to a load. The PowerOpen ABI says - this is the same as R_POS. + this is the same as R_POS. */ boolean @@ -3320,8 +3328,8 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, bfd_byte *location; /* Relocation type R_REF is a special relocation type which is - merely used to prevent garbage collection from occurring for - the csect including the symbol which it references. */ + merely used to prevent garbage collection from occurring for + the csect including the symbol which it references. */ if (rel->r_type == R_REF) continue; @@ -3332,12 +3340,13 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, howto.size = howto.bitsize > 16 ? 2 : 1; howto.pc_relative = false; howto.bitpos = 0; - howto.complain_on_overflow = rel->r_size & 0x80 ? - complain_overflow_signed : complain_overflow_bitfield; + howto.complain_on_overflow = (rel->r_size & 0x80 + ? complain_overflow_signed + : complain_overflow_bitfield); howto.special_function = NULL; howto.name = "internal"; howto.partial_inplace = true; - howto.src_mask = howto.dst_mask = N_ONES(howto.bitsize); + howto.src_mask = howto.dst_mask = N_ONES (howto.bitsize); howto.pcrel_offset = false; /* symbol */ @@ -3345,17 +3354,17 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, addend = 0; h = NULL; sym = NULL; - symndx = rel->r_symndx; + symndx = rel->r_symndx; - if (-1 != symndx) + if (-1 != symndx) { asection *sec; - + h = obj_xcoff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; addend = - sym->n_value; - - if (NULL == h) + + if (NULL == h) { sec = sections[symndx]; /* Hack to make sure we use the right TOC anchor value @@ -3368,32 +3377,32 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, + sec->output_offset + sym->n_value - sec->vma); - } - else + } + else { - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; val = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_common) + } + else if (h->root.type == bfd_link_hash_common) { sec = h->root.u.c.p->section; val = (sec->output_section->vma + sec->output_offset); - - } - else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) - && ! info->relocateable) + + } + else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) + && ! info->relocateable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, true))) return false; - + /* Don't try to process the reloc. It can't help, and it may generate another error. */ continue; @@ -3401,74 +3410,74 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, } } - if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION - || (false == xcoff_calculate_relocation[rel->r_type] - (input_bfd, input_section, output_bfd, rel, sym, &howto, val, - addend, &relocation, contents))) + if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION + || !((*xcoff_calculate_relocation[rel->r_type]) + (input_bfd, input_section, output_bfd, rel, sym, &howto, val, + addend, &relocation, contents))) return false; - + /* address */ address = rel->r_vaddr - input_section->vma; location = contents + address; - + if (address > input_section->_raw_size) - abort(); + abort (); /* Get the value we are going to relocate. */ if (1 == howto.size) value_to_relocate = bfd_get_16 (input_bfd, location); - else + else value_to_relocate = bfd_get_32 (input_bfd, location); - - /* overflow. - + + /* overflow. + FIXME: We may drop bits during the addition which we don't check for. We must either check at every single operation, which would be tedious, or we must do the computations in a type larger than bfd_vma, which would be inefficient. */ - - if ((unsigned int) howto.complain_on_overflow >= - XCOFF_MAX_COMPLAIN_OVERFLOW) - abort(); - if ((true == xcoff_complain_overflow[howto.complain_on_overflow] - (input_bfd, value_to_relocate, relocation, &howto))) + if ((unsigned int) howto.complain_on_overflow + >= XCOFF_MAX_COMPLAIN_OVERFLOW) + abort (); + + if (((*xcoff_complain_overflow[howto.complain_on_overflow]) + (input_bfd, value_to_relocate, relocation, &howto))) { const char *name; char buf[SYMNMLEN + 1]; char reloc_type_name[10]; - - if (symndx == -1) + + if (symndx == -1) { name = "*ABS*"; - } - else if (h != NULL) + } + else if (h != NULL) { name = h->root.root.string; - } - else + } + else { name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); if (name == NULL) name = "UNKNOWN"; } sprintf (reloc_type_name, "0x%02x", rel->r_type); - + if (! ((*info->callbacks->reloc_overflow) (info, name, reloc_type_name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) return false; } - + /* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */ - value_to_relocate = ((value_to_relocate & ~howto.dst_mask) | - (((value_to_relocate & howto.src_mask) + - relocation) & howto.dst_mask)); - + value_to_relocate = ((value_to_relocate & ~howto.dst_mask) + | (((value_to_relocate & howto.src_mask) + + relocation) & howto.dst_mask)); + /* Put the value back in the object file. */ if (1 == howto.size) bfd_put_16 (input_bfd, value_to_relocate, location); - else + else bfd_put_32 (input_bfd, value_to_relocate, location); } @@ -3565,8 +3574,8 @@ xcoff_create_csect_from_smclas (abfd, aux, symbol_name) ".td", NULL, ".sv3264" }; - if ((19 >= aux->x_csect.x_smclas) && - (NULL != names[aux->x_csect.x_smclas])) + if ((19 >= aux->x_csect.x_smclas) + && (NULL != names[aux->x_csect.x_smclas])) { return_value = bfd_make_section_anyway (abfd, names[aux->x_csect.x_smclas]); @@ -3609,7 +3618,7 @@ xcoff_loader_symbol_offset (abfd, ldhdr) bfd *abfd; struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED; { - return bfd_xcoff_ldhdrsz(abfd); + return bfd_xcoff_ldhdrsz (abfd); } static bfd_vma @@ -3617,11 +3626,10 @@ xcoff_loader_reloc_offset (abfd, ldhdr) bfd *abfd; struct internal_ldhdr *ldhdr; { - return bfd_xcoff_ldhdrsz(abfd) + - (ldhdr->l_nsyms * bfd_xcoff_ldsymsz(abfd)); + return bfd_xcoff_ldhdrsz (abfd) + ldhdr->l_nsyms * bfd_xcoff_ldsymsz (abfd); } -static boolean +static boolean xcoff_generate_rtinit (abfd, init, fini, rtld) bfd *abfd; const char *init; @@ -3643,11 +3651,11 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) struct internal_syment syment; union internal_auxent auxent; struct internal_reloc reloc; - + char *data_name = ".data"; char *rtinit_name = "__rtinit"; char *rtld_name = "__rtld"; - + if (! bfd_xcoff_rtinit_size (abfd)) return false; @@ -3658,7 +3666,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) memset (filehdr_ext, 0, FILHSZ); memset (&filehdr, 0, sizeof (struct internal_filehdr)); filehdr.f_magic = bfd_xcoff_magic_number (abfd); - filehdr.f_nscns = 1; + filehdr.f_nscns = 1; filehdr.f_timdat = 0; filehdr.f_nsyms = 0; /* at least 6, no more than 10 */ filehdr.f_symptr = 0; /* set below */ @@ -3679,36 +3687,34 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) scnhdr.s_nlnno = 0; scnhdr.s_flags = STYP_DATA; - /* .data - 0x0000 0x00000000 : rtl - 0x0004 0x00000010 : offset to init, or 0 - 0x0008 0x00000028 : offset to fini, or 0 - 0x000C 0x0000000C : size of descriptor - 0x0010 0x00000000 : init, needs a reloc - 0x0014 0x00000040 : offset to init name - 0x0018 0x00000000 : flags, padded to a word - 0x001C 0x00000000 : empty init - 0x0020 0x00000000 : - 0x0024 0x00000000 : - 0x0028 0x00000000 : fini, needs a reloc - 0x002C 0x00000??? : offset to fini name - 0x0030 0x00000000 : flags, padded to a word - 0x0034 0x00000000 : empty fini - 0x0038 0x00000000 : - 0x003C 0x00000000 : - 0x0040 init name + /* .data + 0x0000 0x00000000 : rtl + 0x0004 0x00000010 : offset to init, or 0 + 0x0008 0x00000028 : offset to fini, or 0 + 0x000C 0x0000000C : size of descriptor + 0x0010 0x00000000 : init, needs a reloc + 0x0014 0x00000040 : offset to init name + 0x0018 0x00000000 : flags, padded to a word + 0x001C 0x00000000 : empty init + 0x0020 0x00000000 : + 0x0024 0x00000000 : + 0x0028 0x00000000 : fini, needs a reloc + 0x002C 0x00000??? : offset to fini name + 0x0030 0x00000000 : flags, padded to a word + 0x0034 0x00000000 : empty fini + 0x0038 0x00000000 : + 0x003C 0x00000000 : + 0x0040 init name 0x0040 + initsz fini name */ data_buffer_size = 0x0040 + initsz + finisz; - data_buffer_size += (data_buffer_size & 7) ? 8 - (data_buffer_size & 7) : 0; + data_buffer_size = (data_buffer_size + 7) &~ (bfd_size_type) 7; data_buffer = NULL; - data_buffer = (bfd_byte *) bfd_malloc (data_buffer_size); + data_buffer = (bfd_byte *) bfd_zmalloc (data_buffer_size); if (data_buffer == NULL) return false; - - memset (data_buffer, 0, data_buffer_size); - if (initsz) + if (initsz) { val = 0x10; bfd_h_put_32 (abfd, val, &data_buffer[0x04]); @@ -3717,7 +3723,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) memcpy (&data_buffer[val], init, initsz); } - if (finisz) + if (finisz) { val = 0x28; bfd_h_put_32 (abfd, val, &data_buffer[0x08]); @@ -3733,25 +3739,27 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) /* string table */ string_table_size = 0; - if (initsz > 9) + if (initsz > 9) string_table_size += initsz; if (finisz > 9) string_table_size += finisz; if (string_table_size) { string_table_size += 4; - string_table = (bfd_byte *)bfd_malloc (string_table_size); - memset (string_table, 0, string_table_size); + string_table = (bfd_byte *) bfd_zmalloc (string_table_size); + if (string_table == NULL) + return false; + val = string_table_size; bfd_h_put_32 (abfd, val, &string_table[0]); st_tmp = string_table + 4; } - - /* symbols + + /* symbols 0. .data csect 2. __rtinit - 4. init function - 6. fini function + 4. init function + 6. fini function 8. __rtld */ memset (syment_ext, 0, 10 * SYMESZ); memset (reloc_ext, 0, 3 * RELSZ); @@ -3766,10 +3774,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) auxent.x_csect.x_scnlen.l = data_buffer_size; auxent.x_csect.x_smtyp = 3 << 3 | XTY_SD; auxent.x_csect.x_smclas = XMC_RW; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); filehdr.f_nsyms += 2; @@ -3782,20 +3790,20 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) syment.n_numaux = 1; auxent.x_csect.x_smtyp = XTY_LD; auxent.x_csect.x_smclas = XMC_RW; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); filehdr.f_nsyms += 2; /* init */ - if (initsz) + if (initsz) { memset (&syment, 0, sizeof (struct internal_syment)); memset (&auxent, 0, sizeof (union internal_auxent)); - if (initsz > 9) + if (initsz > 9) { syment._n._n_n._n_offset = st_tmp - string_table; memcpy (st_tmp, init, initsz); @@ -3806,10 +3814,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) syment.n_sclass = C_EXT; syment.n_numaux = 1; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); /* reloc */ @@ -3823,14 +3831,14 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) filehdr.f_nsyms += 2; scnhdr.s_nreloc += 1; } - + /* fini */ - if (finisz) + if (finisz) { memset (&syment, 0, sizeof (struct internal_syment)); memset (&auxent, 0, sizeof (union internal_auxent)); - if (finisz > 9) + if (finisz > 9) { syment._n._n_n._n_offset = st_tmp - string_table; memcpy (st_tmp, fini, finisz); @@ -3841,10 +3849,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) syment.n_sclass = C_EXT; syment.n_numaux = 1; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); /* reloc */ @@ -3853,7 +3861,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) reloc.r_symndx = filehdr.f_nsyms; reloc.r_type = R_POS; reloc.r_size = 31; - bfd_coff_swap_reloc_out (abfd, &reloc, + bfd_coff_swap_reloc_out (abfd, &reloc, &reloc_ext[scnhdr.s_nreloc * RELSZ]); filehdr.f_nsyms += 2; @@ -3867,10 +3875,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) memcpy (syment._n._n_name, rtld_name, strlen (rtld_name)); syment.n_sclass = C_EXT; syment.n_numaux = 1; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); /* reloc */ @@ -3879,7 +3887,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) reloc.r_symndx = filehdr.f_nsyms; reloc.r_type = R_POS; reloc.r_size = 31; - bfd_coff_swap_reloc_out (abfd, &reloc, + bfd_coff_swap_reloc_out (abfd, &reloc, &reloc_ext[scnhdr.s_nreloc * RELSZ]); filehdr.f_nsyms += 2; @@ -3906,19 +3914,19 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) static reloc_howto_type xcoff_dynamic_reloc = -HOWTO (0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ +HOWTO (0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_POS", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false); /* pcrel_offset */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false); /* pcrel_offset */ /* glink @@ -3942,81 +3950,81 @@ static unsigned long xcoff_glink_code[9] = static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = { { /* COFF backend, defined in libcoff.h. */ - _bfd_xcoff_swap_aux_in, /* _bfd_coff_swap_aux_in */ - _bfd_xcoff_swap_sym_in, /* _bfd_coff_swap_sym_in */ - coff_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ - _bfd_xcoff_swap_aux_out, /* _bfd_swap_aux_out */ - _bfd_xcoff_swap_sym_out, /* _bfd_swap_sym_out */ - coff_swap_lineno_out, /* _bfd_swap_lineno_out */ - xcoff_swap_reloc_out, /* _bfd_swap_reloc_out */ - coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ - coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ - coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ - FILHSZ, /* _bfd_filhsz */ - AOUTSZ, /* _bfd_aoutsz */ - SCNHSZ, /* _bfd_scnhsz */ - SYMESZ, /* _bfd_symesz */ - AUXESZ, /* _bfd_auxesz */ - RELSZ, /* _bfd_relsz */ - LINESZ, /* _bfd_linesz */ - FILNMLEN, /* _bfd_filnmlen */ - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ - (3), /* _bfd_coff_default_section_alignment_power */ - false, /* _bfd_coff_force_symnames_in_strings */ - 2, /* _bfd_coff_debug_string_prefix_length */ - coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ - coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ - coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ - xcoff_swap_reloc_in, /* _bfd_reloc_in */ - coff_bad_format_hook, /* _bfd_bad_format_hook */ - coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ - coff_mkobject_hook, /* _bfd_mkobject_hook */ - styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ - coff_set_alignment_hook, /* _bfd_set_alignment_hook */ - coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ - symname_in_debug_hook, /* _coff_symname_in_debug_hook */ - coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ - coff_print_aux, /* bfd_coff_print_aux */ - dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ - dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ - NULL, /* bfd_coff_sym_is_global */ - coff_compute_section_file_positions, /* _bfd_coff_compute_section_file_positions */ - NULL, /* _bfd_coff_start_final_link */ - xcoff_ppc_relocate_section, /* _bfd_coff_relocate_section */ - coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ - NULL, /* _bfd_coff_addust_symndx */ - _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ - coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ - coff_final_link_postscript /* _bfd_coff_final_link_postscript */ + _bfd_xcoff_swap_aux_in, + _bfd_xcoff_swap_sym_in, + coff_swap_lineno_in, + _bfd_xcoff_swap_aux_out, + _bfd_xcoff_swap_sym_out, + coff_swap_lineno_out, + xcoff_swap_reloc_out, + coff_swap_filehdr_out, + coff_swap_aouthdr_out, + coff_swap_scnhdr_out, + FILHSZ, + AOUTSZ, + SCNHSZ, + SYMESZ, + AUXESZ, + RELSZ, + LINESZ, + FILNMLEN, + true, /* _bfd_coff_long_filenames */ + false, /* _bfd_coff_long_section_names */ + 3, /* _bfd_coff_default_section_alignment_power */ + false, /* _bfd_coff_force_symnames_in_strings */ + 2, /* _bfd_coff_debug_string_prefix_length */ + coff_swap_filehdr_in, + coff_swap_aouthdr_in, + coff_swap_scnhdr_in, + xcoff_swap_reloc_in, + coff_bad_format_hook, + coff_set_arch_mach_hook, + coff_mkobject_hook, + styp_to_sec_flags, + coff_set_alignment_hook, + coff_slurp_symbol_table, + symname_in_debug_hook, + coff_pointerize_aux_hook, + coff_print_aux, + dummy_reloc16_extra_cases, + dummy_reloc16_estimate, + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ + xcoff_ppc_relocate_section, + coff_rtype_to_howto, + NULL, /* _bfd_coff_adjust_symndx */ + _bfd_generic_link_add_one_symbol, + coff_link_output_has_begun, + coff_final_link_postscript }, - 0x01DF, /* magic number */ - bfd_arch_rs6000, /* architecture */ - bfd_mach_rs6k, /* machine */ + 0x01DF, /* magic number */ + bfd_arch_rs6000, + bfd_mach_rs6k, /* Function pointers to xcoff specific swap routines. */ - xcoff_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ - xcoff_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ - xcoff_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ - xcoff_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ - xcoff_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ - xcoff_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ + xcoff_swap_ldhdr_in, + xcoff_swap_ldhdr_out, + xcoff_swap_ldsym_in, + xcoff_swap_ldsym_out, + xcoff_swap_ldrel_in, + xcoff_swap_ldrel_out, /* Sizes. */ - LDHDRSZ, /* _xcoff_ldhdrsz */ - LDSYMSZ, /* _xcoff_ldsymsz */ - LDRELSZ, /* _xcoff_ldrelsz */ - 12, /* _xcoff_function_descriptor_size */ - SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */ + LDHDRSZ, + LDSYMSZ, + LDRELSZ, + 12, /* _xcoff_function_descriptor_size */ + SMALL_AOUTSZ, - /* Versions. */ - 1, /* _xcoff_ldhdr_version */ + /* Versions. */ + 1, /* _xcoff_ldhdr_version */ - _bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */ - _bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ - & xcoff_dynamic_reloc, /* dynamic reloc howto */ - xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */ + _bfd_xcoff_put_symbol_name, + _bfd_xcoff_put_ldsymbol_name, + &xcoff_dynamic_reloc, + xcoff_create_csect_from_smclas, /* Lineno and reloc count overflow. */ xcoff_is_lineno_count_overflow, @@ -4026,425 +4034,391 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = xcoff_loader_reloc_offset, /* glink. */ - & xcoff_glink_code[0], - (36), /* _xcoff_glink_size */ + &xcoff_glink_code[0], + 36, /* _xcoff_glink_size */ /* rtinit */ - 64, /* _xcoff_rtinit_size */ - xcoff_generate_rtinit, /* _xcoff_generate_rtinit */ -}; + 64, /* _xcoff_rtinit_size */ + xcoff_generate_rtinit, + }; /* The transfer vector that leads the outside world to all of the above. */ const bfd_target rs6000coff_vec = -{ - "aixcoff-rs6000", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | DYNAMIC | - HAS_SYMS | HAS_LOCALS | WP_TEXT), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* leading char */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen??? FIXMEmgo */ - - /* data */ - bfd_getb64, /* bfd_getx64 */ - bfd_getb_signed_64, /* bfd_getx_signed_64 */ - bfd_putb64, /* bfd_putx64 */ - bfd_getb32, /* bfd_getx32 */ - bfd_getb_signed_32, /* bfd_getx_signed_32 */ - bfd_putb32, /* bfd_putx32 */ - bfd_getb16, /* bfd_getx16 */ - bfd_getb_signed_16, /* bfd_getx_signed_16 */ - bfd_putb16, /* bfd_putx16 */ - - /* hdrs */ - bfd_getb64, /* bfd_h_getx64 */ - bfd_getb_signed_64, /* bfd_h_getx_signed_64 */ - bfd_putb64, /* bfd_h_putx64 */ - bfd_getb32, /* bfd_h_getx32 */ - bfd_getb_signed_32, /* bfd_h_getx_signed_32 */ - bfd_putb32, /* bfd_h_putx32 */ - bfd_getb16, /* bfd_h_getx16 */ - bfd_getb_signed_16, /* bfd_h_getx_signed_16 */ - bfd_putb16, /* bfd_h_putx16 */ - - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - _bfd_xcoff_archive_p, - CORE_FILE_P - }, - - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, + { + "aixcoff-rs6000", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC + | HAS_SYMS | HAS_LOCALS | WP_TEXT), + + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + /* data */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + /* hdrs */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + _bfd_xcoff_archive_p, + CORE_FILE_P + }, - {/* bfd_write_contents */ + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + coff_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, + + /* Generic */ + bfd_true, + bfd_true, + coff_new_section_hook, + _bfd_generic_get_section_contents, + _bfd_generic_get_section_contents_in_window, + + /* Copy */ + _bfd_xcoff_copy_private_bfd_data, + ((boolean (*) (bfd *, bfd *)) bfd_true), + ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((boolean (*) (bfd *, flagword)) bfd_true), + ((boolean (*) (bfd *, void * )) bfd_true), + + /* Core */ + coff_core_file_failing_command, + coff_core_file_failing_signal, + coff_core_file_matches_executable_p, + + /* Archive */ + _bfd_xcoff_slurp_armap, bfd_false, - coff_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, - - /* Generic */ - bfd_true, /* _close_and_cleanup */ - bfd_true, /* _bfd_free_cached_info */ - coff_new_section_hook, /* _new_section_hook */ - _bfd_generic_get_section_contents, /* _bfd_get_section_contents */ - /* _bfd_get_section_contents_in_window */ - _bfd_generic_get_section_contents_in_window, - - /* Copy */ - _bfd_xcoff_copy_private_bfd_data, /* _bfd_copy_private_bfd */ - /* _bfd_merge_private_bfd_data */ - ((boolean (*) (bfd *, bfd *)) bfd_true), - /* _bfd_copy_pivate_section_data */ - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - /* _bfd_copy_private_symbol_data */ - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), /* _bfd_set_private_flags */ - ((boolean (*) (bfd *, void * )) bfd_true), /* _bfd_print_private_bfd_data */ - - /* Core */ - coff_core_file_failing_command, /* _core_file_failing_command */ - coff_core_file_failing_signal, /* _core_file_failing_signal */ - /* _core_file_matches_executable_p */ - coff_core_file_matches_executable_p, - - /* Archive */ - _bfd_xcoff_slurp_armap, /* _slurp_armap */ - /* XCOFF archives do not have - anything which corresponds to - an extended name table. */ - bfd_false, /* _slurp_extended_name_table */ - /* _construct_extended_name_table */ - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), - bfd_dont_truncate_arname, /* _truncate_arname */ - _bfd_xcoff_write_armap, /* _write_armap */ - _bfd_xcoff_read_ar_hdr, /* _read_ar_hdr */ - _bfd_xcoff_openr_next_archived_file, /* _openr_next_archived_file */ - _bfd_generic_get_elt_at_index, /* _get_elt_at_index */ - _bfd_xcoff_stat_arch_elt, /* _generic_stat_arch_elt */ - /* XCOFF archives do not have - a timestamp. */ - bfd_true, /* _update_armap_timestamp */ - - /* Symbols */ - coff_get_symtab_upper_bound, /* _get_symtab_upper_bound */ - coff_get_symtab, /* _get_symtab */ - coff_make_empty_symbol, /* _make_empty_symbol */ - coff_print_symbol, /* _print_symbol */ - coff_get_symbol_info, /* _get_symbol_info */ - _bfd_xcoff_is_local_label_name, /* _bfd_is_local_label_name */ - coff_get_lineno, /* _get_lineno */ - coff_find_nearest_line, /* _find_nearest_line */ - coff_bfd_make_debug_symbol, /* _bfd_make_debug_symbol */ - _bfd_generic_read_minisymbols, /* _read_minisymbols */ - _bfd_generic_minisymbol_to_symbol, /* _minsymbol_to_symbol */ - - /* Reloc */ - coff_get_reloc_upper_bound, /* _get_reloc_upper_bound */ - coff_canonicalize_reloc, /* _cononicalize_reloc */ - _bfd_xcoff_reloc_type_lookup, /* _bfd_reloc_type_lookup */ - - /* Write */ - coff_set_arch_mach, /* _set_arch_mach */ - coff_set_section_contents, /* _set_section_contents */ - - /* Link */ - _bfd_xcoff_sizeof_headers, /* _sizeof_headers */ - /* _bfd_get_relocated_section_contents */ - bfd_generic_get_relocated_section_contents, - bfd_generic_relax_section, /* _bfd_relax_section */ - _bfd_xcoff_bfd_link_hash_table_create, /* _bfd_link_hash_table_create */ - _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */ - _bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */ - _bfd_generic_link_just_syms, /* _bfd_link_just_syms */ - _bfd_xcoff_bfd_final_link, /* _bfd_final_link */ - _bfd_generic_link_split_section, /* _bfd_link_split_section */ - bfd_generic_gc_sections, /* _bfd_gc_sections */ - bfd_generic_merge_sections, /* _bfd_merge_sections */ - - /* Dynamic */ - /* _get_dynamic_symtab_upper_bound */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, - _bfd_xcoff_canonicalize_dynamic_symtab, /* _cononicalize_dynamic_symtab */ - _bfd_xcoff_get_dynamic_reloc_upper_bound,/* _get_dynamic_reloc_upper_bound */ - _bfd_xcoff_canonicalize_dynamic_reloc, /* _cononicalize_dynamic_reloc */ - - /* Opposite endian version, none exists */ - NULL, - - /* back end data */ - (void *) &bfd_xcoff_backend_data, -}; + ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + bfd_dont_truncate_arname, + _bfd_xcoff_write_armap, + _bfd_xcoff_read_ar_hdr, + _bfd_xcoff_openr_next_archived_file, + _bfd_generic_get_elt_at_index, + _bfd_xcoff_stat_arch_elt, + bfd_true, + + /* Symbols */ + coff_get_symtab_upper_bound, + coff_get_symtab, + coff_make_empty_symbol, + coff_print_symbol, + coff_get_symbol_info, + _bfd_xcoff_is_local_label_name, + coff_get_lineno, + coff_find_nearest_line, + coff_bfd_make_debug_symbol, + _bfd_generic_read_minisymbols, + _bfd_generic_minisymbol_to_symbol, + + /* Reloc */ + coff_get_reloc_upper_bound, + coff_canonicalize_reloc, + _bfd_xcoff_reloc_type_lookup, + + /* Write */ + coff_set_arch_mach, + coff_set_section_contents, + + /* Link */ + _bfd_xcoff_sizeof_headers, + bfd_generic_get_relocated_section_contents, + bfd_generic_relax_section, + _bfd_xcoff_bfd_link_hash_table_create, + _bfd_generic_link_hash_table_free, + _bfd_xcoff_bfd_link_add_symbols, + _bfd_generic_link_just_syms, + _bfd_xcoff_bfd_final_link, + _bfd_generic_link_split_section, + bfd_generic_gc_sections, + bfd_generic_merge_sections, + bfd_generic_discard_group, + + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, + _bfd_xcoff_canonicalize_dynamic_symtab, + _bfd_xcoff_get_dynamic_reloc_upper_bound, + _bfd_xcoff_canonicalize_dynamic_reloc, + + /* Opposite endian version, none exists */ + NULL, + + (void *) &bfd_xcoff_backend_data, + }; -/* - * xcoff-powermac target - * Old target. - * Only difference between this target and the rs6000 target is the - * the default architecture and machine type used in coffcode.h - * - * PowerPC Macs use the same magic numbers as RS/6000 - * (because that's how they were bootstrapped originally), - * but they are always PowerPC architecture. - */ +/* xcoff-powermac target + Old target. + Only difference between this target and the rs6000 target is the + the default architecture and machine type used in coffcode.h + + PowerPC Macs use the same magic numbers as RS/6000 + (because that's how they were bootstrapped originally), + but they are always PowerPC architecture. */ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = -{ - { /* COFF backend, defined in libcoff.h */ - _bfd_xcoff_swap_aux_in, /* _bfd_coff_swap_aux_in */ - _bfd_xcoff_swap_sym_in, /* _bfd_coff_swap_sym_in */ - coff_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ - _bfd_xcoff_swap_aux_out, /* _bfd_swap_aux_out */ - _bfd_xcoff_swap_sym_out, /* _bfd_swap_sym_out */ - coff_swap_lineno_out, /* _bfd_swap_lineno_out */ - xcoff_swap_reloc_out, /* _bfd_swap_reloc_out */ - coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ - coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ - coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ - FILHSZ, /* _bfd_filhsz */ - AOUTSZ, /* _bfd_aoutsz */ - SCNHSZ, /* _bfd_scnhsz */ - SYMESZ, /* _bfd_symesz */ - AUXESZ, /* _bfd_auxesz */ - RELSZ, /* _bfd_relsz */ - LINESZ, /* _bfd_linesz */ - FILNMLEN, /* _bfd_filnmlen */ - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ - (3), /* _bfd_coff_default_section_alignment_power */ - false, /* _bfd_coff_force_symnames_in_strings */ - 2, /* _bfd_coff_debug_string_prefix_length */ - coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ - coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ - coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ - xcoff_swap_reloc_in, /* _bfd_reloc_in */ - coff_bad_format_hook, /* _bfd_bad_format_hook */ - coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ - coff_mkobject_hook, /* _bfd_mkobject_hook */ - styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ - coff_set_alignment_hook, /* _bfd_set_alignment_hook */ - coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ - symname_in_debug_hook, /* _coff_symname_in_debug_hook */ - coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ - coff_print_aux, /* bfd_coff_print_aux */ - dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ - dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ - NULL, /* bfd_coff_sym_is_global */ - /* _bfd_coff_compute_section_file_positions */ - coff_compute_section_file_positions, - NULL, /* _bfd_coff_start_final_link */ - xcoff_ppc_relocate_section, /* _bfd_coff_relocate_section */ - coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ - NULL, /* _bfd_coff_addust_symndx */ - _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ - coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ - coff_final_link_postscript /* _bfd_coff_final_link_postscript */ - }, - - 0x01DF, /* magic number */ - bfd_arch_powerpc, /* architecture */ - bfd_mach_ppc, /* machine */ - - /* function pointers to xcoff specific swap routines */ - xcoff_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ - xcoff_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ - xcoff_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ - xcoff_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ - xcoff_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ - xcoff_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ - - /* sizes */ - LDHDRSZ, /* _xcoff_ldhdrsz */ - LDSYMSZ, /* _xcoff_ldsymsz */ - LDRELSZ, /* _xcoff_ldrelsz */ - 12, /* _xcoff_function_descriptor_size */ - SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */ - - /* versions */ - 1, /* _xcoff_ldhdr_version */ - - /* xcoff vs xcoff64 putting symbol names */ - _bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */ - _bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ - - &xcoff_dynamic_reloc, /* dynamic reloc howto */ - - xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */ - - /* lineno and reloc count overflow */ - xcoff_is_lineno_count_overflow, - xcoff_is_reloc_count_overflow, - - xcoff_loader_symbol_offset, - xcoff_loader_reloc_offset, - - /* glink */ - &xcoff_glink_code[0], - (36), /* _xcoff_glink_size */ - - /* rtinit */ - 0, /* _xcoff_rtinit_size */ - xcoff_generate_rtinit, /* _xcoff_generate_rtinit */ -}; + { + { /* COFF backend, defined in libcoff.h. */ + _bfd_xcoff_swap_aux_in, + _bfd_xcoff_swap_sym_in, + coff_swap_lineno_in, + _bfd_xcoff_swap_aux_out, + _bfd_xcoff_swap_sym_out, + coff_swap_lineno_out, + xcoff_swap_reloc_out, + coff_swap_filehdr_out, + coff_swap_aouthdr_out, + coff_swap_scnhdr_out, + FILHSZ, + AOUTSZ, + SCNHSZ, + SYMESZ, + AUXESZ, + RELSZ, + LINESZ, + FILNMLEN, + true, /* _bfd_coff_long_filenames */ + false, /* _bfd_coff_long_section_names */ + 3, /* _bfd_coff_default_section_alignment_power */ + false, /* _bfd_coff_force_symnames_in_strings */ + 2, /* _bfd_coff_debug_string_prefix_length */ + coff_swap_filehdr_in, + coff_swap_aouthdr_in, + coff_swap_scnhdr_in, + xcoff_swap_reloc_in, + coff_bad_format_hook, + coff_set_arch_mach_hook, + coff_mkobject_hook, + styp_to_sec_flags, + coff_set_alignment_hook, + coff_slurp_symbol_table, + symname_in_debug_hook, + coff_pointerize_aux_hook, + coff_print_aux, + dummy_reloc16_extra_cases, + dummy_reloc16_estimate, + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ + xcoff_ppc_relocate_section, + coff_rtype_to_howto, + NULL, /* _bfd_coff_adjust_symndx */ + _bfd_generic_link_add_one_symbol, + coff_link_output_has_begun, + coff_final_link_postscript + }, + + 0x01DF, /* magic number */ + bfd_arch_powerpc, + bfd_mach_ppc, + + /* Function pointers to xcoff specific swap routines. */ + xcoff_swap_ldhdr_in, + xcoff_swap_ldhdr_out, + xcoff_swap_ldsym_in, + xcoff_swap_ldsym_out, + xcoff_swap_ldrel_in, + xcoff_swap_ldrel_out, + + /* Sizes. */ + LDHDRSZ, + LDSYMSZ, + LDRELSZ, + 12, /* _xcoff_function_descriptor_size */ + SMALL_AOUTSZ, + + /* Versions. */ + 1, /* _xcoff_ldhdr_version */ + + _bfd_xcoff_put_symbol_name, + _bfd_xcoff_put_ldsymbol_name, + &xcoff_dynamic_reloc, + xcoff_create_csect_from_smclas, + + /* Lineno and reloc count overflow. */ + xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, + + xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset, -/* The transfer vector that leads the outside world to all of the above. */ + /* glink. */ + &xcoff_glink_code[0], + 36, /* _xcoff_glink_size */ + + /* rtinit */ + 0, /* _xcoff_rtinit_size */ + xcoff_generate_rtinit, + }; + +/* The transfer vector that leads the outside world to all of the above. */ const bfd_target pmac_xcoff_vec = -{ - "xcoff-powermac", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | DYNAMIC | - HAS_SYMS | HAS_LOCALS | WP_TEXT), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* leading char */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen??? FIXMEmgo */ - - /* data */ - bfd_getb64, /* bfd_getx64 */ - bfd_getb_signed_64, /* bfd_getx_signed_64 */ - bfd_putb64, /* bfd_putx64 */ - bfd_getb32, /* bfd_getx32 */ - bfd_getb_signed_32, /* bfd_getx_signed_32 */ - bfd_putb32, /* bfd_putx32 */ - bfd_getb16, /* bfd_getx16 */ - bfd_getb_signed_16, /* bfd_getx_signed_16 */ - bfd_putb16, /* bfd_putx16 */ - - /* hdrs */ - bfd_getb64, /* bfd_h_getx64 */ - bfd_getb_signed_64, /* bfd_h_getx_signed_64 */ - bfd_putb64, /* bfd_h_putx64 */ - bfd_getb32, /* bfd_h_getx32 */ - bfd_getb_signed_32, /* bfd_h_getx_signed_32 */ - bfd_putb32, /* bfd_h_putx32 */ - bfd_getb16, /* bfd_h_getx16 */ - bfd_getb_signed_16, /* bfd_h_getx_signed_16 */ - bfd_putb16, /* bfd_h_putx16 */ - - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - _bfd_xcoff_archive_p, - CORE_FILE_P - }, - - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, + { + "xcoff-powermac", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC + | HAS_SYMS | HAS_LOCALS | WP_TEXT), + + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + /* data */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + /* hdrs */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + _bfd_xcoff_archive_p, + CORE_FILE_P + }, + + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + coff_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, - {/* bfd_write_contents */ + /* Generic */ + bfd_true, + bfd_true, + coff_new_section_hook, + _bfd_generic_get_section_contents, + _bfd_generic_get_section_contents_in_window, + + /* Copy */ + _bfd_xcoff_copy_private_bfd_data, + ((boolean (*) (bfd *, bfd *)) bfd_true), + ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((boolean (*) (bfd *, flagword)) bfd_true), + ((boolean (*) (bfd *, void * )) bfd_true), + + /* Core */ + coff_core_file_failing_command, + coff_core_file_failing_signal, + coff_core_file_matches_executable_p, + + /* Archive */ + _bfd_xcoff_slurp_armap, bfd_false, - coff_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, - - /* Generic */ - bfd_true, /* _close_and_cleanup */ - bfd_true, /* _bfd_free_cached_info */ - coff_new_section_hook, /* _new_section_hook */ - _bfd_generic_get_section_contents, /* _bfd_get_section_contents */ - /* _bfd_get_section_contents_in_window */ - _bfd_generic_get_section_contents_in_window, - - /* Copy */ - _bfd_xcoff_copy_private_bfd_data, /* _bfd_copy_private_bfd */ - /* _bfd_merge_private_bfd_data */ - ((boolean (*) (bfd *, bfd *)) bfd_true), - /* _bfd_copy_pivate_section_data */ - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - /* _bfd_copy_private_symbol_data */ - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), /* _bfd_set_private_flags */ - ((boolean (*) (bfd *, void * )) bfd_true), /* _bfd_print_private_bfd_data */ - - /* Core */ - coff_core_file_failing_command, /* _core_file_failing_command */ - coff_core_file_failing_signal, /* _core_file_failing_signal */ - /* _core_file_matches_executable_p */ - coff_core_file_matches_executable_p, - - /* Archive */ - _bfd_xcoff_slurp_armap, /* _slurp_armap */ - /* XCOFF archives do not have - anything which corresponds to - an extended name table. */ - bfd_false, /* _slurp_extended_name_table */ - /* _construct_extended_name_table */ - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), - bfd_dont_truncate_arname, /* _truncate_arname */ - _bfd_xcoff_write_armap, /* _write_armap */ - _bfd_xcoff_read_ar_hdr, /* _read_ar_hdr */ - _bfd_xcoff_openr_next_archived_file, /* _openr_next_archived_file */ - _bfd_generic_get_elt_at_index, /* _get_elt_at_index */ - _bfd_xcoff_stat_arch_elt, /* _generic_stat_arch_elt */ - /* XCOFF archives do not have - a timestamp. */ - bfd_true, /* _update_armap_timestamp */ - - /* Symbols */ - coff_get_symtab_upper_bound, /* _get_symtab_upper_bound */ - coff_get_symtab, /* _get_symtab */ - coff_make_empty_symbol, /* _make_empty_symbol */ - coff_print_symbol, /* _print_symbol */ - coff_get_symbol_info, /* _get_symbol_info */ - _bfd_xcoff_is_local_label_name, /* _bfd_is_local_label_name */ - coff_get_lineno, /* _get_lineno */ - coff_find_nearest_line, /* _find_nearest_line */ - coff_bfd_make_debug_symbol, /* _bfd_make_debug_symbol */ - _bfd_generic_read_minisymbols, /* _read_minisymbols */ - _bfd_generic_minisymbol_to_symbol, /* _minsymbol_to_symbol */ - - /* Reloc */ - coff_get_reloc_upper_bound, /* _get_reloc_upper_bound */ - coff_canonicalize_reloc, /* _cononicalize_reloc */ - _bfd_xcoff_reloc_type_lookup, /* _bfd_reloc_type_lookup */ - - /* Write */ - coff_set_arch_mach, /* _set_arch_mach */ - coff_set_section_contents, /* _set_section_contents */ - - /* Link */ - _bfd_xcoff_sizeof_headers, /* _sizeof_headers */ - /* _bfd_get_relocated_section_contents */ - bfd_generic_get_relocated_section_contents, - bfd_generic_relax_section, /* _bfd_relax_section */ - _bfd_xcoff_bfd_link_hash_table_create, /* _bfd_link_hash_table_create */ - _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */ - _bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */ - _bfd_generic_link_just_syms, /* _bfd_link_just_syms */ - _bfd_xcoff_bfd_final_link, /* _bfd_final_link */ - _bfd_generic_link_split_section, /* _bfd_link_split_section */ - bfd_generic_gc_sections, /* _bfd_gc_sections */ - bfd_generic_merge_sections, /* _bfd_merge_sections */ - - /* Dynamic */ - /* _get_dynamic_symtab_upper_bound */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, - _bfd_xcoff_canonicalize_dynamic_symtab, /* _cononicalize_dynamic_symtab */ - _bfd_xcoff_get_dynamic_reloc_upper_bound,/* _get_dynamic_reloc_upper_bound */ - _bfd_xcoff_canonicalize_dynamic_reloc, /* _cononicalize_dynamic_reloc */ - - /* Opposite endian version, none exists */ - NULL, - - /* back end data */ - (void *) &bfd_pmac_xcoff_backend_data, -}; + ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + bfd_dont_truncate_arname, + _bfd_xcoff_write_armap, + _bfd_xcoff_read_ar_hdr, + _bfd_xcoff_openr_next_archived_file, + _bfd_generic_get_elt_at_index, + _bfd_xcoff_stat_arch_elt, + bfd_true, + + /* Symbols */ + coff_get_symtab_upper_bound, + coff_get_symtab, + coff_make_empty_symbol, + coff_print_symbol, + coff_get_symbol_info, + _bfd_xcoff_is_local_label_name, + coff_get_lineno, + coff_find_nearest_line, + coff_bfd_make_debug_symbol, + _bfd_generic_read_minisymbols, + _bfd_generic_minisymbol_to_symbol, + + /* Reloc */ + coff_get_reloc_upper_bound, + coff_canonicalize_reloc, + _bfd_xcoff_reloc_type_lookup, + + /* Write */ + coff_set_arch_mach, + coff_set_section_contents, + + /* Link */ + _bfd_xcoff_sizeof_headers, + bfd_generic_get_relocated_section_contents, + bfd_generic_relax_section, + _bfd_xcoff_bfd_link_hash_table_create, + _bfd_generic_link_hash_table_free, + _bfd_xcoff_bfd_link_add_symbols, + _bfd_generic_link_just_syms, + _bfd_xcoff_bfd_final_link, + _bfd_generic_link_split_section, + bfd_generic_gc_sections, + bfd_generic_merge_sections, + bfd_generic_discard_group, + + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, + _bfd_xcoff_canonicalize_dynamic_symtab, + _bfd_xcoff_get_dynamic_reloc_upper_bound, + _bfd_xcoff_canonicalize_dynamic_reloc, + + /* Opposite endian version, none exists */ + NULL, + + (void *) &bfd_pmac_xcoff_backend_data, + }; diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index d13fa0f..d5cce39 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -156,36 +156,36 @@ static boolean xcoff64_bad_format_hook PARAMS ((bfd *, PTR )); static boolean xcoff64_reloc_type_br PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) - (XCOFF_RELOC_FUNCTION_ARGS) = + PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)) = { - xcoff_reloc_type_pos, /* R_POS (0x00) */ - xcoff_reloc_type_neg, /* R_NEG (0x01) */ - xcoff_reloc_type_rel, /* R_REL (0x02) */ - xcoff_reloc_type_toc, /* R_TOC (0x03) */ + xcoff_reloc_type_pos, /* R_POS (0x00) */ + xcoff_reloc_type_neg, /* R_NEG (0x01) */ + xcoff_reloc_type_rel, /* R_REL (0x02) */ + xcoff_reloc_type_toc, /* R_TOC (0x03) */ xcoff_reloc_type_fail, /* R_RTB (0x04) */ - xcoff_reloc_type_toc, /* R_GL (0x05) */ - xcoff_reloc_type_toc, /* R_TCL (0x06) */ - xcoff_reloc_type_fail, /* (0x07) */ - xcoff_reloc_type_ba, /* R_BA (0x08) */ - xcoff_reloc_type_fail, /* (0x09) */ + xcoff_reloc_type_toc, /* R_GL (0x05) */ + xcoff_reloc_type_toc, /* R_TCL (0x06) */ + xcoff_reloc_type_fail, /* (0x07) */ + xcoff_reloc_type_ba, /* R_BA (0x08) */ + xcoff_reloc_type_fail, /* (0x09) */ xcoff64_reloc_type_br, /* R_BR (0x0a) */ - xcoff_reloc_type_fail, /* (0x0b) */ - xcoff_reloc_type_pos, /* R_RL (0x0c) */ - xcoff_reloc_type_pos, /* R_RLA (0x0d) */ - xcoff_reloc_type_fail, /* (0x0e) */ + xcoff_reloc_type_fail, /* (0x0b) */ + xcoff_reloc_type_pos, /* R_RL (0x0c) */ + xcoff_reloc_type_pos, /* R_RLA (0x0d) */ + xcoff_reloc_type_fail, /* (0x0e) */ xcoff_reloc_type_noop, /* R_REF (0x0f) */ - xcoff_reloc_type_fail, /* (0x10) */ - xcoff_reloc_type_fail, /* (0x11) */ - xcoff_reloc_type_toc, /* R_TRL (0x12) */ - xcoff_reloc_type_toc, /* R_TRLA (0x13) */ + xcoff_reloc_type_fail, /* (0x10) */ + xcoff_reloc_type_fail, /* (0x11) */ + xcoff_reloc_type_toc, /* R_TRL (0x12) */ + xcoff_reloc_type_toc, /* R_TRLA (0x13) */ xcoff_reloc_type_fail, /* R_RRTBI (0x14) */ xcoff_reloc_type_fail, /* R_RRTBA (0x15) */ - xcoff_reloc_type_ba, /* R_CAI (0x16) */ + xcoff_reloc_type_ba, /* R_CAI (0x16) */ xcoff_reloc_type_crel, /* R_CREL (0x17) */ - xcoff_reloc_type_ba, /* R_RBA (0x18) */ - xcoff_reloc_type_ba, /* R_RBAC (0x19) */ + xcoff_reloc_type_ba, /* R_RBA (0x18) */ + xcoff_reloc_type_ba, /* R_RBAC (0x19) */ xcoff64_reloc_type_br, /* R_RBR (0x1a) */ - xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ + xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ }; /* coffcode.h needs these to be defined. */ @@ -214,7 +214,7 @@ boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) #ifdef AIX_CORE extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); extern boolean rs6000coff_core_file_matches_executable_p - PARAMS((bfd *cbfd, bfd *ebfd)); + PARAMS ((bfd *cbfd, bfd *ebfd)); extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); #define CORE_FILE_P rs6000coff_core_p @@ -722,7 +722,7 @@ xcoff64_swap_ldrel_out (abfd, src, d) static boolean xcoff64_write_object_contents (abfd) - bfd * abfd; + bfd *abfd; { asection *current; boolean hasrelocs = false; @@ -742,7 +742,7 @@ xcoff64_write_object_contents (abfd) bfd_set_error (bfd_error_system_call); - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { if (! bfd_coff_compute_section_file_positions (abfd)) return false; @@ -886,9 +886,11 @@ xcoff64_write_object_contents (abfd) memset (&internal_a, 0, sizeof internal_a); internal_f.f_magic = bfd_xcoff_magic_number (abfd); - internal_a.magic = (abfd->flags & D_PAGED) ? RS6K_AOUTHDR_ZMAGIC : - (abfd->flags & WP_TEXT) ? RS6K_AOUTHDR_NMAGIC : - RS6K_AOUTHDR_OMAGIC; + internal_a.magic = (abfd->flags & D_PAGED + ? RS6K_AOUTHDR_ZMAGIC + : (abfd->flags & WP_TEXT + ? RS6K_AOUTHDR_NMAGIC + : RS6K_AOUTHDR_OMAGIC)); /* FIXME: Does anybody ever set this to another value? */ internal_a.vstamp = 0; @@ -1054,7 +1056,7 @@ xcoff64_write_object_contents (abfd) if (buff == NULL) return false; - bfd_coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff); + bfd_coff_swap_aouthdr_out (abfd, (PTR) &internal_a, (PTR) buff); amount = bfd_bwrite ((PTR) buff, amount, abfd); free (buff); @@ -1066,8 +1068,8 @@ xcoff64_write_object_contents (abfd) return true; } -static boolean -xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, +static boolean +xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section; @@ -1082,7 +1084,7 @@ xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, { struct xcoff_link_hash_entry *h; - if (0 > rel->r_symndx) + if (0 > rel->r_symndx) return false; h = obj_xcoff_sym_hashes (input_bfd)[rel->r_symndx]; @@ -1094,53 +1096,53 @@ xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, call is followed by a ld r2,40(r1), but the call is not going to global linkage code, we can replace the load with a cror. */ - if (NULL != h - && bfd_link_hash_defined == h->root.type - && (rel->r_vaddr - input_section->vma + 8 <= - input_section->_cooked_size)) + if (NULL != h + && bfd_link_hash_defined == h->root.type + && (rel->r_vaddr - input_section->vma + 8 + <= input_section->_cooked_size)) { bfd_byte *pnext; unsigned long next; - + pnext = contents + (rel->r_vaddr - input_section->vma) + 4; next = bfd_get_32 (input_bfd, pnext); - - /* The _ptrgl function is magic. It is used by the AIX compiler to call + + /* The _ptrgl function is magic. It is used by the AIX compiler to call a function through a pointer. */ - if (h->smclas == XMC_GL || strcmp (h->root.root.string, "._ptrgl") == 0) + if (h->smclas == XMC_GL || strcmp (h->root.root.string, "._ptrgl") == 0) { - if (next == 0x4def7b82 /* cror 15,15,15 */ - || next == 0x4ffffb82 /* cror 31,31,31 */ - || next == 0x60000000) /* ori r0,r0,0 */ - bfd_put_32 (input_bfd, 0xe8410028, pnext); /* ld r2,40(r1) */ - } - else + if (next == 0x4def7b82 /* cror 15,15,15 */ + || next == 0x4ffffb82 /* cror 31,31,31 */ + || next == 0x60000000) /* ori r0,r0,0 */ + bfd_put_32 (input_bfd, 0xe8410028, pnext); /* ld r2,40(r1) */ + } + else { - if (next == 0xe8410028) /* ld r2,40(r1) */ - bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ + if (next == 0xe8410028) /* ld r2,40(r1) */ + bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ } - } - else if (NULL != h && bfd_link_hash_undefined == h->root.type) + } + else if (NULL != h && bfd_link_hash_undefined == h->root.type) { /* Normally, this relocation is against a defined symbol. In the case where this is a partial link and the output section offset - is greater than 2^25, the linker will return an invalid error + is greater than 2^25, the linker will return an invalid error message that the relocation has been truncated. Yes it has been - truncated but no it not important. For this case, disable the + truncated but no it not important. For this case, disable the overflow checking. */ howto->complain_on_overflow = complain_overflow_dont; } - + howto->pc_relative = true; howto->src_mask &= ~3; howto->dst_mask = howto->src_mask; - + /* A PC relative reloc includes the section address. */ addend += input_section->vma; - + *relocation = val + addend; - *relocation -= (input_section->output_section->vma + - input_section->output_offset); + *relocation -= (input_section->output_section->vma + + input_section->output_offset); return true; } @@ -1179,8 +1181,8 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, bfd_byte *location; /* Relocation type R_REF is a special relocation type which is - merely used to prevent garbage collection from occurring for - the csect including the symbol which it references. */ + merely used to prevent garbage collection from occurring for + the csect including the symbol which it references. */ if (rel->r_type == R_REF) continue; @@ -1191,12 +1193,13 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, howto.size = howto.bitsize > 16 ? (howto.bitsize > 32 ? 4 : 2) : 1; howto.pc_relative = false; howto.bitpos = 0; - howto.complain_on_overflow = rel->r_size & 0x80 ? - complain_overflow_signed : complain_overflow_bitfield; + howto.complain_on_overflow = (rel->r_size & 0x80 + ? complain_overflow_signed + : complain_overflow_bitfield); howto.special_function = NULL; howto.name = "internal"; howto.partial_inplace = true; - howto.src_mask = howto.dst_mask = N_ONES(howto.bitsize); + howto.src_mask = howto.dst_mask = N_ONES (howto.bitsize); howto.pcrel_offset = false; /* symbol */ @@ -1204,17 +1207,17 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, addend = 0; h = NULL; sym = NULL; - symndx = rel->r_symndx; + symndx = rel->r_symndx; - if (-1 != symndx) + if (-1 != symndx) { asection *sec; - + h = obj_xcoff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; addend = - sym->n_value; - - if (NULL == h) + + if (NULL == h) { sec = sections[symndx]; /* Hack to make sure we use the right TOC anchor value @@ -1227,93 +1230,93 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, + sec->output_offset + sym->n_value - sec->vma); - } - else + } + else { - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; val = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_common) + } + else if (h->root.type == bfd_link_hash_common) { sec = h->root.u.c.p->section; val = (sec->output_section->vma + sec->output_offset); - } - else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) - && ! info->relocateable) + } + else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) + && ! info->relocateable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_vaddr - input_section->vma, true))) return false; - + /* Don't try to process the reloc. It can't help, and it may generate another error. */ continue; } } } - - if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION - || (false == xcoff64_calculate_relocation[rel->r_type] - (input_bfd, input_section, output_bfd, rel, sym, &howto, val, - addend, &relocation, contents))) + + if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION + || ((*xcoff64_calculate_relocation[rel->r_type]) + (input_bfd, input_section, output_bfd, rel, sym, &howto, val, + addend, &relocation, contents))) return false; - + /* address */ address = rel->r_vaddr - input_section->vma; location = contents + address; - + if (address > input_section->_raw_size) - abort(); - + abort (); + /* Get the value we are going to relocate. */ if (1 == howto.size) value_to_relocate = bfd_get_16 (input_bfd, location); else if (2 == howto.size) value_to_relocate = bfd_get_32 (input_bfd, location); - else + else value_to_relocate = bfd_get_64 (input_bfd, location); - - /* overflow. - + + /* overflow. + FIXME: We may drop bits during the addition which we don't check for. We must either check at every single operation, which would be tedious, or we must do the computations in a type larger than bfd_vma, which would be inefficient. */ - - if ((unsigned int) howto.complain_on_overflow >= - XCOFF_MAX_COMPLAIN_OVERFLOW) - abort(); - - if ((true == xcoff_complain_overflow[howto.complain_on_overflow] - (input_bfd, value_to_relocate, relocation, &howto))) + + if ((unsigned int) howto.complain_on_overflow + >= XCOFF_MAX_COMPLAIN_OVERFLOW) + abort (); + + if (((*xcoff_complain_overflow[howto.complain_on_overflow]) + (input_bfd, value_to_relocate, relocation, &howto))) { const char *name; char buf[SYMNMLEN + 1]; char reloc_type_name[10]; - - if (symndx == -1) + + if (symndx == -1) { name = "*ABS*"; - } - else if (h != NULL) + } + else if (h != NULL) { name = h->root.root.string; - } - else + } + else { name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); if (name == NULL) name = "UNKNOWN"; } sprintf (reloc_type_name, "0x%02x", rel->r_type); - + if (! ((*info->callbacks->reloc_overflow) (info, name, reloc_type_name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) @@ -1321,10 +1324,10 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, } /* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */ - value_to_relocate = ((value_to_relocate & ~howto.dst_mask) | - (((value_to_relocate & howto.src_mask) + - relocation) & howto.dst_mask)); - + value_to_relocate = ((value_to_relocate & ~howto.dst_mask) + | (((value_to_relocate & howto.src_mask) + + relocation) & howto.dst_mask)); + /* Put the value back in the object file. */ if (1 == howto.size) bfd_put_16 (input_bfd, value_to_relocate, location); @@ -1332,7 +1335,7 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, bfd_put_32 (input_bfd, value_to_relocate, location); else bfd_put_64 (input_bfd, value_to_relocate, location); - + } return true; } @@ -1406,7 +1409,7 @@ reloc_howto_type xcoff64_howto_table[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* I don't really know what this is. */ + /* I don't really know what this is. */ HOWTO (R_RTB, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1424,7 +1427,7 @@ reloc_howto_type xcoff64_howto_table[] = /* External TOC relative symbol. */ HOWTO (R_GL, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1439,7 +1442,7 @@ reloc_howto_type xcoff64_howto_table[] = /* Local TOC relative symbol. */ HOWTO (R_TCL, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1464,8 +1467,8 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* special_function */ "R_BA_26", /* name */ true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ false), /* pcrel_offset */ EMPTY_HOWTO (9), @@ -1481,8 +1484,8 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* special_function */ "R_BR", /* name */ true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ false), /* pcrel_offset */ EMPTY_HOWTO (0xb), @@ -1490,7 +1493,7 @@ reloc_howto_type xcoff64_howto_table[] = /* Indirect load. */ HOWTO (R_RL, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1505,7 +1508,7 @@ reloc_howto_type xcoff64_howto_table[] = /* Load address. */ HOWTO (R_RLA, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1519,14 +1522,14 @@ reloc_howto_type xcoff64_howto_table[] = EMPTY_HOWTO (0xe), - /* Non-relocating reference. */ + /* Non-relocating reference. */ HOWTO (R_REF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "R_REF", /* name */ false, /* partial_inplace */ @@ -1540,7 +1543,7 @@ reloc_howto_type xcoff64_howto_table[] = /* TOC relative indirect load. */ HOWTO (R_TRL, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1555,7 +1558,7 @@ reloc_howto_type xcoff64_howto_table[] = /* TOC relative load address. */ HOWTO (R_TRLA, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1600,7 +1603,7 @@ reloc_howto_type xcoff64_howto_table[] = /* Modifiable call absolute indirect. */ HOWTO (R_CAI, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1612,10 +1615,10 @@ reloc_howto_type xcoff64_howto_table[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* Modifiable call relative. */ + /* Modifiable call relative. */ HOWTO (R_CREL, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1638,8 +1641,8 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* special_function */ "R_RBA", /* name */ true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ false), /* pcrel_offset */ /* Modifiable branch absolute. */ @@ -1653,8 +1656,8 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* special_function */ "R_RBAC", /* name */ true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* Modifiable branch relative. */ @@ -1668,14 +1671,14 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* special_function */ "R_RBR_26", /* name */ true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ false), /* pcrel_offset */ /* Modifiable branch absolute. */ HOWTO (R_RBRC, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -1717,19 +1720,35 @@ reloc_howto_type xcoff64_howto_table[] = false), /* pcrel_offset */ /* Modifiable branch relative. */ - HOWTO (R_RBR, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBR, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBR_16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBR_16", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable branch absolute. */ + HOWTO (R_RBA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RBA_16", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + }; void @@ -1742,22 +1761,24 @@ xcoff64_rtype2howto (relent, internal) /* Default howto layout works most of the time */ relent->howto = &xcoff64_howto_table[internal->r_type]; - + /* Special case some 16 bit reoloc */ if (15 == (internal->r_size & 0x3f)) { - if (R_BA == internal->r_type) + if (R_BA == internal->r_type) relent->howto = &xcoff64_howto_table[0x1d]; - else if (R_RBR == internal->r_type) + else if (R_RBR == internal->r_type) relent->howto = &xcoff64_howto_table[0x1e]; + else if (R_RBA == internal->r_type) + relent->howto = &xcoff64_howto_table[0x1f]; } /* Special case 32 bit */ else if (31 == (internal->r_size & 0x3f)) { - if (R_POS == internal->r_type) + if (R_POS == internal->r_type) relent->howto = &xcoff64_howto_table[0x1c]; } - + /* The r_size field of an XCOFF reloc encodes the bitsize of the relocation, as well as indicating whether it is signed or not. Doublecheck that the relocation information gathered from the @@ -1767,10 +1788,6 @@ xcoff64_rtype2howto (relent, internal) && (relent->howto->bitsize != ((unsigned int) internal->r_size & 0x3f) + 1)) abort (); - - /* Put a meaningful value in addend */ - relent->addend = (internal->r_size & 0x80) ? - internal->r_vaddr - : internal->r_vaddr; } reloc_howto_type * @@ -1822,7 +1839,8 @@ xcoff64_slurp_armap (abfd) return true; } - off = strtol (xcoff_ardata_big (abfd)->symoff64, (char **) NULL, 10); + off = bfd_scan_vma (xcoff_ardata_big (abfd)->symoff64, + (const char **) NULL, 10); if (off == 0) { bfd_has_map (abfd) = false; @@ -1843,10 +1861,7 @@ xcoff64_slurp_armap (abfd) if (bfd_seek (abfd, pos, SEEK_CUR) != 0) return false; - /* XXX This actually has to be a call to strtoll (at least on 32-bit - machines) since the field width is 20 and there numbers with more - than 32 bits can be represented. */ - sz = strtol (hdr.size, (char **) NULL, 10); + sz = bfd_scan_vma (hdr.size, (const char **) NULL, 10); /* Read in the entire symbol table. */ contents = (bfd_byte *) bfd_alloc (abfd, sz); @@ -1902,6 +1917,7 @@ static const bfd_target * xcoff64_archive_p (abfd) bfd *abfd; { + struct artdata *tdata_hold; char magic[SXCOFFARMAG]; /* This is the new format. */ struct xcoff_ar_file_hdr_big hdr; @@ -1920,50 +1936,46 @@ xcoff64_archive_p (abfd) return NULL; } - /* We are setting bfd_ardata(abfd) here, but since bfd_ardata - involves a cast, we can't do it as the left operand of - assignment. */ - amt = sizeof (struct artdata); - abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); - - if (bfd_ardata (abfd) == (struct artdata *) NULL) - return NULL; - - bfd_ardata (abfd)->cache = NULL; - bfd_ardata (abfd)->archive_head = NULL; - bfd_ardata (abfd)->symdefs = NULL; - bfd_ardata (abfd)->extended_names = NULL; - /* Copy over the magic string. */ memcpy (hdr.magic, magic, SXCOFFARMAG); /* Now read the rest of the file header. */ - if (bfd_bread ((PTR) &hdr.memoff, - (bfd_size_type) (SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG), - abfd) != SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG) + amt = SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG; + if (bfd_bread ((PTR) &hdr.memoff, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); return NULL; } - /* XXX This actually has to be a call to strtoll (at least on 32-bit - machines) since the field width is 20 and there numbers with more - than 32 bits can be represented. */ - bfd_ardata (abfd)->first_file_filepos = strtol (hdr.firstmemoff, - (char **) NULL, 10); + tdata_hold = bfd_ardata (abfd); + + amt = sizeof (struct artdata); + bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt); + if (bfd_ardata (abfd) == (struct artdata *) NULL) + goto error_ret_restore; + + bfd_ardata (abfd)->cache = NULL; + bfd_ardata (abfd)->archive_head = NULL; + bfd_ardata (abfd)->symdefs = NULL; + bfd_ardata (abfd)->extended_names = NULL; + bfd_ardata (abfd)->first_file_filepos = bfd_scan_vma (hdr.firstmemoff, + (const char **) NULL, + 10); amt = SIZEOF_AR_FILE_HDR_BIG; bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd)->tdata == NULL) - return NULL; + goto error_ret; memcpy (bfd_ardata (abfd)->tdata, &hdr, SIZEOF_AR_FILE_HDR_BIG); if (! xcoff64_slurp_armap (abfd)) { + error_ret: bfd_release (abfd, bfd_ardata (abfd)); - abfd->tdata.aout_ar_data = (struct artdata *) NULL; + error_ret_restore: + bfd_ardata (abfd) = tdata_hold; return NULL; } @@ -1993,20 +2005,15 @@ xcoff64_openr_next_archived_file (archive, last_file) } else { - /* XXX These actually have to be a calls to strtoll (at least - on 32-bit machines) since the fields's width is 20 and - there numbers with more than 32 bits can be represented. */ - filestart = strtol (arch_xhdr_big (last_file)->nextoff, (char **) NULL, - 10); + filestart = bfd_scan_vma (arch_xhdr_big (last_file)->nextoff, + (const char **) NULL, 10); } - /* XXX These actually have to be calls to strtoll (at least on 32-bit - machines) since the fields's width is 20 and there numbers with more - than 32 bits can be represented. */ + if (filestart == 0 - || filestart == strtol (xcoff_ardata_big (archive)->memoff, - (char **) NULL, 10) - || filestart == strtol (xcoff_ardata_big (archive)->symoff, - (char **) NULL, 10)) + || filestart == bfd_scan_vma (xcoff_ardata_big (archive)->memoff, + (const char **) NULL, 10) + || filestart == bfd_scan_vma (xcoff_ardata_big (archive)->symoff, + (const char **) NULL, 10)) { bfd_set_error (bfd_error_no_more_archived_files); return NULL; @@ -2218,40 +2225,38 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld) bss_scnhdr.s_flags = STYP_BSS; /* .data - 0x0000 0x00000000 : rtl - 0x0004 0x00000000 : - 0x0008 0x00000018 : offset to init, or 0 - 0x000C 0x00000038 : offset to fini, or 0 - 0x0010 0x00000010 : size of descriptor - 0x0014 0x00000000 : pad - 0x0018 0x00000000 : init, needs a reloc - 0x001C 0x00000000 : - 0x0020 0x00000058 : offset to init name - 0x0024 0x00000000 : flags, padded to a word - 0x0028 0x00000000 : empty init - 0x002C 0x00000000 : - 0x0030 0x00000000 : - 0x0034 0x00000000 : - 0x0038 0x00000000 : fini, needs a reloc - 0x003C 0x00000000 : - 0x0040 0x00000??? : offset to fini name - 0x0044 0x00000000 : flags, padded to a word - 0x0048 0x00000000 : empty fini - 0x004C 0x00000000 : - 0x0050 0x00000000 : - 0x0054 0x00000000 : - 0x0058 init name + 0x0000 0x00000000 : rtl + 0x0004 0x00000000 : + 0x0008 0x00000018 : offset to init, or 0 + 0x000C 0x00000038 : offset to fini, or 0 + 0x0010 0x00000010 : size of descriptor + 0x0014 0x00000000 : pad + 0x0018 0x00000000 : init, needs a reloc + 0x001C 0x00000000 : + 0x0020 0x00000058 : offset to init name + 0x0024 0x00000000 : flags, padded to a word + 0x0028 0x00000000 : empty init + 0x002C 0x00000000 : + 0x0030 0x00000000 : + 0x0034 0x00000000 : + 0x0038 0x00000000 : fini, needs a reloc + 0x003C 0x00000000 : + 0x0040 0x00000??? : offset to fini name + 0x0044 0x00000000 : flags, padded to a word + 0x0048 0x00000000 : empty fini + 0x004C 0x00000000 : + 0x0050 0x00000000 : + 0x0054 0x00000000 : + 0x0058 init name 0x0058 + initsz fini name */ data_buffer_size = 0x0058 + initsz + finisz; - data_buffer_size += (data_buffer_size & 7) ? 8 - (data_buffer_size & 7) : 0; + data_buffer_size = (data_buffer_size + 7) &~ (bfd_size_type) 7; data_buffer = NULL; - data_buffer = (bfd_byte *)bfd_malloc (data_buffer_size); + data_buffer = (bfd_byte *) bfd_zmalloc (data_buffer_size); if (data_buffer == NULL) return false; - memset (data_buffer, 0, data_buffer_size); - if (initsz) { val = 0x18; @@ -2281,11 +2286,13 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld) string_table_size += strlen (rtinit_name) + 1; string_table_size += initsz; string_table_size += finisz; - if (true == rtld) + if (rtld) string_table_size += strlen (rtld_name) + 1; - string_table = (bfd_byte *)bfd_malloc (string_table_size); - memset (string_table, 0, string_table_size); + string_table = (bfd_byte *) bfd_zmalloc (string_table_size); + if (string_table == NULL) + return false; + val = string_table_size; bfd_put_32 (abfd, val, &string_table[0]); st_tmp = string_table + 4; @@ -2483,504 +2490,474 @@ static unsigned long xcoff64_glink_code[10] = }; static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = -{ - { /* COFF backend, defined in libcoff.h. */ - _bfd_xcoff64_swap_aux_in, /* _bfd_coff_swap_aux_in */ - _bfd_xcoff64_swap_sym_in, /* _bfd_coff_swap_sym_in */ - _bfd_xcoff64_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ - _bfd_xcoff64_swap_aux_out, /* _bfd_swap_aux_out */ - _bfd_xcoff64_swap_sym_out, /* _bfd_swap_sym_out */ - _bfd_xcoff64_swap_lineno_out, /* _bfd_swap_lineno_out */ - xcoff64_swap_reloc_out, /* _bfd_swap_reloc_out */ - coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ - coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ - coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ - FILHSZ, /* _bfd_filhsz */ - AOUTSZ, /* _bfd_aoutsz */ - SCNHSZ, /* _bfd_scnhsz */ - SYMESZ, /* _bfd_symesz */ - AUXESZ, /* _bfd_auxesz */ - RELSZ, /* _bfd_relsz */ - LINESZ, /* _bfd_linesz */ - FILNMLEN, /* _bfd_filnmlen */ - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ - (3), /* _bfd_coff_default_section_alignment_power */ - true, /* _bfd_coff_force_symnames_in_strings */ - 4, /* _bfd_coff_debug_string_prefix_length */ - coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ - coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ - coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ - xcoff64_swap_reloc_in, /* _bfd_reloc_in */ - xcoff64_bad_format_hook, /* _bfd_bad_format_hook */ - coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ - coff_mkobject_hook, /* _bfd_mkobject_hook */ - styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ - coff_set_alignment_hook, /* _bfd_set_alignment_hook */ - coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ - symname_in_debug_hook, /* _coff_symname_in_debug_hook */ - coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ - coff_print_aux, /* bfd_coff_print_aux */ - dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ - dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ - NULL, /* bfd_coff_sym_is_global */ - /* _bfd_coff_compute_section_file_positions */ - coff_compute_section_file_positions, - NULL , /* _bfd_coff_start_final_link */ - xcoff64_ppc_relocate_section, /* _bfd_coff_relocate_section */ - coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ - NULL , /* _bfd_coff_addust_symndx */ - _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ - coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ - coff_final_link_postscript /* _bfd_coff_final_link_postscript */ - }, - - 0x01EF, /* magic number */ - bfd_arch_powerpc, /* architecture */ - bfd_mach_ppc_620, /* machine */ - - /* Function pointers to xcoff specific swap routines. */ - xcoff64_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ - xcoff64_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ - xcoff64_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ - xcoff64_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ - xcoff64_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ - xcoff64_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ - - /* Sizes. */ - LDHDRSZ, /* _xcoff_ldhdrsz */ - LDSYMSZ, /* _xcoff_ldsymsz */ - LDRELSZ, /* _xcoff_ldrelsz */ - 24, /* _xcoff_function_descriptor_size */ - 0, /* _xcoff_small_aout_header_size */ - - /* Versions. */ - 2, /* _xcoff_ldhdr_version */ - - /* xcoff vs xcoff64 putting symbol names. */ - _bfd_xcoff64_put_symbol_name, /* _xcoff_put_symbol_name */ - _bfd_xcoff64_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ - - /* Dynamic reloc howto. */ - &xcoff64_dynamic_reloc, - - xcoff64_create_csect_from_smclas, - - /* Lineno and reloc count overflow. */ - xcoff64_is_lineno_count_overflow, - xcoff64_is_reloc_count_overflow, - - xcoff64_loader_symbol_offset, - xcoff64_loader_reloc_offset, - - /* glink. */ - &xcoff64_glink_code[0], - 40, /* _xcoff_glink_size */ - - /* rtinit. */ - 88, /* _xcoff_rtinit_size */ - xcoff64_generate_rtinit, /* _xcoff_generate_rtinit */ -}; + { + { /* COFF backend, defined in libcoff.h. */ + _bfd_xcoff64_swap_aux_in, + _bfd_xcoff64_swap_sym_in, + _bfd_xcoff64_swap_lineno_in, + _bfd_xcoff64_swap_aux_out, + _bfd_xcoff64_swap_sym_out, + _bfd_xcoff64_swap_lineno_out, + xcoff64_swap_reloc_out, + coff_swap_filehdr_out, + coff_swap_aouthdr_out, + coff_swap_scnhdr_out, + FILHSZ, + AOUTSZ, + SCNHSZ, + SYMESZ, + AUXESZ, + RELSZ, + LINESZ, + FILNMLEN, + true, /* _bfd_coff_long_filenames */ + false, /* _bfd_coff_long_section_names */ + 3, /* _bfd_coff_default_section_alignment_power */ + true, /* _bfd_coff_force_symnames_in_strings */ + 4, /* _bfd_coff_debug_string_prefix_length */ + coff_swap_filehdr_in, + coff_swap_aouthdr_in, + coff_swap_scnhdr_in, + xcoff64_swap_reloc_in, + xcoff64_bad_format_hook, + coff_set_arch_mach_hook, + coff_mkobject_hook, + styp_to_sec_flags, + coff_set_alignment_hook, + coff_slurp_symbol_table, + symname_in_debug_hook, + coff_pointerize_aux_hook, + coff_print_aux, + dummy_reloc16_extra_cases, + dummy_reloc16_estimate, + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ + xcoff64_ppc_relocate_section, + coff_rtype_to_howto, + NULL, /* _bfd_coff_adjust_symndx */ + _bfd_generic_link_add_one_symbol, + coff_link_output_has_begun, + coff_final_link_postscript + }, + + 0x01EF, /* magic number */ + bfd_arch_powerpc, + bfd_mach_ppc_620, + + /* Function pointers to xcoff specific swap routines. */ + xcoff64_swap_ldhdr_in, + xcoff64_swap_ldhdr_out, + xcoff64_swap_ldsym_in, + xcoff64_swap_ldsym_out, + xcoff64_swap_ldrel_in, + xcoff64_swap_ldrel_out, + + /* Sizes. */ + LDHDRSZ, + LDSYMSZ, + LDRELSZ, + 24, /* _xcoff_function_descriptor_size */ + 0, /* _xcoff_small_aout_header_size */ + + /* Versions. */ + 2, /* _xcoff_ldhdr_version */ + + _bfd_xcoff64_put_symbol_name, + _bfd_xcoff64_put_ldsymbol_name, + &xcoff64_dynamic_reloc, + xcoff64_create_csect_from_smclas, + + /* Lineno and reloc count overflow. */ + xcoff64_is_lineno_count_overflow, + xcoff64_is_reloc_count_overflow, + + xcoff64_loader_symbol_offset, + xcoff64_loader_reloc_offset, + + /* glink. */ + &xcoff64_glink_code[0], + 40, /* _xcoff_glink_size */ + + /* rtinit. */ + 88, /* _xcoff_rtinit_size */ + xcoff64_generate_rtinit, + }; /* The transfer vector that leads the outside world to all of the above. */ const bfd_target rs6000coff64_vec = -{ - "aixcoff64-rs6000", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | DYNAMIC | - HAS_SYMS | HAS_LOCALS | WP_TEXT), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* leading char */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen??? FIXMEmgo */ - - /* data */ - bfd_getb64, /* bfd_getx64 */ - bfd_getb_signed_64, /* bfd_getx_signed_64 */ - bfd_putb64, /* bfd_putx64 */ - bfd_getb32, /* bfd_getx32 */ - bfd_getb_signed_32, /* bfd_getx_signed_32 */ - bfd_putb32, /* bfd_putx32 */ - bfd_getb16, /* bfd_getx16 */ - bfd_getb_signed_16, /* bfd_getx_signed_16 */ - bfd_putb16, /* bfd_putx16 */ - - /* hdrs */ - bfd_getb64, /* bfd_h_getx64 */ - bfd_getb_signed_64, /* bfd_h_getx_signed_64 */ - bfd_putb64, /* bfd_h_putx64 */ - bfd_getb32, /* bfd_h_getx32 */ - bfd_getb_signed_32, /* bfd_h_getx_signed_32 */ - bfd_putb32, /* bfd_h_putx32 */ - bfd_getb16, /* bfd_h_getx16 */ - bfd_getb_signed_16, /* bfd_h_getx_signed_16 */ - bfd_putb16, /* bfd_h_putx16 */ - - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - xcoff64_archive_p, - CORE_FILE_P - }, - - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, - - {/* bfd_write_contents */ + { + "aixcoff64-rs6000", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC + | HAS_SYMS | HAS_LOCALS | WP_TEXT), + + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + /* data */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + /* hdrs */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + xcoff64_archive_p, + CORE_FILE_P + }, + + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + xcoff64_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, + + /* Generic */ + bfd_true, + bfd_true, + coff_new_section_hook, + _bfd_generic_get_section_contents, + _bfd_generic_get_section_contents_in_window, + + /* Copy */ + _bfd_xcoff_copy_private_bfd_data, + ((boolean (*) (bfd *, bfd *)) bfd_true), + ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((boolean (*) (bfd *, flagword)) bfd_true), + ((boolean (*) (bfd *, void * )) bfd_true), + + /* Core */ + coff_core_file_failing_command, + coff_core_file_failing_signal, + coff_core_file_matches_executable_p, + + /* Archive */ + xcoff64_slurp_armap, bfd_false, - xcoff64_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, - - /* Generic */ - bfd_true, /* _close_and_cleanup */ - bfd_true, /* _bfd_free_cached_info */ - coff_new_section_hook, /* _new_section_hook */ - _bfd_generic_get_section_contents, /* _bfd_get_section_contents */ - /* _bfd_get_section_contents_in_window */ - _bfd_generic_get_section_contents_in_window, - - /* Copy */ - _bfd_xcoff_copy_private_bfd_data, /* _bfd_copy_private_bfd */ - /* _bfd_merge_private_bfd_data */ - ((boolean (*) (bfd *, bfd *)) bfd_true), - /* _bfd_copy_pivate_section_data */ - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - /* _bfd_copy_private_symbol_data */ - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), /* _bfd_set_private_flags */ - ((boolean (*) (bfd *, void * )) bfd_true), /* _bfd_print_private_bfd_data */ - - /* Core */ - coff_core_file_failing_command, /* _core_file_failing_command */ - coff_core_file_failing_signal, /* _core_file_failing_signal */ - coff_core_file_matches_executable_p, /* _core_file_matches_executable_p */ - - /* Archive */ - xcoff64_slurp_armap, /* _slurp_armap */ - /* XCOFF archives do not have anything which corresponds to an - extended name table. */ - bfd_false, /* _slurp_extended_name_table */ - /* _construct_extended_name_table */ - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), - bfd_dont_truncate_arname, /* _truncate_arname */ - _bfd_xcoff_write_armap, /* _write_armap */ - _bfd_xcoff_read_ar_hdr, /* _read_ar_hdr */ - xcoff64_openr_next_archived_file, /* _openr_next_archived_file */ - _bfd_generic_get_elt_at_index, /* _get_elt_at_index */ - _bfd_xcoff_stat_arch_elt, /* _generic_stat_arch_elt */ - /* XCOFF archives do not have a timestamp. */ - bfd_true, /* _update_armap_timestamp */ - - /* Symbols */ - coff_get_symtab_upper_bound, /* _get_symtab_upper_bound */ - coff_get_symtab, /* _get_symtab */ - coff_make_empty_symbol, /* _make_empty_symbol */ - coff_print_symbol, /* _print_symbol */ - coff_get_symbol_info, /* _get_symbol_info */ - _bfd_xcoff_is_local_label_name, /* _bfd_is_local_label_name */ - coff_get_lineno, /* _get_lineno */ - coff_find_nearest_line, /* _find_nearest_line */ - coff_bfd_make_debug_symbol, /* _bfd_make_debug_symbol */ - _bfd_generic_read_minisymbols, /* _read_minisymbols */ - _bfd_generic_minisymbol_to_symbol, /* _minsymbol_to_symbol */ - - /* Reloc */ - coff_get_reloc_upper_bound, /* _get_reloc_upper_bound */ - coff_canonicalize_reloc, /* _cononicalize_reloc */ - xcoff64_reloc_type_lookup, /* _bfd_reloc_type_lookup */ - - /* Write */ - coff_set_arch_mach, /* _set_arch_mach */ - coff_set_section_contents, /* _set_section_contents */ - - /* Link */ - xcoff64_sizeof_headers, /* _sizeof_headers */ - /* _bfd_get_relocated_section_contents */ - bfd_generic_get_relocated_section_contents, - bfd_generic_relax_section, /* _bfd_relax_section */ - _bfd_xcoff_bfd_link_hash_table_create,/* _bfd_link_hash_table_create */ - _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */ - _bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */ - _bfd_generic_link_just_syms, /* _bfd_link_just_syms */ - _bfd_xcoff_bfd_final_link, /* _bfd_final_link */ - _bfd_generic_link_split_section, /* _bfd_link_split_section */ - bfd_generic_gc_sections, /* _bfd_gc_sections */ - bfd_generic_merge_sections, /* _bfd_merge_sections */ - - /* Dynamic */ - /* _get_dynamic_symtab_upper_bound */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, - _bfd_xcoff_canonicalize_dynamic_symtab, /* _cononicalize_dynamic_symtab */ - _bfd_xcoff_get_dynamic_reloc_upper_bound,/* _get_dynamic_reloc_upper_bound */ - _bfd_xcoff_canonicalize_dynamic_reloc, /* _cononicalize_dynamic_reloc */ - - /* Opposite endian version, none exists */ - NULL, - - /* back end data */ - (void *) &bfd_xcoff_backend_data, -}; + ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + bfd_dont_truncate_arname, + _bfd_xcoff_write_armap, + _bfd_xcoff_read_ar_hdr, + xcoff64_openr_next_archived_file, + _bfd_generic_get_elt_at_index, + _bfd_xcoff_stat_arch_elt, + bfd_true, + + /* Symbols */ + coff_get_symtab_upper_bound, + coff_get_symtab, + coff_make_empty_symbol, + coff_print_symbol, + coff_get_symbol_info, + _bfd_xcoff_is_local_label_name, + coff_get_lineno, + coff_find_nearest_line, + coff_bfd_make_debug_symbol, + _bfd_generic_read_minisymbols, + _bfd_generic_minisymbol_to_symbol, + + /* Reloc */ + coff_get_reloc_upper_bound, + coff_canonicalize_reloc, + xcoff64_reloc_type_lookup, + + /* Write */ + coff_set_arch_mach, + coff_set_section_contents, + + /* Link */ + xcoff64_sizeof_headers, + bfd_generic_get_relocated_section_contents, + bfd_generic_relax_section, + _bfd_xcoff_bfd_link_hash_table_create, + _bfd_generic_link_hash_table_free, + _bfd_xcoff_bfd_link_add_symbols, + _bfd_generic_link_just_syms, + _bfd_xcoff_bfd_final_link, + _bfd_generic_link_split_section, + bfd_generic_gc_sections, + bfd_generic_merge_sections, + bfd_generic_discard_group, + + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, + _bfd_xcoff_canonicalize_dynamic_symtab, + _bfd_xcoff_get_dynamic_reloc_upper_bound, + _bfd_xcoff_canonicalize_dynamic_reloc, + + /* Opposite endian version, none exists */ + NULL, + + (void *) &bfd_xcoff_backend_data, + }; extern const bfd_target *xcoff64_core_p PARAMS ((bfd *)); -extern boolean xcoff64_core_file_matches_executable_p PARAMS((bfd *, bfd *)); +extern boolean xcoff64_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); extern char *xcoff64_core_file_failing_command PARAMS ((bfd *)); extern int xcoff64_core_file_failing_signal PARAMS ((bfd *)); /* AIX 5 */ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data = -{ - { /* COFF backend, defined in libcoff.h. */ - _bfd_xcoff64_swap_aux_in, /* _bfd_coff_swap_aux_in */ - _bfd_xcoff64_swap_sym_in, /* _bfd_coff_swap_sym_in */ - _bfd_xcoff64_swap_lineno_in, /* _bfd_coff_swap_lineno_in */ - _bfd_xcoff64_swap_aux_out, /* _bfd_swap_aux_out */ - _bfd_xcoff64_swap_sym_out, /* _bfd_swap_sym_out */ - _bfd_xcoff64_swap_lineno_out, /* _bfd_swap_lineno_out */ - xcoff64_swap_reloc_out, /* _bfd_swap_reloc_out */ - coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */ - coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */ - coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */ - FILHSZ, /* _bfd_filhsz */ - AOUTSZ, /* _bfd_aoutsz */ - SCNHSZ, /* _bfd_scnhsz */ - SYMESZ, /* _bfd_symesz */ - AUXESZ, /* _bfd_auxesz */ - RELSZ, /* _bfd_relsz */ - LINESZ, /* _bfd_linesz */ - FILNMLEN, /* _bfd_filnmlen */ - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ - (3), /* _bfd_coff_default_section_alignment_power */ - true, /* _bfd_coff_force_symnames_in_strings */ - 4, /* _bfd_coff_debug_string_prefix_length */ - coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */ - coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */ - coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */ - xcoff64_swap_reloc_in, /* _bfd_reloc_in */ - xcoff64_bad_format_hook, /* _bfd_bad_format_hook */ - coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */ - coff_mkobject_hook, /* _bfd_mkobject_hook */ - styp_to_sec_flags, /* _bfd_syp_to_sec_flags */ - coff_set_alignment_hook, /* _bfd_set_alignment_hook */ - coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */ - symname_in_debug_hook, /* _coff_symname_in_debug_hook */ - coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */ - coff_print_aux, /* bfd_coff_print_aux */ - dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */ - dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */ - NULL, /* bfd_coff_sym_is_global */ - /* _bfd_coff_compute_section_file_positions */ - coff_compute_section_file_positions, - NULL , /* _bfd_coff_start_final_link */ - xcoff64_ppc_relocate_section, /* _bfd_coff_relocate_section */ - coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */ - NULL , /* _bfd_coff_addust_symndx */ - _bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */ - coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */ - coff_final_link_postscript /* _bfd_coff_final_link_postscript */ - }, - - U64_TOCMAGIC, /* magic number */ - bfd_arch_powerpc, /* architecture */ - bfd_mach_ppc_620, /* machine */ - - /* Function pointers to xcoff specific swap routines. */ - xcoff64_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */ - xcoff64_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */ - xcoff64_swap_ldsym_in, /* _xcoff_swap_ldsym_in */ - xcoff64_swap_ldsym_out, /* _xcoff_swap_ldsym_out */ - xcoff64_swap_ldrel_in, /* _xcoff_swap_ldrel_in */ - xcoff64_swap_ldrel_out, /* _xcoff_swap_ldrel_out */ - - /* Sizes. */ - LDHDRSZ, /* _xcoff_ldhdrsz */ - LDSYMSZ, /* _xcoff_ldsymsz */ - LDRELSZ, /* _xcoff_ldrelsz */ - 24, /* _xcoff_function_descriptor_size */ - 0, /* _xcoff_small_aout_header_size */ - /* Versions. */ - 2, /* _xcoff_ldhdr_version */ - - _bfd_xcoff64_put_symbol_name, /* _xcoff_put_symbol_name */ - _bfd_xcoff64_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */ - - /* Dynamic reloc howto. */ - &xcoff64_dynamic_reloc, - xcoff64_create_csect_from_smclas, - - /* Lineno and reloc count overflow. */ - xcoff64_is_lineno_count_overflow, - xcoff64_is_reloc_count_overflow, - - xcoff64_loader_symbol_offset, - xcoff64_loader_reloc_offset, - - /* glink. */ - &xcoff64_glink_code[0], - 40, /* _xcoff_glink_size */ - - /* rtinit. */ - 88, /* _xcoff_rtinit_size */ - xcoff64_generate_rtinit, /* _xcoff_generate_rtinit */ -}; + { + { /* COFF backend, defined in libcoff.h. */ + _bfd_xcoff64_swap_aux_in, + _bfd_xcoff64_swap_sym_in, + _bfd_xcoff64_swap_lineno_in, + _bfd_xcoff64_swap_aux_out, + _bfd_xcoff64_swap_sym_out, + _bfd_xcoff64_swap_lineno_out, + xcoff64_swap_reloc_out, + coff_swap_filehdr_out, + coff_swap_aouthdr_out, + coff_swap_scnhdr_out, + FILHSZ, + AOUTSZ, + SCNHSZ, + SYMESZ, + AUXESZ, + RELSZ, + LINESZ, + FILNMLEN, + true, /* _bfd_coff_long_filenames */ + false, /* _bfd_coff_long_section_names */ + 3, /* _bfd_coff_default_section_alignment_power */ + true, /* _bfd_coff_force_symnames_in_strings */ + 4, /* _bfd_coff_debug_string_prefix_length */ + coff_swap_filehdr_in, + coff_swap_aouthdr_in, + coff_swap_scnhdr_in, + xcoff64_swap_reloc_in, + xcoff64_bad_format_hook, + coff_set_arch_mach_hook, + coff_mkobject_hook, + styp_to_sec_flags, + coff_set_alignment_hook, + coff_slurp_symbol_table, + symname_in_debug_hook, + coff_pointerize_aux_hook, + coff_print_aux, + dummy_reloc16_extra_cases, + dummy_reloc16_estimate, + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ + xcoff64_ppc_relocate_section, + coff_rtype_to_howto, + NULL, /* _bfd_coff_adjust_symndx */ + _bfd_generic_link_add_one_symbol, + coff_link_output_has_begun, + coff_final_link_postscript + }, + + U64_TOCMAGIC, /* magic number */ + bfd_arch_powerpc, + bfd_mach_ppc_620, + + /* Function pointers to xcoff specific swap routines. */ + xcoff64_swap_ldhdr_in, + xcoff64_swap_ldhdr_out, + xcoff64_swap_ldsym_in, + xcoff64_swap_ldsym_out, + xcoff64_swap_ldrel_in, + xcoff64_swap_ldrel_out, + + /* Sizes. */ + LDHDRSZ, + LDSYMSZ, + LDRELSZ, + 24, /* _xcoff_function_descriptor_size */ + 0, /* _xcoff_small_aout_header_size */ + /* Versions. */ + 2, /* _xcoff_ldhdr_version */ + + _bfd_xcoff64_put_symbol_name, + _bfd_xcoff64_put_ldsymbol_name, + &xcoff64_dynamic_reloc, + xcoff64_create_csect_from_smclas, + + /* Lineno and reloc count overflow. */ + xcoff64_is_lineno_count_overflow, + xcoff64_is_reloc_count_overflow, + + xcoff64_loader_symbol_offset, + xcoff64_loader_reloc_offset, + + /* glink. */ + &xcoff64_glink_code[0], + 40, /* _xcoff_glink_size */ + + /* rtinit. */ + 88, /* _xcoff_rtinit_size */ + xcoff64_generate_rtinit, + }; /* The transfer vector that leads the outside world to all of the above. */ const bfd_target aix5coff64_vec = -{ - "aix5coff64-rs6000", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | DYNAMIC | - HAS_SYMS | HAS_LOCALS | WP_TEXT), - - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* leading char */ - '/', /* ar_pad_char */ - 15, /* ar_max_namelen??? FIXMEmgo */ - - /* data */ - bfd_getb64, /* bfd_getx64 */ - bfd_getb_signed_64, /* bfd_getx_signed_64 */ - bfd_putb64, /* bfd_putx64 */ - bfd_getb32, /* bfd_getx32 */ - bfd_getb_signed_32, /* bfd_getx_signed_32 */ - bfd_putb32, /* bfd_putx32 */ - bfd_getb16, /* bfd_getx16 */ - bfd_getb_signed_16, /* bfd_getx_signed_16 */ - bfd_putb16, /* bfd_putx16 */ - - /* hdrs */ - bfd_getb64, /* bfd_h_getx64 */ - bfd_getb_signed_64, /* bfd_h_getx_signed_64 */ - bfd_putb64, /* bfd_h_putx64 */ - bfd_getb32, /* bfd_h_getx32 */ - bfd_getb_signed_32, /* bfd_h_getx_signed_32 */ - bfd_putb32, /* bfd_h_putx32 */ - bfd_getb16, /* bfd_h_getx16 */ - bfd_getb_signed_16, /* bfd_h_getx_signed_16 */ - bfd_putb16, /* bfd_h_putx16 */ - - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - xcoff64_archive_p, - xcoff64_core_p - }, - - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, - - {/* bfd_write_contents */ + { + "aix5coff64-rs6000", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC + | HAS_SYMS | HAS_LOCALS | WP_TEXT), + + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + /* data */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + /* hdrs */ + bfd_getb64, + bfd_getb_signed_64, + bfd_putb64, + bfd_getb32, + bfd_getb_signed_32, + bfd_putb32, + bfd_getb16, + bfd_getb_signed_16, + bfd_putb16, + + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + xcoff64_archive_p, + xcoff64_core_p + }, + + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + xcoff64_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, + + /* Generic */ + bfd_true, + bfd_true, + coff_new_section_hook, + _bfd_generic_get_section_contents, + _bfd_generic_get_section_contents_in_window, + + /* Copy */ + _bfd_xcoff_copy_private_bfd_data, + ((boolean (*) (bfd *, bfd *)) bfd_true), + ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((boolean (*) (bfd *, flagword)) bfd_true), + ((boolean (*) (bfd *, void * )) bfd_true), + + /* Core */ + xcoff64_core_file_failing_command, + xcoff64_core_file_failing_signal, + xcoff64_core_file_matches_executable_p, + + /* Archive */ + xcoff64_slurp_armap, bfd_false, - xcoff64_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, - - /* Generic */ - bfd_true, /* _close_and_cleanup */ - bfd_true, /* _bfd_free_cached_info */ - coff_new_section_hook, /* _new_section_hook */ - _bfd_generic_get_section_contents, /* _bfd_get_section_contents */ - /* _bfd_get_section_contents_in_window */ - _bfd_generic_get_section_contents_in_window, - - /* Copy */ - _bfd_xcoff_copy_private_bfd_data, /* _bfd_copy_private_bfd */ - /* _bfd_merge_private_bfd_data */ - ((boolean (*) (bfd *, bfd *)) bfd_true), - /* _bfd_copy_pivate_section_data */ - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - /* _bfd_copy_private_symbol_data */ - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), /* _bfd_set_private_flags */ - ((boolean (*) (bfd *, void * )) bfd_true), /* _bfd_print_private_bfd_data */ - - /* Core */ - xcoff64_core_file_failing_command, /* _core_file_failing_command */ - xcoff64_core_file_failing_signal, /* _core_file_failing_signal */ - xcoff64_core_file_matches_executable_p, /* _core_file_matches_executable_p */ - - /* Archive */ - xcoff64_slurp_armap, /* _slurp_armap */ - /* XCOFF archives do not have anything which corresponds to an - extended name table. */ - bfd_false, /* _slurp_extended_name_table */ - /* _construct_extended_name_table */ - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), - bfd_dont_truncate_arname, /* _truncate_arname */ - _bfd_xcoff_write_armap, /* _write_armap */ - _bfd_xcoff_read_ar_hdr, /* _read_ar_hdr */ - xcoff64_openr_next_archived_file, /* _openr_next_archived_file */ - _bfd_generic_get_elt_at_index, /* _get_elt_at_index */ - _bfd_xcoff_stat_arch_elt, /* _generic_stat_arch_elt */ - /* XCOFF archives do not have a timestamp. */ - bfd_true, /* _update_armap_timestamp */ - - /* Symbols */ - coff_get_symtab_upper_bound, /* _get_symtab_upper_bound */ - coff_get_symtab, /* _get_symtab */ - coff_make_empty_symbol, /* _make_empty_symbol */ - coff_print_symbol, /* _print_symbol */ - coff_get_symbol_info, /* _get_symbol_info */ - _bfd_xcoff_is_local_label_name, /* _bfd_is_local_label_name */ - coff_get_lineno, /* _get_lineno */ - coff_find_nearest_line, /* _find_nearest_line */ - coff_bfd_make_debug_symbol, /* _bfd_make_debug_symbol */ - _bfd_generic_read_minisymbols, /* _read_minisymbols */ - _bfd_generic_minisymbol_to_symbol, /* _minsymbol_to_symbol */ - - /* Reloc */ - coff_get_reloc_upper_bound, /* _get_reloc_upper_bound */ - coff_canonicalize_reloc, /* _cononicalize_reloc */ - xcoff64_reloc_type_lookup, /* _bfd_reloc_type_lookup */ - - /* Write */ - coff_set_arch_mach, /* _set_arch_mach */ - coff_set_section_contents, /* _set_section_contents */ - - /* Link */ - xcoff64_sizeof_headers, /* _sizeof_headers */ - /* _bfd_get_relocated_section_contents */ - bfd_generic_get_relocated_section_contents, - bfd_generic_relax_section, /* _bfd_relax_section */ - _bfd_xcoff_bfd_link_hash_table_create,/* _bfd_link_hash_table_create */ - _bfd_generic_link_hash_table_free, /* _bfd_link_hash_table_free */ - _bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */ - _bfd_generic_link_just_syms, /* _bfd_link_just_syms */ - _bfd_xcoff_bfd_final_link, /* _bfd_final_link */ - _bfd_generic_link_split_section, /* _bfd_link_split_section */ - bfd_generic_gc_sections, /* _bfd_gc_sections */ - bfd_generic_merge_sections, /* _bfd_merge_sections */ - - /* Dynamic */ - /* _get_dynamic_symtab_upper_bound */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, - _bfd_xcoff_canonicalize_dynamic_symtab, /* _cononicalize_dynamic_symtab */ - _bfd_xcoff_get_dynamic_reloc_upper_bound,/* _get_dynamic_reloc_upper_bound */ - _bfd_xcoff_canonicalize_dynamic_reloc, /* _cononicalize_dynamic_reloc */ - - /* Opposite endian version, none exists. */ - NULL, - - /* back end data */ - (void *) & bfd_xcoff_aix5_backend_data, -}; + ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + bfd_dont_truncate_arname, + _bfd_xcoff_write_armap, + _bfd_xcoff_read_ar_hdr, + xcoff64_openr_next_archived_file, + _bfd_generic_get_elt_at_index, + _bfd_xcoff_stat_arch_elt, + bfd_true, + + /* Symbols */ + coff_get_symtab_upper_bound, + coff_get_symtab, + coff_make_empty_symbol, + coff_print_symbol, + coff_get_symbol_info, + _bfd_xcoff_is_local_label_name, + coff_get_lineno, + coff_find_nearest_line, + coff_bfd_make_debug_symbol, + _bfd_generic_read_minisymbols, + _bfd_generic_minisymbol_to_symbol, + + /* Reloc */ + coff_get_reloc_upper_bound, + coff_canonicalize_reloc, + xcoff64_reloc_type_lookup, + + /* Write */ + coff_set_arch_mach, + coff_set_section_contents, + + /* Link */ + xcoff64_sizeof_headers, + bfd_generic_get_relocated_section_contents, + bfd_generic_relax_section, + _bfd_xcoff_bfd_link_hash_table_create, + _bfd_generic_link_hash_table_free, + _bfd_xcoff_bfd_link_add_symbols, + _bfd_generic_link_just_syms, + _bfd_xcoff_bfd_final_link, + _bfd_generic_link_split_section, + bfd_generic_gc_sections, + bfd_generic_merge_sections, + bfd_generic_discard_group, + + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, + _bfd_xcoff_canonicalize_dynamic_symtab, + _bfd_xcoff_get_dynamic_reloc_upper_bound, + _bfd_xcoff_canonicalize_dynamic_reloc, + + /* Opposite endian version, none exists. */ + NULL, + + (void *) & bfd_xcoff_aix5_backend_data, + }; diff --git a/bfd/coffcode.h b/bfd/coffcode.h index cea516f..bb777aa 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1739,7 +1739,7 @@ coff_mkobject_hook (abfd, filehdr, aouthdr) struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; coff_data_type *coff; - if (coff_mkobject (abfd) == false) + if (! coff_mkobject (abfd)) return NULL; coff = coff_data (abfd); @@ -1782,8 +1782,8 @@ coff_mkobject_hook (abfd, filehdr, aouthdr) xcoff->toc = internal_a->o_toc; xcoff->sntoc = internal_a->o_sntoc; xcoff->snentry = internal_a->o_snentry; - xcoff->text_align_power = internal_a->o_algntext; - xcoff->data_align_power = internal_a->o_algndata; + bfd_xcoff_text_align_power (abfd) = internal_a->o_algntext; + bfd_xcoff_data_align_power (abfd) = internal_a->o_algndata; xcoff->modtype = internal_a->o_modtype; xcoff->cputype = internal_a->o_cputype; xcoff->maxdata = internal_a->o_maxdata; @@ -2177,7 +2177,7 @@ symname_in_debug_hook (abfd, sym) bfd * abfd ATTRIBUTE_UNUSED; struct internal_syment *sym; { - return SYMNAME_IN_DEBUG (sym) ? true : false; + return SYMNAME_IN_DEBUG (sym) != 0; } #else @@ -2394,7 +2394,7 @@ coff_write_relocs (abfd, first_undef) return false; #ifdef COFF_WITH_PE - if (s->reloc_count > 0xffff) + if (obj_pe (abfd) && s->reloc_count >= 0xffff) { /* encode real count here as first reloc */ struct internal_reloc n; @@ -2822,8 +2822,8 @@ coff_set_arch_mach (abfd, arch, machine) if (! bfd_default_set_arch_mach (abfd, arch, machine)) return false; - if (arch != bfd_arch_unknown && - coff_set_flags (abfd, &dummy1, &dummy2) != true) + if (arch != bfd_arch_unknown + && ! coff_set_flags (abfd, &dummy1, &dummy2)) return false; /* We can't represent this type */ return true; /* We're easy ... */ @@ -3084,8 +3084,10 @@ coff_compute_section_file_positions (abfd) AIX executable is stripped with gnu strip because the default vma of native is 0x10000150 but default for gnu is 0x10000140. Gnu stripped gnu excutable passes this check because the filepos is - 0x0140. */ - if (!strcmp (current->name, _TEXT)) + 0x0140. This problem also show up with 64 bit shared objects. The + data section must also be aligned. */ + if (!strcmp (current->name, _TEXT) + || !strcmp (current->name, _DATA)) { bfd_vma pad; bfd_vma align; @@ -3403,7 +3405,7 @@ coff_write_object_contents (abfd) lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd); - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { if (! coff_compute_section_file_positions (abfd)) return false; @@ -3418,7 +3420,7 @@ coff_write_object_contents (abfd) { #ifdef COFF_WITH_PE /* we store the actual reloc count in the first reloc's addr */ - if (current->reloc_count > 0xffff) + if (obj_pe (abfd) && current->reloc_count >= 0xffff) reloc_count ++; #endif reloc_count += current->reloc_count; @@ -3449,7 +3451,7 @@ coff_write_object_contents (abfd) reloc_base += current->reloc_count * bfd_coff_relsz (abfd); #ifdef COFF_WITH_PE /* extra reloc to hold real count */ - if (current->reloc_count > 0xffff) + if (obj_pe (abfd) && current->reloc_count >= 0xffff) reloc_base += bfd_coff_relsz (abfd); #endif } @@ -4194,7 +4196,7 @@ coff_set_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - if (abfd->output_has_begun == false) /* set by bfd.c handler */ + if (! abfd->output_has_begun) /* set by bfd.c handler */ { if (! coff_compute_section_file_positions (abfd)) return false; @@ -5372,6 +5374,10 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_merge_sections bfd_generic_merge_sections #endif +#ifndef coff_bfd_discard_group +#define coff_bfd_discard_group bfd_generic_discard_group +#endif + #define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \ const bfd_target VAR = \ { \ diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 88591f1..ee6c8fc 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1,6 +1,6 @@ /* Support for the generic parts of COFF, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -178,6 +178,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) flagword oflags = abfd->flags; bfd_vma ostart = bfd_get_start_address (abfd); PTR tdata; + PTR tdata_save; bfd_size_type readsize; /* length of file_info */ unsigned int scnhsz; char *external_sections; @@ -206,9 +207,10 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) /* Set up the tdata area. ECOFF uses its own routine, and overrides abfd->flags. */ + tdata_save = abfd->tdata.any; tdata = bfd_coff_mkobject_hook (abfd, (PTR) internal_f, (PTR) internal_a); if (tdata == NULL) - return 0; + goto fail2; scnhsz = bfd_coff_scnhsz (abfd); readsize = (bfd_size_type) nscns * scnhsz; @@ -221,7 +223,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) /* Set the arch/mach *before* swapping in sections; section header swapping may depend on arch/mach info. */ - if (bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f) == false) + if (! bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f)) goto fail; /* Now copy data as required; construct all asections etc */ @@ -245,6 +247,8 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) fail: bfd_release (abfd, tdata); + fail2: + abfd->tdata.any = tdata_save; abfd->flags = oflags; bfd_get_start_address (abfd) = ostart; return (const bfd_target *) NULL; @@ -270,12 +274,13 @@ coff_object_p (abfd) filehdr = bfd_alloc (abfd, filhsz); if (filehdr == NULL) - return 0; + return NULL; if (bfd_bread (filehdr, filhsz, abfd) != filhsz) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return 0; + bfd_release (abfd, filehdr); + return NULL; } bfd_coff_swap_filehdr_in (abfd, filehdr, &internal_f); bfd_release (abfd, filehdr); @@ -288,11 +293,11 @@ coff_object_p (abfd) only read in f_opthdr bytes in the call to bfd_bread. We should also attempt to catch corrupt or non-COFF binaries with a strange value for f_opthdr. */ - if (bfd_coff_bad_format_hook (abfd, &internal_f) == false + if (! bfd_coff_bad_format_hook (abfd, &internal_f) || internal_f.f_opthdr > aoutsz) { bfd_set_error (bfd_error_wrong_format); - return 0; + return NULL; } nscns = internal_f.f_nscns; @@ -302,13 +307,15 @@ coff_object_p (abfd) opthdr = bfd_alloc (abfd, aoutsz); if (opthdr == NULL) - return 0; + return NULL; if (bfd_bread (opthdr, (bfd_size_type) internal_f.f_opthdr, abfd) != internal_f.f_opthdr) { - return 0; + bfd_release (abfd, opthdr); + return NULL; } bfd_coff_swap_aouthdr_in (abfd, opthdr, (PTR) &internal_a); + bfd_release (abfd, opthdr); } return coff_real_object_p (abfd, nscns, &internal_f, @@ -1438,13 +1445,13 @@ coff_section_symbol (abfd, name) combined_entry_type e[10]; }; struct foo *f; - f = (struct foo *) bfd_alloc (abfd, (bfd_size_type) sizeof (*f)); + + f = (struct foo *) bfd_zalloc (abfd, (bfd_size_type) sizeof (*f)); if (!f) { bfd_set_error (bfd_error_no_error); return NULL; } - memset ((char *) f, 0, sizeof (*f)); coff_symbol_from (abfd, sym)->native = csym = f->e; } csym[0].u.syment.n_sclass = C_STAT; @@ -1835,10 +1842,9 @@ coff_get_normalized_symtab (abfd) if (internal_ptr->u.syment._n._n_name[i] == '\0') break; - newstring = (PTR) bfd_alloc (abfd, (bfd_size_type) (i + 1)); + newstring = (PTR) bfd_zalloc (abfd, (bfd_size_type) (i + 1)); if (newstring == NULL) return (NULL); - memset (newstring, 0, i + 1); strncpy (newstring, internal_ptr->u.syment._n._n_name, i); internal_ptr->u.syment._n._n_n._n_offset = (long int) newstring; internal_ptr->u.syment._n._n_n._n_zeroes = 0; @@ -1897,10 +1903,9 @@ coff_make_empty_symbol (abfd) bfd *abfd; { bfd_size_type amt = sizeof (coff_symbol_type); - coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, amt); + coff_symbol_type *new = (coff_symbol_type *) bfd_zalloc (abfd, amt); if (new == NULL) return (NULL); - memset (new, 0, sizeof *new); new->symbol.section = 0; new->native = 0; new->lineno = (alent *) NULL; @@ -2415,7 +2420,7 @@ coff_sizeof_headers (abfd, reloc) { size_t size; - if (reloc == false) + if (! reloc) { size = bfd_coff_filhsz (abfd) + bfd_coff_aoutsz (abfd); } @@ -2453,12 +2458,10 @@ bfd_coff_set_symbol_class (abfd, symbol, class) combined_entry_type * native; bfd_size_type amt = sizeof (* native); - native = (combined_entry_type *) bfd_alloc (abfd, amt); + native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (native == NULL) return false; - memset (native, 0, sizeof (* native)); - native->u.syment.n_type = T_NULL; native->u.syment.n_sclass = class; diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 1eac3c5..eb9388f 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -342,12 +342,10 @@ coff_link_add_symbols (abfd, info) /* We keep a list of the linker hash table entries that correspond to particular symbols. */ amt = symcount * sizeof (struct coff_link_hash_entry *); - sym_hash = (struct coff_link_hash_entry **) bfd_alloc (abfd, amt); + sym_hash = (struct coff_link_hash_entry **) bfd_zalloc (abfd, amt); if (sym_hash == NULL && symcount != 0) goto error_return; obj_coff_sym_hashes (abfd) = sym_hash; - memset (sym_hash, 0, - (size_t) symcount * sizeof (struct coff_link_hash_entry *)); symesz = bfd_coff_symesz (abfd); BFD_ASSERT (symesz == bfd_coff_auxesz (abfd)); @@ -759,6 +757,10 @@ _bfd_coff_final_link (abfd, info) o->flags |= SEC_RELOC; o->rel_filepos = rel_filepos; rel_filepos += o->reloc_count * relsz; + /* In PE COFF, if there are at least 0xffff relocations an + extra relocation will be written out to encode the count. */ + if (obj_pe (abfd) && o->reloc_count >= 0xffff) + rel_filepos += relsz; } if (bfd_coff_long_section_names (abfd) diff --git a/bfd/config.bfd b/bfd/config.bfd index bba8d96..0db3748 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -125,8 +125,13 @@ case "${targ}" in ;; arm-*-netbsd* | arm-*-openbsd*) targ_defvec=armnetbsd_vec + targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec" targ_underscore=yes ;; + arm-*-nto* | nto*arm*) + targ_defvec=bfd_elf32_littlearmqnx_vec + targ_selvecs=bfd_elf32_bigarmqnx_vec + ;; arm-*-riscix*) targ_defvec=riscix_vec ;; @@ -280,6 +285,10 @@ case "${targ}" in targ_defvec=bfd_elf32_fr30_vec ;; + frv-*-elf) + targ_defvec=bfd_elf32_frv_vec + ;; + h8300*-*-elf) targ_defvec=bfd_elf32_h8300_vec @@ -345,6 +354,10 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; + i[3456]86-*-nto-qnx*) + targ_defvec=bfd_elf32_i386qnx_vec + targ_selvecs=i386coff_vec + ;; i[3456]86-*-chorus*) targ_defvec=bfd_elf32_i386_vec ;; @@ -407,6 +420,7 @@ case "${targ}" in i[3456]86-*-linux-gnu*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" + targ64_selvecs=bfd_elf64_x86_64_vec ;; #ifdef BFD64 x86_64-*-freebsd*) @@ -509,6 +523,10 @@ case "${targ}" in targ_selvecs="icoff_little_vec icoff_big_vec" ;; + ip2k-*-elf) + targ_defvec=bfd_elf32_ip2k_vec + ;; + m32r-*-*) targ_defvec=bfd_elf32_m32r_vec ;; @@ -731,21 +749,23 @@ case "${targ}" in ;; #ifdef BFD64 mips64*el-*-linux*) - targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" + targ_defvec=bfd_elf32_ntradlittlemips_vec + targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" ;; mips64*-*-linux*) - targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + targ_defvec=bfd_elf32_ntradbigmips_vec + targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" ;; #endif mips*el-*-linux*) targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec" + targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec" + want64=true ;; mips*-*-linux*) targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec" + want64=true ;; #ifdef BFD64 mmix-*-*) @@ -803,11 +823,13 @@ case "${targ}" in targ_selvecs="aix5coff64_vec" want64=true ;; +#ifdef BFD64 powerpc64-*-aix5*) targ_defvec=aix5coff64_vec targ_selvecs="rs6000coff_vec" want64=true ;; +#endif powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*) targ_defvec=rs6000coff_vec @@ -825,7 +847,8 @@ case "${targ}" in targ_defvec=rs6000coff64_vec targ_selvecs=rs6000coff_vec ;; - powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux*) + powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \ + powerpc64-*-*bsd*) targ_defvec=bfd_elf64_powerpc_vec targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" ;; @@ -848,6 +871,14 @@ case "${targ}" in targ_defvec=bfd_elf32_powerpc_vec targ_selvecs="nlm32_powerpc_vec rs6000coff_vec" ;; + powerpc-*-nto*) + targ_defvec=bfd_elf32_powerpcqnx_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcleqnx_vec ppcboot_vec" + ;; + powerpcle-*-nto*) + targ_defvec=bfd_elf32_powerpcleqnx_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcqnx_vec ppcboot_vec" + ;; powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ powerpcle-*-rtems*) @@ -871,6 +902,11 @@ case "${targ}" in #endif #ifdef BFD64 + sh64l*-*-elf*) + targ_defvec=bfd_elf32_sh64l_vec + targ_selvecs="bfd_elf32_sh64_vec bfd_elf64_sh64l_vec bfd_elf64_sh64_vec bfd_elf32_shl_vec bfd_elf32_sh_vec" + targ_underscore=yes + ;; sh64-*-elf*) targ_defvec=bfd_elf32_sh64_vec targ_selvecs="bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec bfd_elf32_sh_vec bfd_elf32_shl_vec" @@ -900,6 +936,26 @@ case "${targ}" in targ_defvec=bfd_elf32_shlin_vec ;; +#ifdef BFD64 + sh5le-*-netbsd*) + targ_defvec=bfd_elf32_sh64lnbsd_vec + targ_selvecs="bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" + ;; + sh5-*-netbsd*) + targ_defvec=bfd_elf32_sh64nbsd_vec + targ_selvecs="bfd_elf32_sh64lnbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" + ;; + + sh64le-*-netbsd*) + targ_defvec=bfd_elf64_sh64lnbsd_vec + targ_selvecs="bfd_elf64_sh64nbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec" + ;; + sh64-*-netbsd*) + targ_defvec=bfd_elf64_sh64nbsd_vec + targ_selvecs="bfd_elf64_sh64lnbsd_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec" + ;; +#endif + shle-*-netbsdelf*) targ_defvec=bfd_elf32_shlnbsd_vec targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" @@ -923,7 +979,15 @@ case "${targ}" in targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" ;; - sh-*-elf* | sh-*-rtemself*) + shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf*) + targ_defvec=bfd_elf32_shl_vec + targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec" +#ifdef BFD64 + targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" +#endif + targ_underscore=yes + ;; + sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself*) targ_defvec=bfd_elf32_sh_vec targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" #ifdef BFD64 @@ -931,6 +995,11 @@ case "${targ}" in #endif targ_underscore=yes ;; + sh-*-nto*) + targ_defvec=bfd_elf32_shqnx_vec + targ_selvecs="bfd_elf32_shlqnx_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" + targ_underscore=yes + ;; sh-*-pe) targ_defvec=shlpe_vec targ_selvecs="shlpe_vec shlpei_vec" @@ -1053,12 +1122,22 @@ case "${targ}" in v850ea-*-*) targ_defvec=bfd_elf32_v850_vec ;; -#if HAVE_host_aout_vec + + vax-*-netbsdelf*) + targ_defvec=bfd_elf32_vax_vec + targ_selvecs="vaxnetbsd_vec vax1knetbsd_vec" + ;; + + vax-*-netbsdaout* | vax-*-netbsd*) + targ_defvec=vaxnetbsd_vec + targ_selvecs="bfd_elf32_vax_vec vax1knetbsd_vec" + targ_underscore=yes + ;; + vax-*-bsd* | vax-*-ultrix*) - targ_defvec=host_aout_vec + targ_defvec=vaxbsd_vec targ_underscore=yes ;; -#endif vax*-*-*vms*) targ_defvec=vms_vax_vec @@ -1118,7 +1197,7 @@ esac # to be used on an arbitrary ELF file for anything other than # relocation information. case "${targ_defvec} ${targ_selvecs}" in - *bfd_elf64*) + *bfd_elf64* | *bfd_elf32_n*mips*) targ_selvecs="${targ_selvecs} bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec" ;; *bfd_elf32*) diff --git a/bfd/configure b/bfd/configure index 5345211..cd03dd3 100755 --- a/bfd/configure +++ b/bfd/configure @@ -1118,7 +1118,7 @@ fi PACKAGE=bfd -VERSION=2.12.90 +VERSION=2.13.90 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -5265,6 +5265,7 @@ rm -f conftest* COREFILE=trad-core.lo TRAD_HEADER='"hosts/tahoe.h"' ;; + vax-*-netbsd*) COREFILE=netbsd-core.lo ;; vax-*-ultrix2*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' @@ -5300,17 +5301,17 @@ rm -f conftest* do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5304: checking for $ac_hdr" >&5 +echo "configure:5305: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5309 "configure" +#line 5310 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5338,12 +5339,12 @@ done if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5342: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5343: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5347 "configure" +#line 5348 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5352,7 +5353,7 @@ int main() { prstatus_t avar ; return 0; } EOF -if { (eval echo configure:5356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5374,12 +5375,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5378: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5379: checking for prstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5383 "configure" +#line 5384 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5388,7 +5389,7 @@ int main() { prstatus32_t avar ; return 0; } EOF -if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5410,12 +5411,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5414: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5415: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5419 "configure" +#line 5420 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5424,7 +5425,7 @@ int main() { prstatus_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -5446,12 +5447,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5450: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5451: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5455 "configure" +#line 5456 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5460,7 +5461,7 @@ int main() { prstatus32_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:5464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else @@ -5482,12 +5483,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5486: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5487: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5491 "configure" +#line 5492 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5496,7 +5497,7 @@ int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:5500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5518,12 +5519,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5522: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5523: checking for pxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5527 "configure" +#line 5528 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5532,7 +5533,7 @@ int main() { pxstatus_t avar ; return 0; } EOF -if { (eval echo configure:5536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5554,12 +5555,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6 echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5558: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5559: checking for pstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5563 "configure" +#line 5564 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5568,7 +5569,7 @@ int main() { pstatus32_t avar ; return 0; } EOF -if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5590,12 +5591,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5594: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5595: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5599 "configure" +#line 5600 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5604,7 +5605,7 @@ int main() { prpsinfo_t avar ; return 0; } EOF -if { (eval echo configure:5608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5626,12 +5627,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5630: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5631: checking for prpsinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5635 "configure" +#line 5636 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5640,7 +5641,7 @@ int main() { prpsinfo32_t avar ; return 0; } EOF -if { (eval echo configure:5644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5662,12 +5663,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5666: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5667: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5671 "configure" +#line 5672 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5676,7 +5677,7 @@ int main() { psinfo_t avar ; return 0; } EOF -if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5698,12 +5699,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5702: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5703: checking for psinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5707 "configure" +#line 5708 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5712,7 +5713,7 @@ int main() { psinfo32_t avar ; return 0; } EOF -if { (eval echo configure:5716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5734,12 +5735,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5738: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5739: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5743 "configure" +#line 5744 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5748,7 +5749,7 @@ int main() { lwpstatus_t avar ; return 0; } EOF -if { (eval echo configure:5752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5770,12 +5771,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5774: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5775: checking for lwpxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5779 "configure" +#line 5780 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5784,7 +5785,7 @@ int main() { lwpxstatus_t avar ; return 0; } EOF -if { (eval echo configure:5788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5806,12 +5807,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5810: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5811: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5815 "configure" +#line 5816 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5820,7 +5821,7 @@ int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_context ; return 0; } EOF -if { (eval echo configure:5824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -5842,12 +5843,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5846: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5847: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5851 "configure" +#line 5852 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5856,7 +5857,7 @@ int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_reg ; return 0; } EOF -if { (eval echo configure:5860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -5878,12 +5879,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5882: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5883: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5887 "configure" +#line 5888 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -5892,7 +5893,7 @@ int main() { win32_pstatus_t avar ; return 0; } EOF -if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -6035,6 +6036,7 @@ do # use one entry per line, even though this leads to long lines. a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;; a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;; + aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;; aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;; aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;; @@ -6061,26 +6063,31 @@ do bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; + bfd_elf32_bigarmqnx_vec) tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_dlx_big_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; + bfd_elf32_frv_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; + bfd_elf32_i386qnx_vec) tb="$tb elf32-i386qnx.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";; + bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; + bfd_elf32_littlearmqnx_vec) tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; @@ -6091,31 +6098,40 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf32_powerpcleqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf32_powerpcqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; + # FIXME: We include cofflink.lo not because it's needed for + # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec + # which needs it but does not list it. Should be fixed in right place. + bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - # FIXME: We include cofflink.lo not because it's needed for - # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec - # which needs it but does not list it. Should be fixed in right place. - bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf32_shqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; + bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; @@ -6133,6 +6149,10 @@ do bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; @@ -6142,8 +6162,6 @@ do bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - cisco_core_big_vec) tb="$tb cisco-core.lo" ;; - cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;; ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; @@ -6185,6 +6203,7 @@ do m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;; m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; m88kbcs_vec) tb="$tb coff-m88k.lo" ;; + m88kmach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; @@ -6204,7 +6223,6 @@ do ppcboot_vec) tb="$tb ppcboot.lo" ;; riscix_vec) tb="$tb aout32.lo riscix.lo" ;; rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; - aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; @@ -6219,10 +6237,7 @@ do sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;; sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;; sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; - srec_vec) tb="$tb srec.lo" ;; sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;; - symbolsrec_vec) tb="$tb srec.lo" ;; - tekhex_vec) tb="$tb tekhex.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; @@ -6232,6 +6247,9 @@ do tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; + vaxnetbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;; + vax1knetbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;; + vaxbsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;; versados_vec) tb="$tb versados.lo" ;; vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;; vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;; @@ -6239,6 +6257,13 @@ do we32kcoff_vec) tb="$tb coff-we32k.lo" ;; z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;; + # These appear out of order in targets.c + srec_vec) tb="$tb srec.lo" ;; + symbolsrec_vec) tb="$tb srec.lo" ;; + tekhex_vec) tb="$tb tekhex.lo" ;; + cisco_core_big_vec) tb="$tb cisco-core.lo" ;; + cisco_core_little_vec) tb="$tb cisco-core.lo" ;; + "") ;; *) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;; esac @@ -6307,10 +6332,10 @@ case ${host64}-${target64}-${want64} in if test -n "$GCC" ; then bad_64bit_gcc=no; echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6 -echo "configure:6311: checking for gcc version with buggy 64-bit support" >&5 +echo "configure:6336: checking for gcc version with buggy 64-bit support" >&5 # Add more tests for gcc versions with non-working 64-bit support here. cat > conftest.$ac_ext <<EOF -#line 6314 "configure" +#line 6339 "configure" #include "confdefs.h" :__GNUC__:__GNUC_MINOR__:__i386__: EOF @@ -6355,17 +6380,17 @@ for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6359: checking for $ac_hdr" >&5 +echo "configure:6384: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6364 "configure" +#line 6389 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6394,12 +6419,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6398: checking for $ac_func" >&5 +echo "configure:6423: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6403 "configure" +#line 6428 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6422,7 +6447,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6447,7 +6472,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6451: checking for working mmap" >&5 +echo "configure:6476: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6455,7 +6480,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 6459 "configure" +#line 6484 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -6608,7 +6633,7 @@ main() } EOF -if { (eval echo configure:6612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6633,12 +6658,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6637: checking for $ac_func" >&5 +echo "configure:6662: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6642 "configure" +#line 6667 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6661,7 +6686,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/bfd/configure.in b/bfd/configure.in index 340da09..2f59095 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -7,7 +7,7 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.12.90) +AM_INIT_AUTOMAKE(bfd, 2.13.90) # Uncomment the next line to remove the date from the reported bfd version #is_release=y @@ -365,6 +365,7 @@ changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/tahoe.h"' ;; + vax-*-netbsd*) COREFILE=netbsd-core.lo ;; vax-*-ultrix2*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' @@ -536,6 +537,7 @@ do # use one entry per line, even though this leads to long lines. a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;; a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;; + aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;; aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;; aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;; @@ -562,26 +564,31 @@ do bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; + bfd_elf32_bigarmqnx_vec) tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_dlx_big_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; + bfd_elf32_frv_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; + bfd_elf32_i386qnx_vec) tb="$tb elf32-i386qnx.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";; + bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; + bfd_elf32_littlearmqnx_vec) tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; @@ -592,31 +599,40 @@ do bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf32_powerpcleqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf32_powerpcqnx_vec) tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; + # FIXME: We include cofflink.lo not because it's needed for + # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec + # which needs it but does not list it. Should be fixed in right place. + bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - # FIXME: We include cofflink.lo not because it's needed for - # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec - # which needs it but does not list it. Should be fixed in right place. - bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf32_shqnx_vec) tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; + bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; @@ -634,6 +650,10 @@ do bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; @@ -643,8 +663,6 @@ do bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - cisco_core_big_vec) tb="$tb cisco-core.lo" ;; - cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; demo_64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;; ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; @@ -686,6 +704,7 @@ do m68knetbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;; m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; m88kbcs_vec) tb="$tb coff-m88k.lo" ;; + m88kmach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; @@ -705,7 +724,6 @@ do ppcboot_vec) tb="$tb ppcboot.lo" ;; riscix_vec) tb="$tb aout32.lo riscix.lo" ;; rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; - aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; @@ -720,10 +738,7 @@ do sparclynx_aout_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;; sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;; sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; - srec_vec) tb="$tb srec.lo" ;; sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;; - symbolsrec_vec) tb="$tb srec.lo" ;; - tekhex_vec) tb="$tb tekhex.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; @@ -733,6 +748,9 @@ do tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; + vaxnetbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;; + vax1knetbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;; + vaxbsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;; versados_vec) tb="$tb versados.lo" ;; vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"; target_size=64 ;; vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;; @@ -740,6 +758,13 @@ do we32kcoff_vec) tb="$tb coff-we32k.lo" ;; z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;; + # These appear out of order in targets.c + srec_vec) tb="$tb srec.lo" ;; + symbolsrec_vec) tb="$tb srec.lo" ;; + tekhex_vec) tb="$tb tekhex.lo" ;; + cisco_core_big_vec) tb="$tb cisco-core.lo" ;; + cisco_core_little_vec) tb="$tb cisco-core.lo" ;; + "") ;; *) AC_MSG_ERROR(*** unknown target vector $vec) ;; esac diff --git a/bfd/corefile.c b/bfd/corefile.c index 609c4e6..2414225 100644 --- a/bfd/corefile.c +++ b/bfd/corefile.c @@ -1,5 +1,5 @@ /* Core file generic interface routines for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -44,7 +44,7 @@ DESCRIPTION */ -CONST char * +const char * bfd_core_file_failing_command (abfd) bfd *abfd; { diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c index 07beae5..10ca3fd 100644 --- a/bfd/cpu-h8300.c +++ b/bfd/cpu-h8300.c @@ -97,23 +97,20 @@ compatible (in, out) return in; } -static const bfd_arch_info_type h8300_info_struct = +static const bfd_arch_info_type h8300s_info_struct = { - 16, /* 16 bits in a word */ - 16, /* 16 bits in an address */ + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_h8300, - bfd_mach_h8300, - "h8300", /* arch_name */ - "h8300", /* printable name */ + bfd_mach_h8300s, + "h8300s", /* arch_name */ + "h8300s", /* printable name */ 1, - true, /* the default machine */ + false, /* the default machine */ compatible, h8300_scan, -#if 0 - local_bfd_reloc_type_lookup, -#endif - 0, + 0 }; static const bfd_arch_info_type h8300h_info_struct = @@ -129,27 +126,21 @@ static const bfd_arch_info_type h8300h_info_struct = false, /* the default machine */ compatible, h8300_scan, -#if 0 - local_bfd_reloc_type_lookup, -#endif - &h8300_info_struct, + &h8300s_info_struct }; const bfd_arch_info_type bfd_h8300_arch = { - 32, /* 32 bits in a word */ - 32, /* 32 bits in an address */ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_h8300, - bfd_mach_h8300s, - "h8300s", /* arch_name */ - "h8300s", /* printable name */ + bfd_mach_h8300, + "h8300", /* arch_name */ + "h8300", /* printable name */ 1, - false, /* the default machine */ + true, /* the default machine */ compatible, h8300_scan, -#if 0 - local_bfd_reloc_type_lookup, -#endif - &h8300h_info_struct, + &h8300h_info_struct }; diff --git a/bfd/cpu-ip2k.c b/bfd/cpu-ip2k.c new file mode 100644 index 0000000..6afb7fe --- /dev/null +++ b/bfd/cpu-ip2k.c @@ -0,0 +1,54 @@ +/* BFD support for the Scenix IP2xxx processor. + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_ip2k_nonext_arch = +{ + 32, /* Bits per word - not really true. */ + 16, /* Bits per address. */ + 8, /* Bits per byte. */ + bfd_arch_ip2k, /* Architecture. */ + bfd_mach_ip2022, /* Machine. */ + "ip2k", /* Architecture name. */ + "ip2022", /* Machine name. */ + 1, /* Section align power. */ + false, /* The default ? */ + bfd_default_compatible, /* Architecture comparison fn. */ + bfd_default_scan, /* String to architecture convert fn. */ + NULL /* Next in list. */ +}; + +const bfd_arch_info_type bfd_ip2k_arch = +{ + 32, /* Bits per word - not really true. */ + 16, /* Bits per address. */ + 8, /* Bits per byte. */ + bfd_arch_ip2k, /* Architecture. */ + bfd_mach_ip2022ext, /* Machine. */ + "ip2k", /* Architecture name. */ + "ip2022ext", /* Machine name. */ + 1, /* Section align power. */ + true, /* The default ? */ + bfd_default_compatible, /* Architecture comparison fn. */ + bfd_default_scan, /* String to architecture convert fn. */ + & bfd_ip2k_nonext_arch /* Next in list. */ +}; diff --git a/bfd/cpu-ns32k.c b/bfd/cpu-ns32k.c index 2cfa26f..acc081a 100644 --- a/bfd/cpu-ns32k.c +++ b/bfd/cpu-ns32k.c @@ -1,24 +1,24 @@ /* BFD support for the ns32k architecture. - Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001 + Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. Almost totally rewritten by Ian Dall from initial work by Andrew Cagney. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static const bfd_arch_info_type arch_info_struct[] = { - N(32532,"ns32k:32532",true, 0), /* the word ns32k will match this too */ + N(32532,"ns32k:32532",true, 0), /* The word ns32k will match this too. */ }; const bfd_arch_info_type bfd_ns32k_arch = @@ -40,7 +40,7 @@ static bfd_reloc_status_type do_ns32k_reloc PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, bfd *, char **, bfd_vma (*) (bfd_byte *, int), - int (*) (bfd_vma, bfd_byte *, int))); + void (*) (bfd_vma, bfd_byte *, int))); bfd_vma _bfd_ns32k_get_displacement (buffer, size) @@ -48,6 +48,7 @@ _bfd_ns32k_get_displacement (buffer, size) int size; { bfd_signed_vma value; + switch (size) { case 1: @@ -70,10 +71,11 @@ _bfd_ns32k_get_displacement (buffer, size) abort (); return 0; } + return value; } -int +void _bfd_ns32k_put_displacement (value, buffer, size) bfd_vma value; bfd_byte *buffer; @@ -82,15 +84,11 @@ _bfd_ns32k_put_displacement (value, buffer, size) switch (size) { case 1: - if (value + 0x40 > 0x7f) - return -1; value &= 0x7f; *buffer++ = value; break; case 2: - if (value + 0x2000 > 0x3fff) - return -1; value &= 0x3fff; value |= 0x8000; *buffer++ = (value >> 8); @@ -98,19 +96,14 @@ _bfd_ns32k_put_displacement (value, buffer, size) break; case 4: - /* FIXME: is this correct? -0x1f000000 <= value < 0x2000000 */ - if (value + 0x1f000000 > 0x3effffff) - return -1; value |= (bfd_vma) 0xc0000000; *buffer++ = (value >> 24); *buffer++ = (value >> 16); *buffer++ = (value >> 8); *buffer++ = value; break; - default: - return -1; } - return 0; + return; } bfd_vma @@ -119,13 +112,9 @@ _bfd_ns32k_get_immediate (buffer, size) int size; { bfd_vma value = 0; + switch (size) { - case 8: - value = (value << 8) | (*buffer++ & 0xff); - value = (value << 8) | (*buffer++ & 0xff); - value = (value << 8) | (*buffer++ & 0xff); - value = (value << 8) | (*buffer++ & 0xff); case 4: value = (value << 8) | (*buffer++ & 0xff); value = (value << 8) | (*buffer++ & 0xff); @@ -133,11 +122,14 @@ _bfd_ns32k_get_immediate (buffer, size) value = (value << 8) | (*buffer++ & 0xff); case 1: value = (value << 8) | (*buffer++ & 0xff); + break; + default: + abort (); } return value; } -int +void _bfd_ns32k_put_immediate (value, buffer, size) bfd_vma value; bfd_byte *buffer; @@ -146,11 +138,6 @@ _bfd_ns32k_put_immediate (value, buffer, size) buffer += size - 1; switch (size) { - case 8: - *buffer-- = (value & 0xff); value >>= 8; - *buffer-- = (value & 0xff); value >>= 8; - *buffer-- = (value & 0xff); value >>= 8; - *buffer-- = (value & 0xff); value >>= 8; case 4: *buffer-- = (value & 0xff); value >>= 8; *buffer-- = (value & 0xff); value >>= 8; @@ -159,14 +146,13 @@ _bfd_ns32k_put_immediate (value, buffer, size) case 1: *buffer-- = (value & 0xff); value >>= 8; } - return 0; } /* This is just like the standard perform_relocation except we - * use get_data and put_data which know about the ns32k - * storage methods. - * This is probably a lot more complicated than it needs to be! - */ + use get_data and put_data which know about the ns32k storage + methods. This is probably a lot more complicated than it + needs to be! */ + static bfd_reloc_status_type do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message, get_data, put_data) @@ -178,7 +164,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; bfd_vma (*get_data) PARAMS ((bfd_byte *, int)); - int (*put_data) PARAMS ((bfd_vma, bfd_byte *, int)); + void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int)); { int overflow = 0; bfd_vma relocation; @@ -220,7 +206,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd && howto->partial_inplace == false) + if (output_bfd != NULL && ! howto->partial_inplace) output_base = 0; else output_base = reloc_target_output_section->vma; @@ -233,7 +219,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ - if (howto->pc_relative == true) + if (howto->pc_relative) { /* This is a PC relative relocation. We want to set RELOCATION to the distance between the address of the symbol and the @@ -262,17 +248,16 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, producing relocateable output it is not what the code actually does. I don't want to change it, because it seems far too likely that something will break. */ - relocation -= input_section->output_section->vma + input_section->output_offset; - if (howto->pcrel_offset == true) + if (howto->pcrel_offset) relocation -= reloc_entry->address; } if (output_bfd != (bfd *) NULL) { - if (howto->partial_inplace == false) + if (! howto->partial_inplace) { /* This is a partial relocation, and we want to apply the relocation to the reloc entry rather than the raw data. Modify the reloc @@ -299,71 +284,76 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, relocation with -r. Removing the line below this comment fixes that problem; see PR 2953. -However, Ian wrote the following, regarding removing the line below, -which explains why it is still enabled: --djm - -If you put a patch like that into BFD you need to check all the COFF -linkers. I am fairly certain that patch will break coff-i386 (e.g., -SCO); see coff_i386_reloc in coff-i386.c where I worked around the -problem in a different way. There may very well be a reason that the -code works as it does. - -Hmmm. The first obvious point is that bfd_perform_relocation should -not have any tests that depend upon the flavour. It's seem like -entirely the wrong place for such a thing. The second obvious point -is that the current code ignores the reloc addend when producing -relocateable output for COFF. That's peculiar. In fact, I really -have no idea what the point of the line you want to remove is. - -A typical COFF reloc subtracts the old value of the symbol and adds in -the new value to the location in the object file (if it's a pc -relative reloc it adds the difference between the symbol value and the -location). When relocating we need to preserve that property. - -BFD handles this by setting the addend to the negative of the old -value of the symbol. Unfortunately it handles common symbols in a -non-standard way (it doesn't subtract the old value) but that's a -different story (we can't change it without losing backward -compatibility with old object files) (coff-i386 does subtract the old -value, to be compatible with existing coff-i386 targets, like SCO). - -So everything works fine when not producing relocateable output. When -we are producing relocateable output, logically we should do exactly -what we do when not producing relocateable output. Therefore, your -patch is correct. In fact, it should probably always just set -reloc_entry->addend to 0 for all cases, since it is, in fact, going to -add the value into the object file. This won't hurt the COFF code, -which doesn't use the addend; I'm not sure what it will do to other -formats (the thing to check for would be whether any formats both use -the addend and set partial_inplace). - -When I wanted to make coff-i386 produce relocateable output, I ran -into the problem that you are running into: I wanted to remove that -line. Rather than risk it, I made the coff-i386 relocs use a special -function; it's coff_i386_reloc in coff-i386.c. The function -specifically adds the addend field into the object file, knowing that -bfd_perform_relocation is not going to. If you remove that line, then -coff-i386.c will wind up adding the addend field in twice. It's -trivial to fix; it just needs to be done. - -The problem with removing the line is just that it may break some -working code. With BFD it's hard to be sure of anything. The right -way to deal with this is simply to build and test at least all the -supported COFF targets. It should be straightforward if time and disk -space consuming. For each target: - 1) build the linker - 2) generate some executable, and link it using -r (I would - probably use paranoia.o and link against newlib/libc.a, which - for all the supported targets would be available in - /usr/cygnus/progressive/H-host/target/lib/libc.a). - 3) make the change to reloc.c - 4) rebuild the linker - 5) repeat step 2 - 6) if the resulting object files are the same, you have at least - made it no worse - 7) if they are different you have to figure out which version is - right -*/ + However, Ian wrote the following, regarding removing the line + below, which explains why it is still enabled: --djm + + If you put a patch like that into BFD you need to check all + the COFF linkers. I am fairly certain that patch will break + coff-i386 (e.g., SCO); see coff_i386_reloc in coff-i386.c + where I worked around the problem in a different way. There + may very well be a reason that the code works as it does. + + Hmmm. The first obvious point is that bfd_perform_relocation + should not have any tests that depend upon the flavour. It's + seem like entirely the wrong place for such a thing. The + second obvious point is that the current code ignores the + reloc addend when producing relocateable output for COFF. + That's peculiar. In fact, I really have no idea what the + point of the line you want to remove is. + + A typical COFF reloc subtracts the old value of the symbol + and adds in the new value to the location in the object file + (if it's a pc relative reloc it adds the difference between + the symbol value and the location). When relocating we need + to preserve that property. + + BFD handles this by setting the addend to the negative of the + old value of the symbol. Unfortunately it handles common + symbols in a non-standard way (it doesn't subtract the old + value) but that's a different story (we can't change it + without losing backward compatibility with old object files) + (coff-i386 does subtract the old value, to be compatible with + existing coff-i386 targets, like SCO). + + So everything works fine when not producing relocateable + output. When we are producing relocateable output, logically + we should do exactly what we do when not producing + relocateable output. Therefore, your patch is correct. In + fact, it should probably always just set reloc_entry->addend + to 0 for all cases, since it is, in fact, going to add the + value into the object file. This won't hurt the COFF code, + which doesn't use the addend; I'm not sure what it will do + to other formats (the thing to check for would be whether + any formats both use the addend and set partial_inplace). + + When I wanted to make coff-i386 produce relocateable output, + I ran into the problem that you are running into: I wanted + to remove that line. Rather than risk it, I made the + coff-i386 relocs use a special function; it's coff_i386_reloc + in coff-i386.c. The function specifically adds the addend + field into the object file, knowing that bfd_perform_relocation + is not going to. If you remove that line, then coff-i386.c + will wind up adding the addend field in twice. It's trivial + to fix; it just needs to be done. + + The problem with removing the line is just that it may break + some working code. With BFD it's hard to be sure of anything. + The right way to deal with this is simply to build and test at + least all the supported COFF targets. It should be + straightforward if time and disk space consuming. For each + target: + 1) build the linker + 2) generate some executable, and link it using -r (I would + probably use paranoia.o and link against newlib/libc.a, + which for all the supported targets would be available in + /usr/cygnus/progressive/H-host/target/lib/libc.a). + 3) make the change to reloc.c + 4) rebuild the linker + 5) repeat step 2 + 6) if the resulting object files are the same, you have at + least made it no worse + 7) if they are different you have to figure out which + version is right. */ relocation -= reloc_entry->addend; #endif reloc_entry->addend = 0; @@ -462,11 +452,9 @@ space consuming. For each target: } } - /* - Either we are relocating all the way, or we don't want to apply - the relocation to the reloc entry (probably because there isn't - any room in the output format to describe addends to relocs) - */ + /* Either we are relocating all the way, or we don't want to apply + the relocation to the reloc entry (probably because there isn't + any room in the output format to describe addends to relocs). */ /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler (OSF version 1.3, compiler version 3.11). It miscompiles the @@ -493,11 +481,10 @@ space consuming. For each target: relocation >>= (bfd_vma) howto->rightshift; - /* Shift everything up to where it's going to be used */ - + /* Shift everything up to where it's going to be used. */ relocation <<= (bfd_vma) howto->bitpos; - /* Wait for the day when all have the mask in them */ + /* Wait for the day when all have the mask in them. */ /* What we do: i instruction to be left alone @@ -527,8 +514,7 @@ space consuming. For each target: B B B B B or A A A A A ----------------------- - R R R R R R R R R R put into bfd_put<size> - */ + R R R R R R R R R R put into bfd_put<size>. */ #define DOIT(x) \ x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask)) @@ -538,39 +524,39 @@ space consuming. For each target: { case 0: { - char x = get_data (location, 1); + bfd_vma x = get_data (location, 1); DOIT (x); - overflow = put_data ((bfd_vma) x, location, 1); + put_data ((bfd_vma) x, location, 1); } break; case 1: if (relocation) { - short x = get_data (location, 2); + bfd_vma x = get_data (location, 2); DOIT (x); - overflow = put_data ((bfd_vma) x, location, 2); + put_data ((bfd_vma) x, location, 2); } break; case 2: if (relocation) { - long x = get_data (location, 4); + bfd_vma x = get_data (location, 4); DOIT (x); - overflow = put_data ((bfd_vma) x, location, 4); + put_data ((bfd_vma) x, location, 4); } break; case -2: { - long x = get_data (location, 4); + bfd_vma x = get_data (location, 4); relocation = -relocation; DOIT(x); - overflow = put_data ((bfd_vma) x, location, 4); + put_data ((bfd_vma) x, location, 4); } break; case 3: - /* Do nothing */ + /* Do nothing. */ break; case 4: @@ -579,7 +565,7 @@ space consuming. For each target: { bfd_vma x = get_data (location, 8); DOIT (x); - overflow = put_data (x, location, 8); + put_data (x, location, 8); } #else abort (); @@ -604,7 +590,7 @@ _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location, bfd_vma relocation; bfd_byte *location; bfd_vma (*get_data) PARAMS ((bfd_byte *, int)); - int (*put_data) PARAMS ((bfd_vma, bfd_byte *, int)); + void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int)); { int size; bfd_vma x; diff --git a/bfd/cpu-powerpc.c b/bfd/cpu-powerpc.c index d77b426..b282c60 100644 --- a/bfd/cpu-powerpc.c +++ b/bfd/cpu-powerpc.c @@ -50,7 +50,8 @@ powerpc_compatible (a,b) const bfd_arch_info_type bfd_powerpc_archs[] = { -#if BFD_DEFAULT_TARGET_SIZE == 64 /* default arch must come first. */ +#if BFD_DEFAULT_TARGET_SIZE == 64 + /* Default arch must come first. */ { 64, /* 64 bits in a word */ 64, /* 64 bits in an address */ @@ -65,6 +66,8 @@ const bfd_arch_info_type bfd_powerpc_archs[] = bfd_default_scan, &bfd_powerpc_archs[1] }, + /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch + being immediately after the 64 bit default. */ { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ @@ -80,6 +83,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = &bfd_powerpc_archs[2], }, #else + /* Default arch must come first. */ { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ @@ -94,6 +98,8 @@ const bfd_arch_info_type bfd_powerpc_archs[] = bfd_default_scan, &bfd_powerpc_archs[1], }, + /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch + being immediately after the 32 bit default. */ { 64, /* 64 bits in a word */ 64, /* 64 bits in an address */ @@ -264,6 +270,20 @@ const bfd_arch_info_type bfd_powerpc_archs[] = &bfd_powerpc_archs[13] }, { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_e500, + "powerpc", + "powerpc:e500", + 3, + false, + powerpc_compatible, + bfd_default_scan, + &bfd_powerpc_archs[14] + }, + { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index d141846..39c69c9 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,3 +1,28 @@ +2002-08-13 Alan Modra <amodra@bigpond.net.au> + + * header.sed: Strip tabs. + +2002-06-08 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am: Fix quote style in last change. + * Makefile.in: Regenerate. + +2002-06-07 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (libbfd.h): Don't use "echo -n". + (libcoff.h, bfd.h): Likewise. + * Makefile.in: Regenerate. + +2002-06-06 Lars Brinkhoff <lars@nocrew.org> + + * bfdint.texi: Change registry@sco.com to registry@caldera.com. + +2002-06-05 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (libbfd.h): Add "Extracted from.." comment. + (libcoff.h, bfd.h): Likewise. + * Makefile.in: Regenerate. + 2002-05-25 Alan Modra <amodra@bigpond.net.au> * chew.c: Use #include "" instead of <> for local header files. diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am index cbfd342..0787143 100644 --- a/bfd/doc/Makefile.am +++ b/bfd/doc/Makefile.am @@ -209,7 +209,9 @@ libbfd.h: $(LIBBFD_H_DEP) case $$file in \ *-in.h) cat $$file >> $@ ;; \ */header.sed) break ;; \ - *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ + -e 's,$$,. */,' >> $@ ; \ + ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ esac; \ done @@ -226,7 +228,9 @@ libcoff.h: $(LIBCOFF_H_DEP) case $$file in \ *-in.h) cat $$file >> $@ ;; \ */header.sed) break ;; \ - *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ + -e 's,$$,. */,' >> $@ ; \ + ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ esac; \ done @@ -255,7 +259,9 @@ bfd.h: $(BFD_H_DEP) case $$file in \ *-in.h) cat $$file >> $@ ;; \ */header.sed) break ;; \ - *) ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ + *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ + -e 's,$$,. */,' >> $@ ; \ + ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ esac; \ done echo "#ifdef __cplusplus" >> $@ diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index 0e46ceb..66a19d1 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -606,7 +606,9 @@ libbfd.h: $(LIBBFD_H_DEP) case $$file in \ *-in.h) cat $$file >> $@ ;; \ */header.sed) break ;; \ - *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ + -e 's,$$,. */,' >> $@ ; \ + ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ esac; \ done @@ -616,7 +618,9 @@ libcoff.h: $(LIBCOFF_H_DEP) case $$file in \ *-in.h) cat $$file >> $@ ;; \ */header.sed) break ;; \ - *) ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ + *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ + -e 's,$$,. */,' >> $@ ; \ + ./$(MKDOC) -i -f $(srcdir)/proto.str < $$file >> $@ ;; \ esac; \ done @@ -626,7 +630,9 @@ bfd.h: $(BFD_H_DEP) case $$file in \ *-in.h) cat $$file >> $@ ;; \ */header.sed) break ;; \ - *) ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ + *) echo $$file | sed -e 's,.*/,,' -e 's,^,/* Extracted from ,' \ + -e 's,$$,. */,' >> $@ ; \ + ./$(MKDOC) -f $(srcdir)/proto.str < $$file >> $@ ;; \ esac; \ done echo "#ifdef __cplusplus" >> $@ diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi index 76fd832..d2996dc 100644 --- a/bfd/doc/bfdint.texi +++ b/bfd/doc/bfdint.texi @@ -1545,9 +1545,9 @@ Define @samp{ELF_ARCH} to the BFD architecture (an element of the @item Define @samp{ELF_MACHINE_CODE} to the magic number which should appear in the @samp{e_machine} field of the ELF header. As of this writing, -these magic numbers are assigned by SCO; if you want to get a magic +these magic numbers are assigned by Caldera; if you want to get a magic number for a particular processor, try sending a note to -@email{registry@@sco.com}. In the BFD sources, the magic numbers are +@email{registry@@caldera.com}. In the BFD sources, the magic numbers are found in @file{include/elf/common.h}; they have names beginning with @samp{EM_}. @item diff --git a/bfd/doc/header.sed b/bfd/doc/header.sed index ed27040..c58dc60 100644 --- a/bfd/doc/header.sed +++ b/bfd/doc/header.sed @@ -1,3 +1,4 @@ +s|[ ][ ]*| |g s|\(.*\) [^ ]*header.sed.*|\1| s|[^ ]*/||g s|^ *|"| diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index e3b8e27..9c5e7b8 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -856,13 +856,18 @@ concat_filename (table, file) filename = table->files[file - 1].name; if (IS_ABSOLUTE_PATH(filename)) return filename; - else { char* dirname = (table->files[file - 1].dir ? table->dirs[table->files[file - 1].dir - 1] : table->comp_dir); - return (char*) concat (dirname, "/", filename, NULL); + + /* Not all tools set DW_AT_comp_dir, so dirname may be unknown. The + best we can do is return the filename part. */ + if (dirname == NULL) + return filename; + else + return (char*) concat (dirname, "/", filename, NULL); } } @@ -990,6 +995,13 @@ decode_line_info (unit, stash) line_ptr += 8; offset_size = 8; } + else if (lh.total_length == 0 && unit->addr_size == 8) + { + /* Handle (non-standard) 64-bit DWARF2 formats. */ + lh.total_length = read_4_bytes (abfd, line_ptr); + line_ptr += 4; + offset_size = 8; + } line_end = line_ptr + lh.total_length; lh.version = read_2_bytes (abfd, line_ptr); line_ptr += 2; diff --git a/bfd/ecoff.c b/bfd/ecoff.c index c7230f6..82baeeb 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -4,21 +4,21 @@ Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -46,29 +46,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Prototypes for static functions. */ -static int ecoff_get_magic PARAMS ((bfd *abfd)); -static long ecoff_sec_to_styp_flags PARAMS ((const char *name, - flagword flags)); -static boolean ecoff_slurp_symbolic_header PARAMS ((bfd *abfd)); -static boolean ecoff_set_symbol_info PARAMS ((bfd *abfd, SYMR *ecoff_sym, - asymbol *asym, int ext, int weak)); -static void ecoff_emit_aggregate PARAMS ((bfd *abfd, FDR *fdr, - char *string, - RNDXR *rndx, long isym, - const char *which)); -static char *ecoff_type_to_string PARAMS ((bfd *abfd, FDR *fdr, - unsigned int indx)); -static boolean ecoff_slurp_reloc_table PARAMS ((bfd *abfd, asection *section, - asymbol **symbols)); +static int ecoff_get_magic PARAMS ((bfd *)); +static long ecoff_sec_to_styp_flags PARAMS ((const char *, flagword)); +static boolean ecoff_slurp_symbolic_header PARAMS ((bfd *)); +static boolean ecoff_set_symbol_info PARAMS ((bfd *, SYMR *, asymbol *, int, int)); +static void ecoff_emit_aggregate PARAMS ((bfd *, FDR *, char *, RNDXR *, long, const char *)); +static char *ecoff_type_to_string PARAMS ((bfd *, FDR *, unsigned int)); +static boolean ecoff_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **)); static int ecoff_sort_hdrs PARAMS ((const PTR, const PTR)); -static boolean ecoff_compute_section_file_positions PARAMS ((bfd *abfd)); -static bfd_size_type ecoff_compute_reloc_file_positions PARAMS ((bfd *abfd)); +static boolean ecoff_compute_section_file_positions PARAMS ((bfd *)); +static bfd_size_type ecoff_compute_reloc_file_positions PARAMS ((bfd *)); static boolean ecoff_get_extr PARAMS ((asymbol *, EXTR *)); static void ecoff_set_index PARAMS ((asymbol *, bfd_size_type)); -static unsigned int ecoff_armap_hash PARAMS ((const char *s, - unsigned int *rehash, - unsigned int size, - unsigned int hlog)); +static unsigned int ecoff_armap_hash PARAMS ((const char *, unsigned int *, unsigned int, unsigned int)); /* This stuff is somewhat copied from coffcode.h. */ @@ -105,6 +95,7 @@ _bfd_ecoff_mkobject (abfd) bfd *abfd; { bfd_size_type amt = sizeof (ecoff_data_type); + abfd->tdata.ecoff_obj_data = (struct ecoff_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.ecoff_obj_data == NULL) return false; @@ -125,7 +116,7 @@ _bfd_ecoff_mkobject_hook (abfd, filehdr, aouthdr) struct internal_aouthdr *internal_a = (struct internal_aouthdr *) aouthdr; ecoff_data_type *ecoff; - if (_bfd_ecoff_mkobject (abfd) == false) + if (! _bfd_ecoff_mkobject (abfd)) return NULL; ecoff = ecoff_data (abfd); @@ -184,10 +175,8 @@ _bfd_ecoff_new_section_hook (abfd, section) || strcmp (section->name, _SBSS) == 0) section->flags |= SEC_ALLOC; else if (strcmp (section->name, _LIB) == 0) - { - /* An Irix 4 shared libary. */ - section->flags |= SEC_COFF_SHARED_LIBRARY; - } + /* An Irix 4 shared libary. */ + section->flags |= SEC_COFF_SHARED_LIBRARY; /* Probably any other section name is SEC_NEVER_LOAD, but I'm uncertain about .init on some systems and I don't know how shared @@ -221,14 +210,14 @@ _bfd_ecoff_set_arch_mach_hook (abfd, filehdr) case MIPS_MAGIC_LITTLE2: case MIPS_MAGIC_BIG2: - /* MIPS ISA level 2: the r6000 */ + /* MIPS ISA level 2: the r6000. */ arch = bfd_arch_mips; mach = 6000; break; case MIPS_MAGIC_LITTLE3: case MIPS_MAGIC_BIG3: - /* MIPS ISA level 3: the r4000 */ + /* MIPS ISA level 3: the r4000. */ arch = bfd_arch_mips; mach = 4000; break; @@ -553,7 +542,6 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) documented section. And the ordering of the sections varies between statically and dynamically linked executables. If bfd supports SEEK_END someday, this code could be simplified. */ - raw_end = 0; #define UPDATE_RAW_END(start, count, size) \ @@ -604,6 +592,7 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) debug->off2 = (type) ((char *) raw \ + (internal_symhdr->off1 \ - raw_base)) + FIX (cbLineOffset, line, unsigned char *); FIX (cbDnOffset, external_dnr, PTR); FIX (cbPdOffset, external_pdr, PTR); @@ -661,10 +650,9 @@ _bfd_ecoff_make_empty_symbol (abfd) ecoff_symbol_type *new; bfd_size_type amt = sizeof (ecoff_symbol_type); - new = (ecoff_symbol_type *) bfd_alloc (abfd, amt); + new = (ecoff_symbol_type *) bfd_zalloc (abfd, amt); if (new == (ecoff_symbol_type *) NULL) return (asymbol *) NULL; - memset ((PTR) new, 0, sizeof *new); new->symbol.section = (asection *) NULL; new->fdr = (FDR *) NULL; new->local = false; @@ -727,6 +715,10 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) || ECOFF_IS_STAB (ecoff_sym)) asym->flags |= BSF_DEBUGGING; } + + if (ecoff_sym->st == stProc || ecoff_sym->st == stStaticProc) + asym->flags |= BSF_FUNCTION; + switch (ecoff_sym->sc) { case scNil: @@ -1057,7 +1049,7 @@ _bfd_ecoff_get_symtab (abfd, alocation) ecoff_symbol_type *symbase; ecoff_symbol_type **location = (ecoff_symbol_type **) alocation; - if (_bfd_ecoff_slurp_symbol_table (abfd) == false) + if (! _bfd_ecoff_slurp_symbol_table (abfd)) return -1; if (bfd_get_symcount (abfd) == 0) return 0; @@ -1187,56 +1179,54 @@ ecoff_type_to_string (abfd, fdr, indx) qualifiers[5].type = u.ti.tq5; qualifiers[6].type = tqNil; - /* - * Go get the basic type. - */ + /* Go get the basic type. */ switch (basic_type) { - case btNil: /* undefined */ + case btNil: /* Undefined. */ strcpy (p1, "nil"); break; - case btAdr: /* address - integer same size as pointer */ + case btAdr: /* Address - integer same size as pointer. */ strcpy (p1, "address"); break; - case btChar: /* character */ + case btChar: /* Character. */ strcpy (p1, "char"); break; - case btUChar: /* unsigned character */ + case btUChar: /* Unsigned character. */ strcpy (p1, "unsigned char"); break; - case btShort: /* short */ + case btShort: /* Short. */ strcpy (p1, "short"); break; - case btUShort: /* unsigned short */ + case btUShort: /* Unsigned short. */ strcpy (p1, "unsigned short"); break; - case btInt: /* int */ + case btInt: /* Int. */ strcpy (p1, "int"); break; - case btUInt: /* unsigned int */ + case btUInt: /* Unsigned int. */ strcpy (p1, "unsigned int"); break; - case btLong: /* long */ + case btLong: /* Long. */ strcpy (p1, "long"); break; - case btULong: /* unsigned long */ + case btULong: /* Unsigned long. */ strcpy (p1, "unsigned long"); break; - case btFloat: /* float (real) */ + case btFloat: /* Float (real). */ strcpy (p1, "float"); break; - case btDouble: /* Double (real) */ + case btDouble: /* Double (real). */ strcpy (p1, "double"); break; @@ -1244,83 +1234,83 @@ ecoff_type_to_string (abfd, fdr, indx) 1st word is [ST_RFDESCAPE, offset] pointer to struct def; 2nd word is file index if 1st word rfd is ST_RFDESCAPE. */ - case btStruct: /* Structure (Record) */ + case btStruct: /* Structure (Record). */ _bfd_ecoff_swap_rndx_in (bigendian, &aux_ptr[indx].a_rndx, &rndx); ecoff_emit_aggregate (abfd, fdr, p1, &rndx, (long) AUX_GET_ISYM (bigendian, &aux_ptr[indx+1]), "struct"); - indx++; /* skip aux words */ + indx++; /* Skip aux words. */ break; /* Unions add 1-2 aux words: 1st word is [ST_RFDESCAPE, offset] pointer to union def; 2nd word is file index if 1st word rfd is ST_RFDESCAPE. */ - case btUnion: /* Union */ + case btUnion: /* Union. */ _bfd_ecoff_swap_rndx_in (bigendian, &aux_ptr[indx].a_rndx, &rndx); ecoff_emit_aggregate (abfd, fdr, p1, &rndx, (long) AUX_GET_ISYM (bigendian, &aux_ptr[indx+1]), "union"); - indx++; /* skip aux words */ + indx++; /* Skip aux words. */ break; /* Enumerations add 1-2 aux words: 1st word is [ST_RFDESCAPE, offset] pointer to enum def; 2nd word is file index if 1st word rfd is ST_RFDESCAPE. */ - case btEnum: /* Enumeration */ + case btEnum: /* Enumeration. */ _bfd_ecoff_swap_rndx_in (bigendian, &aux_ptr[indx].a_rndx, &rndx); ecoff_emit_aggregate (abfd, fdr, p1, &rndx, (long) AUX_GET_ISYM (bigendian, &aux_ptr[indx+1]), "enum"); - indx++; /* skip aux words */ + indx++; /* Skip aux words. */ break; - case btTypedef: /* defined via a typedef, isymRef points */ + case btTypedef: /* Defined via a typedef, isymRef points. */ strcpy (p1, "typedef"); break; - case btRange: /* subrange of int */ + case btRange: /* Subrange of int. */ strcpy (p1, "subrange"); break; - case btSet: /* pascal sets */ + case btSet: /* Pascal sets. */ strcpy (p1, "set"); break; - case btComplex: /* fortran complex */ + case btComplex: /* Fortran complex. */ strcpy (p1, "complex"); break; - case btDComplex: /* fortran double complex */ + case btDComplex: /* Fortran double complex. */ strcpy (p1, "double complex"); break; - case btIndirect: /* forward or unnamed typedef */ + case btIndirect: /* Forward or unnamed typedef. */ strcpy (p1, "forward/unamed typedef"); break; - case btFixedDec: /* Fixed Decimal */ + case btFixedDec: /* Fixed Decimal. */ strcpy (p1, "fixed decimal"); break; - case btFloatDec: /* Float Decimal */ + case btFloatDec: /* Float Decimal. */ strcpy (p1, "float decimal"); break; - case btString: /* Varying Length Character String */ + case btString: /* Varying Length Character String. */ strcpy (p1, "string"); break; - case btBit: /* Aligned Bit String */ + case btBit: /* Aligned Bit String. */ strcpy (p1, "bit"); break; - case btPicture: /* Picture */ + case btPicture: /* Picture. */ strcpy (p1, "picture"); break; - case btVoid: /* Void */ + case btVoid: /* Void. */ strcpy (p1, "void"); break; @@ -1331,9 +1321,7 @@ ecoff_type_to_string (abfd, fdr, indx) p1 += strlen (buffer1); - /* - * If this is a bitfield, get the bitsize. - */ + /* If this is a bitfield, get the bitsize. */ if (u.ti.fBitfield) { int bitsize; @@ -1343,20 +1331,16 @@ ecoff_type_to_string (abfd, fdr, indx) p1 += strlen (buffer1); } - /* - * Deal with any qualifiers. - */ + /* Deal with any qualifiers. */ if (qualifiers[0].type != tqNil) { - /* - * Snarf up any array bounds in the correct order. Arrays - * store 5 successive words in the aux. table: - * word 0 RNDXR to type of the bounds (ie, int) - * word 1 Current file descriptor index - * word 2 low bound - * word 3 high bound (or -1 if []) - * word 4 stride size in bits - */ + /* Snarf up any array bounds in the correct order. Arrays + store 5 successive words in the aux. table: + word 0 RNDXR to type of the bounds (ie, int) + word 1 Current file descriptor index + word 2 low bound + word 3 high bound (or -1 if []) + word 4 stride size in bits. */ for (i = 0; i < 7; i++) { if (qualifiers[i].type == tqArray) @@ -1371,9 +1355,7 @@ ecoff_type_to_string (abfd, fdr, indx) } } - /* - * Now print out the qualifiers. - */ + /* Now print out the qualifiers. */ for (i = 0; i < 6; i++) { switch (qualifiers[i].type) @@ -1409,7 +1391,6 @@ ecoff_type_to_string (abfd, fdr, indx) /* Print array bounds reversed (ie, in the order the C programmer writes them). C is such a fun language.... */ - while (i < 5 && qualifiers[i+1].type == tqArray) i++; @@ -1511,7 +1492,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) } break; case bfd_print_symbol_all: - /* Print out the symbols in a reasonable way */ + /* Print out the symbols in a reasonable way. */ { char type; int pos; @@ -1585,7 +1566,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) order is indicated by a bit in the fdr. */ bigendian = fdr->fBigendian; - /* This switch is basically from gcc/mips-tdump.c */ + /* This switch is basically from gcc/mips-tdump.c. */ switch (ecoff_ext.asym.st) { case stNil: @@ -1678,7 +1659,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols) || (section->flags & SEC_CONSTRUCTOR) != 0) return true; - if (_bfd_ecoff_slurp_symbol_table (abfd) == false) + if (! _bfd_ecoff_slurp_symbol_table (abfd)) return false; amt = section->reloc_count; @@ -1794,7 +1775,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) { arelent *tblptr; - if (ecoff_slurp_reloc_table (abfd, section, symbols) == false) + if (! ecoff_slurp_reloc_table (abfd, section, symbols)) return -1; tblptr = section->relocation; @@ -2181,7 +2162,7 @@ ecoff_compute_section_file_positions (abfd) if ((current->flags & SEC_HAS_CONTENTS) != 0) file_sofar += current->_raw_size; - /* make sure that this section is of the right size too */ + /* Make sure that this section is of the right size too. */ old_sofar = sofar; sofar = BFD_ALIGN (sofar, 1 << alignment_power); if ((current->flags & SEC_HAS_CONTENTS) != 0) @@ -2268,7 +2249,7 @@ _bfd_ecoff_set_section_contents (abfd, section, location, offset, count) /* This must be done first, because bfd_set_section_contents is going to set output_has_begun to true. */ - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { if (! ecoff_compute_section_file_positions (abfd)) return false; @@ -2363,7 +2344,7 @@ bfd_ecoff_set_regmasks (abfd, gprmask, fprmask, cprmask) tdata->fprmask = fprmask; if (cprmask != (unsigned long *) NULL) { - register int i; + int i; for (i = 0; i < 3; i++) tdata->cprmask[i] = cprmask[i]; @@ -2630,13 +2611,12 @@ _bfd_ecoff_write_object_contents (abfd) else if (section.s_flags == 0 || (section.s_flags & STYP_ECOFF_LIB) != 0 || section.s_flags == STYP_COMMENT) - /* Do nothing */ ; + /* Do nothing. */ ; else abort (); } /* Set up the file header. */ - internal_f.f_magic = ecoff_get_magic (abfd); /* We will NOT put a fucking timestamp in the header here. Every @@ -2729,7 +2709,6 @@ _bfd_ecoff_write_object_contents (abfd) } /* Write out the file header and the optional header. */ - if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) goto error_return; @@ -2751,11 +2730,9 @@ _bfd_ecoff_write_object_contents (abfd) symhdr->issExtMax = 0; debug->external_ext = debug->external_ext_end = NULL; debug->ssext = debug->ssext_end = NULL; - if (bfd_ecoff_debug_externals (abfd, debug, &backend->debug_swap, - (((abfd->flags & EXEC_P) == 0) - ? true : false), - ecoff_get_extr, ecoff_set_index) - == false) + if (! bfd_ecoff_debug_externals (abfd, debug, &backend->debug_swap, + (abfd->flags & EXEC_P) == 0, + ecoff_get_extr, ecoff_set_index)) goto error_return; /* Write out the relocs. */ @@ -2859,9 +2836,8 @@ _bfd_ecoff_write_object_contents (abfd) if (bfd_get_symcount (abfd) > 0) { /* Write out the debugging information. */ - if (bfd_ecoff_write_debug (abfd, debug, &backend->debug_swap, - ecoff_data (abfd)->sym_filepos) - == false) + if (! bfd_ecoff_write_debug (abfd, debug, &backend->debug_swap, + ecoff_data (abfd)->sym_filepos)) goto error_return; } } @@ -3060,7 +3036,6 @@ _bfd_ecoff_slurp_armap (abfd) /* This code used to overlay the symdefs over the raw archive data, but that doesn't work on a 64 bit host. */ - stringbase = raw_armap + count * 8 + 8; #ifdef CHECK_ARMAP_HASH @@ -3314,8 +3289,6 @@ _bfd_ecoff_archive_p (abfd) char armag[SARMAG + 1]; bfd_size_type amt; - tdata_hold = abfd->tdata.aout_ar_data; - if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG) { if (bfd_get_error () != bfd_error_system_call) @@ -3329,15 +3302,13 @@ _bfd_ecoff_archive_p (abfd) return NULL; } - /* We are setting bfd_ardata(abfd) here, but since bfd_ardata - involves a cast, we can't do it as the left operand of - assignment. */ - amt = sizeof (struct artdata); - abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); + tdata_hold = bfd_ardata (abfd); + amt = sizeof (struct artdata); + bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == (struct artdata *) NULL) { - abfd->tdata.aout_ar_data = tdata_hold; + bfd_ardata (abfd) = tdata_hold; return (const bfd_target *) NULL; } @@ -3348,11 +3319,11 @@ _bfd_ecoff_archive_p (abfd) bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->tdata = NULL; - if (_bfd_ecoff_slurp_armap (abfd) == false - || _bfd_ecoff_slurp_extended_name_table (abfd) == false) + if (! _bfd_ecoff_slurp_armap (abfd) + || ! _bfd_ecoff_slurp_extended_name_table (abfd)) { bfd_release (abfd, bfd_ardata (abfd)); - abfd->tdata.aout_ar_data = tdata_hold; + bfd_ardata (abfd) = tdata_hold; return (const bfd_target *) NULL; } @@ -3370,22 +3341,23 @@ _bfd_ecoff_archive_p (abfd) first = bfd_openr_next_archived_file (abfd, (bfd *) NULL); if (first != NULL) { - boolean fail; - first->target_defaulted = false; - fail = false; if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { +#if 0 + /* We ought to close `first' here, but we can't, because + we have no way to remove it from the archive cache. + It's close to impossible to figure out when we can + release bfd_ardata. FIXME. */ (void) bfd_close (first); bfd_release (abfd, bfd_ardata (abfd)); - abfd->tdata.aout_ar_data = tdata_hold; - bfd_set_error (bfd_error_wrong_format); +#endif + bfd_set_error (bfd_error_wrong_object_format); + bfd_ardata (abfd) = tdata_hold; return NULL; } - - /* We ought to close first here, but we can't, because we - have no way to remove it from the archive cache. FIXME. */ + /* And we ought to close `first' here too. */ } } diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c index 53d6544..5b854af 100644 --- a/bfd/ecofflink.c +++ b/bfd/ecofflink.c @@ -1,5 +1,5 @@ /* Routines to link ECOFF debugging information. - Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001 + Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>. @@ -1314,12 +1314,12 @@ bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, sym_ptr = *sym_ptr_ptr; /* Get the external symbol information. */ - if ((*get_extr) (sym_ptr, &esym) == false) + if (! (*get_extr) (sym_ptr, &esym)) continue; /* If we're producing an executable, move common symbols into bss. */ - if (relocateable == false) + if (! relocateable) { if (esym.asym.sc == scCommon) esym.asym.sc = scBss; @@ -1376,20 +1376,18 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) if ((size_t) (debug->ssext_end - debug->ssext) < symhdr->issExtMax + namelen + 1) { - if (ecoff_add_bytes ((char **) &debug->ssext, - (char **) &debug->ssext_end, - symhdr->issExtMax + namelen + 1) - == false) + if (! ecoff_add_bytes ((char **) &debug->ssext, + (char **) &debug->ssext_end, + symhdr->issExtMax + namelen + 1)) return false; } if ((size_t) ((char *) debug->external_ext_end - (char *) debug->external_ext) < (symhdr->iextMax + 1) * external_ext_size) { - if (ecoff_add_bytes ((char **) &debug->external_ext, - (char **) &debug->external_ext_end, - (symhdr->iextMax + 1) * (size_t) external_ext_size) - == false) + if (! ecoff_add_bytes ((char **) &debug->external_ext, + (char **) &debug->external_ext_end, + (symhdr->iextMax + 1) * (size_t) external_ext_size)) return false; } @@ -1650,11 +1648,10 @@ ecoff_write_shuffle (abfd, swap, shuffle, space) bfd_byte *s; i = swap->debug_align - (total & (swap->debug_align - 1)); - s = (bfd_byte *) bfd_malloc ((bfd_size_type) i); + s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i); if (s == NULL && i != 0) return false; - memset ((PTR) s, 0, i); if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) { free (s); @@ -1736,10 +1733,10 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) bfd_byte *s; i = swap->debug_align - (total & (swap->debug_align - 1)); - s = (bfd_byte *) bfd_malloc ((bfd_size_type) i); + s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i); if (s == NULL && i != 0) goto error_return; - memset ((PTR) s, 0, i); + if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) { free (s); @@ -1761,10 +1758,10 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) i = (swap->debug_align - (debug->symbolic_header.issExtMax & (swap->debug_align - 1))); - s = (bfd_byte *) bfd_malloc ((bfd_size_type) i); + s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i); if (s == NULL && i != 0) goto error_return; - memset ((PTR) s, 0, i); + if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) { free (s); diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index f2c8075..dcccc48 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -3,21 +3,21 @@ 2002 Free Software Foundation, Inc. Written by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LIBELF_H_ #define _LIBELF_H_ 1 @@ -223,6 +223,12 @@ struct elf_link_local_dynamic_entry Elf_Internal_Sym isym; }; +struct elf_link_loaded_list +{ + struct elf_link_loaded_list *next; + bfd *abfd; +}; + enum elf_link_info_type { ELF_INFO_TYPE_NONE, @@ -297,6 +303,9 @@ struct elf_link_hash_table /* Cached start, size and alignment of PT_TLS segment. */ struct elf_link_tls_segment *tls_segment; + + /* A linked list of BFD's loaded in the link. */ + struct elf_link_loaded_list *loaded; }; /* Look up an entry in an ELF linker hash table. */ @@ -353,6 +362,8 @@ struct elf_size_info { PARAMS ((bfd *)); void (*write_relocs) PARAMS ((bfd *, asection *, PTR)); + void (*swap_symbol_in) + PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); void (*swap_symbol_out) PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); boolean (*slurp_reloc_table) @@ -406,8 +417,7 @@ enum elf_reloc_type_class { struct elf_reloc_cookie { Elf_Internal_Rela *rels, *rel, *relend; - PTR locsyms; - PTR locsym_shndx; + Elf_Internal_Sym *locsyms; bfd *abfd; size_t locsymcount; size_t extsymoff; @@ -490,7 +500,7 @@ struct elf_backend_data /* A function to handle unusual section types when creating BFD sections from ELF sections. */ boolean (*elf_backend_section_from_shdr) - PARAMS ((bfd *, Elf32_Internal_Shdr *, char *)); + PARAMS ((bfd *, Elf32_Internal_Shdr *, const char *)); /* A function to convert machine dependent section header flags to BFD internal section header flags. */ @@ -669,10 +679,9 @@ struct elf_backend_data PARAMS ((bfd *)); /* This function is called during section gc to discover the section a - particular relocation refers to. It need not be defined for hosts - that have no queer relocation types. */ + particular relocation refers to. */ asection * (*gc_mark_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *h, Elf_Internal_Sym *)); /* This function, if defined, is called during the sweep phase of gc @@ -702,13 +711,14 @@ struct elf_backend_data PARAMS ((bfd *, struct bfd_link_info *, PTR, boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); - /* Copy any information related to dynamic linking from a pre-existing + /* Copy any information related to dynamic linking from a pre-existing symbol to a newly created symbol. Also called to copy flags and other back-end info to a weakdef, in which case the symbol is not newly created and plt/got refcounts and dynamic indices should not be copied. */ void (*elf_backend_copy_indirect_symbol) - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); /* Modify any information related to dynamic linking such that the symbol is not exported. */ @@ -760,6 +770,22 @@ struct elf_backend_data boolean (*elf_backend_write_section) PARAMS ((bfd *, asection *, bfd_byte *)); + /* This function, if defined, sets up the file positions for non PT_LOAD + segments, especially for segments containing non-allocated sections. */ + void (*set_nonloadable_filepos) + PARAMS ((bfd *, Elf_Internal_Phdr *)); + + /* This function, if defined, returns true if the section is contained + within the segment. File positions are compared. */ + boolean (*is_contained_by_filepos) + PARAMS ((asection *, Elf_Internal_Phdr *)); + + /* This function, if defined, returns true if copy_private_bfd_data + should be called. It provides a way of overriding default + test conditions in _bfd_elf_copy_private_section_data. */ + boolean (*copy_private_bfd_data_p) + PARAMS ((bfd *, asection *, bfd *, asection *)); + /* The level of IRIX compatibility we're striving for. MIPS ELF specific function. */ irix_compat_t (*elf_backend_mips_irix_compat) @@ -834,6 +860,10 @@ struct elf_backend_data unsigned can_refcount : 1; unsigned want_got_sym : 1; unsigned want_dynbss : 1; + /* Targets which do not support physical addressing often require + that the p_paddr field in the section header to be set to zero. + This field indicates whether this behavior is required. */ + unsigned want_p_paddr_set_to_zero : 1; }; /* Information stored for each BFD section in an ELF file. This @@ -898,8 +928,13 @@ struct bfd_elf_section_data /* Type of that information. */ enum elf_link_info_type sec_info_type; - /* Group name, if this section is part of a group. */ - const char *group_name; + union { + /* Group name, if this section is a member of a group. */ + const char *name; + + /* Group signature sym, if this is the SHT_GROUP section. */ + struct symbol_cache_entry *id; + } group; /* A linked list of sections in the group. Circular when used by the linker. */ @@ -910,11 +945,16 @@ struct bfd_elf_section_data /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; + + /* Nonzero when a group is COMDAT. */ + unsigned int linkonce_p:1; }; #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd) -#define elf_group_name(sec) (elf_section_data(sec)->group_name) +#define elf_group_name(sec) (elf_section_data(sec)->group.name) +#define elf_group_id(sec) (elf_section_data(sec)->group.id) #define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) +#define elf_linkonce_p(sec) (elf_section_data(sec)->linkonce_p) /* Return true if section has been discarded. */ #define elf_discarded_section(sec) \ @@ -1180,6 +1220,9 @@ extern char *bfd_elf_string_from_elf_section PARAMS ((bfd *, unsigned, unsigned)); extern char *bfd_elf_get_str_section PARAMS ((bfd *, unsigned)); +extern Elf_Internal_Sym *bfd_elf_get_elf_syms + PARAMS ((bfd *, Elf_Internal_Shdr *, size_t, size_t, + Elf_Internal_Sym *, PTR, Elf_External_Sym_Shndx *)); extern boolean _bfd_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *)); @@ -1229,7 +1272,8 @@ extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create PARAMS ((bfd *)); extern void _bfd_elf_link_hash_copy_indirect - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); extern void _bfd_elf_link_hash_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); extern boolean _bfd_elf_link_hash_table_init @@ -1241,6 +1285,10 @@ extern boolean _bfd_elf_slurp_version_tables PARAMS ((bfd *)); extern boolean _bfd_elf_merge_sections PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean bfd_elf_discard_group + PARAMS ((bfd *, struct sec *)); +extern void bfd_elf_set_group_contents + PARAMS ((bfd *, asection *, PTR)); extern void _bfd_elf_link_just_syms PARAMS ((asection *, struct bfd_link_info *)); extern boolean _bfd_elf_copy_private_symbol_data @@ -1419,8 +1467,7 @@ extern boolean bfd_elf32_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern void bfd_elf32_swap_symbol_in - PARAMS ((bfd *, const Elf32_External_Sym *, const Elf_External_Sym_Shndx *, - Elf_Internal_Sym *)); + PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); extern void bfd_elf32_swap_symbol_out PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); extern void bfd_elf32_swap_reloc_in @@ -1472,8 +1519,7 @@ extern boolean bfd_elf64_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern void bfd_elf64_swap_symbol_in - PARAMS ((bfd *, const Elf64_External_Sym *, const Elf_External_Sym_Shndx *, - Elf_Internal_Sym *)); + PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); extern void bfd_elf64_swap_symbol_out PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); extern void bfd_elf64_swap_reloc_in @@ -1514,10 +1560,12 @@ extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs #define bfd_elf64_link_record_dynamic_symbol \ _bfd_elf_link_record_dynamic_symbol -extern boolean _bfd_elf32_link_record_local_dynamic_symbol - PARAMS ((struct bfd_link_info *, bfd *, long)); -extern boolean _bfd_elf64_link_record_local_dynamic_symbol +extern int elf_link_record_local_dynamic_symbol PARAMS ((struct bfd_link_info *, bfd *, long)); +#define _bfd_elf32_link_record_local_dynamic_symbol \ + elf_link_record_local_dynamic_symbol +#define _bfd_elf64_link_record_local_dynamic_symbol \ + elf_link_record_local_dynamic_symbol extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *)); @@ -1553,20 +1601,20 @@ extern boolean _bfd_elf64_reloc_symbol_deleted_p PARAMS ((bfd_vma, PTR)); /* Exported interface for writing elf corefile notes. */ -extern char *elfcore_write_note - PARAMS ((bfd *, char *, int *, char *, int, void *, int)); -extern char *elfcore_write_prpsinfo - PARAMS ((bfd *, char *, int *, char *, char *)); -extern char *elfcore_write_prstatus - PARAMS ((bfd *, char *, int *, long, int, void *)); -extern char * elfcore_write_pstatus - PARAMS ((bfd *, char *, int *, long, int, void *)); -extern char *elfcore_write_prfpreg - PARAMS ((bfd *, char *, int *, void *, int)); -extern char *elfcore_write_prxfpreg - PARAMS ((bfd *, char *, int *, void *, int)); -extern char *elfcore_write_lwpstatus - PARAMS ((bfd*, char*, int*, long, int, void*)); +extern char *elfcore_write_note + PARAMS ((bfd *, char *, int *, const char *, int, const PTR, int)); +extern char *elfcore_write_prpsinfo + PARAMS ((bfd *, char *, int *, const char *, const char *)); +extern char *elfcore_write_prstatus + PARAMS ((bfd *, char *, int *, long, int, const PTR)); +extern char * elfcore_write_pstatus + PARAMS ((bfd *, char *, int *, long, int, const PTR)); +extern char *elfcore_write_prfpreg + PARAMS ((bfd *, char *, int *, const PTR, int)); +extern char *elfcore_write_prxfpreg + PARAMS ((bfd *, char *, int *, const PTR, int)); +extern char *elfcore_write_lwpstatus + PARAMS ((bfd *, char *, int *, long, int, const PTR)); /* SH ELF specific routine. */ diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 6f10cd7..eb4a69b 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -287,7 +287,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, bfd *abfd; struct bfd_link_info *info; asection *sec, *ehdrsec; - boolean (*reloc_symbol_deleted_p) (bfd_vma, PTR); + boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR)); struct elf_reloc_cookie *cookie; { bfd_byte *ehbuf = NULL, *buf; @@ -506,6 +506,11 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, } read_uleb128 (cie.code_align, buf); read_sleb128 (cie.data_align, buf); + /* Note - in DWARF2 the return address column is an unsigned byte. + In DWARF3 it is a ULEB128. We are following DWARF3. For most + ports this will not matter as the value will be less than 128. + For the others (eg FRV, SH, MMIX, IA64) they need a fixed GCC + which conforms to the DWARF3 standard. */ read_uleb128 (cie.ra_column, buf); ENSURE_NO_RELOCS (buf); cie.lsda_encoding = DW_EH_PE_omit; diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index 99a66f4..263e9ac 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -811,7 +811,10 @@ elf_hppa_reloc_final_type (abfd, base_type, format, field) final_type = R_PARISC_PCREL14R; break; case e_fsel: - final_type = R_PARISC_PCREL14F; + if (bfd_get_mach (abfd) < 25) + final_type = R_PARISC_PCREL14F; + else + final_type = R_PARISC_PCREL16F; break; default: return R_PARISC_NONE; @@ -1296,22 +1299,22 @@ elf_hppa_final_link (abfd, info) address of the .plt + gp_offset. If no .plt is found, then look for .dlt, .opd and .data (in - that order) and set __gp to the base address of whichever section - is found first. */ + that order) and set __gp to the base address of whichever + section is found first. */ sec = hppa_info->plt_sec; - if (sec) + if (sec && ! (sec->flags & SEC_EXCLUDE)) gp_val = (sec->output_offset + sec->output_section->vma + hppa_info->gp_offset); else { sec = hppa_info->dlt_sec; - if (!sec) + if (!sec || (sec->flags & SEC_EXCLUDE)) sec = hppa_info->opd_sec; - if (!sec) + if (!sec || (sec->flags & SEC_EXCLUDE)) sec = bfd_get_section_by_name (abfd, ".data"); - if (!sec) + if (!sec || (sec->flags & SEC_EXCLUDE)) return false; gp_val = sec->output_offset + sec->output_section->vma; @@ -1373,8 +1376,12 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info); + struct elf64_hppa_link_hash_table *hppa_info; + + if (info->relocateable) + return true; + hppa_info = elf64_hppa_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; rel = relocs; @@ -1402,28 +1409,8 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, return false; } - r_symndx = ELF_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sym_sec = local_sections[r_symndx]; - rel->r_addend += sym_sec->output_offset; - } - } - - continue; - } - /* This is a final link. */ + r_symndx = ELF_R_SYM (rel->r_info); h = NULL; sym = NULL; sym_sec = NULL; @@ -1609,8 +1596,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_NONE: break; - /* Basic function call support. I'm not entirely sure if PCREL14F is - actually needed or even handled correctly. + /* Basic function call support. Note for a call to a function defined in another dynamic library we want to redirect the call to a stub. */ @@ -2074,11 +2060,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, hppa_info->opd_sec->contents + dyn_h->opd_offset + 24); } - /* We want the value of the OPD offset for this symbol, not - the symbol's actual address. */ - value = (dyn_h->opd_offset - + hppa_info->opd_sec->output_offset - + hppa_info->opd_sec->output_section->vma); + if (dyn_h->want_opd) + /* We want the value of the OPD offset for this symbol. */ + value = (dyn_h->opd_offset + + hppa_info->opd_sec->output_offset + + hppa_info->opd_sec->output_section->vma); + else + /* We want the address of the symbol. */ + value += addend; bfd_put_64 (input_bfd, value, hit_data); return bfd_reloc_ok; @@ -2179,24 +2168,27 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DLTIND14R: case R_PARISC_DLTIND14F: case R_PARISC_LTOFF_FPTR14R: - case R_PARISC_LTOFF_FPTR16F: case R_PARISC_PCREL14R: case R_PARISC_PCREL14F: - case R_PARISC_PCREL16F: case R_PARISC_LTOFF_TP14R: case R_PARISC_LTOFF_TP14F: - case R_PARISC_LTOFF_TP16F: case R_PARISC_DPREL14R: case R_PARISC_DPREL14F: - case R_PARISC_GPREL16F: case R_PARISC_PLTOFF14R: case R_PARISC_PLTOFF14F: - case R_PARISC_PLTOFF16F: case R_PARISC_DIR14R: case R_PARISC_DIR14F: + return (insn & ~0x3fff) | low_sign_unext (sym_value, 14); + + /* PA2.0W LDO and integer loads/stores with 16 bit displacements. */ + case R_PARISC_LTOFF_FPTR16F: + case R_PARISC_PCREL16F: + case R_PARISC_LTOFF_TP16F: + case R_PARISC_GPREL16F: + case R_PARISC_PLTOFF16F: case R_PARISC_DIR16F: case R_PARISC_LTOFF16F: - return (insn & ~0x3fff) | low_sign_unext (sym_value, 14); + return (insn & ~0xffff) | re_assemble_16 (sym_value); /* Doubleword loads and stores with a 14 bit displacement. */ case R_PARISC_DLTREL14DR: diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index 4e8de60..37b832a 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -30,7 +30,7 @@ static void mn10200_info_to_howto static boolean mn10200_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); static boolean mn10200_elf_symbol_address_p - PARAMS ((bfd *, asection *, bfd_vma)); + PARAMS ((bfd *, asection *, Elf_Internal_Sym *, bfd_vma)); static bfd_reloc_status_type mn10200_elf_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, bfd_vma, bfd_vma, bfd_vma, @@ -45,10 +45,6 @@ static bfd_byte * mn10200_elf_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); -/* We have to use RELA instructions since md_apply_fix3 in the assembler - does absolutely nothing. */ -#define USE_RELA - enum reloc_type { R_MN10200_NONE = 0, R_MN10200_32, @@ -508,15 +504,10 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) boolean *again; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *contents = NULL; - bfd_byte *free_contents = NULL; - Elf32_External_Sym *extsyms = NULL; - Elf32_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* Assume nothing changes. */ *again = false; @@ -536,7 +527,6 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) sec->_cooked_size = sec->_raw_size; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; /* Get a copy of the native relocations. */ internal_relocs = (_bfd_elf32_link_read_relocs @@ -544,8 +534,6 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) link_info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; /* Walk through them looking for relaxing opportunities. */ irelend = internal_relocs + sec->reloc_count; @@ -572,7 +560,6 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (! bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) @@ -580,67 +567,35 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) } } - /* Read this BFD's symbols if we haven't done so already. */ - if (extsyms == NULL) + /* Read this BFD's local symbols if we haven't done so already. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) { - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, abfd) != amt) - goto error_return; - symtab_hdr->contents = (bfd_byte *) extsyms; - } - - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_return; - shndx_hdr->contents = (bfd_byte *) shndx_buf; - } + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; } /* Get the value of the symbol referred to by the reloc. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { /* A local symbol. */ - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; + Elf_Internal_Sym *isym; asection *sym_sec; - esym = extsyms + ELF32_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == SHN_UNDEF) + isym = isymbuf + ELF32_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) sym_sec = bfd_und_section_ptr; - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) sym_sec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; else - sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx); - symval = (isym.st_value + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = (isym->st_value + sym_sec->output_section->vma + sym_sec->output_offset); } @@ -701,12 +656,8 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ if (code == 0xe0) @@ -758,12 +709,8 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xea, contents + irel->r_offset - 1); @@ -848,17 +795,14 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) /* We also have to be sure there is no symbol/label at the unconditional branch. */ - if (mn10200_elf_symbol_address_p (abfd, sec, irel->r_offset + 1)) + if (mn10200_elf_symbol_address_p (abfd, sec, isymbuf, + irel->r_offset + 1)) continue; /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Reverse the condition of the first branch. */ switch (code) @@ -976,12 +920,8 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the reldection contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xf8 + (code & 0x03), @@ -1019,12 +959,8 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) case 0xc8: /* Note that we've changed the reldection contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; if ((code & 0xfc) == 0x74) code = 0xdc + (code & 0x03); @@ -1106,12 +1042,8 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the reldection contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xf7, contents + irel->r_offset - 2); @@ -1169,12 +1101,8 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) case 0xc4: /* Note that we've changed the reldection contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; bfd_put_8 (abfd, 0xcc + (code & 0x03), contents + irel->r_offset - 2); @@ -1204,52 +1132,46 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) } } - if (free_relocs != NULL) - free (free_relocs); - - if (free_contents != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { if (! link_info->keep_memory) - free (free_contents); + free (isymbuf); else { - /* Cache the section contents for elf_link_input_bfd. */ - elf_section_data (sec)->this_hdr.contents = contents; + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } } - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - - if (free_extsyms != NULL) + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) { if (! link_info->keep_memory) + free (contents); + else { - symtab_hdr->contents = NULL; - free (free_extsyms); + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; } } + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - if (free_extsyms != NULL) - { - symtab_hdr->contents = NULL; - free (free_extsyms); - } + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return false; } @@ -1264,22 +1186,17 @@ mn10200_elf_relax_delete_bytes (abfd, sec, addr, count) int count; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; unsigned int sec_shndx; bfd_byte *contents; Elf_Internal_Rela *irel, *irelend; Elf_Internal_Rela *irelalign; bfd_vma toaddr; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **end_hashes; unsigned int symcount; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); contents = elf_section_data (sec)->this_hdr.contents; @@ -1308,24 +1225,14 @@ mn10200_elf_relax_delete_bytes (abfd, sec, addr, count) } /* Adjust the local symbols defined in this section. */ - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; - esym = extsyms; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) { - Elf_Internal_Sym isym; - Elf_External_Sym_Shndx dummy; - - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == sec_shndx - && isym.st_value > addr - && isym.st_value < toaddr) - { - isym.st_value -= count; - bfd_elf32_swap_symbol_out (abfd, &isym, (PTR) esym, (PTR) &dummy); - } + if (isym->st_shndx == sec_shndx + && isym->st_value > addr + && isym->st_value < toaddr) + isym->st_value -= count; } /* Now adjust the global symbols defined in this section. */ @@ -1352,36 +1259,27 @@ mn10200_elf_relax_delete_bytes (abfd, sec, addr, count) /* Return true if a symbol exists at the given address, else return false. */ static boolean -mn10200_elf_symbol_address_p (abfd, sec, addr) +mn10200_elf_symbol_address_p (abfd, sec, isym, addr) bfd *abfd; asection *sec; + Elf_Internal_Sym *isym; bfd_vma addr; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; unsigned int sec_shndx; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; + Elf_Internal_Sym *isymend; struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **end_hashes; unsigned int symcount; sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); - /* Examine all the symbols. */ + /* Examine all the local symbols. */ symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; - esym = (Elf32_External_Sym *) symtab_hdr->contents; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) { - Elf_Internal_Sym isym; - - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == sec_shndx - && isym.st_value == addr) + if (isym->st_shndx == sec_shndx + && isym->st_value == addr) return true; } @@ -1416,15 +1314,11 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; asection *input_section = link_order->u.indirect.section; bfd *input_bfd = input_section->owner; asection **sections = NULL; Elf_Internal_Rela *internal_relocs = NULL; - Elf32_External_Sym *external_syms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym *internal_syms = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ @@ -1436,7 +1330,6 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; memcpy (data, elf_section_data (input_section)->this_hdr.contents, (size_t) input_section->_raw_size); @@ -1444,48 +1337,27 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, if ((input_section->flags & SEC_RELOC) != 0 && input_section->reloc_count > 0) { - Elf_Internal_Sym *isymp; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; asection **secpp; - Elf32_External_Sym *esym, *esymend; bfd_size_type amt; - if (symtab_hdr->contents != NULL) - external_syms = (Elf32_External_Sym *) symtab_hdr->contents; - else if (symtab_hdr->sh_info != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - external_syms = (Elf32_External_Sym *) bfd_malloc (amt); - if (external_syms == NULL) - goto error_return; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) external_syms, amt, input_bfd) != amt) - goto error_return; - } - - if (symtab_hdr->sh_info != 0 && shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt) - goto error_return; - } - internal_relocs = (_bfd_elf32_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, false)); if (internal_relocs == NULL) goto error_return; - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_Internal_Sym); - internal_syms = (Elf_Internal_Sym *) bfd_malloc (amt); - if (internal_syms == NULL && amt != 0) - goto error_return; + if (symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } amt = symtab_hdr->sh_info; amt *= sizeof (asection *); @@ -1493,58 +1365,48 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, if (sections == NULL && amt != 0) goto error_return; - for (isymp = internal_syms, secpp = sections, shndx = shndx_buf, - esym = external_syms, esymend = esym + symtab_hdr->sh_info; - esym < esymend; - ++esym, ++isymp, ++secpp, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp) { asection *isec; - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp); - - if (isymp->st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) isec = bfd_und_section_ptr; - else if (isymp->st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) isec = bfd_abs_section_ptr; - else if (isymp->st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) isec = bfd_com_section_ptr; else - isec = bfd_section_from_elf_index (input_bfd, isymp->st_shndx); + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); *secpp = isec; } if (! mn10200_elf_relocate_section (output_bfd, link_info, input_bfd, input_section, data, internal_relocs, - internal_syms, sections)) + isymbuf, sections)) goto error_return; if (sections != NULL) free (sections); - if (internal_syms != NULL) - free (internal_syms); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_relocs != elf_section_data (input_section)->relocs) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); } return data; error_return: - if (internal_relocs != NULL - && internal_relocs != elf_section_data (input_section)->relocs) - free (internal_relocs); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_syms != NULL) - free (internal_syms); if (sections != NULL) free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); return NULL; } diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 40b4ad6..374e55e 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -122,22 +122,18 @@ static boolean mn10300_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *mn10300_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *info, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *info, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean mn10300_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); static boolean mn10300_elf_symbol_address_p - PARAMS ((bfd *, asection *, bfd_vma)); +PARAMS ((bfd *, asection *, Elf_Internal_Sym *, bfd_vma)); static boolean elf32_mn10300_finish_hash_table_entry PARAMS ((struct bfd_hash_entry *, PTR)); static void compute_function_info PARAMS ((bfd *, struct elf32_mn10300_link_hash_entry *, bfd_vma, unsigned char *)); -/* We have to use RELA instructions since md_apply_fix3 in the assembler - does absolutely nothing. */ -#define USE_RELA - static reloc_howto_type elf_mn10300_howto_table[] = { /* Dummy relocation. Does nothing. */ HOWTO (R_MN10300_NONE, @@ -397,8 +393,8 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -mn10300_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +mn10300_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -428,9 +424,7 @@ mn10300_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -785,16 +779,12 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) boolean *again; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs = NULL; - Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *contents = NULL; - bfd_byte *free_contents = NULL; - Elf32_External_Sym *extsyms = NULL; - Elf32_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_Internal_Sym *isymbuf = NULL; struct elf32_mn10300_link_hash_table *hash_table; + asection *section = sec; /* Assume nothing changes. */ *again = false; @@ -812,42 +802,16 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) input_bfd != NULL; input_bfd = input_bfd->link_next) { - asection *section; - /* We're going to need all the symbols for each bfd. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; - - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else + if (symtab_hdr->sh_info != 0) { - /* Go get them off disk. */ - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, input_bfd) != amt) - goto error_return; - } - - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt) + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) goto error_return; } @@ -877,7 +841,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (section->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (!bfd_get_section_contents (input_bfd, section, contents, (file_ptr) 0, @@ -885,10 +848,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) goto error_return; } else - { - contents = NULL; - free_contents = NULL; - } + contents = NULL; /* If there aren't any relocs, then there's nothing to do. */ if ((section->flags & SEC_RELOC) != 0 @@ -902,8 +862,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) link_info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; /* Now examine each relocation. */ irel = internal_relocs; @@ -929,38 +887,31 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) if (r_index < symtab_hdr->sh_info) { /* A local symbol. */ - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; + Elf_Internal_Sym *isym; struct elf_link_hash_table *elftab; bfd_size_type amt; - esym = extsyms + r_index; - shndx = shndx_buf + (shndx_buf ? r_index : 0); - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, - &isym); - - if (isym.st_shndx == SHN_UNDEF) + isym = isymbuf + r_index; + if (isym->st_shndx == SHN_UNDEF) sym_sec = bfd_und_section_ptr; - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) sym_sec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; else sym_sec = bfd_section_from_elf_index (input_bfd, - isym.st_shndx); + isym->st_shndx); sym_name = bfd_elf_string_from_elf_section (input_bfd, (symtab_hdr ->sh_link), - isym.st_name); + isym->st_name); /* If it isn't a function, then we don't care about it. */ - if (r_index < symtab_hdr->sh_info - && ELF_ST_TYPE (isym.st_info) != STT_FUNC) + if (ELF_ST_TYPE (isym->st_info) != STT_FUNC) continue; /* Tack on an ID so we can uniquely identify this @@ -995,8 +946,9 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) if (code != 0xdd && code != 0xcd) hash->flags |= MN10300_CONVERT_CALL_TO_CALLS; - /* If this is a jump/call, then bump the direct_calls - counter. Else force "call" to "calls" conversions. */ + /* If this is a jump/call, then bump the + direct_calls counter. Else force "call" to + "calls" conversions. */ if (r_type == R_MN10300_PCREL32 || r_type == R_MN10300_PCREL16) hash->direct_calls++; @@ -1010,45 +962,40 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) (ie movm_args). */ if ((section->flags & SEC_CODE) != 0) { - - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; - int idx; + Elf_Internal_Sym *isym, *isymend; unsigned int sec_shndx; + struct elf_link_hash_entry **hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; sec_shndx = _bfd_elf_section_from_bfd_section (input_bfd, section); /* Look at each function defined in this section and update info for that function. */ - for (esym = extsyms, esymend = esym + symtab_hdr->sh_info, - shndx = shndx_buf; - esym < esymend; - esym++, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf; isym < isymend; isym++) { - Elf_Internal_Sym isym; - - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, &isym); - if (isym.st_shndx == sec_shndx - && ELF_ST_TYPE (isym.st_info) == STT_FUNC) + if (isym->st_shndx == sec_shndx + && ELF_ST_TYPE (isym->st_info) == STT_FUNC) { struct elf_link_hash_table *elftab; bfd_size_type amt; - if (isym.st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) sym_sec = bfd_und_section_ptr; - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) sym_sec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; else sym_sec = bfd_section_from_elf_index (input_bfd, - isym.st_shndx); + isym->st_shndx); sym_name = (bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, - isym.st_name)); + isym->st_name)); /* Tack on an ID so we can uniquely identify this local symbol in the global hash table. */ @@ -1067,23 +1014,21 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) true, true, false)); free (new_name); compute_function_info (input_bfd, hash, - isym.st_value, contents); + isym->st_value, contents); } } - esym = extsyms + symtab_hdr->sh_info; - esymend = extsyms + (symtab_hdr->sh_size - / sizeof (Elf32_External_Sym)); - for (idx = 0; esym < esymend; esym++, idx++) + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + hashes = elf_sym_hashes (abfd); + end_hashes = hashes + symcount; + for (; hashes < end_hashes; hashes++) { - Elf_Internal_Sym isym; - - hash = (struct elf32_mn10300_link_hash_entry *) - elf_sym_hashes (input_bfd)[idx]; + hash = (struct elf32_mn10300_link_hash_entry *) *hashes; if ((hash->root.root.type == bfd_link_hash_defined || hash->root.root.type == bfd_link_hash_defweak) && hash->root.root.u.def.section == section - && ELF_ST_TYPE (isym.st_info) == STT_FUNC) + && ELF_ST_TYPE (isym->st_info) == STT_FUNC) compute_function_info (input_bfd, hash, (hash)->root.root.u.def.value, contents); @@ -1091,44 +1036,39 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) } /* Cache or free any memory we allocated for the relocs. */ - if (free_relocs != NULL) - { - free (free_relocs); - free_relocs = NULL; - } + if (internal_relocs != NULL + && elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); + internal_relocs = NULL; /* Cache or free any memory we allocated for the contents. */ - if (free_contents != NULL) + if (contents != NULL + && elf_section_data (section)->this_hdr.contents != contents) { if (! link_info->keep_memory) - free (free_contents); + free (contents); else { /* Cache the section contents for elf_link_input_bfd. */ elf_section_data (section)->this_hdr.contents = contents; } - free_contents = NULL; } - } - - if (shndx_buf != NULL) - { - free (shndx_buf); - shndx_buf = NULL; + contents = NULL; } /* Cache or free any memory we allocated for the symbols. */ - if (free_extsyms != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { if (! link_info->keep_memory) - free (free_extsyms); + free (isymbuf); else { /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = (unsigned char *) extsyms; + symtab_hdr->contents = (unsigned char *) isymbuf; } - free_extsyms = NULL; } + isymbuf = NULL; } /* Now iterate on each symbol in the hash table and perform @@ -1151,45 +1091,17 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) input_bfd != NULL; input_bfd = input_bfd->link_next) { - asection *section; - /* We're going to need all the local symbols for each bfd. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; - - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else + if (symtab_hdr->sh_info != 0) { - /* Go get them off disk. */ - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, input_bfd) != amt) + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) goto error_return; - symtab_hdr->contents = (bfd_byte *) extsyms; - } - - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt) - goto error_return; - shndx_hdr->contents = (bfd_byte *) shndx_buf; } /* Walk over each section in this bfd. */ @@ -1198,9 +1110,10 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) section = section->next) { unsigned int sec_shndx; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; - unsigned int idx; + Elf_Internal_Sym *isym, *isymend; + struct elf_link_hash_entry **hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; /* Skip non-code sections and empty sections. */ if ((section->flags & SEC_CODE) == 0 || section->_raw_size == 0) @@ -1215,8 +1128,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) link_info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; } /* Get cached copy of section contents if it exists. */ @@ -1228,7 +1139,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (section->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (!bfd_get_section_contents (input_bfd, section, contents, (file_ptr) 0, @@ -1241,12 +1151,9 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Now look for any function in this section which needs insns deleted from its prologue. */ - for (esym = extsyms, esymend = esym + symtab_hdr->sh_info, - shndx = shndx_buf; - esym < esymend; - esym++, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf; isym < isymend; isym++) { - Elf_Internal_Sym isym; struct elf32_mn10300_link_hash_entry *sym_hash; asection *sym_sec = NULL; const char *sym_name; @@ -1254,25 +1161,23 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) struct elf_link_hash_table *elftab; bfd_size_type amt; - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, &isym); - - if (isym.st_shndx != sec_shndx) + if (isym->st_shndx != sec_shndx) continue; - if (isym.st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) sym_sec = bfd_und_section_ptr; - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) sym_sec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; else sym_sec - = bfd_section_from_elf_index (input_bfd, isym.st_shndx); + = bfd_section_from_elf_index (input_bfd, isym->st_shndx); sym_name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, - isym.st_name); + isym->st_name); /* Tack on an ID so we can uniquely identify this local symbol in the global hash table. */ @@ -1299,12 +1204,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed things. */ elf_section_data (section)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (section)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Count how many bytes we're going to delete. */ if (sym_hash->movm_args) @@ -1323,7 +1224,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Actually delete the bytes. */ if (!mn10300_elf_relax_delete_bytes (input_bfd, section, - isym.st_value, + isym->st_value, bytes)) goto error_return; @@ -1335,15 +1236,15 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Look for any global functions in this section which need insns deleted from their prologues. */ - for (idx = 0; - idx < (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) - symtab_hdr->sh_info); - idx++) + hashes = elf_sym_hashes (abfd); + end_hashes = hashes + symcount; + for (; hashes < end_hashes; hashes++) { struct elf32_mn10300_link_hash_entry *sym_hash; - sym_hash = (struct elf32_mn10300_link_hash_entry *) - (elf_sym_hashes (input_bfd)[idx]); + sym_hash = (struct elf32_mn10300_link_hash_entry *) *hashes; if ((sym_hash->root.root.type == bfd_link_hash_defined || sym_hash->root.root.type == bfd_link_hash_defweak) && sym_hash->root.root.u.def.section == section @@ -1355,12 +1256,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed things. */ elf_section_data (section)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (section)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Count how many bytes we're going to delete. */ if (sym_hash->movm_args) @@ -1391,53 +1288,48 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) } /* Cache or free any memory we allocated for the relocs. */ - if (free_relocs != NULL) - { - free (free_relocs); - free_relocs = NULL; - } + if (internal_relocs != NULL + && elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); + internal_relocs = NULL; /* Cache or free any memory we allocated for the contents. */ - if (free_contents != NULL) + if (contents != NULL + && elf_section_data (section)->this_hdr.contents != contents) { if (! link_info->keep_memory) - free (free_contents); + free (contents); else { /* Cache the section contents for elf_link_input_bfd. */ elf_section_data (section)->this_hdr.contents = contents; } - free_contents = NULL; } - } - - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - shndx_buf = NULL; + contents = NULL; } /* Cache or free any memory we allocated for the symbols. */ - if (free_extsyms != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { if (! link_info->keep_memory) + free (isymbuf); + else { - symtab_hdr->contents = NULL; - free (free_extsyms); + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } - free_extsyms = NULL; } + isymbuf = NULL; } } /* (Re)initialize for the basic instruction shortening/relaxing pass. */ contents = NULL; - extsyms = NULL; internal_relocs = NULL; - free_relocs = NULL; - free_contents = NULL; - free_extsyms = NULL; + isymbuf = NULL; + /* For error_return. */ + section = sec; /* We don't have to do anything for a relocateable link, if this section does not have relocs, or if this is not a @@ -1454,7 +1346,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) sec->_cooked_size = sec->_raw_size; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; /* Get a copy of the native relocations. */ internal_relocs = (_bfd_elf32_link_read_relocs @@ -1462,8 +1353,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) link_info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; /* Walk through them looking for relaxing opportunities. */ irelend = internal_relocs + sec->reloc_count; @@ -1491,7 +1380,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (! bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) @@ -1499,75 +1387,43 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) } } - /* Read this BFD's symbols if we haven't done so already. */ - if (extsyms == NULL) + /* Read this BFD's symbols if we haven't done so already. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) { - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, abfd) != amt) - goto error_return; - symtab_hdr->contents = (bfd_byte *) extsyms; - } - - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_return; - shndx_hdr->contents = (bfd_byte *) shndx_buf; - } + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; } /* Get the value of the symbol referred to by the reloc. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; + Elf_Internal_Sym *isym; asection *sym_sec = NULL; const char *sym_name; char *new_name; /* A local symbol. */ - esym = extsyms + ELF32_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == SHN_UNDEF) + isym = isymbuf + ELF32_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) sym_sec = bfd_und_section_ptr; - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) sym_sec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; else - sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx); + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); - symval = (isym.st_value + symval = (isym->st_value + sym_sec->output_section->vma + sym_sec->output_offset); sym_name = bfd_elf_string_from_elf_section (abfd, symtab_hdr->sh_link, - isym.st_name); + isym->st_name); /* Tack on an ID so we can uniquely identify this local symbol in the global hash table. */ @@ -1635,12 +1491,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfc, contents + irel->r_offset - 1); @@ -1699,12 +1551,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ if (code == 0xdc) @@ -1750,12 +1598,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfa, contents + irel->r_offset - 1); @@ -1812,12 +1656,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xca, contents + irel->r_offset - 1); @@ -1901,17 +1741,14 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* We also have to be sure there is no symbol/label at the unconditional branch. */ - if (mn10300_elf_symbol_address_p (abfd, sec, irel->r_offset + 1)) + if (mn10300_elf_symbol_address_p (abfd, sec, isymbuf, + irel->r_offset + 1)) continue; /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Reverse the condition of the first branch. */ switch (code) @@ -2019,12 +1856,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfb, contents + irel->r_offset - 3); @@ -2094,12 +1927,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfd, contents + irel->r_offset - 3); @@ -2177,12 +2006,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfa, contents + irel->r_offset - 2); @@ -2214,12 +2039,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) case 0x83: /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; if ((code & 0xf3) == 0x81) code = 0x01 + (code & 0x0c); @@ -2268,12 +2089,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfa, contents + irel->r_offset - 2); @@ -2320,12 +2137,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; if ((code & 0xfc) == 0xcc) code = 0x2c + (code & 0x03); @@ -2401,12 +2214,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfa, contents + irel->r_offset - 2); @@ -2432,12 +2241,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocation contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Fix the opcode. */ bfd_put_8 (abfd, 0xfa, contents + irel->r_offset - 2); @@ -2461,52 +2266,46 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) } } - if (free_relocs != NULL) - free (free_relocs); - - if (free_contents != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { if (! link_info->keep_memory) - free (free_contents); + free (isymbuf); else { - /* Cache the section contents for elf_link_input_bfd. */ - elf_section_data (sec)->this_hdr.contents = contents; + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } } - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - - if (free_extsyms != NULL) + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) { if (! link_info->keep_memory) + free (contents); + else { - symtab_hdr->contents = NULL; - free (free_extsyms); + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; } } + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - if (free_extsyms != NULL) - { - symtab_hdr->contents = NULL; - free (free_extsyms); - } + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (section)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); return false; } @@ -2621,22 +2420,16 @@ mn10300_elf_relax_delete_bytes (abfd, sec, addr, count) int count; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; unsigned int sec_shndx; bfd_byte *contents; Elf_Internal_Rela *irel, *irelend; Elf_Internal_Rela *irelalign; bfd_vma toaddr; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; + Elf_Internal_Sym *isym, *isymend; struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **end_hashes; unsigned int symcount; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); contents = elf_section_data (sec)->this_hdr.contents; @@ -2665,24 +2458,14 @@ mn10300_elf_relax_delete_bytes (abfd, sec, addr, count) } /* Adjust the local symbols defined in this section. */ - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; - esym = extsyms; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) { - Elf_Internal_Sym isym; - Elf_External_Sym_Shndx dummy; - - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == sec_shndx - && isym.st_value > addr - && isym.st_value < toaddr) - { - isym.st_value -= count; - bfd_elf32_swap_symbol_out (abfd, &isym, (PTR) esym, (PTR) &dummy); - } + if (isym->st_shndx == sec_shndx + && isym->st_value > addr + && isym->st_value < toaddr) + isym->st_value -= count; } /* Now adjust the global symbols defined in this section. */ @@ -2709,16 +2492,15 @@ mn10300_elf_relax_delete_bytes (abfd, sec, addr, count) /* Return true if a symbol exists at the given address, else return false. */ static boolean -mn10300_elf_symbol_address_p (abfd, sec, addr) +mn10300_elf_symbol_address_p (abfd, sec, isym, addr) bfd *abfd; asection *sec; + Elf_Internal_Sym *isym; bfd_vma addr; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; unsigned int sec_shndx; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; + Elf_Internal_Sym *isymend; struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **end_hashes; unsigned int symcount; @@ -2727,18 +2509,10 @@ mn10300_elf_symbol_address_p (abfd, sec, addr) /* Examine all the symbols. */ symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; - esym = (Elf32_External_Sym *) symtab_hdr->contents; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) { - Elf_Internal_Sym isym; - - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == sec_shndx - && isym.st_value == addr) + if (isym->st_shndx == sec_shndx + && isym->st_value == addr) return true; } @@ -2773,15 +2547,11 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; asection *input_section = link_order->u.indirect.section; bfd *input_bfd = input_section->owner; asection **sections = NULL; Elf_Internal_Rela *internal_relocs = NULL; - Elf32_External_Sym *external_syms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym *internal_syms = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ @@ -2793,7 +2563,6 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; memcpy (data, elf_section_data (input_section)->this_hdr.contents, (size_t) input_section->_raw_size); @@ -2801,48 +2570,26 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, if ((input_section->flags & SEC_RELOC) != 0 && input_section->reloc_count > 0) { - Elf_Internal_Sym *isymp; asection **secpp; - Elf32_External_Sym *esym, *esymend; + Elf_Internal_Sym *isym, *isymend; bfd_size_type amt; - if (symtab_hdr->contents != NULL) - external_syms = (Elf32_External_Sym *) symtab_hdr->contents; - else if (symtab_hdr->sh_info != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - external_syms = (Elf32_External_Sym *) bfd_malloc (amt); - if (external_syms == NULL) - goto error_return; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) external_syms, amt, input_bfd) != amt) - goto error_return; - } - - if (symtab_hdr->sh_info != 0 && shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt) - goto error_return; - } - internal_relocs = (_bfd_elf32_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, false)); if (internal_relocs == NULL) goto error_return; - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_Internal_Sym); - internal_syms = (Elf_Internal_Sym *) bfd_malloc (amt); - if (internal_syms == NULL && amt != 0) - goto error_return; + if (symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } amt = symtab_hdr->sh_info; amt *= sizeof (asection *); @@ -2850,40 +2597,32 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, if (sections == NULL && amt != 0) goto error_return; - for (isymp = internal_syms, secpp = sections, shndx = shndx_buf, - esym = external_syms, esymend = esym + symtab_hdr->sh_info; - esym < esymend; - ++esym, ++isymp, ++secpp, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp) { asection *isec; - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp); - - if (isymp->st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) isec = bfd_und_section_ptr; - else if (isymp->st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) isec = bfd_abs_section_ptr; - else if (isymp->st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) isec = bfd_com_section_ptr; else - isec = bfd_section_from_elf_index (input_bfd, isymp->st_shndx); + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); *secpp = isec; } if (! mn10300_elf_relocate_section (output_bfd, link_info, input_bfd, input_section, data, internal_relocs, - internal_syms, sections)) + isymbuf, sections)) goto error_return; if (sections != NULL) free (sections); - if (internal_syms != NULL) - free (internal_syms); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); + if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); if (internal_relocs != elf_section_data (input_section)->relocs) free (internal_relocs); } @@ -2891,17 +2630,13 @@ mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order, return data; error_return: + if (sections != NULL) + free (sections); + if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); if (internal_relocs != NULL && internal_relocs != elf_section_data (input_section)->relocs) free (internal_relocs); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_syms != NULL) - free (internal_syms); - if (sections != NULL) - free (sections); return NULL; } diff --git a/bfd/elf-strtab.c b/bfd/elf-strtab.c index ff7d9a4..7a993c2 100644 --- a/bfd/elf-strtab.c +++ b/bfd/elf-strtab.c @@ -1,28 +1,29 @@ /* ELF strtab with GC and suffix merging support. - Copyright 2001 Free Software Foundation, Inc. + Copyright 2001, 2002 Free Software Foundation, Inc. Written by Jakub Jelinek <jakub@redhat.com>. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" #include "hashtab.h" +#include "libiberty.h" /* An entry in the strtab hash table. */ @@ -351,7 +352,7 @@ _bfd_elf_strtab_finalize (tab) qsort (array, size, sizeof (struct elf_strtab_hash_entry *), cmplengthentry); - last4tab = htab_create (size * 4, NULL, last4_eq, NULL); + last4tab = htab_create_alloc (size * 4, NULL, last4_eq, NULL, calloc, free); if (last4tab == NULL) goto alloc_failure; @@ -15,11 +15,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software + along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* SECTION - + ELF backends BFD support for ELF formats is being worked on. @@ -50,10 +50,10 @@ static boolean prep_headers PARAMS ((bfd *)); static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **, int)); static boolean copy_private_bfd_data PARAMS ((bfd *, bfd *)); static char *elf_read PARAMS ((bfd *, file_ptr, bfd_size_type)); +static const char *group_signature PARAMS ((bfd *, Elf_Internal_Shdr *)); static boolean setup_group PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); static void merge_sections_remove_hook PARAMS ((bfd *, asection *)); static void elf_fake_sections PARAMS ((bfd *, asection *, PTR)); -static void set_group_contents PARAMS ((bfd *, asection *, PTR)); static boolean assign_section_numbers PARAMS ((bfd *)); static INLINE int sym_is_global PARAMS ((bfd *, asymbol *)); static boolean elf_map_symbols PARAMS ((bfd *)); @@ -352,6 +352,107 @@ bfd_elf_string_from_elf_section (abfd, shindex, strindex) return ((char *) hdr->contents) + strindex; } +/* Read and convert symbols to internal format. + SYMCOUNT specifies the number of symbols to read, starting from + symbol SYMOFFSET. If any of INTSYM_BUF, EXTSYM_BUF or EXTSHNDX_BUF + are non-NULL, they are used to store the internal symbols, external + symbols, and symbol section index extensions, respectively. */ + +Elf_Internal_Sym * +bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset, + intsym_buf, extsym_buf, extshndx_buf) + bfd *ibfd; + Elf_Internal_Shdr *symtab_hdr; + size_t symcount; + size_t symoffset; + Elf_Internal_Sym *intsym_buf; + PTR extsym_buf; + Elf_External_Sym_Shndx *extshndx_buf; +{ + Elf_Internal_Shdr *shndx_hdr; + PTR alloc_ext; + const bfd_byte *esym; + Elf_External_Sym_Shndx *alloc_extshndx; + Elf_External_Sym_Shndx *shndx; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + struct elf_backend_data *bed; + size_t extsym_size; + bfd_size_type amt; + file_ptr pos; + + if (symcount == 0) + return intsym_buf; + + /* Normal syms might have section extension entries. */ + shndx_hdr = NULL; + if (symtab_hdr == &elf_tdata (ibfd)->symtab_hdr) + shndx_hdr = &elf_tdata (ibfd)->symtab_shndx_hdr; + + /* Read the symbols. */ + alloc_ext = NULL; + alloc_extshndx = NULL; + bed = get_elf_backend_data (ibfd); + extsym_size = bed->s->sizeof_sym; + amt = symcount * extsym_size; + pos = symtab_hdr->sh_offset + symoffset * extsym_size; + if (extsym_buf == NULL) + { + alloc_ext = bfd_malloc (amt); + extsym_buf = alloc_ext; + } + if (extsym_buf == NULL + || bfd_seek (ibfd, pos, SEEK_SET) != 0 + || bfd_bread (extsym_buf, amt, ibfd) != amt) + { + intsym_buf = NULL; + goto out; + } + + if (shndx_hdr == NULL || shndx_hdr->sh_size == 0) + extshndx_buf = NULL; + else + { + amt = symcount * sizeof (Elf_External_Sym_Shndx); + pos = shndx_hdr->sh_offset + symoffset * sizeof (Elf_External_Sym_Shndx); + if (extshndx_buf == NULL) + { + alloc_extshndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + extshndx_buf = alloc_extshndx; + } + if (extshndx_buf == NULL + || bfd_seek (ibfd, pos, SEEK_SET) != 0 + || bfd_bread (extshndx_buf, amt, ibfd) != amt) + { + intsym_buf = NULL; + goto out; + } + } + + if (intsym_buf == NULL) + { + bfd_size_type amt = symcount * sizeof (Elf_Internal_Sym); + intsym_buf = (Elf_Internal_Sym *) bfd_malloc (amt); + if (intsym_buf == NULL) + goto out; + } + + /* Convert the symbols to internal form. */ + isymend = intsym_buf + symcount; + for (esym = extsym_buf, isym = intsym_buf, shndx = extshndx_buf; + isym < isymend; + esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL) + (*bed->s->swap_symbol_in) (ibfd, esym, (const PTR) shndx, isym); + + out: + if (alloc_ext != NULL) + free (alloc_ext); + if (alloc_extshndx != NULL) + free (alloc_extshndx); + + return intsym_buf; +} + /* Elf_Internal_Shdr->contents is an array of these for SHT_GROUP sections. The first element is the flags, the rest are section pointers. */ @@ -361,6 +462,43 @@ typedef union elf_internal_group { unsigned int flags; } Elf_Internal_Group; +/* Return the name of the group signature symbol. Why isn't the + signature just a string? */ + +static const char * +group_signature (abfd, ghdr) + bfd *abfd; + Elf_Internal_Shdr *ghdr; +{ + Elf_Internal_Shdr *hdr; + unsigned char esym[sizeof (Elf64_External_Sym)]; + Elf_External_Sym_Shndx eshndx; + Elf_Internal_Sym isym; + unsigned int iname; + unsigned int shindex; + + /* First we need to ensure the symbol table is available. */ + if (! bfd_section_from_shdr (abfd, ghdr->sh_link)) + return NULL; + + /* Go read the symbol. */ + hdr = &elf_tdata (abfd)->symtab_hdr; + if (bfd_elf_get_elf_syms (abfd, hdr, 1, ghdr->sh_info, + &isym, esym, &eshndx) == NULL) + return NULL; + + /* Look up the symbol name. */ + iname = isym.st_name; + shindex = hdr->sh_link; + if (iname == 0 && ELF_ST_TYPE (isym.st_info) == STT_SECTION) + { + iname = elf_elfsections (abfd)[isym.st_shndx]->sh_name; + shindex = elf_elfheader (abfd)->e_shstrndx; + } + + return bfd_elf_string_from_elf_section (abfd, shindex, iname); +} + /* Set next_in_group list pointer, and group name for NEWSECT. */ static boolean @@ -440,6 +578,9 @@ setup_group (abfd, hdr, newsect) if (src == shdr->contents) { dest->flags = idx; + if (shdr->bfd_section != NULL && (idx & GRP_COMDAT)) + shdr->bfd_section->flags + |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; break; } if (idx >= shnum) @@ -492,32 +633,22 @@ setup_group (abfd, hdr, newsect) } else { - struct elf_backend_data *bed; - file_ptr pos; - unsigned char ename[4]; - unsigned long iname; const char *gname; - /* Humbug. Get the name from the group signature - symbol. Why isn't the signature just a string? - Fortunately, the name index is at the same - place in the external symbol for both 32 and 64 - bit ELF. */ - bed = get_elf_backend_data (abfd); - pos = elf_tdata (abfd)->symtab_hdr.sh_offset; - pos += shdr->sh_info * bed->s->sizeof_sym; - if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread (ename, (bfd_size_type) 4, abfd) != 4) + gname = group_signature (abfd, shdr); + if (gname == NULL) return false; - iname = H_GET_32 (abfd, ename); - gname = elf_string_from_elf_strtab (abfd, iname); elf_group_name (newsect) = gname; /* Start a circular list with one element. */ elf_next_in_group (newsect) = newsect; } + + /* If the group section has been created, point to the + new member. */ if (shdr->bfd_section != NULL) elf_next_in_group (shdr->bfd_section) = newsect; + i = num_group - 1; break; } @@ -532,6 +663,25 @@ setup_group (abfd, hdr, newsect) return true; } +boolean +bfd_elf_discard_group (abfd, group) + bfd *abfd ATTRIBUTE_UNUSED; + asection *group; +{ + asection *first = elf_next_in_group (group); + asection *s = first; + + while (s != NULL) + { + s->output_section = bfd_abs_section_ptr; + s = elf_next_in_group (s); + /* These lists are circular. */ + if (s == first) + break; + } + return true; +} + /* Make a BFD section from an ELF section. We store a pointer to the BFD section in the bfd_section field of the header. */ @@ -620,7 +770,8 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) The symbols will be defined as weak, so that multiple definitions are permitted. The GNU linker extension is to actually discard all but one of the sections. */ - if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) + if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0 + && elf_next_in_group (newsect) == NULL) flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; bed = get_elf_backend_data (abfd); @@ -653,7 +804,7 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) /* This section is part of this segment if its file offset plus size lies within the segment's memory span and, if the section is loaded, the extent of the - loaded data lies within the extent of the segment. + loaded data lies within the extent of the segment. Note - we used to check the p_paddr field as well, and refuse to set the LMA if it was 0. This is wrong @@ -796,7 +947,7 @@ merge_sections_remove_hook (abfd, sec) asection *sec; { struct bfd_elf_section_data *sec_data; - + sec_data = elf_section_data (sec); BFD_ASSERT (sec_data->sec_info_type == ELF_INFO_TYPE_MERGE); sec_data->sec_info_type = ELF_INFO_TYPE_NONE; @@ -1267,10 +1418,12 @@ _bfd_elf_link_hash_newfunc (entry, table, string) old indirect symbol. Also used for copying flags to a weakdef. */ void -_bfd_elf_link_hash_copy_indirect (dir, ind) +_bfd_elf_link_hash_copy_indirect (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { bfd_signed_vma tmp; + bfd_signed_vma lowest_valid = bed->can_refcount; /* Copy down any references that we may have already seen to the symbol which just became indirect. */ @@ -1288,22 +1441,22 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) /* Copy over the global and procedure linkage table refcount entries. These may have been already set up by a check_relocs routine. */ tmp = dir->got.refcount; - if (tmp <= 0) + if (tmp < lowest_valid) { dir->got.refcount = ind->got.refcount; ind->got.refcount = tmp; } else - BFD_ASSERT (ind->got.refcount <= 0); + BFD_ASSERT (ind->got.refcount < lowest_valid); tmp = dir->plt.refcount; - if (tmp <= 0) + if (tmp < lowest_valid) { dir->plt.refcount = ind->plt.refcount; ind->plt.refcount = tmp; } else - BFD_ASSERT (ind->plt.refcount <= 0); + BFD_ASSERT (ind->plt.refcount < lowest_valid); if (dir->dynindx == -1) { @@ -1357,6 +1510,7 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc) table->bucketcount = 0; table->needed = NULL; table->runpath = NULL; + table->loaded = NULL; table->hgot = NULL; table->stab_info = NULL; table->merge_info = NULL; @@ -1576,7 +1730,7 @@ bfd_section_from_shdr (abfd, shindex) Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[shindex]; Elf_Internal_Ehdr *ehdr = elf_elfheader (abfd); struct elf_backend_data *bed = get_elf_backend_data (abfd); - char *name; + const char *name; name = elf_string_from_elf_strtab (abfd, hdr->sh_name); @@ -1587,7 +1741,6 @@ bfd_section_from_shdr (abfd, shindex) return true; case SHT_PROGBITS: /* Normal section with contents. */ - case SHT_DYNAMIC: /* Dynamic linking information. */ case SHT_NOBITS: /* .bss section. */ case SHT_HASH: /* .hash section. */ case SHT_NOTE: /* .note section. */ @@ -1596,6 +1749,39 @@ bfd_section_from_shdr (abfd, shindex) case SHT_PREINIT_ARRAY: /* .preinit_array section. */ return _bfd_elf_make_section_from_shdr (abfd, hdr, name); + case SHT_DYNAMIC: /* Dynamic linking information. */ + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_STRTAB) + { + Elf_Internal_Shdr *dynsymhdr; + + /* The shared libraries distributed with hpux11 have a bogus + sh_link field for the ".dynamic" section. Find the + string table for the ".dynsym" section instead. */ + if (elf_dynsymtab (abfd) != 0) + { + dynsymhdr = elf_elfsections (abfd)[elf_dynsymtab (abfd)]; + hdr->sh_link = dynsymhdr->sh_link; + } + else + { + unsigned int i, num_sec; + + num_sec = elf_numsections (abfd); + for (i = 1; i < num_sec; i++) + { + dynsymhdr = elf_elfsections (abfd)[i]; + if (dynsymhdr->sh_type == SHT_DYNSYM) + { + hdr->sh_link = dynsymhdr->sh_link; + break; + } + } + } + } + break; + case SHT_SYMTAB: /* A symbol table */ if (elf_onesymtab (abfd) == shindex) return true; @@ -1820,7 +2006,12 @@ bfd_section_from_shdr (abfd, shindex) return true; case SHT_GROUP: - /* Make a section for objcopy and relocatable links. */ + /* We need a BFD section for objcopy and relocatable linking, + and it's handy to have the signature available as the section + name. */ + name = group_signature (abfd, hdr); + if (name == NULL) + return false; if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name)) return false; if (hdr->contents != NULL) @@ -1829,6 +2020,10 @@ bfd_section_from_shdr (abfd, shindex) unsigned int n_elt = hdr->sh_size / 4; asection *s; + if (idx->flags & GRP_COMDAT) + hdr->bfd_section->flags + |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; + while (--n_elt != 0) if ((s = (++idx)->shdr->bfd_section) != NULL && elf_next_in_group (s) != NULL) @@ -1861,50 +2056,19 @@ bfd_section_from_r_symndx (abfd, cache, sec, r_symndx) asection *sec; unsigned long r_symndx; { - unsigned char esym_shndx[4]; - unsigned int isym_shndx; Elf_Internal_Shdr *symtab_hdr; - file_ptr pos; - bfd_size_type amt; + unsigned char esym[sizeof (Elf64_External_Sym)]; + Elf_External_Sym_Shndx eshndx; + Elf_Internal_Sym isym; unsigned int ent = r_symndx % LOCAL_SYM_CACHE_SIZE; if (cache->abfd == abfd && cache->indx[ent] == r_symndx) return cache->sec[ent]; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - pos = symtab_hdr->sh_offset; - if (get_elf_backend_data (abfd)->s->sizeof_sym - == sizeof (Elf64_External_Sym)) - { - pos += r_symndx * sizeof (Elf64_External_Sym); - pos += offsetof (Elf64_External_Sym, st_shndx); - amt = sizeof (((Elf64_External_Sym *) 0)->st_shndx); - } - else - { - pos += r_symndx * sizeof (Elf32_External_Sym); - pos += offsetof (Elf32_External_Sym, st_shndx); - amt = sizeof (((Elf32_External_Sym *) 0)->st_shndx); - } - if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) esym_shndx, amt, abfd) != amt) + if (bfd_elf_get_elf_syms (abfd, symtab_hdr, 1, r_symndx, + &isym, esym, &eshndx) == NULL) return NULL; - isym_shndx = H_GET_16 (abfd, esym_shndx); - - if (isym_shndx == SHN_XINDEX) - { - Elf_Internal_Shdr *shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) - { - pos = shndx_hdr->sh_offset; - pos += r_symndx * sizeof (Elf_External_Sym_Shndx); - amt = sizeof (Elf_External_Sym_Shndx); - if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) esym_shndx, amt, abfd) != amt) - return NULL; - isym_shndx = H_GET_32 (abfd, esym_shndx); - } - } if (cache->abfd != abfd) { @@ -1913,10 +2077,10 @@ bfd_section_from_r_symndx (abfd, cache, sec, r_symndx) } cache->indx[ent] = r_symndx; cache->sec[ent] = sec; - if (isym_shndx < SHN_LORESERVE || isym_shndx > SHN_HIRESERVE) + if (isym.st_shndx < SHN_LORESERVE || isym.st_shndx > SHN_HIRESERVE) { asection *s; - s = bfd_section_from_elf_index (abfd, isym_shndx); + s = bfd_section_from_elf_index (abfd, isym.st_shndx); if (s != NULL) cache->sec[ent] = s; } @@ -1988,16 +2152,18 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) asection *newsect; char *name; char namebuf[64]; + size_t len; int split; split = ((hdr->p_memsz > 0) && (hdr->p_filesz > 0) && (hdr->p_memsz > hdr->p_filesz)); sprintf (namebuf, "%s%d%s", typename, index, split ? "a" : ""); - name = bfd_alloc (abfd, (bfd_size_type) strlen (namebuf) + 1); + len = strlen (namebuf) + 1; + name = bfd_alloc (abfd, (bfd_size_type) len); if (!name) return false; - strcpy (name, namebuf); + memcpy (name, namebuf, len); newsect = bfd_make_section (abfd, name); if (newsect == NULL) return false; @@ -2025,10 +2191,11 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) if (split) { sprintf (namebuf, "%s%db", typename, index); - name = bfd_alloc (abfd, (bfd_size_type) strlen (namebuf) + 1); + len = strlen (namebuf) + 1; + name = bfd_alloc (abfd, (bfd_size_type) len); if (!name) return false; - strcpy (name, namebuf); + memcpy (name, namebuf, len); newsect = bfd_make_section (abfd, name); if (newsect == NULL) return false; @@ -2275,10 +2442,23 @@ elf_fake_sections (abfd, asect, failedptrarg) if ((asect->flags & SEC_STRINGS) != 0) this_hdr->sh_flags |= SHF_STRINGS; } - if (elf_group_name (asect) != NULL) + if ((asect->flags & SEC_GROUP) == 0 && elf_group_name (asect) != NULL) this_hdr->sh_flags |= SHF_GROUP; if ((asect->flags & SEC_THREAD_LOCAL) != 0) - this_hdr->sh_flags |= SHF_TLS; + { + this_hdr->sh_flags |= SHF_TLS; + if (asect->_raw_size == 0 && (asect->flags & SEC_HAS_CONTENTS) == 0) + { + struct bfd_link_order *o; + + this_hdr->sh_size = 0; + for (o = asect->link_order_head; o != NULL; o = o->next) + if (this_hdr->sh_size < o->offset + o->size) + this_hdr->sh_size = o->offset + o->size; + if (this_hdr->sh_size) + this_hdr->sh_type = SHT_NOBITS; + } + } /* Check for processor-specific section types. */ if (bed->elf_backend_fake_sections @@ -2299,35 +2479,47 @@ elf_fake_sections (abfd, asect, failedptrarg) /* Fill in the contents of a SHT_GROUP section. */ -static void -set_group_contents (abfd, sec, failedptrarg) +void +bfd_elf_set_group_contents (abfd, sec, failedptrarg) bfd *abfd; asection *sec; - PTR failedptrarg ATTRIBUTE_UNUSED; + PTR failedptrarg; { boolean *failedptr = (boolean *) failedptrarg; unsigned long symindx; - asection *elt; + asection *elt, *first; unsigned char *loc; struct bfd_link_order *l; + boolean gas; if (elf_section_data (sec)->this_hdr.sh_type != SHT_GROUP || *failedptr) return; - /* If called from the assembler, swap_out_syms will have set up - elf_section_syms; If called for "ld -r", the symbols won't yet - be mapped, so emulate elf_bfd_final_link. */ - if (elf_section_syms (abfd) != NULL) - symindx = elf_section_syms (abfd)[sec->index]->udata.i; - else - symindx = elf_section_data (sec)->this_idx; + symindx = 0; + if (elf_group_id (sec) != NULL) + symindx = elf_group_id (sec)->udata.i; + + if (symindx == 0) + { + /* If called from the assembler, swap_out_syms will have set up + elf_section_syms; If called for "ld -r", use target_index. */ + if (elf_section_syms (abfd) != NULL) + symindx = elf_section_syms (abfd)[sec->index]->udata.i; + else + symindx = sec->target_index; + } elf_section_data (sec)->this_hdr.sh_info = symindx; - /* Nor will the contents be allocated for "ld -r". */ + /* The contents won't be allocated for "ld -r" or objcopy. */ + gas = true; if (sec->contents == NULL) { + gas = false; sec->contents = bfd_alloc (abfd, sec->_raw_size); + + /* Arrange for the section to be written out. */ + elf_section_data (sec)->this_hdr.contents = sec->contents; if (sec->contents == NULL) { *failedptr = true; @@ -2337,9 +2529,10 @@ set_group_contents (abfd, sec, failedptrarg) loc = sec->contents + sec->_raw_size; - /* Get the pointer to the first section in the group that we - squirreled away here. */ - elt = elf_next_in_group (sec); + /* Get the pointer to the first section in the group that gas + squirreled away here. objcopy arranges for this to be set to the + start of the input section group. */ + first = elt = elf_next_in_group (sec); /* First element is a flag word. Rest of section is elf section indices for all the sections of the group. Write them backwards @@ -2347,9 +2540,20 @@ set_group_contents (abfd, sec, failedptrarg) directives, not that it matters. */ while (elt != NULL) { + asection *s; + unsigned int idx; + loc -= 4; - H_PUT_32 (abfd, elf_section_data (elt)->this_idx, loc); + s = elt; + if (!gas) + s = s->output_section; + idx = 0; + if (s != NULL) + idx = elf_section_data (s)->this_idx; + H_PUT_32 (abfd, idx, loc); elt = elf_next_in_group (elt); + if (elt == first) + break; } /* If this is a relocatable link, then the above did nothing because @@ -2368,10 +2572,16 @@ set_group_contents (abfd, sec, failedptrarg) } while (elt != elf_next_in_group (l->u.indirect.section)); - loc -= 4; - H_PUT_32 (abfd, 0, loc); + /* With ld -r, merging SHT_GROUP sections results in wasted space + due to allowing for the flag word on each input. We may well + duplicate entries too. */ + while ((loc -= 4) > sec->contents) + H_PUT_32 (abfd, 0, loc); - BFD_ASSERT (loc == sec->contents); + if (loc != sec->contents) + abort (); + + H_PUT_32 (abfd, sec->flags & SEC_LINK_ONCE ? GRP_COMDAT : 0, loc); } /* Assign all ELF section numbers. The dummy first section is handled here @@ -2553,10 +2763,10 @@ assign_section_numbers (abfd) char *alc; len = strlen (sec->name); - alc = (char *) bfd_malloc ((bfd_size_type) len - 2); + alc = (char *) bfd_malloc ((bfd_size_type) (len - 2)); if (alc == NULL) return false; - strncpy (alc, sec->name, len - 3); + memcpy (alc, sec->name, len - 3); alc[len - 3] = '\0'; s = bfd_get_section_by_name (abfd, alc); free (alc); @@ -2565,8 +2775,9 @@ assign_section_numbers (abfd) elf_section_data (s)->this_hdr.sh_link = d->this_idx; /* This is a .stab section. */ - elf_section_data (s)->this_hdr.sh_entsize = - 4 + 2 * bfd_get_arch_size (abfd) / 8; + if (elf_section_data (s)->this_hdr.sh_entsize == 0) + elf_section_data (s)->this_hdr.sh_entsize + = 4 + 2 * bfd_get_arch_size (abfd) / 8; } } break; @@ -2852,9 +3063,9 @@ _bfd_elf_compute_section_file_positions (abfd, link_info) return false; } - if (link_info == NULL || link_info->relocateable) + if (link_info == NULL) { - bfd_map_over_sections (abfd, set_group_contents, &failed); + bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed); if (failed) return false; } @@ -3348,6 +3559,37 @@ assign_file_positions_for_segments (abfd) if (! map_sections_to_segments (abfd)) return false; } + else + { + /* The placement algorithm assumes that non allocated sections are + not in PT_LOAD segments. We ensure this here by removing such + sections from the segment map. */ + for (m = elf_tdata (abfd)->segment_map; + m != NULL; + m = m->next) + { + unsigned int new_count; + unsigned int i; + + if (m->p_type != PT_LOAD) + continue; + + new_count = 0; + for (i = 0; i < m->count; i ++) + { + if ((m->sections[i]->flags & SEC_ALLOC) != 0) + { + if (i != new_count) + m->sections[new_count] = m->sections[i]; + + new_count ++; + } + } + + if (new_count != m->count) + m->count = new_count; + } + } if (bed->elf_backend_modify_segment_map) { @@ -3403,12 +3645,12 @@ assign_file_positions_for_segments (abfd) asection **secpp; /* If elf_segment_map is not from map_sections_to_segments, the - sections may not be correctly ordered. NOTE: sorting should + sections may not be correctly ordered. NOTE: sorting should not be done to the PT_NOTE section of a corefile, which may contain several pseudo-sections artificially created by bfd. Sorting these pseudo-sections breaks things badly. */ - if (m->count > 1 - && !(elf_elfheader (abfd)->e_type == ET_CORE + if (m->count > 1 + && !(elf_elfheader (abfd)->e_type == ET_CORE && m->p_type == PT_NOTE)) qsort (m->sections, (size_t) m->count, sizeof (asection *), elf_sort_sections); @@ -3477,8 +3719,9 @@ assign_file_positions_for_segments (abfd) if (p->p_vaddr < (bfd_vma) off) { - _bfd_error_handler (_("%s: Not enough room for program headers, try linking with -N"), - bfd_get_filename (abfd)); + (*_bfd_error_handler) + (_("%s: Not enough room for program headers, try linking with -N"), + bfd_get_filename (abfd)); bfd_set_error (bfd_error_bad_value); return false; } @@ -3716,6 +3959,11 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a } } + /* If additional nonloadable filepos adjustments are required, + do them now. */ + if (bed->set_nonloadable_filepos) + (*bed->set_nonloadable_filepos) (abfd, phdrs); + /* Clear out any program headers we allocated but did not use. */ for (; count < alloc; count++, p++) { @@ -4274,6 +4522,7 @@ copy_private_bfd_data (ibfd, obfd) bfd_vma maxpagesize; struct elf_segment_map * phdr_adjust_seg = NULL; unsigned int phdr_adjust_num = 0; + struct elf_backend_data * bed; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -4282,6 +4531,7 @@ copy_private_bfd_data (ibfd, obfd) if (elf_tdata (ibfd)->phdr == NULL) return true; + bed = get_elf_backend_data (ibfd); iehdr = elf_elfheader (ibfd); map_first = NULL; @@ -4291,44 +4541,53 @@ copy_private_bfd_data (ibfd, obfd) maxpagesize = get_elf_backend_data (obfd)->maxpagesize; /* Returns the end address of the segment + 1. */ -#define SEGMENT_END(segment, start) \ - (start + (segment->p_memsz > segment->p_filesz \ - ? segment->p_memsz : segment->p_filesz)) +#define SEGMENT_END(segment, start) \ + (start + (segment->p_memsz > segment->p_filesz \ + ? segment->p_memsz : segment->p_filesz)) /* Returns true if the given section is contained within the given segment. VMA addresses are compared. */ -#define IS_CONTAINED_BY_VMA(section, segment) \ - (section->vma >= segment->p_vaddr \ - && (section->vma + section->_raw_size) \ - <= (SEGMENT_END (segment, segment->p_vaddr))) +#define IS_CONTAINED_BY_VMA(section, segment) \ + (section->vma >= segment->p_vaddr \ + && (section->vma + section->_raw_size \ + <= (SEGMENT_END (segment, segment->p_vaddr)))) /* Returns true if the given section is contained within the given segment. LMA addresses are compared. */ -#define IS_CONTAINED_BY_LMA(section, segment, base) \ - (section->lma >= base \ - && (section->lma + section->_raw_size) \ - <= SEGMENT_END (segment, base)) +#define IS_CONTAINED_BY_LMA(section, segment, base) \ + (section->lma >= base \ + && (section->lma + section->_raw_size \ + <= SEGMENT_END (segment, base))) + + /* Returns true if the given section is contained within the + given segment. Filepos addresses are compared in an elf + backend function. */ +#define IS_CONTAINED_BY_FILEPOS(sec, seg, bed) \ + (bed->is_contained_by_filepos \ + && (*bed->is_contained_by_filepos) (sec, seg)) /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */ -#define IS_COREFILE_NOTE(p, s) \ - (p->p_type == PT_NOTE \ - && bfd_get_format (ibfd) == bfd_core \ - && s->vma == 0 && s->lma == 0 \ - && (bfd_vma) s->filepos >= p->p_offset \ - && (bfd_vma) s->filepos + s->_raw_size \ - <= p->p_offset + p->p_filesz) +#define IS_COREFILE_NOTE(p, s) \ + (p->p_type == PT_NOTE \ + && bfd_get_format (ibfd) == bfd_core \ + && s->vma == 0 && s->lma == 0 \ + && (bfd_vma) s->filepos >= p->p_offset \ + && ((bfd_vma) s->filepos + s->_raw_size \ + <= p->p_offset + p->p_filesz)) /* The complicated case when p_vaddr is 0 is to handle the Solaris linker, which generates a PT_INTERP section with p_vaddr and p_memsz set to 0. */ -#define IS_SOLARIS_PT_INTERP(p, s) \ - ( p->p_vaddr == 0 \ - && p->p_filesz > 0 \ - && (s->flags & SEC_HAS_CONTENTS) != 0 \ - && s->_raw_size > 0 \ - && (bfd_vma) s->filepos >= p->p_offset \ - && ((bfd_vma) s->filepos + s->_raw_size \ - <= p->p_offset + p->p_filesz)) +#define IS_SOLARIS_PT_INTERP(p, s) \ + (p->p_vaddr == 0 \ + && p->p_paddr == 0 \ + && p->p_memsz == 0 \ + && p->p_filesz > 0 \ + && (s->flags & SEC_HAS_CONTENTS) != 0 \ + && s->_raw_size > 0 \ + && (bfd_vma) s->filepos >= p->p_offset \ + && ((bfd_vma) s->filepos + s->_raw_size \ + <= p->p_offset + p->p_filesz)) /* Decide if the given section should be included in the given segment. A section will be included if: @@ -4337,23 +4596,25 @@ copy_private_bfd_data (ibfd, obfd) 2. It is an allocated segment, 3. There is an output section associated with it, 4. The section has not already been allocated to a previous segment. */ -#define INCLUDE_SECTION_IN_SEGMENT(section, segment) \ - (((((segment->p_paddr \ - ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ - : IS_CONTAINED_BY_VMA (section, segment)) \ - || IS_SOLARIS_PT_INTERP (segment, section)) \ +#define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \ + ((((segment->p_paddr \ + ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ + : IS_CONTAINED_BY_VMA (section, segment)) \ && (section->flags & SEC_ALLOC) != 0) \ - || IS_COREFILE_NOTE (segment, section)) \ + || IS_COREFILE_NOTE (segment, section) \ + || (IS_CONTAINED_BY_FILEPOS (section, segment, bed) \ + && (section->flags & SEC_ALLOC) == 0)) \ && section->output_section != NULL \ - && section->segment_mark == false) + && ! section->segment_mark) /* Returns true iff seg1 starts after the end of seg2. */ -#define SEGMENT_AFTER_SEGMENT(seg1, seg2) \ - (seg1->p_vaddr >= SEGMENT_END (seg2, seg2->p_vaddr)) +#define SEGMENT_AFTER_SEGMENT(seg1, seg2) \ + (seg1->p_vaddr >= SEGMENT_END (seg2, seg2->p_vaddr)) /* Returns true iff seg1 and seg2 overlap. */ -#define SEGMENT_OVERLAPS(seg1, seg2) \ - (!(SEGMENT_AFTER_SEGMENT (seg1, seg2) || SEGMENT_AFTER_SEGMENT (seg2, seg1))) +#define SEGMENT_OVERLAPS(seg1, seg2) \ + (!(SEGMENT_AFTER_SEGMENT (seg1, seg2) \ + || SEGMENT_AFTER_SEGMENT (seg2, seg1))) /* Initialise the segment mark field. */ for (section = ibfd->sections; section != NULL; section = section->next) @@ -4362,7 +4623,7 @@ copy_private_bfd_data (ibfd, obfd) /* Scan through the segments specified in the program header of the input BFD. For this first scan we look for overlaps in the loadable segments. These can be created by weird - parameters to objcopy. */ + parameters to objcopy. Also, fix some solaris weirdness. */ for (i = 0, segment = elf_tdata (ibfd)->phdr; i < num_segments; i++, segment++) @@ -4370,6 +4631,16 @@ copy_private_bfd_data (ibfd, obfd) unsigned int j; Elf_Internal_Phdr *segment2; + if (segment->p_type == PT_INTERP) + for (section = ibfd->sections; section; section = section->next) + if (IS_SOLARIS_PT_INTERP (segment, section)) + { + /* Mininal change so that the normal section to segment + assigment code will work. */ + segment->p_vaddr = section->vma; + break; + } + if (segment->p_type != PT_LOAD) continue; @@ -4443,7 +4714,7 @@ copy_private_bfd_data (ibfd, obfd) /* Compute how many sections might be placed into this segment. */ section_count = 0; for (section = ibfd->sections; section != NULL; section = section->next) - if (INCLUDE_SECTION_IN_SEGMENT (section, segment)) + if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed)) ++section_count; /* Allocate a segment map big enough to contain all of the @@ -4486,11 +4757,12 @@ copy_private_bfd_data (ibfd, obfd) { /* Special segments, such as the PT_PHDR segment, may contain no sections, but ordinary, loadable segments should contain - something. */ + something. They are allowed by the ELF spec however, so only + a warning is produced. */ if (segment->p_type == PT_LOAD) - _bfd_error_handler - (_("%s: warning: Empty loadable segment detected\n"), - bfd_archive_filename (ibfd)); + (*_bfd_error_handler) + (_("%s: warning: Empty loadable segment detected, is this intentional ?\n"), + bfd_archive_filename (ibfd)); map->count = 0; *pointer_to_map = map; @@ -4527,7 +4799,9 @@ copy_private_bfd_data (ibfd, obfd) pointers that we are interested in. As these sections get assigned to a segment, they are removed from this array. */ - amt = (bfd_size_type) section_count * sizeof (asection *); + /* Gcc 2.96 miscompiles this code on mips. Don't do casting here + to work around this long long bug. */ + amt = section_count * sizeof (asection *); sections = (asection **) bfd_malloc (amt); if (sections == NULL) return false; @@ -4546,7 +4820,7 @@ copy_private_bfd_data (ibfd, obfd) section != NULL; section = section->next) { - if (INCLUDE_SECTION_IN_SEGMENT (section, segment)) + if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed)) { output_section = section->output_section; @@ -4554,9 +4828,11 @@ copy_private_bfd_data (ibfd, obfd) /* The Solaris native linker always sets p_paddr to 0. We try to catch that case here, and set it to the - correct value. */ + correct value. Note - some backends require that + p_paddr be left as zero. */ if (segment->p_paddr == 0 && segment->p_vaddr != 0 + && (! bed->want_p_paddr_set_to_zero) && isec == 0 && output_section->lma != 0 && (output_section->vma == (segment->p_vaddr @@ -4572,7 +4848,11 @@ copy_private_bfd_data (ibfd, obfd) /* Match up the physical address of the segment with the LMA address of the output section. */ if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr) - || IS_COREFILE_NOTE (segment, section)) + || IS_CONTAINED_BY_FILEPOS (section, segment, bed) + || IS_COREFILE_NOTE (segment, section) + || (bed->want_p_paddr_set_to_zero && + IS_CONTAINED_BY_VMA (output_section, segment)) + ) { if (matching_lma == 0) matching_lma = output_section->lma; @@ -4641,7 +4921,7 @@ copy_private_bfd_data (ibfd, obfd) } /* Step Three: Loop over the sections again, this time assigning - those that fit to the current segment and remvoing them from the + those that fit to the current segment and removing them from the sections array; but making sure not to leave large gaps. Once all possible sections have been assigned to the current segment it is added to the list of built segments and if sections still remain @@ -4692,7 +4972,7 @@ copy_private_bfd_data (ibfd, obfd) maxpagesize then we need to start a new segment. */ if ((BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size, maxpagesize) - < BFD_ALIGN (output_section->lma, maxpagesize)) + < BFD_ALIGN (output_section->lma, maxpagesize)) || ((prev_sec->lma + prev_sec->_raw_size) > output_section->lma)) { @@ -4805,6 +5085,7 @@ copy_private_bfd_data (ibfd, obfd) #undef SEGMENT_END #undef IS_CONTAINED_BY_VMA #undef IS_CONTAINED_BY_LMA +#undef IS_CONTAINED_BY_FILEPOS #undef IS_COREFILE_NOTE #undef IS_SOLARIS_PT_INTERP #undef INCLUDE_SECTION_IN_SEGMENT @@ -4824,6 +5105,7 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) asection *osec; { Elf_Internal_Shdr *ihdr, *ohdr; + const struct elf_backend_data *bed = get_elf_backend_data (ibfd); if (ibfd->xvec->flavour != bfd_target_elf_flavour || obfd->xvec->flavour != bfd_target_elf_flavour) @@ -4833,24 +5115,31 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) This must be done here, rather than in the copy_private_bfd_data entry point, because the latter is called after the section contents have been set, which means that the program headers have - already been worked out. */ - if (elf_tdata (obfd)->segment_map == NULL - && elf_tdata (ibfd)->phdr != NULL) + already been worked out. The backend function provides a way to + override the test conditions and code path for the call to + copy_private_bfd_data. */ + if (bed->copy_private_bfd_data_p) { - asection *s; + if ((*bed->copy_private_bfd_data_p) (ibfd, isec, obfd, osec)) + if (! copy_private_bfd_data (ibfd, obfd)) + return false; + } + else if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL) + { + asection *s; - /* Only set up the segments if there are no more SEC_ALLOC - sections. FIXME: This won't do the right thing if objcopy is - used to remove the last SEC_ALLOC section, since objcopy - won't call this routine in that case. */ - for (s = isec->next; s != NULL; s = s->next) - if ((s->flags & SEC_ALLOC) != 0) - break; - if (s == NULL) - { - if (! copy_private_bfd_data (ibfd, obfd)) - return false; - } + /* Only set up the segments if there are no more SEC_ALLOC + sections. FIXME: This won't do the right thing if objcopy is + used to remove the last SEC_ALLOC section, since objcopy + won't call this routine in that case. */ + for (s = isec->next; s != NULL; s = s->next) + if ((s->flags & SEC_ALLOC) != 0) + break; + if (s == NULL) + { + if (! copy_private_bfd_data (ibfd, obfd)) + return false; + } } ihdr = &elf_section_data (isec)->this_hdr; @@ -4864,6 +5153,12 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) || ihdr->sh_type == SHT_GNU_verdef) ohdr->sh_info = ihdr->sh_info; + /* Set things up for objcopy. The output SHT_GROUP section will + have its elf_next_in_group pointing back to the input group + members. */ + elf_next_in_group (osec) = elf_next_in_group (isec); + elf_group_name (osec) = elf_group_name (isec); + elf_section_data (osec)->use_rela_p = elf_section_data (isec)->use_rela_p; @@ -4972,10 +5267,9 @@ swap_out_syms (abfd, sttp, relocatable_p) if (symtab_shndx_hdr->sh_name != 0) { amt = (bfd_size_type) (1 + symcount) * sizeof (Elf_External_Sym_Shndx); - outbound_shndx = bfd_alloc (abfd, amt); + outbound_shndx = bfd_zalloc (abfd, amt); if (outbound_shndx == NULL) return false; - memset (outbound_shndx, 0, (unsigned long) amt); symtab_shndx_hdr->contents = outbound_shndx; symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX; symtab_shndx_hdr->sh_size = amt; @@ -5786,8 +6080,8 @@ _bfd_elf_set_section_contents (abfd, section, location, offset, count) bfd_signed_vma pos; if (! abfd->output_has_begun - && ! _bfd_elf_compute_section_file_positions - (abfd, (struct bfd_link_info *) NULL)) + && ! (_bfd_elf_compute_section_file_positions + (abfd, (struct bfd_link_info *) NULL))) return false; hdr = &elf_section_data (section)->this_hdr; @@ -6010,15 +6304,17 @@ _bfd_elfcore_make_pseudosection (abfd, name, size, filepos) { char buf[100]; char *threaded_name; + size_t len; asection *sect; /* Build the section name. */ sprintf (buf, "%s/%d", name, elfcore_make_pid (abfd)); - threaded_name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + len = strlen (buf) + 1; + threaded_name = bfd_alloc (abfd, (bfd_size_type) len); if (threaded_name == NULL) return false; - strcpy (threaded_name, buf); + memcpy (threaded_name, buf, len); sect = bfd_make_section (abfd, threaded_name); if (sect == NULL) @@ -6303,6 +6599,7 @@ elfcore_grok_lwpstatus (abfd, note) lwpstatus_t lwpstat; char buf[100]; char *name; + size_t len; asection *sect; if (note->descsz != sizeof (lwpstat) @@ -6320,10 +6617,11 @@ elfcore_grok_lwpstatus (abfd, note) /* Make a ".reg/999" section. */ sprintf (buf, ".reg/%d", elfcore_make_pid (abfd)); - name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + len = strlen (buf) + 1; + name = bfd_alloc (abfd, (bfd_size_type) len); if (name == NULL) return false; - strcpy (name, buf); + memcpy (name, buf, len); sect = bfd_make_section (abfd, name); if (sect == NULL) @@ -6349,10 +6647,11 @@ elfcore_grok_lwpstatus (abfd, note) /* Make a ".reg2/999" section */ sprintf (buf, ".reg2/%d", elfcore_make_pid (abfd)); - name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + len = strlen (buf) + 1; + name = bfd_alloc (abfd, (bfd_size_type) len); if (name == NULL) return false; - strcpy (name, buf); + memcpy (name, buf, len); sect = bfd_make_section (abfd, name); if (sect == NULL) @@ -6384,6 +6683,7 @@ elfcore_grok_win32pstatus (abfd, note) { char buf[30]; char *name; + size_t len; asection *sect; win32_pstatus_t pstatus; @@ -6404,11 +6704,12 @@ elfcore_grok_win32pstatus (abfd, note) /* Make a ".reg/999" section. */ sprintf (buf, ".reg/%d", pstatus.data.thread_info.tid); - name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + len = strlen (buf) + 1; + name = bfd_alloc (abfd, (bfd_size_type) len); if (name == NULL) return false; - strcpy (name, buf); + memcpy (name, buf, len); sect = bfd_make_section (abfd, name); if (sect == NULL) @@ -6430,11 +6731,12 @@ elfcore_grok_win32pstatus (abfd, note) /* Make a ".module/xxxxxxxx" section. */ sprintf (buf, ".module/%08x", pstatus.data.module_info.base_address); - name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1); + len = strlen (buf) + 1; + name = bfd_alloc (abfd, (bfd_size_type) len); if (name == NULL) return false; - strcpy (name, buf); + memcpy (name, buf, len); sect = bfd_make_section (abfd, name); @@ -6568,7 +6870,7 @@ elfcore_grok_netbsd_note (abfd, note) find this note before any of the others, which is fine, since the kernel writes this note out first when it creates a core file. */ - + return elfcore_grok_netbsd_procinfo (abfd, note); } @@ -6576,7 +6878,7 @@ elfcore_grok_netbsd_note (abfd, note) defined for NetBSD core files. If the note type is less than the start of the machine-dependent note types, we don't understand it. */ - + if (note->type < NT_NETBSDCORE_FIRSTMACH) return true; @@ -6621,7 +6923,7 @@ elfcore_grok_netbsd_note (abfd, note) /* Function: elfcore_write_note - Inputs: + Inputs: buffer to hold note name of note type of note @@ -6636,16 +6938,30 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size) bfd *abfd; char *buf; int *bufsiz; - char *name; + const char *name; int type; - void *input; + const PTR input; int size; { Elf_External_Note *xnp; - int namesz = strlen (name); - int newspace = BFD_ALIGN (sizeof (Elf_External_Note) + size + namesz - 1, 4); + size_t namesz; + size_t pad; + size_t newspace; char *p, *dest; + namesz = 0; + pad = 0; + if (name != NULL) + { + struct elf_backend_data *bed; + + namesz = strlen (name) + 1; + bed = get_elf_backend_data (abfd); + pad = -namesz & (bed->s->file_align - 1); + } + + newspace = sizeof (Elf_External_Note) - 1 + namesz + pad + size; + p = realloc (buf, *bufsiz + newspace); dest = p + *bufsiz; *bufsiz += newspace; @@ -6653,8 +6969,18 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size) H_PUT_32 (abfd, namesz, xnp->namesz); H_PUT_32 (abfd, size, xnp->descsz); H_PUT_32 (abfd, type, xnp->type); - strcpy (xnp->name, name); - memcpy (xnp->name + BFD_ALIGN (namesz, 4), input, size); + dest = xnp->name; + if (name != NULL) + { + memcpy (dest, name, namesz); + dest += namesz; + while (pad != 0) + { + *dest++ = '\0'; + --pad; + } + } + memcpy (dest, input, size); return p; } @@ -6664,8 +6990,8 @@ elfcore_write_prpsinfo (abfd, buf, bufsiz, fname, psargs) bfd *abfd; char *buf; int *bufsiz; - char *fname; - char *psargs; + const char *fname; + const char *psargs; { int note_type; char *note_name = "CORE"; @@ -6681,7 +7007,7 @@ elfcore_write_prpsinfo (abfd, buf, bufsiz, fname, psargs) memset (&data, 0, sizeof (data)); strncpy (data.pr_fname, fname, sizeof (data.pr_fname)); strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs)); - return elfcore_write_note (abfd, buf, bufsiz, + return elfcore_write_note (abfd, buf, bufsiz, note_name, note_type, &data, sizeof (data)); } #endif /* PSINFO_T or PRPSINFO_T */ @@ -6694,7 +7020,7 @@ elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs) int *bufsiz; long pid; int cursig; - void *gregs; + const PTR gregs; { prstatus_t prstat; char *note_name = "CORE"; @@ -6703,7 +7029,7 @@ elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs) prstat.pr_pid = pid; prstat.pr_cursig = cursig; memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg)); - return elfcore_write_note (abfd, buf, bufsiz, + return elfcore_write_note (abfd, buf, bufsiz, note_name, NT_PRSTATUS, &prstat, sizeof (prstat)); } #endif /* HAVE_PRSTATUS_T */ @@ -6716,7 +7042,7 @@ elfcore_write_lwpstatus (abfd, buf, bufsiz, pid, cursig, gregs) int *bufsiz; long pid; int cursig; - void *gregs; + const PTR gregs; { lwpstatus_t lwpstat; char *note_name = "CORE"; @@ -6735,7 +7061,7 @@ elfcore_write_lwpstatus (abfd, buf, bufsiz, pid, cursig, gregs) gregs, sizeof (lwpstat.pr_context.uc_mcontext.__gregs)); #endif #endif - return elfcore_write_note (abfd, buf, bufsiz, note_name, + return elfcore_write_note (abfd, buf, bufsiz, note_name, NT_LWPSTATUS, &lwpstat, sizeof (lwpstat)); } #endif /* HAVE_LWPSTATUS_T */ @@ -6748,14 +7074,14 @@ elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs) int *bufsiz; long pid; int cursig; - void *gregs; + const PTR gregs; { pstatus_t pstat; char *note_name = "CORE"; memset (&pstat, 0, sizeof (pstat)); pstat.pr_pid = pid & 0xffff; - buf = elfcore_write_note (abfd, buf, bufsiz, note_name, + buf = elfcore_write_note (abfd, buf, bufsiz, note_name, NT_PSTATUS, &pstat, sizeof (pstat)); return buf; } @@ -6766,11 +7092,11 @@ elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size) bfd *abfd; char *buf; int *bufsiz; - void *fpregs; + const PTR fpregs; int size; { char *note_name = "CORE"; - return elfcore_write_note (abfd, buf, bufsiz, + return elfcore_write_note (abfd, buf, bufsiz, note_name, NT_FPREGSET, fpregs, size); } @@ -6779,11 +7105,11 @@ elfcore_write_prxfpreg (abfd, buf, bufsiz, xfpregs, size) bfd *abfd; char *buf; int *bufsiz; - void *xfpregs; + const PTR xfpregs; int size; { char *note_name = "LINUX"; - return elfcore_write_note (abfd, buf, bufsiz, + return elfcore_write_note (abfd, buf, bufsiz, note_name, NT_PRXFPREG, xfpregs, size); } @@ -6964,7 +7290,7 @@ _bfd_elf_reloc_type_class (rela) return reloc_class_normal; } -/* For RELA architectures, return what the relocation value for +/* For RELA architectures, return the relocation value for a relocation against a local symbol. */ bfd_vma @@ -7003,7 +7329,7 @@ _bfd_elf_rel_local_sym (abfd, sym, psec, addend) Elf_Internal_Sym *sym; asection **psec; bfd_vma addend; -{ +{ asection *sec = *psec; if (elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_MERGE) diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index ad7247a..ff5c5f4 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -235,7 +235,7 @@ arc_elf_b22_pcrel (abfd, reloc_entry, symbol, data, input_section, return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); } - + #define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec #define TARGET_LITTLE_NAME "elf32-littlearc" #define TARGET_BIG_SYM bfd_elf32_bigarc_vec diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 8b9bf07..bfc1aa6 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -42,10 +42,6 @@ static struct elf_link_hash_entry *find_thumb_glue PARAMS ((struct bfd_link_info *, const char *, bfd *)); static struct elf_link_hash_entry *find_arm_glue PARAMS ((struct bfd_link_info *, const char *, bfd *)); -static void record_arm_to_thumb_glue - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static void record_thumb_to_arm_glue - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static void elf32_arm_post_process_headers PARAMS ((bfd *, struct bfd_link_info *)); static int elf32_arm_to_thumb_stub @@ -58,7 +54,7 @@ static boolean elf32_arm_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static asection * elf32_arm_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf32_arm_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -84,15 +80,22 @@ static struct bfd_hash_entry * elf32_arm_link_hash_newfunc static void arm_add_to_rel PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma)); #endif +static enum elf_reloc_type_class elf32_arm_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); +#ifndef ELFARM_NABI_C_INCLUDED +static void record_arm_to_thumb_glue + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static void record_thumb_to_arm_glue + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); boolean bfd_elf32_arm_allocate_interworking_sections PARAMS ((struct bfd_link_info *)); boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); boolean bfd_elf32_arm_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *, int)); -static enum elf_reloc_type_class elf32_arm_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); +#endif + #define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) @@ -367,6 +370,7 @@ static const insn16 t2a4_bx_insn = 0x4730; static const insn32 t2a5_pop_insn = 0xe8bd4040; static const insn32 t2a6_bx_insn = 0xe12fff1e; +#ifndef ELFARM_NABI_C_INCLUDED boolean bfd_elf32_arm_allocate_interworking_sections (info) struct bfd_link_info * info; @@ -547,31 +551,22 @@ record_thumb_to_arm_glue (link_info, h) return; } -/* Select a BFD to be used to hold the sections used by the glue code. - This function is called from the linker scripts in ld/emultempl/ - {armelf/pe}.em */ +/* Add the glue sections to ABFD. This function is called from the + linker scripts in ld/emultempl/{armelf}.em. */ boolean -bfd_elf32_arm_get_bfd_for_interworking (abfd, info) +bfd_elf32_arm_add_glue_sections_to_bfd (abfd, info) bfd *abfd; struct bfd_link_info *info; { - struct elf32_arm_link_hash_table *globals; flagword flags; asection *sec; - /* If we are only performing a partial link do not bother - getting a bfd to hold the glue. */ + /* If we are only performing a partial + link do not bother adding the glue. */ if (info->relocateable) return true; - globals = elf32_arm_hash_table (info); - - BFD_ASSERT (globals != NULL); - - if (globals->bfd_of_glue_owner != NULL) - return true; - sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME); if (sec == NULL) @@ -609,6 +604,32 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info) sec->gc_mark = 1; } + return true; +} + +/* Select a BFD to be used to hold the sections used by the glue code. + This function is called from the linker scripts in ld/emultempl/ + {armelf/pe}.em */ + +boolean +bfd_elf32_arm_get_bfd_for_interworking (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elf32_arm_link_hash_table *globals; + + /* If we are only performing a partial link + do not bother getting a bfd to hold the glue. */ + if (info->relocateable) + return true; + + globals = elf32_arm_hash_table (info); + + BFD_ASSERT (globals != NULL); + + if (globals->bfd_of_glue_owner != NULL) + return true; + /* Save the bfd for later use. */ globals->bfd_of_glue_owner = abfd; @@ -622,12 +643,9 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) int no_pipeline_knowledge; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Rela *internal_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *contents = NULL; - bfd_byte *free_contents = NULL; - Elf32_External_Sym *extsyms = NULL; - Elf32_External_Sym *free_extsyms = NULL; asection *sec; struct elf32_arm_link_hash_table *globals; @@ -660,13 +678,15 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Load the relocs. */ - irel = (_bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, false)); + internal_relocs + = _bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, false); - BFD_ASSERT (irel != 0); + if (internal_relocs == NULL) + goto error_return; - irelend = irel + sec->reloc_count; - for (; irel < irelend; irel++) + irelend = internal_relocs + sec->reloc_count; + for (irel = internal_relocs; irel < irelend; irel++) { long r_type; unsigned long r_index; @@ -694,37 +714,12 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) if (contents == NULL) goto error_return; - free_contents = contents; - if (!bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) goto error_return; } } - /* Read this BFD's symbols if we haven't done so already. */ - if (extsyms == NULL) - { - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - extsyms = ((Elf32_External_Sym *) - bfd_malloc (symtab_hdr->sh_size)); - if (extsyms == NULL) - goto error_return; - - free_extsyms = extsyms; - - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_bread (extsyms, symtab_hdr->sh_size, abfd) - != symtab_hdr->sh_size)) - goto error_return; - } - } - /* If the relocation is not against a symbol it cannot concern us. */ h = NULL; @@ -764,20 +759,31 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) break; } } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + contents = NULL; + + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + internal_relocs = NULL; } return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (free_extsyms != NULL) - free (free_extsyms); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return false; } +#endif /* The thumb form of a long branch is a bit finicky, because the offset encoding is split over two fields, each in it's own instruction. They @@ -1523,7 +1529,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); relocation |= (bfd_get_16 (input_bfd, hit_data) & (~ howto->dst_mask)); - + bfd_put_16 (input_bfd, relocation, hit_data); /* Assumes two's complement. */ @@ -1532,7 +1538,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; } - + case R_ARM_GNU_VTINHERIT: case R_ARM_GNU_VTENTRY: return bfd_reloc_ok; @@ -1557,7 +1563,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, if (sgot == NULL) return bfd_reloc_notsupported; - /* If we are addressing a Thumb function, we need to adjust the + /* If we are addressing a Thumb function, we need to adjust the address by one, so that attempts to call the function pointer will correctly interpret it as Thumb code. */ if (sym_flags == STT_ARM_TFUNC) @@ -2206,7 +2212,7 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) asection *sec; /* Check if we have the same endianess. */ - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -2357,7 +2363,7 @@ ERROR: %s uses hardware FP, whereas %s uses software FP"), _bfd_error_handler (_("\ Warning: %s supports interworking, whereas %s does not"), bfd_archive_filename (ibfd), - bfd_get_filename (obfd)); + bfd_get_filename (obfd)); } else { @@ -2512,8 +2518,8 @@ elf32_arm_get_symbol_type (elf_sym, type) } static asection * -elf32_arm_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf32_arm_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -2543,9 +2549,7 @@ elf32_arm_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -3610,7 +3614,9 @@ elf32_arm_reloc_type_class (rela) #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM +#ifndef ELF_MAXPAGESIZE #define ELF_MAXPAGESIZE 0x8000 +#endif #define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data #define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data @@ -3645,3 +3651,4 @@ elf32_arm_reloc_type_class (rela) #define elf_backend_plt_header_size PLT_ENTRY_SIZE #include "elf32-target.h" + diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index 61f28e6..42683682 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -1,5 +1,5 @@ /* AVR-specific support for 32-bit ELF - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Denis Chertykov <denisc@overta.ru> This file is part of BFD, the Binary File Descriptor library. @@ -29,7 +29,7 @@ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static void avr_info_to_howto_rela PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); static asection *elf32_avr_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf32_avr_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -46,9 +46,6 @@ static boolean elf32_avr_relocate_section static void bfd_elf_avr_final_write_processing PARAMS ((bfd *, boolean)); static boolean elf32_avr_object_p PARAMS ((bfd *)); -/* Use RELA instead of REL */ -#undef USE_REL - static reloc_howto_type elf_avr_howto_table[] = { HOWTO (R_AVR_NONE, /* type */ @@ -399,8 +396,8 @@ avr_info_to_howto_rela (abfd, cache_ptr, dst) } static asection * -elf32_avr_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf32_avr_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -426,9 +423,7 @@ elf32_avr_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -724,6 +719,9 @@ elf32_avr_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; + if (info->relocateable) + return true; + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -740,30 +738,9 @@ elf32_avr_relocate_section (output_bfd, info, input_bfd, input_section, const char * name = NULL; int r_type; + /* This is a final link. */ r_type = ELF32_R_TYPE (rel->r_info); r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections [r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - - /* This is a final link. */ howto = elf_avr_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; sym = NULL; @@ -954,6 +931,7 @@ elf32_avr_object_p (abfd) #define elf_backend_gc_sweep_hook elf32_avr_gc_sweep_hook #define elf_backend_check_relocs elf32_avr_check_relocs #define elf_backend_can_gc_sections 1 +#define elf_backend_rela_normal 1 #define elf_backend_final_write_processing \ bfd_elf_avr_final_write_processing #define elf_backend_object_p elf32_avr_object_p diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index ab72483..8eff52d 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -52,7 +52,7 @@ static boolean cris_elf_gc_sweep_hook const Elf_Internal_Rela *)); static asection * cris_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean cris_elf_object_p PARAMS ((bfd *)); @@ -547,7 +547,7 @@ cris_elf_grok_psinfo (abfd, note) static const bfd_byte elf_cris_plt0_entry[PLT_ENTRY_SIZE] = { 0xfc, 0xe1, - 0x7e, 0x7e, /* push mof. */ + 0x7e, 0x7e, /* push mof. */ 0x7f, 0x0d, /* (dip [pc+]) */ 0, 0, 0, 0, /* Replaced with address of .got + 4. */ 0x30, 0x7a, /* move [...],mof */ @@ -799,17 +799,15 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; + if (info->relocateable) + return true; + dynobj = elf_hash_table (info)->dynobj; local_got_offsets = elf_local_got_offsets (input_bfd); symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; - /* It seems this can happen with erroneous or unsupported input (mixing - a.out and elf in an archive, for example.) */ - if (sym_hashes == NULL) - return false; - sgot = NULL; splt = NULL; sreloc = NULL; @@ -838,29 +836,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_CRIS_GNU_VTENTRY) continue; - r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections [r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - /* This is a final link. */ + r_symndx = ELF32_R_SYM (rel->r_info); howto = cris_elf_howto_table + r_type; h = NULL; sym = NULL; @@ -879,6 +856,11 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else { + /* It seems this can happen with erroneous or unsupported input + (mixing a.out and elf in an archive, for example.) */ + if (sym_hashes == NULL) + return false; + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; while (h->root.type == bfd_link_hash_indirect @@ -1046,29 +1028,28 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) { /* This wasn't checked above for ! info->shared, but - must hold there if we get here; the symbol must not - be used in, or defined by a DSO. (Note that - checking for ELF_LINK_HASH_DEF_REGULAR doesn't - catch all cases.) */ - BFD_ASSERT (info->shared + must hold there if we get here; the symbol must be + defined in the regular program, or be undefweak. */ + BFD_ASSERT (!elf_hash_table (info)->dynamic_sections_created + || info->shared || (h->elf_link_hash_flags - & (ELF_LINK_HASH_REF_DYNAMIC - | ELF_LINK_HASH_DEF_DYNAMIC)) == 0); + & ELF_LINK_HASH_DEF_REGULAR) != 0 + || h->root.type == bfd_link_hash_undefweak); /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file, or we're not creating a - dynamic object and the symbol isn't referred to by - a dynamic object. We must initialize - this entry in the global offset table. Since - the offset must always be a multiple of 4, we - use the least significant bit to record whether - we have initialized it already. - - When doing a dynamic link, we create a .rela.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ + -Bsymbolic link and the symbol is defined locally, + or is undefweak, or the symbol was forced to be + local because of a version file, or we're not + creating a dynamic object. We must initialize this + entry in the global offset table. Since the offset + must always be a multiple of 4, we use the least + significant bit to record whether we have + initialized it already. + + If this GOT entry should be runtime-initialized, we + will create a .rela.got relocation entry to + initialize the value. This is done in the + finish_dynamic_symbol routine. */ if ((off & 1) != 0) off &= ~1; else @@ -1150,7 +1131,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_CRIS_32_GOTREL: /* This relocation must only be performed against local symbols. */ - if (h != NULL) + if (h != NULL && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) { (*_bfd_error_handler) (_("%s: relocation %s is not allowed for global symbol: `%s' from %s section"), @@ -1190,7 +1171,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Resolve a PLT_PCREL reloc against a local symbol directly, without using the procedure linkage table. */ - if (h == NULL) + if (h == NULL || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) break; if (h->plt.offset == (bfd_vma) -1 @@ -1215,7 +1196,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Resolve a PLT_GOTREL reloc against a local symbol directly, without using the procedure linkage table. */ - if (h == NULL) + if (h == NULL || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) break; if (h->plt.offset == (bfd_vma) -1 @@ -1237,7 +1218,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_CRIS_16_PCREL: case R_CRIS_32_PCREL: /* If the symbol was local, we need no shlib-specific handling. */ - if (h == NULL) + if (h == NULL || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) break; /* Fall through. */ @@ -1561,9 +1542,13 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym) } /* We don't emit .got relocs for symbols that aren't in the - dynamic-symbols table for an ordinary program. */ + dynamic-symbols table for an ordinary program and are either defined + by the program or are undefined weak symbols. */ if (h->got.offset != (bfd_vma) -1 - && (info->shared || h->dynindx != -1)) + && (info->shared + || (h->dynindx != -1 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + && h->root.type != bfd_link_hash_undefweak))) { asection *sgot; asection *srela; @@ -1770,8 +1755,8 @@ elf_cris_finish_dynamic_sections (output_bfd, info) relocation. */ static asection * -cris_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd * abfd; +cris_elf_gc_mark_hook (sec, info, rel, h, sym) + asection * sec; struct bfd_link_info * info ATTRIBUTE_UNUSED; Elf_Internal_Rela * rel; struct elf_link_hash_entry * h; @@ -1801,9 +1786,7 @@ cris_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1900,7 +1883,8 @@ cris_elf_gc_sweep_hook (abfd, info, sec, relocs) if (r_symndx >= symtab_hdr->sh_info) { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) + if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + && h->plt.refcount > 0) --h->plt.refcount; } break; @@ -2068,23 +2052,23 @@ elf_cris_adjust_dynamic_symbol (info, h) if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { + /* If we link a program (not a DSO), we'll get rid of unnecessary + PLT entries; we point to the actual symbols -- even for pic + relocs, because a program built with -fpic should have the same + result as one built without -fpic, specifically considering weak + symbols. + FIXME: m68k and i386 differ here, for unclear reasons. */ if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 - /* We must always create the plt entry if it was referenced by a - PLT relocation. In this case we already recorded it as a - dynamic symbol. */ - /* FIXME: m68k and i386 differ here, for unclear reasons. */ - && h->dynindx == -1) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0) { /* This case can occur if we saw a PLT reloc in an input file, - but the symbol was never referred to by a dynamic object. In - such a case, we don't actually need to build a procedure - linkage table, and we can just do a PC reloc instead, or + but the symbol was not defined by a dynamic object. In such + a case, we don't actually need to build a procedure linkage + table, and we can just do an absolute or PC reloc instead, or change a .got.plt index to a .got index for GOTPLT relocs. */ BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; h->plt.offset = (bfd_vma) -1; - return elf_cris_adjust_gotplt_to_got ((struct elf_cris_link_hash_entry *) h, @@ -2122,9 +2106,7 @@ elf_cris_adjust_dynamic_symbol (info, h) /* If this symbol is not defined in a regular file, and we are not generating a shared library, then set the symbol to this - location in the .plt. This is required to make function - pointers compare as equal between the normal executable and - the shared library. */ + location in the .plt. */ if (!info->shared && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -2488,7 +2470,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs) /* If this is a local symbol, we resolve it directly without creating a procedure linkage table entry. */ - if (h == NULL) + if (h == NULL || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) continue; h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; @@ -2527,7 +2509,8 @@ cris_elf_check_relocs (abfd, info, sec, relocs) /* Make sure a plt entry is created for this symbol if it turns out to be a function defined by a dynamic object. */ - h->plt.refcount++; + if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + h->plt.refcount++; } /* If we are creating a shared library and this is not a local @@ -2560,7 +2543,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs) || r_type == R_CRIS_32_PCREL) { /* If the symbol is local, then we can eliminate the reloc. */ - if (h == NULL) + if (h == NULL || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) break; /* If this is with -Bsymbolic and the symbol isn't weak, and @@ -2907,10 +2890,9 @@ elf_cris_discard_excess_program_dynamics (h, inf) /* If we're not creating a shared library and have a symbol which is referred to by .got references, but the symbol is defined locally, - (or rather, not referred to by a DSO and not defined by a DSO) then - lose the reloc for the .got (don't allocate room for it). */ - if ((h->root.elf_link_hash_flags - & (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_DEF_DYNAMIC)) == 0) + (or rather, not not defined by a DSO) then lose the reloc for the + .got (don't allocate room for it). */ + if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0) { if (h->root.got.refcount > 0 /* The size of this section is only valid and in sync with the @@ -2935,7 +2917,8 @@ elf_cris_discard_excess_program_dynamics (h, inf) functions; doing this for all symbols would presumably not introduce new problems. Of course we don't do this if we're exporting all dynamic symbols. */ - if (! info->export_dynamic) + if (! info->export_dynamic + && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) { h->root.dynindx = -1; _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, @@ -3003,7 +2986,7 @@ cris_elf_merge_private_bfd_data (ibfd, obfd) { flagword old_flags, new_flags; - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -3113,6 +3096,7 @@ elf_cris_reloc_type_class (rela) take the easy route. */ #define elf_backend_may_use_rel_p 0 #define elf_backend_may_use_rela_p 1 +#define elf_backend_rela_normal 1 #include "elf32-target.h" diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c index cd06244..1dec0b0 100644 --- a/bfd/elf32-d10v.c +++ b/bfd/elf32-d10v.c @@ -1,5 +1,5 @@ /* D10V-specific support for 32-bit ELF - Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -29,7 +29,7 @@ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static void d10v_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); static asection * elf32_d10v_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf32_d10v_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -67,10 +67,10 @@ static reloc_howto_type elf_d10v_howto_table[] = HOWTO (R_D10V_10_PCREL_R, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ + 7, /* bitsize */ true, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ + complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_D10V_10_PCREL_R", /* name */ false, /* partial_inplace */ @@ -83,10 +83,10 @@ static reloc_howto_type elf_d10v_howto_table[] = HOWTO (R_D10V_10_PCREL_L, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ + 7, /* bitsize */ true, /* pc_relative */ 15, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ + complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_D10V_10_PCREL_L", /* name */ false, /* partial_inplace */ @@ -128,10 +128,10 @@ static reloc_howto_type elf_d10v_howto_table[] = HOWTO (R_D10V_18_PCREL, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ + 15, /* bitsize */ true, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ + complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_D10V_18_PCREL", /* name */ false, /* partial_inplace */ @@ -240,12 +240,12 @@ d10v_info_to_howto_rel (abfd, cache_ptr, dst) } static asection * -elf32_d10v_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf32_d10v_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; { if (h != NULL) { @@ -271,9 +271,8 @@ elf32_d10v_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + return NULL; } diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c index 4d26b92..f2f3946 100644 --- a/bfd/elf32-d30v.c +++ b/bfd/elf32-d30v.c @@ -1,5 +1,6 @@ /* D30V-specific support for 32-bit ELF - Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -313,7 +314,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ - if (howto->pc_relative == true) + if (howto->pc_relative) { tmp_addr = input_section->output_section->vma + input_section->output_offset + reloc_entry->address; @@ -332,7 +333,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, relocation += num; - if (howto->pc_relative == true && howto->bitsize == 32) + if (howto->pc_relative && howto->bitsize == 32) { /* The D30V has a PC that doesn't wrap and PC-relative jumps are signed, so a PC-relative jump can't be more than +/- 2^31 bytes. @@ -422,11 +423,11 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ - if (howto->pc_relative == true) + if (howto->pc_relative) { relocation -= (input_section->output_section->vma + input_section->output_offset); - if (howto->pcrel_offset == true) + if (howto->pcrel_offset) relocation -= reloc_entry->address; } diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c index d7d419c..91d75f3 100644 --- a/bfd/elf32-dlx.c +++ b/bfd/elf32-dlx.c @@ -488,7 +488,7 @@ elf32_dlx_relocate26 (abfd, reloc_entry, symbol, data, /* A mapping from BFD reloc types to DLX ELF reloc types. Stolen from elf32-mips.c. - + More about this table - for dlx elf relocation we do not really need this table, if we have a rtype defined in this table will caused tc_gen_relocate confused and die on us, but if we remove @@ -500,7 +500,7 @@ struct elf_reloc_map enum elf_dlx_reloc_type elf_reloc_val; }; -static CONST struct elf_reloc_map dlx_reloc_map[] = +static const struct elf_reloc_map dlx_reloc_map[] = { { BFD_RELOC_NONE, R_DLX_NONE }, { BFD_RELOC_16, R_DLX_RELOC_16 }, diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c index e1bc741..07453cf 100644 --- a/bfd/elf32-fr30.c +++ b/bfd/elf32-fr30.c @@ -42,7 +42,7 @@ static boolean fr30_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection * fr30_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean fr30_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -468,9 +468,6 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca } /* Relocate an FR30 ELF section. - There is some attempt to make this function usable for many architectures, - both USE_REL and USE_RELA ['twould be nice if such a critter existed], - if only to serve as a learning tool. The RELOCATE_SECTION function is called by the new ELF backend linker to handle the relocations for a section. @@ -664,8 +661,8 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation. */ static asection * -fr30_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd * abfd; +fr30_elf_gc_mark_hook (sec, info, rel, h, sym) + asection * sec; struct bfd_link_info * info ATTRIBUTE_UNUSED; Elf_Internal_Rela * rel; struct elf_link_hash_entry * h; @@ -695,9 +692,7 @@ fr30_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index cc26b96..c818795 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -51,7 +51,7 @@ static bfd_reloc_status_type frv_final_link_relocate static boolean elf32_frv_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection * elf32_frv_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf32_frv_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static int elf32_frv_machine PARAMS ((bfd *)); @@ -621,9 +621,6 @@ frv_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocat /* Relocate an FRV ELF section. - There is some attempt to make this function usable for many architectures, - both USE_REL and USE_RELA ['twould be nice if such a critter existed], - if only to serve as a learning tool. The RELOCATE_SECTION function is called by the new ELF backend linker to handle the relocations for a section. @@ -655,7 +652,7 @@ frv_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocat static boolean elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) + contents, relocs, local_syms, local_sections) bfd * output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info * info; bfd * input_bfd; @@ -670,6 +667,9 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; + if (info->relocateable) + return true; + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; @@ -692,29 +692,8 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_FRV_GNU_VTENTRY) continue; - r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections [r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - /* This is a final link. */ + r_symndx = ELF32_R_SYM (rel->r_info); howto = elf32_frv_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; sym = NULL; @@ -838,8 +817,8 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, relocation. */ static asection * -elf32_frv_gc_mark_hook (abfd, info, rel, h, sym) - bfd * abfd; +elf32_frv_gc_mark_hook (sec, info, rel, h, sym) + asection * sec; struct bfd_link_info * info ATTRIBUTE_UNUSED; Elf_Internal_Rela * rel; struct elf_link_hash_entry * h; @@ -869,13 +848,7 @@ elf32_frv_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - if (!(elf_bad_symtab (abfd) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1395,6 +1368,7 @@ frv_elf_print_private_bfd_data (abfd, ptr) #define elf_backend_add_symbol_hook elf32_frv_add_symbol_hook #define elf_backend_can_gc_sections 1 +#define elf_backend_rela_normal 1 #define bfd_elf32_bfd_reloc_type_lookup frv_reloc_type_lookup #define bfd_elf32_bfd_set_private_flags frv_elf_set_private_flags diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index 52213ec..48e2960 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -1,5 +1,6 @@ /* Generic support for 32-bit ELF - Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999, 2001, 2002 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -428,6 +429,9 @@ elf32_h8_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel, *relend; + if (info->relocateable) + return true; + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -443,29 +447,9 @@ elf32_h8_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma relocation; bfd_reloc_status_type r; + /* This is a final link. */ r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - - /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; @@ -677,10 +661,7 @@ elf32_h8_merge_private_bfd_data (ibfd, obfd) mov.b:16 -> mov.b:8 2 bytes mov.b:24/32 -> mov.b:8 4 bytes - mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes - - -*/ + mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes */ static boolean elf32_h8_relax_section (abfd, sec, link_info, again) @@ -690,15 +671,10 @@ elf32_h8_relax_section (abfd, sec, link_info, again) boolean *again; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *contents = NULL; - bfd_byte *free_contents = NULL; - Elf32_External_Sym *extsyms = NULL; - Elf32_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_Internal_Sym *isymbuf = NULL; static asection *last_input_section = NULL; static Elf_Internal_Rela *last_reloc = NULL; @@ -720,7 +696,6 @@ elf32_h8_relax_section (abfd, sec, link_info, again) sec->_cooked_size = sec->_raw_size; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; /* Get a copy of the native relocations. */ internal_relocs = (_bfd_elf32_link_read_relocs @@ -728,8 +703,6 @@ elf32_h8_relax_section (abfd, sec, link_info, again) link_info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; if (sec != last_input_section) last_reloc = NULL; @@ -747,6 +720,13 @@ elf32_h8_relax_section (abfd, sec, link_info, again) if (irel != internal_relocs) last_reloc = irel - 1; + if (ELF32_R_TYPE (irel->r_info) != R_H8_DIR24R8 + && ELF32_R_TYPE (irel->r_info) != R_H8_PCREL16 + && ELF32_R_TYPE (irel->r_info) != R_H8_DIR16A8 + && ELF32_R_TYPE (irel->r_info) != R_H8_DIR24A8 + && ELF32_R_TYPE (irel->r_info) != R_H8_DIR32A16) + continue; + /* Get the section contents if we haven't done so already. */ if (contents == NULL) { @@ -759,7 +739,6 @@ elf32_h8_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (! bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) @@ -768,57 +747,27 @@ elf32_h8_relax_section (abfd, sec, link_info, again) } /* Read this BFD's local symbols if we haven't done so already. */ - if (extsyms == NULL) + if (isymbuf == NULL && symtab_hdr->sh_info != 0) { - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - bfd_size_type amt; - - amt = symtab_hdr->sh_info * sizeof (Elf32_External_Sym); - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, abfd) != amt) - goto error_return; - symtab_hdr->contents = (PTR) extsyms; - } - - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_return; - shndx_hdr->contents = (PTR) shndx_buf; - } + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; } /* Get the value of the symbol referred to by the reloc. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; - asection *sym_sec; - /* A local symbol. */ - esym = extsyms + ELF32_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); + Elf_Internal_Sym *isym; + asection *sym_sec; - sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx); - symval = (isym.st_value + isym = isymbuf + ELF64_R_SYM (irel->r_info); + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = (isym->st_value + sym_sec->output_section->vma + sym_sec->output_offset); } @@ -878,12 +827,8 @@ elf32_h8_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* If the previous instruction conditionally jumped around this instruction, we may be able to reverse the condition @@ -898,24 +843,17 @@ elf32_h8_relax_section (abfd, sec, link_info, again) && ELF32_R_TYPE (last_reloc->r_info) == R_H8_PCREL8 && ELF32_R_SYM (last_reloc->r_info) < symtab_hdr->sh_info) { - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; bfd_vma last_value; asection *last_sym_sec; - Elf_Internal_Sym last_symbol; + Elf_Internal_Sym *last_sym; /* We will need to examine the symbol used by the previous relocation. */ - esym = extsyms + ELF32_R_SYM (last_reloc->r_info); - shndx = shndx_buf; - if (shndx != NULL) - shndx += ELF32_R_SYM (last_reloc->r_info); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &last_symbol); - + last_sym = isymbuf + ELF32_R_SYM (last_reloc->r_info); last_sym_sec - = bfd_section_from_elf_index (abfd, last_symbol.st_shndx); - last_value = (last_symbol.st_value + = bfd_section_from_elf_index (abfd, last_sym->st_shndx); + last_value = (last_sym->st_value + last_sym_sec->output_section->vma + last_sym_sec->output_offset); @@ -1007,12 +945,8 @@ elf32_h8_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Get the opcode. */ code = bfd_get_8 (abfd, contents + irel->r_offset - 2); @@ -1068,12 +1002,8 @@ elf32_h8_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Get the opcode. */ code = bfd_get_8 (abfd, contents + irel->r_offset - 2); @@ -1130,12 +1060,8 @@ elf32_h8_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Get the opcode. */ code = bfd_get_8 (abfd, contents + irel->r_offset - 2); @@ -1186,12 +1112,8 @@ elf32_h8_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Get the opcode. */ code = bfd_get_8 (abfd, contents + irel->r_offset - 1); @@ -1222,56 +1144,43 @@ elf32_h8_relax_section (abfd, sec, link_info, again) } } - if (free_relocs != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { - free (free_relocs); - free_relocs = NULL; + if (! link_info->keep_memory) + free (isymbuf); + else + symtab_hdr->contents = (unsigned char *) isymbuf; } - if (free_contents != NULL) + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) { if (! link_info->keep_memory) - free (free_contents); + free (contents); else { /* Cache the section contents for elf_link_input_bfd. */ elf_section_data (sec)->this_hdr.contents = contents; } - free_contents = NULL; } - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - - if (free_extsyms != NULL) - { - if (! link_info->keep_memory) - { - symtab_hdr->contents = NULL; - free (free_extsyms); - } - } + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - if (free_extsyms != NULL) - { - symtab_hdr->contents = NULL; - free (free_extsyms); - } + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return false; } @@ -1285,22 +1194,17 @@ elf32_h8_relax_delete_bytes (abfd, sec, addr, count) int count; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; unsigned int sec_shndx; bfd_byte *contents; Elf_Internal_Rela *irel, *irelend; Elf_Internal_Rela *irelalign; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; bfd_vma toaddr; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **end_hashes; unsigned int symcount; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); contents = elf_section_data (sec)->this_hdr.contents; @@ -1329,24 +1233,15 @@ elf32_h8_relax_delete_bytes (abfd, sec, addr, count) } /* Adjust the local symbols defined in this section. */ - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; - esym = extsyms; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + isymend = isym + symtab_hdr->sh_info; + for (; isym < isymend; isym++) { - Elf_Internal_Sym isym; - Elf_External_Sym_Shndx dummy; - - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == sec_shndx - && isym.st_value > addr - && isym.st_value < toaddr) - { - isym.st_value -= count; - bfd_elf32_swap_symbol_out (abfd, &isym, esym, &dummy); - } + if (isym->st_shndx == sec_shndx + && isym->st_value > addr + && isym->st_value < toaddr) + isym->st_value -= count; } /* Now adjust the global symbols defined in this section. */ @@ -1379,10 +1274,9 @@ elf32_h8_symbol_address_p (abfd, sec, addr) bfd_vma addr; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; unsigned int sec_shndx; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **end_hashes; unsigned int symcount; @@ -1391,18 +1285,12 @@ elf32_h8_symbol_address_p (abfd, sec, addr) /* Examine all the symbols. */ symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; - esym = (Elf32_External_Sym *) symtab_hdr->contents; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + isymend = isym + symtab_hdr->sh_info; + for (; isym < isymend; isym++) { - Elf_Internal_Sym isym; - - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == sec_shndx - && isym.st_value == addr) + if (isym->st_shndx == sec_shndx + && isym->st_value == addr) return true; } @@ -1437,15 +1325,11 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; asection *input_section = link_order->u.indirect.section; bfd *input_bfd = input_section->owner; asection **sections = NULL; Elf_Internal_Rela *internal_relocs = NULL; - Elf32_External_Sym *external_syms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym *internal_syms = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ @@ -1457,7 +1341,6 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; memcpy (data, elf_section_data (input_section)->this_hdr.contents, (size_t) input_section->_raw_size); @@ -1465,48 +1348,26 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, if ((input_section->flags & SEC_RELOC) != 0 && input_section->reloc_count > 0) { - Elf_Internal_Sym *isymp; asection **secpp; - Elf32_External_Sym *esym, *esymend; + Elf_Internal_Sym *isym, *isymend; bfd_size_type amt; - if (symtab_hdr->contents != NULL) - external_syms = (Elf32_External_Sym *) symtab_hdr->contents; - else if (symtab_hdr->sh_info != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - external_syms = (Elf32_External_Sym *) bfd_malloc (amt); - if (external_syms == NULL) - goto error_return; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) external_syms, amt, input_bfd) != amt) - goto error_return; - } - - if (symtab_hdr->sh_info != 0 && shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt) - goto error_return; - } - internal_relocs = (_bfd_elf32_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, false)); if (internal_relocs == NULL) goto error_return; - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_Internal_Sym); - internal_syms = (Elf_Internal_Sym *) bfd_malloc (amt); - if (internal_syms == NULL && amt != 0) - goto error_return; + if (symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } amt = symtab_hdr->sh_info; amt *= sizeof (asection *); @@ -1514,58 +1375,48 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, if (sections == NULL && amt != 0) goto error_return; - for (isymp = internal_syms, secpp = sections, shndx = shndx_buf, - esym = external_syms, esymend = esym + symtab_hdr->sh_info; - esym < esymend; - ++esym, ++isymp, ++secpp, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp) { asection *isec; - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp); - - if (isymp->st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) isec = bfd_und_section_ptr; - else if (isymp->st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) isec = bfd_abs_section_ptr; - else if (isymp->st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) isec = bfd_com_section_ptr; else - isec = bfd_section_from_elf_index (input_bfd, isymp->st_shndx); + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); *secpp = isec; } if (! elf32_h8_relocate_section (output_bfd, link_info, input_bfd, input_section, data, internal_relocs, - internal_syms, sections)) + isymbuf, sections)) goto error_return; if (sections != NULL) free (sections); - if (internal_syms != NULL) - free (internal_syms); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_relocs != elf_section_data (input_section)->relocs) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); } return data; error_return: - if (internal_relocs != NULL - && internal_relocs != elf_section_data (input_section)->relocs) - free (internal_relocs); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_syms != NULL) - free (internal_syms); if (sections != NULL) free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); return NULL; } @@ -1597,6 +1448,7 @@ elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order, /* Use an H8 specific linker, not the ELF generic linker. */ #define elf_backend_relocate_section elf32_h8_relocate_section +#define elf_backend_rela_normal 1 /* And relaxing stuff. */ #define bfd_elf32_bfd_relax_section elf32_h8_relax_section diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 4dc7e9b..35e6f32 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -327,14 +327,15 @@ static boolean elf32_hppa_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static void elf32_hppa_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf32_hppa_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf32_hppa_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf32_hppa_gc_sweep_hook @@ -643,16 +644,18 @@ hppa_add_stub (stub_name, section, htab) stub_sec = htab->stub_group[link_sec->id].stub_sec; if (stub_sec == NULL) { + size_t namelen; bfd_size_type len; char *s_name; - len = strlen (link_sec->name) + sizeof (STUB_SUFFIX); + namelen = strlen (link_sec->name); + len = namelen + sizeof (STUB_SUFFIX); s_name = bfd_alloc (htab->stub_bfd, len); if (s_name == NULL) return NULL; - strcpy (s_name, link_sec->name); - strcpy (s_name + len - sizeof (STUB_SUFFIX), STUB_SUFFIX); + memcpy (s_name, link_sec->name, namelen); + memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX)); stub_sec = (*htab->add_stub_section) (s_name, link_sec); if (stub_sec == NULL) return NULL; @@ -1143,7 +1146,8 @@ elf32_hppa_create_dynamic_sections (abfd, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf32_hppa_copy_indirect_symbol (dir, ind) +elf32_hppa_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf32_hppa_link_hash_entry *edir, *eind; @@ -1187,7 +1191,7 @@ elf32_hppa_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and @@ -1630,8 +1634,8 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs) for a given relocation. */ static asection * -elf32_hppa_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf32_hppa_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -1661,9 +1665,7 @@ elf32_hppa_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -2558,7 +2560,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info) /* Set up various things so that we can make a list of input sections for each output section included in the link. Returns -1 on error, - 0 when no stubs will be needed, and 1 on success. */ + 0 when no stubs will be needed, and 1 on success. */ int elf32_hppa_setup_section_lists (output_bfd, info) @@ -2770,68 +2772,26 @@ get_local_syms (output_bfd, input_bfd, info) input_bfd = input_bfd->link_next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf_Internal_Sym *isym; - Elf32_External_Sym *ext_syms, *esym, *end_sy; - Elf_External_Sym_Shndx *shndx_buf, *shndx; - bfd_size_type sec_size; /* We'll need the symbol table in a second. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; if (symtab_hdr->sh_info == 0) continue; - /* We need an array of the local symbols attached to the input bfd. - Unfortunately, we're going to have to read & swap them in. */ - sec_size = symtab_hdr->sh_info; - sec_size *= sizeof (Elf_Internal_Sym); - local_syms = (Elf_Internal_Sym *) bfd_malloc (sec_size); + /* We need an array of the local symbols attached to the input bfd. */ + local_syms = (Elf_Internal_Sym *) symtab_hdr->contents; if (local_syms == NULL) - return -1; - - all_local_syms[bfd_indx] = local_syms; - sec_size = symtab_hdr->sh_info; - sec_size *= sizeof (Elf32_External_Sym); - ext_syms = (Elf32_External_Sym *) bfd_malloc (sec_size); - if (ext_syms == NULL) - return -1; - - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) ext_syms, sec_size, input_bfd) != sec_size) { - error_ret_free_ext_syms: - free (ext_syms); - return -1; + local_syms = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + /* Cache them for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) local_syms; } + if (local_syms == NULL) + return -1; - shndx_buf = NULL; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) - { - sec_size = symtab_hdr->sh_info; - sec_size *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (sec_size); - if (shndx_buf == NULL) - goto error_ret_free_ext_syms; - - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, sec_size, input_bfd) != sec_size) - { - free (shndx_buf); - goto error_ret_free_ext_syms; - } - } - - /* Swap the local symbols in. */ - for (esym = ext_syms, end_sy = esym + symtab_hdr->sh_info, - isym = local_syms, shndx = shndx_buf; - esym < end_sy; - esym++, isym++, shndx = (shndx ? shndx + 1 : NULL)) - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isym); - - /* Now we can free the external symbols. */ - free (shndx_buf); - free (ext_syms); + all_local_syms[bfd_indx] = local_syms; if (info->shared && htab->multi_subspace) { @@ -2926,7 +2886,6 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, bfd_size_type stub_group_size; boolean stubs_always_before_branch; boolean stub_changed; - boolean ret = 0; struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info); /* Stash our params away. */ @@ -2993,10 +2952,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, section != NULL; section = section->next) { - Elf_Internal_Shdr *input_rel_hdr; - Elf32_External_Rela *external_relocs, *erelaend, *erela; Elf_Internal_Rela *internal_relocs, *irelaend, *irela; - bfd_size_type amt; /* If there aren't any relocs, then there's nothing more to do. */ @@ -3010,47 +2966,13 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, || section->output_section->owner != output_bfd) continue; - /* Allocate space for the external relocations. */ - amt = section->reloc_count; - amt *= sizeof (Elf32_External_Rela); - external_relocs = (Elf32_External_Rela *) bfd_malloc (amt); - if (external_relocs == NULL) - { - goto error_ret_free_local; - } - - /* Likewise for the internal relocations. */ - amt = section->reloc_count; - amt *= sizeof (Elf_Internal_Rela); - internal_relocs = (Elf_Internal_Rela *) bfd_malloc (amt); + /* Get the relocs. */ + internal_relocs + = _bfd_elf32_link_read_relocs (input_bfd, section, NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) - { - free (external_relocs); - goto error_ret_free_local; - } - - /* Read in the external relocs. */ - input_rel_hdr = &elf_section_data (section)->rel_hdr; - if (bfd_seek (input_bfd, input_rel_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) external_relocs, - input_rel_hdr->sh_size, - input_bfd) != input_rel_hdr->sh_size) - { - free (external_relocs); - error_ret_free_internal: - free (internal_relocs); - goto error_ret_free_local; - } - - /* Swap in the relocs. */ - erela = external_relocs; - erelaend = erela + section->reloc_count; - irela = internal_relocs; - for (; erela < erelaend; erela++, irela++) - bfd_elf32_swap_reloca_in (input_bfd, erela, irela); - - /* We're done with the external relocs, free them. */ - free (external_relocs); + goto error_ret_free_local; /* Now examine each relocation. */ irela = internal_relocs; @@ -3073,7 +2995,10 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, if (r_type >= (unsigned int) R_PARISC_UNIMPLEMENTED) { bfd_set_error (bfd_error_bad_value); - goto error_ret_free_internal; + error_ret_free_internal: + if (elf_section_data (section)->relocs == NULL) + free (internal_relocs); + goto error_ret_free_local; } /* Only look for stubs on call instructions. */ @@ -3176,7 +3101,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, if (stub_entry == NULL) { free (stub_name); - goto error_ret_free_local; + goto error_ret_free_internal; } stub_entry->target_value = sym_value; @@ -3194,7 +3119,8 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, } /* We're done with the internal relocs, free them. */ - free (internal_relocs); + if (elf_section_data (section)->relocs == NULL) + free (internal_relocs); } } @@ -3218,15 +3144,12 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, stub_changed = false; } - ret = true; + free (htab->all_local_syms); + return true; error_ret_free_local: - while (htab->bfd_count-- > 0) - if (htab->all_local_syms[htab->bfd_count]) - free (htab->all_local_syms[htab->bfd_count]); free (htab->all_local_syms); - - return ret; + return false; } /* For a final link, this function is called after we have sized the @@ -3689,6 +3612,9 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; + if (info->relocateable) + return true; + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; htab = hppa_link_hash_table (info); @@ -3720,27 +3646,8 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == (unsigned int) R_PARISC_GNU_VTINHERIT) continue; - r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sym_sec = local_sections[r_symndx]; - rel->r_addend += sym_sec->output_offset; - } - } - continue; - } - /* This is a final link. */ + r_symndx = ELF32_R_SYM (rel->r_info); h = NULL; sym = NULL; sym_sec = NULL; @@ -4548,6 +4455,7 @@ elf32_hppa_elf_get_symbol_type (elf_sym, type) #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 8 +#define elf_backend_rela_normal 1 #define TARGET_BIG_SYM bfd_elf32_hppa_vec #define TARGET_BIG_NAME "elf32-hppa" diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index fc82b47..d047f01 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -34,32 +34,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "elf/i370.h" -#define USE_RELA /* we want RELA relocations, not REL */ - -/* i370 relocations */ -/* Note that there is really just one relocation that we currently - * support (and only one that we seem to need, at the moment), and - * that is the 31-bit address relocation. Note that the 370/390 - * only supports a 31-bit (2GB) address space. - */ -enum i370_reloc_type -{ - R_I370_NONE = 0, - R_I370_ADDR31 = 1, - R_I370_ADDR32 = 2, - R_I370_ADDR16 = 3, - R_I370_REL31 = 4, - R_I370_REL32 = 5, - R_I370_ADDR12 = 6, - R_I370_REL12 = 7, - R_I370_ADDR8 = 8, - R_I370_REL8 = 9, - R_I370_COPY = 10, - R_I370_RELATIVE = 11, - - R_I370_max -}; - static reloc_howto_type *i370_elf_howto_table[ (int)R_I370_max ]; static reloc_howto_type i370_elf_howto_raw[] = @@ -319,7 +293,7 @@ static boolean i370_elf_create_dynamic_sections PARAMS ((bfd *, static boolean i370_elf_section_from_shdr PARAMS ((bfd *, Elf32_Internal_Shdr *, - char *)); + const char *)); static boolean i370_elf_fake_sections PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); @@ -429,7 +403,7 @@ static boolean i370_elf_section_from_shdr (abfd, hdr, name) bfd *abfd; Elf32_Internal_Shdr *hdr; - char *name; + const char *name; { asection *newsect; flagword flags; diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 01e1f21..edf06de 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -45,7 +45,8 @@ static boolean create_got_section static boolean elf_i386_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_i386_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static int elf_i386_tls_transition PARAMS ((struct bfd_link_info *, int, int)); @@ -57,7 +58,7 @@ static boolean elf_i386_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_i386_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf_i386_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -594,7 +595,7 @@ elf_i386_mkobject (abfd) return false; return true; } - + static boolean elf_i386_object_p (abfd) bfd *abfd; @@ -697,6 +698,7 @@ elf_i386_link_hash_table_create (abfd) ret->srelplt = NULL; ret->sdynbss = NULL; ret->srelbss = NULL; + ret->tls_ldm_got.refcount = 0; ret->sym_sec.abfd = NULL; return &ret->elf.root; @@ -766,7 +768,8 @@ elf_i386_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_i386_copy_indirect_symbol (dir, ind) +elf_i386_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_i386_link_hash_entry *edir, *eind; @@ -808,7 +811,13 @@ elf_i386_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static int @@ -1174,8 +1183,8 @@ elf_i386_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_i386_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf_i386_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -1205,9 +1214,7 @@ elf_i386_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1400,7 +1407,7 @@ elf_i386_adjust_dynamic_symbol (info, h) } /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ if (p == NULL) { h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; @@ -1552,7 +1559,7 @@ allocate_dynrelocs (h, inf) && !info->shared && h->dynindx == -1 && elf_i386_hash_entry(h)->tls_type == GOT_TLS_IE) - h->got.offset = (bfd_vma) -1; + h->got.offset = (bfd_vma) -1; else if (h->got.refcount > 0) { asection *s; @@ -2428,7 +2435,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (r_type == R_386_TLS_LE_32) { - BFD_ASSERT (unresolved_reloc == false); + BFD_ASSERT (! unresolved_reloc); if (ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD) { unsigned int val, type; @@ -2562,13 +2569,17 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, outrel.r_offset = (htab->sgot->output_section->vma + htab->sgot->output_offset + off); - bfd_put_32 (output_bfd, 0, - htab->sgot->contents + off); indx = h && h->dynindx != -1 ? h->dynindx : 0; if (r_type == R_386_TLS_GD) dr_type = R_386_TLS_DTPMOD32; else dr_type = R_386_TLS_TPOFF32; + if (dr_type == R_386_TLS_TPOFF32 && indx == 0) + bfd_put_32 (output_bfd, relocation - dtpoff_base (info), + htab->sgot->contents + off); + else + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + off); outrel.r_info = ELF32_R_INFO (indx, dr_type); loc = (Elf32_External_Rel *) htab->srelgot->contents; loc += htab->srelgot->reloc_count++; @@ -2578,7 +2589,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, { if (indx == 0) { - BFD_ASSERT (unresolved_reloc == false); + BFD_ASSERT (! unresolved_reloc); bfd_put_32 (output_bfd, relocation - dtpoff_base (info), htab->sgot->contents + off + 4); @@ -2739,14 +2750,11 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, break; } - /* FIXME: Why do we allow debugging sections to escape this error? - More importantly, why do we not emit dynamic relocs for - R_386_32 above in debugging sections (which are ! SEC_ALLOC)? - If we had emitted the dynamic reloc, we could remove the - fudge here. */ + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), @@ -2885,7 +2893,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) the .plt section. Leave the value alone. This is a clue for the dynamic linker, to make function pointer comparisons work between an application and shared - library. */ + library. */ sym->st_shndx = SHN_UNDEF; } } @@ -3146,4 +3154,6 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define elf_backend_relocate_section elf_i386_relocate_section #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections +#ifndef ELF32_I386_C_INCLUDED #include "elf32-target.h" +#endif diff --git a/bfd/elf32-i386qnx.c b/bfd/elf32-i386qnx.c index 5f2e111..523eecb 100644 --- a/bfd/elf32-i386qnx.c +++ b/bfd/elf32-i386qnx.c @@ -2,110 +2,29 @@ Copyright 2002 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ELF32_I386_C_INCLUDED #include "elf32-i386.c" - /* Returns the end address of the segment + 1. */ -#define SEGMENT_END(segment, start) \ - (start + (segment->p_memsz > segment->p_filesz \ - ? segment->p_memsz : segment->p_filesz)) - -static boolean elf_i386qnx_copy_private_bfd_data_p - PARAMS ((bfd *, asection *, bfd *, asection *)); -static boolean elf_i386qnx_is_contained_by_filepos - PARAMS ((asection *, Elf_Internal_Phdr *)); -static void elf_i386qnx_set_nonloadable_filepos - PARAMS ((bfd *, Elf_Internal_Phdr *)); - -static boolean -elf_i386qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec) - bfd *ibfd; - asection *isec; - bfd *obfd; - asection *osec; -{ - /* We don't use these parameters, but another target might. */ - ibfd = ibfd; - obfd = obfd; - osec = osec; - return isec->next == NULL; -} - -static boolean -elf_i386qnx_is_contained_by_filepos (section, segment) - asection *section; - Elf_Internal_Phdr *segment; -{ - return ((bfd_vma) section->filepos >= segment->p_offset - && ((bfd_vma) section->filepos + section->_raw_size - <= SEGMENT_END (segment, segment->p_offset))); -} - -static void -elf_i386qnx_set_nonloadable_filepos (abfd, phdrs) - bfd *abfd; - Elf_Internal_Phdr *phdrs; -{ - struct elf_segment_map *m; - Elf_Internal_Phdr *p; - file_ptr off = 0; - - for (m = elf_tdata (abfd)->segment_map, p = phdrs; - m != NULL; - m = m->next, p++) - { - unsigned int i; - asection **secpp; - - for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) - { - asection *sec; - - sec = *secpp; - - if (p->p_type == PT_LOAD) - off = sec->filepos; - else - { - if (i == 0) - { - if (sec->filepos) - p->p_offset = sec->filepos; - else - p->p_offset = off; - } - if (!sec->filepos) - { - off += sec->_raw_size; - p->p_filesz += sec->_raw_size; - } - } - } - } - return; -} +#include "elf32-qnx.h" #undef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM bfd_elf32_i386qnx_vec -#define elf_backend_set_nonloadable_filepos elf_i386qnx_set_nonloadable_filepos -#define elf_backend_is_contained_by_filepos elf_i386qnx_is_contained_by_filepos -#define elf_backend_copy_private_bfd_data_p elf_i386qnx_copy_private_bfd_data_p - #include "elf32-target.h" + diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c index 82c7190..f8ab971 100644 --- a/bfd/elf32-i860.c +++ b/bfd/elf32-i860.c @@ -831,9 +831,6 @@ i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca /* Relocate an i860 ELF section. This is boiler-plate code copied from fr30. - There is some attempt to make this function usable for many architectures, - both USE_REL and USE_RELA ['twould be nice if such a critter existed], - if only to serve as a learning tool. The RELOCATE_SECTION function is called by the new ELF backend linker to handle the relocations for a section. diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c new file mode 100644 index 0000000..0194646 --- /dev/null +++ b/bfd/elf32-ip2k.c @@ -0,0 +1,1692 @@ +/* Ubicom IP2xxx specific support for 32-bit ELF + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/ip2k.h" + +/* Struct used to pass miscellaneous paramaters which + helps to avoid overly long parameter lists. */ +struct misc +{ + Elf_Internal_Shdr * symtab_hdr; + Elf_Internal_Rela * irelbase; + bfd_byte * contents; + Elf_Internal_Sym * isymbuf; +}; + +/* Prototypes. */ +static reloc_howto_type * ip2k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); +static void ip2k_info_to_howto_rela PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static asection * ip2k_elf_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean ip2k_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); +static bfd_vma symbol_value PARAMS ((bfd *, Elf_Internal_Shdr *, Elf32_Internal_Sym *, Elf_Internal_Rela *)); +static void adjust_all_relocations PARAMS ((bfd *, asection *, bfd_vma, bfd_vma, int, int)); +static boolean ip2k_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); +static boolean ip2k_elf_relax_add_bytes PARAMS ((bfd *, asection *, bfd_vma, const bfd_byte *, int, int)); +static boolean add_page_insn PARAMS ((bfd *, asection *, Elf_Internal_Rela *, struct misc *)); +static boolean ip2k_elf_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static boolean relax_switch_dispatch_tables_pass1 PARAMS ((bfd *, asection *, bfd_vma, struct misc *)); +static boolean unrelax_dispatch_table_entries PARAMS ((bfd *, asection *, bfd_vma, bfd_vma, boolean *, struct misc *)); +static boolean unrelax_switch_dispatch_tables_passN PARAMS ((bfd *, asection *, bfd_vma, boolean *, struct misc *)); +static boolean is_switch_128_dispatch_table_p PARAMS ((bfd *, bfd_vma, boolean, struct misc *)); +static boolean is_switch_256_dispatch_table_p PARAMS ((bfd *, bfd_vma, boolean, struct misc *)); +static boolean ip2k_elf_relax_section_pass1 PARAMS ((bfd *, asection *, boolean *, struct misc *)); +static boolean ip2k_elf_relax_section_passN PARAMS ((bfd *, asection *, boolean *, boolean *, struct misc *)); +static bfd_reloc_status_type ip2k_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma)); +static boolean ip2k_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); + +#define IS_OPCODE(CODE0,CODE1,OPCODE) \ + ((CODE0) == (OPCODE)[0] && (CODE1) == (OPCODE)[1]) + +#define PAGE_INSN_0 0x00 +#define PAGE_INSN_1 0x10 + +static const bfd_byte page_opcode[] = +{ + PAGE_INSN_0, PAGE_INSN_1 +}; + +#define IS_PAGE_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, page_opcode) + +#define JMP_INSN_0 0xE0 +#define JMP_INSN_1 0x00 + +static const bfd_byte jmp_opcode[] = +{ + JMP_INSN_0, JMP_INSN_1 +}; + +#define IS_JMP_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, jmp_opcode) + +#define CALL_INSN_0 0xC0 +#define CALL_INSN_1 0x00 + +static const bfd_byte call_opcode[] = +{ + CALL_INSN_0, CALL_INSN_1 +}; + +#define IS_CALL_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, call_opcode) + +#define ADD_PCL_W_INSN_0 0x1E +#define ADD_PCL_W_INSN_1 0x09 + +static const bfd_byte add_pcl_w_opcode[] = +{ + ADD_PCL_W_INSN_0, ADD_PCL_W_INSN_1 +}; + +#define IS_ADD_PCL_W_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, add_pcl_w_opcode) + +#define ADD_W_WREG_INSN_0 0x1C +#define ADD_W_WREG_INSN_1 0x0A + +static const bfd_byte add_w_wreg_opcode[] = +{ + ADD_W_WREG_INSN_0, ADD_W_WREG_INSN_1 +}; + +#define IS_ADD_W_WREG_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, add_w_wreg_opcode) + +#define SNC_INSN_0 0xA0 +#define SNC_INSN_1 0x0B + +static const bfd_byte snc_opcode[] = +{ + SNC_INSN_0, SNC_INSN_1 +}; + +#define IS_SNC_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, snc_opcode) + +#define INC_1_SP_INSN_0 0x2B +#define INC_1_SP_INSN_1 0x81 + +static const bfd_byte inc_1_sp_opcode[] = +{ + INC_1_SP_INSN_0, INC_1_SP_INSN_1 +}; + +#define IS_INC_1_SP_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, inc_1_sp_opcode) + +#define ADD_2_SP_W_INSN_0 0x1F +#define ADD_2_SP_W_INSN_1 0x82 + +static const bfd_byte add_2_sp_w_opcode[] = +{ + ADD_2_SP_W_INSN_0, ADD_2_SP_W_INSN_1 +}; + +#define IS_ADD_2_SP_W_OPCODE(CODE0,CODE1) \ + IS_OPCODE (CODE0, CODE1, add_2_sp_w_opcode) + +/* Relocation tables. */ +static reloc_howto_type ip2k_elf_howto_table [] = +{ +#define IP2K_HOWTO(t,rs,s,bs,pr,bp,name,sm,dm) \ + HOWTO(t, /* type */ \ + rs, /* rightshift */ \ + s, /* size (0 = byte, 1 = short, 2 = long) */ \ + bs, /* bitsize */ \ + pr, /* pc_relative */ \ + bp, /* bitpos */ \ + complain_overflow_dont,/* complain_on_overflow */ \ + bfd_elf_generic_reloc,/* special_function */ \ + name, /* name */ \ + false, /* partial_inplace */ \ + sm, /* src_mask */ \ + dm, /* dst_mask */ \ + pr) /* pcrel_offset */ + + /* This reloc does nothing. */ + IP2K_HOWTO (R_IP2K_NONE, 0,2,32, false, 0, "R_IP2K_NONE", 0, 0), + /* A 16 bit absolute relocation. */ + IP2K_HOWTO (R_IP2K_16, 0,1,16, false, 0, "R_IP2K_16", 0, 0xffff), + /* A 32 bit absolute relocation. */ + IP2K_HOWTO (R_IP2K_32, 0,2,32, false, 0, "R_IP2K_32", 0, 0xffffffff), + /* A 8-bit data relocation for the FR9 field. Ninth bit is computed specially. */ + IP2K_HOWTO (R_IP2K_FR9, 0,1,9, false, 0, "R_IP2K_FR9", 0, 0x00ff), + /* A 4-bit data relocation. */ + IP2K_HOWTO (R_IP2K_BANK, 8,1,4, false, 0, "R_IP2K_BANK", 0, 0x000f), + /* A 13-bit insn relocation - word address => right-shift 1 bit extra. */ + IP2K_HOWTO (R_IP2K_ADDR16CJP, 1,1,13, false, 0, "R_IP2K_ADDR16CJP", 0, 0x1fff), + /* A 3-bit insn relocation - word address => right-shift 1 bit extra. */ + IP2K_HOWTO (R_IP2K_PAGE3, 14,1,3, false, 0, "R_IP2K_PAGE3", 0, 0x0007), + /* Two 8-bit data relocations. */ + IP2K_HOWTO (R_IP2K_LO8DATA, 0,1,8, false, 0, "R_IP2K_LO8DATA", 0, 0x00ff), + IP2K_HOWTO (R_IP2K_HI8DATA, 8,1,8, false, 0, "R_IP2K_HI8DATA", 0, 0x00ff), + /* Two 8-bit insn relocations. word address => right-shift 1 bit extra. */ + IP2K_HOWTO (R_IP2K_LO8INSN, 1,1,8, false, 0, "R_IP2K_LO8INSN", 0, 0x00ff), + IP2K_HOWTO (R_IP2K_HI8INSN, 9,1,8, false, 0, "R_IP2K_HI8INSN", 0, 0x00ff), + + /* Special 1 bit relocation for SKIP instructions. */ + IP2K_HOWTO (R_IP2K_PC_SKIP, 1,1,1, false, 12, "R_IP2K_PC_SKIP", 0xfffe, 0x1000), + /* 16 bit word address. */ + IP2K_HOWTO (R_IP2K_TEXT, 1,1,16, false, 0, "R_IP2K_TEXT", 0, 0xffff), + /* A 7-bit offset relocation for the FR9 field. Eigth and ninth bit comes from insn. */ + IP2K_HOWTO (R_IP2K_FR_OFFSET, 0,1,9, false, 0, "R_IP2K_FR_OFFSET", 0x180, 0x007f), + /* Bits 23:16 of an address. */ + IP2K_HOWTO (R_IP2K_EX8DATA, 16,1,8, false, 0, "R_IP2K_EX8DATA", 0, 0x00ff), +}; + + +/* Map BFD reloc types to IP2K ELF reloc types. */ +static reloc_howto_type * +ip2k_reloc_type_lookup (abfd, code) + bfd * abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + /* Note that the ip2k_elf_howto_table is indxed by the R_ + constants. Thus, the order that the howto records appear in the + table *must* match the order of the relocation types defined in + include/elf/ip2k.h. */ + + switch (code) + { + case BFD_RELOC_NONE: + return &ip2k_elf_howto_table[ (int) R_IP2K_NONE]; + case BFD_RELOC_16: + return &ip2k_elf_howto_table[ (int) R_IP2K_16]; + case BFD_RELOC_32: + return &ip2k_elf_howto_table[ (int) R_IP2K_32]; + case BFD_RELOC_IP2K_FR9: + return &ip2k_elf_howto_table[ (int) R_IP2K_FR9]; + case BFD_RELOC_IP2K_BANK: + return &ip2k_elf_howto_table[ (int) R_IP2K_BANK]; + case BFD_RELOC_IP2K_ADDR16CJP: + return &ip2k_elf_howto_table[ (int) R_IP2K_ADDR16CJP]; + case BFD_RELOC_IP2K_PAGE3: + return &ip2k_elf_howto_table[ (int) R_IP2K_PAGE3]; + case BFD_RELOC_IP2K_LO8DATA: + return &ip2k_elf_howto_table[ (int) R_IP2K_LO8DATA]; + case BFD_RELOC_IP2K_HI8DATA: + return &ip2k_elf_howto_table[ (int) R_IP2K_HI8DATA]; + case BFD_RELOC_IP2K_LO8INSN: + return &ip2k_elf_howto_table[ (int) R_IP2K_LO8INSN]; + case BFD_RELOC_IP2K_HI8INSN: + return &ip2k_elf_howto_table[ (int) R_IP2K_HI8INSN]; + case BFD_RELOC_IP2K_PC_SKIP: + return &ip2k_elf_howto_table[ (int) R_IP2K_PC_SKIP]; + case BFD_RELOC_IP2K_TEXT: + return &ip2k_elf_howto_table[ (int) R_IP2K_TEXT]; + case BFD_RELOC_IP2K_FR_OFFSET: + return &ip2k_elf_howto_table[ (int) R_IP2K_FR_OFFSET]; + case BFD_RELOC_IP2K_EX8DATA: + return &ip2k_elf_howto_table[ (int) R_IP2K_EX8DATA]; + default: + /* Pacify gcc -Wall. */ + return NULL; + } + return NULL; +} + +#define PAGENO(ABSADDR) ((ABSADDR) & 0x1C000) +#define BASEADDR(SEC) ((SEC)->output_section->vma + (SEC)->output_offset) + +#define UNDEFINED_SYMBOL (~(bfd_vma)0) + +/* Return the value of the symbol associated with the relocation IREL. */ + +static bfd_vma +symbol_value (abfd, symtab_hdr, isymbuf, irel) + bfd *abfd; + Elf_Internal_Shdr *symtab_hdr; + Elf32_Internal_Sym *isymbuf; + Elf_Internal_Rela *irel; +{ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + Elf_Internal_Sym *isym; + asection *sym_sec; + + isym = isymbuf + ELF32_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + else if (isym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + + return isym->st_value + BASEADDR (sym_sec); + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + return UNDEFINED_SYMBOL; + + return (h->root.u.def.value + BASEADDR (h->root.u.def.section)); + } +} + +/* Determine if the instruction sequence matches that for + the prologue of a switch dispatch table with fewer than + 128 entries. + + sc + page $nnn0 + jmp $nnn0 + add w,wreg + add pcl,w + addr=> + page $nnn1 + jmp $nnn1 + page $nnn2 + jmp $nnn2 + ... + page $nnnN + jmp $nnnN + + After relaxation. + sc + page $nnn0 + jmp $nnn0 + add pcl,w + addr=> + jmp $nnn1 + jmp $nnn2 + ... + jmp $nnnN */ + +static boolean +is_switch_128_dispatch_table_p (abfd, addr, relaxed, misc) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_vma addr; + boolean relaxed; + struct misc *misc; +{ + bfd_byte code0, code1; + + if (addr < (3 * 2)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 2); + code1 = bfd_get_8 (abfd, misc->contents + addr - 1); + + /* Is it ADD PCL,W */ + if (! IS_ADD_PCL_W_OPCODE (code0, code1)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 4); + code1 = bfd_get_8 (abfd, misc->contents + addr - 3); + + if (relaxed) + /* Is it ADD W,WREG */ + return ! IS_ADD_W_WREG_OPCODE (code0, code1); + + else + { + /* Is it ADD W,WREG */ + if (! IS_ADD_W_WREG_OPCODE (code0, code1)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 6); + code1 = bfd_get_8 (abfd, misc->contents + addr - 5); + + /* Is it JMP $nnnn */ + if (! IS_JMP_OPCODE (code0, code1)) + return false; + } + + /* It looks like we've found the prologue for + a 1-127 entry switch dispatch table. */ + return true; +} + +/* Determine if the instruction sequence matches that for + the prologue switch dispatch table with fewer than + 256 entries but more than 127. + + Before relaxation. + push %lo8insn(label) ; Push address of table + push %hi8insn(label) + add w,wreg ; index*2 => offset + snc ; CARRY SET? + inc 1(sp) ; Propagate MSB into table address + add 2(sp),w ; Add low bits of offset to table address + snc ; and handle any carry-out + inc 1(sp) + addr=> + page __indjmp ; Do an indirect jump to that location + jmp __indjmp + label: ; case dispatch table starts here + page $nnn1 + jmp $nnn1 + page $nnn2 + jmp $nnn2 + ... + page $nnnN + jmp $nnnN + + After relaxation. + push %lo8insn(label) ; Push address of table + push %hi8insn(label) + add 2(sp),w ; Add low bits of offset to table address + snc ; and handle any carry-out + inc 1(sp) + addr=> + page __indjmp ; Do an indirect jump to that location + jmp __indjmp + label: ; case dispatch table starts here + jmp $nnn1 + jmp $nnn2 + ... + jmp $nnnN */ + +static boolean +is_switch_256_dispatch_table_p (abfd, addr, relaxed, misc) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_vma addr; + boolean relaxed; + struct misc *misc; +{ + bfd_byte code0, code1; + + if (addr < (8 * 2)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 2); + code1 = bfd_get_8 (abfd, misc->contents + addr - 1); + + /* Is it INC 1(SP). */ + if (! IS_INC_1_SP_OPCODE (code0, code1)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 4); + code1 = bfd_get_8 (abfd, misc->contents + addr - 3); + + /* Is it SNC. */ + if (! IS_SNC_OPCODE (code0, code1)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 6); + code1 = bfd_get_8 (abfd, misc->contents + addr - 5); + + /* Is it ADD 2(SP),W. */ + if (! IS_ADD_2_SP_W_OPCODE (code0, code1)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 8); + code1 = bfd_get_8 (abfd, misc->contents + addr - 7); + + if (relaxed) + /* Is it INC 1(SP). */ + return ! IS_INC_1_SP_OPCODE (code0, code1); + + else + { + /* Is it INC 1(SP). */ + if (! IS_INC_1_SP_OPCODE (code0, code1)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 10); + code1 = bfd_get_8 (abfd, misc->contents + addr - 9); + + /* Is it SNC. */ + if (! IS_SNC_OPCODE (code0, code1)) + return false; + + code0 = bfd_get_8 (abfd, misc->contents + addr - 12); + code1 = bfd_get_8 (abfd, misc->contents + addr - 11); + + /* Is it ADD W,WREG. */ + if (! IS_ADD_W_WREG_OPCODE (code0, code1)) + return false; + } + + /* It looks like we've found the prologue for + a 128-255 entry switch dispatch table. */ + return true; +} + +static boolean +relax_switch_dispatch_tables_pass1 (abfd, sec, addr, misc) + bfd *abfd; + asection *sec; + bfd_vma addr; + struct misc *misc; +{ + if (addr + 3 < sec->_cooked_size) + { + bfd_byte code0 = bfd_get_8 (abfd, misc->contents + addr + 2); + bfd_byte code1 = bfd_get_8 (abfd, misc->contents + addr + 3); + + if (IS_JMP_OPCODE (code0, code1) + && is_switch_128_dispatch_table_p (abfd, addr, false, misc)) + { + /* Delete ADD W,WREG from prologue. */ + ip2k_elf_relax_delete_bytes (abfd, sec, addr - (2 * 2), (1 * 2)); + return true; + } + + if (IS_JMP_OPCODE (code0, code1) + && is_switch_256_dispatch_table_p (abfd, addr, false, misc)) + { + /* Delete ADD W,WREG; SNC ; INC 1(SP) from prologue. */ + ip2k_elf_relax_delete_bytes (abfd, sec, addr - 6 * 2, 3 * 2); + return true; + } + } + + return true; +} + +static boolean +unrelax_dispatch_table_entries (abfd, sec, first, last, changed, misc) + bfd *abfd; + asection *sec; + bfd_vma first; + bfd_vma last; + boolean *changed; + struct misc *misc; +{ + bfd_vma addr = first; + + while (addr < last) + { + bfd_byte code0 = bfd_get_8 (abfd, misc->contents + addr); + bfd_byte code1 = bfd_get_8 (abfd, misc->contents + addr + 1); + + /* We are only expecting to find PAGE or JMP insns + in the dispatch table. If we find anything else + something has gone wrong failed the relaxation + which will cause the link to be aborted. */ + + if (IS_PAGE_OPCODE (code0, code1)) + /* Skip the PAGE and JMP insns. */ + addr += 4; + else if (IS_JMP_OPCODE (code0, code1)) + { + Elf_Internal_Rela * irelend = misc->irelbase + + sec->reloc_count; + Elf_Internal_Rela * irel; + + /* Find the relocation entry. */ + for (irel = misc->irelbase; irel < irelend; irel++) + { + if (irel->r_offset == addr + && ELF32_R_TYPE (irel->r_info) == R_IP2K_ADDR16CJP) + { + if (! add_page_insn (abfd, sec, irel, misc)) + /* Something has gone wrong. */ + return false; + + *changed = true; + break; + } + } + + /* If we fell off the end something has gone wrong. */ + if (irel >= irelend) + /* Something has gone wrong. */ + return false; + + /* Skip the PAGE and JMP isns. */ + addr += 4; + /* Acount for the new PAGE insn. */ + last += 2; + } + else + /* Something has gone wrong. */ + return false; + } + + return true; +} + +static boolean +unrelax_switch_dispatch_tables_passN (abfd, sec, addr, changed, misc) + bfd *abfd; + asection *sec; + bfd_vma addr; + boolean *changed; + struct misc *misc; +{ + if (2 <= addr && (addr + 3) < sec->_cooked_size) + { + bfd_byte code0 = bfd_get_8 (abfd, misc->contents + addr - 2); + bfd_byte code1 = bfd_get_8 (abfd, misc->contents + addr - 1); + + if (IS_PAGE_OPCODE (code0, code1)) + { + addr -= 2; + code0 = bfd_get_8 (abfd, misc->contents + addr + 2); + code1 = bfd_get_8 (abfd, misc->contents + addr + 3); + } + else + { + code0 = bfd_get_8 (abfd, misc->contents + addr); + code1 = bfd_get_8 (abfd, misc->contents + addr + 1); + } + + if (IS_JMP_OPCODE (code0, code1) + && is_switch_128_dispatch_table_p (abfd, addr, true, misc)) + { + bfd_vma first = addr; + bfd_vma last = first; + boolean relaxed = true; + + /* On the final pass we must check if *all* entries in the + dispatch table are relaxed. If *any* are not relaxed + then we must unrelax *all* the entries in the dispach + table and also unrelax the dispatch table prologue. */ + + /* Find the last entry in the dispach table. */ + while (last < sec->_cooked_size) + { + code0 = bfd_get_8 (abfd, misc->contents + last); + code1 = bfd_get_8 (abfd, misc->contents + last + 1); + + if (IS_PAGE_OPCODE (code0, code1)) + relaxed = false; + else if (! IS_JMP_OPCODE (code0, code1)) + break; + + last += 2; + } + + /* We should have found the end of the dispatch table + before reaching the end of the section. If we've have + reached the end then fail the relaxation which will + cause the link to be aborted. */ + if (last >= sec->_cooked_size) + /* Something has gone wrong. */ + return false; + + /* If we found an unrelaxed entry then + unlrelax all the switch table entries. */ + if (! relaxed ) + { + if (! unrelax_dispatch_table_entries (abfd, sec, first, + last, changed, misc)) + /* Something has gone wrong. */ + return false; + + if (! is_switch_128_dispatch_table_p (abfd, addr, true, misc)) + /* Something has gone wrong. */ + return false; + + /* Unrelax the prologue. */ + + /* Insert an ADD W,WREG insnstruction. */ + if (! ip2k_elf_relax_add_bytes (abfd, sec, + addr - 2, + add_w_wreg_opcode, + sizeof (add_w_wreg_opcode), + 0)) + /* Something has gone wrong. */ + return false; + } + + return true; + } + + if (IS_JMP_OPCODE (code0, code1) + && is_switch_256_dispatch_table_p (abfd, addr, true, misc)) + { + bfd_vma first = addr; + bfd_vma last; + boolean relaxed = true; + + /* On the final pass we must check if *all* entries in the + dispatch table are relaxed. If *any* are not relaxed + then we must unrelax *all* the entries in the dispach + table and also unrelax the dispatch table prologue. */ + + /* Note the 1st PAGE/JMP instructions are part of the + prologue and can safely be relaxed. */ + + code0 = bfd_get_8 (abfd, misc->contents + first); + code1 = bfd_get_8 (abfd, misc->contents + first + 1); + + if (IS_PAGE_OPCODE (code0, code1)) + { + first += 2; + code0 = bfd_get_8 (abfd, misc->contents + first); + code1 = bfd_get_8 (abfd, misc->contents + first + 1); + } + + if (! IS_JMP_OPCODE (code0, code1)) + /* Something has gone wrong. */ + return false; + + first += 2; + last = first; + + /* Find the last entry in the dispach table. */ + while (last < sec->_cooked_size) + { + code0 = bfd_get_8 (abfd, misc->contents + last); + code1 = bfd_get_8 (abfd, misc->contents + last + 1); + + if (IS_PAGE_OPCODE (code0, code1)) + relaxed = false; + else if (! IS_JMP_OPCODE (code0, code1)) + break; + + last += 2; + } + + /* We should have found the end of the dispatch table + before reaching the end of the section. If we have + reached the end of the section then fail the + relaxation. */ + if (last >= sec->_cooked_size) + return false; + + /* If we found an unrelaxed entry then + unrelax all the switch table entries. */ + if (! relaxed) + { + if (! unrelax_dispatch_table_entries (abfd, sec, first, + last, changed, misc)) + return false; + + if (! is_switch_256_dispatch_table_p (abfd, addr, true, misc)) + return false; + + /* Unrelax the prologue. */ + + /* Insert an INC 1(SP) insnstruction. */ + if (! ip2k_elf_relax_add_bytes (abfd, sec, + addr - 6, + inc_1_sp_opcode, + sizeof (inc_1_sp_opcode), + 0)) + return false; + + /* Insert an SNC insnstruction. */ + if (! ip2k_elf_relax_add_bytes (abfd, sec, + addr - 6, + snc_opcode, + sizeof (snc_opcode), + 0)) + return false; + + /* Insert an ADD W,WREG insnstruction. */ + if (! ip2k_elf_relax_add_bytes (abfd, sec, + addr - 6, + add_w_wreg_opcode, + sizeof (add_w_wreg_opcode), + 0)) + return false; + } + + return true; + } + } + + return true; +} + +/* This function handles relaxing for the ip2k. */ + +static boolean +ip2k_elf_relax_section (abfd, sec, link_info, again) + bfd *abfd; + asection *sec; + struct bfd_link_info *link_info; + boolean *again; +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + bfd_byte *contents = NULL; + Elf_Internal_Sym *isymbuf = NULL; + static asection * first_section = NULL; + static asection * last_section = NULL; + static boolean changed = false; + static boolean final_pass = false; + static unsigned int pass = 0; + struct misc misc; + asection *stab; + + /* Assume nothing changes. */ + *again = false; + + if (first_section == NULL) + first_section = sec; + + if (first_section == sec) + { + changed = false; + pass++; + } + + /* If we make too many passes then it's a sign that + something is wrong and we fail the relaxation. + Note if everything is working correctly then the + relaxation should converge reasonably quickly. */ + if (pass == 4096) + return false; + + /* We don't have to do anything for a relocatable link, + if this section does not have relocs, or if this is + not a code section. */ + if (link_info->relocateable + || (sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0 + || (sec->flags & SEC_CODE) == 0) + return true; + + if (pass == 1) + last_section = sec; + + /* If this is the first time we have been called + for this section, initialise the cooked size. */ + if (sec->_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + internal_relocs = _bfd_elf32_link_read_relocs (abfd, sec, NULL, + (Elf_Internal_Rela *)NULL, + link_info->keep_memory); + if (internal_relocs == NULL) + goto error_return; + + /* Make sure the stac.rela stuff gets read in. */ + stab = bfd_get_section_by_name (abfd, ".stab"); + + if (stab) + { + /* So stab does exits. */ + Elf_Internal_Rela * irelbase; + + irelbase = _bfd_elf32_link_read_relocs (abfd, stab, NULL, + (Elf_Internal_Rela *)NULL, + link_info->keep_memory); + } + + /* Get section contents cached copy if it exists. */ + if (contents == NULL) + { + /* Get cached copy if it exists. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else + { + /* Go get them off disk. */ + contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (contents == NULL) + goto error_return; + + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; + } + } + + /* Read this BFD's symbols cached copy if it exists. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } + + misc.symtab_hdr = symtab_hdr; + misc.isymbuf = isymbuf; + misc.irelbase = internal_relocs; + misc.contents = contents; + + /* This is where all the relaxation actually get done. */ + + if (pass == 1) + { + /* On the first pass we remove *all* page instructions and + relax the prolog for switch dispatch tables. This gets + us to the starting point for subsequent passes where + we add page instructions back in as needed. */ + + if (! ip2k_elf_relax_section_pass1 (abfd, sec, again, &misc)) + goto error_return; + + changed |= *again; + } + else + { + /* Add page instructions back in as needed but we ignore + the issue with sections (functions) crossing a page + boundary until we have converged to an approximate + solution (i.e. nothing has changed on this relaxation + pass) and we then know roughly where the page boundaries + will end up. + + After we have have converged to an approximate solution + we set the final pass flag and continue relaxing. On these + final passes if a section (function) cross page boundary + we will add *all* the page instructions back into such + sections. + + After adding *all* page instructions back into a section + which crosses a page bounbdary we reset the final pass flag + so the we will again interate until we find a new approximate + solution which is closer to the final solution. */ + + if (! ip2k_elf_relax_section_passN (abfd, sec, again, &final_pass, + &misc)) + goto error_return; + + changed |= *again; + + /* If nothing has changed on this relaxation + pass restart the final relaxaton pass. */ + if (! changed && last_section == sec) + { + /* If this was the final pass and we didn't reset + the final pass flag then we are done, otherwise + do another final pass. */ + if (! final_pass) + { + final_pass = true; + *again = true; + } + } + } + + /* Perform some house keeping after relaxing the section. */ + + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + { + if (! link_info->keep_memory) + free (isymbuf); + else + symtab_hdr->contents = (unsigned char *) isymbuf; + } + + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + { + if (! link_info->keep_memory) + free (contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + + return true; + + error_return: + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return false; +} + +/* This function handles relaxation during the first pass. */ + +static boolean +ip2k_elf_relax_section_pass1 (abfd, sec, again, misc) + bfd *abfd; + asection *sec; + boolean *again; + struct misc * misc; +{ + Elf_Internal_Rela *irelend = misc->irelbase + sec->reloc_count; + Elf_Internal_Rela *irel; + + /* Walk thru the section looking for relaxation opertunities. */ + for (irel = misc->irelbase; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) == (int) R_IP2K_PAGE3) + { + bfd_byte code0 = bfd_get_8 (abfd, + misc->contents + irel->r_offset); + bfd_byte code1 = bfd_get_8 (abfd, + misc->contents + irel->r_offset + 1); + + /* Verify that this is the PAGE opcode. */ + if (IS_PAGE_OPCODE (code0, code1)) + { + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = misc->irelbase; + elf_section_data (sec)->this_hdr.contents = misc->contents; + misc->symtab_hdr->contents = (bfd_byte *) misc->isymbuf; + + /* Handle switch dispatch tables/prologues. */ + if (! relax_switch_dispatch_tables_pass1 (abfd, sec, + irel->r_offset, misc)) + return false; + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_IP2K_NONE); + + /* Delete the PAGE insn. */ + if (! ip2k_elf_relax_delete_bytes (abfd, sec, + irel->r_offset, + sizeof (page_opcode))) + return false; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = true; + } + } + } + + return true; +} + +/* This function handles relaxation for 2nd and subsequent passes. */ + +static boolean +ip2k_elf_relax_section_passN (abfd, sec, again, final_pass, misc) + bfd *abfd; + asection *sec; + boolean *again; + boolean *final_pass; + struct misc * misc; +{ + Elf_Internal_Rela *irelend = misc->irelbase + sec->reloc_count; + Elf_Internal_Rela *irel; + boolean add_all; + + /* If we are on the final relaxation pass and the section crosses + then set a flag to indicate that *all* page instructions need + to be added back into this section. */ + if (*final_pass) + { + add_all = (PAGENO (BASEADDR (sec)) + != PAGENO (BASEADDR (sec) + sec->_cooked_size)); + + /* If this section crosses a page boundary set the crossed + page boundary flag. */ + if (add_all) + sec->userdata = sec; + else + { + /* If the section had previously crossed a page boundary + but on this pass does not then reset crossed page + boundary flag and rerun the 1st relaxation pass on + this section. */ + if (sec->userdata) + { + sec->userdata = NULL; + if (! ip2k_elf_relax_section_pass1 (abfd, sec, again, misc)) + return false; + } + } + } + else + add_all = false; + + /* Walk thru the section looking for call/jmp + instructions which need a page instruction. */ + for (irel = misc->irelbase; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) == (int) R_IP2K_ADDR16CJP) + { + /* Get the value of the symbol referred to by the reloc. */ + bfd_vma symval = symbol_value (abfd, misc->symtab_hdr, misc->isymbuf, + irel); + bfd_byte code0, code1; + + if (symval == UNDEFINED_SYMBOL) + { + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + continue; + } + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Get the opcode. */ + code0 = bfd_get_8 (abfd, misc->contents + irel->r_offset); + code1 = bfd_get_8 (abfd, misc->contents + irel->r_offset + 1); + + if (IS_JMP_OPCODE (code0, code1) || IS_CALL_OPCODE (code0, code1)) + { + if (*final_pass) + { + if (! unrelax_switch_dispatch_tables_passN (abfd, sec, + irel->r_offset, + again, misc)) + return false; + + if (*again) + add_all = false; + } + + code0 = bfd_get_8 (abfd, misc->contents + irel->r_offset - 2); + code1 = bfd_get_8 (abfd, misc->contents + irel->r_offset - 1); + + if (! IS_PAGE_OPCODE (code0, code1)) + { + bfd_vma value = symval + irel->r_addend; + bfd_vma addr = BASEADDR (sec) + irel->r_offset; + + if (add_all || PAGENO (addr) != PAGENO (value)) + { + if (! add_page_insn (abfd, sec, irel, misc)) + return false; + + /* That will have changed things, so, we must relax again. */ + *again = true; + } + } + } + } + } + + /* If anything changed reset the final pass flag. */ + if (*again) + *final_pass = false; + + return true; +} + +/* Parts of a Stabs entry. */ + +#define STRDXOFF (0) +#define TYPEOFF (4) +#define OTHEROFF (5) +#define DESCOFF (6) +#define VALOFF (8) +#define STABSIZE (12) + +/* Adjust all the relocations entries after adding or inserting instructions. */ + +static void +adjust_all_relocations (abfd, sec, addr, endaddr, count, noadj) + bfd *abfd; + asection *sec; + bfd_vma addr; + bfd_vma endaddr; + int count; + int noadj; +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Sym *isymbuf, *isym, *isymend; + unsigned int shndx; + bfd_byte *contents; + Elf_Internal_Rela *irel, *irelend, *irelbase; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isymbuf = (Elf32_Internal_Sym *) symtab_hdr->contents; + + shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + contents = elf_section_data (sec)->this_hdr.contents; + + irelbase = elf_section_data (sec)->relocs; + irelend = irelbase + sec->reloc_count; + + for (irel = irelbase; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) != R_IP2K_NONE) + { + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + asection *sym_sec; + + /* A local symbol. */ + isym = isymbuf + ELF32_R_SYM (irel->r_info); + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + + if (isym->st_shndx == shndx) + { + bfd_vma baseaddr = BASEADDR (sec); + bfd_vma symval = BASEADDR (sym_sec) + isym->st_value + + irel->r_addend; + + if ((baseaddr + addr + noadj) <= symval + && symval < (baseaddr + endaddr)) + irel->r_addend += count; + } + } + } + + /* Do this only for PC space relocations. */ + if (addr <= irel->r_offset && irel->r_offset < endaddr) + irel->r_offset += count; + } + + /* When adding an instruction back it is sometimes necessary to move any + global or local symbol that was referencing the first instruction of + the moved block to refer to the first instruction of the inserted block. + + For example adding a PAGE instruction before a CALL or JMP requires + that any label on the CALL or JMP is moved to the PAGE insn. */ + addr += noadj; + + /* Adjust the local symbols defined in this section. */ + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf; isym < isymend; isym++) + { + if (isym->st_shndx == shndx + && addr <= isym->st_value + && isym->st_value < endaddr) + isym->st_value += count; + } + + /* Now adjust the global symbols defined in this section. */ + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf_link_hash_entry *sym_hash = *sym_hashes; + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec) + { + if (addr <= sym_hash->root.u.def.value + && sym_hash->root.u.def.value < endaddr) + { + sym_hash->root.u.def.value += count; + } + } + } + + return; +} + +static boolean +add_page_insn (abfd, sec, irel, misc) + bfd *abfd; + asection *sec; + Elf_Internal_Rela *irel; + struct misc *misc; +{ + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = misc->irelbase; + elf_section_data (sec)->this_hdr.contents = misc->contents; + misc->symtab_hdr->contents = (bfd_byte *) misc->isymbuf; + + /* Add the PAGE insn. */ + if (! ip2k_elf_relax_add_bytes (abfd, sec, irel->r_offset, + page_opcode, + sizeof (page_opcode), + sizeof (page_opcode))) + return false; + else + { + Elf32_Internal_Rela * jrel = irel - 1; + + /* Add relocation for PAGE insn added. */ + if (ELF32_R_TYPE (jrel->r_info) != R_IP2K_NONE) + { + bfd_byte code0, code1; + char *msg = NULL; + + /* Get the opcode. */ + code0 = bfd_get_8 (abfd, misc->contents + irel->r_offset); + code1 = bfd_get_8 (abfd, misc->contents + irel->r_offset + 1); + + if (IS_JMP_OPCODE (code0, code1)) + msg = "\tJMP instruction missing a preceeding PAGE instruction in %s\n\n"; + + else if (IS_CALL_OPCODE (code0, code1)) + msg = "\tCALL instruction missing a preceeding PAGE instruction in %s\n\n"; + + if (msg) + { + fprintf (stderr, "\n\t *** LINKER RELAXATION failure ***\n"); + fprintf (stderr, msg, sec->owner->filename); + } + + return false; + } + + jrel->r_addend = irel->r_addend; + jrel->r_offset = irel->r_offset - sizeof (page_opcode); + jrel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_IP2K_PAGE3); + } + + return true; +} + +/* Insert bytes into a section while relaxing. */ + +static boolean +ip2k_elf_relax_add_bytes (abfd, sec, addr, bytes, count, noadj) + bfd *abfd; + asection *sec; + bfd_vma addr; + const bfd_byte *bytes; + int count; + int noadj; +{ + bfd_byte *contents = elf_section_data (sec)->this_hdr.contents; + bfd_vma endaddr = sec->_cooked_size; + + /* Make room to insert the bytes. */ + memmove (contents + addr + count, contents + addr, endaddr - addr); + + /* Insert the bytes into the section. */ + memcpy (contents + addr, bytes, count); + + sec->_cooked_size += count; + + adjust_all_relocations (abfd, sec, addr, endaddr, count, noadj); + return true; +} + +/* Delete some bytes from a section while relaxing. */ + +static boolean +ip2k_elf_relax_delete_bytes (abfd, sec, addr, count) + bfd *abfd; + asection *sec; + bfd_vma addr; + int count; +{ + bfd_byte *contents = elf_section_data (sec)->this_hdr.contents; + bfd_vma endaddr = sec->_cooked_size; + + /* Actually delete the bytes. */ + memmove (contents + addr, contents + addr + count, + endaddr - addr - count); + + sec->_cooked_size -= count; + + adjust_all_relocations (abfd, sec, addr + count, endaddr, -count, 0); + return true; +} + +/* -------------------------------------------------------------------- */ + +/* XXX: The following code is the result of a cut&paste. This unfortunate + practice is very widespread in the various target back-end files. */ + +/* Set the howto pointer for a IP2K ELF reloc. */ + +static void +ip2k_info_to_howto_rela (abfd, cache_ptr, dst) + bfd * abfd ATTRIBUTE_UNUSED; + arelent * cache_ptr; + Elf32_Internal_Rela * dst; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + switch (r_type) + { + default: + cache_ptr->howto = & ip2k_elf_howto_table [r_type]; + break; + } +} + +/* Perform a single relocation. + By default we use the standard BFD routines. */ + +static bfd_reloc_status_type +ip2k_final_link_relocate (howto, input_bfd, input_section, contents, rel, + relocation) + reloc_howto_type * howto; + bfd * input_bfd; + asection * input_section; + bfd_byte * contents; + Elf_Internal_Rela * rel; + bfd_vma relocation; +{ + bfd_reloc_status_type r = bfd_reloc_ok; + + switch (howto->type) + { + /* Handle data space relocations. */ + case R_IP2K_FR9: + case R_IP2K_BANK: + if ((relocation & IP2K_DATA_MASK) == IP2K_DATA_VALUE) + relocation &= ~IP2K_DATA_MASK; + else + r = bfd_reloc_notsupported; + break; + + case R_IP2K_LO8DATA: + case R_IP2K_HI8DATA: + case R_IP2K_EX8DATA: + break; + + /* Handle insn space relocations. */ + case R_IP2K_ADDR16CJP: + case R_IP2K_PAGE3: + case R_IP2K_LO8INSN: + case R_IP2K_HI8INSN: + case R_IP2K_PC_SKIP: + if ((relocation & IP2K_INSN_MASK) == IP2K_INSN_VALUE) + relocation &= ~IP2K_INSN_MASK; + else + r = bfd_reloc_notsupported; + break; + + case R_IP2K_16: + /* If this is a relocation involving a TEXT + symbol, reduce it to a word address. */ + if ((relocation & IP2K_INSN_MASK) == IP2K_INSN_VALUE) + howto = &ip2k_elf_howto_table[ (int) R_IP2K_TEXT]; + break; + + /* Pass others through. */ + default: + break; + } + + /* Only install relocation if above tests did not disqualify it. */ + if (r == bfd_reloc_ok) + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); + + return r; +} + +/* Relocate a IP2K ELF section. + + The RELOCATE_SECTION function is called by the new ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjusting the section contents as + necessary, and (if using Rela relocs and generating a relocateable + output file) adjusting the reloc addend as necessary. + + This function does not have to worry about setting the reloc + address or the reloc symbol index. + + LOCAL_SYMS is a pointer to the swapped in local symbols. + + LOCAL_SECTIONS is an array giving the section in the input file + corresponding to the st_shndx field of each local symbol. + + The global hash table entry for the global symbols can be found + via elf_sym_hashes (input_bfd). + + When generating relocateable output, this function must handle + STB_LOCAL/STT_SECTION symbols specially. The output symbol is + going to be the section symbol corresponding to the output + section, which means that the addend must be adjusted + accordingly. */ + +static boolean +ip2k_elf_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd * output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info * info; + bfd * input_bfd; + asection * input_section; + bfd_byte * contents; + Elf_Internal_Rela * relocs; + Elf_Internal_Sym * local_syms; + asection ** local_sections; +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + Elf_Internal_Rela * rel; + Elf_Internal_Rela * relend; + + if (info->relocateable) + return true; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + relend = relocs + input_section->reloc_count; + + for (rel = relocs; rel < relend; rel ++) + { + reloc_howto_type * howto; + unsigned long r_symndx; + Elf_Internal_Sym * sym; + asection * sec; + struct elf_link_hash_entry * h; + bfd_vma relocation; + bfd_reloc_status_type r; + const char * name = NULL; + int r_type; + + /* This is a final link. */ + r_type = ELF32_R_TYPE (rel->r_info); + r_symndx = ELF32_R_SYM (rel->r_info); + howto = ip2k_elf_howto_table + ELF32_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = BASEADDR (sec) + sym->st_value; + + name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; + } + else + { + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + name = h->root.root.string; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = h->root.u.def.value + BASEADDR (sec); + } + else if (h->root.type == bfd_link_hash_undefweak) + { + relocation = 0; + } + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + (! info->shared || info->no_undefined)))) + return false; + relocation = 0; + } + } + + /* Finally, the sole IP2K-specific part. */ + r = ip2k_final_link_relocate (howto, input_bfd, input_section, + contents, rel, relocation); + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + r = info->callbacks->reloc_overflow + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset); + break; + + case bfd_reloc_undefined: + r = info->callbacks->undefined_symbol + (info, name, input_bfd, input_section, rel->r_offset, true); + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + break; + + /* This is how ip2k_final_link_relocate tells us of a non-kosher + reference between insn & data address spaces. */ + case bfd_reloc_notsupported: + if (sym != NULL) /* Only if it's not an unresolved symbol. */ + msg = _("unsupported relocation between data/insn address spaces"); + break; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous relocation"); + break; + + default: + msg = _("internal error: unknown error"); + break; + } + + if (msg) + r = info->callbacks->warning + (info, msg, name, input_bfd, input_section, rel->r_offset); + + if (! r) + return false; + } + } + + return true; +} + +static asection * +ip2k_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { +#if 0 + case R_IP2K_GNU_VTINHERIT: + case R_IP2K_GNU_VTENTRY: + break; +#endif + + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + if (!(elf_bad_symtab (sec->owner) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + { + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + } + } + return NULL; +} + +static boolean +ip2k_elf_gc_sweep_hook (abfd, info, sec, relocs) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; +{ + /* we don't use got and plt entries for ip2k */ + return true; +} + + +/* -------------------------------------------------------------------- */ + + +#define TARGET_BIG_SYM bfd_elf32_ip2k_vec +#define TARGET_BIG_NAME "elf32-ip2k" + +#define ELF_ARCH bfd_arch_ip2k +#define ELF_MACHINE_CODE EM_IP2K +#define ELF_MAXPAGESIZE 1 /* No pages on the IP2K */ + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto ip2k_info_to_howto_rela + +#define elf_backend_can_gc_sections 1 +#define elf_backend_rela_normal 1 +#define elf_backend_gc_mark_hook ip2k_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook ip2k_elf_gc_sweep_hook + +#define elf_backend_relocate_section ip2k_elf_relocate_section + +#define elf_symbol_leading_char '_' +#define bfd_elf32_bfd_reloc_type_lookup ip2k_reloc_type_lookup +#define bfd_elf32_bfd_relax_section ip2k_elf_relax_section + + +#include "elf32-target.h" + diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index e8015a9..a2e9e0b 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1,5 +1,5 @@ /* M32R-specific support for 32-bit ELF. - Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -78,7 +78,7 @@ static boolean m32r_elf_check_relocs const Elf_Internal_Rela *)); asection * m32r_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); #define NOP_INSN 0x7000 @@ -931,8 +931,7 @@ m32r_elf_final_sda_base (output_bfd, info, error_message, psb) /* Relocate an M32R/D ELF section. There is some attempt to make this function usable for many architectures, - both USE_REL and USE_RELA ['twould be nice if such a critter existed], - if only to serve as a learning tool. + both for RELA and REL type relocs, if only to serve as a learning tool. The RELOCATE_SECTION function is called by the new ELF backend linker to handle the relocations for a section. @@ -1337,13 +1336,10 @@ m32r_elf_relax_section (abfd, sec, link_info, again) /* The Rela structures are used here because that's what _bfd_elf32_link_read_relocs uses [for convenience - it sets the addend field to 0]. */ - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Rela *internal_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *contents = NULL; - bfd_byte *free_contents = NULL; - Elf32_External_Sym *extsyms = NULL; - Elf32_External_Sym *free_extsyms = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* Assume nothing changes. */ *again = false; @@ -1371,8 +1367,6 @@ m32r_elf_relax_section (abfd, sec, link_info, again) link_info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; /* Walk through them looking for relaxing opportunities. */ irelend = internal_relocs + sec->reloc_count; @@ -1397,7 +1391,6 @@ m32r_elf_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (! bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) @@ -1405,39 +1398,28 @@ m32r_elf_relax_section (abfd, sec, link_info, again) } } - /* Read this BFD's symbols if we haven't done so already. */ - if (extsyms == NULL) + /* Read this BFD's local symbols if we haven't done so already. */ + if (isymbuf == NULL && symtab_hdr->sh_info != 0) { - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - bfd_size_type amt = symtab_hdr->sh_size; - /* Go get them off disk. */ - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (extsyms, amt, abfd) != amt) - goto error_return; - } + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; } /* Get the value of the symbol referred to by the reloc. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - Elf_Internal_Sym isym; - asection *sym_sec; - /* A local symbol. */ - bfd_elf32_swap_symbol_in (abfd, - extsyms + ELF32_R_SYM (irel->r_info), - &isym); + Elf_Internal_Sym *isym; + asection *sym_sec; - sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx); - symval = (isym.st_value + isym = isymbuf + ELF32_R_SYM (irel->r_info), + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = (isym->st_value + sym_sec->output_section->vma + sym_sec->output_offset); } @@ -1599,13 +1581,8 @@ m32r_elf_relax_section (abfd, sec, link_info, again) /* Note that we've changed the relocs, section contents, etc. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - symtab_hdr->contents = (bfd_byte *) extsyms; - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Delete TO_DELETE bytes of data. */ if (!m32r_elf_relax_delete_bytes (abfd, sec, @@ -1633,45 +1610,47 @@ m32r_elf_relax_section (abfd, sec, link_info, again) /* loop to try the next reloc */ } - if (free_relocs != NULL) - { - free (free_relocs); - free_relocs = NULL; - } - - if (free_contents != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { if (! link_info->keep_memory) - free (free_contents); + free (isymbuf); else { - /* Cache the section contents for elf_link_input_bfd. */ - elf_section_data (sec)->this_hdr.contents = contents; + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } - free_contents = NULL; } - if (free_extsyms != NULL) + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) { if (! link_info->keep_memory) - free (free_extsyms); + free (contents); else { - /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = extsyms; + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; } - free_extsyms = NULL; } + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (free_extsyms != NULL) - free (free_extsyms); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return false; } @@ -1685,17 +1664,15 @@ m32r_elf_relax_delete_bytes (abfd, sec, addr, count) int count; { Elf_Internal_Shdr *symtab_hdr; - Elf32_External_Sym *extsyms; - int shndx, index; + int shndx; bfd_byte *contents; Elf_Internal_Rela *irel, *irelend; Elf_Internal_Rela *irelalign; bfd_vma toaddr; - Elf32_External_Sym *esym, *esymend; - struct elf_link_hash_entry *sym_hash; - - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + Elf_Internal_Sym *isym, *isymend; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; shndx = _bfd_elf_section_from_bfd_section (abfd, sec); @@ -1724,40 +1701,32 @@ m32r_elf_relax_delete_bytes (abfd, sec, addr, count) } /* Adjust the local symbols defined in this section. */ - esym = extsyms; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++) + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++) { - Elf_Internal_Sym isym; - - bfd_elf32_swap_symbol_in (abfd, esym, &isym); - - if (isym.st_shndx == shndx - && isym.st_value > addr - && isym.st_value < toaddr) - { - isym.st_value -= count; - bfd_elf32_swap_symbol_out (abfd, &isym, esym); - } + if (isym->st_shndx == shndx + && isym->st_value > addr + && isym->st_value < toaddr) + isym->st_value -= count; } /* Now adjust the global symbols defined in this section. */ - esym = extsyms + symtab_hdr->sh_info; - esymend = extsyms + (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)); - for (index = 0; esym < esymend; esym++, index++) + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + for (; sym_hashes < end_hashes; sym_hashes++) { - Elf_Internal_Sym isym; - - bfd_elf32_swap_symbol_in (abfd, esym, &isym); - sym_hash = elf_sym_hashes (abfd)[index]; - if (isym.st_shndx == shndx - && ((sym_hash)->root.type == bfd_link_hash_defined - || (sym_hash)->root.type == bfd_link_hash_defweak) - && (sym_hash)->root.u.def.section == sec - && (sym_hash)->root.u.def.value > addr - && (sym_hash)->root.u.def.value < toaddr) + struct elf_link_hash_entry *sym_hash = *sym_hashes; + + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec + && sym_hash->root.u.def.value > addr + && sym_hash->root.u.def.value < toaddr) { - (sym_hash)->root.u.def.value -= count; + sym_hash->root.u.def.value -= count; } } @@ -1782,8 +1751,7 @@ m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order, bfd *input_bfd = input_section->owner; asection **sections = NULL; Elf_Internal_Rela *internal_relocs = NULL; - Elf32_External_Sym *external_syms = NULL; - Elf_Internal_Sym *internal_syms = NULL; + Elf_Internal_Sym *isymbuf = NULL; bfd_size_type amt; /* We only need to handle the case of relaxing, or of having a @@ -1807,31 +1775,22 @@ m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order, asection **secpp; Elf32_External_Sym *esym, *esymend; - if (symtab_hdr->contents != NULL) - external_syms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - external_syms = (Elf32_External_Sym *) bfd_malloc (amt); - if (external_syms == NULL && symtab_hdr->sh_info > 0) - goto error_return; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (external_syms, amt, input_bfd) != amt) - goto error_return; - } - internal_relocs = (_bfd_elf32_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, false)); if (internal_relocs == NULL) goto error_return; - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_Internal_Sym); - internal_syms = (Elf_Internal_Sym *) bfd_malloc (amt); - if (internal_syms == NULL && symtab_hdr->sh_info > 0) - goto error_return; + if (symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } amt = symtab_hdr->sh_info; amt *= sizeof (asection *); @@ -1839,61 +1798,50 @@ m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order, if (sections == NULL && symtab_hdr->sh_info > 0) goto error_return; - isymp = internal_syms; - secpp = sections; - esym = external_syms; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; ++esym, ++isymp, ++secpp) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp) { asection *isec; - bfd_elf32_swap_symbol_in (input_bfd, esym, isymp); - - if (isymp->st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) isec = bfd_und_section_ptr; - else if (isymp->st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) isec = bfd_abs_section_ptr; - else if (isymp->st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) isec = bfd_com_section_ptr; - else if (isymp->st_shndx == SHN_M32R_SCOMMON) + else if (isym->st_shndx == SHN_M32R_SCOMMON) isec = &m32r_elf_scom_section; else - isec = bfd_section_from_elf_index (input_bfd, isymp->st_shndx); + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); *secpp = isec; } if (! m32r_elf_relocate_section (output_bfd, link_info, input_bfd, input_section, data, internal_relocs, - internal_syms, sections)) + isymbuf, sections)) goto error_return; if (sections != NULL) free (sections); - sections = NULL; - if (internal_syms != NULL) - free (internal_syms); - internal_syms = NULL; - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - external_syms = NULL; - if (internal_relocs != elf_section_data (input_section)->relocs) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); - internal_relocs = NULL; } return data; error_return: - if (internal_relocs != NULL - && internal_relocs != elf_section_data (input_section)->relocs) - free (internal_relocs); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_syms != NULL) - free (internal_syms); if (sections != NULL) free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); return NULL; } @@ -2033,12 +1981,12 @@ m32r_elf_print_private_bfd_data (abfd, ptr) } asection * -m32r_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +m32r_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; { if (h != NULL) { @@ -2064,9 +2012,8 @@ m32r_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + return NULL; } diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index ae69ae2..f189be8 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1,6 +1,6 @@ /* Motorola 68HC11-specific support for 32-bit ELF - Copyright 1999, 2000 Free Software Foundation, Inc. - Contributed by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) This file is part of BFD, the Binary File Descriptor library. @@ -21,14 +21,45 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" +#include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" #include "elf/m68hc11.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup -PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static void m68hc11_info_to_howto_rel -PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + +static bfd_reloc_status_type m68hc11_elf_ignore_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + +/* GC mark and sweep. */ +static asection *elf32_m68hc11_gc_mark_hook + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_m68hc11_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_m68hc11_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_m68hc11_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static boolean m68hc11_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static void m68hc11_elf_relax_delete_bytes + PARAMS ((bfd *, asection *, bfd_vma, int)); +static void m68hc11_relax_group + PARAMS ((bfd *, asection *, bfd_byte *, unsigned, + unsigned long, unsigned long)); +static int compare_reloc PARAMS ((const void *, const void *)); + + +boolean _bfd_m68hc11_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd *, flagword)); +boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); /* Use REL instead of RELA to save space */ #define USE_REL @@ -46,7 +77,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 32, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_M68HC11_NONE", /* name */ false, /* partial_inplace */ @@ -110,7 +141,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { bfd_elf_generic_reloc, /* special_function */ "R_M68HC11_PCREL_8", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ false), /* pcrel_offset */ @@ -171,7 +202,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { bfd_elf_generic_reloc, /* special_function */ "R_M68HC11_PCREL_16", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0xffff, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ @@ -204,6 +235,88 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ + + /* A 24 bit relocation */ + HOWTO (R_M68HC11_24, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_24", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16-bit low relocation */ + HOWTO (R_M68HC11_LO16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_LO16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A page relocation */ + HOWTO (R_M68HC11_PAGE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_PAGE", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + + /* Mark beginning of a jump instruction (any form). */ + HOWTO (R_M68HC11_RL_JUMP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC11_RL_JUMP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Mark beginning of Gcc relaxation group instruction. */ + HOWTO (R_M68HC11_RL_GROUP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC11_RL_GROUP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ }; /* Map BFD reloc types to M68HC11 ELF reloc types. */ @@ -225,9 +338,15 @@ static const struct m68hc11_reloc_map m68hc11_reloc_map[] = { {BFD_RELOC_32, R_M68HC11_32}, {BFD_RELOC_M68HC11_3B, R_M68HC11_3B}, - /* The following relocs are defined but they probably don't work yet. */ {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT}, {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY}, + + {BFD_RELOC_M68HC11_LO16, R_M68HC11_LO16}, + {BFD_RELOC_M68HC11_PAGE, R_M68HC11_PAGE}, + {BFD_RELOC_M68HC11_24, R_M68HC11_24}, + + {BFD_RELOC_M68HC11_RL_JUMP, R_M68HC11_RL_JUMP}, + {BFD_RELOC_M68HC11_RL_GROUP, R_M68HC11_RL_GROUP}, }; static reloc_howto_type * @@ -248,6 +367,25 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return NULL; } +/* This function is used for relocs which are only used for relaxing, + which the linker should otherwise ignore. */ + +static bfd_reloc_status_type +m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + if (output_bfd != NULL) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + /* Set the howto pointer for an M68HC11 ELF reloc. */ static void @@ -263,6 +401,1213 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; } +static asection * +elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + return NULL; +} + +static boolean +elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; +{ + /* We don't use got and plt entries for 68hc11/68hc12. */ + return true; +} + +struct m68hc11_direct_relax +{ + const char *name; + unsigned char code; + unsigned char direct_code; +} m68hc11_direct_relax_table[] = { + { "adca", 0xB9, 0x99 }, + { "adcb", 0xF9, 0xD9 }, + { "adda", 0xBB, 0x9B }, + { "addb", 0xFB, 0xDB }, + { "addd", 0xF3, 0xD3 }, + { "anda", 0xB4, 0x94 }, + { "andb", 0xF4, 0xD4 }, + { "cmpa", 0xB1, 0x91 }, + { "cmpb", 0xF1, 0xD1 }, + { "cpd", 0xB3, 0x93 }, + { "cpxy", 0xBC, 0x9C }, +/* { "cpy", 0xBC, 0x9C }, */ + { "eora", 0xB8, 0x98 }, + { "eorb", 0xF8, 0xD8 }, + { "jsr", 0xBD, 0x9D }, + { "ldaa", 0xB6, 0x96 }, + { "ldab", 0xF6, 0xD6 }, + { "ldd", 0xFC, 0xDC }, + { "lds", 0xBE, 0x9E }, + { "ldxy", 0xFE, 0xDE }, + /* { "ldy", 0xFE, 0xDE },*/ + { "oraa", 0xBA, 0x9A }, + { "orab", 0xFA, 0xDA }, + { "sbca", 0xB2, 0x92 }, + { "sbcb", 0xF2, 0xD2 }, + { "staa", 0xB7, 0x97 }, + { "stab", 0xF7, 0xD7 }, + { "std", 0xFD, 0xDD }, + { "sts", 0xBF, 0x9F }, + { "stxy", 0xFF, 0xDF }, + /* { "sty", 0xFF, 0xDF },*/ + { "suba", 0xB0, 0x90 }, + { "subb", 0xF0, 0xD0 }, + { "subd", 0xB3, 0x93 }, + { 0, 0, 0 } +}; + +static struct m68hc11_direct_relax * +find_relaxable_insn (unsigned char code) +{ + int i; + + for (i = 0; m68hc11_direct_relax_table[i].name; i++) + if (m68hc11_direct_relax_table[i].code == code) + return &m68hc11_direct_relax_table[i]; + + return 0; +} + +static int +compare_reloc (e1, e2) + const void *e1; + const void *e2; +{ + const Elf_Internal_Rela *i1 = (const Elf_Internal_Rela *) e1; + const Elf_Internal_Rela *i2 = (const Elf_Internal_Rela *) e2; + + if (i1->r_offset == i2->r_offset) + return 0; + else + return i1->r_offset < i2->r_offset ? -1 : 1; +} + +#define M6811_OP_LDX_IMMEDIATE (0xCE) + +static void +m68hc11_relax_group (abfd, sec, contents, value, offset, end_group) + bfd *abfd; + asection *sec; + bfd_byte *contents; + unsigned value; + unsigned long offset; + unsigned long end_group; +{ + unsigned char code; + unsigned long start_offset; + unsigned long ldx_offset = offset; + unsigned long ldx_size; + int can_delete_ldx; + int relax_ldy = 0; + + /* First instruction of the relax group must be a + LDX #value or LDY #value. If this is not the case, + ignore the relax group. */ + code = bfd_get_8 (abfd, contents + offset); + if (code == 0x18) + { + relax_ldy++; + offset++; + code = bfd_get_8 (abfd, contents + offset); + } + ldx_size = offset - ldx_offset + 3; + offset += 3; + if (code != M6811_OP_LDX_IMMEDIATE || offset >= end_group) + return; + + + /* We can remove the LDX/LDY only when all bset/brclr instructions + of the relax group have been converted to use direct addressing + mode. */ + can_delete_ldx = 1; + while (offset < end_group) + { + unsigned isize; + unsigned new_value; + int bset_use_y; + + bset_use_y = 0; + start_offset = offset; + code = bfd_get_8 (abfd, contents + offset); + if (code == 0x18) + { + bset_use_y++; + offset++; + code = bfd_get_8 (abfd, contents + offset); + } + + /* Check the instruction and translate to use direct addressing mode. */ + switch (code) + { + /* bset */ + case 0x1C: + code = 0x14; + isize = 3; + break; + + /* brclr */ + case 0x1F: + code = 0x13; + isize = 4; + break; + + /* brset */ + case 0x1E: + code = 0x12; + isize = 4; + break; + + /* bclr */ + case 0x1D: + code = 0x15; + isize = 3; + break; + + /* This instruction is not recognized and we are not + at end of the relax group. Ignore and don't remove + the first LDX (we don't know what it is used for...). */ + default: + return; + } + new_value = (unsigned) bfd_get_8 (abfd, contents + offset + 1); + new_value += value; + if ((new_value & 0xff00) == 0 && bset_use_y == relax_ldy) + { + bfd_put_8 (abfd, code, contents + offset); + bfd_put_8 (abfd, new_value, contents + offset + 1); + if (start_offset != offset) + { + m68hc11_elf_relax_delete_bytes (abfd, sec, start_offset, + offset - start_offset); + end_group--; + } + } + else + { + can_delete_ldx = 0; + } + offset = start_offset + isize; + } + if (can_delete_ldx) + { + /* Remove the move instruction (3 or 4 bytes win). */ + m68hc11_elf_relax_delete_bytes (abfd, sec, ldx_offset, ldx_size); + } +} + +/* This function handles relaxing for the 68HC11. + + + and somewhat more difficult to support. */ + +static boolean +m68hc11_elf_relax_section (abfd, sec, link_info, again) + bfd *abfd; + asection *sec; + struct bfd_link_info *link_info; + boolean *again; +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents = NULL; + bfd_byte *free_contents = NULL; + Elf32_External_Sym *extsyms = NULL; + Elf32_External_Sym *free_extsyms = NULL; + Elf_Internal_Rela *prev_insn_branch = NULL; + Elf_Internal_Rela *prev_insn_group = NULL; + unsigned insn_group_value = 0; + Elf_External_Sym_Shndx *shndx_buf = NULL; + + /* Assume nothing changes. */ + *again = false; + + /* We don't have to do anything for a relocateable link, if + this section does not have relocs, or if this is not a + code section. */ + if (link_info->relocateable + || (sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0 + || (sec->flags & SEC_CODE) == 0) + return true; + + /* If this is the first time we have been called for this section, + initialize the cooked size. */ + if (sec->_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + + /* Get a copy of the native relocations. */ + internal_relocs = (_bfd_elf32_link_read_relocs + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + goto error_return; + if (! link_info->keep_memory) + free_relocs = internal_relocs; + + /* Checking for branch relaxation relies on the relocations to + be sorted on 'r_offset'. This is not guaranteed so we must sort. */ + qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), + compare_reloc); + + /* Walk through them looking for relaxing opportunities. */ + irelend = internal_relocs + sec->reloc_count; + for (irel = internal_relocs; irel < irelend; irel++) + { + bfd_vma symval; + bfd_vma value; + Elf_Internal_Sym isym; + + /* If this isn't something that can be relaxed, then ignore + this reloc. */ + if (ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_16 + && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_JUMP + && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_GROUP) + { + prev_insn_branch = 0; + prev_insn_group = 0; + continue; + } + + /* Get the section contents if we haven't done so already. */ + if (contents == NULL) + { + /* Get cached copy if it exists. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else + { + /* Go get them off disk. */ + contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (contents == NULL) + goto error_return; + free_contents = contents; + + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; + } + } + + /* Try to eliminate an unconditional 8 bit pc-relative branch + which immediately follows a conditional 8 bit pc-relative + branch around the unconditional branch. + + original: new: + bCC lab1 bCC' lab2 + bra lab2 + lab1: lab1: + + This happens when the bCC can't reach lab2 at assembly time, + but due to other relaxations it can reach at link time. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_RL_JUMP) + { + Elf_Internal_Rela *nrel; + unsigned char code; + unsigned char roffset; + + prev_insn_branch = 0; + prev_insn_group = 0; + + /* Do nothing if this reloc is the last byte in the section. */ + if (irel->r_offset == sec->_cooked_size) + continue; + + /* See if the next instruction is an unconditional pc-relative + branch, more often than not this test will fail, so we + test it first to speed things up. */ + code = bfd_get_8 (abfd, contents + irel->r_offset + 2); + if (code != 0x7e) + continue; + + /* Also make sure the next relocation applies to the next + instruction and that it's a pc-relative 8 bit branch. */ + nrel = irel + 1; + if (nrel == irelend + || irel->r_offset + 3 != nrel->r_offset + || ELF32_R_TYPE (nrel->r_info) != (int) R_M68HC11_16) + continue; + + /* Make sure our destination immediately follows the + unconditional branch. */ + roffset = bfd_get_8 (abfd, contents + irel->r_offset + 1); + if (roffset != 3) + continue; + + prev_insn_branch = irel; + prev_insn_group = 0; + continue; + } + + /* Read this BFD's symbols if we haven't done so already. */ + if (extsyms == NULL) + { + /* Get cached copy if it exists. */ + if (symtab_hdr->contents != NULL) + extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + else + { + /* Go get them off disk. */ + bfd_size_type amt = symtab_hdr->sh_size; + extsyms = (Elf32_External_Sym *) bfd_malloc (amt); + if (extsyms == NULL) + goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) extsyms, amt, abfd) != amt) + goto error_return; + } + + if (shndx_hdr->sh_size != 0) + { + bfd_size_type amt; + + amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); + shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + if (shndx_buf == NULL) + goto error_return; + if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + goto error_return; + shndx_hdr->contents = (PTR) shndx_buf; + } + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + Elf32_External_Sym *esym; + Elf_External_Sym_Shndx *shndx; + asection *sym_sec; + + /* A local symbol. */ + esym = extsyms + ELF32_R_SYM (irel->r_info); + shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); + bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); + + sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx); + symval = (isym.st_value + + sym_sec->output_section->vma + + sym_sec->output_offset); + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + { + /* This appears to be a reference to an undefined + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ + prev_insn_branch = 0; + prev_insn_group = 0; + continue; + } + + symval = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } + + if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_RL_GROUP) + { + prev_insn_branch = 0; + prev_insn_group = 0; + + /* Do nothing if this reloc is the last byte in the section. */ + if (irel->r_offset == sec->_cooked_size) + continue; + + prev_insn_group = irel; + insn_group_value = isym.st_value; + continue; + } + + value = symval; + /* Try to turn a far branch to a near branch. */ + if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16 + && prev_insn_branch) + { + bfd_vma offset; + unsigned char code; + + offset = value - (prev_insn_branch->r_offset + + sec->output_section->vma + + sec->output_offset + 2); + + /* If the offset is still out of -128..+127 range, + leave that far branch unchanged. */ + if ((offset & 0xff80) != 0 && (offset & 0xff80) != 0xff80) + { + prev_insn_branch = 0; + continue; + } + + /* Shrink the branch. */ + code = bfd_get_8 (abfd, contents + prev_insn_branch->r_offset); + if (code == 0x7e) + { + code = 0x20; + bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset); + bfd_put_8 (abfd, offset, + contents + prev_insn_branch->r_offset + 1); + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + m68hc11_elf_relax_delete_bytes (abfd, sec, + irel->r_offset, 1); + } + else + { + code ^= 0x1; + bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset); + bfd_put_8 (abfd, offset, + contents + prev_insn_branch->r_offset + 1); + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + m68hc11_elf_relax_delete_bytes (abfd, sec, + irel->r_offset - 1, 3); + } + prev_insn_branch = 0; + } + + /* Try to turn a 16 bit address into a 8 bit page0 address. */ + else if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16 + && (value & 0xff00) == 0) + { + unsigned char code; + unsigned short offset; + struct m68hc11_direct_relax *rinfo; + + prev_insn_branch = 0; + offset = bfd_get_16 (abfd, contents + irel->r_offset); + offset += value; + if ((offset & 0xff00) != 0) + { + prev_insn_group = 0; + continue; + } + + if (prev_insn_group) + { + /* Note that we've changed the reldection contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + m68hc11_relax_group (abfd, sec, contents, offset, + prev_insn_group->r_offset, + insn_group_value); + irel = prev_insn_group; + prev_insn_group = 0; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + continue; + } + + /* Get the opcode. */ + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + rinfo = find_relaxable_insn (code); + if (rinfo == 0) + { + prev_insn_group = 0; + continue; + } + + /* Note that we've changed the reldection contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + /* Fix the opcode. */ + /* printf ("A relaxable case : 0x%02x (%s)\n", + code, rinfo->name); */ + bfd_put_8 (abfd, rinfo->direct_code, + contents + irel->r_offset - 1); + + /* Delete one byte of data (upper byte of address). */ + m68hc11_elf_relax_delete_bytes (abfd, sec, irel->r_offset, 1); + + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_8); + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = true; + } + else if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_16) + { + unsigned char code; + bfd_vma offset; + + prev_insn_branch = 0; + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + if (code == 0x7e) + { + offset = value - (irel->r_offset + + sec->output_section->vma + + sec->output_offset + 1); + offset += bfd_get_16 (abfd, contents + irel->r_offset); + + /* If the offset is still out of -128..+127 range, + leave that far branch unchanged. */ + if ((offset & 0xff80) == 0 || (offset & 0xff80) == 0xff80) + { + + /* Note that we've changed the reldection contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + free_relocs = NULL; + + elf_section_data (sec)->this_hdr.contents = contents; + free_contents = NULL; + + symtab_hdr->contents = (bfd_byte *) extsyms; + free_extsyms = NULL; + + /* Shrink the branch. */ + code = 0x20; + bfd_put_8 (abfd, code, + contents + irel->r_offset - 1); + bfd_put_8 (abfd, offset, + contents + irel->r_offset); + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + m68hc11_elf_relax_delete_bytes (abfd, sec, + irel->r_offset + 1, 1); + } + } + } + prev_insn_branch = 0; + } + + if (free_relocs != NULL) + { + free (free_relocs); + free_relocs = NULL; + } + + if (free_contents != NULL) + { + if (! link_info->keep_memory) + free (free_contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + free_contents = NULL; + } + + if (free_extsyms != NULL) + { + if (! link_info->keep_memory) + free (free_extsyms); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) extsyms; + } + free_extsyms = NULL; + } + + return true; + + error_return: + if (free_relocs != NULL) + free (free_relocs); + if (free_contents != NULL) + free (free_contents); + if (free_extsyms != NULL) + free (free_extsyms); + return false; +} + +/* Delete some bytes from a section while relaxing. */ + +static void +m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count) + bfd *abfd; + asection *sec; + bfd_vma addr; + int count; +{ + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *shndx_hdr; + Elf32_External_Sym *extsyms; + unsigned int sec_shndx; + Elf_External_Sym_Shndx *shndx; + bfd_byte *contents; + Elf_Internal_Rela *irel, *irelend; + bfd_vma toaddr; + Elf32_External_Sym *esym, *esymend; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + + sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + contents = elf_section_data (sec)->this_hdr.contents; + + toaddr = sec->_cooked_size; + + irel = elf_section_data (sec)->relocs; + irelend = irel + sec->reloc_count; + + /* Actually delete the bytes. */ + memmove (contents + addr, contents + addr + count, + (size_t) (toaddr - addr - count)); + sec->_cooked_size -= count; + + /* Adjust all the relocs. */ + for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++) + { + unsigned char code; + unsigned char offset; + unsigned short raddr; + unsigned long old_offset; + int branch_pos; + + old_offset = irel->r_offset; + + /* See if this reloc was for the bytes we have deleted, in which + case we no longer care about it. Don't delete relocs which + represent addresses, though. */ + if (ELF32_R_TYPE (irel->r_info) != R_M68HC11_RL_JUMP + && irel->r_offset >= addr && irel->r_offset < addr + count) + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_M68HC11_NONE); + + if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_NONE) + continue; + + /* Get the new reloc address. */ + if ((irel->r_offset > addr + && irel->r_offset < toaddr)) + irel->r_offset -= count; + + /* If this is a PC relative reloc, see if the range it covers + includes the bytes we have deleted. */ + switch (ELF32_R_TYPE (irel->r_info)) + { + default: + break; + + case R_M68HC11_RL_JUMP: + code = bfd_get_8 (abfd, contents + irel->r_offset); + switch (code) + { + /* jsr and jmp instruction are also marked with RL_JUMP + relocs but no adjustment must be made. */ + case 0x7e: + case 0x9d: + case 0xbd: + continue; + + case 0x12: + case 0x13: + branch_pos = 3; + raddr = 4; + + /* Special case when we translate a brclr N,y into brclr *<addr> + In this case, the 0x18 page2 prefix is removed. + The reloc offset is not modified but the instruction + size is reduced by 1. */ + if (old_offset == addr) + raddr++; + break; + + case 0x1e: + case 0x1f: + branch_pos = 3; + raddr = 4; + break; + + case 0x18: + branch_pos = 4; + raddr = 5; + break; + + default: + branch_pos = 1; + raddr = 2; + break; + } + offset = bfd_get_8 (abfd, contents + irel->r_offset + branch_pos); + raddr += old_offset; + raddr += ((unsigned short) offset | ((offset & 0x80) ? 0xff00 : 0)); + if (irel->r_offset < addr && raddr >= addr) + { + offset -= count; + bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos); + } + else if (irel->r_offset >= addr && raddr <= addr) + { + offset += count; + bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos); + } + else + { + /*printf ("Not adjusted 0x%04x [0x%4x 0x%4x]\n", raddr, + irel->r_offset, addr);*/ + } + + break; + } + } + + /* Adjust the local symbols defined in this section. */ + shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents; + esym = extsyms; + esymend = esym + symtab_hdr->sh_info; + for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + { + Elf_Internal_Sym isym; + Elf_External_Sym_Shndx dummy; + + bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); + + if (isym.st_shndx == sec_shndx + && isym.st_value > addr + && isym.st_value < toaddr) + { + isym.st_value -= count; + bfd_elf32_swap_symbol_out (abfd, &isym, esym, &dummy); + } + } + + /* Now adjust the global symbols defined in this section. */ + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = elf_sym_hashes (abfd); + end_hashes = sym_hashes + symcount; + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf_link_hash_entry *sym_hash = *sym_hashes; + if ((sym_hash->root.type == bfd_link_hash_defined + || sym_hash->root.type == bfd_link_hash_defweak) + && sym_hash->root.u.def.section == sec + && sym_hash->root.u.def.value > addr + && sym_hash->root.u.def.value < toaddr) + { + sym_hash->root.u.def.value -= count; + } + } +} + +/* Look through the relocs for a section during the first phase. + Since we don't do .gots or .plts, we just need to consider the + virtual table relocs for gc. */ + +static boolean +elf32_m68hc11_check_relocs (abfd, info, sec, relocs) + bfd * abfd; + struct bfd_link_info * info; + asection * sec; + const Elf_Internal_Rela * relocs; +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + struct elf_link_hash_entry ** sym_hashes_end; + const Elf_Internal_Rela * rel; + const Elf_Internal_Rela * rel_end; + + if (info->relocateable) + return true; + + symtab_hdr = & elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + rel_end = relocs + sec->reloc_count; + + for (rel = relocs; rel < rel_end; rel++) + { + struct elf_link_hash_entry * h; + unsigned long r_symndx; + + r_symndx = ELF32_R_SYM (rel->r_info); + + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + + switch (ELF32_R_TYPE (rel->r_info)) + { + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_M68HC11_GNU_VTINHERIT: + if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return false; + break; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_M68HC11_GNU_VTENTRY: + if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; + } + } + + return true; +} + +/* Relocate a 68hc11/68hc12 ELF section. */ +static boolean +elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd *output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel, *relend; + const char *name; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + bfd_vma relocation; + bfd_reloc_status_type r; + + r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + if (r_type == R_M68HC11_GNU_VTENTRY + || r_type == R_M68HC11_GNU_VTINHERIT ) + continue; + + howto = elf_m68hc11_howto_table + r_type; + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections[r_symndx]; + rel->r_addend += sec->output_offset + sym->st_value; + } + } + + continue; + } + + /* This is a final link. */ + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + } + else + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_undefweak) + relocation = 0; + else + { + if (!((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, true))) + return false; + relocation = 0; + } + } + + if (h != NULL) + name = h->root.root.string; + else + { + name = (bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name)); + if (name == NULL || *name == '\0') + name = bfd_section_name (input_bfd, sec); + } + + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) 0; + + switch (r) + { + case bfd_reloc_overflow: + if (!((*info->callbacks->reloc_overflow) + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset))) + return false; + break; + + case bfd_reloc_undefined: + if (!((*info->callbacks->undefined_symbol) + (info, name, input_bfd, input_section, + rel->r_offset, true))) + return false; + break; + + case bfd_reloc_outofrange: + msg = _ ("internal error: out of range error"); + goto common_error; + + case bfd_reloc_notsupported: + msg = _ ("internal error: unsupported relocation error"); + goto common_error; + + case bfd_reloc_dangerous: + msg = _ ("internal error: dangerous error"); + goto common_error; + + default: + msg = _ ("internal error: unknown error"); + /* fall through */ + + common_error: + if (!((*info->callbacks->warning) + (info, msg, name, input_bfd, input_section, + rel->r_offset))) + return false; + break; + } + } + } + + return true; +} + + + +/* Set and control ELF flags in ELF header. */ + +boolean +_bfd_m68hc11_elf_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +boolean +_bfd_m68hc11_elf_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + flagword old_flags; + flagword new_flags; + boolean ok = true; + + /* Check if we have the same endianess */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + new_flags = elf_elfheader (ibfd)->e_flags; + elf_elfheader (obfd)->e_flags |= new_flags & EF_M68HC11_ABI; + old_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = new_flags; + elf_elfheader (obfd)->e_ident[EI_CLASS] + = elf_elfheader (ibfd)->e_ident[EI_CLASS]; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd))) + return false; + } + + return true; + } + + /* Check ABI compatibility. */ + if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 16-bit integers (-mshort) " + "and others for 32-bit integers"), + bfd_archive_filename (ibfd)); + ok = false; + } + if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 32-bit double (-fshort-double) " + "and others for 64-bit double"), + bfd_archive_filename (ibfd)); + ok = false; + } + new_flags &= ~EF_M68HC11_ABI; + old_flags &= ~EF_M68HC11_ABI; + + /* Warn about any other mismatches */ + if (new_flags != old_flags) + { + (*_bfd_error_handler) + (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), + bfd_archive_filename (ibfd), (unsigned long) new_flags, + (unsigned long) old_flags); + ok = false; + } + + if (! ok) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + return true; +} + +boolean +_bfd_m68hc11_elf_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + /* xgettext:c-format */ + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_I32) + fprintf (file, _("[abi=32-bit int,")); + else + fprintf (file, _("[abi=16-bit int,")); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_F64) + fprintf (file, _(" 64-bit double]")); + else + fprintf (file, _(" 32-bit double]")); + + if (elf_elfheader (abfd)->e_flags & E_M68HC12_BANKS) + fprintf (file, _(" [memory=bank-model]")); + else + fprintf (file, _(" [memory=flat]")); + + fputc ('\n', file); + + return true; +} + /* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c. The Motorola spec says to use a different Elf machine code. */ #define ELF_ARCH bfd_arch_m68hc11 @@ -274,7 +1619,18 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) #define elf_info_to_howto 0 #define elf_info_to_howto_rel m68hc11_info_to_howto_rel +#define bfd_elf32_bfd_relax_section m68hc11_elf_relax_section +#define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook +#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook +#define elf_backend_check_relocs elf32_m68hc11_check_relocs +#define elf_backend_relocate_section elf32_m68hc11_relocate_section #define elf_backend_object_p 0 #define elf_backend_final_write_processing 0 +#define elf_backend_can_gc_sections 1 +#define bfd_elf32_bfd_merge_private_bfd_data \ + _bfd_m68hc11_elf_merge_private_bfd_data +#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags +#define bfd_elf32_bfd_print_private_bfd_data \ + _bfd_m68hc11_elf_print_private_bfd_data #include "elf32-target.h" diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c index 8f6ca49..9ab8780 100644 --- a/bfd/elf32-m68hc12.c +++ b/bfd/elf32-m68hc12.c @@ -1,6 +1,6 @@ /* Motorola 68HC12-specific support for 32-bit ELF - Copyright 1999, 2000 Free Software Foundation, Inc. - Contributed by Stephane Carrez (stcarrez@worldnet.fr) + Copyright 1999, 2000, 2002 Free Software Foundation, Inc. + Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) This file is part of BFD, the Binary File Descriptor library. @@ -24,11 +24,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" #include "elf/m68hc11.h" +#include "opcode/m68hc11.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup -PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static void m68hc11_info_to_howto_rel -PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + +static bfd_reloc_status_type m68hc11_elf_ignore_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type m68hc12_elf_special_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static int m68hc12_addr_is_banked PARAMS ((bfd_vma)); +static bfd_vma m68hc12_phys_addr PARAMS ((bfd_vma)); +static bfd_vma m68hc12_phys_page PARAMS ((bfd_vma)); + +/* GC mark and sweep. */ +static asection *elf32_m68hc11_gc_mark_hook + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_m68hc11_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); + +boolean _bfd_m68hc12_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +boolean _bfd_m68hc12_elf_set_private_flags PARAMS ((bfd *, flagword)); +boolean _bfd_m68hc12_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); + + /* Use REL instead of RELA to save space */ #define USE_REL @@ -37,6 +60,68 @@ PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); We must handle 8 and 16-bit relocations. The 32-bit relocation is defined but not used except by gas when -gstabs is used (which is wrong). + + The 68HC12 microcontroler has a memory bank switching system + with a 16Kb window in the 64Kb address space. The extended memory + is mapped in the 16Kb window (at 0x8000). The page register controls + which 16Kb bank is mapped. The call/rtc instructions take care of + bank switching in function calls/returns. + + For GNU Binutils to work, we consider there is a physical memory + at 0..0x0ffff and a kind of virtual memory above that. Symbols + in virtual memory have their addresses treated in a special way + when disassembling and when linking. + + For the linker to work properly, we must always relocate the virtual + memory as if it is mapped at 0x8000. When a 16-bit relocation is + made in the virtual memory, we check that it does not cross the + memory bank where it is used. This would involve a page change + which would be wrong. The 24-bit relocation is for that and it + treats the address as a physical address + page number. + + + Banked + Address Space + | | Page n + +---------------+ 0x1010000 + | | + | jsr _foo | + | .. | Page 3 + | _foo: | + +---------------+ 0x100C000 + | | + | call _bar | + | .. | Page 2 + | _bar: | + +---------------+ 0x1008000 + /------>| | + | | call _foo | Page 1 + | | | + | +---------------+ 0x1004000 + Physical | | | + Address Space | | | Page 0 + | | | + +-----------+ 0x00FFFF | +---------------+ 0x1000000 + | | | + | call _foo | | + | | | + +-----------+ 0x00BFFF -+---/ + | | | + | | | + | | 16K | + | | | + +-----------+ 0x008000 -+ + | | + | | + = = + | | + | | + +-----------+ 0000 + + + The 'call _foo' must be relocated with page 3 and 16-bit address + mapped at 0x8000. + The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */ static reloc_howto_type elf_m68hc11_howto_table[] = { /* This reloc does nothing. */ @@ -46,9 +131,9 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 32, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_NONE", /* name */ + "R_M68HC12_NONE", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ @@ -63,7 +148,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_8", /* name */ + "R_M68HC12_8", /* name */ false, /* partial_inplace */ 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ @@ -78,7 +163,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_HI8", /* name */ + "R_M68HC12_HI8", /* name */ false, /* partial_inplace */ 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ @@ -93,7 +178,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_LO8", /* name */ + "R_M68HC12_LO8", /* name */ false, /* partial_inplace */ 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ @@ -108,9 +193,9 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_PCREL_8", /* name */ + "R_M68HC12_PCREL_8", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0x00ff, /* src_mask */ 0x00ff, /* dst_mask */ false), /* pcrel_offset */ @@ -122,8 +207,8 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont /*bitfield */ , /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_16", /* name */ + m68hc12_elf_special_reloc, /* special_function */ + "R_M68HC12_16", /* name */ false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ @@ -139,7 +224,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_32", /* name */ + "R_M68HC12_32", /* name */ false, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ @@ -154,7 +239,7 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_4B", /* name */ + "R_M68HC12_4B", /* name */ false, /* partial_inplace */ 0x003, /* src_mask */ 0x003, /* dst_mask */ @@ -169,9 +254,9 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_M68HC11_PCREL_16", /* name */ + "R_M68HC12_PCREL_16", /* name */ false, /* partial_inplace */ - 0x0, /* src_mask */ + 0xffff, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ @@ -204,6 +289,88 @@ static reloc_howto_type elf_m68hc11_howto_table[] = { 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ + + /* A 24 bit relocation */ + HOWTO (R_M68HC11_24, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc12_elf_special_reloc, /* special_function */ + "R_M68HC12_24", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16-bit low relocation */ + HOWTO (R_M68HC11_LO16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc12_elf_special_reloc,/* special_function */ + "R_M68HC12_LO16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A page relocation */ + HOWTO (R_M68HC11_PAGE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc12_elf_special_reloc,/* special_function */ + "R_M68HC12_PAGE", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + + /* Mark beginning of a jump instruction (any form). */ + HOWTO (R_M68HC11_RL_JUMP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC12_RL_JUMP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ + + /* Mark beginning of Gcc relaxation group instruction. */ + HOWTO (R_M68HC11_RL_GROUP, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + m68hc11_elf_ignore_reloc, /* special_function */ + "R_M68HC12_RL_GROUP", /* name */ + true, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + true), /* pcrel_offset */ }; /* Map BFD reloc types to M68HC11 ELF reloc types. */ @@ -225,9 +392,15 @@ static const struct m68hc11_reloc_map m68hc11_reloc_map[] = { {BFD_RELOC_32, R_M68HC11_32}, {BFD_RELOC_M68HC11_3B, R_M68HC11_3B}, - /* The following relocs are defined but they probably don't work yet. */ {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT}, {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY}, + + {BFD_RELOC_M68HC11_LO16, R_M68HC11_LO16}, + {BFD_RELOC_M68HC11_PAGE, R_M68HC11_PAGE}, + {BFD_RELOC_M68HC11_24, R_M68HC11_24}, + + {BFD_RELOC_M68HC11_RL_JUMP, R_M68HC11_RL_JUMP}, + {BFD_RELOC_M68HC11_RL_GROUP, R_M68HC11_RL_GROUP}, }; static reloc_howto_type * @@ -248,6 +421,158 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) return NULL; } +/* This function is used for relocs which are only used for relaxing, + which the linker should otherwise ignore. */ + +static bfd_reloc_status_type +m68hc11_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + if (output_bfd != NULL) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + +static int +m68hc12_addr_is_banked (addr) + bfd_vma addr; +{ + return (addr >= M68HC12_BANK_VIRT) ? 1 : 0; +} + +/* Return the physical address seen by the processor, taking + into account banked memory. */ +static bfd_vma +m68hc12_phys_addr (addr) + bfd_vma addr; +{ + if (addr < M68HC12_BANK_VIRT) + return addr; + + /* Map the address to the memory bank. */ + addr -= M68HC12_BANK_VIRT; + addr &= M68HC12_BANK_MASK; + addr += M68HC12_BANK_BASE; + return addr; +} + +/* Return the page number corresponding to an address in banked memory. */ +static bfd_vma +m68hc12_phys_page (addr) + bfd_vma addr; +{ + if (addr < M68HC12_BANK_VIRT) + return 0; + + /* Map the address to the memory bank. */ + addr -= M68HC12_BANK_VIRT; + addr >>= M68HC12_BANK_SHIFT; + addr &= M68HC12_BANK_PAGE_MASK; + return addr; +} + +static bfd_reloc_status_type +m68hc12_elf_special_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + reloc_howto_type *howto; + bfd_vma relocation; + bfd_vma phys_addr; + bfd_vma phys_page; + bfd_vma insn_page; + bfd_vma insn_addr; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (! reloc_entry->howto->partial_inplace + || reloc_entry->addend == 0)) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (output_bfd != NULL) + return bfd_reloc_continue; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + /* Compute relocation. */ + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + relocation += bfd_get_16 (abfd, (bfd_byte*) data + reloc_entry->address); + + /* Do the memory bank mapping. */ + phys_addr = m68hc12_phys_addr (relocation); + phys_page = m68hc12_phys_page (relocation); + + howto = reloc_entry->howto; + if (howto->complain_on_overflow != complain_overflow_dont + && (phys_addr & (((bfd_vma) -1) << 16))) + return bfd_reloc_overflow; + + switch (howto->type) + { + case R_M68HC11_16: + /* Get virtual address of instruction having the relocation. */ + insn_addr = input_section->output_section->vma + + input_section->output_offset + + reloc_entry->address; + + insn_page = m68hc12_phys_page (insn_addr); + + if (m68hc12_addr_is_banked (relocation) + && m68hc12_addr_is_banked (insn_addr) + && phys_page != insn_page) + { + *error_message = _("address is not in the same bank"); + return bfd_reloc_dangerous; + } + if (m68hc12_addr_is_banked (relocation) + && !m68hc12_addr_is_banked (insn_addr)) + { + *error_message = _("reference to a banked address in " + "the normal address space"); + return bfd_reloc_dangerous; + } + + case R_M68HC11_LO16: + bfd_put_16 (abfd, phys_addr, (bfd_byte*) data + reloc_entry->address); + break; + + case R_M68HC11_24: + bfd_put_16 (abfd, phys_addr, (bfd_byte*) data + reloc_entry->address); + bfd_put_8 (abfd, phys_page, (bfd_byte*) data + reloc_entry->address + 2); + break; + + case R_M68HC11_PAGE: + bfd_put_8 (abfd, phys_page, (bfd_byte*) data + reloc_entry->address); + break; + + default: + abort (); + break; + } + + return bfd_reloc_ok; +} + /* Set the howto pointer for an M68HC11 ELF reloc. */ static void @@ -263,6 +588,177 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; } +static asection * +elf32_m68hc11_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); + + return NULL; +} + +static boolean +elf32_m68hc11_gc_sweep_hook (abfd, info, sec, relocs) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; +{ + /* We don't use got and plt entries for 68hc11/68hc12. */ + return true; +} + + +/* Set and control ELF flags in ELF header. */ + +boolean +_bfd_m68hc12_elf_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ + +boolean +_bfd_m68hc12_elf_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + flagword old_flags; + flagword new_flags; + boolean ok = true; + + /* Check if we have the same endianess */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + new_flags = elf_elfheader (ibfd)->e_flags; + elf_elfheader (obfd)->e_flags |= new_flags & EF_M68HC11_ABI; + old_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = new_flags; + elf_elfheader (obfd)->e_ident[EI_CLASS] + = elf_elfheader (ibfd)->e_ident[EI_CLASS]; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd))) + return false; + } + + return true; + } + + /* Check ABI compatibility. */ + if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 16-bit integers (-mshort) " + "and others for 32-bit integers"), + bfd_archive_filename (ibfd)); + ok = false; + } + if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64)) + { + (*_bfd_error_handler) + (_("%s: linking files compiled for 32-bit double (-fshort-double) " + "and others for 64-bit double"), + bfd_archive_filename (ibfd)); + ok = false; + } + new_flags &= ~EF_M68HC11_ABI; + old_flags &= ~EF_M68HC11_ABI; + + /* Warn about any other mismatches */ + if (new_flags != old_flags) + { + (*_bfd_error_handler) + (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), + bfd_archive_filename (ibfd), (unsigned long) new_flags, + (unsigned long) old_flags); + ok = false; + } + + if (! ok) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + return true; +} + +boolean +_bfd_m68hc12_elf_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + /* xgettext:c-format */ + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_I32) + fprintf (file, _("[abi=32-bit int,")); + else + fprintf (file, _("[abi=16-bit int,")); + + if (elf_elfheader (abfd)->e_flags & E_M68HC11_F64) + fprintf (file, _(" 64-bit double]")); + else + fprintf (file, _(" 32-bit double]")); + + fputc ('\n', file); + + return true; +} + /* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c. The Motorola spec says to use a different Elf machine code. */ #define ELF_ARCH bfd_arch_m68hc12 @@ -274,7 +770,17 @@ m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) #define elf_info_to_howto 0 #define elf_info_to_howto_rel m68hc11_info_to_howto_rel +#define elf_backend_gc_mark_hook elf32_m68hc11_gc_mark_hook +#define elf_backend_gc_sweep_hook elf32_m68hc11_gc_sweep_hook #define elf_backend_object_p 0 #define elf_backend_final_write_processing 0 +/* Disabled as this backend uses the generic linker. */ +#define elf_backend_can_gc_sections 0 + +#define bfd_elf32_bfd_merge_private_bfd_data \ + _bfd_m68hc12_elf_merge_private_bfd_data +#define bfd_elf32_bfd_set_private_flags _bfd_m68hc12_elf_set_private_flags +#define bfd_elf32_bfd_print_private_bfd_data \ + _bfd_m68hc12_elf_print_private_bfd_data #include "elf32-target.h" diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index b507fba..2c50ed08 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -37,7 +37,7 @@ static boolean elf_m68k_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_m68k_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf_m68k_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -180,8 +180,6 @@ reloc_type_lookup (abfd, code) #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup #define ELF_ARCH bfd_arch_m68k /* end code generated by elf.el */ - -#define USE_RELA /* Functions for the m68k ELF linker. */ @@ -754,8 +752,8 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_m68k_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf_m68k_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -785,9 +783,7 @@ elf_m68k_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -2113,12 +2109,8 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) char **errmsg; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; - Elf32_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Sym *isymbuf = NULL; + Elf_Internal_Rela *internal_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *p; bfd_size_type amt; @@ -2131,40 +2123,6 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) return true; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - /* Read this BFD's symbols if we haven't done so already, or get the cached - copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - amt = symtab_hdr->sh_info * sizeof (Elf32_External_Sym); - if (info->keep_memory) - extsyms = (Elf32_External_Sym *) bfd_alloc (abfd, amt); - else - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - if (! info->keep_memory) - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (extsyms, amt, abfd) != amt) - goto error_return; - if (info->keep_memory) - symtab_hdr->contents = (unsigned char *) extsyms; - } - - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_return; - } /* Get a copy of the native relocations. */ internal_relocs = (_bfd_elf32_link_read_relocs @@ -2172,8 +2130,6 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! info->keep_memory) - free_relocs = internal_relocs; amt = (bfd_size_type) datasec->reloc_count * 12; relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt); @@ -2204,16 +2160,23 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) /* Get the target section referred to by the reloc. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; - /* A local symbol. */ - esym = extsyms + ELF32_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); + Elf_Internal_Sym *isym; + + /* Read this BFD's local symbols if we haven't done so already. */ + if (isymbuf == NULL) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } - targetsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + isym = isymbuf + ELF32_R_SYM (irel->r_info); + targetsec = bfd_section_from_elf_index (abfd, isym->st_shndx); } else { @@ -2237,21 +2200,19 @@ bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) strncpy (p + 4, targetsec->output_section->name, 8); } - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); - if (free_relocs != NULL) - free (free_relocs); + if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (datasec)->relocs != internal_relocs) + free (internal_relocs); return true; error_return: - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); - if (free_relocs != NULL) - free (free_relocs); + if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (datasec)->relocs != internal_relocs) + free (internal_relocs); return false; } diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index 38e9c13..789f725 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -29,8 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/mcore.h" #include <assert.h> -#define USE_RELA /* Only USE_REL is actually significant, but this is - here are a reminder... */ +/* RELA relocs are used here... */ static void mcore_elf_howto_init PARAMS ((void)); @@ -48,7 +47,7 @@ static boolean mcore_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static asection * mcore_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean mcore_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -311,7 +310,7 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd) flagword new_flags; /* Check if we have the same endianess */ - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -573,8 +572,8 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation. */ static asection * -mcore_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd * abfd; +mcore_elf_gc_mark_hook (sec, info, rel, h, sym) + asection * sec; struct bfd_link_info * info ATTRIBUTE_UNUSED; Elf_Internal_Rela * rel; struct elf_link_hash_entry * h; @@ -604,9 +603,7 @@ mcore_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 5c201b3..f166732 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -80,12 +80,6 @@ static boolean elf32_mips_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); static boolean elf32_mips_grok_psinfo PARAMS ((bfd *, Elf_Internal_Note *)); -static boolean elf32_mips_discard_info - PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *)); -static boolean elf32_mips_ignore_discarded_relocs - PARAMS ((asection *)); -static boolean elf32_mips_write_section - PARAMS ((bfd *, asection *, bfd_byte *)); static irix_compat_t elf32_mips_irix_compat PARAMS ((bfd *)); @@ -1393,7 +1387,7 @@ struct elf_reloc_map { static const struct elf_reloc_map mips_reloc_map[] = { - { BFD_RELOC_NONE, R_MIPS_NONE, }, + { BFD_RELOC_NONE, R_MIPS_NONE }, { BFD_RELOC_16, R_MIPS_16 }, { BFD_RELOC_32, R_MIPS_32 }, /* There is no BFD reloc for R_MIPS_REL32. */ @@ -1576,6 +1570,9 @@ mips_elf32_object_p (abfd) if (SGI_COMPAT (abfd)) elf_bad_symtab (abfd) = true; + if (ABI_N32_P (abfd)) + return false; + mach = _bfd_elf_mips_mach (elf_elfheader (abfd)->e_flags); bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach); @@ -1662,112 +1659,6 @@ elf32_mips_grok_psinfo (abfd, note) return true; } -#define PDR_SIZE 32 - -static boolean -elf32_mips_discard_info (abfd, cookie, info) - bfd *abfd; - struct elf_reloc_cookie *cookie; - struct bfd_link_info *info; -{ - asection *o; - boolean ret = false; - unsigned char *tdata; - size_t i, skip; - - o = bfd_get_section_by_name (abfd, ".pdr"); - if (! o) - return false; - if (o->_raw_size == 0) - return false; - if (o->_raw_size % PDR_SIZE != 0) - return false; - if (o->output_section != NULL - && bfd_is_abs_section (o->output_section)) - return false; - - tdata = bfd_zmalloc (o->_raw_size / PDR_SIZE); - if (! tdata) - return false; - - cookie->rels = _bfd_elf32_link_read_relocs (abfd, o, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); - if (!cookie->rels) - { - free (tdata); - return false; - } - - cookie->rel = cookie->rels; - cookie->relend = cookie->rels + o->reloc_count; - - for (i = 0, skip = 0; i < o->_raw_size; i ++) - { - if (_bfd_elf32_reloc_symbol_deleted_p (i * PDR_SIZE, cookie)) - { - tdata[i] = 1; - skip ++; - } - } - - if (skip != 0) - { - elf_section_data (o)->tdata = tdata; - o->_cooked_size = o->_raw_size - skip * PDR_SIZE; - ret = true; - } - else - free (tdata); - - if (! info->keep_memory) - free (cookie->rels); - - return ret; -} - -static boolean -elf32_mips_ignore_discarded_relocs (sec) - asection *sec; -{ - if (strcmp (sec->name, ".pdr") == 0) - return true; - return false; -} - -static boolean -elf32_mips_write_section (output_bfd, sec, contents) - bfd *output_bfd; - asection *sec; - bfd_byte *contents; -{ - bfd_byte *to, *from, *end; - int i; - - if (strcmp (sec->name, ".pdr") != 0) - return false; - - if (elf_section_data (sec)->tdata == NULL) - return false; - - to = contents; - end = contents + sec->_raw_size; - for (from = contents, i = 0; - from < end; - from += PDR_SIZE, i++) - { - if (((unsigned char *)elf_section_data (sec)->tdata)[i] == 1) - continue; - if (to != from) - memcpy (to, from, PDR_SIZE); - to += PDR_SIZE; - } - bfd_set_section_contents (output_bfd, sec->output_section, contents, - (file_ptr) sec->output_offset, - sec->_cooked_size); - return true; -} - /* Depending on the target vector we generate some version of Irix executables or "normal" MIPS ELF ABI executables. */ static irix_compat_t @@ -1797,15 +1688,10 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) char **errmsg; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; - Elf32_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Sym *isymbuf = NULL; + Elf_Internal_Rela *internal_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *p; - bfd_size_type amt; BFD_ASSERT (! info->relocateable); @@ -1814,41 +1700,17 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) if (datasec->reloc_count == 0) return true; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Read this BFD's symbols if we haven't done so already, or get the cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - if (info->keep_memory) - extsyms = ((Elf32_External_Sym *) - bfd_alloc (abfd, symtab_hdr->sh_size)); - else - extsyms = ((Elf32_External_Sym *) - bfd_malloc (symtab_hdr->sh_size)); - if (extsyms == NULL) - goto error_return; - if (! info->keep_memory) - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_bread (extsyms, symtab_hdr->sh_size, abfd) - != symtab_hdr->sh_size)) - goto error_return; - if (info->keep_memory) - symtab_hdr->contents = (unsigned char *) extsyms; - } - - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + if (symtab_hdr->sh_info != 0) { - amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) goto error_return; } @@ -1858,8 +1720,6 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! info->keep_memory) - free_relocs = internal_relocs; relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12); if (relsec->contents == NULL) @@ -1890,16 +1750,11 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) /* Get the target section referred to by the reloc. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; + Elf_Internal_Sym *isym; /* A local symbol. */ - esym = extsyms + ELF32_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - targetsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + isym = isymbuf + ELF32_R_SYM (irel->r_info); + targetsec = bfd_section_from_elf_index (abfd, isym->st_shndx); } else { @@ -1936,21 +1791,21 @@ bfd_mips_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) strncpy (p + 4, targetsec->output_section->name, 8); } - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); - if (free_relocs != NULL) - free (free_relocs); + if (internal_relocs != NULL + && elf_section_data (datasec)->relocs != internal_relocs) + free (internal_relocs); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); return true; error_return: - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); - if (free_relocs != NULL) - free (free_relocs); + if (internal_relocs != NULL + && elf_section_data (datasec)->relocs != internal_relocs) + free (internal_relocs); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); return false; } @@ -2054,10 +1909,9 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_default_use_rela_p 0 #define elf_backend_sign_extend_vma true -#define elf_backend_discard_info elf32_mips_discard_info +#define elf_backend_discard_info _bfd_mips_elf_discard_info #define elf_backend_ignore_discarded_relocs \ - elf32_mips_ignore_discarded_relocs -#define elf_backend_write_section elf32_mips_write_section + _bfd_mips_elf_ignore_discarded_relocs #define elf_backend_mips_irix_compat elf32_mips_irix_compat #define elf_backend_mips_rtype_to_howto mips_elf32_rtype_to_howto #define bfd_elf32_bfd_is_local_label_name \ diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c index 34d4d9f..7092110 100644 --- a/bfd/elf32-openrisc.c +++ b/bfd/elf32-openrisc.c @@ -41,7 +41,7 @@ static boolean openrisc_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection * openrisc_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean openrisc_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -289,9 +289,6 @@ openrisc_final_link_relocate (howto, input_bfd, input_section, contents, rel, } /* Relocate an OpenRISC ELF section. - There is some attempt to make this function usable for many architectures, - both USE_REL and USE_RELA ['twould be nice if such a critter existed], - if only to serve as a learning tool. The RELOCATE_SECTION function is called by the new ELF backend linker to handle the relocations for a section. @@ -468,12 +465,12 @@ openrisc_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation. */ static asection * -openrisc_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd ATTRIBUTE_UNUSED; +openrisc_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel ATTRIBUTE_UNUSED; - struct elf_link_hash_entry *h ATTRIBUTE_UNUSED; - Elf_Internal_Sym *sym ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; { if (h != NULL) { @@ -499,9 +496,7 @@ openrisc_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } diff --git a/bfd/elf32-or32.c b/bfd/elf32-or32.c index eed0b99..a61b09d 100644 --- a/bfd/elf32-or32.c +++ b/bfd/elf32-or32.c @@ -277,19 +277,19 @@ or32_elf_32_reloc (abfd, reloc_entry, symbol, data, input_section, asection *input_section; bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; -{ +{ if (output_bfd != (bfd *) NULL) { unsigned long insn; bfd_size_type addr = reloc_entry->address; reloc_entry->address += input_section->output_offset; - + insn = bfd_get_32 (abfd, (bfd_byte *) data + addr); insn += symbol->section->output_section->vma; insn += symbol->section->output_offset; insn += symbol->value; - bfd_put_32 (abfd, insn, (bfd_byte *) data + addr); + bfd_put_32 (abfd, insn, (bfd_byte *) data + addr); return bfd_reloc_ok; } @@ -307,7 +307,7 @@ or32_elf_16_reloc (abfd, reloc_entry, symbol, data, input_section, asection *input_section; bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; -{ +{ if (output_bfd != (bfd *) NULL) { unsigned short insn; @@ -319,7 +319,7 @@ or32_elf_16_reloc (abfd, reloc_entry, symbol, data, input_section, insn += symbol->section->output_section->vma; insn += symbol->section->output_offset; insn += symbol->value; - bfd_put_16 (abfd, insn, (bfd_byte *) data + addr); + bfd_put_16 (abfd, insn, (bfd_byte *) data + addr); return bfd_reloc_ok; } @@ -337,7 +337,7 @@ or32_elf_8_reloc (abfd, reloc_entry, symbol, data, input_section, asection *input_section; bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; -{ +{ if (output_bfd != (bfd *) NULL) { unsigned char insn; @@ -349,7 +349,7 @@ or32_elf_8_reloc (abfd, reloc_entry, symbol, data, input_section, insn += symbol->section->output_section->vma; insn += symbol->section->output_offset; insn += symbol->value; - bfd_put_8 (abfd, insn, (bfd_byte *) data + addr); + bfd_put_8 (abfd, insn, (bfd_byte *) data + addr); return bfd_reloc_ok; } @@ -391,7 +391,7 @@ or32_elf_consth_reloc (abfd, reloc_entry, symbol, data, input_section, bfd_reloc_status_type ret; bfd_vma relocation; struct or32_consth *n; - + ret = bfd_reloc_ok; if (bfd_is_und_section (symbol->section) @@ -505,7 +505,7 @@ or32_elf_jumptarg_reloc (abfd, reloc_entry, symbol, data, input_section, asection *input_section; bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; -{ +{ if (output_bfd != (bfd *) NULL) { unsigned long insn, tmp; @@ -517,7 +517,7 @@ or32_elf_jumptarg_reloc (abfd, reloc_entry, symbol, data, input_section, tmp = insn | 0xfc000000; tmp -= (input_section->output_offset >> 2); insn = (insn & 0xfc000000) | (tmp & 0x03ffffff); - bfd_put_32 (abfd, insn, (bfd_byte *) data + addr); + bfd_put_32 (abfd, insn, (bfd_byte *) data + addr); return bfd_reloc_ok; } diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 31d9e0c..d5ed0c4 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "elf/ppc.h" -#define USE_RELA /* we want RELA relocations, not REL */ +/* RELA relocations are used here. */ static reloc_howto_type *ppc_elf_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); @@ -43,6 +43,7 @@ static boolean ppc_elf_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static bfd_reloc_status_type ppc_elf_addr16_ha_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static boolean ppc_elf_object_p PARAMS ((bfd *)); static boolean ppc_elf_set_private_flags PARAMS ((bfd *, flagword)); static boolean ppc_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); @@ -56,7 +57,7 @@ static boolean ppc_elf_create_dynamic_sections static boolean ppc_elf_section_from_shdr PARAMS ((bfd *, Elf32_Internal_Shdr *, - char *)); + const char *)); static boolean ppc_elf_fake_sections PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); @@ -70,7 +71,7 @@ static boolean ppc_elf_check_relocs PARAMS ((bfd *, asection *, const Elf_Internal_Rela *)); -static asection * ppc_elf_gc_mark_hook PARAMS ((bfd *abfd, +static asection * ppc_elf_gc_mark_hook PARAMS ((asection *sec, struct bfd_link_info *info, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h, @@ -1380,6 +1381,27 @@ ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } +/* Fix bad default arch selected for a 32 bit input bfd when the + default is 64 bit. */ + +static boolean +ppc_elf_object_p (abfd) + bfd *abfd; +{ + if (abfd->arch_info->the_default && abfd->arch_info->bits_per_word == 64) + { + Elf_Internal_Ehdr *i_ehdr = elf_elfheader (abfd); + + if (i_ehdr->e_ident[EI_CLASS] == ELFCLASS32) + { + /* Relies on arch after 64 bit default being 32 bit default. */ + abfd->arch_info = abfd->arch_info->next; + BFD_ASSERT (abfd->arch_info->bits_per_word == 32); + } + } + return true; +} + /* Function to set whether a module needs the -mrelocatable bit set. */ static boolean @@ -1407,7 +1429,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) boolean error; /* Check if we have the same endianess */ - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -1490,7 +1512,7 @@ static boolean ppc_elf_section_from_shdr (abfd, hdr, name) bfd *abfd; Elf32_Internal_Shdr *hdr; - char *name; + const char *name; { asection *newsect; flagword flags; @@ -2459,8 +2481,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -ppc_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +ppc_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -2490,9 +2512,7 @@ ppc_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -3797,6 +3817,7 @@ ppc_elf_grok_psinfo (abfd, note) #define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags #define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link +#define elf_backend_object_p ppc_elf_object_p #define elf_backend_gc_mark_hook ppc_elf_gc_mark_hook #define elf_backend_gc_sweep_hook ppc_elf_gc_sweep_hook #define elf_backend_section_from_shdr ppc_elf_section_from_shdr @@ -3815,4 +3836,7 @@ ppc_elf_grok_psinfo (abfd, note) #define elf_backend_grok_psinfo ppc_elf_grok_psinfo #define elf_backend_reloc_type_class ppc_elf_reloc_type_class +#ifndef ELF32_PPC_C_INCLUDED #include "elf32-target.h" +#endif + diff --git a/bfd/elf32-ppcqnx.c b/bfd/elf32-ppcqnx.c new file mode 100644 index 0000000..35fbe37 --- /dev/null +++ b/bfd/elf32-ppcqnx.c @@ -0,0 +1,32 @@ +/* PowerPC QNX specific support for 32-bit ELF + Copyright 2002 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define ELF32_PPC_C_INCLUDED +#include "elf32-ppc.c" + +#include "elf32-qnx.h" + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf32_powerpcleqnx_vec +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf32_powerpcqnx_vec + +#include "elf32-target.h" + diff --git a/bfd/elf32-qnx.h b/bfd/elf32-qnx.h new file mode 100644 index 0000000..d4eefb8 --- /dev/null +++ b/bfd/elf32-qnx.h @@ -0,0 +1,111 @@ +/* QNX specific support for 32-bit ELF + Copyright 2002 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + /* Returns the end address of the segment + 1. */ +#define SEGMENT_END(segment, start) \ + (start + (segment->p_memsz > segment->p_filesz \ + ? segment->p_memsz : segment->p_filesz)) + +static boolean elf_qnx_copy_private_bfd_data_p + PARAMS ((bfd *, asection *, bfd *, asection *)); +static boolean elf_qnx_is_contained_by_filepos + PARAMS ((asection *, Elf_Internal_Phdr *)); +static void elf_qnx_set_nonloadable_filepos + PARAMS ((bfd *, Elf_Internal_Phdr *)); + +static boolean +elf_qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec) + bfd *ibfd; + asection *isec; + bfd *obfd; + asection *osec; +{ + /* We don't use these parameters, but another target might. */ + ibfd = ibfd; + obfd = obfd; + osec = osec; + + return isec->next == NULL; +} + +static boolean +elf_qnx_is_contained_by_filepos (section, segment) + asection *section; + Elf_Internal_Phdr *segment; +{ + return ((bfd_vma) section->filepos >= segment->p_offset + && ((bfd_vma) section->filepos + section->_raw_size + <= SEGMENT_END (segment, segment->p_offset))); +} + +static void +elf_qnx_set_nonloadable_filepos (abfd, phdrs) + bfd *abfd; + Elf_Internal_Phdr *phdrs; +{ + struct elf_segment_map *m; + Elf_Internal_Phdr *p; + file_ptr off = 0; + + for (m = elf_tdata (abfd)->segment_map, p = phdrs; + m != NULL; + m = m->next, p++) + { + unsigned int i; + asection **secpp; + + for (i = 0, secpp = m->sections; i < m->count; i++, secpp++) + { + asection *sec; + + sec = *secpp; + + if (p->p_type == PT_LOAD) + off = sec->filepos; + else + { + if (i == 0) + { + if (sec->filepos) + p->p_offset = sec->filepos; + else + p->p_offset = off; + } + if (!sec->filepos) + { + off += sec->_raw_size; + p->p_filesz += sec->_raw_size; + } + } + } + } + return; +} + +#ifndef elf_backend_set_nonloadable_filepos +#define elf_backend_set_nonloadable_filepos elf_qnx_set_nonloadable_filepos +#endif + +#ifndef elf_backend_is_contained_by_filepos +#define elf_backend_is_contained_by_filepos elf_qnx_is_contained_by_filepos +#endif + +#ifndef elf_backend_copy_private_bfd_data_p +#define elf_backend_copy_private_bfd_data_p elf_qnx_copy_private_bfd_data_p +#endif diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 5032a5c..bbc2ead 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -40,12 +40,13 @@ static boolean create_got_section static boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_s390_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -71,8 +72,6 @@ static boolean elf_s390_finish_dynamic_sections static boolean elf_s390_object_p PARAMS ((bfd *)); static boolean elf_s390_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); -#define USE_RELA 1 /* We want RELA relocations, not REL. */ - #include "elf/s390.h" /* The relocation "howto" table. */ @@ -564,7 +563,8 @@ elf_s390_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_s390_copy_indirect_symbol (dir, ind) +elf_s390_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -606,7 +606,7 @@ elf_s390_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and @@ -903,8 +903,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_s390_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf_s390_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -934,9 +934,7 @@ elf_s390_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1064,7 +1062,7 @@ elf_s390_adjust_dynamic_symbol (info, h) /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later - (although we could actually do it here). */ + (although we could actually do it here). */ if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { @@ -1973,9 +1971,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, break; } + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index ef737b5..c8f179b 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -78,7 +78,7 @@ static bfd_reloc_status_type sh_elf_reloc_loop static boolean sh_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static asection * sh_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean sh_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -1546,7 +1546,6 @@ sh_elf_reloc_loop (r_type, input_bfd, input_section, contents, addr, { static bfd_vma last_addr; static asection *last_symbol_section; - bfd_byte *free_contents = NULL; bfd_byte *start_ptr, *ptr, *last_ptr; int diff, cum_diff; bfd_signed_vma x; @@ -1581,7 +1580,6 @@ sh_elf_reloc_loop (r_type, input_bfd, input_section, contents, addr, contents = (bfd_byte *) bfd_malloc (symbol_section->_raw_size); if (contents == NULL) return bfd_reloc_outofrange; - free_contents = contents; if (! bfd_get_section_contents (input_bfd, symbol_section, contents, (file_ptr) 0, symbol_section->_raw_size)) @@ -1621,8 +1619,9 @@ sh_elf_reloc_loop (r_type, input_bfd, input_section, contents, addr, end = start0; } - if (free_contents) - free (free_contents); + if (contents != NULL + && elf_section_data (symbol_section)->this_hdr.contents != contents) + free (contents); insn = bfd_get_16 (input_bfd, contents + addr); @@ -1888,16 +1887,11 @@ sh_elf_relax_section (abfd, sec, link_info, again) boolean *again; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; boolean have_code; Elf_Internal_Rela *irel, *irelend; bfd_byte *contents = NULL; - bfd_byte *free_contents = NULL; - Elf32_External_Sym *extsyms = NULL; - Elf32_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_Internal_Sym *isymbuf = NULL; *again = false; @@ -1920,15 +1914,12 @@ sh_elf_relax_section (abfd, sec, link_info, again) sec->_cooked_size = sec->_raw_size; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; internal_relocs = (_bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; have_code = false; @@ -1956,7 +1947,6 @@ sh_elf_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (! bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) @@ -2021,55 +2011,25 @@ sh_elf_relax_section (abfd, sec, link_info, again) } /* Read this BFD's symbols if we haven't done so already. */ - if (extsyms == NULL) + if (isymbuf == NULL && symtab_hdr->sh_info != 0) { - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, abfd) != amt) - goto error_return; - symtab_hdr->contents = (bfd_byte *) extsyms; - } - - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_return; - shndx_hdr->contents = (bfd_byte *) shndx_buf; - } + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; } /* Get the value of the symbol referred to by the reloc. */ if (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info) { /* A local symbol. */ - Elf32_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; - - esym = extsyms + ELF32_R_SYM (irelfn->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irelfn->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); + Elf_Internal_Sym *isym; - if (isym.st_shndx + isym = isymbuf + ELF32_R_SYM (irelfn->r_info); + if (isym->st_shndx != (unsigned int) _bfd_elf_section_from_bfd_section (abfd, sec)) { ((*_bfd_error_handler) @@ -2078,7 +2038,7 @@ sh_elf_relax_section (abfd, sec, link_info, again) continue; } - symval = (isym.st_value + symval = (isym->st_value + sec->output_section->vma + sec->output_offset); } @@ -2129,12 +2089,8 @@ sh_elf_relax_section (abfd, sec, link_info, again) the linker is run. */ elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; /* Replace the jsr with a bsr. */ @@ -2239,7 +2195,6 @@ sh_elf_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (! bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) @@ -2254,61 +2209,51 @@ sh_elf_relax_section (abfd, sec, link_info, again) if (swapped) { elf_section_data (sec)->relocs = internal_relocs; - free_relocs = NULL; - elf_section_data (sec)->this_hdr.contents = contents; - free_contents = NULL; - - free_extsyms = NULL; + symtab_hdr->contents = (unsigned char *) isymbuf; } } - if (free_relocs != NULL) - free (free_relocs); - - if (free_contents != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { if (! link_info->keep_memory) - free (free_contents); + free (isymbuf); else { - /* Cache the section contents for elf_link_input_bfd. */ - elf_section_data (sec)->this_hdr.contents = contents; + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } } - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - - if (free_extsyms != NULL) + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) { if (! link_info->keep_memory) + free (contents); + else { - symtab_hdr->contents = NULL; - free (free_extsyms); + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; } } + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - if (free_extsyms != NULL) - { - symtab_hdr->contents = NULL; - free (free_extsyms); - } + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return false; } @@ -2325,25 +2270,19 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) int count; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; unsigned int sec_shndx; bfd_byte *contents; Elf_Internal_Rela *irel, *irelend; Elf_Internal_Rela *irelalign; bfd_vma toaddr; - Elf32_External_Sym *esym, *esymend; - Elf_External_Sym_Shndx *shndx_buf, *shndx; + Elf_Internal_Sym *isymbuf, *isym, *isymend; struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry **end_hashes; unsigned int symcount; asection *o; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - shndx_buf = (Elf_External_Sym_Shndx *) shndx_hdr->contents; + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); @@ -2391,7 +2330,6 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) bfd_vma nraddr, stop; bfd_vma start = 0; int insn = 0; - Elf_Internal_Sym sym; int off, adjust, oinsn; bfd_signed_vma voff = 0; boolean overflow; @@ -2445,18 +2383,15 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) range to be adjusted, and hence must be changed. */ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - esym = extsyms + ELF32_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &sym); - - if (sym.st_shndx == sec_shndx - && (sym.st_value <= addr - || sym.st_value >= toaddr)) + isym = isymbuf + ELF32_R_SYM (irel->r_info); + if (isym->st_shndx == sec_shndx + && (isym->st_value <= addr + || isym->st_value >= toaddr)) { bfd_vma val; val = bfd_get_32 (abfd, contents + nraddr); - val += sym.st_value; + val += isym->st_value; if (val > addr && val < toaddr) bfd_put_32 (abfd, val - count, contents + nraddr); } @@ -2649,8 +2584,6 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) irelscanend = internal_relocs + o->reloc_count; for (irelscan = internal_relocs; irelscan < irelscanend; irelscan++) { - Elf_Internal_Sym sym; - /* Dwarf line numbers use R_SH_SWITCH32 relocs. */ if (ELF32_R_TYPE (irelscan->r_info) == (int) R_SH_SWITCH32) { @@ -2708,13 +2641,10 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) continue; - esym = extsyms + ELF32_R_SYM (irelscan->r_info); - shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irelscan->r_info) : 0); - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &sym); - - if (sym.st_shndx == sec_shndx - && (sym.st_value <= addr - || sym.st_value >= toaddr)) + isym = isymbuf + ELF32_R_SYM (irelscan->r_info); + if (isym->st_shndx == sec_shndx + && (isym->st_value <= addr + || isym->st_value >= toaddr)) { bfd_vma val; @@ -2740,7 +2670,7 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) } val = bfd_get_32 (abfd, ocontents + irelscan->r_offset); - val += sym.st_value; + val += isym->st_value; if (val > addr && val < toaddr) bfd_put_32 (abfd, val - count, ocontents + irelscan->r_offset); @@ -2749,23 +2679,13 @@ sh_elf_relax_delete_bytes (abfd, sec, addr, count) } /* Adjust the local symbols defined in this section. */ - shndx = shndx_buf; - esym = extsyms; - esymend = esym + symtab_hdr->sh_info; - for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf; isym < isymend; isym++) { - Elf_Internal_Sym isym; - Elf_External_Sym_Shndx dummy; - - bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym); - - if (isym.st_shndx == sec_shndx - && isym.st_value > addr - && isym.st_value < toaddr) - { - isym.st_value -= count; - bfd_elf32_swap_symbol_out (abfd, &isym, (PTR) esym, (PTR) &dummy); - } + if (isym->st_shndx == sec_shndx + && isym->st_value > addr + && isym->st_value < toaddr) + isym->st_value -= count; } /* Now adjust the global symbols defined in this section. */ @@ -3027,7 +2947,7 @@ static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = 0xcc, 0x00, 0x01, 0x10, /* movi .got.plt >> 16, r17 */ 0xc8, 0x00, 0x01, 0x10, /* shori .got.plt & 65535, r17 */ 0x89, 0x10, 0x09, 0x90, /* ld.l r17, 8, r25 */ - 0x6b, 0xf1, 0x46, 0x00, /* ptabs r17, tr0 */ + 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ 0x89, 0x10, 0x05, 0x10, /* ld.l r17, 4, r17 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ 0x6f, 0xf0, 0xff, 0xf0, /* nop */ @@ -3047,7 +2967,7 @@ static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = 0x10, 0x01, 0x00, 0xcc, /* movi .got.plt >> 16, r17 */ 0x10, 0x01, 0x00, 0xc8, /* shori .got.plt & 65535, r17 */ 0x90, 0x09, 0x10, 0x89, /* ld.l r17, 8, r25 */ - 0x00, 0x46, 0xf1, 0x6b, /* ptabs r17, tr0 */ + 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ 0x10, 0x05, 0x10, 0x89, /* ld.l r17, 4, r17 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ 0xf0, 0xff, 0xf0, 0x6f, /* nop */ @@ -3975,7 +3895,7 @@ sh_elf_size_dynamic_sections (output_bfd, info) } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -4840,15 +4760,11 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; asection *input_section = link_order->u.indirect.section; bfd *input_bfd = input_section->owner; asection **sections = NULL; Elf_Internal_Rela *internal_relocs = NULL; - Elf32_External_Sym *external_syms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym *internal_syms = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ @@ -4860,7 +4776,6 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; memcpy (data, elf_section_data (input_section)->this_hdr.contents, (size_t) input_section->_raw_size); @@ -4868,48 +4783,26 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, if ((input_section->flags & SEC_RELOC) != 0 && input_section->reloc_count > 0) { - Elf_Internal_Sym *isymp; asection **secpp; - Elf32_External_Sym *esym, *esymend; + Elf_Internal_Sym *isym, *isymend; bfd_size_type amt; - if (symtab_hdr->contents != NULL) - external_syms = (Elf32_External_Sym *) symtab_hdr->contents; - else if (symtab_hdr->sh_info != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - external_syms = (Elf32_External_Sym *) bfd_malloc (amt); - if (external_syms == NULL) - goto error_return; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) external_syms, amt, input_bfd) != amt) - goto error_return; - } - - if (symtab_hdr->sh_info != 0 && shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt) - goto error_return; - } - internal_relocs = (_bfd_elf32_link_read_relocs (input_bfd, input_section, (PTR) NULL, (Elf_Internal_Rela *) NULL, false)); if (internal_relocs == NULL) goto error_return; - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_Internal_Sym); - internal_syms = (Elf_Internal_Sym *) bfd_malloc (amt); - if (internal_syms == NULL && amt != 0) - goto error_return; + if (symtab_hdr->sh_info != 0) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + } amt = symtab_hdr->sh_info; amt *= sizeof (asection *); @@ -4917,64 +4810,54 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, if (sections == NULL && amt != 0) goto error_return; - for (isymp = internal_syms, secpp = sections, shndx = shndx_buf, - esym = external_syms, esymend = esym + symtab_hdr->sh_info; - esym < esymend; - ++esym, ++isymp, ++secpp, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp) { asection *isec; - bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp); - - if (isymp->st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) isec = bfd_und_section_ptr; - else if (isymp->st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) isec = bfd_abs_section_ptr; - else if (isymp->st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) isec = bfd_com_section_ptr; else - isec = bfd_section_from_elf_index (input_bfd, isymp->st_shndx); + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); *secpp = isec; } if (! sh_elf_relocate_section (output_bfd, link_info, input_bfd, input_section, data, internal_relocs, - internal_syms, sections)) + isymbuf, sections)) goto error_return; if (sections != NULL) free (sections); - if (internal_syms != NULL) - free (internal_syms); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_relocs != elf_section_data (input_section)->relocs) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); } return data; error_return: - if (internal_relocs != NULL - && internal_relocs != elf_section_data (input_section)->relocs) - free (internal_relocs); - if (shndx_buf != NULL) - free (shndx_buf); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_syms != NULL) - free (internal_syms); if (sections != NULL) free (sections); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (input_section)->relocs != internal_relocs) + free (internal_relocs); return NULL; } static asection * -sh_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +sh_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -4989,6 +4872,11 @@ sh_elf_gc_mark_hook (abfd, info, rel, h, sym) break; default: +#ifdef INCLUDE_SHMEDIA + while (h->root.type == bfd_link_hash_indirect + && h->root.u.i.link) + h = (struct elf_link_hash_entry *) h->root.u.i.link; +#endif switch (h->root.type) { case bfd_link_hash_defined: @@ -5004,9 +4892,7 @@ sh_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -5520,7 +5406,7 @@ sh_elf_merge_private_data (ibfd, obfd) { flagword old_flags, new_flags; - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -5598,7 +5484,8 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) got_offset = (plt_index + 3) * 4; #ifdef GOT_BIAS - got_offset -= GOT_BIAS; + if (info->shared) + got_offset -= GOT_BIAS; #endif /* Fill in the entry in the procedure linkage table. */ @@ -5619,8 +5506,10 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) (splt->contents + h->plt.offset + elf_sh_plt_symbol_offset (info))); + /* Set bottom bit because its for a branch to SHmedia */ movi_shori_putval (output_bfd, - (splt->output_section->vma + splt->output_offset), + (splt->output_section->vma + splt->output_offset) + | 1, (splt->contents + h->plt.offset + elf_sh_plt_plt0_offset (info))); #else @@ -5659,7 +5548,8 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } #ifdef GOT_BIAS - got_offset += GOT_BIAS; + if (info->shared) + got_offset += GOT_BIAS; #endif #ifdef INCLUDE_SHMEDIA @@ -5811,6 +5701,7 @@ sh_elf_finish_dynamic_sections (output_bfd, info) Elf_Internal_Dyn dyn; const char *name; asection *s; + struct elf_link_hash_entry *h; bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); @@ -5819,6 +5710,27 @@ sh_elf_finish_dynamic_sections (output_bfd, info) default: break; +#ifdef INCLUDE_SHMEDIA + case DT_INIT: + name = info->init_function; + goto get_sym; + + case DT_FINI: + name = info->fini_function; + get_sym: + if (dyn.d_un.d_val != 0) + { + h = elf_link_hash_lookup (elf_hash_table (info), name, + false, false, true); + if (h != NULL && (h->other & STO_SH5_ISA32)) + { + dyn.d_un.d_val |= 1; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; +#endif + case DT_PLTGOT: name = ".got"; goto get_vma; @@ -5996,4 +5908,8 @@ sh_elf_reloc_type_class (rela) #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 12 #define elf_backend_plt_header_size PLT_ENTRY_SIZE + +#ifndef ELF32_SH_C_INCLUDED #include "elf32-target.h" +#endif + diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 5e7ccdd..7a38fb22 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -54,7 +54,7 @@ static boolean sh64_elf_link_output_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *)); static boolean sh64_backend_section_from_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, char *)); + PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); static void sh64_elf_final_write_processing PARAMS ((bfd *, boolean)); static boolean sh64_bfd_elf_copy_private_section_data PARAMS ((bfd *, asection *, bfd *, asection *)); @@ -105,15 +105,6 @@ static void sh64_find_section_for_address PARAMS ((bfd *, asection *, PTR)); #define INCLUDE_SHMEDIA #include "elf32-sh.c" -/* The type sh64_elf_crange is defined in elf/sh.h which is included in - elf32-sh.c, hence these prototypes located after including it. */ -static int crange_qsort_cmpb PARAMS ((const void *, const void *)); -static int crange_qsort_cmpl PARAMS ((const void *, const void *)); -static int crange_bsearch_cmpb PARAMS ((const void *, const void *)); -static int crange_bsearch_cmpl PARAMS ((const void *, const void *)); -static boolean sh64_address_in_cranges - PARAMS ((asection *cranges, bfd_vma, sh64_elf_crange *)); - /* Set the SHF_SH5_ISA32 flag for ISA SHmedia code sections, and pass through SHT_SH5_CR_SORTED on a sorted .cranges section. */ @@ -196,7 +187,7 @@ sh64_elf_merge_private_data (ibfd, obfd) { flagword old_flags, new_flags; - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -255,7 +246,7 @@ boolean sh64_backend_section_from_shdr (abfd, hdr, name) bfd *abfd; Elf_Internal_Shdr *hdr; - char *name; + const char *name; { flagword flags = 0; @@ -731,7 +722,8 @@ sh64_elf_final_write_processing (abfd, linker) qsort (cranges->contents, cranges_size / SH64_CRANGE_SIZE, SH64_CRANGE_SIZE, bfd_big_endian (cranges->owner) - ? crange_qsort_cmpb : crange_qsort_cmpl); + ? _bfd_sh64_crange_qsort_cmpb + : _bfd_sh64_crange_qsort_cmpl); elf_section_data (cranges)->this_hdr.sh_type = SHT_SH5_CR_SORTED; } @@ -750,236 +742,3 @@ sh64_elf_final_write_processing (abfd, linker) } } } - -/* Ordering functions of a crange, for the qsort and bsearch calls and for - different endianness. */ - -static int -crange_qsort_cmpb (p1, p2) - const PTR p1; - const PTR p2; -{ - bfd_vma a1 = bfd_getb32 (p1); - bfd_vma a2 = bfd_getb32 (p2); - - /* Preserve order if there's ambiguous contents. */ - if (a1 == a2) - return (char *) p1 - (char *) p2; - - return a1 - a2; -} - -static int -crange_qsort_cmpl (p1, p2) - const PTR p1; - const PTR p2; -{ - bfd_vma a1 = (bfd_vma) bfd_getl32 (p1); - bfd_vma a2 = (bfd_vma) bfd_getl32 (p2); - - /* Preserve order if there's ambiguous contents. */ - if (a1 == a2) - return (char *) p1 - (char *) p2; - - return a1 - a2; -} - -static int -crange_bsearch_cmpb (p1, p2) - const PTR p1; - const PTR p2; -{ - bfd_vma a1 = *(bfd_vma *) p1; - bfd_vma a2 = (bfd_vma) bfd_getb32 (p2); - bfd_size_type size - = (bfd_size_type) bfd_getb32 (SH64_CRANGE_CR_SIZE_OFFSET + (char *) p2); - - if (a1 >= a2 + size) - return 1; - if (a1 < a2) - return -1; - return 0; -} - -static int -crange_bsearch_cmpl (p1, p2) - const PTR p1; - const PTR p2; -{ - bfd_vma a1 = *(bfd_vma *) p1; - bfd_vma a2 = (bfd_vma) bfd_getl32 (p2); - bfd_size_type size - = (bfd_size_type) bfd_getl32 (SH64_CRANGE_CR_SIZE_OFFSET + (char *) p2); - - if (a1 >= a2 + size) - return 1; - if (a1 < a2) - return -1; - return 0; -} - -/* Check whether a specific address is specified within a .cranges - section. Return FALSE if not found, and TRUE if found, and the region - filled into RANGEP if non-NULL. */ - -static boolean -sh64_address_in_cranges (cranges, addr, rangep) - asection *cranges; - bfd_vma addr; - sh64_elf_crange *rangep; -{ - bfd_byte *cranges_contents; - bfd_byte *found_rangep; - bfd_size_type cranges_size = bfd_section_size (cranges->owner, cranges); - - /* If the size is not a multiple of the cranges entry size, then - something is badly wrong. */ - if ((cranges_size % SH64_CRANGE_SIZE) != 0) - return false; - - /* If this section has relocations, then we can't do anything sane. */ - if (bfd_get_section_flags (cranges->owner, cranges) & SEC_RELOC) - return false; - - /* Has some kind soul (or previous call) left processed, sorted contents - for us? */ - if ((bfd_get_section_flags (cranges->owner, cranges) & SEC_IN_MEMORY) - && elf_section_data (cranges)->this_hdr.sh_type == SHT_SH5_CR_SORTED) - cranges_contents = cranges->contents; - else - { - cranges_contents - = bfd_malloc (cranges->_cooked_size == 0 - ? cranges->_cooked_size : cranges->_raw_size); - if (cranges_contents == NULL) - return false; - - if (! bfd_get_section_contents (cranges->owner, cranges, - cranges_contents, (file_ptr) 0, - cranges_size)) - goto error_return; - - /* Is it sorted? */ - if (elf_section_data (cranges)->this_hdr.sh_type - != SHT_SH5_CR_SORTED) - /* Nope. Lets sort it. */ - qsort (cranges_contents, cranges_size / SH64_CRANGE_SIZE, - SH64_CRANGE_SIZE, - bfd_big_endian (cranges->owner) - ? crange_qsort_cmpb : crange_qsort_cmpl); - - /* Let's keep it around. */ - cranges->contents = cranges_contents; - bfd_set_section_flags (cranges->owner, cranges, - bfd_get_section_flags (cranges->owner, cranges) - | SEC_IN_MEMORY); - - /* It's sorted now. */ - elf_section_data (cranges)->this_hdr.sh_type = SHT_SH5_CR_SORTED; - } - - /* Try and find a matching range. */ - found_rangep - = bsearch (&addr, cranges_contents, cranges_size / SH64_CRANGE_SIZE, - SH64_CRANGE_SIZE, - bfd_big_endian (cranges->owner) - ? crange_bsearch_cmpb : crange_bsearch_cmpl); - - /* Fill in a few return values if we found a matching range. */ - if (found_rangep) - { - enum sh64_elf_cr_type cr_type - = bfd_get_16 (cranges->owner, - SH64_CRANGE_CR_TYPE_OFFSET + found_rangep); - bfd_vma cr_addr - = bfd_get_32 (cranges->owner, - SH64_CRANGE_CR_ADDR_OFFSET - + (char *) found_rangep); - bfd_size_type cr_size - = bfd_get_32 (cranges->owner, - SH64_CRANGE_CR_SIZE_OFFSET - + (char *) found_rangep); - - rangep->cr_addr = cr_addr; - rangep->cr_size = cr_size; - rangep->cr_type = cr_type; - - return true; - } - - /* There is a .cranges section, but it does not have a descriptor - matching this address. */ - return false; - -error_return: - free (cranges_contents); - return false; -} - -/* Determine what ADDR points to in SEC, and fill in a range descriptor in - *RANGEP if it's non-NULL. */ - -enum sh64_elf_cr_type -sh64_get_contents_type (sec, addr, rangep) - asection *sec; - bfd_vma addr; - sh64_elf_crange *rangep; -{ - asection *cranges; - - /* Fill in the range with the boundaries of the section as a default. */ - if (bfd_get_flavour (sec->owner) == bfd_target_elf_flavour - && elf_elfheader (sec->owner)->e_type == ET_EXEC) - { - rangep->cr_addr = bfd_get_section_vma (sec->owner, sec); - rangep->cr_size = bfd_section_size (sec->owner, sec); - rangep->cr_type = CRT_NONE; - } - else - return false; - - /* If none of the pertinent bits are set, then it's a SHcompact (or at - least not SHmedia). */ - if ((elf_section_data (sec)->this_hdr.sh_flags - & (SHF_SH5_ISA32 | SHF_SH5_ISA32_MIXED)) == 0) - { - enum sh64_elf_cr_type cr_type - = ((bfd_get_section_flags (sec->owner, sec) & SEC_CODE) != 0 - ? CRT_SH5_ISA16 : CRT_DATA); - rangep->cr_type = cr_type; - return cr_type; - } - - /* If only the SHF_SH5_ISA32 bit is set, then we have SHmedia. */ - if ((elf_section_data (sec)->this_hdr.sh_flags - & (SHF_SH5_ISA32 | SHF_SH5_ISA32_MIXED)) == SHF_SH5_ISA32) - { - rangep->cr_type = CRT_SH5_ISA32; - return CRT_SH5_ISA32; - } - - /* Otherwise, we have to look up the .cranges section. */ - cranges = bfd_get_section_by_name (sec->owner, SH64_CRANGES_SECTION_NAME); - - if (cranges == NULL) - /* A mixed section but there's no .cranges section. This is probably - bad input; it does not comply to specs. */ - return CRT_NONE; - - /* If this call fails, we will still have CRT_NONE in rangep->cr_type - and that will be suitable to return. */ - sh64_address_in_cranges (cranges, addr, rangep); - - return rangep->cr_type; -} - -/* This is a simpler exported interface for the benefit of gdb et al. */ - -boolean -sh64_address_is_shmedia (sec, addr) - asection *sec; - bfd_vma addr; -{ - sh64_elf_crange dummy; - return sh64_get_contents_type (sec, addr, &dummy) == CRT_SH5_ISA32; -} diff --git a/bfd/elf32-shqnx.c b/bfd/elf32-shqnx.c new file mode 100644 index 0000000..a27c0f2 --- /dev/null +++ b/bfd/elf32-shqnx.c @@ -0,0 +1,31 @@ +/* Hitachi SH QNX specific support for 32-bit ELF + Copyright 2002 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define ELF32_SH_C_INCLUDED +#include "elf32-sh.c" + +#include "elf32-qnx.h" + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf32_shlqnx_vec +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf32_shqnx_vec + +#include "elf32-target.h" + diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index a11db81..4c9b3d4 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -55,7 +55,7 @@ static void elf32_sparc_final_write_processing static enum elf_reloc_type_class elf32_sparc_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static asection * elf32_sparc_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf32_sparc_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -637,14 +637,13 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) } static asection * -elf32_sparc_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf32_sparc_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; { - if (h != NULL) { switch (ELF32_R_TYPE (rel->r_info)) @@ -669,9 +668,7 @@ elf32_sparc_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1120,6 +1117,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; + if (info->relocateable) + return true; + dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1162,28 +1162,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } howto = _bfd_sparc_elf_howto_table + r_type; - r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - /* This is a final link. */ + r_symndx = ELF32_R_SYM (rel->r_info); h = NULL; sym = NULL; sec = NULL; @@ -1564,10 +1544,11 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; } - /* ??? Copied from elf32-i386.c, debugging section check and all. */ + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), @@ -2149,5 +2130,6 @@ elf32_sparc_reloc_type_class (rela) #define elf_backend_want_plt_sym 1 #define elf_backend_got_header_size 4 #define elf_backend_plt_header_size (4*PLT_ENTRY_SIZE) +#define elf_backend_rela_normal 1 #include "elf32-target.h" diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index ae0a0c4..07890c6 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -1,5 +1,5 @@ /* V850-specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -79,12 +79,12 @@ static boolean v850_elf_link_output_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *)); static boolean v850_elf_section_from_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, char *)); + PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); static boolean v850_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection * v850_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); @@ -1322,7 +1322,7 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) nop foo: nop */ - if (reloc->howto->pc_relative == true) + if (reloc->howto->pc_relative) { /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ @@ -1529,6 +1529,9 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; + if (info->relocateable) + return true; + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1566,28 +1569,8 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_V850_GNU_VTINHERIT) continue; - howto = v850_elf_howto_table + r_type; - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - /* This is a final link. */ + howto = v850_elf_howto_table + r_type; h = NULL; sym = NULL; sec = NULL; @@ -1740,8 +1723,8 @@ v850_elf_gc_sweep_hook (abfd, info, sec, relocs) } static asection * -v850_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +v850_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -1771,9 +1754,7 @@ v850_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -2135,7 +2116,7 @@ static boolean v850_elf_section_from_shdr (abfd, hdr, name) bfd * abfd; Elf_Internal_Shdr * hdr; - char * name; + const char * name; { /* There ought to be a place to keep ELF backend specific flags, but at the moment there isn't one. We just keep track of the @@ -2210,6 +2191,7 @@ v850_elf_fake_sections (abfd, hdr, sec) #define elf_backend_gc_sweep_hook v850_elf_gc_sweep_hook #define elf_backend_can_gc_sections 1 +#define elf_backend_rela_normal 1 #define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name #define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 8901188..068578b 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -38,7 +38,7 @@ static boolean elf_vax_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_vax_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf_vax_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -341,8 +341,6 @@ reloc_type_lookup (abfd, code) #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup #define ELF_ARCH bfd_arch_vax /* end code generated by elf.el */ - -#define USE_RELA /* Functions for the VAX ELF linker. */ @@ -542,13 +540,13 @@ elf32_vax_print_private_bfd_data (abfd, ptr) /* xgettext:c-format */ fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); - if (elf_elfheader (abfd)->e_flags & EF_NONPIC) + if (elf_elfheader (abfd)->e_flags & EF_VAX_NONPIC) fprintf (file, _(" [nonpic]")); - if (elf_elfheader (abfd)->e_flags & EF_DFLOAT) + if (elf_elfheader (abfd)->e_flags & EF_VAX_DFLOAT) fprintf (file, _(" [d-float]")); - if (elf_elfheader (abfd)->e_flags & EF_GFLOAT) + if (elf_elfheader (abfd)->e_flags & EF_VAX_GFLOAT) fprintf (file, _(" [g-float]")); fputc ('\n', file); @@ -855,8 +853,8 @@ elf_vax_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_vax_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf_vax_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -886,9 +884,7 @@ elf_vax_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1421,6 +1417,9 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; + if (info->relocateable) + return true; + dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1452,28 +1451,8 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, } howto = howto_table + r_type; - r_symndx = ELF32_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - /* This is a final link. */ + r_symndx = ELF32_R_SYM (rel->r_info); h = NULL; sym = NULL; sec = NULL; @@ -2210,5 +2189,6 @@ elf_vax_finish_dynamic_sections (output_bfd, info) #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 16 +#define elf_backend_rela_normal 1 #include "elf32-target.h" diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index d6b8dd3..b845bc4 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Forward declarations. */ static reloc_howto_type * xstormy16_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -static void xstormy16_info_to_howto_rela +static void xstormy16_info_to_howto_rela PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); -static bfd_reloc_status_type xstormy16_elf_24_reloc +static bfd_reloc_status_type xstormy16_elf_24_reloc PARAMS ((bfd *abfd, arelent *reloc_entry, asymbol *symbol, PTR data, asection *input_section, bfd *output_bfd, char **error_message)); @@ -45,7 +45,7 @@ static boolean xstormy16_elf_relax_section boolean *again)); static boolean xstormy16_elf_always_size_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean xstormy16_elf_relocate_section +static boolean xstormy16_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static boolean xstormy16_elf_finish_dynamic_sections @@ -54,7 +54,7 @@ static boolean xstormy16_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection * xstormy16_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static reloc_howto_type xstormy16_elf_howto_table [] = @@ -88,7 +88,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* A 16 bit absolute relocation. */ HOWTO (R_XSTORMY16_16, /* type */ 0, /* rightshift */ @@ -103,7 +103,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* An 8 bit absolute relocation. */ HOWTO (R_XSTORMY16_8, /* type */ 0, /* rightshift */ @@ -118,7 +118,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* A 32 bit pc-relative relocation. */ HOWTO (R_XSTORMY16_PC32, /* type */ 0, /* rightshift */ @@ -133,7 +133,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ - + /* A 16 bit pc-relative relocation. */ HOWTO (R_XSTORMY16_PC16, /* type */ 0, /* rightshift */ @@ -148,7 +148,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ - + /* An 8 bit pc-relative relocation. */ HOWTO (R_XSTORMY16_PC8, /* type */ 0, /* rightshift */ @@ -163,7 +163,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ - + /* A 12-bit pc-relative relocation suitable for the branch instructions. */ HOWTO (R_XSTORMY16_REL_12, /* type */ 1, /* rightshift */ @@ -178,7 +178,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0x0fff, /* dst_mask */ true), /* pcrel_offset */ - + /* A 24-bit absolute relocation suitable for the jump instructions. */ HOWTO (R_XSTORMY16_24, /* type */ 0, /* rightshift */ @@ -193,7 +193,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0, /* src_mask */ 0xffff00ff, /* dst_mask */ true), /* pcrel_offset */ - + /* A 16 bit absolute relocation to a function pointer. */ HOWTO (R_XSTORMY16_FPTR16, /* type */ 0, /* rightshift */ @@ -209,7 +209,7 @@ static reloc_howto_type xstormy16_elf_howto_table [] = 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ }; - + static reloc_howto_type xstormy16_elf_howto_table2 [] = { /* GNU extension to record C++ vtable hierarchy */ @@ -241,7 +241,7 @@ static reloc_howto_type xstormy16_elf_howto_table2 [] = 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ - + }; /* Map BFD reloc types to XSTORMY16 ELF reloc types. */ @@ -286,7 +286,7 @@ xstormy16_reloc_type_lookup (abfd, code) return entry->table + (entry->xstormy16_reloc_val - entry->table[0].type); } - + return NULL; } @@ -451,7 +451,7 @@ xstormy16_elf_check_relocs (abfd, info, sec, relocs) if (local_plt_offsets == NULL) return false; elf_local_got_offsets (abfd) = local_plt_offsets; - + for (i = 0; i < symtab_hdr->sh_info; i++) local_plt_offsets[i] = (bfd_vma) -1; } @@ -471,7 +471,7 @@ xstormy16_elf_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return false; break; - + /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_XSTORMY16_GNU_VTENTRY: @@ -578,7 +578,7 @@ xstormy16_elf_relax_section (dynobj, splt, info, again) if (splt->_cooked_size == 0) splt->_cooked_size = splt->_raw_size; - /* Map across all global symbols; see which ones happen to + /* Map across all global symbols; see which ones happen to fall in the low 64k. */ relax_plt_data.splt = splt; relax_plt_data.again = again; @@ -586,87 +586,51 @@ xstormy16_elf_relax_section (dynobj, splt, info, again) &relax_plt_data); /* Likewise for local symbols, though that's somewhat less convenient - as we have walk the list of input bfds and swap in symbol data. */ + as we have to walk the list of input bfds and swap in symbol data. */ for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next) { bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd); Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf32_External_Sym *extsyms; - Elf_External_Sym_Shndx *shndx_buf; + Elf_Internal_Sym *isymbuf = NULL; unsigned int idx; if (! local_plt_offsets) continue; symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; - shndx_hdr = &elf_tdata (ibfd)->symtab_shndx_hdr; - - if (symtab_hdr->contents != NULL) - extsyms = (Elf32_External_Sym *) symtab_hdr->contents; - else + if (symtab_hdr->sh_info != 0) { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf32_External_Sym); - extsyms = (Elf32_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (ibfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) return false; - if (bfd_seek (ibfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, ibfd) != amt) - { - error_ret_free_extsyms: - free (extsyms); - return false; - } - } - - shndx_buf = NULL; - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_ret_free_extsyms; - if (bfd_seek (ibfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, ibfd) != amt) - { - free (shndx_buf); - goto error_ret_free_extsyms; - } - shndx_hdr->contents = (bfd_byte *) shndx_buf; } for (idx = 0; idx < symtab_hdr->sh_info; ++idx) { - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; + Elf_Internal_Sym *isym; asection *tsec; bfd_vma address; if (local_plt_offsets[idx] == (bfd_vma) -1) continue; - shndx = shndx_buf; - if (shndx != NULL) - shndx += idx; - bfd_elf32_swap_symbol_in (ibfd, extsyms + idx, shndx, &isym); - if (isym.st_shndx == SHN_UNDEF) + isym = &isymbuf[idx]; + if (isym->st_shndx == SHN_UNDEF) continue; - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) tsec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) tsec = bfd_com_section_ptr; else - tsec = bfd_section_from_elf_index (ibfd, isym.st_shndx); + tsec = bfd_section_from_elf_index (ibfd, isym->st_shndx); address = (tsec->output_section->vma + tsec->output_offset - + isym.st_value); + + isym->st_value); if (address <= 0xffff) { local_plt_offsets[idx] = -1; @@ -675,11 +639,17 @@ xstormy16_elf_relax_section (dynobj, splt, info, again) } } - if (shndx_buf != NULL) - free (shndx_buf); - - if ((Elf32_External_Sym *) symtab_hdr->contents != extsyms) - free (extsyms); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + { + if (! info->keep_memory) + free (isymbuf); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; + } + } } /* If we changed anything, walk the symbols again to reallocate @@ -739,9 +709,6 @@ xstormy16_elf_always_size_sections (output_bfd, info) } /* Relocate an XSTORMY16 ELF section. - There is some attempt to make this function usable for many architectures, - both USE_REL and USE_RELA ['twould be nice if such a critter existed], - if only to serve as a learning tool. The RELOCATE_SECTION function is called by the new ELF backend linker to handle the relocations for a section. @@ -813,19 +780,19 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_reloc_status_type r; const char * name = NULL; int r_type; - + r_type = ELF32_R_TYPE (rel->r_info); - + if ( r_type == R_XSTORMY16_GNU_VTINHERIT || r_type == R_XSTORMY16_GNU_VTENTRY) continue; - + r_symndx = ELF32_R_SYM (rel->r_info); howto = xstormy16_elf_howto_table + ELF32_R_TYPE (rel->r_info); h = NULL; sym = NULL; sec = NULL; - + if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -833,7 +800,7 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); - + name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; @@ -841,13 +808,13 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section, else { h = sym_hashes [r_symndx - symtab_hdr->sh_info]; - + while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; name = h->root.root.string; - + if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -869,14 +836,14 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = 0; } } - + switch (ELF32_R_TYPE (rel->r_info)) { case R_XSTORMY16_24: { bfd_vma reloc = relocation + rel->r_addend; unsigned int x; - + x = bfd_get_32 (input_bfd, contents + rel->r_offset); x &= 0x0000ff00; x |= reloc & 0xff; @@ -952,13 +919,13 @@ xstormy16_elf_relocate_section (output_bfd, info, input_bfd, input_section, (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset); break; - + case bfd_reloc_undefined: r = info->callbacks->undefined_symbol (info, name, input_bfd, input_section, rel->r_offset, true); break; - + case bfd_reloc_outofrange: msg = _("internal error: out of range error"); break; @@ -1020,8 +987,8 @@ xstormy16_elf_finish_dynamic_sections (abfd, info) relocation. */ static asection * -xstormy16_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd * abfd; +xstormy16_elf_gc_mark_hook (sec, info, rel, h, sym) + asection * sec; struct bfd_link_info * info ATTRIBUTE_UNUSED; Elf_Internal_Rela * rel; struct elf_link_hash_entry * h; @@ -1051,9 +1018,7 @@ xstormy16_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 94b4ebe..4aeb32d 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -73,7 +73,7 @@ static boolean elf64_alpha_mkobject static boolean elf64_alpha_object_p PARAMS((bfd *)); static boolean elf64_alpha_section_from_shdr - PARAMS((bfd *, Elf64_Internal_Shdr *, char *)); + PARAMS((bfd *, Elf64_Internal_Shdr *, const char *)); static boolean elf64_alpha_section_flags PARAMS((flagword *, Elf64_Internal_Shdr *)); static boolean elf64_alpha_fake_sections @@ -106,14 +106,27 @@ static boolean elf64_alpha_calc_got_offsets_for_symbol PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); static void elf64_alpha_calc_got_offsets PARAMS ((struct bfd_link_info *)); static boolean elf64_alpha_size_got_sections - PARAMS ((bfd *, struct bfd_link_info *)); + PARAMS ((struct bfd_link_info *)); +static boolean elf64_alpha_size_plt_section + PARAMS ((struct bfd_link_info *)); +static boolean elf64_alpha_size_plt_section_1 + PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); static boolean elf64_alpha_always_size_sections PARAMS ((bfd *, struct bfd_link_info *)); +static int alpha_dynamic_entries_for_reloc + PARAMS ((int, int, int)); static boolean elf64_alpha_calc_dynrel_sizes PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *)); +static boolean elf64_alpha_size_rela_got_section + PARAMS ((struct bfd_link_info *)); +static boolean elf64_alpha_size_rela_got_1 + PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *)); static boolean elf64_alpha_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); +static struct alpha_elf_got_entry *get_got_entry + PARAMS ((bfd *, struct alpha_elf_link_hash_entry *, unsigned long, + unsigned long, bfd_vma)); static boolean elf64_alpha_check_relocs PARAMS((bfd *, struct bfd_link_info *, asection *sec, const Elf_Internal_Rela *)); @@ -121,6 +134,9 @@ static boolean elf64_alpha_adjust_dynamic_symbol PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean elf64_alpha_size_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); +static boolean elf64_alpha_relocate_section_r + PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static boolean elf64_alpha_relocate_section PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); @@ -148,11 +164,15 @@ struct alpha_elf_link_hash_entry /* Cumulative flags for all the .got entries. */ int flags; - /* Contexts (LITUSE) in which a literal was referenced. */ -#define ALPHA_ELF_LINK_HASH_LU_ADDR 0x01 -#define ALPHA_ELF_LINK_HASH_LU_MEM 0x02 -#define ALPHA_ELF_LINK_HASH_LU_BYTE 0x04 -#define ALPHA_ELF_LINK_HASH_LU_FUNC 0x08 + /* Contexts in which a literal was referenced. */ +#define ALPHA_ELF_LINK_HASH_LU_ADDR 0x01 +#define ALPHA_ELF_LINK_HASH_LU_MEM 0x02 +#define ALPHA_ELF_LINK_HASH_LU_BYTE 0x04 +#define ALPHA_ELF_LINK_HASH_LU_JSR 0x08 +#define ALPHA_ELF_LINK_HASH_LU_TLSGD 0x10 +#define ALPHA_ELF_LINK_HASH_LU_TLSLDM 0x20 +#define ALPHA_ELF_LINK_HASH_LU_FUNC 0x38 +#define ALPHA_ELF_LINK_HASH_TLS_IE 0x40 /* Used to implement multiple .got subsections. */ struct alpha_elf_got_entry @@ -168,13 +188,20 @@ struct alpha_elf_link_hash_entry /* the .got offset for this entry. */ int got_offset; - int flags; + /* How many references to this entry? */ + int use_count; - /* Additional flags. */ -#define ALPHA_ELF_GOT_ENTRY_RELOCS_DONE 0x10 -#define ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED 0x20 + /* The relocation type of this entry. */ + unsigned char reloc_type; - int use_count; + /* How a LITERAL is used. */ + unsigned char flags; + + /* Have we initialized the dynamic relocation for this entry? */ + unsigned char reloc_done; + + /* Have we adjusted this entry for SEC_MERGE? */ + unsigned char reloc_xlated; } *got_entries; /* used to count non-got, non-plt relocations for delayed sizing @@ -361,12 +388,12 @@ struct alpha_elf_obj_tdata /* For every got, this is the section. */ asection *got; - /* For every got, this is it's total number of *entries*. */ - int total_got_entries; + /* For every got, this is it's total number of words. */ + int total_got_size; - /* For every got, this is the sum of the number of *entries* required + /* For every got, this is the sum of the number of words required to hold all of the member object's local got. */ - int n_local_got_entries; + int local_got_size; }; #define alpha_elf_tdata(abfd) \ @@ -748,6 +775,203 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ true), /* pcrel_offset */ + + /* Creates a tls_index for the symbol in the got. */ + HOWTO (R_ALPHA_TLSGD, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "TLSGD", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Creates a tls_index for the (current) module in the got. */ + HOWTO (R_ALPHA_TLSLDM, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "TLSLDM", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A dynamic relocation for a DTP module entry. */ + HOWTO (R_ALPHA_DTPMOD64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "DTPMOD64", /* name */ + false, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* Creates a 64-bit offset in the got for the displacement + from DTP to the target. */ + HOWTO (R_ALPHA_GOTDTPREL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "GOTDTPREL", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A dynamic relocation for a displacement from DTP to the target. */ + HOWTO (R_ALPHA_DTPREL64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "DTPREL64", /* name */ + false, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* The high 16 bits of the displacement from DTP to the target. */ + HOWTO (R_ALPHA_DTPRELHI, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "DTPRELHI", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The low 16 bits of the displacement from DTP to the target. */ + HOWTO (R_ALPHA_DTPRELLO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + 0, /* special_function */ + "DTPRELLO", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16-bit displacement from DTP to the target. */ + HOWTO (R_ALPHA_DTPREL16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "DTPREL16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Creates a 64-bit offset in the got for the displacement + from TP to the target. */ + HOWTO (R_ALPHA_GOTTPREL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "GOTTPREL", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A dynamic relocation for a displacement from TP to the target. */ + HOWTO (R_ALPHA_TPREL64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "TPREL64", /* name */ + false, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* The high 16 bits of the displacement from TP to the target. */ + HOWTO (R_ALPHA_TPRELHI, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "TPRELHI", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The low 16 bits of the displacement from TP to the target. */ + HOWTO (R_ALPHA_TPRELLO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + 0, /* special_function */ + "TPRELLO", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16-bit displacement from TP to the target. */ + HOWTO (R_ALPHA_TPREL16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "TPREL16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ }; /* A relocation function which doesn't do anything. */ @@ -902,6 +1126,19 @@ static const struct elf_reloc_map elf64_alpha_reloc_map[] = {BFD_RELOC_ALPHA_GPREL_LO16, R_ALPHA_GPRELLOW}, {BFD_RELOC_GPREL16, R_ALPHA_GPREL16}, {BFD_RELOC_ALPHA_BRSGP, R_ALPHA_BRSGP}, + {BFD_RELOC_ALPHA_TLSGD, R_ALPHA_TLSGD}, + {BFD_RELOC_ALPHA_TLSLDM, R_ALPHA_TLSLDM}, + {BFD_RELOC_ALPHA_DTPMOD64, R_ALPHA_DTPMOD64}, + {BFD_RELOC_ALPHA_GOTDTPREL16, R_ALPHA_GOTDTPREL}, + {BFD_RELOC_ALPHA_DTPREL64, R_ALPHA_DTPREL64}, + {BFD_RELOC_ALPHA_DTPREL_HI16, R_ALPHA_DTPRELHI}, + {BFD_RELOC_ALPHA_DTPREL_LO16, R_ALPHA_DTPRELLO}, + {BFD_RELOC_ALPHA_DTPREL16, R_ALPHA_DTPREL16}, + {BFD_RELOC_ALPHA_GOTTPREL16, R_ALPHA_GOTTPREL}, + {BFD_RELOC_ALPHA_TPREL64, R_ALPHA_TPREL64}, + {BFD_RELOC_ALPHA_TPREL_HI16, R_ALPHA_TPRELHI}, + {BFD_RELOC_ALPHA_TPREL_LO16, R_ALPHA_TPRELLO}, + {BFD_RELOC_ALPHA_TPREL16, R_ALPHA_TPREL16}, }; /* Given a BFD reloc type, return a HOWTO structure. */ @@ -936,6 +1173,19 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst) BFD_ASSERT (r_type < (unsigned int) R_ALPHA_max); cache_ptr->howto = &elf64_alpha_howto_table[r_type]; } + +/* These two relocations create a two-word entry in the got. */ +#define alpha_got_entry_size(r_type) \ + (r_type == R_ALPHA_TLSGD || r_type == R_ALPHA_TLSLDM ? 16 : 8) + +/* This is PT_TLS segment p_vaddr. */ +#define alpha_get_dtprel_base(tlss) \ + ((tlss)->start) + +/* Main program TLS (whose template starts at PT_TLS p_vaddr) + is assigned offset round(16, PT_TLS p_align). */ +#define alpha_get_tprel_base(tlss) \ + ((tlss)->start - align_power ((bfd_vma) 16, (tlss)->align)) /* These functions do relaxation for Alpha ELF. @@ -958,35 +1208,45 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst) #define OP_BR 0x30 #define OP_BSR 0x34 #define INSN_UNOP 0x2ffe0000 +#define INSN_ADDQ 0x40000400 +#define INSN_RDUNIQ 0x0000009e struct alpha_relax_info { bfd *abfd; asection *sec; bfd_byte *contents; + Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *relocs, *relend; struct bfd_link_info *link_info; - boolean changed_contents; - boolean changed_relocs; + struct elf_link_tls_segment *tls_segment; bfd_vma gp; bfd *gotobj; asection *tsec; struct alpha_elf_link_hash_entry *h; + struct alpha_elf_got_entry **first_gotent; struct alpha_elf_got_entry *gotent; + boolean changed_contents; + boolean changed_relocs; unsigned char other; }; -static Elf_Internal_Rela * elf64_alpha_relax_with_lituse - PARAMS((struct alpha_relax_info *info, bfd_vma symval, - Elf_Internal_Rela *irel, Elf_Internal_Rela *irelend)); - -static boolean elf64_alpha_relax_without_lituse +static boolean elf64_alpha_relax_with_lituse PARAMS((struct alpha_relax_info *info, bfd_vma symval, Elf_Internal_Rela *irel)); - static bfd_vma elf64_alpha_relax_opt_call PARAMS((struct alpha_relax_info *info, bfd_vma symval)); - +static boolean elf64_alpha_relax_got_load + PARAMS((struct alpha_relax_info *info, bfd_vma symval, + Elf_Internal_Rela *irel, unsigned long)); +static boolean elf64_alpha_relax_gprelhilo + PARAMS((struct alpha_relax_info *info, bfd_vma symval, + Elf_Internal_Rela *irel, boolean)); +static boolean elf64_alpha_relax_tls_get_addr + PARAMS((struct alpha_relax_info *info, bfd_vma symval, + Elf_Internal_Rela *irel, boolean)); +static struct elf_link_tls_segment *elf64_alpha_relax_find_tls_segment + PARAMS((struct alpha_relax_info *, struct elf_link_tls_segment *)); static boolean elf64_alpha_relax_section PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, boolean *again)); @@ -1007,13 +1267,13 @@ elf64_alpha_find_reloc_at_ofs (rel, relend, offset, type) return NULL; } -static Elf_Internal_Rela * -elf64_alpha_relax_with_lituse (info, symval, irel, irelend) +static boolean +elf64_alpha_relax_with_lituse (info, symval, irel) struct alpha_relax_info *info; bfd_vma symval; - Elf_Internal_Rela *irel, *irelend; + Elf_Internal_Rela *irel; { - Elf_Internal_Rela *urel; + Elf_Internal_Rela *urel, *irelend = info->relend; int flags, count, i; bfd_signed_vma disp; boolean fits16; @@ -1029,9 +1289,13 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn", bfd_archive_filename (info->abfd), info->sec->name, (unsigned long) irel->r_offset)); - return irel; + return true; } + /* Can't relax dynamic symbols. */ + if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) + return true; + /* Summarize how this particular LITERAL is used. */ for (urel = irel+1, flags = count = 0; urel < irelend; ++urel, ++count) { @@ -1054,25 +1318,27 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) switch (urel->r_addend) { - default: /* 0 = ADDRESS FORMAT */ + case LITUSE_ALPHA_ADDR: + default: /* This type is really just a placeholder to note that all uses cannot be optimized, but to still allow some. */ all_optimized = false; break; - case 1: /* MEM FORMAT */ + case LITUSE_ALPHA_BASE: /* We can always optimize 16-bit displacements. */ /* Extract the displacement from the instruction, sign-extending it if necessary, then test whether it is within 16 or 32 bits displacement from GP. */ insn_disp = insn & 0x0000ffff; - if (insn_disp & 0x00008000) - insn_disp |= 0xffff0000; /* Negative: sign-extend. */ + if (insn_disp & 0x8000) + insn_disp |= ~0xffff; /* Negative: sign-extend. */ xdisp = disp + insn_disp; - fits16 = (xdisp >= - (bfd_signed_vma) 0x00008000 && xdisp < 0x00008000); - fits32 = (xdisp >= - (bfd_signed_vma) 0x80000000 && xdisp < 0x7fff8000); + fits16 = (xdisp >= - (bfd_signed_vma) 0x8000 && xdisp < 0x8000); + fits32 = (xdisp >= - (bfd_signed_vma) 0x80000000 + && xdisp < 0x7fff8000); if (fits16) { @@ -1111,7 +1377,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) all_optimized = false; break; - case 2: /* BYTE OFFSET FORMAT */ + case LITUSE_ALPHA_BYTOFF: /* We can always optimize byte instructions. */ /* FIXME: sanity check the insn for byte op. Check that the @@ -1129,16 +1395,20 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) info->changed_contents = true; break; - case 3: /* CALL FORMAT */ + case LITUSE_ALPHA_JSR: + case LITUSE_ALPHA_TLSGD: + case LITUSE_ALPHA_TLSLDM: { - /* If not zero, place to jump without needing pv. */ - bfd_vma optdest = elf64_alpha_relax_opt_call (info, symval); - bfd_vma org = (info->sec->output_section->vma - + info->sec->output_offset - + urel->r_offset + 4); + bfd_vma optdest, org; bfd_signed_vma odisp; + /* If not zero, place to jump without needing pv. */ + optdest = elf64_alpha_relax_opt_call (info, symval); + org = (info->sec->output_section->vma + + info->sec->output_offset + + urel->r_offset + 4); odisp = (optdest ? optdest : symval) - org; + if (odisp >= -0x400000 && odisp < 0x400000) { Elf_Internal_Rela *xrel; @@ -1180,10 +1450,11 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) { Elf_Internal_Rela *gpdisp = (elf64_alpha_find_reloc_at_ofs - (irel, irelend, urel->r_offset + 4, R_ALPHA_GPDISP)); + (info->relocs, irelend, urel->r_offset + 4, + R_ALPHA_GPDISP)); if (gpdisp) { - bfd_byte *p_ldah = info->contents + gpdisp->r_offset; + bfd_byte *p_ldah = info->contents + gpdisp->r_offset; bfd_byte *p_lda = p_ldah + gpdisp->r_addend; unsigned int ldah = bfd_get_32 (info->abfd, p_ldah); unsigned int lda = bfd_get_32 (info->abfd, p_lda); @@ -1213,14 +1484,17 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) got entry by one, possibly eliminating it. */ if (all_optimized) { - info->gotent->use_count -= 1; - alpha_elf_tdata (info->gotent->gotobj)->total_got_entries -= 1; - if (!info->h) - alpha_elf_tdata (info->gotent->gotobj)->n_local_got_entries -= 1; + if (--info->gotent->use_count == 0) + { + int sz = alpha_got_entry_size (R_ALPHA_LITERAL); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + } /* If the literal instruction is no longer needed (it may have been - reused. We can eliminate it. - ??? For now, I don't want to deal with compacting the section, + reused. We can eliminate it. */ + /* ??? For now, I don't want to deal with compacting the section, so just nop it out. */ if (!lit_reused) { @@ -1233,7 +1507,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) } } - return irel + count; + return true; } static bfd_vma @@ -1309,10 +1583,11 @@ elf64_alpha_relax_opt_call (info, symval) } static boolean -elf64_alpha_relax_without_lituse (info, symval, irel) +elf64_alpha_relax_got_load (info, symval, irel, r_type) struct alpha_relax_info *info; bfd_vma symval; Elf_Internal_Rela *irel; + unsigned long r_type; { unsigned int insn; bfd_signed_vma disp; @@ -1322,37 +1597,74 @@ elf64_alpha_relax_without_lituse (info, symval, irel) if (insn >> 26 != OP_LDQ) { + reloc_howto_type *howto = elf64_alpha_howto_table + r_type; ((*_bfd_error_handler) - ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn", + ("%s: %s+0x%lx: warning: %s relocation against unexpected insn", bfd_archive_filename (info->abfd), info->sec->name, - (unsigned long) irel->r_offset)); + (unsigned long) irel->r_offset, howto->name)); return true; } - /* So we aren't told much. Do what we can with the address load and - fake the rest. All of the optimizations here require that the - offset from the GP fit in 16 bits. */ + /* Can't relax dynamic symbols. */ + if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) + return true; - disp = symval - info->gp; - if (disp < -0x8000 || disp >= 0x8000) + /* Can't use local-exec relocations in shared libraries. */ + if (r_type == R_ALPHA_GOTTPREL && info->link_info->shared) return true; - /* On the LITERAL instruction itself, consider exchanging - `ldq R,X(gp)' for `lda R,Y(gp)'. */ + if (r_type == R_ALPHA_LITERAL) + disp = symval - info->gp; + else + { + bfd_vma dtp_base, tp_base; + + BFD_ASSERT (info->tls_segment != NULL); + dtp_base = alpha_get_dtprel_base (info->tls_segment); + tp_base = alpha_get_tprel_base (info->tls_segment); + disp = symval - (r_type == R_ALPHA_GOTDTPREL ? dtp_base : tp_base); + } - insn = (OP_LDA << 26) | (insn & 0x03ff0000); + if (disp < -0x8000 || disp >= 0x8000) + return true; + + /* Exchange LDQ for LDA. In the case of the TLS relocs, we're loading + a constant, so force the base register to be $31. */ + if (r_type == R_ALPHA_LITERAL) + insn = (OP_LDA << 26) | (insn & 0x03ff0000); + else + insn = (OP_LDA << 26) | (insn & (31 << 21)) | (31 << 16); bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + irel->r_offset); info->changed_contents = true; - irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPREL16); + switch (r_type) + { + case R_ALPHA_LITERAL: + r_type = R_ALPHA_GPREL16; + break; + case R_ALPHA_GOTDTPREL: + r_type = R_ALPHA_DTPREL16; + break; + case R_ALPHA_GOTTPREL: + r_type = R_ALPHA_TPREL16; + break; + default: + BFD_ASSERT (0); + return false; + } + + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), r_type); info->changed_relocs = true; /* Reduce the use count on this got entry by one, possibly eliminating it. */ - info->gotent->use_count -= 1; - alpha_elf_tdata (info->gotent->gotobj)->total_got_entries -= 1; - if (!info->h) - alpha_elf_tdata (info->gotent->gotobj)->n_local_got_entries -= 1; + if (--info->gotent->use_count == 0) + { + int sz = alpha_got_entry_size (r_type); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + } /* ??? Search forward through this basic block looking for insns that use the target register. Stop after an insn modifying the @@ -1371,6 +1683,353 @@ elf64_alpha_relax_without_lituse (info, symval, irel) } static boolean +elf64_alpha_relax_gprelhilo (info, symval, irel, hi) + struct alpha_relax_info *info; + bfd_vma symval; + Elf_Internal_Rela *irel; + boolean hi; +{ + unsigned int insn; + bfd_signed_vma disp; + bfd_byte *pos = info->contents + irel->r_offset; + + /* ??? This assumes that the compiler doesn't render + + array[i] + as + ldah t, array(gp) !gprelhigh + s8addl i, t, t + ldq r, array(t) !gprellow + + which would indeed be the most efficient way to implement this. */ + + return true; + + disp = symval - info->gp; + if (disp < -0x8000 || disp >= 0x8000) + return true; + + if (hi) + { + /* Nop out the high instruction. */ + + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos); + info->changed_contents = true; + + irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + irel->r_addend = 0; + info->changed_relocs = true; + } + else + { + /* Adjust the low instruction to reference GP directly. */ + + insn = bfd_get_32 (info->abfd, pos); + insn = (insn & 0xffe00000) | (29 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos); + info->changed_contents = true; + + irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_GPREL16); + info->changed_relocs = true; + } + + return true; +} + +static boolean +elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) + struct alpha_relax_info *info; + bfd_vma symval; + Elf_Internal_Rela *irel; + boolean is_gd; +{ + bfd_byte *pos[5]; + unsigned int insn; + Elf_Internal_Rela *gpdisp, *hint; + boolean dynamic, use_gottprel; + + dynamic = alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info); + + /* ??? For LD relaxation, we need a symbol referencing the beginning + of the TLS segment. */ + if (!is_gd) + return true; + + /* If a TLS symbol is accessed using IE at least once, there is no point + to use dynamic model for it. */ + if (is_gd && info->h && (info->h->flags & ALPHA_ELF_LINK_HASH_TLS_IE)) + ; + + /* If the symbol is local, and we've already committed to DF_STATIC_TLS, + then we might as well relax to IE. */ + else if (info->link_info->shared && !dynamic + && (info->link_info->flags & DF_STATIC_TLS)) + ; + + /* Otherwise we must be building an executable to do anything. */ + else if (info->link_info->shared) + return true; + + /* The TLSGD/TLSLDM relocation must be followed by a LITERAL and + the matching LITUSE_TLS relocations. */ + if (irel + 2 >= info->relend) + return true; + if (ELF64_R_TYPE (irel[1].r_info) != R_ALPHA_LITERAL + || ELF64_R_TYPE (irel[2].r_info) != R_ALPHA_LITUSE + || irel[2].r_addend != (is_gd ? LITUSE_ALPHA_TLSGD : LITUSE_ALPHA_TLSLDM)) + return true; + + /* There must be a GPDISP relocation positioned immediately after the + LITUSE relocation. */ + gpdisp = elf64_alpha_find_reloc_at_ofs (info->relocs, info->relend, + irel[2].r_offset + 4, R_ALPHA_GPDISP); + if (!gpdisp) + return true; + + pos[0] = info->contents + irel[0].r_offset; + pos[1] = info->contents + irel[1].r_offset; + pos[2] = info->contents + irel[2].r_offset; + pos[3] = info->contents + gpdisp->r_offset; + pos[4] = pos[3] + gpdisp->r_addend; + + /* Only positions 0 and 1 are allowed to be out of order. */ + if (pos[1] < pos[0]) + { + bfd_byte *tmp = pos[0]; + pos[0] = pos[1]; + pos[1] = tmp; + } + if (pos[1] >= pos[2] || pos[2] >= pos[3] || pos[3] >= pos[4]) + return true; + + /* Reduce the use count on the LITERAL relocation. Do this before we + smash the symndx when we adjust the relocations below. */ + { + struct alpha_elf_got_entry *lit_gotent; + struct alpha_elf_link_hash_entry *lit_h; + unsigned long indx; + + BFD_ASSERT (ELF64_R_SYM (irel[1].r_info) >= info->symtab_hdr->sh_info); + indx = ELF64_R_SYM (irel[1].r_info) - info->symtab_hdr->sh_info; + lit_h = alpha_elf_sym_hashes (info->abfd)[indx]; + + while (lit_h->root.root.type == bfd_link_hash_indirect + || lit_h->root.root.type == bfd_link_hash_warning) + lit_h = (struct alpha_elf_link_hash_entry *) lit_h->root.root.u.i.link; + + for (lit_gotent = lit_h->got_entries; lit_gotent ; + lit_gotent = lit_gotent->next) + if (lit_gotent->gotobj == info->gotobj + && lit_gotent->reloc_type == R_ALPHA_LITERAL + && lit_gotent->addend == irel[1].r_addend) + break; + BFD_ASSERT (lit_gotent); + + if (--lit_gotent->use_count == 0) + { + int sz = alpha_got_entry_size (R_ALPHA_LITERAL); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + } + } + + /* Change + + lda $16,x($gp) !tlsgd!1 + ldq $27,__tls_get_addr($gp) !literal!1 + jsr $26,($27)__tls_get_addr !lituse_tlsgd!1 + ldah $29,0($26) !gpdisp!2 + lda $29,0($29) !gpdisp!2 + to + ldq $16,x($gp) !gottprel + unop + call_pal rduniq + addq $16,$0,$0 + unop + or the first pair to + lda $16,x($gp) !tprel + unop + or + ldah $16,x($gp) !tprelhi + lda $16,x($16) !tprello + + as appropriate. */ + + use_gottprel = false; + switch (!dynamic && !info->link_info->shared) + { + case 1: + { + bfd_vma tp_base; + bfd_signed_vma disp; + + BFD_ASSERT (info->tls_segment != NULL); + tp_base = alpha_get_tprel_base (info->tls_segment); + disp = symval - tp_base; + + if (disp >= -0x8000 && disp < 0x8000) + { + insn = (OP_LDA << 26) | (16 << 21) | (31 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); + + irel[0].r_offset = pos[0] - info->contents; + irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_TPREL16); + irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + break; + } + else if (disp >= -(bfd_signed_vma) 0x80000000 + && disp < (bfd_signed_vma) 0x7fff8000) + { + insn = (OP_LDAH << 26) | (16 << 21) | (31 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); + insn = (OP_LDA << 26) | (16 << 21) | (16 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[1]); + + irel[0].r_offset = pos[0] - info->contents; + irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_TPRELHI); + irel[1].r_offset = pos[1] - info->contents; + irel[1].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_TPRELLO); + break; + } + } + /* FALLTHRU */ + + default: + use_gottprel = true; + + insn = (OP_LDQ << 26) | (16 << 21) | (29 << 16); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); + + irel[0].r_offset = pos[0] - info->contents; + irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_ALPHA_GOTTPREL); + irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + break; + } + + bfd_put_32 (info->abfd, (bfd_vma) INSN_RDUNIQ, pos[2]); + + insn = INSN_ADDQ | (16 << 21) | (0 << 16) | (0 << 0); + bfd_put_32 (info->abfd, (bfd_vma) insn, pos[3]); + + bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[4]); + + irel[2].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + + hint = elf64_alpha_find_reloc_at_ofs (info->relocs, info->relend, + irel[2].r_offset, R_ALPHA_HINT); + if (hint) + hint->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); + + info->changed_contents = true; + info->changed_relocs = true; + + /* Reduce the use count on the TLSGD/TLSLDM relocation. */ + if (--info->gotent->use_count == 0) + { + int sz = alpha_got_entry_size (info->gotent->reloc_type); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + } + + /* If we've switched to a GOTTPREL relocation, increment the reference + count on that got entry. */ + if (use_gottprel) + { + struct alpha_elf_got_entry *tprel_gotent; + + for (tprel_gotent = *info->first_gotent; tprel_gotent ; + tprel_gotent = tprel_gotent->next) + if (tprel_gotent->gotobj == info->gotobj + && tprel_gotent->reloc_type == R_ALPHA_GOTTPREL + && tprel_gotent->addend == irel->r_addend) + break; + if (tprel_gotent) + tprel_gotent->use_count++; + else + { + if (info->gotent->use_count == 0) + tprel_gotent = info->gotent; + else + { + tprel_gotent = (struct alpha_elf_got_entry *) + bfd_alloc (info->abfd, sizeof (struct alpha_elf_got_entry)); + if (!tprel_gotent) + return false; + + tprel_gotent->next = *info->first_gotent; + *info->first_gotent = tprel_gotent; + + tprel_gotent->gotobj = info->gotobj; + tprel_gotent->addend = irel->r_addend; + tprel_gotent->got_offset = -1; + tprel_gotent->reloc_done = 0; + tprel_gotent->reloc_xlated = 0; + } + + tprel_gotent->use_count = 1; + tprel_gotent->reloc_type = R_ALPHA_GOTTPREL; + } + } + + return true; +} + +static struct elf_link_tls_segment * +elf64_alpha_relax_find_tls_segment (info, seg) + struct alpha_relax_info *info; + struct elf_link_tls_segment *seg; +{ + bfd *output_bfd = info->sec->output_section->owner; + asection *o; + unsigned int align; + bfd_vma base, end; + + for (o = output_bfd->sections; o ; o = o->next) + if ((o->flags & SEC_THREAD_LOCAL) != 0 + && (o->flags & SEC_LOAD) != 0) + break; + if (!o) + return NULL; + + base = o->vma; + align = 0; + + do + { + bfd_vma size; + + if (bfd_get_section_alignment (output_bfd, o) > align) + align = bfd_get_section_alignment (output_bfd, o); + + size = o->_raw_size; + if (size == 0 && (o->flags & SEC_HAS_CONTENTS) == 0) + { + struct bfd_link_order *lo; + for (lo = o->link_order_head; lo ; lo = lo->next) + if (size < lo->offset + lo->size) + size = lo->offset + lo->size; + } + end = o->vma + size; + o = o->next; + } + while (o && (o->flags & SEC_THREAD_LOCAL)); + + seg->start = base; + seg->size = end - base; + seg->align = align; + + return seg; +} + +static boolean elf64_alpha_relax_section (abfd, sec, link_info, again) bfd *abfd; asection *sec; @@ -1378,16 +2037,12 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) boolean *again; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; - bfd_byte *free_contents = NULL; - Elf64_External_Sym *extsyms = NULL; - Elf64_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_Internal_Sym *isymbuf = NULL; struct alpha_elf_got_entry **local_got_entries; struct alpha_relax_info info; + struct elf_link_tls_segment tls_segment; /* We are not currently changing any sizes, so only one pass. */ *again = false; @@ -1410,116 +2065,99 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) - goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; + return false; memset(&info, 0, sizeof (info)); info.abfd = abfd; info.sec = sec; info.link_info = link_info; + info.symtab_hdr = symtab_hdr; info.relocs = internal_relocs; info.relend = irelend = internal_relocs + sec->reloc_count; - /* Find the GP for this object. */ + /* Find the GP for this object. Do not store the result back via + _bfd_set_gp_value, since this could change again before final. */ info.gotobj = alpha_elf_tdata (abfd)->gotobj; if (info.gotobj) { asection *sgot = alpha_elf_tdata (info.gotobj)->got; - info.gp = _bfd_get_gp_value (info.gotobj); - if (info.gp == 0) - { - info.gp = (sgot->output_section->vma - + sgot->output_offset - + 0x8000); - _bfd_set_gp_value (info.gotobj, info.gp); - } + info.gp = (sgot->output_section->vma + + sgot->output_offset + + 0x8000); + } + + /* Get the section contents. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + info.contents = elf_section_data (sec)->this_hdr.contents; + else + { + info.contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (info.contents == NULL) + goto error_return; + + if (! bfd_get_section_contents (abfd, sec, info.contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; } + /* Compute the TLS segment information. The version normally found in + elf_hash_table (link_info)->tls_segment isn't built until final_link. + ??? Probably should look into extracting this into a common function. */ + info.tls_segment = elf64_alpha_relax_find_tls_segment (&info, &tls_segment); + for (irel = internal_relocs; irel < irelend; irel++) { bfd_vma symval; - Elf_Internal_Sym isym; struct alpha_elf_got_entry *gotent; + unsigned long r_type = ELF64_R_TYPE (irel->r_info); - if (ELF64_R_TYPE (irel->r_info) != (int) R_ALPHA_LITERAL) - continue; - - /* Get the section contents. */ - if (info.contents == NULL) + /* Early exit for unhandled or unrelaxable relocations. */ + switch (r_type) { - if (elf_section_data (sec)->this_hdr.contents != NULL) - info.contents = elf_section_data (sec)->this_hdr.contents; - else - { - info.contents = (bfd_byte *) bfd_malloc (sec->_raw_size); - if (info.contents == NULL) - goto error_return; - free_contents = info.contents; - - if (! bfd_get_section_contents (abfd, sec, info.contents, - (file_ptr) 0, sec->_raw_size)) - goto error_return; - } + case R_ALPHA_LITERAL: + case R_ALPHA_GPRELHIGH: + case R_ALPHA_GPRELLOW: + case R_ALPHA_GOTDTPREL: + case R_ALPHA_GOTTPREL: + case R_ALPHA_TLSGD: + case R_ALPHA_TLSLDM: + break; + default: + continue; } - /* Read this BFD's symbols if we haven't done so already. */ - if (extsyms == NULL) + /* Get the value of the symbol referred to by the reloc. */ + if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - bfd_size_type amt; - - if (symtab_hdr->contents != NULL) - extsyms = (Elf64_External_Sym *) symtab_hdr->contents; - else - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf64_External_Sym); - extsyms = (Elf64_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, abfd) != amt) - goto error_return; - } + /* A local symbol. */ + Elf_Internal_Sym *isym; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) + /* Read this BFD's local symbols. */ + if (isymbuf == NULL) { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) goto error_return; } - } - /* Get the value of the symbol referred to by the reloc. */ - if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) - { - /* A local symbol. */ - Elf64_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - - esym = extsyms + ELF64_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELF64_R_SYM (irel->r_info) : 0); - bfd_elf64_swap_symbol_in (abfd, esym, shndx, &isym); - if (isym.st_shndx == SHN_UNDEF) - info.tsec = bfd_und_section_ptr; - else if (isym.st_shndx == SHN_ABS) + isym = isymbuf + ELF64_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) + continue; + else if (isym->st_shndx == SHN_ABS) info.tsec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) info.tsec = bfd_com_section_ptr; else - info.tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); info.h = NULL; - info.other = isym.st_other; - gotent = local_got_entries[ELF64_R_SYM(irel->r_info)]; - symval = isym.st_value; + info.other = isym->st_other; + info.first_gotent = &local_got_entries[ELF64_R_SYM(irel->r_info)]; + symval = isym->st_value; } else { @@ -1534,66 +2172,103 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) || h->root.root.type == bfd_link_hash_warning) h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; - /* We can't do anthing with undefined or dynamic symbols. */ - if (h->root.root.type == bfd_link_hash_undefined - || h->root.root.type == bfd_link_hash_undefweak - || alpha_elf_dynamic_symbol_p (&h->root, link_info)) + /* If the symbol is undefined, we can't do anything with it. */ + if (h->root.root.type == bfd_link_hash_undefweak + || h->root.root.type == bfd_link_hash_undefined) + continue; + + /* If the symbol isn't defined in the current module, again + we can't do anything. */ + if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) continue; info.h = h; info.tsec = h->root.root.u.def.section; info.other = h->root.other; - gotent = h->got_entries; + info.first_gotent = &h->got_entries; symval = h->root.root.u.def.value; } /* Search for the got entry to be used by this relocation. */ - while (gotent->gotobj != info.gotobj || gotent->addend != irel->r_addend) - gotent = gotent->next; + for (gotent = *info.first_gotent; gotent ; gotent = gotent->next) + if (gotent->gotobj == info.gotobj + && gotent->reloc_type == r_type + && gotent->addend == irel->r_addend) + break; info.gotent = gotent; symval += info.tsec->output_section->vma + info.tsec->output_offset; symval += irel->r_addend; - BFD_ASSERT(info.gotent != NULL); + switch (r_type) + { + case R_ALPHA_LITERAL: + BFD_ASSERT(info.gotent != NULL); - /* If there exist LITUSE relocations immediately following, this - opens up all sorts of interesting optimizations, because we - now know every location that this address load is used. */ + /* If there exist LITUSE relocations immediately following, this + opens up all sorts of interesting optimizations, because we + now know every location that this address load is used. */ + if (irel+1 < irelend + && ELF64_R_TYPE (irel[1].r_info) == R_ALPHA_LITUSE) + { + if (!elf64_alpha_relax_with_lituse (&info, symval, irel)) + goto error_return; + } + else + { + if (!elf64_alpha_relax_got_load (&info, symval, irel, r_type)) + goto error_return; + } + break; - if (irel+1 < irelend && ELF64_R_TYPE (irel[1].r_info) == R_ALPHA_LITUSE) - { - irel = elf64_alpha_relax_with_lituse (&info, symval, irel, irelend); - if (irel == NULL) + case R_ALPHA_GPRELHIGH: + case R_ALPHA_GPRELLOW: + if (!elf64_alpha_relax_gprelhilo (&info, symval, irel, + r_type == R_ALPHA_GPRELHIGH)) goto error_return; - } - else - { - if (!elf64_alpha_relax_without_lituse (&info, symval, irel)) + break; + + case R_ALPHA_GOTDTPREL: + case R_ALPHA_GOTTPREL: + BFD_ASSERT(info.gotent != NULL); + if (!elf64_alpha_relax_got_load (&info, symval, irel, r_type)) goto error_return; + break; + + case R_ALPHA_TLSGD: + case R_ALPHA_TLSLDM: + BFD_ASSERT(info.gotent != NULL); + if (!elf64_alpha_relax_tls_get_addr (&info, symval, irel, + r_type == R_ALPHA_TLSGD)) + goto error_return; + break; } } - if (!elf64_alpha_size_got_sections (abfd, link_info)) + if (!elf64_alpha_size_plt_section (link_info)) + return false; + if (!elf64_alpha_size_got_sections (link_info)) + return false; + if (!elf64_alpha_size_rela_got_section (link_info)) return false; - if (info.changed_relocs) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { - elf_section_data (sec)->relocs = internal_relocs; - } - else if (free_relocs != NULL) - { - free (free_relocs); + if (!link_info->keep_memory) + free (isymbuf); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; + } } - if (info.changed_contents) + if (info.contents != NULL + && elf_section_data (sec)->this_hdr.contents != info.contents) { - elf_section_data (sec)->this_hdr.contents = info.contents; - } - else if (free_contents != NULL) - { - if (! link_info->keep_memory) - free (free_contents); + if (!info.changed_contents && !link_info->keep_memory) + free (info.contents); else { /* Cache the section contents for elf_link_input_bfd. */ @@ -1601,18 +2276,12 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) } } - if (shndx_buf != NULL) - free (shndx_buf); - - if (free_extsyms != NULL) + if (elf_section_data (sec)->relocs != internal_relocs) { - if (! link_info->keep_memory) - free (free_extsyms); + if (!info.changed_relocs) + free (internal_relocs); else - { - /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = (unsigned char *) extsyms; - } + elf_section_data (sec)->relocs = internal_relocs; } *again = info.changed_contents || info.changed_relocs; @@ -1620,14 +2289,15 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); + if (info.contents != NULL + && elf_section_data (sec)->this_hdr.contents != info.contents) + free (info.contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return false; } @@ -1643,7 +2313,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) #define PLT_ENTRY_WORD2 0 #define PLT_ENTRY_WORD3 0 -#define MAX_GOT_ENTRIES (64*1024 / 8) +#define MAX_GOT_SIZE (64*1024) #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so" @@ -1656,7 +2326,7 @@ static boolean elf64_alpha_section_from_shdr (abfd, hdr, name) bfd *abfd; Elf64_Internal_Shdr *hdr; - char *name; + const char *name; { asection *newsect; @@ -1908,9 +2578,8 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) if (ext_hdr == NULL && swap->external_hdr_size != 0) goto error_return; - if (bfd_get_section_contents (abfd, section, ext_hdr, (file_ptr) 0, - swap->external_hdr_size) - == false) + if (! bfd_get_section_contents (abfd, section, ext_hdr, (file_ptr) 0, + swap->external_hdr_size)) goto error_return; symhdr = &debug->symbolic_header; @@ -2244,18 +2913,86 @@ elf64_alpha_output_extsym (h, data) return true; } + +/* Search for and possibly create a got entry. */ -/* FIXME: Create a runtime procedure table from the .mdebug section. - -static boolean -mips_elf_create_procedure_table (handle, abfd, info, s, debug) - PTR handle; +static struct alpha_elf_got_entry * +get_got_entry (abfd, h, r_type, r_symndx, r_addend) bfd *abfd; - struct bfd_link_info *info; - asection *s; - struct ecoff_debug_info *debug; -*/ - + struct alpha_elf_link_hash_entry *h; + unsigned long r_type, r_symndx; + bfd_vma r_addend; +{ + struct alpha_elf_got_entry *gotent; + struct alpha_elf_got_entry **slot; + + if (h) + slot = &h->got_entries; + else + { + /* This is a local .got entry -- record for merge. */ + + struct alpha_elf_got_entry **local_got_entries; + + local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; + if (!local_got_entries) + { + bfd_size_type size; + Elf_Internal_Shdr *symtab_hdr; + + symtab_hdr = &elf_tdata(abfd)->symtab_hdr; + size = symtab_hdr->sh_info; + size *= sizeof (struct alpha_elf_got_entry *); + + local_got_entries + = (struct alpha_elf_got_entry **) bfd_zalloc (abfd, size); + if (!local_got_entries) + return NULL; + + alpha_elf_tdata (abfd)->local_got_entries = local_got_entries; + } + + slot = &local_got_entries[r_symndx]; + } + + for (gotent = *slot; gotent ; gotent = gotent->next) + if (gotent->gotobj == abfd + && gotent->reloc_type == r_type + && gotent->addend == r_addend) + break; + + if (!gotent) + { + int entry_size; + bfd_size_type amt; + + amt = sizeof (struct alpha_elf_got_entry); + gotent = (struct alpha_elf_got_entry *) bfd_alloc (abfd, amt); + if (!gotent) + return NULL; + + gotent->gotobj = abfd; + gotent->addend = r_addend; + gotent->got_offset = -1; + gotent->use_count = 1; + gotent->reloc_type = r_type; + gotent->reloc_done = 0; + gotent->reloc_xlated = 0; + + gotent->next = *slot; + *slot = gotent; + + entry_size = alpha_got_entry_size (r_type); + alpha_elf_tdata (abfd)->total_got_size += entry_size; + if (!h) + alpha_elf_tdata(abfd)->local_got_size += entry_size; + } + else + gotent->use_count += 1; + + return gotent; +} + /* Handle dynamic relocations when doing an Alpha ELF link. */ static boolean @@ -2270,9 +3007,8 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) const char *rel_sec_name; Elf_Internal_Shdr *symtab_hdr; struct alpha_elf_link_hash_entry **sym_hashes; - struct alpha_elf_got_entry **local_got_entries; const Elf_Internal_Rela *rel, *relend; - int got_created; + boolean got_created; bfd_size_type amt; if (info->relocateable) @@ -2286,14 +3022,23 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) rel_sec_name = NULL; symtab_hdr = &elf_tdata(abfd)->symtab_hdr; sym_hashes = alpha_elf_sym_hashes(abfd); - local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; - got_created = 0; + got_created = false; relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; ++rel) { + enum { + NEED_GOT = 1, + NEED_GOT_ENTRY = 2, + NEED_DYNREL = 4 + }; + unsigned long r_symndx, r_type; struct alpha_elf_link_hash_entry *h; + unsigned int gotent_flags; + boolean maybe_dynamic; + unsigned int need; + bfd_vma addend; r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) @@ -2308,125 +3053,40 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) h->root.elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; } + + /* We can only get preliminary data on whether a symbol is + locally or externally defined, as not all of the input files + have yet been processed. Do something with what we know, as + this may help reduce memory usage and processing time later. */ + maybe_dynamic = false; + if (h && ((info->shared + && (!info->symbolic || info->allow_shlib_undefined)) + || ! (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + || h->root.root.type == bfd_link_hash_defweak)) + maybe_dynamic = true; + + need = 0; + gotent_flags = 0; r_type = ELF64_R_TYPE (rel->r_info); + addend = rel->r_addend; switch (r_type) { case R_ALPHA_LITERAL: - { - struct alpha_elf_got_entry *gotent; - int flags = 0; - - if (h) - { - /* Search for and possibly create a got entry. */ - for (gotent = h->got_entries; gotent ; gotent = gotent->next) - if (gotent->gotobj == abfd && - gotent->addend == rel->r_addend) - break; - - if (!gotent) - { - amt = sizeof (struct alpha_elf_got_entry); - gotent = ((struct alpha_elf_got_entry *) - bfd_alloc (abfd, amt)); - if (!gotent) - return false; - - gotent->gotobj = abfd; - gotent->addend = rel->r_addend; - gotent->got_offset = -1; - gotent->flags = 0; - gotent->use_count = 1; - - gotent->next = h->got_entries; - h->got_entries = gotent; - - alpha_elf_tdata (abfd)->total_got_entries++; - } - else - gotent->use_count += 1; - } - else - { - /* This is a local .got entry -- record for merge. */ - if (!local_got_entries) - { - bfd_size_type size; - size = symtab_hdr->sh_info; - size *= sizeof (struct alpha_elf_got_entry *); - - local_got_entries = ((struct alpha_elf_got_entry **) - bfd_alloc (abfd, size)); - if (!local_got_entries) - return false; - - memset (local_got_entries, 0, (size_t) size); - alpha_elf_tdata (abfd)->local_got_entries = - local_got_entries; - } - - for (gotent = local_got_entries[ELF64_R_SYM(rel->r_info)]; - gotent != NULL && gotent->addend != rel->r_addend; - gotent = gotent->next) - continue; - if (!gotent) - { - amt = sizeof (struct alpha_elf_got_entry); - gotent = ((struct alpha_elf_got_entry *) - bfd_alloc (abfd, amt)); - if (!gotent) - return false; - - gotent->gotobj = abfd; - gotent->addend = rel->r_addend; - gotent->got_offset = -1; - gotent->flags = 0; - gotent->use_count = 1; - - gotent->next = local_got_entries[ELF64_R_SYM(rel->r_info)]; - local_got_entries[ELF64_R_SYM(rel->r_info)] = gotent; - - alpha_elf_tdata(abfd)->total_got_entries++; - alpha_elf_tdata(abfd)->n_local_got_entries++; - } - else - gotent->use_count += 1; - } - - /* Remember how this literal is used from its LITUSEs. - This will be important when it comes to decide if we can - create a .plt entry for a function symbol. */ - if (rel+1 < relend - && ELF64_R_TYPE (rel[1].r_info) == R_ALPHA_LITUSE) - { - do - { - ++rel; - if (rel->r_addend >= 1 && rel->r_addend <= 3) - flags |= 1 << rel->r_addend; - } - while (rel+1 < relend && - ELF64_R_TYPE (rel[1].r_info) == R_ALPHA_LITUSE); - } - else - { - /* No LITUSEs -- presumably the address is not being - loaded for nothing. */ - flags = ALPHA_ELF_LINK_HASH_LU_ADDR; - } - - gotent->flags |= flags; - if (h) - { - /* Make a guess as to whether a .plt entry will be needed. */ - if ((h->flags |= flags) == ALPHA_ELF_LINK_HASH_LU_FUNC) - h->root.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - else - h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - } - } - /* FALLTHRU */ + need = NEED_GOT | NEED_GOT_ENTRY; + + /* Remember how this literal is used from its LITUSEs. + This will be important when it comes to decide if we can + create a .plt entry for a function symbol. */ + while (++rel < relend && ELF64_R_TYPE (rel->r_info) == R_ALPHA_LITUSE) + if (rel->r_addend >= 1 && rel->r_addend <= 5) + gotent_flags |= 1 << rel->r_addend; + --rel; + + /* No LITUSEs -- presumably the address is used somehow. */ + if (gotent_flags == 0) + gotent_flags = ALPHA_ELF_LINK_HASH_LU_ADDR; + break; case R_ALPHA_GPDISP: case R_ALPHA_GPREL16: @@ -2434,9 +3094,38 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) case R_ALPHA_GPRELHIGH: case R_ALPHA_GPRELLOW: case R_ALPHA_BRSGP: - /* We don't actually use the .got here, but the sections must - be created before the linker maps input sections to output - sections. */ + need = NEED_GOT; + break; + + case R_ALPHA_REFLONG: + case R_ALPHA_REFQUAD: + if (info->shared || maybe_dynamic) + need = NEED_DYNREL; + break; + + case R_ALPHA_TLSGD: + case R_ALPHA_TLSLDM: + case R_ALPHA_GOTDTPREL: + need = NEED_GOT | NEED_GOT_ENTRY; + break; + + case R_ALPHA_GOTTPREL: + need = NEED_GOT | NEED_GOT_ENTRY; + gotent_flags = ALPHA_ELF_LINK_HASH_TLS_IE; + if (info->shared) + info->flags |= DF_STATIC_TLS; + break; + + case R_ALPHA_TPREL64: + if (info->shared || maybe_dynamic) + need = NEED_DYNREL; + if (info->shared) + info->flags |= DF_STATIC_TLS; + break; + } + + if (need & NEED_GOT) + { if (!got_created) { if (!elf64_alpha_create_got_section (abfd, info)) @@ -2450,17 +3139,36 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) got_created = 1; } - break; + } - case R_ALPHA_SREL16: - case R_ALPHA_SREL32: - case R_ALPHA_SREL64: - if (h == NULL) - break; - /* FALLTHRU */ + if (need & NEED_GOT_ENTRY) + { + struct alpha_elf_got_entry *gotent; - case R_ALPHA_REFLONG: - case R_ALPHA_REFQUAD: + gotent = get_got_entry (abfd, h, r_type, r_symndx, addend); + if (!gotent) + return false; + + if (gotent_flags) + { + gotent->flags |= gotent_flags; + if (h) + { + gotent_flags |= h->flags; + h->flags = gotent_flags; + + /* Make a guess as to whether a .plt entry is needed. */ + if ((gotent_flags & ALPHA_ELF_LINK_HASH_LU_FUNC) + && !(gotent_flags & ~ALPHA_ELF_LINK_HASH_LU_FUNC)) + h->root.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + else + h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + } + + if (need & NEED_DYNREL) + { if (rel_sec_name == NULL) { rel_sec_name = (bfd_elf_string_from_elf_section @@ -2530,15 +3238,15 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) else rent->count++; } - else if (info->shared && (sec->flags & SEC_ALLOC)) + else if (info->shared) { /* If this is a shared library, and the section is to be loaded into memory, we need a RELATIVE reloc. */ sreloc->_raw_size += sizeof (Elf64_External_Rela); - if (sec->flags & SEC_READONLY) + if ((sec->flags & (SEC_READONLY | SEC_ALLOC)) + == (SEC_READONLY | SEC_ALLOC)) info->flags |= DF_TEXTREL; } - break; } } @@ -2570,7 +3278,8 @@ elf64_alpha_adjust_dynamic_symbol (info, h) && ((h->type == STT_FUNC && !(ah->flags & ALPHA_ELF_LINK_HASH_LU_ADDR)) || (h->type == STT_NOTYPE - && ah->flags == ALPHA_ELF_LINK_HASH_LU_FUNC)) + && (ah->flags & ALPHA_ELF_LINK_HASH_LU_FUNC) + && !(ah->flags & ~ALPHA_ELF_LINK_HASH_LU_FUNC))) /* Don't prevent otherwise valid programs from linking by attempting to create a new .got entry somewhere. A Correct Solution would be to add a new .got section to a new object file and let it be merged @@ -2667,8 +3376,13 @@ elf64_alpha_merge_ind_symbols (hi, dummy) { gin = gi->next; for (gs = gsh; gs ; gs = gs->next) - if (gi->gotobj == gs->gotobj && gi->addend == gs->addend) - goto got_found; + if (gi->gotobj == gs->gotobj + && gi->reloc_type == gs->reloc_type + && gi->addend == gs->addend) + { + gi->use_count += gs->use_count; + goto got_found; + } gi->next = hs->got_entries; hs->got_entries = gi; got_found:; @@ -2710,15 +3424,15 @@ static boolean elf64_alpha_can_merge_gots (a, b) bfd *a, *b; { - int total = alpha_elf_tdata (a)->total_got_entries; + int total = alpha_elf_tdata (a)->total_got_size; bfd *bsub; /* Trivial quick fallout test. */ - if (total + alpha_elf_tdata (b)->total_got_entries <= MAX_GOT_ENTRIES) + if (total + alpha_elf_tdata (b)->total_got_size <= MAX_GOT_SIZE) return true; /* By their nature, local .got entries cannot be merged. */ - if ((total += alpha_elf_tdata (b)->n_local_got_entries) > MAX_GOT_ENTRIES) + if ((total += alpha_elf_tdata (b)->local_got_size) > MAX_GOT_SIZE) return false; /* Failing the common trivial comparison, we must effectively @@ -2749,10 +3463,13 @@ elf64_alpha_can_merge_gots (a, b) continue; for (ae = h->got_entries; ae ; ae = ae->next) - if (ae->gotobj == a && ae->addend == be->addend) + if (ae->gotobj == a + && ae->reloc_type == be->reloc_type + && ae->addend == be->addend) goto global_found; - if (++total > MAX_GOT_ENTRIES) + total += alpha_got_entry_size (be->reloc_type); + if (total > MAX_GOT_SIZE) return false; global_found:; } @@ -2768,14 +3485,14 @@ static void elf64_alpha_merge_gots (a, b) bfd *a, *b; { - int total = alpha_elf_tdata (a)->total_got_entries; + int total = alpha_elf_tdata (a)->total_got_size; bfd *bsub; /* Remember local expansion. */ { - int e = alpha_elf_tdata (b)->n_local_got_entries; + int e = alpha_elf_tdata (b)->local_got_size; total += e; - alpha_elf_tdata (a)->n_local_got_entries += e; + alpha_elf_tdata (a)->local_got_size += e; } for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next) @@ -2825,7 +3542,9 @@ elf64_alpha_merge_gots (a, b) continue; for (ae = *start; ae ; ae = ae->next) - if (ae->gotobj == a && ae->addend == be->addend) + if (ae->gotobj == a + && ae->reloc_type == be->reloc_type + && ae->addend == be->addend) { ae->flags |= be->flags; ae->use_count += be->use_count; @@ -2833,7 +3552,7 @@ elf64_alpha_merge_gots (a, b) goto global_found; } be->gotobj = a; - total += 1; + total += alpha_got_entry_size (be->reloc_type); global_found:; } @@ -2841,7 +3560,7 @@ elf64_alpha_merge_gots (a, b) alpha_elf_tdata (bsub)->gotobj = a; } - alpha_elf_tdata (a)->total_got_entries = total; + alpha_elf_tdata (a)->total_got_size = total; /* Merge the two in_got chains. */ { @@ -2874,7 +3593,7 @@ elf64_alpha_calc_got_offsets_for_symbol (h, arg) = &alpha_elf_tdata (gotent->gotobj)->got->_raw_size; gotent->got_offset = *plge; - *plge += 8; + *plge += alpha_got_entry_size (gotent->reloc_type); } return true; @@ -2916,7 +3635,7 @@ elf64_alpha_calc_got_offsets (info) if (gotent->use_count > 0) { gotent->got_offset = got_offset; - got_offset += 8; + got_offset += alpha_got_entry_size (gotent->reloc_type); } } @@ -2928,8 +3647,7 @@ elf64_alpha_calc_got_offsets (info) /* Constructs the gots. */ static boolean -elf64_alpha_size_got_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; +elf64_alpha_size_got_sections (info) struct bfd_link_info *info; { bfd *i, *got_list, *cur_got_obj = NULL; @@ -2950,13 +3668,13 @@ elf64_alpha_size_got_sections (output_bfd, info) /* We are assuming no merging has yet ocurred. */ BFD_ASSERT (this_got == i); - if (alpha_elf_tdata (this_got)->total_got_entries > MAX_GOT_ENTRIES) + if (alpha_elf_tdata (this_got)->total_got_size > MAX_GOT_SIZE) { /* Yikes! A single object file has too many entries. */ (*_bfd_error_handler) (_("%s: .got subsegment exceeds 64K (size %d)"), bfd_archive_filename (i), - alpha_elf_tdata (this_got)->total_got_entries * 8); + alpha_elf_tdata (this_got)->total_got_size); return false; } @@ -3003,9 +3721,80 @@ elf64_alpha_size_got_sections (output_bfd, info) return true; } +/* Called from relax_section to rebuild the PLT in light of + potential changes in the function's status. */ + +static boolean +elf64_alpha_size_plt_section (info) + struct bfd_link_info *info; +{ + asection *splt, *spltrel; + unsigned long entries; + bfd *dynobj; + + dynobj = elf_hash_table(info)->dynobj; + splt = bfd_get_section_by_name(dynobj, ".plt"); + if (splt == NULL) + return true; + + splt->_raw_size = 0; + + alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), + elf64_alpha_size_plt_section_1, splt); + + splt->_cooked_size = splt->_raw_size; + + /* Every plt entry requires a JMP_SLOT relocation. */ + spltrel = bfd_get_section_by_name (dynobj, ".rela.plt"); + if (splt->_raw_size) + entries = (splt->_raw_size - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE; + else + entries = 0; + spltrel->_raw_size = entries * sizeof (Elf64_External_Rela); + spltrel->_cooked_size = spltrel->_raw_size; + + return true; +} + +static boolean +elf64_alpha_size_plt_section_1 (h, data) + struct alpha_elf_link_hash_entry *h; + PTR data; +{ + asection *splt = (asection *) data; + struct alpha_elf_got_entry *gotent; + + /* If we didn't need an entry before, we still don't. */ + if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)) + return true; + + /* There must still be a LITERAL got entry for the function. */ + for (gotent = h->got_entries; gotent ; gotent = gotent->next) + if (gotent->reloc_type == R_ALPHA_LITERAL + && gotent->use_count > 0) + break; + + /* If there is, reset the PLT offset. If not, there's no longer + a need for the PLT entry. */ + if (gotent) + { + if (splt->_raw_size == 0) + splt->_raw_size = PLT_HEADER_SIZE; + h->root.plt.offset = splt->_raw_size; + splt->_raw_size += PLT_ENTRY_SIZE; + } + else + { + h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + h->root.plt.offset = -1; + } + + return true; +} + static boolean elf64_alpha_always_size_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *i; @@ -3018,7 +3807,7 @@ elf64_alpha_always_size_sections (output_bfd, info) elf64_alpha_merge_ind_symbols, NULL); - if (!elf64_alpha_size_got_sections (output_bfd, info)) + if (!elf64_alpha_size_got_sections (info)) return false; /* Allocate space for all of the .got subsections. */ @@ -3037,6 +3826,40 @@ elf64_alpha_always_size_sections (output_bfd, info) return true; } +/* The number of dynamic relocations required by a static relocation. */ + +static int +alpha_dynamic_entries_for_reloc (r_type, dynamic, shared) + int r_type, dynamic, shared; +{ + switch (r_type) + { + /* May appear in GOT entries. */ + case R_ALPHA_TLSGD: + return (dynamic ? 2 : shared ? 1 : 0); + case R_ALPHA_TLSLDM: + return shared; + case R_ALPHA_LITERAL: + return dynamic || shared; + case R_ALPHA_GOTDTPREL: + case R_ALPHA_GOTTPREL: + return dynamic; + + /* May appear in data sections. */ + case R_ALPHA_REFLONG: + case R_ALPHA_REFQUAD: + return dynamic || shared; + case R_ALPHA_SREL64: + case R_ALPHA_TPREL64: + return dynamic; + + /* Everything else is illegal. We'll issue an error during + relocate_section. */ + default: + return 0; + } +} + /* Work out the sizes of the dynamic relocation entries. */ static boolean @@ -3044,6 +3867,10 @@ elf64_alpha_calc_dynrel_sizes (h, info) struct alpha_elf_link_hash_entry *h; struct bfd_link_info *info; { + boolean dynamic; + struct alpha_elf_reloc_entry *relent; + unsigned long entries; + if (h->root.root.type == bfd_link_hash_warning) h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; @@ -3062,51 +3889,125 @@ elf64_alpha_calc_dynrel_sizes (h, info) && (h->root.root.type == bfd_link_hash_defined || h->root.root.type == bfd_link_hash_defweak) && !(h->root.root.u.def.section->owner->flags & DYNAMIC)) - { - h->root.elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - } + h->root.elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; /* If the symbol is dynamic, we'll need all the relocations in their natural form. If this is a shared object, and it has been forced local, we'll need the same number of RELATIVE relocations. */ - if (alpha_elf_dynamic_symbol_p (&h->root, info) || info->shared) + dynamic = alpha_elf_dynamic_symbol_p (&h->root, info); + + for (relent = h->reloc_entries; relent; relent = relent->next) { - struct alpha_elf_reloc_entry *relent; - bfd *dynobj; - struct alpha_elf_got_entry *gotent; - bfd_size_type count; - asection *srel; + entries = alpha_dynamic_entries_for_reloc (relent->rtype, dynamic, + info->shared); + if (entries) + { + relent->srel->_raw_size += + entries * sizeof (Elf64_External_Rela) * relent->count; + if (relent->reltext) + info->flags |= DT_TEXTREL; + } + } - for (relent = h->reloc_entries; relent; relent = relent->next) - if (relent->rtype == R_ALPHA_REFLONG - || relent->rtype == R_ALPHA_REFQUAD) - { - relent->srel->_raw_size += - sizeof (Elf64_External_Rela) * relent->count; - if (relent->reltext) - info->flags |= DT_TEXTREL; - } + return true; +} - dynobj = elf_hash_table(info)->dynobj; - count = 0; +/* Set the sizes of the dynamic relocation sections. */ - for (gotent = h->got_entries; gotent ; gotent = gotent->next) - count++; +static boolean +elf64_alpha_size_rela_got_section (info) + struct bfd_link_info *info; +{ + unsigned long entries; + bfd *i, *dynobj; + asection *srel; - /* If we are using a .plt entry, subtract one, as the first - reference uses a .rela.plt entry instead. */ - if (h->root.plt.offset != MINUS_ONE) - count--; + /* Shared libraries often require RELATIVE relocs, and some relocs + require attention for the main application as well. */ + + entries = 0; + for (i = alpha_elf_hash_table(info)->got_list; + i ; i = alpha_elf_tdata(i)->got_link_next) + { + bfd *j; - if (count > 0) + for (j = i; j ; j = alpha_elf_tdata(j)->in_got_link_next) { - srel = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (srel != NULL); - srel->_raw_size += sizeof (Elf64_External_Rela) * count; + struct alpha_elf_got_entry **local_got_entries, *gotent; + int k, n; + + local_got_entries = alpha_elf_tdata(j)->local_got_entries; + if (!local_got_entries) + continue; + + for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k) + for (gotent = local_got_entries[k]; + gotent ; gotent = gotent->next) + if (gotent->use_count > 0) + entries += (alpha_dynamic_entries_for_reloc + (gotent->reloc_type, 0, info->shared)); } } + dynobj = elf_hash_table(info)->dynobj; + srel = bfd_get_section_by_name (dynobj, ".rela.got"); + if (!srel) + { + BFD_ASSERT (entries == 0); + return true; + } + srel->_raw_size = sizeof (Elf64_External_Rela) * entries; + + /* Now do the non-local symbols. */ + alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), + elf64_alpha_size_rela_got_1, info); + + srel->_cooked_size = srel->_raw_size; + + return true; +} + +/* Subroutine of elf64_alpha_size_rela_got_section for doing the + global symbols. */ + +static boolean +elf64_alpha_size_rela_got_1 (h, info) + struct alpha_elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + boolean dynamic; + struct alpha_elf_got_entry *gotent; + unsigned long entries; + + if (h->root.root.type == bfd_link_hash_warning) + h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; + + /* If the symbol is dynamic, we'll need all the relocations in their + natural form. If this is a shared object, and it has been forced + local, we'll need the same number of RELATIVE relocations. */ + + dynamic = alpha_elf_dynamic_symbol_p (&h->root, info); + + entries = 0; + for (gotent = h->got_entries; gotent ; gotent = gotent->next) + if (gotent->use_count > 0) + entries += alpha_dynamic_entries_for_reloc (gotent->reloc_type, + dynamic, info->shared); + + /* If we are using a .plt entry, subtract one, as the first + reference uses a .rela.plt entry instead. */ + if (h->root.plt.offset != MINUS_ONE) + entries--; + + if (entries > 0) + { + bfd *dynobj = elf_hash_table(info)->dynobj; + asection *srel = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srel != NULL); + srel->_raw_size += sizeof (Elf64_External_Rela) * entries; + } + return true; } @@ -3140,27 +4041,9 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) collected information in check_relocs that we can now apply to size the dynamic relocation sections. */ alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), - elf64_alpha_calc_dynrel_sizes, - info); - - /* When building shared libraries, each local .got entry needs a - RELATIVE reloc. */ - if (info->shared) - { - bfd *i; - asection *srel; - bfd_size_type count; - - srel = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (srel != NULL); - - for (i = alpha_elf_hash_table(info)->got_list, count = 0; - i != NULL; - i = alpha_elf_tdata(i)->got_link_next) - count += alpha_elf_tdata(i)->n_local_got_entries; + elf64_alpha_calc_dynrel_sizes, info); - srel->_raw_size += count * sizeof (Elf64_External_Rela); - } + elf64_alpha_size_rela_got_section (info); } /* else we're not dynamic and by definition we don't need such things. */ @@ -3237,12 +4120,10 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) return false; } - if (!add_dynamic_entry (DT_PLTGOT, 0)) - return false; - if (relplt) { - if (!add_dynamic_entry (DT_PLTRELSZ, 0) + if (!add_dynamic_entry (DT_PLTGOT, 0) + || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) return false; @@ -3264,6 +4145,71 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) return true; } +/* Relocate an Alpha ELF section for a relocatable link. + + We don't have to change anything unless the reloc is against a section + symbol, in which case we have to adjust according to where the section + symbol winds up in the output section. */ + +static boolean +elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd *output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents ATTRIBUTE_UNUSED; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; +{ + unsigned long symtab_hdr_sh_info; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + boolean ret_val = true; + + symtab_hdr_sh_info = elf_tdata (input_bfd)->symtab_hdr.sh_info; + + relend = relocs + input_section->reloc_count; + for (rel = relocs; rel < relend; rel++) + { + unsigned long r_symndx; + Elf_Internal_Sym *sym; + asection *sec; + unsigned long r_type; + + r_type = ELF64_R_TYPE(rel->r_info); + if (r_type >= R_ALPHA_max) + { + (*_bfd_error_handler) + (_("%s: unknown relocation type %d"), + bfd_archive_filename (input_bfd), (int)r_type); + bfd_set_error (bfd_error_bad_value); + ret_val = false; + continue; + } + + r_symndx = ELF64_R_SYM(rel->r_info); + + /* The symbol associated with GPDISP and LITUSE is + immaterial. Only the addend is significant. */ + if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE) + continue; + + if (r_symndx < symtab_hdr_sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) + { + sec = local_sections[r_symndx]; + rel->r_addend += sec->output_offset + sym->st_value; + } + } + } + + return ret_val; +} + /* Relocate an Alpha ELF section. */ static boolean @@ -3281,22 +4227,39 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - asection *sec, *sgot, *srel, *srelgot; + struct elf_link_tls_segment *tls_segment; + asection *sgot, *srel, *srelgot; bfd *dynobj, *gotobj; - bfd_vma gp; - boolean ret_val = true; + bfd_vma gp, tp_base, dtp_base; + struct alpha_elf_got_entry **local_got_entries; + boolean ret_val; + const char *section_name; + + /* Handle relocatable links with a smaller loop. */ + if (info->relocateable) + return elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, + input_section, contents, relocs, + local_syms, local_sections); + + /* This is a final link. */ + + ret_val = true; - srelgot = srel = NULL; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + dynobj = elf_hash_table (info)->dynobj; if (dynobj) - { - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - } + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + else + srelgot = NULL; + + section_name = (bfd_elf_string_from_elf_section + (input_bfd, elf_elfheader(input_bfd)->e_shstrndx, + elf_section_data(input_section)->rel_hdr.sh_name)); + BFD_ASSERT(section_name != NULL); + srel = bfd_get_section_by_name (dynobj, section_name); /* Find the gp value for this input bfd. */ - sgot = NULL; - gp = 0; gotobj = alpha_elf_tdata (input_bfd)->gotobj; if (gotobj) { @@ -3310,66 +4273,97 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, _bfd_set_gp_value (gotobj, gp); } } + else + { + sgot = NULL; + gp = 0; + } + + local_got_entries = alpha_elf_tdata(input_bfd)->local_got_entries; + + tls_segment = elf_hash_table (info)->tls_segment; + if (tls_segment) + { + dtp_base = alpha_get_dtprel_base (tls_segment); + tp_base = alpha_get_tprel_base (tls_segment); + } + else + dtp_base = tp_base = 0; - rel = relocs; relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) + for (rel = relocs; rel < relend; rel++) { - int r_type; + struct alpha_elf_link_hash_entry *h = NULL; + struct alpha_elf_got_entry *gotent; + bfd_reloc_status_type r; reloc_howto_type *howto; unsigned long r_symndx; - struct alpha_elf_link_hash_entry *h; - Elf_Internal_Sym *sym; - bfd_vma relocation; + Elf_Internal_Sym *sym = NULL; + asection *sec = NULL; + bfd_vma value; bfd_vma addend; - bfd_reloc_status_type r; + boolean dynamic_symbol_p; + boolean undef_weak_ref = false; + unsigned long r_type; r_type = ELF64_R_TYPE(rel->r_info); - if (r_type < 0 || r_type >= (int) R_ALPHA_max) + if (r_type >= R_ALPHA_max) { + (*_bfd_error_handler) + (_("%s: unknown relocation type %d"), + bfd_archive_filename (input_bfd), (int)r_type); bfd_set_error (bfd_error_bad_value); - return false; + ret_val = false; + continue; } - howto = elf64_alpha_howto_table + r_type; + howto = elf64_alpha_howto_table + r_type; r_symndx = ELF64_R_SYM(rel->r_info); - if (info->relocateable) + if (r_symndx < symtab_hdr->sh_info) { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - - /* The symbol associated with GPDISP and LITUSE is - immaterial. Only the addend is significant. */ - if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE) - continue; + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + value = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); - if (r_symndx < symtab_hdr->sh_info) + if (local_got_entries) + gotent = local_got_entries[r_symndx]; + else + gotent = NULL; + + /* Need to adjust local GOT entries' addends for SEC_MERGE + unless it has been done already. */ + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION + && (elf_section_data (sec)->sec_info_type + == ELF_INFO_TYPE_MERGE) + && gotent + && !gotent->reloc_xlated) { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) + struct alpha_elf_got_entry *ent; + asection *msec; + + for (ent = gotent; ent; ent = ent->next) { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; + ent->reloc_xlated = 1; + if (ent->use_count == 0) + continue; + msec = sec; + ent->addend = + _bfd_merged_section_offset (output_bfd, &msec, + elf_section_data (sec)-> + sec_info, + sym->st_value + ent->addend, + (bfd_vma) 0); + ent->addend -= sym->st_value; + ent->addend += msec->output_section->vma + + msec->output_offset + - sec->output_section->vma + - sec->output_offset; } } - continue; - } - - /* This is a final link. */ - - h = NULL; - sym = NULL; - sec = NULL; - - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + dynamic_symbol_p = false; } else { @@ -3379,27 +4373,32 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.root.type == bfd_link_hash_warning) h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; + value = 0; if (h->root.root.type == bfd_link_hash_defined || h->root.root.type == bfd_link_hash_defweak) { sec = h->root.root.u.def.section; - if (sec->output_section == NULL) - relocation = 0; - else - { - relocation = (h->root.root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } + /* Detect the cases that sym_sec->output_section is + expected to be NULL -- all cases in which the symbol + is defined in another shared module. This includes + PLT relocs for which we've created a PLT entry and + other relocs for which we're prepared to create + dynamic relocations. */ + /* ??? Just accept it NULL and continue. */ + + if (sec->output_section != NULL) + value = (h->root.root.u.def.value + + sec->output_section->vma + + sec->output_offset); } else if (h->root.root.type == bfd_link_hash_undefweak) - relocation = 0; + undef_weak_ref = true; else if (info->shared && (!info->symbolic || info->allow_shlib_undefined) && !info->no_undefined && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) - relocation = 0; + ; else { if (!((*info->callbacks->undefined_symbol) @@ -3407,11 +4406,24 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, input_section, rel->r_offset, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->root.other))))) - ret_val = false; - relocation = 0; + return false; + ret_val = false; + continue; } + + dynamic_symbol_p = alpha_elf_dynamic_symbol_p (&h->root, info); + gotent = h->got_entries; } + addend = rel->r_addend; + value += addend; + + /* Search for the proper got entry. */ + for (; gotent ; gotent = gotent->next) + if (gotent->gotobj == gotobj + && gotent->reloc_type == r_type + && gotent->addend == addend) + break; switch (r_type) { @@ -3421,124 +4433,66 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT(gp != 0); - relocation = (input_section->output_section->vma - + input_section->output_offset - + rel->r_offset); + value = (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); - p_ldah = contents + rel->r_offset - input_section->vma; + p_ldah = contents + rel->r_offset; p_lda = p_ldah + rel->r_addend; - r = elf64_alpha_do_reloc_gpdisp (input_bfd, gp - relocation, + r = elf64_alpha_do_reloc_gpdisp (input_bfd, gp - value, p_ldah, p_lda); } break; case R_ALPHA_LITERAL: - { - struct alpha_elf_got_entry *gotent; - boolean dynamic_symbol; - - BFD_ASSERT(sgot != NULL); - BFD_ASSERT(gp != 0); - - if (h != NULL) - { - gotent = h->got_entries; - dynamic_symbol = alpha_elf_dynamic_symbol_p (&h->root, info); - } - else - { - gotent = (alpha_elf_tdata(input_bfd)-> - local_got_entries[r_symndx]); - dynamic_symbol = false; - - /* Need to adjust local GOT entries' addends for SEC_MERGE - unless it has been done already. */ - if ((sec->flags & SEC_MERGE) - && ELF_ST_TYPE (sym->st_info) == STT_SECTION - && (elf_section_data (sec)->sec_info_type - == ELF_INFO_TYPE_MERGE) - && (gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED) == 0) - { - struct alpha_elf_got_entry *ent; - asection *msec; - - for (ent = gotent; ent; ent = ent->next) - { - ent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED; - if (ent->use_count == 0) - continue; - msec = sec; - ent->addend = - _bfd_merged_section_offset (output_bfd, &msec, - elf_section_data (sec)-> - sec_info, - sym->st_value - + ent->addend, - (bfd_vma) 0); - ent->addend -= sym->st_value; - ent->addend += msec->output_section->vma - + msec->output_offset - - sec->output_section->vma - - sec->output_offset; - } - } - } + BFD_ASSERT(sgot != NULL); + BFD_ASSERT(gp != 0); + BFD_ASSERT(gotent != NULL); + BFD_ASSERT(gotent->use_count >= 1); - BFD_ASSERT(gotent != NULL); + if (!gotent->reloc_done) + { + gotent->reloc_done = 1; - while (gotent->gotobj != gotobj || gotent->addend != addend) - gotent = gotent->next; + bfd_put_64 (output_bfd, value, + sgot->contents + gotent->got_offset); - BFD_ASSERT(gotent->use_count >= 1); + /* If the symbol has been forced local, output a + RELATIVE reloc, otherwise it will be handled in + finish_dynamic_symbol. */ + if (info->shared && !dynamic_symbol_p) + { + Elf_Internal_Rela outrel; - /* Initialize the .got entry's value. */ - if (!(gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_DONE)) - { - bfd_put_64 (output_bfd, relocation + addend, - sgot->contents + gotent->got_offset); + BFD_ASSERT(srelgot != NULL); - /* If the symbol has been forced local, output a - RELATIVE reloc, otherwise it will be handled in - finish_dynamic_symbol. */ - if (info->shared && !dynamic_symbol) - { - Elf_Internal_Rela outrel; - - BFD_ASSERT(srelgot != NULL); - - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); - outrel.r_addend = relocation + addend; - - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *) - srelgot->contents) - + srelgot->reloc_count++); - BFD_ASSERT (sizeof (Elf64_External_Rela) - * srelgot->reloc_count - <= srelgot->_cooked_size); - } + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + + gotent->got_offset); + outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE); + outrel.r_addend = value; - gotent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_DONE; - } + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + ((Elf64_External_Rela *) + srelgot->contents) + + srelgot->reloc_count++); + BFD_ASSERT (sizeof (Elf64_External_Rela) + * srelgot->reloc_count + <= srelgot->_cooked_size); + } + } - /* Figure the gprel relocation. */ - addend = 0; - relocation = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - relocation -= gp; - } - /* overflow handled by _bfd_final_link_relocate */ + value = (sgot->output_section->vma + + sgot->output_offset + + gotent->got_offset); + value -= gp; goto default_reloc; case R_ALPHA_GPREL16: case R_ALPHA_GPREL32: case R_ALPHA_GPRELLOW: - if (h && alpha_elf_dynamic_symbol_p (&h->root, info)) + if (dynamic_symbol_p) { (*_bfd_error_handler) (_("%s: gp-relative relocation against dynamic symbol %s"), @@ -3546,11 +4500,11 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, ret_val = false; } BFD_ASSERT(gp != 0); - relocation -= gp; + value -= gp; goto default_reloc; case R_ALPHA_GPRELHIGH: - if (h && alpha_elf_dynamic_symbol_p (&h->root, info)) + if (dynamic_symbol_p) { (*_bfd_error_handler) (_("%s: gp-relative relocation against dynamic symbol %s"), @@ -3558,27 +4512,34 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, ret_val = false; } BFD_ASSERT(gp != 0); - relocation -= gp; - relocation += addend; - addend = 0; - relocation = (((bfd_signed_vma) relocation >> 16) - + ((relocation >> 15) & 1)); + value -= gp; + value = ((bfd_signed_vma) value >> 16) + ((value >> 15) & 1); goto default_reloc; case R_ALPHA_HINT: /* A call to a dynamic symbol is definitely out of range of the 16-bit displacement. Don't bother writing anything. */ - if (h && alpha_elf_dynamic_symbol_p (&h->root, info)) + if (dynamic_symbol_p) { r = bfd_reloc_ok; break; } - /* FALLTHRU */ + /* The regular PC-relative stuff measures from the start of + the instruction rather than the end. */ + value -= 4; + goto default_reloc; case R_ALPHA_BRADDR: + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: pc-relative relocation against dynamic symbol %s"), + bfd_archive_filename (input_bfd), h->root.root.root.string); + ret_val = false; + } /* The regular PC-relative stuff measures from the start of the instruction rather than the end. */ - addend -= 4; + value -= 4; goto default_reloc; case R_ALPHA_BRSGP: @@ -3588,12 +4549,12 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* The regular PC-relative stuff measures from the start of the instruction rather than the end. */ - addend -= 4; + value -= 4; /* The source and destination gp must be the same. Note that the source will always have an assigned gp, since we forced one in check_relocs, but that the destination may not, as - it might not have had any relocations at all. Also take + it might not have had any relocations at all. Also take care not to crash if H is an undefined symbol. */ if (h != NULL && sec != NULL && alpha_elf_tdata (sec->owner)->gotobj @@ -3641,41 +4602,52 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, case R_ALPHA_REFLONG: case R_ALPHA_REFQUAD: + case R_ALPHA_DTPREL64: + case R_ALPHA_TPREL64: { Elf_Internal_Rela outrel; /* Careful here to remember RELATIVE relocations for global variables for symbolic shared objects. */ - if (h && alpha_elf_dynamic_symbol_p (&h->root, info)) + if (dynamic_symbol_p) { BFD_ASSERT(h->root.dynindx != -1); - outrel.r_info = ELF64_R_INFO(h->root.dynindx, r_type); + outrel.r_info = ELF64_R_INFO (h->root.dynindx, r_type); outrel.r_addend = addend; - addend = 0, relocation = 0; + addend = 0, value = 0; + } + else if (r_type == R_ALPHA_DTPREL64) + { + BFD_ASSERT(tls_segment != NULL); + value -= dtp_base; + goto default_reloc; + } + else if (r_type == R_ALPHA_TPREL64) + { + BFD_ASSERT(tls_segment != NULL); + value -= dtp_base; + goto default_reloc; } else if (info->shared && r_symndx != 0 && (input_section->flags & SEC_ALLOC)) { - outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); - outrel.r_addend = relocation + addend; + if (r_type == R_ALPHA_REFLONG) + { + (*_bfd_error_handler) + (_("%s: unhandled dynamic relocation against %s"), + bfd_archive_filename (input_bfd), + h->root.root.root.string); + ret_val = false; + } + outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE); + outrel.r_addend = value; } else goto default_reloc; - if (!srel) - { - const char *name; - - name = (bfd_elf_string_from_elf_section - (input_bfd, elf_elfheader(input_bfd)->e_shstrndx, - elf_section_data(input_section)->rel_hdr.sh_name)); - BFD_ASSERT(name != NULL); - - srel = bfd_get_section_by_name (dynobj, name); - BFD_ASSERT(srel != NULL); - } + BFD_ASSERT(srel != NULL); outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, @@ -3695,8 +4667,17 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, } goto default_reloc; + case R_ALPHA_SREL16: case R_ALPHA_SREL32: case R_ALPHA_SREL64: + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: pc-relative relocation against dynamic symbol %s"), + bfd_archive_filename (input_bfd), h->root.root.root.string); + ret_val = false; + } + /* ??? .eh_frame references to discarded sections will be smashed to relocations against SHN_UNDEF. The .eh_frame format allows NULL to be encoded as 0 in any format, so this works here. */ @@ -3705,11 +4686,134 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, + (r_type - R_ALPHA_SREL32 + R_ALPHA_REFLONG)); goto default_reloc; + case R_ALPHA_TLSLDM: + /* Ignore the symbol for the relocation. The result is always + the current module. */ + dynamic_symbol_p = 0; + /* FALLTHRU */ + + case R_ALPHA_TLSGD: + if (!gotent->reloc_done) + { + gotent->reloc_done = 1; + + /* Note that the module index for the main program is 1. */ + bfd_put_64 (output_bfd, !info->shared && !dynamic_symbol_p, + sgot->contents + gotent->got_offset); + + /* If the symbol has been forced local, output a + DTPMOD64 reloc, otherwise it will be handled in + finish_dynamic_symbol. */ + if (info->shared && !dynamic_symbol_p) + { + Elf_Internal_Rela outrel; + + BFD_ASSERT(srelgot != NULL); + + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + + gotent->got_offset); + /* ??? Proper dynindx here. */ + outrel.r_info = ELF64_R_INFO (0, R_ALPHA_DTPMOD64); + outrel.r_addend = 0; + + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + ((Elf64_External_Rela *) + srelgot->contents) + + srelgot->reloc_count++); + BFD_ASSERT (sizeof (Elf64_External_Rela) + * srelgot->reloc_count + <= srelgot->_cooked_size); + } + + if (dynamic_symbol_p || r_type == R_ALPHA_TLSLDM) + value = 0; + else + { + BFD_ASSERT(tls_segment != NULL); + value -= dtp_base; + } + bfd_put_64 (output_bfd, value, + sgot->contents + gotent->got_offset + 8); + } + + value = (sgot->output_section->vma + + sgot->output_offset + + gotent->got_offset); + value -= gp; + goto default_reloc; + + case R_ALPHA_DTPRELHI: + case R_ALPHA_DTPRELLO: + case R_ALPHA_DTPREL16: + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: dtp-relative relocation against dynamic symbol %s"), + bfd_archive_filename (input_bfd), h->root.root.root.string); + ret_val = false; + } + BFD_ASSERT(tls_segment != NULL); + value -= dtp_base; + if (r_type == R_ALPHA_DTPRELHI) + value = ((bfd_signed_vma) value >> 16) + ((value >> 15) & 1); + goto default_reloc; + + case R_ALPHA_TPRELHI: + case R_ALPHA_TPRELLO: + case R_ALPHA_TPREL16: + if (info->shared) + { + (*_bfd_error_handler) + (_("%s: TLS local exec code cannot be linked into shared objects"), + bfd_archive_filename (input_bfd)); + ret_val = false; + } + else if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: tp-relative relocation against dynamic symbol %s"), + bfd_archive_filename (input_bfd), h->root.root.root.string); + ret_val = false; + } + BFD_ASSERT(tls_segment != NULL); + value -= tp_base; + if (r_type == R_ALPHA_TPRELHI) + value = ((bfd_signed_vma) value >> 16) + ((value >> 15) & 1); + goto default_reloc; + + case R_ALPHA_GOTDTPREL: + case R_ALPHA_GOTTPREL: + BFD_ASSERT(sgot != NULL); + BFD_ASSERT(gp != 0); + BFD_ASSERT(gotent != NULL); + BFD_ASSERT(gotent->use_count >= 1); + + if (!gotent->reloc_done) + { + gotent->reloc_done = 1; + + if (dynamic_symbol_p) + value = 0; + else + { + BFD_ASSERT(tls_segment != NULL); + value -= (r_type == R_ALPHA_GOTDTPREL ? dtp_base : tp_base); + } + bfd_put_64 (output_bfd, value, + sgot->contents + gotent->got_offset); + } + + value = (sgot->output_section->vma + + sgot->output_offset + + gotent->got_offset); + value -= gp; + goto default_reloc; + default: default_reloc: r = _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, relocation, - addend); + contents, rel->r_offset, value, 0); break; } @@ -3881,20 +4985,58 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) srel = bfd_get_section_by_name (dynobj, ".rela.got"); BFD_ASSERT (srel != NULL); - outrel.r_info = ELF64_R_INFO (h->dynindx, R_ALPHA_GLOB_DAT); for (gotent = ((struct alpha_elf_link_hash_entry *) h)->got_entries; gotent != NULL; gotent = gotent->next) { - asection *sgot = alpha_elf_tdata (gotent->gotobj)->got; + asection *sgot; + int r_type; + + if (gotent->use_count == 0) + continue; + + sgot = alpha_elf_tdata (gotent->gotobj)->got; outrel.r_offset = (sgot->output_section->vma + sgot->output_offset + gotent->got_offset); + + r_type = gotent->reloc_type; + switch (r_type) + { + case R_ALPHA_LITERAL: + r_type = R_ALPHA_GLOB_DAT; + break; + case R_ALPHA_TLSGD: + r_type = R_ALPHA_DTPMOD64; + break; + case R_ALPHA_GOTDTPREL: + r_type = R_ALPHA_DTPREL64; + break; + case R_ALPHA_GOTTPREL: + r_type = R_ALPHA_TPREL64; + break; + case R_ALPHA_TLSLDM: + default: + abort (); + } + + outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); outrel.r_addend = gotent->addend; bfd_elf64_swap_reloca_out (output_bfd, &outrel, ((Elf64_External_Rela *)srel->contents + srel->reloc_count++)); + + if (gotent->reloc_type == R_ALPHA_TLSGD) + { + outrel.r_offset += 8; + outrel.r_info = ELF64_R_INFO (h->dynindx, R_ALPHA_DTPREL64); + + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + ((Elf64_External_Rela *)srel->contents + + srel->reloc_count++)); + } + BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count <= srel->_cooked_size); } @@ -4355,6 +5497,7 @@ const struct elf_size_info alpha_elf_size_info = bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out, bfd_elf64_slurp_reloc_table, bfd_elf64_slurp_symbol_table, diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index c6ea4f4..aef822a 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -184,7 +184,7 @@ static boolean elf64_hppa_object_p PARAMS ((bfd *)); static boolean elf64_hppa_section_from_shdr - PARAMS ((bfd *, Elf64_Internal_Shdr *, char *)); + PARAMS ((bfd *, Elf64_Internal_Shdr *, const char *)); static void elf64_hppa_post_process_headers PARAMS ((bfd *, struct bfd_link_info *)); @@ -195,6 +195,9 @@ static boolean elf64_hppa_create_dynamic_sections static boolean elf64_hppa_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static boolean elf64_hppa_mark_milli_and_exported_functions + PARAMS ((struct elf_link_hash_entry *, PTR)); + static boolean elf64_hppa_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -210,6 +213,9 @@ static int elf64_hppa_additional_program_headers PARAMS ((bfd *)); static boolean elf64_hppa_modify_segment_map PARAMS ((bfd *)); +static enum elf_reloc_type_class elf64_hppa_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); + static boolean elf64_hppa_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -403,7 +409,7 @@ static boolean elf64_hppa_section_from_shdr (abfd, hdr, name) bfd *abfd; Elf64_Internal_Shdr *hdr; - char *name; + const char *name; { asection *newsect; @@ -585,7 +591,6 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs) struct elf64_hppa_link_hash_table *hppa_info; const Elf_Internal_Rela *relend; Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; const Elf_Internal_Rela *rel; asection *dlt, *plt, *stubs; char *buf; @@ -607,15 +612,14 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* If necessary, build a new table holding section symbols indices - for this BFD. This is disgusting. */ + for this BFD. */ if (info->shared && hppa_info->section_syms_bfd != abfd) { unsigned long i; unsigned int highest_shndx; - Elf_Internal_Sym *local_syms, *isym; - Elf64_External_Sym *ext_syms, *esym; - Elf_External_Sym_Shndx *shndx_buf, *shndx; + Elf_Internal_Sym *local_syms = NULL; + Elf_Internal_Sym *isym, *isymend; bfd_size_type amt; /* We're done with the old cache of section index to section symbol @@ -626,71 +630,27 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs) if (hppa_info->section_syms) free (hppa_info->section_syms); - /* Allocate memory for the internal and external symbols. */ - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_Internal_Sym); - local_syms = (Elf_Internal_Sym *) bfd_malloc (amt); - if (local_syms == NULL) - return false; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf64_External_Sym); - ext_syms = (Elf64_External_Sym *) bfd_malloc (amt); - if (ext_syms == NULL) + /* Read this BFD's local symbols. */ + if (symtab_hdr->sh_info != 0) { - free (local_syms); - return false; - } - - /* Read in the local symbols. */ - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (ext_syms, amt, abfd) != amt) - { - free (ext_syms); - free (local_syms); - return false; - } - - shndx_buf = NULL; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - { - free (ext_syms); - free (local_syms); - return false; - } - - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (shndx_buf, amt, abfd) != amt) - { - free (shndx_buf); - free (ext_syms); - free (local_syms); - return false; - } + local_syms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (local_syms == NULL) + local_syms = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (local_syms == NULL) + return false; } - /* Swap in the local symbols, also record the highest section index - referenced by the local symbols. */ + /* Record the highest section index referenced by the local symbols. */ highest_shndx = 0; - for (i = 0, isym = local_syms, esym = ext_syms, shndx = shndx_buf; - i < symtab_hdr->sh_info; - i++, esym++, isym++, shndx = (shndx != NULL ? shndx + 1 : NULL)) + isymend = local_syms + symtab_hdr->sh_info; + for (isym = local_syms; isym < isymend; isym++) { - bfd_elf64_swap_symbol_in (abfd, esym, shndx, isym); if (isym->st_shndx > highest_shndx) highest_shndx = isym->st_shndx; } - /* Now we can free the external symbols. */ - free (shndx_buf); - free (ext_syms); - /* Allocate an array to hold the section index to section symbol index mapping. Bump by one since we start counting at zero. */ highest_shndx++; @@ -700,14 +660,24 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs) /* Now walk the local symbols again. If we find a section symbol, record the index of the symbol into the section_syms array. */ - for (isym = local_syms, i = 0; i < symtab_hdr->sh_info; i++, isym++) + for (i = 0, isym = local_syms; isym < isymend; i++, isym++) { if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) hppa_info->section_syms[isym->st_shndx] = i; } - /* We are finished with the local symbols. Get rid of them. */ - free (local_syms); + /* We are finished with the local symbols. */ + if (local_syms != NULL + && symtab_hdr->contents != (unsigned char *) local_syms) + { + if (! info->keep_memory) + free (local_syms); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) local_syms; + } + } /* Record which BFD we built the section_syms mapping for. */ hppa_info->section_syms_bfd = abfd; @@ -1072,7 +1042,7 @@ allocate_global_data_dlt (dyn_h, data) table since we might need to create a dynamic relocation against it. */ if (! h - || (h && h->dynindx == -1)) + || (h->dynindx == -1 && h->type != STT_PARISC_MILLI)) { bfd *owner; owner = (h ? h->root.u.def.section->owner : dyn_h->owner); @@ -1158,7 +1128,8 @@ allocate_global_data_opd (dyn_h, data) /* We never need an opd entry for a symbol which is not defined by this output file. */ - if (h && h->root.type == bfd_link_hash_undefined) + if (h && (h->root.type == bfd_link_hash_undefined + || h->root.u.def.section->output_section == NULL)) dyn_h->want_opd = 0; /* If we are creating a shared library, took the address of a local @@ -1166,10 +1137,9 @@ allocate_global_data_opd (dyn_h, data) we have to create an opd descriptor. */ else if (x->info->shared || h == NULL - || h->dynindx == -1 - || ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && h->root.u.def.section->output_section != NULL)) + || (h->dynindx == -1 && h->type != STT_PARISC_MILLI) + || (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)) { /* If we are creating a shared library, then we will have to create a runtime relocation for the symbol to properly @@ -1531,22 +1501,18 @@ allocate_dynrel_entries (dyn_h, data) for (rent = dyn_h->reloc_entries; rent; rent = rent->next) { - switch (rent->type) - { - case R_PARISC_FPTR64: - /* Allocate one iff we are not building a shared library and - !want_opd, which by this point will be true only if we're - actually allocating one statically in the main executable. */ - if (!x->info->shared && dyn_h->want_opd) - continue; - break; - } + /* Allocate one iff we are building a shared library, the relocation + isn't a R_PARISC_FPTR64, or we don't want an opd entry. */ + if (!shared && rent->type == R_PARISC_FPTR64 && dyn_h->want_opd) + continue; + hppa_info->other_rel_sec->_raw_size += sizeof (Elf64_External_Rela); /* Make sure this symbol gets into the dynamic symbol table if it is not already recorded. ?!? This should not be in the loop since the symbol need only be added once. */ - if (dyn_h->h == 0 || dyn_h->h->dynindx == -1) + if (dyn_h->h == 0 + || (dyn_h->h->dynindx == -1 && dyn_h->h->type != STT_PARISC_MILLI)) if (!_bfd_elf64_link_record_local_dynamic_symbol (x->info, rent->sec->owner, dyn_h->sym_indx)) return false; @@ -1614,6 +1580,36 @@ elf64_hppa_adjust_dynamic_symbol (info, h) return true; } +/* This function is called via elf_link_hash_traverse to mark millicode + symbols with a dynindx of -1 and to remove the string table reference + from the dynamic symbol table. If the symbol is not a millicode symbol, + elf64_hppa_mark_exported_functions is called. */ + +static boolean +elf64_hppa_mark_milli_and_exported_functions (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf_link_hash_entry *elf = h; + + if (elf->root.type == bfd_link_hash_warning) + elf = (struct elf_link_hash_entry *) elf->root.u.i.link; + + if (elf->type == STT_PARISC_MILLI) + { + if (elf->dynindx != -1) + { + elf->dynindx = -1; + _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, + elf->dynstr_index); + } + return true; + } + + return elf64_hppa_mark_exported_functions (h, data); +} + /* Set the final sizes of the dynamic sections and allocate memory for the contents of our special sections. */ @@ -1635,6 +1631,19 @@ elf64_hppa_size_dynamic_sections (output_bfd, info) dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); + /* Mark each function this program exports so that we will allocate + space in the .opd section for each function's FPTR. If we are + creating dynamic sections, change the dynamic index of millicode + symbols to -1 and remove them from the string table for .dynstr. + + We have to traverse the main linker hash table since we have to + find functions which may not have been mentioned in any relocs. */ + elf_link_hash_traverse (elf_hash_table (info), + (elf_hash_table (info)->dynamic_sections_created + ? elf64_hppa_mark_milli_and_exported_functions + : elf64_hppa_mark_exported_functions), + info); + if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ @@ -1679,15 +1688,6 @@ elf64_hppa_size_dynamic_sections (output_bfd, info) hppa_info->stub_sec->_raw_size = data.ofs; } - /* Mark each function this program exports so that we will allocate - space in the .opd section for each function's FPTR. - - We have to traverse the main linker hash table since we have to - find functions which may not have been mentioned in any relocs. */ - elf_link_hash_traverse (elf_hash_table (info), - elf64_hppa_mark_exported_functions, - info); - /* Allocate space for entries in the .opd section. */ if (elf64_hppa_hash_table (info)->opd_sec) { @@ -1722,10 +1722,9 @@ elf64_hppa_size_dynamic_sections (output_bfd, info) if (strcmp (name, ".plt") == 0) { + /* Strip this section if we don't need it; see the comment below. */ if (s->_raw_size == 0) { - /* Strip this section if we don't need it; see the - comment below. */ strip = true; } else @@ -1736,24 +1735,29 @@ elf64_hppa_size_dynamic_sections (output_bfd, info) } else if (strcmp (name, ".dlt") == 0) { + /* Strip this section if we don't need it; see the comment below. */ if (s->_raw_size == 0) { - /* Strip this section if we don't need it; see the - comment below. */ strip = true; } } else if (strcmp (name, ".opd") == 0) { + /* Strip this section if we don't need it; see the comment below. */ if (s->_raw_size == 0) { - /* Strip this section if we don't need it; see the - comment below. */ strip = true; } } - else if (strncmp (name, ".rela", 4) == 0) + else if (strncmp (name, ".rela", 5) == 0) { + /* If we don't need this section, strip it from the output file. + This is mostly to handle .rela.bss and .rela.plt. We must + create both sections in create_dynamic_sections, because they + must be created before the linker maps input sections to output + sections. The linker does that before adjust_dynamic_symbol + is called, and it is that function which decides whether + anything needs to go into these sections. */ if (s->_raw_size == 0) { /* If we don't need this section, strip it from the @@ -1951,9 +1955,6 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) spltrel = hppa_info->plt_rel_sec; sdltrel = hppa_info->dlt_rel_sec; - BFD_ASSERT (stub != NULL && splt != NULL - && sopd != NULL && sdlt != NULL) - /* Incredible. It is actually necessary to NOT use the symbol's real value when building the dynamic symbol table for a shared library. At least for symbols that refer to functions. @@ -1963,6 +1964,8 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) the original values (in elf64_hppa_link_output_symbol_hook). */ if (dyn_h && dyn_h->want_opd) { + BFD_ASSERT (sopd != NULL) + /* Save away the original value and section index so that we can restore them later. */ dyn_h->st_value = sym->st_value; @@ -1984,6 +1987,8 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_vma value; Elf_Internal_Rela rel; + BFD_ASSERT (splt != NULL && spltrel != NULL) + /* We do not actually care about the value in the PLT entry if we are creating a shared library and the symbol is still undefined, we create a dynamic relocation to fill @@ -2034,6 +2039,8 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) int insn; unsigned int max_offset; + BFD_ASSERT (stub != NULL) + /* Install the generic stub template. We are modifying the contents of the stub section, so we do not @@ -2096,11 +2103,6 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) stub->contents + dyn_h->stub_offset + 8); } - /* Millicode symbols should not be put in the dynamic - symbol table under any circumstances. */ - if (ELF_ST_TYPE (sym->st_info) == STT_PARISC_MILLI) - h->dynindx = -1; - return true; } @@ -2114,7 +2116,7 @@ elf64_hppa_finalize_opd (dyn_h, data) { struct bfd_link_info *info = (struct bfd_link_info *)data; struct elf64_hppa_link_hash_table *hppa_info; - struct elf_link_hash_entry *h = dyn_h->h; + struct elf_link_hash_entry *h = dyn_h ? dyn_h->h : NULL; asection *sopd; asection *sopdrel; @@ -2122,7 +2124,7 @@ elf64_hppa_finalize_opd (dyn_h, data) sopd = hppa_info->opd_sec; sopdrel = hppa_info->opd_rel_sec; - if (h && dyn_h && dyn_h->want_opd) + if (h && dyn_h->want_opd) { bfd_vma value; @@ -2235,7 +2237,7 @@ elf64_hppa_finalize_dlt (dyn_h, data) struct bfd_link_info *info = (struct bfd_link_info *)data; struct elf64_hppa_link_hash_table *hppa_info; asection *sdlt, *sdltrel; - struct elf_link_hash_entry *h = dyn_h->h; + struct elf_link_hash_entry *h = dyn_h ? dyn_h->h : NULL; hppa_info = elf64_hppa_hash_table (info); @@ -2246,7 +2248,7 @@ elf64_hppa_finalize_dlt (dyn_h, data) address, so there is no need to create a relocation. Just install the proper value into the DLT, note this shortcut can not be skipped when building a shared library. */ - if (! info->shared && h && dyn_h && dyn_h->want_dlt) + if (! info->shared && h && dyn_h->want_dlt) { bfd_vma value; @@ -2262,16 +2264,17 @@ elf64_hppa_finalize_dlt (dyn_h, data) + hppa_info->opd_sec->output_offset + hppa_info->opd_sec->output_section->vma); } - else + else if (h->root.u.def.section) { - value = (h->root.u.def.value - + h->root.u.def.section->output_offset); - + value = h->root.u.def.value + h->root.u.def.section->output_offset; if (h->root.u.def.section->output_section) value += h->root.u.def.section->output_section->vma; else value += h->root.u.def.section->vma; } + else + /* We have an undefined function reference. */ + value = 0; /* We do not need to include the output offset of the DLT section here because we are modifying the in-memory contents. */ @@ -2356,16 +2359,10 @@ elf64_hppa_finalize_dynreloc (dyn_h, data) { Elf64_Internal_Rela rel; - switch (rent->type) - { - case R_PARISC_FPTR64: - /* Allocate one iff we are not building a shared library and - !want_opd, which by this point will be true only if we're - actually allocating one statically in the main executable. */ - if (!info->shared && dyn_h->want_opd) - continue; - break; - } + /* Allocate one iff we are building a shared library, the relocation + isn't a R_PARISC_FPTR64, or we don't want an opd entry. */ + if (!info->shared && rent->type == R_PARISC_FPTR64 && dyn_h->want_opd) + continue; /* Create a dynamic relocation for this entry. @@ -2394,7 +2391,7 @@ elf64_hppa_finalize_dynreloc (dyn_h, data) We use a section symbol recorded by check_relocs as the base symbol for the relocation. The addend is the difference between the section symbol and the address of the .opd entry. */ - if (info->shared && rent->type == R_PARISC_FPTR64) + if (info->shared && rent->type == R_PARISC_FPTR64 && dyn_h->want_opd) { bfd_vma value, value2; @@ -2439,6 +2436,27 @@ elf64_hppa_finalize_dynreloc (dyn_h, data) return true; } +/* Used to decide how to sort relocs in an optimal manner for the + dynamic linker, before writing them out. */ + +static enum elf_reloc_type_class +elf64_hppa_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + if (ELF64_R_SYM (rela->r_info) == 0) + return reloc_class_relative; + + switch ((int) ELF64_R_TYPE (rela->r_info)) + { + case R_PARISC_IPLT: + return reloc_class_plt; + case R_PARISC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + /* Finish up the dynamic sections. */ static boolean @@ -2522,8 +2540,10 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info) case DT_RELA: s = hppa_info->other_rel_sec; - if (! s) + if (! s || ! s->_raw_size) s = hppa_info->dlt_rel_sec; + if (! s || ! s->_raw_size) + s = hppa_info->opd_rel_sec; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); break; @@ -2673,6 +2693,7 @@ const struct elf_size_info hppa64_elf_size_info = bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out, bfd_elf64_slurp_reloc_table, bfd_elf64_slurp_symbol_table, @@ -2703,7 +2724,7 @@ const struct elf_size_info hppa64_elf_size_info = #define elf_backend_fake_sections elf_hppa_fake_sections #define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook -#define elf_backend_relocate_section elf_hppa_relocate_section +#define elf_backend_relocate_section elf_hppa_relocate_section #define bfd_elf64_bfd_final_link elf_hppa_final_link @@ -2748,6 +2769,8 @@ const struct elf_size_info hppa64_elf_size_info = #define elf_backend_plt_header_size 0 #define elf_backend_type_change_ok true #define elf_backend_get_symbol_type elf64_hppa_elf_get_symbol_type +#define elf_backend_reloc_type_class elf64_hppa_reloc_type_class +#define elf_backend_rela_normal 1 #include "elf64-target.h" diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 508c0ee..00c312c 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -34,8 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ . generally untested. . - Relocation handling for RELA relocs related to GOT support are . also likely to be wrong. - . - Support for MIPS16 is only partially implemented. - . - Embedded PIC is only partially implemented (is it needed?). + . - Support for MIPS16 is untested. . - Combined relocs with RSS_* entries are unsupported. . - The whole GOT handling for NewABI is missing, some parts of . the OldABI version is still lying around and should be removed. @@ -102,14 +101,8 @@ static void mips_elf64_write_rela PARAMS((bfd *, asection *, Elf_Internal_Shdr *, int *, PTR)); static bfd_reloc_status_type mips_elf64_hi16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_higher_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_highest_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips_elf64_gprel16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static bfd_reloc_status_type mips_elf64_gprel16_reloca - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips_elf64_literal_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips_elf64_gprel32_reloc @@ -118,22 +111,18 @@ static bfd_reloc_status_type mips_elf64_shift6_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type mips_elf64_got16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips16_jump_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips16_gprel_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static boolean mips_elf64_assign_gp PARAMS ((bfd *, bfd_vma *)); static bfd_reloc_status_type mips_elf64_final_gp PARAMS ((bfd *, asymbol *, boolean, char **, bfd_vma *)); static boolean mips_elf64_object_p PARAMS ((bfd *)); static irix_compat_t elf64_mips_irix_compat PARAMS ((bfd *)); -extern const bfd_target bfd_elf64_tradbigmips_vec; -extern const bfd_target bfd_elf64_tradlittlemips_vec; - -static bfd_vma prev_reloc_addend = 0; -static bfd_size_type prev_reloc_address = 0; - -/* Whether we are trying to be compatible with IRIX6 (or little endianers - which are otherwise IRIX-ABI compliant). */ -#define SGI_COMPAT(abfd) \ - (elf64_mips_irix_compat (abfd) != ict_none) +extern const bfd_target bfd_elf64_bigmips_vec; +extern const bfd_target bfd_elf64_littlemips_vec; /* In case we're on a 32-bit machine, construct a 64-bit "-1" value from smaller values. Start with zero, widen, *then* decrement. */ @@ -144,8 +133,6 @@ static bfd_size_type prev_reloc_address = 0; /* The relocation table used for SHT_REL sections. */ -#define UNUSED_RELOC(num) { num, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - static reloc_howto_type mips_elf64_howto_table_rel[] = { /* No relocation. */ @@ -226,6 +213,9 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0x03ffffff, /* dst_mask */ false), /* pcrel_offset */ + /* R_MIPS_HI16 and R_MIPS_LO16 are unsupported for NewABI REL. + However, the native IRIX6 tools use them, so we try our best. */ + /* High 16 bits of symbol value. */ HOWTO (R_MIPS_HI16, /* type */ 0, /* rightshift */ @@ -234,7 +224,7 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf64_hi16_reloc, /* special_function */ "R_MIPS_HI16", /* name */ true, /* partial_inplace */ 0x0000ffff, /* src_mask */ @@ -317,7 +307,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = true), /* pcrel_offset */ /* 16 bit call through global offset table. */ - /* FIXME: This is not handled correctly. */ HOWTO (R_MIPS_CALL16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -347,9 +336,9 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - UNUSED_RELOC (13), - UNUSED_RELOC (14), - UNUSED_RELOC (15), + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), /* A 5 bit shift field. */ HOWTO (R_MIPS_SHIFT5, /* type */ @@ -397,7 +386,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* Displacement in the global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_DISP, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -413,7 +401,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* Displacement to page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_PAGE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -429,7 +416,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* Offset from page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_OFST, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -445,7 +431,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_HI16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -461,7 +446,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_LO16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -477,7 +461,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* 64 bit substraction. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_SUB, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ @@ -541,38 +524,16 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - /* Get the higher value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHER, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_elf64_higher_reloc, /* special_function */ - "R_MIPS_HIGHER", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Get the highest value of a 64 bit addend. */ - HOWTO (R_MIPS_HIGHEST, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - mips_elf64_highest_reloc, /* special_function */ - "R_MIPS_HIGHEST", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ + /* The MIPS ELF64 ABI Draft wants us to support these for REL relocations. + We don't, because + a) It means building the addend from a R_MIPS_HIGHEST/R_MIPS_HIGHER/ + R_MIPS_HI16/R_MIPS_LO16 sequence with varying ordering, using + fallable heuristics. + b) No other NewABI toolchain actually emits such relocations. */ + EMPTY_HOWTO (R_MIPS_HIGHER), + EMPTY_HOWTO (R_MIPS_HIGHEST), /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_CALL_HI16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -588,7 +549,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_CALL_LO16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -604,7 +564,6 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = false), /* pcrel_offset */ /* Section displacement, used by an associated event location section. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_SCN_DISP, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -752,7 +711,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0x03ffffff, /* dst_mask */ false), /* pcrel_offset */ - /* R_MIPS_HI16 and R_MIPS_LO16 are unsupported for 64 bit REL. */ /* High 16 bits of symbol value. */ HOWTO (R_MIPS_HI16, /* type */ 0, /* rightshift */ @@ -791,7 +749,7 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - mips_elf64_gprel16_reloca, /* special_function */ + mips_elf64_gprel16_reloc, /* special_function */ "R_MIPS_GPREL16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ @@ -814,7 +772,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* Reference to global offset table. */ - /* FIXME: This is not handled correctly. */ HOWTO (R_MIPS_GOT16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -822,7 +779,7 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ + mips_elf64_got16_reloc, /* special_function */ "R_MIPS_GOT16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ @@ -845,7 +802,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = true), /* pcrel_offset */ /* 16 bit call through global offset table. */ - /* FIXME: This is not handled correctly. */ HOWTO (R_MIPS_CALL16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -875,9 +831,9 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - UNUSED_RELOC (13), - UNUSED_RELOC (14), - UNUSED_RELOC (15), + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), /* A 5 bit shift field. */ HOWTO (R_MIPS_SHIFT5, /* type */ @@ -925,7 +881,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* Displacement in the global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_DISP, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -941,7 +896,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* Displacement to page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_PAGE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -957,7 +911,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* Offset from page pointer in the global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_OFST, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -973,7 +926,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_HI16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -989,7 +941,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_LO16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1005,7 +956,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* 64 bit substraction. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_SUB, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1100,7 +1050,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* High 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_CALL_HI16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1116,7 +1065,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* Low 16 bits of displacement in global offset table. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_CALL_LO16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1132,7 +1080,6 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = false), /* pcrel_offset */ /* Section displacement, used by an associated event location section. */ - /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_SCN_DISP, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -1197,6 +1144,73 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0x00000000, /* dst_mask */ false), /* pcrel_offset */ }; + +/* The reloc used for the mips16 jump instruction. */ +static reloc_howto_type elf_mips16_jump_howto = + HOWTO (R_MIPS16_26, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + /* This needs complex overflow + detection, because the upper four + bits must match the PC. */ + mips16_jump_reloc, /* special_function */ + "R_MIPS16_26", /* name */ + true, /* partial_inplace */ + 0x3ffffff, /* src_mask */ + 0x3ffffff, /* dst_mask */ + false); /* pcrel_offset */ + +/* The reloc used for the mips16 gprel instruction. */ +static reloc_howto_type elf_mips16_gprel_howto = + HOWTO (R_MIPS16_GPREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips16_gprel_reloc, /* special_function */ + "R_MIPS16_GPREL", /* name */ + true, /* partial_inplace */ + 0x07ff001f, /* src_mask */ + 0x07ff001f, /* dst_mask */ + false); /* pcrel_offset */ + +/* GNU extension to record C++ vtable hierarchy */ +static reloc_howto_type elf_mips_gnu_vtinherit_howto = + HOWTO (R_MIPS_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_MIPS_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false); /* pcrel_offset */ + +/* GNU extension to record C++ vtable member usage */ +static reloc_howto_type elf_mips_gnu_vtentry_howto = + HOWTO (R_MIPS_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_MIPS_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false); /* pcrel_offset */ /* Swap in a MIPS 64-bit Rel reloc. */ @@ -1365,14 +1379,9 @@ mips_elf64_be_swap_reloca_out (abfd, src, dst) /* Do a R_MIPS_HI16 relocation. */ -bfd_reloc_status_type -mips_elf64_hi16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +static bfd_reloc_status_type +mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry; asymbol *symbol; @@ -1398,78 +1407,6 @@ mips_elf64_hi16_reloc (abfd, return bfd_reloc_continue; } -/* Do a R_MIPS_HIGHER relocation. */ - -bfd_reloc_status_type -mips_elf64_higher_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - /* If we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (((reloc_entry->addend & 0xffffffff) + 0x80008000) - & ~0xffffffff) - reloc_entry->addend += 0x80008000; - - return bfd_reloc_continue; -} - -/* Do a R_MIPS_HIGHEST relocation. */ - -bfd_reloc_status_type -mips_elf64_highest_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - /* If we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - if (((reloc_entry->addend & 0xffffffffffff) + 0x800080008000) - & ~0xffffffffffff) - reloc_entry->addend += 0x800080008000; - - return bfd_reloc_continue; -} - /* Do a R_MIPS_GOT16 reloc. This is a reloc against the global offset table used for PIC code. If the symbol is an external symbol, the instruction is modified to contain the offset of the appropriate @@ -1484,14 +1421,9 @@ mips_elf64_highest_reloc (abfd, This implementation suffices for the assembler, but the linker does not yet know how to create global offset tables. */ -bfd_reloc_status_type -mips_elf64_got16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +static bfd_reloc_status_type +mips_elf64_got16_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; @@ -1500,24 +1432,17 @@ mips_elf64_got16_reloc (abfd, bfd *output_bfd; char **error_message; { - /* If we're relocating, and this an external symbol, we don't want - to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - /* If we're relocating, and this is a local symbol, we can handle it - just like HI16. */ + just like an R_MIPS_HI16. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) != 0) return mips_elf64_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); - abort (); + + /* Otherwise we try to handle it as R_MIPS_GOT_DISP. */ + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); } /* Set the GP value for OUTPUT_BFD. Returns false if this is a @@ -1548,7 +1473,7 @@ mips_elf64_assign_gp (output_bfd, pgp) { for (i = 0; i < count; i++, sym++) { - register CONST char *name; + register const char *name; name = bfd_asymbol_name (*sym); if (*name == '_' && strcmp (name, "_gp") == 0) @@ -1617,7 +1542,7 @@ mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, pgp) /* Do a R_MIPS_GPREL16 relocation. This is a 16 bit value which must become the offset from the gp register. */ -bfd_reloc_status_type +static bfd_reloc_status_type mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) bfd *abfd; @@ -1638,7 +1563,8 @@ mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, file. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (! reloc_entry->howto->partial_inplace + || reloc_entry->addend == 0)) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; @@ -1662,37 +1588,35 @@ mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, data, gp); } -/* Do a R_MIPS_GPREL16 RELA relocation. */ +/* Do a R_MIPS_LITERAL relocation. */ -bfd_reloc_status_type -mips_elf64_gprel16_reloca (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) +static bfd_reloc_status_type +mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; + PTR data; asection *input_section; bfd *output_bfd; char **error_message; { boolean relocateable; + bfd_reloc_status_type ret; bfd_vma gp; - /* This works only for NewABI. */ - BFD_ASSERT (reloc_entry->howto->src_mask == 0); - - /* If we're relocating, and this is an external symbol with no - addend, we don't want to change anything. We will only have an - addend if this is a newly created reloc, not read from an ELF - file. */ + /* If we're relocating, and this is an external symbol, we don't + want to change anything. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 - && reloc_entry->addend == 0) + && (! reloc_entry->howto->partial_inplace + || reloc_entry->addend == 0)) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } + /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */ if (output_bfd != (bfd *) NULL) relocateable = true; else @@ -1701,25 +1625,21 @@ mips_elf64_gprel16_reloca (abfd, reloc_entry, symbol, data, input_section, output_bfd = symbol->section->output_section->owner; } - if (prev_reloc_address != reloc_entry->address) - prev_reloc_address = reloc_entry->address; - else - { - mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, - &gp); - prev_reloc_addend = reloc_entry->addend + reloc_entry->address - gp; - if (symbol->flags & BSF_LOCAL) - prev_reloc_addend += _bfd_get_gp_value (abfd); -/*fprintf(stderr, "Addend: %lx, Next Addend: %lx\n", reloc_entry->addend, prev_reloc_addend);*/ - } + ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, + &gp); + if (ret != bfd_reloc_ok) + return ret; - return bfd_reloc_ok; + return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, + input_section, relocateable, + data, gp); } -/* Do a R_MIPS_LITERAL relocation. */ +/* Do a R_MIPS_GPREL32 relocation. This is a 32 bit value which must + become the offset from the gp register. */ -bfd_reloc_status_type -mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, +static bfd_reloc_status_type +mips_elf64_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) bfd *abfd; arelent *reloc_entry; @@ -1729,42 +1649,6 @@ mips_elf64_literal_reloc (abfd, reloc_entry, symbol, data, input_section, bfd *output_bfd; char **error_message; { - /* If we're relocating, and this is an external symbol, we don't - want to change anything. */ - if (output_bfd != (bfd *) NULL - && (symbol->flags & BSF_SECTION_SYM) == 0 - && (! reloc_entry->howto->partial_inplace - || reloc_entry->addend == 0)) - { - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; - } - - /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. - Currently we simply call mips_elf64_gprel16_reloc. */ - return mips_elf64_gprel16_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); -} - -/* Do a R_MIPS_GPREL32 relocation. Is this 32 bit value the offset - from the gp register? XXX */ - -bfd_reloc_status_type -mips_elf64_gprel32_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; -{ boolean relocateable; bfd_reloc_status_type ret; bfd_vma gp; @@ -1838,9 +1722,9 @@ mips_elf64_gprel32_reloc (abfd, } /* Do a R_MIPS_SHIFT6 relocation. The MSB of the shift is stored at bit 2, - the rest is at bits 6-10. The bitpos alredy got right by the howto. */ + the rest is at bits 6-10. The bitpos already got right by the howto. */ -bfd_reloc_status_type +static bfd_reloc_status_type mips_elf64_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; @@ -1868,6 +1752,164 @@ mips_elf64_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } +/* Handle a mips16 jump. */ + +static bfd_reloc_status_type +mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (! reloc_entry->howto->partial_inplace + || reloc_entry->addend == 0)) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + /* FIXME. */ + { + static boolean warned; + + if (! warned) + (*_bfd_error_handler) + (_("Linking mips16 objects into %s format is not supported"), + bfd_get_target (input_section->output_section->owner)); + warned = true; + } + + return bfd_reloc_undefined; +} + +/* Handle a mips16 GP relative reloc. */ + +static bfd_reloc_status_type +mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + boolean relocateable; + bfd_reloc_status_type ret; + bfd_vma gp; + unsigned short extend, insn; + unsigned long final; + + /* If we're relocating, and this is an external symbol with no + addend, we don't want to change anything. We will only have an + addend if this is a newly created reloc, not read from an ELF + file. */ + if (output_bfd != NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && reloc_entry->addend == 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (output_bfd != NULL) + relocateable = true; + else + { + relocateable = false; + output_bfd = symbol->section->output_section->owner; + } + + ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, + &gp); + if (ret != bfd_reloc_ok) + return ret; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + /* Pick up the mips16 extend instruction and the real instruction. */ + extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); + insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); + + /* Stuff the current addend back as a 32 bit value, do the usual + relocation, and then clean up. */ + bfd_put_32 (abfd, + (bfd_vma) (((extend & 0x1f) << 11) + | (extend & 0x7e0) + | (insn & 0x1f)), + (bfd_byte *) data + reloc_entry->address); + + ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, + input_section, relocateable, data, gp); + + final = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + bfd_put_16 (abfd, + (bfd_vma) ((extend & 0xf800) + | ((final >> 11) & 0x1f) + | (final & 0x7e0)), + (bfd_byte *) data + reloc_entry->address); + bfd_put_16 (abfd, + (bfd_vma) ((insn & 0xffe0) + | (final & 0x1f)), + (bfd_byte *) data + reloc_entry->address + 2); + + return ret; +} + +/* A mapping from BFD reloc types to MIPS ELF reloc types. */ + +struct elf_reloc_map { + bfd_reloc_code_real_type bfd_val; + enum elf_mips_reloc_type elf_val; +}; + +static const struct elf_reloc_map mips_reloc_map[] = +{ + { BFD_RELOC_NONE, R_MIPS_NONE }, + { BFD_RELOC_16, R_MIPS_16 }, + { BFD_RELOC_32, R_MIPS_32 }, + /* There is no BFD reloc for R_MIPS_REL32. */ + { BFD_RELOC_64, R_MIPS_64 }, + { BFD_RELOC_CTOR, R_MIPS_64 }, + { BFD_RELOC_16_PCREL, R_MIPS_PC16 }, + { BFD_RELOC_HI16_S, R_MIPS_HI16 }, + { BFD_RELOC_LO16, R_MIPS_LO16 }, + { BFD_RELOC_GPREL16, R_MIPS_GPREL16 }, + { BFD_RELOC_GPREL32, R_MIPS_GPREL32 }, + { BFD_RELOC_MIPS_JMP, R_MIPS_26 }, + { BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL }, + { BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 }, + { BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 }, + { BFD_RELOC_MIPS_SHIFT5, R_MIPS_SHIFT5 }, + { BFD_RELOC_MIPS_SHIFT6, R_MIPS_SHIFT6 }, + { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }, + { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE }, + { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST }, + { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 }, + { BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 }, + { BFD_RELOC_MIPS_SUB, R_MIPS_SUB }, + { BFD_RELOC_MIPS_INSERT_A, R_MIPS_INSERT_A }, + { BFD_RELOC_MIPS_INSERT_B, R_MIPS_INSERT_B }, + { BFD_RELOC_MIPS_DELETE, R_MIPS_DELETE }, + { BFD_RELOC_MIPS_HIGHEST, R_MIPS_HIGHEST }, + { BFD_RELOC_MIPS_HIGHER, R_MIPS_HIGHER }, + { BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 }, + { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }, + { BFD_RELOC_MIPS_SCN_DISP, R_MIPS_SCN_DISP }, + { BFD_RELOC_MIPS_REL16, R_MIPS_REL16 }, + /* Use of R_MIPS_ADD_IMMEDIATE and R_MIPS_PJUMP is deprecated. */ + { BFD_RELOC_MIPS_RELGOT, R_MIPS_RELGOT }, + { BFD_RELOC_MIPS_JALR, R_MIPS_JALR } +}; + /* Given a BFD reloc type, return a howto structure. */ static reloc_howto_type * @@ -1875,79 +1917,20 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { + unsigned int i; /* FIXME: We default to RELA here instead of choosing the right relocation variant. */ reloc_howto_type *howto_table = mips_elf64_howto_table_rela; + for (i = 0; i < sizeof (mips_reloc_map) / sizeof (struct elf_reloc_map); + i++) + { + if (mips_reloc_map[i].bfd_val == code) + return &howto_table[(int) mips_reloc_map[i].elf_val]; + } + switch (code) { - case BFD_RELOC_NONE: - return &howto_table[R_MIPS_NONE]; - case BFD_RELOC_16: - return &howto_table[R_MIPS_16]; - case BFD_RELOC_32: - return &howto_table[R_MIPS_32]; - case BFD_RELOC_64: - case BFD_RELOC_CTOR: - return &howto_table[R_MIPS_64]; - case BFD_RELOC_16_PCREL: - return &howto_table[R_MIPS_PC16]; - case BFD_RELOC_HI16_S: - return &howto_table[R_MIPS_HI16]; - case BFD_RELOC_LO16: - return &howto_table[R_MIPS_LO16]; - case BFD_RELOC_GPREL16: - return &howto_table[R_MIPS_GPREL16]; - case BFD_RELOC_GPREL32: - return &howto_table[R_MIPS_GPREL32]; - case BFD_RELOC_MIPS_JMP: - return &howto_table[R_MIPS_26]; - case BFD_RELOC_MIPS_LITERAL: - return &howto_table[R_MIPS_LITERAL]; - case BFD_RELOC_MIPS_GOT16: - return &howto_table[R_MIPS_GOT16]; - case BFD_RELOC_MIPS_CALL16: - return &howto_table[R_MIPS_CALL16]; - case BFD_RELOC_MIPS_SHIFT5: - return &howto_table[R_MIPS_SHIFT5]; - case BFD_RELOC_MIPS_SHIFT6: - return &howto_table[R_MIPS_SHIFT6]; - case BFD_RELOC_MIPS_GOT_DISP: - return &howto_table[R_MIPS_GOT_DISP]; - case BFD_RELOC_MIPS_GOT_PAGE: - return &howto_table[R_MIPS_GOT_PAGE]; - case BFD_RELOC_MIPS_GOT_OFST: - return &howto_table[R_MIPS_GOT_OFST]; - case BFD_RELOC_MIPS_GOT_HI16: - return &howto_table[R_MIPS_GOT_HI16]; - case BFD_RELOC_MIPS_GOT_LO16: - return &howto_table[R_MIPS_GOT_LO16]; - case BFD_RELOC_MIPS_SUB: - return &howto_table[R_MIPS_SUB]; - case BFD_RELOC_MIPS_INSERT_A: - return &howto_table[R_MIPS_INSERT_A]; - case BFD_RELOC_MIPS_INSERT_B: - return &howto_table[R_MIPS_INSERT_B]; - case BFD_RELOC_MIPS_DELETE: - return &howto_table[R_MIPS_DELETE]; - case BFD_RELOC_MIPS_HIGHEST: - return &howto_table[R_MIPS_HIGHEST]; - case BFD_RELOC_MIPS_HIGHER: - return &howto_table[R_MIPS_HIGHER]; - case BFD_RELOC_MIPS_CALL_HI16: - return &howto_table[R_MIPS_CALL_HI16]; - case BFD_RELOC_MIPS_CALL_LO16: - return &howto_table[R_MIPS_CALL_LO16]; - case BFD_RELOC_MIPS_SCN_DISP: - return &howto_table[R_MIPS_SCN_DISP]; - case BFD_RELOC_MIPS_REL16: - return &howto_table[R_MIPS_REL16]; - /* Use of R_MIPS_ADD_IMMEDIATE and R_MIPS_PJUMP is deprecated. */ - case BFD_RELOC_MIPS_RELGOT: - return &howto_table[R_MIPS_RELGOT]; - case BFD_RELOC_MIPS_JALR: - return &howto_table[R_MIPS_JALR]; -/* case BFD_RELOC_MIPS16_JMP: return &elf_mips16_jump_howto; case BFD_RELOC_MIPS16_GPREL: @@ -1956,17 +1939,6 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code) return &elf_mips_gnu_vtinherit_howto; case BFD_RELOC_VTABLE_ENTRY: return &elf_mips_gnu_vtentry_howto; - case BFD_RELOC_PCREL_HI16_S: - return &elf_mips_gnu_rel_hi16; - case BFD_RELOC_PCREL_LO16: - return &elf_mips_gnu_rel_lo16; - case BFD_RELOC_16_PCREL_S2: - return &elf_mips_gnu_rel16_s2; - case BFD_RELOC_64_PCREL: - return &elf_mips_gnu_pcrel64; - case BFD_RELOC_32_PCREL: - return &elf_mips_gnu_pcrel32; -*/ default: bfd_set_error (bfd_error_bad_value); return NULL; @@ -1982,36 +1954,14 @@ mips_elf64_rtype_to_howto (r_type, rela_p) { switch (r_type) { -/* case R_MIPS16_26: return &elf_mips16_jump_howto; - break; case R_MIPS16_GPREL: return &elf_mips16_gprel_howto; - break; case R_MIPS_GNU_VTINHERIT: return &elf_mips_gnu_vtinherit_howto; - break; case R_MIPS_GNU_VTENTRY: return &elf_mips_gnu_vtentry_howto; - break; - case R_MIPS_GNU_REL_HI16: - return &elf_mips_gnu_rel_hi16; - break; - case R_MIPS_GNU_REL_LO16: - return &elf_mips_gnu_rel_lo16; - break; - case R_MIPS_GNU_REL16_S2: - return &elf_mips_gnu_rel16_s2; - break; - case R_MIPS_PC64: - return &elf_mips_gnu_pcrel64; - break; - case R_MIPS_PC32: - return &elf_mips_gnu_pcrel32; - break; -*/ - default: BFD_ASSERT (r_type < (unsigned int) R_MIPS_max); if (rela_p) @@ -2579,7 +2529,7 @@ mips_elf64_object_p (abfd) /* Irix 6 is broken. Object file symbol tables are not always sorted correctly such that local symbols precede global symbols, and the sh_info field in the symbol table is not always right. */ - if (SGI_COMPAT(abfd)) + if (elf64_mips_irix_compat (abfd) != ict_none) elf_bad_symtab (abfd) = true; mach = _bfd_elf_mips_mach (elf_elfheader (abfd)->e_flags); @@ -2593,11 +2543,11 @@ static irix_compat_t elf64_mips_irix_compat (abfd) bfd *abfd; { - if ((abfd->xvec == &bfd_elf64_tradbigmips_vec) - || (abfd->xvec == &bfd_elf64_tradlittlemips_vec)) - return ict_none; - else + if ((abfd->xvec == &bfd_elf64_bigmips_vec) + || (abfd->xvec == &bfd_elf64_littlemips_vec)) return ict_irix6; + else + return ict_none; } /* ECOFF swapping routines. These are used when dealing with the @@ -2666,6 +2616,7 @@ const struct elf_size_info mips_elf64_size_info = bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, mips_elf64_write_relocs, + bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out, mips_elf64_slurp_reloc_table, bfd_elf64_slurp_symbol_table, @@ -2680,6 +2631,9 @@ const struct elf_size_info mips_elf64_size_info = #define ELF_ARCH bfd_arch_mips #define ELF_MACHINE_CODE EM_MIPS +/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses + a value of 0x1000, and we are compatible. + FIXME: How does this affect NewABI? */ #define ELF_MAXPAGESIZE 0x1000 #define elf_backend_collect true @@ -2719,6 +2673,8 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook #define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook #define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol +#define elf_backend_ignore_discarded_relocs \ + _bfd_mips_elf_ignore_discarded_relocs #define elf_backend_mips_irix_compat elf64_mips_irix_compat #define elf_backend_mips_rtype_to_howto mips_elf64_rtype_to_howto #define elf_backend_ecoff_debug_swap &mips_elf64_ecoff_debug_swap @@ -2733,6 +2689,10 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_may_use_rela_p 1 #define elf_backend_default_use_rela_p 1 +#define elf_backend_ignore_discarded_relocs \ + _bfd_mips_elf_ignore_discarded_relocs +#define elf_backend_write_section _bfd_mips_elf_write_section + /* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit MIPS-specific function only applies to IRIX5, which had no 64-bit ABI. */ diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 96146ed..8b76f34 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -148,7 +148,7 @@ static boolean mmix_elf_relocate_section Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static asection * mmix_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean mmix_elf_gc_sweep_hook @@ -943,7 +943,7 @@ mmix_elf_perform_relocation (isec, howto, datap, addr, value) value += addr; break; } - /* FALLTHROUGH. */ + /* FALLTHROUGH. */ case R_MMIX_ADDR19: case R_MMIX_ADDR27: /* These must be in range, or else we emit an error. */ @@ -1524,8 +1524,8 @@ mmix_final_link_relocate (howto, input_section, contents, relocation. */ static asection * -mmix_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +mmix_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -1555,9 +1555,7 @@ mmix_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -2226,8 +2224,12 @@ bpo_reloc_request_sort_fn (p1, p2) if (r1->value != r2->value) return r1->value > r2->value ? 1 : -1; - /* As a last re-sort, use the address so we get a stable sort. */ - return r1 > r2 ? 1 : (r1 < r2 ? -1 : 0); + /* As a last re-sort, use the relocation number, so we get a stable + sort. The *addresses* aren't stable since items are swapped during + sorting. It depends on the qsort implementation if this actually + happens. */ + return r1->bpo_reloc_no > r2->bpo_reloc_no + ? 1 : (r1->bpo_reloc_no < r2->bpo_reloc_no ? -1 : 0); } /* For debug use only. Dumps the global register allocations resulting @@ -2303,9 +2305,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again) boolean *again; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; asection *bpo_gregs_section = NULL; struct bpo_greg_section_info *gregdata; @@ -2314,9 +2314,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again) elf_section_data (sec)->tdata; size_t bpono; bfd *bpo_greg_owner; - Elf64_External_Sym *extsyms = NULL; - Elf64_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* Assume nothing changes. */ *again = false; @@ -2339,7 +2337,6 @@ mmix_elf_relax_section (abfd, sec, link_info, again) return true; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; bpo_greg_owner = (bfd *) link_info->base_file; bpo_gregs_section = bpodata->bpo_greg_section; @@ -2355,8 +2352,6 @@ mmix_elf_relax_section (abfd, sec, link_info, again) link_info->keep_memory); if (internal_relocs == NULL) goto error_return; - if (! link_info->keep_memory) - free_relocs = internal_relocs; /* Walk through them looking for relaxing opportunities. */ irelend = internal_relocs + sec->reloc_count; @@ -2367,69 +2362,35 @@ mmix_elf_relax_section (abfd, sec, link_info, again) if (ELF64_R_TYPE (irel->r_info) != (int) R_MMIX_BASE_PLUS_OFFSET) continue; - /* Read this BFD's symbols if we haven't done so already. */ - if (extsyms == NULL) - { - /* Get cached copy if it exists. */ - if (symtab_hdr->contents != NULL) - extsyms = (Elf64_External_Sym *) symtab_hdr->contents; - else - { - /* Go get them off disk. */ - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf64_External_Sym); - extsyms = (Elf64_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extsyms, amt, abfd) != amt) - goto error_return; - symtab_hdr->contents = (bfd_byte *) extsyms; - } - - /* If >64k sections, this presumable happens. No test-case. */ - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_return; - shndx_hdr->contents = (bfd_byte *) shndx_buf; - } - } - /* Get the value of the symbol referred to by the reloc. */ if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) { /* A local symbol. */ - Elf64_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym isym; + Elf_Internal_Sym *isym; asection *sym_sec; - esym = extsyms + ELF64_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf - ? ELF64_R_SYM (irel->r_info) : 0); - bfd_elf64_swap_symbol_in (abfd, esym, shndx, &isym); + /* Read this BFD's local symbols if we haven't already. */ + if (isymbuf == NULL) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == 0) + goto error_return; + } - if (isym.st_shndx == SHN_UNDEF) + isym = isymbuf + ELF64_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) sym_sec = bfd_und_section_ptr; - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) sym_sec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; else - sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx); - symval = (isym.st_value + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + symval = (isym->st_value + sym_sec->output_section->vma + sym_sec->output_offset); } @@ -2526,40 +2487,29 @@ mmix_elf_relax_section (abfd, sec, link_info, again) bpo_gregs_section->_cooked_size = (regindex + 1) * 8; } - if (free_relocs != NULL) - free (free_relocs); - - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - - if (free_extsyms != NULL) + if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents) { if (! link_info->keep_memory) + free (isymbuf); + else { - symtab_hdr->contents = NULL; - free (free_extsyms); + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } } + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); + return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (shndx_buf != NULL) - { - shndx_hdr->contents = NULL; - free (shndx_buf); - } - if (free_extsyms != NULL) - { - symtab_hdr->contents = NULL; - free (free_extsyms); - } - + if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents) + free (isymbuf); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return false; } diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index b703ab6..d9f8626 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -30,9 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/ppc.h" #include "elf64-ppc.h" -#define USE_RELA /* we want RELA relocations, not REL. */ - - static void ppc_howto_init PARAMS ((void)); static reloc_howto_type *ppc64_elf_reloc_type_lookup @@ -55,12 +52,10 @@ static bfd_reloc_status_type ppc64_elf_toc64_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type ppc64_elf_unhandled_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static boolean ppc64_elf_set_private_flags - PARAMS ((bfd *, flagword)); +static boolean ppc64_elf_object_p + PARAMS ((bfd *)); static boolean ppc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean ppc64_elf_section_from_shdr - PARAMS ((bfd *, Elf64_Internal_Shdr *, char *)); /* The name of the dynamic interpreter. This is put in the .interp @@ -106,7 +101,7 @@ static boolean ppc64_elf_section_from_shdr #define CROR_151515 0x4def7b82 #define CROR_313131 0x4ffffb82 -/* .glink entries for the first 32k functions are two instructions. */ +/* .glink entries for the first 32k functions are two instructions. */ #define LI_R0_0 0x38000000 /* li %r0,0 */ #define B_DOT 0x48000000 /* b . */ @@ -123,12 +118,13 @@ static boolean ppc64_elf_section_from_shdr /* Since .opd is an array of descriptors and each entry will end up with identical R_PPC64_RELATIVE relocs, there is really no need to propagate .opd relocs; The dynamic linker should be taught to - relocate .opd without reloc entries. FIXME: .opd should be trimmed - of unused values. */ + relocate .opd without reloc entries. */ #ifndef NO_OPD_RELOCS #define NO_OPD_RELOCS 0 #endif +#define ONES(n) (((bfd_vma) 1 << ((n) - 1) << 1) - 1) + /* Relocation HOWTO's. */ static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC_max]; @@ -136,11 +132,11 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { /* This reloc does nothing. */ HOWTO (R_PPC64_NONE, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_NONE", /* name */ false, /* partial_inplace */ @@ -176,7 +172,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_ADDR24", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0x03fffffc, /* dst_mask */ false), /* pcrel_offset */ /* A standard 16 bit relocation. */ @@ -253,7 +249,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_ADDR14", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xfffc, /* dst_mask */ + 0x0000fffc, /* dst_mask */ false), /* pcrel_offset */ /* An absolute 16 bit branch, for which bit 10 should be set to @@ -270,7 +266,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_ADDR14_BRTAKEN",/* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xfffc, /* dst_mask */ + 0x0000fffc, /* dst_mask */ false), /* pcrel_offset */ /* An absolute 16 bit branch, for which bit 10 should be set to @@ -287,7 +283,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_ADDR14_BRNTAKEN",/* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xfffc, /* dst_mask */ + 0x0000fffc, /* dst_mask */ false), /* pcrel_offset */ /* A relative 26 bit branch; the lower two bits must be zero. */ @@ -302,7 +298,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_REL24", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0x03fffffc, /* dst_mask */ true), /* pcrel_offset */ /* A relative 16 bit branch; the lower two bits must be zero. */ @@ -317,7 +313,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_REL14", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xfffc, /* dst_mask */ + 0x0000fffc, /* dst_mask */ true), /* pcrel_offset */ /* A relative 16 bit branch. Bit 10 should be set to indicate that @@ -334,7 +330,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_REL14_BRTAKEN", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xfffc, /* dst_mask */ + 0x0000fffc, /* dst_mask */ true), /* pcrel_offset */ /* A relative 16 bit branch. Bit 10 should be set to indicate that @@ -351,7 +347,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_REL14_BRNTAKEN",/* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xfffc, /* dst_mask */ + 0x0000fffc, /* dst_mask */ true), /* pcrel_offset */ /* Like R_PPC64_ADDR16, but referring to the GOT table entry for the @@ -425,12 +421,12 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { run has to have the data at some particular address. */ HOWTO (R_PPC64_COPY, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ + 0, /* this one is variable size */ + 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - ppc64_elf_unhandled_reloc, /* special_function */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_COPY", /* name */ false, /* partial_inplace */ 0, /* src_mask */ @@ -450,7 +446,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_GLOB_DAT", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xffffffffffffffff, /* dst_mask */ + ONES (64), /* dst_mask */ false), /* pcrel_offset */ /* Created by the link editor. Marks a procedure linkage table @@ -483,7 +479,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_RELATIVE", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xffffffffffffffff, /* dst_mask */ + ONES (64), /* dst_mask */ false), /* pcrel_offset */ /* Like R_PPC64_ADDR32, but may be unaligned. */ @@ -523,7 +519,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 32, /* bitsize */ true, /* pc_relative */ 0, /* bitpos */ - /* FIXME: Verify. Was complain_overflow_bitfield. */ + /* FIXME: Verify. Was complain_overflow_bitfield. */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_REL32", /* name */ @@ -544,7 +540,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_PLT32", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0, /* dst_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* 32-bit PC relative relocation to the symbol's procedure linkage table. @@ -560,7 +556,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_PLTREL32", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0, /* dst_mask */ + 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ /* Like R_PPC64_ADDR16_LO, but referring to the PLT table entry for @@ -701,7 +697,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_ADDR64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xffffffffffffffff, /* dst_mask */ + ONES (64), /* dst_mask */ false), /* pcrel_offset */ /* The bits 32-47 of an address. */ @@ -778,7 +774,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_UADDR64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xffffffffffffffff, /* dst_mask */ + ONES (64), /* dst_mask */ false), /* pcrel_offset */ /* 64-bit relative relocation. */ @@ -793,10 +789,10 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_REL64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xffffffffffffffff, /* dst_mask */ + ONES (64), /* dst_mask */ true), /* pcrel_offset */ - /* 64-bit relocation to the symbol's procedure linkage table. */ + /* 64-bit relocation to the symbol's procedure linkage table. */ HOWTO (R_PPC64_PLT64, /* type */ 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ @@ -808,7 +804,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_PLT64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0, /* dst_mask */ + ONES (64), /* dst_mask */ false), /* pcrel_offset */ /* 64-bit PC relative relocation to the symbol's procedure linkage @@ -825,7 +821,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_PLTREL64", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0, /* dst_mask */ + ONES (64), /* dst_mask */ true), /* pcrel_offset */ /* 16 bit TOC-relative relocation. */ @@ -912,7 +908,7 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { "R_PPC64_TOC", /* name */ false, /* partial_inplace */ 0, /* src_mask */ - 0xffffffffffffffff, /* dst_mask */ + ONES (64), /* dst_mask */ false), /* pcrel_offset */ /* Like R_PPC64_GOT16, but also informs the link editor that the @@ -1386,7 +1382,7 @@ ppc64_elf_ha_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); /* Adjust the addend for sign extension of the low 16 bits. @@ -1417,7 +1413,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); octets = reloc_entry->address * bfd_octets_per_byte (abfd); @@ -1426,7 +1422,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, r_type = (enum elf_ppc_reloc_type) reloc_entry->howto->type; if (r_type == R_PPC64_ADDR14_BRTAKEN || r_type == R_PPC64_REL14_BRTAKEN) - insn |= 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */ + insn |= 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */ if (is_power4) { @@ -1478,7 +1474,7 @@ ppc64_elf_sectoff_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); /* Subtract the symbol section base address. */ @@ -1501,7 +1497,7 @@ ppc64_elf_sectoff_ha_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); /* Subtract the symbol section base address. */ @@ -1529,7 +1525,7 @@ ppc64_elf_toc_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); TOCstart = _bfd_get_gp_value (input_section->output_section->owner); @@ -1558,7 +1554,7 @@ ppc64_elf_toc_ha_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); TOCstart = _bfd_get_gp_value (input_section->output_section->owner); @@ -1591,7 +1587,7 @@ ppc64_elf_toc64_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); TOCstart = _bfd_get_gp_value (input_section->output_section->owner); @@ -1618,7 +1614,7 @@ ppc64_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, call the generic function. Any adjustment will be done at final link time. */ if (output_bfd != NULL) - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); if (error_message != NULL) @@ -1631,32 +1627,35 @@ ppc64_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, return bfd_reloc_dangerous; } -/* Function to set whether a module needs the -mrelocatable bit set. */ +/* Fix bad default arch selected for a 64 bit input bfd when the + default is 32 bit. */ static boolean -ppc64_elf_set_private_flags (abfd, flags) +ppc64_elf_object_p (abfd) bfd *abfd; - flagword flags; { - BFD_ASSERT (!elf_flags_init (abfd) - || elf_elfheader (abfd)->e_flags == flags); + if (abfd->arch_info->the_default && abfd->arch_info->bits_per_word == 32) + { + Elf_Internal_Ehdr *i_ehdr = elf_elfheader (abfd); - elf_elfheader (abfd)->e_flags = flags; - elf_flags_init (abfd) = true; + if (i_ehdr->e_ident[EI_CLASS] == ELFCLASS64) + { + /* Relies on arch after 32 bit default being 64 bit default. */ + abfd->arch_info = abfd->arch_info->next; + BFD_ASSERT (abfd->arch_info->bits_per_word == 64); + } + } return true; } /* Merge backend specific data from an object file to the output object file when linking. */ + static boolean ppc64_elf_merge_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; { - flagword old_flags; - flagword new_flags; - boolean error; - /* Check if we have the same endianess. */ if (ibfd->xvec->byteorder != obfd->xvec->byteorder && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) @@ -1674,106 +1673,6 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd) return false; } - if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour - || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; - - new_flags = elf_elfheader (ibfd)->e_flags; - old_flags = elf_elfheader (obfd)->e_flags; - if (!elf_flags_init (obfd)) - { - /* First call, no flags set. */ - elf_flags_init (obfd) = true; - elf_elfheader (obfd)->e_flags = new_flags; - } - - else if (new_flags == old_flags) - /* Compatible flags are ok. */ - ; - - else - { - /* Incompatible flags. Warn about -mrelocatable mismatch. - Allow -mrelocatable-lib to be linked with either. */ - error = false; - if ((new_flags & EF_PPC_RELOCATABLE) != 0 - && (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0) - { - error = true; - (*_bfd_error_handler) - (_("%s: compiled with -mrelocatable and linked with modules compiled normally"), - bfd_archive_filename (ibfd)); - } - else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 - && (old_flags & EF_PPC_RELOCATABLE) != 0) - { - error = true; - (*_bfd_error_handler) - (_("%s: compiled normally and linked with modules compiled with -mrelocatable"), - bfd_archive_filename (ibfd)); - } - - /* The output is -mrelocatable-lib iff both the input files are. */ - if (! (new_flags & EF_PPC_RELOCATABLE_LIB)) - elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB; - - /* The output is -mrelocatable iff it can't be -mrelocatable-lib, - but each input file is either -mrelocatable or -mrelocatable-lib. */ - if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB) - && (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)) - && (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))) - elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE; - - /* Do not warn about eabi vs. V.4 mismatch, just or in the bit - if any module uses it. */ - elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB); - - new_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); - old_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); - - /* Warn about any other mismatches. */ - if (new_flags != old_flags) - { - error = true; - (*_bfd_error_handler) - (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), - bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); - } - - if (error) - { - bfd_set_error (bfd_error_bad_value); - return false; - } - } - - return true; -} - -/* Handle a PowerPC specific section when reading an object file. This - is called when elfcode.h finds a section with an unknown type. */ - -static boolean -ppc64_elf_section_from_shdr (abfd, hdr, name) - bfd *abfd; - Elf64_Internal_Shdr *hdr; - char *name; -{ - asection *newsect; - flagword flags; - - if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; - - newsect = hdr->bfd_section; - flags = bfd_get_section_flags (abfd, newsect); - if (hdr->sh_flags & SHF_EXCLUDE) - flags |= SEC_EXCLUDE; - - if (hdr->sh_type == SHT_ORDERED) - flags |= SEC_SORT_ENTRIES; - - bfd_set_section_flags (abfd, newsect, flags); return true; } @@ -1964,6 +1863,7 @@ struct ppc_link_hash_entry /* Flag function code and descriptor symbols. */ unsigned int is_func:1; unsigned int is_func_descriptor:1; + unsigned int is_entry:1; }; /* ppc64 ELF linker hash table. */ @@ -1995,10 +1895,8 @@ struct ppc_link_hash_table } *stub_group; /* Assorted information used by ppc64_elf_size_stubs. */ - unsigned int bfd_count; int top_index; asection **input_list; - Elf_Internal_Sym **all_local_syms; /* Short-cuts to get to dynamic linker sections. */ asection *sgot; @@ -2054,16 +1952,17 @@ static boolean create_got_section static boolean ppc64_elf_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static void ppc64_elf_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean ppc64_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection * ppc64_elf_gc_mark_hook - PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Rela *rel, - struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean ppc64_elf_gc_sweep_hook - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, - const Elf_Internal_Rela *relocs)); + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static boolean func_desc_adjust PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean ppc64_elf_func_desc_adjust @@ -2072,6 +1971,8 @@ static boolean ppc64_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static void ppc64_elf_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); +static boolean edit_opd + PARAMS ((bfd *, struct bfd_link_info *)); static boolean allocate_dynrelocs PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean readonly_dynrelocs @@ -2091,10 +1992,6 @@ static boolean ppc_size_one_stub PARAMS ((struct bfd_hash_entry *, PTR)); static void group_sections PARAMS ((struct ppc_link_hash_table *, bfd_size_type, boolean)); -static boolean get_local_syms - PARAMS ((bfd *, struct ppc_link_hash_table *)); -static boolean ppc64_elf_fake_sections - PARAMS ((bfd *, Elf64_Internal_Shdr *, asection *)); static boolean ppc64_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *info, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, @@ -2215,6 +2112,7 @@ link_hash_newfunc (entry, table, string) eh->oh = NULL; eh->is_func = 0; eh->is_func_descriptor = 0; + eh->is_entry = 0; } return entry; @@ -2395,16 +2293,18 @@ ppc_add_stub (stub_name, section, htab) stub_sec = htab->stub_group[link_sec->id].stub_sec; if (stub_sec == NULL) { + size_t namelen; bfd_size_type len; char *s_name; - len = strlen (link_sec->name) + sizeof (STUB_SUFFIX); + namelen = strlen (link_sec->name); + len = namelen + sizeof (STUB_SUFFIX); s_name = bfd_alloc (htab->stub_bfd, len); if (s_name == NULL) return NULL; - strcpy (s_name, link_sec->name); - strcpy (s_name + len - sizeof (STUB_SUFFIX), STUB_SUFFIX); + memcpy (s_name, link_sec->name, namelen); + memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX)); stub_sec = (*htab->add_stub_section) (s_name, link_sec); if (stub_sec == NULL) return NULL; @@ -2471,7 +2371,7 @@ create_linkage_sections (dynobj, info) { flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->srelbrlt = bfd_make_section (dynobj, ".rela.branch_lt"); + htab->srelbrlt = bfd_make_section_anyway (dynobj, ".rela.branch_lt"); if (!htab->srelbrlt || ! bfd_set_section_flags (dynobj, htab->srelbrlt, flags) || ! bfd_set_section_alignment (dynobj, htab->srelbrlt, 3)) @@ -2541,7 +2441,8 @@ ppc64_elf_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -ppc64_elf_copy_indirect_symbol (dir, ind) +ppc64_elf_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct ppc_link_hash_entry *edir, *eind; @@ -2585,8 +2486,31 @@ ppc64_elf_copy_indirect_symbol (dir, ind) edir->is_func |= eind->is_func; edir->is_func_descriptor |= eind->is_func_descriptor; + edir->is_entry |= eind->is_entry; + + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + +/* Set a flag, used by ppc64_elf_gc_mark_hook, on the entry symbol and + symbols undefined on the command-line. */ + +boolean +ppc64_elf_mark_entry_syms (info) + struct bfd_link_info *info; +{ + struct ppc_link_hash_table *htab; + struct bfd_sym_chain *sym; - _bfd_elf_link_hash_copy_indirect (dir, ind); + htab = ppc_hash_table (info); + for (sym = info->gc_sym_list; sym; sym = sym->next) + { + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (&htab->elf, sym->name, false, false, false); + if (h != NULL) + ((struct ppc_link_hash_entry *) h)->is_entry = 1; + } + return true; } /* Look through the relocs for a section during the first phase, and @@ -2606,7 +2530,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; - boolean is_opd; + asection **opd_sym_map; if (info->relocateable) return true; @@ -2616,12 +2540,34 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) sym_hashes = elf_sym_hashes (abfd); sym_hashes_end = (sym_hashes - + symtab_hdr->sh_size / sizeof (Elf64_External_Sym)); - if (!elf_bad_symtab (abfd)) - sym_hashes_end -= symtab_hdr->sh_info; + + symtab_hdr->sh_size / sizeof (Elf64_External_Sym) + - symtab_hdr->sh_info); sreloc = NULL; - is_opd = strcmp (bfd_get_section_name (abfd, sec), ".opd") == 0; + opd_sym_map = NULL; + if (strcmp (bfd_get_section_name (abfd, sec), ".opd") == 0) + { + /* Garbage collection needs some extra help with .opd sections. + We don't want to necessarily keep everything referenced by + relocs in .opd, as that would keep all functions. Instead, + if we reference an .opd symbol (a function descriptor), we + want to keep the function code symbol's section. This is + easy for global symbols, but for local syms we need to keep + information about the associated function section. Later, if + edit_opd deletes entries, we'll use this array to adjust + local syms in .opd. */ + union opd_info { + asection *func_section; + long entry_adjust; + }; + bfd_size_type amt; + + amt = sec->_raw_size * sizeof (union opd_info) / 24; + opd_sym_map = (asection **) bfd_zalloc (abfd, amt); + if (opd_sym_map == NULL) + return false; + elf_section_data (sec)->tdata = opd_sym_map; + } if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; @@ -2690,14 +2636,14 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_PLT32: case R_PPC64_PLT64: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code without - linking in any dynamic objects, in which case we don't - need to generate a procedure linkage table after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ if (h == NULL) { /* It does not make sense to have a procedure linkage - table entry for a local symbol. */ + table entry for a local symbol. */ bfd_set_error (bfd_error_bad_value); return false; } @@ -2758,7 +2704,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) break; case R_PPC64_ADDR64: - if (is_opd + if (opd_sym_map != NULL && h != NULL && h->root.root.string[0] == '.' && h->root.root.string[1] != 0) @@ -2775,6 +2721,21 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) ((struct ppc_link_hash_entry *) h)->oh = fdh; } } + if (opd_sym_map != NULL + && h == NULL + && rel + 1 < rel_end + && ((enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info) + == R_PPC64_TOC)) + { + asection *s; + + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, + r_symndx); + if (s == NULL) + return false; + else if (s != sec) + opd_sym_map[rel->r_offset / 24] = s; + } /* Fall through. */ case R_PPC64_REL64: @@ -2800,7 +2761,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_UADDR64: case R_PPC64_TOC: /* Don't propagate .opd relocs. */ - if (NO_OPD_RELOCS && is_opd) + if (NO_OPD_RELOCS && opd_sym_map != NULL) break; /* If we are creating a shared library, and this is a reloc @@ -2941,16 +2902,19 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -ppc64_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; { + asection *rsec = NULL; + if (h != NULL) { enum elf_ppc_reloc_type r_type; + struct ppc_link_hash_entry *fdh; r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); switch (r_type) @@ -2964,10 +2928,26 @@ ppc64_elf_gc_mark_hook (abfd, info, rel, h, sym) { case bfd_link_hash_defined: case bfd_link_hash_defweak: - return h->root.u.def.section; + fdh = (struct ppc_link_hash_entry *) h; + + /* Function descriptor syms cause the associated + function code sym section to be marked. */ + if (fdh->is_func_descriptor) + rsec = fdh->oh->root.u.def.section; + + /* Function entry syms return NULL if they are in .opd + and are not ._start (or others undefined on the ld + command line). Thus we avoid marking all function + sections, as all functions are referenced in .opd. */ + else if ((fdh->oh != NULL + && ((struct ppc_link_hash_entry *) fdh->oh)->is_entry) + || elf_section_data (sec)->tdata == NULL) + rsec = h->root.u.def.section; + break; case bfd_link_hash_common: - return h->root.u.c.p->section; + rsec = h->root.u.c.p->section; + break; default: break; @@ -2976,10 +2956,17 @@ ppc64_elf_gc_mark_hook (abfd, info, rel, h, sym) } else { - return bfd_section_from_elf_index (abfd, sym->st_shndx); + asection **opd_sym_section; + + rsec = bfd_section_from_elf_index (sec->owner, sym->st_shndx); + opd_sym_section = (asection **) elf_section_data (rsec)->tdata; + if (opd_sym_section != NULL) + rsec = opd_sym_section[sym->st_value / 24]; + else if (elf_section_data (sec)->tdata != NULL) + rsec = NULL; } - return NULL; + return rsec; } /* Update the .got, .plt. and dynamic reloc reference counts for the @@ -3549,6 +3536,310 @@ ppc64_elf_hide_symbol (info, h, force_local) } } +static boolean +edit_opd (obfd, info) + bfd *obfd; + struct bfd_link_info *info; +{ + bfd *ibfd; + unsigned int bfd_indx; + + for (bfd_indx = 0, ibfd = info->input_bfds; + ibfd != NULL; + ibfd = ibfd->link_next, bfd_indx++) + { + asection *sec; + Elf_Internal_Rela *relstart, *rel, *relend; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Sym *local_syms; + struct elf_link_hash_entry **sym_hashes; + bfd_vma offset; + long *adjust; + boolean need_edit; + + sec = bfd_get_section_by_name (ibfd, ".opd"); + if (sec == NULL) + continue; + + adjust = (long *) elf_section_data (sec)->tdata; + BFD_ASSERT (adjust != NULL); + memset (adjust, 0, (size_t) sec->_raw_size * sizeof (long) / 24); + + if (sec->output_section == bfd_abs_section_ptr) + continue; + + /* Look through the section relocs. */ + if ((sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0) + continue; + + local_syms = NULL; + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (ibfd); + + /* Read the relocations. */ + relstart = _bfd_elf64_link_read_relocs (obfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); + if (relstart == NULL) + return false; + + /* First run through the relocs to check they are sane, and to + determine whether we need to edit this opd section. */ + need_edit = false; + offset = 0; + relend = relstart + sec->reloc_count; + for (rel = relstart; rel < relend; rel++) + { + enum elf_ppc_reloc_type r_type; + unsigned long r_symndx; + asection *sym_sec; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; + + /* .opd contains a regular array of 24 byte entries. We're + only interested in the reloc pointing to a function entry + point. */ + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + if (r_type == R_PPC64_TOC) + continue; + + if (r_type != R_PPC64_ADDR64) + { + (*_bfd_error_handler) + (_("%s: unexpected reloc type %u in .opd section"), + bfd_archive_filename (ibfd), r_type); + need_edit = false; + break; + } + + if (rel + 1 >= relend) + continue; + r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info); + if (r_type != R_PPC64_TOC) + continue; + + if (rel->r_offset != offset) + { + /* If someone messes with .opd alignment then after a + "ld -r" we might have padding in the middle of .opd. + Also, there's nothing to prevent someone putting + something silly in .opd with the assembler. No .opd + optimization for them! */ + (*_bfd_error_handler) + (_("%s: .opd is not a regular array of opd entries"), + bfd_archive_filename (ibfd)); + need_edit = false; + break; + } + + r_symndx = ELF64_R_SYM (rel->r_info); + sym_sec = NULL; + h = NULL; + sym = NULL; + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + sym_sec = h->root.u.def.section; + } + else + { + if (local_syms == NULL) + { + local_syms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (local_syms == NULL) + local_syms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (local_syms == NULL) + goto error_free_rel; + } + sym = local_syms + r_symndx; + if ((sym->st_shndx != SHN_UNDEF + && sym->st_shndx < SHN_LORESERVE) + || sym->st_shndx > SHN_HIRESERVE) + sym_sec = bfd_section_from_elf_index (ibfd, sym->st_shndx); + } + + if (sym_sec == NULL || sym_sec->owner == NULL) + { + (*_bfd_error_handler) + (_("%s: undefined sym `%s' in .opd section"), + bfd_archive_filename (ibfd), + h != NULL ? h->root.root.string : "<local symbol>"); + need_edit = false; + break; + } + + if (sym_sec->output_section == bfd_abs_section_ptr) + { + /* OK, we've found a function that's excluded from the + link. */ + need_edit = true; + } + + offset += 24; + } + + if (need_edit) + { + Elf_Internal_Rela *write_rel; + bfd_byte *rptr, *wptr; + boolean skip; + + /* This seems a waste of time as input .opd sections are all + zeros as generated by gcc, but I suppose there's no reason + this will always be so. We might start putting something in + the third word of .opd entries. */ + if ((sec->flags & SEC_IN_MEMORY) == 0) + { + bfd_byte *loc = bfd_alloc (ibfd, sec->_raw_size); + if (loc == NULL + || !bfd_get_section_contents (ibfd, sec, loc, (bfd_vma) 0, + sec->_raw_size)) + { + if (local_syms != NULL + && symtab_hdr->contents != (unsigned char *) local_syms) + free (local_syms); + error_free_rel: + if (elf_section_data (sec)->relocs != relstart) + free (relstart); + return false; + } + sec->contents = loc; + sec->flags |= (SEC_IN_MEMORY | SEC_HAS_CONTENTS); + } + + elf_section_data (sec)->relocs = relstart; + + wptr = sec->contents; + rptr = sec->contents; + write_rel = relstart; + skip = false; + offset = 0; + for (rel = relstart; rel < relend; rel++) + { + if (rel->r_offset == offset) + { + unsigned long r_symndx; + asection *sym_sec; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; + + r_symndx = ELF64_R_SYM (rel->r_info); + sym_sec = NULL; + h = NULL; + sym = NULL; + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + sym_sec = h->root.u.def.section; + } + else + { + sym = local_syms + r_symndx; + if ((sym->st_shndx != SHN_UNDEF + && sym->st_shndx < SHN_LORESERVE) + || sym->st_shndx > SHN_HIRESERVE) + sym_sec = bfd_section_from_elf_index (ibfd, + sym->st_shndx); + } + + skip = sym_sec->output_section == bfd_abs_section_ptr; + if (skip) + { + if (h != NULL) + { + /* Arrange for the function descriptor sym + to be dropped. */ + struct elf_link_hash_entry *fdh; + struct ppc_link_hash_entry *fh; + + fh = (struct ppc_link_hash_entry *) h; + BFD_ASSERT (fh->is_func); + fdh = fh->oh; + fdh->root.u.def.value = 0; + fdh->root.u.def.section = sym_sec; + } + } + else + { + /* We'll be keeping this opd entry. */ + + if (h != NULL) + { + /* Redefine the function descriptor symbol + to this location in the opd section. + We've checked above that opd relocs are + ordered. */ + struct elf_link_hash_entry *fdh; + struct ppc_link_hash_entry *fh; + + fh = (struct ppc_link_hash_entry *) h; + BFD_ASSERT (fh->is_func); + fdh = fh->oh; + fdh->root.u.def.value = wptr - sec->contents; + } + else + { + /* Local syms are a bit tricky. We could + tweak them as they can be cached, but + we'd need to look through the local syms + for the function descriptor sym which we + don't have at the moment. So keep an + array of adjustments. */ + adjust[(rel->r_offset + wptr - rptr) / 24] + = wptr - rptr; + } + + if (wptr != rptr) + memcpy (wptr, rptr, 24); + wptr += 24; + } + rptr += 24; + offset += 24; + } + + /* We need to adjust any reloc offsets to point to the + new opd entries. While we're at it, we may as well + remove redundant relocs. */ + if (!skip) + { + rel->r_offset += wptr - rptr; + if (write_rel != rel) + memcpy (write_rel, rel, sizeof (*rel)); + ++write_rel; + } + } + + sec->_cooked_size = wptr - sec->contents; + sec->reloc_count = write_rel - relstart; + } + else if (elf_section_data (sec)->relocs != relstart) + free (relstart); + + if (local_syms != NULL + && symtab_hdr->contents != (unsigned char *) local_syms) + { + if (!info->keep_memory) + free (local_syms); + else + symtab_hdr->contents = (unsigned char *) local_syms; + } + } + + return true; +} + /* This is the condition under which ppc64_elf_finish_dynamic_symbol will be called from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol routine, we'll need to do something about @@ -3847,6 +4138,9 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) } } + if (!edit_opd (output_bfd, info)) + return false; + /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); @@ -3905,6 +4199,10 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) continue; } + /* .plt is in the bss section. We don't initialise it. */ + if ((s->flags & SEC_LOAD) == 0) + continue; + /* Allocate memory for the section contents. We use bfd_zalloc here in case unused entries are not reclaimed before the section's contents are written out. This should not happen, @@ -4310,7 +4608,7 @@ ppc_size_one_stub (gen_entry, in_arg) /* Set up various things so that we can make a list of input sections for each output section included in the link. Returns -1 on error, - 0 when no stubs will be needed, and 1 on success. */ + 0 when no stubs will be needed, and 1 on success. */ int ppc64_elf_setup_section_lists (output_bfd, info) @@ -4318,7 +4616,6 @@ ppc64_elf_setup_section_lists (output_bfd, info) struct bfd_link_info *info; { bfd *input_bfd; - unsigned int bfd_count; int top_id, top_index; asection *section; asection **input_list, **list; @@ -4329,12 +4626,11 @@ ppc64_elf_setup_section_lists (output_bfd, info) || htab->sbrlt == NULL) return 0; - /* Count the number of input BFDs and find the top input section id. */ - for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; + /* Find the top input section id. */ + for (input_bfd = info->input_bfds, top_id = 0; input_bfd != NULL; input_bfd = input_bfd->link_next) { - bfd_count += 1; for (section = input_bfd->sections; section != NULL; section = section->next) @@ -4343,7 +4639,6 @@ ppc64_elf_setup_section_lists (output_bfd, info) top_id = section->id; } } - htab->bfd_count = bfd_count; amt = sizeof (struct map_stub) * (top_id + 1); htab->stub_group = (struct map_stub *) bfd_zmalloc (amt); @@ -4488,100 +4783,6 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) #undef PREV_SEC } -/* Read in all local syms for all input bfds. */ - -static boolean -get_local_syms (input_bfd, htab) - bfd *input_bfd; - struct ppc_link_hash_table *htab; -{ - unsigned int bfd_indx; - Elf_Internal_Sym *local_syms, **all_local_syms; - - /* We want to read in symbol extension records only once. To do this - we need to read in the local symbols in parallel and save them for - later use; so hold pointers to the local symbols in an array. */ - bfd_size_type amt = sizeof (Elf_Internal_Sym *) * htab->bfd_count; - all_local_syms = (Elf_Internal_Sym **) bfd_zmalloc (amt); - htab->all_local_syms = all_local_syms; - if (all_local_syms == NULL) - return false; - - /* Walk over all the input BFDs, swapping in local symbols. - If we are creating a shared library, create hash entries for the - export stubs. */ - for (bfd_indx = 0; - input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) - { - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf_Internal_Sym *isym; - Elf64_External_Sym *ext_syms, *esym, *end_sy; - Elf_External_Sym_Shndx *shndx_buf, *shndx; - bfd_size_type sec_size; - - /* We'll need the symbol table in a second. */ - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - if (symtab_hdr->sh_info == 0) - continue; - - /* We need an array of the local symbols attached to the input bfd. - Unfortunately, we're going to have to read & swap them in. */ - sec_size = symtab_hdr->sh_info; - sec_size *= sizeof (Elf_Internal_Sym); - local_syms = (Elf_Internal_Sym *) bfd_malloc (sec_size); - if (local_syms == NULL) - return false; - - all_local_syms[bfd_indx] = local_syms; - sec_size = symtab_hdr->sh_info; - sec_size *= sizeof (Elf64_External_Sym); - ext_syms = (Elf64_External_Sym *) bfd_malloc (sec_size); - if (ext_syms == NULL) - return false; - - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) ext_syms, sec_size, input_bfd) != sec_size) - { - error_ret_free_ext_syms: - free (ext_syms); - return false; - } - - shndx_buf = NULL; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) - { - sec_size = symtab_hdr->sh_info; - sec_size *= sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (sec_size); - if (shndx_buf == NULL) - goto error_ret_free_ext_syms; - - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, sec_size, input_bfd) != sec_size) - { - free (shndx_buf); - goto error_ret_free_ext_syms; - } - } - - /* Swap the local symbols in. */ - for (esym = ext_syms, end_sy = esym + symtab_hdr->sh_info, - isym = local_syms, shndx = shndx_buf; - esym < end_sy; - esym++, isym++, shndx = (shndx ? shndx + 1 : NULL)) - bfd_elf64_swap_symbol_in (input_bfd, esym, shndx, isym); - - /* Now we can free the external symbols. */ - free (shndx_buf); - free (ext_syms); - } - - return true; -} - /* Determine and set the size of the stub section for a final link. The basic idea here is to examine all the relocations looking for @@ -4600,7 +4801,6 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, { bfd_size_type stub_group_size; boolean stubs_always_before_branch; - boolean ret = false; struct ppc_link_hash_table *htab = ppc_hash_table (info); /* Stash our params away. */ @@ -4622,13 +4822,6 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, group_sections (htab, stub_group_size, stubs_always_before_branch); - if (! get_local_syms (info->input_bfds, htab)) - { - if (htab->all_local_syms) - goto error_ret_free_local; - return false; - } - while (1) { bfd *input_bfd; @@ -4645,24 +4838,19 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, { Elf_Internal_Shdr *symtab_hdr; asection *section; - Elf_Internal_Sym *local_syms; + Elf_Internal_Sym *local_syms = NULL; /* We'll need the symbol table in a second. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; if (symtab_hdr->sh_info == 0) continue; - local_syms = htab->all_local_syms[bfd_indx]; - /* Walk over each section attached to the input bfd. */ for (section = input_bfd->sections; section != NULL; section = section->next) { - Elf_Internal_Shdr *input_rel_hdr; - Elf64_External_Rela *external_relocs, *erelaend, *erela; Elf_Internal_Rela *internal_relocs, *irelaend, *irela; - bfd_size_type amt; /* If there aren't any relocs, then there's nothing more to do. */ @@ -4676,47 +4864,13 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, || section->output_section->owner != output_bfd) continue; - /* Allocate space for the external relocations. */ - amt = section->reloc_count; - amt *= sizeof (Elf64_External_Rela); - external_relocs = (Elf64_External_Rela *) bfd_malloc (amt); - if (external_relocs == NULL) - { - goto error_ret_free_local; - } - - /* Likewise for the internal relocations. */ - amt = section->reloc_count; - amt *= sizeof (Elf_Internal_Rela); - internal_relocs = (Elf_Internal_Rela *) bfd_malloc (amt); + /* Get the relocs. */ + internal_relocs + = _bfd_elf64_link_read_relocs (input_bfd, section, NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); if (internal_relocs == NULL) - { - free (external_relocs); - goto error_ret_free_local; - } - - /* Read in the external relocs. */ - input_rel_hdr = &elf_section_data (section)->rel_hdr; - if (bfd_seek (input_bfd, input_rel_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) external_relocs, - input_rel_hdr->sh_size, - input_bfd) != input_rel_hdr->sh_size) - { - free (external_relocs); - error_ret_free_internal: - free (internal_relocs); - goto error_ret_free_local; - } - - /* Swap in the relocs. */ - erela = external_relocs; - erelaend = erela + section->reloc_count; - irela = internal_relocs; - for (; erela < erelaend; erela++, irela++) - bfd_elf64_swap_reloca_in (input_bfd, erela, irela); - - /* We're done with the external relocs, free them. */ - free (external_relocs); + goto error_ret_free_local; /* Now examine each relocation. */ irela = internal_relocs; @@ -4761,6 +4915,18 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, Elf_Internal_Sym *sym; Elf_Internal_Shdr *hdr; + if (local_syms == NULL) + { + local_syms + = (Elf_Internal_Sym *) symtab_hdr->contents; + if (local_syms == NULL) + local_syms + = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (local_syms == NULL) + goto error_ret_free_internal; + } sym = local_syms + r_indx; hdr = elf_elfsections (input_bfd)[sym->st_shndx]; sym_sec = hdr->bfd_section; @@ -4832,7 +4998,15 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, if (stub_entry == NULL) { free (stub_name); - goto error_ret_free_local; + error_ret_free_internal: + if (elf_section_data (section)->relocs == NULL) + free (internal_relocs); + error_ret_free_local: + if (local_syms != NULL + && (symtab_hdr->contents + != (unsigned char *) local_syms)) + free (local_syms); + return false; } stub_entry->target_value = sym_value; @@ -4843,7 +5017,17 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, } /* We're done with the internal relocs, free them. */ - free (internal_relocs); + if (elf_section_data (section)->relocs != internal_relocs) + free (internal_relocs); + } + + if (local_syms != NULL + && symtab_hdr->contents != (unsigned char *) local_syms) + { + if (!info->keep_memory) + free (local_syms); + else + symtab_hdr->contents = (unsigned char *) local_syms; } } @@ -4873,15 +5057,7 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, the dynamic symbol table is corrupted since the section symbol for the stripped section isn't written. */ - ret = true; - - error_ret_free_local: - while (htab->bfd_count-- > 0) - if (htab->all_local_syms[htab->bfd_count]) - free (htab->all_local_syms[htab->bfd_count]); - free (htab->all_local_syms); - - return ret; + return true; } /* Called after we have determined section placement. If sections @@ -5021,23 +5197,6 @@ ppc64_elf_build_stubs (info) return !htab->stub_error; } -/* Set up any other section flags and such that may be necessary. */ - -static boolean -ppc64_elf_fake_sections (abfd, shdr, asect) - bfd *abfd ATTRIBUTE_UNUSED; - Elf64_Internal_Shdr *shdr; - asection *asect; -{ - if ((asect->flags & SEC_EXCLUDE) != 0) - shdr->sh_flags |= SHF_EXCLUDE; - - if ((asect->flags & SEC_SORT_ENTRIES) != 0) - shdr->sh_type = SHT_ORDERED; - - return true; -} - /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -5103,7 +5262,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, TOCstart = elf_gp (output_bfd); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - is_opd = strcmp (bfd_get_section_name (abfd, input_section), ".opd") == 0; + is_opd = elf_section_data (input_section)->tdata != NULL; rel = relocs; relend = relocs + input_section->reloc_count; @@ -5154,6 +5313,15 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); /* rel may have changed, update our copy of addend. */ addend = rel->r_addend; + + if (elf_section_data (sec) != NULL) + { + long *opd_sym_adjust; + + opd_sym_adjust = (long *) elf_section_data (sec)->tdata; + if (opd_sym_adjust != NULL && sym->st_value % 24 == 0) + relocation += opd_sym_adjust[sym->st_value / 24]; + } } else { @@ -5208,8 +5376,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Branch taken prediction relocations. */ case R_PPC64_ADDR14_BRTAKEN: case R_PPC64_REL14_BRTAKEN: - insn = 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */ - /* Fall thru. */ + insn = 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */ + /* Fall thru. */ /* Branch not taken prediction relocations. */ case R_PPC64_ADDR14_BRNTAKEN: @@ -5591,14 +5759,18 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocate = true; if (r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC) { - if (is_opd && h != NULL && info->shared) + if (is_opd && h != NULL) { /* Lie about opd entries. This case occurs when building shared libraries and we reference a function in another shared - lib. In that case we won't use the opd - entry in this lib; We ought to edit the - opd section to remove unused entries. */ + lib. The same thing happens for a weak + definition in an application that's + overridden by a strong definition in a + shared lib. (I believe this is a generic + bug in binutils handling of weak syms.) + In these cases we won't use the opd + entry in this lib. */ unresolved_reloc = false; } outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); @@ -5750,13 +5922,11 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; } - /* FIXME: Why do we allow debugging sections to escape this error? - More importantly, why do we not emit dynamic relocs above in - debugging sections (which are ! SEC_ALLOC)? If we had - emitted the dynamic reloc, we could remove the fudge here. */ + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) { (*_bfd_error_handler) @@ -5854,7 +6024,7 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) Elf64_External_Rela *loc; /* This symbol has an entry in the procedure linkage table. Set - it up. */ + it up. */ if (htab->splt == NULL || htab->srelplt == NULL @@ -5881,7 +6051,7 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) Elf64_External_Rela *loc; /* This symbol has an entry in the global offset table. Set it - up. */ + up. */ if (htab->sgot == NULL || htab->srelgot == NULL) abort (); @@ -6104,12 +6274,11 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) #define elf_backend_rela_normal 1 #define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup -#define bfd_elf64_bfd_set_private_flags ppc64_elf_set_private_flags #define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data #define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create #define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free -#define elf_backend_section_from_shdr ppc64_elf_section_from_shdr +#define elf_backend_object_p ppc64_elf_object_p #define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections #define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol #define elf_backend_check_relocs ppc64_elf_check_relocs @@ -6119,7 +6288,6 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) #define elf_backend_hide_symbol ppc64_elf_hide_symbol #define elf_backend_always_size_sections ppc64_elf_func_desc_adjust #define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections -#define elf_backend_fake_sections ppc64_elf_fake_sections #define elf_backend_relocate_section ppc64_elf_relocate_section #define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol #define elf_backend_reloc_type_class ppc64_elf_reloc_type_class diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index 86f687e..cabc388 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +boolean ppc64_elf_mark_entry_syms + PARAMS ((struct bfd_link_info *)); bfd_vma ppc64_elf_toc PARAMS ((bfd *)); int ppc64_elf_setup_section_lists diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index ceb5efa..296e349 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -40,12 +40,13 @@ static boolean create_got_section static boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_s390_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -70,8 +71,6 @@ static boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static boolean elf_s390_object_p PARAMS ((bfd *)); -#define USE_RELA 1 /* We want RELA relocations, not REL. */ - #include "elf/s390.h" /* In case we're on a 32-bit machine, construct a 64-bit "-1" value @@ -471,7 +470,7 @@ create_got_section (dynobj, info) (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 3)) return false; return true; } @@ -510,7 +509,8 @@ elf_s390_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_s390_copy_indirect_symbol (dir, ind) +elf_s390_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -552,7 +552,7 @@ elf_s390_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } /* Look through the relocs for a section during the first phase, and @@ -776,7 +776,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) flags |= SEC_ALLOC | SEC_LOAD; if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) - || ! bfd_set_section_alignment (dynobj, sreloc, 2)) + || ! bfd_set_section_alignment (dynobj, sreloc, 3)) return false; } elf_section_data (sec)->sreloc = sreloc; @@ -855,8 +855,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf_s390_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf_s390_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -886,9 +886,7 @@ elf_s390_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1019,7 +1017,7 @@ elf_s390_adjust_dynamic_symbol (info, h) /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later - (although we could actually do it here). */ + (although we could actually do it here). */ if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { @@ -1937,9 +1935,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, break; } + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), @@ -2339,6 +2339,7 @@ const struct elf_size_info s390_elf64_size_info = bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out, bfd_elf64_slurp_reloc_table, bfd_elf64_slurp_symbol_table, diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index b168934..4fb695f 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -127,7 +127,7 @@ static bfd_byte *sh_elf64_get_relocated_section_contents static boolean sh_elf64_set_mach_from_flags PARAMS ((bfd *)); static boolean sh_elf64_set_private_flags PARAMS ((bfd *, flagword)); static asection *sh_elf64_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean sh_elf64_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -139,7 +139,7 @@ static int sh64_elf64_get_symbol_type PARAMS ((Elf_Internal_Sym *, int)); static boolean sh64_elf64_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); -extern boolean sh64_elf64_link_output_symbol_hook +static boolean sh64_elf64_link_output_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *)); static boolean sh64_elf64_fake_sections @@ -1342,8 +1342,8 @@ sh_elf64_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, return bfd_reloc_undefined; if (bfd_is_com_section (symbol_in->section)) - sym_value = 0; - else + sym_value = 0; + else sym_value = (symbol_in->value + symbol_in->section->output_section->vma + symbol_in->section->output_offset); @@ -1614,7 +1614,7 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section, sec = h->root.u.def.section; /* In these cases, we don't need the relocation value. We check specially because in some obscure cases - sec->output_section will be NULL. */ + sec->output_section will be NULL. */ if (r_type == R_SH_GOTPC_LOW16 || r_type == R_SH_GOTPC_MEDLOW16 || r_type == R_SH_GOTPC_MEDHI16 @@ -1756,7 +1756,7 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section, skip = true; else if (outrel.r_offset == (bfd_vma) -2) skip = true, relocate = true; - + outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -2144,15 +2144,11 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, asymbol **symbols; { Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; asection *input_section = link_order->u.indirect.section; bfd *input_bfd = input_section->owner; asection **sections = NULL; Elf_Internal_Rela *internal_relocs = NULL; - Elf64_External_Sym *external_syms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym *internal_syms = NULL; + Elf_Internal_Sym *isymbuf = NULL; /* We only need to handle the case of relaxing, or of having a particular set of section contents, specially. */ @@ -2164,7 +2160,6 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, symbols); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; memcpy (data, elf_section_data (input_section)->this_hdr.contents, input_section->_raw_size); @@ -2173,37 +2168,18 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, && input_section->reloc_count > 0) { Elf_Internal_Sym *isymp; + Elf_Internal_Sym *isymend; asection **secpp; - Elf64_External_Sym *esym, *esymend; - bfd_size_type amt; - if (symtab_hdr->contents != NULL) - external_syms = (Elf64_External_Sym *) symtab_hdr->contents; - else + /* Read this BFD's local symbols. */ + if (symtab_hdr->sh_info != 0) { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf64_External_Sym); - - external_syms = (Elf64_External_Sym *) bfd_malloc (amt); - if (external_syms == NULL && symtab_hdr->sh_info > 0) - goto error_return; - - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || (bfd_bread ((PTR) external_syms, amt, input_bfd) != amt)) - goto error_return; - } - - if (symtab_hdr->sh_info != 0 && shndx_hdr->sh_size != 0) - { - amt = symtab_hdr->sh_info; - amt *= sizeof (Elf_External_Sym_Shndx); - - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt) + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) goto error_return; } @@ -2213,29 +2189,17 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, if (internal_relocs == NULL) goto error_return; - internal_syms = ((Elf_Internal_Sym *) - bfd_malloc (symtab_hdr->sh_info - * sizeof (Elf_Internal_Sym))); - if (internal_syms == NULL && symtab_hdr->sh_info > 0) - goto error_return; - sections = (asection **) bfd_malloc (symtab_hdr->sh_info * sizeof (asection *)); if (sections == NULL && symtab_hdr->sh_info > 0) goto error_return; - isymp = internal_syms; secpp = sections; - esym = external_syms; - esymend = esym + symtab_hdr->sh_info; - shndx = shndx_buf; - for (; esym < esymend; - ++esym, ++isymp, ++secpp, shndx = (shndx ? shndx + 1 : NULL)) + isymend = isymbuf + symtab_hdr->sh_info; + for (isymp = isymbuf; isymp < isymend; ++isymp, ++secpp) { asection *isec; - bfd_elf64_swap_symbol_in (input_bfd, esym, shndx, isymp); - if (isymp->st_shndx == SHN_UNDEF) isec = bfd_und_section_ptr; else if (isymp->st_shndx > 0 && isymp->st_shndx < SHN_LORESERVE) @@ -2255,35 +2219,29 @@ sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order, if (! sh_elf64_relocate_section (output_bfd, link_info, input_bfd, input_section, data, internal_relocs, - internal_syms, sections)) + isymbuf, sections)) goto error_return; if (sections != NULL) free (sections); - sections = NULL; - if (internal_syms != NULL) - free (internal_syms); - internal_syms = NULL; - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - external_syms = NULL; if (internal_relocs != elf_section_data (input_section)->relocs) free (internal_relocs); - internal_relocs = NULL; + if (isymbuf != NULL + && (unsigned char *) isymbuf != symtab_hdr->contents) + free (isymbuf); } return data; error_return: + if (sections != NULL) + free (sections); if (internal_relocs != NULL && internal_relocs != elf_section_data (input_section)->relocs) free (internal_relocs); - if (external_syms != NULL && symtab_hdr->contents == NULL) - free (external_syms); - if (internal_syms != NULL) - free (internal_syms); - if (sections != NULL) - free (sections); + if (isymbuf != NULL + && (unsigned char *) isymbuf != symtab_hdr->contents) + free (isymbuf); return NULL; } @@ -2390,7 +2348,7 @@ sh_elf64_merge_private_data (ibfd, obfd) { flagword old_flags, new_flags; - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -2449,12 +2407,12 @@ sh_elf64_merge_private_data (ibfd, obfd) relocation. */ static asection * -sh_elf64_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +sh_elf64_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; { if (h != NULL) { @@ -2465,6 +2423,9 @@ sh_elf64_gc_mark_hook (abfd, info, rel, h, sym) break; default: + while (h->root.type == bfd_link_hash_indirect + && h->root.u.i.link) + h = (struct elf_link_hash_entry *) h->root.u.i.link; switch (h->root.type) { case bfd_link_hash_defined: @@ -2480,13 +2441,7 @@ sh_elf64_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - if (!(elf_bad_symtab (abfd) - && ELF_ST_BIND (sym->st_info) != STB_LOCAL) - && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) - && sym->st_shndx != SHN_COMMON)) - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -2507,7 +2462,7 @@ sh_elf64_gc_sweep_hook (abfd, info, sec, relocs) /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ - + static boolean sh_elf64_check_relocs (abfd, info, sec, relocs) bfd *abfd; @@ -2537,7 +2492,7 @@ sh_elf64_check_relocs (abfd, info, sec, relocs) sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf64_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - + dynobj = elf_hash_table (info)->dynobj; local_got_offsets = elf_local_got_offsets (abfd); @@ -2546,13 +2501,13 @@ sh_elf64_check_relocs (abfd, info, sec, relocs) { struct elf_link_hash_entry *h; unsigned long r_symndx; - + r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h = NULL; else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + /* Some relocs require a global offset table. */ if (dynobj == NULL) { @@ -2596,7 +2551,7 @@ sh_elf64_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return false; break; - + /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_SH_GNU_VTENTRY: @@ -2881,7 +2836,7 @@ sh_elf64_check_relocs (abfd, info, sec, relocs) break; } } - + return true; } @@ -3016,7 +2971,7 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) we don't need to look up and make sure to emit the main symbol for each DataLabel symbol. */ -boolean +static boolean sh64_elf64_link_output_symbol_hook (abfd, info, cname, sym, input_sec) bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; @@ -3064,7 +3019,7 @@ static const bfd_byte elf_sh64_plt0_entry_be[PLT_ENTRY_SIZE] = 0xc8, 0x00, 0x01, 0x10, /* shori (.got.plt >> 16) & 65535, r17 */ 0xc8, 0x00, 0x01, 0x10, /* shori .got.plt & 65535, r17 */ 0x8d, 0x10, 0x09, 0x90, /* ld.q r17, 16, r25 */ - 0x6b, 0xf1, 0x46, 0x00, /* ptabs r17, tr0 */ + 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ 0x8d, 0x10, 0x05, 0x10, /* ld.q r17, 8, r17 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ 0x6f, 0xf0, 0xff, 0xf0, /* nop */ @@ -3084,7 +3039,7 @@ static const bfd_byte elf_sh64_plt0_entry_le[PLT_ENTRY_SIZE] = 0x10, 0x01, 0x00, 0xc8, /* shori (.got.plt >> 16) & 65535, r17 */ 0x10, 0x01, 0x00, 0xc8, /* shori .got.plt & 65535, r17 */ 0x90, 0x09, 0x10, 0x8d, /* ld.q r17, 16, r25 */ - 0x00, 0x46, 0xf1, 0x6b, /* ptabs r17, tr0 */ + 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ 0x10, 0x05, 0x10, 0x8d, /* ld.q r17, 8, r17 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ 0xf0, 0xff, 0xf0, 0x6f, /* nop */ @@ -3110,9 +3065,9 @@ static const bfd_byte elf_sh64_plt_entry_be[PLT_ENTRY_SIZE] = 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ 0x6f, 0xf0, 0xff, 0xf0, /* nop */ - 0xcc, 0x00, 0x01, 0x90, /* movi .PLT0 >> 16, r25 */ - 0xc8, 0x00, 0x01, 0x90, /* shori .PLT0 & 65535, r25 */ - 0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */ + 0xcc, 0x00, 0x01, 0x90, /* movi (.+8-.PLT0) >> 16, r25 */ + 0xc8, 0x00, 0x01, 0x90, /* shori (.+4-.PLT0) & 65535, r25 */ + 0x6b, 0xf5, 0x66, 0x00, /* ptrel r25, tr0 */ 0xcc, 0x00, 0x01, 0x50, /* movi reloc-offset >> 16, r21 */ 0xc8, 0x00, 0x01, 0x50, /* shori reloc-offset & 65535, r21 */ 0x44, 0x01, 0xff, 0xf0, /* blink tr0, r63 */ @@ -3130,9 +3085,9 @@ static const bfd_byte elf_sh64_plt_entry_le[PLT_ENTRY_SIZE] = 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ 0xf0, 0xff, 0xf0, 0x6f, /* nop */ - 0x90, 0x01, 0x00, 0xcc, /* movi .PLT0 >> 16, r25 */ - 0x90, 0x01, 0x00, 0xc8, /* shori .PLT0 & 65535, r25 */ - 0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */ + 0x90, 0x01, 0x00, 0xcc, /* movi (.+8-.PLT0) >> 16, r25 */ + 0x90, 0x01, 0x00, 0xc8, /* shori (.+4-.PLT0) & 65535, r25 */ + 0x00, 0x66, 0xf5, 0x6b, /* ptrel r25, tr0 */ 0x50, 0x01, 0x00, 0xcc, /* movi reloc-offset >> 16, r21 */ 0x50, 0x01, 0x00, 0xc8, /* shori reloc-offset & 65535, r21 */ 0xf0, 0xff, 0x01, 0x44, /* blink tr0, r63 */ @@ -3762,7 +3717,7 @@ sh64_elf64_size_dynamic_sections (output_bfd, info) } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -3853,7 +3808,8 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym) The first three are reserved. */ got_offset = (plt_index + 3) * 8; - got_offset -= GOT_BIAS; + if (info->shared) + got_offset -= GOT_BIAS; /* Fill in the entry in the procedure linkage table. */ if (! info->shared) @@ -3872,8 +3828,11 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym) (splt->contents + h->plt.offset + elf_sh64_plt_symbol_offset (info))); + /* Set bottom bit because its for a branch to SHmedia */ movi_shori_putval (output_bfd, - (splt->output_section->vma + splt->output_offset), + -(h->plt.offset + + elf_sh64_plt_plt0_offset (info) + 8) + | 1, (splt->contents + h->plt.offset + elf_sh64_plt_plt0_offset (info))); } @@ -3892,7 +3851,8 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym) + elf_sh64_plt_symbol_offset (info))); } - got_offset += GOT_BIAS; + if (info->shared) + got_offset += GOT_BIAS; movi_shori_putval (output_bfd, plt_index * sizeof (Elf64_External_Rela), @@ -4035,6 +3995,7 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info) Elf_Internal_Dyn dyn; const char *name; asection *s; + struct elf_link_hash_entry *h; bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); @@ -4043,6 +4004,25 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info) default: break; + case DT_INIT: + name = info->init_function; + goto get_sym; + + case DT_FINI: + name = info->fini_function; + get_sym: + if (dyn.d_un.d_val != 0) + { + h = elf_link_hash_lookup (elf_hash_table (info), name, + false, false, true); + if (h != NULL && (h->other & STO_SH5_ISA32)) + { + dyn.d_un.d_val |= 1; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; + case DT_PLTGOT: name = ".got"; goto get_vma; diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 4933f8d..764b0d7 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -72,6 +72,9 @@ static void sparc64_elf_symbol_processing static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static boolean sparc64_elf_fake_sections + PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); + static const char *sparc64_elf_print_symbol_all PARAMS ((bfd *, PTR, asymbol *)); static boolean sparc64_elf_relax_section @@ -711,7 +714,7 @@ init_insn_reloc (abfd, return bfd_reloc_ok; } - /* This works because partial_inplace == false. */ + /* This works because partial_inplace is false. */ if (output_bfd != NULL) return bfd_reloc_continue; @@ -1386,7 +1389,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) return true; } else if (*namep && **namep - && info->hash->creator->flavour == bfd_target_elf_flavour) + && info->hash->creator == abfd->xvec) { int i; struct sparc64_elf_app_reg *p; @@ -1916,6 +1919,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; + if (info->relocateable) + return true; + dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1951,28 +1957,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } howto = sparc64_elf_howto_table + r_type; - r_symndx = ELF64_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - /* This is a final link. */ + r_symndx = ELF64_R_SYM (rel->r_info); h = NULL; sym = NULL; sec = NULL; @@ -2565,9 +2551,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; } + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), @@ -2995,6 +2983,27 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) } return true; } + +/* MARCO: Set the correct entry size for the .stab section. */ + +static boolean +sparc64_elf_fake_sections (abfd, hdr, sec) + bfd *abfd ATTRIBUTE_UNUSED; + Elf32_Internal_Shdr *hdr ATTRIBUTE_UNUSED; + asection *sec; +{ + const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ".stab") == 0) + { + /* Even in the 64bit case the stab entries are only 12 bytes long. */ + elf_section_data (sec)->this_hdr.sh_entsize = 12; + } + + return true; +} /* Print a STT_REGISTER symbol to file FILE. */ @@ -3067,6 +3076,7 @@ const struct elf_size_info sparc64_elf_size_info = bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, sparc64_elf_write_relocs, + bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out, sparc64_elf_slurp_reloc_table, bfd_elf64_slurp_symbol_table, @@ -3131,6 +3141,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_output_arch_syms #define bfd_elf64_bfd_merge_private_bfd_data \ sparc64_elf_merge_private_bfd_data +#define elf_backend_fake_sections \ + sparc64_elf_fake_sections #define elf_backend_size_info \ sparc64_elf_size_info @@ -3142,6 +3154,7 @@ const struct elf_size_info sparc64_elf_size_info = #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 1 +#define elf_backend_rela_normal 1 /* Section 5.2.4 of the ABI specifies a 256-byte boundary for the table. */ #define elf_backend_plt_alignment 8 diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 66a27db..9c4a9d4 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -26,9 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/x86-64.h" -/* We use only the RELA entries. */ -#define USE_RELA 1 - /* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */ #define MINUS_ONE (~ (bfd_vma) 0) @@ -125,9 +122,9 @@ static reloc_howto_type *elf64_x86_64_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void elf64_x86_64_info_to_howto PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); -static boolean elf64_x86_64_grok_prstatus +static boolean elf64_x86_64_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); -static boolean elf64_x86_64_grok_psinfo +static boolean elf64_x86_64_grok_psinfo PARAMS ((bfd *, Elf_Internal_Note *)); static struct bfd_link_hash_table *elf64_x86_64_link_hash_table_create PARAMS ((bfd *)); @@ -137,12 +134,13 @@ static boolean create_got_section static boolean elf64_x86_64_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf64_x86_64_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static boolean elf64_x86_64_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *sec, const Elf_Internal_Rela *)); static asection *elf64_x86_64_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static boolean elf64_x86_64_gc_sweep_hook @@ -228,11 +226,11 @@ elf64_x86_64_grok_prstatus (abfd, note) case 336: /* sizeof(istruct elf_prstatus) on Linux/x86_64 */ /* pr_cursig */ - elf_tdata (abfd)->core_signal + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); /* pr_pid */ - elf_tdata (abfd)->core_pid + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 32); /* pr_reg */ @@ -497,7 +495,8 @@ elf64_x86_64_create_dynamic_sections (dynobj, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf64_x86_64_copy_indirect_symbol (dir, ind) +elf64_x86_64_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf64_x86_64_link_hash_entry *edir, *eind; @@ -539,7 +538,7 @@ elf64_x86_64_copy_indirect_symbol (dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static boolean @@ -660,11 +659,28 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) case R_X86_64_8: case R_X86_64_16: case R_X86_64_32: - case R_X86_64_64: case R_X86_64_32S: + /* Let's help debug shared library creation. These relocs + cannot be used in shared libs. Don't error out for + sections we don't care about, such as debug sections or + non-constant sections. */ + if (info->shared + && (sec->flags & SEC_ALLOC) != 0 + && (sec->flags & SEC_READONLY) != 0) + { + (*_bfd_error_handler) + (_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"), + bfd_archive_filename (abfd), + x86_64_elf_howto_table[ELF64_R_TYPE (rel->r_info)].name); + bfd_set_error (bfd_error_bad_value); + return false; + } + /* Fall through. */ + case R_X86_64_PC8: case R_X86_64_PC16: case R_X86_64_PC32: + case R_X86_64_64: if (h != NULL && !info->shared) { /* If this reloc is in a read-only section, we might @@ -839,8 +855,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) relocation. */ static asection * -elf64_x86_64_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +elf64_x86_64_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -870,9 +886,7 @@ elf64_x86_64_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -1087,7 +1101,7 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) /* We must generate a R_X86_64_COPY reloc to tell the dynamic linker to copy the initial value out of the dynamic object and into the - runtime process image. */ + runtime process image. */ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) { htab->srelbss->_raw_size += sizeof (Elf64_External_Rela); @@ -1861,9 +1875,44 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, else { /* This symbol is local, or marked to become local. */ - relocate = true; - outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_X86_64_64) + { + relocate = true; + outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); + outrel.r_addend = relocation + rel->r_addend; + } + else + { + long sindx; + + if (h == NULL) + sec = local_sections[r_symndx]; + else + { + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || (h->root.type + == bfd_link_hash_defweak)); + sec = h->root.u.def.section; + } + if (sec != NULL && bfd_is_abs_section (sec)) + sindx = 0; + else if (sec == NULL || sec->owner == NULL) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + else + { + asection *osec; + + osec = sec->output_section; + sindx = elf_section_data (osec)->dynindx; + BFD_ASSERT (sindx > 0); + } + + outrel.r_info = ELF64_R_INFO (sindx, r_type); + outrel.r_addend = relocation + rel->r_addend; + } } sreloc = elf_section_data (input_section)->sreloc; @@ -1888,14 +1937,11 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, break; } - /* FIXME: Why do we allow debugging sections to escape this error? - More importantly, why do we not emit dynamic relocs for - R_386_32 above in debugging sections (which are ! SEC_ALLOC)? - If we had emitted the dynamic reloc, we could remove the - fudge here. */ + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections + because such sections are not SEC_ALLOC and thus ld.so will + not process them. */ if (unresolved_reloc - && !(info->shared - && (input_section->flags & SEC_DEBUGGING) != 0 + && !((input_section->flags & SEC_DEBUGGING) != 0 && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) (*_bfd_error_handler) (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c index 2d791de..1c07dc8 100644 --- a/bfd/elfarm-nabi.c +++ b/bfd/elfarm-nabi.c @@ -749,4 +749,6 @@ elf32_arm_nabi_grok_psinfo (abfd, note) #define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus #define elf_backend_grok_psinfo elf32_arm_nabi_grok_psinfo +#ifndef ELFARM_NABI_C_INCLUDED #include "elf32-arm.h" +#endif diff --git a/bfd/elfarm-oabi.c b/bfd/elfarm-oabi.c index 25c4d89..fb92046 100644 --- a/bfd/elfarm-oabi.c +++ b/bfd/elfarm-oabi.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM old abi option. - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -18,6 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define OLD_ARM_ABI +#define bfd_elf32_arm_allocate_interworking_sections \ + bfd_elf32_arm_oabi_allocate_interworking_sections +#define bfd_elf32_arm_get_bfd_for_interworking \ + bfd_elf32_arm_oabi_get_bfd_for_interworking +#define bfd_elf32_arm_process_before_allocation \ + bfd_elf32_arm_oabi_process_before_allocation +#define bfd_elf32_arm_add_glue_sections_to_bfd \ + bfd_elf32_arm_oabi_add_glue_sections_to_bfd #include "elf/arm.h" #include "bfd.h" @@ -29,8 +37,6 @@ #define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0]) #endif -#define USE_RELA - #define TARGET_LITTLE_SYM bfd_elf32_littlearm_oabi_vec #define TARGET_LITTLE_NAME "elf32-littlearm-oabi" #define TARGET_BIG_SYM bfd_elf32_bigarm_oabi_vec @@ -417,11 +423,4 @@ elf32_arm_reloc_type_lookup (abfd, code) return NULL; } -#define bfd_elf32_arm_allocate_interworking_sections \ - bfd_elf32_arm_oabi_allocate_interworking_sections -#define bfd_elf32_arm_get_bfd_for_interworking \ - bfd_elf32_arm_oabi_get_bfd_for_interworking -#define bfd_elf32_arm_process_before_allocation \ - bfd_elf32_arm_oabi_process_before_allocation - #include "elf32-arm.h" diff --git a/bfd/elfarmqnx-nabi.c b/bfd/elfarmqnx-nabi.c new file mode 100644 index 0000000..7647b3d --- /dev/null +++ b/bfd/elfarmqnx-nabi.c @@ -0,0 +1,34 @@ +/* ARM new abi QNX specific support for 32-bit ELF + Copyright 2002 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define ELFARM_NABI_C_INCLUDED +#include "elfarm-nabi.c" + +#include "elf32-qnx.h" + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf32_littlearmqnx_vec +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf32_bigarmqnx_vec + +/* QNX Neutrino for ARM has a max pagesize of 0x1000. */ +#undef ELF_MAXPAGESIZE +#define ELF_MAXPAGESIZE 0x1000 + +#include "elf32-arm.h" diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 203323c..eb667eb 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1,6 +1,6 @@ /* ELF executable support for BFD. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001 Free Software Foundation, Inc. + 2001, 2002 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -203,12 +203,14 @@ static char *elf_symbol_flags PARAMS ((flagword)); format. */ void -elf_swap_symbol_in (abfd, src, shndx, dst) +elf_swap_symbol_in (abfd, psrc, pshn, dst) bfd *abfd; - const Elf_External_Sym *src; - const Elf_External_Sym_Shndx *shndx; + const PTR psrc; + const PTR pshn; Elf_Internal_Sym *dst; { + const Elf_External_Sym *src = (const Elf_External_Sym *) psrc; + const Elf_External_Sym_Shndx *shndx = (const Elf_External_Sym_Shndx *) pshn; int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; dst->st_name = H_GET_32 (abfd, src->st_name); @@ -557,9 +559,9 @@ elf_object_p (abfd) section header table (FIXME: See comments re sections at top of this file). */ - if ((elf_file_p (&x_ehdr) == false) || - (x_ehdr.e_ident[EI_VERSION] != EV_CURRENT) || - (x_ehdr.e_ident[EI_CLASS] != ELFCLASS)) + if (! elf_file_p (&x_ehdr) + || x_ehdr.e_ident[EI_VERSION] != EV_CURRENT + || x_ehdr.e_ident[EI_CLASS] != ELFCLASS) goto got_wrong_format_error; /* Check that file's byte order matches xvec's */ @@ -622,6 +624,10 @@ elf_object_p (abfd) if (i_ehdrp->e_shentsize != sizeof (x_shdr) && i_ehdrp->e_shnum != 0) goto got_wrong_format_error; + /* Further sanity check. */ + if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_shnum != 0) + goto got_wrong_format_error; + ebd = get_elf_backend_data (abfd); /* Check that the ELF e_machine field matches what this particular @@ -675,25 +681,28 @@ elf_object_p (abfd) /* Remember the entry point specified in the ELF file header. */ bfd_set_start_address (abfd, i_ehdrp->e_entry); - /* Seek to the section header table in the file. */ - if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0) - goto got_no_match; + if (i_ehdrp->e_shoff != 0) + { + /* Seek to the section header table in the file. */ + if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0) + goto got_no_match; - /* Read the first section header at index 0, and convert to internal - form. */ - if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd) - != sizeof (x_shdr)) - goto got_no_match; - elf_swap_shdr_in (abfd, &x_shdr, &i_shdr); + /* Read the first section header at index 0, and convert to internal + form. */ + if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd) + != sizeof (x_shdr)) + goto got_no_match; + elf_swap_shdr_in (abfd, &x_shdr, &i_shdr); - /* If the section count is zero, the actual count is in the first - section header. */ - if (i_ehdrp->e_shnum == SHN_UNDEF) - i_ehdrp->e_shnum = i_shdr.sh_size; + /* If the section count is zero, the actual count is in the first + section header. */ + if (i_ehdrp->e_shnum == SHN_UNDEF) + i_ehdrp->e_shnum = i_shdr.sh_size; - /* And similarly for the string table index. */ - if (i_ehdrp->e_shstrndx == SHN_XINDEX) - i_ehdrp->e_shstrndx = i_shdr.sh_link; + /* And similarly for the string table index. */ + if (i_ehdrp->e_shstrndx == SHN_XINDEX) + i_ehdrp->e_shstrndx = i_shdr.sh_link; + } /* Allocate space for a copy of the section header table in internal form. */ @@ -749,7 +758,7 @@ elf_object_p (abfd) } } - if (i_ehdrp->e_shstrndx) + if (i_ehdrp->e_shstrndx && i_ehdrp->e_shoff) { if (! bfd_section_from_shdr (abfd, i_ehdrp->e_shstrndx)) goto got_no_match; @@ -787,7 +796,7 @@ elf_object_p (abfd) bfd_section_from_shdr with it (since this particular strtab is used to find all of the ELF section names.) */ - if (i_ehdrp->e_shstrndx != 0) + if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff) { unsigned int num_sec; @@ -812,7 +821,7 @@ elf_object_p (abfd) information. */ if (ebd->elf_backend_object_p) { - if ((*ebd->elf_backend_object_p) (abfd) == false) + if (! (*ebd->elf_backend_object_p) (abfd)) goto got_wrong_format_error; } @@ -1124,10 +1133,12 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) unsigned long symcount; /* Number of external ELF symbols */ elf_symbol_type *sym; /* Pointer to current bfd symbol */ elf_symbol_type *symbase; /* Buffer for generated bfd symbols */ - Elf_Internal_Sym i_sym; - Elf_External_Sym *x_symp = NULL; - Elf_External_Sym_Shndx *x_shndx = NULL; - Elf_External_Versym *x_versymp = NULL; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + Elf_Internal_Sym *isymbuf = NULL; + Elf_External_Versym *xver; + Elf_External_Versym *xverbuf = NULL; + struct elf_backend_data *ebd; bfd_size_type amt; /* Read each raw ELF symbol, converting from external ELF form to @@ -1142,24 +1153,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) if (! dynamic) { - Elf_Internal_Shdr *shndx_hdr; - hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; verhdr = NULL; - - /* If we have a SHT_SYMTAB_SHNDX section for the symbol table, - read the raw contents. */ - if (elf_elfsections (abfd) != NULL - && elf_elfsections (abfd)[shndx_hdr->sh_link] == hdr) - { - amt = shndx_hdr->sh_size; - x_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (x_shndx == NULL - || bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) x_shndx, amt, abfd) != amt) - goto error_return; - } } else { @@ -1178,39 +1173,24 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) } } - if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0) - goto error_return; - + ebd = get_elf_backend_data (abfd); symcount = hdr->sh_size / sizeof (Elf_External_Sym); - if (symcount == 0) sym = symbase = NULL; else { - unsigned long i; - - if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0) - goto error_return; + isymbuf = bfd_elf_get_elf_syms (abfd, hdr, symcount, 0, + NULL, NULL, NULL); + if (isymbuf == NULL) + return -1; amt = symcount; amt *= sizeof (elf_symbol_type); symbase = (elf_symbol_type *) bfd_zalloc (abfd, amt); if (symbase == (elf_symbol_type *) NULL) goto error_return; - sym = symbase; - - /* Temporarily allocate room for the raw ELF symbols. */ - amt = symcount; - amt *= sizeof (Elf_External_Sym); - x_symp = (Elf_External_Sym *) bfd_malloc (amt); - if (x_symp == NULL) - goto error_return; - - if (bfd_bread ((PTR) x_symp, amt, abfd) != amt) - goto error_return; /* Read the raw ELF version symbol information. */ - if (verhdr != NULL && verhdr->sh_size / sizeof (Elf_External_Versym) != symcount) { @@ -1230,41 +1210,40 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) if (bfd_seek (abfd, verhdr->sh_offset, SEEK_SET) != 0) goto error_return; - x_versymp = (Elf_External_Versym *) bfd_malloc (verhdr->sh_size); - if (x_versymp == NULL && verhdr->sh_size != 0) + xverbuf = (Elf_External_Versym *) bfd_malloc (verhdr->sh_size); + if (xverbuf == NULL && verhdr->sh_size != 0) goto error_return; - if (bfd_bread ((PTR) x_versymp, verhdr->sh_size, abfd) + if (bfd_bread ((PTR) xverbuf, verhdr->sh_size, abfd) != verhdr->sh_size) goto error_return; } /* Skip first symbol, which is a null dummy. */ - for (i = 1; i < symcount; i++) + xver = xverbuf; + if (xver != NULL) + ++xver; + isymend = isymbuf + symcount; + for (isym = isymbuf + 1, sym = symbase; isym < isymend; isym++, sym++) { - elf_swap_symbol_in (abfd, x_symp + i, - x_shndx + (x_shndx != NULL ? i : 0), &i_sym); - memcpy (&sym->internal_elf_sym, &i_sym, sizeof (Elf_Internal_Sym)); -#ifdef ELF_KEEP_EXTSYM - memcpy (&sym->native_elf_sym, x_symp + i, sizeof (Elf_External_Sym)); -#endif + memcpy (&sym->internal_elf_sym, isym, sizeof (Elf_Internal_Sym)); sym->symbol.the_bfd = abfd; sym->symbol.name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, - i_sym.st_name); + isym->st_name); - sym->symbol.value = i_sym.st_value; + sym->symbol.value = isym->st_value; - if (i_sym.st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) { sym->symbol.section = bfd_und_section_ptr; } - else if (i_sym.st_shndx < SHN_LORESERVE - || i_sym.st_shndx > SHN_HIRESERVE) + else if (isym->st_shndx < SHN_LORESERVE + || isym->st_shndx > SHN_HIRESERVE) { sym->symbol.section = section_from_elf_index (abfd, - i_sym.st_shndx); + isym->st_shndx); if (sym->symbol.section == NULL) { /* This symbol is in a section for which we did not @@ -1273,18 +1252,18 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) sym->symbol.section = bfd_abs_section_ptr; } } - else if (i_sym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) { sym->symbol.section = bfd_abs_section_ptr; } - else if (i_sym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) { sym->symbol.section = bfd_com_section_ptr; /* Elf puts the alignment into the `value' field, and the size into the `size' field. BFD wants to see the size in the value field, and doesn't care (at the moment) about the alignment. */ - sym->symbol.value = i_sym.st_size; + sym->symbol.value = isym->st_size; } else sym->symbol.section = bfd_abs_section_ptr; @@ -1294,14 +1273,13 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) sym->symbol.value -= sym->symbol.section->vma; - switch (ELF_ST_BIND (i_sym.st_info)) + switch (ELF_ST_BIND (isym->st_info)) { case STB_LOCAL: sym->symbol.flags |= BSF_LOCAL; break; case STB_GLOBAL: - if (i_sym.st_shndx != SHN_UNDEF - && i_sym.st_shndx != SHN_COMMON) + if (isym->st_shndx != SHN_UNDEF && isym->st_shndx != SHN_COMMON) sym->symbol.flags |= BSF_GLOBAL; break; case STB_WEAK: @@ -1309,7 +1287,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) break; } - switch (ELF_ST_TYPE (i_sym.st_info)) + switch (ELF_ST_TYPE (isym->st_info)) { case STT_SECTION: sym->symbol.flags |= BSF_SECTION_SYM | BSF_DEBUGGING; @@ -1328,31 +1306,24 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) if (dynamic) sym->symbol.flags |= BSF_DYNAMIC; - if (x_versymp != NULL) + if (xver != NULL) { Elf_Internal_Versym iversym; - _bfd_elf_swap_versym_in (abfd, x_versymp + i, &iversym); + _bfd_elf_swap_versym_in (abfd, xver, &iversym); sym->version = iversym.vs_vers; + xver++; } /* Do some backend-specific processing on this symbol. */ - { - struct elf_backend_data *ebd = get_elf_backend_data (abfd); - if (ebd->elf_backend_symbol_processing) - (*ebd->elf_backend_symbol_processing) (abfd, &sym->symbol); - } - - sym++; + if (ebd->elf_backend_symbol_processing) + (*ebd->elf_backend_symbol_processing) (abfd, &sym->symbol); } } /* Do some backend-specific processing on this symbol table. */ - { - struct elf_backend_data *ebd = get_elf_backend_data (abfd); - if (ebd->elf_backend_symbol_table_processing) - (*ebd->elf_backend_symbol_table_processing) (abfd, symbase, symcount); - } + if (ebd->elf_backend_symbol_table_processing) + (*ebd->elf_backend_symbol_table_processing) (abfd, symbase, symcount); /* We rely on the zalloc to clear out the final symbol entry. */ @@ -1372,21 +1343,17 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) *symptrs = 0; /* Final null pointer */ } - if (x_shndx != NULL) - free (x_shndx); - if (x_versymp != NULL) - free (x_versymp); - if (x_symp != NULL) - free (x_symp); + if (xverbuf != NULL) + free (xverbuf); + if (isymbuf != NULL && hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); return symcount; error_return: - if (x_shndx != NULL) - free (x_shndx); - if (x_versymp != NULL) - free (x_versymp); - if (x_symp != NULL) - free (x_symp); + if (xverbuf != NULL) + free (xverbuf); + if (isymbuf != NULL && hdr->contents != (unsigned char *) isymbuf) + free (isymbuf); return -1; } @@ -1695,6 +1662,7 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = { elf_write_out_phdrs, elf_write_shdrs_and_ehdr, elf_write_relocs, + elf_swap_symbol_in, elf_swap_symbol_out, elf_slurp_reloc_table, elf_slurp_symbol_table, diff --git a/bfd/elfcore.h b/bfd/elfcore.h index c206af5..7db5f72 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -1,5 +1,5 @@ /* ELF core file support for BFD. - Copyright 1995, 1996, 1997, 1998, 2000, 2001 + Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -100,7 +100,7 @@ elf_core_file_p (abfd) } /* Check the magic number. */ - if (elf_file_p (&x_ehdr) == false) + if (! elf_file_p (&x_ehdr)) goto wrong; /* FIXME: Check EI_VERSION here ! */ @@ -244,7 +244,7 @@ elf_core_file_p (abfd) information. */ if (ebd->elf_backend_object_p) { - if ((*ebd->elf_backend_object_p) (abfd) == false) + if (! (*ebd->elf_backend_object_p) (abfd)) goto wrong; } diff --git a/bfd/elflink.c b/bfd/elflink.c index e74fae9..f8cc645 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -278,11 +278,13 @@ _bfd_elf_link_record_dynamic_symbol (info, h) } else { - alc = bfd_malloc ((bfd_size_type) (p - name + 1)); + size_t len = p - name + 1; + + alc = bfd_malloc ((bfd_size_type) len); if (alc == NULL) return false; - strncpy (alc, name, (size_t) (p - name)); - alc[p - name] = '\0'; + memcpy (alc, name, len - 1); + alc[len - 1] = '\0'; name = alc; copy = true; } @@ -300,6 +302,98 @@ _bfd_elf_link_record_dynamic_symbol (info, h) return true; } +/* Record a new local dynamic symbol. Returns 0 on failure, 1 on + success, and 2 on a failure caused by attempting to record a symbol + in a discarded section, eg. a discarded link-once section symbol. */ + +int +elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) + struct bfd_link_info *info; + bfd *input_bfd; + long input_indx; +{ + bfd_size_type amt; + struct elf_link_local_dynamic_entry *entry; + struct elf_link_hash_table *eht; + struct elf_strtab_hash *dynstr; + unsigned long dynstr_index; + char *name; + Elf_External_Sym_Shndx eshndx; + char esym[sizeof (Elf64_External_Sym)]; + + if (! is_elf_hash_table (info)) + return 0; + + /* See if the entry exists already. */ + for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next) + if (entry->input_bfd == input_bfd && entry->input_indx == input_indx) + return 1; + + amt = sizeof (*entry); + entry = (struct elf_link_local_dynamic_entry *) bfd_alloc (input_bfd, amt); + if (entry == NULL) + return 0; + + /* Go find the symbol, so that we can find it's name. */ + if (!bfd_elf_get_elf_syms (input_bfd, &elf_tdata (input_bfd)->symtab_hdr, + (size_t) 1, (size_t) input_indx, + &entry->isym, esym, &eshndx)) + { + bfd_release (input_bfd, entry); + return 0; + } + + if (entry->isym.st_shndx != SHN_UNDEF + && (entry->isym.st_shndx < SHN_LORESERVE + || entry->isym.st_shndx > SHN_HIRESERVE)) + { + asection *s; + + s = bfd_section_from_elf_index (input_bfd, entry->isym.st_shndx); + if (s == NULL || bfd_is_abs_section (s->output_section)) + { + /* We can still bfd_release here as nothing has done another + bfd_alloc. We can't do this later in this function. */ + bfd_release (input_bfd, entry); + return 2; + } + } + + name = (bfd_elf_string_from_elf_section + (input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link, + entry->isym.st_name)); + + dynstr = elf_hash_table (info)->dynstr; + if (dynstr == NULL) + { + /* Create a strtab to hold the dynamic symbol names. */ + elf_hash_table (info)->dynstr = dynstr = _bfd_elf_strtab_init (); + if (dynstr == NULL) + return 0; + } + + dynstr_index = _bfd_elf_strtab_add (dynstr, name, false); + if (dynstr_index == (unsigned long) -1) + return 0; + entry->isym.st_name = dynstr_index; + + eht = elf_hash_table (info); + + entry->next = eht->dynlocal; + eht->dynlocal = entry; + entry->input_bfd = input_bfd; + entry->input_indx = input_indx; + eht->dynsymcount++; + + /* Whatever binding the symbol had before, it's now local. */ + entry->isym.st_info + = ELF_ST_INFO (STB_LOCAL, ELF_ST_TYPE (entry->isym.st_info)); + + /* The dynindx will be set at the end of size_dynamic_sections. */ + + return 1; +} + /* Return the dynindex of a local dynamic symbol. */ long @@ -355,7 +449,8 @@ _bfd_elf_link_renumber_dynsyms (output_bfd, info) { asection *p; for (p = output_bfd->sections; p ; p = p->next) - elf_section_data (p)->dynindx = ++dynsymcount; + if ((p->flags & SEC_EXCLUDE) == 0) + elf_section_data (p)->dynindx = ++dynsymcount; } if (elf_hash_table (info)->dynlocal) diff --git a/bfd/elflink.h b/bfd/elflink.h index 5046416..638f80a 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -149,18 +149,13 @@ elf_link_is_defined_archive_symbol (abfd, symdef) carsym * symdef; { Elf_Internal_Shdr * hdr; - Elf_Internal_Shdr * shndx_hdr; - Elf_External_Sym * esym; - Elf_External_Sym * esymend; - Elf_External_Sym * buf = NULL; - Elf_External_Sym_Shndx * shndx_buf = NULL; - Elf_External_Sym_Shndx * shndx; bfd_size_type symcount; bfd_size_type extsymcount; bfd_size_type extsymoff; - boolean result = false; - file_ptr pos; - bfd_size_type amt; + Elf_Internal_Sym *isymbuf; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + boolean result; abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); if (abfd == (bfd *) NULL) @@ -178,15 +173,9 @@ elf_link_is_defined_archive_symbol (abfd, symdef) /* Select the appropriate symbol table. */ if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0) - { - hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - } + hdr = &elf_tdata (abfd)->symtab_hdr; else - { - hdr = &elf_tdata (abfd)->dynsymtab_hdr; - shndx_hdr = NULL; - } + hdr = &elf_tdata (abfd)->dynsymtab_hdr; symcount = hdr->sh_size / sizeof (Elf_External_Sym); @@ -203,58 +192,34 @@ elf_link_is_defined_archive_symbol (abfd, symdef) extsymoff = hdr->sh_info; } - amt = extsymcount * sizeof (Elf_External_Sym); - buf = (Elf_External_Sym *) bfd_malloc (amt); - if (buf == NULL && extsymcount != 0) + if (extsymcount == 0) return false; - /* Read in the symbol table. - FIXME: This ought to be cached somewhere. */ - pos = hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym); - if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) buf, amt, abfd) != amt) - goto error_exit; - - if (shndx_hdr != NULL && shndx_hdr->sh_size != 0) - { - amt = extsymcount * sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL && extsymcount != 0) - goto error_exit; - - pos = shndx_hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym_Shndx); - if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) - goto error_exit; - } + /* Read in the symbol table. */ + isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff, + NULL, NULL, NULL); + if (isymbuf == NULL) + return false; /* Scan the symbol table looking for SYMDEF. */ - esymend = buf + extsymcount; - for (esym = buf, shndx = shndx_buf; - esym < esymend; - esym++, shndx = (shndx != NULL ? shndx + 1 : NULL)) + result = false; + for (isym = isymbuf, isymend = isymbuf + extsymcount; isym < isymend; isym++) { - Elf_Internal_Sym sym; - const char * name; - - elf_swap_symbol_in (abfd, esym, shndx, &sym); + const char *name; - name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, sym.st_name); + name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, + isym->st_name); if (name == (const char *) NULL) break; if (strcmp (name, symdef->name) == 0) { - result = is_global_data_symbol_definition (abfd, & sym); + result = is_global_data_symbol_definition (abfd, isym); break; } } - error_exit: - if (shndx_buf != NULL) - free (shndx_buf); - if (buf != NULL) - free (buf); + free (isymbuf); return result; } @@ -313,12 +278,10 @@ elf_link_add_archive_symbols (abfd, info) return true; amt = c; amt *= sizeof (boolean); - defined = (boolean *) bfd_malloc (amt); - included = (boolean *) bfd_malloc (amt); + defined = (boolean *) bfd_zmalloc (amt); + included = (boolean *) bfd_zmalloc (amt); if (defined == (boolean *) NULL || included == (boolean *) NULL) goto error_return; - memset (defined, 0, (size_t) amt); - memset (included, 0, (size_t) amt); symdefs = bfd_ardata (abfd)->symdefs; @@ -355,26 +318,40 @@ elf_link_add_archive_symbols (abfd, info) if (h == NULL) { char *p, *copy; + size_t len, first; /* If this is a default version (the name contains @@), - look up the symbol again without the version. The - effect is that references to the symbol without the - version will be matched by the default symbol in the - archive. */ + look up the symbol again with only one `@' as well + as without the version. The effect is that references + to the symbol with and without the version will be + matched by the default symbol in the archive. */ p = strchr (symdef->name, ELF_VER_CHR); if (p == NULL || p[1] != ELF_VER_CHR) continue; - copy = bfd_alloc (abfd, (bfd_size_type) (p - symdef->name + 1)); + /* First check with only one `@'. */ + len = strlen (symdef->name); + copy = bfd_alloc (abfd, (bfd_size_type) len); if (copy == NULL) goto error_return; - memcpy (copy, symdef->name, (size_t) (p - symdef->name)); - copy[p - symdef->name] = '\0'; + first = p - symdef->name + 1; + memcpy (copy, symdef->name, first); + memcpy (copy + first, symdef->name + first + 1, len - first); h = elf_link_hash_lookup (elf_hash_table (info), copy, false, false, false); + if (h == NULL) + { + /* We also need to check references to the symbol + without the version. */ + + copy[first - 1] = '\0'; + h = elf_link_hash_lookup (elf_hash_table (info), + copy, false, false, false); + } + bfd_release (abfd, copy); } @@ -922,19 +899,19 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, /* This function is called to create an indirect symbol from the default for the symbol with the default version if needed. The - symbol is described by H, NAME, SYM, SEC, VALUE, and OVERRIDE. We + symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We set DYNSYM if the new indirect symbol is dynamic. DT_NEEDED indicates if it comes from a DT_NEEDED entry of a shared object. */ static boolean -elf_add_default_symbol (abfd, info, h, name, sym, sec, value, +elf_add_default_symbol (abfd, info, h, name, sym, psec, value, dynsym, override, dt_needed) bfd *abfd; struct bfd_link_info *info; struct elf_link_hash_entry *h; const char *name; Elf_Internal_Sym *sym; - asection **sec; + asection **psec; bfd_vma *value; boolean *dynsym; boolean override; @@ -948,6 +925,8 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, boolean collect; boolean dynamic; char *p; + size_t len, shortlen; + asection *sec; /* If this symbol has a version, and it is the default version, we create an indirect symbol from the default name to the fully @@ -960,7 +939,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, if (override) { /* We are overridden by an old defition. We need to check if we - need to crreate the indirect symbol from the default name. */ + need to create the indirect symbol from the default name. */ hi = elf_link_hash_lookup (elf_hash_table (info), name, true, false, false); BFD_ASSERT (hi != NULL); @@ -979,12 +958,12 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, collect = bed->collect; dynamic = (abfd->flags & DYNAMIC) != 0; - shortname = bfd_hash_allocate (&info->hash->table, - (size_t) (p - name + 1)); + shortlen = p - name; + shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1); if (shortname == NULL) return false; - strncpy (shortname, name, (size_t) (p - name)); - shortname [p - name] = '\0'; + memcpy (shortname, name, shortlen); + shortname[shortlen] = '\0'; /* We are going to create a new symbol. Merge it with any existing symbol with this name. For the purposes of the merge, act as @@ -992,7 +971,8 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, actually going to define an indirect symbol. */ type_change_ok = false; size_change_ok = false; - if (! elf_merge_symbol (abfd, info, shortname, sym, sec, value, + sec = *psec; + if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value, &hi, &override, &type_change_ok, &size_change_ok, dt_needed)) return false; @@ -1064,7 +1044,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, | ELF_LINK_HASH_DEF_REGULAR)) == 0); ht = (struct elf_link_hash_entry *) hi->root.u.i.link; - (*bed->elf_backend_copy_indirect_symbol) (ht, hi); + (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi); /* See if the new flags lead us to realize that the symbol must be dynamic. */ @@ -1089,16 +1069,18 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, /* We also need to define an indirection from the nondefault version of the symbol. */ - shortname = bfd_hash_allocate (&info->hash->table, strlen (name)); + len = strlen (name); + shortname = bfd_hash_allocate (&info->hash->table, len); if (shortname == NULL) return false; - strncpy (shortname, name, (size_t) (p - name)); - strcpy (shortname + (p - name), p + 1); + memcpy (shortname, name, shortlen); + memcpy (shortname + shortlen, p + 1, len - shortlen); /* Once again, merge with any existing symbol. */ type_change_ok = false; size_change_ok = false; - if (! elf_merge_symbol (abfd, info, shortname, sym, sec, value, + sec = *psec; + if (! elf_merge_symbol (abfd, info, shortname, sym, &sec, value, &hi, &override, &type_change_ok, &size_change_ok, dt_needed)) return false; @@ -1106,10 +1088,13 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, if (override) { /* Here SHORTNAME is a versioned name, so we don't expect to see - the type of override we do in the case above. */ - (*_bfd_error_handler) - (_("%s: warning: unexpected redefinition of `%s'"), - bfd_archive_filename (abfd), shortname); + the type of override we do in the case above unless it is + overridden by a versioned definiton. */ + if (hi->root.type != bfd_link_hash_defined + && hi->root.type != bfd_link_hash_defweak) + (*_bfd_error_handler) + (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"), + bfd_archive_filename (abfd), shortname); } else { @@ -1131,7 +1116,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, sec, value, & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_DEF_REGULAR)) == 0); - (*bed->elf_backend_copy_indirect_symbol) (h, hi); + (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi); /* See if the new flags lead us to realize that the symbol must be dynamic. */ @@ -1172,25 +1157,20 @@ elf_link_add_object_symbols (abfd, info) asection *, const Elf_Internal_Rela *)); boolean collect; Elf_Internal_Shdr *hdr; - Elf_Internal_Shdr *shndx_hdr; bfd_size_type symcount; bfd_size_type extsymcount; bfd_size_type extsymoff; - Elf_External_Sym *buf = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; - Elf_External_Sym_Shndx *shndx; struct elf_link_hash_entry **sym_hash; boolean dynamic; Elf_External_Versym *extversym = NULL; Elf_External_Versym *ever; - Elf_External_Dyn *dynbuf = NULL; struct elf_link_hash_entry *weaks; - Elf_External_Sym *esym; - Elf_External_Sym *esymend; + Elf_Internal_Sym *isymbuf = NULL; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; struct elf_backend_data *bed; boolean dt_needed; struct elf_link_hash_table * hash_table; - file_ptr pos; bfd_size_type amt; hash_table = elf_hash_table (info); @@ -1289,85 +1269,7 @@ elf_link_add_object_symbols (abfd, info) } } - /* If this is a dynamic object, we always link against the .dynsym - symbol table, not the .symtab symbol table. The dynamic linker - will only see the .dynsym symbol table, so there is no reason to - look at .symtab for a dynamic object. */ - - if (! dynamic || elf_dynsymtab (abfd) == 0) - { - hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - } - else - { - hdr = &elf_tdata (abfd)->dynsymtab_hdr; - shndx_hdr = NULL; - } - - if (dynamic) - { - /* Read in any version definitions. */ - - if (! _bfd_elf_slurp_version_tables (abfd)) - goto error_return; - - /* Read in the symbol versions, but don't bother to convert them - to internal format. */ - if (elf_dynversym (abfd) != 0) - { - Elf_Internal_Shdr *versymhdr; - - versymhdr = &elf_tdata (abfd)->dynversym_hdr; - extversym = (Elf_External_Versym *) bfd_malloc (versymhdr->sh_size); - if (extversym == NULL) - goto error_return; - amt = versymhdr->sh_size; - if (bfd_seek (abfd, versymhdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) extversym, amt, abfd) != amt) - goto error_return; - } - } - - symcount = hdr->sh_size / sizeof (Elf_External_Sym); - - /* The sh_info field of the symtab header tells us where the - external symbols start. We don't care about the local symbols at - this point. */ - if (elf_bad_symtab (abfd)) - { - extsymcount = symcount; - extsymoff = 0; - } - else - { - extsymcount = symcount - hdr->sh_info; - extsymoff = hdr->sh_info; - } - - amt = extsymcount * sizeof (Elf_External_Sym); - buf = (Elf_External_Sym *) bfd_malloc (amt); - if (buf == NULL && extsymcount != 0) - goto error_return; - - if (shndx_hdr != NULL && shndx_hdr->sh_size != 0) - { - amt = extsymcount * sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL && extsymcount != 0) - goto error_return; - } - - /* We store a pointer to the hash table entry for each external - symbol. */ - amt = extsymcount * sizeof (struct elf_link_hash_entry *); - sym_hash = (struct elf_link_hash_entry **) bfd_alloc (abfd, amt); - if (sym_hash == NULL) - goto error_return; - elf_sym_hashes (abfd) = sym_hash; - dt_needed = false; - if (! dynamic) { /* If we are creating a shared library, create all the dynamic @@ -1417,6 +1319,7 @@ elf_link_add_object_symbols (abfd, info) s = bfd_get_section_by_name (abfd, ".dynamic"); if (s != NULL) { + Elf_External_Dyn *dynbuf = NULL; Elf_External_Dyn *extdyn; Elf_External_Dyn *extdynend; int elfsec; @@ -1430,30 +1333,13 @@ elf_link_add_object_symbols (abfd, info) if (! bfd_get_section_contents (abfd, s, (PTR) dynbuf, (file_ptr) 0, s->_raw_size)) - goto error_return; + goto error_free_dyn; elfsec = _bfd_elf_section_from_bfd_section (abfd, s); if (elfsec == -1) - goto error_return; + goto error_free_dyn; shlink = elf_elfsections (abfd)[elfsec]->sh_link; - { - /* The shared libraries distributed with hpux11 have a bogus - sh_link field for the ".dynamic" section. This code detects - when SHLINK refers to a section that is not a string table - and tries to find the string table for the ".dynsym" section - instead. */ - Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[shlink]; - if (shdr->sh_type != SHT_STRTAB) - { - asection *ds = bfd_get_section_by_name (abfd, ".dynsym"); - int elfdsec = _bfd_elf_section_from_bfd_section (abfd, ds); - if (elfdsec == -1) - goto error_return; - shlink = elf_elfsections (abfd)[elfdsec]->sh_link; - } - } - extdyn = dynbuf; extdynend = extdyn + s->_raw_size / sizeof (Elf_External_Dyn); rpath = 0; @@ -1468,7 +1354,7 @@ elf_link_add_object_symbols (abfd, info) unsigned int tagv = dyn.d_un.d_val; name = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (name == NULL) - goto error_return; + goto error_free_dyn; } if (dyn.d_tag == DT_NEEDED) { @@ -1480,11 +1366,12 @@ elf_link_add_object_symbols (abfd, info) n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (n == NULL || fnm == NULL) - goto error_return; - anm = bfd_alloc (abfd, (bfd_size_type) strlen (fnm) + 1); + goto error_free_dyn; + amt = strlen (fnm) + 1; + anm = bfd_alloc (abfd, amt); if (anm == NULL) - goto error_return; - strcpy (anm, fnm); + goto error_free_dyn; + memcpy (anm, fnm, (size_t) amt); n->name = anm; n->by = abfd; n->next = NULL; @@ -1511,11 +1398,12 @@ elf_link_add_object_symbols (abfd, info) n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (n == NULL || fnm == NULL) - goto error_return; - anm = bfd_alloc (abfd, (bfd_size_type) strlen (fnm) + 1); + goto error_free_dyn; + amt = strlen (fnm) + 1; + anm = bfd_alloc (abfd, amt); if (anm == NULL) - goto error_return; - strcpy (anm, fnm); + goto error_free_dyn; + memcpy (anm, fnm, (size_t) amt); n->name = anm; n->by = abfd; n->next = NULL; @@ -1538,11 +1426,16 @@ elf_link_add_object_symbols (abfd, info) n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); if (n == NULL || fnm == NULL) - goto error_return; - anm = bfd_alloc (abfd, (bfd_size_type) strlen (fnm) + 1); + goto error_free_dyn; + amt = strlen (fnm) + 1; + anm = bfd_alloc (abfd, amt); if (anm == NULL) - goto error_return; - strcpy (anm, fnm); + { + error_free_dyn: + free (dynbuf); + goto error_return; + } + memcpy (anm, fnm, (size_t) amt); n->name = anm; n->by = abfd; n->next = NULL; @@ -1556,7 +1449,6 @@ elf_link_add_object_symbols (abfd, info) } free (dynbuf); - dynbuf = NULL; } /* We do not want to include any of the sections in a dynamic @@ -1606,10 +1498,6 @@ elf_link_add_object_symbols (abfd, info) if (dyn.d_tag == DT_NEEDED && dyn.d_un.d_val == strindex) { - if (buf != NULL) - free (buf); - if (extversym != NULL) - free (extversym); _bfd_elf_strtab_delref (hash_table->dynstr, strindex); return true; } @@ -1627,31 +1515,79 @@ elf_link_add_object_symbols (abfd, info) elf_dt_name (abfd) = name; } - pos = hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym); - amt = extsymcount * sizeof (Elf_External_Sym); - if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) buf, amt, abfd) != amt) - goto error_return; + /* If this is a dynamic object, we always link against the .dynsym + symbol table, not the .symtab symbol table. The dynamic linker + will only see the .dynsym symbol table, so there is no reason to + look at .symtab for a dynamic object. */ + + if (! dynamic || elf_dynsymtab (abfd) == 0) + hdr = &elf_tdata (abfd)->symtab_hdr; + else + hdr = &elf_tdata (abfd)->dynsymtab_hdr; + + symcount = hdr->sh_size / sizeof (Elf_External_Sym); - if (shndx_hdr != NULL && shndx_hdr->sh_size != 0) + /* The sh_info field of the symtab header tells us where the + external symbols start. We don't care about the local symbols at + this point. */ + if (elf_bad_symtab (abfd)) { - amt = extsymcount * sizeof (Elf_External_Sym_Shndx); - pos = shndx_hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym_Shndx); - if (bfd_seek (abfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt) + extsymcount = symcount; + extsymoff = 0; + } + else + { + extsymcount = symcount - hdr->sh_info; + extsymoff = hdr->sh_info; + } + + sym_hash = NULL; + if (extsymcount != 0) + { + isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff, + NULL, NULL, NULL); + if (isymbuf == NULL) goto error_return; + + /* We store a pointer to the hash table entry for each external + symbol. */ + amt = extsymcount * sizeof (struct elf_link_hash_entry *); + sym_hash = (struct elf_link_hash_entry **) bfd_alloc (abfd, amt); + if (sym_hash == NULL) + goto error_free_sym; + elf_sym_hashes (abfd) = sym_hash; + } + + if (dynamic) + { + /* Read in any version definitions. */ + if (! _bfd_elf_slurp_version_tables (abfd)) + goto error_free_sym; + + /* Read in the symbol versions, but don't bother to convert them + to internal format. */ + if (elf_dynversym (abfd) != 0) + { + Elf_Internal_Shdr *versymhdr; + + versymhdr = &elf_tdata (abfd)->dynversym_hdr; + extversym = (Elf_External_Versym *) bfd_malloc (versymhdr->sh_size); + if (extversym == NULL) + goto error_free_sym; + amt = versymhdr->sh_size; + if (bfd_seek (abfd, versymhdr->sh_offset, SEEK_SET) != 0 + || bfd_bread ((PTR) extversym, amt, abfd) != amt) + goto error_free_vers; + } } weaks = NULL; ever = extversym != NULL ? extversym + extsymoff : NULL; - esymend = buf + extsymcount; - for (esym = buf, shndx = shndx_buf; - esym < esymend; - esym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL), - shndx = (shndx != NULL ? shndx + 1 : NULL)) + for (isym = isymbuf, isymend = isymbuf + extsymcount; + isym < isymend; + isym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL)) { - Elf_Internal_Sym sym; int bind; bfd_vma value; asection *sec; @@ -1666,14 +1602,12 @@ elf_link_add_object_symbols (abfd, info) override = false; - elf_swap_symbol_in (abfd, esym, shndx, &sym); - flags = BSF_NO_FLAGS; sec = NULL; - value = sym.st_value; + value = isym->st_value; *sym_hash = NULL; - bind = ELF_ST_BIND (sym.st_info); + bind = ELF_ST_BIND (isym->st_info); if (bind == STB_LOCAL) { /* This should be impossible, since ELF requires that all @@ -1684,8 +1618,8 @@ elf_link_add_object_symbols (abfd, info) } else if (bind == STB_GLOBAL) { - if (sym.st_shndx != SHN_UNDEF - && sym.st_shndx != SHN_COMMON) + if (isym->st_shndx != SHN_UNDEF + && isym->st_shndx != SHN_COMMON) flags = BSF_GLOBAL; } else if (bind == STB_WEAK) @@ -1695,35 +1629,37 @@ elf_link_add_object_symbols (abfd, info) /* Leave it up to the processor backend. */ } - if (sym.st_shndx == SHN_UNDEF) + if (isym->st_shndx == SHN_UNDEF) sec = bfd_und_section_ptr; - else if (sym.st_shndx < SHN_LORESERVE || sym.st_shndx > SHN_HIRESERVE) + else if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) { - sec = section_from_elf_index (abfd, sym.st_shndx); + sec = section_from_elf_index (abfd, isym->st_shndx); if (sec == NULL) sec = bfd_abs_section_ptr; else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) value -= sec->vma; } - else if (sym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) sec = bfd_abs_section_ptr; - else if (sym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) { sec = bfd_com_section_ptr; /* What ELF calls the size we call the value. What ELF calls the value we call the alignment. */ - value = sym.st_size; + value = isym->st_size; } else { /* Leave it up to the processor backend. */ } - name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, sym.st_name); + name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, + isym->st_name); if (name == (const char *) NULL) - goto error_return; + goto error_free_vers; - if (sym.st_shndx == SHN_COMMON && ELF_ST_TYPE (sym.st_info) == STT_TLS) + if (isym->st_shndx == SHN_COMMON + && ELF_ST_TYPE (isym->st_info) == STT_TLS) { asection *tcomm = bfd_get_section_by_name (abfd, ".tcommon"); @@ -1735,15 +1671,15 @@ elf_link_add_object_symbols (abfd, info) | SEC_IS_COMMON | SEC_LINKER_CREATED | SEC_THREAD_LOCAL))) - goto error_return; + goto error_free_vers; } sec = tcomm; } else if (add_symbol_hook) { - if (! (*add_symbol_hook) (abfd, info, &sym, &name, &flags, &sec, + if (! (*add_symbol_hook) (abfd, info, isym, &name, &flags, &sec, &value)) - goto error_return; + goto error_free_vers; /* The hook function sets the name to NULL if this symbol should be skipped for some reason. */ @@ -1755,7 +1691,7 @@ elf_link_add_object_symbols (abfd, info) if (sec == (asection *) NULL) { bfd_set_error (bfd_error_bad_value); - goto error_return; + goto error_free_vers; } if (bfd_is_und_section (sec) @@ -1786,11 +1722,10 @@ elf_link_add_object_symbols (abfd, info) || (vernum > 1 && ! bfd_is_abs_section (sec))) { const char *verstr; - unsigned int namelen; - bfd_size_type newlen; + size_t namelen, verlen, newlen; char *newname, *p; - if (sym.st_shndx != SHN_UNDEF) + if (isym->st_shndx != SHN_UNDEF) { if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info) { @@ -1799,7 +1734,7 @@ elf_link_add_object_symbols (abfd, info) bfd_archive_filename (abfd), name, vernum, elf_tdata (abfd)->dynverdef_hdr.sh_info); bfd_set_error (bfd_error_bad_value); - goto error_return; + goto error_free_vers; } else if (vernum > 1) verstr = @@ -1839,37 +1774,39 @@ elf_link_add_object_symbols (abfd, info) (_("%s: %s: invalid needed version %d"), bfd_archive_filename (abfd), name, vernum); bfd_set_error (bfd_error_bad_value); - goto error_return; + goto error_free_vers; } } namelen = strlen (name); - newlen = namelen + strlen (verstr) + 2; - if ((iver.vs_vers & VERSYM_HIDDEN) == 0) + verlen = strlen (verstr); + newlen = namelen + verlen + 2; + if ((iver.vs_vers & VERSYM_HIDDEN) == 0 + && isym->st_shndx != SHN_UNDEF) ++newlen; - newname = (char *) bfd_alloc (abfd, newlen); + newname = (char *) bfd_alloc (abfd, (bfd_size_type) newlen); if (newname == NULL) - goto error_return; - strcpy (newname, name); + goto error_free_vers; + memcpy (newname, name, namelen); p = newname + namelen; *p++ = ELF_VER_CHR; /* If this is a defined non-hidden version symbol, we add another @ to the name. This indicates the default version of the symbol. */ if ((iver.vs_vers & VERSYM_HIDDEN) == 0 - && sym.st_shndx != SHN_UNDEF) + && isym->st_shndx != SHN_UNDEF) *p++ = ELF_VER_CHR; - strcpy (p, verstr); + memcpy (p, verstr, verlen + 1); name = newname; } } - if (! elf_merge_symbol (abfd, info, name, &sym, &sec, &value, + if (! elf_merge_symbol (abfd, info, name, isym, &sec, &value, sym_hash, &override, &type_change_ok, &size_change_ok, dt_needed)) - goto error_return; + goto error_free_vers; if (override) definition = false; @@ -1897,7 +1834,7 @@ elf_link_add_object_symbols (abfd, info) if (! (_bfd_generic_link_add_one_symbol (info, abfd, name, flags, sec, value, (const char *) NULL, false, collect, (struct bfd_link_hash_entry **) sym_hash))) - goto error_return; + goto error_free_vers; h = *sym_hash; while (h->root.type == bfd_link_hash_indirect @@ -1909,7 +1846,7 @@ elf_link_add_object_symbols (abfd, info) if (dynamic && definition && (flags & BSF_WEAK) != 0 - && ELF_ST_TYPE (sym.st_info) != STT_FUNC + && ELF_ST_TYPE (isym->st_info) != STT_FUNC && info->hash->creator->flavour == bfd_target_elf_flavour && h->weakdef == NULL) { @@ -1931,16 +1868,16 @@ elf_link_add_object_symbols (abfd, info) } /* Set the alignment of a common symbol. */ - if (sym.st_shndx == SHN_COMMON + if (isym->st_shndx == SHN_COMMON && h->root.type == bfd_link_hash_common) { unsigned int align; - align = bfd_log2 (sym.st_value); + align = bfd_log2 (isym->st_value); if (align > old_alignment /* Permit an alignment power of zero if an alignment of one is specified and no other alignments have been specified. */ - || (sym.st_value == 1 && old_alignment == 0)) + || (isym->st_value == 1 && old_alignment == 0)) h->root.u.c.p->alignment_power = align; } @@ -1951,16 +1888,16 @@ elf_link_add_object_symbols (abfd, info) int new_flag; /* Remember the symbol size and type. */ - if (sym.st_size != 0 + if (isym->st_size != 0 && (definition || h->size == 0)) { - if (h->size != 0 && h->size != sym.st_size && ! size_change_ok) + if (h->size != 0 && h->size != isym->st_size && ! size_change_ok) (*_bfd_error_handler) (_("Warning: size of symbol `%s' changed from %lu to %lu in %s"), - name, (unsigned long) h->size, (unsigned long) sym.st_size, - bfd_archive_filename (abfd)); + name, (unsigned long) h->size, + (unsigned long) isym->st_size, bfd_archive_filename (abfd)); - h->size = sym.st_size; + h->size = isym->st_size; } /* If this is a common symbol, then we always want H->SIZE @@ -1971,37 +1908,37 @@ elf_link_add_object_symbols (abfd, info) if (h->root.type == bfd_link_hash_common) h->size = h->root.u.c.size; - if (ELF_ST_TYPE (sym.st_info) != STT_NOTYPE + if (ELF_ST_TYPE (isym->st_info) != STT_NOTYPE && (definition || h->type == STT_NOTYPE)) { if (h->type != STT_NOTYPE - && h->type != ELF_ST_TYPE (sym.st_info) + && h->type != ELF_ST_TYPE (isym->st_info) && ! type_change_ok) (*_bfd_error_handler) (_("Warning: type of symbol `%s' changed from %d to %d in %s"), - name, h->type, ELF_ST_TYPE (sym.st_info), + name, h->type, ELF_ST_TYPE (isym->st_info), bfd_archive_filename (abfd)); - h->type = ELF_ST_TYPE (sym.st_info); + h->type = ELF_ST_TYPE (isym->st_info); } /* If st_other has a processor-specific meaning, specific code might be needed here. */ - if (sym.st_other != 0) + if (isym->st_other != 0) { /* Combine visibilities, using the most constraining one. */ unsigned char hvis = ELF_ST_VISIBILITY (h->other); - unsigned char symvis = ELF_ST_VISIBILITY (sym.st_other); + unsigned char symvis = ELF_ST_VISIBILITY (isym->st_other); if (symvis && (hvis > symvis || hvis == 0)) - h->other = sym.st_other; + h->other = isym->st_other; /* If neither has visibility, use the st_other of the definition. This is an arbitrary choice, since the other bits have no general meaning. */ if (!symvis && !hvis && (definition || h->other == 0)) - h->other = sym.st_other; + h->other = isym->st_other; } /* Set a flag in the hash table entry indicating the type of @@ -2045,21 +1982,21 @@ elf_link_add_object_symbols (abfd, info) /* Check to see if we need to add an indirect symbol for the default name. */ if (definition || h->root.type == bfd_link_hash_common) - if (! elf_add_default_symbol (abfd, info, h, name, &sym, + if (! elf_add_default_symbol (abfd, info, h, name, isym, &sec, &value, &dynsym, override, dt_needed)) - goto error_return; + goto error_free_vers; if (dynsym && h->dynindx == -1) { if (! _bfd_elf_link_record_dynamic_symbol (info, h)) - goto error_return; + goto error_free_vers; if (h->weakdef != NULL && ! new_weakdef && h->weakdef->dynindx == -1) { if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef)) - goto error_return; + goto error_free_vers; } } else if (dynsym && h->dynindx != -1) @@ -2082,7 +2019,7 @@ elf_link_add_object_symbols (abfd, info) bfd_size_type strindex; if (! is_elf_hash_table (info)) - goto error_return; + goto error_free_vers; /* The symbol from a DT_NEEDED object is referenced from the regular object to create a dynamic executable. We @@ -2093,7 +2030,7 @@ elf_link_add_object_symbols (abfd, info) strindex = _bfd_elf_strtab_add (hash_table->dynstr, elf_dt_soname (abfd), false); if (strindex == (bfd_size_type) -1) - goto error_return; + goto error_free_vers; if (oldsize == _bfd_elf_strtab_size (hash_table->dynstr)) { @@ -2119,11 +2056,21 @@ elf_link_add_object_symbols (abfd, info) } if (! elf_add_dynamic_entry (info, (bfd_vma) DT_NEEDED, strindex)) - goto error_return; + goto error_free_vers; } } } + if (extversym != NULL) + { + free (extversym); + extversym = NULL; + } + + if (isymbuf != NULL) + free (isymbuf); + isymbuf = NULL; + /* Now set the weakdefs field correctly for all the weak defined symbols we found. The only way to do this is to search all the symbols. Since we only need the information for non functions in @@ -2191,24 +2138,11 @@ elf_link_add_object_symbols (abfd, info) if (! _bfd_elf_link_record_dynamic_symbol (info, hlook)) goto error_return; } - break; } } } - if (buf != NULL) - { - free (buf); - buf = NULL; - } - - if (extversym != NULL) - { - free (extversym); - extversym = NULL; - } - /* If this object is the same format as the output object, and it is not a shared library, then let the backend look through the relocs. @@ -2254,7 +2188,7 @@ elf_link_add_object_symbols (abfd, info) ok = (*check_relocs) (abfd, info, o, internal_relocs); - if (! info->keep_memory) + if (elf_section_data (o)->relocs != internal_relocs) free (internal_relocs); if (! ok) @@ -2317,15 +2251,29 @@ elf_link_add_object_symbols (abfd, info) } } + if (is_elf_hash_table (info)) + { + /* Add this bfd to the loaded list. */ + struct elf_link_loaded_list *n; + + n = ((struct elf_link_loaded_list *) + bfd_alloc (abfd, sizeof (struct elf_link_loaded_list))); + if (n == NULL) + goto error_return; + n->abfd = abfd; + n->next = hash_table->loaded; + hash_table->loaded = n; + } + return true; - error_return: - if (buf != NULL) - free (buf); - if (dynbuf != NULL) - free (dynbuf); + error_free_vers: if (extversym != NULL) free (extversym); + error_free_sym: + if (isymbuf != NULL) + free (isymbuf); + error_return: return false; } @@ -2506,92 +2454,6 @@ elf_add_dynamic_entry (info, tag, val) return true; } - -/* Record a new local dynamic symbol. */ - -boolean -elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) - struct bfd_link_info *info; - bfd *input_bfd; - long input_indx; -{ - struct elf_link_local_dynamic_entry *entry; - struct elf_link_hash_table *eht; - struct elf_strtab_hash *dynstr; - Elf_External_Sym esym; - Elf_External_Sym_Shndx eshndx; - Elf_External_Sym_Shndx *shndx; - unsigned long dynstr_index; - char *name; - file_ptr pos; - bfd_size_type amt; - - if (! is_elf_hash_table (info)) - return false; - - /* See if the entry exists already. */ - for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next) - if (entry->input_bfd == input_bfd && entry->input_indx == input_indx) - return true; - - entry = (struct elf_link_local_dynamic_entry *) - bfd_alloc (input_bfd, (bfd_size_type) sizeof (*entry)); - if (entry == NULL) - return false; - - /* Go find the symbol, so that we can find it's name. */ - amt = sizeof (Elf_External_Sym); - pos = elf_tdata (input_bfd)->symtab_hdr.sh_offset + input_indx * amt; - if (bfd_seek (input_bfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) &esym, amt, input_bfd) != amt) - return false; - shndx = NULL; - if (elf_tdata (input_bfd)->symtab_shndx_hdr.sh_size != 0) - { - amt = sizeof (Elf_External_Sym_Shndx); - pos = elf_tdata (input_bfd)->symtab_shndx_hdr.sh_offset; - pos += input_indx * amt; - shndx = &eshndx; - if (bfd_seek (input_bfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx, amt, input_bfd) != amt) - return false; - } - elf_swap_symbol_in (input_bfd, &esym, shndx, &entry->isym); - - name = (bfd_elf_string_from_elf_section - (input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link, - entry->isym.st_name)); - - dynstr = elf_hash_table (info)->dynstr; - if (dynstr == NULL) - { - /* Create a strtab to hold the dynamic symbol names. */ - elf_hash_table (info)->dynstr = dynstr = _bfd_elf_strtab_init (); - if (dynstr == NULL) - return false; - } - - dynstr_index = _bfd_elf_strtab_add (dynstr, name, false); - if (dynstr_index == (unsigned long) -1) - return false; - entry->isym.st_name = dynstr_index; - - eht = elf_hash_table (info); - - entry->next = eht->dynlocal; - eht->dynlocal = entry; - entry->input_bfd = input_bfd; - entry->input_indx = input_indx; - eht->dynsymcount++; - - /* Whatever binding the symbol had before, it's now local. */ - entry->isym.st_info - = ELF_ST_INFO (STB_LOCAL, ELF_ST_TYPE (entry->isym.st_info)); - - /* The dynindx will be set at the end of size_dynamic_sections. */ - - return true; -} /* Read and swap the relocs from the section indicated by SHDR. This may be either a REL or a RELA section. The relocations are @@ -2909,11 +2771,11 @@ compute_bucket_count (info) elf_link_hash_traverse (elf_hash_table (info), elf_collect_hash_codes, &hashcodesp); -/* We have a problem here. The following code to optimize the table - size requires an integer type with more the 32 bits. If - BFD_HOST_U_64_BIT is set we know about such a type. */ + /* We have a problem here. The following code to optimize the table + size requires an integer type with more the 32 bits. If + BFD_HOST_U_64_BIT is set we know about such a type. */ #ifdef BFD_HOST_U_64_BIT - if (info->optimize == true) + if (info->optimize) { unsigned long int nsyms = hashcodesp - hashcodes; size_t minsize; @@ -3054,7 +2916,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, return true; if (! is_elf_hash_table (info)) - return false; + return true; /* Any syms created from now on start with -1 in got.refcount/offset and plt.refcount/offset. */ @@ -3082,6 +2944,9 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, struct elf_info_failed eif; struct elf_link_hash_entry *h; asection *dynstr; + struct bfd_elf_version_tree *t; + struct bfd_elf_version_expr *d; + boolean all_defined; *sinterpptr = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (*sinterpptr != NULL || info->shared); @@ -3162,6 +3027,57 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, return false; } + /* Make all global versions with definiton. */ + for (t = verdefs; t != NULL; t = t->next) + for (d = t->globals; d != NULL; d = d->next) + if (!d->symver && strchr (d->pattern, '*') == NULL) + { + const char *verstr, *name; + size_t namelen, verlen, newlen; + char *newname, *p; + struct elf_link_hash_entry *newh; + + name = d->pattern; + namelen = strlen (name); + verstr = t->name; + verlen = strlen (verstr); + newlen = namelen + verlen + 3; + + newname = (char *) bfd_malloc ((bfd_size_type) newlen); + if (newname == NULL) + return false; + memcpy (newname, name, namelen); + + /* Check the hidden versioned definition. */ + p = newname + namelen; + *p++ = ELF_VER_CHR; + memcpy (p, verstr, verlen + 1); + newh = elf_link_hash_lookup (elf_hash_table (info), + newname, false, false, + false); + if (newh == NULL + || (newh->root.type != bfd_link_hash_defined + && newh->root.type != bfd_link_hash_defweak)) + { + /* Check the default versioned definition. */ + *p++ = ELF_VER_CHR; + memcpy (p, verstr, verlen + 1); + newh = elf_link_hash_lookup (elf_hash_table (info), + newname, false, false, + false); + } + free (newname); + + /* Mark this version if there is a definition and it is + not defined in a shared object. */ + if (newh != NULL + && ((newh->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) == 0) + && (newh->root.type == bfd_link_hash_defined + || newh->root.type == bfd_link_hash_defweak)) + d->symver = 1; + } + /* Attach all the symbols to their version information. */ asvinfo.output_bfd = output_bfd; asvinfo.info = info; @@ -3174,6 +3090,28 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (asvinfo.failed) return false; + if (!info->allow_undefined_version) + { + /* Check if all global versions have a definiton. */ + all_defined = true; + for (t = verdefs; t != NULL; t = t->next) + for (d = t->globals; d != NULL; d = d->next) + if (!d->symver && !d->script + && strchr (d->pattern, '*') == NULL) + { + (*_bfd_error_handler) + (_("%s: undefined version: %s"), + d->pattern, t->name); + all_defined = false; + } + + if (!all_defined) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + } + /* Find all symbols which were defined in a dynamic object and make the backend pick a reasonable value for them. */ elf_link_hash_traverse (elf_hash_table (info), @@ -3229,7 +3167,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, { (*_bfd_error_handler) (_("%s: .preinit_array section is not allowed in DSO"), - bfd_archive_filename (sub)); + bfd_archive_filename (sub)); break; } @@ -3664,10 +3602,9 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, BFD_ASSERT (s != NULL); hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize; s->_raw_size = ((2 + bucketcount + dynsymcount) * hash_entry_size); - s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size); if (s->contents == NULL) return false; - memset (s->contents, 0, (size_t) s->_raw_size); bfd_put (8 * hash_entry_size, output_bfd, (bfd_vma) bucketcount, s->contents); @@ -3966,7 +3903,7 @@ elf_fix_symbol_flags (h, eif) struct elf_backend_data *bed; bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); - (*bed->elf_backend_copy_indirect_symbol) (weakdef, h); + (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h); } } @@ -4086,7 +4023,7 @@ elf_adjust_dynamic_symbol (h, data) && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0) (*_bfd_error_handler) (_("warning: type and size of dynamic symbol `%s' are not defined"), - h->root.root.string); + h->root.root.string); dynobj = elf_hash_table (eif->info)->dynobj; bed = get_elf_backend_data (dynobj); @@ -4146,7 +4083,7 @@ elf_export_symbol (h, data) if (!eif->verdefs) { -doit: + doit: if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h)) { eif->failed = true; @@ -4313,7 +4250,7 @@ elf_link_assign_sym_version (h, data) alc = bfd_malloc ((bfd_size_type) len); if (alc == NULL) return false; - strncpy (alc, h->root.root.string, len - 1); + memcpy (alc, h->root.root.string, len - 1); alc[len - 1] = '\0'; if (alc[len - 2] == ELF_VER_CHR) alc[len - 2] = '\0'; @@ -4416,45 +4353,58 @@ elf_link_assign_sym_version (h, data) if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL) { struct bfd_elf_version_tree *t; - struct bfd_elf_version_tree *deflt; + struct bfd_elf_version_tree *local_ver; struct bfd_elf_version_expr *d; /* See if can find what version this symbol is in. If the symbol is supposed to be local, then don't actually register it. */ - deflt = NULL; + local_ver = NULL; for (t = sinfo->verdefs; t != NULL; t = t->next) { if (t->globals != NULL) { + boolean matched; + + matched = false; for (d = t->globals; d != NULL; d = d->next) { if ((*d->match) (d, h->root.root.string)) { - h->verinfo.vertree = t; - break; + if (d->symver) + matched = true; + else + { + /* There is a version without definition. Make + the symbol the default definition for this + version. */ + h->verinfo.vertree = t; + local_ver = NULL; + d->script = 1; + break; + } } } if (d != NULL) break; + else if (matched) + /* There is no undefined version for this symbol. Hide the + default one. */ + (*bed->elf_backend_hide_symbol) (info, h, true); } if (t->locals != NULL) { for (d = t->locals; d != NULL; d = d->next) { + /* If the match is "*", keep looking for a more + explicit, perhaps even global, match. */ if (d->pattern[0] == '*' && d->pattern[1] == '\0') - deflt = t; + local_ver = t; else if ((*d->match) (d, h->root.root.string)) { - h->verinfo.vertree = t; - if (h->dynindx != -1 - && info->shared - && ! info->export_dynamic) - { - (*bed->elf_backend_hide_symbol) (info, h, true); - } + local_ver = t; break; } } @@ -4464,9 +4414,9 @@ elf_link_assign_sym_version (h, data) } } - if (deflt != NULL && h->verinfo.vertree == NULL) + if (local_ver != NULL) { - h->verinfo.vertree = deflt; + h->verinfo.vertree = local_ver; if (h->dynindx != -1 && info->shared && ! info->export_dynamic) @@ -4538,6 +4488,8 @@ static boolean elf_link_output_extsym PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_link_sec_merge_syms PARAMS ((struct elf_link_hash_entry *, PTR)); +static boolean elf_link_check_versioned_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean elf_link_input_bfd PARAMS ((struct elf_final_link_info *, bfd *)); static boolean elf_reloc_link_order @@ -4681,7 +4633,7 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) for (j = 0; j < bed->s->int_rels_per_ext_rel; j++) irela[j].r_info = ELF_R_INFO ((*rel_hash)->indx, - ELF_R_TYPE (irela[j].r_info)); + ELF_R_TYPE (irela[j].r_info)); if (bed->s->swap_reloca_out) (*bed->s->swap_reloca_out) (abfd, irela, (bfd_byte *) erela); @@ -4694,10 +4646,12 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) free (irela); } -struct elf_link_sort_rela { +struct elf_link_sort_rela +{ bfd_vma offset; enum elf_reloc_type_class type; - union { + union + { Elf_Internal_Rel rel; Elf_Internal_Rela rela; } u; @@ -5033,7 +4987,7 @@ elf_bfd_final_link (abfd, info) o->reloc_count += (*bed->elf_backend_count_relocs) (sec, relocs); - if (!info->keep_memory) + if (elf_section_data (o)->relocs != relocs) free (relocs); } @@ -5371,7 +5325,7 @@ elf_bfd_final_link (abfd, info) size = 0; for (o = sec->link_order_head; o != NULL; o = o->next) if (size < o->offset + o->size) - size = o->offset + o->size; + size = o->offset + o->size; } end = sec->vma + size; } @@ -5510,8 +5464,8 @@ elf_bfd_final_link (abfd, info) sym = e->isym; if (e->isym.st_shndx != SHN_UNDEF - && (e->isym.st_shndx < SHN_LORESERVE - || e->isym.st_shndx > SHN_HIRESERVE)) + && (e->isym.st_shndx < SHN_LORESERVE + || e->isym.st_shndx > SHN_HIRESERVE)) { s = bfd_section_from_elf_index (e->input_bfd, e->isym.st_shndx); @@ -5694,7 +5648,13 @@ elf_bfd_final_link (abfd, info) name = ".fini_array"; get_size: o = bfd_get_section_by_name (abfd, name); - BFD_ASSERT (o != NULL); + if (o == NULL) + { + (*_bfd_error_handler) + (_("%s: could not find output section %s"), + bfd_get_filename (abfd), name); + goto error_return; + } if (o->_raw_size == 0) (*_bfd_error_handler) (_("warning: %s section has zero size"), name); @@ -5731,7 +5691,13 @@ elf_bfd_final_link (abfd, info) name = ".gnu.version"; get_vma: o = bfd_get_section_by_name (abfd, name); - BFD_ASSERT (o != NULL); + if (o == NULL) + { + (*_bfd_error_handler) + (_("%s: could not find output section %s"), + bfd_get_filename (abfd), name); + goto error_return; + } dyn.d_un.d_ptr = o->vma; elf_swap_dyn_out (dynobj, &dyn, dyncon); break; @@ -5810,6 +5776,15 @@ elf_bfd_final_link (abfd, info) } } + if (info->relocateable) + { + boolean failed = false; + + bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed); + if (failed) + goto error_return; + } + /* If we have optimized stabs strings, output them. */ if (elf_hash_table (info)->stab_info != NULL) { @@ -6023,6 +5998,127 @@ elf_link_sec_merge_syms (h, data) return true; } +/* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in + allowing an unsatisfied unversioned symbol in the DSO to match a + versioned symbol that would normally require an explicit version. */ + +static boolean +elf_link_check_versioned_symbol (info, h) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; +{ + bfd *undef_bfd = h->root.u.undef.abfd; + struct elf_link_loaded_list *loaded; + + if ((undef_bfd->flags & DYNAMIC) == 0 + || info->hash->creator->flavour != bfd_target_elf_flavour + || elf_dt_soname (h->root.u.undef.abfd) == NULL) + return false; + + for (loaded = elf_hash_table (info)->loaded; + loaded != NULL; + loaded = loaded->next) + { + bfd *input; + Elf_Internal_Shdr *hdr; + bfd_size_type symcount; + bfd_size_type extsymcount; + bfd_size_type extsymoff; + Elf_Internal_Shdr *versymhdr; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + Elf_Internal_Sym *isymbuf; + Elf_External_Versym *ever; + Elf_External_Versym *extversym; + + input = loaded->abfd; + + /* We check each DSO for a possible hidden versioned definition. */ + if (input == undef_bfd + || (input->flags & DYNAMIC) == 0 + || elf_dynversym (input) == 0) + continue; + + hdr = &elf_tdata (input)->dynsymtab_hdr; + + symcount = hdr->sh_size / sizeof (Elf_External_Sym); + if (elf_bad_symtab (input)) + { + extsymcount = symcount; + extsymoff = 0; + } + else + { + extsymcount = symcount - hdr->sh_info; + extsymoff = hdr->sh_info; + } + + if (extsymcount == 0) + continue; + + isymbuf = bfd_elf_get_elf_syms (input, hdr, extsymcount, extsymoff, + NULL, NULL, NULL); + if (isymbuf == NULL) + return false; + + /* Read in any version definitions. */ + versymhdr = &elf_tdata (input)->dynversym_hdr; + extversym = (Elf_External_Versym *) bfd_malloc (versymhdr->sh_size); + if (extversym == NULL) + goto error_ret; + + if (bfd_seek (input, versymhdr->sh_offset, SEEK_SET) != 0 + || (bfd_bread ((PTR) extversym, versymhdr->sh_size, input) + != versymhdr->sh_size)) + { + free (extversym); + error_ret: + free (isymbuf); + return false; + } + + ever = extversym + extsymoff; + isymend = isymbuf + extsymcount; + for (isym = isymbuf; isym < isymend; isym++, ever++) + { + const char *name; + Elf_Internal_Versym iver; + + if (ELF_ST_BIND (isym->st_info) == STB_LOCAL + || isym->st_shndx == SHN_UNDEF) + continue; + + name = bfd_elf_string_from_elf_section (input, + hdr->sh_link, + isym->st_name); + if (strcmp (name, h->root.root.string) != 0) + continue; + + _bfd_elf_swap_versym_in (input, ever, &iver); + + if ((iver.vs_vers & VERSYM_HIDDEN) == 0) + { + /* If we have a non-hidden versioned sym, then it should + have provided a definition for the undefined sym. */ + abort (); + } + + if ((iver.vs_vers & VERSYM_VERSION) == 2) + { + /* This is the oldest (default) sym. We can use it. */ + free (extversym); + free (isymbuf); + return true; + } + } + + free (extversym); + free (isymbuf); + } + + return false; +} + /* Add an external symbol to the symbol table. This is called from the hash table traversal routine. When generating a shared object, we go through the symbol table twice. The first time we output @@ -6072,7 +6168,8 @@ elf_link_output_extsym (h, data) && ! finfo->info->shared && h->root.type == bfd_link_hash_undefined && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0) + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0 + && ! elf_link_check_versioned_symbol (finfo->info, h)) { if (! ((*finfo->info->callbacks->undefined_symbol) (finfo->info, h->root.root.string, h->root.u.undef.abfd, @@ -6245,8 +6342,8 @@ elf_link_output_extsym (h, data) sym.st_other ^= ELF_ST_VISIBILITY (sym.st_other); /* If this symbol should be put in the .dynsym section, then put it - there now. We have already know the symbol index. We also fill - in the entry in the .hash section. */ + there now. We already know the symbol index. We also fill in + the entry in the .hash section. */ if (h->dynindx != -1 && elf_hash_table (finfo->info)->dynamic_sections_created) { @@ -6305,7 +6402,7 @@ elf_link_output_extsym (h, data) /* If we're stripping it, then it was just a dynamic symbol, and there's nothing else to do. */ - if (strip) + if (strip || (input_sec->flags & SEC_EXCLUDE) != 0) return true; h->indx = bfd_get_symcount (finfo->output_bfd); @@ -6357,19 +6454,19 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, } else { - (*_bfd_error_handler) ( - _("%s: relocation size mismatch in %s section %s"), - bfd_get_filename (output_bfd), - bfd_archive_filename (input_section->owner), - input_section->name); + (*_bfd_error_handler) + (_("%s: relocation size mismatch in %s section %s"), + bfd_get_filename (output_bfd), + bfd_archive_filename (input_section->owner), + input_section->name); bfd_set_error (bfd_error_wrong_object_format); return false; } bed = get_elf_backend_data (output_bfd); irela = internal_relocs; - irelaend = irela + NUM_SHDR_ENTRIES (input_rel_hdr) - * bed->s->int_rels_per_ext_rel; + irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr) + * bed->s->int_rels_per_ext_rel); if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel)) { @@ -6441,15 +6538,11 @@ elf_link_input_bfd (finfo, input_bfd) Elf_Internal_Sym *, asection **)); bfd *output_bfd; Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; size_t locsymcount; size_t extsymoff; - Elf_External_Sym *external_syms; - Elf_External_Sym *esym; - Elf_External_Sym *esymend; - Elf_External_Sym_Shndx *shndx_buf; - Elf_External_Sym_Shndx *shndx; + Elf_Internal_Sym *isymbuf; Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; long *pindex; asection **ppsection; asection *o; @@ -6484,44 +6577,29 @@ elf_link_input_bfd (finfo, input_bfd) } /* Read the local symbols. */ - if (symtab_hdr->contents != NULL) - external_syms = (Elf_External_Sym *) symtab_hdr->contents; - else if (locsymcount == 0) - external_syms = NULL; - else - { - bfd_size_type amt = locsymcount * sizeof (Elf_External_Sym); - external_syms = finfo->external_syms; - if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (external_syms, amt, input_bfd) != amt) + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL && locsymcount != 0) + { + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0, + finfo->internal_syms, + finfo->external_syms, + finfo->locsym_shndx); + if (isymbuf == NULL) return false; } - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; - shndx_buf = NULL; - if (shndx_hdr->sh_size != 0 && locsymcount != 0) - { - bfd_size_type amt = locsymcount * sizeof (Elf_External_Sym_Shndx); - shndx_buf = finfo->locsym_shndx; - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (shndx_buf, amt, input_bfd) != amt) - return false; - } - - /* Swap in the local symbols and write out the ones which we know - are going into the output file. */ - for (esym = external_syms, esymend = esym + locsymcount, - isym = finfo->internal_syms, pindex = finfo->indices, - ppsection = finfo->sections, shndx = shndx_buf; - esym < esymend; - esym++, isym++, pindex++, ppsection++, - shndx = (shndx != NULL ? shndx + 1 : NULL)) + /* Find local symbol sections and adjust values of symbols in + SEC_MERGE sections. Write out those local symbols we know are + going into the output file. */ + isymend = isymbuf + locsymcount; + for (isym = isymbuf, pindex = finfo->indices, ppsection = finfo->sections; + isym < isymend; + isym++, pindex++, ppsection++) { asection *isec; const char *name; Elf_Internal_Sym osym; - elf_swap_symbol_in (input_bfd, esym, shndx, isym); *pindex = -1; if (elf_bad_symtab (input_bfd)) @@ -6560,7 +6638,7 @@ elf_link_input_bfd (finfo, input_bfd) *ppsection = isec; /* Don't output the first, undefined, symbol. */ - if (esym == external_syms) + if (ppsection == finfo->sections) continue; if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) @@ -6830,7 +6908,7 @@ elf_link_input_bfd (finfo, input_bfd) if (! (*relocate_section) (output_bfd, finfo->info, input_bfd, o, contents, internal_relocs, - finfo->internal_syms, + isymbuf, finfo->sections)) return false; @@ -6839,7 +6917,7 @@ elf_link_input_bfd (finfo, input_bfd) Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; struct elf_link_hash_entry **rel_hash; - Elf_Internal_Shdr *input_rel_hdr; + Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2; unsigned int next_erel; boolean (*reloc_emitter) PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, @@ -6862,6 +6940,7 @@ elf_link_input_bfd (finfo, input_bfd) { unsigned long r_symndx; asection *sec; + Elf_Internal_Sym sym; if (next_erel == bed->s->int_rels_per_ext_rel) { @@ -6914,9 +6993,9 @@ elf_link_input_bfd (finfo, input_bfd) /* This is a reloc against a local symbol. */ *rel_hash = NULL; - isym = finfo->internal_syms + r_symndx; + sym = isymbuf[r_symndx]; sec = finfo->sections[r_symndx]; - if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) + if (ELF_ST_TYPE (sym.st_info) == STT_SECTION) { /* I suppose the backend ought to fill in the section of any STT_SECTION symbol against a @@ -6939,7 +7018,7 @@ elf_link_input_bfd (finfo, input_bfd) } /* Adjust the addend according to where the - section winds up in the output section. */ + section winds up in the output section. */ if (rela_normal) irela->r_addend += sec->output_offset; } @@ -6963,34 +7042,34 @@ elf_link_input_bfd (finfo, input_bfd) must output it now. */ shlink = symtab_hdr->sh_link; name = (bfd_elf_string_from_elf_section - (input_bfd, shlink, isym->st_name)); + (input_bfd, shlink, sym.st_name)); if (name == NULL) return false; osec = sec->output_section; - isym->st_shndx = + sym.st_shndx = _bfd_elf_section_from_bfd_section (output_bfd, osec); - if (isym->st_shndx == SHN_BAD) + if (sym.st_shndx == SHN_BAD) return false; - isym->st_value += sec->output_offset; + sym.st_value += sec->output_offset; if (! finfo->info->relocateable) { - isym->st_value += osec->vma; - if (ELF_ST_TYPE (isym->st_info) == STT_TLS) + sym.st_value += osec->vma; + if (ELF_ST_TYPE (sym.st_info) == STT_TLS) { /* STT_TLS symbols are relative to PT_TLS segment base. */ BFD_ASSERT (finfo->first_tls_sec != NULL); - isym->st_value -= finfo->first_tls_sec->vma; + sym.st_value -= finfo->first_tls_sec->vma; } } finfo->indices[r_symndx] = bfd_get_symcount (output_bfd); - if (! elf_link_output_sym (finfo, name, isym, sec)) + if (! elf_link_output_sym (finfo, name, &sym, sec)) return false; } @@ -7009,20 +7088,20 @@ elf_link_input_bfd (finfo, input_bfd) else reloc_emitter = elf_link_output_relocs; - if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr, - internal_relocs)) + if (input_rel_hdr->sh_size != 0 + && ! (*reloc_emitter) (output_bfd, o, input_rel_hdr, + internal_relocs)) return false; - input_rel_hdr = elf_section_data (o)->rel_hdr2; - if (input_rel_hdr) + input_rel_hdr2 = elf_section_data (o)->rel_hdr2; + if (input_rel_hdr2 && input_rel_hdr2->sh_size != 0) { internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr) * bed->s->int_rels_per_ext_rel); - if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr, + if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr2, internal_relocs)) return false; } - } } @@ -7539,28 +7618,27 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, /* Garbage collect unused sections. */ static boolean elf_gc_mark - PARAMS ((struct bfd_link_info *info, asection *sec, - asection * (*gc_mark_hook) - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)))); + PARAMS ((struct bfd_link_info *, asection *, + asection * (*) (asection *, struct bfd_link_info *, + Elf_Internal_Rela *, struct elf_link_hash_entry *, + Elf_Internal_Sym *))); static boolean elf_gc_sweep - PARAMS ((struct bfd_link_info *info, - boolean (*gc_sweep_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, - const Elf_Internal_Rela *relocs)))); + PARAMS ((struct bfd_link_info *, + boolean (*) (bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *))); static boolean elf_gc_sweep_symbol - PARAMS ((struct elf_link_hash_entry *h, PTR idxptr)); + PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_gc_allocate_got_offsets - PARAMS ((struct elf_link_hash_entry *h, PTR offarg)); + PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_gc_propagate_vtable_entries_used - PARAMS ((struct elf_link_hash_entry *h, PTR dummy)); + PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_gc_smash_unused_vtentry_relocs - PARAMS ((struct elf_link_hash_entry *h, PTR dummy)); + PARAMS ((struct elf_link_hash_entry *, PTR)); /* The mark phase of garbage collection. For a given section, mark it and any sections in this section's group, and all the sections @@ -7570,9 +7648,10 @@ static boolean elf_gc_mark (info, sec, gc_mark_hook) struct bfd_link_info *info; asection *sec; - asection * (*gc_mark_hook) - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); + asection * (*gc_mark_hook) PARAMS ((asection *, struct bfd_link_info *, + Elf_Internal_Rela *, + struct elf_link_hash_entry *, + Elf_Internal_Sym *)); { boolean ret; asection *group_sec; @@ -7591,17 +7670,12 @@ elf_gc_mark (info, sec, gc_mark_hook) { Elf_Internal_Rela *relstart, *rel, *relend; Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; struct elf_link_hash_entry **sym_hashes; size_t nlocsyms; size_t extsymoff; - Elf_External_Sym *locsyms, *freesyms = NULL; - Elf_External_Sym_Shndx *locsym_shndx; bfd *input_bfd = sec->owner; struct elf_backend_data *bed = get_elf_backend_data (input_bfd); - - /* GCFIXME: how to arrange so that relocs and symbols are not - reread continually? */ + Elf_Internal_Sym *isym = NULL; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -7615,37 +7689,18 @@ elf_gc_mark (info, sec, gc_mark_hook) else extsymoff = nlocsyms = symtab_hdr->sh_info; - if (symtab_hdr->contents) - locsyms = (Elf_External_Sym *) symtab_hdr->contents; - else if (nlocsyms == 0) - locsyms = NULL; - else + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isym == NULL && nlocsyms != 0) { - bfd_size_type amt = nlocsyms * sizeof (Elf_External_Sym); - locsyms = freesyms = bfd_malloc (amt); - if (freesyms == NULL - || bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (locsyms, amt, input_bfd) != amt) - { - ret = false; - goto out1; - } - } - - shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr; - locsym_shndx = NULL; - if (shndx_hdr->sh_size != 0 && nlocsyms != 0) - { - bfd_size_type amt = nlocsyms * sizeof (Elf_External_Sym_Shndx); - locsym_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (locsym_shndx, amt, input_bfd) != amt) + isym = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, nlocsyms, 0, + NULL, NULL, NULL); + if (isym == NULL) return false; } /* Read the relocations. */ relstart = (NAME(_bfd_elf,link_read_relocs) - (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, + (input_bfd, sec, NULL, (Elf_Internal_Rela *) NULL, info->keep_memory)); if (relstart == NULL) { @@ -7659,38 +7714,20 @@ elf_gc_mark (info, sec, gc_mark_hook) unsigned long r_symndx; asection *rsec; struct elf_link_hash_entry *h; - Elf_Internal_Sym s; r_symndx = ELF_R_SYM (rel->r_info); if (r_symndx == 0) continue; - if (elf_bad_symtab (sec->owner)) - { - elf_swap_symbol_in (input_bfd, - locsyms + r_symndx, - locsym_shndx + (locsym_shndx ? r_symndx : 0), - &s); - if (ELF_ST_BIND (s.st_info) == STB_LOCAL) - rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); - else - { - h = sym_hashes[r_symndx - extsymoff]; - rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL); - } - } - else if (r_symndx >= nlocsyms) + if (r_symndx >= nlocsyms + || ELF_ST_BIND (isym[r_symndx].st_info) != STB_LOCAL) { h = sym_hashes[r_symndx - extsymoff]; - rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL); + rsec = (*gc_mark_hook) (sec, info, rel, h, NULL); } else { - elf_swap_symbol_in (input_bfd, - locsyms + r_symndx, - locsym_shndx + (locsym_shndx ? r_symndx : 0), - &s); - rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); + rsec = (*gc_mark_hook) (sec, info, rel, NULL, &isym[r_symndx]); } if (rsec && !rsec->gc_mark) @@ -7706,11 +7743,16 @@ elf_gc_mark (info, sec, gc_mark_hook) } out2: - if (!info->keep_memory) + if (elf_section_data (sec)->relocs != relstart) free (relstart); out1: - if (freesyms) - free (freesyms); + if (isym != NULL && symtab_hdr->contents != (unsigned char *) isym) + { + if (! info->keep_memory) + free (isym); + else + symtab_hdr->contents = (unsigned char *) isym; + } } return ret; @@ -7721,9 +7763,8 @@ elf_gc_mark (info, sec, gc_mark_hook) static boolean elf_gc_sweep (info, gc_sweep_hook) struct bfd_link_info *info; - boolean (*gc_sweep_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, - const Elf_Internal_Rela *relocs)); + boolean (*gc_sweep_hook) PARAMS ((bfd *, struct bfd_link_info *, + asection *, const Elf_Internal_Rela *)); { bfd *sub; @@ -7767,7 +7808,7 @@ elf_gc_sweep (info, gc_sweep_hook) r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs); - if (!info->keep_memory) + if (elf_section_data (o)->relocs != internal_relocs) free (internal_relocs); if (!r) @@ -7938,7 +7979,7 @@ elf_gc_sections (abfd, info) boolean ok = true; bfd *sub; asection * (*gc_mark_hook) - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *h, Elf_Internal_Sym *)); if (!get_elf_backend_data (abfd)->can_gc_sections @@ -8265,7 +8306,6 @@ elf_reloc_symbol_deleted_p (offset, cookie) for (; rcookie->rel < rcookie->relend; rcookie->rel++) { unsigned long r_symndx = ELF_R_SYM (rcookie->rel->r_info); - Elf_Internal_Sym isym; if (! rcookie->bad_symtab) if (rcookie->rel->r_offset > offset) @@ -8273,21 +8313,8 @@ elf_reloc_symbol_deleted_p (offset, cookie) if (rcookie->rel->r_offset != offset) continue; - if (rcookie->locsyms && r_symndx < rcookie->locsymcount) - { - Elf_External_Sym *lsym; - Elf_External_Sym_Shndx *lshndx; - - lsym = (Elf_External_Sym *) rcookie->locsyms + r_symndx; - lshndx = (Elf_External_Sym_Shndx *) rcookie->locsym_shndx; - if (lshndx != NULL) - lshndx += r_symndx; - elf_swap_symbol_in (rcookie->abfd, lsym, lshndx, &isym); - } - if (r_symndx >= rcookie->locsymcount - || (rcookie->locsyms - && ELF_ST_BIND (isym.st_info) != STB_LOCAL)) + || ELF_ST_BIND (rcookie->locsyms[r_symndx].st_info) != STB_LOCAL) { struct elf_link_hash_entry *h; @@ -8304,17 +8331,19 @@ elf_reloc_symbol_deleted_p (offset, cookie) else return false; } - else if (rcookie->locsyms) + else { /* It's not a relocation against a global symbol, but it could be a relocation against a local symbol for a discarded section. */ asection *isec; + Elf_Internal_Sym *isym; /* Need to: get the symbol; get the section. */ - if (isym.st_shndx < SHN_LORESERVE || isym.st_shndx > SHN_HIRESERVE) + isym = &rcookie->locsyms[r_symndx]; + if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) { - isec = section_from_elf_index (rcookie->abfd, isym.st_shndx); + isec = section_from_elf_index (rcookie->abfd, isym->st_shndx); if (isec != NULL && elf_discarded_section (isec)) return true; } @@ -8337,8 +8366,6 @@ elf_bfd_discard_info (output_bfd, info) struct elf_reloc_cookie cookie; asection *stab, *eh, *ehdr; Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; - Elf_External_Sym *freesyms; struct elf_backend_data *bed; bfd *abfd; boolean ret = false; @@ -8389,8 +8416,6 @@ elf_bfd_discard_info (output_bfd, info) continue; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - cookie.abfd = abfd; cookie.sym_hashes = elf_sym_hashes (abfd); cookie.bad_symtab = elf_bad_symtab (abfd); @@ -8406,48 +8431,20 @@ elf_bfd_discard_info (output_bfd, info) cookie.extsymoff = symtab_hdr->sh_info; } - freesyms = NULL; - if (symtab_hdr->contents) - cookie.locsyms = (void *) symtab_hdr->contents; - else if (cookie.locsymcount == 0) - cookie.locsyms = NULL; - else + cookie.locsyms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (cookie.locsyms == NULL && cookie.locsymcount != 0) { - bfd_size_type amt = cookie.locsymcount * sizeof (Elf_External_Sym); - cookie.locsyms = bfd_malloc (amt); + cookie.locsyms = bfd_elf_get_elf_syms (abfd, symtab_hdr, + cookie.locsymcount, 0, + NULL, NULL, NULL); if (cookie.locsyms == NULL) return false; - freesyms = cookie.locsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (cookie.locsyms, amt, abfd) != amt) - { - error_ret_free_loc: - free (cookie.locsyms); - return false; - } - } - - cookie.locsym_shndx = NULL; - if (shndx_hdr->sh_size != 0 && cookie.locsymcount != 0) - { - bfd_size_type amt; - amt = cookie.locsymcount * sizeof (Elf_External_Sym_Shndx); - cookie.locsym_shndx = bfd_malloc (amt); - if (cookie.locsym_shndx == NULL) - goto error_ret_free_loc; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (cookie.locsym_shndx, amt, abfd) != amt) - { - free (cookie.locsym_shndx); - goto error_ret_free_loc; - } } if (stab) { cookie.rels = (NAME(_bfd_elf,link_read_relocs) - (abfd, stab, (PTR) NULL, - (Elf_Internal_Rela *) NULL, + (abfd, stab, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->keep_memory)); if (cookie.rels) { @@ -8459,7 +8456,7 @@ elf_bfd_discard_info (output_bfd, info) elf_reloc_symbol_deleted_p, &cookie)) ret = true; - if (! info->keep_memory) + if (elf_section_data (stab)->relocs != cookie.rels) free (cookie.rels); } } @@ -8483,7 +8480,7 @@ elf_bfd_discard_info (output_bfd, info) elf_reloc_symbol_deleted_p, &cookie)) ret = true; - if (! info->keep_memory) + if (cookie.rels && elf_section_data (eh)->relocs != cookie.rels) free (cookie.rels); } @@ -8493,11 +8490,14 @@ elf_bfd_discard_info (output_bfd, info) ret = true; } - if (cookie.locsym_shndx != NULL) - free (cookie.locsym_shndx); - - if (freesyms != NULL) - free (freesyms); + if (cookie.locsyms != NULL + && symtab_hdr->contents != (unsigned char *) cookie.locsyms) + { + if (! info->keep_memory) + free (cookie.locsyms); + else + symtab_hdr->contents = (unsigned char *) cookie.locsyms; + } } if (ehdr && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info, ehdr)) diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c new file mode 100644 index 0000000..040fddf --- /dev/null +++ b/bfd/elfn32-mips.c @@ -0,0 +1,2230 @@ +/* MIPS-specific support for 32-bit ELF + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + + Most of the information added by Ian Lance Taylor, Cygnus Support, + <ian@cygnus.com>. + N32/64 ABI support added by Mark Mitchell, CodeSourcery, LLC. + <mark@codesourcery.com> + Traditional MIPS targets support added by Koundinya.K, Dansk Data + Elektronik & Operations Research Group. <kk@ddeorg.soft.net> + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This file handles MIPS ELF targets. SGI Irix 5 uses a slightly + different MIPS ELF from other targets. This matters when linking. + This file supports both, switching at runtime. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "bfdlink.h" +#include "genlink.h" +#include "elf-bfd.h" +#include "elfxx-mips.h" +#include "elf/mips.h" + +/* Get the ECOFF swapping routines. */ +#include "coff/sym.h" +#include "coff/symconst.h" +#include "coff/internal.h" +#include "coff/ecoff.h" +#include "coff/mips.h" +#define ECOFF_SIGNED_32 +#include "ecoffswap.h" + +static bfd_reloc_status_type mips_elf_generic_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips_elf_hi16_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips_elf_lo16_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips_elf_got16_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static boolean mips_elf_assign_gp PARAMS ((bfd *, bfd_vma *)); +static bfd_reloc_status_type mips_elf_final_gp + PARAMS ((bfd *, asymbol *, boolean, char **, bfd_vma *)); +static bfd_reloc_status_type mips_elf_gprel16_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips_elf_literal_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips_elf_gprel32_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type gprel32_with_gp + PARAMS ((bfd *, asymbol *, arelent *, asection *, boolean, PTR, bfd_vma)); +static bfd_reloc_status_type mips_elf_shift6_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips16_jump_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type mips16_gprel_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +static reloc_howto_type *mips_elf_n32_rtype_to_howto + PARAMS ((unsigned int, boolean)); +static void mips_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); +static void mips_info_to_howto_rela + PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *)); +static boolean mips_elf_n32_object_p PARAMS ((bfd *)); +static boolean elf32_mips_grok_prstatus + PARAMS ((bfd *, Elf_Internal_Note *)); +static boolean elf32_mips_grok_psinfo + PARAMS ((bfd *, Elf_Internal_Note *)); +static irix_compat_t elf_n32_mips_irix_compat + PARAMS ((bfd *)); + +extern const bfd_target bfd_elf32_nbigmips_vec; +extern const bfd_target bfd_elf32_nlittlemips_vec; + +static bfd_vma prev_reloc_address = -1; +static bfd_vma prev_reloc_addend = 0; + +/* Nonzero if ABFD is using the N32 ABI. */ +#define ABI_N32_P(abfd) \ + ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0) + +/* Whether we are trying to be compatible with IRIX at all. */ +#define SGI_COMPAT(abfd) \ + (elf_n32_mips_irix_compat (abfd) != ict_none) + +/* The number of local .got entries we reserve. */ +#define MIPS_RESERVED_GOTNO (2) + +/* In case we're on a 32-bit machine, construct a 64-bit "-1" value + from smaller values. Start with zero, widen, *then* decrement. */ +#define MINUS_ONE (((bfd_vma)0) - 1) + +/* The relocation table used for SHT_REL sections. */ + +static reloc_howto_type elf_mips_howto_table_rel[] = +{ + /* No relocation. */ + HOWTO (R_MIPS_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit relocation. */ + HOWTO (R_MIPS_16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit relocation. */ + HOWTO (R_MIPS_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit symbol relative relocation. */ + HOWTO (R_MIPS_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_REL32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 26 bit jump address. */ + HOWTO (R_MIPS_26, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + /* This needs complex overflow + detection, because the upper four + bits must match the PC + 4. */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_26", /* name */ + true, /* partial_inplace */ + 0x03ffffff, /* src_mask */ + 0x03ffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* R_MIPS_HI16 and R_MIPS_LO16 are unsupported for NewABI REL. + However, the native IRIX6 tools use them, so we try our best. */ + + /* High 16 bits of symbol value. */ + HOWTO (R_MIPS_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_hi16_reloc, /* special_function */ + "R_MIPS_HI16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Low 16 bits of symbol value. */ + HOWTO (R_MIPS_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_lo16_reloc, /* special_function */ + "R_MIPS_LO16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* GP relative reference. */ + HOWTO (R_MIPS_GPREL16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_gprel16_reloc, /* special_function */ + "R_MIPS_GPREL16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Reference to literal section. */ + HOWTO (R_MIPS_LITERAL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_literal_reloc, /* special_function */ + "R_MIPS_LITERAL", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Reference to global offset table. */ + HOWTO (R_MIPS_GOT16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_got16_reloc, /* special_function */ + "R_MIPS_GOT16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit PC relative reference. */ + HOWTO (R_MIPS_PC16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 16 bit call through global offset table. */ + HOWTO (R_MIPS_CALL16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_CALL16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit GP relative reference. */ + HOWTO (R_MIPS_GPREL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_gprel32_reloc, /* special_function */ + "R_MIPS_GPREL32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The remaining relocs are defined on Irix 5, although they are + not defined by the ABI. */ + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + + /* A 5 bit shift field. */ + HOWTO (R_MIPS_SHIFT5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + false, /* pc_relative */ + 6, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_SHIFT5", /* name */ + true, /* partial_inplace */ + 0x000007c0, /* src_mask */ + 0x000007c0, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 6 bit shift field. */ + HOWTO (R_MIPS_SHIFT6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + false, /* pc_relative */ + 6, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + mips_elf_shift6_reloc, /* special_function */ + "R_MIPS_SHIFT6", /* name */ + true, /* partial_inplace */ + 0x000007c4, /* src_mask */ + 0x000007c4, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 64 bit relocation. */ + HOWTO (R_MIPS_64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_64", /* name */ + true, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* Displacement in the global offset table. */ + HOWTO (R_MIPS_GOT_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_DISP", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Displacement to page pointer in the global offset table. */ + HOWTO (R_MIPS_GOT_PAGE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_PAGE", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Offset from page pointer in the global offset table. */ + HOWTO (R_MIPS_GOT_OFST, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_OFST", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* High 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_GOT_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_HI16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Low 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_GOT_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_LO16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64 bit subtraction. */ + HOWTO (R_MIPS_SUB, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_SUB", /* name */ + true, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* Insert the addend as an instruction. */ + /* FIXME: Not handled correctly. */ + HOWTO (R_MIPS_INSERT_A, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_INSERT_A", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Insert the addend as an instruction, and change all relocations + to refer to the old instruction at the address. */ + /* FIXME: Not handled correctly. */ + HOWTO (R_MIPS_INSERT_B, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_INSERT_B", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Delete a 32 bit instruction. */ + /* FIXME: Not handled correctly. */ + HOWTO (R_MIPS_DELETE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_DELETE", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* The MIPS ELF64 ABI Draft wants us to support these for REL relocations. + We don't, because + a) It means building the addend from a R_MIPS_HIGHEST/R_MIPS_HIGHER/ + R_MIPS_HI16/R_MIPS_LO16 sequence with varying ordering, using + fallable heuristics. + b) No other NEwABI toolchain actually emits such relocations. */ + EMPTY_HOWTO (R_MIPS_HIGHER), + EMPTY_HOWTO (R_MIPS_HIGHEST), + + /* High 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_CALL_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_CALL_HI16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Low 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_CALL_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_CALL_LO16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Section displacement. */ + HOWTO (R_MIPS_SCN_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_SCN_DISP", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_MIPS_REL16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_REL16", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* These two are obsolete. */ + EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE), + EMPTY_HOWTO (R_MIPS_PJUMP), + + /* Similiar to R_MIPS_REL32, but used for relocations in a GOT section. + It must be used for multigot GOT's (and only there). */ + HOWTO (R_MIPS_RELGOT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_RELGOT", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Protected jump conversion. This is an optimization hint. No + relocation is required for correctness. */ + HOWTO (R_MIPS_JALR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_JALR", /* name */ + false, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x00000000, /* dst_mask */ + false), /* pcrel_offset */ +}; + +/* The relocation table used for SHT_RELA sections. */ + +static reloc_howto_type elf_mips_howto_table_rela[] = +{ + /* No relocation. */ + HOWTO (R_MIPS_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit relocation. */ + HOWTO (R_MIPS_16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit relocation. */ + HOWTO (R_MIPS_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit symbol relative relocation. */ + HOWTO (R_MIPS_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_REL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 26 bit jump address. */ + HOWTO (R_MIPS_26, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + /* This needs complex overflow + detection, because the upper 36 + bits must match the PC + 4. */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_26", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x03ffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* High 16 bits of symbol value. */ + HOWTO (R_MIPS_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_HI16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Low 16 bits of symbol value. */ + HOWTO (R_MIPS_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_LO16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* GP relative reference. */ + HOWTO (R_MIPS_GPREL16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_gprel16_reloc, /* special_function */ + "R_MIPS_GPREL16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Reference to literal section. */ + HOWTO (R_MIPS_LITERAL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_literal_reloc, /* special_function */ + "R_MIPS_LITERAL", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Reference to global offset table. */ + HOWTO (R_MIPS_GOT16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_got16_reloc, /* special_function */ + "R_MIPS_GOT16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit PC relative reference. */ + HOWTO (R_MIPS_PC16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 16 bit call through global offset table. */ + HOWTO (R_MIPS_CALL16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_CALL16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit GP relative reference. */ + HOWTO (R_MIPS_GPREL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_gprel32_reloc, /* special_function */ + "R_MIPS_GPREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + + /* A 5 bit shift field. */ + HOWTO (R_MIPS_SHIFT5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + false, /* pc_relative */ + 6, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_SHIFT5", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x000007c0, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 6 bit shift field. */ + HOWTO (R_MIPS_SHIFT6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + false, /* pc_relative */ + 6, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + mips_elf_shift6_reloc, /* special_function */ + "R_MIPS_SHIFT6", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x000007c4, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64 bit relocation. */ + HOWTO (R_MIPS_64, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_64", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* Displacement in the global offset table. */ + HOWTO (R_MIPS_GOT_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_DISP", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Displacement to page pointer in the global offset table. */ + HOWTO (R_MIPS_GOT_PAGE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_PAGE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Offset from page pointer in the global offset table. */ + HOWTO (R_MIPS_GOT_OFST, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_OFST", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* High 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_GOT_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_HI16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Low 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_GOT_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_GOT_LO16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 64 bit substraction. */ + HOWTO (R_MIPS_SUB, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_SUB", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false), /* pcrel_offset */ + + /* Insert the addend as an instruction. */ + /* FIXME: Not handled correctly. */ + HOWTO (R_MIPS_INSERT_A, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_INSERT_A", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Insert the addend as an instruction, and change all relocations + to refer to the old instruction at the address. */ + /* FIXME: Not handled correctly. */ + HOWTO (R_MIPS_INSERT_B, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_INSERT_B", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Delete a 32 bit instruction. */ + /* FIXME: Not handled correctly. */ + HOWTO (R_MIPS_DELETE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_DELETE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Get the higher value of a 64 bit addend. */ + HOWTO (R_MIPS_HIGHER, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_HIGHER", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Get the highest value of a 64 bit addend. */ + HOWTO (R_MIPS_HIGHEST, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_HIGHEST", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* High 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_CALL_HI16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_CALL_HI16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Low 16 bits of displacement in global offset table. */ + HOWTO (R_MIPS_CALL_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_CALL_LO16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Section displacement, used by an associated event location section. */ + HOWTO (R_MIPS_SCN_DISP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_SCN_DISP", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit relocation. */ + HOWTO (R_MIPS_REL16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_REL16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* These two are obsolete. */ + EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE), + EMPTY_HOWTO (R_MIPS_PJUMP), + + /* Similiar to R_MIPS_REL32, but used for relocations in a GOT section. + It must be used for multigot GOT's (and only there). */ + HOWTO (R_MIPS_RELGOT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_RELGOT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Protected jump conversion. This is an optimization hint. No + relocation is required for correctness. */ + HOWTO (R_MIPS_JALR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + mips_elf_generic_reloc, /* special_function */ + "R_MIPS_JALR", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ +}; + +/* The reloc used for the mips16 jump instruction. */ +static reloc_howto_type elf_mips16_jump_howto = + HOWTO (R_MIPS16_26, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + /* This needs complex overflow + detection, because the upper four + bits must match the PC. */ + mips16_jump_reloc, /* special_function */ + "R_MIPS16_26", /* name */ + true, /* partial_inplace */ + 0x3ffffff, /* src_mask */ + 0x3ffffff, /* dst_mask */ + false); /* pcrel_offset */ + +/* The reloc used for the mips16 gprel instruction. */ +static reloc_howto_type elf_mips16_gprel_howto = + HOWTO (R_MIPS16_GPREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + mips16_gprel_reloc, /* special_function */ + "R_MIPS16_GPREL", /* name */ + true, /* partial_inplace */ + 0x07ff001f, /* src_mask */ + 0x07ff001f, /* dst_mask */ + false); /* pcrel_offset */ + +/* GNU extension to record C++ vtable hierarchy */ +static reloc_howto_type elf_mips_gnu_vtinherit_howto = + HOWTO (R_MIPS_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_MIPS_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false); /* pcrel_offset */ + +/* GNU extension to record C++ vtable member usage */ +static reloc_howto_type elf_mips_gnu_vtentry_howto = + HOWTO (R_MIPS_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_MIPS_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false); /* pcrel_offset */ + +/* This is derived from bfd_elf_generic_reloc. NewABI allows us to have + several relocations against the same address. The addend is derived + from the addends of preceding relocations. If we don't need to + do something special, we simply keep track of the addend. */ + +#define GET_RELOC_ADDEND(obfd, sym, entry, sec) \ +{ \ + /* If we're relocating, and this is an external symbol, we don't \ + want to change anything. */ \ + if (obfd != (bfd *) NULL \ + && (sym->flags & BSF_SECTION_SYM) == 0 \ + && (! entry->howto->partial_inplace \ + || entry->addend == 0)) \ + { \ + entry->address += sec->output_offset; \ + return bfd_reloc_ok; \ + } \ + \ + /* The addend of combined relocs is remembered and left for \ + subsequent relocs. */ \ + if (prev_reloc_address != reloc_entry->address) \ + { \ + prev_reloc_address = reloc_entry->address; \ + prev_reloc_addend = reloc_entry->addend; \ + } \ + else \ + reloc_entry->addend = prev_reloc_addend; \ +} + +#define SET_RELOC_ADDEND(entry) \ +{ \ + prev_reloc_addend = entry->addend; \ +} + +static bfd_reloc_status_type +mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + return bfd_reloc_continue; +} + +/* Do a R_MIPS_HI16 relocation. This has to be done in combination + with a R_MIPS_LO16 reloc, because there is a carry from the LO16 to + the HI16. Here we just save the information we need; we do the + actual relocation when we see the LO16. + + MIPS ELF requires that the LO16 immediately follow the HI16. As a + GNU extension, for non-pc-relative relocations, we permit an + arbitrary number of HI16 relocs to be associated with a single LO16 + reloc. This extension permits gcc to output the HI and LO relocs + itself. + + This cannot be done for PC-relative relocations because both the HI16 + and LO16 parts of the relocations must be done relative to the LO16 + part, and there can be carry to or borrow from the HI16 part. */ + +struct mips_hi16 +{ + struct mips_hi16 *next; + bfd_byte *addr; + bfd_vma addend; +}; + +/* FIXME: This should not be a static variable. */ + +static struct mips_hi16 *mips_hi16_list; + +static bfd_reloc_status_type +mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + bfd_reloc_status_type ret; + bfd_vma relocation; + struct mips_hi16 *n; + + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + ret = bfd_reloc_ok; + + if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL) + ret = bfd_reloc_undefined; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + relocation += reloc_entry->addend; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + /* Save the information, and let LO16 do the actual relocation. */ + n = (struct mips_hi16 *) bfd_malloc ((bfd_size_type) sizeof *n); + if (n == NULL) + return bfd_reloc_outofrange; + n->addr = (bfd_byte *) data + reloc_entry->address; + n->addend = relocation; + n->next = mips_hi16_list; + mips_hi16_list = n; + + if (output_bfd != (bfd *) NULL) + reloc_entry->address += input_section->output_offset; + + return ret; +} + +/* Do a R_MIPS_LO16 relocation. This is a straightforward 16 bit + inplace relocation; this function exists in order to do the + R_MIPS_HI16 relocation described above. */ + +static bfd_reloc_status_type +mips_elf_lo16_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + if (mips_hi16_list != NULL) + { + struct mips_hi16 *l; + + l = mips_hi16_list; + while (l != NULL) + { + unsigned long insn; + unsigned long val; + unsigned long vallo; + struct mips_hi16 *next; + + /* Do the HI16 relocation. Note that we actually don't need + to know anything about the LO16 itself, except where to + find the low 16 bits of the addend needed by the LO16. */ + insn = bfd_get_32 (abfd, l->addr); + vallo = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + /* The low order 16 bits are always treated as a signed + value. */ + vallo = ((vallo & 0xffff) ^ 0x8000) - 0x8000; + val = ((insn & 0xffff) << 16) + vallo; + val += l->addend; + + /* If PC-relative, we need to subtract out the address of the LO + half of the HI/LO. (The actual relocation is relative + to that instruction.) */ + if (reloc_entry->howto->pc_relative) + val -= reloc_entry->address; + + /* At this point, "val" has the value of the combined HI/LO + pair. If the low order 16 bits (which will be used for + the LO16 insn) are negative, then we will need an + adjustment for the high order 16 bits. */ + val += 0x8000; + val = (val >> 16) & 0xffff; + + insn &= ~ (bfd_vma) 0xffff; + insn |= val; + bfd_put_32 (abfd, (bfd_vma) insn, l->addr); + + next = l->next; + free (l); + l = next; + } + + mips_hi16_list = NULL; + } + + /* Now do the LO16 reloc in the usual way. */ + return mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); +} + +/* Do a R_MIPS_GOT16 reloc. This is a reloc against the global offset + table used for PIC code. If the symbol is an external symbol, the + instruction is modified to contain the offset of the appropriate + entry in the global offset table. If the symbol is a section + symbol, the next reloc is a R_MIPS_LO16 reloc. The two 16 bit + addends are combined to form the real addend against the section + symbol; the GOT16 is modified to contain the offset of an entry in + the global offset table, and the LO16 is modified to offset it + appropriately. Thus an offset larger than 16 bits requires a + modified value in the global offset table. + + This implementation suffices for the assembler, but the linker does + not yet know how to create global offset tables. */ + +static bfd_reloc_status_type +mips_elf_got16_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + /* If we're relocating, and this is a local symbol, we can handle it + just like HI16. */ + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) != 0) + return mips_elf_hi16_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); + + /* Otherwise we try to handle it as R_MIPS_GOT_DISP. */ + return mips_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); +} + +/* Set the GP value for OUTPUT_BFD. Returns false if this is a + dangerous relocation. */ + +static boolean +mips_elf_assign_gp (output_bfd, pgp) + bfd *output_bfd; + bfd_vma *pgp; +{ + unsigned int count; + asymbol **sym; + unsigned int i; + + /* If we've already figured out what GP will be, just return it. */ + *pgp = _bfd_get_gp_value (output_bfd); + if (*pgp) + return true; + + count = bfd_get_symcount (output_bfd); + sym = bfd_get_outsymbols (output_bfd); + + /* The linker script will have created a symbol named `_gp' with the + appropriate value. */ + if (sym == (asymbol **) NULL) + i = count; + else + { + for (i = 0; i < count; i++, sym++) + { + register const char *name; + + name = bfd_asymbol_name (*sym); + if (*name == '_' && strcmp (name, "_gp") == 0) + { + *pgp = bfd_asymbol_value (*sym); + _bfd_set_gp_value (output_bfd, *pgp); + break; + } + } + } + + if (i >= count) + { + /* Only get the error once. */ + *pgp = 4; + _bfd_set_gp_value (output_bfd, *pgp); + return false; + } + + return true; +} + +/* We have to figure out the gp value, so that we can adjust the + symbol value correctly. We look up the symbol _gp in the output + BFD. If we can't find it, we're stuck. We cache it in the ELF + target data. We don't need to adjust the symbol value for an + external symbol if we are producing relocateable output. */ + +static bfd_reloc_status_type +mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp) + bfd *output_bfd; + asymbol *symbol; + boolean relocateable; + char **error_message; + bfd_vma *pgp; +{ + if (bfd_is_und_section (symbol->section) + && ! relocateable) + { + *pgp = 0; + return bfd_reloc_undefined; + } + + *pgp = _bfd_get_gp_value (output_bfd); + if (*pgp == 0 + && (! relocateable + || (symbol->flags & BSF_SECTION_SYM) != 0)) + { + if (relocateable) + { + /* Make up a value. */ + *pgp = symbol->section->output_section->vma + 0x4000; + _bfd_set_gp_value (output_bfd, *pgp); + } + else if (!mips_elf_assign_gp (output_bfd, pgp)) + { + *error_message = + (char *) _("GP relative relocation when _gp not defined"); + return bfd_reloc_dangerous; + } + } + + return bfd_reloc_ok; +} + +/* Do a R_MIPS_GPREL16 relocation. This is a 16 bit value which must + become the offset from the gp register. */ + +static bfd_reloc_status_type +mips_elf_gprel16_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + boolean relocateable; + bfd_reloc_status_type ret; + bfd_vma gp; + + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + if (output_bfd != (bfd *) NULL) + relocateable = true; + else + { + relocateable = false; + output_bfd = symbol->section->output_section->owner; + } + + ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + &gp); + if (ret != bfd_reloc_ok) + return ret; + + return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, + input_section, relocateable, + data, gp); +} + +/* Do a R_MIPS_LITERAL relocation. */ + +static bfd_reloc_status_type +mips_elf_literal_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + boolean relocateable; + bfd_reloc_status_type ret; + bfd_vma gp; + + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + /* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */ + if (output_bfd != (bfd *) NULL) + relocateable = true; + else + { + relocateable = false; + output_bfd = symbol->section->output_section->owner; + } + + ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + &gp); + if (ret != bfd_reloc_ok) + return ret; + + return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, + input_section, relocateable, + data, gp); +} + +/* Do a R_MIPS_GPREL32 relocation. This is a 32 bit value which must + become the offset from the gp register. */ + +static bfd_reloc_status_type +mips_elf_gprel32_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + boolean relocateable; + bfd_reloc_status_type ret; + bfd_vma gp; + + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + /* R_MIPS_GPREL32 relocations are defined for local symbols only. + We will only have an addend if this is a newly created reloc, + not read from an ELF file. */ + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && reloc_entry->addend == 0) + { + *error_message = (char *) + _("32bits gp relative relocation occurs for an external symbol"); + return bfd_reloc_outofrange; + } + + if (output_bfd != (bfd *) NULL) + { + relocateable = true; + gp = _bfd_get_gp_value (output_bfd); + } + else + { + relocateable = false; + output_bfd = symbol->section->output_section->owner; + + ret = mips_elf_final_gp (output_bfd, symbol, relocateable, + error_message, &gp); + if (ret != bfd_reloc_ok) + return ret; + } + + return gprel32_with_gp (abfd, symbol, reloc_entry, input_section, + relocateable, data, gp); +} + +static bfd_reloc_status_type +gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data, + gp) + bfd *abfd; + asymbol *symbol; + arelent *reloc_entry; + asection *input_section; + boolean relocateable; + PTR data; + bfd_vma gp; +{ + bfd_vma relocation; + unsigned long val; + + if (bfd_is_com_section (symbol->section)) + relocation = 0; + else + relocation = symbol->value; + + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + if (reloc_entry->howto->src_mask == 0) + val = 0; + else + val = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + /* Set val to the offset into the section or symbol. */ + val += reloc_entry->addend; + + /* Adjust val for the final section location and GP value. If we + are producing relocateable output, we don't want to do this for + an external symbol. */ + if (! relocateable + || (symbol->flags & BSF_SECTION_SYM) != 0) + val += relocation - gp; + + bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + reloc_entry->address); + + if (relocateable) + reloc_entry->address += input_section->output_offset; + + return bfd_reloc_ok; +} + +/* Do a R_MIPS_SHIFT6 relocation. The MSB of the shift is stored at bit 2, + the rest is at bits 6-10. The bitpos already got right by the howto. */ + +static bfd_reloc_status_type +mips_elf_shift6_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + reloc_entry->addend = (reloc_entry->addend & 0x00007c0) + | (reloc_entry->addend & 0x00000800) >> 9; + + SET_RELOC_ADDEND (reloc_entry) + + return bfd_reloc_continue; +} + +/* Handle a mips16 jump. */ + +static bfd_reloc_status_type +mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + static boolean warned = false; + + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + /* FIXME. */ + if (! warned) + (*_bfd_error_handler) + (_("Linking mips16 objects into %s format is not supported"), + bfd_get_target (input_section->output_section->owner)); + warned = true; + + return bfd_reloc_undefined; +} + +/* Handle a mips16 GP relative reloc. */ + +static bfd_reloc_status_type +mips16_gprel_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + boolean relocateable; + bfd_reloc_status_type ret; + bfd_vma gp; + unsigned short extend, insn; + unsigned long final; + + GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section) + + if (output_bfd != NULL) + relocateable = true; + else + { + relocateable = false; + output_bfd = symbol->section->output_section->owner; + } + + ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, + &gp); + if (ret != bfd_reloc_ok) + return ret; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + /* Pick up the mips16 extend instruction and the real instruction. */ + extend = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); + insn = bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address + 2); + + /* Stuff the current addend back as a 32 bit value, do the usual + relocation, and then clean up. */ + bfd_put_32 (abfd, + (bfd_vma) (((extend & 0x1f) << 11) + | (extend & 0x7e0) + | (insn & 0x1f)), + (bfd_byte *) data + reloc_entry->address); + + ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, + input_section, relocateable, data, gp); + + final = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + bfd_put_16 (abfd, + (bfd_vma) ((extend & 0xf800) + | ((final >> 11) & 0x1f) + | (final & 0x7e0)), + (bfd_byte *) data + reloc_entry->address); + bfd_put_16 (abfd, + (bfd_vma) ((insn & 0xffe0) + | (final & 0x1f)), + (bfd_byte *) data + reloc_entry->address + 2); + + return ret; +} + +#undef GET_RELOC_ADDEND +#undef SET_RELOC_ADDEND + +/* A mapping from BFD reloc types to MIPS ELF reloc types. */ + +struct elf_reloc_map { + bfd_reloc_code_real_type bfd_val; + enum elf_mips_reloc_type elf_val; +}; + +static const struct elf_reloc_map mips_reloc_map[] = +{ + { BFD_RELOC_NONE, R_MIPS_NONE }, + { BFD_RELOC_16, R_MIPS_16 }, + { BFD_RELOC_32, R_MIPS_32 }, + /* There is no BFD reloc for R_MIPS_REL32. */ + { BFD_RELOC_CTOR, R_MIPS_32 }, + { BFD_RELOC_64, R_MIPS_64 }, + { BFD_RELOC_16_PCREL, R_MIPS_PC16 }, + { BFD_RELOC_HI16_S, R_MIPS_HI16 }, + { BFD_RELOC_LO16, R_MIPS_LO16 }, + { BFD_RELOC_GPREL16, R_MIPS_GPREL16 }, + { BFD_RELOC_GPREL32, R_MIPS_GPREL32 }, + { BFD_RELOC_MIPS_JMP, R_MIPS_26 }, + { BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL }, + { BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 }, + { BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 }, + { BFD_RELOC_MIPS_SHIFT5, R_MIPS_SHIFT5 }, + { BFD_RELOC_MIPS_SHIFT6, R_MIPS_SHIFT6 }, + { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }, + { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE }, + { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST }, + { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 }, + { BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 }, + { BFD_RELOC_MIPS_SUB, R_MIPS_SUB }, + { BFD_RELOC_MIPS_INSERT_A, R_MIPS_INSERT_A }, + { BFD_RELOC_MIPS_INSERT_B, R_MIPS_INSERT_B }, + { BFD_RELOC_MIPS_DELETE, R_MIPS_DELETE }, + { BFD_RELOC_MIPS_HIGHEST, R_MIPS_HIGHEST }, + { BFD_RELOC_MIPS_HIGHER, R_MIPS_HIGHER }, + { BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 }, + { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }, + { BFD_RELOC_MIPS_SCN_DISP, R_MIPS_SCN_DISP }, + { BFD_RELOC_MIPS_REL16, R_MIPS_REL16 }, + /* Use of R_MIPS_ADD_IMMEDIATE and R_MIPS_PJUMP is deprecated. */ + { BFD_RELOC_MIPS_RELGOT, R_MIPS_RELGOT }, + { BFD_RELOC_MIPS_JALR, R_MIPS_JALR } +}; + +/* Given a BFD reloc type, return a howto structure. */ + +static reloc_howto_type * +bfd_elf32_bfd_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + unsigned int i; + /* FIXME: We default to RELA here instead of choosing the right + relocation variant. */ + reloc_howto_type *howto_table = elf_mips_howto_table_rela; + + for (i = 0; i < sizeof (mips_reloc_map) / sizeof (struct elf_reloc_map); + i++) + { + if (mips_reloc_map[i].bfd_val == code) + return &howto_table[(int) mips_reloc_map[i].elf_val]; + } + + switch (code) + { + case BFD_RELOC_MIPS16_JMP: + return &elf_mips16_jump_howto; + case BFD_RELOC_MIPS16_GPREL: + return &elf_mips16_gprel_howto; + case BFD_RELOC_VTABLE_INHERIT: + return &elf_mips_gnu_vtinherit_howto; + case BFD_RELOC_VTABLE_ENTRY: + return &elf_mips_gnu_vtentry_howto; + default: + bfd_set_error (bfd_error_bad_value); + return NULL; + } +} + +/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ + +static reloc_howto_type * +mips_elf_n32_rtype_to_howto (r_type, rela_p) + unsigned int r_type; + boolean rela_p; +{ + switch (r_type) + { + case R_MIPS16_26: + return &elf_mips16_jump_howto; + case R_MIPS16_GPREL: + return &elf_mips16_gprel_howto; + case R_MIPS_GNU_VTINHERIT: + return &elf_mips_gnu_vtinherit_howto; + case R_MIPS_GNU_VTENTRY: + return &elf_mips_gnu_vtentry_howto; + default: + BFD_ASSERT (r_type < (unsigned int) R_MIPS_max); + if (rela_p) + return &elf_mips_howto_table_rela[r_type]; + else + return &elf_mips_howto_table_rel[r_type]; + break; + } +} + +/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ + +static void +mips_info_to_howto_rel (abfd, cache_ptr, dst) + bfd *abfd; + arelent *cache_ptr; + Elf32_Internal_Rel *dst; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + cache_ptr->howto = mips_elf_n32_rtype_to_howto (r_type, false); + + /* The addend for a GPREL16 or LITERAL relocation comes from the GP + value for the object file. We get the addend now, rather than + when we do the relocation, because the symbol manipulations done + by the linker may cause us to lose track of the input BFD. */ + if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0 + && (r_type == (unsigned int) R_MIPS_GPREL16 + || r_type == (unsigned int) R_MIPS_LITERAL)) + cache_ptr->addend = elf_gp (abfd); +} + +/* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure. */ + +static void +mips_info_to_howto_rela (abfd, cache_ptr, dst) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr; + Elf32_Internal_Rela *dst; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + cache_ptr->howto = mips_elf_n32_rtype_to_howto (r_type, true); + cache_ptr->addend = dst->r_addend; +} + +/* Determine whether a symbol is global for the purposes of splitting + the symbol table into global symbols and local symbols. At least + on Irix 5, this split must be between section symbols and all other + symbols. On most ELF targets the split is between static symbols + and externally visible symbols. */ + +static boolean +mips_elf_sym_is_global (abfd, sym) + bfd *abfd ATTRIBUTE_UNUSED; + asymbol *sym; +{ + if (SGI_COMPAT (abfd)) + return (sym->flags & BSF_SECTION_SYM) == 0; + else + return ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0 + || bfd_is_und_section (bfd_get_section (sym)) + || bfd_is_com_section (bfd_get_section (sym))); +} + +/* Set the right machine number for a MIPS ELF file. */ + +static boolean +mips_elf_n32_object_p (abfd) + bfd *abfd; +{ + unsigned long mach; + + /* Irix 5 and 6 are broken. Object file symbol tables are not always + sorted correctly such that local symbols precede global symbols, + and the sh_info field in the symbol table is not always right. */ + if (SGI_COMPAT (abfd)) + elf_bad_symtab (abfd) = true; + + mach = _bfd_elf_mips_mach (elf_elfheader (abfd)->e_flags); + bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach); + + if (! ABI_N32_P(abfd)) + return false; + + return true; +} + +/* Support for core dump NOTE sections. */ +static boolean +elf32_mips_grok_prstatus (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + int offset; + unsigned int raw_size; + + switch (note->descsz) + { + default: + return false; + + case 256: /* Linux/MIPS */ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + + /* pr_reg */ + offset = 72; + raw_size = 180; + + break; + } + + /* Make a ".reg/999" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size, + note->descpos + offset); +} + +static boolean +elf32_mips_grok_psinfo (abfd, note) + bfd *abfd; + Elf_Internal_Note *note; +{ + switch (note->descsz) + { + default: + return false; + + case 128: /* Linux/MIPS elf_prpsinfo */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80); + } + + /* Note that for some reason, a spurious space is tacked + onto the end of the args in some (at least one anyway) + implementations, so strip it off if it exists. */ + + { + char *command = elf_tdata (abfd)->core_command; + int n = strlen (command); + + if (0 < n && command[n - 1] == ' ') + command[n - 1] = '\0'; + } + + return true; +} + +/* Depending on the target vector we generate some version of Irix + executables or "normal" MIPS ELF ABI executables. */ +static irix_compat_t +elf_n32_mips_irix_compat (abfd) + bfd *abfd; +{ + if ((abfd->xvec == &bfd_elf32_nbigmips_vec) + || (abfd->xvec == &bfd_elf32_nlittlemips_vec)) + return ict_irix6; + else + return ict_none; +} + +/* ECOFF swapping routines. These are used when dealing with the + .mdebug section, which is in the ECOFF debugging format. */ +static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { + /* Symbol table magic number. */ + magicSym, + /* Alignment of debugging information. E.g., 4. */ + 4, + /* Sizes of external symbolic information. */ + sizeof (struct hdr_ext), + sizeof (struct dnr_ext), + sizeof (struct pdr_ext), + sizeof (struct sym_ext), + sizeof (struct opt_ext), + sizeof (struct fdr_ext), + sizeof (struct rfd_ext), + sizeof (struct ext_ext), + /* Functions to swap in external symbolic data. */ + ecoff_swap_hdr_in, + ecoff_swap_dnr_in, + ecoff_swap_pdr_in, + ecoff_swap_sym_in, + ecoff_swap_opt_in, + ecoff_swap_fdr_in, + ecoff_swap_rfd_in, + ecoff_swap_ext_in, + _bfd_ecoff_swap_tir_in, + _bfd_ecoff_swap_rndx_in, + /* Functions to swap out external symbolic data. */ + ecoff_swap_hdr_out, + ecoff_swap_dnr_out, + ecoff_swap_pdr_out, + ecoff_swap_sym_out, + ecoff_swap_opt_out, + ecoff_swap_fdr_out, + ecoff_swap_rfd_out, + ecoff_swap_ext_out, + _bfd_ecoff_swap_tir_out, + _bfd_ecoff_swap_rndx_out, + /* Function to read in symbolic data. */ + _bfd_mips_elf_read_ecoff_info +}; + +#define ELF_ARCH bfd_arch_mips +#define ELF_MACHINE_CODE EM_MIPS + +/* The SVR4 MIPS ABI says that this should be 0x10000, but Irix 5 uses + a value of 0x1000, and we are compatible. + FIXME: How does this affect NewABI? */ +#define ELF_MAXPAGESIZE 0x1000 + +#define elf_backend_collect true +#define elf_backend_type_change_ok true +#define elf_backend_can_gc_sections true +#define elf_info_to_howto mips_info_to_howto_rela +#define elf_info_to_howto_rel mips_info_to_howto_rel +#define elf_backend_sym_is_global mips_elf_sym_is_global +#define elf_backend_object_p mips_elf_n32_object_p +#define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing +#define elf_backend_section_processing _bfd_mips_elf_section_processing +#define elf_backend_section_from_shdr _bfd_mips_elf_section_from_shdr +#define elf_backend_fake_sections _bfd_mips_elf_fake_sections +#define elf_backend_section_from_bfd_section \ + _bfd_mips_elf_section_from_bfd_section +#define elf_backend_add_symbol_hook _bfd_mips_elf_add_symbol_hook +#define elf_backend_link_output_symbol_hook \ + _bfd_mips_elf_link_output_symbol_hook +#define elf_backend_create_dynamic_sections \ + _bfd_mips_elf_create_dynamic_sections +#define elf_backend_check_relocs _bfd_mips_elf_check_relocs +#define elf_backend_adjust_dynamic_symbol \ + _bfd_mips_elf_adjust_dynamic_symbol +#define elf_backend_always_size_sections \ + _bfd_mips_elf_always_size_sections +#define elf_backend_size_dynamic_sections \ + _bfd_mips_elf_size_dynamic_sections +#define elf_backend_relocate_section _bfd_mips_elf_relocate_section +#define elf_backend_finish_dynamic_symbol \ + _bfd_mips_elf_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + _bfd_mips_elf_finish_dynamic_sections +#define elf_backend_final_write_processing \ + _bfd_mips_elf_final_write_processing +#define elf_backend_additional_program_headers \ + _bfd_mips_elf_additional_program_headers +#define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map +#define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook +#define elf_backend_copy_indirect_symbol \ + _bfd_mips_elf_copy_indirect_symbol +#define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol +#define elf_backend_grok_prstatus elf32_mips_grok_prstatus +#define elf_backend_grok_psinfo elf32_mips_grok_psinfo +#define elf_backend_ecoff_debug_swap &mips_elf32_ecoff_debug_swap + +#define elf_backend_got_header_size (4 * MIPS_RESERVED_GOTNO) +#define elf_backend_plt_header_size 0 + +/* MIPS n32 ELF can use a mixture of REL and RELA, but some Relocations + work better/work only in RELA, so we default to this. */ +#define elf_backend_may_use_rel_p 1 +#define elf_backend_may_use_rela_p 1 +#define elf_backend_default_use_rela_p 1 +#define elf_backend_sign_extend_vma true + +#define elf_backend_discard_info _bfd_mips_elf_discard_info +#define elf_backend_ignore_discarded_relocs \ + _bfd_mips_elf_ignore_discarded_relocs +#define elf_backend_write_section _bfd_mips_elf_write_section +#define elf_backend_mips_irix_compat elf_n32_mips_irix_compat +#define elf_backend_mips_rtype_to_howto mips_elf_n32_rtype_to_howto +#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line +#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents +#define bfd_elf32_bfd_get_relocated_section_contents \ + _bfd_elf_mips_get_relocated_section_contents +#define bfd_elf32_bfd_link_hash_table_create \ + _bfd_mips_elf_link_hash_table_create +#define bfd_elf32_bfd_final_link _bfd_mips_elf_final_link +#define bfd_elf32_bfd_merge_private_bfd_data \ + _bfd_mips_elf_merge_private_bfd_data +#define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags +#define bfd_elf32_bfd_print_private_bfd_data \ + _bfd_mips_elf_print_private_bfd_data + +/* Support for SGI-ish mips targets using n32 ABI. */ + +#define TARGET_LITTLE_SYM bfd_elf32_nlittlemips_vec +#define TARGET_LITTLE_NAME "elf32-nlittlemips" +#define TARGET_BIG_SYM bfd_elf32_nbigmips_vec +#define TARGET_BIG_NAME "elf32-nbigmips" + +#include "elf32-target.h" + +/* Support for traditional mips targets using n32 ABI. */ +#define INCLUDED_TARGET_FILE /* More a type of flag. */ + +#undef TARGET_LITTLE_SYM +#undef TARGET_LITTLE_NAME +#undef TARGET_BIG_SYM +#undef TARGET_BIG_NAME + +#define TARGET_LITTLE_SYM bfd_elf32_ntradlittlemips_vec +#define TARGET_LITTLE_NAME "elf32-ntradlittlemips" +#define TARGET_BIG_SYM bfd_elf32_ntradbigmips_vec +#define TARGET_BIG_NAME "elf32-ntradbigmips" + +/* Include the target file again for this target. */ +#include "elf32-target.h" diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 943159b..dca8b45 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -2,21 +2,21 @@ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Mosberger-Tang <davidm@hpl.hp.com> -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -25,37 +25,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opcode/ia64.h" #include "elf/ia64.h" -/* - * THE RULES for all the stuff the linker creates -- - * - * GOT Entries created in response to LTOFF or LTOFF_FPTR - * relocations. Dynamic relocs created for dynamic - * symbols in an application; REL relocs for locals - * in a shared library. - * - * FPTR The canonical function descriptor. Created for local - * symbols in applications. Descriptors for dynamic symbols - * and local symbols in shared libraries are created by - * ld.so. Thus there are no dynamic relocs against these - * objects. The FPTR relocs for such _are_ passed through - * to the dynamic relocation tables. - * - * FULL_PLT Created for a PCREL21B relocation against a dynamic symbol. - * Requires the creation of a PLTOFF entry. This does not - * require any dynamic relocations. - * - * PLTOFF Created by PLTOFF relocations. For local symbols, this - * is an alternate function descriptor, and in shared libraries - * requires two REL relocations. Note that this cannot be - * transformed into an FPTR relocation, since it must be in - * range of the GP. For dynamic symbols, this is a function - * descriptor for a MIN_PLT entry, and requires one IPLT reloc. - * - * MIN_PLT Created by PLTOFF entries against dynamic symbols. This - * does not reqire dynamic relocations. - */ - -#define USE_RELA /* we want RELA relocs, not REL */ +/* THE RULES for all the stuff the linker creates -- + + GOT Entries created in response to LTOFF or LTOFF_FPTR + relocations. Dynamic relocs created for dynamic + symbols in an application; REL relocs for locals + in a shared library. + + FPTR The canonical function descriptor. Created for local + symbols in applications. Descriptors for dynamic symbols + and local symbols in shared libraries are created by + ld.so. Thus there are no dynamic relocs against these + objects. The FPTR relocs for such _are_ passed through + to the dynamic relocation tables. + + FULL_PLT Created for a PCREL21B relocation against a dynamic symbol. + Requires the creation of a PLTOFF entry. This does not + require any dynamic relocations. + + PLTOFF Created by PLTOFF relocations. For local symbols, this + is an alternate function descriptor, and in shared libraries + requires two REL relocations. Note that this cannot be + transformed into an FPTR relocation, since it must be in + range of the GP. For dynamic symbols, this is a function + descriptor for a MIN_PLT entry, and requires one IPLT reloc. + + MIN_PLT Created by PLTOFF entries against dynamic symbols. This + does not reqire dynamic relocations. */ #define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) @@ -140,7 +136,7 @@ struct elfNN_ia64_link_hash_entry struct elfNN_ia64_link_hash_table { - /* The main hash table */ + /* The main hash table. */ struct elf_link_hash_table root; asection *got_sec; /* the linkage table section (or NULL) */ @@ -174,7 +170,7 @@ static boolean elfNN_ia64_relax_section static boolean is_unwind_section_name PARAMS ((bfd *abfd, const char *)); static boolean elfNN_ia64_section_from_shdr - PARAMS ((bfd *, ElfNN_Internal_Shdr *, char *)); + PARAMS ((bfd *, ElfNN_Internal_Shdr *, const char *)); static boolean elfNN_ia64_section_flags PARAMS ((flagword *, ElfNN_Internal_Shdr *)); static boolean elfNN_ia64_fake_sections @@ -211,7 +207,8 @@ static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string)); static void elfNN_ia64_hash_copy_indirect - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); static void elfNN_ia64_hash_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); static struct bfd_link_hash_table *elfNN_ia64_hash_table_create @@ -327,7 +324,7 @@ static void elfNN_hpux_post_process_headers boolean elfNN_hpux_backend_section_from_bfd_section PARAMS ((bfd *abfd, asection *sec, int *retval)); -/* ia64-specific relocation */ +/* ia64-specific relocation. */ /* Perform a relocation. Not much to do here as all the hard work is done in elfNN_ia64_final_link_relocate. */ @@ -461,7 +458,7 @@ static unsigned char elf_code_to_howto_index[R_IA64_MAX_RELOC_CODE + 1]; /* Given a BFD reloc type, return the matching HOWTO structure. */ -static reloc_howto_type* +static reloc_howto_type * lookup_howto (rtype) unsigned int rtype; { @@ -691,15 +688,10 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) }; Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Shdr *shndx_hdr; Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *free_relocs = NULL; Elf_Internal_Rela *irel, *irelend; bfd_byte *contents; - bfd_byte *free_contents = NULL; - ElfNN_External_Sym *extsyms; - ElfNN_External_Sym *free_extsyms = NULL; - Elf_External_Sym_Shndx *shndx_buf = NULL; + Elf_Internal_Sym *isymbuf = NULL; struct elfNN_ia64_link_hash_table *ia64_info; struct one_fixup *fixups = NULL; boolean changed_contents = false; @@ -726,10 +718,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) - goto error_return; - - if (! link_info->keep_memory) - free_relocs = internal_relocs; + return false; ia64_info = elfNN_ia64_hash_table (link_info); irelend = internal_relocs + sec->reloc_count; @@ -741,8 +730,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) /* No branch-type relocations. */ if (irel == irelend) { - if (free_relocs != NULL) - free (free_relocs); + if (elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return true; } @@ -754,48 +743,15 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; - free_contents = contents; if (! bfd_get_section_contents (abfd, sec, contents, (file_ptr) 0, sec->_raw_size)) goto error_return; } - /* Read this BFD's local symbols. */ - if (symtab_hdr->contents != NULL) - extsyms = (ElfNN_External_Sym *) symtab_hdr->contents; - else - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info * sizeof (ElfNN_External_Sym); - extsyms = (ElfNN_External_Sym *) bfd_malloc (amt); - if (extsyms == NULL) - goto error_return; - free_extsyms = extsyms; - if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (extsyms, amt, abfd) != amt) - goto error_return; - } - - shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; - if (shndx_hdr->sh_size != 0) - { - bfd_size_type amt; - - amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx); - shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); - if (shndx_buf == NULL) - goto error_return; - if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread (shndx_buf, amt, abfd) != amt) - goto error_return; - } - for (; irel < irelend; irel++) { bfd_vma symaddr, reladdr, trampoff, toff, roff; - Elf_Internal_Sym isym; asection *tsec; struct one_fixup *f; bfd_size_type amt; @@ -806,25 +762,34 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) /* Get the value of the symbol referred to by the reloc. */ if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info) { - ElfNN_External_Sym *esym; - Elf_External_Sym_Shndx *shndx; - /* A local symbol. */ - esym = extsyms + ELFNN_R_SYM (irel->r_info); - shndx = shndx_buf + (shndx_buf ? ELFNN_R_SYM (irel->r_info) : 0); - bfd_elfNN_swap_symbol_in (abfd, esym, shndx, &isym); - if (isym.st_shndx == SHN_UNDEF) + Elf_Internal_Sym *isym; + + /* Read this BFD's local symbols. */ + if (isymbuf == NULL) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == 0) + goto error_return; + } + + isym = isymbuf + ELF64_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) continue; /* We can't do anthing with undefined symbols. */ - else if (isym.st_shndx == SHN_ABS) + else if (isym->st_shndx == SHN_ABS) tsec = bfd_abs_section_ptr; - else if (isym.st_shndx == SHN_COMMON) + else if (isym->st_shndx == SHN_COMMON) tsec = bfd_com_section_ptr; - else if (isym.st_shndx == SHN_IA_64_ANSI_COMMON) + else if (isym->st_shndx == SHN_IA_64_ANSI_COMMON) tsec = bfd_com_section_ptr; else - tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); - toff = isym.st_value; + toff = isym->st_value; } else { @@ -972,50 +937,50 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) free (f); } - if (changed_relocs) - elf_section_data (sec)->relocs = internal_relocs; - else if (free_relocs != NULL) - free (free_relocs); - - if (changed_contents) - elf_section_data (sec)->this_hdr.contents = contents; - else if (free_contents != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { if (! link_info->keep_memory) - free (free_contents); + free (isymbuf); else { - /* Cache the section contents for elf_link_input_bfd. */ - elf_section_data (sec)->this_hdr.contents = contents; + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; } } - if (shndx_buf != NULL) - free (shndx_buf); - - if (free_extsyms != NULL) + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) { - if (! link_info->keep_memory) - free (free_extsyms); + if (!changed_contents && !link_info->keep_memory) + free (contents); else { - /* Cache the symbols for elf_link_input_bfd. */ - symtab_hdr->contents = (unsigned char *) extsyms; + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; } } + if (elf_section_data (sec)->relocs != internal_relocs) + { + if (!changed_relocs) + free (internal_relocs); + else + elf_section_data (sec)->relocs = internal_relocs; + } + *again = changed_contents || changed_relocs; return true; error_return: - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - if (shndx_buf != NULL) - free (shndx_buf); - if (free_extsyms != NULL) - free (free_extsyms); + if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents) + free (isymbuf); + if (contents != NULL + && elf_section_data (sec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (sec)->relocs != internal_relocs) + free (internal_relocs); return false; } @@ -1047,7 +1012,7 @@ static boolean elfNN_ia64_section_from_shdr (abfd, hdr, name) bfd *abfd; ElfNN_Internal_Shdr *hdr; - char *name; + const char *name; { asection *newsect; @@ -1119,24 +1084,22 @@ elfNN_ia64_fake_sections (abfd, hdr, sec) else if (strcmp (name, ".HP.opt_annot") == 0) hdr->sh_type = SHT_IA_64_HP_OPT_ANOT; else if (strcmp (name, ".reloc") == 0) - /* - * This is an ugly, but unfortunately necessary hack that is - * needed when producing EFI binaries on IA-64. It tells - * elf.c:elf_fake_sections() not to consider ".reloc" as a section - * containing ELF relocation info. We need this hack in order to - * be able to generate ELF binaries that can be translated into - * EFI applications (which are essentially COFF objects). Those - * files contain a COFF ".reloc" section inside an ELFNN object, - * which would normally cause BFD to segfault because it would - * attempt to interpret this section as containing relocation - * entries for section "oc". With this hack enabled, ".reloc" - * will be treated as a normal data section, which will avoid the - * segfault. However, you won't be able to create an ELFNN binary - * with a section named "oc" that needs relocations, but that's - * the kind of ugly side-effects you get when detecting section - * types based on their names... In practice, this limitation is - * unlikely to bite. - */ + /* This is an ugly, but unfortunately necessary hack that is + needed when producing EFI binaries on IA-64. It tells + elf.c:elf_fake_sections() not to consider ".reloc" as a section + containing ELF relocation info. We need this hack in order to + be able to generate ELF binaries that can be translated into + EFI applications (which are essentially COFF objects). Those + files contain a COFF ".reloc" section inside an ELFNN object, + which would normally cause BFD to segfault because it would + attempt to interpret this section as containing relocation + entries for section "oc". With this hack enabled, ".reloc" + will be treated as a normal data section, which will avoid the + segfault. However, you won't be able to create an ELFNN binary + with a section named "oc" that needs relocations, but that's + the kind of ugly side-effects you get when detecting section + types based on their names... In practice, this limitation is + unlikely to bite. */ hdr->sh_type = SHT_PROGBITS; if (sec->flags & SEC_SMALL_DATA) @@ -1225,6 +1188,19 @@ elfNN_ia64_final_write_processing (abfd, linker) break; } } + + if (! elf_flags_init (abfd)) + { + unsigned long flags = 0; + + if (abfd->xvec->byteorder == BFD_ENDIAN_BIG) + flags |= EF_IA_64_BE; + if (bfd_get_mach (abfd) == bfd_mach_ia64_elf64) + flags |= EF_IA_64_ABI64; + + elf_elfheader(abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + } } /* Hook called by the linker routine which adds symbols from an object @@ -1401,8 +1377,6 @@ elfNN_ia64_modify_segment_map (abfd) struct elf_segment_map *m, **pm; Elf_Internal_Shdr *hdr; asection *s; - boolean unwind_found; - asection *unwind_sec; /* If we need a PT_IA_64_ARCHEXT segment, it must come before all PT_LOAD segments. */ @@ -1447,20 +1421,16 @@ elfNN_ia64_modify_segment_map (abfd) for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) if (m->p_type == PT_IA_64_UNWIND) { + int i; + /* Look through all sections in the unwind segment for a match since there may be multiple sections to a segment. */ + for (i = m->count - 1; i >= 0; --i) + if (m->sections[i] == s) + break; - unwind_sec = m->sections[0]; - unwind_found = false; - while (unwind_sec != NULL && !unwind_found) - { - if (unwind_sec == s) - unwind_found = true; - else - unwind_sec = unwind_sec -> next; - } - if (unwind_found) + if (i >= 0) break; } @@ -1548,6 +1518,8 @@ elfNN_ia64_dynamic_symbol_p (h, info) case STV_INTERNAL: case STV_HIDDEN: return false; + default: + break; } if (h->root.type == bfd_link_hash_undefweak @@ -1631,7 +1603,8 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string) } static void -elfNN_ia64_hash_copy_indirect (xdir, xind) +elfNN_ia64_hash_copy_indirect (bed, xdir, xind) + struct elf_backend_data *bed ATTRIBUTE_UNUSED; struct elf_link_hash_entry *xdir, *xind; { struct elfNN_ia64_link_hash_entry *dir, *ind; @@ -4834,6 +4807,9 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) #undef elf_backend_section_from_bfd_section #define elf_backend_section_from_bfd_section elfNN_hpux_backend_section_from_bfd_section +#undef elf_backend_want_p_paddr_set_to_zero +#define elf_backend_want_p_paddr_set_to_zero 1 + #undef ELF_MAXPAGESIZE #define ELF_MAXPAGESIZE 0x1000 /* 1K */ @@ -4841,3 +4817,5 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) #define elfNN_bed elfNN_ia64_hpux_bed #include "elfNN-target.h" + +#undef elf_backend_want_p_paddr_set_to_zero diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 0a92e5d..5132693 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -373,26 +373,28 @@ static bfd *reldyn_sorting_bfd; #define ABI_N32_P(abfd) \ ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0) -/* Nonzero if ABFD is using the 64-bit ABI. */ +/* Nonzero if ABFD is using the N64 ABI. */ #define ABI_64_P(abfd) \ - ((elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64) != 0) + (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64) +/* Nonzero if ABFD is using NewABI conventions. */ +#define NEWABI_P(abfd) (ABI_N32_P (abfd) || ABI_64_P (abfd)) + +/* The IRIX compatibility level we are striving for. */ #define IRIX_COMPAT(abfd) \ (get_elf_backend_data (abfd)->elf_backend_mips_irix_compat (abfd)) -#define NEWABI_P(abfd) (ABI_N32_P(abfd) || ABI_64_P(abfd)) - /* Whether we are trying to be compatible with IRIX at all. */ #define SGI_COMPAT(abfd) \ (IRIX_COMPAT (abfd) != ict_none) /* The name of the options section. */ #define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \ - (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.options" : ".options") + (ABI_64_P (abfd) ? ".MIPS.options" : ".options") /* The name of the stub section. */ #define MIPS_ELF_STUB_SECTION_NAME(abfd) \ - (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.stubs" : ".stub") + (ABI_64_P (abfd) ? ".MIPS.stubs" : ".stub") /* The size of an external REL relocation. */ #define MIPS_ELF_REL_SIZE(abfd) \ @@ -610,9 +612,8 @@ _bfd_mips_elf_read_ecoff_info (abfd, section, debug) if (ext_hdr == NULL && swap->external_hdr_size != 0) goto error_return; - if (bfd_get_section_contents (abfd, section, ext_hdr, (file_ptr) 0, - swap->external_hdr_size) - == false) + if (! bfd_get_section_contents (abfd, section, ext_hdr, (file_ptr) 0, + swap->external_hdr_size)) goto error_return; symhdr = &debug->symbolic_header; @@ -1243,7 +1244,7 @@ mips_elf_output_extsym (h, data) h->esym.asym.value = mips_elf_hash_table (einfo->info)->procedure_count; } - else if (strcmp (name, "_gp_disp") == 0) + else if (strcmp (name, "_gp_disp") == 0 && ! NEWABI_P (einfo->abfd)) { h->esym.asym.sc = scAbs; h->esym.asym.st = stLabel; @@ -1445,15 +1446,18 @@ mips_elf_global_got_index (abfd, h) bfd_vma index; asection *sgot; struct mips_got_info *g; + long global_got_dynindx = 0; g = mips_elf_got_info (abfd, &sgot); + if (g->global_gotsym != NULL) + global_got_dynindx = g->global_gotsym->dynindx; /* Once we determine the global GOT entry with the lowest dynamic symbol table index, we must put all dynamic symbols with greater indices into the GOT. That makes it easy to calculate the GOT offset. */ - BFD_ASSERT (h->dynindx >= g->global_gotsym->dynindx); - index = ((h->dynindx - g->global_gotsym->dynindx + g->local_gotno) + BFD_ASSERT (h->dynindx >= global_got_dynindx); + index = ((h->dynindx - global_got_dynindx + g->local_gotno) * MIPS_ELF_GOT_SIZE (abfd)); BFD_ASSERT (index < sgot->_raw_size); @@ -1482,7 +1486,7 @@ mips_elf_got_page (abfd, info, value, offsetp) g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); - /* Look to see if we aleady have an appropriate entry. */ + /* Look to see if we already have an appropriate entry. */ last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno; for (entry = (sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO); @@ -1635,7 +1639,7 @@ mips_elf_sort_hash_table (info, max_local) &hsd); /* There should have been enough room in the symbol table to - accomodate both the GOT and non-GOT symbols. */ + accommodate both the GOT and non-GOT symbols. */ BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx); /* Now we know which dynamic symbol has the lowest dynamic symbol @@ -2082,8 +2086,16 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, sec = local_sections[r_symndx]; symbol = sec->output_section->vma + sec->output_offset; - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) + if (ELF_ST_TYPE (sym->st_info) != STT_SECTION + || (sec->flags & SEC_MERGE)) symbol += sym->st_value; + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + addend = _bfd_elf_rel_local_sym (abfd, sym, &sec, addend); + addend -= symbol; + addend += sec->output_section->vma + sec->output_offset; + } /* MIPS16 text labels should be treated as odd. */ if (sym->st_other == STO_MIPS16) @@ -2466,8 +2478,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, return bfd_reloc_outofrange; value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, - value); + abfd, value); overflowed_p = mips_elf_overflow_p (value, 16); break; } @@ -2509,8 +2520,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, if (value == MINUS_ONE) return bfd_reloc_outofrange; value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj, - abfd, - value); + abfd, value); overflowed_p = mips_elf_overflow_p (value, 16); break; @@ -2823,8 +2833,7 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec, r_type = ELF_R_TYPE (output_bfd, rel->r_info); dynobj = elf_hash_table (info)->dynobj; - sreloc - = bfd_get_section_by_name (dynobj, ".rel.dyn"); + sreloc = bfd_get_section_by_name (dynobj, ".rel.dyn"); BFD_ASSERT (sreloc != NULL); BFD_ASSERT (sreloc->contents != NULL); BFD_ASSERT (sreloc->reloc_count * MIPS_ELF_REL_SIZE (output_bfd) @@ -2926,7 +2935,8 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec, /* The relocation is always an REL32 relocation because we don't know where the shared library will wind up at load-time. */ - outrel[0].r_info = ELF_R_INFO (output_bfd, indx, R_MIPS_REL32); + outrel[0].r_info = ELF_R_INFO (output_bfd, (unsigned long) indx, + R_MIPS_REL32); /* Adjust the output offset of the relocation to reference the correct location in the output file. */ @@ -3351,7 +3361,7 @@ boolean _bfd_mips_elf_section_from_shdr (abfd, hdr, name) bfd *abfd; Elf_Internal_Shdr *hdr; - char *name; + const char *name; { flagword flags = 0; @@ -3634,7 +3644,8 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec) sh_offset == object size, and ld doesn't allow that. While the check is arguably bogus for empty or SHT_NOBITS sections, it can easily be avoided by not emitting those useless sections in the first place. */ - if (IRIX_COMPAT (abfd) != ict_irix5 && (sec->flags & SEC_RELOC) != 0) + if ((IRIX_COMPAT (abfd) != ict_irix5 && (IRIX_COMPAT (abfd) != ict_irix6)) + && (sec->flags & SEC_RELOC) != 0) { struct bfd_elf_section_data *esd; bfd_size_type amt = sizeof (Elf_Internal_Shdr); @@ -3948,7 +3959,7 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info) return false; } - /* Change aligments of some sections. */ + /* Change alignments of some sections. */ s = bfd_get_section_by_name (abfd, ".hash"); if (s != NULL) bfd_set_section_alignment (abfd, s, 4); @@ -4115,7 +4126,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs) && ELF_R_TYPE (abfd, r->r_info) != R_MIPS16_26) break; - if (! info->keep_memory) + if (elf_section_data (o)->relocs != sec_relocs) free (sec_relocs); if (r < rend) @@ -4762,7 +4773,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info) /* Assume there are two loadable segments consisting of contiguous sections. Is 5 enough? */ local_gotno = (loadable_size >> 16) + 5; - if (IRIX_COMPAT (output_bfd) == ict_irix6) + if (NEWABI_P (output_bfd)) /* It's possible we will need GOT_PAGE entries as well as GOT16 entries. Often, these will be able to share GOT entries, but not always. */ @@ -4997,7 +5008,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, const char * msg = (const char *) NULL; /* Find the relocation howto for this relocation. */ - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd)) + if (r_type == R_MIPS_64 && ! NEWABI_P (input_bfd)) { /* Some 32-bit code uses R_MIPS_64. In particular, people use 64-bit code, but make sure all their addresses are in the @@ -5005,8 +5016,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, space. Thus, when they use an R_MIPS_64 they mean what is usually meant by R_MIPS_32, with the exception that the stored value is sign-extended to 64 bits. */ - howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, R_MIPS_32, - NEWABI_P (input_bfd)); + howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, R_MIPS_32, false); /* On big-endian systems, we need to lie about the position of the reloc. */ @@ -5041,6 +5051,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, addend = mips_elf_obtain_contents (howto, rel, input_bfd, contents); addend &= howto->src_mask; + addend <<= howto->rightshift; /* For some kinds of relocations, the ADDEND is a combination of the addend stored in two different @@ -5073,11 +5084,11 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, return false; /* Obtain the addend kept there. */ - lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, lo, - rela_relocation_p); + lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, lo, false); l = mips_elf_obtain_contents (lo16_howto, lo16_relocation, input_bfd, contents); l &= lo16_howto->src_mask; + l <<= lo16_howto->rightshift; l = mips_elf_sign_extend (l, 16); addend <<= 16; @@ -5114,7 +5125,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym *sym; unsigned long r_symndx; - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd) + if (r_type == R_MIPS_64 && ! NEWABI_P (output_bfd) && bfd_big_endian (input_bfd)) rel->r_offset -= 4; @@ -5136,13 +5147,6 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_MIPS_LITERAL) addend -= (_bfd_get_gp_value (output_bfd) - _bfd_get_gp_value (input_bfd)); - else if (r_type == R_MIPS_26 || r_type == R_MIPS16_26 - || r_type == R_MIPS_GNU_REL16_S2) - /* The addend is stored without its two least - significant bits (which are always zero.) In a - non-relocateable link, calculate_relocation will do - this shift; here, we must do it ourselves. */ - addend <<= 2; r_symndx = ELF_R_SYM (output_bfd, rel->r_info); sym = local_syms + r_symndx; @@ -5150,23 +5154,20 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Adjust the addend appropriately. */ addend += local_sections[r_symndx]->output_offset; - /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16, - then we only want to write out the high-order 16 bits. - The subsequent R_MIPS_LO16 will handle the low-order bits. */ - if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16 - || r_type == R_MIPS_GNU_REL_HI16) - addend = mips_elf_high (addend); - else if (r_type == R_MIPS_HIGHER) - addend = mips_elf_higher (addend); - else if (r_type == R_MIPS_HIGHEST) - addend = mips_elf_highest (addend); - - /* If the relocation is for an R_MIPS_26 relocation, then - the two low-order bits are not stored in the object file; - they are implicitly zero. */ - else if (r_type == R_MIPS_26 || r_type == R_MIPS16_26 - || r_type == R_MIPS_GNU_REL16_S2) - addend >>= 2; + if (howto->partial_inplace) + { + /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16, + then we only want to write out the high-order 16 bits. + The subsequent R_MIPS_LO16 will handle the low-order bits. + */ + if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16 + || r_type == R_MIPS_GNU_REL_HI16) + addend = mips_elf_high (addend); + else if (r_type == R_MIPS_HIGHER) + addend = mips_elf_higher (addend); + else if (r_type == R_MIPS_HIGHEST) + addend = mips_elf_highest (addend); + } if (rela_relocation_p) /* If this is a RELA relocation, just update the addend. @@ -5179,9 +5180,10 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, destination mask because the place to which we are writing will be source of the addend in the final link. */ + addend >>= howto->rightshift; addend &= howto->src_mask; - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd)) + if (r_type == R_MIPS_64 && ! NEWABI_P (output_bfd)) /* See the comment above about using R_MIPS_64 in the 32-bit ABI. Here, we need to update the addend. It would be possible to get away with just using the R_MIPS_32 reloc @@ -5242,6 +5244,8 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, else use_saved_addend_p = false; + addend >>= howto->rightshift; + /* Figure out what value we are supposed to relocate. */ switch (mips_elf_calculate_relocation (output_bfd, input_bfd, input_section, info, rel, @@ -5297,7 +5301,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; } - if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd)) + if (r_type == R_MIPS_64 && ! NEWABI_P (output_bfd)) /* See the comment above about using R_MIPS_64 in the 32-bit ABI. Until now, we've been using the HOWTO for R_MIPS_32; that calculated the right value. Now, however, we @@ -5525,7 +5529,7 @@ _bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym) sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); sym->st_value = 1; } - else if (strcmp (name, "_gp_disp") == 0) + else if (strcmp (name, "_gp_disp") == 0 && ! NEWABI_P (output_bfd)) { sym->st_shndx = SHN_ABS; sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION); @@ -6103,9 +6107,9 @@ _bfd_mips_elf_modify_segment_map (abfd) /* For IRIX 6, we don't have .mdebug sections, nor does anything but .dynamic end up in PT_DYNAMIC. However, we do have to insert a - PT_OPTIONS segement immediately following the program header + PT_OPTIONS segment immediately following the program header table. */ - if (IRIX_COMPAT (abfd) == ict_irix6) + if (NEWABI_P (abfd)) { for (s = abfd->sections; s; s = s->next) if (elf_section_data (s)->this_hdr.sh_type == SHT_MIPS_OPTIONS) @@ -6118,7 +6122,7 @@ _bfd_mips_elf_modify_segment_map (abfd) /* Usually, there's a program header table. But, sometimes there's not (like when running the `ld' testsuite). So, if there's no program header table, we just put the - options segement at the end. */ + options segment at the end. */ for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next) @@ -6274,8 +6278,8 @@ _bfd_mips_elf_modify_segment_map (abfd) relocation. */ asection * -_bfd_mips_elf_gc_mark_hook (abfd, info, rel, h, sym) - bfd *abfd; +_bfd_mips_elf_gc_mark_hook (sec, info, rel, h, sym) + asection *sec; struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; @@ -6285,7 +6289,7 @@ _bfd_mips_elf_gc_mark_hook (abfd, info, rel, h, sym) if (h != NULL) { - switch (ELF_R_TYPE (abfd, rel->r_info)) + switch (ELF_R_TYPE (sec->owner, rel->r_info)) { case R_MIPS_GNU_VTINHERIT: case R_MIPS_GNU_VTENTRY: @@ -6307,9 +6311,7 @@ _bfd_mips_elf_gc_mark_hook (abfd, info, rel, h, sym) } } else - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (sec->owner, sym->st_shndx); return NULL; } @@ -6345,6 +6347,9 @@ _bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs) case R_MIPS_CALL_LO16: case R_MIPS_GOT_HI16: case R_MIPS_GOT_LO16: + case R_MIPS_GOT_DISP: + case R_MIPS_GOT_PAGE: + case R_MIPS_GOT_OFST: /* ??? It would seem that the existing MIPS code does no sort of reference counting or whatnot on its GOT and PLT entries, so it is not possible to garbage collect them at this time. */ @@ -6364,12 +6369,13 @@ _bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs) _bfd_elf_link_hash_copy_indirect copy the flags for us. */ void -_bfd_mips_elf_copy_indirect_symbol (dir, ind) +_bfd_mips_elf_copy_indirect_symbol (bed, dir, ind) + struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct mips_elf_link_hash_entry *dirmips, *indmips; - _bfd_elf_link_hash_copy_indirect (dir, ind); + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); if (ind->root.type != bfd_link_hash_indirect) return; @@ -6414,6 +6420,112 @@ _bfd_mips_elf_hide_symbol (info, entry, force_local) got->_raw_size += MIPS_ELF_GOT_SIZE (dynobj); } +#define PDR_SIZE 32 + +boolean +_bfd_mips_elf_discard_info (abfd, cookie, info) + bfd *abfd; + struct elf_reloc_cookie *cookie; + struct bfd_link_info *info; +{ + asection *o; + boolean ret = false; + unsigned char *tdata; + size_t i, skip; + + o = bfd_get_section_by_name (abfd, ".pdr"); + if (! o) + return false; + if (o->_raw_size == 0) + return false; + if (o->_raw_size % PDR_SIZE != 0) + return false; + if (o->output_section != NULL + && bfd_is_abs_section (o->output_section)) + return false; + + tdata = bfd_zmalloc (o->_raw_size / PDR_SIZE); + if (! tdata) + return false; + + cookie->rels = _bfd_elf32_link_read_relocs (abfd, o, (PTR) NULL, + (Elf_Internal_Rela *) NULL, + info->keep_memory); + if (!cookie->rels) + { + free (tdata); + return false; + } + + cookie->rel = cookie->rels; + cookie->relend = cookie->rels + o->reloc_count; + + for (i = 0, skip = 0; i < o->_raw_size; i ++) + { + if (_bfd_elf32_reloc_symbol_deleted_p (i * PDR_SIZE, cookie)) + { + tdata[i] = 1; + skip ++; + } + } + + if (skip != 0) + { + elf_section_data (o)->tdata = tdata; + o->_cooked_size = o->_raw_size - skip * PDR_SIZE; + ret = true; + } + else + free (tdata); + + if (! info->keep_memory) + free (cookie->rels); + + return ret; +} + +boolean +_bfd_mips_elf_ignore_discarded_relocs (sec) + asection *sec; +{ + if (strcmp (sec->name, ".pdr") == 0) + return true; + return false; +} + +boolean +_bfd_mips_elf_write_section (output_bfd, sec, contents) + bfd *output_bfd; + asection *sec; + bfd_byte *contents; +{ + bfd_byte *to, *from, *end; + int i; + + if (strcmp (sec->name, ".pdr") != 0) + return false; + + if (elf_section_data (sec)->tdata == NULL) + return false; + + to = contents; + end = contents + sec->_raw_size; + for (from = contents, i = 0; + from < end; + from += PDR_SIZE, i++) + { + if (((unsigned char *) elf_section_data (sec)->tdata)[i] == 1) + continue; + if (to != from) + memcpy (to, from, PDR_SIZE); + to += PDR_SIZE; + } + bfd_set_section_contents (output_bfd, sec->output_section, contents, + (file_ptr) sec->output_offset, + sec->_cooked_size); + return true; +} + /* MIPS ELF uses a special find_nearest_line routine in order the handle the ECOFF debugging information. */ @@ -6680,7 +6792,7 @@ _bfd_elf_mips_get_relocated_section_contents (abfd, link_info, link_order, asymbol *sym = *(*parent)->sym_ptr_ptr; if (bfd_is_abs_section (sym->section) && abfd) { - /* The special_function wouldn't get called anyways. */ + /* The special_function wouldn't get called anyway. */ } else if (!gp_found) { @@ -7537,7 +7649,7 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) asection *sec; /* Check if we have the same endianess */ - if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + if (! _bfd_generic_verify_endian_match (ibfd, obfd)) return false; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour @@ -7696,6 +7808,15 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd) old_flags &= ~EF_MIPS_ABI; } + /* For now, allow arbitrary mixing of ASEs (retain the union). */ + if ((new_flags & EF_MIPS_ARCH_ASE) != (old_flags & EF_MIPS_ARCH_ASE)) + { + elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_ARCH_ASE; + + new_flags &= ~ EF_MIPS_ARCH_ASE; + old_flags &= ~ EF_MIPS_ARCH_ASE; + } + /* Warn about any other mismatches */ if (new_flags != old_flags) { diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h index 959bfa6..2c8ac2f 100644 --- a/bfd/elfxx-mips.h +++ b/bfd/elfxx-mips.h @@ -25,7 +25,7 @@ extern void _bfd_mips_elf_symbol_processing extern boolean _bfd_mips_elf_section_processing PARAMS ((bfd *, Elf_Internal_Shdr *)); extern boolean _bfd_mips_elf_section_from_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, char *)); + PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); extern boolean _bfd_mips_elf_fake_sections PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); extern boolean _bfd_mips_elf_section_from_bfd_section @@ -62,15 +62,18 @@ extern int _bfd_mips_elf_additional_program_headers extern boolean _bfd_mips_elf_modify_segment_map PARAMS ((bfd *)); extern asection * _bfd_mips_elf_gc_mark_hook - PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); extern boolean _bfd_mips_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); extern void _bfd_mips_elf_copy_indirect_symbol - PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); + PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); extern void _bfd_mips_elf_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); +extern boolean _bfd_mips_elf_ignore_discarded_relocs + PARAMS ((asection *)); extern boolean _bfd_mips_elf_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *)); @@ -89,6 +92,10 @@ extern boolean _bfd_mips_elf_set_private_flags PARAMS ((bfd *, flagword)); extern boolean _bfd_mips_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); +extern boolean _bfd_mips_elf_discard_info + PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *)); +extern boolean _bfd_mips_elf_write_section + PARAMS ((bfd *, asection *, bfd_byte *)); extern boolean _bfd_mips_elf_read_ecoff_info PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 08b680a..8da7256 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -2,21 +2,21 @@ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This structure contains everything that BFD knows about a target. It includes things like its byte order, name, what routines to call @@ -44,7 +44,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef bfd_elfNN_get_reloc_upper_bound #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound #endif +#ifndef bfd_elfNN_get_symbol_info #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info +#endif #define bfd_elfNN_get_symtab _bfd_elf_get_symtab #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound #if 0 /* done in elf-bfd.h */ @@ -87,6 +89,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_want_dynbss #define elf_backend_want_dynbss 1 #endif +#ifndef elf_backend_want_p_paddr_set_to_zero +#define elf_backend_want_p_paddr_set_to_zero 0 +#endif #define bfd_elfNN_bfd_debug_info_start bfd_void #define bfd_elfNN_bfd_debug_info_end bfd_void @@ -126,6 +131,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ _bfd_elf_merge_sections #endif +#ifndef bfd_elfNN_bfd_discard_group +#define bfd_elfNN_bfd_discard_group bfd_elf_discard_group +#endif + #ifndef bfd_elfNN_bfd_make_debug_symbol #define bfd_elfNN_bfd_make_debug_symbol \ ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) @@ -376,6 +385,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_write_section #define elf_backend_write_section NULL #endif +#ifndef elf_backend_set_nonloadable_filepos +#define elf_backend_set_nonloadable_filepos NULL +#endif +#ifndef elf_backend_is_contained_by_filepos +#define elf_backend_is_contained_by_filepos NULL +#endif +#ifndef elf_backend_copy_private_bfd_data_p +#define elf_backend_copy_private_bfd_data_p NULL +#endif #ifndef elf_backend_mips_irix_compat #define elf_backend_mips_irix_compat NULL #endif @@ -477,6 +495,9 @@ static const struct elf_backend_data elfNN_bed = elf_backend_discard_info, elf_backend_ignore_discarded_relocs, elf_backend_write_section, + elf_backend_set_nonloadable_filepos, + elf_backend_is_contained_by_filepos, + elf_backend_copy_private_bfd_data_p, elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto, elf_backend_ecoff_debug_swap, @@ -501,7 +522,8 @@ static const struct elf_backend_data elfNN_bed = elf_backend_can_gc_sections, elf_backend_can_refcount, elf_backend_want_got_sym, - elf_backend_want_dynbss + elf_backend_want_dynbss, + elf_backend_want_p_paddr_set_to_zero }; #endif diff --git a/bfd/format.c b/bfd/format.c index f60f0ca..1efa9e2 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -1,5 +1,5 @@ /* Generic BFD support for file formats. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. @@ -355,7 +355,7 @@ bfd_set_format (abfd, format) } if (abfd->format != bfd_unknown) - return (abfd->format == format) ? true : false; + return abfd->format == format; /* Presume the answer is yes. */ abfd->format = format; @@ -1,5 +1,5 @@ /* hash.c -- hash table routines for BFD - Copyright 1993, 1994, 1995, 1997, 1999, 2001 + Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> @@ -407,7 +407,7 @@ bfd_hash_lookup (table, string, create, copy) bfd_set_error (bfd_error_no_memory); return (struct bfd_hash_entry *) NULL; } - strcpy (new, string); + memcpy (new, string, len + 1); string = new; } hashp->string = string; diff --git a/bfd/i386linux.c b/bfd/i386linux.c index 755b456..c144822 100644 --- a/bfd/i386linux.c +++ b/bfd/i386linux.c @@ -597,10 +597,9 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info) { s->_raw_size = linux_hash_table (info)->fixup_count + 1; s->_raw_size *= 8; - s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size); if (s->contents == NULL) return false; - memset (s->contents, 0, (size_t) s->_raw_size); } return true; diff --git a/bfd/i386lynx.c b/bfd/i386lynx.c index f748543..fc58767 100644 --- a/bfd/i386lynx.c +++ b/bfd/i386lynx.c @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries under LynxOS. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -429,10 +429,9 @@ doit: count = reloc_size / each_size; - reloc_cache = (arelent *) bfd_malloc (count * sizeof (arelent)); + reloc_cache = (arelent *) bfd_zmalloc (count * sizeof (arelent)); if (!reloc_cache && count != 0) return false; - memset (reloc_cache, 0, (size_t) count * sizeof (arelent)); relocs = (PTR) bfd_alloc (abfd, reloc_size); if (!relocs && reloc_size != 0) diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index 0edb90e..5c060ecf 100644 --- a/bfd/i386msdos.c +++ b/bfd/i386msdos.c @@ -173,6 +173,7 @@ msdos_set_section_contents (abfd, section, location, offset, count) #define msdos_bfd_relax_section bfd_generic_relax_section #define msdos_bfd_gc_sections bfd_generic_gc_sections #define msdos_bfd_merge_sections bfd_generic_merge_sections +#define msdos_bfd_discard_group bfd_generic_discard_group #define msdos_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define msdos_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define msdos_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c index 47f9ef3..cafad3e 100644 --- a/bfd/i386os9k.c +++ b/bfd/i386os9k.c @@ -284,7 +284,7 @@ os9k_set_section_contents (abfd, section, location, offset, count) int count; { - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { /* set by bfd.c handler */ if (! aout_32_make_sections (abfd)) return false; @@ -329,6 +329,7 @@ os9k_sizeof_headers (ignore_abfd, ignore) #define os9k_bfd_relax_section bfd_generic_relax_section #define os9k_bfd_gc_sections bfd_generic_gc_sections #define os9k_bfd_merge_sections bfd_generic_merge_sections +#define os9k_bfd_discard_group bfd_generic_discard_group #define os9k_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define os9k_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define os9k_bfd_link_add_symbols _bfd_generic_link_add_symbols @@ -471,7 +471,7 @@ must_parse_int (ieee) common_header_type *ieee; { bfd_vma result; - BFD_ASSERT (parse_int (ieee, &result) == true); + BFD_ASSERT (parse_int (ieee, &result)); return result; } @@ -983,7 +983,7 @@ ieee_slurp_external_symbols (abfd) /* Fetch the default size if not resolved */ size = must_parse_int (&(ieee->h)); /* Fetch the defautlt value if available */ - if (parse_int (&(ieee->h), &value) == false) + if (! parse_int (&(ieee->h), &value)) { value = 0; } @@ -1058,7 +1058,7 @@ static boolean ieee_slurp_symbol_table (abfd) bfd *abfd; { - if (IEEE_DATA (abfd)->read_symbols == false) + if (! IEEE_DATA (abfd)->read_symbols) { if (! ieee_slurp_external_symbols (abfd)) return false; @@ -1112,7 +1112,7 @@ ieee_get_symtab (abfd, location) if (! ieee_slurp_symbol_table (abfd)) return -1; - if (ieee->symbol_table_full == false) + if (! ieee->symbol_table_full) { /* Arrgh - there are gaps in the table, run through and fill them */ /* up with pointers to a null place */ @@ -1414,7 +1414,7 @@ ieee_archive_p (abfd) abfd->tdata.ieee_ar_data = (ieee_ar_data_type *) bfd_alloc (abfd, amt); if (!abfd->tdata.ieee_ar_data) - goto error_return; + goto error_ret_restore; ieee = IEEE_AR_DATA (abfd); /* Ignore the return value here. It doesn't matter if we don't read @@ -1530,13 +1530,13 @@ ieee_archive_p (abfd) return abfd->xvec; got_wrong_format_error: - bfd_release (abfd, ieee); - abfd->tdata.ieee_ar_data = save; bfd_set_error (bfd_error_wrong_format); - error_return: if (elts != NULL) free (elts); + bfd_release (abfd, ieee); + error_ret_restore: + abfd->tdata.ieee_ar_data = save; return NULL; } @@ -1663,11 +1663,11 @@ ieee_object_p (abfd) } next_byte (&(ieee->h)); - if (parse_int (&(ieee->h), &ieee->ad.number_of_bits_mau) == false) + if (! parse_int (&(ieee->h), &ieee->ad.number_of_bits_mau)) { goto fail; } - if (parse_int (&(ieee->h), &ieee->ad.number_of_maus_in_address) == false) + if (! parse_int (&(ieee->h), &ieee->ad.number_of_maus_in_address)) { goto fail; } @@ -1690,7 +1690,7 @@ ieee_object_p (abfd) } ieee->w.offset[part] = parse_i (&(ieee->h), &ok); - if (ok == false) + if (! ok) { goto fail; } @@ -1732,7 +1732,7 @@ ieee_object_p (abfd) got_wrong_format: bfd_set_error (bfd_error_wrong_format); fail: - (void) bfd_release (abfd, ieee); + bfd_release (abfd, ieee); abfd->tdata.ieee_data = save; return (const bfd_target *) NULL; } @@ -1895,7 +1895,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) case 0: case 4: - if (pcrel == true) + if (pcrel) { #if KEEPMINUSPCININST bfd_put_32 (ieee->h.abfd, -current_map->pc, @@ -1917,7 +1917,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) current_map->pc += 4; break; case 2: - if (pcrel == true) + if (pcrel) { #if KEEPMINUSPCININST bfd_put_16 (ieee->h.abfd, (bfd_vma) -current_map->pc, @@ -1941,7 +1941,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) current_map->pc += 2; break; case 1: - if (pcrel == true) + if (pcrel) { #if KEEPMINUSPCININST bfd_put_8 (ieee->h.abfd, (int) (-current_map->pc), location_ptr + current_map->pc); @@ -1969,7 +1969,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) default: { bfd_vma this_size; - if (parse_int (&(ieee->h), &this_size) == true) + if (parse_int (&(ieee->h), &this_size)) { unsigned int i; for (i = 0; i < this_size; i++) @@ -2007,7 +2007,7 @@ ieee_slurp_section_data (abfd) ieee_per_section_type *current_map = (ieee_per_section_type *) NULL; asection *s; /* Seek to the start of the data area */ - if (ieee->read_data == true) + if (ieee->read_data) return true; ieee->read_data = true; ieee_seek (ieee, ieee->w.r.data_part); @@ -2398,10 +2398,9 @@ do_with_relocs (abfd, s) if ((PTR) stream == (PTR) NULL) { /* Outputting a section without data, fill it up */ - stream = (unsigned char *) (bfd_alloc (abfd, s->_raw_size)); + stream = (unsigned char *) bfd_zalloc (abfd, s->_raw_size); if (!stream) return false; - memset ((PTR) stream, 0, (size_t) s->_raw_size); } while (current_byte_index < s->_raw_size) { @@ -2626,7 +2625,7 @@ ieee_mkobject (abfd) output_buffer = 0; amt = sizeof (ieee_data_type); abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, amt); - return abfd->tdata.ieee_data ? true : false; + return abfd->tdata.ieee_data != NULL; } static void @@ -3943,7 +3942,7 @@ ieee_bfd_debug_info_accumulate (abfd, section) if (section->owner->xvec != abfd->xvec) return; /* Only bother once per bfd */ - if (ieee->done_debug == true) + if (ieee->done_debug) return; ieee->done_debug = true; @@ -4010,6 +4009,7 @@ ieee_bfd_debug_info_accumulate (abfd, section) #define ieee_bfd_relax_section bfd_generic_relax_section #define ieee_bfd_gc_sections bfd_generic_gc_sections #define ieee_bfd_merge_sections bfd_generic_merge_sections +#define ieee_bfd_discard_group bfd_generic_discard_group #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols @@ -193,19 +193,16 @@ static boolean ihex_mkobject (abfd) bfd *abfd; { - if (abfd->tdata.ihex_data == NULL) - { - struct ihex_data_struct *tdata; - bfd_size_type amt = sizeof (struct ihex_data_struct); + struct ihex_data_struct *tdata; + bfd_size_type amt = sizeof (struct ihex_data_struct); - tdata = (struct ihex_data_struct *) bfd_alloc (abfd, amt); - if (tdata == NULL) - return false; - abfd->tdata.ihex_data = tdata; - tdata->head = NULL; - tdata->tail = NULL; - } + tdata = (struct ihex_data_struct *) bfd_alloc (abfd, amt); + if (tdata == NULL) + return false; + abfd->tdata.ihex_data = tdata; + tdata->head = NULL; + tdata->tail = NULL; return true; } @@ -513,6 +510,7 @@ static const bfd_target * ihex_object_p (abfd) bfd *abfd; { + PTR tdata_save; bfd_byte b[9]; unsigned int i; unsigned int type; @@ -551,9 +549,14 @@ ihex_object_p (abfd) } /* OK, it looks like it really is an Intel Hex file. */ - if (! ihex_mkobject (abfd) - || ! ihex_scan (abfd)) - return NULL; + tdata_save = abfd->tdata.any; + if (! ihex_mkobject (abfd) || ! ihex_scan (abfd)) + { + if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL) + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = tdata_save; + return NULL; + } return abfd->xvec; } @@ -977,6 +980,7 @@ ihex_sizeof_headers (abfd, exec) #define ihex_bfd_relax_section bfd_generic_relax_section #define ihex_bfd_gc_sections bfd_generic_gc_sections #define ihex_bfd_merge_sections bfd_generic_merge_sections +#define ihex_bfd_discard_group bfd_generic_discard_group #define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ihex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/libaout.h b/bfd/libaout.h index d7e5c71..a76b935 100644 --- a/bfd/libaout.h +++ b/bfd/libaout.h @@ -302,6 +302,7 @@ enum machine_type { M_ALPHA_NETBSD = 141, /* NetBSD/alpha binary */ M_ARM6_NETBSD = 143, /* NetBSD/arm32 binary */ M_SPARCLET_1 = 147, /* 0x93, reserved */ + M_VAX4K_NETBSD = 150, /* NetBSD/vax 4K pages binary */ M_MIPS1 = 151, /* MIPS R2000/R3000 binary */ M_MIPS2 = 152, /* MIPS R4000/R6000 binary */ M_SPARCLET_2 = 163, /* 0xa3, reserved */ diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 106ba8d..776dcd6 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -322,6 +322,10 @@ extern boolean _bfd_generic_set_section_contents ((boolean (*) \ PARAMS ((bfd *, struct bfd_link_info *))) \ bfd_false) +#define _bfd_nolink_bfd_discard_group \ + ((boolean (*) \ + PARAMS ((bfd *, struct sec *))) \ + bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_hash_table_free \ @@ -589,5 +593,3 @@ extern boolean _bfd_sh_align_load_span boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma), PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *)); -/* And more follows */ - diff --git a/bfd/libbfd.c b/bfd/libbfd.c index a397d82..29170a0 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -1353,8 +1353,8 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) return bfd_get_section_contents (abfd, section, w->data, offset, count); } if (offset + count > section->_raw_size - || (bfd_get_file_window (abfd, section->filepos + offset, count, w, true) - == false)) + || ! bfd_get_file_window (abfd, section->filepos + offset, count, w, + true)) return false; return true; #else diff --git a/bfd/libbfd.h b/bfd/libbfd.h index cbb6390..88beae8 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -327,6 +327,10 @@ extern boolean _bfd_generic_set_section_contents ((boolean (*) \ PARAMS ((bfd *, struct bfd_link_info *))) \ bfd_false) +#define _bfd_nolink_bfd_discard_group \ + ((boolean (*) \ + PARAMS ((bfd *, struct sec *))) \ + bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_hash_table_free \ @@ -594,14 +598,15 @@ extern boolean _bfd_sh_align_load_span boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma), PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *)); -/* And more follows */ - +/* Extracted from init.c. */ +/* Extracted from libbfd.c. */ boolean bfd_write_bigendian_4byte_int PARAMS ((bfd *, unsigned int)); unsigned int bfd_log2 PARAMS ((bfd_vma x)); +/* Extracted from cache.c. */ #define BFD_CACHE_MAX_OPEN 10 extern bfd *bfd_last_cache; @@ -621,6 +626,7 @@ bfd_open_file PARAMS ((bfd *abfd)); FILE * bfd_cache_lookup_worker PARAMS ((bfd *abfd)); +/* Extracted from reloc.c. */ #ifdef _BFD_MAKE_TABLE_bfd_reloc_code_real static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", @@ -732,6 +738,19 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ALPHA_GPREL_HI16", "BFD_RELOC_ALPHA_GPREL_LO16", "BFD_RELOC_ALPHA_BRSGP", + "BFD_RELOC_ALPHA_TLSGD", + "BFD_RELOC_ALPHA_TLSLDM", + "BFD_RELOC_ALPHA_DTPMOD64", + "BFD_RELOC_ALPHA_GOTDTPREL16", + "BFD_RELOC_ALPHA_DTPREL64", + "BFD_RELOC_ALPHA_DTPREL_HI16", + "BFD_RELOC_ALPHA_DTPREL_LO16", + "BFD_RELOC_ALPHA_DTPREL16", + "BFD_RELOC_ALPHA_GOTTPREL16", + "BFD_RELOC_ALPHA_TPREL64", + "BFD_RELOC_ALPHA_TPREL_HI16", + "BFD_RELOC_ALPHA_TPREL_LO16", + "BFD_RELOC_ALPHA_TPREL16", "BFD_RELOC_MIPS_JMP", "BFD_RELOC_MIPS16_JMP", "BFD_RELOC_MIPS16_GPREL", @@ -762,6 +781,15 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MIPS_REL16", "BFD_RELOC_MIPS_RELGOT", "BFD_RELOC_MIPS_JALR", + "BFD_RELOC_FRV_LABEL16", + "BFD_RELOC_FRV_LABEL24", + "BFD_RELOC_FRV_LO16", + "BFD_RELOC_FRV_HI16", + "BFD_RELOC_FRV_GPREL12", + "BFD_RELOC_FRV_GPRELU12", + "BFD_RELOC_FRV_GPREL32", + "BFD_RELOC_FRV_GPRELHI", + "BFD_RELOC_FRV_GPRELLO", "BFD_RELOC_386_GOT32", "BFD_RELOC_386_PLT32", @@ -1092,6 +1120,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_390_GOT64", "BFD_RELOC_390_PLT64", "BFD_RELOC_390_GOTENT", + "BFD_RELOC_IP2K_FR9", + "BFD_RELOC_IP2K_BANK", + "BFD_RELOC_IP2K_ADDR16CJP", + "BFD_RELOC_IP2K_PAGE3", + "BFD_RELOC_IP2K_LO8DATA", + "BFD_RELOC_IP2K_HI8DATA", + "BFD_RELOC_IP2K_EX8DATA", + "BFD_RELOC_IP2K_LO8INSN", + "BFD_RELOC_IP2K_HI8INSN", + "BFD_RELOC_IP2K_PC_SKIP", + "BFD_RELOC_IP2K_TEXT", + "BFD_RELOC_IP2K_FR_OFFSET", + "BFD_RELOC_VPE4KMATH_DATA", + "BFD_RELOC_VPE4KMATH_INSN", "BFD_RELOC_VTABLE_INHERIT", "BFD_RELOC_VTABLE_ENTRY", "BFD_RELOC_IA64_IMM14", @@ -1176,6 +1218,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_M68HC11_HI8", "BFD_RELOC_M68HC11_LO8", "BFD_RELOC_M68HC11_3B", + "BFD_RELOC_M68HC11_RL_JUMP", + "BFD_RELOC_M68HC11_RL_GROUP", + "BFD_RELOC_M68HC11_LO16", + "BFD_RELOC_M68HC11_PAGE", + "BFD_RELOC_M68HC11_24", "BFD_RELOC_CRIS_BDISP8", "BFD_RELOC_CRIS_UNSIGNED_5", "BFD_RELOC_CRIS_SIGNED_6", @@ -1234,6 +1281,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_XSTORMY16_REL_12", "BFD_RELOC_XSTORMY16_24", "BFD_RELOC_XSTORMY16_FPTR16", + "BFD_RELOC_VAX_GLOB_DAT", + "BFD_RELOC_VAX_JMP_SLOT", + "BFD_RELOC_VAX_RELATIVE", "@@overflow: BFD_RELOC_UNUSED@@", }; #endif @@ -1261,6 +1311,7 @@ bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, boolean relocateable, asymbol **symbols)); +/* Extracted from archures.c. */ extern const bfd_arch_info_type bfd_default_arch_struct; boolean bfd_default_set_arch_mach PARAMS ((bfd *abfd, @@ -1274,6 +1325,7 @@ bfd_default_compatible PARAMS ((const bfd_arch_info_type *a, boolean bfd_default_scan PARAMS ((const struct bfd_arch_info *info, const char *string)); +/* Extracted from elf.c. */ struct elf_internal_shdr * bfd_elf_find_section PARAMS ((bfd *abfd, char *name)); diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index 618ddda..efc2fee 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -598,5 +598,3 @@ extern boolean ppc_allocate_toc_section extern boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); -/* And more taken from the source .. */ - diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 2e9a7d8..88b0909 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -602,8 +602,7 @@ extern boolean ppc_allocate_toc_section extern boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); -/* And more taken from the source .. */ - +/* Extracted from coffcode.h. */ typedef struct coff_ptr_struct { /* Remembers the offset from the first symbol in the file for diff --git a/bfd/libxcoff.h b/bfd/libxcoff.h index 7463eef..819b51f 100644 --- a/bfd/libxcoff.h +++ b/bfd/libxcoff.h @@ -39,12 +39,18 @@ struct xcoff_backend_data_rec long _xcoff_machine; /* Function pointers to xcoff specific swap routines. */ - void (* _xcoff_swap_ldhdr_in)(bfd *, const PTR, struct internal_ldhdr *); - void (* _xcoff_swap_ldhdr_out)(bfd *, const struct internal_ldhdr *, PTR); - void (* _xcoff_swap_ldsym_in)(bfd *, const PTR, struct internal_ldsym *); - void (* _xcoff_swap_ldsym_out)(bfd *, const struct internal_ldsym *, PTR); - void (* _xcoff_swap_ldrel_in)(bfd *, const PTR, struct internal_ldrel *); - void (* _xcoff_swap_ldrel_out)(bfd *, const struct internal_ldrel *, PTR); + void (* _xcoff_swap_ldhdr_in) + PARAMS ((bfd *, const PTR, struct internal_ldhdr *)); + void (* _xcoff_swap_ldhdr_out) + PARAMS ((bfd *, const struct internal_ldhdr *, PTR)); + void (* _xcoff_swap_ldsym_in) + PARAMS ((bfd *, const PTR, struct internal_ldsym *)); + void (* _xcoff_swap_ldsym_out) + PARAMS ((bfd *, const struct internal_ldsym *, PTR)); + void (* _xcoff_swap_ldrel_in) + PARAMS ((bfd *, const PTR, struct internal_ldrel *)); + void (* _xcoff_swap_ldrel_out) + PARAMS ((bfd *, const struct internal_ldrel *, PTR)); /* Size of the external struct. */ unsigned int _xcoff_ldhdrsz; @@ -63,29 +69,33 @@ struct xcoff_backend_data_rec unsigned long _xcoff_ldhdr_version; boolean (* _xcoff_put_symbol_name) - PARAMS ((bfd *, struct bfd_strtab_hash *, struct internal_syment *, - const char *)); + PARAMS ((bfd *, struct bfd_strtab_hash *, struct internal_syment *, + const char *)); boolean (* _xcoff_put_ldsymbol_name) - PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *, - const char *)); + PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *, + const char *)); reloc_howto_type *_xcoff_dynamic_reloc; asection * (* _xcoff_create_csect_from_smclas) - PARAMS ((bfd *, union internal_auxent *, const char *)); + PARAMS ((bfd *, union internal_auxent *, const char *)); /* Line number and relocation overflow. XCOFF32 overflows to another section when the line number or the relocation count exceeds 0xffff. XCOFF64 does not overflow. */ - boolean (*_xcoff_is_lineno_count_overflow)(bfd *, bfd_vma); - boolean (*_xcoff_is_reloc_count_overflow)(bfd *, bfd_vma); + boolean (*_xcoff_is_lineno_count_overflow) + PARAMS ((bfd *, bfd_vma)); + boolean (*_xcoff_is_reloc_count_overflow) + PARAMS ((bfd *, bfd_vma)); /* Loader section symbol and relocation table offset XCOFF32 is after the .loader header XCOFF64 is offset in .loader header. */ - bfd_vma (*_xcoff_loader_symbol_offset)(bfd *, struct internal_ldhdr *); - bfd_vma (*_xcoff_loader_reloc_offset)(bfd *, struct internal_ldhdr *); + bfd_vma (*_xcoff_loader_symbol_offset) + PARAMS ((bfd *, struct internal_ldhdr *)); + bfd_vma (*_xcoff_loader_reloc_offset) + PARAMS ((bfd *, struct internal_ldhdr *)); /* Global linkage. The first word of global linkage code must be be modified by filling in the correct TOC offset. */ @@ -96,8 +106,8 @@ struct xcoff_backend_data_rec /* rtinit. */ unsigned int _xcoff_rtinit_size; - boolean (*_xcoff_generate_rtinit)(bfd *, const char *, const char *, - boolean); + boolean (*_xcoff_generate_rtinit) + PARAMS ((bfd *, const char *, const char *, boolean)); }; /* Look up an entry in an XCOFF link hash table. */ @@ -218,9 +228,9 @@ struct xcoff_backend_data_rec bfd *, bfd_vma, bfd_vma, struct reloc_howto_struct *howto extern boolean (*xcoff_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) - (XCOFF_RELOC_FUNCTION_ARGS); + PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); extern boolean (*xcoff_complain_overflow[XCOFF_MAX_COMPLAIN_OVERFLOW]) - (XCOFF_COMPLAIN_FUNCTION_ARGS); + PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); /* Relocation functions */ boolean xcoff_reloc_type_noop PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); diff --git a/bfd/linker.c b/bfd/linker.c index 228f088..242f8bd 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1674,8 +1674,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, abort (); if (! ((*info->callbacks->constructor) - (info, - c == 'I' ? true : false, + (info, c == 'I', h->root.string, abfd, section, value))) return false; } @@ -1975,12 +1974,12 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, else { char *w; + size_t len = strlen (string) + 1; - w = bfd_hash_allocate (&info->hash->table, - strlen (string) + 1); + w = bfd_hash_allocate (&info->hash->table, len); if (w == NULL) return false; - strcpy (w, string); + memcpy (w, string, len); sub->u.i.warning = w; } @@ -2391,7 +2390,7 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) Gross. .bss and similar sections won't have the linker_mark field set. */ if ((sym->section->flags & SEC_HAS_CONTENTS) != 0 - && sym->section->linker_mark == false) + && ! sym->section->linker_mark) output = false; if (output) diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c index 7dd0428..863a61d 100644 --- a/bfd/m68klinux.c +++ b/bfd/m68klinux.c @@ -601,13 +601,12 @@ bfd_m68klinux_size_dynamic_sections (output_bfd, info) { s->_raw_size = linux_hash_table (info)->fixup_count + 1; s->_raw_size *= 8; - s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size); if (s->contents == NULL) { bfd_set_error (bfd_error_no_memory); return false; } - memset (s->contents, 0, (size_t) s->_raw_size); } return true; diff --git a/bfd/merge.c b/bfd/merge.c index e175efd..ce61207 100644 --- a/bfd/merge.c +++ b/bfd/merge.c @@ -1,22 +1,22 @@ /* SEC_MERGE support. - Copyright 2001 Free Software Foundation, Inc. + Copyright 2001, 2002 Free Software Foundation, Inc. Written by Jakub Jelinek <jakub@redhat.com>. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This file contains support for merging duplicate entities within sections, as used in ELF SHF_MERGE. */ @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "hashtab.h" +#include "libiberty.h" struct sec_merge_sec_info; @@ -38,7 +39,8 @@ struct sec_merge_hash_entry /* Start of this string needs to be aligned to alignment octets (not 1 << align). */ unsigned int alignment; - union { + union + { /* Index within the merged section. */ bfd_size_type index; /* Entity size (if present in suffix hash tables). */ @@ -144,7 +146,7 @@ sec_merge_hash_newfunc (entry, table, string) ret->next = NULL; } - return (struct bfd_hash_entry *)ret; + return (struct bfd_hash_entry *) ret; } /* Look up an entry in a section merge hash table. */ @@ -381,14 +383,6 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo) return true; } - if (sec->output_section != NULL - && bfd_is_abs_section (sec->output_section)) - { - /* The section is being discarded from the link, so we should - just ignore it. */ - return true; - } - align = bfd_get_section_alignment (sec->owner, sec); if ((sec->entsize < (unsigned int)(1 << align) && ((sec->entsize & (sec->entsize - 1)) @@ -415,15 +409,14 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo) if (sinfo == NULL) { /* Initialize the information we need to keep track of. */ - sinfo = (struct sec_merge_info *) - bfd_alloc (abfd, (bfd_size_type) sizeof (struct sec_merge_info)); + amt = sizeof (struct sec_merge_info); + sinfo = (struct sec_merge_info *) bfd_alloc (abfd, amt); if (sinfo == NULL) goto error_return; sinfo->next = (struct sec_merge_info *) *psinfo; sinfo->chain = NULL; *psinfo = (PTR) sinfo; - sinfo->htab = - sec_merge_init (sec->entsize, (sec->flags & SEC_STRINGS)); + sinfo->htab = sec_merge_init (sec->entsize, (sec->flags & SEC_STRINGS)); if (sinfo->htab == NULL) goto error_return; } @@ -650,8 +643,10 @@ merge_strings (sinfo) qsort (array, (size_t) sinfo->htab->size, sizeof (struct sec_merge_hash_entry *), cmplengthentry); - last4tab = htab_create ((size_t) sinfo->htab->size * 4, NULL, last4_eq, NULL); - lasttab = htab_create ((size_t) sinfo->htab->size * 4, NULL, last_eq, NULL); + last4tab = htab_create_alloc ((size_t) sinfo->htab->size * 4, + NULL, last4_eq, NULL, calloc, free); + lasttab = htab_create_alloc ((size_t) sinfo->htab->size * 4, + NULL, last_eq, NULL, calloc, free); if (lasttab == NULL || last4tab == NULL) goto alloc_failure; @@ -839,10 +834,7 @@ _bfd_merge_sections (abfd, xsinfo, remove_hook) the hash table at all. */ for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) if (secinfo->first == NULL) - { - secinfo->sec->_cooked_size = 0; - secinfo->sec->flags |= SEC_EXCLUDE; - } + secinfo->sec->_cooked_size = 0; } return true; @@ -908,7 +900,7 @@ _bfd_merged_section_offset (output_bfd, psec, psecinfo, offset, addend) if (sec->entsize == 1) { p = secinfo->contents + offset + addend - 1; - while (*p && p >= secinfo->contents) + while (p >= secinfo->contents && *p) --p; ++p; } @@ -260,7 +260,7 @@ enum mmo_sym_type { mmo_reg_sym, mmo_undef_sym, mmo_data_sym, mmo_abs_sym}; struct mmo_symbol { struct mmo_symbol *next; - CONST char *name; + const char *name; bfd_vma value; enum mmo_sym_type sym_type; unsigned int serno; @@ -357,7 +357,7 @@ static void mmo_write_section_unless_reg_contents PARAMS ((bfd *, asection *, PTR)); static void mmo_find_sec_w_addr PARAMS ((bfd *, asection *, PTR)); static void mmo_find_sec_w_addr_grow PARAMS ((bfd *, asection *, PTR)); -static asection *mmo_make_section PARAMS ((bfd *, CONST char *)); +static asection *mmo_make_section PARAMS ((bfd *, const char *)); static void mmo_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static void mmo_print_symbol PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); @@ -371,10 +371,10 @@ static INLINE bfd_byte *mmo_get_loc PARAMS ((asection *, bfd_vma, int)); static void mmo_xore_64 PARAMS ((asection *, bfd_vma vma, bfd_vma value)); static void mmo_xore_32 PARAMS ((asection *, bfd_vma vma, unsigned int)); static void mmo_xore_16 PARAMS ((asection *, bfd_vma vma, unsigned int)); -static CONST bfd_target *mmo_object_p PARAMS ((bfd *)); +static const bfd_target *mmo_object_p PARAMS ((bfd *)); static void mmo_map_set_sizes PARAMS ((bfd *, asection *, PTR)); static boolean mmo_get_symbols PARAMS ((bfd *)); -static boolean mmo_create_symbol PARAMS ((bfd *, CONST char *, bfd_vma, +static boolean mmo_create_symbol PARAMS ((bfd *, const char *, bfd_vma, enum mmo_sym_type, unsigned int)); static boolean mmo_get_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); @@ -391,7 +391,7 @@ static long mmo_get_reloc_upper_bound PARAMS ((bfd *, asection *)); static boolean mmo_internal_write_header PARAMS ((bfd *)); static boolean mmo_internal_write_post PARAMS ((bfd *, int, asection *)); static boolean mmo_internal_add_3_sym - PARAMS ((bfd *, struct mmo_symbol_trie *, CONST struct mmo_symbol *)); + PARAMS ((bfd *, struct mmo_symbol_trie *, const struct mmo_symbol *)); static unsigned int mmo_internal_3_length PARAMS ((bfd *, struct mmo_symbol_trie *)); static void mmo_internal_3_dump @@ -404,10 +404,10 @@ static void mmo_write_tetra_raw PARAMS ((bfd *, unsigned int)); static void mmo_write_octa PARAMS ((bfd *, bfd_vma)); static void mmo_write_octa_raw PARAMS ((bfd *, bfd_vma)); static boolean mmo_write_chunk - PARAMS ((bfd *, CONST bfd_byte *, unsigned int)); + PARAMS ((bfd *, const bfd_byte *, unsigned int)); static boolean mmo_flush_chunk PARAMS ((bfd *)); static boolean mmo_write_loc_chunk - PARAMS ((bfd *, bfd_vma, CONST bfd_byte *, unsigned int, bfd_vma *)); + PARAMS ((bfd *, bfd_vma, const bfd_byte *, unsigned int, bfd_vma *)); static boolean mmo_write_chunk_list PARAMS ((bfd *, mmo_data_list_type *)); static boolean mmo_write_loc_chunk_list PARAMS ((bfd *, mmo_data_list_type *)); @@ -417,7 +417,7 @@ static flagword bfd_sec_flags_from_mmo_flags PARAMS ((flagword)); static bfd_byte mmo_get_byte PARAMS ((bfd *)); static void mmo_write_byte PARAMS ((bfd *, bfd_byte)); static boolean mmo_new_section_hook PARAMS ((bfd *, asection *)); -static int mmo_sort_mmo_symbols PARAMS ((CONST PTR, CONST PTR)); +static int mmo_sort_mmo_symbols PARAMS ((const PTR, const PTR)); static boolean mmo_write_object_contents PARAMS ((bfd *)); static long mmo_canonicalize_reloc PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); @@ -446,7 +446,7 @@ char valid_mmo_symbol_character_set[/* A-Z a-z (we assume consecutive static asection * mmo_make_section (abfd, secname) bfd *abfd; - CONST char *secname; + const char *secname; { asection *sec = bfd_get_section_by_name (abfd, secname); @@ -481,7 +481,7 @@ mmo_init () static const char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789:_"; - if (inited == true) + if (inited) return; inited = true; @@ -495,7 +495,7 @@ mmo_init () /* Check whether an existing file is an mmo file. */ -static CONST bfd_target * +static const bfd_target * mmo_object_p (abfd) bfd *abfd; { @@ -819,7 +819,7 @@ mmo_write_octa_raw (abfd, value) static INLINE boolean mmo_write_chunk (abfd, loc, len) bfd *abfd; - CONST bfd_byte *loc; + const bfd_byte *loc; unsigned int len; { boolean retval = true; @@ -846,10 +846,9 @@ mmo_write_chunk (abfd, loc, len) if (loc[0] == LOP) mmo_write_tetra_raw (abfd, LOP_QUOTE_NEXT); - retval - = (retval == true - && abfd->tdata.mmo_data->have_error == false - && 4 == bfd_bwrite ((PTR) loc, 4, abfd)); + retval = (retval + && ! abfd->tdata.mmo_data->have_error + && 4 == bfd_bwrite ((PTR) loc, 4, abfd)); loc += 4; len -= 4; @@ -861,7 +860,7 @@ mmo_write_chunk (abfd, loc, len) abfd->tdata.mmo_data->byte_no = len; } - if (retval == false) + if (! retval) abfd->tdata.mmo_data->have_error = true; return retval; } @@ -882,7 +881,7 @@ mmo_flush_chunk (abfd) abfd->tdata.mmo_data->byte_no = 0; } - return abfd->tdata.mmo_data->have_error == false; + return ! abfd->tdata.mmo_data->have_error; } /* Same, but from a list. */ @@ -907,23 +906,30 @@ static boolean mmo_write_loc_chunk (abfd, vma, loc, len, last_vmap) bfd *abfd; bfd_vma vma; - CONST bfd_byte *loc; + const bfd_byte *loc; unsigned int len; bfd_vma *last_vmap; { /* Find an initial and trailing section of zero tetras; we don't need to write out zeros. FIXME: When we do this, we should emit section size and address specifiers, else objcopy can't always perform an identity - translation. */ - while (len >= 4 && bfd_get_32 (abfd, loc) == 0) + translation. Only do this if we *don't* have left-over data from a + previous write or the vma of this chunk is *not* the next address, + because then data isn't tetrabyte-aligned and we're concatenating to + that left-over data. */ + + if (abfd->tdata.mmo_data->byte_no == 0 || vma != *last_vmap) { - vma += 4; - len -= 4; - loc += 4; - } + while (len >= 4 && bfd_get_32 (abfd, loc) == 0) + { + vma += 4; + len -= 4; + loc += 4; + } - while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0) - len -= 4; + while (len >= 4 && bfd_get_32 (abfd, loc + len - 4) == 0) + len -= 4; + } /* Only write out the location if it's different than the one the caller (supposedly) previously handled, accounting for omitted leading zeros. */ @@ -941,9 +947,8 @@ mmo_write_loc_chunk (abfd, vma, loc, len, last_vmap) /* Update to reflect end of this chunk, with trailing zeros omitted. */ *last_vmap = vma + len; - return - abfd->tdata.mmo_data->have_error == false - && mmo_write_chunk (abfd, loc, len); + return (! abfd->tdata.mmo_data->have_error + && mmo_write_chunk (abfd, loc, len)); } /* Same, but from a list. */ @@ -1161,7 +1166,7 @@ mmo_get_byte (abfd) if (abfd->tdata.mmo_data->byte_no == 0) { - if (abfd->tdata.mmo_data->have_error == false + if (! abfd->tdata.mmo_data->have_error && bfd_bread (abfd->tdata.mmo_data->buf, 4, abfd) != 4) { abfd->tdata.mmo_data->have_error = true; @@ -1188,7 +1193,7 @@ mmo_write_byte (abfd, value) abfd->tdata.mmo_data->buf[(abfd->tdata.mmo_data->byte_no++ % 4)] = value; if ((abfd->tdata.mmo_data->byte_no % 4) == 0) { - if (abfd->tdata.mmo_data->have_error == false + if (! abfd->tdata.mmo_data->have_error && bfd_bwrite (abfd->tdata.mmo_data->buf, 4, abfd) != 4) abfd->tdata.mmo_data->have_error = true; } @@ -1199,7 +1204,7 @@ mmo_write_byte (abfd, value) static boolean mmo_create_symbol (abfd, symname, addr, sym_type, serno) bfd *abfd; - CONST char *symname; + const char *symname; bfd_vma addr; enum mmo_sym_type sym_type; unsigned int serno; @@ -1354,7 +1359,7 @@ SUBSECTION bfd_byte m = mmo_get_byte (abfd); /* Check first if we have a bad hair day. */ - if (abfd->tdata.mmo_data->have_error == true) + if (abfd->tdata.mmo_data->have_error) return false; if (m & MMO3_LEFT) @@ -1438,7 +1443,7 @@ SUBSECTION serno -= 128; /* Got it. Now enter it. Skip a leading ":". */ - if (abfd->tdata.mmo_data->have_error == false + if (! abfd->tdata.mmo_data->have_error && ! mmo_create_symbol (abfd, abfd->tdata.mmo_data->lop_stab_symbol + 1, @@ -1457,7 +1462,7 @@ SUBSECTION /* Traverse right trie. */ mmo_get_symbols (abfd); - return abfd->tdata.mmo_data->have_error == false; + return ! abfd->tdata.mmo_data->have_error; } /* Get the location of memory area [VMA..VMA + SIZE - 1], which we think @@ -2060,7 +2065,7 @@ mmo_scan (abfd) for (i = 0; i < sizeof (file_names) / sizeof (file_names[0]); i++) if (file_names[i]) free (file_names[i]); - return error ? false : true; + return ! error; } /* A hook to set up object file dependent section information. For mmo, @@ -2135,11 +2140,11 @@ mmo_get_symtab_upper_bound (abfd) static int mmo_sort_mmo_symbols (arg1, arg2) - CONST PTR arg1; - CONST PTR arg2; + const PTR arg1; + const PTR arg2; { - CONST struct mmo_symbol *sym1 = *(CONST struct mmo_symbol **) arg1; - CONST struct mmo_symbol *sym2 = *(CONST struct mmo_symbol **) arg2; + const struct mmo_symbol *sym1 = *(const struct mmo_symbol **) arg1; + const struct mmo_symbol *sym2 = *(const struct mmo_symbol **) arg2; /* Sort by serial number first. */ if (sym1->serno < sym2->serno) @@ -2148,7 +2153,7 @@ mmo_sort_mmo_symbols (arg1, arg2) return 1; /* Then sort by address of the table entries. */ - return ((CONST char *) arg1 - (CONST char *) arg2); + return ((const char *) arg1 - (const char *) arg2); } /* Translate the symbol table. */ @@ -2295,7 +2300,7 @@ static boolean mmo_internal_write_header (abfd) bfd *abfd; { - CONST char lop_pre_bfd[] = { LOP, LOP_PRE, 1, 1}; + const char lop_pre_bfd[] = { LOP, LOP_PRE, 1, 1}; if (bfd_bwrite (lop_pre_bfd, 4, abfd) != 4) return false; @@ -2335,9 +2340,7 @@ mmo_internal_write_post (abfd, z, sec) Z == 255, don't assume DATA is valid. */ bfd_put_64 (abfd, bfd_get_start_address (abfd), buf); - return - abfd->tdata.mmo_data->have_error == false - && bfd_bwrite (buf, 8, abfd) == 8; + return ! abfd->tdata.mmo_data->have_error && bfd_bwrite (buf, 8, abfd) == 8; } /* Translate to and from BFD flags. This is to make sure that we don't @@ -2442,11 +2445,10 @@ mmo_internal_write_section (abfd, sec) { int n = atoi (sec->name + strlen (MMIX_OTHER_SPEC_SECTION_PREFIX)); mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_SPEC << 16) | n); - return - abfd->tdata.mmo_data->have_error == false - && mmo_write_chunk_list (abfd, - ((struct mmo_section_data_struct *) - (sec->used_by_bfd))->head); + return (! abfd->tdata.mmo_data->have_error + && mmo_write_chunk_list (abfd, + ((struct mmo_section_data_struct *) + (sec->used_by_bfd))->head)); } /* Ignore sections that are just allocated or empty; we write out _contents_ here. */ @@ -2563,13 +2565,13 @@ EXAMPLE /* Writing a LOP_LOC ends the LOP_SPEC data, and makes data actually loaded. */ if (bfd_get_section_flags (abfd, sec) & SEC_LOAD) - return - abfd->tdata.mmo_data->have_error == false + return + ! abfd->tdata.mmo_data->have_error && mmo_write_loc_chunk_list (abfd, ((struct mmo_section_data_struct *) (sec->used_by_bfd))->head); return - abfd->tdata.mmo_data->have_error == false + ! abfd->tdata.mmo_data->have_error && mmo_write_chunk_list (abfd, ((struct mmo_section_data_struct *) (sec->used_by_bfd))->head); @@ -2619,9 +2621,9 @@ static boolean mmo_internal_add_3_sym (abfd, rootp, symp) bfd *abfd; struct mmo_symbol_trie *rootp; - CONST struct mmo_symbol *symp; + const struct mmo_symbol *symp; { - CONST char *name = symp->name; + const char *name = symp->name; struct mmo_symbol_trie *trie = rootp; struct mmo_symbol_trie **triep = NULL; @@ -3088,7 +3090,7 @@ mmo_write_section_unless_reg_contents (abfd, sec, p) { struct mmo_write_sec_info *infop = (struct mmo_write_sec_info *) p; - if (infop->retval == false) + if (! infop->retval) return; if (strcmp (sec->name, MMIX_REG_CONTENTS_SECTION_NAME) == 0) @@ -3139,7 +3141,7 @@ mmo_write_object_contents (abfd) bfd_map_over_sections (abfd, mmo_write_section_unless_reg_contents, (PTR) &wsecinfo); - if (wsecinfo.retval == false) + if (! wsecinfo.retval) return false; if (wsecinfo.reg_section != NULL) @@ -3256,6 +3258,7 @@ mmo_canonicalize_reloc (abfd, section, relptr, symbols) #define mmo_set_arch_mach bfd_default_set_arch_mach #define mmo_bfd_relax_section bfd_generic_relax_section #define mmo_bfd_merge_sections bfd_generic_merge_sections +#define mmo_bfd_discard_group bfd_generic_discard_group /* objcopy will be upset if we return -1 from bfd_get_reloc_upper_bound by using BFD_JUMP_TABLE_RELOCS (_bfd_norelocs) rather than 0. FIXME: Most @@ -3277,7 +3280,7 @@ mmo_canonicalize_reloc (abfd, section, relptr, symbols) #define mmo_bfd_set_private_flags _bfd_generic_bfd_set_private_flags #define mmo_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data -CONST bfd_target bfd_mmo_vec = +const bfd_target bfd_mmo_vec = { "mmo", /* name */ bfd_target_mmo_flavour, diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index e8f4626..e0a8304 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define nlm_bfd_relax_section bfd_generic_relax_section #define nlm_bfd_gc_sections bfd_generic_gc_sections #define nlm_bfd_merge_sections bfd_generic_merge_sections +#define nlm_bfd_discard_group bfd_generic_discard_group #define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define nlm_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/nlm32-alpha.c b/bfd/nlm32-alpha.c index 0d3919e..6099c2b 100644 --- a/bfd/nlm32-alpha.c +++ b/bfd/nlm32-alpha.c @@ -1,5 +1,5 @@ /* Support for 32-bit Alpha NLM (NetWare Loadable Module) - Copyright 1993, 1994, 2000, 2001 Free Software Foundation, Inc. + Copyright 1993, 1994, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -654,9 +654,7 @@ nlm_alpha_read_import (abfd, sym) { asection *section; - if (nlm_alpha_read_reloc (abfd, sym, §ion, - &nlm_relocs -> reloc) - == false) + if (! nlm_alpha_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc)) return false; nlm_relocs -> section = section; nlm_relocs++; @@ -846,18 +844,17 @@ nlm_alpha_write_external (abfd, count, sym, relocs) r.address = nlm_alpha_backend_data (abfd)->lita_address; r.addend = nlm_alpha_backend_data (abfd)->lita_size + 1; - if (nlm_alpha_write_import (abfd, (asection *) NULL, &r) == false) + if (! nlm_alpha_write_import (abfd, (asection *) NULL, &r)) return false; r.address = nlm_alpha_backend_data (abfd)->gp; r.addend = 0; - if (nlm_alpha_write_import (abfd, (asection *) NULL, &r) == false) + if (! nlm_alpha_write_import (abfd, (asection *) NULL, &r)) return false; for (i = 0; i < count; i++) { - if (nlm_alpha_write_import (abfd, relocs[i].sec, - relocs[i].rel) == false) + if (! nlm_alpha_write_import (abfd, relocs[i].sec, relocs[i].rel)) return false; } diff --git a/bfd/nlm32-i386.c b/bfd/nlm32-i386.c index 32b05b4..095ab63 100644 --- a/bfd/nlm32-i386.c +++ b/bfd/nlm32-i386.c @@ -1,5 +1,5 @@ /* Support for 32-bit i386 NLM (NetWare Loadable Module) - Copyright 1993, 1994, 2000, 2001 Free Software Foundation, Inc. + Copyright 1993, 1994, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -378,9 +378,7 @@ nlm_i386_read_import (abfd, sym) { asection *section; - if (nlm_i386_read_reloc (abfd, sym, §ion, - &nlm_relocs -> reloc) - == false) + if (! nlm_i386_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc)) return false; nlm_relocs -> section = section; nlm_relocs++; @@ -414,8 +412,7 @@ nlm_i386_write_external (abfd, count, sym, relocs) for (i = 0; i < count; i++) { - if (nlm_i386_write_import (abfd, relocs[i].sec, - relocs[i].rel) == false) + if (! nlm_i386_write_import (abfd, relocs[i].sec, relocs[i].rel)) return false; } diff --git a/bfd/nlm32-ppc.c b/bfd/nlm32-ppc.c index 98410a8..884b85a 100644 --- a/bfd/nlm32-ppc.c +++ b/bfd/nlm32-ppc.c @@ -1,5 +1,5 @@ /* Support for 32-bit PowerPC NLM (NetWare Loadable Module) - Copyright 1994, 1995, 2000, 2001 Free Software Foundation, Inc. + Copyright 1994, 1995, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -689,9 +689,7 @@ nlm_powerpc_read_import (abfd, sym) { asection *section; - if (nlm_powerpc_read_reloc (abfd, sym, §ion, - &nlm_relocs -> reloc) - == false) + if (! nlm_powerpc_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc)) return false; nlm_relocs -> section = section; nlm_relocs++; diff --git a/bfd/nlm32-sparc.c b/bfd/nlm32-sparc.c index 0246dd2..76b7328 100644 --- a/bfd/nlm32-sparc.c +++ b/bfd/nlm32-sparc.c @@ -1,5 +1,5 @@ /* Support for 32-bit SPARC NLM (NetWare Loadable Module) - Copyright 1993, 1994, 2000, 2001 Free Software Foundation, Inc. + Copyright 1993, 1994, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -296,9 +296,7 @@ nlm_sparc_read_import (abfd, sym) { asection *section; - if (nlm_sparc_read_reloc (abfd, sym, §ion, - &nlm_relocs -> reloc) - == false) + if (! nlm_sparc_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc)) return false; nlm_relocs -> section = section; nlm_relocs++; @@ -342,7 +340,7 @@ nlm_sparc_write_import (abfd, sec, rel) bfd_put_32 (abfd, (bfd_vma) 1, temp); if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) return false; - if (nlm_sparc_write_reloc (abfd, sec, rel) == false) + if (! nlm_sparc_write_reloc (abfd, sec, rel)) return false; return true; } @@ -372,8 +370,7 @@ nlm_sparc_write_external (abfd, count, sym, relocs) for (i = 0; i < count; i++) { - if (nlm_sparc_write_reloc (abfd, relocs[i].sec, - relocs[i].rel) == false) + if (! nlm_sparc_write_reloc (abfd, relocs[i].sec, relocs[i].rel)) return false; } diff --git a/bfd/nlmcode.h b/bfd/nlmcode.h index d4501d0..0e089b3 100644 --- a/bfd/nlmcode.h +++ b/bfd/nlmcode.h @@ -1,25 +1,25 @@ /* NLM (NetWare Loadable Module) executable support for BFD. - Copyright 1993, 1994, 1995, 1998, 2000, 2001 + Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, using ELF support as the template. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -57,7 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define nlm_swap_fixed_header_out(abfd,src,dst) \ (nlm_swap_fixed_header_out_func(abfd)) (abfd,src,dst) -/* Forward declarations of static functions */ +/* Forward declarations of static functions. */ static boolean add_bfd_section PARAMS ((bfd *, char *, file_ptr, bfd_size_type, flagword)); @@ -114,7 +114,6 @@ nlm_object_p (abfd) } /* Read in the fixed length portion of the NLM header in external format. */ - amt = nlm_fixed_header_size (abfd); x_fxdhdr = (PTR) bfd_malloc (amt); if (x_fxdhdr == NULL) @@ -130,7 +129,6 @@ nlm_object_p (abfd) /* Allocate an instance of the nlm_obj_tdata structure and hook it up to the tdata pointer in the bfd. */ - amt = sizeof (struct nlm_obj_tdata); new_tdata = (struct nlm_obj_tdata *) bfd_zalloc (abfd, amt); if (new_tdata == NULL) @@ -145,7 +143,6 @@ nlm_object_p (abfd) /* Check to see if we have an NLM file for this backend by matching the NLM signature. */ - signature = nlm_signature (abfd); if (signature != NULL && *signature != '\0' @@ -155,14 +152,12 @@ nlm_object_p (abfd) /* There's no supported way to discover the endianess of an NLM, so test for a sane version number after doing byte swapping appropriate for this - XVEC. (Hack alert!) */ - + XVEC. (Hack alert!) */ if (i_fxdhdrp->version > 0xFFFF) goto got_wrong_format_error; /* There's no supported way to check for 32 bit versus 64 bit addresses, so ignore this distinction for now. (FIXME) */ - /* Swap in the rest of the required header. */ if (!nlm_swap_variable_header_in (abfd)) { @@ -177,7 +172,6 @@ nlm_object_p (abfd) additional sections described in the cygnus_ext header. From this point on we assume that we have an NLM, and do not treat errors as indicating the wrong format. */ - if (!add_bfd_section (abfd, NLM_CODE_NAME, i_fxdhdrp->codeImageOffset, i_fxdhdrp->codeImageSize, @@ -239,14 +233,14 @@ add_bfd_section (abfd, name, offset, size, flags) newsect = bfd_make_section (abfd, name); if (newsect == NULL) - { - return false; - } + return false; + newsect->vma = 0; /* NLM's are relocatable. */ newsect->_raw_size = size; newsect->filepos = offset; newsect->flags = flags; newsect->alignment_power = bfd_log2 ((bfd_vma) 0); /* FIXME */ + return true; } @@ -327,7 +321,6 @@ nlm_swap_variable_header_out (abfd) bfd_size_type amt; /* Write the description length and text members. */ - amt = sizeof (nlm_variable_header (abfd)->descriptionLength); if (bfd_bwrite ((PTR) & nlm_variable_header (abfd)->descriptionLength, amt, abfd) != amt) @@ -338,7 +331,6 @@ nlm_swap_variable_header_out (abfd) return false; /* Convert and write the stackSize field. */ - put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->stackSize, (bfd_byte *) temp); amt = sizeof (temp); @@ -346,7 +338,6 @@ nlm_swap_variable_header_out (abfd) return false; /* Convert and write the reserved field. */ - put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->reserved, (bfd_byte *) temp); amt = sizeof (temp); @@ -354,14 +345,12 @@ nlm_swap_variable_header_out (abfd) return false; /* Write the oldThreadName field. This field is a fixed length string. */ - amt = sizeof (nlm_variable_header (abfd)->oldThreadName); if (bfd_bwrite ((PTR) nlm_variable_header (abfd)->oldThreadName, amt, abfd) != amt) return false; /* Write the screen name length and text members. */ - amt = sizeof (nlm_variable_header (abfd)->screenNameLength); if (bfd_bwrite ((PTR) & nlm_variable_header (abfd)->screenNameLength, amt, abfd) != amt) @@ -372,7 +361,6 @@ nlm_swap_variable_header_out (abfd) return false; /* Write the thread name length and text members. */ - amt = sizeof (nlm_variable_header (abfd)->threadNameLength); if (bfd_bwrite ((PTR) & nlm_variable_header (abfd)->threadNameLength, amt, abfd) != amt) @@ -663,9 +651,7 @@ nlm_swap_auxiliary_headers_in (abfd) } } else - { - break; - } + break; } return true; } @@ -719,6 +705,31 @@ nlm_swap_auxiliary_headers_out (abfd) return false; } + /* Note - the CoPyRiGhT tag is emitted before the MeSsAgEs + tag in order to make the NW4.x and NW5.x loaders happy. */ + + /* Write out the copyright header if there is one. */ + if (find_nonzero ((PTR) nlm_copyright_header (abfd), + sizeof (Nlm_Internal_Copyright_Header))) + { + Nlm_External_Copyright_Header thdr; + + memcpy (thdr.stamp, "CoPyRiGhT=", 10); + amt = sizeof (thdr.stamp); + if (bfd_bwrite ((PTR) thdr.stamp, amt, abfd) != amt) + return false; + thdr.copyrightMessageLength[0] = + nlm_copyright_header (abfd)->copyrightMessageLength; + amt = 1; + if (bfd_bwrite ((PTR) thdr.copyrightMessageLength, amt, abfd) != amt) + return false; + /* The copyright message is a variable length string. */ + amt = nlm_copyright_header (abfd)->copyrightMessageLength + 1; + if (bfd_bwrite ((PTR) nlm_copyright_header (abfd)->copyrightMessage, + amt, abfd) != amt) + return false; + } + /* Write out the extended header if there is one. */ if (find_nonzero ((PTR) nlm_extended_header (abfd), sizeof (Nlm_Internal_Extended_Header))) @@ -818,28 +829,6 @@ nlm_swap_auxiliary_headers_out (abfd) return false; } - /* Write out the copyright header if there is one. */ - if (find_nonzero ((PTR) nlm_copyright_header (abfd), - sizeof (Nlm_Internal_Copyright_Header))) - { - Nlm_External_Copyright_Header thdr; - - memcpy (thdr.stamp, "CoPyRiGhT=", 10); - amt = sizeof (thdr.stamp); - if (bfd_bwrite ((PTR) thdr.stamp, amt, abfd) != amt) - return false; - thdr.copyrightMessageLength[0] = - nlm_copyright_header (abfd)->copyrightMessageLength; - amt = 1; - if (bfd_bwrite ((PTR) thdr.copyrightMessageLength, amt, abfd) != amt) - return false; - /* The copyright message is a variable length string. */ - amt = nlm_copyright_header (abfd)->copyrightMessageLength + 1; - if (bfd_bwrite ((PTR) nlm_copyright_header (abfd)->copyrightMessage, - amt, abfd) != amt) - return false; - } - /* Write out the custom header if there is one. */ if (find_nonzero ((PTR) nlm_custom_header (abfd), sizeof (Nlm_Internal_Custom_Header))) @@ -913,7 +902,7 @@ long nlm_get_symtab_upper_bound (abfd) bfd *abfd; { - Nlm_Internal_Fixed_Header *i_fxdhdrp; /* Nlm file header, internal form */ + Nlm_Internal_Fixed_Header *i_fxdhdrp; /* Nlm file header, internal form. */ long symcount; long symtab_size = 0; @@ -936,7 +925,7 @@ nlm_get_symtab (abfd, alocation) nlm_symbol_type *symbase; bfd_size_type counter = 0; - if (nlm_slurp_symbol_table (abfd) == false) + if (! nlm_slurp_symbol_table (abfd)) return -1; symbase = nlm_get_symbols (abfd); while (counter < bfd_get_symcount (abfd)) @@ -1018,20 +1007,19 @@ nlm_print_symbol (abfd, afile, symbol, how) The bfd symbols are copied to SYMPTRS. When we return, the bfd symcount is either zero or contains the correct - number of symbols. -*/ + number of symbols. */ static boolean nlm_slurp_symbol_table (abfd) bfd *abfd; { - Nlm_Internal_Fixed_Header *i_fxdhdrp; /* Nlm file header, internal form */ - bfd_size_type totsymcount; /* Number of NLM symbols */ - bfd_size_type symcount; /* Counter of NLM symbols */ - nlm_symbol_type *sym; /* Pointer to current bfd symbol */ - unsigned char symlength; /* Symbol length read into here */ - unsigned char symtype; /* Type of debugging symbol */ - bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* Symbol offsets read into here */ + Nlm_Internal_Fixed_Header *i_fxdhdrp; /* Nlm file header, internal form. */ + bfd_size_type totsymcount; /* Number of NLM symbols. */ + bfd_size_type symcount; /* Counter of NLM symbols. */ + nlm_symbol_type *sym; /* Pointer to current bfd symbol. */ + unsigned char symlength; /* Symbol length read into here. */ + unsigned char symtype; /* Type of debugging symbol. */ + bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* Symbol offsets read into here. */ boolean (*read_import_func) PARAMS ((bfd *, nlm_symbol_type *)); boolean (*set_public_section_func) PARAMS ((bfd *, nlm_symbol_type *)); bfd_size_type amt; @@ -1053,9 +1041,7 @@ nlm_slurp_symbol_table (abfd) + i_fxdhdrp->numberOfDebugRecords + i_fxdhdrp->numberOfExternalReferences); if (totsymcount == 0) - { - return true; - } + return true; if (bfd_seek (abfd, i_fxdhdrp->publicsOffset, SEEK_SET) != 0) return false; @@ -1095,7 +1081,7 @@ nlm_slurp_symbol_table (abfd) { /* Most backends can use the code below, but unfortunately some use a different scheme. */ - if ((*set_public_section_func) (abfd, sym) == false) + if (! (*set_public_section_func) (abfd, sym)) return false; } else @@ -1171,7 +1157,6 @@ nlm_slurp_symbol_table (abfd) /* Read in the import records. We can only do this if we know how to read relocs for this target. */ - read_import_func = nlm_read_import_func (abfd); if (read_import_func != NULL) { @@ -1181,7 +1166,7 @@ nlm_slurp_symbol_table (abfd) symcount += i_fxdhdrp->numberOfExternalReferences; while (abfd->symcount < symcount) { - if ((*read_import_func) (abfd, sym) == false) + if (! (*read_import_func) (abfd, sym)) return false; sym++; abfd->symcount++; @@ -1238,7 +1223,7 @@ nlm_slurp_reloc_fixups (abfd) the machine specific reloc information is. */ while (count-- != 0) { - if ((*read_func) (abfd, (nlm_symbol_type *) NULL, secs, rels) == false) + if (! (*read_func) (abfd, (nlm_symbol_type *) NULL, secs, rels)) { nlm_relocation_fixups (abfd) = NULL; nlm_relocation_fixup_secs (abfd) = NULL; @@ -1274,7 +1259,7 @@ nlm_get_reloc_upper_bound (abfd, sec) syms = nlm_get_symbols (abfd); if (syms == NULL) { - if (nlm_slurp_symbol_table (abfd) == false) + if (! nlm_slurp_symbol_table (abfd)) return -1; syms = nlm_get_symbols (abfd); } @@ -1309,7 +1294,7 @@ nlm_canonicalize_reloc (abfd, sec, relptr, symbols) rels = nlm_relocation_fixups (abfd); if (rels == NULL) { - if (nlm_slurp_reloc_fixups (abfd) == false) + if (! nlm_slurp_reloc_fixups (abfd)) return -1; rels = nlm_relocation_fixups (abfd); } @@ -1386,7 +1371,7 @@ nlm_compute_section_file_positions (abfd) asection *bss_sec; asymbol **sym_ptr_ptr; - if (abfd->output_has_begun == true) + if (abfd->output_has_begun) return true; /* Make sure we have a section to hold uninitialized data. */ @@ -1587,8 +1572,8 @@ nlm_set_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - if (abfd->output_has_begun == false - && nlm_compute_section_file_positions (abfd) == false) + if (! abfd->output_has_begun + && ! nlm_compute_section_file_positions (abfd)) return false; if (count == 0) @@ -1690,16 +1675,16 @@ nlm_write_object_contents (abfd) if (fixed_header == NULL) goto error_return; - if (abfd->output_has_begun == false - && nlm_compute_section_file_positions (abfd) == false) + if (! abfd->output_has_begun + && ! nlm_compute_section_file_positions (abfd)) goto error_return; /* Write out the variable length headers. */ pos = nlm_optional_prefix_size (abfd) + nlm_fixed_header_size (abfd); if (bfd_seek (abfd, pos, SEEK_SET) != 0) goto error_return; - if (nlm_swap_variable_header_out (abfd) == false - || nlm_swap_auxiliary_headers_out (abfd) == false) + if (! nlm_swap_variable_header_out (abfd) + || ! nlm_swap_auxiliary_headers_out (abfd)) { bfd_set_error (bfd_error_system_call); goto error_return; @@ -1760,7 +1745,7 @@ nlm_write_object_contents (abfd) if (! bfd_is_und_section (bfd_get_section (sym))) { ++internal_reloc_count; - if ((*write_import_func) (abfd, sec, rel) == false) + if (! (*write_import_func) (abfd, sec, rel)) goto error_return; } else @@ -1832,9 +1817,8 @@ nlm_write_object_contents (abfd) j++) ++cnt; - if ((*nlm_write_external_func (abfd)) (abfd, cnt, sym, - &external_relocs[i]) - == false) + if (! (*nlm_write_external_func (abfd)) (abfd, cnt, sym, + &external_relocs[i])) goto error_return; i += cnt; @@ -1902,7 +1886,7 @@ nlm_write_object_contents (abfd) if (write_export_func) { - if ((*write_export_func) (abfd, sym, offset) == false) + if (! (*write_export_func) (abfd, sym, offset)) goto error_return; } else @@ -2036,7 +2020,7 @@ nlm_write_object_contents (abfd) write_prefix_func = nlm_write_prefix_func (abfd); if (write_prefix_func) { - if ((*write_prefix_func) (abfd) == false) + if (! (*write_prefix_func) (abfd)) goto error_return; } diff --git a/bfd/ns32k.h b/bfd/ns32k.h index 818ae0b..a97a9ae 100644 --- a/bfd/ns32k.h +++ b/bfd/ns32k.h @@ -1,22 +1,22 @@ /* Header file for ns32k routines. - Copyright 1996, 2001 Free Software Foundation, Inc. + Copyright 1996, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern bfd_reloc_status_type _bfd_ns32k_relocate_contents PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *)); @@ -24,7 +24,7 @@ extern bfd_reloc_status_type _bfd_ns32k_relocate_contents extern bfd_reloc_status_type _bfd_do_ns32k_reloc_contents PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *, bfd_vma (*) (bfd_byte *, int), - int (*) (bfd_vma, bfd_byte *, int))); + void (*) (bfd_vma, bfd_byte *, int))); extern bfd_reloc_status_type _bfd_ns32k_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma, @@ -32,8 +32,8 @@ extern bfd_reloc_status_type _bfd_ns32k_final_link_relocate extern bfd_vma _bfd_ns32k_get_displacement PARAMS ((bfd_byte *, int)); extern bfd_vma _bfd_ns32k_get_immediate PARAMS ((bfd_byte *, int)); -extern int _bfd_ns32k_put_displacement PARAMS ((bfd_vma, bfd_byte *, int)); -extern int _bfd_ns32k_put_immediate PARAMS ((bfd_vma, bfd_byte *, int)); +extern void _bfd_ns32k_put_displacement PARAMS ((bfd_vma, bfd_byte *, int)); +extern void _bfd_ns32k_put_immediate PARAMS ((bfd_vma, bfd_byte *, int)); extern bfd_reloc_status_type _bfd_ns32k_reloc_disp PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); diff --git a/bfd/ns32knetbsd.c b/bfd/ns32knetbsd.c index 032a96d..3c3b5a2 100644 --- a/bfd/ns32knetbsd.c +++ b/bfd/ns32knetbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for NetBSD/ns32k a.out-ish binaries. - Copyright 1990, 1991, 1992, 1994, 1995, 1998, 2000, 2001 + Copyright 1990, 1991, 1992, 1994, 1995, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -48,7 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" /* To ensure following declaration is OK */ -CONST struct reloc_howto_struct * +const struct reloc_howto_struct * MY_bfd_reloc_type_lookup PARAMS((bfd *abfd AND bfd_reloc_code_real_type code)); diff --git a/bfd/oasys.c b/bfd/oasys.c index 5c2bf5e..9035a4f 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -254,7 +254,7 @@ oasys_get_symtab (abfd, location) { asymbol *symbase; unsigned int counter; - if (oasys_slurp_symbol_table (abfd) == false) + if (! oasys_slurp_symbol_table (abfd)) { return -1; } @@ -411,7 +411,7 @@ oasys_mkobject (abfd) { bfd_size_type amt = sizeof (oasys_data_type); abfd->tdata.oasys_obj_data = (oasys_data_type *) bfd_alloc (abfd, amt); - return abfd->tdata.oasys_obj_data ? true : false; + return abfd->tdata.oasys_obj_data != NULL; } #define MAX_SECS 16 @@ -496,7 +496,7 @@ oasys_object_p (abfd) case oasys_record_is_module_enum: case oasys_record_is_named_section_enum: case oasys_record_is_end_enum: - if (had_usefull == false) + if (! had_usefull) goto fail; loop = false; break; @@ -600,7 +600,7 @@ oasys_slurp_section_data (abfd) for (s = abfd->sections; s != (asection *) NULL; s = s->next) { per = oasys_per_section (s); - if (per->initialized == true) + if (per->initialized) return true; } @@ -632,7 +632,7 @@ oasys_slurp_section_data (abfd) per = oasys_per_section (section); - if (per->initialized == false) + if (! per->initialized) { per->data = (bfd_byte *) bfd_zalloc (abfd, section->_raw_size); if (!per->data) @@ -646,7 +646,7 @@ oasys_slurp_section_data (abfd) } dst_offset = H_GET_32 (abfd, record.data.addr); - if (per->had_vma == false) + if (! per->had_vma) { /* Take the first vma we see as the base */ section->vma = dst_offset; @@ -728,16 +728,13 @@ oasys_slurp_section_data (abfd) r->relent.sym_ptr_ptr = (asymbol **) NULL; section->reloc_count++; - /* Fake up the data to look like it's got the -ve pc in it, this makes - it much easier to convert into other formats. This is done by - hitting the addend. - */ - if (r->relent.howto->pc_relative == true) - { - r->relent.addend -= dst_ptr - dst_base_ptr; - } - - + /* Fake up the data to look like + it's got the -ve pc in it, this + makes it much easier to convert + into other formats. This is done + by hitting the addend. */ + if (r->relent.howto->pc_relative) + r->relent.addend -= dst_ptr - dst_base_ptr; } break; @@ -772,17 +769,13 @@ oasys_slurp_section_data (abfd) section->reloc_count++; src += 2; - /* Fake up the data to look like it's got the -ve pc in it, this makes - it much easier to convert into other formats. This is done by - hitting the addend. - */ - if (r->relent.howto->pc_relative == true) - { - r->relent.addend -= dst_ptr - dst_base_ptr; - } - - - + /* Fake up the data to look like + it's got the -ve pc in it, this + makes it much easier to convert + into other formats. This is done + by hitting the addend. */ + if (r->relent.howto->pc_relative) + r->relent.addend -= dst_ptr - dst_base_ptr; } break; case RELOCATION_TYPE_COM: @@ -850,7 +843,7 @@ oasys_get_section_contents (abfd, section, location, offset, count) { oasys_per_section_type *p = (oasys_per_section_type *) section->used_by_bfd; oasys_slurp_section_data (abfd); - if (p->initialized == false) + if (! p->initialized) { (void) memset (location, 0, (size_t) count); } @@ -1490,6 +1483,7 @@ oasys_sizeof_headers (abfd, exec) #define oasys_bfd_relax_section bfd_generic_relax_section #define oasys_bfd_gc_sections bfd_generic_gc_sections #define oasys_bfd_merge_sections bfd_generic_merge_sections +#define oasys_bfd_discard_group bfd_generic_discard_group #define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define oasys_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/opncls.c b/bfd/opncls.c index f110259..cdf08df 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -152,7 +152,6 @@ bfd_openr (filename, target) target_vec = bfd_find_target (target, nbfd); if (target_vec == NULL) { - bfd_set_error (bfd_error_invalid_target); _bfd_delete_bfd (nbfd); return NULL; } @@ -220,7 +219,8 @@ bfd_fdopenr (filename, target, fd) #else fdflags = fcntl (fd, F_GETFL, NULL); #endif - if (fdflags == -1) return NULL; + if (fdflags == -1) + return NULL; nbfd = _bfd_new_bfd (); if (nbfd == NULL) @@ -229,7 +229,6 @@ bfd_fdopenr (filename, target, fd) target_vec = bfd_find_target (target, nbfd); if (target_vec == NULL) { - bfd_set_error (bfd_error_invalid_target); _bfd_delete_bfd (nbfd); return NULL; } @@ -308,7 +307,6 @@ bfd_openstreamr (filename, target, streamarg) target_vec = bfd_find_target (target, nbfd); if (target_vec == NULL) { - bfd_set_error (bfd_error_invalid_target); _bfd_delete_bfd (nbfd); return NULL; } @@ -354,8 +352,6 @@ bfd_openw (filename, target) bfd *nbfd; const bfd_target *target_vec; - bfd_set_error (bfd_error_system_call); - /* nbfd has to point to head of malloc'ed block so that bfd_close may reclaim it correctly. */ nbfd = _bfd_new_bfd (); diff --git a/bfd/pdp11.c b/bfd/pdp11.c index d4fe79e..cb47f78 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -1479,9 +1479,9 @@ aout_get_external_symbols (abfd) count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE; #ifdef USE_MMAP - if (bfd_get_file_window (abfd, - obj_sym_filepos (abfd), exec_hdr (abfd)->a_syms, - &obj_aout_sym_window (abfd), true) == false) + if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), + exec_hdr (abfd)->a_syms, + &obj_aout_sym_window (abfd), true)) return false; syms = (struct external_nlist *) obj_aout_sym_window (abfd).data; #else @@ -1520,8 +1520,8 @@ aout_get_external_symbols (abfd) stringsize = H_GET_32 (abfd, string_chars); #ifdef USE_MMAP - if (bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize, - &obj_aout_string_window (abfd), true) == false) + if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize, + &obj_aout_string_window (abfd), true)) return false; strings = (char *) obj_aout_string_window (abfd).data; #else @@ -1841,11 +1841,9 @@ NAME(aout,slurp_symbol_table) (abfd) cached_size = obj_aout_external_sym_count (abfd); cached_size *= sizeof (aout_symbol_type); - cached = (aout_symbol_type *) bfd_malloc (cached_size); + cached = (aout_symbol_type *) bfd_zmalloc (cached_size); if (cached == NULL && cached_size != 0) return false; - if (cached_size != 0) - memset (cached, 0, (size_t) cached_size); /* Convert from external symbol information to internal. */ if (! (NAME(aout,translate_symbol_table) @@ -2255,10 +2253,9 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) count = real_count; } - reloc_cache = (arelent *) bfd_malloc (count * sizeof (arelent)); + reloc_cache = (arelent *) bfd_zmalloc (count * sizeof (arelent)); if (reloc_cache == NULL && count != 0) return false; - memset (reloc_cache, 0, (size_t) count * sizeof (arelent)); cache_ptr = reloc_cache; @@ -2319,8 +2316,6 @@ NAME(aout,squirt_out_relocs) (abfd, section) if (!native) return false; - memset ((PTR)native, 0, (size_t) natsize); - generic = section->orelocation; if (generic != NULL) { diff --git a/bfd/pe-i386.c b/bfd/pe-i386.c index 7ced147..9c75f95 100644 --- a/bfd/pe-i386.c +++ b/bfd/pe-i386.c @@ -1,21 +1,21 @@ /* BFD back-end for Intel 386 PECOFF files. - Copyright 1995, 1996, 1999, 2001 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2001, 2002 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -29,6 +29,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define COFF_LONG_FILENAMES #define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 22f2e3f..b643f3c 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -3,21 +3,21 @@ Free Software Foundation, Inc. Written by Cygnus Solutions. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Most of this hacked by Steve Chamberlain <sac@cygnus.com>. @@ -620,7 +620,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) extra->NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; /* first null out all data directory entries .. */ - memset (extra->DataDirectory, sizeof (extra->DataDirectory), 0); + memset (extra->DataDirectory, 0, sizeof (extra->DataDirectory)); add_data_entry (abfd, extra, 0, ".edata", ib); @@ -1142,6 +1142,7 @@ pe_print_idata (abfd, vfile) adj = section->vma - extra->ImageBase; + /* Print all image import descriptors. */ for (i = 0; i < datasize; i += onaline) { bfd_vma hint_addr; @@ -1153,7 +1154,7 @@ pe_print_idata (abfd, vfile) bfd_size_type j; char *dll; - /* print (i + extra->DataDirectory[1].VirtualAddress) */ + /* Print (i + extra->DataDirectory[1].VirtualAddress). */ fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff)); #if 0 if (i + 20 > datasize) @@ -1181,19 +1182,83 @@ pe_print_idata (abfd, vfile) if (hint_addr != 0) { - fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); + bfd_byte *ft_data; + asection *ft_section; + bfd_vma ft_addr; + bfd_size_type ft_datasize; + int ft_idx; + int ft_allocated = 0; + + fprintf (file, _("\tvma: Hint/Ord Member-Name Bound-To\n")); idx = hint_addr - adj; + + ft_addr = first_thunk + extra->ImageBase; + ft_data = data; + ft_idx = first_thunk - adj; + ft_allocated = 0; + + if (first_thunk != hint_addr) + { + /* Find the section which contains the first thunk. */ + for (ft_section = abfd->sections; + ft_section != NULL; + ft_section = ft_section->next) + { + ft_datasize = bfd_section_size (abfd, ft_section); + if (ft_addr >= ft_section->vma + && ft_addr < ft_section->vma + ft_datasize) + break; + } + + if (ft_section == NULL) + { + fprintf (file, + _("\nThere is a first thunk, but the section containing it could not be found\n")); + continue; + } + + /* Now check to see if this section is the same as our current + section. If it is not then we will have to load its data in. */ + if (ft_section == section) + { + ft_data = data; + ft_idx = first_thunk - adj; + } + else + { + ft_idx = first_thunk - (ft_section->vma - extra->ImageBase); + ft_data = (bfd_byte *) bfd_malloc (datasize); + if (ft_data == NULL) + continue; + + /* Read datasize bfd_bytes starting at offset ft_idx. */ + if (! bfd_get_section_contents (abfd, ft_section, + (PTR) ft_data, + (bfd_vma) ft_idx, + datasize)) + { + free (ft_data); + continue; + } + ft_idx = 0; + ft_allocated = 1; + } + } + + /* Print HintName vector entries. */ for (j = 0; j < datasize; j += 4) { unsigned long member = bfd_get_32 (abfd, data + idx + j); + /* Print single IMAGE_IMPORT_BY_NAME vector. */ if (member == 0) break; + if (member & 0x80000000) - fprintf (file, "\t%04lx\t %4lu", member, - member & 0x7fffffff); + fprintf (file, "\t%04lx\t %4lu <none>", + member, member & 0x7fffffff); else { int ordinal; @@ -1206,117 +1271,15 @@ pe_print_idata (abfd, vfile) } /* If the time stamp is not zero, the import address - table holds actual addresses. */ + table holds actual addresses. */ if (time_stamp != 0 && first_thunk != 0 && first_thunk != hint_addr) fprintf (file, "\t%04lx", - (long) bfd_get_32 (abfd, data + first_thunk - adj + j)); + (long) bfd_get_32 (abfd, ft_data + ft_idx + j)); fprintf (file, "\n"); } - } - - if (hint_addr != first_thunk && time_stamp == 0) - { - bfd_byte *ft_data; - asection *ft_section; - bfd_vma ft_addr; - bfd_size_type ft_datasize; - int ft_idx; - int differ = 0; - int ft_allocated = 0; - - ft_addr = first_thunk + extra->ImageBase; - - /* Find the section which contains the first thunk. */ - for (ft_section = abfd->sections; - ft_section != NULL; - ft_section = ft_section->next) - { - ft_datasize = bfd_section_size (abfd, ft_section); - if (ft_addr >= ft_section->vma - && ft_addr < ft_section->vma + ft_datasize) - break; - } - - if (ft_section == NULL) - { - fprintf (file, - _("\nThere is a first thunk, but the section containing it could not be found\n")); - continue; - } - - /* Now check to see if this section is the same as our current - section. If it is not then we will have to load its data in. */ - if (ft_section == section) - { - ft_data = data; - ft_idx = first_thunk - adj; - } - else - { - ft_idx = first_thunk - (ft_section->vma - extra->ImageBase); - ft_data = (bfd_byte *) bfd_malloc (datasize); - if (ft_data == NULL) - continue; - - /* Read datasize bfd_bytes starting at offset ft_idx. */ - if (! bfd_get_section_contents (abfd, ft_section, (PTR) ft_data, (bfd_vma) ft_idx, datasize)) - { - free (ft_data); - continue; - } - - ft_idx = 0; - ft_allocated = 1; - } - - for (j = 0; j < datasize; j += 4) - { - int ordinal; - char *member_name; - bfd_vma hint_member = 0; - bfd_vma iat_member; - - if (hint_addr != 0) - hint_member = bfd_get_32 (abfd, data + idx + j); - iat_member = bfd_get_32 (abfd, ft_data + ft_idx + j); - - if (hint_addr == 0 && iat_member == 0) - break; - - if (hint_addr == 0 || hint_member != iat_member) - { - if (differ == 0) - { - fprintf (file, - _("\tThe Import Address Table (difference found)\n")); - fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); - differ = 1; - } - - if (iat_member == 0) - fprintf (file, - _("\t>>> Ran out of IAT members!\n")); - else - { - ordinal = bfd_get_16 (abfd, data + iat_member - adj); - member_name = (char *) data + iat_member - adj + 2; - fprintf (file, "\t%04lx\t %4d %s\n", - (unsigned long) iat_member, - ordinal, - member_name); - } - } - - if (hint_addr != 0 && hint_member == 0) - break; - } - - if (differ == 0) - fprintf (file, - _("\tThe Import Address Table is identical\n")); if (ft_allocated) free (ft_data); diff --git a/bfd/pei-i386.c b/bfd/pei-i386.c index 8f0f77a..9f577e6 100644 --- a/bfd/pei-i386.c +++ b/bfd/pei-i386.c @@ -1,21 +1,21 @@ /* BFD back-end for Intel 386 PE IMAGE COFF files. - Copyright 1995, 1996, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2002 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -30,6 +30,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define COFF_LONG_FILENAMES #define COFF_SECTION_ALIGNMENT_ENTRIES \ +{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ +{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \ + COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \ diff --git a/bfd/peicode.h b/bfd/peicode.h index 323b30d..a621acc 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -1,5 +1,5 @@ /* Support for the generic parts of PE/PEI, for BFD. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Solutions. @@ -312,7 +312,7 @@ pe_mkobject_hook (abfd, filehdr, aouthdr) struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; pe_data_type *pe; - if (pe_mkobject (abfd) == false) + if (! pe_mkobject (abfd)) return NULL; pe = pe_data (abfd); @@ -1207,7 +1207,10 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc return NULL; if (bfd_bread (ptr, size, abfd) != size) - return NULL; + { + bfd_release (abfd, ptr); + return NULL; + } symbol_name = ptr; source_dll = ptr + strlen (ptr) + 1; @@ -1219,14 +1222,17 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc (_("%s: string not null terminated in ILF object file."), bfd_archive_filename (abfd)); bfd_set_error (bfd_error_malformed_archive); - + bfd_release (abfd, ptr); return NULL; } /* Now construct the bfd. */ if (! pe_ILF_build_a_bfd (abfd, magic, symbol_name, source_dll, ordinal, types)) - return NULL; + { + bfd_release (abfd, ptr); + return NULL; + } return abfd->xvec; } diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index 8f0199d..4c32ca0 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -65,7 +65,9 @@ cpu-avr.c cpu-cris.c cpu-d10v.c cpu-d30v.c +cpu-dlx.c cpu-fr30.c +cpu-frv.c cpu-h8300.c cpu-h8500.c cpu-hppa.c @@ -74,6 +76,7 @@ cpu-i386.c cpu-i860.c cpu-i960.c cpu-ia64.c +cpu-ip2k.c cpu-m10200.c cpu-m10300.c cpu-m32r.c @@ -124,15 +127,19 @@ elf32-avr.c elf32-cris.c elf32-d10v.c elf32-d30v.c +elf32-dlx.c elf32-fr30.c +elf32-frv.c elf32-gen.c elf32-h8300.c elf32-hppa.c elf32-hppa.h elf32-i370.c elf32-i386.c +elf32-i386qnx.c elf32-i860.c elf32-i960.c +elf32-ip2k.c elf32-m32r.c elf32-m68hc11.c elf32-m68hc12.c @@ -148,9 +155,12 @@ elf32-s390.c elf32-sh-lin.c elf32-sh-nbsd.c elf32-sh.c +elf32-sh64-com.c +elf32-sh64-nbsd.c elf32-sh64.c elf32-sparc.c elf32-v850.c +elf32-vax.c elf32-xstormy16.c elf32.c elf64-alpha.c @@ -161,6 +171,7 @@ elf64-mips.c elf64-mmix.c elf64-ppc.c elf64-s390.c +elf64-sh64-nbsd.c elf64-sh64.c elf64-sparc.c elf64-x86-64.c @@ -268,6 +279,8 @@ syms.c targets.c tekhex.c trad-core.c +vax1knetbsd.c +vaxbsd.c vaxnetbsd.c versados.c version.h diff --git a/bfd/po/es.po b/bfd/po/es.po index db6b76a..ab8b837 100644 --- a/bfd/po/es.po +++ b/bfd/po/es.po @@ -1,19 +1,19 @@ -# Mensajes en español para bfd 2.12-pre020121. +# Mensajes en español para bfd 2.12.91. # Copyright (C) 2002 Free Software Foundation, Inc. # Cristian Othón Martínez Vera <cfuga@itam.mx>, 2002. # msgid "" msgstr "" -"Project-Id-Version: bfd 2.12-pre020121\n" -"POT-Creation-Date: 2002-01-31 17:07+0000\n" -"PO-Revision-Date: 2002-01-24 10:04-0600\n" +"Project-Id-Version: bfd 2.12.91\n" +"POT-Creation-Date: 2002-07-23 15:55-0400\n" +"PO-Revision-Date: 2002-07-24 02:29-0500\n" "Last-Translator: Cristian Othón Martínez Vera <cfuga@itam.mx>\n" "Language-Team: Spanish <es@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: aout-adobe.c:196 +#: aout-adobe.c:197 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "%s: Tipo de sección desconocido en el fichero a.out.adobe: %x\n" @@ -36,31 +36,25 @@ msgstr "%s: Registro de reubicación importado erróneo: %d" #: aoutx.h:1282 aoutx.h:1699 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" -msgstr "" -"%s: no se puede representar la sección `%s' en el fichero objeto de formato " -"a.out" +msgstr "%s: no se puede representar la sección `%s' en el fichero objeto de formato a.out" #: aoutx.h:1669 #, c-format -msgid "" -"%s: can not represent section for symbol `%s' in a.out object file format" -msgstr "" -"%s: no se puede representar la sección para el símbolo `%s' en el fichero " -"objeto de formato a.out" +msgid "%s: can not represent section for symbol `%s' in a.out object file format" +msgstr "%s: no se puede representar la sección para el símbolo `%s' en el fichero objeto de formato a.out" #: aoutx.h:1671 msgid "*unknown*" msgstr "*desconocido*" -#: aoutx.h:3735 +#: aoutx.h:3732 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "%s: enlace reubicable desde %s a %s sin soporte" #: archive.c:1826 msgid "Warning: writing archive was slow: rewriting timestamp\n" -msgstr "" -"Aviso: la escritura del fichero fue lenta: reescribiendo la marca de tiempo\n" +msgstr "Aviso: la escritura del fichero fue lenta: reescribiendo la marca de tiempo\n" # ¡Uff! Si utilizáramos file=archivo, esta traducción sería imposible. cfuga #: archive.c:2093 @@ -163,7 +157,7 @@ msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "error interno de BFD %s, abortando en %s línea %d en %s\n" #: bfd.c:723 -#, fuzzy, c-format +#, c-format msgid "BFD %s internal error, aborting at %s line %d\n" msgstr "error interno de BFD %s, abortando en %s línea %d\n" @@ -174,9 +168,7 @@ msgstr "Por favor reporte este bicho.\n" #: binary.c:306 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." -msgstr "" -"Aviso: Escribiendo la sección `%s' a un desplazamiento de fichero grande (pe " -"negativo) 0x%lx." +msgstr "Aviso: Escribiendo la sección `%s' a un desplazamiento de fichero grande (pe negativo) 0x%lx." #: coff-a29k.c:119 msgid "Missing IHCONST" @@ -186,7 +178,7 @@ msgstr "IHCONST faltante" msgid "Missing IHIHALF" msgstr "IHIHALF faltante" -#: coff-a29k.c:212 coff-or32.c:228 +#: coff-a29k.c:212 coff-or32.c:229 msgid "Unrecognized reloc" msgstr "Reubicación no reconocida" @@ -198,7 +190,7 @@ msgstr "reubicación IHCONST faltante" msgid "missing IHIHALF reloc" msgstr "reubicación IHIHALF faltante" -#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1433 +#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432 msgid "GP relative relocation used when GP not defined" msgstr "se usó una reubicación GP relativa cuando GP no estaba definido" @@ -206,182 +198,156 @@ msgstr "se usó una reubicación GP relativa cuando GP no estaba definido" msgid "using multiple gp values" msgstr "usando valores múltiples de gp" -#: coff-arm.c:1051 elf32-arm.h:285 +#: coff-arm.c:1066 elf32-arm.h:285 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "%s: no se puede encontrar el pegamento THUMB '%s' para `%s'" -#: coff-arm.c:1080 elf32-arm.h:320 +#: coff-arm.c:1096 elf32-arm.h:320 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "%s: no se puede encontrar el pegamento ARM '%s' para `%s'" -#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 +#: coff-arm.c:1391 coff-arm.c:1486 elf32-arm.h:887 elf32-arm.h:991 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "%s(%s): aviso: interoperabilidad no activada." -#: coff-arm.c:1379 elf32-arm.h:993 +#: coff-arm.c:1395 elf32-arm.h:994 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr " primera ocurrencia: %s: llamada arm a thumb" -#: coff-arm.c:1474 elf32-arm.h:889 +#: coff-arm.c:1490 elf32-arm.h:890 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr " primera ocurrencia: %s: llamada thumb a arm" -#: coff-arm.c:1477 +#: coff-arm.c:1493 msgid " consider relinking with --support-old-code enabled" msgstr " considere el reenlace con --support-old-code activado" -#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 +#: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3031 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "%s: dirección de reubicación 0x%lx errónea en la sección `%s'" -#: coff-arm.c:2107 +#: coff-arm.c:2127 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "%s: índice de símbolos ilegal en la reubicación: %d" -#: coff-arm.c:2235 +#: coff-arm.c:2255 #, c-format -msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" -msgstr "" -"%s: ERROR: compilado para APCS-%d mientras que el objetivo %s usa APCS-%d" +msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" +msgstr "ERROR: %s está compilado para APCS-%d, mientras que %s está compilado para APCS-%d" -#: coff-arm.c:2250 +#: coff-arm.c:2270 elf32-arm.h:2297 #, c-format -msgid "" -"%s: ERROR: passes floats in float registers whereas target %s uses integer " -"registers" -msgstr "" -"%s: ERROR: pasan números de coma flotante en registros de coma flotante " -"mientras que el objetivo %s usa registros enteros" +msgid "ERROR: %s passes floats in float registers, whereas %s passes them in integer registers" +msgstr "ERROR: %s pasa números de coma flotante en registros de coma flotante, mientras que %s los pasa en registros enteros" -#: coff-arm.c:2253 +#: coff-arm.c:2273 elf32-arm.h:2302 #, c-format -msgid "" -"%s: ERROR: passes floats in integer registers whereas target %s uses float " -"registers" -msgstr "" -"%s: ERROR: pasan números de coma flotante en registros enteros mientras que " -"el objetivo %s usa registros de coma flotante" +msgid "ERROR: %s passes floats in integer registers, whereas %s passes them in float registers" +msgstr "ERROR: %s pasa números de coma flotante en registros enteros, mientras que %s los pasa en registros de coma flotante" -#: coff-arm.c:2268 +#: coff-arm.c:2288 #, c-format -msgid "" -"%s: ERROR: compiled as position independent code, whereas target %s is " -"absolute position" -msgstr "" -"%s: ERROR: compilado como código independiente de posición, mientras que el " -"objetivo %s es de posición absoluta" +msgid "ERROR: %s is compiled as position independent code, whereas target %s is absolute position" +msgstr "ERROR: %s está compilado como código independiente de posición, mientras que el objetivo %s es de posición absoluta" -#: coff-arm.c:2271 +#: coff-arm.c:2291 #, c-format -msgid "" -"%s: ERROR: compiled as absolute position code, whereas target %s is position " -"independent" -msgstr "" -"%s: ERROR: compilado como código de posición absoluta, mientras que el " -"objetivo %s es independiente de posición" +msgid "ERROR: %s is compiled as absolute position code, whereas target %s is position independent" +msgstr "ERROR: %s está compilado como código de posición absoluta, mientras que el objetivo %s es independiente de posición" -#: coff-arm.c:2300 -#, fuzzy, c-format -msgid "Warning: %s supports interworking, whereas %s does not." -msgstr "" -"Aviso: el fichero de entrada %s soporta interoperabilidad, mientras que %s no" +#: coff-arm.c:2320 elf32-arm.h:2358 +#, c-format +msgid "Warning: %s supports interworking, whereas %s does not" +msgstr "Aviso: el fichero de entrada %s soporta interoperabilidad, mientras que %s no" -#: coff-arm.c:2303 -#, fuzzy, c-format -msgid "Warning: %s does not support interworking, whereas %s does." -msgstr "" -"Aviso: el fichero de entrada %s no soporta interoperabilidad, mientras que %" -"s sí" +#: coff-arm.c:2323 elf32-arm.h:2365 +#, c-format +msgid "Warning: %s does not support interworking, whereas %s does" +msgstr "Aviso: el fichero de entrada %s no soporta interoperabilidad, mientras que %s sí" -#: coff-arm.c:2330 +#: coff-arm.c:2350 #, c-format msgid "private flags = %x:" msgstr "opciones privadas = %x:" -#: coff-arm.c:2338 elf32-arm.h:2408 +#: coff-arm.c:2358 elf32-arm.h:2418 msgid " [floats passed in float registers]" msgstr "[números de coma flotante pasados en registros de coma flotante]" -#: coff-arm.c:2340 +#: coff-arm.c:2360 msgid " [floats passed in integer registers]" msgstr "[números de coma flotante pasados en registros enteros]" -#: coff-arm.c:2343 elf32-arm.h:2411 +#: coff-arm.c:2363 elf32-arm.h:2421 msgid " [position independent]" msgstr "[independiente de posición]" -#: coff-arm.c:2345 +#: coff-arm.c:2365 msgid " [absolute position]" msgstr "[posición absoluta]" -#: coff-arm.c:2349 +#: coff-arm.c:2369 msgid " [interworking flag not initialised]" msgstr "[opción de interoperabilidad no iniciada]" -#: coff-arm.c:2351 +#: coff-arm.c:2371 msgid " [interworking supported]" msgstr "[soporte para interoperabilidad]" -#: coff-arm.c:2353 +#: coff-arm.c:2373 msgid " [interworking not supported]" msgstr "[sin soporte para interoperabilidad]" -#: coff-arm.c:2401 elf32-arm.h:2114 -#, fuzzy, c-format -msgid "" -"Warning: Not setting interworking flag of %s since it has already been " -"specified as non-interworking" -msgstr "" -"Aviso: No se establece la opción de interoperabilidad de %s, ya que ya había " -"sido especificado como no interoperable" +#: coff-arm.c:2421 elf32-arm.h:2124 +#, c-format +msgid "Warning: Not setting interworking flag of %s since it has already been specified as non-interworking" +msgstr "Aviso: No se establece la opción de interoperabilidad de %s ya que se había especificado con anterioridad como no interoperable" -#: coff-arm.c:2405 elf32-arm.h:2118 +#: coff-arm.c:2425 elf32-arm.h:2128 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" -msgstr "" -"Aviso: Limpiando la opción de interoperabilidad de %s debido a una petición " -"externa" +msgstr "Aviso: Limpiando la opción de interoperabilidad de %s debido a una petición externa" #: coff-i960.c:136 coff-i960.c:485 msgid "uncertain calling convention for non-COFF symbol" msgstr "convención de llamada incierta para un símbolo que no es COFF" -#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2212 elf32-mips.c:9954 +#: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844 msgid "unsupported reloc type" msgstr "tipo de reubicación sin soporte" -#: coff-mips.c:875 elf32-mips.c:1997 elf64-mips.c:1739 +#: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609 msgid "GP relative relocation when _gp not defined" msgstr "reubicación GP relativa cuando _gp no está definido" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2468 +#: coff-mips.c:2466 msgid "reloc against unsupported section" msgstr "reubicación contra una sección sin soporte" -#: coff-mips.c:2476 +#: coff-mips.c:2474 msgid "reloc not properly aligned" msgstr "reubicación no alineada adecuadamente" -#: coff-rs6000.c:2710 coff64-rs6000.c:1164 +#: coff-rs6000.c:2766 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "%s: tipo de reubicación 0x%02x sin soporte" -#: coff-rs6000.c:2756 coff64-rs6000.c:1210 +#: coff-rs6000.c:2859 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "%s: reubicación de TOC en 0x%x al símbolo `%s' sin entrada TOC" -#: coff-rs6000.c:3006 coff64-rs6000.c:2060 +#: coff-rs6000.c:3590 coff64-rs6000.c:2091 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" msgstr "%s: el símbolo `%s' tiene smclas %d no reconocido" @@ -391,7 +357,7 @@ msgstr "%s: el símbolo `%s' tiene smclas %d no reconocido" msgid "Unrecognized reloc type 0x%x" msgstr "Tipo de reubicación 0x%x no reconocida" -#: coff-tic54x.c:390 coffcode.h:4868 +#: coff-tic54x.c:390 coffcode.h:4974 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "%s: aviso: íncide de símbolos %ld ilegal en reubicaciones" @@ -401,37 +367,37 @@ msgstr "%s: aviso: íncide de símbolos %ld ilegal en reubicaciones" msgid "ignoring reloc %s\n" msgstr "ignorando la reubicación %s\n" -#: coffcode.h:1081 +#: coffcode.h:1086 #, c-format msgid "%s (%s): Section flag %s (0x%x) ignored" msgstr "%s (%s): Se ignora la opción de sección %s (0x%x)" -#: coffcode.h:2132 +#: coffcode.h:2143 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" msgstr "Id de objetivo TI COFF '0x%x' no reconocido" -#: coffcode.h:4257 +#: coffcode.h:4365 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "%s: aviso: índice de símbolos %ld ilegal en los números de línea" -#: coffcode.h:4271 +#: coffcode.h:4379 #, c-format msgid "%s: warning: duplicate line number information for `%s'" msgstr "%s: aviso: información duplicada de números de línea para `%s'" -#: coffcode.h:4630 +#: coffcode.h:4736 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "%s: Clase de almacenamiento %d no reconocida para %s símbolo `%s'" -#: coffcode.h:4761 +#: coffcode.h:4867 #, c-format msgid "warning: %s: local symbol `%s' has no section" msgstr "aviso: %s: el símbolo local `%s' no tiene sección" -#: coffcode.h:4906 +#: coffcode.h:5012 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "%s: tipo de reubicación %d ilegal en la dirección 0x%lx" @@ -441,113 +407,92 @@ msgstr "%s: tipo de reubicación %d ilegal en la dirección 0x%lx" msgid "%s: bad string table size %lu" msgstr "%s: tamaño de tabla de cadenas %lu erróneo" -#: cofflink.c:536 elflink.h:1967 +#: cofflink.c:534 elflink.h:1912 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "Aviso: el tipo del símbolo `%s' cambió de %d a %d en %s" -#: cofflink.c:2317 +#: cofflink.c:2321 #, c-format msgid "%s: relocs in section `%s', but it has no contents" msgstr "%s: reubicaciones en la sección `%s', pero no tiene contenidos" -#: cofflink.c:2653 coffswap.h:889 +#: cofflink.c:2664 coffswap.h:877 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "%s: %s: desbordamiento de reubicación: 0x%lx > 0xffff" -#: cofflink.c:2662 coffswap.h:876 +#: cofflink.c:2673 coffswap.h:864 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "%s: aviso: %s: desbordamiento de número de línea: 0x%lx > 0xffff" -#: dwarf2.c:381 +#: dwarf2.c:382 msgid "Dwarf Error: Can't find .debug_str section." msgstr "Error de Dwarf: No se puede encontrar la sección .debug_str." -#: dwarf2.c:398 +#: dwarf2.c:399 #, c-format -msgid "" -"Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str " -"size (%u)." -msgstr "" -"Error de Dwarf: El desplazamiento DW_FROM_strp (%u) es más grande que el " -"tamaño de .debug_str (%u)." +msgid "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)." +msgstr "Error de Dwarf: El desplazamiento DW_FROM_strp (%lu) es más grande o igual que el tamaño de .debug_str (%lu)." -#: dwarf2.c:542 +#: dwarf2.c:543 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "Error de Dwarf: No se puede encontrar la sección .debug_abbrev." -#: dwarf2.c:559 -#, fuzzy, c-format -msgid "" -"Dwarf Error: Abbrev offset (%u) greater than or equal to .debug_abbrev size " -"(%u)." -msgstr "" -"Error de Dwarf: El desplazamiento de abreviatura (%u) es más grande que el " -"tamaño de abreviatura (%u)." +#: dwarf2.c:560 +#, c-format +msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)." +msgstr "Error de Dwarf: El desplazamiento de abreviatura (%lu) es más grande o igual que el tamaño de .debug_abbrev (%lu)." -#: dwarf2.c:756 +#: dwarf2.c:757 #, c-format -msgid "Dwarf Error: Invalid or unhandled FORM value: %d." -msgstr "Error de Dwarf: Valor de FORM inválido o no manejado: %d." +msgid "Dwarf Error: Invalid or unhandled FORM value: %u." +msgstr "Error de Dwarf: Valor de FORM inválido o no manejado: %u." -#: dwarf2.c:843 +#: dwarf2.c:852 msgid "Dwarf Error: mangled line number section (bad file number)." -msgstr "" -"Error de Dwarf: sección de números de línea revuelta (número erróneo de " -"fichero)." +msgstr "Error de Dwarf: sección de números de línea revuelta (número erróneo de fichero)." -#: dwarf2.c:929 +#: dwarf2.c:938 msgid "Dwarf Error: Can't find .debug_line section." msgstr "Error de Dwarf: No se puede encontrar lan sección .debug_line." -#: dwarf2.c:952 -#, fuzzy, c-format -msgid "" -"Dwarf Error: Line offset (%u) greater than or equal to .debug_line size (%u)." -msgstr "" -"Error de Dwarf: El desplazamiento de línea (%u) es más grande que el tamaño " -"de línea (%u)." +#: dwarf2.c:961 +#, c-format +msgid "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)." +msgstr "Error de Dwarf: El desplazamiento de línea (%lu) es más grande o igual que el tamaño de .debug_line (%lu)." -#: dwarf2.c:1143 +#: dwarf2.c:1159 msgid "Dwarf Error: mangled line number section." msgstr "Error de Dwarf: sección de números de línea revuelta." -#: dwarf2.c:1318 dwarf2.c:1529 +#: dwarf2.c:1355 dwarf2.c:1566 #, c-format -msgid "Dwarf Error: Could not find abbrev number %d." -msgstr "Error de Dwarf: No se puede encontrar el número de abreviatura %d." +msgid "Dwarf Error: Could not find abbrev number %u." +msgstr "Error de Dwarf: No se puede encontrar el número de abreviatura %u." -#: dwarf2.c:1490 +#: dwarf2.c:1527 #, c-format -msgid "" -"Dwarf Error: found dwarf version '%hu', this reader only handles version 2 " -"information." -msgstr "" -"Error de Dwarf: se encontró la versión de dwarf '%hu', este lector solamente " -"maneja información de la versión 2." +msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2 information." +msgstr "Error de Dwarf: se encontró la versión de dwarf '%u', este lector solamente maneja información de la versión 2." -#: dwarf2.c:1497 +#: dwarf2.c:1534 #, c-format -msgid "" -"Dwarf Error: found address size '%u', this reader can not handle sizes " -"greater than '%u'." -msgstr "" -"Error de Dwarf: se encontró el tamaño de dirección '%u', este lector no " -"puede manejar tamaños más grandes que '%u'." +msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'." +msgstr "Error de Dwarf: se encontró el tamaño de dirección '%u', este lector no puede manejar tamaños más grandes que '%u'." -#: dwarf2.c:1520 +#: dwarf2.c:1557 #, c-format -msgid "Dwarf Error: Bad abbrev number: %d." -msgstr "Error de Dwarf: Número de abreviación erróneo: %d." +msgid "Dwarf Error: Bad abbrev number: %u." +msgstr "Error de Dwarf: Número de abreviación erróneo: %u." -#: ecoff.c:1328 +#: ecoff.c:1318 #, c-format msgid "Unknown basic type %d" msgstr "Tipo básico %d desconocido" -#: ecoff.c:1597 +#: ecoff.c:1578 #, c-format msgid "" "\n" @@ -556,7 +501,7 @@ msgstr "" "\n" " Símbolo final+1: %ld" -#: ecoff.c:1604 ecoff.c:1607 +#: ecoff.c:1585 ecoff.c:1588 #, c-format msgid "" "\n" @@ -565,7 +510,7 @@ msgstr "" "\n" " Primer símbolo: %ld" -#: ecoff.c:1619 +#: ecoff.c:1600 #, c-format msgid "" "\n" @@ -574,7 +519,7 @@ msgstr "" "\n" " Símbolo final+1: %-7ld Tipo: %s" -#: ecoff.c:1626 +#: ecoff.c:1607 #, c-format msgid "" "\n" @@ -583,7 +528,7 @@ msgstr "" "\n" " Símbolo local: %ld" -#: ecoff.c:1634 +#: ecoff.c:1615 #, c-format msgid "" "\n" @@ -592,7 +537,7 @@ msgstr "" "\n" " struct; símbolo final+1: %ld" -#: ecoff.c:1639 +#: ecoff.c:1620 #, c-format msgid "" "\n" @@ -601,7 +546,7 @@ msgstr "" "\n" " union; símbolo final+1: %ld" -#: ecoff.c:1644 +#: ecoff.c:1625 #, c-format msgid "" "\n" @@ -610,7 +555,7 @@ msgstr "" "\n" " enum; símbolo final+1: %ld" -#: ecoff.c:1650 +#: ecoff.c:1631 #, c-format msgid "" "\n" @@ -619,37 +564,35 @@ msgstr "" "\n" " Tipo: %s" -#: elf-hppa.h:1366 elf-hppa.h:1399 elf32-ppc.c:3062 elf32-sh.c:3201 -#: elf64-x86-64.c:1275 +#: elf-hppa.h:1476 elf-hppa.h:1509 elf32-ppc.c:3091 elf32-sh.c:4213 +#: elf64-sh64.c:1659 #, c-format -msgid "" -"%s: warning: unresolvable relocation against symbol `%s' from %s section" -msgstr "" -"%s: aviso: reubicación sin resolución contra el símbolo `%s' de la sección %s" +msgid "%s: warning: unresolvable relocation against symbol `%s' from %s section" +msgstr "%s: aviso: reubicación sin resolución contra el símbolo `%s' de la sección %s" -#: elf-m10200.c:463 elf-m10300.c:673 elf32-arm.h:2074 elf32-avr.c:835 -#: elf32-cris.c:1406 elf32-d10v.c:482 elf32-fr30.c:653 elf32-h8300.c:547 -#: elf32-i860.c:1048 elf32-m32r.c:1280 elf32-openrisc.c:455 elf32-v850.c:1691 -#: elf32-xstormy16.c:976 elf64-mmix.c:1164 +#: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2084 elf32-avr.c:833 +#: elf32-cris.c:1403 elf32-d10v.c:481 elf32-fr30.c:635 elf32-frv.c:809 +#: elf32-h8300.c:548 elf32-i860.c:1031 elf32-m32r.c:1278 elf32-openrisc.c:439 +#: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302 msgid "internal error: out of range error" msgstr "error interno: error fuera de rango" -#: elf-m10200.c:467 elf-m10300.c:677 elf32-arm.h:2078 elf32-avr.c:839 -#: elf32-cris.c:1410 elf32-d10v.c:486 elf32-fr30.c:657 elf32-h8300.c:551 -#: elf32-i860.c:1052 elf32-m32r.c:1284 elf32-mips.c:7587 elf32-openrisc.c:459 -#: elf32-v850.c:1695 elf32-xstormy16.c:980 elf64-mips.c:4464 elf64-mmix.c:1168 +#: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2088 elf32-avr.c:837 +#: elf32-cris.c:1407 elf32-d10v.c:485 elf32-fr30.c:639 elf32-frv.c:813 +#: elf32-h8300.c:552 elf32-i860.c:1035 elf32-m32r.c:1282 elf32-openrisc.c:443 +#: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5264 msgid "internal error: unsupported relocation error" msgstr "error interno: error de reubicación sin soporte" -#: elf-m10200.c:471 elf-m10300.c:681 elf32-arm.h:2082 elf32-d10v.c:490 -#: elf32-h8300.c:555 elf32-m32r.c:1288 +#: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2092 elf32-d10v.c:489 +#: elf32-h8300.c:556 elf32-m32r.c:1286 msgid "internal error: dangerous error" msgstr "error interno: error peligroso" -#: elf-m10200.c:475 elf-m10300.c:685 elf32-arm.h:2086 elf32-avr.c:847 -#: elf32-cris.c:1418 elf32-d10v.c:494 elf32-fr30.c:665 elf32-h8300.c:559 -#: elf32-i860.c:1060 elf32-m32r.c:1292 elf32-openrisc.c:467 elf32-v850.c:1715 -#: elf32-xstormy16.c:988 elf64-mmix.c:1176 +#: elf-m10200.c:458 elf-m10300.c:668 elf32-arm.h:2096 elf32-avr.c:845 +#: elf32-cris.c:1415 elf32-d10v.c:493 elf32-fr30.c:647 elf32-frv.c:821 +#: elf32-h8300.c:560 elf32-i860.c:1043 elf32-m32r.c:1290 elf32-openrisc.c:451 +#: elf32-v850.c:1715 elf32-xstormy16.c:945 elf64-mmix.c:1314 msgid "internal error: unknown error" msgstr "error interno: error desconocido" @@ -658,17 +601,17 @@ msgstr "error interno: error desconocido" msgid "%s: invalid string offset %u >= %lu for section `%s'" msgstr "%s: desplazamiento de cadena inválido %u >= %lu para la sección `%s'" -#: elf.c:448 +#: elf.c:589 #, c-format msgid "%s: invalid SHT_GROUP entry" msgstr "%s: entrada SHT_GROUP inválida" -#: elf.c:529 +#: elf.c:660 #, c-format msgid "%s: no group info for section %s" msgstr "%s: no hay información de grupo para la sección %s" -#: elf.c:840 +#: elf.c:1023 msgid "" "\n" "Program Header:\n" @@ -676,7 +619,7 @@ msgstr "" "\n" "Encabezado del Programa:\n" -#: elf.c:889 +#: elf.c:1073 msgid "" "\n" "Dynamic Section:\n" @@ -684,7 +627,7 @@ msgstr "" "\n" "Sección Dinámica:\n" -#: elf.c:1018 +#: elf.c:1202 msgid "" "\n" "Version definitions:\n" @@ -692,7 +635,7 @@ msgstr "" "\n" "Definiciones de versión:\n" -#: elf.c:1041 +#: elf.c:1225 msgid "" "\n" "Version References:\n" @@ -700,442 +643,383 @@ msgstr "" "\n" "Referencias de Versión:\n" -#: elf.c:1046 +#: elf.c:1230 #, c-format msgid " required from %s:\n" msgstr " requerido desde %s:\n" -#: elf.c:1682 +#: elf.c:1902 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" msgstr "%s: enlace %lu inválido para la sección de reubicación %s (índice %u)" -#: elf.c:3296 +#: elf.c:3603 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" -msgstr "" -"%s: No hay suficiente espacio para los encabezados del programa (%u " -"asignados, %u necesarios)" +msgstr "%s: No hay suficiente espacio para los encabezados del programa (%u asignados, %u necesarios)" -#: elf.c:3400 +#: elf.c:3708 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" -msgstr "" -"%s: No hay suficiente espacio para los encabezados del programa, pruebe " -"enlazar con -N" +msgstr "%s: No hay suficiente espacio para los encabezados del programa, pruebe enlazar con -N" -#: elf.c:3525 +#: elf.c:3833 #, c-format -msgid "" -"Error: First section in segment (%s) starts at 0x%x whereas the segment " -"starts at 0x%x" -msgstr "" -"Error: La primera sección en el segmento (%s) inicia en 0x%x mientras que el " -"segmento inicia en 0x%x" +msgid "Error: First section in segment (%s) starts at 0x%x whereas the segment starts at 0x%x" +msgstr "Error: La primera sección en el segmento (%s) inicia en 0x%x mientras que el segmento inicia en 0x%x" -#: elf.c:3811 +#: elf.c:4148 #, c-format msgid "%s: warning: allocated section `%s' not in segment" msgstr "%s: aviso: la sección asignada `%s' no está en el segmento" -#: elf.c:4142 +#: elf.c:4472 #, c-format msgid "%s: symbol `%s' required but not present" msgstr "%s: se requiere el símbolo `%s' pero no está presente" -#: elf.c:4395 +#: elf.c:4749 #, c-format -msgid "%s: warning: Empty loadable segment detected\n" -msgstr "%s: aviso: Se detectó un segmento cargable vacío\n" +msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" +msgstr "%s: aviso: Se detectó un segmento cargable vacío, ¿ es intencional ?\n" -#: elf.c:5808 +#: elf.c:6193 #, c-format msgid "%s: unsupported relocation type %s" msgstr "%s: tipo de reubicación %s sin soporte" -#: elf32-arm.h:1224 +#: elf32-arm.h:1221 #, c-format msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "%s: Aviso: La instrucción Arm BLX apunta a la función Arm '%s'." -#: elf32-arm.h:1420 +#: elf32-arm.h:1417 #, c-format msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "%s: Aviso: La instrucción Thumb BLX apunta a la función thumb '%s'." -#: elf32-arm.h:1904 elf32-i386.c:1778 elf32-sh.c:3133 +#: elf32-arm.h:1914 elf32-sh.c:4125 #, c-format msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" msgstr "%s(%s+0x%lx): reubicación %s contra la sección SEC_MERGE" -#: elf32-arm.h:1998 +#: elf32-arm.h:2008 #, c-format -msgid "" -"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" -msgstr "" -"%s: aviso: reubicación %d sin resolución contra el símbolo `%s' de la " -"sección %s" +msgid "%s: warning: unresolvable relocation %d against symbol `%s' from %s section" +msgstr "%s: aviso: reubicación %d sin resolución contra el símbolo `%s' de la sección %s" -#: elf32-arm.h:2166 -#, fuzzy, c-format -msgid "" -"Warning: Clearing the interworking flag of %s because non-interworking code " -"in %s has been linked with it" -msgstr "" -"Aviso: Limpiando la opción de interoperación en %s porque se ha enlazado " -"código no interoperable en %s" - -#: elf32-arm.h:2261 +#: elf32-arm.h:2176 #, c-format -msgid "" -"Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" -msgstr "" -"Error: %s compilado para EABI versión %d, mientras que %s está compilado " -"para la versión %d" +msgid "Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it" +msgstr "Aviso: Limpiando la opción de interoperación en %s porque se ha enlazado con él código no interoperable en %s" -#: elf32-arm.h:2275 +#: elf32-arm.h:2271 #, c-format -msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" -msgstr "" -"Error: %s compilado para APCS-%d, mientras que %s está compilado para APCS-%d" +msgid "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d" +msgstr "ERROR: %s está compilado para EABI versión %d, mientras que %s está compilado para la versión %d" -#: elf32-arm.h:2287 +#: elf32-arm.h:2285 #, c-format -msgid "" -"Error: %s passes floats in FP registers, whereas %s passes them in integer " -"registers" -msgstr "" -"Error: %s pasa números de coma flotante en registros FP, mientras que %s los " -"pasa en registros enteros" - -#: elf32-arm.h:2292 -#, c-format -msgid "" -"Error: %s passes floats in integer registers, whereas %s passes them in FP " -"registers" -msgstr "" -"Error: %s pasa números de coma flotante en registros enteros, mientras que %" -"s los pasa en registros FP" - -#: elf32-arm.h:2303 -#, fuzzy, c-format -msgid "Error: %s uses VFP instructions, whereas %s uses FPA instructions" -msgstr "" -"Error: %s utiliza instrucciones VFP, mientras que %s utiliza instrucciones " -"FPA" - -#: elf32-arm.h:2308 -#, fuzzy, c-format -msgid "Error: %s uses FPA instructions, whereas %s uses VFP instructions" -msgstr "" -"Error: %s utiliza instrucciones FPA, mientras que %s utiliza instrucciones " -"VFP" +msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" +msgstr "ERROR: %s está compilado para APCS-%d mientras que el objetivo %s usa APCS-%d" -#: elf32-arm.h:2328 +#: elf32-arm.h:2313 #, c-format -msgid "Error: %s uses software FP, whereas %s uses hardware FP" -msgstr "" -"Error: %s utiliza FP de software, mientras que %s utiliza FP de hardware" +msgid "ERROR: %s uses VFP instructions, whereas %s uses FPA instructions" +msgstr "ERROR: %s utiliza instrucciones VFP, mientras que %s utiliza instrucciones FPA" -#: elf32-arm.h:2333 +#: elf32-arm.h:2318 #, c-format -msgid "Error: %s uses hardware FP, whereas %s uses software FP" -msgstr "" -"Error: %s utiliza FP de hardware, mientras que %s utiliza FP de software" +msgid "ERROR: %s uses FPA instructions, whereas %s uses VFP instructions" +msgstr "ERROR: %s utiliza instrucciones FPA, mientras que %s utiliza instrucciones VFP" -#: elf32-arm.h:2348 +#: elf32-arm.h:2338 #, c-format -msgid "Warning: %s supports interworking, whereas %s does not" -msgstr "" -"Aviso: el fichero de entrada %s soporta interoperabilidad, mientras que %s no" +msgid "ERROR: %s uses software FP, whereas %s uses hardware FP" +msgstr "ERROR: %s utiliza FP de software, mientras que %s utiliza FP de hardware" -#: elf32-arm.h:2355 +#: elf32-arm.h:2343 #, c-format -msgid "Warning: %s does not support interworking, whereas %s does" -msgstr "" -"Aviso: el fichero de entrada %s no soporta interoperabilidad, mientras que %" -"s sí" +msgid "ERROR: %s uses hardware FP, whereas %s uses software FP" +msgstr "ERROR: %s utiliza FP de hardware, mientras que %s utiliza FP de software" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2386 elf32-cris.c:2991 elf32-m68k.c:410 elf32-mips.c:3242 +#: elf32-arm.h:2396 elf32-cris.c:2988 elf32-m68k.c:410 elf32-vax.c:543 +#: elfxx-mips.c:7756 #, c-format msgid "private flags = %lx:" msgstr "opciones privadas = %lx:" -#: elf32-arm.h:2395 +#: elf32-arm.h:2405 msgid " [interworking enabled]" msgstr " [interoperabilidad activada]" -#: elf32-arm.h:2398 -msgid " [APCS-26]" -msgstr " [APCS-26]" - -#: elf32-arm.h:2400 -msgid " [APCS-32]" -msgstr " [APCS-32]" - -#: elf32-arm.h:2403 +#: elf32-arm.h:2413 msgid " [VFP float format]" msgstr " [formato de coma flotante VFP]" -#: elf32-arm.h:2405 +#: elf32-arm.h:2415 msgid " [FPA float format]" msgstr " [formato de coma flotante FPA]" -#: elf32-arm.h:2414 +#: elf32-arm.h:2424 msgid " [new ABI]" msgstr " [ABI nuevo]" -#: elf32-arm.h:2417 +#: elf32-arm.h:2427 msgid " [old ABI]" msgstr " [ABI antiguo]" -#: elf32-arm.h:2420 +#: elf32-arm.h:2430 msgid " [software FP]" msgstr " [FP por software]" -#: elf32-arm.h:2428 +#: elf32-arm.h:2438 msgid " [Version1 EABI]" msgstr " [EABI Version1]" -#: elf32-arm.h:2431 elf32-arm.h:2442 +#: elf32-arm.h:2441 elf32-arm.h:2452 msgid " [sorted symbol table]" msgstr " [tabla de símbolos ordenados]" -#: elf32-arm.h:2433 elf32-arm.h:2444 +#: elf32-arm.h:2443 elf32-arm.h:2454 msgid " [unsorted symbol table]" msgstr " [tabla de símbolos sin ordenar]" -#: elf32-arm.h:2439 +#: elf32-arm.h:2449 msgid " [Version2 EABI]" msgstr " [EABI Version2]" -#: elf32-arm.h:2447 +#: elf32-arm.h:2457 msgid " [dynamic symbols use segment index]" msgstr " [los símbolos dinámicos utilizan índices de segmento]" -#: elf32-arm.h:2450 +#: elf32-arm.h:2460 msgid " [mapping symbols precede others]" msgstr " [el mapeo de símbolos precede a otros]" -#: elf32-arm.h:2457 +#: elf32-arm.h:2467 msgid " <EABI version unrecognised>" msgstr " <versión de EABI no reconocida>" -#: elf32-arm.h:2464 +#: elf32-arm.h:2474 msgid " [relocatable executable]" msgstr " [ejecutable reubicable]" -#: elf32-arm.h:2467 +#: elf32-arm.h:2477 msgid " [has entry point]" msgstr " [tiene punto de entrada]" -#: elf32-arm.h:2472 +#: elf32-arm.h:2482 msgid "<Unrecognised flag bits set>" msgstr "<Conjunto de bits de opción no reconocidos>" -#: elf32-avr.c:843 elf32-cris.c:1414 elf32-fr30.c:661 elf32-i860.c:1056 -#: elf32-openrisc.c:463 elf32-v850.c:1699 elf32-xstormy16.c:984 -#: elf64-mmix.c:1172 +#: elf32-avr.c:841 elf32-cris.c:1411 elf32-fr30.c:643 elf32-frv.c:817 +#: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699 +#: elf32-xstormy16.c:941 elf64-mmix.c:1310 msgid "internal error: dangerous relocation" msgstr "error interno: reubicación peligrosa" #: elf32-cris.c:949 #, c-format msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" -msgstr "" -"%s: reubicación %s sin resolución contra el símbolo `%s' de la sección %s" +msgstr "%s: reubicación %s sin resolución contra el símbolo `%s' de la sección %s" #: elf32-cris.c:1012 #, c-format -msgid "" -"%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" -msgstr "" -"%s: No hay PLT ni GOT para la reubicación %s contra el símbolo `%s' de la " -"sección %s" +msgid "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" +msgstr "%s: No hay PLT ni GOT para la reubicación %s contra el símbolo `%s' de la sección %s" -#: elf32-cris.c:1015 elf32-cris.c:1142 +#: elf32-cris.c:1015 elf32-cris.c:1141 msgid "[whose name is lost]" msgstr "[cuyo nombre se pierde]" -#: elf32-cris.c:1131 +#: elf32-cris.c:1130 #, c-format -msgid "" -"%s: relocation %s with non-zero addend %d against local symbol from %s " -"section" -msgstr "" -"%s: reubicación %s con adición %d que no es cero contra un símbolo local de " -"la sección %s" +msgid "%s: relocation %s with non-zero addend %d against local symbol from %s section" +msgstr "%s: reubicación %s con adición %d que no es cero contra un símbolo local de la sección %s" -#: elf32-cris.c:1138 +#: elf32-cris.c:1137 #, c-format -msgid "" -"%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" -msgstr "" -"%s: reubicación %s con adición %d que no es cero contra el símbolo `%s' de " -"la sección %s" +msgid "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" +msgstr "%s: reubicación %s con adición %d que no es cero contra el símbolo `%s' de la sección %s" -#: elf32-cris.c:1156 +#: elf32-cris.c:1155 #, c-format -msgid "" -"%s: relocation %s is not allowed for global symbol: `%s' from %s section" -msgstr "" -"%s: no se permite la reubicación %s para el símbolo global: `%s' de la " -"sección %s" +msgid "%s: relocation %s is not allowed for global symbol: `%s' from %s section" +msgstr "%s: no se permite la reubicación %s para el símbolo global: `%s' de la sección %s" -#: elf32-cris.c:1171 -#, fuzzy, c-format +#: elf32-cris.c:1170 +#, c-format msgid "%s: relocation %s in section %s with no GOT created" -msgstr "%s: reubicaciones en la sección `%s', pero no tiene contenidos" +msgstr "%s: la reubicación %s en la sección %s sin GOT creado" -#: elf32-cris.c:1289 +#: elf32-cris.c:1288 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" -msgstr "" -"%s: Inconsistencia interna; no se encuentra la sección de reubicación %s" +msgstr "%s: Inconsistencia interna; no se encuentra la sección de reubicación %s" -#: elf32-cris.c:2523 +#: elf32-cris.c:2514 #, c-format msgid "" "%s, section %s:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" "%s, sección %s:\n" -" no se debe usar la reubicación %s en un objeto compartido; recompile con -" -"fPIC" +" no se debe usar la reubicación %s en un objeto compartido; recompile con -fPIC" -#: elf32-cris.c:2994 +#: elf32-cris.c:2991 msgid " [symbols have a _ prefix]" msgstr " [los símbolos tiene un prefijo _]" -#: elf32-cris.c:3033 +#: elf32-cris.c:3030 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" -msgstr "" -"%s: utiliza símbolos con prefijo _, pero escribe el fichero con símbolos sin " -"prefijo" +msgstr "%s: utiliza símbolos con prefijo _, pero escribe el fichero con símbolos sin prefijo" -#: elf32-cris.c:3034 +#: elf32-cris.c:3031 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" -msgstr "" -"%s: utiliza símbolos sin prefijo, pero escribe el fichero con símbolos con " -"prefijo _" +msgstr "%s: utiliza símbolos sin prefijo, pero escribe el fichero con símbolos con prefijo _" + +#: elf32-frv.c:1217 +#, c-format +msgid "%s: compiled with %s and linked with modules that use non-pic relocations" +msgstr "%s: compilado con %s y enlazado con módulos que usan reubicaciones que no son pic" + +#: elf32-frv.c:1267 +#, c-format +msgid "%s: compiled with %s and linked with modules compiled with %s" +msgstr "%s: compilado con %s y enlazado con módulos compilados con %s" + +#: elf32-frv.c:1279 +#, c-format +msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%s: usa campos e_flags desconocidos (0x%lx) diferentes a aquéllos de los módulos previos (0x%lx)" + +#: elf32-frv.c:1315 +#, c-format +msgid "private flags = 0x%lx:" +msgstr "opciones privadas = 0x%lx:" #: elf32-gen.c:82 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" msgstr "%s: Reubicaciones en ELF genérico (EM: %d)" -#: elf32-hppa.c:646 +#: elf32-hppa.c:671 elf64-ppc.c:2323 #, c-format msgid "%s: cannot create stub entry %s" msgstr "%s: no se puede crear la entrada de cabo %s" -#: elf32-hppa.c:937 elf32-hppa.c:3545 +#: elf32-hppa.c:956 elf32-hppa.c:3555 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" -msgstr "" -"%s(%s+0x%lx): no se puede alcanzar %s, recompile con -ffuntion-sections" +msgstr "%s(%s+0x%lx): no se puede alcanzar %s, recompile con -ffuntion-sections" -#: elf32-hppa.c:1312 +#: elf32-hppa.c:1338 elf64-x86-64.c:673 #, c-format -msgid "" -"%s: relocation %s can not be used when making a shared object; recompile " -"with -fPIC" -msgstr "" -"%s: no se puede usar la reubicación %s cuando se hace un objeto compartido; " -"recompile con -fPIC" +msgid "%s: relocation %s can not be used when making a shared object; recompile with -fPIC" +msgstr "%s: no se puede usar la reubicación %s cuando se hace un objeto compartido; recompile con -fPIC" -#: elf32-hppa.c:1332 +#: elf32-hppa.c:1358 #, c-format -msgid "" -"%s: relocation %s should not be used when making a shared object; recompile " -"with -fPIC" -msgstr "" -"%s: no se debe usar la reubicación %s cuando se hace un objeto compartido; " -"recompile con -fPIC" +msgid "%s: relocation %s should not be used when making a shared object; recompile with -fPIC" +msgstr "%s: no se debe usar la reubicación %s cuando se hace un objeto compartido; recompile con -fPIC" -#: elf32-hppa.c:1525 +#: elf32-hppa.c:1551 #, c-format msgid "Could not find relocation section for %s" msgstr "No se puede encontrar la sección de reubicación para %s" -#: elf32-hppa.c:2867 +#: elf32-hppa.c:2855 #, c-format msgid "%s: duplicate export stub %s" msgstr "%s: cabo de exportación %s duplicado" -#: elf32-hppa.c:3429 +#: elf32-hppa.c:3433 #, c-format msgid "%s(%s+0x%lx): fixing %s" msgstr "%s(%s+0x%lx): componiendo %s" -#: elf32-hppa.c:4069 +#: elf32-hppa.c:4080 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" msgstr "%s(%s+0x%lx): no se puede manejar %s para %s" -#: elf32-hppa.c:4408 +#: elf32-hppa.c:4393 msgid ".got section not immediately after .plt section" msgstr "la sección .got no está inmediatamente después de la sección .plt" -#: elf32-i386.c:298 +#: elf32-i386.c:379 #, c-format msgid "%s: invalid relocation type %d" msgstr "%s: tipo de reubicación %d inválido" -#: elf32-i386.c:718 elf32-s390.c:636 elf64-s390.c:595 +#: elf32-i386.c:876 elf32-s390.c:649 elf64-s390.c:595 elf64-x86-64.c:591 #, c-format msgid "%s: bad symbol index: %d" msgstr "%s: índice de símbolos erróneo: %d" -#: elf32-i386.c:863 elf32-s390.c:790 elf64-ppc.c:2198 elf64-s390.c:759 +#: elf32-i386.c:948 +#, c-format +msgid "%s: `%s' accessed both as normal and thread local symbol" +msgstr "%s: se accesó `%s' como un símbolo normal y un símbolo local de hilo" + +#: elf32-i386.c:1072 elf32-s390.c:808 elf64-ppc.c:2827 elf64-s390.c:759 +#: elf64-x86-64.c:761 #, c-format msgid "%s: bad relocation section name `%s'" msgstr "%s: nombre de sección de reubicación `%s' erróneo" -#: elf32-i386.c:2069 elf32-s390.c:1951 elf64-ppc.c:4124 elf64-s390.c:1955 +#: elf32-i386.c:1159 elf64-alpha.c:4768 +#, c-format +msgid "%s: TLS local exec code cannot be linked into shared objects" +msgstr "%s: el código de ejecución local TLS no se puede enlazar en objetos compartidos" + +#: elf32-i386.c:2747 elf32-s390.c:1981 elf32-sparc.c:1571 elf64-ppc.c:5918 +#: elf64-s390.c:1945 elf64-sparc.c:2578 elf64-x86-64.c:1948 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" msgstr "%s(%s+0x%lx): reubicación sin resolución contra el símbolo `%s'" -#: elf32-i386.c:2107 elf32-s390.c:1989 elf64-s390.c:1993 +#: elf32-i386.c:2784 elf32-s390.c:2019 elf64-ppc.c:5977 elf64-s390.c:1983 +#: elf64-x86-64.c:1986 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" msgstr "%s(%s+0x%lx): reubicación contra `%s': error %d" -#: elf32-m32r.c:923 +#: elf32-m32r.c:924 msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "reubicación SDA cuando _SDA_BASE_ no está definido" -#: elf32-ia64.c:3537 elf32-m32r.c:1007 elf32-ppc.c:2930 elf64-ia64.c:3537 +#: elf32-ia64.c:3687 elf32-m32r.c:1013 elf32-ppc.c:2987 elf64-alpha.c:4185 +#: elf64-alpha.c:4313 elf64-ia64.c:3687 #, c-format msgid "%s: unknown relocation type %d" msgstr "%s: tipo de reubicación %d desconocido" -#: elf32-m32r.c:1223 +#: elf32-m32r.c:1221 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" -msgstr "" -"%s: El objetivo (%s) de una reubicación %s está en la sección errónea (%s)" +msgstr "%s: El objetivo (%s) de una reubicación %s está en la sección errónea (%s)" -#: elf32-m32r.c:2000 +#: elf32-m32r.c:1947 #, c-format msgid "%s: Instruction set mismatch with previous modules" msgstr "%s: Conjunto de instrucciones no coincidente con módulos previos" -#: elf32-m32r.c:2023 +#: elf32-m32r.c:1970 #, c-format msgid "private flags = %lx" msgstr "opciones privadas = %lx" -#: elf32-m32r.c:2028 +#: elf32-m32r.c:1975 msgid ": m32r instructions" msgstr ": instrucciones m32r" -#: elf32-m32r.c:2029 +#: elf32-m32r.c:1976 msgid ": m32rx instructions" msgstr ": instrucciones m32rx" @@ -1143,261 +1027,177 @@ msgstr ": instrucciones m32rx" msgid " [cpu32]" msgstr " [cpu32]" -#: elf32-mcore.c:353 elf32-mcore.c:479 +#: elf32-m68k.c:416 +msgid " [m68000]" +msgstr " [m68000]" + +#: elf32-mcore.c:354 elf32-mcore.c:457 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "%s: La reubicación %s (%d) actualmente no tiene soporte.\n" -#: elf32-mcore.c:438 +#: elf32-mcore.c:442 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "%s: Tipo de reubicación %d desconocido\n" -#: elf32-mips.c:2156 elf64-mips.c:1972 +#: elf32-mips.c:1152 elf64-mips.c:1783 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "la reubicación gp relativa de 32bits sucede para un símbolo externo" -#: elf32-mips.c:2305 +#: elf32-mips.c:1301 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "Enlazar objetos mips16 en el formato %s no tiene soporte" -#: elf32-mips.c:3129 +#: elf32-ppc.c:1460 #, c-format -msgid "%s: linking PIC files with non-PIC files" -msgstr "%s: enlazando ficheros PIC con ficheros que no son PIC" - -#: elf32-mips.c:3139 -#, c-format -msgid "%s: linking abicalls files with non-abicalls files" -msgstr "" -"%s: enlazando ficheros de llamadas abi con ficheros que no son de llamadas " -"abi" +msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" +msgstr "%s: compilado con -mrelocatable y enlazado con módulos compilados de forma normal" -#: elf32-mips.c:3168 +#: elf32-ppc.c:1468 #, c-format -msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" -msgstr "%s: no coincide el ISA (-mips%d) con módulos previos (-mips%d)" - -#: elf32-mips.c:3177 -#, c-format -msgid "%s: ISA mismatch (%d) with previous modules (%d)" -msgstr "%s: no coincide el ISA (%d) con módulos previos (%d)" - -#: elf32-mips.c:3200 -#, c-format -msgid "%s: ABI mismatch: linking %s module with previous %s modules" -msgstr "%s: no coincide el ABI: enlazando el módulo %s con módulos %s previos" +msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" +msgstr "%s: compilado de forma normal y enlazado con módulos compilados con -mrelocatable" -#: elf32-mips.c:3214 elf32-ppc.c:1470 elf64-ppc.c:1556 elf64-sparc.c:3027 +#: elf32-ppc.c:1494 elf64-sparc.c:2989 elfxx-mips.c:7713 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" -msgstr "" -"%s: usa campos de e_flags diferentes (0x%lx) que los módulos previos (0x%lx)" - -#: elf32-mips.c:3245 -msgid " [abi=O32]" -msgstr " [abi=O32]" - -#: elf32-mips.c:3247 -msgid " [abi=O64]" -msgstr " [abi=O64]" - -#: elf32-mips.c:3249 -msgid " [abi=EABI32]" -msgstr " [abi=EABI32]" - -#: elf32-mips.c:3251 -msgid " [abi=EABI64]" -msgstr " [abi=EABI64]" - -#: elf32-mips.c:3253 -msgid " [abi unknown]" -msgstr " [abi desconocido]" - -#: elf32-mips.c:3255 -msgid " [abi=N32]" -msgstr " [abi=N32]" - -#: elf32-mips.c:3257 -msgid " [abi=64]" -msgstr " [abi=64]" - -#: elf32-mips.c:3259 -msgid " [no abi set]" -msgstr " [no hay conjunto abi]" - -#: elf32-mips.c:3262 -msgid " [mips1]" -msgstr " [mips1]" - -#: elf32-mips.c:3264 -msgid " [mips2]" -msgstr " [mips2]" - -#: elf32-mips.c:3266 -msgid " [mips3]" -msgstr " [mips3]" - -#: elf32-mips.c:3268 -msgid " [mips4]" -msgstr " [mips4]" - -#: elf32-mips.c:3270 -msgid " [mips5]" -msgstr " [mips5]" - -#: elf32-mips.c:3272 -msgid " [mips32]" -msgstr " [mips32]" - -#: elf32-mips.c:3274 -msgid " [mips64]" -msgstr " [mips64]" - -#: elf32-mips.c:3276 -msgid " [unknown ISA]" -msgstr " [ISA desconocido]" - -#: elf32-mips.c:3279 -msgid " [32bitmode]" -msgstr " [modo 32bit]" - -#: elf32-mips.c:3281 -msgid " [not 32bitmode]" -msgstr " [no es modo 32bit]" - -#: elf32-mips.c:4954 -msgid "static procedure (no name)" -msgstr "procedimiento estático (sin nombre)" - -#: elf32-mips.c:5572 elf64-mips.c:6694 -#, c-format -msgid "%s: illegal section name `%s'" -msgstr "%s: nombre de sección `%s' ilegal" - -#: elf32-mips.c:6139 elf64-mips.c:3150 -msgid "not enough GOT space for local GOT entries" -msgstr "no hay suficiente espacio GOT para entradas GOT locales" - -#: elf32-mips.c:7250 elf64-mips.c:4203 -#, c-format -msgid "%s: %s+0x%lx: jump to stub routine which is not jal" -msgstr "%s: %s+0x%lx: salto a una rutina cabo la cual no es jal" - -#: elf32-mips.c:8259 elf64-mips.c:5891 -#, c-format -msgid "%s: Malformed reloc detected for section %s" -msgstr "%s: Se detectó una reubicación malformada para la sección %s" - -#: elf32-mips.c:8337 elf64-mips.c:5969 -#, c-format -msgid "%s: CALL16 reloc at 0x%lx not against global symbol" -msgstr "%s: la reubicación CALL16 en 0x%lx no es contra un símbolo global" +msgstr "%s: usa campos de e_flags diferentes (0x%lx) que los módulos previos (0x%lx)" -#: elf32-ppc.c:1436 elf64-ppc.c:1521 -#, c-format -msgid "" -"%s: compiled with -mrelocatable and linked with modules compiled normally" -msgstr "" -"%s: compilado con -mrelocatable y enlazado con módulos compilados de forma " -"normal" - -#: elf32-ppc.c:1444 elf64-ppc.c:1529 -#, c-format -msgid "" -"%s: compiled normally and linked with modules compiled with -mrelocatable" -msgstr "" -"%s: compilado de forma normal y enlazado con módulos compilados con -" -"mrelocatable" - -#: elf32-ppc.c:1568 +#: elf32-ppc.c:1592 #, c-format msgid "%s: Unknown special linker type %d" msgstr "%s: Tipo de enlazador especial %d desconocido" -#: elf32-ppc.c:2218 elf32-ppc.c:2252 elf32-ppc.c:2287 +#: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" -msgstr "" -"%s: no se puede usar la reubicación %s cuando se hace un objeto compartido" +msgstr "%s: no se puede usar la reubicación %s cuando se hace un objeto compartido" -#: elf32-ppc.c:3097 elf64-ppc.c:3716 +#: elf32-ppc.c:3126 elf64-ppc.c:5473 #, c-format msgid "%s: unknown relocation type %d for symbol %s" msgstr "%s: tipo de reubicación %d desconocido para el símbolo %s" -#: elf32-ppc.c:3452 elf32-ppc.c:3473 elf32-ppc.c:3523 +#: elf32-ppc.c:3482 elf32-ppc.c:3503 elf32-ppc.c:3553 #, c-format -msgid "" -"%s: The target (%s) of a %s relocation is in the wrong output section (%s)" -msgstr "" -"%s: El objetivo (%s) de una reubicación %s está en la sección de salida " -"errónea (%s)" +msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" +msgstr "%s: El objetivo (%s) de una reubicación %s está en la sección de salida errónea (%s)" -#: elf32-ppc.c:3589 +#: elf32-ppc.c:3619 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." msgstr "%s: La reubicación %s aún no tiene soporte para el símbolo %s." -#: elf32-sh.c:1101 +#: elf32-sh.c:1964 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES offset" msgstr "%s: 0x%lx: aviso: desplazamiento R_SH_USES erróneo" -#: elf32-sh.c:1113 +#: elf32-sh.c:1976 #, c-format msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "%s: 0x%lx: aviso: R_SH_USES señala al insn 0x%x no reconocido" -#: elf32-sh.c:1130 +#: elf32-sh.c:1993 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" msgstr "%s: 0x%lx: aviso: desplazamiento de carga R_SH_USES erróneo" -#: elf32-sh.c:1145 +#: elf32-sh.c:2008 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" msgstr "%s: 0x%lx: aviso: no se puede encontrar la reubicación esperada" -#: elf32-sh.c:1202 +#: elf32-sh.c:2036 #, c-format msgid "%s: 0x%lx: warning: symbol in unexpected section" msgstr "%s: 0x%lx: aviso: símbolo en una sección inesperada" -#: elf32-sh.c:1323 +#: elf32-sh.c:2153 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" msgstr "%s: 0x%lx: aviso: no se puede encontrar la reubicación COUNT esperada" -#: elf32-sh.c:1332 +#: elf32-sh.c:2162 #, c-format msgid "%s: 0x%lx: warning: bad count" msgstr "%s: 0x%lx: aviso: cuenta errónea" -#: elf32-sh.c:1741 elf32-sh.c:2132 +#: elf32-sh.c:2550 elf32-sh.c:2926 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" msgstr "%s: 0x%lx: fatal: desbordamiento de reubicación durante la relajación" -#: elf32-sh.c:3267 +#: elf32-sh.c:4073 elf64-sh64.c:1576 +msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +msgstr "No se maneja un STO_SH5_ISA32 inesperado en un símbolo local" + +#: elf32-sh.c:4284 #, c-format msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" -msgstr "" -"%s: 0x%lx: fatal: objetivo de ramificación sin alineación para la " -"reubicación de soporte de relajamiento" +msgstr "%s: 0x%lx: fatal: objetivo de ramificación sin alineación para la reubicación de soporte de relajamiento" + +#: elf32-sh64.c:203 elf64-sh64.c:2364 +#, c-format +msgid "%s: compiled as 32-bit object and %s is 64-bit" +msgstr "%s: compilado como un objeto de 32-bit y %s es de 64-bit" -#: elf32-sparc.c:1554 elf64-sparc.c:2280 +#: elf32-sh64.c:206 elf64-sh64.c:2367 +#, c-format +msgid "%s: compiled as 64-bit object and %s is 32-bit" +msgstr "%s: compilado como un objeto de 64-bit y %s es de 32-bit" + +#: elf32-sh64.c:208 elf64-sh64.c:2369 +#, c-format +msgid "%s: object size does not match that of target %s" +msgstr "%s: el tamaño del objeto no coincide con el tamaño del objetivo %s" + +#: elf32-sh64.c:440 elf64-sh64.c:2941 +#, c-format +msgid "%s: encountered datalabel symbol in input" +msgstr "%s: se encontró un símbolo datalabel en la entrada" + +#: elf32-sh64.c:523 +msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" +msgstr "No coincide PTB: una dirección SHmedia (bit 0 == 1)" + +#: elf32-sh64.c:526 +msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" +msgstr "No coincide PTA: una dirección SHcompact (bit 0 == 0)" + +#: elf32-sh64.c:544 +#, c-format +msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" +msgstr "%s: error de GAS: instrucción PTB inesperada con R_SH_PT_16" + +#: elf32-sh64.c:593 elf64-sh64.c:1703 +#, c-format +msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" +msgstr "%s: error: tipo de reubicación %d sin alinear en %08x reubicación %08x\n" + +#: elf32-sh64.c:677 +#, c-format +msgid "%s: could not write out added .cranges entries" +msgstr "%s: no se pueden escribir las entradas .cranges agregadas" + +#: elf32-sh64.c:739 +#, c-format +msgid "%s: could not write out sorted .cranges entries" +msgstr "%s: no se pueden escribir las entradas .cranges ordenadas" + +#: elf32-sparc.c:1535 elf64-sparc.c:2224 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "%s: ¿Compilado probablemente sin -fPIC?" -#: elf32-sparc.c:2007 +#: elf32-sparc.c:2002 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "%s: compilado para un sistema de 64 bit y el objetivo es de 32 bit" -#: elf32-sparc.c:2021 +#: elf32-sparc.c:2016 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "%s: enlazando ficheros little endian con ficheros big endian" @@ -1409,35 +1209,23 @@ msgstr "La variable `%s' no puede ocupar múltiples regiones de datos small" #: elf32-v850.c:685 #, c-format -msgid "" -"Variable `%s' can only be in one of the small, zero, and tiny data regions" -msgstr "" -"La variable `%s' solamente puede estar en una de las regiones de datos " -"small, cero, y tiny" +msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions" +msgstr "La variable `%s' solamente puede estar en una de las regiones de datos small, cero, y tiny" #: elf32-v850.c:688 #, c-format -msgid "" -"Variable `%s' cannot be in both small and zero data regions simultaneously" -msgstr "" -"La variable `%s' no puede estar simultáneamente en las regiones de datos " -"small y cero" +msgid "Variable `%s' cannot be in both small and zero data regions simultaneously" +msgstr "La variable `%s' no puede estar simultáneamente en las regiones de datos small y cero" #: elf32-v850.c:691 #, c-format -msgid "" -"Variable `%s' cannot be in both small and tiny data regions simultaneously" -msgstr "" -"La variable `%s' no puede estar simultáneamente en las regiones de datos " -"small y tiny" +msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously" +msgstr "La variable `%s' no puede estar simultáneamente en las regiones de datos small y tiny" #: elf32-v850.c:694 #, c-format -msgid "" -"Variable `%s' cannot be in both zero and tiny data regions simultaneously" -msgstr "" -"La variable `%s' no puede estar simultáneamente en las regiones de datos " -"cero y tiny" +msgid "Variable `%s' cannot be in both zero and tiny data regions simultaneously" +msgstr "La variable `%s' no puede estar simultáneamente en las regiones de datos cero y tiny" #: elf32-v850.c:1072 msgid "FAILED to find previous HI16 reloc\n" @@ -1455,244 +1243,494 @@ msgstr "no se puede localizar el símbolo especial del enlazador __ep" msgid "could not locate special linker symbol __ctbp" msgstr "no se puede localizar el símbolo especial del enlazador __ctbp" -#: elf32-v850.c:1877 +#: elf32-v850.c:1875 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "%s: No coincide la arquitectura con los módulos previos" -#: elf32-v850.c:1897 +#: elf32-v850.c:1895 #, c-format msgid "private flags = %lx: " msgstr "opciones privadas = %lx: " -#: elf32-v850.c:1902 +#: elf32-v850.c:1900 msgid "v850 architecture" msgstr "arquitectura v850" -#: elf32-v850.c:1903 +#: elf32-v850.c:1901 msgid "v850e architecture" msgstr "arquitectura v850e" -#: elf32-v850.c:1904 +#: elf32-v850.c:1902 msgid "v850ea architecture" msgstr "arquitectura v850ea" -#: elf32-ia64.c:2247 elf32-xstormy16.c:414 elf64-ia64.c:2247 +#: elf32-vax.c:546 +msgid " [nonpic]" +msgstr " [no pic]" + +#: elf32-vax.c:549 +msgid " [d-float]" +msgstr " [flotante-d]" + +#: elf32-vax.c:552 +msgid " [g-float]" +msgstr " [flotante-g]" + +#: elf32-vax.c:674 +#, c-format +msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld" +msgstr "%s: aviso: la adición GOT de %ld a `%s' no coincide con la adición previa GOT de %ld" + +#: elf32-vax.c:1679 +#, c-format +msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" +msgstr "%s: aviso: se ignora la adición PLT de %d a `%s' de la sección %s" + +#: elf32-vax.c:1814 +#, c-format +msgid "%s: warning: %s relocation against symbol `%s' from %s section" +msgstr "%s: aviso: reubicación %s contra el símbolo `%s' de la sección %s" + +#: elf32-vax.c:1820 +#, c-format +msgid "%s: warning: %s relocation to 0x%x from %s section" +msgstr "%s: aviso: reubicación %s a 0x%x de la sección %s" + +#: elf32-ia64.c:2280 elf32-xstormy16.c:414 elf64-ia64.c:2280 msgid "non-zero addend in @fptr reloc" msgstr "adición que no es cero en la reubicación @fptr" -#: elf64-alpha.c:858 +#: elf64-alpha.c:1097 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "la reubicación GPDISP no encontró las instrucciones ldah y lda" -#: elf64-alpha.c:2934 +#: elf64-alpha.c:3675 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "%s: el subsegmento .got excede los 64K (tamaño %d)" -#: elf64-alpha.c:3518 elf64-alpha.c:3530 +#: elf64-alpha.c:4498 elf64-alpha.c:4510 #, c-format msgid "%s: gp-relative relocation against dynamic symbol %s" msgstr "%s: reubicación gp relativa contra el símbolo dinámico %s" -#: elf64-hppa.c:2070 +#: elf64-alpha.c:4536 elf64-alpha.c:4676 +#, c-format +msgid "%s: pc-relative relocation against dynamic symbol %s" +msgstr "%s: reubicación relativa al pc contra el símbolo dinámico %s" + +#: elf64-alpha.c:4564 +#, c-format +msgid "%s: change in gp: BRSGP %s" +msgstr "%s: cambio en gp: BRSGP %s" + +#: elf64-alpha.c:4589 +msgid "<unknown>" +msgstr "<desconocido>" + +#: elf64-alpha.c:4594 +#, c-format +msgid "%s: !samegp reloc against symbol without .prologue: %s" +msgstr "%s: reubicación !samegp contra un símbolo sin .prologue: %s" + +#: elf64-alpha.c:4639 +#, c-format +msgid "%s: unhandled dynamic relocation against %s" +msgstr "%s: reubicación dinámica sin manejar contra %s" + +#: elf64-alpha.c:4752 +#, c-format +msgid "%s: dtp-relative relocation against dynamic symbol %s" +msgstr "%s: reubicación relativa a dtp contra el símbolo dinámico %s" + +#: elf64-alpha.c:4775 +#, c-format +msgid "%s: tp-relative relocation against dynamic symbol %s" +msgstr "%s: reubicación relativa a tp contra el símbolo dinámico %s" + +#: elf64-hppa.c:2080 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" +msgstr "la entrada de cabo para %s no puede cargar .plt, desplazamiento dp = %ld" + +#: elf64-mmix.c:1002 +#, c-format +msgid "" +"%s: Internal inconsistency error for value for\n" +" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n" msgstr "" -"la entrada de cabo para %s no puede cargar .plt, desplazamiento dp = %ld" +"%s: Error de inconsistencia interna para el valor para\n" +" un registro global colocado por el enlazador: enlazado: 0x%lx%08lx != relajado: 0x%lx%08lx\n" + +#: elf64-mmix.c:1386 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s" +msgstr "%s: reubicación base-más-desplazamiento contra un símbolo de registro: (desconocido) en %s" -#: elf64-mmix.c:1271 -#, fuzzy, c-format +#: elf64-mmix.c:1391 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: %s in %s" +msgstr "%s: reubicación base-más-desplazamiento contra un símbolo de registro: %s en %s" + +#: elf64-mmix.c:1435 +#, c-format msgid "%s: register relocation against non-register symbol: (unknown) in %s" -msgstr "" -"%s: reubicación de registro contra un símbolo que no es registro: %s en %s" +msgstr "%s: reubicación de registro contra un símbolo que no es registro: (desconocido) en %s" -#: elf64-mmix.c:1276 +#: elf64-mmix.c:1440 #, c-format msgid "%s: register relocation against non-register symbol: %s in %s" -msgstr "" -"%s: reubicación de registro contra un símbolo que no es registro: %s en %s" +msgstr "%s: reubicación de registro contra un símbolo que no es registro: %s en %s" -#: elf64-mmix.c:1312 +#: elf64-mmix.c:1477 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" -msgstr "" -"%s: la directiva LOCAL sólo es válida con un registro o un valor absoluto" +msgstr "%s: la directiva LOCAL sólo es válida con un registro o un valor absoluto" -#: elf64-mmix.c:1340 +#: elf64-mmix.c:1505 #, c-format -msgid "" -"%s: LOCAL directive: Register $%ld is not a local register. First global " -"register is $%ld." -msgstr "" -"%s: directiva LOCAL: El registro $%ld no es un registro local. El primer " -"registro global es $%ld." +msgid "%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld." +msgstr "%s: directiva LOCAL: El registro $%ld no es un registro local. El primer registro global es $%ld." -#: elf64-mmix.c:1615 +#: elf64-mmix.c:1965 #, c-format -msgid "" -"%s: Error: multiple definition of `%s'; start of %s is set in a earlier " -"linked file\n" -msgstr "" -"%s: Error: definición múltiple de `%s'; el inicio de %s está definido en un " -"fichero enlazado con anterioridad\n" +msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n" +msgstr "%s: Error: definición múltiple de `%s'; el inicio de %s está definido en un fichero enlazado con anterioridad\n" -#: elf64-mmix.c:1674 +#: elf64-mmix.c:2024 msgid "Register section has contents\n" msgstr "La sección de registros no tiene contenido\n" -#: elf64-ppc.c:1484 libbfd.c:1436 +#: elf64-mmix.c:2186 #, c-format -msgid "%s: compiled for a big endian system and target is little endian" +msgid "" +"Internal inconsistency: remaining %u != max %u.\n" +" Please report this bug." msgstr "" -"%s: compilado para un sistema big endian y el objetivo es little endian" +"Inconsistencia interna: %u restante != %u máximo.\n" +" Por favor reporte este bicho." + +#: elf64-ppc.c:1669 libbfd.c:1435 +#, c-format +msgid "%s: compiled for a big endian system and target is little endian" +msgstr "%s: compilado para un sistema big endian y el objetivo es little endian" -#: elf64-ppc.c:1486 libbfd.c:1438 +#: elf64-ppc.c:1671 libbfd.c:1437 #, c-format msgid "%s: compiled for a little endian system and target is big endian" -msgstr "" -"%s: compilado para un sistema little endian y el objetivo es big endian" +msgstr "%s: compilado para un sistema little endian y el objetivo es big endian" + +#: elf64-ppc.c:3610 +#, c-format +msgid "%s: unexpected reloc type %u in .opd section" +msgstr "%s: tipo de reubicación %u inesperado en la sección .opd" + +#: elf64-ppc.c:3630 +#, c-format +msgid "%s: .opd is not a regular array of opd entries" +msgstr "%s: .opd no es una matriz regular de entradas opd" + +#: elf64-ppc.c:3672 +#, c-format +msgid "%s: undefined sym `%s' in .opd section" +msgstr "%s: símbolo `%s' indefinido en la sección .opd" -#: elf64-ppc.c:3350 -#, fuzzy, c-format +#: elf64-ppc.c:4397 +#, c-format +msgid "can't find branch stub `%s'" +msgstr "no se puede encontrar la ramificación de cabo `%s'" + +#: elf64-ppc.c:4436 elf64-ppc.c:4501 +#, c-format msgid "linkage table error against `%s'" -msgstr "desbordamiento de la tabla de enlazado contra `%s'" +msgstr "error de la tabla de enlazado contra `%s'" + +#: elf64-ppc.c:4573 +#, c-format +msgid "can't build branch stub `%s'" +msgstr "no se puede construir la ramificación de cabos `%s'" -#: elf64-ppc.c:3432 -msgid "stub section size doesn't match calculated size" -msgstr "el tamaño de la sección de cabos no coincide con el tamaño calculado" +#: elf64-ppc.c:5179 +msgid "stubs don't match calculated size" +msgstr "los cabos no coinciden con el tamaño calculado" -#: elf64-ppc.c:4061 +#: elf64-ppc.c:5828 #, c-format msgid "%s: Relocation %s is not supported for symbol %s." msgstr "%s: La reubicación %s no tiene soporte para el símbolo %s." -#: elf64-ppc.c:4105 +#: elf64-ppc.c:5872 #, c-format msgid "%s: error: relocation %s not a multiple of 4" msgstr "%s: error: la reubicación %s no es un múltiplo de 4" -#: elf64-sparc.c:1277 +#: elf64-sparc.c:1280 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" msgstr "%s: check_relocs: tipo de reubicación %d sin manejar" -#: elf64-sparc.c:1314 +#: elf64-sparc.c:1317 #, c-format msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" -msgstr "" -"%s: Solamente los registros %%g[2367] pueden ser declarados utilizando " -"STT_REGISTER" +msgstr "%s: Solamente los registros %%g[2367] pueden ser declarados utilizando STT_REGISTER" -#: elf64-sparc.c:1334 -#, fuzzy, c-format +#: elf64-sparc.c:1337 +#, c-format msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" -msgstr "El registro %%g%d se usó de forma incompatible: %s en %s" +msgstr "El registro %%g%d se usó de forma incompatible: %s en %s, previamente %s en %s" -#: elf64-sparc.c:1357 -#, fuzzy, c-format +#: elf64-sparc.c:1360 +#, c-format msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" -msgstr "" -"El símbolo `%s' tiene tipos divergentes: previamente %s, REGISTER en %s" +msgstr "El símbolo `%s' tiene tipos divergentes: REGISTER en %s, previamente %s en %s" -#: elf64-sparc.c:1404 -#, fuzzy, c-format +#: elf64-sparc.c:1406 +#, c-format msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" -msgstr "" -"El símbolo `%s' tiene tipos divergentes: previamente %s, REGISTER en %s" +msgstr "El símbolo `%s' tiene tipos divergentes: %s en %s, previamente REGISTER en %s" -#: elf64-sparc.c:3008 +#: elf64-sparc.c:2970 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" -msgstr "" -"%s: enlazando código específico de UltraSPARC con código específico de HAL" +msgstr "%s: enlazando código específico de UltraSPARC con código específico de HAL" -#: elfcode.h:1218 +#: elfcode.h:1198 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" -msgstr "" -"%s: la cuenta de versión (%ld) no coincide con la cuenta de símbolos (%ld)" +msgstr "%s: la cuenta de versión (%ld) no coincide con la cuenta de símbolos (%ld)" -#: elflink.c:434 +#: elflink.c:440 #, c-format msgid "%s: Section %s is too large to add hole of %ld bytes" msgstr "%s: La sección %s es muy grande para agregar un agujero de %ld bytes" -#: elflink.h:1113 +#: elflink.h:1090 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" msgstr "%s: aviso: redefinición inesperada de `%s'" -#: elflink.h:1784 +#: elflink.h:1727 #, c-format msgid "%s: %s: invalid version %u (max %d)" msgstr "%s: %s: versión %u inválida (máximo %d)" -#: elflink.h:1825 +#: elflink.h:1768 #, c-format msgid "%s: %s: invalid needed version %d" msgstr "%s: %s: versión requerida %d inválida" -#: elflink.h:1945 +#: elflink.h:1890 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" msgstr "Aviso: el tamaño del símbolo `%s' cambió de %lu a %lu en %s" -#: elflink.h:4014 +#: elflink.h:3174 +#, c-format +msgid "%s: .preinit_array section is not allowed in DSO" +msgstr "%s: no se permite la sección .preinit_array en DSO" + +#: elflink.h:4030 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "aviso: el tipo y tamaño del símbolo dinámico `%s' no están definidos" -#: elflink.h:4320 +#: elflink.h:4345 #, c-format msgid "%s: undefined versioned symbol name %s" msgstr "%s: nombre de símbolo con versión %s sin definir" -#: elflink.h:4544 elflink.h:4552 elflink.h:6203 elflink.h:7280 +#: elflink.h:4611 elflink.h:4619 elflink.h:6508 elflink.h:7600 msgid "Error: out of memory" msgstr "Error: memoria agotada" -#: elflink.h:4714 +#: elflink.h:4781 msgid "Not enough memory to sort relocations" msgstr "No hay suficiente memoria para ordenar las reubicaciones" -#: elflink.h:5980 +#: elflink.h:5682 elflink.h:5725 +#, c-format +msgid "%s: could not find output section %s" +msgstr "%s: no se puede encontrar la sección de salida %s" + +#: elflink.h:5688 +#, c-format +msgid "warning: %s section has zero size" +msgstr "aviso: la sección %s es de tamaño cero" + +#: elflink.h:6275 #, c-format msgid "%s: could not find output section %s for input section %s" -msgstr "" -"%s: no se puede encontrar la sección de salida %s para la sección de entrada " -"%s" +msgstr "%s: no se puede encontrar la sección de salida %s para la sección de entrada %s" -#: elflink.h:6553 +#: elflink.h:6486 +#, c-format +msgid "%s: relocation size mismatch in %s section %s" +msgstr "%s: tamaño de reubicación no coincidente en %s sección %s" + +#: elflink.h:6849 msgid "warning: relocation against removed section; zeroing" msgstr "aviso: reubicación contra una sección eliminada; cambiando a ceros" -#: elflink.h:6583 +#: elflink.h:6879 msgid "warning: relocation against removed section" msgstr "aviso: reubicación contra una sección eliminada" -#: elflink.h:6596 +#: elflink.h:6892 #, c-format msgid "local symbols in discarded section %s" msgstr "símbolos locales en la sección descartada %s" -#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 +#: elfxx-mips.c:734 +msgid "static procedure (no name)" +msgstr "procedimiento estático (sin nombre)" + +#: elfxx-mips.c:1601 +msgid "not enough GOT space for local GOT entries" +msgstr "no hay suficiente espacio GOT para entradas GOT locales" + +#: elfxx-mips.c:2750 +#, c-format +msgid "%s: %s+0x%lx: jump to stub routine which is not jal" +msgstr "%s: %s+0x%lx: salto a una rutina cabo la cual no es jal" + +#: elfxx-mips.c:4270 +#, c-format +msgid "%s: Malformed reloc detected for section %s" +msgstr "%s: Se detectó una reubicación malformada para la sección %s" + +#: elfxx-mips.c:4348 +#, c-format +msgid "%s: CALL16 reloc at 0x%lx not against global symbol" +msgstr "%s: la reubicación CALL16 en 0x%lx no es contra un símbolo global" + +#: elfxx-mips.c:7301 +#, c-format +msgid "%s: illegal section name `%s'" +msgstr "%s: nombre de sección `%s' ilegal" + +#: elfxx-mips.c:7615 +#, c-format +msgid "%s: linking PIC files with non-PIC files" +msgstr "%s: enlazando ficheros PIC con ficheros que no son PIC" + +#: elfxx-mips.c:7625 +#, c-format +msgid "%s: linking abicalls files with non-abicalls files" +msgstr "%s: enlazando ficheros de llamadas abi con ficheros que no son de llamadas abi" + +#: elfxx-mips.c:7654 +#, c-format +msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" +msgstr "%s: no coincide el ISA (-mips%d) con módulos previos (-mips%d)" + +#: elfxx-mips.c:7676 +#, c-format +msgid "%s: ISA mismatch (%d) with previous modules (%d)" +msgstr "%s: no coincide el ISA (%d) con módulos previos (%d)" + +#: elfxx-mips.c:7699 +#, c-format +msgid "%s: ABI mismatch: linking %s module with previous %s modules" +msgstr "%s: no coincide el ABI: enlazando el módulo %s con módulos %s previos" + +#: elfxx-mips.c:7759 +msgid " [abi=O32]" +msgstr " [abi=O32]" + +#: elfxx-mips.c:7761 +msgid " [abi=O64]" +msgstr " [abi=O64]" + +#: elfxx-mips.c:7763 +msgid " [abi=EABI32]" +msgstr " [abi=EABI32]" + +#: elfxx-mips.c:7765 +msgid " [abi=EABI64]" +msgstr " [abi=EABI64]" + +#: elfxx-mips.c:7767 +msgid " [abi unknown]" +msgstr " [abi desconocido]" + +#: elfxx-mips.c:7769 +msgid " [abi=N32]" +msgstr " [abi=N32]" + +#: elfxx-mips.c:7771 +msgid " [abi=64]" +msgstr " [abi=64]" + +#: elfxx-mips.c:7773 +msgid " [no abi set]" +msgstr " [no hay conjunto abi]" + +#: elfxx-mips.c:7776 +msgid " [mips1]" +msgstr " [mips1]" + +#: elfxx-mips.c:7778 +msgid " [mips2]" +msgstr " [mips2]" + +#: elfxx-mips.c:7780 +msgid " [mips3]" +msgstr " [mips3]" + +#: elfxx-mips.c:7782 +msgid " [mips4]" +msgstr " [mips4]" + +#: elfxx-mips.c:7784 +msgid " [mips5]" +msgstr " [mips5]" + +#: elfxx-mips.c:7786 +msgid " [mips32]" +msgstr " [mips32]" + +#: elfxx-mips.c:7788 +msgid " [mips64]" +msgstr " [mips64]" + +#: elfxx-mips.c:7790 +msgid " [unknown ISA]" +msgstr " [ISA desconocido]" + +#: elfxx-mips.c:7793 +msgid " [mdmx]" +msgstr " [mdmx]" + +#: elfxx-mips.c:7796 +msgid " [mips16]" +msgstr " [mips16]" + +#: elfxx-mips.c:7799 +msgid " [32bitmode]" +msgstr " [modo 32bit]" + +#: elfxx-mips.c:7801 +msgid " [not 32bitmode]" +msgstr " [no es modo 32bit]" + +#: i386linux.c:458 m68klinux.c:462 sparclinux.c:459 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "El fichero de salida requiere la biblioteca compartida `%s'\n" -#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 +#: i386linux.c:466 m68klinux.c:470 sparclinux.c:467 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "El fichero de salida requiere la biblioteca compartida `%s.so.%s'\n" -#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 -#: sparclinux.c:655 sparclinux.c:705 +#: i386linux.c:655 i386linux.c:705 m68klinux.c:662 m68klinux.c:710 +#: sparclinux.c:657 sparclinux.c:707 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "El símbolo %s no está definido para composturas\n" -#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 +#: i386linux.c:729 m68klinux.c:734 sparclinux.c:731 msgid "Warning: fixup count mismatch\n" msgstr "Aviso: no coincide la cuenta de composturas\n" @@ -1707,7 +1745,7 @@ msgid "%s: unrecognized symbol `%s' flags 0x%x" msgstr "%s: símbolo `%s' no reconocido opciones 0x%x" #: ieee.c:877 -#, fuzzy, c-format +#, c-format msgid "%s: unimplemented ATI record %u for symbol %u" msgstr "%s: grabación ATI %u sin implementar para el símbolo %u" @@ -1726,61 +1764,50 @@ msgstr "%s: tipo inesperado después de ATN" msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" msgstr "%s:%d: carácter `%s' inesperado en el fichero Hexadecimal de Intel\n" -#: ihex.c:368 +#: ihex.c:366 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" -msgstr "" -"%s:%u: suma de comprobación errónea en el fichero Hexadecimal de Intel (se " -"esperaba %u, se obtuvo %u)" +msgstr "%s:%u: suma de comprobación errónea en el fichero Hexadecimal de Intel (se esperaba %u, se obtuvo %u)" -#: ihex.c:422 +#: ihex.c:420 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" -msgstr "" -"%s:%u: longitud de registro de dirección extendida errónea en el fichero " -"Hexadecimal de Intel" +msgstr "%s:%u: longitud de registro de dirección extendida errónea en el fichero Hexadecimal de Intel" -#: ihex.c:439 +#: ihex.c:437 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" -msgstr "" -"%s:%u: longitud de dirección de inicio extendida errónea en el fichero " -"Hexadecimal de Intel" +msgstr "%s:%u: longitud de dirección de inicio extendida errónea en el fichero Hexadecimal de Intel" -#: ihex.c:456 +#: ihex.c:454 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" -msgstr "" -"%s:%u: longitud de registro de dirección lineal extendida errónea en el " -"fichero Hexadecimal de Intel" +msgstr "%s:%u: longitud de registro de dirección lineal extendida errónea en el fichero Hexadecimal de Intel" -#: ihex.c:473 +#: ihex.c:471 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" -msgstr "" -"%s:%u: longitud de dirección de inicio lineal extendida errónea en el " -"fichero Hexadecimal de Intel" +msgstr "%s:%u: longitud de dirección de inicio lineal extendida errónea en el fichero Hexadecimal de Intel" -#: ihex.c:490 +#: ihex.c:488 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" msgstr "%s:%u: tipo ihex %u no reconocido en el fichero Hexadecimal de Intel\n" -#: ihex.c:610 +#: ihex.c:607 #, c-format msgid "%s: internal error in ihex_read_section" msgstr "%s: error interno en ihex_read_section" -#: ihex.c:645 +#: ihex.c:642 #, c-format msgid "%s: bad section length in ihex_read_section" msgstr "%s: longitud de sección errónea en ihex_read_section" -#: ihex.c:863 -#, fuzzy, c-format +#: ihex.c:860 +#, c-format msgid "%s: address 0x%s out of range for Intel Hex file" -msgstr "" -"%s: la dirección 0x%s está fuera de rango en el fichero Hexadecimal de Intel" +msgstr "%s: la dirección 0x%s está fuera de rango en el fichero Hexadecimal de Intel" #: libbfd.c:492 #, c-format @@ -1791,27 +1818,27 @@ msgstr "no se mapea: datos=%lx mapeados%d\n" msgid "not mapping: env var not set\n" msgstr "no se mapea: no se estableció la variable de ambiente\n" -#: libbfd.c:1467 -#, fuzzy, c-format +#: libbfd.c:1466 +#, c-format msgid "Deprecated %s called at %s line %d in %s\n" -msgstr " en %s línea %d en %s\n" +msgstr "Se llamó a %s que está deprecado en %s línea %d en %s\n" -#: libbfd.c:1470 -#, fuzzy, c-format +#: libbfd.c:1469 +#, c-format msgid "Deprecated %s called\n" -msgstr "Se llamó a %s que está deprecado" +msgstr "Se llamó a %s que está deprecado\n" -#: linker.c:1849 +#: linker.c:1873 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" msgstr "%s: el símbolo indirecto `%s' para `%s' es un ciclo" -#: linker.c:2745 +#: linker.c:2776 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" msgstr "Se intentó hacer un enlace reubicable con entrada %s y salida %s" -#: merge.c:897 +#: merge.c:892 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" msgstr "%s: acceso más allá del final de la sección mezclada (%ld + %ld)" @@ -1821,178 +1848,127 @@ msgstr "%s: acceso más allá del final de la sección mezclada (%ld + %ld)" msgid "%s: No core to allocate section name %s\n" msgstr "%s: No hay core para asignar el nombre de sección %s\n" -#: mmo.c:537 +#: mmo.c:536 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "%s: No hay core para asignar un símbolo de %d bytes de longitud\n" -#: mmo.c:1190 +#: mmo.c:1245 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" -msgstr "" -"%s: fichero mmo inválido: el valor de iniciación para $255 no es `Main'\n" +msgstr "%s: fichero mmo inválido: el valor de iniciación para $255 no es `Main'\n" -#: mmo.c:1336 +#: mmo.c:1391 #, c-format -msgid "" -"%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name " -"starting with `%s'\n" -msgstr "" -"%s: secuencia de caracteres anchos 0x%02X 0x%02X sin soporte después del " -"nombre de símbolo que inicia con `%s'\n" +msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n" +msgstr "%s: secuencia de caracteres anchos 0x%02X 0x%02X sin soporte después del nombre de símbolo que inicia con `%s'\n" -#: mmo.c:1571 +#: mmo.c:1633 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "%s: fichero mmo inválido: código de operación-l `%d' sin soporte\n" -#: mmo.c:1581 +#: mmo.c:1643 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" -msgstr "" -"%s: fichero mmo inválido: se esperaba YZ = 1 se obtuvo YZ = %d para " -"lop_quote\n" +msgstr "%s: fichero mmo inválido: se esperaba YZ = 1 se obtuvo YZ = %d para lop_quote\n" -#: mmo.c:1617 +#: mmo.c:1679 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" -msgstr "" -"%s: fichero mmo inválido: se esperaba z = 1 ó z = 2, se obtuvo z = %d para " -"lop_loc\n" +msgstr "%s: fichero mmo inválido: se esperaba z = 1 ó z = 2, se obtuvo z = %d para lop_loc\n" -#: mmo.c:1663 +#: mmo.c:1725 #, c-format -msgid "" -"%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" -msgstr "" -"%s: fichero mmo inválido: se esperaba z = 1 ó z = 2, se obtuvo z = %d para " -"lop_fixo\n" +msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" +msgstr "%s: fichero mmo inválido: se esperaba z = 1 ó z = 2, se obtuvo z = %d para lop_fixo\n" -#: mmo.c:1702 +#: mmo.c:1764 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" -msgstr "" -"%s: fichero mmo inválido: se esperaba y = 0, se obtuvo y = %d para " -"lop_fixrx\n" +msgstr "%s: fichero mmo inválido: se esperaba y = 0, se obtuvo y = %d para lop_fixrx\n" -#: mmo.c:1711 +#: mmo.c:1773 #, c-format -msgid "" -"%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" -msgstr "" -"%s: fichero mmo inválido: se esperaba z = 16 ó z = 24, se obtuvo z = %d para " -"lop_fixrx\n" +msgid "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" +msgstr "%s: fichero mmo inválido: se esperaba z = 16 ó z = 24, se obtuvo z = %d para lop_fixrx\n" -#: mmo.c:1734 +#: mmo.c:1796 #, c-format -msgid "" -"%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d " -"for lop_fixrx\n" -msgstr "" -"%s: fichero mmo inválido: el byte inicial de la palabra operando debe ser 0 " -"ó 1, se obtuvo %d para lop_fixrx\n" +msgid "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n" +msgstr "%s: fichero mmo inválido: el byte inicial de la palabra operando debe ser 0 ó 1, se obtuvo %d para lop_fixrx\n" -#: mmo.c:1757 +#: mmo.c:1819 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" -msgstr "" -"%s: no se puede asignar el nombre de fichero para el número de fichero %d, %" -"d bytes\n" +msgstr "%s: no se puede asignar el nombre de fichero para el número de fichero %d, %d bytes\n" -#: mmo.c:1777 +#: mmo.c:1839 #, c-format -msgid "" -"%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" -msgstr "" -"%s: fichero mmo inválido: el número de fichero %d `%s' ya se había " -"introducido como `%s'\n" +msgid "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" +msgstr "%s: fichero mmo inválido: el número de fichero %d `%s' ya se había introducido como `%s'\n" -#: mmo.c:1790 +#: mmo.c:1852 #, c-format -msgid "" -"%s: invalid mmo file: file name for number %d was not specified before use\n" -msgstr "" -"%s: fichero mmo inválido: no se especificó un nombre de fichero para el " -"número %d antes de utilizarse\n" +msgid "%s: invalid mmo file: file name for number %d was not specified before use\n" +msgstr "%s: fichero mmo inválido: no se especificó un nombre de fichero para el número %d antes de utilizarse\n" -#: mmo.c:1896 +#: mmo.c:1958 #, c-format -msgid "" -"%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" -msgstr "" -"%s: fichero mmo inválido: los campos y y z de lop_stab no son cero, y: %d, " -"z: %d\n" +msgid "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" +msgstr "%s: fichero mmo inválido: los campos y y z de lop_stab no son cero, y: %d, z: %d\n" -#: mmo.c:1932 +#: mmo.c:1994 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" -msgstr "" -"%s: fichero mmo inválido: lop_end no es el último elemento en el fichero\n" +msgstr "%s: fichero mmo inválido: lop_end no es el último elemento en el fichero\n" -#: mmo.c:1945 +#: mmo.c:2007 #, c-format -msgid "" -"%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras " -"to the preceding lop_stab (%ld)\n" -msgstr "" -"%s: fichero mmo inválido: YZ de lop_end (%ld) no es igual al número de " -"tetras del lop_stab precedente (%ld)\n" +msgid "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras to the preceding lop_stab (%ld)\n" +msgstr "%s: fichero mmo inválido: YZ de lop_end (%ld) no es igual al número de tetras del lop_stab precedente (%ld)\n" -#: mmo.c:2610 +#: mmo.c:2670 #, c-format msgid "%s: invalid symbol table: duplicate symbol `%s'\n" msgstr "%s: tabla de símbolos inválida: símbolo `%s' duplicado\n" -#: mmo.c:2898 +#: mmo.c:2921 #, c-format -msgid "" -"%s: Bad symbol definition: `Main' set to %s rather than the start address %" -"s\n" -msgstr "" -"%s: Definición de símbolo errónea: `Main' se estableción como %s en lugar de " -"la dirección de inicio %s\n" +msgid "%s: Bad symbol definition: `Main' set to %s rather than the start address %s\n" +msgstr "%s: Definición de símbolo errónea: `Main' se estableción como %s en lugar de la dirección de inicio %s\n" -#: mmo.c:2932 +#: mmo.c:3011 #, c-format -msgid "" -"%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: " -"%d. Only `Main' will be emitted.\n" -msgstr "" -"%s: aviso: la tabla de símbolos es demasiado grande para mmo, es más grande " -"que 65535 words de 32-bit: %d. Sólo se emitirá `Main'.\n" +msgid "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: %d. Only `Main' will be emitted.\n" +msgstr "%s: aviso: la tabla de símbolos es demasiado grande para mmo, es más grande que 65535 words de 32-bit: %d. Sólo se emitirá `Main'.\n" -#: mmo.c:2977 +#: mmo.c:3056 #, c-format msgid "%s: internal error, symbol table changed size from %d to %d words\n" -msgstr "" -"%s: error interno, la tabla de símbolos cambió de tamaño de %d a %d words\n" +msgstr "%s: error interno, la tabla de símbolos cambió de tamaño de %d a %d words\n" -#: mmo.c:3032 +#: mmo.c:3111 #, c-format msgid "%s: internal error, internal register section %s had contents\n" -msgstr "" -"%s: error interno, la sección interna de registros %s tiene contenido\n" +msgstr "%s: error interno, la sección interna de registros %s tiene contenido\n" -#: mmo.c:3084 +#: mmo.c:3163 #, c-format msgid "%s: no initialized registers; section length 0\n" msgstr "%s: no hay registros iniciados; longitud de sección 0\n" -#: mmo.c:3090 +#: mmo.c:3169 #, c-format msgid "%s: too many initialized registers; section length %ld\n" msgstr "%s: demasiados registros iniciados: longitud de sección %ld\n" -#: mmo.c:3095 +#: mmo.c:3174 #, c-format -msgid "" -"%s: invalid start address for initialized registers of length %ld: 0x%lx%" -"08lx\n" -msgstr "" -"%s: dirección de inicio inválida para los registros iniciados de longitud %" -"ld: 0x%lx%08lx\n" +msgid "%s: invalid start address for initialized registers of length %ld: 0x%lx%08lx\n" +msgstr "%s: dirección de inicio inválida para los registros iniciados de longitud %ld: 0x%lx%08lx\n" -#: oasys.c:1036 +#: oasys.c:1029 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "%s: no se puede representar la sección `%s' en oasys" @@ -2046,25 +2022,17 @@ msgstr "%s: Tipo de nombre de importación no reconocida; %x" #: peicode.h:1162 #, c-format msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" -msgstr "" -"%s: Tipo de máquina (0x%x) no reconocida en el archivo de Formato de " -"Importación de Bibliotecas" +msgstr "%s: Tipo de máquina (0x%x) no reconocida en el archivo de Formato de Importación de Bibliotecas" #: peicode.h:1174 #, c-format -msgid "" -"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " -"archive" -msgstr "" -"%s: Tipo de máquina (0x%x) reconocida pero sin manejar en el archivo de " -"Formato de Importación de Bibliotecas" +msgid "%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive" +msgstr "%s: Tipo de máquina (0x%x) reconocida pero sin manejar en el archivo de Formato de Importación de Bibliotecas" #: peicode.h:1191 #, c-format msgid "%s: size field is zero in Import Library Format header" -msgstr "" -"%s: el tamaño del campo es cero en el encabezado del Formato de Importación " -"de Bibliotecas" +msgstr "%s: el tamaño del campo es cero en el encabezado del Formato de Importación de Bibliotecas" #: peicode.h:1219 #, c-format @@ -2123,7 +2091,7 @@ msgstr "Partición[%d] sector = 0x%.8lx (%ld)\n" msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "Partición[%d] longitud = 0x%.8lx (%ld)\n" -#: som.c:5402 +#: som.c:5398 msgid "som_sizeof_headers unimplemented" msgstr "som_sizeof_headers sin implementar" @@ -2132,7 +2100,12 @@ msgstr "som_sizeof_headers sin implementar" msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "%s:%d: Caractér `%s' inesperado en el fichero S-record\n" -#: syms.c:998 +#: stabs.c:319 +#, c-format +msgid "%s(%s+0x%lx): Stabs entry has invalid string index." +msgstr "%s(%s+0x%lx): La entrada de cabos tiene una cadena índice inválida." + +#: syms.c:1044 msgid "Unsupported .stab relocation" msgstr "Reubicación .stab sin soporte" @@ -2151,7 +2124,7 @@ msgstr "bfd_set_section_flags (%s, %x) falló" msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "No coincide el tamaño de la sección %s=%lx, %s=%lx" -#: vms-gsd.c:704 +#: vms-gsd.c:702 #, c-format msgid "unknown gsd/egsd subtype %d" msgstr "subtipo de gsd/egsd %d desconocido" @@ -2192,24 +2165,24 @@ msgid "No Mem !" msgstr "¡ No hay Memoria !" #: vms-tir.c:362 -#, fuzzy, c-format +#, c-format msgid "bad section index in %s" -msgstr "Índice de sección erróneo en ETIR_S_C_STA_PQ" +msgstr "Índice de sección erróneo en %s" #: vms-tir.c:375 -#, fuzzy, c-format +#, c-format msgid "unsupported STA cmd %s" -msgstr "Orden STA %d sin soporte" +msgstr "orden STA %s sin soporte" #: vms-tir.c:380 vms-tir.c:1240 -#, fuzzy, c-format +#, c-format msgid "reserved STA cmd %d" -msgstr "Orden STA %d reservada" +msgstr "orden STA %d reservada" #: vms-tir.c:491 vms-tir.c:514 -#, fuzzy, c-format +#, c-format msgid "%s: no symbol \"%s\"" -msgstr "%s: no hay tal símbolo" +msgstr "%s: no existe el símbolo \"%s\"" #. unsigned shift #. rotate @@ -2217,41 +2190,39 @@ msgstr "%s: no hay tal símbolo" #. Define a literal. #: vms-tir.c:581 vms-tir.c:693 vms-tir.c:803 vms-tir.c:821 vms-tir.c:829 #: vms-tir.c:838 vms-tir.c:1563 -#, fuzzy, c-format +#, c-format msgid "%s: not supported" -msgstr "no tiene soporte para" +msgstr "%s: no tiene soporte" #: vms-tir.c:586 vms-tir.c:1418 -#, fuzzy, c-format +#, c-format msgid "%s: not implemented" -msgstr "%s: %s sin implementar\n" +msgstr "%s: sin implementar" #: vms-tir.c:590 vms-tir.c:1422 -#, fuzzy, c-format +#, c-format msgid "reserved STO cmd %d" -msgstr "Orden STO %d reservada" +msgstr "orden STO %d reservada" #: vms-tir.c:708 vms-tir.c:1568 -#, fuzzy, c-format +#, c-format msgid "reserved OPR cmd %d" -msgstr "Orden OPR %d reservada" +msgstr "orden OPR %d reservada" #: vms-tir.c:776 vms-tir.c:1632 -#, fuzzy, c-format +#, c-format msgid "reserved CTL cmd %d" -msgstr "Orden CTL %d reservada" +msgstr "orden CTL %d reservada" #. stack byte from image #. arg: none. #: vms-tir.c:1148 -#, fuzzy msgid "stack-from-image not implemented" -msgstr "Pila-desde-imagen sin implementar" +msgstr "pila-desde-imagen sin implementar" #: vms-tir.c:1166 -#, fuzzy msgid "stack-entry-mask not fully implemented" -msgstr "Pila-máscara-entrada no está completamente implementado" +msgstr "pila-máscara-entrada no está completamente implementado" #. compare procedure argument #. arg: cs symbol name @@ -2265,31 +2236,27 @@ msgid "PASSMECH not fully implemented" msgstr "PASSMECH no está completamente implementado" #: vms-tir.c:1199 -#, fuzzy msgid "stack-local-symbol not fully implemented" -msgstr "Pila-símbolo-local no está completamente implementado" +msgstr "pila-símbolo-local no está completamente implementado" #: vms-tir.c:1212 -#, fuzzy msgid "stack-literal not fully implemented" -msgstr "Pila-literal no está completamente implementado" +msgstr "pila-literal no está completamente implementado" #: vms-tir.c:1233 -#, fuzzy msgid "stack-local-symbol-entry-point-mask not fully implemented" -msgstr "" -"Pila-símbolo-local-máscara-punto-entrada no está completamente implementado" +msgstr "pila-símbolo-local-máscara-punto-entrada no está completamente implementado" #: vms-tir.c:1510 vms-tir.c:1522 vms-tir.c:1534 vms-tir.c:1546 vms-tir.c:1611 #: vms-tir.c:1619 vms-tir.c:1627 -#, fuzzy, c-format +#, c-format msgid "%s: not fully implemented" -msgstr "PASSMECH no está completamente implementado" +msgstr "%s: no está completamente implementado" #: vms-tir.c:1684 -#, fuzzy, c-format +#, c-format msgid "obj code %d not found" -msgstr "No se encontró el código objeto %d" +msgstr "no se encontró el código objeto %d" #: vms-tir.c:2019 #, c-format @@ -2301,157 +2268,152 @@ msgstr "SEC_RELOC sin reubicaciones en la sección %s" msgid "Unhandled relocation %s" msgstr "Reubicación %s sin manejar" -#: xcofflink.c:1241 +#: xcofflink.c:1243 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "%s: `%s' tiene números de línea pero no una sección contenedora" -#: xcofflink.c:1294 +#: xcofflink.c:1296 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "%s: clase %d símbolo `%s' no tiene entradas auxiliares" -#: xcofflink.c:1317 +#: xcofflink.c:1319 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "%s: el símbolo `%s' tiene un tipo csect %d no reconocido" -#: xcofflink.c:1329 +#: xcofflink.c:1331 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "%s: símbolo XTY_ER `%s' erróneo: clase %d scnum %d scnlen %d" -#: xcofflink.c:1365 +#: xcofflink.c:1367 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "%s: símbolo XMC_TCO `%s' es clase %d scnlen %d" -#: xcofflink.c:1517 +#: xcofflink.c:1519 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "%s: csect `%s' no está contenido en una sección" -#: xcofflink.c:1624 +#: xcofflink.c:1626 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "%s: XTY_LD `%s' mal ubicado" -#: xcofflink.c:1948 +#: xcofflink.c:1957 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "%s: la reubicación %s:%d no está en csect" -#: xcofflink.c:2083 +#: xcofflink.c:2092 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "%s: objeto compartido XCOFF cuando no se produce salida XCOFF" -#: xcofflink.c:2104 +#: xcofflink.c:2113 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "%s: objeto dinámico sin sección .loader" -#: xcofflink.c:2749 +#: xcofflink.c:2758 #, c-format msgid "%s: no such symbol" msgstr "%s: no hay tal símbolo" -#: xcofflink.c:2890 +#: xcofflink.c:2891 msgid "error: undefined symbol __rtinit" msgstr "error: símbolo __rtinit indefinido" -#: xcofflink.c:3458 +#: xcofflink.c:3453 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "aviso: intento de exportar el símbolo sin definir `%s'" -#: xcofflink.c:4452 +#: xcofflink.c:4447 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" -msgstr "" -"Desbordamiento de TOC: 0x%lx > 0x10000; pruebe -mminimal-toc al compilar" +msgstr "Desbordamiento de TOC: 0x%lx > 0x10000; pruebe -mminimal-toc al compilar" -#: xcofflink.c:5292 xcofflink.c:5754 xcofflink.c:5816 xcofflink.c:6117 +#: xcofflink.c:5287 xcofflink.c:5756 xcofflink.c:5818 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "%s: reubicación del cargador en la sección `%s' no reconocida" -#: xcofflink.c:5314 xcofflink.c:6128 +#: xcofflink.c:5309 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" -msgstr "" -"%s: `%s' en la reubicación del cargador pero no es un símbolo del cargador" +msgstr "%s: `%s' en la reubicación del cargador pero no es un símbolo del cargador" -#: xcofflink.c:5329 +#: xcofflink.c:5324 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "%s: reubicación del cargador en la sección de sólo lectura %s" -#: elf32-ia64.c:2189 elf64-ia64.c:2189 +#: elf32-ia64.c:2222 elf64-ia64.c:2222 msgid "@pltoff reloc against local symbol" msgstr "reubicación @pltoff contra un símbolo local" -#: elf32-ia64.c:3413 elf64-ia64.c:3413 +#: elf32-ia64.c:3562 elf64-ia64.c:3562 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "%s: segmento de datos short desbordado (0x%lx >= 0x400000)" -#: elf32-ia64.c:3424 elf64-ia64.c:3424 +#: elf32-ia64.c:3573 elf64-ia64.c:3573 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "%s: __gp no cubre el segmento de datos short" -#: elf32-ia64.c:3728 elf64-ia64.c:3728 +#: elf32-ia64.c:3858 elf64-ia64.c:3858 #, c-format msgid "%s: linking non-pic code in a shared library" msgstr "%s: enlazando código que no es pic en una biblioteca compartida" -#: elf32-ia64.c:3761 elf64-ia64.c:3761 +#: elf32-ia64.c:3891 elf64-ia64.c:3891 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" msgstr "%s: reubicación @gprel contra el símbolo dinámico %s" -#: elf32-ia64.c:3900 elf64-ia64.c:3900 +#: elf32-ia64.c:4030 elf64-ia64.c:4030 #, c-format msgid "%s: dynamic relocation against speculation fixup" msgstr "%s: reubicación dinámica contra una compostura de especulación" -#: elf32-ia64.c:3908 elf64-ia64.c:3908 +#: elf32-ia64.c:4038 elf64-ia64.c:4038 #, c-format msgid "%s: speculation fixup against undefined weak symbol" msgstr "%s: compostura de especulación contra un símbolo débil indefinido" -#: elf32-ia64.c:4092 elf64-ia64.c:4092 +#: elf32-ia64.c:4271 elf64-ia64.c:4271 msgid "unsupported reloc" msgstr "reubicación sin soporte" -#: elf32-ia64.c:4372 elf64-ia64.c:4372 +#: elf32-ia64.c:4551 elf64-ia64.c:4551 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" -msgstr "" -"%s: enlazando deferencias-captura-en-NULL con ficheros que no son de captura" +msgstr "%s: enlazando deferencias-captura-en-NULL con ficheros que no son de captura" -#: elf32-ia64.c:4381 elf64-ia64.c:4381 +#: elf32-ia64.c:4560 elf64-ia64.c:4560 #, c-format msgid "%s: linking big-endian files with little-endian files" msgstr "%s: enlazando ficheros big endian con ficheros little endian" -#: elf32-ia64.c:4390 elf64-ia64.c:4390 +#: elf32-ia64.c:4569 elf64-ia64.c:4569 #, c-format msgid "%s: linking 64-bit files with 32-bit files" msgstr "%s: enlazando ficheros de 64-bit con ficheros de 32-bit" -#: elf32-ia64.c:4399 elf64-ia64.c:4399 +#: elf32-ia64.c:4578 elf64-ia64.c:4578 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" -msgstr "" -"%s: enlazando ficheros de gp constante con ficheros con gp no constante" +msgstr "%s: enlazando ficheros de gp constante con ficheros con gp no constante" -#: elf32-ia64.c:4409 elf64-ia64.c:4409 +#: elf32-ia64.c:4588 elf64-ia64.c:4588 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" -msgstr "" -"%s: enlazando ficheros de pic automático con ficheros sin pic automático" +msgstr "%s: enlazando ficheros de pic automático con ficheros sin pic automático" #: peigen.c:962 pepigen.c:962 #, c-format @@ -2529,8 +2491,7 @@ msgid "" "There is an import table, but the section containing it could not be found\n" msgstr "" "\n" -"Hay una tabla de importación, pero la sección que la contiene no se puede " -"encontrar\n" +"Hay una tabla de importación, pero la sección que la contiene no se puede encontrar\n" #: peigen.c:1076 pepigen.c:1076 #, c-format @@ -2553,8 +2514,7 @@ msgstr "" #: peigen.c:1116 pepigen.c:1116 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" -msgstr "" -"\tcódigo-base %08lx tabla-de-contenidos (cargable/actual) %08lx/%08lx\n" +msgstr "\tcódigo-base %08lx tabla-de-contenidos (cargable/actual) %08lx/%08lx\n" #: peigen.c:1122 pepigen.c:1122 msgid "" @@ -2571,17 +2531,17 @@ msgid "" "The Import Tables (interpreted %s section contents)\n" msgstr "" "\n" -"Las Tablas de Importación (se interpretaron los contenidos de la sección %" -"s)\n" +"Las Tablas de Importación (se interpretaron los contenidos de la sección %s)\n" #: peigen.c:1130 pepigen.c:1130 -#, fuzzy msgid "" " vma: Hint Time Forward DLL First\n" " Table Stamp Chain Name Thunk\n" -msgstr " Tabla Estampa Cadena Nombre Thunk\n" +msgstr "" +" vma: Pista Fecha Adelante DLL Primero\n" +" Tabla Estampa Cadena Nombre Thunk\n" -#: peigen.c:1180 pepigen.c:1180 +#: peigen.c:1181 pepigen.c:1181 #, c-format msgid "" "\n" @@ -2590,33 +2550,27 @@ msgstr "" "\n" "\tNombre de la DLL: %s\n" -#: peigen.c:1184 peigen.c:1247 pepigen.c:1184 pepigen.c:1247 -msgid "\tvma: Hint/Ord Member-Name\n" -msgstr "\tvma: Nombre de Miembro de Pista/Ord\n" +#: peigen.c:1192 pepigen.c:1192 +msgid "\tvma: Hint/Ord Member-Name Bound-To\n" +msgstr "\tvma: Pista/Ord Nombre-Miembro Unido-A\n" -#: peigen.c:1246 pepigen.c:1246 -msgid "\tThe Import Address Table (difference found)\n" +#: peigen.c:1217 pepigen.c:1217 +msgid "" +"\n" +"There is a first thunk, but the section containing it could not be found\n" msgstr "" -"\tLa Tabla de Importación de Direcciones (se encontró una diferencia)\n" - -#: peigen.c:1253 pepigen.c:1253 -msgid "\t>>> Ran out of IAT members!\n" -msgstr "\t>>> ¡Se terminaron los miembros IAT!\n" - -#: peigen.c:1271 pepigen.c:1271 -msgid "\tThe Import Address Table is identical\n" -msgstr "\tLa Tabla de Importación de Direcciones es idéntica\n" +"\n" +"Hay un thunk inicial, pero la sección que lo contiene no se puede encontrar\n" -#: peigen.c:1343 pepigen.c:1343 +#: peigen.c:1357 pepigen.c:1357 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" "\n" -"Hay una tabla de exportación, pero la sección que la contiene no se puede " -"encontrar\n" +"Hay una tabla de exportación, pero la sección que la contiene no se puede encontrar\n" -#: peigen.c:1348 pepigen.c:1348 +#: peigen.c:1362 pepigen.c:1362 #, c-format msgid "" "\n" @@ -2625,7 +2579,7 @@ msgstr "" "\n" "Hay una tabla de exportación en %s en 0x%lx\n" -#: peigen.c:1379 pepigen.c:1379 +#: peigen.c:1393 pepigen.c:1393 #, c-format msgid "" "\n" @@ -2633,66 +2587,65 @@ msgid "" "\n" msgstr "" "\n" -"Las Tablas de Exportación (se interpretaron los contenidos de la sección %" -"s)\n" +"Las Tablas de Exportación (se interpretaron los contenidos de la sección %s)\n" "\n" -#: peigen.c:1383 pepigen.c:1383 +#: peigen.c:1397 pepigen.c:1397 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "Opciones de Exportación \t\t\t%lx\n" -#: peigen.c:1386 pepigen.c:1386 +#: peigen.c:1400 pepigen.c:1400 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "marca de Hora/Fecha \t\t%lx\n" -#: peigen.c:1389 pepigen.c:1389 +#: peigen.c:1403 pepigen.c:1403 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "Mayor/Menor \t\t\t%d/%d\n" -#: peigen.c:1392 pepigen.c:1392 +#: peigen.c:1406 pepigen.c:1406 msgid "Name \t\t\t\t" msgstr "Nombre \t\t\t\t" -#: peigen.c:1398 pepigen.c:1398 +#: peigen.c:1412 pepigen.c:1412 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "Base Ordinal \t\t\t%ld\n" -#: peigen.c:1401 pepigen.c:1401 +#: peigen.c:1415 pepigen.c:1415 msgid "Number in:\n" msgstr "Número en:\n" -#: peigen.c:1404 pepigen.c:1404 +#: peigen.c:1418 pepigen.c:1418 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "\tTabla de Exportación de Direcciones \t\t%08lx\n" -#: peigen.c:1408 pepigen.c:1408 +#: peigen.c:1422 pepigen.c:1422 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "\tTabla [Nombre Apuntador/Ordinal]\t%08lx\n" -#: peigen.c:1411 pepigen.c:1411 +#: peigen.c:1425 pepigen.c:1425 msgid "Table Addresses\n" msgstr "Direcciones de la Tabla\n" -#: peigen.c:1414 pepigen.c:1414 +#: peigen.c:1428 pepigen.c:1428 msgid "\tExport Address Table \t\t" msgstr "\tTabla de Exportación de Direcciones \t\t" -#: peigen.c:1419 pepigen.c:1419 +#: peigen.c:1433 pepigen.c:1433 msgid "\tName Pointer Table \t\t" msgstr "\tNombre de la Tabla de Apuntadores \t\t" # continuar aqui -#: peigen.c:1424 pepigen.c:1424 +#: peigen.c:1438 pepigen.c:1438 msgid "\tOrdinal Table \t\t\t" msgstr "\tTabla Ordinal \t\t\t" -#: peigen.c:1439 pepigen.c:1439 +#: peigen.c:1453 pepigen.c:1453 #, c-format msgid "" "\n" @@ -2701,15 +2654,15 @@ msgstr "" "\n" "Tabla de Exportación de Direcciones -- Base Ordinal %ld\n" -#: peigen.c:1458 pepigen.c:1458 +#: peigen.c:1472 pepigen.c:1472 msgid "Forwarder RVA" msgstr "RVA Adelantador" -#: peigen.c:1469 pepigen.c:1469 +#: peigen.c:1483 pepigen.c:1483 msgid "Export RVA" msgstr "RVA Exportador" -#: peigen.c:1476 pepigen.c:1476 +#: peigen.c:1490 pepigen.c:1490 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" @@ -2717,44 +2670,44 @@ msgstr "" "\n" "Tabla [Apuntador a Ordinal/Nombre]\n" -#: peigen.c:1531 pepigen.c:1531 +#: peigen.c:1545 pepigen.c:1545 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "Aviso, el tamaño de la sección .pdata (%ld) no es un múltiplo de %d\n" -#: peigen.c:1535 pepigen.c:1535 +#: peigen.c:1549 pepigen.c:1549 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" "\n" -"La Tabla de Funciones (se interpretaron los contenidos de la sección ." -"pdata)\n" +"La Tabla de Funciones (se interpretaron los contenidos de la sección .pdata)\n" -#: peigen.c:1538 pepigen.c:1538 +#: peigen.c:1552 pepigen.c:1552 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr " vma:\t\t\tDirección Inicio Dirección Fin Información Desenvuelta\n" -#: peigen.c:1540 pepigen.c:1540 -#, fuzzy +#: peigen.c:1554 pepigen.c:1554 msgid "" " vma:\t\tBegin End EH EH PrologEnd Exception\n" " \t\tAddress Address Handler Data Address Mask\n" -msgstr " vma:\t\tInicio Fin EH EH FinPrólogo Excepción\n" +msgstr "" +" vma:\t\tInicio Fin EH EH FinPrólogo Excepción\n" +" \t\tDirecc Direcc Asa Datos Dirección Máscara\n" -#: peigen.c:1610 pepigen.c:1610 +#: peigen.c:1624 pepigen.c:1624 msgid " Register save millicode" msgstr " Registro para guardar milicódigo" -#: peigen.c:1613 pepigen.c:1613 +#: peigen.c:1627 pepigen.c:1627 msgid " Register restore millicode" msgstr " Registro para restaurar milicódigo" -#: peigen.c:1616 pepigen.c:1616 +#: peigen.c:1630 pepigen.c:1630 msgid " Glue code sequence" msgstr " Secuencia de código pegamento" -#: peigen.c:1668 pepigen.c:1668 +#: peigen.c:1682 pepigen.c:1682 msgid "" "\n" "\n" @@ -2762,20 +2715,18 @@ msgid "" msgstr "" "\n" "\n" -"Reubicaciones de Fichero Base PE (se interpretaron los contenidos de la " -"sección .reloc)\n" +"Reubicaciones de Fichero Base PE (se interpretaron los contenidos de la sección .reloc)\n" -#: peigen.c:1698 pepigen.c:1698 +#: peigen.c:1712 pepigen.c:1712 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" "\n" -"Dirección Virtual: %08lx Tamaño del trozo %ld (0x%lx) Número de composturas %" -"ld\n" +"Dirección Virtual: %08lx Tamaño del trozo %ld (0x%lx) Número de composturas %ld\n" -#: peigen.c:1711 pepigen.c:1711 +#: peigen.c:1725 pepigen.c:1725 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "\treubicación %4d desplazamiento %4x [%4lx] %s" @@ -2783,7 +2734,7 @@ msgstr "\treubicación %4d desplazamiento %4x [%4lx] %s" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1751 pepigen.c:1751 +#: peigen.c:1765 pepigen.c:1765 #, c-format msgid "" "\n" @@ -2792,43 +2743,49 @@ msgstr "" "\n" "Características 0x%x\n" +#~ msgid "\tThe Import Address Table (difference found)\n" +#~ msgstr "\tLa Tabla de Importación de Direcciones (se encontró una diferencia)\n" + +#~ msgid "\t>>> Ran out of IAT members!\n" +#~ msgstr "\t>>> ¡Se terminaron los miembros IAT!\n" + +#~ msgid "\tThe Import Address Table is identical\n" +#~ msgstr "\tLa Tabla de Importación de Direcciones es idéntica\n" + #~ msgid "GP relative relocation when GP not defined" #~ msgstr "reubicación GP relativa cuando GP no estaba definido" +#~ msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" +#~ msgstr "%s: ERROR: pasan números de coma flotante en registros de coma flotante mientras que el objetivo %s usa registros enteros" + +#~ msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" +#~ msgstr "%s: ERROR: pasan números de coma flotante en registros enteros mientras que el objetivo %s usa registros de coma flotante" + #~ msgid "Warning: input file %s supports interworking, whereas %s does not." -#~ msgstr "" -#~ "Aviso: el fichero de entrada %s soporta interoperabilidad, mientras que %" -#~ "s no." +#~ msgstr "Aviso: el fichero de entrada %s soporta interoperabilidad, mientras que %s no." -#~ msgid "" -#~ "Warning: input file %s does not support interworking, whereas %s does." -#~ msgstr "" -#~ "Aviso: el fichero de entrada %s no soporta interoperabilidad, mientras " -#~ "que %s sí." +#~ msgid "Warning: input file %s does not support interworking, whereas %s does." +#~ msgstr "Aviso: el fichero de entrada %s no soporta interoperabilidad, mientras que %s sí." # FIXME: Revisar en el código si son abreviaturas comunes, o corresponden a # partes fijas dentro del programa. cfuga #~ msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" #~ msgstr "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" -#~ msgid "" -#~ "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x" -#~ "%.8lx%s\n" -#~ msgstr "" -#~ "elf_symbol_from_bfd_symbol 0x%.8lx, nombre = %s, núm sim = %d, opciones = " -#~ "0x%.8lx%s\n" +#~ msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" +#~ msgstr "elf_symbol_from_bfd_symbol 0x%.8lx, nombre = %s, núm sim = %d, opciones = 0x%.8lx%s\n" -#~ msgid "" -#~ "Warning: Not setting interwork flag of %s since it has already been " -#~ "specified as non-interworking" -#~ msgstr "" -#~ "Aviso: No se activa la opción de interoperación de %s ya que ya había " -#~ "sido especificada como no interoperable" +#~ msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" +#~ msgstr "Aviso: No se activa la opción de interoperación de %s ya que ya había sido especificada como no interoperable" #~ msgid "Warning: Clearing the interwork flag of %s due to outside request" -#~ msgstr "" -#~ "Aviso: Limpiando la opción de interoperación de %s debido a una petición " -#~ "externa" +#~ msgstr "Aviso: Limpiando la opción de interoperación de %s debido a una petición externa" + +#~ msgid " [APCS-26]" +#~ msgstr " [APCS-26]" + +#~ msgid " [APCS-32]" +#~ msgstr " [APCS-32]" #~ msgid "(unknown)" #~ msgstr "(desconocido)" @@ -2917,9 +2874,6 @@ msgstr "" #~ msgid " \t\tAddress Address Handler Data Address Mask\n" #~ msgstr " \t\tDirección Dirección Manejador Datos Dirección Máscara\n" -#~ msgid "float" -#~ msgstr "coma flotante" - #~ msgid "integer" #~ msgstr "entero" @@ -2946,15 +2900,10 @@ msgstr "" #~ msgstr "%s(%s+0x%lx): no se puede encontrar la entrada de cabo %s" #~ msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections" -#~ msgstr "" -#~ "%s(%s+0x%lx): no se puede reubicar %s, recompile con -ffuncion-sections" - -#~ msgid "" -#~ "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section " -#~ "= 0x%.8lx\n" -#~ msgstr "" -#~ "creando el símbolo de sección, nombre = %s, valor = 0x%.8lx, índice = %d, " -#~ "sección 0x%.8lx\n" +#~ msgstr "%s(%s+0x%lx): no se puede reubicar %s, recompile con -ffuncion-sections" + +#~ msgid "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = 0x%.8lx\n" +#~ msgstr "creando el símbolo de sección, nombre = %s, valor = 0x%.8lx, índice = %d, sección 0x%.8lx\n" #~ msgid " whereas segment starts at 0x%x" #~ msgstr " mientras que el segmento inicia en 0x%x" diff --git a/bfd/po/fr.po b/bfd/po/fr.po index 8662d31..4c0defd 100644 --- a/bfd/po/fr.po +++ b/bfd/po/fr.po @@ -1,19 +1,19 @@ # Messages français pour GNU concernant bfd. -# Copyright (C) 1996 Free Software Foundation, Inc. -# Michel Robitaille <robitail@IRO.UMontreal.CA>, 1996. +# Copyright © 1996 Free Software Foundation, Inc. +# Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996. # msgid "" msgstr "" -"Project-Id-Version: GNU bfd 2.12-pre020121\n" -"POT-Creation-Date: 2002-01-17 12:55+0000\n" -"PO-Revision-Date: 2002-03-17 20:00-0500\n" +"Project-Id-Version: GNU bfd 2.12.91\n" +"POT-Creation-Date: 2002-07-23 15:55-0400\n" +"PO-Revision-Date: 2002-07-24 08:00-0500\n" "Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n" "Language-Team: French <traduc@traduc.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" -#: aout-adobe.c:196 +#: aout-adobe.c:197 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "%s: type de section inconnu dans le fichier a.out.adobe: %x\n" @@ -47,7 +47,7 @@ msgstr "%s: ne peut représenter la section pour le symbole « %s » dans le fichie msgid "*unknown*" msgstr "*inconnu*" -#: aoutx.h:3735 +#: aoutx.h:3732 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "%s: relocalisation de liens de %s vers %s n'est pas supporté" @@ -65,102 +65,102 @@ msgstr "Lecture du cachet date-heure modifé du fichier d'archive" msgid "Writing updated armap timestamp" msgstr "Écriture du cachet date-heure armap mise à jour" -#: bfd.c:281 +#: bfd.c:274 msgid "No error" msgstr "Pas d'erreur" -#: bfd.c:282 +#: bfd.c:275 msgid "System call error" msgstr "Erreur d'appel système" -#: bfd.c:283 +#: bfd.c:276 msgid "Invalid bfd target" msgstr "cible bfd invalide" -#: bfd.c:284 +#: bfd.c:277 msgid "File in wrong format" msgstr "Fichier dans un mauvais format" -#: bfd.c:285 +#: bfd.c:278 msgid "Archive object file in wrong format" msgstr "Fichier objet d'archive dans un mauvais format" -#: bfd.c:286 +#: bfd.c:279 msgid "Invalid operation" msgstr "Opération invalide" -#: bfd.c:287 +#: bfd.c:280 msgid "Memory exhausted" msgstr "Mémoire épuisée" -#: bfd.c:288 +#: bfd.c:281 msgid "No symbols" msgstr "Aucun symbole" -#: bfd.c:289 +#: bfd.c:282 msgid "Archive has no index; run ranlib to add one" msgstr "L'archive n'a pas d'index; exécuter ranlib pour en ajouter un" -#: bfd.c:290 +#: bfd.c:283 msgid "No more archived files" msgstr "Aucun autre fichier d'archive" -#: bfd.c:291 +#: bfd.c:284 msgid "Malformed archive" msgstr "Archive mal formé" -#: bfd.c:292 +#: bfd.c:285 msgid "File format not recognized" msgstr "Format de fichier non reconnu" -#: bfd.c:293 +#: bfd.c:286 msgid "File format is ambiguous" msgstr "Format de fichier ambiguë" -#: bfd.c:294 +#: bfd.c:287 msgid "Section has no contents" msgstr "Section sans contenu" -#: bfd.c:295 +#: bfd.c:288 msgid "Nonrepresentable section on output" msgstr "Section non-représentable pour la sortie" -#: bfd.c:296 +#: bfd.c:289 msgid "Symbol needs debug section which does not exist" msgstr "Symboles ont besoin de la section de débug qui est inexistente" -#: bfd.c:297 +#: bfd.c:290 msgid "Bad value" msgstr "Mauvaise valeur" -#: bfd.c:298 +#: bfd.c:291 msgid "File truncated" msgstr "Fichier tronqué" -#: bfd.c:299 +#: bfd.c:292 msgid "File too big" msgstr "Fichier trop gros" -#: bfd.c:300 +#: bfd.c:293 msgid "#<Invalid error code>" msgstr "#<Code d'erreur invalide>" -#: bfd.c:707 +#: bfd.c:700 #, c-format msgid "BFD %s assertion fail %s:%d" msgstr "BFD assertion %s a échoué %s:%d" -#: bfd.c:726 +#: bfd.c:719 #, c-format msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "BFD erreur interne %s, abandon à %s, ligne %d dans %s\n" -#: bfd.c:730 +#: bfd.c:723 #, c-format -msgid "BFD %sinternal error, aborting at %s line %d\n" +msgid "BFD %s internal error, aborting at %s line %d\n" msgstr "BFD erreur interne %s, abandon à %s, ligne %d\n" -#: bfd.c:732 +#: bfd.c:725 msgid "Please report this bug.\n" msgstr "SVP rapporter cette anomalie.\n" @@ -177,7 +177,7 @@ msgstr "IHCONST manquant" msgid "Missing IHIHALF" msgstr "IHIHALF manquant" -#: coff-a29k.c:212 +#: coff-a29k.c:212 coff-or32.c:229 msgid "Unrecognized reloc" msgstr "Relocalisation non reconnue" @@ -189,7 +189,7 @@ msgstr "IHCONST de relocalisation manquant" msgid "missing IHIHALF reloc" msgstr "IHIHALF de relocalisation manquant" -#: coff-alpha.c:881 coff-alpha.c:918 +#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432 msgid "GP relative relocation used when GP not defined" msgstr "Relocalisation relative GP utilisé alors que GP n'est pas défini" @@ -197,123 +197,119 @@ msgstr "Relocalisation relative GP utilisé alors que GP n'est pas défini" msgid "using multiple gp values" msgstr "utilisation de valeurs multiples gp" -#: coff-alpha.c:1989 coff-mips.c:1433 -msgid "GP relative relocation when GP not defined" -msgstr "GP relocalisation relative alors que GP n'est pas défini" - -#: coff-arm.c:1051 elf32-arm.h:285 +#: coff-arm.c:1066 elf32-arm.h:285 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "%s: incapable de repérer le REPÈRE de liant « %s » pour « %s »" -#: coff-arm.c:1080 elf32-arm.h:320 +#: coff-arm.c:1096 elf32-arm.h:320 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "%s: incapable de repérer le liant ARM « %s » pour « %s »" -#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 +#: coff-arm.c:1391 coff-arm.c:1486 elf32-arm.h:887 elf32-arm.h:991 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "%s(%s): AVERTISSEMENT: l'inter-réseautage n'est pas permis." -#: coff-arm.c:1379 elf32-arm.h:993 +#: coff-arm.c:1395 elf32-arm.h:994 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr " première occurrence: %s: appel arm de repérage" -#: coff-arm.c:1474 elf32-arm.h:889 +#: coff-arm.c:1490 elf32-arm.h:890 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr " première occurrence: %s: appel de repérage à ARM" -#: coff-arm.c:1477 +#: coff-arm.c:1493 msgid " consider relinking with --support-old-code enabled" msgstr " considérer de rafaire les liens avec --support-old-code enabled" -#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 +#: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3031 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "%s: mauvaise adresse de relocalisation 0x%lx dans la section « %s »" -#: coff-arm.c:2107 +#: coff-arm.c:2127 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "%s: symbole index illégal dans la relocalisation: %d" -#: coff-arm.c:2235 +#: coff-arm.c:2255 #, c-format -msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" -msgstr "%s: ERREUR: compilé pour APCS-%d alors que la cible %s utilise APCS-%d" +msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" +msgstr "Erreur: %s compilé pour APCS-%d alors que %s a été compilé pour APCS-%d" -#: coff-arm.c:2250 +#: coff-arm.c:2270 elf32-arm.h:2297 #, c-format -msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" -msgstr "%s: ERREUR: passage de valeurs en virgule flottante dans des registreen virgule flottance alors que la cible %s utilise des registres de valeursentières" +msgid "ERROR: %s passes floats in float registers, whereas %s passes them in integer registers" +msgstr "Erreur: %s passage de valeurs en virgule flottante dans les registres FP alors que %s les passe dans les registres entiers" -#: coff-arm.c:2253 +#: coff-arm.c:2273 elf32-arm.h:2302 #, c-format -msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" -msgstr "%s: ERREUR: passage de valeurs en virgule flottante dans des registreen valeur entière alors que la cible %s utilise des registres de valeursen virgule flottante" +msgid "ERROR: %s passes floats in integer registers, whereas %s passes them in float registers" +msgstr "Erreur: %s passage de valeurs en virgule flottante dans les registres entiers alors que %s les passe dans les registres FP" -#: coff-arm.c:2268 +#: coff-arm.c:2288 #, c-format -msgid "%s: ERROR: compiled as position independent code, whereas target %s is absolute position" -msgstr "%s: ERREUR: compilé en code indépendant de la position, alors que la cible %s esten position absolue" +msgid "ERROR: %s is compiled as position independent code, whereas target %s is absolute position" +msgstr "ERREUR: %s compilé avec du code à position indépendante alors que la cible %s est à position absolue" -#: coff-arm.c:2271 +#: coff-arm.c:2291 #, c-format -msgid "%s: ERROR: compiled as absolute position code, whereas target %s is position independent" -msgstr "%s: ERREUR: compilé en code à position abolsu, alors que la cible %s estindépendant de la position" +msgid "ERROR: %s is compiled as absolute position code, whereas target %s is position independent" +msgstr "ERREUR: %s compilé avec du code à position absolu alors que la cible %s est à position indépendante" -#: coff-arm.c:2300 +#: coff-arm.c:2320 elf32-arm.h:2358 #, c-format -msgid "Warning: input file %s supports interworking, whereas %s does not." -msgstr "AVERTISSEMENT: file d'entrée %s supporte l'inter-réseautage, contrairement à %s." +msgid "Warning: %s supports interworking, whereas %s does not" +msgstr "AVERTISSEMENT: %s supporte l'inter-réseautage, contrairement à %s." -#: coff-arm.c:2303 +#: coff-arm.c:2323 elf32-arm.h:2365 #, c-format -msgid "Warning: input file %s does not support interworking, whereas %s does." -msgstr "AVERTISSEMENT: fichier d'entrée %s ne supporte pas l'inter-réseautage, contrairement à %s." +msgid "Warning: %s does not support interworking, whereas %s does" +msgstr "AVERTISSEMENT: %s ne supporte pas l'inter-réseautage, contrairement à %s." -#: coff-arm.c:2330 +#: coff-arm.c:2350 #, c-format msgid "private flags = %x:" msgstr "fanions privés = %x" -#: coff-arm.c:2338 elf32-arm.h:2408 +#: coff-arm.c:2358 elf32-arm.h:2418 msgid " [floats passed in float registers]" msgstr " [valeurs en virgule flottante passées dans des registres de valeurs en virgule flottante]" -#: coff-arm.c:2340 +#: coff-arm.c:2360 msgid " [floats passed in integer registers]" msgstr " [valeurs en virgule flottante passées dans des registres de valeurs entières]" -#: coff-arm.c:2343 elf32-arm.h:2411 +#: coff-arm.c:2363 elf32-arm.h:2421 msgid " [position independent]" msgstr " [position indépendante]" -#: coff-arm.c:2345 +#: coff-arm.c:2365 msgid " [absolute position]" msgstr " [position absolue]" -#: coff-arm.c:2349 +#: coff-arm.c:2369 msgid " [interworking flag not initialised]" msgstr " [fanion d'inter-réseautage n'a pas été initialisé]" -#: coff-arm.c:2351 +#: coff-arm.c:2371 msgid " [interworking supported]" msgstr " [inter-réseautage supporté]" -#: coff-arm.c:2353 +#: coff-arm.c:2373 msgid " [interworking not supported]" msgstr " [inter-réseautage non supporté]" -#: coff-arm.c:2401 +#: coff-arm.c:2421 elf32-arm.h:2124 #, c-format -msgid "Warning: Not setting interworking flag of %s, since it has already been specified as non-interworking" -msgstr "AVERTISSEMENT: pas d'initialisation du fanion d'inter-réseautage %s, puisqu'il a déjà été spécifié comme sans inter-réseautage" +msgid "Warning: Not setting interworking flag of %s since it has already been specified as non-interworking" +msgstr "AVERTISSEMENT: pas d'initialisation du fanion d'inter-réseautage %s puisqu'il a déjà été spécifié sans inter-réseautage" -#: coff-arm.c:2405 +#: coff-arm.c:2425 elf32-arm.h:2128 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" msgstr "AVERTISSEMENT: mise à zéro du fanion d'inter-réseautage %s en raison d'une requête externe" @@ -322,35 +318,35 @@ msgstr "AVERTISSEMENT: mise à zéro du fanion d'inter-réseautage %s en raison d'u msgid "uncertain calling convention for non-COFF symbol" msgstr "convention d'appel incertaine pour un symbole non COFF" -#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2212 +#: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844 msgid "unsupported reloc type" msgstr "type de relocalisation non supporté" -#: coff-mips.c:875 elf32-mips.c:1987 elf64-mips.c:1739 +#: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609 msgid "GP relative relocation when _gp not defined" msgstr "relocalisation relative GP sans que _gp ne soit défini" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2468 +#: coff-mips.c:2466 msgid "reloc against unsupported section" msgstr "relocalisation vers une section non supportée" -#: coff-mips.c:2476 +#: coff-mips.c:2474 msgid "reloc not properly aligned" msgstr "relocalisation n'est pas alignée correctement" -#: coff-rs6000.c:2710 coff64-rs6000.c:1164 +#: coff-rs6000.c:2766 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "%s: type de relocalisation non supporté 0x%02x" -#: coff-rs6000.c:2756 coff64-rs6000.c:1210 +#: coff-rs6000.c:2859 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "%s: table des matières des relocalisation à 0x%x pour les symboles « %s » sans aucune entrée" -#: coff-rs6000.c:3006 coff64-rs6000.c:2060 +#: coff-rs6000.c:3590 coff64-rs6000.c:2091 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" msgstr "%s: symbole « %s » a une classe smclas non reconnue %d" @@ -360,7 +356,7 @@ msgstr "%s: symbole « %s » a une classe smclas non reconnue %d" msgid "Unrecognized reloc type 0x%x" msgstr "Type de relocalisation non reconnu 0x%x" -#: coff-tic54x.c:390 coffcode.h:4847 +#: coff-tic54x.c:390 coffcode.h:4974 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "%s: AVERTISSEMENT: symbole index illégal %ld dans les relocalisations" @@ -370,37 +366,37 @@ msgstr "%s: AVERTISSEMENT: symbole index illégal %ld dans les relocalisations" msgid "ignoring reloc %s\n" msgstr "relocalisation de %s ignorée\n" -#: coffcode.h:1081 +#: coffcode.h:1086 #, c-format msgid "%s (%s): Section flag %s (0x%x) ignored" msgstr "%s (%s): fanion de section %s (0x%x) ignoré" -#: coffcode.h:2125 +#: coffcode.h:2143 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" msgstr "cible TI COFF non reconnue identificateur '0x%x'" -#: coffcode.h:4236 +#: coffcode.h:4365 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "%s: AVERTISSEMENT: symbole d'index illégal %ld dans le numéro de ligne" -#: coffcode.h:4250 +#: coffcode.h:4379 #, c-format msgid "%s: warning: duplicate line number information for `%s'" msgstr "%s: AVERTISSEMENT: information de numéro de ligne dédoublée pour « %s »" -#: coffcode.h:4609 +#: coffcode.h:4736 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "%s: classe de stockage non reconnue %d pour %s symbole « %s »" -#: coffcode.h:4740 +#: coffcode.h:4867 #, c-format msgid "warning: %s: local symbol `%s' has no section" msgstr "AVERTISSEMENT: %s: symbole local « %s » n'a pas de section" -#: coffcode.h:4885 +#: coffcode.h:5012 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "%s: type de relocalisation illégal %d à l'adresse 0x%lx" @@ -410,97 +406,92 @@ msgstr "%s: type de relocalisation illégal %d à l'adresse 0x%lx" msgid "%s: bad string table size %lu" msgstr "%s: chaîne erronée de la taille de table %lu" -#: coffgen.c:2138 -#, c-format -msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" -msgstr "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld prochain %ld" - -#: cofflink.c:536 elflink.h:1967 +#: cofflink.c:534 elflink.h:1912 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "AVERTISSEMENT: type de symbole « %s » a changé de %d à %d dans %s" -#: cofflink.c:2317 +#: cofflink.c:2321 #, c-format msgid "%s: relocs in section `%s', but it has no contents" msgstr "%s: relocalisations dans la section « %s », mais n'a aucun contenu" -#: cofflink.c:2653 coffswap.h:889 +#: cofflink.c:2664 coffswap.h:877 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "%s: %s: débordement de relocalisation: 0x%lx > 0xffff" -#: cofflink.c:2662 coffswap.h:876 +#: cofflink.c:2673 coffswap.h:864 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "%s: AVERTISSEMENT: %s: débordement du compteur de numéro de ligne: 0x%lx > 0xffff" -#: dwarf2.c:381 +#: dwarf2.c:382 msgid "Dwarf Error: Can't find .debug_str section." msgstr "Erreur DWARF: ne peut repérer la section .debug_str" -#: dwarf2.c:398 +#: dwarf2.c:399 #, c-format -msgid "Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str size (%u)." -msgstr "Erreur DWARF: décalage DW_FORM_strp (%u) est > ou = à la taille de .debug_str (%u)." +msgid "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)." +msgstr "Erreur DWARF: décalage DW_FORM_strp (%lu) est >= à la taille de .debug_str (%lu)." -#: dwarf2.c:542 +#: dwarf2.c:543 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "Erreur DWARF: ne peut repérer la section .debug_abbrev" -#: dwarf2.c:559 +#: dwarf2.c:560 #, c-format -msgid "Dwarf Error: Abbrev offset (%u) greater than or equal to abbrev size (%u)." -msgstr "Erreur DWARF: décalage Abbrev (%u) est > ou = à la taille abbrev (%u)." +msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)." +msgstr "Erreur DWARF: décalage Abbrev (%lu) est >= à la taille .debug_abbrev (%lu)." -#: dwarf2.c:756 +#: dwarf2.c:757 #, c-format -msgid "Dwarf Error: Invalid or unhandled FORM value: %d." -msgstr "Erreur DWARF: valeur de FORME invalide ou mal traitée: %d" +msgid "Dwarf Error: Invalid or unhandled FORM value: %u." +msgstr "Erreur DWARF: valeur de FORME invalide ou mal traitée: %u" -#: dwarf2.c:843 +#: dwarf2.c:852 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "Erreur DWARF: numéro mutilé de ligne de section (mauvais no. de fichier)" -#: dwarf2.c:929 +#: dwarf2.c:938 msgid "Dwarf Error: Can't find .debug_line section." msgstr "Erreur DWARF: ne peut repérer la section .debug_line" -#: dwarf2.c:952 +#: dwarf2.c:961 #, c-format -msgid "Dwarf Error: Line offset (%u) greater than or equal to line size (%u)." -msgstr "Erreur DWARF: décalage de ligne (%u) est > ou = à la taille de ligne (%u)" +msgid "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)." +msgstr "Erreur DWARF: décalage de ligne (%lu) est >= à la taille de .debug_line (%lu)" -#: dwarf2.c:1143 +#: dwarf2.c:1159 msgid "Dwarf Error: mangled line number section." msgstr "Erreur DWARF: numéro mutilé de ligne de section" -#: dwarf2.c:1318 dwarf2.c:1532 +#: dwarf2.c:1355 dwarf2.c:1566 #, c-format -msgid "Dwarf Error: Could not find abbrev number %d." -msgstr "Erreur DWARF: ne peut repérer le numéro abrégé %d" +msgid "Dwarf Error: Could not find abbrev number %u." +msgstr "Erreur DWARF: ne peut repérer le numéro abrégé %u" -#: dwarf2.c:1493 +#: dwarf2.c:1527 #, c-format -msgid "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 information." -msgstr "Erreur DWARF: version DWARF retrouvée « %hu », ce lecteur ne supporte que les informations de la version 2." +msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2 information." +msgstr "Erreur DWARF: version DWARF retrouvée « %u », ce lecteur ne supporte que les informations de la version 2." -#: dwarf2.c:1500 +#: dwarf2.c:1534 #, c-format msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'." msgstr "Erreur DWARF: taille d'adresse obtenue « %u », ce lecteur ne peut traiter des tailles plus grandes que « %u »." -#: dwarf2.c:1523 +#: dwarf2.c:1557 #, c-format -msgid "Dwarf Error: Bad abbrev number: %d." -msgstr "Erreur DWARF: mauvais numéro abrégé: %d" +msgid "Dwarf Error: Bad abbrev number: %u." +msgstr "Erreur DWARF: mauvais numéro abrégé: %u" -#: ecoff.c:1328 +#: ecoff.c:1318 #, c-format msgid "Unknown basic type %d" msgstr "type de base inconnu %d" -#: ecoff.c:1597 +#: ecoff.c:1578 #, c-format msgid "" "\n" @@ -509,7 +500,7 @@ msgstr "" "\n" " Dernier+1 symbole: %ld" -#: ecoff.c:1604 ecoff.c:1607 +#: ecoff.c:1585 ecoff.c:1588 #, c-format msgid "" "\n" @@ -518,7 +509,7 @@ msgstr "" "\n" " Premier symbole: %ld" -#: ecoff.c:1619 +#: ecoff.c:1600 #, c-format msgid "" "\n" @@ -527,7 +518,7 @@ msgstr "" "\n" " Dernier+1 symbole: %-7ld Type: %s" -#: ecoff.c:1626 +#: ecoff.c:1607 #, c-format msgid "" "\n" @@ -536,7 +527,7 @@ msgstr "" "\n" " Symbole local: %ld" -#: ecoff.c:1634 +#: ecoff.c:1615 #, c-format msgid "" "\n" @@ -545,7 +536,7 @@ msgstr "" "\n" " struct; Symbole Fin+1: %ld" -#: ecoff.c:1639 +#: ecoff.c:1620 #, c-format msgid "" "\n" @@ -554,7 +545,7 @@ msgstr "" "\n" " union; Dernier+1 symbole: %ld" -#: ecoff.c:1644 +#: ecoff.c:1625 #, c-format msgid "" "\n" @@ -563,7 +554,7 @@ msgstr "" "\n" " enum; Dernier+1 symbol: %ld" -#: ecoff.c:1650 +#: ecoff.c:1631 #, c-format msgid "" "\n" @@ -572,43 +563,54 @@ msgstr "" "\n" " Type: %s" -#: elf-hppa.h:1366 elf-hppa.h:1399 elf32-ppc.c:3062 elf32-sh.c:3201 elf64-x86-64.c:1275 +#: elf-hppa.h:1476 elf-hppa.h:1509 elf32-ppc.c:3091 elf32-sh.c:4213 +#: elf64-sh64.c:1659 #, c-format msgid "%s: warning: unresolvable relocation against symbol `%s' from %s section" msgstr "%s: AVERTISSEMENT: relocalisation sans solution vers le symbole « %s » de la section %s" -#: elf-m10200.c:463 elf-m10300.c:673 elf32-arm.h:2074 elf32-avr.c:835 elf32-cris.c:1392 elf32-d10v.c:482 elf32-fr30.c:653 elf32-h8300.c:547 elf32-i860.c:1048 elf32-m32r.c:1281 elf32-openrisc.c:455 elf32-v850.c:1691 elf64-mmix.c:1164 +#: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2084 elf32-avr.c:833 +#: elf32-cris.c:1403 elf32-d10v.c:481 elf32-fr30.c:635 elf32-frv.c:809 +#: elf32-h8300.c:548 elf32-i860.c:1031 elf32-m32r.c:1278 elf32-openrisc.c:439 +#: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302 msgid "internal error: out of range error" msgstr "erreur interne: hors gamme" -#: elf-m10200.c:467 elf-m10300.c:677 elf32-arm.h:2078 elf32-avr.c:839 elf32-cris.c:1396 elf32-d10v.c:486 elf32-fr30.c:657 elf32-h8300.c:551 elf32-i860.c:1052 elf32-m32r.c:1285 elf32-mips.c:7565 elf32-openrisc.c:459 elf32-v850.c:1695 elf64-mips.c:4464 elf64-mmix.c:1168 +#: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2088 elf32-avr.c:837 +#: elf32-cris.c:1407 elf32-d10v.c:485 elf32-fr30.c:639 elf32-frv.c:813 +#: elf32-h8300.c:552 elf32-i860.c:1035 elf32-m32r.c:1282 elf32-openrisc.c:443 +#: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5264 msgid "internal error: unsupported relocation error" msgstr "erreur interne: erreur de relocalisation non supportée" -#: elf-m10200.c:471 elf-m10300.c:681 elf32-arm.h:2082 elf32-d10v.c:490 elf32-h8300.c:555 elf32-m32r.c:1289 +#: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2092 elf32-d10v.c:489 +#: elf32-h8300.c:556 elf32-m32r.c:1286 msgid "internal error: dangerous error" msgstr "erreur interne: erreur dangereuse" -#: elf-m10200.c:475 elf-m10300.c:685 elf32-arm.h:2086 elf32-avr.c:847 elf32-cris.c:1404 elf32-d10v.c:494 elf32-fr30.c:665 elf32-h8300.c:559 elf32-i860.c:1060 elf32-m32r.c:1293 elf32-openrisc.c:467 elf32-v850.c:1715 elf64-mmix.c:1176 +#: elf-m10200.c:458 elf-m10300.c:668 elf32-arm.h:2096 elf32-avr.c:845 +#: elf32-cris.c:1415 elf32-d10v.c:493 elf32-fr30.c:647 elf32-frv.c:821 +#: elf32-h8300.c:560 elf32-i860.c:1043 elf32-m32r.c:1290 elf32-openrisc.c:451 +#: elf32-v850.c:1715 elf32-xstormy16.c:945 elf64-mmix.c:1314 msgid "internal error: unknown error" msgstr "erreur interne: erreur inconnue" -#: elf.c:345 +#: elf.c:343 #, c-format msgid "%s: invalid string offset %u >= %lu for section `%s'" msgstr "%s: chaîne de décalage invalide %u >= %lu pour la section « %s »" -#: elf.c:450 +#: elf.c:589 #, c-format msgid "%s: invalid SHT_GROUP entry" msgstr "%s: entrée SHT_GROUP invalide" -#: elf.c:531 +#: elf.c:660 #, c-format msgid "%s: no group info for section %s" msgstr "%s: aucune info de groupe pour la section %s" -#: elf.c:842 +#: elf.c:1023 msgid "" "\n" "Program Header:\n" @@ -616,7 +618,7 @@ msgstr "" "\n" "En-tête de programme:\n" -#: elf.c:891 +#: elf.c:1073 msgid "" "\n" "Dynamic Section:\n" @@ -624,7 +626,7 @@ msgstr "" "\n" "Section dynamique:\n" -#: elf.c:1020 +#: elf.c:1202 msgid "" "\n" "Version definitions:\n" @@ -632,7 +634,7 @@ msgstr "" "\n" "Définitions des versions:\n" -#: elf.c:1043 +#: elf.c:1225 msgid "" "\n" "Version References:\n" @@ -640,221 +642,181 @@ msgstr "" "\n" "Références de version:\n" -#: elf.c:1048 +#: elf.c:1230 #, c-format msgid " required from %s:\n" msgstr " requis par %s:\n" -#: elf.c:1675 +#: elf.c:1902 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" msgstr "%s: lien invalide %lu pour la section de relocalisation %s (index %u)" -#: elf.c:3289 +#: elf.c:3603 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" msgstr "%s: pas suffisamment d'espace pour les en-têtes du programme (alloué %u, besoin de %u)" -#: elf.c:3393 +#: elf.c:3708 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" msgstr "%s: pas suffisamment d'espace pour les en-têtes du programme, essayer l'option -N" -#: elf.c:3518 +#: elf.c:3833 #, c-format msgid "Error: First section in segment (%s) starts at 0x%x whereas the segment starts at 0x%x" msgstr "Erreur: première section dans le segment (%s) débute à 0x%x alors que le segment débute à 0x%x" -#: elf.c:3804 +#: elf.c:4148 #, c-format msgid "%s: warning: allocated section `%s' not in segment" msgstr "%s: AVERTISSEMENT: section allouée « %s » n'est pas dans le segment" -#: elf.c:4138 +#: elf.c:4472 #, c-format msgid "%s: symbol `%s' required but not present" msgstr "%s: symbole « %s » requis mais absent" -#: elf.c:4147 -#, c-format -msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" -msgstr "elf_symbol_from_bfd_symbol 0x%.8lx, nom = %s, no. de symbole = %d, fanions = 0x%.8lx%s\n" - -#: elf.c:4391 +#: elf.c:4749 #, c-format -msgid "%s: warning: Empty loadable segment detected\n" -msgstr "%s: AVERTISSEMENT: segment chargeable vide détecté\n" +msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" +msgstr "%s: AVERTISSEMENT: segment chargeable vide détecté, est-ce intentionnel ?\n" -#: elf.c:5804 +#: elf.c:6193 #, c-format msgid "%s: unsupported relocation type %s" msgstr "%s: type de relocalisation non supporté %s" -#: elf32-arm.h:1224 +#: elf32-arm.h:1221 #, c-format msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "%s: AVERTISSEMENT: instruction Arm BLX vise la fonction Arm « %s »." -#: elf32-arm.h:1420 +#: elf32-arm.h:1417 #, c-format msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "%s: AVERTISSEMENT: instruction de repérage BLX vise la function de repérage « %s »." -#: elf32-arm.h:1904 elf32-i386.c:1776 elf32-sh.c:3133 +#: elf32-arm.h:1914 elf32-sh.c:4125 #, c-format msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" msgstr "%s(%s+0x%lx): %s relocation vers une section SEC_MERGE" -#: elf32-arm.h:1998 +#: elf32-arm.h:2008 #, c-format msgid "%s: warning: unresolvable relocation %d against symbol `%s' from %s section" msgstr "%s: AVERTISSEMENT: relocalisation sans solution %d vers le symbole « %s » de la section %s" -#: elf32-arm.h:2114 -#, c-format -msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" -msgstr "AVERTISSEMENT: pas d'initialisation du fanion d'inter-réseautage %s alors qu'il a déjè été spécifié sans inter-réseautage" - -#: elf32-arm.h:2118 -#, c-format -msgid "Warning: Clearing the interwork flag of %s due to outside request" -msgstr "AVERTISSEMENT: mise à zéro du fanion d'inter-réseautage %s en raison d'une requête externe" - -#: elf32-arm.h:2166 -#, c-format -msgid "Warning: Clearing the interwork flag in %s because non-interworking code in %s has been linked with it" -msgstr "AVERTISSEMENT: mise à zéro du fanion d'inter-réseautage %s en raison du code sans inter-réseautage dans %s qui a été lié avec lui" - -#: elf32-arm.h:2261 -#, c-format -msgid "Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" -msgstr "Erreur: %s compilé pour une version EABI %d, alors que %s a été compilé pour la version %d" - -#: elf32-arm.h:2275 -#, c-format -msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" -msgstr "Erreur: %s compilé pour APCS-%d, alors que %s a été compilé pour APCS-%d" - -#: elf32-arm.h:2287 +#: elf32-arm.h:2176 #, c-format -msgid "Error: %s passes floats in FP registers, whereas %s passes them in integer registers" -msgstr "Erreur: %s passage de valeurs en virgule flottante dans les registres FP, alors que %s les passe dans les registres entiers" +msgid "Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it" +msgstr "AVERTISSEMENT: mise à zéro du fanion d'inter-réseautage %s en raison du code sans inter-réseautage dans %s lié avec lui" -#: elf32-arm.h:2292 +#: elf32-arm.h:2271 #, c-format -msgid "Error: %s passes floats in integer registers, whereas %s passes them in FP registers" -msgstr "Erreur: %s passage de valeurs en virgule flottante dans les registres entiers, alors que %s les passe dans les registres FP" +msgid "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d" +msgstr "ERREUR: %s compilé pour une version EABI %d alors que %s a été compilé pour la version %d" -#: elf32-arm.h:2303 +#: elf32-arm.h:2285 #, c-format -msgid "Error: %s uses VFP instructions, whereas %s FPA instructions" -msgstr "Erreur: %s utilise les instructions VFP, alors que %s utilise les instructions FPA" +msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" +msgstr "ERREUR: %s compilé pour APCS-%d alors que la cible %s utilise APCS-%d" -#: elf32-arm.h:2308 +#: elf32-arm.h:2313 #, c-format -msgid "Error: %s uses FPA instructions, whereas %s VFP instructions" -msgstr "Erreur: %s utilise les instructions FPA, alors que %s utilise les instructions VFP" +msgid "ERROR: %s uses VFP instructions, whereas %s uses FPA instructions" +msgstr "ERREUR: %s utilise les instructions VFP alors que %s utilise les instructions FPA" -#: elf32-arm.h:2328 +#: elf32-arm.h:2318 #, c-format -msgid "Error: %s uses software FP, whereas %s uses hardware FP" -msgstr "Erreur: %s utilise le logiciel pour virgule flottante, alors que %s utilise le matériel pour virgule flottante" +msgid "ERROR: %s uses FPA instructions, whereas %s uses VFP instructions" +msgstr "ERREUR: %s utilise les instructions FPA alors que %s utilise les instructions VFP" -#: elf32-arm.h:2333 +#: elf32-arm.h:2338 #, c-format -msgid "Error: %s uses hardware FP, whereas %s uses software FP" -msgstr "Erreur: %s utilise le matériel pour virgule flottante, alors que %s utilise le logiciel pour virgule flottante" +msgid "ERROR: %s uses software FP, whereas %s uses hardware FP" +msgstr "ERREUR: %s utilise le logiciel pour virgule flottante alors que %s utilise le matériel pour virgule flottante" -#: elf32-arm.h:2348 +#: elf32-arm.h:2343 #, c-format -msgid "Warning: %s supports interworking, whereas %s does not" -msgstr "AVERTISSEMENT: %s supporte l'inter-réseautage, contrairement à %s." - -#: elf32-arm.h:2355 -#, c-format -msgid "Warning: %s does not support interworking, whereas %s does" -msgstr "AVERTISSEMENT: %s ne supporte pas l'inter-réseautage, contrairement à %s." +msgid "ERROR: %s uses hardware FP, whereas %s uses software FP" +msgstr "ERREUR: %s utilise le matériel pour virgule flottante alors que %s utilise le logiciel pour virgule flottante" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2386 elf32-cris.c:2970 elf32-m68k.c:410 elf32-mips.c:3232 +#: elf32-arm.h:2396 elf32-cris.c:2988 elf32-m68k.c:410 elf32-vax.c:543 +#: elfxx-mips.c:7756 #, c-format msgid "private flags = %lx:" msgstr "fanions privés = %lx" -#: elf32-arm.h:2395 +#: elf32-arm.h:2405 msgid " [interworking enabled]" msgstr " [inter-réseautage autorisé]" -#: elf32-arm.h:2398 -msgid " [APCS-26]" -msgstr " [APCS-26]" - -#: elf32-arm.h:2400 -msgid " [APCS-32]" -msgstr " [APCS-32]" - -#: elf32-arm.h:2403 +#: elf32-arm.h:2413 msgid " [VFP float format]" msgstr " [format flottant VFP]" -#: elf32-arm.h:2405 +#: elf32-arm.h:2415 msgid " [FPA float format]" msgstr " [format flottant FPA]" -#: elf32-arm.h:2414 +#: elf32-arm.h:2424 msgid " [new ABI]" msgstr " [nouvel ABI]" -#: elf32-arm.h:2417 +#: elf32-arm.h:2427 msgid " [old ABI]" msgstr " [ancien ABI]" -#: elf32-arm.h:2420 +#: elf32-arm.h:2430 msgid " [software FP]" msgstr " [virgule flottante logiciel]" -#: elf32-arm.h:2428 +#: elf32-arm.h:2438 msgid " [Version1 EABI]" msgstr " [Version 1 EABI]" -#: elf32-arm.h:2431 elf32-arm.h:2442 +#: elf32-arm.h:2441 elf32-arm.h:2452 msgid " [sorted symbol table]" msgstr " [table des symboles triés]" -#: elf32-arm.h:2433 elf32-arm.h:2444 +#: elf32-arm.h:2443 elf32-arm.h:2454 msgid " [unsorted symbol table]" msgstr " [table des symboles non triés]" -#: elf32-arm.h:2439 +#: elf32-arm.h:2449 msgid " [Version2 EABI]" msgstr " [Version2 EABI]" -#: elf32-arm.h:2447 +#: elf32-arm.h:2457 msgid " [dynamic symbols use segment index]" msgstr " [symboles dynamiques utilisent un index de segment]" -#: elf32-arm.h:2450 +#: elf32-arm.h:2460 msgid " [mapping symbols precede others]" msgstr " [mapping de symboles précèdes les autres]" -#: elf32-arm.h:2457 +#: elf32-arm.h:2467 msgid " <EABI version unrecognised>" msgstr " <Version EABI non reconnue>" -#: elf32-arm.h:2464 +#: elf32-arm.h:2474 msgid " [relocatable executable]" msgstr " [exécutables relocalisés]" -#: elf32-arm.h:2467 +#: elf32-arm.h:2477 msgid " [has entry point]" msgstr " [a des points d'entrées]" -#: elf32-arm.h:2472 +#: elf32-arm.h:2482 msgid "<Unrecognised flag bits set>" msgstr "<Bits de fanions non reconnus>" -#: elf32-avr.c:843 elf32-cris.c:1400 elf32-fr30.c:661 elf32-i860.c:1056 elf32-openrisc.c:463 elf32-v850.c:1699 elf64-mmix.c:1172 +#: elf32-avr.c:841 elf32-cris.c:1411 elf32-fr30.c:643 elf32-frv.c:817 +#: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699 +#: elf32-xstormy16.c:941 elf64-mmix.c:1310 msgid "internal error: dangerous relocation" msgstr "erreur interne: relocalisation dangereuse" @@ -868,31 +830,36 @@ msgstr "%s: relocalisation %s sans solution vers le symbole « %s » à partir de l msgid "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" msgstr "%s: pas de relocalisation %s PLT ni GOT vers le symbole « %s » à partir de la section %s" -#: elf32-cris.c:1015 elf32-cris.c:1142 +#: elf32-cris.c:1015 elf32-cris.c:1141 msgid "[whose name is lost]" msgstr "[où le nom est perdu]" -#: elf32-cris.c:1131 +#: elf32-cris.c:1130 #, c-format msgid "%s: relocation %s with non-zero addend %d against local symbol from %s section" msgstr "%s: relocalisation %s sans zéro ajoute %d vers le symbole local à partir de la section %s" -#: elf32-cris.c:1138 +#: elf32-cris.c:1137 #, c-format msgid "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" msgstr "%s: relocalisation %s sans zéro ajoute %d vers le symbole « %s » à partir de la section %s" -#: elf32-cris.c:1156 +#: elf32-cris.c:1155 #, c-format msgid "%s: relocation %s is not allowed for global symbol: `%s' from %s section" msgstr "%s: relocalisation %s n'est pas permise pour le symbole global: « %s » de la section %s." -#: elf32-cris.c:1275 +#: elf32-cris.c:1170 +#, c-format +msgid "%s: relocation %s in section %s with no GOT created" +msgstr "%s: relocalisation %s dans la section %s mais aucun GOT créé" + +#: elf32-cris.c:1288 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" msgstr "%s: inconsistence interne; pas de section de relocalisation %s" -#: elf32-cris.c:2508 +#: elf32-cris.c:2514 #, c-format msgid "" "%s, section %s:\n" @@ -901,90 +868,123 @@ msgstr "" "%s, section %s:\n" " relocalisation %s devrait être utilisée dans un objet partagé; recompiler avec -fPIC" -#: elf32-cris.c:2973 +#: elf32-cris.c:2991 msgid " [symbols have a _ prefix]" msgstr " [symboles sont préfixés par « _ »]" -#: elf32-cris.c:3012 +#: elf32-cris.c:3030 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" msgstr "%s: utilise _-prefixed symbols, mais avec écriture au fichier avec des symboles sans préfixes" -#: elf32-cris.c:3013 +#: elf32-cris.c:3031 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" msgstr "%s: utilise des symboles sans préfixes, mais avec écriture au fichier avec des symboles ayant des préfixes_-prefixed" +#: elf32-frv.c:1217 +#, c-format +msgid "%s: compiled with %s and linked with modules that use non-pic relocations" +msgstr "%s: compilé avec %s et lié avec les modules qui utilisent de la relocalisation non PIC" + +#: elf32-frv.c:1267 +#, c-format +msgid "%s: compiled with %s and linked with modules compiled with %s" +msgstr "%s: compilé avec %s et lié avec les modules compilés avec %s" + +#: elf32-frv.c:1279 +#, c-format +msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%s: utilise différents champs e_flags (0x%lx) que les modules précédents (0x%lx)" + +#: elf32-frv.c:1315 +#, c-format +msgid "private flags = 0x%lx:" +msgstr "fanions privés = 0x%lx:" + #: elf32-gen.c:82 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" msgstr "%s: relocalisation en format ELF générique (EM: %d)" -#: elf32-hppa.c:646 +#: elf32-hppa.c:671 elf64-ppc.c:2323 #, c-format msgid "%s: cannot create stub entry %s" msgstr "%s: ne peut créer l'entrée du talon %s" -#: elf32-hppa.c:937 elf32-hppa.c:3540 +#: elf32-hppa.c:956 elf32-hppa.c:3555 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "%s(%s+0x%lx): ne peut atteindre %s, recompiler avec -ffunction-sections" -#: elf32-hppa.c:1312 +#: elf32-hppa.c:1338 elf64-x86-64.c:673 #, c-format msgid "%s: relocation %s can not be used when making a shared object; recompile with -fPIC" msgstr "%s: relocalisation de %s ne peut être utilisée lors de la création d'un objet partagé; recompiler avec -fPIC" -#: elf32-hppa.c:1332 +#: elf32-hppa.c:1358 #, c-format msgid "%s: relocation %s should not be used when making a shared object; recompile with -fPIC" msgstr "%s: relocalisation %s ne doit pas être utilisée lors de la création d'un objet partagé; recompiler avec -fPIC" -#: elf32-hppa.c:1525 +#: elf32-hppa.c:1551 #, c-format msgid "Could not find relocation section for %s" msgstr "Ne peut repérer la section de relocalisation pour %s" -#: elf32-hppa.c:2862 +#: elf32-hppa.c:2855 #, c-format msgid "%s: duplicate export stub %s" msgstr "%s: talon d'exportation en double %s" -#: elf32-hppa.c:3424 +#: elf32-hppa.c:3433 #, c-format msgid "%s(%s+0x%lx): fixing %s" msgstr "%s(%s+0x%lx): corrigeant %s" -#: elf32-hppa.c:4064 +#: elf32-hppa.c:4080 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" msgstr "%s(%s+0x%lx): ne traiter %s pour %s" -#: elf32-hppa.c:4403 +#: elf32-hppa.c:4393 msgid ".got section not immediately after .plt section" msgstr "section .got pas immédiatement après la section .plt" -#: elf32-i386.c:298 +#: elf32-i386.c:379 #, c-format msgid "%s: invalid relocation type %d" msgstr "%s: type de relocalisation invalide %d" -#: elf32-i386.c:718 elf32-s390.c:636 elf64-s390.c:595 +#: elf32-i386.c:876 elf32-s390.c:649 elf64-s390.c:595 elf64-x86-64.c:591 #, c-format msgid "%s: bad symbol index: %d" msgstr "%s: symbole index erroné: %d" -#: elf32-i386.c:863 elf32-s390.c:790 elf64-ppc.c:2085 elf64-s390.c:759 +#: elf32-i386.c:948 +#, c-format +msgid "%s: `%s' accessed both as normal and thread local symbol" +msgstr "%s: « %s » symbole local accéder à la fois comme normal et avec thread" + +#: elf32-i386.c:1072 elf32-s390.c:808 elf64-ppc.c:2827 elf64-s390.c:759 +#: elf64-x86-64.c:761 #, c-format msgid "%s: bad relocation section name `%s'" msgstr "%s: nom de section de relocalisation erroné « %s »" -#: elf32-i386.c:2067 elf32-s390.c:1949 elf64-ppc.c:3908 elf64-s390.c:1953 +#: elf32-i386.c:1159 elf64-alpha.c:4768 +#, c-format +msgid "%s: TLS local exec code cannot be linked into shared objects" +msgstr "%s: code exécutable local TLS ne peut être lié en objets partagés" + +#: elf32-i386.c:2747 elf32-s390.c:1981 elf32-sparc.c:1571 elf64-ppc.c:5918 +#: elf64-s390.c:1945 elf64-sparc.c:2578 elf64-x86-64.c:1948 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" msgstr "%s(%s+0x%lx): relocalisation sans solution vers le symbole « %s »" -#: elf32-i386.c:2105 elf32-s390.c:1987 elf64-s390.c:1991 +#: elf32-i386.c:2784 elf32-s390.c:2019 elf64-ppc.c:5977 elf64-s390.c:1983 +#: elf64-x86-64.c:1986 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" msgstr "%s(%s+0x%lx): relocalisation vers « %s »: erreur %d" @@ -993,31 +993,32 @@ msgstr "%s(%s+0x%lx): relocalisation vers « %s »: erreur %d" msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "relocalisation SDA alors que _SDA_BASE_ n'est pas définie" -#: elf32-ia64.c:3538 elf32-m32r.c:1008 elf32-ppc.c:2930 elf64-ia64.c:3538 +#: elf32-ia64.c:3687 elf32-m32r.c:1013 elf32-ppc.c:2987 elf64-alpha.c:4185 +#: elf64-alpha.c:4313 elf64-ia64.c:3687 #, c-format msgid "%s: unknown relocation type %d" msgstr "%s: type de relocalisation inconnu %d" -#: elf32-m32r.c:1224 +#: elf32-m32r.c:1221 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" msgstr "%s: la cible (%s) de la relocalisation %s est dans la mauvaise section (%s)" -#: elf32-m32r.c:2001 +#: elf32-m32r.c:1947 #, c-format msgid "%s: Instruction set mismatch with previous modules" msgstr "%s: jeu d'instructions ne concorde par avec les modules précédents" -#: elf32-m32r.c:2024 +#: elf32-m32r.c:1970 #, c-format msgid "private flags = %lx" msgstr "fanions privés = %lx" -#: elf32-m32r.c:2029 +#: elf32-m32r.c:1975 msgid ": m32r instructions" msgstr ": instructions m32r" -#: elf32-m32r.c:2030 +#: elf32-m32r.c:1976 msgid ": m32rx instructions" msgstr ": instruction m32rx" @@ -1025,246 +1026,177 @@ msgstr ": instruction m32rx" msgid " [cpu32]" msgstr " [cpu32]" -#: elf32-mcore.c:353 elf32-mcore.c:479 +#: elf32-m68k.c:416 +msgid " [m68000]" +msgstr " [m68000]" + +#: elf32-mcore.c:354 elf32-mcore.c:457 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "%s: relocalisation %s (%d) n'est pas couramment supportée.\n" -#: elf32-mcore.c:438 +#: elf32-mcore.c:442 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "%s: type de relocalisation inconnue %d\n" -#: elf32-mips.c:2146 elf64-mips.c:1972 +#: elf32-mips.c:1152 elf64-mips.c:1783 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "relocalisation relative gp 32bits est survenue pour un symbole externe" -#: elf32-mips.c:2295 +#: elf32-mips.c:1301 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "Édition de liens d'objets mips16 dans le format %s n'est pas supporté" -#: elf32-mips.c:3119 -#, c-format -msgid "%s: linking PIC files with non-PIC files" -msgstr "%s: édition de liens des fichiers PIC avec des fichiers non PIC" - -#: elf32-mips.c:3129 -#, c-format -msgid "%s: linking abicalls files with non-abicalls files" -msgstr "%s: édition de liens des fichier abicalls avec des fichiers non abicalls" - -#: elf32-mips.c:3158 -#, c-format -msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" -msgstr "%s: ISA ne concorde pas (-mips%d) avec les modules précédents (-mips%d)" - -#: elf32-mips.c:3167 -#, c-format -msgid "%s: ISA mismatch (%d) with previous modules (%d)" -msgstr "%s: ISA ne concorde pas (%d) avec les modules précédents (%d)" - -#: elf32-mips.c:3190 -#, c-format -msgid "%s: ABI mismatch: linking %s module with previous %s modules" -msgstr "%s: ABI ne concorde pas: édition de lien du module %s avec les modules précédents %s" - -#: elf32-mips.c:3204 elf32-ppc.c:1470 elf64-ppc.c:1538 elf64-sparc.c:3033 -#, c-format -msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" -msgstr "%s: utilise differents champs e_flags (0x%lx) que les modules précédents (0x%lx)" - -#: elf32-mips.c:3235 -msgid " [abi=O32]" -msgstr " [abi=O32]" - -#: elf32-mips.c:3237 -msgid " [abi=O64]" -msgstr " [abi=O64]" - -#: elf32-mips.c:3239 -msgid " [abi=EABI32]" -msgstr " [abi=EABI32]" - -#: elf32-mips.c:3241 -msgid " [abi=EABI64]" -msgstr " [abi=EABI64]" - -#: elf32-mips.c:3243 -msgid " [abi unknown]" -msgstr " [abi inconnu]" - -#: elf32-mips.c:3245 -msgid " [abi=N32]" -msgstr " [abi=N32]" - -#: elf32-mips.c:3247 -msgid " [abi=64]" -msgstr " [abi=64]" - -#: elf32-mips.c:3249 -msgid " [no abi set]" -msgstr " [aucun jeu abi]" - -#: elf32-mips.c:3252 -msgid " [mips1]" -msgstr " [mips1]" - -#: elf32-mips.c:3254 -msgid " [mips2]" -msgstr " [mips2]" - -#: elf32-mips.c:3256 -msgid " [mips3]" -msgstr " [mips3]" - -#: elf32-mips.c:3258 -msgid " [mips4]" -msgstr " [mips4]" - -#: elf32-mips.c:3260 -msgid " [mips5]" -msgstr " [mips5]" - -#: elf32-mips.c:3262 -msgid " [mips32]" -msgstr " [mips32]" - -#: elf32-mips.c:3264 -msgid " [mips64]" -msgstr " [mips64]" - -#: elf32-mips.c:3266 -msgid " [unknown ISA]" -msgstr " [ISA inconnu]" - -#: elf32-mips.c:3269 -msgid " [32bitmode]" -msgstr " [mode 32 bits]" - -#: elf32-mips.c:3271 -msgid " [not 32bitmode]" -msgstr " [aucun mode 32 bits]" - -#: elf32-mips.c:4947 -msgid "static procedure (no name)" -msgstr "procédure statique (sans name)" - -#: elf32-mips.c:5565 elf64-mips.c:6694 -#, c-format -msgid "%s: illegal section name `%s'" -msgstr "%s: nom illégal de section « %s »" - -#: elf32-mips.c:6132 elf64-mips.c:3150 -msgid "not enough GOT space for local GOT entries" -msgstr "pas suffisamment d'espace GOT pour les entrées locales GOT" - -#: elf32-mips.c:7238 elf64-mips.c:4203 -#, c-format -msgid "%s: %s+0x%lx: jump to stub routine which is not jal" -msgstr "%s: %s+0x%lx: saut vers la routine dans la partie du talon (stub) qui n'est pas jal" - -#: elf32-mips.c:8237 elf64-mips.c:5891 -#, c-format -msgid "%s: Malformed reloc detected for section %s" -msgstr "%s: relocalisation mal composée détectée dans la section %s" - -#: elf32-mips.c:8315 elf64-mips.c:5969 -#, c-format -msgid "%s: CALL16 reloc at 0x%lx not against global symbol" -msgstr "%s: appel CALL16 de relocalisation à 0x%lx qui n'est pas pourun symbole global" - -#: elf32-ppc.c:1436 elf64-ppc.c:1503 +#: elf32-ppc.c:1460 #, c-format msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" msgstr "%s: compilé avec -mrelocatable et fait l'édition de lien avec les modules compilés normalement" -#: elf32-ppc.c:1444 elf64-ppc.c:1511 +#: elf32-ppc.c:1468 #, c-format msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" msgstr "%s: compilé normalement et fait l'édition de lien avec les modules compilés avec -mrelocatable" -#: elf32-ppc.c:1568 +#: elf32-ppc.c:1494 elf64-sparc.c:2989 elfxx-mips.c:7713 +#, c-format +msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%s: utilise differents champs e_flags (0x%lx) que les modules précédents (0x%lx)" + +#: elf32-ppc.c:1592 #, c-format msgid "%s: Unknown special linker type %d" msgstr "%s: type d'édition spécial de lien inconnu %d" -#: elf32-ppc.c:2218 elf32-ppc.c:2252 elf32-ppc.c:2287 +#: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" msgstr "%s: relocalisation %s ne peut être utilisée lors de la création d'un objet partagé" -#: elf32-ppc.c:3097 elf64-ppc.c:3500 +#: elf32-ppc.c:3126 elf64-ppc.c:5473 #, c-format msgid "%s: unknown relocation type %d for symbol %s" msgstr "%s: type de relocalisation inconnue %d pour le symbole %s" -#: elf32-ppc.c:3452 elf32-ppc.c:3473 elf32-ppc.c:3523 +#: elf32-ppc.c:3482 elf32-ppc.c:3503 elf32-ppc.c:3553 #, c-format msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "%s: la cible (%s) d'une relocalisation %s est dans la mauvaise section de sortie (%s)" -#: elf32-ppc.c:3589 +#: elf32-ppc.c:3619 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." msgstr "%s: relocalisation %s n'est pas encore supporté pour le symbole %s." -#: elf32-sh.c:1101 +#: elf32-sh.c:1964 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES offset" msgstr "%s: 0x%lx: AVERTISSEMENT: mauvais décalage pour R_SH_USES" -#: elf32-sh.c:1113 +#: elf32-sh.c:1976 #, c-format msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "%s: 0x%lx: AVERTISSEMENT: R_SH_USES pointe vers un insn inconnu 0x%x " -#: elf32-sh.c:1130 +#: elf32-sh.c:1993 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" msgstr "%s: 0x%lx: AVERTISSEMENT: mauvais décalage de chargement R_SH_USES" -#: elf32-sh.c:1145 +#: elf32-sh.c:2008 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" msgstr "%s: 0x%lx: AVERTISSEMENT: ne peut repérer la relocalisation attendue" -#: elf32-sh.c:1202 +#: elf32-sh.c:2036 #, c-format msgid "%s: 0x%lx: warning: symbol in unexpected section" msgstr "%s: 0x%lx: AVERTISSEMENT: symbole dans une section inattendue" -#: elf32-sh.c:1323 +#: elf32-sh.c:2153 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" msgstr "%s: 0x%lx: AVERTISSEMENT: ne peut repérer le compteur de relocalisation attendu" -#: elf32-sh.c:1332 +#: elf32-sh.c:2162 #, c-format msgid "%s: 0x%lx: warning: bad count" msgstr "%s: 0x%lx: AVERTISSEMENT: mauvais décompte" -#: elf32-sh.c:1741 elf32-sh.c:2132 +#: elf32-sh.c:2550 elf32-sh.c:2926 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" msgstr "%s: 0x%lx: erreur fatale: débordement de relocalisation lors de relâches" -#: elf32-sh.c:3267 +#: elf32-sh.c:4073 elf64-sh64.c:1576 +msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +msgstr "STO_SH5_ISA32 inattendu sur le symbole local n'est pas traité" + +#: elf32-sh.c:4284 #, c-format msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" msgstr "%s: 0x%lx: fatal: cible de branchement non aligné pour une relocalisatin de type relax-support" -#: elf32-sparc.c:1554 elf64-sparc.c:2286 +#: elf32-sh64.c:203 elf64-sh64.c:2364 +#, c-format +msgid "%s: compiled as 32-bit object and %s is 64-bit" +msgstr "%s: compilé comme un objet de 32 bits et %s est de 64 bits" + +#: elf32-sh64.c:206 elf64-sh64.c:2367 +#, c-format +msgid "%s: compiled as 64-bit object and %s is 32-bit" +msgstr "%s: compilé comme un objet de 64 bits et %s est de 32 bits" + +#: elf32-sh64.c:208 elf64-sh64.c:2369 +#, c-format +msgid "%s: object size does not match that of target %s" +msgstr "%s: taille de l'objet ne concorde pas avec la taille de la cible %s" + +#: elf32-sh64.c:440 elf64-sh64.c:2941 +#, c-format +msgid "%s: encountered datalabel symbol in input" +msgstr "%s: rencontre du symbole d'une étiquette de donnée dans l'entrée" + +#: elf32-sh64.c:523 +msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" +msgstr "Non concordance PTB: adresse SHmedia (bit 0 == 1)" + +#: elf32-sh64.c:526 +msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" +msgstr "Non concordance PTA: adresse SHcompact (bit 0 == 0)" + +#: elf32-sh64.c:544 +#, c-format +msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" +msgstr "%s: ERREUR GAS: insn PTB inattendue avec R_SH_PT_16" + +#: elf32-sh64.c:593 elf64-sh64.c:1703 +#, c-format +msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" +msgstr "%s: ERREUR: relocalisation non alignée type %d à %08x relocalisé`%08x\n" + +#: elf32-sh64.c:677 +#, c-format +msgid "%s: could not write out added .cranges entries" +msgstr "%s: ne peut écrire en sortie des entrées .cranges" + +#: elf32-sh64.c:739 +#, c-format +msgid "%s: could not write out sorted .cranges entries" +msgstr "%s: ne peut écrire en sortie des entrées .cranges" + +#: elf32-sparc.c:1535 elf64-sparc.c:2224 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "%s: probablement compilé sans -fPIC?" -#: elf32-sparc.c:2007 +#: elf32-sparc.c:2002 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "%s: compilé pour un système à 64 bits et la cible est de 32 bits" -#: elf32-sparc.c:2021 +#: elf32-sparc.c:2016 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "" @@ -1312,220 +1244,498 @@ msgstr "ne peut repérer le symbole spécial d'édition de lien __ep" msgid "could not locate special linker symbol __ctbp" msgstr "ne peut repérer le symbole spécial d'édition de lien __ctbp" -#: elf32-v850.c:1877 +#: elf32-v850.c:1875 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "%s: l'architecture ne concorde pas avec les modules précédents" -#: elf32-v850.c:1897 +#: elf32-v850.c:1895 #, c-format msgid "private flags = %lx: " msgstr "fanions privés = %lx" -#: elf32-v850.c:1902 +#: elf32-v850.c:1900 msgid "v850 architecture" msgstr "architecture v850" -#: elf32-v850.c:1903 +#: elf32-v850.c:1901 msgid "v850e architecture" msgstr "architecture v850e" -#: elf32-v850.c:1904 +#: elf32-v850.c:1902 msgid "v850ea architecture" msgstr "architecture v850ea" -#: elf64-alpha.c:858 +#: elf32-vax.c:546 +msgid " [nonpic]" +msgstr " [nonpic]" + +#: elf32-vax.c:549 +msgid " [d-float]" +msgstr " [d-float]" + +#: elf32-vax.c:552 +msgid " [g-float]" +msgstr " [g-float]" + +#: elf32-vax.c:674 +#, c-format +msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld" +msgstr "%s: AVERTISSEMENT: GOT ajouté de %ld vers « %s » ne concorde par avec le GOT ajouté de %ld" + +#: elf32-vax.c:1679 +#, c-format +msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" +msgstr "%s: AVERTISSEMENT: PLT ajouté de %d vers « %s » de la section %s ignoré" + +#: elf32-vax.c:1814 +#, c-format +msgid "%s: warning: %s relocation against symbol `%s' from %s section" +msgstr "%s: AVERTISSEMENT: relocalisation %s vers le symbole « %s » de la section %s" + +#: elf32-vax.c:1820 +#, c-format +msgid "%s: warning: %s relocation to 0x%x from %s section" +msgstr "%s: AVERTISSEMENT: relocalisation %s vers 0x%x de la section %s" + +#: elf32-ia64.c:2280 elf32-xstormy16.c:414 elf64-ia64.c:2280 +msgid "non-zero addend in @fptr reloc" +msgstr "ajout non null dans la relocalisation @fptr" + +#: elf64-alpha.c:1097 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "la relocalisation GPDISP n'a pas repéré les instructions ldah et lda" -#: elf64-alpha.c:2934 +#: elf64-alpha.c:3675 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "%s: le sous-segment .got excède 64K (taille %d)" -#: elf64-alpha.c:3518 elf64-alpha.c:3530 +#: elf64-alpha.c:4498 elf64-alpha.c:4510 #, c-format msgid "%s: gp-relative relocation against dynamic symbol %s" msgstr "%s: relocalisation relative gp vers le symbole dynamique %s" -#: elf64-hppa.c:2070 +#: elf64-alpha.c:4536 elf64-alpha.c:4676 +#, c-format +msgid "%s: pc-relative relocation against dynamic symbol %s" +msgstr "%s: relocalisation relative au PC vers le symbole dynamique %s" + +#: elf64-alpha.c:4564 +#, c-format +msgid "%s: change in gp: BRSGP %s" +msgstr "%s: changé dans le GP: BRSGP %s" + +#: elf64-alpha.c:4589 +msgid "<unknown>" +msgstr "<inconnu>" + +#: elf64-alpha.c:4594 +#, c-format +msgid "%s: !samegp reloc against symbol without .prologue: %s" +msgstr "%s: relocalisation !samegp vers le symbole sans .prologue: %s" + +#: elf64-alpha.c:4639 +#, c-format +msgid "%s: unhandled dynamic relocation against %s" +msgstr "%s: relocalisation dynamique non traitée vers %s" + +#: elf64-alpha.c:4752 +#, c-format +msgid "%s: dtp-relative relocation against dynamic symbol %s" +msgstr "%s: relocalisation relative dtp vers le symbole dynamique %s" + +#: elf64-alpha.c:4775 +#, c-format +msgid "%s: tp-relative relocation against dynamic symbol %s" +msgstr "%s: relocalisation relative tp vers le symbole dynamique %s" + +#: elf64-hppa.c:2080 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "entrée du talon pour %s ne peut charger .plt, décalage dp = %ld" -#: elf64-mmix.c:1268 +#: elf64-mmix.c:1002 +#, c-format +msgid "" +"%s: Internal inconsistency error for value for\n" +" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n" +msgstr "" +"%s: erreur d'inconsistence interne pour la valeur du registre global\n" +" alloué à l'édition de lien: lié: 0x%lx%08lx != relâché: 0x%lx%08lx\n" + +#: elf64-mmix.c:1386 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s" +msgstr "%s: relocalisation base plus décalage vers le symbole registre: (inconnu) dans %s" + +#: elf64-mmix.c:1391 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: %s in %s" +msgstr "%s: relocalisation base plus décalage vers le symbole registre: %s dans %s" + +#: elf64-mmix.c:1435 +#, c-format +msgid "%s: register relocation against non-register symbol: (unknown) in %s" +msgstr "%s: relocalisation de registre vers le symbole non-registre: (inconnu) dans %s" + +#: elf64-mmix.c:1440 #, c-format msgid "%s: register relocation against non-register symbol: %s in %s" msgstr "%s: relocalisation de registre vers le symbole non-registre: %s dans %s" -#: elf64-mmix.c:1270 -msgid "(unknown)" -msgstr "(inconnu)" - -#: elf64-mmix.c:1305 +#: elf64-mmix.c:1477 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" msgstr "%s: directive LOCAL valide seulement avec un registre ou une valeur absolue" -#: elf64-mmix.c:1333 +#: elf64-mmix.c:1505 #, c-format msgid "%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld." msgstr "%s: directive LOCAL: registre $%ld n'est pas un registre local. Premier registre global est $%ld." -#: elf64-mmix.c:1609 +#: elf64-mmix.c:1965 #, c-format msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n" msgstr "%s: erreur: multiple définitions de « %s »; début de %s est initialisé dans un précédent fichier lié\n" -#: elf64-mmix.c:1668 +#: elf64-mmix.c:2024 msgid "Register section has contents\n" msgstr "Registre de section contient\n" -#: elf64-ppc.c:1466 libbfd.c:1436 +#: elf64-mmix.c:2186 +#, c-format +msgid "" +"Internal inconsistency: remaining %u != max %u.\n" +" Please report this bug." +msgstr "" +"Inconsistence interne: reste %u != max %u.\n" +" SVP rapporter cette anomalie." + +#: elf64-ppc.c:1669 libbfd.c:1435 #, c-format msgid "%s: compiled for a big endian system and target is little endian" msgstr "" "%s: compilé pour un système à octets de poids fort alors que la cible\n" "est un système à octets de poids faible" -#: elf64-ppc.c:1468 libbfd.c:1438 +#: elf64-ppc.c:1671 libbfd.c:1437 #, c-format msgid "%s: compiled for a little endian system and target is big endian" msgstr "" "%s: compilé pour un système à octets de poids faible alors que la cible\n" "est un système à octets de poids fort" -#: elf64-ppc.c:3166 +#: elf64-ppc.c:3610 +#, c-format +msgid "%s: unexpected reloc type %u in .opd section" +msgstr "%s: type inattendu de relocalisation %u dans la section .opd" + +#: elf64-ppc.c:3630 +#, c-format +msgid "%s: .opd is not a regular array of opd entries" +msgstr "%s: .opd n'est pas un tableau régulier d'entrées opd" + +#: elf64-ppc.c:3672 +#, c-format +msgid "%s: undefined sym `%s' in .opd section" +msgstr "%s: symbole « %s » indéfini dans la section .opd" + +#: elf64-ppc.c:4397 +#, c-format +msgid "can't find branch stub `%s'" +msgstr "ne peut repérer le talon de branchement « %s »" + +#: elf64-ppc.c:4436 elf64-ppc.c:4501 +#, c-format +msgid "linkage table error against `%s'" +msgstr "erreur de liaison de la table de liaison vers « %s »" + +#: elf64-ppc.c:4573 #, c-format -msgid "linkage table overflow against `%s'" -msgstr "débordement de la table de liaison vers « %s »" +msgid "can't build branch stub `%s'" +msgstr "ne peut construire un talon de branchement « %s »" -#: elf64-ppc.c:3244 -msgid "stub section size doesn't match calculated size" -msgstr "taille de la section du talon ne concorde pas avec la taille calculée" +#: elf64-ppc.c:5179 +msgid "stubs don't match calculated size" +msgstr "taille des talons ne concorde pas avec la taille calculée" -#: elf64-ppc.c:3845 +#: elf64-ppc.c:5828 #, c-format msgid "%s: Relocation %s is not supported for symbol %s." msgstr "%s: relocalisation %s n'est pas supportée pour le symbole %s." -#: elf64-ppc.c:3889 +#: elf64-ppc.c:5872 #, c-format msgid "%s: error: relocation %s not a multiple of 4" msgstr "%s: erreur: relocalisation %s n'est pas un multiple de 4" -#: elf64-sparc.c:1277 +#: elf64-sparc.c:1280 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" msgstr "%s: check_relocs: type de relocalisation non traitée %d" -#: elf64-sparc.c:1314 +#: elf64-sparc.c:1317 #, c-format msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "%s: seuls les registres %%g[2367] peuvent être déclarés en utilisant les registres STT_REGISTER" -#: elf64-sparc.c:1334 +#: elf64-sparc.c:1337 #, c-format -msgid "Register %%g%d used incompatibly: %s in %s" -msgstr "Registre %%g%d utilisé de manière incompatible: %s dans %s" +msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" +msgstr "Registre %%g%d utilisé de manière incompatible: %s dans %s précédemment %s dans %s" -#: elf64-sparc.c:1338 elf64-sparc.c:1362 elf64-sparc.c:1411 +#: elf64-sparc.c:1360 #, c-format -msgid " previously %s in %s" -msgstr " précédemment %s dans %s" +msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" +msgstr "Symbole « %s » a des types qui diffèrent: REGISTRE dans %s, précédemment %s dans %s" -#: elf64-sparc.c:1359 elf64-sparc.c:1408 +#: elf64-sparc.c:1406 #, c-format -msgid "Symbol `%s' has differing types: %s in %s" -msgstr "Symbole « %s » a des types qui diffèrent: %s dans %s" +msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" +msgstr "Symbole « %s » a des types qui diffèrent: %s dans %s, précédemment REGISTRE dans %s" -#: elf64-sparc.c:3014 +#: elf64-sparc.c:2970 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "%s: édition de liens spécifiques pour UltraSPARC avec du code spécifique HAL" -#: elfcode.h:1218 +#: elfcode.h:1198 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "%s: compteur de version (%ld) ne concorde pas avec le symbole du compteur (%ld)" -#: elflink.c:434 +#: elflink.c:440 #, c-format msgid "%s: Section %s is too large to add hole of %ld bytes" msgstr "%s: section %s est trop grande pour ajouter un trou de %ld octets" -#: elflink.h:1113 +#: elflink.h:1090 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" msgstr "%s: AVERTISSEMENT: redéfinition inattendue de « %s »" -#: elflink.h:1784 +#: elflink.h:1727 #, c-format msgid "%s: %s: invalid version %u (max %d)" msgstr "%s: %s: version invalide %u (max %d)" -#: elflink.h:1825 +#: elflink.h:1768 #, c-format msgid "%s: %s: invalid needed version %d" msgstr "%s: %s: version requise invalide %d" -#: elflink.h:1945 +#: elflink.h:1890 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" msgstr "AVERTISSEMENT: taille du symbole « %s » a changé de %lu à %lu dans %s" -#: elflink.h:4020 +#: elflink.h:3174 +#, c-format +msgid "%s: .preinit_array section is not allowed in DSO" +msgstr "%s: section .preinit_array n'est pas permise dans DSO" + +#: elflink.h:4030 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "AVERTISSEMENT: type et taille du symbole dynamique « %s » ne sont pas définis" -#: elflink.h:4329 +#: elflink.h:4345 #, c-format msgid "%s: undefined versioned symbol name %s" msgstr "%s: nom symbole avec version indéfinie %s" -#: elflink.h:4559 elflink.h:4567 elflink.h:6218 elflink.h:7295 +#: elflink.h:4611 elflink.h:4619 elflink.h:6508 elflink.h:7600 msgid "Error: out of memory" msgstr "Erreur: mémoire épuisée" -#: elflink.h:4729 +#: elflink.h:4781 msgid "Not enough memory to sort relocations" msgstr "Pas assez de mémoire pour effectuer le trie des relocalisations" -#: elflink.h:5995 +#: elflink.h:5682 elflink.h:5725 +#, c-format +msgid "%s: could not find output section %s" +msgstr "%s: ne peut repérer la section de sortie %s" + +#: elflink.h:5688 +#, c-format +msgid "warning: %s section has zero size" +msgstr "AVERTISSEMENT: section %s a une taille nulle" + +#: elflink.h:6275 #, c-format msgid "%s: could not find output section %s for input section %s" msgstr "%s: ne peut repérer la section de sortie %s pour la section d'entrée %s" -#: elflink.h:6568 +#: elflink.h:6486 +#, c-format +msgid "%s: relocation size mismatch in %s section %s" +msgstr "%s: taille de la relocalisation ne concorde pas dans %s section %s" + +#: elflink.h:6849 msgid "warning: relocation against removed section; zeroing" msgstr "AVERTISSEMENT: relocalisation vers une section qui a été enlevée; mise à zéro" -#: elflink.h:6598 +#: elflink.h:6879 msgid "warning: relocation against removed section" msgstr "AVERTISSEMENT: relocalisation vers une section enlevée" -#: elflink.h:6611 +#: elflink.h:6892 #, c-format msgid "local symbols in discarded section %s" msgstr "symboles locaux de la section mise à l'écart %s" -#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 +#: elfxx-mips.c:734 +msgid "static procedure (no name)" +msgstr "procédure statique (sans name)" + +#: elfxx-mips.c:1601 +msgid "not enough GOT space for local GOT entries" +msgstr "pas suffisamment d'espace GOT pour les entrées locales GOT" + +#: elfxx-mips.c:2750 +#, c-format +msgid "%s: %s+0x%lx: jump to stub routine which is not jal" +msgstr "%s: %s+0x%lx: saut vers la routine dans la partie du talon (stub) qui n'est pas jal" + +#: elfxx-mips.c:4270 +#, c-format +msgid "%s: Malformed reloc detected for section %s" +msgstr "%s: relocalisation mal composée détectée dans la section %s" + +#: elfxx-mips.c:4348 +#, c-format +msgid "%s: CALL16 reloc at 0x%lx not against global symbol" +msgstr "%s: appel CALL16 de relocalisation à 0x%lx qui n'est pas pourun symbole global" + +#: elfxx-mips.c:7301 +#, c-format +msgid "%s: illegal section name `%s'" +msgstr "%s: nom illégal de section « %s »" + +#: elfxx-mips.c:7615 +#, c-format +msgid "%s: linking PIC files with non-PIC files" +msgstr "%s: édition de liens des fichiers PIC avec des fichiers non PIC" + +#: elfxx-mips.c:7625 +#, c-format +msgid "%s: linking abicalls files with non-abicalls files" +msgstr "%s: édition de liens des fichier abicalls avec des fichiers non abicalls" + +#: elfxx-mips.c:7654 +#, c-format +msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" +msgstr "%s: ISA ne concorde pas (-mips%d) avec les modules précédents (-mips%d)" + +#: elfxx-mips.c:7676 +#, c-format +msgid "%s: ISA mismatch (%d) with previous modules (%d)" +msgstr "%s: ISA ne concorde pas (%d) avec les modules précédents (%d)" + +#: elfxx-mips.c:7699 +#, c-format +msgid "%s: ABI mismatch: linking %s module with previous %s modules" +msgstr "%s: ABI ne concorde pas: édition de lien du module %s avec les modules précédents %s" + +#: elfxx-mips.c:7759 +msgid " [abi=O32]" +msgstr " [abi=O32]" + +#: elfxx-mips.c:7761 +msgid " [abi=O64]" +msgstr " [abi=O64]" + +#: elfxx-mips.c:7763 +msgid " [abi=EABI32]" +msgstr " [abi=EABI32]" + +#: elfxx-mips.c:7765 +msgid " [abi=EABI64]" +msgstr " [abi=EABI64]" + +#: elfxx-mips.c:7767 +msgid " [abi unknown]" +msgstr " [abi inconnu]" + +#: elfxx-mips.c:7769 +msgid " [abi=N32]" +msgstr " [abi=N32]" + +#: elfxx-mips.c:7771 +msgid " [abi=64]" +msgstr " [abi=64]" + +#: elfxx-mips.c:7773 +msgid " [no abi set]" +msgstr " [aucun jeu abi]" + +#: elfxx-mips.c:7776 +msgid " [mips1]" +msgstr " [mips1]" + +#: elfxx-mips.c:7778 +msgid " [mips2]" +msgstr " [mips2]" + +#: elfxx-mips.c:7780 +msgid " [mips3]" +msgstr " [mips3]" + +#: elfxx-mips.c:7782 +msgid " [mips4]" +msgstr " [mips4]" + +#: elfxx-mips.c:7784 +msgid " [mips5]" +msgstr " [mips5]" + +#: elfxx-mips.c:7786 +msgid " [mips32]" +msgstr " [mips32]" + +#: elfxx-mips.c:7788 +msgid " [mips64]" +msgstr " [mips64]" + +#: elfxx-mips.c:7790 +msgid " [unknown ISA]" +msgstr " [ISA inconnu]" + +#: elfxx-mips.c:7793 +msgid " [mdmx]" +msgstr " [mdmx]" + +#: elfxx-mips.c:7796 +msgid " [mips16]" +msgstr " [mips16]" + +#: elfxx-mips.c:7799 +msgid " [32bitmode]" +msgstr " [mode 32 bits]" + +#: elfxx-mips.c:7801 +msgid " [not 32bitmode]" +msgstr " [aucun mode 32 bits]" + +#: i386linux.c:458 m68klinux.c:462 sparclinux.c:459 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "La sortie requiert une ilbrairie partagée « %s »\n" -#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 +#: i386linux.c:466 m68klinux.c:470 sparclinux.c:467 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "Le fichier de sortie requiert une librairie partagée « %s.so.%s »\n" -#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 sparclinux.c:655 sparclinux.c:705 +#: i386linux.c:655 i386linux.c:705 m68klinux.c:662 m68klinux.c:710 +#: sparclinux.c:657 sparclinux.c:707 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "Symbole %s n'est pas défini pour les corrections\n" -#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 +#: i386linux.c:729 m68klinux.c:734 sparclinux.c:731 msgid "Warning: fixup count mismatch\n" msgstr "AVERTISSEMENT: correction du compteur qui ne concordait pas\n" @@ -1541,7 +1751,7 @@ msgstr "%s: symbole non reconnue « %s » fanions 0x%x" #: ieee.c:877 #, c-format -msgid "%s: unimplemented ATI record %u for symbol %u" +msgid "%s: unimplemented ATI record %u for symbol %u" msgstr "%s: enregistrement ATI non implanté %u pour le symbole %u" #: ieee.c:902 @@ -1559,49 +1769,49 @@ msgstr "%s: type inattendu après ATN" msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" msgstr "%s:%d: caractères inattendue « %s » dans le fichier Intel hexadécimal\n" -#: ihex.c:368 +#: ihex.c:366 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "%s:%u: somme de contrôle erronée dans le fichier Intel hexadécimal (attendu %u, obtenu %u)" -#: ihex.c:422 +#: ihex.c:420 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" msgstr "%s:%u: longueur erronée de l'enregistrement d'adresse étendue dans le fichier Intel hexadécimal" -#: ihex.c:439 +#: ihex.c:437 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" msgstr "%s:%u: longueur erronée d'adresse étendue de début dans le fichier Intel hexadécimal" -#: ihex.c:456 +#: ihex.c:454 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" msgstr "%s:%u: longueur erronée de l'enregistrement d'adresse étendue linéaire dans le fichier Intel hexadécimal" -#: ihex.c:473 +#: ihex.c:471 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" msgstr "%s:%u: longueur erronée d'adresse étendue linéraire de début dans le fichier Intel hexadécimal" -#: ihex.c:490 +#: ihex.c:488 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" msgstr "%s:%u: type ihex non reconnu %u dans le fichier Intel hexadécimal\n" -#: ihex.c:610 +#: ihex.c:607 #, c-format msgid "%s: internal error in ihex_read_section" msgstr "%s: erreur interne dans ihex_read_section" -#: ihex.c:645 +#: ihex.c:642 #, c-format msgid "%s: bad section length in ihex_read_section" msgstr "%s: longuer erronée de section dans ihex_read_section" -#: ihex.c:863 +#: ihex.c:860 #, c-format -msgid "%s: address 0x%s out of range for Intex Hex file" +msgid "%s: address 0x%s out of range for Intel Hex file" msgstr "%s: adresse 0x%s hors gamme pour le fichier Intel hexadécimal" #: libbfd.c:492 @@ -1613,27 +1823,27 @@ msgstr "pas de table de projection: données=%lx adresse de la table=%d\n" msgid "not mapping: env var not set\n" msgstr "pas de table de projection: variable d'environnement pas initialisée\n" -#: libbfd.c:1463 +#: libbfd.c:1466 #, c-format -msgid "Deprecated %s called" -msgstr "%s appel déprécié" +msgid "Deprecated %s called at %s line %d in %s\n" +msgstr "%s déprécié appelé à %s dans la ligne %d dans %s\n" -#: libbfd.c:1465 +#: libbfd.c:1469 #, c-format -msgid " at %s line %d in %s\n" -msgstr " à %s ligne %d dans %s\n" +msgid "Deprecated %s called\n" +msgstr "%s appel déprécié\n" -#: linker.c:1849 +#: linker.c:1873 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" msgstr "%s: symbole indirect « %s » vers « %s » est une boucle" -#: linker.c:2745 +#: linker.c:2776 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" msgstr "Tentative de relocalisation d'un lien avec %s à l'entrée et %s à la sortie" -#: merge.c:897 +#: merge.c:892 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" msgstr "%s: accès au-delà de la fin de la section fusionnée (%ld + %ld)" @@ -1643,127 +1853,127 @@ msgstr "%s: accès au-delà de la fin de la section fusionnée (%ld + %ld)" msgid "%s: No core to allocate section name %s\n" msgstr "%s: pas de corps pour allouer un nom de section %s\n" -#: mmo.c:537 +#: mmo.c:536 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "%s: pas de corps pour allouer un symbole %d octets de longueur\n" -#: mmo.c:1190 +#: mmo.c:1245 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" msgstr "%s: fichier mmo invalide: valeur d'initialisation pour $255 n'est pas « Main »\n" -#: mmo.c:1336 +#: mmo.c:1391 #, c-format msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n" msgstr "%s: séquence de caractères large 0x%02X 0x%02X non supportée après le nom de symbole débutant avec « %s »\n" -#: mmo.c:1571 +#: mmo.c:1633 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "%s: fichier mmo invalide: lopcode non supporté « %d »\n" -#: mmo.c:1581 +#: mmo.c:1643 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" msgstr "%s: fichier mmo invalide: attendu YZ = 1 obtenu YZ = %d pour lop_quote\n" -#: mmo.c:1617 +#: mmo.c:1679 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "%s: fichier mmo invalide: attendu z = 1 ou z = 2, obtenu z = %d pour lop_loc\n" -#: mmo.c:1663 +#: mmo.c:1725 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" msgstr "%s: fichier mmo invalide: attendu z = 1 ou z = 2, obtenu z = %d pour lop_fixo\n" -#: mmo.c:1702 +#: mmo.c:1764 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" msgstr "%s: fichier mmo invalide: attendu y = 0, obtenu y = %d pour lop_fixrx\n" -#: mmo.c:1711 +#: mmo.c:1773 #, c-format msgid "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "%s: fichier mmo invalide: attendu z = 16 ou z = 24, obtenu z = %d pour lop_fixrx\n" -#: mmo.c:1734 +#: mmo.c:1796 #, c-format msgid "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n" msgstr "%s: fichier mmo invalide: octet de tête du mot de l'opérande doit être 0 ou 1, obtenu %d pour lop_fixrx\n" -#: mmo.c:1757 +#: mmo.c:1819 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" msgstr "%s: ne allouer un nom de ficheir pour le no. de fichier %d, %d octets\n" -#: mmo.c:1777 +#: mmo.c:1839 #, c-format msgid "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" msgstr "%s: fichier mmo invalide: no. de fichier %d « %s », a déjà été entré comme « %s »\n" -#: mmo.c:1790 +#: mmo.c:1852 #, c-format msgid "%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "%s: fichier mmo invalide: nom de fichier %d n'a pas été spécifié avant son utilisation\n" -#: mmo.c:1896 +#: mmo.c:1958 #, c-format msgid "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "%s: fichier mmo invalide: champs y et z de lop_stab non null, y: %d, z: %d\n" -#: mmo.c:1932 +#: mmo.c:1994 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" msgstr "%s: fichier mmo invalide: lop_end N,est pas le dernier item dans le fichier\n" -#: mmo.c:1945 +#: mmo.c:2007 #, c-format msgid "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras to the preceding lop_stab (%ld)\n" msgstr "%s: fichier mmo invalide: YZ de lop_end (%ld) n'est pas égal au nombre de teras du lop_stab précédent (%ld)\n" -#: mmo.c:2610 +#: mmo.c:2670 #, c-format msgid "%s: invalid symbol table: duplicate symbol `%s'\n" msgstr "%s: table de symboles invalides: duplication du symbole « %s »\n" -#: mmo.c:2898 +#: mmo.c:2921 #, c-format msgid "%s: Bad symbol definition: `Main' set to %s rather than the start address %s\n" msgstr "%s: définition de symbole erronée: « Main » initialisé à %s au lieu de l'adresse de départ %s\n" -#: mmo.c:2932 +#: mmo.c:3011 #, c-format msgid "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: %d. Only `Main' will be emitted.\n" msgstr "%s: avertissement: table de symboles trop grande pour mmo, plus grande que 65535 mots de 32 bits: %d. Seul « Main » sera produit.\n" -#: mmo.c:2977 +#: mmo.c:3056 #, c-format msgid "%s: internal error, symbol table changed size from %d to %d words\n" msgstr "%s: erreur interne, table de symbole a changé de taille de %d à %d mots\n" -#: mmo.c:3032 +#: mmo.c:3111 #, c-format msgid "%s: internal error, internal register section %s had contents\n" msgstr "%s: erreur interne, registre interne de section %s a du contenu\n" -#: mmo.c:3084 +#: mmo.c:3163 #, c-format msgid "%s: no initialized registers; section length 0\n" msgstr "%s: pas de registres initialisés; section de longeur 0\n" -#: mmo.c:3090 +#: mmo.c:3169 #, c-format msgid "%s: too many initialized registers; section length %ld\n" msgstr "%s: trop de resigstres initialisés; longueur de section %ld\n" -#: mmo.c:3095 +#: mmo.c:3174 #, c-format msgid "%s: invalid start address for initialized registers of length %ld: 0x%lx%08lx\n" msgstr "%s: adresse de départ invalide pour des registres initialisés de longueur %ld: 0x%lx%08lx\n" -#: oasys.c:1036 +#: oasys.c:1029 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "%s: ne peut représenter la section « %s » dans oasis" @@ -1886,7 +2096,7 @@ msgstr "Secteur de la partition[%d] = 0x%.8lx (%ld)\n" msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "Longueur de la partition[%d] = 0x%.8lx (%ld)\n" -#: som.c:5402 +#: som.c:5398 msgid "som_sizeof_headers unimplemented" msgstr "som_sizeof_headers non implanté" @@ -1895,7 +2105,12 @@ msgstr "som_sizeof_headers non implanté" msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "%s:%d: caractère inattendue « %s » dans le fichier S-record\n" -#: syms.c:996 +#: stabs.c:319 +#, c-format +msgid "%s(%s+0x%lx): Stabs entry has invalid string index." +msgstr "%s(%s+0x%lx): entrée des talons a une chaîne index invalide" + +#: syms.c:1044 msgid "Unsupported .stab relocation" msgstr "Relocalisation du .stab non supporté" @@ -1914,7 +2129,7 @@ msgstr "bfd_set_section_flags (%s, %x) a échoué" msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "Taille de section ne concorde pas %s=%lx, %s=%lx" -#: vms-gsd.c:704 +#: vms-gsd.c:702 #, c-format msgid "unknown gsd/egsd subtype %d" msgstr "sous type gsd/egsd inconnu %d" @@ -1950,421 +2165,334 @@ msgstr "Symbole %s remplacé par %s\n" msgid "failed to enter %s" msgstr "échec d'insertion de %s" -#: vms-tir.c:78 +#: vms-tir.c:81 msgid "No Mem !" msgstr "Mémoire épuisée!" -#: vms-tir.c:313 -msgid "Bad section index in ETIR_S_C_STA_PQ" -msgstr "Index de section erronée dans ETIR_S_C_STA_PQ" - -#: vms-tir.c:328 +#: vms-tir.c:362 #, c-format -msgid "Unsupported STA cmd %d" -msgstr "Commande STA non supportée %d" +msgid "bad section index in %s" +msgstr "index de section erronée dans %s" -#: vms-tir.c:333 vms-tir.c:1301 +#: vms-tir.c:375 #, c-format -msgid "Reserved STA cmd %d" -msgstr "Commande STA réservée %d" +msgid "unsupported STA cmd %s" +msgstr "commande STA non supportée %s" -#: vms-tir.c:443 +#: vms-tir.c:380 vms-tir.c:1240 #, c-format -msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" -msgstr "ETIR_S_C_STO_GBL: pas de symbole « %s »" +msgid "reserved STA cmd %d" +msgstr "commande STA réservée %d" -#: vms-tir.c:465 +#: vms-tir.c:491 vms-tir.c:514 #, c-format -msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" -msgstr "ETIR_S_C_STO_CA: pas de symbole « %s »" - -#: vms-tir.c:478 -msgid "ETIR_S_C_STO_RB/AB: Not supported" -msgstr "ETIR_S_C_STO_RB/AB: non supporté" +msgid "%s: no symbol \"%s\"" +msgstr "%s: pas de symbole \"%s\"" -#: vms-tir.c:538 -msgid "ETIR_S_C_STO_LP_PSB: Not supported" -msgstr "ETIR_S_C_STO_LP_PSB: non supporté" - -#: vms-tir.c:544 -msgid "ETIR_S_C_STO_HINT_GBL: not implemented" -msgstr "ETIR_S_C_STO_HINT_GBL: pas implanté" - -#: vms-tir.c:550 -msgid "ETIR_S_C_STO_HINT_PS: not implemented" -msgstr "ETIR_S_C_STO_HINT_PS: pas implanté" - -#: vms-tir.c:554 vms-tir.c:1473 +#. unsigned shift +#. rotate +#. Redefine symbol to current location. +#. Define a literal. +#: vms-tir.c:581 vms-tir.c:693 vms-tir.c:803 vms-tir.c:821 vms-tir.c:829 +#: vms-tir.c:838 vms-tir.c:1563 #, c-format -msgid "Reserved STO cmd %d" -msgstr "Commande STO réservée %d" - -#: vms-tir.c:667 -msgid "ETIR_S_C_OPR_INSV: Not supported" -msgstr "ETIR_S_C_OPR_INSV: non supporté" - -#: vms-tir.c:685 -msgid "ETIR_S_C_OPR_USH: Not supported" -msgstr "ETIR_S_C_OPR_USH: non supporté" - -#: vms-tir.c:691 -msgid "ETIR_S_C_OPR_ROT: Not supported" -msgstr "ETIR_S_C_OPR_ROT: non supporté" - -#: vms-tir.c:710 -msgid "ETIR_S_C_OPR_REDEF: Not supported" -msgstr "ETIR_S_C_OPR_REDEF: non supporté" - -#: vms-tir.c:716 -msgid "ETIR_S_C_OPR_DFLIT: Not supported" -msgstr "ETIR_S_C_OPR_DFLIT: non supporté" +msgid "%s: not supported" +msgstr "%s: pas supporté" -#: vms-tir.c:720 vms-tir.c:1668 +#: vms-tir.c:586 vms-tir.c:1418 #, c-format -msgid "Reserved OPR cmd %d" -msgstr "Commande OPR réservée %d" +msgid "%s: not implemented" +msgstr "%s: non implanté" -#: vms-tir.c:788 vms-tir.c:1737 +#: vms-tir.c:590 vms-tir.c:1422 #, c-format -msgid "Reserved CTL cmd %d" -msgstr "Commande CTL réservée %d" +msgid "reserved STO cmd %d" +msgstr "commande STO réservée %d" -#: vms-tir.c:816 -msgid "ETIR_S_C_STC_LP: not supported" -msgstr "ETIR_S_C_STC_LP: non supporté" - -#: vms-tir.c:834 -msgid "ETIR_S_C_STC_GBL: not supported" -msgstr "ETIR_S_C_STC_GBL: non supporté" - -#: vms-tir.c:842 -msgid "ETIR_S_C_STC_GCA: not supported" -msgstr "ETIR_S_C_STC_GCA: non supporté" +#: vms-tir.c:708 vms-tir.c:1568 +#, c-format +msgid "reserved OPR cmd %d" +msgstr "commande OPR réservée %d" -#: vms-tir.c:851 -msgid "ETIR_S_C_STC_PS: not supported" -msgstr "ETIR_S_C_STC_PS: non supporté" +#: vms-tir.c:776 vms-tir.c:1632 +#, c-format +msgid "reserved CTL cmd %d" +msgstr "commande CTL réservée %d" -#. -#. * stack byte from image -#. * arg: - -#. * -#. -#: vms-tir.c:1199 -msgid "Stack-from-image not implemented" -msgstr "Stack-from-image non implanté" +#. stack byte from image +#. arg: none. +#: vms-tir.c:1148 +msgid "stack-from-image not implemented" +msgstr "pile depuis l'image non implanté" -#: vms-tir.c:1219 -msgid "Stack-entry-mask not fully implemented" -msgstr "Stack-entry-mask pas complètement implanté" +#: vms-tir.c:1166 +msgid "stack-entry-mask not fully implemented" +msgstr "masque de pile d'entrée pas complètement implanté" +#. compare procedure argument +#. arg: cs symbol name +#. by argument index +#. da argument descriptor #. -#. * compare procedure argument -#. * arg: cs symbol name -#. * by argument index -#. * da argument descriptor -#. * -#. * compare argument descriptor with symbol argument (ARG$V_PASSMECH) -#. * and stack TRUE (args match) or FALSE (args dont match) value -#. -#: vms-tir.c:1235 +#. compare argument descriptor with symbol argument (ARG$V_PASSMECH) +#. and stack TRUE (args match) or FALSE (args dont match) value. +#: vms-tir.c:1180 msgid "PASSMECH not fully implemented" msgstr "PASSMECH pas complètement implanté" -#: vms-tir.c:1256 -msgid "Stack-local-symbol not fully implemented" -msgstr "Stack-local-symbol pas complètement implanté" +#: vms-tir.c:1199 +msgid "stack-local-symbol not fully implemented" +msgstr "symbole local de pile pas complètement implanté" -#: vms-tir.c:1271 -msgid "Stack-literal not fully implemented" -msgstr "Stack-literal pas complètement implanté" +#: vms-tir.c:1212 +msgid "stack-literal not fully implemented" +msgstr "litéral de pile pas complètement implanté" -#: vms-tir.c:1294 -msgid "Stack-local-symbol-entry-point-mask not fully implemented" -msgstr "Stack-local-symbol-entry-point-mask pas complètement implanté" +#: vms-tir.c:1233 +msgid "stack-local-symbol-entry-point-mask not fully implemented" +msgstr "masque du symbole local de point d'entrée de pile pas complètement implanté" -#: vms-tir.c:1469 +#: vms-tir.c:1510 vms-tir.c:1522 vms-tir.c:1534 vms-tir.c:1546 vms-tir.c:1611 +#: vms-tir.c:1619 vms-tir.c:1627 #, c-format -msgid "Unimplemented STO cmd %d" -msgstr "Commande STO non implantée %d" - -#: vms-tir.c:1608 -msgid "TIR_S_C_OPR_ASH incomplete" -msgstr "TIR_S_C_OPR_ASH incomplète" - -#: vms-tir.c:1622 -msgid "TIR_S_C_OPR_USH incomplete" -msgstr "TIR_S_C_OPR_USH incomplète" - -#: vms-tir.c:1636 -msgid "TIR_S_C_OPR_ROT incomplete" -msgstr "TIR_S_C_OPR_ROT incomplète" - -#. -#. * redefine symbol to current location -#. -#: vms-tir.c:1657 -msgid "TIR_S_C_OPR_REDEF not supported" -msgstr "TIR_S_C_OPR_REDEF non supporté" +msgid "%s: not fully implemented" +msgstr "%s: pas complètement implanté" -#. -#. * define a literal -#. -#: vms-tir.c:1664 -msgid "TIR_S_C_OPR_DFLIT not supported" -msgstr "TIR_S_C_OPR_DFLIT non supporté" - -#: vms-tir.c:1718 -msgid "TIR_S_C_CTL_DFLOC not fully implemented" -msgstr "TIR_S_C_CTL_DFLOC pas complètement implanté" - -#: vms-tir.c:1726 -msgid "TIR_S_C_CTL_STLOC not fully implemented" -msgstr "TIR_S_C_CTL_STLOC pas complètement implanté" - -#: vms-tir.c:1734 -msgid "TIR_S_C_CTL_STKDL not fully implemented" -msgstr "TIR_S_C_CTL_STKDL n'est pas complètement implanté" - -#: vms-tir.c:1791 +#: vms-tir.c:1684 #, c-format -msgid "Obj code %d not found" -msgstr "Code objet %d non repéré" +msgid "obj code %d not found" +msgstr "code objet %d non repéré" -#: vms-tir.c:2137 +#: vms-tir.c:2019 #, c-format msgid "SEC_RELOC with no relocs in section %s" msgstr "SEC_RELOC sans relocalisation dans la section %s" -#: vms-tir.c:2424 +#: vms-tir.c:2307 #, c-format msgid "Unhandled relocation %s" msgstr "Relocalisation non traitée: %s" -#: xcofflink.c:1241 +#: xcofflink.c:1243 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "%s: « %s » contient des numéros de lignes mais de section de fermeture" -#: xcofflink.c:1294 +#: xcofflink.c:1296 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "%s: classe %d symbole « %s » n'a pas d'entrée auxiliaire" -#: xcofflink.c:1317 +#: xcofflink.c:1319 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "%s: symbole « %s » a un type csect non reconnu %d" -#: xcofflink.c:1329 +#: xcofflink.c:1331 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "%s: symbole XTY_ER erroné « %s »: classe %d scnum %d scnlen %d" -#: xcofflink.c:1365 +#: xcofflink.c:1367 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "%s: XMC_TC0 symbol « %s » est la classe %d scnlen %d" -#: xcofflink.c:1517 +#: xcofflink.c:1519 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "%s: csect « %s » n'est pas dans un section fermée" -#: xcofflink.c:1624 +#: xcofflink.c:1626 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "%s: XTY_LD mal placé « %s »" -#: xcofflink.c:1948 +#: xcofflink.c:1957 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "%s: relocalisation %s:%d n'est pas dans csect" -#: xcofflink.c:2083 +#: xcofflink.c:2092 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "%s: objet XCOFF partagé sans être en production de sortie XCOFF" -#: xcofflink.c:2104 +#: xcofflink.c:2113 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "%s: objet dynamique sans section .loader" -#: xcofflink.c:2749 +#: xcofflink.c:2758 #, c-format msgid "%s: no such symbol" msgstr "%s: pas de tel symbole" -#: xcofflink.c:2890 +#: xcofflink.c:2891 msgid "error: undefined symbol __rtinit" msgstr "erreur: symbole __rtinit indéfini" -#: xcofflink.c:3458 +#: xcofflink.c:3453 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "AVERTISSEMENT: tentative d'exportation d'un symbole indéfini « %s »" -#: xcofflink.c:4452 +#: xcofflink.c:4447 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "Débordement de la table des entrées: 0x%lx > 0x10000; essayer l'option -mminimal-toc" -#: xcofflink.c:5292 xcofflink.c:5754 xcofflink.c:5816 xcofflink.c:6117 +#: xcofflink.c:5287 xcofflink.c:5756 xcofflink.c:5818 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "%s: chargeur de relocalisation dans une section non reconnnue « %s »" -#: xcofflink.c:5314 xcofflink.c:6128 +#: xcofflink.c:5309 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "%s: « %s » est dans le chargeur de relocalisation mais pas dans celui des symboles" -#: xcofflink.c:5329 +#: xcofflink.c:5324 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "%s: chargeur de relocalisation dans un section en lecture seulement %s" -#: elf32-ia64.c:2190 elf64-ia64.c:2190 +#: elf32-ia64.c:2222 elf64-ia64.c:2222 msgid "@pltoff reloc against local symbol" msgstr "relocalisation @pltoff vers un symbole local" -#: elf32-ia64.c:2248 elf64-ia64.c:2248 -msgid "non-zero addend in @fptr reloc" -msgstr "ajout non null dans la relocalisation @fptr" - -#: elf32-ia64.c:3414 elf64-ia64.c:3414 +#: elf32-ia64.c:3562 elf64-ia64.c:3562 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "%s: débordement du segment de données court (0x%lx >= 0x400000)" -#: elf32-ia64.c:3425 elf64-ia64.c:3425 +#: elf32-ia64.c:3573 elf64-ia64.c:3573 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "%s: __gp ne couvre pas ce segment de données court" -#: elf32-ia64.c:3729 elf64-ia64.c:3729 +#: elf32-ia64.c:3858 elf64-ia64.c:3858 #, c-format msgid "%s: linking non-pic code in a shared library" msgstr "%s: liaison de code non-pic dans une librairie partagée" -#: elf32-ia64.c:3762 elf64-ia64.c:3762 +#: elf32-ia64.c:3891 elf64-ia64.c:3891 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" msgstr "%s: relocalisation @gprel vers le symbole dynamique %s" -#: elf32-ia64.c:3901 elf64-ia64.c:3901 +#: elf32-ia64.c:4030 elf64-ia64.c:4030 #, c-format msgid "%s: dynamic relocation against speculation fixup" msgstr "%s: relocalisation dynamique vers un correctif spéculé" -#: elf32-ia64.c:3909 elf64-ia64.c:3909 +#: elf32-ia64.c:4038 elf64-ia64.c:4038 #, c-format msgid "%s: speculation fixup against undefined weak symbol" msgstr "%s: correctif spéculé vers un symbole faible indéfini" -#: elf32-ia64.c:4093 elf64-ia64.c:4093 +#: elf32-ia64.c:4271 elf64-ia64.c:4271 msgid "unsupported reloc" msgstr "relocalisation non supporté" -#: elf32-ia64.c:4373 elf64-ia64.c:4373 +#: elf32-ia64.c:4551 elf64-ia64.c:4551 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" msgstr "%s: édition de liens trap-on-NULL-dereference avec des fichiers non-trapping" -#: elf32-ia64.c:4382 elf64-ia64.c:4382 +#: elf32-ia64.c:4560 elf64-ia64.c:4560 #, c-format msgid "%s: linking big-endian files with little-endian files" msgstr "" "%s: édition de liens pour des fichiers en système à octets de poids fort\n" "avec des fichiers pour des systèmes à octets de poids faible" -#: elf32-ia64.c:4391 elf64-ia64.c:4391 +#: elf32-ia64.c:4569 elf64-ia64.c:4569 #, c-format msgid "%s: linking 64-bit files with 32-bit files" msgstr "%s: édition de liens de fichiers de 64 bits avec des fichiers de 32 bits" -#: elf32-ia64.c:4400 elf64-ia64.c:4400 +#: elf32-ia64.c:4578 elf64-ia64.c:4578 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" msgstr "%s: édition de liens de fichiers constant-gp avec des fichier non-constant-gp" -#: elf32-ia64.c:4410 elf64-ia64.c:4410 +#: elf32-ia64.c:4588 elf64-ia64.c:4588 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" msgstr "%s: édition de liens de fichiers auto-pic avec des fichiers non-auto-pic" -#: peigen.c:964 pepigen.c:964 +#: peigen.c:962 pepigen.c:962 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "%s: débordement du nombre de lignes: 0x%lx > 0xffff" -#: peigen.c:981 pepigen.c:981 +#: peigen.c:979 pepigen.c:979 #, c-format msgid "%s: reloc overflow 1: 0x%lx > 0xffff" msgstr "%s: débordement de la relocalisation 1: 0x%lx > 0xffff" -#: peigen.c:995 pepigen.c:995 +#: peigen.c:993 pepigen.c:993 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "Répertoire d'exportation [.edata (ou là où il a été repéré)]" -#: peigen.c:996 pepigen.c:996 +#: peigen.c:994 pepigen.c:994 msgid "Import Directory [parts of .idata]" msgstr "Répertoire d'importation [faisant partie de .idata]" -#: peigen.c:997 pepigen.c:997 +#: peigen.c:995 pepigen.c:995 msgid "Resource Directory [.rsrc]" msgstr "Répertoire des resources [.rsrc]" -#: peigen.c:998 pepigen.c:998 +#: peigen.c:996 pepigen.c:996 msgid "Exception Directory [.pdata]" msgstr "Répertoire des exceptions [.pdata]" -#: peigen.c:999 pepigen.c:999 +#: peigen.c:997 pepigen.c:997 msgid "Security Directory" msgstr "Répertoire de la sécurité" -#: peigen.c:1000 pepigen.c:1000 +#: peigen.c:998 pepigen.c:998 msgid "Base Relocation Directory [.reloc]" msgstr "Répertoire de base de relocalisation [.reloc]" -#: peigen.c:1001 pepigen.c:1001 +#: peigen.c:999 pepigen.c:999 msgid "Debug Directory" msgstr "Répertoire de débug" -#: peigen.c:1002 pepigen.c:1002 +#: peigen.c:1000 pepigen.c:1000 msgid "Description Directory" msgstr "Répertoire de description" -#: peigen.c:1003 pepigen.c:1003 +#: peigen.c:1001 pepigen.c:1001 msgid "Special Directory" msgstr "Répertoire spécial" -#: peigen.c:1004 pepigen.c:1004 +#: peigen.c:1002 pepigen.c:1002 msgid "Thread Storage Directory [.tls]" msgstr "Répertoire des files de stockage [.tls]" -#: peigen.c:1005 pepigen.c:1005 +#: peigen.c:1003 pepigen.c:1003 msgid "Load Configuration Directory" msgstr "Répertoire de chargement de configuration" -#: peigen.c:1006 pepigen.c:1006 +#: peigen.c:1004 pepigen.c:1004 msgid "Bound Import Directory" msgstr "Répertoire des importations limitées" -#: peigen.c:1007 pepigen.c:1007 +#: peigen.c:1005 pepigen.c:1005 msgid "Import Address Table Directory" msgstr "Répertoire de la table d'adresse d'importation" -#: peigen.c:1008 pepigen.c:1008 +#: peigen.c:1006 pepigen.c:1006 msgid "Delay Import Directory" msgstr "Répertoire des délais d'importation" -#: peigen.c:1009 peigen.c:1010 pepigen.c:1009 pepigen.c:1010 +#: peigen.c:1007 peigen.c:1008 pepigen.c:1007 pepigen.c:1008 msgid "Reserved" msgstr "Réservé" -#: peigen.c:1073 pepigen.c:1073 +#: peigen.c:1071 pepigen.c:1071 msgid "" "\n" "There is an import table, but the section containing it could not be found\n" @@ -2372,7 +2500,7 @@ msgstr "" "\n" "Il y a une table d'importation, mais la section la contenant ne peut être repérée\n" -#: peigen.c:1078 pepigen.c:1078 +#: peigen.c:1076 pepigen.c:1076 #, c-format msgid "" "\n" @@ -2381,7 +2509,7 @@ msgstr "" "\n" "Il y a une table d'importation dans %s à 0x%lx\n" -#: peigen.c:1115 pepigen.c:1115 +#: peigen.c:1113 pepigen.c:1113 #, c-format msgid "" "\n" @@ -2390,12 +2518,12 @@ msgstr "" "\n" "Descripteur de fonction localisé à l'adresse de départ: %04lx\n" -#: peigen.c:1118 pepigen.c:1118 +#: peigen.c:1116 pepigen.c:1116 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "\tcode-base %08lx tab. des entrées (chargeable/actuel) %08lx/%08lx\n" -#: peigen.c:1124 pepigen.c:1124 +#: peigen.c:1122 pepigen.c:1122 msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" @@ -2403,7 +2531,7 @@ msgstr "" "\n" "Pas de section reldata! Descripteur de fonction n'a pas été décodé.\n" -#: peigen.c:1129 pepigen.c:1129 +#: peigen.c:1127 pepigen.c:1127 #, c-format msgid "" "\n" @@ -2412,15 +2540,15 @@ msgstr "" "\n" "Les tables d'importation (contenus interprétés de la section %s)\n" -#: peigen.c:1132 pepigen.c:1132 -msgid " vma: Hint Time Forward DLL First\n" -msgstr " vma: Hint Heure Forward DLL Premier\n" - -#: peigen.c:1134 pepigen.c:1134 -msgid " Table Stamp Chain Name Thunk\n" -msgstr " Table Tampon Chaîne Nom Thunk\n" +#: peigen.c:1130 pepigen.c:1130 +msgid "" +" vma: Hint Time Forward DLL First\n" +" Table Stamp Chain Name Thunk\n" +msgstr "" +" vma: Hint Temps Avant DLL Premier\n" +" Table Estampil. Chaîne Nom Thunk\n" -#: peigen.c:1182 pepigen.c:1182 +#: peigen.c:1181 pepigen.c:1181 #, c-format msgid "" "\n" @@ -2429,23 +2557,19 @@ msgstr "" "\n" "\tNom DLL: %s\n" -#: peigen.c:1186 peigen.c:1249 pepigen.c:1186 pepigen.c:1249 -msgid "\tvma: Hint/Ord Member-Name\n" -msgstr "\tvma: Hint/Nom-de-membre nombre ordinal\n" - -#: peigen.c:1248 pepigen.c:1248 -msgid "\tThe Import Address Table (difference found)\n" -msgstr "\tL'adresse de la table d'importation (différence détectée)\n" +#: peigen.c:1192 pepigen.c:1192 +msgid "\tvma: Hint/Ord Member-Name Bound-To\n" +msgstr "\tvma: Hint/Ord Membre Lien\n" -#: peigen.c:1255 pepigen.c:1255 -msgid "\t>>> Ran out of IAT members!\n" -msgstr "\t>>> membres IAT tous utilisés!\n" - -#: peigen.c:1273 pepigen.c:1273 -msgid "\tThe Import Address Table is identical\n" -msgstr "\tL'adresse de la table d'importation est identique\n" +#: peigen.c:1217 pepigen.c:1217 +msgid "" +"\n" +"There is a first thunk, but the section containing it could not be found\n" +msgstr "" +"\n" +"Il y a un premier « thunk », mais la section le contenant ne peut être repérée\n" -#: peigen.c:1345 pepigen.c:1345 +#: peigen.c:1357 pepigen.c:1357 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" @@ -2453,7 +2577,7 @@ msgstr "" "\n" "Il y a une table d'exportation, mais la section la contenant n'a pu être repérée\n" -#: peigen.c:1350 pepigen.c:1350 +#: peigen.c:1362 pepigen.c:1362 #, c-format msgid "" "\n" @@ -2462,7 +2586,7 @@ msgstr "" "\n" "Il y a une table d'exportation dans %s à 0x%lx\n" -#: peigen.c:1381 pepigen.c:1381 +#: peigen.c:1393 pepigen.c:1393 #, c-format msgid "" "\n" @@ -2473,61 +2597,61 @@ msgstr "" "Les tables d'exportation (contenus interprétés de la section %s)\n" "\n" -#: peigen.c:1385 pepigen.c:1385 +#: peigen.c:1397 pepigen.c:1397 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "Fanion d'exportation \t\t\t%lx\n" -#: peigen.c:1388 pepigen.c:1388 +#: peigen.c:1400 pepigen.c:1400 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "Tampon Heure/Date \t\t%lx\n" -#: peigen.c:1391 pepigen.c:1391 +#: peigen.c:1403 pepigen.c:1403 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "Majeur/Mineur \t\t\t%d/%d\n" -#: peigen.c:1394 pepigen.c:1394 +#: peigen.c:1406 pepigen.c:1406 msgid "Name \t\t\t\t" msgstr "Nom \t\t\t\t" -#: peigen.c:1400 pepigen.c:1400 +#: peigen.c:1412 pepigen.c:1412 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "base de nombre ordinal \t\t\t%ld\n" -#: peigen.c:1403 pepigen.c:1403 +#: peigen.c:1415 pepigen.c:1415 msgid "Number in:\n" msgstr "Numéro dans:\n" -#: peigen.c:1406 pepigen.c:1406 +#: peigen.c:1418 pepigen.c:1418 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "\tTable d'adresses d'exportation \t\t%08lx\n" -#: peigen.c:1410 pepigen.c:1410 +#: peigen.c:1422 pepigen.c:1422 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "\tTable de noms [Pointeur/Nombre ordinal]\t%08lx\n" -#: peigen.c:1413 pepigen.c:1413 +#: peigen.c:1425 pepigen.c:1425 msgid "Table Addresses\n" msgstr "Table d'adresses\n" -#: peigen.c:1416 pepigen.c:1416 +#: peigen.c:1428 pepigen.c:1428 msgid "\tExport Address Table \t\t" msgstr "\tTable d'adresse d'exportation \t\t" -#: peigen.c:1421 pepigen.c:1421 +#: peigen.c:1433 pepigen.c:1433 msgid "\tName Pointer Table \t\t" msgstr "\tTable des noms de pointeurs \t\t" -#: peigen.c:1426 pepigen.c:1426 +#: peigen.c:1438 pepigen.c:1438 msgid "\tOrdinal Table \t\t\t" msgstr "\tTable des ordinals \t\t\t" -#: peigen.c:1441 pepigen.c:1441 +#: peigen.c:1453 pepigen.c:1453 #, c-format msgid "" "\n" @@ -2536,15 +2660,15 @@ msgstr "" "\n" "Table d'adresses d'exportation -- base de nombre ordinal %ld\n" -#: peigen.c:1460 pepigen.c:1460 +#: peigen.c:1472 pepigen.c:1472 msgid "Forwarder RVA" msgstr "Adresseur RVA" -#: peigen.c:1471 pepigen.c:1471 +#: peigen.c:1483 pepigen.c:1483 msgid "Export RVA" msgstr "Exportation RVA" -#: peigen.c:1478 pepigen.c:1478 +#: peigen.c:1490 pepigen.c:1490 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" @@ -2552,12 +2676,12 @@ msgstr "" "\n" "Table [Ordinal/Nom de pointeurs]\n" -#: peigen.c:1533 pepigen.c:1533 +#: peigen.c:1545 pepigen.c:1545 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "AVERTISSEMENT, taille de la section .pdata (%ld) n'est pas un multiple de %d\n" -#: peigen.c:1537 pepigen.c:1537 +#: peigen.c:1549 pepigen.c:1549 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" @@ -2565,31 +2689,31 @@ msgstr "" "\n" "La table de fonctions (interprétation du contenu de la section .pdata)\n" -#: peigen.c:1540 pepigen.c:1540 +#: peigen.c:1552 pepigen.c:1552 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr " vma:\t\t\tDébut Adresse Fin Adresse Unwind Info\n" -#: peigen.c:1543 pepigen.c:1543 -msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" -msgstr " vma:\t\tDébut Fin EH EH FinProlog Exception\n" - -#: peigen.c:1545 pepigen.c:1545 -msgid " \t\tAddress Address Handler Data Address Mask\n" -msgstr " \t\tAdresse Adresse Routine Données Adresse Masque\n" +#: peigen.c:1554 pepigen.c:1554 +msgid "" +" vma:\t\tBegin End EH EH PrologEnd Exception\n" +" \t\tAddress Address Handler Data Address Mask\n" +msgstr "" +" vma:\t\tDébut Fin EH EH FinProlog Exception\n" +" \t\tAdresse Adresse Handler Données Adresse Masque\n" -#: peigen.c:1613 pepigen.c:1613 +#: peigen.c:1624 pepigen.c:1624 msgid " Register save millicode" msgstr " Registre a préservé le millicode" -#: peigen.c:1616 pepigen.c:1616 +#: peigen.c:1627 pepigen.c:1627 msgid " Register restore millicode" msgstr " Registre a restauré le millicode" -#: peigen.c:1619 pepigen.c:1619 +#: peigen.c:1630 pepigen.c:1630 msgid " Glue code sequence" msgstr " Séquence du code de liants" -#: peigen.c:1671 pepigen.c:1671 +#: peigen.c:1682 pepigen.c:1682 msgid "" "\n" "\n" @@ -2599,7 +2723,7 @@ msgstr "" "\n" "Fichier de base des relocalisation PE (contenus interprétés de la section .reloc)\n" -#: peigen.c:1701 pepigen.c:1701 +#: peigen.c:1712 pepigen.c:1712 #, c-format msgid "" "\n" @@ -2608,7 +2732,7 @@ msgstr "" "\n" "Adresse virtuelle: %08lx taille des morceaux %ld (0x%lx) nombre de correctifs %ld\n" -#: peigen.c:1714 pepigen.c:1714 +#: peigen.c:1725 pepigen.c:1725 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "\trelocalisation %4d décalage %4x [%4lx] %s" @@ -2616,7 +2740,7 @@ msgstr "\trelocalisation %4d décalage %4x [%4lx] %s" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1754 pepigen.c:1754 +#: peigen.c:1765 pepigen.c:1765 #, c-format msgid "" "\n" @@ -2625,8 +2749,134 @@ msgstr "" "\n" "Caractéristiques 0x%x\n" -#~ msgid "float" -#~ msgstr "flottant" +#~ msgid "\tThe Import Address Table (difference found)\n" +#~ msgstr "\tL'adresse de la table d'importation (différence détectée)\n" + +#~ msgid "\t>>> Ran out of IAT members!\n" +#~ msgstr "\t>>> membres IAT tous utilisés!\n" + +#~ msgid "\tThe Import Address Table is identical\n" +#~ msgstr "\tL'adresse de la table d'importation est identique\n" + +#~ msgid "GP relative relocation when GP not defined" +#~ msgstr "GP relocalisation relative alors que GP n'est pas défini" + +#~ msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" +#~ msgstr "%s: ERREUR: passage de valeurs en virgule flottante dans des registreen virgule flottance alors que la cible %s utilise des registres de valeursentières" + +#~ msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" +#~ msgstr "%s: ERREUR: passage de valeurs en virgule flottante dans des registreen valeur entière alors que la cible %s utilise des registres de valeursen virgule flottante" + +#~ msgid "Warning: input file %s supports interworking, whereas %s does not." +#~ msgstr "AVERTISSEMENT: file d'entrée %s supporte l'inter-réseautage, contrairement à %s." + +#~ msgid "Warning: input file %s does not support interworking, whereas %s does." +#~ msgstr "AVERTISSEMENT: fichier d'entrée %s ne supporte pas l'inter-réseautage, contrairement à %s." + +#~ msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" +#~ msgstr "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld prochain %ld" + +#~ msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" +#~ msgstr "elf_symbol_from_bfd_symbol 0x%.8lx, nom = %s, no. de symbole = %d, fanions = 0x%.8lx%s\n" + +#~ msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" +#~ msgstr "AVERTISSEMENT: pas d'initialisation du fanion d'inter-réseautage %s alors qu'il a déjè été spécifié sans inter-réseautage" + +#~ msgid "Warning: Clearing the interwork flag of %s due to outside request" +#~ msgstr "AVERTISSEMENT: mise à zéro du fanion d'inter-réseautage %s en raison d'une requête externe" + +#~ msgid " [APCS-26]" +#~ msgstr " [APCS-26]" + +#~ msgid " [APCS-32]" +#~ msgstr " [APCS-32]" + +#~ msgid "(unknown)" +#~ msgstr "(inconnu)" + +#~ msgid " previously %s in %s" +#~ msgstr " précédemment %s dans %s" + +#~ msgid "Symbol `%s' has differing types: %s in %s" +#~ msgstr "Symbole « %s » a des types qui diffèrent: %s dans %s" + +#~ msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" +#~ msgstr "ETIR_S_C_STO_GBL: pas de symbole « %s »" + +#~ msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" +#~ msgstr "ETIR_S_C_STO_CA: pas de symbole « %s »" + +#~ msgid "ETIR_S_C_STO_RB/AB: Not supported" +#~ msgstr "ETIR_S_C_STO_RB/AB: non supporté" + +#~ msgid "ETIR_S_C_STO_LP_PSB: Not supported" +#~ msgstr "ETIR_S_C_STO_LP_PSB: non supporté" + +#~ msgid "ETIR_S_C_STO_HINT_GBL: not implemented" +#~ msgstr "ETIR_S_C_STO_HINT_GBL: pas implanté" + +#~ msgid "ETIR_S_C_STO_HINT_PS: not implemented" +#~ msgstr "ETIR_S_C_STO_HINT_PS: pas implanté" + +#~ msgid "ETIR_S_C_OPR_INSV: Not supported" +#~ msgstr "ETIR_S_C_OPR_INSV: non supporté" + +#~ msgid "ETIR_S_C_OPR_USH: Not supported" +#~ msgstr "ETIR_S_C_OPR_USH: non supporté" + +#~ msgid "ETIR_S_C_OPR_ROT: Not supported" +#~ msgstr "ETIR_S_C_OPR_ROT: non supporté" + +#~ msgid "ETIR_S_C_OPR_REDEF: Not supported" +#~ msgstr "ETIR_S_C_OPR_REDEF: non supporté" + +#~ msgid "ETIR_S_C_OPR_DFLIT: Not supported" +#~ msgstr "ETIR_S_C_OPR_DFLIT: non supporté" + +#~ msgid "ETIR_S_C_STC_LP: not supported" +#~ msgstr "ETIR_S_C_STC_LP: non supporté" + +#~ msgid "ETIR_S_C_STC_GBL: not supported" +#~ msgstr "ETIR_S_C_STC_GBL: non supporté" + +#~ msgid "ETIR_S_C_STC_GCA: not supported" +#~ msgstr "ETIR_S_C_STC_GCA: non supporté" + +#~ msgid "ETIR_S_C_STC_PS: not supported" +#~ msgstr "ETIR_S_C_STC_PS: non supporté" + +#~ msgid "Unimplemented STO cmd %d" +#~ msgstr "Commande STO non implantée %d" + +#~ msgid "TIR_S_C_OPR_ASH incomplete" +#~ msgstr "TIR_S_C_OPR_ASH incomplète" + +#~ msgid "TIR_S_C_OPR_USH incomplete" +#~ msgstr "TIR_S_C_OPR_USH incomplète" + +#~ msgid "TIR_S_C_OPR_ROT incomplete" +#~ msgstr "TIR_S_C_OPR_ROT incomplète" + +#~ msgid "TIR_S_C_OPR_REDEF not supported" +#~ msgstr "TIR_S_C_OPR_REDEF non supporté" + +#~ msgid "TIR_S_C_OPR_DFLIT not supported" +#~ msgstr "TIR_S_C_OPR_DFLIT non supporté" + +#~ msgid "TIR_S_C_CTL_DFLOC not fully implemented" +#~ msgstr "TIR_S_C_CTL_DFLOC pas complètement implanté" + +#~ msgid "TIR_S_C_CTL_STLOC not fully implemented" +#~ msgstr "TIR_S_C_CTL_STLOC pas complètement implanté" + +#~ msgid "TIR_S_C_CTL_STKDL not fully implemented" +#~ msgstr "TIR_S_C_CTL_STKDL n'est pas complètement implanté" + +#~ msgid " vma: Hint Time Forward DLL First\n" +#~ msgstr " vma: Hint Heure Forward DLL Premier\n" + +#~ msgid " \t\tAddress Address Handler Data Address Mask\n" +#~ msgstr " \t\tAdresse Adresse Routine Données Adresse Masque\n" #~ msgid "integer" #~ msgstr "entier" @@ -2643,9 +2893,6 @@ msgstr "" #~ msgid "supports" #~ msgstr "supporte" -#~ msgid "does not support" -#~ msgstr "n'est pas supportée" - #~ msgid "does not" #~ msgstr "n'est pas" @@ -2658,9 +2905,6 @@ msgstr "" #~ msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections" #~ msgstr "%s(%s+0x%lx): ne peut relocaliser %s, recompiler avec -ffunction-sections" -#~ msgid "Symbol `%s' has differing types: previously %s, REGISTER in %s" -#~ msgstr "Symbole `%s' a des types qui diffèrent: précédemment %s, ENREGISTRÉ dans %s" - #~ msgid "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = 0x%.8lx\n" #~ msgstr "création de la section des symboles, nom = %s, valeur = 0x%.8lx, index = %d, section = 0x%.8lx\n" diff --git a/bfd/po/sv.po b/bfd/po/sv.po index ca8ecd9..e73f09b 100644 --- a/bfd/po/sv.po +++ b/bfd/po/sv.po @@ -4,16 +4,16 @@ # msgid "" msgstr "" -"Project-Id-Version: bfd 2.12-pre020121\n" -"POT-Creation-Date: 2002-01-31 17:07+0000\n" -"PO-Revision-Date: 2002-01-30 02:35+0100\n" +"Project-Id-Version: bfd 2.12.91\n" +"POT-Creation-Date: 2002-07-23 15:55-0400\n" +"PO-Revision-Date: 2002-07-30 21:55+0200\n" "Last-Translator: Christian Rose <menthos@menthos.com>\n" "Language-Team: Swedish <sv@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: aout-adobe.c:196 +#: aout-adobe.c:197 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "%s: Okänd sektionstyp i a.out.adobe-fil: %x\n" @@ -40,16 +40,14 @@ msgstr "%s: kan inte representera sektionen \"%s\" i a.out-objektfilformat" #: aoutx.h:1669 #, c-format -msgid "" -"%s: can not represent section for symbol `%s' in a.out object file format" -msgstr "" -"%s: kan inte representera sektion för symbolen \"%s\" i a.out-objektfilformat" +msgid "%s: can not represent section for symbol `%s' in a.out object file format" +msgstr "%s: kan inte representera sektion för symbolen \"%s\" i a.out-objektfilformat" #: aoutx.h:1671 msgid "*unknown*" msgstr "*okänd*" -#: aoutx.h:3735 +#: aoutx.h:3732 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "%s: omlokaliseringsbar länk från %s till %s stöds inte" @@ -169,9 +167,7 @@ msgstr "Rapportera gärna detta fel.\n" #: binary.c:306 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." -msgstr "" -"Varning: Skrivning av sektionen \"%s\" till enormt (dvs negativt) avlägsen " -"byte 0x%lx." +msgstr "Varning: Skrivning av sektionen \"%s\" till enormt (dvs negativt) avlägsen byte 0x%lx." # src/menus.c:341 #: coff-a29k.c:119 @@ -183,7 +179,7 @@ msgstr "IHCONST saknas" msgid "Missing IHIHALF" msgstr "IHIHALF saknas" -#: coff-a29k.c:212 coff-or32.c:228 +#: coff-a29k.c:212 coff-or32.c:229 msgid "Unrecognized reloc" msgstr "Okänd omlokalisering" @@ -195,7 +191,7 @@ msgstr "IHCONST-omlokalisering saknas" msgid "missing IHIHALF reloc" msgstr "IHIHALF-omlokalisering saknas" -#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1433 +#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432 msgid "GP relative relocation used when GP not defined" msgstr "GP-relativ omlokalisering användes då GP inte är definierad" @@ -203,178 +199,156 @@ msgstr "GP-relativ omlokalisering användes då GP inte är definierad" msgid "using multiple gp values" msgstr "använder flera gp-värden" -#: coff-arm.c:1051 elf32-arm.h:285 +#: coff-arm.c:1066 elf32-arm.h:285 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "%s: kunde inte hitta THUMB-klistret \"%s\" till \"%s\"" -#: coff-arm.c:1080 elf32-arm.h:320 +#: coff-arm.c:1096 elf32-arm.h:320 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "%s: kunde inte hitta ARM-klistret \"%s\" till \"%s\"" -#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 +#: coff-arm.c:1391 coff-arm.c:1486 elf32-arm.h:887 elf32-arm.h:991 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "%s(%s): varning: samverkande är inte aktiverat." -#: coff-arm.c:1379 elf32-arm.h:993 +#: coff-arm.c:1395 elf32-arm.h:994 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr " första förekomst: %s: arm-anrop till thumb" -#: coff-arm.c:1474 elf32-arm.h:889 +#: coff-arm.c:1490 elf32-arm.h:890 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr " första förekomst: %s: thumb-anrop till arm" -#: coff-arm.c:1477 +#: coff-arm.c:1493 msgid " consider relinking with --support-old-code enabled" msgstr " överväg omlänkning med --support-old-code aktiverat" -#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 +#: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3031 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "%s: felaktig omlokaliseringsadress 0x%lx i sektionen \"%s\"" -#: coff-arm.c:2107 +#: coff-arm.c:2127 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "%s: otillåtet symbolindex i omlokalisering: %d" -#: coff-arm.c:2235 +#: coff-arm.c:2255 #, c-format -msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" -msgstr "%s: FEL: kompilerad för APCS-%d där målet %s använder APCS-%d" +msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" +msgstr "FEL: %s kompilerad för APCS-%d, medan %s är kompilerad för APCS-%d" -#: coff-arm.c:2250 +#: coff-arm.c:2270 elf32-arm.h:2297 #, c-format -msgid "" -"%s: ERROR: passes floats in float registers whereas target %s uses integer " -"registers" -msgstr "" -"%s: FEL: skickar flyttal i flyttalsregister där målet %s istället använder " -"heltalsregister" +msgid "ERROR: %s passes floats in float registers, whereas %s passes them in integer registers" +msgstr "FEL: %s skickar flyttal i flyttalsregister, medan %s skickar dem i heltalsregister" -#: coff-arm.c:2253 +#: coff-arm.c:2273 elf32-arm.h:2302 #, c-format -msgid "" -"%s: ERROR: passes floats in integer registers whereas target %s uses float " -"registers" -msgstr "" -"%s: FEL: skickar flyttal i heltalsregister där målet %s istället använder " -"flyttalsregister" +msgid "ERROR: %s passes floats in integer registers, whereas %s passes them in float registers" +msgstr "FEL: %s skickar flyttal i heltalsregister, medan %s skickar dem i flyttalsregister" -#: coff-arm.c:2268 +#: coff-arm.c:2288 #, c-format -msgid "" -"%s: ERROR: compiled as position independent code, whereas target %s is " -"absolute position" -msgstr "" -"%s: FEL: kompilerad som positionsoberoende kod, där målet %s istället har " -"absolut position" +msgid "ERROR: %s is compiled as position independent code, whereas target %s is absolute position" +msgstr "FEL: %s är kompilerad som positionsoberoende kod, medan målet %s har absolut position" -#: coff-arm.c:2271 +#: coff-arm.c:2291 #, c-format -msgid "" -"%s: ERROR: compiled as absolute position code, whereas target %s is position " -"independent" -msgstr "" -"%s: FEL: kompilerad som kod med absolut position, där målet %s istället är " -"positionsoberoende" +msgid "ERROR: %s is compiled as absolute position code, whereas target %s is position independent" +msgstr "FEL: %s är kompilerad som kod med absolut position, medan målet %s är positionsoberoende" -#: coff-arm.c:2300 -#, fuzzy, c-format -msgid "Warning: %s supports interworking, whereas %s does not." +#: coff-arm.c:2320 elf32-arm.h:2358 +#, c-format +msgid "Warning: %s supports interworking, whereas %s does not" msgstr "Varning: %s stöder samverkande, medan %s däremot inte gör det" -#: coff-arm.c:2303 -#, fuzzy, c-format -msgid "Warning: %s does not support interworking, whereas %s does." +#: coff-arm.c:2323 elf32-arm.h:2365 +#, c-format +msgid "Warning: %s does not support interworking, whereas %s does" msgstr "Varning: %s stöder inte samverkande, medan %s däremot gör det" -#: coff-arm.c:2330 +#: coff-arm.c:2350 #, c-format msgid "private flags = %x:" msgstr "privata flaggor = %x:" -#: coff-arm.c:2338 elf32-arm.h:2408 +#: coff-arm.c:2358 elf32-arm.h:2418 msgid " [floats passed in float registers]" msgstr " [flyttal skickade i flyttalsregister]" -#: coff-arm.c:2340 +#: coff-arm.c:2360 msgid " [floats passed in integer registers]" msgstr " [flyttal skickade i heltalsregister]" -#: coff-arm.c:2343 elf32-arm.h:2411 +#: coff-arm.c:2363 elf32-arm.h:2421 msgid " [position independent]" msgstr " [positionsoberoende]" -#: coff-arm.c:2345 +#: coff-arm.c:2365 msgid " [absolute position]" msgstr " [absolut position]" -#: coff-arm.c:2349 +#: coff-arm.c:2369 msgid " [interworking flag not initialised]" msgstr " [samverkandeflagga är inte initierad]" -#: coff-arm.c:2351 +#: coff-arm.c:2371 msgid " [interworking supported]" msgstr " [samverkan stöds]" -#: coff-arm.c:2353 +#: coff-arm.c:2373 msgid " [interworking not supported]" msgstr " [samverkan stöds inte]" -#: coff-arm.c:2401 elf32-arm.h:2114 -#, fuzzy, c-format -msgid "" -"Warning: Not setting interworking flag of %s since it has already been " -"specified as non-interworking" -msgstr "" -"Varning: Ställer inte in samverkansflaggan för %s, eftersom den redan har " -"angivits som inte samverkande" +#: coff-arm.c:2421 elf32-arm.h:2124 +#, c-format +msgid "Warning: Not setting interworking flag of %s since it has already been specified as non-interworking" +msgstr "Varning: Ställer inte in samverkansflaggan för %s eftersom den redan har angivits som inte samverkande" -#: coff-arm.c:2405 elf32-arm.h:2118 +#: coff-arm.c:2425 elf32-arm.h:2128 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" -msgstr "" -"Varning: Stänger av samverkansflaggan för %s på grund av begäran utifrån" +msgstr "Varning: Stänger av samverkansflaggan för %s på grund av begäran utifrån" #: coff-i960.c:136 coff-i960.c:485 msgid "uncertain calling convention for non-COFF symbol" msgstr "osäker anropskonvention för icke-COFF-symbol" -#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2212 elf32-mips.c:9954 +#: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844 msgid "unsupported reloc type" msgstr "omlokaliseringstypen stöds inte" -#: coff-mips.c:875 elf32-mips.c:1997 elf64-mips.c:1739 +#: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609 msgid "GP relative relocation when _gp not defined" msgstr "GP-relativ omlokalisering då _gp inte var definierat" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2468 +#: coff-mips.c:2466 msgid "reloc against unsupported section" msgstr "omlokalisering mot sektion som inte stöds" -#: coff-mips.c:2476 +#: coff-mips.c:2474 msgid "reloc not properly aligned" msgstr "omlokalisering inte på jämn gräns" -#: coff-rs6000.c:2710 coff64-rs6000.c:1164 +#: coff-rs6000.c:2766 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "%s: omlokaliseringstypen 0x%02x stöds inte" -#: coff-rs6000.c:2756 coff64-rs6000.c:1210 +#: coff-rs6000.c:2859 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" -msgstr "" -"%s: TOC-omlokalisering vid 0x%x till symbolen \"%s\" utan någon TOC-post" +msgstr "%s: TOC-omlokalisering vid 0x%x till symbolen \"%s\" utan någon TOC-post" -#: coff-rs6000.c:3006 coff64-rs6000.c:2060 +#: coff-rs6000.c:3590 coff64-rs6000.c:2091 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" msgstr "%s: symbolen \"%s\" har okänd smclas %d" @@ -384,7 +358,7 @@ msgstr "%s: symbolen \"%s\" har okänd smclas %d" msgid "Unrecognized reloc type 0x%x" msgstr "Okänd omlokaliseringstyp 0x%x" -#: coff-tic54x.c:390 coffcode.h:4868 +#: coff-tic54x.c:390 coffcode.h:4974 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "%s: varning: otillåtet symbolindex %ld i omlokaliseringarna" @@ -394,37 +368,37 @@ msgstr "%s: varning: otillåtet symbolindex %ld i omlokaliseringarna" msgid "ignoring reloc %s\n" msgstr "ignorerar omlokalisering %s\n" -#: coffcode.h:1081 +#: coffcode.h:1086 #, c-format msgid "%s (%s): Section flag %s (0x%x) ignored" msgstr "%s (%s): Sektionsflaggan %s (0x%x) ignorerades" -#: coffcode.h:2132 +#: coffcode.h:2143 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" msgstr "Okänt TI COFF-målid \"0x%x\"" -#: coffcode.h:4257 +#: coffcode.h:4365 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "%s: varning: otillåtet symbolindex %ld i radnummer" -#: coffcode.h:4271 +#: coffcode.h:4379 #, c-format msgid "%s: warning: duplicate line number information for `%s'" msgstr "%s: varning: dubbel radnummersinformation för \"%s\"" -#: coffcode.h:4630 +#: coffcode.h:4736 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "%s: Okänd lagringsklass %d för %s-symbolen \"%s\"" -#: coffcode.h:4761 +#: coffcode.h:4867 #, c-format msgid "warning: %s: local symbol `%s' has no section" msgstr "varning: %s: lokala symbolen \"%s\" har ingen sektion" -#: coffcode.h:4906 +#: coffcode.h:5012 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "%s: otillåten omlokaliseringstyp %d på adress 0x%lx" @@ -434,110 +408,92 @@ msgstr "%s: otillåten omlokaliseringstyp %d på adress 0x%lx" msgid "%s: bad string table size %lu" msgstr "%s: felaktig strängtabellstorlek %lu" -#: cofflink.c:536 elflink.h:1967 +#: cofflink.c:534 elflink.h:1912 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "Varning: typen på symbolen \"%s\" ändrades från %d till %d i %s" -#: cofflink.c:2317 +#: cofflink.c:2321 #, c-format msgid "%s: relocs in section `%s', but it has no contents" msgstr "%s: omlokaliseringar i sektionen \"%s\", men den har inget innehåll" -#: cofflink.c:2653 coffswap.h:889 +#: cofflink.c:2664 coffswap.h:877 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "%s: %s: omlokalisering ger överspill: 0x%lx > 0xffff" -#: cofflink.c:2662 coffswap.h:876 +#: cofflink.c:2673 coffswap.h:864 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "%s: varning: %s: radnummer ger överspill: 0x%lx > 0xffff" -#: dwarf2.c:381 +#: dwarf2.c:382 msgid "Dwarf Error: Can't find .debug_str section." msgstr "Dwarf-fel: Kan inte hitta sektionen .debug_str." -#: dwarf2.c:398 +#: dwarf2.c:399 #, c-format -msgid "" -"Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str " -"size (%u)." -msgstr "" -"Dwarf-fel: DW_FORM_strp-avståndet (%u) större än eller lika med storleken " -"på .debug_str (%u)." +msgid "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)." +msgstr "Dwarf-fel: DW_FORM_strp-avståndet (%lu) större än eller lika med storleken på .debug_str (%lu)." -#: dwarf2.c:542 +#: dwarf2.c:543 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "Dwarf-fel: Kan inte hitta sektionen .debug_abbrev." -#: dwarf2.c:559 -#, fuzzy, c-format -msgid "" -"Dwarf Error: Abbrev offset (%u) greater than or equal to .debug_abbrev size " -"(%u)." -msgstr "" -"Dwarf-fel: Förkortningsavståndet (%u) större än eller lika med " -"förkortningsstorleken (%u)." +#: dwarf2.c:560 +#, c-format +msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)." +msgstr "Dwarf-fel: Förkortningsavståndet (%lu) större än eller lika med storleken .debug_abbrev (%lu)." -#: dwarf2.c:756 +#: dwarf2.c:757 #, c-format -msgid "Dwarf Error: Invalid or unhandled FORM value: %d." -msgstr "Dwarf-fel: Ogiltig eller ohanterat FORM-värde: %d." +msgid "Dwarf Error: Invalid or unhandled FORM value: %u." +msgstr "Dwarf-fel: Ogiltig eller ohanterat FORM-värde: %u." -#: dwarf2.c:843 +#: dwarf2.c:852 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "Dwarf-fel: trasig radnummerssektion (felaktigt filnummer)." -#: dwarf2.c:929 +#: dwarf2.c:938 msgid "Dwarf Error: Can't find .debug_line section." msgstr "Dwarf-fel: Kan inte hitta sektionen .debug_line." -#: dwarf2.c:952 -#, fuzzy, c-format -msgid "" -"Dwarf Error: Line offset (%u) greater than or equal to .debug_line size (%u)." -msgstr "" -"Dwarf-fel: Radavståndet (%u) större än eller lika med radstorleken (%u)." +#: dwarf2.c:961 +#, c-format +msgid "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)." +msgstr "Dwarf-fel: Radavståndet (%lu) större än eller lika med storleken .debug_line (%lu)." -#: dwarf2.c:1143 +#: dwarf2.c:1159 msgid "Dwarf Error: mangled line number section." msgstr "Dwarf-fel: trasig radnummerssektion." -#: dwarf2.c:1318 dwarf2.c:1529 +#: dwarf2.c:1355 dwarf2.c:1566 #, c-format -msgid "Dwarf Error: Could not find abbrev number %d." -msgstr "Dwarf-fel: Kunde inte hitta förkortningsnumret %d." +msgid "Dwarf Error: Could not find abbrev number %u." +msgstr "Dwarf-fel: Kunde inte hitta förkortningsnumret %u." -#: dwarf2.c:1490 +#: dwarf2.c:1527 #, c-format -msgid "" -"Dwarf Error: found dwarf version '%hu', this reader only handles version 2 " -"information." -msgstr "" -"Dwarf-fel: hittade dwarf version \"%hu\", denna läsare hanterar endast " -"information från version 2." +msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2 information." +msgstr "Dwarf-fel: hittade dwarf version \"%u\", denna läsare hanterar endast information från version 2." -#: dwarf2.c:1497 +#: dwarf2.c:1534 #, c-format -msgid "" -"Dwarf Error: found address size '%u', this reader can not handle sizes " -"greater than '%u'." -msgstr "" -"Dwarf-fel: hittade adresstorleken \"%u\", denna läsare kan inte hantera " -"storlekar större än \"%u\"." +msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'." +msgstr "Dwarf-fel: hittade adresstorleken \"%u\", denna läsare kan inte hantera storlekar större än \"%u\"." -#: dwarf2.c:1520 +#: dwarf2.c:1557 #, c-format -msgid "Dwarf Error: Bad abbrev number: %d." -msgstr "Dwarf-fel: Felaktigt förkortningsnummer: %d." +msgid "Dwarf Error: Bad abbrev number: %u." +msgstr "Dwarf-fel: Felaktigt förkortningsnummer: %u." -#: ecoff.c:1328 +#: ecoff.c:1318 #, c-format msgid "Unknown basic type %d" msgstr "Okänd grundtyp %d" -#: ecoff.c:1597 +#: ecoff.c:1578 #, c-format msgid "" "\n" @@ -546,7 +502,7 @@ msgstr "" "\n" " Symbol slut+1: %ld" -#: ecoff.c:1604 ecoff.c:1607 +#: ecoff.c:1585 ecoff.c:1588 #, c-format msgid "" "\n" @@ -555,7 +511,7 @@ msgstr "" "\n" " Första symbolen: %ld" -#: ecoff.c:1619 +#: ecoff.c:1600 #, c-format msgid "" "\n" @@ -564,7 +520,7 @@ msgstr "" "\n" " Symbol slut+1: %-7ld Typ: %s" -#: ecoff.c:1626 +#: ecoff.c:1607 #, c-format msgid "" "\n" @@ -573,7 +529,7 @@ msgstr "" "\n" " Lokal symbol: %ld" -#: ecoff.c:1634 +#: ecoff.c:1615 #, c-format msgid "" "\n" @@ -582,7 +538,7 @@ msgstr "" "\n" " struct; symbol slut+1: %ld" -#: ecoff.c:1639 +#: ecoff.c:1620 #, c-format msgid "" "\n" @@ -591,7 +547,7 @@ msgstr "" "\n" " union; symbol slut+1: %ld" -#: ecoff.c:1644 +#: ecoff.c:1625 #, c-format msgid "" "\n" @@ -600,7 +556,7 @@ msgstr "" "\n" " enum; symbol slut+1: %ld" -#: ecoff.c:1650 +#: ecoff.c:1631 #, c-format msgid "" "\n" @@ -609,37 +565,35 @@ msgstr "" "\n" " Typ: %s" -#: elf-hppa.h:1366 elf-hppa.h:1399 elf32-ppc.c:3062 elf32-sh.c:3201 -#: elf64-x86-64.c:1275 +#: elf-hppa.h:1476 elf-hppa.h:1509 elf32-ppc.c:3091 elf32-sh.c:4213 +#: elf64-sh64.c:1659 #, c-format -msgid "" -"%s: warning: unresolvable relocation against symbol `%s' from %s section" -msgstr "" -"%s: varning: olöslig omlokalisering mot symbolen \"%s\" från sektionen %s" +msgid "%s: warning: unresolvable relocation against symbol `%s' from %s section" +msgstr "%s: varning: olöslig omlokalisering mot symbolen \"%s\" från sektionen %s" -#: elf-m10200.c:463 elf-m10300.c:673 elf32-arm.h:2074 elf32-avr.c:835 -#: elf32-cris.c:1406 elf32-d10v.c:482 elf32-fr30.c:653 elf32-h8300.c:547 -#: elf32-i860.c:1048 elf32-m32r.c:1280 elf32-openrisc.c:455 elf32-v850.c:1691 -#: elf32-xstormy16.c:976 elf64-mmix.c:1164 +#: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2084 elf32-avr.c:833 +#: elf32-cris.c:1403 elf32-d10v.c:481 elf32-fr30.c:635 elf32-frv.c:809 +#: elf32-h8300.c:548 elf32-i860.c:1031 elf32-m32r.c:1278 elf32-openrisc.c:439 +#: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302 msgid "internal error: out of range error" msgstr "internt fel: utanför intervallet" -#: elf-m10200.c:467 elf-m10300.c:677 elf32-arm.h:2078 elf32-avr.c:839 -#: elf32-cris.c:1410 elf32-d10v.c:486 elf32-fr30.c:657 elf32-h8300.c:551 -#: elf32-i860.c:1052 elf32-m32r.c:1284 elf32-mips.c:7587 elf32-openrisc.c:459 -#: elf32-v850.c:1695 elf32-xstormy16.c:980 elf64-mips.c:4464 elf64-mmix.c:1168 +#: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2088 elf32-avr.c:837 +#: elf32-cris.c:1407 elf32-d10v.c:485 elf32-fr30.c:639 elf32-frv.c:813 +#: elf32-h8300.c:552 elf32-i860.c:1035 elf32-m32r.c:1282 elf32-openrisc.c:443 +#: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5264 msgid "internal error: unsupported relocation error" msgstr "internt fel: omlokaliseringen stöds inte" -#: elf-m10200.c:471 elf-m10300.c:681 elf32-arm.h:2082 elf32-d10v.c:490 -#: elf32-h8300.c:555 elf32-m32r.c:1288 +#: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2092 elf32-d10v.c:489 +#: elf32-h8300.c:556 elf32-m32r.c:1286 msgid "internal error: dangerous error" msgstr "internt fel: farligt fel" -#: elf-m10200.c:475 elf-m10300.c:685 elf32-arm.h:2086 elf32-avr.c:847 -#: elf32-cris.c:1418 elf32-d10v.c:494 elf32-fr30.c:665 elf32-h8300.c:559 -#: elf32-i860.c:1060 elf32-m32r.c:1292 elf32-openrisc.c:467 elf32-v850.c:1715 -#: elf32-xstormy16.c:988 elf64-mmix.c:1176 +#: elf-m10200.c:458 elf-m10300.c:668 elf32-arm.h:2096 elf32-avr.c:845 +#: elf32-cris.c:1415 elf32-d10v.c:493 elf32-fr30.c:647 elf32-frv.c:821 +#: elf32-h8300.c:560 elf32-i860.c:1043 elf32-m32r.c:1290 elf32-openrisc.c:451 +#: elf32-v850.c:1715 elf32-xstormy16.c:945 elf64-mmix.c:1314 msgid "internal error: unknown error" msgstr "internt fel: okänt fel" @@ -648,17 +602,17 @@ msgstr "internt fel: okänt fel" msgid "%s: invalid string offset %u >= %lu for section `%s'" msgstr "%s: ogiltigt strängavstånd %u >= %lu för sektionen \"%s\"" -#: elf.c:448 +#: elf.c:589 #, c-format msgid "%s: invalid SHT_GROUP entry" msgstr "%s: ogiltig SHT_GROUP-post" -#: elf.c:529 +#: elf.c:660 #, c-format msgid "%s: no group info for section %s" msgstr "%s: ingen gruppinformation för sektionen %s" -#: elf.c:840 +#: elf.c:1023 msgid "" "\n" "Program Header:\n" @@ -666,7 +620,7 @@ msgstr "" "\n" "Programhuvud:\n" -#: elf.c:889 +#: elf.c:1073 msgid "" "\n" "Dynamic Section:\n" @@ -674,7 +628,7 @@ msgstr "" "\n" "Dynamisk sektion:\n" -#: elf.c:1018 +#: elf.c:1202 msgid "" "\n" "Version definitions:\n" @@ -682,7 +636,7 @@ msgstr "" "\n" "Versionsdefinitioner:\n" -#: elf.c:1041 +#: elf.c:1225 msgid "" "\n" "Version References:\n" @@ -690,239 +644,181 @@ msgstr "" "\n" "Versionsreferenser:\n" -#: elf.c:1046 +#: elf.c:1230 #, c-format msgid " required from %s:\n" msgstr " krävs från %s:\n" -#: elf.c:1682 +#: elf.c:1902 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" msgstr "%s: ogiltig länk %lu för omlokaliseringssektion %s (index %u)" -#: elf.c:3296 +#: elf.c:3603 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" -msgstr "" -"%s: Inte tillräckligt med utrymme för programhuvuden (allokerade %u, behöver " -"%u)" +msgstr "%s: Inte tillräckligt med utrymme för programhuvuden (allokerade %u, behöver %u)" -#: elf.c:3400 +#: elf.c:3708 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" -msgstr "" -"%s: Inte tillräckligt med utrymme för programhuvuden, försök att länka med -N" +msgstr "%s: Inte tillräckligt med utrymme för programhuvuden, försök att länka med -N" -#: elf.c:3525 +#: elf.c:3833 #, c-format -msgid "" -"Error: First section in segment (%s) starts at 0x%x whereas the segment " -"starts at 0x%x" -msgstr "" -"Fel: Första sektionen i segmentet (%s) börjar vid 0x%x medan segmentet " -"börjar med 0x%x" +msgid "Error: First section in segment (%s) starts at 0x%x whereas the segment starts at 0x%x" +msgstr "Fel: Första sektionen i segmentet (%s) börjar vid 0x%x medan segmentet börjar med 0x%x" -#: elf.c:3811 +#: elf.c:4148 #, c-format msgid "%s: warning: allocated section `%s' not in segment" msgstr "%s: varning: allokerad sektion \"%s\" inte i segment" -#: elf.c:4142 +#: elf.c:4472 #, c-format msgid "%s: symbol `%s' required but not present" msgstr "%s: symbolen \"%s\" krävs men finns inte med" -#: elf.c:4395 +#: elf.c:4749 #, c-format -msgid "%s: warning: Empty loadable segment detected\n" -msgstr "%s: varning: Tomt inläsningsbart segment upptäckt\n" +msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" +msgstr "%s: varning: Tomt inläsningsbart segment upptäckt, är detta meningen?\n" -#: elf.c:5808 +#: elf.c:6193 #, c-format msgid "%s: unsupported relocation type %s" msgstr "%s: omlokaliseringstypen %s stöds inte" -#: elf32-arm.h:1224 +#: elf32-arm.h:1221 #, c-format msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." -msgstr "" -"%s: Varning: Arm BLX-instruktion använder Arm-funktionen \"%s\" som mål." +msgstr "%s: Varning: Arm BLX-instruktion använder Arm-funktionen \"%s\" som mål." -#: elf32-arm.h:1420 +#: elf32-arm.h:1417 #, c-format msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." -msgstr "" -"%s: Varning: Thumb BLX-instruktionen använder thumb-funktionen \"%s\" som " -"mål." +msgstr "%s: Varning: Thumb BLX-instruktionen använder thumb-funktionen \"%s\" som mål." -#: elf32-arm.h:1904 elf32-i386.c:1778 elf32-sh.c:3133 +#: elf32-arm.h:1914 elf32-sh.c:4125 #, c-format msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" msgstr "%s(%s+0x%lx): %s omlokalisering mot SEC_MERGE-sektion" -#: elf32-arm.h:1998 +#: elf32-arm.h:2008 #, c-format -msgid "" -"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" -msgstr "" -"%s: varning: olöslig omlokalisering %d mot symbolen \"%s\" från sektionen %s" - -#: elf32-arm.h:2166 -#, fuzzy, c-format -msgid "" -"Warning: Clearing the interworking flag of %s because non-interworking code " -"in %s has been linked with it" -msgstr "" -"Varning: Stänger av samverkandeflaggan i %s eftersom icke-samverkande kod i %" -"s har länkats med det" +msgid "%s: warning: unresolvable relocation %d against symbol `%s' from %s section" +msgstr "%s: varning: olöslig omlokalisering %d mot symbolen \"%s\" från sektionen %s" -#: elf32-arm.h:2261 +#: elf32-arm.h:2176 #, c-format -msgid "" -"Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" -msgstr "" -"Fel: %s kompilerades för EABI version %d, medan %s kompilerades för version %" -"d" +msgid "Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it" +msgstr "Varning: Stänger av samverkandeflaggan i %s eftersom icke-samverkande kod i %s har länkats med det" -#: elf32-arm.h:2275 +#: elf32-arm.h:2271 #, c-format -msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" -msgstr "Fel: %s kompilerad för APCS-%d, medan %s är kompilerad för APCS-%d" +msgid "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d" +msgstr "FEL: %s är kompilerad för EABI version %d, medan %s är kompilerad för version %d" -#: elf32-arm.h:2287 +#: elf32-arm.h:2285 #, c-format -msgid "" -"Error: %s passes floats in FP registers, whereas %s passes them in integer " -"registers" -msgstr "" -"Fel: %s skickar flyttal i flyttalsregister, medan %s skickar dem i " -"heltalsregister" +msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" +msgstr "FEL: %s är kompilerad för APCS-%d, medan målet %s använder APCS-%d" -#: elf32-arm.h:2292 +#: elf32-arm.h:2313 #, c-format -msgid "" -"Error: %s passes floats in integer registers, whereas %s passes them in FP " -"registers" -msgstr "" -"Fel: %s skickar flyttal i heltalsregister, medan %s skickar dem i " -"flyttalsregister" - -# Tror det saknas "uses" här -#: elf32-arm.h:2303 -#, fuzzy, c-format -msgid "Error: %s uses VFP instructions, whereas %s uses FPA instructions" -msgstr "" -"Fel: %s använder VFP-instruktioner, medan %s använder FPA-instruktioner" +msgid "ERROR: %s uses VFP instructions, whereas %s uses FPA instructions" +msgstr "FEL: %s använder VFP-instruktioner, medan %s använder FPA-instruktioner" -# Tror det saknas "uses" här -#: elf32-arm.h:2308 -#, fuzzy, c-format -msgid "Error: %s uses FPA instructions, whereas %s uses VFP instructions" -msgstr "" -"Fel: %s använder FPA-instruktioner, medan %s använder VFP-instruktioner" - -#: elf32-arm.h:2328 +#: elf32-arm.h:2318 #, c-format -msgid "Error: %s uses software FP, whereas %s uses hardware FP" -msgstr "Fel: %s använder programvaruflyttal, medan %s använder hårdvaruflyttal" +msgid "ERROR: %s uses FPA instructions, whereas %s uses VFP instructions" +msgstr "FEL: %s använder FPA-instruktioner, medan %s använder VFP-instruktioner" -#: elf32-arm.h:2333 +#: elf32-arm.h:2338 #, c-format -msgid "Error: %s uses hardware FP, whereas %s uses software FP" -msgstr "Fel: %s använder hårdvaruflyttal, medan %s använder programvaruflyttal" +msgid "ERROR: %s uses software FP, whereas %s uses hardware FP" +msgstr "FEL: %s använder programvaruflyttal, medan %s använder hårdvaruflyttal" -#: elf32-arm.h:2348 +#: elf32-arm.h:2343 #, c-format -msgid "Warning: %s supports interworking, whereas %s does not" -msgstr "Varning: %s stöder samverkande, medan %s däremot inte gör det" - -#: elf32-arm.h:2355 -#, c-format -msgid "Warning: %s does not support interworking, whereas %s does" -msgstr "Varning: %s stöder inte samverkande, medan %s däremot gör det" +msgid "ERROR: %s uses hardware FP, whereas %s uses software FP" +msgstr "FEL: %s använder hårdvaruflyttal, medan %s använder programvaruflyttal" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2386 elf32-cris.c:2991 elf32-m68k.c:410 elf32-mips.c:3242 +#: elf32-arm.h:2396 elf32-cris.c:2988 elf32-m68k.c:410 elf32-vax.c:543 +#: elfxx-mips.c:7756 #, c-format msgid "private flags = %lx:" msgstr "privata flaggor = %lx:" -#: elf32-arm.h:2395 +#: elf32-arm.h:2405 msgid " [interworking enabled]" msgstr " [samverkande är aktiverat]" -#: elf32-arm.h:2398 -msgid " [APCS-26]" -msgstr " [APCS-26]" - -#: elf32-arm.h:2400 -msgid " [APCS-32]" -msgstr " [APCS-32]" - -#: elf32-arm.h:2403 +#: elf32-arm.h:2413 msgid " [VFP float format]" msgstr " [VFP-flyttalsformat]" -#: elf32-arm.h:2405 +#: elf32-arm.h:2415 msgid " [FPA float format]" msgstr " [FPA-flyttalsformat]" -#: elf32-arm.h:2414 +#: elf32-arm.h:2424 msgid " [new ABI]" msgstr " [nytt ABI]" -#: elf32-arm.h:2417 +#: elf32-arm.h:2427 msgid " [old ABI]" msgstr " [gammalt ABI]" -#: elf32-arm.h:2420 +#: elf32-arm.h:2430 msgid " [software FP]" msgstr " [programvaru-FP]" -#: elf32-arm.h:2428 +#: elf32-arm.h:2438 msgid " [Version1 EABI]" msgstr " [Version1 EABI]" -#: elf32-arm.h:2431 elf32-arm.h:2442 +#: elf32-arm.h:2441 elf32-arm.h:2452 msgid " [sorted symbol table]" msgstr " [sorterad symboltabell]" -#: elf32-arm.h:2433 elf32-arm.h:2444 +#: elf32-arm.h:2443 elf32-arm.h:2454 msgid " [unsorted symbol table]" msgstr " [osorterad symboltabell]" -#: elf32-arm.h:2439 +#: elf32-arm.h:2449 msgid " [Version2 EABI]" msgstr " [Version2 EABI]" -#: elf32-arm.h:2447 +#: elf32-arm.h:2457 msgid " [dynamic symbols use segment index]" msgstr " [dynamiska symboler använder segmentindex]" -#: elf32-arm.h:2450 +#: elf32-arm.h:2460 msgid " [mapping symbols precede others]" msgstr " [mappsymboler har företräde före andra]" -#: elf32-arm.h:2457 +#: elf32-arm.h:2467 msgid " <EABI version unrecognised>" msgstr " <EABI-version känns inte igen>" -#: elf32-arm.h:2464 +#: elf32-arm.h:2474 msgid " [relocatable executable]" msgstr " [omlokaliseringsbar körbar fil]" -#: elf32-arm.h:2467 +#: elf32-arm.h:2477 msgid " [has entry point]" msgstr " [har startpunkt]" -#: elf32-arm.h:2472 +#: elf32-arm.h:2482 msgid "<Unrecognised flag bits set>" msgstr "<Okända flaggbitar satta>" -#: elf32-avr.c:843 elf32-cris.c:1414 elf32-fr30.c:661 elf32-i860.c:1056 -#: elf32-openrisc.c:463 elf32-v850.c:1699 elf32-xstormy16.c:984 -#: elf64-mmix.c:1172 +#: elf32-avr.c:841 elf32-cris.c:1411 elf32-fr30.c:643 elf32-frv.c:817 +#: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699 +#: elf32-xstormy16.c:941 elf64-mmix.c:1310 msgid "internal error: dangerous relocation" msgstr "internt fel: farlig omlokalisering" @@ -933,188 +829,198 @@ msgstr "%s: olöslig omlokalisering %s mot symbolen \"%s\" från sektionen %s" #: elf32-cris.c:1012 #, c-format -msgid "" -"%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" -msgstr "" -"%s: Varken någon PLT eller GOT för omlokalisering %s mot symbolen \"%s\" " -"från sektionen %s" +msgid "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" +msgstr "%s: Varken någon PLT eller GOT för omlokalisering %s mot symbolen \"%s\" från sektionen %s" -#: elf32-cris.c:1015 elf32-cris.c:1142 +#: elf32-cris.c:1015 elf32-cris.c:1141 msgid "[whose name is lost]" msgstr "[vars namn tappats bort]" -#: elf32-cris.c:1131 +#: elf32-cris.c:1130 #, c-format -msgid "" -"%s: relocation %s with non-zero addend %d against local symbol from %s " -"section" -msgstr "" -"%s: omlokalisering %s med icke-tomt addendum %d mot lokal symbol från " -"sektionen %s" +msgid "%s: relocation %s with non-zero addend %d against local symbol from %s section" +msgstr "%s: omlokalisering %s med icke-tomt addendum %d mot lokal symbol från sektionen %s" -#: elf32-cris.c:1138 +#: elf32-cris.c:1137 #, c-format -msgid "" -"%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" -msgstr "" -"%s: omlokalisering %s med icke-tomt addendum %d mot symbolen \"%s\" från " -"sektionen %s" +msgid "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" +msgstr "%s: omlokalisering %s med icke-tomt addendum %d mot symbolen \"%s\" från sektionen %s" -#: elf32-cris.c:1156 +#: elf32-cris.c:1155 #, c-format -msgid "" -"%s: relocation %s is not allowed for global symbol: `%s' from %s section" -msgstr "" -"%s: omlokaliseringen %s är inte tillåten för global symbol: \"%s\" från " -"sektionen %s" +msgid "%s: relocation %s is not allowed for global symbol: `%s' from %s section" +msgstr "%s: omlokaliseringen %s är inte tillåten för global symbol: \"%s\" från sektionen %s" -#: elf32-cris.c:1171 -#, fuzzy, c-format +#: elf32-cris.c:1170 +#, c-format msgid "%s: relocation %s in section %s with no GOT created" -msgstr "%s: omlokaliseringar i sektionen \"%s\", men den har inget innehåll" +msgstr "%s: omlokalisering %s i sektionen %s utan GOT skapad" -#: elf32-cris.c:1289 +#: elf32-cris.c:1288 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" msgstr "%s: Intern inkonsistens; ingen omlokaliseringssektion %s" -#: elf32-cris.c:2523 +#: elf32-cris.c:2514 #, c-format msgid "" "%s, section %s:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" "%s, sektion %s:\n" -" omlokaliseringen %s bör inte användas i ett delat objekt; kompilera om med " -"-fPIC" +" omlokaliseringen %s bör inte användas i ett delat objekt; kompilera om med -fPIC" -#: elf32-cris.c:2994 +#: elf32-cris.c:2991 msgid " [symbols have a _ prefix]" msgstr " [symboler har ett _-prefix]" -#: elf32-cris.c:3033 +#: elf32-cris.c:3030 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" -msgstr "" -"%s: använder symboler med _-prefix, men skriver fil med symboler utan prefix" +msgstr "%s: använder symboler med _-prefix, men skriver fil med symboler utan prefix" -#: elf32-cris.c:3034 +#: elf32-cris.c:3031 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" -msgstr "" -"%s: använder symboler utan prefix, men skriver fil med symboler med _-prefix" +msgstr "%s: använder symboler utan prefix, men skriver fil med symboler med _-prefix" + +#: elf32-frv.c:1217 +#, c-format +msgid "%s: compiled with %s and linked with modules that use non-pic relocations" +msgstr "%s: kompilerad med %s och länkad med moduler som använder icke-pic-omlokalisering" + +#: elf32-frv.c:1267 +#, c-format +msgid "%s: compiled with %s and linked with modules compiled with %s" +msgstr "%s: kompilerad med %s och länkad med moduler som kompilerats med %s" + +#: elf32-frv.c:1279 +#, c-format +msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%s: använder andra okända e_flags-fält (0x%lx) än tidigare moduler (0x%lx)" + +#: elf32-frv.c:1315 +#, c-format +msgid "private flags = 0x%lx:" +msgstr "privata flaggor = 0x%lx:" #: elf32-gen.c:82 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" msgstr "%s: Omlokalisering i allmän ELF (EM: %d)" -#: elf32-hppa.c:646 +#: elf32-hppa.c:671 elf64-ppc.c:2323 #, c-format msgid "%s: cannot create stub entry %s" msgstr "%s: kan inte skapa stubbstarten %s" -#: elf32-hppa.c:937 elf32-hppa.c:3545 +#: elf32-hppa.c:956 elf32-hppa.c:3555 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "%s(%s+0x%lx): kan inte nå %s, kompilera om med -ffunction-sections" -#: elf32-hppa.c:1312 +#: elf32-hppa.c:1338 elf64-x86-64.c:673 #, c-format -msgid "" -"%s: relocation %s can not be used when making a shared object; recompile " -"with -fPIC" -msgstr "" -"%s: omlokaliseringen %s kan inte användas då ett delat objekt skapas; " -"kompilera om med -fPIC" +msgid "%s: relocation %s can not be used when making a shared object; recompile with -fPIC" +msgstr "%s: omlokaliseringen %s kan inte användas då ett delat objekt skapas; kompilera om med -fPIC" -#: elf32-hppa.c:1332 +#: elf32-hppa.c:1358 #, c-format -msgid "" -"%s: relocation %s should not be used when making a shared object; recompile " -"with -fPIC" -msgstr "" -"%s: omlokaliseringen %s bör inte användas då ett delat objekt skapas; " -"kompilera om med -fPIC" +msgid "%s: relocation %s should not be used when making a shared object; recompile with -fPIC" +msgstr "%s: omlokaliseringen %s bör inte användas då ett delat objekt skapas; kompilera om med -fPIC" -#: elf32-hppa.c:1525 +#: elf32-hppa.c:1551 #, c-format msgid "Could not find relocation section for %s" msgstr "Kunde inte hitta omlokaliseringssektion för %s" -#: elf32-hppa.c:2867 +#: elf32-hppa.c:2855 #, c-format msgid "%s: duplicate export stub %s" msgstr "%s: dubbel exportstubb %s" -#: elf32-hppa.c:3429 +#: elf32-hppa.c:3433 #, c-format msgid "%s(%s+0x%lx): fixing %s" msgstr "%s(%s+0x%lx): fixar %s" -#: elf32-hppa.c:4069 +#: elf32-hppa.c:4080 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" msgstr "%s(%s+0x%lx): kan inte hantera %s för %s" -#: elf32-hppa.c:4408 +#: elf32-hppa.c:4393 msgid ".got section not immediately after .plt section" msgstr ".got-sektionen följer inte omedelbart efter .plt-sektion" -#: elf32-i386.c:298 +#: elf32-i386.c:379 #, c-format msgid "%s: invalid relocation type %d" msgstr "%s: ogiltig omlokaliseringstyp %d" -#: elf32-i386.c:718 elf32-s390.c:636 elf64-s390.c:595 +#: elf32-i386.c:876 elf32-s390.c:649 elf64-s390.c:595 elf64-x86-64.c:591 #, c-format msgid "%s: bad symbol index: %d" msgstr "%s: felaktigt symbolindex: %d" -#: elf32-i386.c:863 elf32-s390.c:790 elf64-ppc.c:2198 elf64-s390.c:759 +#: elf32-i386.c:948 +#, c-format +msgid "%s: `%s' accessed both as normal and thread local symbol" +msgstr "%s: \"%s\" anropad både som lokal normal symbol och lokal trådsymbol" + +#: elf32-i386.c:1072 elf32-s390.c:808 elf64-ppc.c:2827 elf64-s390.c:759 +#: elf64-x86-64.c:761 #, c-format msgid "%s: bad relocation section name `%s'" msgstr "%s: felaktig omlokaliseringssektionsnamn \"%s\"" -#: elf32-i386.c:2069 elf32-s390.c:1951 elf64-ppc.c:4124 elf64-s390.c:1955 +#: elf32-i386.c:1159 elf64-alpha.c:4768 +#, c-format +msgid "%s: TLS local exec code cannot be linked into shared objects" +msgstr "%s: lokal TLS-exekveringskod kan inte länkas in i delade objekt" + +#: elf32-i386.c:2747 elf32-s390.c:1981 elf32-sparc.c:1571 elf64-ppc.c:5918 +#: elf64-s390.c:1945 elf64-sparc.c:2578 elf64-x86-64.c:1948 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" msgstr "%s(%s+0x%lx): olöslig omlokalisering mot symbolen \"%s\"" -#: elf32-i386.c:2107 elf32-s390.c:1989 elf64-s390.c:1993 +#: elf32-i386.c:2784 elf32-s390.c:2019 elf64-ppc.c:5977 elf64-s390.c:1983 +#: elf64-x86-64.c:1986 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" msgstr "%s(%s+0x%lx): omlokalisering mot \"%s\": fel %d" -#: elf32-m32r.c:923 +#: elf32-m32r.c:924 msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "SDA-omlokalisering då _SDA_BASE_ inte är definierat" -#: elf32-ia64.c:3537 elf32-m32r.c:1007 elf32-ppc.c:2930 elf64-ia64.c:3537 +#: elf32-ia64.c:3687 elf32-m32r.c:1013 elf32-ppc.c:2987 elf64-alpha.c:4185 +#: elf64-alpha.c:4313 elf64-ia64.c:3687 #, c-format msgid "%s: unknown relocation type %d" msgstr "%s: okänd omlokaliseringstyp %d" -#: elf32-m32r.c:1223 +#: elf32-m32r.c:1221 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" msgstr "%s: Målet (%s) för en %s-omlokalisering är i fel sektion (%s)" -#: elf32-m32r.c:2000 +#: elf32-m32r.c:1947 #, c-format msgid "%s: Instruction set mismatch with previous modules" msgstr "%s: Instruktionsuppsättning passar inte med tidigare moduler" -#: elf32-m32r.c:2023 +#: elf32-m32r.c:1970 #, c-format msgid "private flags = %lx" msgstr "privata flaggor = %lx" -#: elf32-m32r.c:2028 +#: elf32-m32r.c:1975 msgid ": m32r instructions" msgstr ": m32r-instruktioner" -#: elf32-m32r.c:2029 +#: elf32-m32r.c:1976 msgid ": m32rx instructions" msgstr ": m32rx-instruktioner" @@ -1122,255 +1028,177 @@ msgstr ": m32rx-instruktioner" msgid " [cpu32]" msgstr " [cpu32]" -#: elf32-mcore.c:353 elf32-mcore.c:479 +#: elf32-m68k.c:416 +msgid " [m68000]" +msgstr " [m68000]" + +#: elf32-mcore.c:354 elf32-mcore.c:457 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "%s: Omlokalisering %s (%d) stöds för närvarande inte.\n" -#: elf32-mcore.c:438 +#: elf32-mcore.c:442 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "%s: Okänd omlokaliseringstyp %d\n" -#: elf32-mips.c:2156 elf64-mips.c:1972 +#: elf32-mips.c:1152 elf64-mips.c:1783 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "32-bitars gp-relativ omlokalisering förekom för en extern symbol" -#: elf32-mips.c:2305 +#: elf32-mips.c:1301 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "Länkning av mips16-objekt till %s-format stöds inte" -#: elf32-mips.c:3129 +#: elf32-ppc.c:1460 #, c-format -msgid "%s: linking PIC files with non-PIC files" -msgstr "%s: länkar PIC-filer med icke-PIC-filer" +msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" +msgstr "%s: kompilerad med -mrelocatable och länkad med moduler som kompilerats normalt" -#: elf32-mips.c:3139 +#: elf32-ppc.c:1468 #, c-format -msgid "%s: linking abicalls files with non-abicalls files" -msgstr "%s: länkar abicalls-filer med icke-abicalls-filer" +msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" +msgstr "%s: kompilerad normalt och länkad med moduler som kompilerats med -mrelocatable" -#: elf32-mips.c:3168 -#, c-format -msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" -msgstr "%s: ISA (-mips%d) passar inte med tidigare moduler (-mips%d)" - -#: elf32-mips.c:3177 -#, c-format -msgid "%s: ISA mismatch (%d) with previous modules (%d)" -msgstr "%s: ISA (%d) passar inte med tidigare moduler (%d)" - -#: elf32-mips.c:3200 -#, c-format -msgid "%s: ABI mismatch: linking %s module with previous %s modules" -msgstr "%s: ABI passar inte: länkar %s-modul med tidigare %s-moduler" - -#: elf32-mips.c:3214 elf32-ppc.c:1470 elf64-ppc.c:1556 elf64-sparc.c:3027 +#: elf32-ppc.c:1494 elf64-sparc.c:2989 elfxx-mips.c:7713 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "%s: använder andra e_flags-fält (0x%lx) än tidigare moduler (0x%lx)" -#: elf32-mips.c:3245 -msgid " [abi=O32]" -msgstr " [abi=O32]" - -#: elf32-mips.c:3247 -msgid " [abi=O64]" -msgstr " [abi=O64]" - -#: elf32-mips.c:3249 -msgid " [abi=EABI32]" -msgstr " [abi=EABI32]" - -#: elf32-mips.c:3251 -msgid " [abi=EABI64]" -msgstr " [abi=EABI64]" - -#: elf32-mips.c:3253 -msgid " [abi unknown]" -msgstr " [okänt abi]" - -#: elf32-mips.c:3255 -msgid " [abi=N32]" -msgstr " [abi=N32]" - -#: elf32-mips.c:3257 -msgid " [abi=64]" -msgstr " [abi=64]" - -#: elf32-mips.c:3259 -msgid " [no abi set]" -msgstr " [inget abi inställt]" - -#: elf32-mips.c:3262 -msgid " [mips1]" -msgstr " [mips1]" - -#: elf32-mips.c:3264 -msgid " [mips2]" -msgstr " [mips2]" - -#: elf32-mips.c:3266 -msgid " [mips3]" -msgstr " [mips3]" - -#: elf32-mips.c:3268 -msgid " [mips4]" -msgstr " [mips4]" - -#: elf32-mips.c:3270 -msgid " [mips5]" -msgstr " [mips5]" - -#: elf32-mips.c:3272 -msgid " [mips32]" -msgstr " [mips32]" - -#: elf32-mips.c:3274 -msgid " [mips64]" -msgstr " [mips64]" - -#: elf32-mips.c:3276 -msgid " [unknown ISA]" -msgstr " [okänd ISA]" - -#: elf32-mips.c:3279 -msgid " [32bitmode]" -msgstr " [32-bitarsläge]" - -#: elf32-mips.c:3281 -msgid " [not 32bitmode]" -msgstr " [inte 32-bitarsläge]" - -#: elf32-mips.c:4954 -msgid "static procedure (no name)" -msgstr "statisk procedur (inget namn)" - -#: elf32-mips.c:5572 elf64-mips.c:6694 -#, c-format -msgid "%s: illegal section name `%s'" -msgstr "%s: ogiltigt sektionsnamn \"%s\"" - -#: elf32-mips.c:6139 elf64-mips.c:3150 -msgid "not enough GOT space for local GOT entries" -msgstr "inte tillräckligt med GOT-utrymme för lokala GOT-poster" - -#: elf32-mips.c:7250 elf64-mips.c:4203 -#, c-format -msgid "%s: %s+0x%lx: jump to stub routine which is not jal" -msgstr "%s: %s+0x%lx: hoppa till stubbrutin som inte är jal" - -#: elf32-mips.c:8259 elf64-mips.c:5891 -#, c-format -msgid "%s: Malformed reloc detected for section %s" -msgstr "%s: Felaktig omlokalisering för sektion %s upptäckt" - -#: elf32-mips.c:8337 elf64-mips.c:5969 -#, c-format -msgid "%s: CALL16 reloc at 0x%lx not against global symbol" -msgstr "%s: CALL16-omlokalisering vid 0x%lx är inte mot global symbol" - -#: elf32-ppc.c:1436 elf64-ppc.c:1521 -#, c-format -msgid "" -"%s: compiled with -mrelocatable and linked with modules compiled normally" -msgstr "" -"%s: kompilerad med -mrelocatable och länkad med moduler som kompilerats " -"normalt" - -#: elf32-ppc.c:1444 elf64-ppc.c:1529 -#, c-format -msgid "" -"%s: compiled normally and linked with modules compiled with -mrelocatable" -msgstr "" -"%s: kompilerad normalt och länkad med moduler som kompilerats med -" -"mrelocatable" - -#: elf32-ppc.c:1568 +#: elf32-ppc.c:1592 #, c-format msgid "%s: Unknown special linker type %d" msgstr "%s: Okänd speciallänkartyp %d" -#: elf32-ppc.c:2218 elf32-ppc.c:2252 elf32-ppc.c:2287 +#: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" msgstr "%s: omlokaliseringen %s kan inte användas då ett delat objekt skapas" -#: elf32-ppc.c:3097 elf64-ppc.c:3716 +#: elf32-ppc.c:3126 elf64-ppc.c:5473 #, c-format msgid "%s: unknown relocation type %d for symbol %s" msgstr "%s: okänd omlokaliseringstyp %d för symbolen %s" -#: elf32-ppc.c:3452 elf32-ppc.c:3473 elf32-ppc.c:3523 +#: elf32-ppc.c:3482 elf32-ppc.c:3503 elf32-ppc.c:3553 #, c-format -msgid "" -"%s: The target (%s) of a %s relocation is in the wrong output section (%s)" +msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "%s: Målet (%s) för en %s-omlokalisering är i fel utdatasektion (%s)" -#: elf32-ppc.c:3589 +#: elf32-ppc.c:3619 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." msgstr "%s: Omlokaliseringen %s stöds inte än för symbolen %s." -#: elf32-sh.c:1101 +#: elf32-sh.c:1964 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES offset" msgstr "%s: 0x%lx: varning: felaktigt R_SH_USES-avstånd" -#: elf32-sh.c:1113 +#: elf32-sh.c:1976 #, c-format msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "%s: 0x%lx: varning: R_SH_USES pekar till okänd instruktion 0x%x" -#: elf32-sh.c:1130 +#: elf32-sh.c:1993 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" msgstr "%s: 0x%lx: varning: felaktigt R_SH_USES-inläsningsavstånd" -#: elf32-sh.c:1145 +#: elf32-sh.c:2008 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" msgstr "%s: 0x%lx: varning: kunde inte hitta förväntad omlokalisering" -#: elf32-sh.c:1202 +#: elf32-sh.c:2036 #, c-format msgid "%s: 0x%lx: warning: symbol in unexpected section" msgstr "%s: 0x%lx: varning: symbol i oväntad sektion" -#: elf32-sh.c:1323 +#: elf32-sh.c:2153 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" msgstr "%s: 0x%lx: varning: kunde inte hitta förväntad COUNT-omlokalisering" -#: elf32-sh.c:1332 +#: elf32-sh.c:2162 #, c-format msgid "%s: 0x%lx: warning: bad count" msgstr "%s: 0x%lx: varning: felaktigt antal" -#: elf32-sh.c:1741 elf32-sh.c:2132 +#: elf32-sh.c:2550 elf32-sh.c:2926 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" msgstr "%s: 0x%lx: ödesdigert: omlokalisering ger överspill vid förenklingen" -#: elf32-sh.c:3267 +#: elf32-sh.c:4073 elf64-sh64.c:1576 +msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +msgstr "Oväntat STO_SH5_ISA32 på lokal symbol hanteras inte" + +#: elf32-sh.c:4284 #, c-format msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" -msgstr "" -"%s: 0x%lx: ödesdigert: ojusterat grenmål för omlokalisering för " -"förenklingsstöd" +msgstr "%s: 0x%lx: ödesdigert: ojusterat grenmål för omlokalisering för förenklingsstöd" -#: elf32-sparc.c:1554 elf64-sparc.c:2280 +#: elf32-sh64.c:203 elf64-sh64.c:2364 +#, c-format +msgid "%s: compiled as 32-bit object and %s is 64-bit" +msgstr "%s: kompilerat som 32-bitarsobjekt och %s är 64-bitars" + +#: elf32-sh64.c:206 elf64-sh64.c:2367 +#, c-format +msgid "%s: compiled as 64-bit object and %s is 32-bit" +msgstr "%s: kompilerat som 64-bitarsobjekt och %s är 32-bitars" + +#: elf32-sh64.c:208 elf64-sh64.c:2369 +#, c-format +msgid "%s: object size does not match that of target %s" +msgstr "%s: objektstorleken stämmer inte överens med den hos målet %s" + +#: elf32-sh64.c:440 elf64-sh64.c:2941 +#, c-format +msgid "%s: encountered datalabel symbol in input" +msgstr "%s: påträffade dataetikettssymbol i indata" + +#: elf32-sh64.c:523 +msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" +msgstr "PTB passar inte: en SHmedia-adress (bit 0 == 1)" + +#: elf32-sh64.c:526 +msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" +msgstr "PTA passar inte: en SHcompact-adress (bit 0 == 0)" + +#: elf32-sh64.c:544 +#, c-format +msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" +msgstr "%s: GAS-fel: oväntad PTB-instruktion med R_SH_PT_16" + +#: elf32-sh64.c:593 elf64-sh64.c:1703 +#, c-format +msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" +msgstr "%s: fel: ojusterad omlokaliseringstyp %d på %08x omlokalisering %08x\n" + +#: elf32-sh64.c:677 +#, c-format +msgid "%s: could not write out added .cranges entries" +msgstr "%s: kunde inte skriva ut tillagda .cranges-poster" + +#: elf32-sh64.c:739 +#, c-format +msgid "%s: could not write out sorted .cranges entries" +msgstr "%s: kunde inte skriva ut sorterade cranges-poster" + +#: elf32-sparc.c:1535 elf64-sparc.c:2224 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "%s: troligen kompilerad utan -fPIC?" -#: elf32-sparc.c:2007 +#: elf32-sparc.c:2002 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "%s: kompilerat för ett 64-bitarssystem och målet är 32-bitars" -#: elf32-sparc.c:2021 +#: elf32-sparc.c:2016 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "%s: länkar little endian-filer med big endian-filer" @@ -1382,32 +1210,23 @@ msgstr "Variabel \"%s\" kan inte befinna sig i flera små dataområden" #: elf32-v850.c:685 #, c-format -msgid "" -"Variable `%s' can only be in one of the small, zero, and tiny data regions" -msgstr "" -"Variabel \"%s\" kan bara vara i ett av de små, tomma och pyttesmå " -"dataområdena" +msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions" +msgstr "Variabel \"%s\" kan bara vara i ett av de små, tomma och pyttesmå dataområdena" #: elf32-v850.c:688 #, c-format -msgid "" -"Variable `%s' cannot be in both small and zero data regions simultaneously" -msgstr "" -"Variabel \"%s\" kan inte vara i både små och tomma dataområden samtidigt" +msgid "Variable `%s' cannot be in both small and zero data regions simultaneously" +msgstr "Variabel \"%s\" kan inte vara i både små och tomma dataområden samtidigt" #: elf32-v850.c:691 #, c-format -msgid "" -"Variable `%s' cannot be in both small and tiny data regions simultaneously" -msgstr "" -"Variabel \"%s\" kan inte vara i både små och pyttesmå dataområden samtidigt" +msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously" +msgstr "Variabel \"%s\" kan inte vara i både små och pyttesmå dataområden samtidigt" #: elf32-v850.c:694 #, c-format -msgid "" -"Variable `%s' cannot be in both zero and tiny data regions simultaneously" -msgstr "" -"Variabel \"%s\" kan inte vara i både tomma och pyttesmå dataområden samtidigt" +msgid "Variable `%s' cannot be in both zero and tiny data regions simultaneously" +msgstr "Variabel \"%s\" kan inte vara i både tomma och pyttesmå dataområden samtidigt" #: elf32-v850.c:1072 msgid "FAILED to find previous HI16 reloc\n" @@ -1425,246 +1244,494 @@ msgstr "kunde inte lokalisera speciell länkarsymbol __ep" msgid "could not locate special linker symbol __ctbp" msgstr "kunde inte lokalisera speciell länkarsymbol __ctbp" -#: elf32-v850.c:1877 +#: elf32-v850.c:1875 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "%s: Arkitekturen passar inte ihop med tidigare moduler" -#: elf32-v850.c:1897 +#: elf32-v850.c:1895 #, c-format msgid "private flags = %lx: " msgstr "privata flaggor = %lx: " -#: elf32-v850.c:1902 +#: elf32-v850.c:1900 msgid "v850 architecture" msgstr "v850-arkitektur" -#: elf32-v850.c:1903 +#: elf32-v850.c:1901 msgid "v850e architecture" msgstr "v850e-arkitektur" -#: elf32-v850.c:1904 +#: elf32-v850.c:1902 msgid "v850ea architecture" msgstr "v850ea-arkitektur" -#: elf32-ia64.c:2247 elf32-xstormy16.c:414 elf64-ia64.c:2247 +#: elf32-vax.c:546 +msgid " [nonpic]" +msgstr " [icke-pic]" + +#: elf32-vax.c:549 +msgid " [d-float]" +msgstr " [d-flyttal]" + +#: elf32-vax.c:552 +msgid " [g-float]" +msgstr " [g-flyttal]" + +#: elf32-vax.c:674 +#, c-format +msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld" +msgstr "%s: varning: GOT-addendum %ld till \"%s\" stämmer inte överens med tidigare GOT-addendum %ld" + +#: elf32-vax.c:1679 +#, c-format +msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" +msgstr "%s: varning: PLT-addendum %d till \"%s\" från sektionen %s ignorerades" + +#: elf32-vax.c:1814 +#, c-format +msgid "%s: warning: %s relocation against symbol `%s' from %s section" +msgstr "%s: varning: %s-omlokalisering mot symbolen \"%s\" från sektionen %s" + +#: elf32-vax.c:1820 +#, c-format +msgid "%s: warning: %s relocation to 0x%x from %s section" +msgstr "%s: varning: %s-omlokalisering till 0x%x från sektionen %s" + +#: elf32-ia64.c:2280 elf32-xstormy16.c:414 elf64-ia64.c:2280 msgid "non-zero addend in @fptr reloc" msgstr "icke-tomt addendum i @fptr-omlokalisering" -#: elf64-alpha.c:858 +#: elf64-alpha.c:1097 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "GPDISP-omlokalisering hittade inga ldah- och lda-instruktioner" -#: elf64-alpha.c:2934 +#: elf64-alpha.c:3675 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "%s: .got-subsegment överskrider 64 kB (storlek %d)" -#: elf64-alpha.c:3518 elf64-alpha.c:3530 +#: elf64-alpha.c:4498 elf64-alpha.c:4510 #, c-format msgid "%s: gp-relative relocation against dynamic symbol %s" msgstr "%s: gp-relativ omlokalisering mot dynamiska symbolen %s" -#: elf64-hppa.c:2070 +#: elf64-alpha.c:4536 elf64-alpha.c:4676 +#, c-format +msgid "%s: pc-relative relocation against dynamic symbol %s" +msgstr "%s: pc-relativ omlokalisering mot dynamiska symbolen %s" + +#: elf64-alpha.c:4564 +#, c-format +msgid "%s: change in gp: BRSGP %s" +msgstr "%s: ändring i gp: BRSGP %s" + +#: elf64-alpha.c:4589 +msgid "<unknown>" +msgstr "<okänd>" + +#: elf64-alpha.c:4594 +#, c-format +msgid "%s: !samegp reloc against symbol without .prologue: %s" +msgstr "%s: !samegp-omlokalisering mot symbol utan .prologue: %s" + +#: elf64-alpha.c:4639 +#, c-format +msgid "%s: unhandled dynamic relocation against %s" +msgstr "%s: ohanterad dynamisk omlokalisering mot %s" + +#: elf64-alpha.c:4752 +#, c-format +msgid "%s: dtp-relative relocation against dynamic symbol %s" +msgstr "%s: dtp-relativ omlokalisering mot dynamiska symbolen %s" + +#: elf64-alpha.c:4775 +#, c-format +msgid "%s: tp-relative relocation against dynamic symbol %s" +msgstr "%s: tp-relativ omlokalisering mot dynamiska symbolen %s" + +#: elf64-hppa.c:2080 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "stubbpost för %s kan inte läsa in .plt, dp-avstånd = %ld" -# Bör rapportera detta -# -# (_("%s: register relocation against non-register symbol: %s in %s"), -# bfd_get_filename (input_section->owner), -# symname == NULL || *symname == 0 ? _("(unknown)") : symname, -# bfd_get_section_name (symsec->owner, symsec)); -# -#: elf64-mmix.c:1271 -#, fuzzy, c-format +#: elf64-mmix.c:1002 +#, c-format +msgid "" +"%s: Internal inconsistency error for value for\n" +" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n" +msgstr "" +"%s: Intern inkkonsistensfel för värdet för\n" +" länkarallokerat globalt register: länkat: 0x%lx%08lx != avslappnat: 0x%lx%08lx\n" + +#: elf64-mmix.c:1386 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s" +msgstr "%s: bas-plus-avståndsomlokalisering mot registersymbol: (okänd) i %s" + +#: elf64-mmix.c:1391 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: %s in %s" +msgstr "%s: bas-plus-avståndsomlokalisering mot registersymbol: %s i %s" + +#: elf64-mmix.c:1435 +#, c-format msgid "%s: register relocation against non-register symbol: (unknown) in %s" -msgstr "%s: registeromlokalisering mot icke-registersymbol: %s i %s" +msgstr "%s: registeromlokalisering mot icke-registersymbol: (okänd) i %s" -# Bör rapportera detta -# -# (_("%s: register relocation against non-register symbol: %s in %s"), -# bfd_get_filename (input_section->owner), -# symname == NULL || *symname == 0 ? _("(unknown)") : symname, -# bfd_get_section_name (symsec->owner, symsec)); -# -#: elf64-mmix.c:1276 +#: elf64-mmix.c:1440 #, c-format msgid "%s: register relocation against non-register symbol: %s in %s" msgstr "%s: registeromlokalisering mot icke-registersymbol: %s i %s" -#: elf64-mmix.c:1312 +#: elf64-mmix.c:1477 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" -msgstr "" -"%s: LOCAL-direktivet är endast giltigt med ett register eller absolutvärde" +msgstr "%s: LOCAL-direktivet är endast giltigt med ett register eller absolutvärde" -#: elf64-mmix.c:1340 +#: elf64-mmix.c:1505 #, c-format -msgid "" -"%s: LOCAL directive: Register $%ld is not a local register. First global " -"register is $%ld." -msgstr "" -"%s: LOCAL-direktiv: Register $%ld är inte ett lokalt register. Första " -"globala registret är $%ld." +msgid "%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld." +msgstr "%s: LOCAL-direktiv: Register $%ld är inte ett lokalt register. Första globala registret är $%ld." -#: elf64-mmix.c:1615 +#: elf64-mmix.c:1965 #, c-format -msgid "" -"%s: Error: multiple definition of `%s'; start of %s is set in a earlier " -"linked file\n" -msgstr "" -"%s: Fel: flera definitioner av \"%s\"; början på %s är inställd i en " -"tidigare länkad fil\n" +msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n" +msgstr "%s: Fel: flera definitioner av \"%s\"; början på %s är inställd i en tidigare länkad fil\n" -#: elf64-mmix.c:1674 +#: elf64-mmix.c:2024 msgid "Register section has contents\n" msgstr "Registersektion har innehåll\n" -#: elf64-ppc.c:1484 libbfd.c:1436 +#: elf64-mmix.c:2186 +#, c-format +msgid "" +"Internal inconsistency: remaining %u != max %u.\n" +" Please report this bug." +msgstr "" +"Intern inkonsekvens: återstående %u != max %u.\n" +" Rapportera gärna detta fel." + +#: elf64-ppc.c:1669 libbfd.c:1435 #, c-format msgid "%s: compiled for a big endian system and target is little endian" msgstr "%s: kompilerad för big endian-system och målet är little endian" -#: elf64-ppc.c:1486 libbfd.c:1438 +#: elf64-ppc.c:1671 libbfd.c:1437 #, c-format msgid "%s: compiled for a little endian system and target is big endian" msgstr "%s: kompilerad för ett little endian-system och målet är big endian" -#: elf64-ppc.c:3350 -#, fuzzy, c-format +#: elf64-ppc.c:3610 +#, c-format +msgid "%s: unexpected reloc type %u in .opd section" +msgstr "%s: oväntad omlokaliseringstyp %u i .opd-sektion" + +#: elf64-ppc.c:3630 +#, c-format +msgid "%s: .opd is not a regular array of opd entries" +msgstr "%s: .opd är inte en vanlig vektor med opd-poster" + +#: elf64-ppc.c:3672 +#, c-format +msgid "%s: undefined sym `%s' in .opd section" +msgstr "%s: odefinierad symbol \"%s\" i .opd-sektion" + +#: elf64-ppc.c:4397 +#, c-format +msgid "can't find branch stub `%s'" +msgstr "kan inte hitta grenstubb \"%s\"" + +#: elf64-ppc.c:4436 elf64-ppc.c:4501 +#, c-format msgid "linkage table error against `%s'" -msgstr "länktabell spiller över mot \"%s\"" +msgstr "länktabellsfel mot \"%s\"" + +#: elf64-ppc.c:4573 +#, c-format +msgid "can't build branch stub `%s'" +msgstr "kan inte bygga grenstubb \"%s\"" -#: elf64-ppc.c:3432 -msgid "stub section size doesn't match calculated size" -msgstr "stubbsektionsstorleken stämmer inte överens med beräknad storlek" +#: elf64-ppc.c:5179 +msgid "stubs don't match calculated size" +msgstr "stubbar stämmer inte överens med beräknad storlek" -#: elf64-ppc.c:4061 +#: elf64-ppc.c:5828 #, c-format msgid "%s: Relocation %s is not supported for symbol %s." msgstr "%s: Omlokaliseringen %s stöds inte för symbolen %s." -#: elf64-ppc.c:4105 +#: elf64-ppc.c:5872 #, c-format msgid "%s: error: relocation %s not a multiple of 4" msgstr "%s: fel: omlokaliseringen %s är inte en multipel av 4" -#: elf64-sparc.c:1277 +#: elf64-sparc.c:1280 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" msgstr "%s: check_relocs: ohanterad omlokaliseringstyp %d" -#: elf64-sparc.c:1314 +#: elf64-sparc.c:1317 #, c-format msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "%s: Endast register %%g[2367] kan deklareras med STT_REGISTER" -#: elf64-sparc.c:1334 -#, fuzzy, c-format +#: elf64-sparc.c:1337 +#, c-format msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" -msgstr "Register %%g%d används inkompatibelt: %s i %s" +msgstr "Register %%g%d används inkompatibelt: %s i %s, tidigare %s i %s" -#: elf64-sparc.c:1357 -#, fuzzy, c-format +#: elf64-sparc.c:1360 +#, c-format msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" -msgstr "Symbolen \"%s\" har olika typer: tidigare %s, REGISTER i %s" +msgstr "Symbolen \"%s\" har olika typer: REGISTER i %s, tidigare %s i %s" -#: elf64-sparc.c:1404 -#, fuzzy, c-format +#: elf64-sparc.c:1406 +#, c-format msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" -msgstr "Symbolen \"%s\" har olika typer: tidigare %s, REGISTER i %s" +msgstr "Symbolen \"%s\" har olika typer: %s i %s, tidigare REGISTER i %s" -#: elf64-sparc.c:3008 +#: elf64-sparc.c:2970 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "%s: länkar UltraSPARC-specifik med HAL-specifik kod" -#: elfcode.h:1218 +#: elfcode.h:1198 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "%s: versionsantal (%ld) stämmer inte med symbolantal (%ld)" -#: elflink.c:434 +#: elflink.c:440 #, c-format msgid "%s: Section %s is too large to add hole of %ld bytes" msgstr "%s: Sektionen %s är för stor för att stoppa hål med %ld byte i" -#: elflink.h:1113 +#: elflink.h:1090 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" msgstr "%s: varning: oväntad omdefinition av \"%s\"" -#: elflink.h:1784 +#: elflink.h:1727 #, c-format msgid "%s: %s: invalid version %u (max %d)" msgstr "%s: %s: ogiltig version %u (max %d)" -#: elflink.h:1825 +#: elflink.h:1768 #, c-format msgid "%s: %s: invalid needed version %d" msgstr "%s: %s: ogiltig krävd version %d" -#: elflink.h:1945 +#: elflink.h:1890 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" msgstr "Varning: storleken på symbolen \"%s\" ändrades från %lu till %lu i %s" -#: elflink.h:4014 +#: elflink.h:3174 +#, c-format +msgid "%s: .preinit_array section is not allowed in DSO" +msgstr "%s: .preinit_array-sektionen är inte tillåten i DSO" + +#: elflink.h:4030 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" -msgstr "" -"varning: typen och storleken på dynamiska symbolen \"%s\" är inte definierade" +msgstr "varning: typen och storleken på dynamiska symbolen \"%s\" är inte definierade" -#: elflink.h:4320 +#: elflink.h:4345 #, c-format msgid "%s: undefined versioned symbol name %s" msgstr "%s: odefinierat symbolnamn med version %s" -#: elflink.h:4544 elflink.h:4552 elflink.h:6203 elflink.h:7280 +#: elflink.h:4611 elflink.h:4619 elflink.h:6508 elflink.h:7600 msgid "Error: out of memory" msgstr "Fel: slut på minne" -#: elflink.h:4714 +#: elflink.h:4781 msgid "Not enough memory to sort relocations" msgstr "Inte tillräckligt med minne för att sortera omlokaliseringar" -#: elflink.h:5980 +#: elflink.h:5682 elflink.h:5725 +#, c-format +msgid "%s: could not find output section %s" +msgstr "%s: kunde inte hitta utdatasektionen %s" + +#: elflink.h:5688 +#, c-format +msgid "warning: %s section has zero size" +msgstr "varning: %s-sektionen har nollstorlek" + +#: elflink.h:6275 #, c-format msgid "%s: could not find output section %s for input section %s" -msgstr "%s: kunde inte hitta utdatasektion %s för indatasektionen %s" +msgstr "%s: kunde inte hitta utdatasektionen %s för indatasektionen %s" -#: elflink.h:6553 +#: elflink.h:6486 +#, c-format +msgid "%s: relocation size mismatch in %s section %s" +msgstr "%s: omlokaliseringsstorleken stämmer inte överens i %s-sektionen %s" + +#: elflink.h:6849 msgid "warning: relocation against removed section; zeroing" msgstr "varning: omlokalisering mot borttagen sektion; nollställer" -#: elflink.h:6583 +#: elflink.h:6879 msgid "warning: relocation against removed section" msgstr "varning: omlokalisering mot borttagen sektion" -#: elflink.h:6596 +#: elflink.h:6892 #, c-format msgid "local symbols in discarded section %s" msgstr "lokala symboler i bortkastade sektionen %s" -#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 +#: elfxx-mips.c:734 +msgid "static procedure (no name)" +msgstr "statisk procedur (inget namn)" + +#: elfxx-mips.c:1601 +msgid "not enough GOT space for local GOT entries" +msgstr "inte tillräckligt med GOT-utrymme för lokala GOT-poster" + +#: elfxx-mips.c:2750 +#, c-format +msgid "%s: %s+0x%lx: jump to stub routine which is not jal" +msgstr "%s: %s+0x%lx: hoppa till stubbrutin som inte är jal" + +#: elfxx-mips.c:4270 +#, c-format +msgid "%s: Malformed reloc detected for section %s" +msgstr "%s: Felaktig omlokalisering för sektion %s upptäckt" + +#: elfxx-mips.c:4348 +#, c-format +msgid "%s: CALL16 reloc at 0x%lx not against global symbol" +msgstr "%s: CALL16-omlokalisering vid 0x%lx är inte mot global symbol" + +#: elfxx-mips.c:7301 +#, c-format +msgid "%s: illegal section name `%s'" +msgstr "%s: ogiltigt sektionsnamn \"%s\"" + +#: elfxx-mips.c:7615 +#, c-format +msgid "%s: linking PIC files with non-PIC files" +msgstr "%s: länkar PIC-filer med icke-PIC-filer" + +#: elfxx-mips.c:7625 +#, c-format +msgid "%s: linking abicalls files with non-abicalls files" +msgstr "%s: länkar abicalls-filer med icke-abicalls-filer" + +#: elfxx-mips.c:7654 +#, c-format +msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" +msgstr "%s: ISA (-mips%d) passar inte med tidigare moduler (-mips%d)" + +#: elfxx-mips.c:7676 +#, c-format +msgid "%s: ISA mismatch (%d) with previous modules (%d)" +msgstr "%s: ISA (%d) passar inte med tidigare moduler (%d)" + +#: elfxx-mips.c:7699 +#, c-format +msgid "%s: ABI mismatch: linking %s module with previous %s modules" +msgstr "%s: ABI passar inte: länkar %s-modul med tidigare %s-moduler" + +#: elfxx-mips.c:7759 +msgid " [abi=O32]" +msgstr " [abi=O32]" + +#: elfxx-mips.c:7761 +msgid " [abi=O64]" +msgstr " [abi=O64]" + +#: elfxx-mips.c:7763 +msgid " [abi=EABI32]" +msgstr " [abi=EABI32]" + +#: elfxx-mips.c:7765 +msgid " [abi=EABI64]" +msgstr " [abi=EABI64]" + +#: elfxx-mips.c:7767 +msgid " [abi unknown]" +msgstr " [okänt abi]" + +#: elfxx-mips.c:7769 +msgid " [abi=N32]" +msgstr " [abi=N32]" + +#: elfxx-mips.c:7771 +msgid " [abi=64]" +msgstr " [abi=64]" + +#: elfxx-mips.c:7773 +msgid " [no abi set]" +msgstr " [inget abi inställt]" + +#: elfxx-mips.c:7776 +msgid " [mips1]" +msgstr " [mips1]" + +#: elfxx-mips.c:7778 +msgid " [mips2]" +msgstr " [mips2]" + +#: elfxx-mips.c:7780 +msgid " [mips3]" +msgstr " [mips3]" + +#: elfxx-mips.c:7782 +msgid " [mips4]" +msgstr " [mips4]" + +#: elfxx-mips.c:7784 +msgid " [mips5]" +msgstr " [mips5]" + +#: elfxx-mips.c:7786 +msgid " [mips32]" +msgstr " [mips32]" + +#: elfxx-mips.c:7788 +msgid " [mips64]" +msgstr " [mips64]" + +#: elfxx-mips.c:7790 +msgid " [unknown ISA]" +msgstr " [okänd ISA]" + +#: elfxx-mips.c:7793 +msgid " [mdmx]" +msgstr " [mdmx]" + +#: elfxx-mips.c:7796 +msgid " [mips16]" +msgstr " [mips16]" + +#: elfxx-mips.c:7799 +msgid " [32bitmode]" +msgstr " [32-bitarsläge]" + +#: elfxx-mips.c:7801 +msgid " [not 32bitmode]" +msgstr " [inte 32-bitarsläge]" + +#: i386linux.c:458 m68klinux.c:462 sparclinux.c:459 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "Utdatafilen kräver delade biblioteket \"%s\"\n" -#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 +#: i386linux.c:466 m68klinux.c:470 sparclinux.c:467 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "Utdatafilen kräver delade biblioteket \"%s.so.%s\"\n" -#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 -#: sparclinux.c:655 sparclinux.c:705 +#: i386linux.c:655 i386linux.c:705 m68klinux.c:662 m68klinux.c:710 +#: sparclinux.c:657 sparclinux.c:707 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "Symbolen %s är inte definierad för fixar\n" -#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 +#: i386linux.c:729 m68klinux.c:734 sparclinux.c:731 msgid "Warning: fixup count mismatch\n" msgstr "Varning: antalet fixar stämmer inte\n" @@ -1678,9 +1745,8 @@ msgstr "%s: strängen är för lång (%d tecken, max 65535)" msgid "%s: unrecognized symbol `%s' flags 0x%x" msgstr "%s: okänd symbol \"%s\" flaggor 0x%x" -# Ett extra blanksteg i originalet här #: ieee.c:877 -#, fuzzy, c-format +#, c-format msgid "%s: unimplemented ATI record %u for symbol %u" msgstr "%s: inte implementerad ATI-post %u för symbolen %u" @@ -1699,56 +1765,48 @@ msgstr "%s: oväntad typ efter ATN" msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" msgstr "%s:%d: oväntat tecken \"%s\" i hexadecimal Intel-fil\n" -#: ihex.c:368 +#: ihex.c:366 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" -msgstr "" -"%s:%u: felaktig kontrollsumma i hexadecimal Intel-fil (förväntade %u, " -"hittade %u)" +msgstr "%s:%u: felaktig kontrollsumma i hexadecimal Intel-fil (förväntade %u, hittade %u)" -#: ihex.c:422 +#: ihex.c:420 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" -msgstr "" -"%s:%u: felaktig längd på post för utökad adress i hexadecimal Intel-fil" +msgstr "%s:%u: felaktig längd på post för utökad adress i hexadecimal Intel-fil" -#: ihex.c:439 +#: ihex.c:437 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" msgstr "%s:%u: felaktig längd på utökad startadress i hexadecimal Intel-fil" -#: ihex.c:456 +#: ihex.c:454 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" -msgstr "" -"%s:%u: felaktig längd på post för utökad linjär adress i hexadecimal Intel-" -"fil" +msgstr "%s:%u: felaktig längd på post för utökad linjär adress i hexadecimal Intel-fil" -#: ihex.c:473 +#: ihex.c:471 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" -msgstr "" -"%s:%u: felaktig längd på post för utökad linjär startadress i hexadecimal " -"Intel-fil" +msgstr "%s:%u: felaktig längd på post för utökad linjär startadress i hexadecimal Intel-fil" -#: ihex.c:490 +#: ihex.c:488 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" msgstr "%s:%u: okänd ihex-typ %u i hexadecimal Intel-fil\n" -#: ihex.c:610 +#: ihex.c:607 #, c-format msgid "%s: internal error in ihex_read_section" msgstr "%s: internt fel i ihex_read_section" -#: ihex.c:645 +#: ihex.c:642 #, c-format msgid "%s: bad section length in ihex_read_section" msgstr "%s: felaktig sektionslängd i ihex_read_sektion" -# Verkar vara stavfel i originalet här -#: ihex.c:863 -#, fuzzy, c-format +#: ihex.c:860 +#, c-format msgid "%s: address 0x%s out of range for Intel Hex file" msgstr "%s: adressen 0x%s är utanför intervallet för hexadecimal Intel-fil" @@ -1761,28 +1819,27 @@ msgstr "mappar inte: data=%lx mappat=%d\n" msgid "not mapping: env var not set\n" msgstr "mappar inte: miljövariabel är inte satt\n" -#: libbfd.c:1467 -#, fuzzy, c-format +#: libbfd.c:1466 +#, c-format msgid "Deprecated %s called at %s line %d in %s\n" -msgstr " vid %s rad %d i %s\n" +msgstr "Föråldrad %s anropad vid %s rad %d i %s\n" -# Skumt! -#: libbfd.c:1470 -#, fuzzy, c-format +#: libbfd.c:1469 +#, c-format msgid "Deprecated %s called\n" -msgstr "Föråldrad %s anropad" +msgstr "Föråldrad %s anropad\n" -#: linker.c:1849 +#: linker.c:1873 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" msgstr "%s: indirekt symbol \"%s\" till \"%s\" är en slinga" -#: linker.c:2745 +#: linker.c:2776 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" msgstr "Försök att göra en omlokaliseringsbar länk med %s-indata och %s-utdata" -#: merge.c:897 +#: merge.c:892 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" msgstr "%s: åtkomst bortom slut på sammanslagen sektion (%ld + %ld)" @@ -1792,162 +1849,127 @@ msgstr "%s: åtkomst bortom slut på sammanslagen sektion (%ld + %ld)" msgid "%s: No core to allocate section name %s\n" msgstr "%s: Ingen kärna för att allokera sektionsnamn %s\n" -#: mmo.c:537 +#: mmo.c:536 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "%s: Ingen kärna för att allokera en %d byte lång symbol\n" -#: mmo.c:1190 +#: mmo.c:1245 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" msgstr "%s: ogiltig mmo-fil: initieringsvärde för $255 är inte \"Main\"\n" -#: mmo.c:1336 +#: mmo.c:1391 #, c-format -msgid "" -"%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name " -"starting with `%s'\n" -msgstr "" -"%s: bred teckensekvens som inte stöds 0x%02X 0x%02X efter symbolnamnet som " -"börjar med \"%s\"\n" +msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n" +msgstr "%s: bred teckensekvens som inte stöds 0x%02X 0x%02X efter symbolnamnet som börjar med \"%s\"\n" -#: mmo.c:1571 +#: mmo.c:1633 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "%s: ogiltig mmo-fil: lopkod \"%d\" stöds inte\n" -#: mmo.c:1581 +#: mmo.c:1643 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" msgstr "%s: ogiltig mmo-fil: förväntade YZ = 1 fick YZ = %d för lop_quote\n" -#: mmo.c:1617 +#: mmo.c:1679 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" -msgstr "" -"%s: ogiltig mmo-fil: förväntade z = 1 eller z = 2, fick z = %d för lop_loc\n" +msgstr "%s: ogiltig mmo-fil: förväntade z = 1 eller z = 2, fick z = %d för lop_loc\n" -#: mmo.c:1663 +#: mmo.c:1725 #, c-format -msgid "" -"%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" -msgstr "" -"%s: ogiltig mmo-fil: förväntade z = 1 eller z = 2, fick z = %d för lop_fixo\n" +msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" +msgstr "%s: ogiltig mmo-fil: förväntade z = 1 eller z = 2, fick z = %d för lop_fixo\n" -#: mmo.c:1702 +#: mmo.c:1764 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" msgstr "%s: ogiltig mmo-fil: förväntade y = 0, fick y = %d för lop_fixrx\n" -#: mmo.c:1711 +#: mmo.c:1773 #, c-format -msgid "" -"%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" -msgstr "" -"%s: ogiltig mmo-fil: förväntade z = 16 eller z = 24, fick z = %d för " -"lop_fixr\n" +msgid "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" +msgstr "%s: ogiltig mmo-fil: förväntade z = 16 eller z = 24, fick z = %d för lop_fixr\n" -#: mmo.c:1734 +#: mmo.c:1796 #, c-format -msgid "" -"%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d " -"for lop_fixrx\n" -msgstr "" -"%s: ogiltig mmo-fil: inledande byte i operandord måste vara 0 eller 1, fick %" -"d för lop_fixrx\n" +msgid "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n" +msgstr "%s: ogiltig mmo-fil: inledande byte i operandord måste vara 0 eller 1, fick %d för lop_fixrx\n" -#: mmo.c:1757 +#: mmo.c:1819 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" msgstr "%s: kan inte allokera filnamn för fil nummer %d, %d byte\n" -#: mmo.c:1777 +#: mmo.c:1839 #, c-format -msgid "" -"%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" -msgstr "" -"%s: ogiltig mmo-fil: fil nummer %d \"%s\", var redan angiven som \"%s\"\n" +msgid "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" +msgstr "%s: ogiltig mmo-fil: fil nummer %d \"%s\", var redan angiven som \"%s\"\n" -#: mmo.c:1790 +#: mmo.c:1852 #, c-format -msgid "" -"%s: invalid mmo file: file name for number %d was not specified before use\n" -msgstr "" -"%s: ogiltig mmo-fil: filnamnet för nummer %d angavs inte innan användning\n" +msgid "%s: invalid mmo file: file name for number %d was not specified before use\n" +msgstr "%s: ogiltig mmo-fil: filnamnet för nummer %d angavs inte innan användning\n" -#: mmo.c:1896 +#: mmo.c:1958 #, c-format -msgid "" -"%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" -msgstr "" -"%s: ogiltig mmo-fil: fälten y och z i lop_stab är icke-tomma, y: %d, z: %d\n" +msgid "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" +msgstr "%s: ogiltig mmo-fil: fälten y och z i lop_stab är icke-tomma, y: %d, z: %d\n" -#: mmo.c:1932 +#: mmo.c:1994 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" msgstr "%s: ogiltig mmo-fil: lop_end är inte sista objektet i fil\n" -#: mmo.c:1945 +#: mmo.c:2007 #, c-format -msgid "" -"%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras " -"to the preceding lop_stab (%ld)\n" -msgstr "" -"%s: ogiltig mmo-fil: YZ i lop_end (%ld) är inte lika med antalet tetra till " -"den föregående lop_stab (%ld)\n" +msgid "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras to the preceding lop_stab (%ld)\n" +msgstr "%s: ogiltig mmo-fil: YZ i lop_end (%ld) är inte lika med antalet tetra till den föregående lop_stab (%ld)\n" -#: mmo.c:2610 +#: mmo.c:2670 #, c-format msgid "%s: invalid symbol table: duplicate symbol `%s'\n" msgstr "%s: ogiltig symboltabell: dublettsymbol \"%s\"\n" -#: mmo.c:2898 +#: mmo.c:2921 #, c-format -msgid "" -"%s: Bad symbol definition: `Main' set to %s rather than the start address %" -"s\n" -msgstr "" -"%s: Felaktig symboldefinition: \"Main\" är inställd till %s istället för " -"startadressen %s\n" +msgid "%s: Bad symbol definition: `Main' set to %s rather than the start address %s\n" +msgstr "%s: Felaktig symboldefinition: \"Main\" är inställd till %s istället för startadressen %s\n" -#: mmo.c:2932 +#: mmo.c:3011 #, c-format -msgid "" -"%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: " -"%d. Only `Main' will be emitted.\n" -msgstr "" -"%s: varning: symboltabellen är för stor för mmo, större än 65535 32-bitars " -"ord: %d. Endast \"Main\" kommer att skickas.\n" +msgid "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: %d. Only `Main' will be emitted.\n" +msgstr "%s: varning: symboltabellen är för stor för mmo, större än 65535 32-bitars ord: %d. Endast \"Main\" kommer att skickas.\n" -#: mmo.c:2977 +#: mmo.c:3056 #, c-format msgid "%s: internal error, symbol table changed size from %d to %d words\n" msgstr "%s: internt fel, symboltabellen ändrade storlek från %d till %d ord\n" -#: mmo.c:3032 +#: mmo.c:3111 #, c-format msgid "%s: internal error, internal register section %s had contents\n" msgstr "%s: internt fel, interna registersektionen %s hade innehåll\n" -#: mmo.c:3084 +#: mmo.c:3163 #, c-format msgid "%s: no initialized registers; section length 0\n" msgstr "%s: inga initierade register; sektionslängd 0\n" -#: mmo.c:3090 +#: mmo.c:3169 #, c-format msgid "%s: too many initialized registers; section length %ld\n" msgstr "%s: för många initierade register; sektionslängd %ld\n" -#: mmo.c:3095 +#: mmo.c:3174 #, c-format -msgid "" -"%s: invalid start address for initialized registers of length %ld: 0x%lx%" -"08lx\n" -msgstr "" -"%s: ogiltig startadress för initierade register med längden %ld: 0x%lx%08lx\n" +msgid "%s: invalid start address for initialized registers of length %ld: 0x%lx%08lx\n" +msgstr "%s: ogiltig startadress för initierade register med längden %ld: 0x%lx%08lx\n" -#: oasys.c:1036 +#: oasys.c:1029 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "%s: kan inte representera sektionen \"%s\" i oasys" @@ -2005,9 +2027,7 @@ msgstr "%s: Okänd maskintyp (0x%x) i Import Library Format-arkiv" #: peicode.h:1174 #, c-format -msgid "" -"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " -"archive" +msgid "%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive" msgstr "%s: Känd men ohanterad maskintyp (0x%x) i Import Library Format-arkiv" #: peicode.h:1191 @@ -2072,7 +2092,7 @@ msgstr "Sektor för partition[%d] = 0x%.8lx (%ld)\n" msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "Längd på partition[%d] = 0x%.8lx (%ld)\n" -#: som.c:5402 +#: som.c:5398 msgid "som_sizeof_headers unimplemented" msgstr "som_sizeof_headers är inte implementerat" @@ -2081,7 +2101,13 @@ msgstr "som_sizeof_headers är inte implementerat" msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "%s:%d: Oväntat tecken \"%s\" i S-postfil\n" -#: syms.c:998 +# Vad är stabs? +#: stabs.c:319 +#, c-format +msgid "%s(%s+0x%lx): Stabs entry has invalid string index." +msgstr "%s(%s+0x%lx): Stabbpost har ogiltigt strängindex." + +#: syms.c:1044 msgid "Unsupported .stab relocation" msgstr ".stab-omlokalisering som inte stöds" @@ -2100,7 +2126,7 @@ msgstr "bfd_set_section_flags (%s, %x) misslyckades" msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "Storleken passar inte på sektion %s=%lx, %s=%lx" -#: vms-gsd.c:704 +#: vms-gsd.c:702 #, c-format msgid "unknown gsd/egsd subtype %d" msgstr "okänd gsd/egsd-undertyp %d" @@ -2141,24 +2167,24 @@ msgid "No Mem !" msgstr "Inget minne!" #: vms-tir.c:362 -#, fuzzy, c-format +#, c-format msgid "bad section index in %s" -msgstr "Felaktigt sektionsindex i ETIR_S_C_STA_PQ" +msgstr "felaktigt sektionsindex i %s" #: vms-tir.c:375 -#, fuzzy, c-format +#, c-format msgid "unsupported STA cmd %s" -msgstr "STA-kommando %d stöds inte" +msgstr "STA-kommando %s stöds inte" #: vms-tir.c:380 vms-tir.c:1240 -#, fuzzy, c-format +#, c-format msgid "reserved STA cmd %d" -msgstr "Reserverat STA-kommando %d" +msgstr "reserverat STA-kommando %d" #: vms-tir.c:491 vms-tir.c:514 -#, fuzzy, c-format +#, c-format msgid "%s: no symbol \"%s\"" -msgstr "%s: ingen sådan symbol" +msgstr "%s: ingen symbol \"%s\"" #. unsigned shift #. rotate @@ -2166,41 +2192,39 @@ msgstr "%s: ingen sådan symbol" #. Define a literal. #: vms-tir.c:581 vms-tir.c:693 vms-tir.c:803 vms-tir.c:821 vms-tir.c:829 #: vms-tir.c:838 vms-tir.c:1563 -#, fuzzy, c-format +#, c-format msgid "%s: not supported" -msgstr "stöder inte" +msgstr "%s: stöds inte" #: vms-tir.c:586 vms-tir.c:1418 -#, fuzzy, c-format +#, c-format msgid "%s: not implemented" -msgstr "%s: oimplementerat %s\n" +msgstr "%s: inte implementerad" #: vms-tir.c:590 vms-tir.c:1422 -#, fuzzy, c-format +#, c-format msgid "reserved STO cmd %d" -msgstr "Reserverat STO-kommando %d" +msgstr "reserverat STO-kommando %d" #: vms-tir.c:708 vms-tir.c:1568 -#, fuzzy, c-format +#, c-format msgid "reserved OPR cmd %d" -msgstr "Reserverat OPR-kommando %d" +msgstr "reserverat OPR-kommando %d" #: vms-tir.c:776 vms-tir.c:1632 -#, fuzzy, c-format +#, c-format msgid "reserved CTL cmd %d" -msgstr "Reserverat CTL-kommando %d" +msgstr "reserverat CTL-kommando %d" #. stack byte from image #. arg: none. #: vms-tir.c:1148 -#, fuzzy msgid "stack-from-image not implemented" -msgstr "Stac-from-image är inte implementerat" +msgstr "stack-from-image är inte implementerat" #: vms-tir.c:1166 -#, fuzzy msgid "stack-entry-mask not fully implemented" -msgstr "Stack-entry-mask är inte helt implementerat" +msgstr "stack-entry-mask är inte helt implementerat" #. compare procedure argument #. arg: cs symbol name @@ -2214,30 +2238,27 @@ msgid "PASSMECH not fully implemented" msgstr "PASSMECH är inte helt implementerat" #: vms-tir.c:1199 -#, fuzzy msgid "stack-local-symbol not fully implemented" -msgstr "Stack-local-symbol är inte helt implementerat" +msgstr "stack-local-symbol är inte helt implementerat" #: vms-tir.c:1212 -#, fuzzy msgid "stack-literal not fully implemented" -msgstr "Stack-literal är inte helt implementerat" +msgstr "stack-literal är inte helt implementerat" #: vms-tir.c:1233 -#, fuzzy msgid "stack-local-symbol-entry-point-mask not fully implemented" -msgstr "Stack-local-symbol-entry-point-mask är inte helt implementerat" +msgstr "stack-local-symbol-entry-point-mask är inte helt implementerat" #: vms-tir.c:1510 vms-tir.c:1522 vms-tir.c:1534 vms-tir.c:1546 vms-tir.c:1611 #: vms-tir.c:1619 vms-tir.c:1627 -#, fuzzy, c-format +#, c-format msgid "%s: not fully implemented" -msgstr "PASSMECH är inte helt implementerat" +msgstr "%s: inte helt implementerat" #: vms-tir.c:1684 -#, fuzzy, c-format +#, c-format msgid "obj code %d not found" -msgstr "Objektkod %d kunde inte hittas" +msgstr "objektkod %d kunde inte hittas" #: vms-tir.c:2019 #, c-format @@ -2249,150 +2270,149 @@ msgstr "SEC_RELOC utan omlokaliseringar i sektion %s" msgid "Unhandled relocation %s" msgstr "Ohanterad omlokalisering %s" -#: xcofflink.c:1241 +#: xcofflink.c:1243 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "%s: \"%s\" har radnummer men ingen inneslutande sektion" -#: xcofflink.c:1294 +#: xcofflink.c:1296 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "%s: klass %d-symbolen \"%s\" har inga yttre poster" -#: xcofflink.c:1317 +#: xcofflink.c:1319 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "%s: symbolen \"%s\" har okänd csect-typ %d" -#: xcofflink.c:1329 +#: xcofflink.c:1331 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "%s: felaktig XTY_ER-symbol \"%s\": klass %d scnum %d scnlen %d" -#: xcofflink.c:1365 +#: xcofflink.c:1367 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "%s: XMC_TC0-symbolen \"%s\" är klass %d scnlen %d" -#: xcofflink.c:1517 +#: xcofflink.c:1519 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "%s: csect \"%s\" är inte i inneslutande sektion" -#: xcofflink.c:1624 +#: xcofflink.c:1626 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "%s: felaktigt placerat XTY_LD \"%s\"" -#: xcofflink.c:1948 +#: xcofflink.c:1957 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "%s: omlokaliseringen %s:%d är inte i csect" -#: xcofflink.c:2083 +#: xcofflink.c:2092 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "%s: XCOFF delade objekt när inte XCOFF-utdata produceras" -#: xcofflink.c:2104 +#: xcofflink.c:2113 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "%s: dynamiskt objekt utan någon .loader-sektion" -#: xcofflink.c:2749 +#: xcofflink.c:2758 #, c-format msgid "%s: no such symbol" msgstr "%s: ingen sådan symbol" -#: xcofflink.c:2890 +#: xcofflink.c:2891 msgid "error: undefined symbol __rtinit" msgstr "fel: odefinierad symbol __rtinit" -#: xcofflink.c:3458 +#: xcofflink.c:3453 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "varning: försök att exportera odefinierade symbolen \"%s\"" -#: xcofflink.c:4452 +#: xcofflink.c:4447 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" -msgstr "" -"TOC ger överspill: 0x%lx > 0x10000; prova -mminimal-toc vid kompilering" +msgstr "TOC ger överspill: 0x%lx > 0x10000; prova -mminimal-toc vid kompilering" -#: xcofflink.c:5292 xcofflink.c:5754 xcofflink.c:5816 xcofflink.c:6117 +#: xcofflink.c:5287 xcofflink.c:5756 xcofflink.c:5818 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "%s: inläsaromlokalisering i okända sektionen \"%s\"" -#: xcofflink.c:5314 xcofflink.c:6128 +#: xcofflink.c:5309 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "%s: \"%s\" i inläsaromlokalisering men inte inläsarsym" -#: xcofflink.c:5329 +#: xcofflink.c:5324 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "%s: inläsaromlokalisering i skrivskyddade sektionen %s" -#: elf32-ia64.c:2189 elf64-ia64.c:2189 +#: elf32-ia64.c:2222 elf64-ia64.c:2222 msgid "@pltoff reloc against local symbol" msgstr "@pltoff-omlokalisering mot lokal symbol" -#: elf32-ia64.c:3413 elf64-ia64.c:3413 +#: elf32-ia64.c:3562 elf64-ia64.c:3562 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "%s: kort datasegment spillde över (0x%lx >= 0x400000)" -#: elf32-ia64.c:3424 elf64-ia64.c:3424 +#: elf32-ia64.c:3573 elf64-ia64.c:3573 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "%s: __gp täcker inte kort datasegment" -#: elf32-ia64.c:3728 elf64-ia64.c:3728 +#: elf32-ia64.c:3858 elf64-ia64.c:3858 #, c-format msgid "%s: linking non-pic code in a shared library" msgstr "%s: länkar icke-pic-kod i delat bibliotek" -#: elf32-ia64.c:3761 elf64-ia64.c:3761 +#: elf32-ia64.c:3891 elf64-ia64.c:3891 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" msgstr "%s: @gprel-omlokalisering mot dynamiska symbolen %s" -#: elf32-ia64.c:3900 elf64-ia64.c:3900 +#: elf32-ia64.c:4030 elf64-ia64.c:4030 #, c-format msgid "%s: dynamic relocation against speculation fixup" msgstr "%s: dynamisk omlokalisering utan spekulationsfixar" -#: elf32-ia64.c:3908 elf64-ia64.c:3908 +#: elf32-ia64.c:4038 elf64-ia64.c:4038 #, c-format msgid "%s: speculation fixup against undefined weak symbol" msgstr "%s: spekulationsfix mot odefinierad svag symbol" -#: elf32-ia64.c:4092 elf64-ia64.c:4092 +#: elf32-ia64.c:4271 elf64-ia64.c:4271 msgid "unsupported reloc" msgstr "omlokaliseringen stöds inte" -#: elf32-ia64.c:4372 elf64-ia64.c:4372 +#: elf32-ia64.c:4551 elf64-ia64.c:4551 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" msgstr "%s: länkar fånga-vid-NULL-dereferens med ickefångande filer" -#: elf32-ia64.c:4381 elf64-ia64.c:4381 +#: elf32-ia64.c:4560 elf64-ia64.c:4560 #, c-format msgid "%s: linking big-endian files with little-endian files" msgstr "%s: länkar big endian-filer med little endian-filer" -#: elf32-ia64.c:4390 elf64-ia64.c:4390 +#: elf32-ia64.c:4569 elf64-ia64.c:4569 #, c-format msgid "%s: linking 64-bit files with 32-bit files" msgstr "%s: länkar 64-bitarsfiler med 32-bitarsfiler" -#: elf32-ia64.c:4399 elf64-ia64.c:4399 +#: elf32-ia64.c:4578 elf64-ia64.c:4578 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" msgstr "%s: länkar konstant-gp-filer med icke-konstant-gp-filer" -#: elf32-ia64.c:4409 elf64-ia64.c:4409 +#: elf32-ia64.c:4588 elf64-ia64.c:4588 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" msgstr "%s: länkar auto-pic-filer med icke-auto-pic-filer" @@ -2473,8 +2493,7 @@ msgid "" "There is an import table, but the section containing it could not be found\n" msgstr "" "\n" -"Det finns en importtabell, men sektionen som innehåller den kunde inte " -"hittas\n" +"Det finns en importtabell, men sektionen som innehåller den kunde inte hittas\n" #: peigen.c:1076 pepigen.c:1076 #, c-format @@ -2518,13 +2537,14 @@ msgstr "" # Vad är thunk? #: peigen.c:1130 pepigen.c:1130 -#, fuzzy msgid "" " vma: Hint Time Forward DLL First\n" " Table Stamp Chain Name Thunk\n" -msgstr " tabell stämpel kedja namn thunk\n" +msgstr "" +" vma: Tips- Tids- Framåt- DLL- Första\n" +" tabell stämpel kedja namn thunk\n" -#: peigen.c:1180 pepigen.c:1180 +#: peigen.c:1181 pepigen.c:1181 #, c-format msgid "" "\n" @@ -2533,32 +2553,27 @@ msgstr "" "\n" "\tDLL-namn: %s\n" -#: peigen.c:1184 peigen.c:1247 pepigen.c:1184 pepigen.c:1247 -msgid "\tvma: Hint/Ord Member-Name\n" -msgstr "\tvma: Tips/Vanligt medlemsnamn\n" - -#: peigen.c:1246 pepigen.c:1246 -msgid "\tThe Import Address Table (difference found)\n" -msgstr "\tImportadresstabellen (skillnad hittad)\n" +#: peigen.c:1192 pepigen.c:1192 +msgid "\tvma: Hint/Ord Member-Name Bound-To\n" +msgstr "\tvma: Tips/Ordn Medlemsnamn Bundet till\n" -#: peigen.c:1253 pepigen.c:1253 -msgid "\t>>> Ran out of IAT members!\n" -msgstr "\t>>> Slut på IAT-medlemmar!\n" - -#: peigen.c:1271 pepigen.c:1271 -msgid "\tThe Import Address Table is identical\n" -msgstr "\tImportadresstabellen är identisk\n" +#: peigen.c:1217 pepigen.c:1217 +msgid "" +"\n" +"There is a first thunk, but the section containing it could not be found\n" +msgstr "" +"\n" +"Det finns en första thunk, men sektionen som innehåller den kunde inte hittas\n" -#: peigen.c:1343 pepigen.c:1343 +#: peigen.c:1357 pepigen.c:1357 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" "\n" -"Det finns en exporttabell, men sektionen som innehåller den kunde inte " -"hittas\n" +"Det finns en exporttabell, men sektionen som innehåller den kunde inte hittas\n" -#: peigen.c:1348 pepigen.c:1348 +#: peigen.c:1362 pepigen.c:1362 #, c-format msgid "" "\n" @@ -2567,7 +2582,7 @@ msgstr "" "\n" "Det finns en exporttabell i %s vid 0x%lx\n" -#: peigen.c:1379 pepigen.c:1379 +#: peigen.c:1393 pepigen.c:1393 #, c-format msgid "" "\n" @@ -2577,61 +2592,61 @@ msgstr "" "\n" "Exporttabellerna (tolkade innehåll i %s-sektion)\n" -#: peigen.c:1383 pepigen.c:1383 +#: peigen.c:1397 pepigen.c:1397 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "Exportflaggor \t\t\t%lx\n" -#: peigen.c:1386 pepigen.c:1386 +#: peigen.c:1400 pepigen.c:1400 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "Tid-/Datumstämpel \t\t%lx\n" -#: peigen.c:1389 pepigen.c:1389 +#: peigen.c:1403 pepigen.c:1403 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "Övre/Undre \t\t\t%d/%d\n" -#: peigen.c:1392 pepigen.c:1392 +#: peigen.c:1406 pepigen.c:1406 msgid "Name \t\t\t\t" msgstr "Namn \t\t\t\t" -#: peigen.c:1398 pepigen.c:1398 +#: peigen.c:1412 pepigen.c:1412 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "Ordningsbas \t\t\t%ld\n" -#: peigen.c:1401 pepigen.c:1401 +#: peigen.c:1415 pepigen.c:1415 msgid "Number in:\n" msgstr "Tal i:\n" -#: peigen.c:1404 pepigen.c:1404 +#: peigen.c:1418 pepigen.c:1418 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "\tExportadresstabell \t\t%08lx\n" -#: peigen.c:1408 pepigen.c:1408 +#: peigen.c:1422 pepigen.c:1422 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "\t[Namnpekare/Ordningstal]-tabell\t%08lx\n" -#: peigen.c:1411 pepigen.c:1411 +#: peigen.c:1425 pepigen.c:1425 msgid "Table Addresses\n" msgstr "Tabelladresser\n" -#: peigen.c:1414 pepigen.c:1414 +#: peigen.c:1428 pepigen.c:1428 msgid "\tExport Address Table \t\t" msgstr "\tExportadresstabell \t\t" -#: peigen.c:1419 pepigen.c:1419 +#: peigen.c:1433 pepigen.c:1433 msgid "\tName Pointer Table \t\t" msgstr "\tNamnpekartabell \t\t" -#: peigen.c:1424 pepigen.c:1424 +#: peigen.c:1438 pepigen.c:1438 msgid "\tOrdinal Table \t\t\t" msgstr "\tOrdningstalstabell \t\t\t" -#: peigen.c:1439 pepigen.c:1439 +#: peigen.c:1453 pepigen.c:1453 #, c-format msgid "" "\n" @@ -2640,15 +2655,15 @@ msgstr "" "\n" "Exportadresstabell -- Orningsbas %ld\n" -#: peigen.c:1458 pepigen.c:1458 +#: peigen.c:1472 pepigen.c:1472 msgid "Forwarder RVA" msgstr "Vidarebefordrar-RVA" -#: peigen.c:1469 pepigen.c:1469 +#: peigen.c:1483 pepigen.c:1483 msgid "Export RVA" msgstr "Export-RVA" -#: peigen.c:1476 pepigen.c:1476 +#: peigen.c:1490 pepigen.c:1490 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" @@ -2656,13 +2671,12 @@ msgstr "" "\n" "[Ordningstals-/Namnpekar-]tabell\n" -#: peigen.c:1531 pepigen.c:1531 +#: peigen.c:1545 pepigen.c:1545 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" -msgstr "" -"Varning, storleken på .pdata-sektionen (%ld) är inte en multipel av %d\n" +msgstr "Varning, storleken på .pdata-sektionen (%ld) är inte en multipel av %d\n" -#: peigen.c:1535 pepigen.c:1535 +#: peigen.c:1549 pepigen.c:1549 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" @@ -2670,41 +2684,31 @@ msgstr "" "\n" "Funktionstabellen (tolkade innehåll från .pdata-sektionen)\n" -#: peigen.c:1538 pepigen.c:1538 +#: peigen.c:1552 pepigen.c:1552 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr " vma:\t\t\tStartadress Slutadress Ospola information\n" -# This is broken -# -# #ifdef COFF_WITH_pep -# fprintf (file, -# _(" vma:\t\t\tBegin Address End Address Unwind Info\n")); -# #else -# fprintf (file, -# _(" vma:\t\tBegin End EH EH PrologEnd Exception\n")); -# fprintf (file, -# _(" \t\tAddress Address Handler Data Address Mask\n")); -# -#: peigen.c:1540 pepigen.c:1540 -#, fuzzy +#: peigen.c:1554 pepigen.c:1554 msgid "" " vma:\t\tBegin End EH EH PrologEnd Exception\n" " \t\tAddress Address Handler Data Address Mask\n" -msgstr " vma:\t\tStart- Slut- EH- EH- Prologslut- Undantags-\n" +msgstr "" +" vma:\t\tStart- Slut- EH- EH- Prologsluts- Undantags-\n" +" \t\tadress adress hanterare data adress mask\n" -#: peigen.c:1610 pepigen.c:1610 +#: peigen.c:1624 pepigen.c:1624 msgid " Register save millicode" msgstr " Registerspara millikod" -#: peigen.c:1613 pepigen.c:1613 +#: peigen.c:1627 pepigen.c:1627 msgid " Register restore millicode" msgstr " Registeråterställ millikod" -#: peigen.c:1616 pepigen.c:1616 +#: peigen.c:1630 pepigen.c:1630 msgid " Glue code sequence" msgstr " Klisterkodsekvens" -#: peigen.c:1668 pepigen.c:1668 +#: peigen.c:1682 pepigen.c:1682 msgid "" "\n" "\n" @@ -2714,7 +2718,7 @@ msgstr "" "\n" "PE-filbasomlokaliseringar (tolkat innehåll i .reloc-sektionen)\n" -#: peigen.c:1698 pepigen.c:1698 +#: peigen.c:1712 pepigen.c:1712 #, c-format msgid "" "\n" @@ -2723,7 +2727,7 @@ msgstr "" "\n" "Virtuell adress: %08lx Områdesstorlek %ld (0x%lx) Antal fixar %ld\n" -#: peigen.c:1711 pepigen.c:1711 +#: peigen.c:1725 pepigen.c:1725 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "\tomlokalisering %4d avstånd %4x [%4lx] %s" @@ -2731,7 +2735,7 @@ msgstr "\tomlokalisering %4d avstånd %4x [%4lx] %s" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1751 pepigen.c:1751 +#: peigen.c:1765 pepigen.c:1765 #, c-format msgid "" "\n" @@ -2740,6 +2744,15 @@ msgstr "" "\n" "Karakteristik 0x%x\n" +#~ msgid "\tThe Import Address Table (difference found)\n" +#~ msgstr "\tImportadresstabellen (skillnad hittad)\n" + +#~ msgid "\t>>> Ran out of IAT members!\n" +#~ msgstr "\t>>> Slut på IAT-medlemmar!\n" + +#~ msgid "\tThe Import Address Table is identical\n" +#~ msgstr "\tImportadresstabellen är identisk\n" + # Ska vara blanksteg här tror jag #~ msgid "BFD %sinternal error, aborting at %s line %d\n" #~ msgstr "Internt BFD %s-fel, avbryter vid %s rad %d\n" @@ -2747,36 +2760,35 @@ msgstr "" #~ msgid "GP relative relocation when GP not defined" #~ msgstr "GP-relativ omlokalisering då GP inte är definierad" +#~ msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" +#~ msgstr "%s: FEL: skickar flyttal i flyttalsregister där målet %s istället använder heltalsregister" + +#~ msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" +#~ msgstr "%s: FEL: skickar flyttal i heltalsregister där målet %s istället använder flyttalsregister" + #~ msgid "Warning: input file %s supports interworking, whereas %s does not." -#~ msgstr "" -#~ "Varning: indatafilen %s stöder samverkande, medan %s däremot inte gör det." +#~ msgstr "Varning: indatafilen %s stöder samverkande, medan %s däremot inte gör det." -#~ msgid "" -#~ "Warning: input file %s does not support interworking, whereas %s does." -#~ msgstr "" -#~ "Varning: indatafilen %s stöder inte samverkande, medan %s däremot gör det." +#~ msgid "Warning: input file %s does not support interworking, whereas %s does." +#~ msgstr "Varning: indatafilen %s stöder inte samverkande, medan %s däremot gör det." #~ msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" #~ msgstr "AUX tagndx %ld ttlsiz 0x%lx radnummer %ld nästa %ld" -#~ msgid "" -#~ "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x" -#~ "%.8lx%s\n" -#~ msgstr "" -#~ "elf_symbol_from_bfd_symbol 0x%.8lx, namn = %s, symbolnr = %d, flaggor = 0x" -#~ "%.8lx%s\n" +#~ msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" +#~ msgstr "elf_symbol_from_bfd_symbol 0x%.8lx, namn = %s, symbolnr = %d, flaggor = 0x%.8lx%s\n" -#~ msgid "" -#~ "Warning: Not setting interwork flag of %s since it has already been " -#~ "specified as non-interworking" -#~ msgstr "" -#~ "Varning: Ställer inte in samverkandeflaggan för %s eftersom den redan har " -#~ "angivits som inte samverkande" +#~ msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" +#~ msgstr "Varning: Ställer inte in samverkandeflaggan för %s eftersom den redan har angivits som inte samverkande" #~ msgid "Warning: Clearing the interwork flag of %s due to outside request" -#~ msgstr "" -#~ "Varning: Stänger av samverkandeflaggan för %s på grund av utomstående " -#~ "begäran" +#~ msgstr "Varning: Stänger av samverkandeflaggan för %s på grund av utomstående begäran" + +#~ msgid " [APCS-26]" +#~ msgstr " [APCS-26]" + +#~ msgid " [APCS-32]" +#~ msgstr " [APCS-32]" #~ msgid "(unknown)" #~ msgstr "(okänd)" @@ -2877,12 +2889,12 @@ msgstr "" #~ msgid " \t\tAddress Address Handler Data Address Mask\n" #~ msgstr " \t\tadress adress hanterare data adress mask\n" -#~ msgid "float" -#~ msgstr "flyttal" - #~ msgid "integer" #~ msgstr "heltal" +#~ msgid "float" +#~ msgstr "flyttal" + #~ msgid "soft" #~ msgstr "mjuk" @@ -2915,16 +2927,10 @@ msgstr "" #~ msgstr "%s(%s+0x%lx): kan inte hitta stubbstarten %s" #~ msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections" -#~ msgstr "" -#~ "%s(%s+0x%lx): kan inte omlokalisera %s, kompilera om med -ffunction-" -#~ "sections" - -#~ msgid "" -#~ "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section " -#~ "= 0x%.8lx\n" -#~ msgstr "" -#~ "skapar sektionssymbol, namn = %s, värde = 0x%.8lx, index = %d, sektion = " -#~ "0x%.8lx\n" +#~ msgstr "%s(%s+0x%lx): kan inte omlokalisera %s, kompilera om med -ffunction-sections" + +#~ msgid "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = 0x%.8lx\n" +#~ msgstr "skapar sektionssymbol, namn = %s, värde = 0x%.8lx, index = %d, sektion = 0x%.8lx\n" # Hmm #~ msgid " whereas segment starts at 0x%x" diff --git a/bfd/po/tr.po b/bfd/po/tr.po index 80dc9e1..092c0ac 100644 --- a/bfd/po/tr.po +++ b/bfd/po/tr.po @@ -4,171 +4,171 @@ # msgid "" msgstr "" -"Project-Id-Version: bfd 2.12-pre020121\n" -"POT-Creation-Date: 2002-01-17 12:55+0000\n" -"PO-Revision-Date: 2002-01-24 13:11EET\n" +"Project-Id-Version: bfd 2.12.91\n" +"POT-Creation-Date: 2002-07-23 15:55-0400\n" +"PO-Revision-Date: 2002-08-10 13:11EET\n" "Last-Translator: Deniz Akkus Kanca <deniz@arayan.com>\n" "Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-9\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 0.9.5\n" -#: aout-adobe.c:196 +#: aout-adobe.c:197 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" -msgstr "%s: a.out.adobe dosyasýnda bilinmeyen bölüm türü: %x\n" +msgstr "%s: a.out.adobe dosyasında bilinmeyen bölüm türü: %x\n" #: aout-cris.c:208 #, c-format msgid "%s: Invalid relocation type exported: %d" -msgstr "%s: Geçersiz yer deðiþtirme türü ihraç edilmiþ: %d" +msgstr "%s: Geçersiz yer deÄŸiÅŸtirme türü ihraç edilmiÅŸ: %d" #: aout-cris.c:252 #, c-format msgid "%s: Invalid relocation type imported: %d" -msgstr "%s: Geçersiz yer deðiþtirme türü ithal edilmiþ: %d" +msgstr "%s: Geçersiz yer deÄŸiÅŸtirme türü ithal edilmiÅŸ: %d" #: aout-cris.c:263 #, c-format msgid "%s: Bad relocation record imported: %d" -msgstr "%s: Geçersiz yer deðiþtirme kaydý ithal edilmiþ: %d" +msgstr "%s: Geçersiz yer deÄŸiÅŸtirme kaydı ithal edilmiÅŸ: %d" #: aoutx.h:1282 aoutx.h:1699 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" -msgstr "%s: `%s' bölümü a.out nesne dosya biçeminde gösterilemez" +msgstr "%s: `%s' bölümü a.out nesne dosya biçeminde gösterilemez" #: aoutx.h:1669 #, c-format msgid "%s: can not represent section for symbol `%s' in a.out object file format" -msgstr "%s: `%s' sembol bölümü a.out nesne dosyasýnda gösterilemez" +msgstr "%s: `%s' sembol bölümü a.out nesne dosyasında gösterilemez" #: aoutx.h:1671 msgid "*unknown*" msgstr "*bilinmeyen*" -#: aoutx.h:3735 +#: aoutx.h:3732 #, c-format msgid "%s: relocateable link from %s to %s not supported" -msgstr "%s: %s'dan %s'ya yeri deðiþtirilebilen bað desteklenmiyor" +msgstr "%s: %s'dan %s'ya yeri deÄŸiÅŸtirilebilen baÄŸ desteklenmiyor" #: archive.c:1826 msgid "Warning: writing archive was slow: rewriting timestamp\n" -msgstr "Uyarý: arþiv yazma iþlemi yavaþ: zaman damgasý yeniden yazýlýyor\n" +msgstr "Uyarı: arÅŸiv yazma iÅŸlemi yavaÅŸ: zaman damgası yeniden yazılıyor\n" #: archive.c:2093 msgid "Reading archive file mod timestamp" -msgstr "Arþiv dosyasý deðiþim zaman damgasý okunuyor" +msgstr "ArÅŸiv dosyası deÄŸiÅŸim zaman damgası okunuyor" #. FIXME: bfd can't call perror. #: archive.c:2120 msgid "Writing updated armap timestamp" -msgstr "Güncellenmiþ armap zaman damgasý yazýlýyor" +msgstr "GüncellenmiÅŸ armap zaman damgası yazılıyor" -#: bfd.c:281 +#: bfd.c:274 msgid "No error" msgstr "Hata yok" -#: bfd.c:282 +#: bfd.c:275 msgid "System call error" -msgstr "Sistem çaðrý hatasý" +msgstr "Sistem çaÄŸrı hatası" -#: bfd.c:283 +#: bfd.c:276 msgid "Invalid bfd target" -msgstr "Geçersiz bfd hedefi" +msgstr "Geçersiz bfd hedefi" -#: bfd.c:284 +#: bfd.c:277 msgid "File in wrong format" -msgstr "Dosya yanlýþ biçemde" +msgstr "Dosya yanlış biçemde" -#: bfd.c:285 +#: bfd.c:278 msgid "Archive object file in wrong format" -msgstr "Arþiv nesne dosyasý yanlýþ biçemde" +msgstr "ArÅŸiv nesne dosyası yanlış biçemde" -#: bfd.c:286 +#: bfd.c:279 msgid "Invalid operation" -msgstr "Geçersiz iþlem" +msgstr "Geçersiz iÅŸlem" -#: bfd.c:287 +#: bfd.c:280 msgid "Memory exhausted" -msgstr "Bellek tükendi" +msgstr "Bellek tükendi" -#: bfd.c:288 +#: bfd.c:281 msgid "No symbols" msgstr "Sembol yok" -#: bfd.c:289 +#: bfd.c:282 msgid "Archive has no index; run ranlib to add one" -msgstr "Arþivin indeksi yok; ranlib çalýþtýrarak indeks ekleyin" +msgstr "ArÅŸivin indeksi yok; ranlib çalıştırarak indeks ekleyin" -#: bfd.c:290 +#: bfd.c:283 msgid "No more archived files" -msgstr "Baþka arþivlenmiþ dosya yok" +msgstr "BaÅŸka arÅŸivlenmiÅŸ dosya yok" -#: bfd.c:291 +#: bfd.c:284 msgid "Malformed archive" -msgstr "Bozuk arþiv" +msgstr "Bozuk arÅŸiv" -#: bfd.c:292 +#: bfd.c:285 msgid "File format not recognized" -msgstr "Dosya biçemi tanýnmýyor" +msgstr "Dosya biçemi tanınmıyor" -#: bfd.c:293 +#: bfd.c:286 msgid "File format is ambiguous" -msgstr "Dosya biçemi belirsiz" +msgstr "Dosya biçemi belirsiz" -#: bfd.c:294 +#: bfd.c:287 msgid "Section has no contents" -msgstr "Bölümde içerik yok" +msgstr "Bölümde içerik yok" -#: bfd.c:295 +#: bfd.c:288 msgid "Nonrepresentable section on output" -msgstr "Çýktýda gösterilemeyen bölüm" +msgstr "Çıktıda gösterilemeyen bölüm" -#: bfd.c:296 +#: bfd.c:289 msgid "Symbol needs debug section which does not exist" -msgstr "Sembol, olmayan hata ayýklama bölümünü istiyor" +msgstr "Sembol, olmayan hata ayıklama bölümünü istiyor" -#: bfd.c:297 +#: bfd.c:290 msgid "Bad value" -msgstr "Geçersiz deðer" +msgstr "Geçersiz deÄŸer" -#: bfd.c:298 +#: bfd.c:291 msgid "File truncated" -msgstr "Dosya budandý" +msgstr "Dosya budandı" -#: bfd.c:299 +#: bfd.c:292 msgid "File too big" -msgstr "Dosya fazla büyük" +msgstr "Dosya fazla büyük" -#: bfd.c:300 +#: bfd.c:293 msgid "#<Invalid error code>" -msgstr "#<Geçersiz hata kodu>" +msgstr "#<Geçersiz hata kodu>" -#: bfd.c:707 +#: bfd.c:700 #, c-format msgid "BFD %s assertion fail %s:%d" -msgstr "BFD %s, olumlama baþarýsýz %s:%d" +msgstr "BFD %s, olumlama baÅŸarısız %s:%d" -#: bfd.c:726 +#: bfd.c:719 #, c-format msgid "BFD %s internal error, aborting at %s line %d in %s\n" -msgstr "BFD %s iç hatasý, %s'da, %d satýrý, %s içerisinde iþlem durduruldu\n" +msgstr "BFD %s iç hatası, %s'da, %d satırı, %s içerisinde iÅŸlem durduruldu\n" -#: bfd.c:730 +#: bfd.c:723 #, c-format -msgid "BFD %sinternal error, aborting at %s line %d\n" -msgstr "BFD %s iç hatasý, %s, %d satýrýnda iþlem durduruldu\n" +msgid "BFD %s internal error, aborting at %s line %d\n" +msgstr "BFD %s iç hatası, %s, %d satırında iÅŸlem durduruldu\n" -#: bfd.c:732 +#: bfd.c:725 msgid "Please report this bug.\n" -msgstr "Lütfen bu hatayý bildirin.\n" +msgstr "Lütfen bu hatayı bildirin.\n" #: binary.c:306 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." -msgstr "Uyarý: `%s' bölümü çok büyük (negatif) dosya göreli konumu 0x%lx'e yazýlýyor." +msgstr "Uyarı: `%s' bölümü çok büyük (negatif) dosya göreli konumu 0x%lx'e yazılıyor." #: coff-a29k.c:119 msgid "Missing IHCONST" @@ -178,1337 +178,1584 @@ msgstr "IHCONST yok" msgid "Missing IHIHALF" msgstr "IHIHALF yok" -#: coff-a29k.c:212 +#: coff-a29k.c:212 coff-or32.c:229 msgid "Unrecognized reloc" -msgstr "Tanýnmayan yer deðiþtirme" +msgstr "Tanınmayan yer deÄŸiÅŸtirme" #: coff-a29k.c:408 msgid "missing IHCONST reloc" -msgstr "eksik IHCONST yer deðiþtirmesi" +msgstr "eksik IHCONST yer deÄŸiÅŸtirmesi" #: coff-a29k.c:498 msgid "missing IHIHALF reloc" -msgstr "eksik IHIHALF yer deðiþtirmesi" +msgstr "eksik IHIHALF yer deÄŸiÅŸtirmesi" -#: coff-alpha.c:881 coff-alpha.c:918 +#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432 msgid "GP relative relocation used when GP not defined" -msgstr "GP tanýmlanmamýþken GP göreli yer deðiþtirmesi kullanýlmýþ" +msgstr "GP tanımlanmamışken GP göreli yer deÄŸiÅŸtirmesi kullanılmış" #: coff-alpha.c:1485 msgid "using multiple gp values" -msgstr "birden fazla gp deðeri kullanýlýyor" +msgstr "birden fazla gp deÄŸeri kullanılıyor" -#: coff-alpha.c:1989 coff-mips.c:1433 -msgid "GP relative relocation when GP not defined" -msgstr "GP tanýmlanmamýþken GP göreli yer deðiþtirmesi" - -#: coff-arm.c:1051 elf32-arm.h:285 +#: coff-arm.c:1066 elf32-arm.h:285 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" -msgstr "%1$s: `%3$s' için THUMB birleþtiricisi '%2$s' bulunamadý " +msgstr "%1$s: `%3$s' için THUMB birleÅŸtiricisi '%2$s' bulunamadı " -#: coff-arm.c:1080 elf32-arm.h:320 +#: coff-arm.c:1096 elf32-arm.h:320 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" -msgstr "%1$s: `%3$s' için ARM birleþtiricisi '%2$s' bulunamadý" +msgstr "%1$s: `%3$s' için ARM birleÅŸtiricisi '%2$s' bulunamadı" -#: coff-arm.c:1375 coff-arm.c:1470 elf32-arm.h:886 elf32-arm.h:990 +#: coff-arm.c:1391 coff-arm.c:1486 elf32-arm.h:887 elf32-arm.h:991 #, c-format msgid "%s(%s): warning: interworking not enabled." -msgstr "%s(%s): uyarý: beraber çalýþma kipi etkin deðil." +msgstr "%s(%s): uyarı: beraber çalışma kipi etkin deÄŸil." -#: coff-arm.c:1379 elf32-arm.h:993 +#: coff-arm.c:1395 elf32-arm.h:994 #, c-format msgid " first occurrence: %s: arm call to thumb" -msgstr " ilk ortaya çýkýþ: %s: thumb'a arm'dan çaðrý" +msgstr " ilk ortaya çıkış: %s: thumb'a arm'dan çaÄŸrı" -#: coff-arm.c:1474 elf32-arm.h:889 +#: coff-arm.c:1490 elf32-arm.h:890 #, c-format msgid " first occurrence: %s: thumb call to arm" -msgstr " ilk ortaya çýkýþ: %s: arm'a thumb'dan çaðrý" +msgstr " ilk ortaya çıkış: %s: arm'a thumb'dan çaÄŸrı" -#: coff-arm.c:1477 +#: coff-arm.c:1493 msgid " consider relinking with --support-old-code enabled" -msgstr " --support-old-code seçeneði ile yeniden baðlamayý deneyin" +msgstr " --support-old-code seçeneÄŸi ile yeniden baÄŸlamayı deneyin" -#: coff-arm.c:1767 coff-tic80.c:686 cofflink.c:3017 +#: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3031 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" -msgstr "%1$s: `%3$s' bölümünde geçersiz yer deðiþtirme adresi 0x%2$lx" +msgstr "%1$s: `%3$s' bölümünde geçersiz yer deÄŸiÅŸtirme adresi 0x%2$lx" -#: coff-arm.c:2107 +#: coff-arm.c:2127 #, c-format msgid "%s: illegal symbol index in reloc: %d" -msgstr "%s: yer deðiþtirmede geçersiz sembol indeksi: %d" +msgstr "%s: yer deÄŸiÅŸtirmede geçersiz sembol indeksi: %d" -#: coff-arm.c:2235 +#: coff-arm.c:2255 #, c-format -msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" -msgstr "%s: HATA: APCS-%d için derlenmiþ fakat hedef %s APCS-%d kullanýyor" +msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" +msgstr "Hata: %s APCS-%d için derlenmiÅŸ, fakat %s APCS-%d için derlenmiÅŸ" -#: coff-arm.c:2250 +#: coff-arm.c:2270 elf32-arm.h:2297 #, c-format -msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" -msgstr "%s: HATA: kayan sayýlarý kayan yazmaçlarda geçiriyor fakat hedef %s tamsayý yazmaç kullanýyor" +msgid "ERROR: %s passes floats in float registers, whereas %s passes them in integer registers" +msgstr "" +"Hata: %s kayan sayıları kayan sayı yazmaçlarında geçiriyor, \n" +" fakat %s tamsayı yazmaçlarında geçiriyor" -#: coff-arm.c:2253 +#: coff-arm.c:2273 elf32-arm.h:2302 #, c-format -msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" -msgstr "%s: HATA: kayan sayýlarý tamsayý yazmaçlarda geçiriyor fakat hedef %s kayan yazmaç kullanýyor" +msgid "ERROR: %s passes floats in integer registers, whereas %s passes them in float registers" +msgstr "" +"Hata: %s kayan sayıları tamsayı yazmaçlarında geçiriyor, \n" +" fakat %s kayan sayı yazmaçlarında geçiriyor" -#: coff-arm.c:2268 +#: coff-arm.c:2288 #, c-format -msgid "%s: ERROR: compiled as position independent code, whereas target %s is absolute position" -msgstr "%s: HATA: yerden baðýmsýz kod olarak derlendi, fakat hedef %s yere baðýmlý" +msgid "ERROR: %s is compiled as position independent code, whereas target %s is absolute position" +msgstr "HATA: %s yerden bağımsız kod olarak derlendi, fakat hedef %s yere bağımlı" -#: coff-arm.c:2271 +#: coff-arm.c:2291 #, c-format -msgid "%s: ERROR: compiled as absolute position code, whereas target %s is position independent" -msgstr "%s: HATA: yere baðýmlý kod olarak derlendi, fakat hedef %s yerden baðýmsýz" +msgid "ERROR: %s is compiled as absolute position code, whereas target %s is position independent" +msgstr "HATA: %s yere bağımlı kod olarak derlendi, fakat hedef %s yerden bağımsız" -#: coff-arm.c:2300 +#: coff-arm.c:2320 elf32-arm.h:2358 #, c-format -msgid "Warning: input file %s supports interworking, whereas %s does not." -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý destekliyor, fakat %s desteklemiyor." +msgid "Warning: %s supports interworking, whereas %s does not" +msgstr "Uyarı: %s girdi dosyası beraber çalışmayı destekliyor, fakat %s desteklemiyor." -#: coff-arm.c:2303 +#: coff-arm.c:2323 elf32-arm.h:2365 #, c-format -msgid "Warning: input file %s does not support interworking, whereas %s does." -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý desteklemiyor, fakat %s destekliyor." +msgid "Warning: %s does not support interworking, whereas %s does" +msgstr "Uyarı: %s girdi dosyası beraber çalışmayı desteklemiyor, fakat %s destekliyor." -#: coff-arm.c:2330 +#: coff-arm.c:2350 #, c-format msgid "private flags = %x:" -msgstr "özel bayraklar = %x:" +msgstr "özel bayraklar = %x:" -#: coff-arm.c:2338 elf32-arm.h:2408 +#: coff-arm.c:2358 elf32-arm.h:2418 msgid " [floats passed in float registers]" -msgstr " [kayan sayýlar kayan yazmaçlarda geçirildi]" +msgstr " [kayan sayılar kayan yazmaçlarda geçirildi]" -#: coff-arm.c:2340 +#: coff-arm.c:2360 msgid " [floats passed in integer registers]" -msgstr " [kayan sayýlar tamsayý yazmaçlarda geçirildi]" +msgstr " [kayan sayılar tamsayı yazmaçlarda geçirildi]" -#: coff-arm.c:2343 elf32-arm.h:2411 +#: coff-arm.c:2363 elf32-arm.h:2421 msgid " [position independent]" -msgstr " [yerden baðýmsýz]" +msgstr " [yerden bağımsız]" -#: coff-arm.c:2345 +#: coff-arm.c:2365 msgid " [absolute position]" -msgstr " [yere baðýmlý]" +msgstr " [yere bağımlı]" -#: coff-arm.c:2349 +#: coff-arm.c:2369 msgid " [interworking flag not initialised]" -msgstr " [beraber çalýþma bayraðýna öndeðer atanmamýþ]" +msgstr " [beraber çalışma bayrağına öndeÄŸer atanmamış]" -#: coff-arm.c:2351 +#: coff-arm.c:2371 msgid " [interworking supported]" -msgstr " [beraber çalýþma destekleniyor]" +msgstr " [beraber çalışma destekleniyor]" -#: coff-arm.c:2353 +#: coff-arm.c:2373 msgid " [interworking not supported]" -msgstr " [beraber çalýþma desteklenmiyor]" +msgstr " [beraber çalışma desteklenmiyor]" -#: coff-arm.c:2401 +#: coff-arm.c:2421 elf32-arm.h:2124 #, c-format -msgid "Warning: Not setting interworking flag of %s, since it has already been specified as non-interworking" -msgstr "Uyarý: %s beraber çalýþma bayraðý atanmadý, çünkü beraber çalýþma olmayacaðý önceden belirtilmiþ" +msgid "Warning: Not setting interworking flag of %s since it has already been specified as non-interworking" +msgstr "Uyarı: %s beraber çalışma bayrağı atanmadı, çünkü beraber çalışma olmayacağı önceden belirtilmiÅŸ" -#: coff-arm.c:2405 +#: coff-arm.c:2425 elf32-arm.h:2128 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" -msgstr "Uyarý: %s beraber çalýþma bayraðý dýþ istek üzerine temizlendi" +msgstr "Uyarı: %s beraber çalışma bayrağı dış istek üzerine temizlendi" #: coff-i960.c:136 coff-i960.c:485 msgid "uncertain calling convention for non-COFF symbol" -msgstr "COFF olmayan sembol için belirsiz çaðrý davranýþý" +msgstr "COFF olmayan sembol için belirsiz çaÄŸrı davranışı" -#: coff-m68k.c:481 coff-mips.c:2431 elf32-m68k.c:2212 +#: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844 msgid "unsupported reloc type" -msgstr "desteklenmeyen yer deðiþtirme türü" +msgstr "desteklenmeyen yer deÄŸiÅŸtirme türü" -#: coff-mips.c:875 elf32-mips.c:1987 elf64-mips.c:1739 +#: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609 msgid "GP relative relocation when _gp not defined" -msgstr "_gp tanýmsýz iken GP göreli yer deðiþtirmesi" +msgstr "_gp tanımsız iken GP göreli yer deÄŸiÅŸtirmesi" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2468 +#: coff-mips.c:2466 msgid "reloc against unsupported section" -msgstr "desteklenmeyen bölümde yer deðiþtirme" +msgstr "desteklenmeyen bölümde yer deÄŸiÅŸtirme" -#: coff-mips.c:2476 +#: coff-mips.c:2474 msgid "reloc not properly aligned" -msgstr "yer deðiþtirme doðru hizalanmamýþ" +msgstr "yer deÄŸiÅŸtirme doÄŸru hizalanmamış" -#: coff-rs6000.c:2710 coff64-rs6000.c:1164 +#: coff-rs6000.c:2766 #, c-format msgid "%s: unsupported relocation type 0x%02x" -msgstr "%s: desteklenmeyen yükleyici yerdeðiþimi 0x%02x" +msgstr "%s: desteklenmeyen yükleyici yerdeÄŸiÅŸimi 0x%02x" -#: coff-rs6000.c:2756 coff64-rs6000.c:1210 +#: coff-rs6000.c:2859 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" -msgstr "%s: 0x%x'da TOC girdisi olmayan `%s' sembolüne TOC yerdeðiþimi" +msgstr "%s: 0x%x'da TOC girdisi olmayan `%s' sembolüne TOC yerdeÄŸiÅŸimi" -#: coff-rs6000.c:3006 coff64-rs6000.c:2060 +#: coff-rs6000.c:3590 coff64-rs6000.c:2091 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" -msgstr "%s: `%s' sembolünde bilinmeyen %d var" +msgstr "%s: `%s' sembolünde bilinmeyen %d var" #: coff-tic54x.c:279 coff-tic80.c:449 #, c-format msgid "Unrecognized reloc type 0x%x" -msgstr "Bilinmeyen yer deðiþtirme türü 0x%x" +msgstr "Bilinmeyen yer deÄŸiÅŸtirme türü 0x%x" -#: coff-tic54x.c:390 coffcode.h:4847 +#: coff-tic54x.c:390 coffcode.h:4974 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" -msgstr "%s: uyarý: yer deðiþtirmelerde geçersiz sembol indeksi %ld" +msgstr "%s: uyarı: yer deÄŸiÅŸtirmelerde geçersiz sembol indeksi %ld" #: coff-w65.c:363 #, c-format msgid "ignoring reloc %s\n" -msgstr "yer deðiþtirme %s yoksayýldý\n" +msgstr "yer deÄŸiÅŸtirme %s yoksayıldı\n" -#: coffcode.h:1081 +#: coffcode.h:1086 #, c-format msgid "%s (%s): Section flag %s (0x%x) ignored" -msgstr "%s (%s): Bölüm bayraðý %s (0x%x) yoksayýldý" +msgstr "%s (%s): Bölüm bayrağı %s (0x%x) yoksayıldı" -#: coffcode.h:2125 +#: coffcode.h:2143 #, c-format msgid "Unrecognized TI COFF target id '0x%x'" -msgstr "Tanýnmayan TI COFF hedef kimliði '0x%x'" +msgstr "Tanınmayan TI COFF hedef kimliÄŸi '0x%x'" -#: coffcode.h:4236 +#: coffcode.h:4365 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" -msgstr "%s: uyarý: satýr numaralarýnda geçersiz sembol indeksi %ld" +msgstr "%s: uyarı: satır numaralarında geçersiz sembol indeksi %ld" -#: coffcode.h:4250 +#: coffcode.h:4379 #, c-format msgid "%s: warning: duplicate line number information for `%s'" -msgstr "%s: uyarý: `%s' için tekrarlanmýþ satýr numarasý bilgisi" +msgstr "%s: uyarı: `%s' için tekrarlanmış satır numarası bilgisi" -#: coffcode.h:4609 +#: coffcode.h:4736 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" -msgstr "%1$s: %3$s sembolü `%4$s' için bilinmeyen saklama sýnýfý %2$d" +msgstr "%1$s: %3$s sembolü `%4$s' için bilinmeyen saklama sınıfı %2$d" -#: coffcode.h:4740 +#: coffcode.h:4867 #, c-format msgid "warning: %s: local symbol `%s' has no section" -msgstr "uyarý: %s: `%s' yerel sembolünün bölümü yok" +msgstr "uyarı: %s: `%s' yerel sembolünün bölümü yok" -#: coffcode.h:4885 +#: coffcode.h:5012 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" -msgstr "%1$s: 0x%3$lx adresinde geçersiz yer deðiþtirme türü %2$d" +msgstr "%1$s: 0x%3$lx adresinde geçersiz yer deÄŸiÅŸtirme türü %2$d" #: coffgen.c:1661 #, c-format msgid "%s: bad string table size %lu" -msgstr "%s: geçersiz dizge tablo boyu %lu" +msgstr "%s: geçersiz dizge tablo boyu %lu" -#: coffgen.c:2138 -#, c-format -msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" -msgstr "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld sonraki %ld" - -#: cofflink.c:536 elflink.h:1967 +#: cofflink.c:534 elflink.h:1912 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" -msgstr "Uyarý: %4$s içerisinde `%1$s' sembolünün türü %2$d'den %3$d'e deðiþtirildi" +msgstr "Uyarı: %4$s içerisinde `%1$s' sembolünün türü %2$d'den %3$d'e deÄŸiÅŸtirildi" -#: cofflink.c:2317 +#: cofflink.c:2321 #, c-format msgid "%s: relocs in section `%s', but it has no contents" -msgstr "%s: `%s' bölümünde yer deðiþtirmeler mevcut, fakat içi boþ" +msgstr "%s: `%s' bölümünde yer deÄŸiÅŸtirmeler mevcut, fakat içi boÅŸ" -#: cofflink.c:2653 coffswap.h:889 +#: cofflink.c:2664 coffswap.h:877 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" -msgstr "%s: %s: yer deðiþtirme taþmasý: 0x%lx > 0xffff" +msgstr "%s: %s: yer deÄŸiÅŸtirme taÅŸması: 0x%lx > 0xffff" -#: cofflink.c:2662 coffswap.h:876 +#: cofflink.c:2673 coffswap.h:864 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" -msgstr "%s: uyarý: %s: satýr numarasý taþmasý: 0x%lx > 0xffff" +msgstr "%s: uyarı: %s: satır numarası taÅŸması: 0x%lx > 0xffff" -#: dwarf2.c:381 +#: dwarf2.c:382 msgid "Dwarf Error: Can't find .debug_str section." -msgstr "Dwarf Hatasý: .debug_str bölümü bulunamadý." +msgstr "Dwarf Hatası: .debug_str bölümü bulunamadı." -#: dwarf2.c:398 +#: dwarf2.c:399 #, c-format -msgid "Dwarf Error: DW_FORM_strp offset (%u) greater than or equal to .debug_str size (%u)." +msgid "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str size (%lu)." msgstr "" -"Dwarf Hatasý: DW_FORM_strp göreli konumu (%u) .debug_str boyutundan (%u) \n" -" daha büyük veya eþit." +"Dwarf Hatası: DW_FORM_strp göreli konumu (%lu) .debug_str boyutundan (%lu) \n" +" daha büyük veya eÅŸit." -#: dwarf2.c:542 +#: dwarf2.c:543 msgid "Dwarf Error: Can't find .debug_abbrev section." -msgstr "Dwarf Hatasý: .debug_abbrev bölümü bulunamadý." +msgstr "Dwarf Hatası: .debug_abbrev bölümü bulunamadı." -#: dwarf2.c:559 +#: dwarf2.c:560 #, c-format -msgid "Dwarf Error: Abbrev offset (%u) greater than or equal to abbrev size (%u)." +msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)." msgstr "" -"Dwarf Hatasý: Kýsaltma göreli konumu (%u) kýsaltma boyutundan (%u) \n" -" daha büyük veya eþit." +"Dwarf Hatası: Kısaltma göreli konumu (%lu) kısaltma boyutundan (%lu) \n" +" daha büyük veya eÅŸit." -#: dwarf2.c:756 +#: dwarf2.c:757 #, c-format -msgid "Dwarf Error: Invalid or unhandled FORM value: %d." -msgstr "Dwarf Hatasý: Geçersiz veya desteklenmeyen FORM deðeri: %d." +msgid "Dwarf Error: Invalid or unhandled FORM value: %u." +msgstr "Dwarf Hatası: Geçersiz veya desteklenmeyen FORM deÄŸeri: %u." -#: dwarf2.c:843 +#: dwarf2.c:852 msgid "Dwarf Error: mangled line number section (bad file number)." -msgstr "Dwarf Hatasý: bozulmuþ satýr numarasý bölümü (geçersiz dosya numarasý)." +msgstr "Dwarf Hatası: bozulmuÅŸ satır numarası bölümü (geçersiz dosya numarası)." -#: dwarf2.c:929 +#: dwarf2.c:938 msgid "Dwarf Error: Can't find .debug_line section." -msgstr "Dwarf Hatasý: .debug_line bölümü bulunamadý." +msgstr "Dwarf Hatası: .debug_line bölümü bulunamadı." -#: dwarf2.c:952 +#: dwarf2.c:961 #, c-format -msgid "Dwarf Error: Line offset (%u) greater than or equal to line size (%u)." +msgid "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%lu)." msgstr "" -"Dwarf Hatasý: Satýr göreli konumu (%u) satýr boyutundan (%u)\n" -" daha büyük veya eþit." +"Dwarf Hatası: Satır göreli konumu (%lu) satır boyutundan (%lu)\n" +" daha büyük veya eÅŸit." -#: dwarf2.c:1143 +#: dwarf2.c:1159 msgid "Dwarf Error: mangled line number section." -msgstr "Dwarf Hatasý: bozuk satýr numarasý bölümü." +msgstr "Dwarf Hatası: bozuk satır numarası bölümü." -#: dwarf2.c:1318 dwarf2.c:1532 +#: dwarf2.c:1355 dwarf2.c:1566 #, c-format -msgid "Dwarf Error: Could not find abbrev number %d." -msgstr "Dwarf Hatasý: Kýsaltma numarasý %d bulunamadý." +msgid "Dwarf Error: Could not find abbrev number %u." +msgstr "Dwarf Hatası: Kısaltma numarası %u bulunamadı." -#: dwarf2.c:1493 +#: dwarf2.c:1527 #, c-format -msgid "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 information." -msgstr "Dwarf Hatasý: dwarf sürümü '%hu' bulundu, bu okuyucu yalnýzca sürüm 2 bilgisini anlayabiliyor." +msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2 information." +msgstr "Dwarf Hatası: dwarf sürümü '%u' bulundu, bu okuyucu yalnızca sürüm 2 bilgisini anlayabiliyor." -#: dwarf2.c:1500 +#: dwarf2.c:1534 #, c-format msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'." -msgstr "Dwarf Hatasý: adres boyu '%u' bulundu, bu okuyucu '%u'dan daha büyük boylarý okuyamýyor." +msgstr "Dwarf Hatası: adres boyu '%u' bulundu, bu okuyucu '%u'dan daha büyük boyları okuyamıyor." -#: dwarf2.c:1523 +#: dwarf2.c:1557 #, c-format -msgid "Dwarf Error: Bad abbrev number: %d." -msgstr "Dwarf Hatasý: Geçersiz kýsaltma numarasý: %d." +msgid "Dwarf Error: Bad abbrev number: %u." +msgstr "Dwarf Hatası: Geçersiz kısaltma numarası: %u." -#: ecoff.c:1328 +#: ecoff.c:1318 #, c-format msgid "Unknown basic type %d" -msgstr "Bilinmeyen temel tür %d" +msgstr "Bilinmeyen temel tür %d" -#: ecoff.c:1597 +#: ecoff.c:1578 #, c-format -msgid "\n End+1 symbol: %ld" -msgstr "\n Son+1 sembolü: %ld" +msgid "" +"\n" +" End+1 symbol: %ld" +msgstr "" +"\n" +" Son+1 sembolü: %ld" -#: ecoff.c:1604 ecoff.c:1607 +#: ecoff.c:1585 ecoff.c:1588 #, c-format -msgid "\n First symbol: %ld" -msgstr "\n Ýlk sembol: %ld" +msgid "" +"\n" +" First symbol: %ld" +msgstr "" +"\n" +" Ä°lk sembol: %ld" -#: ecoff.c:1619 +#: ecoff.c:1600 #, c-format -msgid "\n End+1 symbol: %-7ld Type: %s" -msgstr "\n Son+1 sembolü: %-7ld Tür: %s" +msgid "" +"\n" +" End+1 symbol: %-7ld Type: %s" +msgstr "" +"\n" +" Son+1 sembolü: %-7ld Tür: %s" -#: ecoff.c:1626 +#: ecoff.c:1607 #, c-format -msgid "\n Local symbol: %ld" -msgstr "\n Yerel sembol: %ld" +msgid "" +"\n" +" Local symbol: %ld" +msgstr "" +"\n" +" Yerel sembol: %ld" -#: ecoff.c:1634 +#: ecoff.c:1615 #, c-format -msgid "\n struct; End+1 symbol: %ld" -msgstr "\n yapý; Son+1 sembolü: %ld" +msgid "" +"\n" +" struct; End+1 symbol: %ld" +msgstr "" +"\n" +" yapı; Son+1 sembolü: %ld" -#: ecoff.c:1639 +#: ecoff.c:1620 #, c-format -msgid "\n union; End+1 symbol: %ld" -msgstr "\n birleþim; Son+1 sembolü: %ld" +msgid "" +"\n" +" union; End+1 symbol: %ld" +msgstr "" +"\n" +" birleÅŸim; Son+1 sembolü: %ld" -#: ecoff.c:1644 +#: ecoff.c:1625 #, c-format -msgid "\n enum; End+1 symbol: %ld" -msgstr "\n enum; Son+1 sembolü: %ld" +msgid "" +"\n" +" enum; End+1 symbol: %ld" +msgstr "" +"\n" +" enum; Son+1 sembolü: %ld" -#: ecoff.c:1650 +#: ecoff.c:1631 #, c-format -msgid "\n Type: %s" -msgstr "\n Tür: %s" +msgid "" +"\n" +" Type: %s" +msgstr "" +"\n" +" Tür: %s" -#: elf-hppa.h:1366 elf-hppa.h:1399 elf32-ppc.c:3062 elf32-sh.c:3201 -#: elf64-x86-64.c:1275 +#: elf-hppa.h:1476 elf-hppa.h:1509 elf32-ppc.c:3091 elf32-sh.c:4213 +#: elf64-sh64.c:1659 #, c-format msgid "%s: warning: unresolvable relocation against symbol `%s' from %s section" -msgstr "%1$s: uyarý: %3$s bölümünden `%2$s' sembolüne çözümlenemeyen yer deðiþimi" +msgstr "%1$s: uyarı: %3$s bölümünden `%2$s' sembolüne çözümlenemeyen yer deÄŸiÅŸimi" -#: elf-m10200.c:463 elf-m10300.c:673 elf32-arm.h:2074 elf32-avr.c:835 -#: elf32-cris.c:1392 elf32-d10v.c:482 elf32-fr30.c:653 elf32-h8300.c:547 -#: elf32-i860.c:1048 elf32-m32r.c:1281 elf32-openrisc.c:455 elf32-v850.c:1691 -#: elf64-mmix.c:1164 +#: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2084 elf32-avr.c:833 +#: elf32-cris.c:1403 elf32-d10v.c:481 elf32-fr30.c:635 elf32-frv.c:809 +#: elf32-h8300.c:548 elf32-i860.c:1031 elf32-m32r.c:1278 elf32-openrisc.c:439 +#: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302 msgid "internal error: out of range error" -msgstr "iç hata: kapsam dýþý hatasý" +msgstr "iç hata: kapsam dışı hatası" -#: elf-m10200.c:467 elf-m10300.c:677 elf32-arm.h:2078 elf32-avr.c:839 -#: elf32-cris.c:1396 elf32-d10v.c:486 elf32-fr30.c:657 elf32-h8300.c:551 -#: elf32-i860.c:1052 elf32-m32r.c:1285 elf32-mips.c:7565 elf32-openrisc.c:459 -#: elf32-v850.c:1695 elf64-mips.c:4464 elf64-mmix.c:1168 +#: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2088 elf32-avr.c:837 +#: elf32-cris.c:1407 elf32-d10v.c:485 elf32-fr30.c:639 elf32-frv.c:813 +#: elf32-h8300.c:552 elf32-i860.c:1035 elf32-m32r.c:1282 elf32-openrisc.c:443 +#: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5264 msgid "internal error: unsupported relocation error" -msgstr "iç hata: desteklenmeyen yer deðiþim hatasý" +msgstr "iç hata: desteklenmeyen yer deÄŸiÅŸim hatası" -#: elf-m10200.c:471 elf-m10300.c:681 elf32-arm.h:2082 elf32-d10v.c:490 -#: elf32-h8300.c:555 elf32-m32r.c:1289 +#: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2092 elf32-d10v.c:489 +#: elf32-h8300.c:556 elf32-m32r.c:1286 msgid "internal error: dangerous error" -msgstr "iç hata: ölümcül hata" +msgstr "iç hata: ölümcül hata" -#: elf-m10200.c:475 elf-m10300.c:685 elf32-arm.h:2086 elf32-avr.c:847 -#: elf32-cris.c:1404 elf32-d10v.c:494 elf32-fr30.c:665 elf32-h8300.c:559 -#: elf32-i860.c:1060 elf32-m32r.c:1293 elf32-openrisc.c:467 elf32-v850.c:1715 -#: elf64-mmix.c:1176 +#: elf-m10200.c:458 elf-m10300.c:668 elf32-arm.h:2096 elf32-avr.c:845 +#: elf32-cris.c:1415 elf32-d10v.c:493 elf32-fr30.c:647 elf32-frv.c:821 +#: elf32-h8300.c:560 elf32-i860.c:1043 elf32-m32r.c:1290 elf32-openrisc.c:451 +#: elf32-v850.c:1715 elf32-xstormy16.c:945 elf64-mmix.c:1314 msgid "internal error: unknown error" -msgstr "iç hata: bilinmeyen hata" +msgstr "iç hata: bilinmeyen hata" -#: elf.c:345 +#: elf.c:343 #, c-format msgid "%s: invalid string offset %u >= %lu for section `%s'" -msgstr "%1$s: `%4$s' bölümünde geçersiz dizge göreli konumu %2$u >= %3$lu" +msgstr "%1$s: `%4$s' bölümünde geçersiz dizge göreli konumu %2$u >= %3$lu" -#: elf.c:450 +#: elf.c:589 #, c-format msgid "%s: invalid SHT_GROUP entry" -msgstr "%s: geçersiz SHT_GROUP girdisi" +msgstr "%s: geçersiz SHT_GROUP girdisi" -#: elf.c:531 +#: elf.c:660 #, c-format msgid "%s: no group info for section %s" -msgstr "%s: %s bölümünde grup bilgisi yok" +msgstr "%s: %s bölümünde grup bilgisi yok" -#: elf.c:842 -msgid "\nProgram Header:\n" -msgstr "\nYazýlým Baþlýðý:\n" +#: elf.c:1023 +msgid "" +"\n" +"Program Header:\n" +msgstr "" +"\n" +"Yazılım BaÅŸlığı:\n" -#: elf.c:891 -msgid "\nDynamic Section:\n" -msgstr "\nDinamik Bölüm:\n" +#: elf.c:1073 +msgid "" +"\n" +"Dynamic Section:\n" +msgstr "" +"\n" +"Dinamik Bölüm:\n" -#: elf.c:1020 -msgid "\nVersion definitions:\n" -msgstr "\nSürüm tanýmlarý:\n" +#: elf.c:1202 +msgid "" +"\n" +"Version definitions:\n" +msgstr "" +"\n" +"Sürüm tanımları:\n" -#: elf.c:1043 -msgid "\nVersion References:\n" -msgstr "\nSürüm Referanslarý:\n" +#: elf.c:1225 +msgid "" +"\n" +"Version References:\n" +msgstr "" +"\n" +"Sürüm Referansları:\n" -#: elf.c:1048 +#: elf.c:1230 #, c-format msgid " required from %s:\n" msgstr " %s'den isteniyor:\n" -#: elf.c:1675 +#: elf.c:1902 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" -msgstr "%1$s: yerdeðiþim bölümü %3$s (indeks %4$u) için geçersiz bað %2$lu" +msgstr "%1$s: yerdeÄŸiÅŸim bölümü %3$s (indeks %4$u) için geçersiz baÄŸ %2$lu" -#: elf.c:3289 +#: elf.c:3603 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" -msgstr "%s: Yazýlým baþlýklarý için yeterli yer yok (%u ayrýldý, %u gerekli)" +msgstr "%s: Yazılım baÅŸlıkları için yeterli yer yok (%u ayrıldı, %u gerekli)" -#: elf.c:3393 +#: elf.c:3708 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" -msgstr "%s: yazýlým baþlýklarý için gerekli yer yok, -N ile baðlamayý deneyin" +msgstr "%s: yazılım baÅŸlıkları için gerekli yer yok, -N ile baÄŸlamayı deneyin" -#: elf.c:3518 +#: elf.c:3833 #, c-format msgid "Error: First section in segment (%s) starts at 0x%x whereas the segment starts at 0x%x" -msgstr "Hata: Parçadaki (%s) ilk bölüm 0x%x'de, parça ise 0x%x'de baþlýyor" +msgstr "Hata: Parçadaki (%s) ilk bölüm 0x%x'de, parça ise 0x%x'de baÅŸlıyor" -#: elf.c:3804 +#: elf.c:4148 #, c-format msgid "%s: warning: allocated section `%s' not in segment" -msgstr "%s: uyarý: ayrýlmýþ `%s' bölümü parça içinde deðil" +msgstr "%s: uyarı: ayrılmış `%s' bölümü parça içinde deÄŸil" -#: elf.c:4138 +#: elf.c:4472 #, c-format msgid "%s: symbol `%s' required but not present" -msgstr "%s: `%s' sembolü gerekli fakat mevcut deðil" - -#: elf.c:4147 -#, c-format -msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" -msgstr "bfd sembolünden elf sembolü:0x%.8lx, isim= %s, sem num = %d, bayrak = 0x%.8lx%s\n" +msgstr "%s: `%s' sembolü gerekli fakat mevcut deÄŸil" -#: elf.c:4391 +#: elf.c:4749 #, c-format -msgid "%s: warning: Empty loadable segment detected\n" -msgstr "%s: uyarý: Boþ yüklenebilir parça bulundu\n" +msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" +msgstr "%s: uyarı: BoÅŸ yüklenebilir parça bulundu, bu isteyerek mi yapılıyor?\n" -#: elf.c:5804 +#: elf.c:6193 #, c-format msgid "%s: unsupported relocation type %s" -msgstr "%s: desteklenmeyen yerdeðiþim türü %s" +msgstr "%s: desteklenmeyen yerdeÄŸiÅŸim türü %s" -#: elf32-arm.h:1224 +#: elf32-arm.h:1221 #, c-format msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." -msgstr "%s: Uyarý: Arm BLX iþlemi Arm iþlevi '%s' hedefliyor." +msgstr "%s: Uyarı: Arm BLX iÅŸlemi Arm iÅŸlevi '%s' hedefliyor." -#: elf32-arm.h:1420 +#: elf32-arm.h:1417 #, c-format msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." -msgstr "%s: Uyarý: Thumb BLX iþlemi thumb iþlevi '%s'ý hedefliyor." +msgstr "%s: Uyarı: Thumb BLX iÅŸlemi thumb iÅŸlevi '%s'ı hedefliyor." -#: elf32-arm.h:1904 elf32-i386.c:1776 elf32-sh.c:3133 +#: elf32-arm.h:1914 elf32-sh.c:4125 #, c-format msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" -msgstr "%s(%s+0x%lx): SEC_MERGE bölümüne %s yerdeðiþimi" +msgstr "%s(%s+0x%lx): SEC_MERGE bölümüne %s yerdeÄŸiÅŸimi" -#: elf32-arm.h:1998 +#: elf32-arm.h:2008 #, c-format msgid "%s: warning: unresolvable relocation %d against symbol `%s' from %s section" -msgstr "%1$s: uyarý: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$d yer deðiþimi" - -#: elf32-arm.h:2114 -#, c-format -msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" -msgstr "Uyarý: beraber çalýþmaz diye önceden belirtilmiþ olduðundan %s'nin beraber çalýþma bayraðý atanmadý" - -#: elf32-arm.h:2118 -#, c-format -msgid "Warning: Clearing the interwork flag of %s due to outside request" -msgstr "Uyarý: Dýþ isteðe uyularak %s'nin beraber çalýþma bayraðý temizlendi" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$d yer deÄŸiÅŸimi" -#: elf32-arm.h:2166 +#: elf32-arm.h:2176 #, c-format -msgid "Warning: Clearing the interwork flag in %s because non-interworking code in %s has been linked with it" -msgstr "Uyarý: %2$s'deki beraber çalýþmaz kod ona baðlandýðý için %1$s'nin beraber çalýþma bayraðý temizlendi" +msgid "Warning: Clearing the interworking flag of %s because non-interworking code in %s has been linked with it" +msgstr "Uyarı: %2$s'deki beraber çalışmaz kod ona baÄŸlandığı için %1$s'nin beraber çalışma bayrağı temizlendi" -#: elf32-arm.h:2261 +#: elf32-arm.h:2271 #, c-format -msgid "Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" -msgstr "Hata: %s EABI sürüm %d için derlenmiþ, fakat %s %d sürümü için derlenmiþ" +msgid "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d" +msgstr "Hata: %s EABI sürüm %d için derlenmiÅŸ, fakat %s %d sürümü için derlenmiÅŸ" -#: elf32-arm.h:2275 +#: elf32-arm.h:2285 #, c-format -msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" -msgstr "Hata: %s APCS-%d için derlenmiþ, fakat %s APCS-%d için derlenmiþ" +msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" +msgstr "HATA: %s, APCS-%d için derlenmiÅŸ fakat hedef %s APCS-%d kullanıyor" -#: elf32-arm.h:2287 +#: elf32-arm.h:2313 #, c-format -msgid "Error: %s passes floats in FP registers, whereas %s passes them in integer registers" -msgstr "" -"Hata: %s kayan sayýlarý kayan sayý yazmaçlarýnda geçiriyor, \n" -" fakat %s tamsayý yazmaçlarýnda geçiriyor" - -#: elf32-arm.h:2292 -#, c-format -msgid "Error: %s passes floats in integer registers, whereas %s passes them in FP registers" -msgstr "" -"Hata: %s kayan sayýlarý tamsayý yazmaçlarýnda geçiriyor, \n" -" fakat %s kayan sayý yazmaçlarýnda geçiriyor" +msgid "ERROR: %s uses VFP instructions, whereas %s uses FPA instructions" +msgstr "Hata: %s VFP iÅŸlemi kullanıyor, fakat %s FPA iÅŸlemi kullanıyor" -#: elf32-arm.h:2303 +#: elf32-arm.h:2318 #, c-format -msgid "Error: %s uses VFP instructions, whereas %s FPA instructions" -msgstr "Hata: %s VFP iþlemi kullanýyor, fakat %s FPA iþlemi kullanýyor" +msgid "ERROR: %s uses FPA instructions, whereas %s uses VFP instructions" +msgstr "Hata: %s FPA iÅŸlemi kullanıyor, fakat %s VFP iÅŸlemi kullanıyor" -#: elf32-arm.h:2308 +#: elf32-arm.h:2338 #, c-format -msgid "Error: %s uses FPA instructions, whereas %s VFP instructions" -msgstr "Hata: %s FPA iþlemi kullanýyor, fakat %s VFP iþlemi kullanýyor" - -#: elf32-arm.h:2328 -#, c-format -msgid "Error: %s uses software FP, whereas %s uses hardware FP" +msgid "ERROR: %s uses software FP, whereas %s uses hardware FP" msgstr "" -"Hata: %s yazýlýmda kayan sayý kullanýyor,\n" -" fakat %s donanýmda kayan sayý kullanýyor" +"Hata: %s yazılımda kayan sayı kullanıyor,\n" +" fakat %s donanımda kayan sayı kullanıyor" -#: elf32-arm.h:2333 +#: elf32-arm.h:2343 #, c-format -msgid "Error: %s uses hardware FP, whereas %s uses software FP" +msgid "ERROR: %s uses hardware FP, whereas %s uses software FP" msgstr "" -"Hata: %s donanýmda kayan sayý kullanýyor,\n" -" fakat %s yazýlýmda kayan sayý kullanýyor" - -#: elf32-arm.h:2348 -#, c-format -msgid "Warning: %s supports interworking, whereas %s does not" -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý destekliyor, fakat %s desteklemiyor." - -#: elf32-arm.h:2355 -#, c-format -msgid "Warning: %s does not support interworking, whereas %s does" -msgstr "Uyarý: %s girdi dosyasý beraber çalýþmayý desteklemiyor, fakat %s destekliyor." +"Hata: %s donanımda kayan sayı kullanıyor,\n" +" fakat %s yazılımda kayan sayı kullanıyor" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2386 elf32-cris.c:2970 elf32-m68k.c:410 elf32-mips.c:3232 +#: elf32-arm.h:2396 elf32-cris.c:2988 elf32-m68k.c:410 elf32-vax.c:543 +#: elfxx-mips.c:7756 #, c-format msgid "private flags = %lx:" -msgstr "özel bayraklar = %lx:" +msgstr "özel bayraklar = %lx:" -#: elf32-arm.h:2395 +#: elf32-arm.h:2405 msgid " [interworking enabled]" -msgstr " [beraber çalýþma etkinleþtirilmiþ]" - -#: elf32-arm.h:2398 -msgid " [APCS-26]" -msgstr " [APCS-26]" +msgstr " [beraber çalışma etkinleÅŸtirilmiÅŸ]" -#: elf32-arm.h:2400 -msgid " [APCS-32]" -msgstr " [APCS-32]" - -#: elf32-arm.h:2403 +#: elf32-arm.h:2413 msgid " [VFP float format]" -msgstr " [VFP kayan nokta biçemi]" +msgstr " [VFP kayan nokta biçemi]" -#: elf32-arm.h:2405 +#: elf32-arm.h:2415 msgid " [FPA float format]" -msgstr " [FPA kayan nokta biçemi]" +msgstr " [FPA kayan nokta biçemi]" -#: elf32-arm.h:2414 +#: elf32-arm.h:2424 msgid " [new ABI]" msgstr " [yeni ABI]" -#: elf32-arm.h:2417 +#: elf32-arm.h:2427 msgid " [old ABI]" msgstr " [eski ABI]" -#: elf32-arm.h:2420 +#: elf32-arm.h:2430 msgid " [software FP]" -msgstr " [yazýlým FP]" +msgstr " [yazılım FP]" -#: elf32-arm.h:2428 +#: elf32-arm.h:2438 msgid " [Version1 EABI]" -msgstr " [Sürüm1 EABI]" +msgstr " [Sürüm1 EABI]" -#: elf32-arm.h:2431 elf32-arm.h:2442 +#: elf32-arm.h:2441 elf32-arm.h:2452 msgid " [sorted symbol table]" -msgstr " [sýralanmýþ sembol tablosu]" +msgstr " [sıralanmış sembol tablosu]" -#: elf32-arm.h:2433 elf32-arm.h:2444 +#: elf32-arm.h:2443 elf32-arm.h:2454 msgid " [unsorted symbol table]" -msgstr " [sýralanmamýþ sembol tablosu]" +msgstr " [sıralanmamış sembol tablosu]" -#: elf32-arm.h:2439 +#: elf32-arm.h:2449 msgid " [Version2 EABI]" -msgstr " [Sürüm2 EABI]" +msgstr " [Sürüm2 EABI]" -#: elf32-arm.h:2447 +#: elf32-arm.h:2457 msgid " [dynamic symbols use segment index]" -msgstr " [dinamik semboller bölüm indeksini kullanýyor]" +msgstr " [dinamik semboller bölüm indeksini kullanıyor]" -#: elf32-arm.h:2450 +#: elf32-arm.h:2460 msgid " [mapping symbols precede others]" -msgstr " [eþleþme sembolleri diðerlerinden önceliklidir]" +msgstr " [eÅŸleÅŸme sembolleri diÄŸerlerinden önceliklidir]" -#: elf32-arm.h:2457 +#: elf32-arm.h:2467 msgid " <EABI version unrecognised>" -msgstr " <EABI sürümü bilinmiyor>" +msgstr " <EABI sürümü bilinmiyor>" -#: elf32-arm.h:2464 +#: elf32-arm.h:2474 msgid " [relocatable executable]" -msgstr " [yer deðiþtirebilir uygulama]" +msgstr " [yer deÄŸiÅŸtirebilir uygulama]" -#: elf32-arm.h:2467 +#: elf32-arm.h:2477 msgid " [has entry point]" -msgstr " [girdi noktasý var]" +msgstr " [girdi noktası var]" -#: elf32-arm.h:2472 +#: elf32-arm.h:2482 msgid "<Unrecognised flag bits set>" -msgstr "<Bilinmeyen bayrak bitleri atanmýþ>" +msgstr "<Bilinmeyen bayrak bitleri atanmış>" -#: elf32-avr.c:843 elf32-cris.c:1400 elf32-fr30.c:661 elf32-i860.c:1056 -#: elf32-openrisc.c:463 elf32-v850.c:1699 elf64-mmix.c:1172 +#: elf32-avr.c:841 elf32-cris.c:1411 elf32-fr30.c:643 elf32-frv.c:817 +#: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699 +#: elf32-xstormy16.c:941 elf64-mmix.c:1310 msgid "internal error: dangerous relocation" -msgstr "iç hata: tehlikeli yer deðiþim" +msgstr "iç hata: tehlikeli yer deÄŸiÅŸim" #: elf32-cris.c:949 #, c-format msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" -msgstr "%1$s: uyarý: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$s yer deðiþimi" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne çözümlenemeyen %2$s yer deÄŸiÅŸimi" #: elf32-cris.c:1012 #, c-format msgid "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" -msgstr "%1$s: %4$s bölümünden `%3$s' sembolüne %2$s yer deðiþimi için PLT veya GOT yok" +msgstr "%1$s: %4$s bölümünden `%3$s' sembolüne %2$s yer deÄŸiÅŸimi için PLT veya GOT yok" -#: elf32-cris.c:1015 elf32-cris.c:1142 +#: elf32-cris.c:1015 elf32-cris.c:1141 msgid "[whose name is lost]" -msgstr "[adý kaybolmuþ]" +msgstr "[adı kaybolmuÅŸ]" -#: elf32-cris.c:1131 +#: elf32-cris.c:1130 #, c-format msgid "%s: relocation %s with non-zero addend %d against local symbol from %s section" msgstr "" -"%1$s: %4$s bölümünden yerel sembol sýfýr olmayan %3$d eklemesi ile\n" -" %2$s yerdeðiþimi" +"%1$s: %4$s bölümünden yerel sembol sıfır olmayan %3$d eklemesi ile\n" +" %2$s yerdeÄŸiÅŸimi" -#: elf32-cris.c:1138 +#: elf32-cris.c:1137 #, c-format msgid "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" -msgstr "%1$s: %5$s bölümünden `%4$s' sembolüne sýfýr olmayan %3$d eklemesi ile %2$s yerdeðiþimi" +msgstr "%1$s: %5$s bölümünden `%4$s' sembolüne sıfır olmayan %3$d eklemesi ile %2$s yerdeÄŸiÅŸimi" -#: elf32-cris.c:1156 +#: elf32-cris.c:1155 #, c-format msgid "%s: relocation %s is not allowed for global symbol: `%s' from %s section" -msgstr "%1$s: %4$s bölümünden %3$s evrensel sembolü için %2$s yerdeðiþimi yapýlamaz" +msgstr "%1$s: %4$s bölümünden %3$s evrensel sembolü için %2$s yerdeÄŸiÅŸimi yapılamaz" -#: elf32-cris.c:1275 +#: elf32-cris.c:1170 +#, c-format +msgid "%s: relocation %s in section %s with no GOT created" +msgstr "%1$s: `%3$s' bölümünde %2$s yer deÄŸiÅŸtirmesi mevcut, fakat GOT oluÅŸturulmamış" + +#: elf32-cris.c:1288 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" -msgstr "%s: Ýç tutarsýzlýk; %s yerdeðiþim bölümü yok" +msgstr "%s: İç tutarsızlık; %s yerdeÄŸiÅŸim bölümü yok" -#: elf32-cris.c:2508 +#: elf32-cris.c:2514 #, c-format msgid "" "%s, section %s:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -"%s, %s bölümü:\n" -" %s yer deðiþimi paylaþýmlý nesne oluþtururken kullanýlamaz;\n" +"%s, %s bölümü:\n" +" %s yer deÄŸiÅŸimi paylaşımlı nesne oluÅŸtururken kullanılamaz;\n" " -fPIC ile yeniden derleyin" -#: elf32-cris.c:2973 +#: elf32-cris.c:2991 msgid " [symbols have a _ prefix]" -msgstr " [semboller _ önekine sahip]" +msgstr " [semboller _ önekine sahip]" -#: elf32-cris.c:3012 +#: elf32-cris.c:3030 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" -msgstr "%s: _-önekli sembolleri kullanýyor, fakat dosyaya öneksiz sembolleri yazýyor" +msgstr "%s: _-önekli sembolleri kullanıyor, fakat dosyaya öneksiz sembolleri yazıyor" -#: elf32-cris.c:3013 +#: elf32-cris.c:3031 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" -msgstr "%s: öneksiz sembolleri kullanýyor, fakat dosyaya _-önekli sembolleri yazýyor" +msgstr "%s: öneksiz sembolleri kullanıyor, fakat dosyaya _-önekli sembolleri yazıyor" + +#: elf32-frv.c:1217 +#, c-format +msgid "%s: compiled with %s and linked with modules that use non-pic relocations" +msgstr "%s: %s ile derlendi ve normal derlenmiÅŸ modüllerle baÄŸlandı" + +#: elf32-frv.c:1267 +#, c-format +msgid "%s: compiled with %s and linked with modules compiled with %s" +msgstr "%s: %s ile derlendi ve %s ile derlenmiÅŸ modüllerle baÄŸlandı" + +#: elf32-frv.c:1279 +#, c-format +msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%s: önceki modüllerden farklı bilinmeyen e_flags (0x%lx) alanları kullanılıyor (0x%lx)" + +#: elf32-frv.c:1315 +#, c-format +msgid "private flags = 0x%lx:" +msgstr "özel bayraklar = 0x%lx:" #: elf32-gen.c:82 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" -msgstr "%s: Normal ELF'de yerdeðiþimler (EM: %d)" +msgstr "%s: Normal ELF'de yerdeÄŸiÅŸimler (EM: %d)" -#: elf32-hppa.c:646 +#: elf32-hppa.c:671 elf64-ppc.c:2323 #, c-format msgid "%s: cannot create stub entry %s" -msgstr "%s: koçan giriþi %s oluþturulamadý" +msgstr "%s: koçan giriÅŸi %s oluÅŸturulamadı" -#: elf32-hppa.c:937 elf32-hppa.c:3540 +#: elf32-hppa.c:956 elf32-hppa.c:3555 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" -msgstr "%s(%s+0x%lx): %s'e ulaþýlamadý, -ffunction-sections ile derleyin" +msgstr "%s(%s+0x%lx): %s'e ulaşılamadı, -ffunction-sections ile derleyin" -#: elf32-hppa.c:1312 +#: elf32-hppa.c:1338 elf64-x86-64.c:673 #, c-format msgid "%s: relocation %s can not be used when making a shared object; recompile with -fPIC" -msgstr "%s: %s yer deðiþimi paylaþýmlý nesne oluþturulurken kullanýlamaz; -fPIC ile yeniden derleyin" +msgstr "%s: %s yer deÄŸiÅŸimi paylaşımlı nesne oluÅŸturulurken kullanılamaz; -fPIC ile yeniden derleyin" -#: elf32-hppa.c:1332 +#: elf32-hppa.c:1358 #, c-format msgid "%s: relocation %s should not be used when making a shared object; recompile with -fPIC" -msgstr "%s: %s yer deðiþimi paylaþýmlý nesne oluþtururken kullanýlamaz; -fPIC ile yeniden derleyin" +msgstr "%s: %s yer deÄŸiÅŸimi paylaşımlı nesne oluÅŸtururken kullanılamaz; -fPIC ile yeniden derleyin" -#: elf32-hppa.c:1525 +#: elf32-hppa.c:1551 #, c-format msgid "Could not find relocation section for %s" -msgstr "%s için yer deðiþtirme bölümü bulunamadý" +msgstr "%s için yer deÄŸiÅŸtirme bölümü bulunamadı" -#: elf32-hppa.c:2862 +#: elf32-hppa.c:2855 #, c-format msgid "%s: duplicate export stub %s" -msgstr "%s: birden fazla ihraç koçaný %s" +msgstr "%s: birden fazla ihraç koçanı %s" -#: elf32-hppa.c:3424 +#: elf32-hppa.c:3433 #, c-format msgid "%s(%s+0x%lx): fixing %s" -msgstr "%s(%s+0x%lx): %s düzeltiliyor" +msgstr "%s(%s+0x%lx): %s düzeltiliyor" -#: elf32-hppa.c:4064 +#: elf32-hppa.c:4080 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" -msgstr "%1$s(%2$s+0x%3$lx): %5$s için %4$s iþlenemedi" +msgstr "%1$s(%2$s+0x%3$lx): %5$s için %4$s iÅŸlenemedi" -#: elf32-hppa.c:4403 +#: elf32-hppa.c:4393 msgid ".got section not immediately after .plt section" -msgstr ".got bölümü .plt bölümünün hemen arkasýnda deðil" +msgstr ".got bölümü .plt bölümünün hemen arkasında deÄŸil" -#: elf32-i386.c:298 +#: elf32-i386.c:379 #, c-format msgid "%s: invalid relocation type %d" -msgstr "%s: geçersiz yer deðiþim türü %d" +msgstr "%s: geçersiz yer deÄŸiÅŸim türü %d" -#: elf32-i386.c:718 elf32-s390.c:636 elf64-s390.c:595 +#: elf32-i386.c:876 elf32-s390.c:649 elf64-s390.c:595 elf64-x86-64.c:591 #, c-format msgid "%s: bad symbol index: %d" -msgstr "%s: geçersiz sembol indeksi: %d" +msgstr "%s: geçersiz sembol indeksi: %d" + +#: elf32-i386.c:948 +#, c-format +msgid "%s: `%s' accessed both as normal and thread local symbol" +msgstr "%s: `%s'a hem normal, hem de dal yerel sembolü olarak eriÅŸildi" -#: elf32-i386.c:863 elf32-s390.c:790 elf64-ppc.c:2085 elf64-s390.c:759 +#: elf32-i386.c:1072 elf32-s390.c:808 elf64-ppc.c:2827 elf64-s390.c:759 +#: elf64-x86-64.c:761 #, c-format msgid "%s: bad relocation section name `%s'" -msgstr "%s: geçersiz yerdeðiþim bölümü adý `%s'" +msgstr "%s: geçersiz yerdeÄŸiÅŸim bölümü adı `%s'" -#: elf32-i386.c:2067 elf32-s390.c:1949 elf64-ppc.c:3908 elf64-s390.c:1953 +#: elf32-i386.c:1159 elf64-alpha.c:4768 +#, c-format +msgid "%s: TLS local exec code cannot be linked into shared objects" +msgstr "%s: TLS yerel çalıştırma kodu paylaşımlı nesnelere baÄŸlanamaz" + +#: elf32-i386.c:2747 elf32-s390.c:1981 elf32-sparc.c:1571 elf64-ppc.c:5918 +#: elf64-s390.c:1945 elf64-sparc.c:2578 elf64-x86-64.c:1948 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" -msgstr "%s(%s+0x%lx): `%s' sembolüne çözümlenemeyen yer deðiþimi" +msgstr "%s(%s+0x%lx): `%s' sembolüne çözümlenemeyen yer deÄŸiÅŸimi" -#: elf32-i386.c:2105 elf32-s390.c:1987 elf64-s390.c:1991 +#: elf32-i386.c:2784 elf32-s390.c:2019 elf64-ppc.c:5977 elf64-s390.c:1983 +#: elf64-x86-64.c:1986 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" -msgstr "%s(%s+0x%lx): %s'e yer deðiþimi: %d hatasý" +msgstr "%s(%s+0x%lx): %s'e yer deÄŸiÅŸimi: %d hatası" #: elf32-m32r.c:924 msgid "SDA relocation when _SDA_BASE_ not defined" -msgstr "_SDA_BASE_ tanýmlanmamýþ iken SDA yer deðiþimi" +msgstr "_SDA_BASE_ tanımlanmamış iken SDA yer deÄŸiÅŸimi" -#: elf32-ia64.c:3538 elf32-m32r.c:1008 elf32-ppc.c:2930 elf64-ia64.c:3538 +#: elf32-ia64.c:3687 elf32-m32r.c:1013 elf32-ppc.c:2987 elf64-alpha.c:4185 +#: elf64-alpha.c:4313 elf64-ia64.c:3687 #, c-format msgid "%s: unknown relocation type %d" -msgstr "%s: bilinmeyen yer deðiþim türü %d" +msgstr "%s: bilinmeyen yer deÄŸiÅŸim türü %d" -#: elf32-m32r.c:1224 +#: elf32-m32r.c:1221 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" -msgstr "%1$s: Bir %3$s yer deðiþiminin hedefi (%2$s) yanlýþ bölümde (%4$s)" +msgstr "%1$s: Bir %3$s yer deÄŸiÅŸiminin hedefi (%2$s) yanlış bölümde (%4$s)" -#: elf32-m32r.c:2001 +#: elf32-m32r.c:1947 #, c-format msgid "%s: Instruction set mismatch with previous modules" -msgstr "%s: Önceki modüllerle iþlem uyuþmazlýðý" +msgstr "%s: Önceki modüllerle iÅŸlem uyuÅŸmazlığı" -#: elf32-m32r.c:2024 +#: elf32-m32r.c:1970 #, c-format msgid "private flags = %lx" -msgstr "özel bayraklar = %lx" +msgstr "özel bayraklar = %lx" -#: elf32-m32r.c:2029 +#: elf32-m32r.c:1975 msgid ": m32r instructions" -msgstr ": m32r iþlemleri" +msgstr ": m32r iÅŸlemleri" -#: elf32-m32r.c:2030 +#: elf32-m32r.c:1976 msgid ": m32rx instructions" -msgstr ": m32rx iþlemleri" +msgstr ": m32rx iÅŸlemleri" #: elf32-m68k.c:413 msgid " [cpu32]" msgstr " [cpu32]" -#: elf32-mcore.c:353 elf32-mcore.c:479 +#: elf32-m68k.c:416 +msgid " [m68000]" +msgstr " [m68000]" + +#: elf32-mcore.c:354 elf32-mcore.c:457 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" -msgstr "%s: %s (%d) yer deðiþimi henüz desteklenmiyor.\n" +msgstr "%s: %s (%d) yer deÄŸiÅŸimi henüz desteklenmiyor.\n" -#: elf32-mcore.c:438 +#: elf32-mcore.c:442 #, c-format msgid "%s: Unknown relocation type %d\n" -msgstr "%s: Bilinmeyen yer deðiþim türü %d\n" +msgstr "%s: Bilinmeyen yer deÄŸiÅŸim türü %d\n" -#: elf32-mips.c:2146 elf64-mips.c:1972 +#: elf32-mips.c:1152 elf64-mips.c:1783 msgid "32bits gp relative relocation occurs for an external symbol" -msgstr "32 bitlik gp göreceli yer deðiþim bir dýþ sembol için yapýlýyor" +msgstr "32 bitlik gp göreceli yer deÄŸiÅŸim bir dış sembol için yapılıyor" -#: elf32-mips.c:2295 +#: elf32-mips.c:1301 #, c-format msgid "Linking mips16 objects into %s format is not supported" -msgstr "mips16 nesnelerini %s biçemine baðlamak desteklenmiyor" +msgstr "mips16 nesnelerini %s biçemine baÄŸlamak desteklenmiyor" -#: elf32-mips.c:3119 +#: elf32-ppc.c:1460 #, c-format -msgid "%s: linking PIC files with non-PIC files" -msgstr "%s: PIC dosyalarý PIC olmayan dosyalarla baðlanýyor" +msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" +msgstr "%s: -mrelocatable ile derlendi ve normal derlenmiÅŸ modüllerle baÄŸlandı" -#: elf32-mips.c:3129 +#: elf32-ppc.c:1468 #, c-format -msgid "%s: linking abicalls files with non-abicalls files" -msgstr "%s: abicalls dosyalarý abicalls olmayan dosyalarla baðlanýyor" +msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" +msgstr "%s: normal derlendi ve -mrelocatable ile derlenmiÅŸ modüllere baÄŸlandı" -#: elf32-mips.c:3158 +#: elf32-ppc.c:1494 elf64-sparc.c:2989 elfxx-mips.c:7713 #, c-format -msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" -msgstr "%1$s: Önceki modüllerle (-mips%3$d) ile ISA uyumsuzluðu (-mips%2$d)" +msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "%1$s: önceki modüllerden (0x%3$lx) farklı e_flags (0x%2$lx) alanları kullanılıyor" -#: elf32-mips.c:3167 +#: elf32-ppc.c:1592 #, c-format -msgid "%s: ISA mismatch (%d) with previous modules (%d)" -msgstr "%1$s: Önceki modüllerle (%3$d) ile ISA uyumsuzluðu (%2$d)" +msgid "%s: Unknown special linker type %d" +msgstr "%s: Bilinmeyen özel baÄŸlayıcı türü %d" -#: elf32-mips.c:3190 +#: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342 #, c-format -msgid "%s: ABI mismatch: linking %s module with previous %s modules" -msgstr "%s: ABI uyumsuzluðu: %s modülü önceki %s modülle baðlanýyor" +msgid "%s: relocation %s cannot be used when making a shared object" +msgstr "%s: %s yerdeÄŸiÅŸimi paylaşımlı nesne oluÅŸturulurken kullanılamaz" -#: elf32-mips.c:3204 elf32-ppc.c:1470 elf64-ppc.c:1538 elf64-sparc.c:3033 +#: elf32-ppc.c:3126 elf64-ppc.c:5473 #, c-format -msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" -msgstr "%1$s: önceki modüllerden (0x%3$lx) farklý e_flags (0x%2$lx) alanlarý kullanýlýyor" - -#: elf32-mips.c:3235 -msgid " [abi=O32]" -msgstr " [abi=O32]" - -#: elf32-mips.c:3237 -msgid " [abi=O64]" -msgstr " [abi=O64]" - -#: elf32-mips.c:3239 -msgid " [abi=EABI32]" -msgstr " [abi=EABI32]" - -#: elf32-mips.c:3241 -msgid " [abi=EABI64]" -msgstr " [abi=EABI64]" - -#: elf32-mips.c:3243 -msgid " [abi unknown]" -msgstr " [abi bilinmiyor]" - -#: elf32-mips.c:3245 -msgid " [abi=N32]" -msgstr " [abi=N32]" - -#: elf32-mips.c:3247 -msgid " [abi=64]" -msgstr " [abi=64]" - -#: elf32-mips.c:3249 -msgid " [no abi set]" -msgstr " [abi atanmamýþ]" - -#: elf32-mips.c:3252 -msgid " [mips1]" -msgstr " [mips1]" - -#: elf32-mips.c:3254 -msgid " [mips2]" -msgstr " [mips2]" - -#: elf32-mips.c:3256 -msgid " [mips3]" -msgstr " [mips3]" - -#: elf32-mips.c:3258 -msgid " [mips4]" -msgstr " [mips4]" - -#: elf32-mips.c:3260 -msgid " [mips5]" -msgstr " [mips5]" - -#: elf32-mips.c:3262 -msgid " [mips32]" -msgstr " [mips32]" - -#: elf32-mips.c:3264 -msgid " [mips64]" -msgstr " [mips64]" - -#: elf32-mips.c:3266 -msgid " [unknown ISA]" -msgstr " [bilinmeyen ISA]" - -#: elf32-mips.c:3269 -msgid " [32bitmode]" -msgstr " [32bitkipi]" - -#: elf32-mips.c:3271 -msgid " [not 32bitmode]" -msgstr " [32bitkipi deðil]" - -#: elf32-mips.c:4947 -msgid "static procedure (no name)" -msgstr "statik altyordam (isimsiz)" +msgid "%s: unknown relocation type %d for symbol %s" +msgstr "%1$s: %3$s sembolü için bilinmeyen %2$d türünde yerdeÄŸiÅŸimi" -#: elf32-mips.c:5565 elf64-mips.c:6694 +#: elf32-ppc.c:3482 elf32-ppc.c:3503 elf32-ppc.c:3553 #, c-format -msgid "%s: illegal section name `%s'" -msgstr "%s: geçersiz bölüm adý `%s'" - -#: elf32-mips.c:6132 elf64-mips.c:3150 -msgid "not enough GOT space for local GOT entries" -msgstr "yerel GOT girdileri için yeterli GOT yeri yok" +msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" +msgstr "%1$s: %3$s yerdeÄŸiÅŸiminin hedefi (%2$s) yanlış çıktı bölümünde (%4$s)" -#: elf32-mips.c:7238 elf64-mips.c:4203 +#: elf32-ppc.c:3619 #, c-format -msgid "%s: %s+0x%lx: jump to stub routine which is not jal" -msgstr "%s: %s+0x%lx: jal olmayan koçan yordamýna sýçrama" +msgid "%s: Relocation %s is not yet supported for symbol %s." +msgstr "%s: %s yerdeÄŸiÅŸimi %s sembolü için henüz desteklenmiyor." -#: elf32-mips.c:8237 elf64-mips.c:5891 +#: elf32-sh.c:1964 #, c-format -msgid "%s: Malformed reloc detected for section %s" -msgstr "%s: %s bölümü için geçersiz yer deðiþim bulundu" +msgid "%s: 0x%lx: warning: bad R_SH_USES offset" +msgstr "%s: 0x%lx: uyarı: hatalı R_SH_USES göreli konumu" -#: elf32-mips.c:8315 elf64-mips.c:5969 +#: elf32-sh.c:1976 #, c-format -msgid "%s: CALL16 reloc at 0x%lx not against global symbol" -msgstr "%s: 0x%lx'deki CALL16 yerdeðiþimi evrensel sembole göre deðil" +msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" +msgstr "%s: 0x%lx: uyarı: R_SH_USES bilinmeyen insn 0x%x'ı imliyor" -#: elf32-ppc.c:1436 elf64-ppc.c:1503 +#: elf32-sh.c:1993 #, c-format -msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" -msgstr "%s: -mrelocatable ile derlendi ve normal derlenmiþ modüllerle baðlandý" +msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" +msgstr "%s: 0x%lx: uyarı: hatalı R_SH_USES yükleme göreli konumu" -#: elf32-ppc.c:1444 elf64-ppc.c:1511 +#: elf32-sh.c:2008 #, c-format -msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" -msgstr "%s: normal derlendi ve -mrelocatable ile derlenmiþ modüllere baðlandý" +msgid "%s: 0x%lx: warning: could not find expected reloc" +msgstr "%s: 0x%lx: uyarı: beklenen yerdeÄŸiÅŸim bulunamadı" -#: elf32-ppc.c:1568 +#: elf32-sh.c:2036 #, c-format -msgid "%s: Unknown special linker type %d" -msgstr "%s: Bilinmeyen özel baðlayýcý türü %d" +msgid "%s: 0x%lx: warning: symbol in unexpected section" +msgstr "%s: 0x%lx: uyarı: beklenmeyen bölümde sembol" -#: elf32-ppc.c:2218 elf32-ppc.c:2252 elf32-ppc.c:2287 +#: elf32-sh.c:2153 #, c-format -msgid "%s: relocation %s cannot be used when making a shared object" -msgstr "%s: %s yerdeðiþimi paylaþýmlý nesne oluþturulurken kullanýlamaz" +msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" +msgstr "%s: 0x%lx: uyarı: beklenen COUNT yerdeÄŸiÅŸimi bulunamadı" -#: elf32-ppc.c:3097 elf64-ppc.c:3500 +#: elf32-sh.c:2162 #, c-format -msgid "%s: unknown relocation type %d for symbol %s" -msgstr "%1$s: %3$s sembolü için bilinmeyen %2$d türünde yerdeðiþimi" +msgid "%s: 0x%lx: warning: bad count" +msgstr "%s: 0x%lx: uyarı: hatalı sayım" -#: elf32-ppc.c:3452 elf32-ppc.c:3473 elf32-ppc.c:3523 +#: elf32-sh.c:2550 elf32-sh.c:2926 #, c-format -msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" -msgstr "%1$s: %3$s yerdeðiþiminin hedefi (%2$s) yanlýþ çýktý bölümünde (%4$s)" +msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" +msgstr "%s: 0x%lx: ölümcül: gevÅŸetilirken yerdeÄŸiÅŸim taÅŸması" -#: elf32-ppc.c:3589 -#, c-format -msgid "%s: Relocation %s is not yet supported for symbol %s." -msgstr "%s: %s yerdeðiþimi %s sembolü için henüz desteklenmiyor." +#: elf32-sh.c:4073 elf64-sh64.c:1576 +msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +msgstr "Yerel sembolde STO_SH5_ISA32 desteklenmiyor" -#: elf32-sh.c:1101 +#: elf32-sh.c:4284 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES offset" -msgstr "%s: 0x%lx: uyarý: hatalý R_SH_USES göreli konumu" +msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" +msgstr "%s: 0x%lx: ölümcül: gevÅŸetme destek yerdeÄŸiÅŸimi için hizalanmamış dal" -#: elf32-sh.c:1113 +#: elf32-sh64.c:203 elf64-sh64.c:2364 #, c-format -msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" -msgstr "%s: 0x%lx: uyarý: R_SH_USES bilinmeyen insn 0x%x'ý imliyor" +msgid "%s: compiled as 32-bit object and %s is 64-bit" +msgstr "%s: 32 bitlik sistem için derlenmiÅŸ ve %s 64 bit" -#: elf32-sh.c:1130 +#: elf32-sh64.c:206 elf64-sh64.c:2367 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" -msgstr "%s: 0x%lx: uyarý: hatalý R_SH_USES yükleme göreli konumu" +msgid "%s: compiled as 64-bit object and %s is 32-bit" +msgstr "%s: 64 bitlik sistem için derlenmiÅŸ ve %s 32 bit" -#: elf32-sh.c:1145 +#: elf32-sh64.c:208 elf64-sh64.c:2369 #, c-format -msgid "%s: 0x%lx: warning: could not find expected reloc" -msgstr "%s: 0x%lx: uyarý: beklenen yerdeðiþim bulunamadý" +msgid "%s: object size does not match that of target %s" +msgstr "%s: nesne boyu hedef %s'nin boyuyla eÅŸleÅŸmiyor" -#: elf32-sh.c:1202 +#: elf32-sh64.c:440 elf64-sh64.c:2941 #, c-format -msgid "%s: 0x%lx: warning: symbol in unexpected section" -msgstr "%s: 0x%lx: uyarý: beklenmeyen bölümde sembol" +msgid "%s: encountered datalabel symbol in input" +msgstr "%s: girdide veri etiketi sembolüne rastlandı" + +#: elf32-sh64.c:523 +msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" +msgstr "PTB uyumsuzluÄŸu: SHmedia adresi (bit 0 == 1)" + +#: elf32-sh64.c:526 +msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" +msgstr "PTA uyumsuzluÄŸu: SHcompact adresi (bit 0 == 0)" -#: elf32-sh.c:1323 +#: elf32-sh64.c:544 #, c-format -msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" -msgstr "%s: 0x%lx: uyarý: beklenen COUNT yerdeðiþimi bulunamadý" +msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" +msgstr "%s: GAS hatası: R_SH_PT_16 içeren PTB yönergesi beklenmiyordu" -#: elf32-sh.c:1332 +#: elf32-sh64.c:593 elf64-sh64.c:1703 #, c-format -msgid "%s: 0x%lx: warning: bad count" -msgstr "%s: 0x%lx: uyarý: hatalý sayým" +msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" +msgstr "%1$s: %3$08x ve %4$08x yerdeÄŸiÅŸtirmesinde hizalanmamış yer deÄŸiÅŸtirme türü %2$d\n" -#: elf32-sh.c:1741 elf32-sh.c:2132 +#: elf32-sh64.c:677 #, c-format -msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" -msgstr "%s: 0x%lx: ölümcül: gevþetilirken yerdeðiþim taþmasý" +msgid "%s: could not write out added .cranges entries" +msgstr "%s: eklenen .cranges girdileri yazılamadı" -#: elf32-sh.c:3267 +#: elf32-sh64.c:739 #, c-format -msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" -msgstr "%s: 0x%lx: ölümcül: gevþetme destek yerdeðiþimi için hizalanmamýþ dal" +msgid "%s: could not write out sorted .cranges entries" +msgstr "%s: sıralanmış .cranges girdileri yazılamadı" -#: elf32-sparc.c:1554 elf64-sparc.c:2286 +#: elf32-sparc.c:1535 elf64-sparc.c:2224 #, c-format msgid "%s: probably compiled without -fPIC?" -msgstr "%s: acaba -fPIC olmaksýzýn mý derlenmiþ?" +msgstr "%s: acaba -fPIC olmaksızın mı derlenmiÅŸ?" -#: elf32-sparc.c:2007 +#: elf32-sparc.c:2002 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" -msgstr "%s: 64 bitlik sistem için derlenmiþ ve hedef 32 bit" +msgstr "%s: 64 bitlik sistem için derlenmiÅŸ ve hedef 32 bit" -#: elf32-sparc.c:2021 +#: elf32-sparc.c:2016 #, c-format msgid "%s: linking little endian files with big endian files" -msgstr "%s: küçük sonlu dosyalar büyük sonlu dosyalarla baðlanýyor" +msgstr "%s: küçük sonlu dosyalar büyük sonlu dosyalarla baÄŸlanıyor" #: elf32-v850.c:682 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" -msgstr "`%s' deðiþkeni birden fazla küçük veri sahasýný kapsayamaz" +msgstr "`%s' deÄŸiÅŸkeni birden fazla küçük veri sahasını kapsayamaz" #: elf32-v850.c:685 #, c-format msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions" -msgstr "`%s' deðiþkeni küçük, sýfýr ve ufak veri sahalarýndan yalnýz birinde olabilir" +msgstr "`%s' deÄŸiÅŸkeni küçük, sıfır ve ufak veri sahalarından yalnız birinde olabilir" #: elf32-v850.c:688 #, c-format msgid "Variable `%s' cannot be in both small and zero data regions simultaneously" -msgstr "`%s' deðiþkeni ayný anda hem küçük hem sýfýr veri sahalarýnda bulunamaz" +msgstr "`%s' deÄŸiÅŸkeni aynı anda hem küçük hem sıfır veri sahalarında bulunamaz" #: elf32-v850.c:691 #, c-format msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously" -msgstr "`%s' deðiþkeni ayný anda hem küçük hem ufak veri sahalarýnda bulunamaz" +msgstr "`%s' deÄŸiÅŸkeni aynı anda hem küçük hem ufak veri sahalarında bulunamaz" #: elf32-v850.c:694 #, c-format msgid "Variable `%s' cannot be in both zero and tiny data regions simultaneously" -msgstr "`%s' deðiþkeni ayný anda hem sýfýr hem ufak veri sahalarýnda bulunamaz" +msgstr "`%s' deÄŸiÅŸkeni aynı anda hem sıfır hem ufak veri sahalarında bulunamaz" #: elf32-v850.c:1072 msgid "FAILED to find previous HI16 reloc\n" -msgstr "önceki HI16 yerdeðiþimi BULUNAMADI\n" +msgstr "önceki HI16 yerdeÄŸiÅŸimi BULUNAMADI\n" #: elf32-v850.c:1703 msgid "could not locate special linker symbol __gp" -msgstr "özel baðlayýcý sembolü __gp bulunamadý" +msgstr "özel baÄŸlayıcı sembolü __gp bulunamadı" #: elf32-v850.c:1707 msgid "could not locate special linker symbol __ep" -msgstr "özel baðlayýcý sembolü __ep bulunamadý" +msgstr "özel baÄŸlayıcı sembolü __ep bulunamadı" #: elf32-v850.c:1711 msgid "could not locate special linker symbol __ctbp" -msgstr "özel baðlayýcý sembolü __ctbp bulunamadý" +msgstr "özel baÄŸlayıcı sembolü __ctbp bulunamadı" -#: elf32-v850.c:1877 +#: elf32-v850.c:1875 #, c-format msgid "%s: Architecture mismatch with previous modules" -msgstr "%s: Önceki modüllerle platform uyumsuzluðu" +msgstr "%s: Önceki modüllerle platform uyumsuzluÄŸu" -#: elf32-v850.c:1897 +#: elf32-v850.c:1895 #, c-format msgid "private flags = %lx: " -msgstr "özel bayraklar = %lx:" +msgstr "özel bayraklar = %lx:" -#: elf32-v850.c:1902 +#: elf32-v850.c:1900 msgid "v850 architecture" msgstr "v850 platformu" -#: elf32-v850.c:1903 +#: elf32-v850.c:1901 msgid "v850e architecture" msgstr "v850e platformu" -#: elf32-v850.c:1904 +#: elf32-v850.c:1902 msgid "v850ea architecture" msgstr "v850ea platformu" -#: elf64-alpha.c:858 +#: elf32-vax.c:546 +msgid " [nonpic]" +msgstr " [nonpic]" + +#: elf32-vax.c:549 +msgid " [d-float]" +msgstr " [d-float]" + +#: elf32-vax.c:552 +msgid " [g-float]" +msgstr " [g-float]" + +#: elf32-vax.c:674 +#, c-format +msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld" +msgstr "%1$s: uyarı: `%3$s'ye GOT %2$ld eklentisi bir önceki %4$ld GOT eklentisiyle eÅŸleÅŸmiyor" + +#: elf32-vax.c:1679 +#, c-format +msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne PLT eklentisi %2$d yok sayıldı" + +#: elf32-vax.c:1814 +#, c-format +msgid "%s: warning: %s relocation against symbol `%s' from %s section" +msgstr "%1$s: uyarı: %4$s bölümünden `%3$s' sembolüne %2$s yer deÄŸiÅŸimi" + +#: elf32-vax.c:1820 +#, c-format +msgid "%s: warning: %s relocation to 0x%x from %s section" +msgstr "%1$s: uyarı: %4$s bölümünden 0x%3$x'e %2$s yer deÄŸiÅŸimi" + +#: elf32-ia64.c:2280 elf32-xstormy16.c:414 elf64-ia64.c:2280 +msgid "non-zero addend in @fptr reloc" +msgstr "@fptr yerdeÄŸiÅŸiminde sıfır olmayan eklenti" + +#: elf64-alpha.c:1097 msgid "GPDISP relocation did not find ldah and lda instructions" -msgstr "GPDISP yerdeðiþimi ldah ve lda iþlemlerini bulamadý" +msgstr "GPDISP yerdeÄŸiÅŸimi ldah ve lda iÅŸlemlerini bulamadı" -#: elf64-alpha.c:2934 +#: elf64-alpha.c:3675 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" -msgstr "%s: .got alt parçasý 64K'yý aþýyor (boy %d)" +msgstr "%s: .got alt parçası 64K'yı aşıyor (boy %d)" -#: elf64-alpha.c:3518 elf64-alpha.c:3530 +#: elf64-alpha.c:4498 elf64-alpha.c:4510 #, c-format msgid "%s: gp-relative relocation against dynamic symbol %s" -msgstr "%s: %s dinamik sembolüne gp göreceli yer deðiþimi" +msgstr "%s: %s dinamik sembolüne gp göreceli yer deÄŸiÅŸimi" + +#: elf64-alpha.c:4536 elf64-alpha.c:4676 +#, c-format +msgid "%s: pc-relative relocation against dynamic symbol %s" +msgstr "%s: %s dinamik sembolüne pc göreceli yer deÄŸiÅŸimi" + +#: elf64-alpha.c:4564 +#, c-format +msgid "%s: change in gp: BRSGP %s" +msgstr "%s: gp içinde deÄŸiÅŸiklik: BRSGP %s" -#: elf64-hppa.c:2070 +#: elf64-alpha.c:4589 +msgid "<unknown>" +msgstr "<bilinmeyen>" + +#: elf64-alpha.c:4594 +#, c-format +msgid "%s: !samegp reloc against symbol without .prologue: %s" +msgstr "%s: .prologue olmaksızın sembole !samegp yerdeÄŸiÅŸimi: %s" + +#: elf64-alpha.c:4639 +#, c-format +msgid "%s: unhandled dynamic relocation against %s" +msgstr "%s: %s'e desteklenmeyen dinamik yerdeÄŸiÅŸim" + +#: elf64-alpha.c:4752 +#, c-format +msgid "%s: dtp-relative relocation against dynamic symbol %s" +msgstr "%s: %s dinamik sembolüne dtp göreceli yer deÄŸiÅŸimi" + +#: elf64-alpha.c:4775 +#, c-format +msgid "%s: tp-relative relocation against dynamic symbol %s" +msgstr "%s: %s dinamik sembolüne tp göreceli yer deÄŸiÅŸimi" + +#: elf64-hppa.c:2080 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" -msgstr "%s için koçan girdisi .plt'yi yükleyemedi, dp görecesi = %ld" +msgstr "%s için koçan girdisi .plt'yi yükleyemedi, dp görecesi = %ld" -#: elf64-mmix.c:1268 +#: elf64-mmix.c:1002 #, c-format -msgid "%s: register relocation against non-register symbol: %s in %s" -msgstr "%1$s: yazmaç olmayan sembole yazmaç yerdeðiþimi: %3$s içinde %2$s" +msgid "" +"%s: Internal inconsistency error for value for\n" +" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n" +msgstr "" +"%s: baÄŸlayıcı tarafından ayrılmış global yazmaç deÄŸeri için iç tutarsızlık hatası:\n" +" 0x%lx%08lx != gevÅŸetilmiÅŸ: 0x%lx%08lx\n" -#: elf64-mmix.c:1270 -msgid "(unknown)" -msgstr "(bilinmeyen)" +#: elf64-mmix.c:1386 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s" +msgstr "%s: yazmaç sembolüne temel artı görece yerdeÄŸiÅŸimi: %s içinde (bilinmeyen)" + +#: elf64-mmix.c:1391 +#, c-format +msgid "%s: base-plus-offset relocation against register symbol: %s in %s" +msgstr "%1$s: yazmaç sembolüne temel artı görece yerdeÄŸiÅŸimi: %3$s içinde %2$s" -#: elf64-mmix.c:1305 +#: elf64-mmix.c:1435 +#, c-format +msgid "%s: register relocation against non-register symbol: (unknown) in %s" +msgstr "%s: yazmaç olmayan sembole yazmaç yerdeÄŸiÅŸimi: %s içinde (bilinmeyen)" + +#: elf64-mmix.c:1440 +#, c-format +msgid "%s: register relocation against non-register symbol: %s in %s" +msgstr "%1$s: yazmaç olmayan sembole yazmaç yerdeÄŸiÅŸimi: %3$s içinde %2$s" + +#: elf64-mmix.c:1477 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" -msgstr "%s: YEREL (LOCAL) yönergesi yalnýz bir yazmaç veya kesin deðerle geçerlidir" +msgstr "%s: YEREL (LOCAL) yönergesi yalnız bir yazmaç veya kesin deÄŸerle geçerlidir" -#: elf64-mmix.c:1333 +#: elf64-mmix.c:1505 #, c-format msgid "%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld." msgstr "" -"%s: YEREL (LOCAL) yönergesi: $%ld yazmacý yerel yazmaç deðil.\n" -" Ýlk evrensel yazmaç: $%ld." +"%s: YEREL (LOCAL) yönergesi: $%ld yazmacı yerel yazmaç deÄŸil.\n" +" Ä°lk evrensel yazmaç: $%ld." -#: elf64-mmix.c:1609 +#: elf64-mmix.c:1965 #, c-format msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n" msgstr "" -"%s: Hata: `%s' birden fazla defa tanýmlanmýþ; %s'nin baþlangýcý daha önce\n" -" baðlanan bir dosyada.\n" +"%s: Hata: `%s' birden fazla defa tanımlanmış; %s'nin baÅŸlangıcı daha önce\n" +" baÄŸlanan bir dosyada.\n" -#: elf64-mmix.c:1668 +#: elf64-mmix.c:2024 msgid "Register section has contents\n" -msgstr "Yazmaç bölümünde içerik yok\n" +msgstr "Yazmaç bölümünde içerik yok\n" + +#: elf64-mmix.c:2186 +#, c-format +msgid "" +"Internal inconsistency: remaining %u != max %u.\n" +" Please report this bug." +msgstr "" +"İç uyumsuzluk: kalan %u != maksimum %u. \n" +" Lütfen bu hatayı bildirin." -#: elf64-ppc.c:1466 libbfd.c:1436 +#: elf64-ppc.c:1669 libbfd.c:1435 #, c-format msgid "%s: compiled for a big endian system and target is little endian" -msgstr "%s: büyük sonlu sistem için derlenmiþ ve hedef küçük sonlu" +msgstr "%s: büyük sonlu sistem için derlenmiÅŸ ve hedef küçük sonlu" -#: elf64-ppc.c:1468 libbfd.c:1438 +#: elf64-ppc.c:1671 libbfd.c:1437 #, c-format msgid "%s: compiled for a little endian system and target is big endian" -msgstr "%s: küçük sonlu sistem için derlenmiþ ve hedef büyük sonlu" +msgstr "%s: küçük sonlu sistem için derlenmiÅŸ ve hedef büyük sonlu" -#: elf64-ppc.c:3166 +#: elf64-ppc.c:3610 #, c-format -msgid "linkage table overflow against `%s'" -msgstr "`%s'ye baðlama tablosu taþmasý" +msgid "%s: unexpected reloc type %u in .opd section" +msgstr "%s: opd bölümünde beklenmeyen yerdeÄŸiÅŸim türü %u" -#: elf64-ppc.c:3244 -msgid "stub section size doesn't match calculated size" -msgstr "koçan bölümü boyu hesaplanan boyla eþleþmiyor" +#: elf64-ppc.c:3630 +#, c-format +msgid "%s: .opd is not a regular array of opd entries" +msgstr "%s: opd, opd girdilerinin düzenli dizisi deÄŸil" + +#: elf64-ppc.c:3672 +#, c-format +msgid "%s: undefined sym `%s' in .opd section" +msgstr "%s: opd bölümünde tanımlanmamış `%s' sembolü" + +#: elf64-ppc.c:4397 +#, c-format +msgid "can't find branch stub `%s'" +msgstr "`%s' dal koçanı bulunamadı" + +#: elf64-ppc.c:4436 elf64-ppc.c:4501 +#, c-format +msgid "linkage table error against `%s'" +msgstr "`%s'ye baÄŸlama tablosu hatası" -#: elf64-ppc.c:3845 +#: elf64-ppc.c:4573 +#, c-format +msgid "can't build branch stub `%s'" +msgstr "`%s' dal koçanı derlenemedi" + +#: elf64-ppc.c:5179 +msgid "stubs don't match calculated size" +msgstr "koçanlar hesaplanan boyla eÅŸleÅŸmiyor" + +#: elf64-ppc.c:5828 #, c-format msgid "%s: Relocation %s is not supported for symbol %s." -msgstr "%s: %s yerdeðiþimi %s sembolü için henüz desteklenmiyor." +msgstr "%s: %s yerdeÄŸiÅŸimi %s sembolü için henüz desteklenmiyor." -#: elf64-ppc.c:3889 +#: elf64-ppc.c:5872 #, c-format msgid "%s: error: relocation %s not a multiple of 4" -msgstr "%s: hata: %s yerdeðiþimi 4'ün katý deðil" +msgstr "%s: hata: %s yerdeÄŸiÅŸimi 4'ün katı deÄŸil" -#: elf64-sparc.c:1277 +#: elf64-sparc.c:1280 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" -msgstr "%s: check_relocs: desteklenmeyen yerdeðiþim türü %d" +msgstr "%s: check_relocs: desteklenmeyen yerdeÄŸiÅŸim türü %d" -#: elf64-sparc.c:1314 +#: elf64-sparc.c:1317 #, c-format msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" -msgstr "%s: Yalnýz %%g[2367] yazmaçlarý STT_REGISTER ile bildirilebilir" +msgstr "%s: Yalnız %%g[2367] yazmaçları STT_REGISTER ile bildirilebilir" -#: elf64-sparc.c:1334 +#: elf64-sparc.c:1337 #, c-format -msgid "Register %%g%d used incompatibly: %s in %s" -msgstr "%%g%1$d yazmacý uyumsuz kullanýlmýþ: %3$s içinde %2$s" +msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" +msgstr "%%g%1$d yazmacı uyumsuz kullanılmış: %3$s içinde %2$s, daha önce %5$s içinde %4$s idi" -#: elf64-sparc.c:1338 elf64-sparc.c:1362 elf64-sparc.c:1411 +#: elf64-sparc.c:1360 #, c-format -msgid " previously %s in %s" -msgstr " daha önce %2$s içinde %1$s" +msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" +msgstr "`%1$s' sembolünün farklı türleri var: %2$s içinde REGISTER (yazmaç), daha önce %4$s içinde %3$s" -#: elf64-sparc.c:1359 elf64-sparc.c:1408 +#: elf64-sparc.c:1406 #, c-format -msgid "Symbol `%s' has differing types: %s in %s" -msgstr "`%1$s' sembolünün farklý türleri var: %3$s içinde %2$s" +msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" +msgstr "" +"`%1$s' sembolünün farklı türleri var: %3$s içinde %2$s, \n" +" daha önce %4$s içinde REGISTER (yazmaç)" -#: elf64-sparc.c:3014 +#: elf64-sparc.c:2970 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" -msgstr "%s: UltraSPARC'a özel kod HAL'e özel kod ile baðlanýyor" +msgstr "%s: UltraSPARC'a özel kod HAL'e özel kod ile baÄŸlanıyor" -#: elfcode.h:1218 +#: elfcode.h:1198 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" -msgstr "%s: sürüm sayýsý (%ld) sembol sayýsý (%ld) ile eþleþmiyor" +msgstr "%s: sürüm sayısı (%ld) sembol sayısı (%ld) ile eÅŸleÅŸmiyor" -#: elflink.c:434 +#: elflink.c:440 #, c-format msgid "%s: Section %s is too large to add hole of %ld bytes" -msgstr "%s: %s bölümü içine %ld baytlýk bir delik koymak için fazla büyük" +msgstr "%s: %s bölümü içine %ld baytlık bir delik koymak için fazla büyük" -#: elflink.h:1113 +#: elflink.h:1090 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" -msgstr "%s: uyarý: `%s' için beklenmeyen yeniden tanýmlama" +msgstr "%s: uyarı: `%s' için beklenmeyen yeniden tanımlama" -#: elflink.h:1784 +#: elflink.h:1727 #, c-format msgid "%s: %s: invalid version %u (max %d)" -msgstr "%s: %s: geçersiz sürüm %u (maksimum %d)" +msgstr "%s: %s: geçersiz sürüm %u (maksimum %d)" -#: elflink.h:1825 +#: elflink.h:1768 #, c-format msgid "%s: %s: invalid needed version %d" -msgstr "%s: %s: geçersiz gerekli sürüm %d" +msgstr "%s: %s: geçersiz gerekli sürüm %d" -#: elflink.h:1945 +#: elflink.h:1890 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" -msgstr "Uyarý: `%s' sembolünün boyu %lu'dan %lu'ya %s içerisinde deðiþti" +msgstr "Uyarı: `%s' sembolünün boyu %lu'dan %lu'ya %s içerisinde deÄŸiÅŸti" -#: elflink.h:4020 +#: elflink.h:3174 +#, c-format +msgid "%s: .preinit_array section is not allowed in DSO" +msgstr "%s: DSO içinde preinit_array'e izin verilmiyor" + +#: elflink.h:4030 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" -msgstr "uyarý: `%s' dinamik sembolünün türü ve boyu tanýmlý deðil" +msgstr "uyarı: `%s' dinamik sembolünün türü ve boyu tanımlı deÄŸil" -#: elflink.h:4329 +#: elflink.h:4345 #, c-format msgid "%s: undefined versioned symbol name %s" -msgstr "%s: sürümlü sembol ismi %s tanýmlý deðil" +msgstr "%s: sürümlü sembol ismi %s tanımlı deÄŸil" -#: elflink.h:4559 elflink.h:4567 elflink.h:6218 elflink.h:7295 +#: elflink.h:4611 elflink.h:4619 elflink.h:6508 elflink.h:7600 msgid "Error: out of memory" -msgstr "Hata: bellek tükendi" +msgstr "Hata: bellek tükendi" -#: elflink.h:4729 +#: elflink.h:4781 msgid "Not enough memory to sort relocations" -msgstr "Yerdeðiþimleri sýralamak için gerekli bellek yok" +msgstr "YerdeÄŸiÅŸimleri sıralamak için gerekli bellek yok" + +#: elflink.h:5682 elflink.h:5725 +#, c-format +msgid "%s: could not find output section %s" +msgstr "%s: çıktı bölümü %s bulunamadı" -#: elflink.h:5995 +#: elflink.h:5688 +#, c-format +msgid "warning: %s section has zero size" +msgstr "uyarı: %s bölümü sıfır boyunda" + +#: elflink.h:6275 #, c-format msgid "%s: could not find output section %s for input section %s" -msgstr "%1$s: girdi bölümü %3$s için çýktý bölümü %2$s bulunamadý" +msgstr "%1$s: girdi bölümü %3$s için çıktı bölümü %2$s bulunamadı" + +#: elflink.h:6486 +#, c-format +msgid "%s: relocation size mismatch in %s section %s" +msgstr "%1$s: %3$s bölümünde %2$s içinde yerdeÄŸiÅŸim boy uyuÅŸmazlığı" -#: elflink.h:6568 +#: elflink.h:6849 msgid "warning: relocation against removed section; zeroing" -msgstr "uyarý: silinmiþ bölüme yer deðiþim; sýfýrlandý" +msgstr "uyarı: silinmiÅŸ bölüme yer deÄŸiÅŸim; sıfırlandı" -#: elflink.h:6598 +#: elflink.h:6879 msgid "warning: relocation against removed section" -msgstr "%1$s: silinmiþ bölüme yerdeðiþim" +msgstr "%1$s: silinmiÅŸ bölüme yerdeÄŸiÅŸim" -#: elflink.h:6611 +#: elflink.h:6892 #, c-format msgid "local symbols in discarded section %s" -msgstr "atýlmýþ %s bölümünde yerel semboller" +msgstr "atılmış %s bölümünde yerel semboller" + +#: elfxx-mips.c:734 +msgid "static procedure (no name)" +msgstr "statik altyordam (isimsiz)" + +#: elfxx-mips.c:1601 +msgid "not enough GOT space for local GOT entries" +msgstr "yerel GOT girdileri için yeterli GOT yeri yok" + +#: elfxx-mips.c:2750 +#, c-format +msgid "%s: %s+0x%lx: jump to stub routine which is not jal" +msgstr "%s: %s+0x%lx: jal olmayan koçan yordamına sıçrama" + +#: elfxx-mips.c:4270 +#, c-format +msgid "%s: Malformed reloc detected for section %s" +msgstr "%s: %s bölümü için geçersiz yer deÄŸiÅŸim bulundu" + +#: elfxx-mips.c:4348 +#, c-format +msgid "%s: CALL16 reloc at 0x%lx not against global symbol" +msgstr "%s: 0x%lx'deki CALL16 yerdeÄŸiÅŸimi evrensel sembole göre deÄŸil" + +#: elfxx-mips.c:7301 +#, c-format +msgid "%s: illegal section name `%s'" +msgstr "%s: geçersiz bölüm adı `%s'" + +#: elfxx-mips.c:7615 +#, c-format +msgid "%s: linking PIC files with non-PIC files" +msgstr "%s: PIC dosyaları PIC olmayan dosyalarla baÄŸlanıyor" -#: i386linux.c:455 m68klinux.c:459 sparclinux.c:456 +#: elfxx-mips.c:7625 +#, c-format +msgid "%s: linking abicalls files with non-abicalls files" +msgstr "%s: abicalls dosyaları abicalls olmayan dosyalarla baÄŸlanıyor" + +#: elfxx-mips.c:7654 +#, c-format +msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" +msgstr "%1$s: Önceki modüllerle (-mips%3$d) ile ISA uyumsuzluÄŸu (-mips%2$d)" + +#: elfxx-mips.c:7676 +#, c-format +msgid "%s: ISA mismatch (%d) with previous modules (%d)" +msgstr "%1$s: Önceki modüllerle (%3$d) ile ISA uyumsuzluÄŸu (%2$d)" + +#: elfxx-mips.c:7699 +#, c-format +msgid "%s: ABI mismatch: linking %s module with previous %s modules" +msgstr "%s: ABI uyumsuzluÄŸu: %s modülü önceki %s modülle baÄŸlanıyor" + +#: elfxx-mips.c:7759 +msgid " [abi=O32]" +msgstr " [abi=O32]" + +#: elfxx-mips.c:7761 +msgid " [abi=O64]" +msgstr " [abi=O64]" + +#: elfxx-mips.c:7763 +msgid " [abi=EABI32]" +msgstr " [abi=EABI32]" + +#: elfxx-mips.c:7765 +msgid " [abi=EABI64]" +msgstr " [abi=EABI64]" + +#: elfxx-mips.c:7767 +msgid " [abi unknown]" +msgstr " [abi bilinmiyor]" + +#: elfxx-mips.c:7769 +msgid " [abi=N32]" +msgstr " [abi=N32]" + +#: elfxx-mips.c:7771 +msgid " [abi=64]" +msgstr " [abi=64]" + +#: elfxx-mips.c:7773 +msgid " [no abi set]" +msgstr " [abi atanmamış]" + +#: elfxx-mips.c:7776 +msgid " [mips1]" +msgstr " [mips1]" + +#: elfxx-mips.c:7778 +msgid " [mips2]" +msgstr " [mips2]" + +#: elfxx-mips.c:7780 +msgid " [mips3]" +msgstr " [mips3]" + +#: elfxx-mips.c:7782 +msgid " [mips4]" +msgstr " [mips4]" + +#: elfxx-mips.c:7784 +msgid " [mips5]" +msgstr " [mips5]" + +#: elfxx-mips.c:7786 +msgid " [mips32]" +msgstr " [mips32]" + +#: elfxx-mips.c:7788 +msgid " [mips64]" +msgstr " [mips64]" + +#: elfxx-mips.c:7790 +msgid " [unknown ISA]" +msgstr " [bilinmeyen ISA]" + +#: elfxx-mips.c:7793 +msgid " [mdmx]" +msgstr " [mdmx]" + +#: elfxx-mips.c:7796 +msgid " [mips16]" +msgstr " [mips16]" + +#: elfxx-mips.c:7799 +msgid " [32bitmode]" +msgstr " [32bitkipi]" + +#: elfxx-mips.c:7801 +msgid " [not 32bitmode]" +msgstr " [32bitkipi deÄŸil]" + +#: i386linux.c:458 m68klinux.c:462 sparclinux.c:459 #, c-format msgid "Output file requires shared library `%s'\n" -msgstr "Çýktý dosyasý için paylaþýmlý kitaplýk `%s' gerekli\n" +msgstr "Çıktı dosyası için paylaşımlı kitaplık `%s' gerekli\n" -#: i386linux.c:463 m68klinux.c:467 sparclinux.c:464 +#: i386linux.c:466 m68klinux.c:470 sparclinux.c:467 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" -msgstr "Çýktý dosyasý için paylaþýmlý kitaplýk `%s.so.%s' gerekli\n" +msgstr "Çıktı dosyası için paylaşımlı kitaplık `%s.so.%s' gerekli\n" -#: i386linux.c:653 i386linux.c:703 m68klinux.c:660 m68klinux.c:708 -#: sparclinux.c:655 sparclinux.c:705 +#: i386linux.c:655 i386linux.c:705 m68klinux.c:662 m68klinux.c:710 +#: sparclinux.c:657 sparclinux.c:707 #, c-format msgid "Symbol %s not defined for fixups\n" -msgstr "%s sembolü düzeltmeler için tanýmlý deðil\n" +msgstr "%s sembolü düzeltmeler için tanımlı deÄŸil\n" -#: i386linux.c:727 m68klinux.c:732 sparclinux.c:729 +#: i386linux.c:729 m68klinux.c:734 sparclinux.c:731 msgid "Warning: fixup count mismatch\n" -msgstr "Uyarý: düzeltme sayý uyumsuzluðu\n" +msgstr "Uyarı: düzeltme sayı uyumsuzluÄŸu\n" #: ieee.c:235 #, c-format @@ -1518,261 +1765,261 @@ msgstr "%s: dizge fazla uzun (%d karakter, en fazla 65535)" #: ieee.c:365 #, c-format msgid "%s: unrecognized symbol `%s' flags 0x%x" -msgstr "%s: bilinmeyen `%s' sembol bayraklarý 0x%x" +msgstr "%s: bilinmeyen `%s' sembol bayrakları 0x%x" #: ieee.c:877 #, c-format -msgid "%s: unimplemented ATI record %u for symbol %u" -msgstr "%1$s: %3$u için desteklenmeyen ATI kaydý %2$u" +msgid "%s: unimplemented ATI record %u for symbol %u" +msgstr "%1$s: %3$u sembolü için desteklenmeyen ATI kaydı %2$u" #: ieee.c:902 #, c-format msgid "%s: unexpected ATN type %d in external part" -msgstr "%s: dýþ parçada beklenmeyen ATN türü %d" +msgstr "%s: dış parçada beklenmeyen ATN türü %d" #: ieee.c:924 #, c-format msgid "%s: unexpected type after ATN" -msgstr "%s: ATN'den sonra beklenmeyen tür" +msgstr "%s: ATN'den sonra beklenmeyen tür" #: ihex.c:258 #, c-format msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" -msgstr "%s:%d: Intel Onaltýlýk dosyasýnda beklenmeyen `%s' karakteri\n" +msgstr "%s:%d: Intel Onaltılık dosyasında beklenmeyen `%s' karakteri\n" -#: ihex.c:368 +#: ihex.c:366 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -"%s:%u: Intel Onaltýlýk dosyasýnda hatalý saðlama toplamý\n" +"%s:%u: Intel Onaltılık dosyasında hatalı saÄŸlama toplamı\n" " (%u beklendi, %u bulundu)" -#: ihex.c:422 +#: ihex.c:420 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun adres kaydý uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun adres kaydı uzunluÄŸu" -#: ihex.c:439 +#: ihex.c:437 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun baþlangýç adresi uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun baÅŸlangıç adresi uzunluÄŸu" -#: ihex.c:456 +#: ihex.c:454 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun lineer adres kaydý uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun lineer adres kaydı uzunluÄŸu" -#: ihex.c:473 +#: ihex.c:471 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda hatalý uzun lineer baþlangýç adres uzunluðu" +msgstr "%s:%u: Intel Onaltılık dosyasında hatalı uzun lineer baÅŸlangıç adres uzunluÄŸu" -#: ihex.c:490 +#: ihex.c:488 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" -msgstr "%s:%u: Intel Onaltýlýk dosyasýnda bilinmeyen onaltýlýk türü %u\n" +msgstr "%s:%u: Intel Onaltılık dosyasında bilinmeyen onaltılık türü %u\n" -#: ihex.c:610 +#: ihex.c:607 #, c-format msgid "%s: internal error in ihex_read_section" -msgstr "%s: ihex_read_section'da iç hata" +msgstr "%s: ihex_read_section'da iç hata" -#: ihex.c:645 +#: ihex.c:642 #, c-format msgid "%s: bad section length in ihex_read_section" -msgstr "%s: ihex_read_section'da hatalý bölüm uzunluðu" +msgstr "%s: ihex_read_section'da hatalı bölüm uzunluÄŸu" -#: ihex.c:863 +#: ihex.c:860 #, c-format -msgid "%s: address 0x%s out of range for Intex Hex file" -msgstr "%s: Intex Onaltýlýk dosyasý için 0x%s adresi kapsamdýþý" +msgid "%s: address 0x%s out of range for Intel Hex file" +msgstr "%s: Intex Onaltılık dosyası için 0x%s adresi kapsamdışı" #: libbfd.c:492 #, c-format msgid "not mapping: data=%lx mapped=%d\n" -msgstr "eþlenmeyen: veri=%lx eþleþen=%d\n" +msgstr "eÅŸlenmeyen: veri=%lx eÅŸleÅŸen=%d\n" #: libbfd.c:495 msgid "not mapping: env var not set\n" -msgstr "eþlenmeyen: çevre deðiþkeni atanmamýþ\n" +msgstr "eÅŸlenmeyen: çevre deÄŸiÅŸkeni atanmamış\n" -#: libbfd.c:1463 +#: libbfd.c:1466 #, c-format -msgid "Deprecated %s called" -msgstr "Geçerliliði kalkmýþ %s çaðrýldý" +msgid "Deprecated %s called at %s line %d in %s\n" +msgstr "GeçersizleÅŸmiÅŸ %s, %s'da, %d satırı, %s içerisinde çaÄŸrıldı\n" -#: libbfd.c:1465 +#: libbfd.c:1469 #, c-format -msgid " at %s line %d in %s\n" -msgstr "%s, %d satýrý, %s içerisinde\n" +msgid "Deprecated %s called\n" +msgstr "GeçerliliÄŸi kalkmış %s çaÄŸrıldı\n" -#: linker.c:1849 +#: linker.c:1873 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" -msgstr "%1$s: `%3$s'den endirekt sembol `%2$s'e çevrim" +msgstr "%1$s: `%3$s'den endirekt sembol `%2$s'e çevrim" -#: linker.c:2745 +#: linker.c:2776 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" -msgstr "%s girdi ve %s çýktýsý ile yerdeðiþimli bað deneniyor" +msgstr "%s girdi ve %s çıktısı ile yerdeÄŸiÅŸimli baÄŸ deneniyor" -#: merge.c:897 +#: merge.c:892 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" -msgstr "%s: karýþtýrýlmýþ bölümün sonundan ileride eriþim (%ld + %ld)" +msgstr "%s: karıştırılmış bölümün sonundan ileride eriÅŸim (%ld + %ld)" #: mmo.c:460 #, c-format msgid "%s: No core to allocate section name %s\n" -msgstr "%s: %s bölüm adýný ayýracak `core' yok\n" +msgstr "%s: %s bölüm adını ayıracak `core' yok\n" -#: mmo.c:537 +#: mmo.c:536 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" -msgstr "%s: %d bayt uzunluðunda bir sembole yer ayýrmak için `core' yok\n" +msgstr "%s: %d bayt uzunluÄŸunda bir sembole yer ayırmak için `core' yok\n" -#: mmo.c:1190 +#: mmo.c:1245 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" -msgstr "%s: geçersiz mmo dosyasý: $255 için baþlangýç deðeri `Main' deðil\n" +msgstr "%s: geçersiz mmo dosyası: $255 için baÅŸlangıç deÄŸeri `Main' deÄŸil\n" -#: mmo.c:1336 +#: mmo.c:1391 #, c-format msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n" msgstr "" -"%1$s: `%4$s' ile baþlayan sembol adýndan sonra desteklenmeyen\n" -" geniþ karakter dizisi 0x%2$02X 0x%3$02X\n" +"%1$s: `%4$s' ile baÅŸlayan sembol adından sonra desteklenmeyen\n" +" geniÅŸ karakter dizisi 0x%2$02X 0x%3$02X\n" -#: mmo.c:1571 +#: mmo.c:1633 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" -msgstr "%s: geçersiz mmo dosyasý: desteklenmeyen lopkod `%d'\n" +msgstr "%s: geçersiz mmo dosyası: desteklenmeyen lopkod `%d'\n" -#: mmo.c:1581 +#: mmo.c:1643 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" -msgstr "%s: geçersiz mmo dosyasý: YZ = 1 beklendi, lop_quote için YZ = %d bulundu\n" +msgstr "%s: geçersiz mmo dosyası: YZ = 1 beklendi, lop_quote için YZ = %d bulundu\n" -#: mmo.c:1617 +#: mmo.c:1679 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "" -"%s: geçersiz mmo dosyasý: z = 1 veya z = 2 beklendi, \n" -" lop_loc için z = %d bulundu\n" +"%s: geçersiz mmo dosyası: z = 1 veya z = 2 beklendi, \n" +" lop_loc için z = %d bulundu\n" -#: mmo.c:1663 +#: mmo.c:1725 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" -msgstr "%s: geçersiz mmo dosyasý: z = 1 veya z = 2 beklendi; lop_fixo için z = %d bulundu\n" +msgstr "%s: geçersiz mmo dosyası: z = 1 veya z = 2 beklendi; lop_fixo için z = %d bulundu\n" -#: mmo.c:1702 +#: mmo.c:1764 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" -msgstr "%s: geçersiz mmo dosyasý: y = 0 beklendi; lop_fixrx için y = %d bulundu\n" +msgstr "%s: geçersiz mmo dosyası: y = 0 beklendi; lop_fixrx için y = %d bulundu\n" -#: mmo.c:1711 +#: mmo.c:1773 #, c-format msgid "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "" -"%s: geçersiz mmo dosyasý: z = 16 veya z = 24 beklendi;\n" -" lop_fixrx için z = %d bulundu\n" +"%s: geçersiz mmo dosyası: z = 16 veya z = 24 beklendi;\n" +" lop_fixrx için z = %d bulundu\n" -#: mmo.c:1734 +#: mmo.c:1796 #, c-format msgid "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n" msgstr "" -"%s: geçersiz mmo dosyasý: iþlenen word'un ilk baytý 0 veya 1 olmalý; \n" -" lop_fixrx için %d bulundu\n" +"%s: geçersiz mmo dosyası: iÅŸlenen word'un ilk baytı 0 veya 1 olmalı; \n" +" lop_fixrx için %d bulundu\n" -#: mmo.c:1757 +#: mmo.c:1819 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" -msgstr "%s: %d sayýlý dosya için dosya adý ayrýlamadý, %d bayt\n" +msgstr "%s: %d sayılı dosya için dosya adı ayrılamadı, %d bayt\n" -#: mmo.c:1777 +#: mmo.c:1839 #, c-format msgid "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" -msgstr "%s: geçersiz mmo dosyasý: %d sayýlý dosya, `%s', zaten `%s' olarak girilmiþ\n" +msgstr "%s: geçersiz mmo dosyası: %d sayılı dosya, `%s', zaten `%s' olarak girilmiÅŸ\n" -#: mmo.c:1790 +#: mmo.c:1852 #, c-format msgid "%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "" -"%s: geçersiz mmo dosyasý: %d sayýsý için dosya adý kullanýmdan\n" -" önce belirtilmemiþ\n" +"%s: geçersiz mmo dosyası: %d sayısı için dosya adı kullanımdan\n" +" önce belirtilmemiÅŸ\n" -#: mmo.c:1896 +#: mmo.c:1958 #, c-format msgid "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "" -"%s: geçersiz mmo dosyasý: lop_stab'in y ve z alanlarý sýfýr deðil;\n" +"%s: geçersiz mmo dosyası: lop_stab'in y ve z alanları sıfır deÄŸil;\n" " y: %d, z: %d\n" -#: mmo.c:1932 +#: mmo.c:1994 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" -msgstr "%s: geçersiz mmo dosyasý: lop_end dosyadaki son girdi deðil\n" +msgstr "%s: geçersiz mmo dosyası: lop_end dosyadaki son girdi deÄŸil\n" -#: mmo.c:1945 +#: mmo.c:2007 #, c-format msgid "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras to the preceding lop_stab (%ld)\n" msgstr "" -"%s: geçersiz mmo dosyasý: lop_end'in YZ'si (%ld); bir önceki \n" -" lop_stab'in (%ld) dörtlü sayýsýna eþit deðil\n" +"%s: geçersiz mmo dosyası: lop_end'in YZ'si (%ld); bir önceki \n" +" lop_stab'in (%ld) dörtlü sayısına eÅŸit deÄŸil\n" -#: mmo.c:2610 +#: mmo.c:2670 #, c-format msgid "%s: invalid symbol table: duplicate symbol `%s'\n" -msgstr "%s: geçersiz sembol tablosu: tekrarlanmýþ sembol `%s'\n" +msgstr "%s: geçersiz sembol tablosu: tekrarlanmış sembol `%s'\n" -#: mmo.c:2898 +#: mmo.c:2921 #, c-format msgid "%s: Bad symbol definition: `Main' set to %s rather than the start address %s\n" msgstr "" -"%1$s: Hatalý sembol tanýmý: `Main' baþlangýç adresi %3$s yerine \n" -" %2$s olarak tanýmlanmýþ\n" +"%1$s: Hatalı sembol tanımı: `Main' baÅŸlangıç adresi %3$s yerine \n" +" %2$s olarak tanımlanmış\n" -#: mmo.c:2932 +#: mmo.c:3011 #, c-format msgid "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: %d. Only `Main' will be emitted.\n" msgstr "" -"%s: uyarý: sembol tablosu mmo için fazla büyük, 65535 32-bit word'den\n" -" fazla: %d. Yalnýz `Main' üretilecek. \n" +"%s: uyarı: sembol tablosu mmo için fazla büyük, 65535 32-bit word'den\n" +" fazla: %d. Yalnız `Main' üretilecek. \n" -#: mmo.c:2977 +#: mmo.c:3056 #, c-format msgid "%s: internal error, symbol table changed size from %d to %d words\n" -msgstr "%s: iç hata, sembol tablosu büyüklüðü %d'den %d word'e deðiþti\n" +msgstr "%s: iç hata, sembol tablosu büyüklüğü %d'den %d word'e deÄŸiÅŸti\n" -#: mmo.c:3032 +#: mmo.c:3111 #, c-format msgid "%s: internal error, internal register section %s had contents\n" -msgstr "%s: iç hata, %s iç yazmaç bölümü içerik taþýyor\n" +msgstr "%s: iç hata, %s iç yazmaç bölümü içerik taşıyor\n" -#: mmo.c:3084 +#: mmo.c:3163 #, c-format msgid "%s: no initialized registers; section length 0\n" -msgstr "%s: ilklenen yazmaç yok; bölüm uzunluðu 0\n" +msgstr "%s: ilklenen yazmaç yok; bölüm uzunluÄŸu 0\n" -#: mmo.c:3090 +#: mmo.c:3169 #, c-format msgid "%s: too many initialized registers; section length %ld\n" -msgstr "%s: çok fazla ilklenmiþ yazmaç; bölüm uzunluðu %ld\n" +msgstr "%s: çok fazla ilklenmiÅŸ yazmaç; bölüm uzunluÄŸu %ld\n" -#: mmo.c:3095 +#: mmo.c:3174 #, c-format msgid "%s: invalid start address for initialized registers of length %ld: 0x%lx%08lx\n" -msgstr "%s: %ld uzunluðunda ilklenmiþ yazmaçlar için hatalý baþlangýç adresi: 0x%lx%08lx\n" +msgstr "%s: %ld uzunluÄŸunda ilklenmiÅŸ yazmaçlar için hatalı baÅŸlangıç adresi: 0x%lx%08lx\n" -#: oasys.c:1036 +#: oasys.c:1029 #, c-format msgid "%s: can not represent section `%s' in oasys" -msgstr "%s: oasys'de `%s' bölümü gösterilemiyor" +msgstr "%s: oasys'de `%s' bölümü gösterilemiyor" #: osf-core.c:132 #, c-format msgid "Unhandled OSF/1 core file section type %d\n" -msgstr "Desteklenmeyen OSF/1 core dosyasý bölüm türü %d\n" +msgstr "Desteklenmeyen OSF/1 core dosyası bölüm türü %d\n" #: pe-mips.c:658 #, c-format @@ -1787,62 +2034,66 @@ msgstr "%s: `ld -r' PE MIPS nesneleri ile birlikte desteklenmiyor\n" #: pe-mips.c:794 #, c-format msgid "%s: unimplemented %s\n" -msgstr "%s: tamamlanmamýþ %s\n" +msgstr "%s: tamamlanmamış %s\n" #: pe-mips.c:820 #, c-format msgid "%s: jump too far away\n" -msgstr "%s: sýçrama fazla uzak\n" +msgstr "%s: sıçrama fazla uzak\n" #: pe-mips.c:847 #, c-format msgid "%s: bad pair/reflo after refhi\n" -msgstr "%s: refhi'den sonra hatalý çift/reflo\n" +msgstr "%s: refhi'den sonra hatalı çift/reflo\n" #. XXX code yet to be written. #: peicode.h:785 #, c-format msgid "%s: Unhandled import type; %x" -msgstr "%s: Desteklenmeyen ithal türü; %x" +msgstr "%s: Desteklenmeyen ithal türü; %x" #: peicode.h:790 #, c-format msgid "%s: Unrecognised import type; %x" -msgstr "%s: Tanýnmayan ithal türü; %x" +msgstr "%s: Tanınmayan ithal türü; %x" #: peicode.h:804 #, c-format msgid "%s: Unrecognised import name type; %x" -msgstr "%s: Tanýnmayan ithal isim türü; %x" +msgstr "%s: Tanınmayan ithal isim türü; %x" #: peicode.h:1162 #, c-format msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" -msgstr "%s: Ýthal Kitaplýk Biçem (ILF) arþivinde tanýnmayan makina türü (0x%x) " +msgstr "%s: Ä°thal Kitaplık Biçem (ILF) arÅŸivinde tanınmayan makina türü (0x%x) " #: peicode.h:1174 #, c-format msgid "%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive" -msgstr "%s: Ýthal Kitaplýk Biçem (ILF) arþivinde bilinen fakat desteklenmeyen makina türü (0x%x)" +msgstr "%s: Ä°thal Kitaplık Biçem (ILF) arÅŸivinde bilinen fakat desteklenmeyen makina türü (0x%x)" #: peicode.h:1191 #, c-format msgid "%s: size field is zero in Import Library Format header" -msgstr "%s: Ýthal Kitaplýk Biçem (ILF) baþlýðýnda boy alaný sýfýr" +msgstr "%s: Ä°thal Kitaplık Biçem (ILF) baÅŸlığında boy alanı sıfır" #: peicode.h:1219 #, c-format msgid "%s: string not null terminated in ILF object file." -msgstr "%s: ILF nesne dosyasýnda dizge boþ deðerle sonlanmamýþ." +msgstr "%s: ILF nesne dosyasında dizge boÅŸ deÄŸerle sonlanmamış." #: ppcboot.c:416 -msgid "\nppcboot header:\n" -msgstr "\nppcboot baþlýðý:\n" +msgid "" +"\n" +"ppcboot header:\n" +msgstr "" +"\n" +"ppcboot baÅŸlığı:\n" #: ppcboot.c:417 #, c-format msgid "Entry offset = 0x%.8lx (%ld)\n" -msgstr "Girdi göreli konumu = 0x%.8lx (%ld)\n" +msgstr "Girdi göreli konumu = 0x%.8lx (%ld)\n" #: ppcboot.c:418 #, c-format @@ -1852,702 +2103,807 @@ msgstr "Uzunluk = 0x%.8lx (%ld)\n" #: ppcboot.c:421 #, c-format msgid "Flag field = 0x%.2x\n" -msgstr "Bayrak alaný = 0x%.2x\n" +msgstr "Bayrak alanı = 0x%.2x\n" #: ppcboot.c:427 #, c-format msgid "Partition name = \"%s\"\n" -msgstr "Bölüm adý = \"%s\"\n" +msgstr "Bölüm adı = \"%s\"\n" #: ppcboot.c:446 #, c-format -msgid "\nPartition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" -msgstr "\nBölüm[%d] baþlangýcý = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" +msgid "" +"\n" +"Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" +msgstr "" +"\n" +"Bölüm[%d] baÅŸlangıcı = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" #: ppcboot.c:452 #, c-format msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" -msgstr "Bölüm[%d] sonu = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" +msgstr "Bölüm[%d] sonu = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" #: ppcboot.c:458 #, c-format msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" -msgstr "Bölüm[%d] sektörü = 0x%.8lx (%ld)\n" +msgstr "Bölüm[%d] sektörü = 0x%.8lx (%ld)\n" #: ppcboot.c:459 #, c-format msgid "Partition[%d] length = 0x%.8lx (%ld)\n" -msgstr "Bölüm[%d] uzunluðu = 0x%.8lx (%ld)\n" +msgstr "Bölüm[%d] uzunluÄŸu = 0x%.8lx (%ld)\n" -#: som.c:5402 +#: som.c:5398 msgid "som_sizeof_headers unimplemented" -msgstr "som_sizeof_headers tamamlanmamýþ" +msgstr "som_sizeof_headers tamamlanmamış" #: srec.c:301 #, c-format msgid "%s:%d: Unexpected character `%s' in S-record file\n" -msgstr "%s:%d: S-kayýt dosyasýnda beklenmeyen `%s' karakteri\n" +msgstr "%s:%d: S-kayıt dosyasında beklenmeyen `%s' karakteri\n" -#: syms.c:996 +#: stabs.c:319 +#, c-format +msgid "%s(%s+0x%lx): Stabs entry has invalid string index." +msgstr "%s(%s+0x%lx): Stabs girdisinde geçersiz dizge indeksi." + +#: syms.c:1044 msgid "Unsupported .stab relocation" -msgstr "Desteklenmeyen .stab yerdeðiþimi" +msgstr "Desteklenmeyen .stab yerdeÄŸiÅŸimi" #: vms-gsd.c:356 #, c-format msgid "bfd_make_section (%s) failed" -msgstr "bfd_make_section (%s) baþarýsýz" +msgstr "bfd_make_section (%s) baÅŸarısız" #: vms-gsd.c:371 #, c-format msgid "bfd_set_section_flags (%s, %x) failed" -msgstr "bfd_set_section_flags (%s, %x) baþarýsýz" +msgstr "bfd_set_section_flags (%s, %x) baÅŸarısız" #: vms-gsd.c:407 #, c-format msgid "Size mismatch section %s=%lx, %s=%lx" -msgstr "Boy uyumsuzluðu bölümü %s=%lx, %s=%lx" +msgstr "Boy uyumsuzluÄŸu bölümü %s=%lx, %s=%lx" -#: vms-gsd.c:704 +#: vms-gsd.c:702 #, c-format msgid "unknown gsd/egsd subtype %d" -msgstr "bilinmeyen gsd/egsd alt türü %d" +msgstr "bilinmeyen gsd/egsd alt türü %d" #: vms-hdr.c:406 msgid "Object module NOT error-free !\n" -msgstr "Nesne modülü hatasýz DEÐÝL !\n" +msgstr "Nesne modülü hatasız DEĞİL !\n" #: vms-misc.c:543 #, c-format msgid "Stack overflow (%d) in _bfd_vms_push" -msgstr "_bfd_vms_push'da yýðýt taþmasý (%d)" +msgstr "_bfd_vms_push'da yığıt taÅŸması (%d)" #: vms-misc.c:561 msgid "Stack underflow in _bfd_vms_pop" -msgstr "_bfd_vms_pop'da yýðýt alt taþmasý" +msgstr "_bfd_vms_pop'da yığıt alt taÅŸması" #: vms-misc.c:919 msgid "_bfd_vms_output_counted called with zero bytes" -msgstr "_bfd_vms_output_counted sýfýr bayt ile çaðrýldý" +msgstr "_bfd_vms_output_counted sıfır bayt ile çaÄŸrıldı" #: vms-misc.c:924 msgid "_bfd_vms_output_counted called with too many bytes" -msgstr "_bfd_vms_output_counted fazla bayt ile çaðrýldý" +msgstr "_bfd_vms_output_counted fazla bayt ile çaÄŸrıldı" #: vms-misc.c:1055 #, c-format msgid "Symbol %s replaced by %s\n" -msgstr "%s sembolü %s ile deðiþtirildi\n" +msgstr "%s sembolü %s ile deÄŸiÅŸtirildi\n" #: vms-misc.c:1117 #, c-format msgid "failed to enter %s" -msgstr "%s'e giriþ baþarýsýz" +msgstr "%s'e giriÅŸ baÅŸarısız" -#: vms-tir.c:78 +#: vms-tir.c:81 msgid "No Mem !" -msgstr "Hafýza Yok !" +msgstr "Hafıza Yok !" -#: vms-tir.c:313 -msgid "Bad section index in ETIR_S_C_STA_PQ" -msgstr "ETIR_S_C_STA_PQ'de hatalý bölüm indeksi" - -#: vms-tir.c:328 +#: vms-tir.c:362 #, c-format -msgid "Unsupported STA cmd %d" -msgstr "Desteklenmeyen STA komutu %d" +msgid "bad section index in %s" +msgstr "%s içinde hatalı bölüm indeksi" -#: vms-tir.c:333 vms-tir.c:1301 +#: vms-tir.c:375 #, c-format -msgid "Reserved STA cmd %d" -msgstr "Ayrýlmýþ STA komutu %d" +msgid "unsupported STA cmd %s" +msgstr "Desteklenmeyen STA komutu %s" -#: vms-tir.c:443 +#: vms-tir.c:380 vms-tir.c:1240 #, c-format -msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" -msgstr "ETIR_S_C_STO_GBL: sembol yok \"%s\"" +msgid "reserved STA cmd %d" +msgstr "Ayrılmış STA komutu %d" -#: vms-tir.c:465 +#: vms-tir.c:491 vms-tir.c:514 #, c-format -msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" -msgstr "ETIR_S_C_STO_CA: sembol yok \"%s\"" - -#: vms-tir.c:478 -msgid "ETIR_S_C_STO_RB/AB: Not supported" -msgstr "ETIR_S_C_STO_RB/AB: Desteklenmiyor" +msgid "%s: no symbol \"%s\"" +msgstr "%s: \"%s\" sembolü yok" -#: vms-tir.c:538 -msgid "ETIR_S_C_STO_LP_PSB: Not supported" -msgstr "ETIR_S_C_STO_LP_PSB: Desteklenmiyor" - -#: vms-tir.c:544 -msgid "ETIR_S_C_STO_HINT_GBL: not implemented" -msgstr "ETIR_S_C_STO_HINT_GBL: tamamlanmamýþ" - -#: vms-tir.c:550 -msgid "ETIR_S_C_STO_HINT_PS: not implemented" -msgstr "ETIR_S_C_STO_HINT_PS: tamamlanmamýþ" - -#: vms-tir.c:554 vms-tir.c:1473 +#. unsigned shift +#. rotate +#. Redefine symbol to current location. +#. Define a literal. +#: vms-tir.c:581 vms-tir.c:693 vms-tir.c:803 vms-tir.c:821 vms-tir.c:829 +#: vms-tir.c:838 vms-tir.c:1563 #, c-format -msgid "Reserved STO cmd %d" -msgstr "Ayrýlmýþ STO komutu %d" - -#: vms-tir.c:667 -msgid "ETIR_S_C_OPR_INSV: Not supported" -msgstr "ETIR_S_C_OPR_INSV: Desteklenmiyor" +msgid "%s: not supported" +msgstr "%s: desteklenmiyor" -#: vms-tir.c:685 -msgid "ETIR_S_C_OPR_USH: Not supported" -msgstr "ETIR_S_C_OPR_USH: Desteklenmiyor" - -#: vms-tir.c:691 -msgid "ETIR_S_C_OPR_ROT: Not supported" -msgstr "ETIR_S_C_OPR_ROT: Desteklenmiyor" - -#: vms-tir.c:710 -msgid "ETIR_S_C_OPR_REDEF: Not supported" -msgstr "ETIR_S_C_OPR_REDEF: Desteklenmiyor" - -#: vms-tir.c:716 -msgid "ETIR_S_C_OPR_DFLIT: Not supported" -msgstr "ETIR_S_C_OPR_DFLIT: Desteklenmiyor" - -#: vms-tir.c:720 vms-tir.c:1668 +#: vms-tir.c:586 vms-tir.c:1418 #, c-format -msgid "Reserved OPR cmd %d" -msgstr "Ayrýlmýþ OPR komutu %d" +msgid "%s: not implemented" +msgstr "%s: tamamlanmamış" -#: vms-tir.c:788 vms-tir.c:1737 +#: vms-tir.c:590 vms-tir.c:1422 #, c-format -msgid "Reserved CTL cmd %d" -msgstr "Ayrýlmýþ CTL komutu %d" +msgid "reserved STO cmd %d" +msgstr "Ayrılmış STO komutu %d" -#: vms-tir.c:816 -msgid "ETIR_S_C_STC_LP: not supported" -msgstr "ETIR_S_C_STC_LP: desteklenmiyor" +#: vms-tir.c:708 vms-tir.c:1568 +#, c-format +msgid "reserved OPR cmd %d" +msgstr "Ayrılmış OPR komutu %d" -#: vms-tir.c:834 -msgid "ETIR_S_C_STC_GBL: not supported" -msgstr "ETIR_S_C_STC_GBL: desteklenmiyor" +#: vms-tir.c:776 vms-tir.c:1632 +#, c-format +msgid "reserved CTL cmd %d" +msgstr "Ayrılmış CTL komutu %d" -#: vms-tir.c:842 -msgid "ETIR_S_C_STC_GCA: not supported" -msgstr "ETIR_S_C_STC_GCA: desteklenmiyor" +#. stack byte from image +#. arg: none. +#: vms-tir.c:1148 +msgid "stack-from-image not implemented" +msgstr "Görüntüden-yığıt tamamlanmamış" -#: vms-tir.c:851 -msgid "ETIR_S_C_STC_PS: not supported" -msgstr "ETIR_S_C_STC_PS: desteklenmiyor" +#: vms-tir.c:1166 +msgid "stack-entry-mask not fully implemented" +msgstr "Yığın girdi maskı tamamlanmamış" +#. compare procedure argument +#. arg: cs symbol name +#. by argument index +#. da argument descriptor #. -#. * stack byte from image -#. * arg: - -#. * -#. -#: vms-tir.c:1199 -msgid "Stack-from-image not implemented" -msgstr "Görüntüden-yýðýt tamamlanmamýþ" - -#: vms-tir.c:1219 -msgid "Stack-entry-mask not fully implemented" -msgstr "Yýðýn girdi maský tamamlanmamýþ" - -#. -#. * compare procedure argument -#. * arg: cs symbol name -#. * by argument index -#. * da argument descriptor -#. * -#. * compare argument descriptor with symbol argument (ARG$V_PASSMECH) -#. * and stack TRUE (args match) or FALSE (args dont match) value -#. -#: vms-tir.c:1235 +#. compare argument descriptor with symbol argument (ARG$V_PASSMECH) +#. and stack TRUE (args match) or FALSE (args dont match) value. +#: vms-tir.c:1180 msgid "PASSMECH not fully implemented" -msgstr "PASSMECH tamamlanmamýþ" +msgstr "PASSMECH tamamlanmamış" -#: vms-tir.c:1256 -msgid "Stack-local-symbol not fully implemented" -msgstr "Yerel sembol yýðýtý tamamlanmamýþ" +#: vms-tir.c:1199 +msgid "stack-local-symbol not fully implemented" +msgstr "Yerel sembol yığıtı tamamlanmamış" -#: vms-tir.c:1271 -msgid "Stack-literal not fully implemented" -msgstr "Yýðýt sabiti tamamlanmamýþ" +#: vms-tir.c:1212 +msgid "stack-literal not fully implemented" +msgstr "Yığıt sabiti tamamlanmamış" -#: vms-tir.c:1294 -msgid "Stack-local-symbol-entry-point-mask not fully implemented" -msgstr "Yýðýn yerel sembol girdi nokta maský tamamlanmamýþ" +#: vms-tir.c:1233 +msgid "stack-local-symbol-entry-point-mask not fully implemented" +msgstr "Yığın yerel sembol girdi noktası maskı tamamlanmamış" -#: vms-tir.c:1469 +#: vms-tir.c:1510 vms-tir.c:1522 vms-tir.c:1534 vms-tir.c:1546 vms-tir.c:1611 +#: vms-tir.c:1619 vms-tir.c:1627 #, c-format -msgid "Unimplemented STO cmd %d" -msgstr "Tamamlanmamýþ STO komutu %d" - -#: vms-tir.c:1608 -msgid "TIR_S_C_OPR_ASH incomplete" -msgstr "TIR_S_C_OPR_ASH tamamlanmamýþ" - -#: vms-tir.c:1622 -msgid "TIR_S_C_OPR_USH incomplete" -msgstr "TIR_S_C_OPR_USH tamamlanmamýþ" +msgid "%s: not fully implemented" +msgstr "%s: tamamlanmamış" -#: vms-tir.c:1636 -msgid "TIR_S_C_OPR_ROT incomplete" -msgstr "TIR_S_C_OPR_ROT tamamlanmamýþ" - -#. -#. * redefine symbol to current location -#. -#: vms-tir.c:1657 -msgid "TIR_S_C_OPR_REDEF not supported" -msgstr "TIR_S_C_OPR_REDEF desteklenmiyor" - -#. -#. * define a literal -#. -#: vms-tir.c:1664 -msgid "TIR_S_C_OPR_DFLIT not supported" -msgstr "TIR_S_C_OPR_DFLIT desteklenmiyor" - -#: vms-tir.c:1718 -msgid "TIR_S_C_CTL_DFLOC not fully implemented" -msgstr "TIR_S_C_CTL_DFLOC tamamlanmamýþ" - -#: vms-tir.c:1726 -msgid "TIR_S_C_CTL_STLOC not fully implemented" -msgstr "TIR_S_C_CTL_STLOC tamamlanmamýþ" - -#: vms-tir.c:1734 -msgid "TIR_S_C_CTL_STKDL not fully implemented" -msgstr "TIR_S_C_CTL_STKDL tamamlanmamýþ" - -#: vms-tir.c:1791 +#: vms-tir.c:1684 #, c-format -msgid "Obj code %d not found" -msgstr "Nesne kodu %d bulunmadý" +msgid "obj code %d not found" +msgstr "Nesne kodu %d bulunmadı" -#: vms-tir.c:2137 +#: vms-tir.c:2019 #, c-format msgid "SEC_RELOC with no relocs in section %s" -msgstr "%s bölümünde yerdeðiþim olmaksýzýn SEC_RELOC" +msgstr "%s bölümünde yerdeÄŸiÅŸim olmaksızın SEC_RELOC" -#: vms-tir.c:2424 +#: vms-tir.c:2307 #, c-format msgid "Unhandled relocation %s" -msgstr "Desteklenmeyen yerdeðiþim %s" +msgstr "Desteklenmeyen yerdeÄŸiÅŸim %s" -#: xcofflink.c:1241 +#: xcofflink.c:1243 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" -msgstr "%s: `%s' satýr numaralarýna sahip fakat onu içeren bölümü yok" +msgstr "%s: `%s' satır numaralarına sahip fakat onu içeren bölümü yok" -#: xcofflink.c:1294 +#: xcofflink.c:1296 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" -msgstr "%s: sýnýf %d sembol `%s'un alternatif girdileri yok" +msgstr "%s: sınıf %d sembol `%s'un alternatif girdileri yok" -#: xcofflink.c:1317 +#: xcofflink.c:1319 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" -msgstr "%s: `%s' sembolünde bilinmeyen csect türü %d var" +msgstr "%s: `%s' sembolünde bilinmeyen csect türü %d var" -#: xcofflink.c:1329 +#: xcofflink.c:1331 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" -msgstr "%s: hatalý XTY_ER sembolü `%s': sýnýf %d scnum %d scnlen %d" +msgstr "%s: hatalı XTY_ER sembolü `%s': sınıf %d scnum %d scnlen %d" -#: xcofflink.c:1365 +#: xcofflink.c:1367 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" -msgstr "%s: XMC_TC0 sembolü `%s': sýnýf %d scnlen %d" +msgstr "%s: XMC_TC0 sembolü `%s': sınıf %d scnlen %d" -#: xcofflink.c:1517 +#: xcofflink.c:1519 #, c-format msgid "%s: csect `%s' not in enclosing section" -msgstr "%s: csect `%s' onu içeren bölümde deðil" +msgstr "%s: csect `%s' onu içeren bölümde deÄŸil" -#: xcofflink.c:1624 +#: xcofflink.c:1626 #, c-format msgid "%s: misplaced XTY_LD `%s'" -msgstr "%s: XTY_LD `%s'yanlýþ yerde" +msgstr "%s: XTY_LD `%s'yanlış yerde" -#: xcofflink.c:1948 +#: xcofflink.c:1957 #, c-format msgid "%s: reloc %s:%d not in csect" -msgstr "%s: yerdeðiþim %s:%d csect içinde deðil" +msgstr "%s: yerdeÄŸiÅŸim %s:%d csect içinde deÄŸil" -#: xcofflink.c:2083 +#: xcofflink.c:2092 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" -msgstr "%s: XCOFF çýktýsý oluþturulmazken XCOFF paylaþýmlý nesnesi" +msgstr "%s: XCOFF çıktısı oluÅŸturulmazken XCOFF paylaşımlı nesnesi" -#: xcofflink.c:2104 +#: xcofflink.c:2113 #, c-format msgid "%s: dynamic object with no .loader section" -msgstr "%s: .loader bölümü olmayan dinamik nesne" +msgstr "%s: .loader bölümü olmayan dinamik nesne" -#: xcofflink.c:2749 +#: xcofflink.c:2758 #, c-format msgid "%s: no such symbol" -msgstr "%s: böyle bir sembol yok" +msgstr "%s: böyle bir sembol yok" -#: xcofflink.c:2890 +#: xcofflink.c:2891 msgid "error: undefined symbol __rtinit" -msgstr "hata: tanýmlanmamýþ sembol __rtinit" +msgstr "hata: tanımlanmamış sembol __rtinit" -#: xcofflink.c:3458 +#: xcofflink.c:3453 #, c-format msgid "warning: attempt to export undefined symbol `%s'" -msgstr "uyarý: tanýmlanmamýþ `%s' sembolünü ihraç denemesi" +msgstr "uyarı: tanımlanmamış `%s' sembolünü ihraç denemesi" -#: xcofflink.c:4452 +#: xcofflink.c:4447 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" -msgstr "TOC taþmasý: 0x%lx > 0x10000; -mminimal-toc ile derlemeyi deneyin" +msgstr "TOC taÅŸması: 0x%lx > 0x10000; -mminimal-toc ile derlemeyi deneyin" -#: xcofflink.c:5292 xcofflink.c:5754 xcofflink.c:5816 xcofflink.c:6117 +#: xcofflink.c:5287 xcofflink.c:5756 xcofflink.c:5818 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" -msgstr "%s: bilinmeyen `%s' bölümünde yükleyici yerdeðiþimi" +msgstr "%s: bilinmeyen `%s' bölümünde yükleyici yerdeÄŸiÅŸimi" -#: xcofflink.c:5314 xcofflink.c:6128 +#: xcofflink.c:5309 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" -msgstr "%s: `%s' yükleyici yerdeðiþiminde fakat yükleyici sembolü deðil" +msgstr "%s: `%s' yükleyici yerdeÄŸiÅŸiminde fakat yükleyici sembolü deÄŸil" -#: xcofflink.c:5329 +#: xcofflink.c:5324 #, c-format msgid "%s: loader reloc in read-only section %s" -msgstr "%s: %s salt-okunur bölümünde yükleyici yerdeðiþimi" +msgstr "%s: %s salt-okunur bölümünde yükleyici yerdeÄŸiÅŸimi" -#: elf32-ia64.c:2190 elf64-ia64.c:2190 +#: elf32-ia64.c:2222 elf64-ia64.c:2222 msgid "@pltoff reloc against local symbol" msgstr "yerel sembole @pltoff yerdegisimi" -#: elf32-ia64.c:2248 elf64-ia64.c:2248 -msgid "non-zero addend in @fptr reloc" -msgstr "@fptr yerdeðiþiminde sýfýr olmayan eklenti" - -#: elf32-ia64.c:3414 elf64-ia64.c:3414 +#: elf32-ia64.c:3562 elf64-ia64.c:3562 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" -msgstr "%s: kýsa veri bölümünde taþma (0x%lx >= 0x400000)" +msgstr "%s: kısa veri bölümünde taÅŸma (0x%lx >= 0x400000)" -#: elf32-ia64.c:3425 elf64-ia64.c:3425 +#: elf32-ia64.c:3573 elf64-ia64.c:3573 #, c-format msgid "%s: __gp does not cover short data segment" -msgstr "%s: __gp kýsa veri bölümünü kapsamýyor" +msgstr "%s: __gp kısa veri bölümünü kapsamıyor" -#: elf32-ia64.c:3729 elf64-ia64.c:3729 +#: elf32-ia64.c:3858 elf64-ia64.c:3858 #, c-format msgid "%s: linking non-pic code in a shared library" -msgstr "%s: pic olmayan kod paylaþmalý kitaplýkta baðlanýyor" +msgstr "%s: pic olmayan kod paylaÅŸmalı kitaplıkta baÄŸlanıyor" -#: elf32-ia64.c:3762 elf64-ia64.c:3762 +#: elf32-ia64.c:3891 elf64-ia64.c:3891 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" -msgstr "%s: %s dinamik sembolüne @gprel yerdeðiþimi" +msgstr "%s: %s dinamik sembolüne @gprel yerdeÄŸiÅŸimi" -#: elf32-ia64.c:3901 elf64-ia64.c:3901 +#: elf32-ia64.c:4030 elf64-ia64.c:4030 #, c-format msgid "%s: dynamic relocation against speculation fixup" -msgstr "%s: kuþkulu düzeltmeye dinamik yerdeðiþim" +msgstr "%s: kuÅŸkulu düzeltmeye dinamik yerdeÄŸiÅŸim" -#: elf32-ia64.c:3909 elf64-ia64.c:3909 +#: elf32-ia64.c:4038 elf64-ia64.c:4038 #, c-format msgid "%s: speculation fixup against undefined weak symbol" -msgstr "%s: tanýmlanmamýþ gevþek sembole tartýþmalý düzeltme" +msgstr "%s: tanımlanmamış gevÅŸek sembole tartışmalı düzeltme" -#: elf32-ia64.c:4093 elf64-ia64.c:4093 +#: elf32-ia64.c:4271 elf64-ia64.c:4271 msgid "unsupported reloc" -msgstr "desteklenmeyen yerdeðiþim" +msgstr "desteklenmeyen yerdeÄŸiÅŸim" -#: elf32-ia64.c:4373 elf64-ia64.c:4373 +#: elf32-ia64.c:4551 elf64-ia64.c:4551 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" -msgstr "%s: NULL-halinde-tuzakla karþý-baþvurusu tuzaklamayan dosyalarla baðlandý" +msgstr "%s: NULL-halinde-tuzakla karşı-baÅŸvurusu tuzaklamayan dosyalarla baÄŸlandı" -#: elf32-ia64.c:4382 elf64-ia64.c:4382 +#: elf32-ia64.c:4560 elf64-ia64.c:4560 #, c-format msgid "%s: linking big-endian files with little-endian files" -msgstr "%s: büyük sonlu dosyalar küçük sonlu dosyalarla baðlanýyor" +msgstr "%s: büyük sonlu dosyalar küçük sonlu dosyalarla baÄŸlanıyor" -#: elf32-ia64.c:4391 elf64-ia64.c:4391 +#: elf32-ia64.c:4569 elf64-ia64.c:4569 #, c-format msgid "%s: linking 64-bit files with 32-bit files" -msgstr "%s: 64 bitlik dosyalar 32 bitlik dosyalarla baðlanýyor" +msgstr "%s: 64 bitlik dosyalar 32 bitlik dosyalarla baÄŸlanıyor" -#: elf32-ia64.c:4400 elf64-ia64.c:4400 +#: elf32-ia64.c:4578 elf64-ia64.c:4578 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" -msgstr "%s: constant-gp dosyalarý constant-gp olmayan dosyalarla baðlanýyor" +msgstr "%s: constant-gp dosyaları constant-gp olmayan dosyalarla baÄŸlanıyor" -#: elf32-ia64.c:4410 elf64-ia64.c:4410 +#: elf32-ia64.c:4588 elf64-ia64.c:4588 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" -msgstr "%s: auto-pic dosyalarý auto-pic olmayan dosyalarla baðlanýyor" +msgstr "%s: auto-pic dosyaları auto-pic olmayan dosyalarla baÄŸlanıyor" -#: peigen.c:964 pepigen.c:964 +#: peigen.c:962 pepigen.c:962 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" -msgstr "%s: satýr numarasý taþmasý: 0x%lx > 0xffff" +msgstr "%s: satır numarası taÅŸması: 0x%lx > 0xffff" -#: peigen.c:981 pepigen.c:981 +#: peigen.c:979 pepigen.c:979 #, c-format msgid "%s: reloc overflow 1: 0x%lx > 0xffff" -msgstr "%s: yerdeðiþim taþmasý 1: 0x%lx > 0xffff" +msgstr "%s: yerdeÄŸiÅŸim taÅŸması 1: 0x%lx > 0xffff" -#: peigen.c:995 pepigen.c:995 +#: peigen.c:993 pepigen.c:993 msgid "Export Directory [.edata (or where ever we found it)]" -msgstr "Ýhraç Dizini [.edata (veya nerede bulundu ise)]" +msgstr "Ä°hraç Dizini [.edata (veya nerede bulundu ise)]" -#: peigen.c:996 pepigen.c:996 +#: peigen.c:994 pepigen.c:994 msgid "Import Directory [parts of .idata]" -msgstr "Ýthal Dizini [.idata'nýn parçalarý]" +msgstr "Ä°thal Dizini [.idata'nın parçaları]" -#: peigen.c:997 pepigen.c:997 +#: peigen.c:995 pepigen.c:995 msgid "Resource Directory [.rsrc]" msgstr "Kaynak Dizini [.rsrc]" -#: peigen.c:998 pepigen.c:998 +#: peigen.c:996 pepigen.c:996 msgid "Exception Directory [.pdata]" -msgstr "Ýstisna Dizini [.pdata]" +msgstr "Ä°stisna Dizini [.pdata]" -#: peigen.c:999 pepigen.c:999 +#: peigen.c:997 pepigen.c:997 msgid "Security Directory" -msgstr "Güvenlik Dizini" +msgstr "Güvenlik Dizini" -#: peigen.c:1000 pepigen.c:1000 +#: peigen.c:998 pepigen.c:998 msgid "Base Relocation Directory [.reloc]" -msgstr "Temel Yerdeðiþim Dizini [.reloc]" +msgstr "Temel YerdeÄŸiÅŸim Dizini [.reloc]" -#: peigen.c:1001 pepigen.c:1001 +#: peigen.c:999 pepigen.c:999 msgid "Debug Directory" -msgstr "Hata Ayýklama Dizini" +msgstr "Hata Ayıklama Dizini" -#: peigen.c:1002 pepigen.c:1002 +#: peigen.c:1000 pepigen.c:1000 msgid "Description Directory" -msgstr "Açýklama Dizini" +msgstr "Açıklama Dizini" -#: peigen.c:1003 pepigen.c:1003 +#: peigen.c:1001 pepigen.c:1001 msgid "Special Directory" -msgstr "Özel Dizin" +msgstr "Özel Dizin" -#: peigen.c:1004 pepigen.c:1004 +#: peigen.c:1002 pepigen.c:1002 msgid "Thread Storage Directory [.tls]" msgstr "Dal Saklama Dizini [.tls]" -#: peigen.c:1005 pepigen.c:1005 +#: peigen.c:1003 pepigen.c:1003 msgid "Load Configuration Directory" -msgstr "Ayar Yükleme Dizini" +msgstr "Ayar Yükleme Dizini" -#: peigen.c:1006 pepigen.c:1006 +#: peigen.c:1004 pepigen.c:1004 msgid "Bound Import Directory" -msgstr "Sýnýr Ýthal Dizini" +msgstr "Sınır Ä°thal Dizini" -#: peigen.c:1007 pepigen.c:1007 +#: peigen.c:1005 pepigen.c:1005 msgid "Import Address Table Directory" -msgstr "Adres Tablosu Ýthal Dizini" +msgstr "Adres Tablosu Ä°thal Dizini" -#: peigen.c:1008 pepigen.c:1008 +#: peigen.c:1006 pepigen.c:1006 msgid "Delay Import Directory" -msgstr "Gecikmeli Ýthal Dizini" +msgstr "Gecikmeli Ä°thal Dizini" -#: peigen.c:1009 peigen.c:1010 pepigen.c:1009 pepigen.c:1010 +#: peigen.c:1007 peigen.c:1008 pepigen.c:1007 pepigen.c:1008 msgid "Reserved" -msgstr "Ayrýlmýþ" +msgstr "Ayrılmış" -#: peigen.c:1073 pepigen.c:1073 -msgid "\nThere is an import table, but the section containing it could not be found\n" -msgstr "\nBir ithal tablosu var, fakat onu içeren bölüm bulunamadý\n" +#: peigen.c:1071 pepigen.c:1071 +msgid "" +"\n" +"There is an import table, but the section containing it could not be found\n" +msgstr "" +"\n" +"Bir ithal tablosu var, fakat onu içeren bölüm bulunamadı\n" -#: peigen.c:1078 pepigen.c:1078 +#: peigen.c:1076 pepigen.c:1076 #, c-format -msgid "\nThere is an import table in %s at 0x%lx\n" -msgstr "\n%s içerisinde 0x%lx'de bir ithal tablosu var\n" +msgid "" +"\n" +"There is an import table in %s at 0x%lx\n" +msgstr "" +"\n" +"%s içerisinde 0x%lx'de bir ithal tablosu var\n" -#: peigen.c:1115 pepigen.c:1115 +#: peigen.c:1113 pepigen.c:1113 #, c-format -msgid "\nFunction descriptor located at the start address: %04lx\n" -msgstr "\nBaþlangýç adresinde iþlev betimleyicisi bulundu: %04lx\n" +msgid "" +"\n" +"Function descriptor located at the start address: %04lx\n" +msgstr "" +"\n" +"BaÅŸlangıç adresinde iÅŸlev betimleyicisi bulundu: %04lx\n" -#: peigen.c:1118 pepigen.c:1118 +#: peigen.c:1116 pepigen.c:1116 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" -msgstr "\tkod temeli %08lx toc (yüklenebilir/gerçek) %08lx/%08lx\n" +msgstr "\tkod temeli %08lx toc (yüklenebilir/gerçek) %08lx/%08lx\n" -#: peigen.c:1124 pepigen.c:1124 -msgid "\nNo reldata section! Function descriptor not decoded.\n" -msgstr "\nReldata bölümü yok! Ýþlev betimleyicisi çözümlenemedi.\n" +#: peigen.c:1122 pepigen.c:1122 +msgid "" +"\n" +"No reldata section! Function descriptor not decoded.\n" +msgstr "" +"\n" +"Reldata bölümü yok! Ä°ÅŸlev betimleyicisi çözümlenemedi.\n" -#: peigen.c:1129 pepigen.c:1129 +#: peigen.c:1127 pepigen.c:1127 #, c-format -msgid "\nThe Import Tables (interpreted %s section contents)\n" -msgstr "\nÝthal Tablolarý (%s bölüm içeriði çözümlendi)\n" - -#: peigen.c:1132 pepigen.c:1132 -msgid " vma: Hint Time Forward DLL First\n" -msgstr " vma: Ýpucu Zaman Ýleri DLL Ýlk\n" +msgid "" +"\n" +"The Import Tables (interpreted %s section contents)\n" +msgstr "" +"\n" +"Ä°thal Tabloları (%s bölüm içeriÄŸi çözümlendi)\n" -#: peigen.c:1134 pepigen.c:1134 -msgid " Table Stamp Chain Name Thunk\n" -msgstr " Tablo Damga Zincir Ýsim Parça\n" +#: peigen.c:1130 pepigen.c:1130 +msgid "" +" vma: Hint Time Forward DLL First\n" +" Table Stamp Chain Name Thunk\n" +msgstr "" +" vma: Ä°pucu Zaman Ä°leri DLL Ä°lk\n" +" Tablo Damga Zincir Ä°sim Parça\n" -#: peigen.c:1182 pepigen.c:1182 +#: peigen.c:1181 pepigen.c:1181 #, c-format -msgid "\n\tDLL Name: %s\n" -msgstr "\n\tDLL Adý: %s\n" - -#: peigen.c:1186 peigen.c:1249 pepigen.c:1186 pepigen.c:1249 -msgid "\tvma: Hint/Ord Member-Name\n" -msgstr "\tvma: Ýpucu/Sýra Üye-Adý\n" - -#: peigen.c:1248 pepigen.c:1248 -msgid "\tThe Import Address Table (difference found)\n" -msgstr "\tÝthal Adres Tablosu (fark bulundu)\n" +msgid "" +"\n" +"\tDLL Name: %s\n" +msgstr "" +"\n" +"\tDLL Adı: %s\n" -#: peigen.c:1255 pepigen.c:1255 -msgid "\t>>> Ran out of IAT members!\n" -msgstr "\t>>> IAT üyeleri bitti!\n" +#: peigen.c:1192 pepigen.c:1192 +msgid "\tvma: Hint/Ord Member-Name Bound-To\n" +msgstr "\tvma: Ä°pucu/Sıra Ãœye-Adı Sınır\n" -#: peigen.c:1273 pepigen.c:1273 -msgid "\tThe Import Address Table is identical\n" -msgstr "\tÝthal Adres Tablosu ayný\n" +#: peigen.c:1217 pepigen.c:1217 +msgid "" +"\n" +"There is a first thunk, but the section containing it could not be found\n" +msgstr "" +"\n" +"Bir ilk parça var, fakat onu içeren bölüm bulunamadı\n" -#: peigen.c:1345 pepigen.c:1345 -msgid "\nThere is an export table, but the section containing it could not be found\n" -msgstr "\nBir ihraç tablosu var, fakat onu içeren bölüm bulunamadý\n" +#: peigen.c:1357 pepigen.c:1357 +msgid "" +"\n" +"There is an export table, but the section containing it could not be found\n" +msgstr "" +"\n" +"Bir ihraç tablosu var, fakat onu içeren bölüm bulunamadı\n" -#: peigen.c:1350 pepigen.c:1350 +#: peigen.c:1362 pepigen.c:1362 #, c-format -msgid "\nThere is an export table in %s at 0x%lx\n" -msgstr "\n%s içinde 0x%lx'de bir ihraç tablosu var\n" +msgid "" +"\n" +"There is an export table in %s at 0x%lx\n" +msgstr "" +"\n" +"%s içinde 0x%lx'de bir ihraç tablosu var\n" -#: peigen.c:1381 pepigen.c:1381 +#: peigen.c:1393 pepigen.c:1393 #, c-format -msgid "\nThe Export Tables (interpreted %s section contents)\n\n" -msgstr "\nÝhraç Tablolarý (%s bölüm içeriði çözümlendi)\n\n" +msgid "" +"\n" +"The Export Tables (interpreted %s section contents)\n" +"\n" +msgstr "" +"\n" +"Ä°hraç Tabloları (%s bölüm içeriÄŸi çözümlendi)\n" +"\n" -#: peigen.c:1385 pepigen.c:1385 +#: peigen.c:1397 pepigen.c:1397 #, c-format msgid "Export Flags \t\t\t%lx\n" -msgstr "Ýhraç Bayraklarý \t\t\t%lx\n" +msgstr "Ä°hraç Bayrakları \t\t\t%lx\n" -#: peigen.c:1388 pepigen.c:1388 +#: peigen.c:1400 pepigen.c:1400 #, c-format msgid "Time/Date stamp \t\t%lx\n" -msgstr "Saat/Tarih damgasý \t\t%lx\n" +msgstr "Saat/Tarih damgası \t\t%lx\n" -#: peigen.c:1391 pepigen.c:1391 +#: peigen.c:1403 pepigen.c:1403 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" -msgstr "Majör/Minör \t\t\t%d/%d\n" +msgstr "Majör/Minör \t\t\t%d/%d\n" -#: peigen.c:1394 pepigen.c:1394 +#: peigen.c:1406 pepigen.c:1406 msgid "Name \t\t\t\t" -msgstr "Ýsim \t\t\t\t" +msgstr "Ä°sim \t\t\t\t" -#: peigen.c:1400 pepigen.c:1400 +#: peigen.c:1412 pepigen.c:1412 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "Onluk Sistem \t\t\t%ld\n" -#: peigen.c:1403 pepigen.c:1403 +#: peigen.c:1415 pepigen.c:1415 msgid "Number in:\n" -msgstr "Sayý içinde:\n" +msgstr "Sayı içinde:\n" -#: peigen.c:1406 pepigen.c:1406 +#: peigen.c:1418 pepigen.c:1418 #, c-format msgid "\tExport Address Table \t\t%08lx\n" -msgstr "\tÝhraç Adres Tablosu \t\t%08lx\n" +msgstr "\tÄ°hraç Adres Tablosu \t\t%08lx\n" -#: peigen.c:1410 pepigen.c:1410 +#: peigen.c:1422 pepigen.c:1422 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" -msgstr "\t[Ýsim Gösterge/Onluk] Tablo\t%08lx\n" +msgstr "\t[Ä°sim Gösterge/Onluk] Tablo\t%08lx\n" -#: peigen.c:1413 pepigen.c:1413 +#: peigen.c:1425 pepigen.c:1425 msgid "Table Addresses\n" msgstr "Tablo Adresleri\n" -#: peigen.c:1416 pepigen.c:1416 +#: peigen.c:1428 pepigen.c:1428 msgid "\tExport Address Table \t\t" -msgstr "\tÝhraç Adres Tablosu \t\t" +msgstr "\tÄ°hraç Adres Tablosu \t\t" -#: peigen.c:1421 pepigen.c:1421 +#: peigen.c:1433 pepigen.c:1433 msgid "\tName Pointer Table \t\t" -msgstr "\tÝsim Gösterge Tablosu \t\t" +msgstr "\tÄ°sim Gösterge Tablosu \t\t" -#: peigen.c:1426 pepigen.c:1426 +#: peigen.c:1438 pepigen.c:1438 msgid "\tOrdinal Table \t\t\t" msgstr "\tOnluk Tablo \t\t\t" -#: peigen.c:1441 pepigen.c:1441 +#: peigen.c:1453 pepigen.c:1453 #, c-format -msgid "\nExport Address Table -- Ordinal Base %ld\n" -msgstr "\nÝhraç Adres Tablosu -- Onluk Sistem %ld\n" +msgid "" +"\n" +"Export Address Table -- Ordinal Base %ld\n" +msgstr "" +"\n" +"Ä°hraç Adres Tablosu -- Onluk Sistem %ld\n" -#: peigen.c:1460 pepigen.c:1460 +#: peigen.c:1472 pepigen.c:1472 msgid "Forwarder RVA" -msgstr "RVA Yönlendiricisi" +msgstr "RVA Yönlendiricisi" -#: peigen.c:1471 pepigen.c:1471 +#: peigen.c:1483 pepigen.c:1483 msgid "Export RVA" -msgstr "RVA Ýhracý" +msgstr "RVA Ä°hracı" -#: peigen.c:1478 pepigen.c:1478 -msgid "\n[Ordinal/Name Pointer] Table\n" -msgstr "\n[Onluk/Ýsim Gösterge] Tablosu\n" +#: peigen.c:1490 pepigen.c:1490 +msgid "" +"\n" +"[Ordinal/Name Pointer] Table\n" +msgstr "" +"\n" +"[Onluk/Ä°sim Gösterge] Tablosu\n" -#: peigen.c:1533 pepigen.c:1533 +#: peigen.c:1545 pepigen.c:1545 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" -msgstr "Uyarý, .pdata bölüm boyu (%ld) %d'nin katý deðil\n" +msgstr "Uyarı, .pdata bölüm boyu (%ld) %d'nin katı deÄŸil\n" -#: peigen.c:1537 pepigen.c:1537 -msgid "\nThe Function Table (interpreted .pdata section contents)\n" -msgstr "\nÝþlev Tablosu (.pdata bölüm içeriði çözümlendi)\n" +#: peigen.c:1549 pepigen.c:1549 +msgid "" +"\n" +"The Function Table (interpreted .pdata section contents)\n" +msgstr "" +"\n" +"Ä°ÅŸlev Tablosu (.pdata bölüm içeriÄŸi çözümlendi)\n" -#: peigen.c:1540 pepigen.c:1540 +#: peigen.c:1552 pepigen.c:1552 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" -msgstr " vma:\t\t\tBaþlangýç Adresi Sonlanma Adresi Geri Al Bilgisi\n" - -#: peigen.c:1543 pepigen.c:1543 -msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" -msgstr " vma:\t\tBaþl. Son EH EH PrologSon Ýstisna\n" +msgstr " vma:\t\t\tBaÅŸlangıç Adresi Sonlanma Adresi Geri Al Bilgisi\n" -#: peigen.c:1545 pepigen.c:1545 -msgid " \t\tAddress Address Handler Data Address Mask\n" -msgstr " \t\tAdres Adres Yön. Veri Adres Mask\n" +#: peigen.c:1554 pepigen.c:1554 +msgid "" +" vma:\t\tBegin End EH EH PrologEnd Exception\n" +" \t\tAddress Address Handler Data Address Mask\n" +msgstr "" +" vma:\t\tBaÅŸl. Son EH EH PrologSon Ä°stisna\n" +" \t\tAdres Adres Yakalay Veri Adres Maske\n" -#: peigen.c:1613 pepigen.c:1613 +#: peigen.c:1624 pepigen.c:1624 msgid " Register save millicode" msgstr " Yazma milikodunu kaydet" -#: peigen.c:1616 pepigen.c:1616 +#: peigen.c:1627 pepigen.c:1627 msgid " Register restore millicode" msgstr " Geri alma milikodunu kaydet" -#: peigen.c:1619 pepigen.c:1619 +#: peigen.c:1630 pepigen.c:1630 msgid " Glue code sequence" -msgstr " Birleþtirici kod dizisi" +msgstr " BirleÅŸtirici kod dizisi" -#: peigen.c:1671 pepigen.c:1671 -msgid "\n\nPE File Base Relocations (interpreted .reloc section contents)\n" -msgstr "\n\nPE Dosya Temel Yerdeðiþimi (.reloc bölüm içeriði çözümlendi)\n" +#: peigen.c:1682 pepigen.c:1682 +msgid "" +"\n" +"\n" +"PE File Base Relocations (interpreted .reloc section contents)\n" +msgstr "" +"\n" +"\n" +"PE Dosya Temel YerdeÄŸiÅŸimi (.reloc bölüm içeriÄŸi çözümlendi)\n" -#: peigen.c:1701 pepigen.c:1701 +#: peigen.c:1712 pepigen.c:1712 #, c-format -msgid "\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" -msgstr "\nSanal Adres: %08lx Parça boyu %ld (0x%lx) Düzeltme Sayýsý %ld\n" +msgid "" +"\n" +"Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" +msgstr "" +"\n" +"Sanal Adres: %08lx Parça boyu %ld (0x%lx) Düzeltme Sayısı %ld\n" -#: peigen.c:1714 pepigen.c:1714 +#: peigen.c:1725 pepigen.c:1725 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" -msgstr "\tyer deðiþim %4d göreli konum %4x [%4lx] %s" +msgstr "\tyer deÄŸiÅŸim %4d göreli konum %4x [%4lx] %s" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1754 pepigen.c:1754 +#: peigen.c:1765 pepigen.c:1765 #, c-format -msgid "\nCharacteristics 0x%x\n" -msgstr "\nÖzellikler 0x%x\n" +msgid "" +"\n" +"Characteristics 0x%x\n" +msgstr "" +"\n" +"Özellikler 0x%x\n" + +#~ msgid "GP relative relocation when GP not defined" +#~ msgstr "GP tanımlanmamışken GP göreli yer deÄŸiÅŸtirmesi" + +#~ msgid "%s: ERROR: passes floats in float registers whereas target %s uses integer registers" +#~ msgstr "%s: HATA: kayan sayıları kayan yazmaçlarda geçiriyor fakat hedef %s tamsayı yazmaç kullanıyor" + +#~ msgid "%s: ERROR: passes floats in integer registers whereas target %s uses float registers" +#~ msgstr "%s: HATA: kayan sayıları tamsayı yazmaçlarda geçiriyor fakat hedef %s kayan yazmaç kullanıyor" + +#~ msgid "Warning: input file %s supports interworking, whereas %s does not." +#~ msgstr "Uyarı: %s girdi dosyası beraber çalışmayı destekliyor, fakat %s desteklemiyor." + +#~ msgid "Warning: input file %s does not support interworking, whereas %s does." +#~ msgstr "Uyarı: %s girdi dosyası beraber çalışmayı desteklemiyor, fakat %s destekliyor." + +#~ msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" +#~ msgstr "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld sonraki %ld" + +#~ msgid "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n" +#~ msgstr "bfd sembolünden elf sembolü:0x%.8lx, isim= %s, sem num = %d, bayrak = 0x%.8lx%s\n" + +#~ msgid "Warning: Not setting interwork flag of %s since it has already been specified as non-interworking" +#~ msgstr "Uyarı: beraber çalışmaz diye önceden belirtilmiÅŸ olduÄŸundan %s'nin beraber çalışma bayrağı atanmadı" + +#~ msgid "Warning: Clearing the interwork flag of %s due to outside request" +#~ msgstr "Uyarı: Dış isteÄŸe uyularak %s'nin beraber çalışma bayrağı temizlendi" + +#~ msgid " [APCS-26]" +#~ msgstr " [APCS-26]" + +#~ msgid " [APCS-32]" +#~ msgstr " [APCS-32]" + +#~ msgid "(unknown)" +#~ msgstr "(bilinmeyen)" + +#~ msgid " previously %s in %s" +#~ msgstr " daha önce %2$s içinde %1$s" + +#~ msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" +#~ msgstr "ETIR_S_C_STO_GBL: sembol yok \"%s\"" + +#~ msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" +#~ msgstr "ETIR_S_C_STO_CA: sembol yok \"%s\"" + +#~ msgid "ETIR_S_C_STO_RB/AB: Not supported" +#~ msgstr "ETIR_S_C_STO_RB/AB: Desteklenmiyor" + +#~ msgid "ETIR_S_C_STO_LP_PSB: Not supported" +#~ msgstr "ETIR_S_C_STO_LP_PSB: Desteklenmiyor" + +#~ msgid "ETIR_S_C_STO_HINT_GBL: not implemented" +#~ msgstr "ETIR_S_C_STO_HINT_GBL: tamamlanmamış" + +#~ msgid "ETIR_S_C_STO_HINT_PS: not implemented" +#~ msgstr "ETIR_S_C_STO_HINT_PS: tamamlanmamış" + +#~ msgid "ETIR_S_C_OPR_INSV: Not supported" +#~ msgstr "ETIR_S_C_OPR_INSV: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_USH: Not supported" +#~ msgstr "ETIR_S_C_OPR_USH: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_ROT: Not supported" +#~ msgstr "ETIR_S_C_OPR_ROT: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_REDEF: Not supported" +#~ msgstr "ETIR_S_C_OPR_REDEF: Desteklenmiyor" + +#~ msgid "ETIR_S_C_OPR_DFLIT: Not supported" +#~ msgstr "ETIR_S_C_OPR_DFLIT: Desteklenmiyor" + +#~ msgid "ETIR_S_C_STC_GBL: not supported" +#~ msgstr "ETIR_S_C_STC_GBL: desteklenmiyor" + +#~ msgid "ETIR_S_C_STC_GCA: not supported" +#~ msgstr "ETIR_S_C_STC_GCA: desteklenmiyor" + +#~ msgid "ETIR_S_C_STC_PS: not supported" +#~ msgstr "ETIR_S_C_STC_PS: desteklenmiyor" + +#~ msgid "Unimplemented STO cmd %d" +#~ msgstr "Tamamlanmamış STO komutu %d" + +#~ msgid "TIR_S_C_OPR_ASH incomplete" +#~ msgstr "TIR_S_C_OPR_ASH tamamlanmamış" + +#~ msgid "TIR_S_C_OPR_USH incomplete" +#~ msgstr "TIR_S_C_OPR_USH tamamlanmamış" + +#~ msgid "TIR_S_C_OPR_ROT incomplete" +#~ msgstr "TIR_S_C_OPR_ROT tamamlanmamış" + +#~ msgid "TIR_S_C_OPR_REDEF not supported" +#~ msgstr "TIR_S_C_OPR_REDEF desteklenmiyor" + +#~ msgid "TIR_S_C_OPR_DFLIT not supported" +#~ msgstr "TIR_S_C_OPR_DFLIT desteklenmiyor" + +#~ msgid "TIR_S_C_CTL_DFLOC not fully implemented" +#~ msgstr "TIR_S_C_CTL_DFLOC tamamlanmamış" + +#~ msgid "TIR_S_C_CTL_STLOC not fully implemented" +#~ msgstr "TIR_S_C_CTL_STLOC tamamlanmamış" + +#~ msgid "TIR_S_C_CTL_STKDL not fully implemented" +#~ msgstr "TIR_S_C_CTL_STKDL tamamlanmamış" + +#~ msgid " vma: Hint Time Forward DLL First\n" +#~ msgstr " vma: Ä°pucu Zaman Ä°leri DLL Ä°lk\n" + +#~ msgid "\tThe Import Address Table (difference found)\n" +#~ msgstr "\tÄ°thal Adres Tablosu (fark bulundu)\n" + +#~ msgid "\t>>> Ran out of IAT members!\n" +#~ msgstr "\t>>> IAT üyeleri bitti!\n" + +#~ msgid "\tThe Import Address Table is identical\n" +#~ msgstr "\tÄ°thal Adres Tablosu aynı\n" + +#~ msgid " \t\tAddress Address Handler Data Address Mask\n" +#~ msgstr " \t\tAdres Adres Yön. Veri Adres Mask\n" diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index 22043b5..5b153bd 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -469,6 +469,7 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg) #define ppcboot_bfd_relax_section bfd_generic_relax_section #define ppcboot_bfd_gc_sections bfd_generic_gc_sections #define ppcboot_bfd_merge_sections bfd_generic_merge_sections +#define ppcboot_bfd_discard_group bfd_generic_discard_group #define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/reloc.c b/bfd/reloc.c index 20df4f8..deba952 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -645,7 +645,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd && howto->partial_inplace == false) + if (output_bfd && ! howto->partial_inplace) output_base = 0; else output_base = reloc_target_output_section->vma; @@ -658,7 +658,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ - if (howto->pc_relative == true) + if (howto->pc_relative) { /* This is a PC relative relocation. We want to set RELOCATION to the distance between the address of the symbol and the @@ -691,13 +691,13 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, relocation -= input_section->output_section->vma + input_section->output_offset; - if (howto->pcrel_offset == true) + if (howto->pcrel_offset) relocation -= reloc_entry->address; } if (output_bfd != (bfd *) NULL) { - if (howto->partial_inplace == false) + if (! howto->partial_inplace) { /* This is a partial relocation, and we want to apply the relocation to the reloc entry rather than the raw data. Modify the reloc @@ -1037,7 +1037,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (howto->partial_inplace == false) + if (! howto->partial_inplace) output_base = 0; else output_base = reloc_target_output_section->vma; @@ -1050,7 +1050,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ - if (howto->pc_relative == true) + if (howto->pc_relative) { /* This is a PC relative relocation. We want to set RELOCATION to the distance between the address of the symbol and the @@ -1083,11 +1083,11 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, relocation -= input_section->output_section->vma + input_section->output_offset; - if (howto->pcrel_offset == true && howto->partial_inplace == true) + if (howto->pcrel_offset && howto->partial_inplace) relocation -= reloc_entry->address; } - if (howto->partial_inplace == false) + if (! howto->partial_inplace) { /* This is a partial relocation, and we want to apply the relocation to the reloc entry rather than the raw data. Modify the reloc @@ -1963,6 +1963,35 @@ ENUMDOC STO_ALPHA_STD_GPLOAD. ENUM + BFD_RELOC_ALPHA_TLSGD +ENUMX + BFD_RELOC_ALPHA_TLSLDM +ENUMX + BFD_RELOC_ALPHA_DTPMOD64 +ENUMX + BFD_RELOC_ALPHA_GOTDTPREL16 +ENUMX + BFD_RELOC_ALPHA_DTPREL64 +ENUMX + BFD_RELOC_ALPHA_DTPREL_HI16 +ENUMX + BFD_RELOC_ALPHA_DTPREL_LO16 +ENUMX + BFD_RELOC_ALPHA_DTPREL16 +ENUMX + BFD_RELOC_ALPHA_GOTTPREL16 +ENUMX + BFD_RELOC_ALPHA_TPREL64 +ENUMX + BFD_RELOC_ALPHA_TPREL_HI16 +ENUMX + BFD_RELOC_ALPHA_TPREL_LO16 +ENUMX + BFD_RELOC_ALPHA_TPREL16 +ENUMDOC + Alpha thread-local storage relocations. + +ENUM BFD_RELOC_MIPS_JMP ENUMDOC Bits 27..2 of the relocation address shifted right 2 bits; @@ -2050,6 +2079,27 @@ ENUMX ENUMX BFD_RELOC_MIPS_JALR COMMENT +ENUM + BFD_RELOC_FRV_LABEL16 +ENUMX + BFD_RELOC_FRV_LABEL24 +ENUMX + BFD_RELOC_FRV_LO16 +ENUMX + BFD_RELOC_FRV_HI16 +ENUMX + BFD_RELOC_FRV_GPREL12 +ENUMX + BFD_RELOC_FRV_GPRELU12 +ENUMX + BFD_RELOC_FRV_GPREL32 +ENUMX + BFD_RELOC_FRV_GPRELHI +ENUMX + BFD_RELOC_FRV_GPRELLO +ENUMDOC + Fujitsu Frv Relocations. +COMMENT COMMENT ENUMDOC MIPS ELF relocations. @@ -3073,6 +3123,55 @@ ENUMDOC 32 bit rel. offset to GOT entry. ENUM + BFD_RELOC_IP2K_FR9 +ENUMDOC + Scenix IP2K - 9-bit register number / data address +ENUM + BFD_RELOC_IP2K_BANK +ENUMDOC + Scenix IP2K - 4-bit register/data bank number +ENUM + BFD_RELOC_IP2K_ADDR16CJP +ENUMDOC + Scenix IP2K - low 13 bits of instruction word address +ENUM + BFD_RELOC_IP2K_PAGE3 +ENUMDOC + Scenix IP2K - high 3 bits of instruction word address +ENUM + BFD_RELOC_IP2K_LO8DATA +ENUMX + BFD_RELOC_IP2K_HI8DATA +ENUMX + BFD_RELOC_IP2K_EX8DATA +ENUMDOC + Scenix IP2K - ext/low/high 8 bits of data address +ENUM + BFD_RELOC_IP2K_LO8INSN +ENUMX + BFD_RELOC_IP2K_HI8INSN +ENUMDOC + Scenix IP2K - low/high 8 bits of instruction word address +ENUM + BFD_RELOC_IP2K_PC_SKIP +ENUMDOC + Scenix IP2K - even/odd PC modifier to modify snb pcl.0 +ENUM + BFD_RELOC_IP2K_TEXT +ENUMDOC + Scenix IP2K - 16 bit word address in text section. +ENUM + BFD_RELOC_IP2K_FR_OFFSET +ENUMDOC + Scenix IP2K - 7-bit sp or dp offset +ENUM + BFD_RELOC_VPE4KMATH_DATA +ENUMX + BFD_RELOC_VPE4KMATH_INSN +ENUMDOC + Scenix VPE4K coprocessor - data/insn-space addressing + +ENUM BFD_RELOC_VTABLE_INHERIT ENUMX BFD_RELOC_VTABLE_ENTRY @@ -3260,17 +3359,53 @@ ENUM BFD_RELOC_M68HC11_HI8 ENUMDOC Motorola 68HC11 reloc. - This is the 8 bits high part of an absolute address. + This is the 8 bit high part of an absolute address. ENUM BFD_RELOC_M68HC11_LO8 ENUMDOC Motorola 68HC11 reloc. - This is the 8 bits low part of an absolute address. + This is the 8 bit low part of an absolute address. ENUM BFD_RELOC_M68HC11_3B ENUMDOC Motorola 68HC11 reloc. - This is the 3 bits of a value. + This is the 3 bit of a value. +ENUM + BFD_RELOC_M68HC11_RL_JUMP +ENUMDOC + Motorola 68HC11 reloc. + This reloc marks the beginning of a jump/call instruction. + It is used for linker relaxation to correctly identify beginning + of instruction and change some branchs to use PC-relative + addressing mode. +ENUM + BFD_RELOC_M68HC11_RL_GROUP +ENUMDOC + Motorola 68HC11 reloc. + This reloc marks a group of several instructions that gcc generates + and for which the linker relaxation pass can modify and/or remove + some of them. +ENUM + BFD_RELOC_M68HC11_LO16 +ENUMDOC + Motorola 68HC11 reloc. + This is the 16-bit lower part of an address. It is used for 'call' + instruction to specify the symbol address without any special + transformation (due to memory bank window). +ENUM + BFD_RELOC_M68HC11_PAGE +ENUMDOC + Motorola 68HC11 reloc. + This is a 8-bit reloc that specifies the page number of an address. + It is used by 'call' instruction to specify the page number of + the symbol. +ENUM + BFD_RELOC_M68HC11_24 +ENUMDOC + Motorola 68HC11 reloc. + This is a 24-bit reloc that represents the address with a 16-bit + value and a 8-bit page number. The symbol address is transformed + to follow the 16K memory bank of 68HC12 (seen as mapped in the window). ENUM BFD_RELOC_CRIS_BDISP8 @@ -3420,6 +3555,15 @@ ENUMX ENUMDOC Sony Xstormy16 Relocations. +ENUM + BFD_RELOC_VAX_GLOB_DAT +ENUMX + BFD_RELOC_VAX_JMP_SLOT +ENUMX + BFD_RELOC_VAX_RELATIVE +ENUMDOC + Relocations used by VAX ELF. + ENDSENUM BFD_RELOC_UNUSED CODE_FRAGMENT diff --git a/bfd/reloc16.c b/bfd/reloc16.c index 1d69a7f..1db8daf 100644 --- a/bfd/reloc16.c +++ b/bfd/reloc16.c @@ -196,8 +196,7 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) The last element is used as an accumlator of shrinks. */ amt = reloc_count + 1; amt *= sizeof (unsigned); - shrinks = (unsigned *) bfd_malloc (amt); - memset (shrinks, 0, (size_t) amt); + shrinks = (unsigned *) bfd_zmalloc (amt); /* Loop until nothing changes in this section. */ do { diff --git a/bfd/section.c b/bfd/section.c index 358f5c4..51b21c7 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -798,7 +798,7 @@ bfd_get_unique_section_name (abfd, templat, count) sname = bfd_malloc ((bfd_size_type) len + 8); if (sname == NULL) return NULL; - strcpy (sname, templat); + memcpy (sname, templat, len); num = 1; if (count != NULL) num = *count; @@ -1301,77 +1301,57 @@ SYNOPSIS DESCRIPTION Remove @var{section} from the output. If the output section - becomes empty, remove it from the output bfd. @var{info} may - be NULL; if it is not, it is used to decide whether the output - section is empty. + becomes empty, remove it from the output bfd. + + This function won't actually do anything except twiddle flags + if called too late in the linking process, when it's not safe + to remove sections. */ void _bfd_strip_section_from_output (info, s) struct bfd_link_info *info; asection *s; { - asection **spp, *os; - struct bfd_link_order *p, *pp; - boolean keep_os; + asection *os; + asection *is; + bfd *abfd; - /* Excise the input section from the link order. + s->flags |= SEC_EXCLUDE; - FIXME: For all calls that I can see to this function, the link - orders have not yet been set up. So why are we checking them? -- - Ian */ + /* If the section wasn't assigned to an output section, or the + section has been discarded by the linker script, there's nothing + more to do. */ os = s->output_section; - - /* Handle a section that wasn't output. */ - if (os == NULL) + if (os == NULL || os->owner == NULL) return; - for (p = os->link_order_head, pp = NULL; p != NULL; pp = p, p = p->next) - if (p->type == bfd_indirect_link_order - && p->u.indirect.section == s) - { - if (pp) - pp->next = p->next; - else - os->link_order_head = p->next; - if (!p->next) - os->link_order_tail = pp; - break; - } - - keep_os = os->link_order_head != NULL; - - if (! keep_os && info != NULL) - { - bfd *abfd; - for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) - { - asection *is; - for (is = abfd->sections; is != NULL; is = is->next) - { - if (is != s && is->output_section == os - && (is->flags & SEC_EXCLUDE) == 0) - break; - } - if (is != NULL) - break; - } - if (abfd != NULL) - keep_os = true; - } + /* If the output section has other (non-excluded) input sections, we + can't remove it. */ + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) + for (is = abfd->sections; is != NULL; is = is->next) + if (is->output_section == os && (is->flags & SEC_EXCLUDE) == 0) + return; - /* If the output section is empty, remove it too. Careful about sections - that have been discarded in the link script -- they are mapped to - bfd_abs_section, which has no owner. */ - if (!keep_os && os->owner != NULL) - { - for (spp = &os->owner->sections; *spp; spp = &(*spp)->next) - if (*spp == os) - { - bfd_section_list_remove (os->owner, spp); - os->owner->section_count--; - break; - } - } + /* If the output section is empty, flag it for removal too. + See ldlang.c:strip_excluded_output_sections for the action. */ + os->flags |= SEC_EXCLUDE; +} - s->flags |= SEC_EXCLUDE; +/* +FUNCTION + bfd_generic_discard_group + +SYNOPSIS + boolean bfd_generic_discard_group (bfd *abfd, asection *group); + +DESCRIPTION + Remove all members of @var{group} from the output. +*/ + +boolean +bfd_generic_discard_group (abfd, group) + bfd *abfd ATTRIBUTE_UNUSED; + asection *group ATTRIBUTE_UNUSED; +{ + return true; } @@ -1740,7 +1740,7 @@ som_object_setup (abfd, file_hdrp, aux_hdrp, current_offset) int found; /* som_mkobject will set bfd_error if som_mkobject fails. */ - if (som_mkobject (abfd) != true) + if (! som_mkobject (abfd)) return 0; /* Set BFD flags based on what information is available in the SOM. */ @@ -1905,9 +1905,9 @@ setup_sections (abfd, file_hdr, current_offset) space_asect->flags |= SEC_DEBUGGING; /* Set up all the attributes for the space. */ - if (bfd_som_set_section_attributes (space_asect, space.is_defined, - space.is_private, space.sort_key, - space.space_number) == false) + if (! bfd_som_set_section_attributes (space_asect, space.is_defined, + space.is_private, space.sort_key, + space.space_number)) goto error_return; /* If the space has no subspaces, then we're done. */ @@ -1968,10 +1968,10 @@ setup_sections (abfd, file_hdr, current_offset) goto error_return; /* Store private information about the section. */ - if (bfd_som_set_subsection_attributes (subspace_asect, space_asect, - subspace.access_control_bits, - subspace.sort_key, - subspace.quadrant) == false) + if (! bfd_som_set_subsection_attributes (subspace_asect, space_asect, + subspace.access_control_bits, + subspace.sort_key, + subspace.quadrant)) goto error_return; /* Keep an easy mapping between subspaces and sections. @@ -3457,7 +3457,7 @@ som_begin_writing (abfd) obj_som_file_hdr (abfd)->space_strings_location = current_offset; /* Scribble out the space strings. */ - if (som_write_space_strings (abfd, current_offset, &strings_size) == false) + if (! som_write_space_strings (abfd, current_offset, &strings_size)) return false; /* Record total string table size in the header and update the @@ -3727,10 +3727,9 @@ som_finish_writing (abfd) obj_som_file_hdr (abfd)->symbol_strings_location = current_offset; /* Scribble out the symbol strings. */ - if (som_write_symbol_strings (abfd, current_offset, syms, - num_syms, &strings_size, - obj_som_compilation_unit (abfd)) - == false) + if (! som_write_symbol_strings (abfd, current_offset, syms, + num_syms, &strings_size, + obj_som_compilation_unit (abfd))) return false; /* Record total string table size in header and update the @@ -3751,7 +3750,7 @@ som_finish_writing (abfd) /* Write the fixups and update fields in subspace headers which relate to the fixup stream. */ - if (som_write_fixups (abfd, current_offset, &total_reloc_size) == false) + if (! som_write_fixups (abfd, current_offset, &total_reloc_size)) return false; /* Record the total size of the fixup stream in the file header. */ @@ -3762,7 +3761,7 @@ som_finish_writing (abfd) /* Now that the symbol table information is complete, build and write the symbol table. */ - if (som_build_and_write_symbol_table (abfd) == false) + if (! som_build_and_write_symbol_table (abfd)) return false; /* Subspaces are written first so that we can set up information @@ -4141,10 +4140,9 @@ som_build_and_write_symbol_table (abfd) to hold the symbol table as we build it. */ symtab_size = num_syms; symtab_size *= sizeof (struct symbol_dictionary_record); - som_symtab = (struct symbol_dictionary_record *) bfd_malloc (symtab_size); + som_symtab = (struct symbol_dictionary_record *) bfd_zmalloc (symtab_size); if (som_symtab == NULL && symtab_size != 0) goto error_return; - memset (som_symtab, 0, (size_t) symtab_size); /* Walk over each symbol. */ for (i = 0; i < num_syms; i++) @@ -4192,7 +4190,7 @@ static boolean som_write_object_contents (abfd) bfd *abfd; { - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { /* Set up fixed parts of the file, space, and subspace headers. Notify the world that output has begun. */ @@ -4230,10 +4228,9 @@ som_slurp_string_table (abfd) /* Allocate and read in the string table. */ amt = obj_som_stringtab_size (abfd); - stringtab = bfd_malloc (amt); + stringtab = bfd_zmalloc (amt); if (stringtab == NULL) return false; - memset (stringtab, 0, obj_som_stringtab_size (abfd)); if (bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET) != 0) return false; @@ -4336,10 +4333,9 @@ som_slurp_symbol_table (abfd) amt = symbol_count; amt *= sizeof (som_symbol_type); - symbase = (som_symbol_type *) bfd_malloc (amt); + symbase = (som_symbol_type *) bfd_zmalloc (amt); if (symbase == NULL) goto error_return; - memset (symbase, 0, symbol_count * sizeof (som_symbol_type)); /* Read in the external SOM representation. */ amt = symbol_count; @@ -5039,7 +5035,7 @@ som_canonicalize_reloc (abfd, section, relptr, symbols) arelent *tblptr; int count; - if (som_slurp_reloc_table (abfd, section, symbols, false) == false) + if (! som_slurp_reloc_table (abfd, section, symbols, false)) return -1; count = section->reloc_count; @@ -5342,7 +5338,7 @@ som_set_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { /* Set up fixed parts of the file, space, and subspace headers. Notify the world that output has begun. */ @@ -5752,8 +5748,7 @@ som_slurp_armap (abfd) } /* Count the number of symbols in the library symbol table. */ - if (som_bfd_count_ar_symbols (abfd, &lst_header, &ardata->symdef_count) - == false) + if (! som_bfd_count_ar_symbols (abfd, &lst_header, &ardata->symdef_count)) return false; /* Get back to the start of the library symbol table. */ @@ -5770,8 +5765,7 @@ som_slurp_armap (abfd) return false; /* Now fill in the canonical archive symbols. */ - if (som_bfd_fill_in_ar_symbols (abfd, &lst_header, &ardata->symdefs) - == false) + if (! som_bfd_fill_in_ar_symbols (abfd, &lst_header, &ardata->symdefs)) return false; /* Seek back to the "first" file in the archive. Note the "first" @@ -5817,7 +5811,7 @@ som_bfd_prep_for_ar_write (abfd, num_syms, stringsize) /* Make sure the symbol table has been read, then snag a pointer to it. It's a little slimey to grab the symbols via obj_som_symtab, but doing so avoids allocating lots of extra memory. */ - if (som_slurp_symbol_table (curr_bfd) == false) + if (! som_slurp_symbol_table (curr_bfd)) return false; sym = obj_som_symtab (curr_bfd); @@ -5899,19 +5893,19 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) amt = lst.hash_size; amt *= sizeof (unsigned int); - hash_table = (unsigned int *) bfd_malloc (amt); + hash_table = (unsigned int *) bfd_zmalloc (amt); if (hash_table == NULL && lst.hash_size != 0) goto error_return; amt = lst.module_count; amt *= sizeof (struct som_entry); - som_dict = (struct som_entry *) bfd_malloc (amt); + som_dict = (struct som_entry *) bfd_zmalloc (amt); if (som_dict == NULL && lst.module_count != 0) goto error_return; amt = lst.hash_size; amt *= sizeof (struct lst_symbol_record *); - last_hash_entry = ((struct lst_symbol_record **) bfd_malloc (amt)); + last_hash_entry = ((struct lst_symbol_record **) bfd_zmalloc (amt)); if (last_hash_entry == NULL && lst.hash_size != 0) goto error_return; @@ -5919,12 +5913,6 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) of the lst record. So save its location. */ lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header); - /* Some initialization. */ - memset (hash_table, 0, 4 * lst.hash_size); - memset (som_dict, 0, lst.module_count * sizeof (struct som_entry)); - memset (last_hash_entry, 0, - lst.hash_size * sizeof (struct lst_symbol_record *)); - /* Symbols have som_index fields, so we have to keep track of the index of each SOM in the archive. @@ -5978,7 +5966,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) /* Make sure the symbol table has been read, then snag a pointer to it. It's a little slimey to grab the symbols via obj_som_symtab, but doing so avoids allocating lots of extra memory. */ - if (som_slurp_symbol_table (curr_bfd) == false) + if (! som_slurp_symbol_table (curr_bfd)) goto error_return; sym = obj_som_symtab (curr_bfd); @@ -6214,7 +6202,7 @@ som_write_armap (abfd, elength, map, orl_count, stridx) /* Count how many symbols we will have on the hash chains and the size of the associated string table. */ - if (som_bfd_prep_for_ar_write (abfd, &nsyms, &stringsize) == false) + if (! som_bfd_prep_for_ar_write (abfd, &nsyms, &stringsize)) return false; lst_size += sizeof (struct lst_symbol_record) * nsyms; @@ -6340,6 +6328,7 @@ som_bfd_link_split_section (abfd, sec) #define som_bfd_gc_sections bfd_generic_gc_sections #define som_bfd_merge_sections bfd_generic_merge_sections +#define som_bfd_discard_group bfd_generic_discard_group const bfd_target som_vec = { "som", /* name */ diff --git a/bfd/sparclinux.c b/bfd/sparclinux.c index 7f1d270..e55a4ff 100644 --- a/bfd/sparclinux.c +++ b/bfd/sparclinux.c @@ -599,10 +599,9 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info) { s->_raw_size = linux_hash_table (info)->fixup_count + 1; s->_raw_size *= 8; - s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); + s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size); if (s->contents == NULL) return false; - memset (s->contents, 0, (size_t) s->_raw_size); } return true; @@ -160,7 +160,7 @@ srec_init () { static boolean inited = false; - if (inited == false) + if (! inited) { inited = true; hex_init (); @@ -230,22 +230,23 @@ static boolean srec_mkobject (abfd) bfd *abfd; { + bfd_size_type amt; + tdata_type *tdata; + srec_init (); - if (abfd->tdata.srec_data == NULL) - { - bfd_size_type amt = sizeof (tdata_type); - tdata_type *tdata = (tdata_type *) bfd_alloc (abfd, amt); - if (tdata == NULL) - return false; - abfd->tdata.srec_data = tdata; - tdata->type = 1; - tdata->head = NULL; - tdata->tail = NULL; - tdata->symbols = NULL; - tdata->symtail = NULL; - tdata->csymbols = NULL; - } + amt = sizeof (tdata_type); + tdata = (tdata_type *) bfd_alloc (abfd, amt); + if (tdata == NULL) + return false; + + abfd->tdata.srec_data = tdata; + tdata->type = 1; + tdata->head = NULL; + tdata->tail = NULL; + tdata->symbols = NULL; + tdata->symtail = NULL; + tdata->csymbols = NULL; return true; } @@ -640,6 +641,7 @@ static const bfd_target * srec_object_p (abfd) bfd *abfd; { + PTR tdata_save; bfd_byte b[4]; srec_init (); @@ -654,9 +656,14 @@ srec_object_p (abfd) return NULL; } - if (! srec_mkobject (abfd) - || ! srec_scan (abfd)) - return NULL; + tdata_save = abfd->tdata.any; + if (! srec_mkobject (abfd) || ! srec_scan (abfd)) + { + if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL) + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = tdata_save; + return NULL; + } if (abfd->symcount > 0) abfd->flags |= HAS_SYMS; @@ -670,6 +677,7 @@ static const bfd_target * symbolsrec_object_p (abfd) bfd *abfd; { + PTR tdata_save; char b[2]; srec_init (); @@ -684,9 +692,14 @@ symbolsrec_object_p (abfd) return NULL; } - if (! srec_mkobject (abfd) - || ! srec_scan (abfd)) - return NULL; + tdata_save = abfd->tdata.any; + if (! srec_mkobject (abfd) || ! srec_scan (abfd)) + { + if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL) + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = tdata_save; + return NULL; + } if (abfd->symcount > 0) abfd->flags |= HAS_SYMS; @@ -1270,6 +1283,7 @@ srec_print_symbol (abfd, afile, symbol, how) #define srec_bfd_relax_section bfd_generic_relax_section #define srec_bfd_gc_sections bfd_generic_gc_sections #define srec_bfd_merge_sections bfd_generic_merge_sections +#define srec_bfd_discard_group bfd_generic_discard_group #define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define srec_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/stabs.c b/bfd/stabs.c index bba4a6d..e225d9c 100644 --- a/bfd/stabs.c +++ b/bfd/stabs.c @@ -284,6 +284,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) sym < symend; sym += STABSIZE, ++pstridx) { + bfd_size_type symstroff; int type; const char *string; @@ -311,9 +312,18 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) } /* Store the string in the hash table, and record the index. */ - string = ((char *) stabstrbuf - + stroff - + bfd_get_32 (abfd, sym + STRDXOFF)); + symstroff = stroff + bfd_get_32 (abfd, sym + STRDXOFF); + if (symstroff >= stabstrsec->_raw_size) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): Stabs entry has invalid string index."), + bfd_archive_filename (abfd), + bfd_get_section_name (abfd, stabsec), + (long) (sym - stabbuf)); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + string = (char *) stabstrbuf + symstroff; *pstridx = _bfd_stringtab_add (sinfo->strings, string, true, true); /* An N_BINCL symbol indicates the start of the stabs entries diff --git a/bfd/sunos.c b/bfd/sunos.c index 7825a82..5fec6f9 100644 --- a/bfd/sunos.c +++ b/bfd/sunos.c @@ -1434,10 +1434,9 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, s = bfd_get_section_by_name (dynobj, ".hash"); BFD_ASSERT (s != NULL); hashalloc = (dynsymcount + bucketcount - 1) * HASH_ENTRY_SIZE; - s->contents = (bfd_byte *) bfd_alloc (dynobj, hashalloc); + s->contents = (bfd_byte *) bfd_zalloc (dynobj, hashalloc); if (s->contents == NULL && dynsymcount > 0) return false; - memset (s->contents, 0, (size_t) hashalloc); for (i = 0; i < bucketcount; i++) PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE); s->_raw_size = bucketcount * HASH_ENTRY_SIZE; @@ -315,6 +315,7 @@ CODE_FRAGMENT #include "aout/stab_gnu.h" static char coff_section_type PARAMS ((const char *)); +static char decode_section_type PARAMS ((const struct sec *)); static int cmpindexentry PARAMS ((const PTR, const PTR)); /* @@ -589,6 +590,41 @@ coff_section_type (s) return '?'; } +/* Return the single-character symbol type corresponding to section + SECTION, or '?' for an unknown section. This uses section flags to + identify sections. + + FIXME These types are unhandled: c, i, e, p. If we handled these also, + we could perhaps obsolete coff_section_type. */ + +static char +decode_section_type (section) + const struct sec *section; +{ + if (section->flags & SEC_CODE) + return 't'; + if (section->flags & SEC_DATA) + { + if (section->flags & SEC_READONLY) + return 'r'; + else if (section->flags & SEC_SMALL_DATA) + return 'g'; + else + return 'd'; + } + if ((section->flags & SEC_HAS_CONTENTS) == 0) + { + if (section->flags & SEC_SMALL_DATA) + return 's'; + else + return 'b'; + } + if (section->flags & SEC_DEBUGGING) + return 'N'; + + return '?'; +} + /* FUNCTION bfd_decode_symclass @@ -639,7 +675,11 @@ bfd_decode_symclass (symbol) if (bfd_is_abs_section (symbol->section)) c = 'a'; else if (symbol->section) - c = coff_section_type (symbol->section->name); + { + c = coff_section_type (symbol->section->name); + if (c == '?') + c = decode_section_type (symbol->section); + } else return '?'; if (symbol->flags & BSF_GLOBAL) @@ -766,6 +806,7 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) return symcount; error_return: + bfd_set_error (bfd_error_no_symbols); if (syms != NULL) free (syms); return -1; @@ -1313,14 +1354,16 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, || strncmp (info->filename, directory_name, dirlen) != 0 || strcmp (info->filename + dirlen, file_name) != 0) { + size_t len; + if (info->filename != NULL) free (info->filename); - info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen - + strlen (file_name) + 1); + len = strlen (file_name) + 1; + info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen + len); if (info->filename == NULL) return false; - strcpy (info->filename, directory_name); - strcpy (info->filename + dirlen, file_name); + memcpy (info->filename, directory_name, dirlen); + memcpy (info->filename + dirlen, file_name, len); } *pfilename = info->filename; diff --git a/bfd/targets.c b/bfd/targets.c index fe778ca..093490c 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -400,7 +400,8 @@ the tokens. .CONCAT2 (NAME,_bfd_final_link), \ .CONCAT2 (NAME,_bfd_link_split_section), \ .CONCAT2 (NAME,_bfd_gc_sections), \ -.CONCAT2 (NAME,_bfd_merge_sections) +.CONCAT2 (NAME,_bfd_merge_sections), \ +.CONCAT2 (NAME,_bfd_discard_group) . int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); . bfd_byte *(*_bfd_get_relocated_section_contents) . PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, @@ -435,6 +436,9 @@ the tokens. . {* Attempt to merge SEC_MERGE sections. *} . boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); . +. {* Discard members of a group. *} +. boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); +. . {* Routines to handle dynamic symbols and relocs. *} .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ .CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ @@ -477,6 +481,7 @@ to find an alternative output format that is suitable. we can't intermix extern's and initializers. */ extern const bfd_target a29kcoff_big_vec; extern const bfd_target a_out_adobe_vec; +extern const bfd_target aix5coff64_vec; extern const bfd_target aout0_big_vec; extern const bfd_target aout_arm_big_vec; extern const bfd_target aout_arm_little_vec; @@ -503,26 +508,31 @@ extern const bfd_target bfd_elf32_big_generic_vec; extern const bfd_target bfd_elf32_bigarc_vec; extern const bfd_target bfd_elf32_bigarm_oabi_vec; extern const bfd_target bfd_elf32_bigarm_vec; +extern const bfd_target bfd_elf32_bigarmqnx_vec; extern const bfd_target bfd_elf32_bigmips_vec; extern const bfd_target bfd_elf32_cris_vec; extern const bfd_target bfd_elf32_d10v_vec; extern const bfd_target bfd_elf32_d30v_vec; extern const bfd_target bfd_elf32_dlx_big_vec; extern const bfd_target bfd_elf32_fr30_vec; +extern const bfd_target bfd_elf32_frv_vec; extern const bfd_target bfd_elf32_h8300_vec; extern const bfd_target bfd_elf32_hppa_linux_vec; extern const bfd_target bfd_elf32_hppa_vec; extern const bfd_target bfd_elf32_i370_vec; extern const bfd_target bfd_elf32_i386_vec; +extern const bfd_target bfd_elf32_i386qnx_vec; extern const bfd_target bfd_elf32_i860_little_vec; extern const bfd_target bfd_elf32_i860_vec; extern const bfd_target bfd_elf32_i960_vec; extern const bfd_target bfd_elf32_ia64_big_vec; extern const bfd_target bfd_elf32_ia64_hpux_big_vec; +extern const bfd_target bfd_elf32_ip2k_vec; extern const bfd_target bfd_elf32_little_generic_vec; extern const bfd_target bfd_elf32_littlearc_vec; extern const bfd_target bfd_elf32_littlearm_oabi_vec; extern const bfd_target bfd_elf32_littlearm_vec; +extern const bfd_target bfd_elf32_littlearmqnx_vec; extern const bfd_target bfd_elf32_littlemips_vec; extern const bfd_target bfd_elf32_m32r_vec; extern const bfd_target bfd_elf32_m68hc11_vec; @@ -533,24 +543,37 @@ extern const bfd_target bfd_elf32_mcore_big_vec; extern const bfd_target bfd_elf32_mcore_little_vec; extern const bfd_target bfd_elf32_mn10200_vec; extern const bfd_target bfd_elf32_mn10300_vec; +extern const bfd_target bfd_elf32_nbigmips_vec; +extern const bfd_target bfd_elf32_nlittlemips_vec; +extern const bfd_target bfd_elf32_ntradbigmips_vec; +extern const bfd_target bfd_elf32_ntradlittlemips_vec; extern const bfd_target bfd_elf32_openrisc_vec; extern const bfd_target bfd_elf32_or32_big_vec; extern const bfd_target bfd_elf32_pj_vec; extern const bfd_target bfd_elf32_pjl_vec; extern const bfd_target bfd_elf32_powerpc_vec; extern const bfd_target bfd_elf32_powerpcle_vec; +extern const bfd_target bfd_elf32_powerpcleqnx_vec; +extern const bfd_target bfd_elf32_powerpcqnx_vec; extern const bfd_target bfd_elf32_s390_vec; +extern const bfd_target bfd_elf32_sh64_vec; +extern const bfd_target bfd_elf32_sh64l_vec; +extern const bfd_target bfd_elf32_sh64lnbsd_vec; +extern const bfd_target bfd_elf32_sh64nbsd_vec; extern const bfd_target bfd_elf32_sh_vec; extern const bfd_target bfd_elf32_shblin_vec; extern const bfd_target bfd_elf32_shl_vec; extern const bfd_target bfd_elf32_shlin_vec; extern const bfd_target bfd_elf32_shlnbsd_vec; +extern const bfd_target bfd_elf32_shlqnx_vec; extern const bfd_target bfd_elf32_shnbsd_vec; +extern const bfd_target bfd_elf32_shqnx_vec; extern const bfd_target bfd_elf32_sparc_vec; extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; extern const bfd_target bfd_elf32_us_cris_vec; extern const bfd_target bfd_elf32_v850_vec; +extern const bfd_target bfd_elf32_vax_vec; extern const bfd_target bfd_elf32_xstormy16_vec; extern const bfd_target bfd_elf64_alpha_vec; extern const bfd_target bfd_elf64_big_generic_vec; @@ -568,6 +591,10 @@ extern const bfd_target bfd_elf64_mmix_vec; extern const bfd_target bfd_elf64_powerpc_vec; extern const bfd_target bfd_elf64_powerpcle_vec; extern const bfd_target bfd_elf64_s390_vec; +extern const bfd_target bfd_elf64_sh64_vec; +extern const bfd_target bfd_elf64_sh64l_vec; +extern const bfd_target bfd_elf64_sh64lnbsd_vec; +extern const bfd_target bfd_elf64_sh64nbsd_vec; extern const bfd_target bfd_elf64_sparc_vec; extern const bfd_target bfd_elf64_tradbigmips_vec; extern const bfd_target bfd_elf64_tradlittlemips_vec; @@ -640,7 +667,6 @@ extern const bfd_target ppcboot_vec; extern const bfd_target riscix_vec; extern const bfd_target rs6000coff64_vec; extern const bfd_target rs6000coff_vec; -extern const bfd_target aix5coff64_vec; extern const bfd_target shcoff_small_vec; extern const bfd_target shcoff_vec; extern const bfd_target shlcoff_small_vec; @@ -664,7 +690,9 @@ extern const bfd_target tic54x_coff1_vec; extern const bfd_target tic54x_coff2_beh_vec; extern const bfd_target tic54x_coff2_vec; extern const bfd_target tic80coff_vec; +extern const bfd_target vaxbsd_vec; extern const bfd_target vaxnetbsd_vec; +extern const bfd_target vax1knetbsd_vec; extern const bfd_target versados_vec; extern const bfd_target vms_alpha_vec; extern const bfd_target vms_vax_vec; @@ -692,10 +720,6 @@ extern const bfd_target ptrace_core_vec; extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; -extern const bfd_target bfd_elf32_sh64_vec; -extern const bfd_target bfd_elf32_sh64l_vec; -extern const bfd_target bfd_elf64_sh64_vec; -extern const bfd_target bfd_elf64_sh64l_vec; static const bfd_target * const _bfd_target_vector[] = { #ifdef SELECT_VECS @@ -715,6 +739,9 @@ static const bfd_target * const _bfd_target_vector[] = { it wasn't omitted by mistake. */ &a29kcoff_big_vec, &a_out_adobe_vec, +#ifdef BFD64 + &aix5coff64_vec, +#endif &aout0_big_vec, #if 0 /* We have no way of distinguishing these from other a.out variants */ @@ -760,11 +787,13 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_d30v_vec, &bfd_elf32_dlx_big_vec, &bfd_elf32_fr30_vec, + &bfd_elf32_frv_vec, &bfd_elf32_h8300_vec, &bfd_elf32_hppa_linux_vec, &bfd_elf32_hppa_vec, &bfd_elf32_i370_vec, &bfd_elf32_i386_vec, + &bfd_elf32_i386qnx_vec, &bfd_elf32_i860_little_vec, &bfd_elf32_i860_vec, &bfd_elf32_i960_vec, @@ -772,6 +801,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_ia64_big_vec, #endif &bfd_elf32_ia64_hpux_big_vec, + &bfd_elf32_ip2k_vec, &bfd_elf32_little_generic_vec, &bfd_elf32_littlearc_vec, &bfd_elf32_littlearm_oabi_vec, @@ -786,12 +816,20 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_mcore_little_vec, &bfd_elf32_mn10200_vec, &bfd_elf32_mn10300_vec, +#ifdef BFD64 + &bfd_elf32_nbigmips_vec, + &bfd_elf32_nlittlemips_vec, + &bfd_elf32_ntradbigmips_vec, + &bfd_elf32_ntradlittlemips_vec, +#endif &bfd_elf32_openrisc_vec, &bfd_elf32_or32_big_vec, &bfd_elf32_pj_vec, &bfd_elf32_pjl_vec, &bfd_elf32_powerpc_vec, &bfd_elf32_powerpcle_vec, + &bfd_elf32_powerpcleqnx_vec, + &bfd_elf32_powerpcqnx_vec, &bfd_elf32_s390_vec, &bfd_elf32_sh_vec, &bfd_elf32_shblin_vec, @@ -799,11 +837,18 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_shlin_vec, &bfd_elf32_shlnbsd_vec, &bfd_elf32_shnbsd_vec, +#ifdef BFD64 + &bfd_elf32_sh64_vec, + &bfd_elf32_sh64l_vec, + &bfd_elf32_sh64lnbsd_vec, + &bfd_elf32_sh64nbsd_vec, +#endif &bfd_elf32_sparc_vec, &bfd_elf32_tradbigmips_vec, &bfd_elf32_tradlittlemips_vec, &bfd_elf32_us_cris_vec, &bfd_elf32_v850_vec, + &bfd_elf32_vax_vec, &bfd_elf32_xstormy16_vec, #ifdef BFD64 &bfd_elf64_alpha_vec, @@ -822,6 +867,10 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_powerpc_vec, &bfd_elf64_powerpcle_vec, &bfd_elf64_s390_vec, + &bfd_elf64_sh64_vec, + &bfd_elf64_sh64l_vec, + &bfd_elf64_sh64lnbsd_vec, + &bfd_elf64_sh64nbsd_vec, #if 0 &bfd_elf64_sparc_vec, #endif @@ -965,7 +1014,9 @@ static const bfd_target * const _bfd_target_vector[] = { &tic54x_coff2_beh_vec, &tic54x_coff2_vec, &tic80coff_vec, + &vaxbsd_vec, &vaxnetbsd_vec, + &vax1knetbsd_vec, &versados_vec, #ifdef BFD64 &vms_alpha_vec, diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 4391da1..19dcb87 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -242,7 +242,7 @@ tekhex_init () static boolean inited = false; int val; - if (inited == false) + if (! inited) { inited = true; hex_init (); @@ -354,17 +354,13 @@ find_chunk (abfd, vma) } if (!d) { - char *sname = bfd_alloc (abfd, (bfd_size_type) 12); - /* No chunk for this address, so make one up */ d = ((struct data_struct *) - bfd_alloc (abfd, (bfd_size_type) sizeof (struct data_struct))); + bfd_zalloc (abfd, (bfd_size_type) sizeof (struct data_struct))); - if (!sname || !d) + if (!d) return NULL; - memset (d->chunk_init, 0, CHUNK_MASK + 1); - memset (d->chunk_data, 0, CHUNK_MASK + 1); d->next = abfd->tdata.tekhex_data->data; d->vma = vma; abfd->tdata.tekhex_data->data = d; @@ -489,7 +485,7 @@ pass_over (abfd, func) /* To the front of the file */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) abort (); - while (eof == false) + while (! eof) { char buffer[MAXCHUNK]; char *src = buffer; @@ -681,7 +677,7 @@ tekhex_set_section_contents (abfd, section, locationp, offset, bytes_to_do) bfd_size_type bytes_to_do; { - if (abfd->output_has_begun == false) + if (! abfd->output_has_begun) { /* The first time around, allocate enough sections to hold all the chunks */ asection *s = abfd->sections; @@ -1005,6 +1001,7 @@ tekhex_print_symbol (abfd, filep, symbol, how) #define tekhex_bfd_relax_section bfd_generic_relax_section #define tekhex_bfd_gc_sections bfd_generic_gc_sections #define tekhex_bfd_merge_sections bfd_generic_merge_sections +#define tekhex_bfd_discard_group bfd_generic_discard_group #define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define tekhex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/vaxbsd.c b/bfd/vaxbsd.c new file mode 100644 index 0000000..5faedbe --- /dev/null +++ b/bfd/vaxbsd.c @@ -0,0 +1,39 @@ +/* BFD back-end for BSD and Ultrix/VAX (1K page size) a.out-ish binaries. + Copyright 2002 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define N_HEADER_IN_TEXT(x) 0 +#define BYTES_IN_WORD 4 +#define ENTRY_CAN_BE_ZERO +#define N_SHARED_LIB(x) 0 /* Avoids warning */ +#define TEXT_START_ADDR 0 +#define TARGET_PAGE_SIZE 1024 +#define SEGMENT_SIZE TARGET_PAGE_SIZE +#define DEFAULT_ARCH bfd_arch_vax + +/* Do not "beautify" the CONCAT* macro args. Traditional C will not remove whitespace added here, and thus will fail to concatenate the tokens. */ +#define MY(OP) CONCAT2 (vaxbsd_,OP) + +#define TARGETNAME "a.out-vax-bsd" + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "libaout.h" + +#include "aout-target.h" diff --git a/bfd/vaxnetbsd.c b/bfd/vaxnetbsd.c index 21a0b37..48a1ed6 100644 --- a/bfd/vaxnetbsd.c +++ b/bfd/vaxnetbsd.c @@ -1,5 +1,5 @@ -/* BFD back-end for NetBSD/VAX a.out-ish binaries. - Copyright 1998, 2000, 2001 Free Software Foundation, Inc. +/* BFD back-end for NetBSD/VAX (4K page size) a.out-ish binaries. + Copyright 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -20,11 +20,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define BYTES_IN_WORD 4 #undef TARGET_IS_BIG_ENDIAN_P -#define TARGET_PAGE_SIZE 1024 +#define TARGET_PAGE_SIZE 0x1000 #define SEGMENT_SIZE TARGET_PAGE_SIZE #define DEFAULT_ARCH bfd_arch_vax -#define DEFAULT_MID M_VAX_NETBSD +#define DEFAULT_MID M_VAX4K_NETBSD /* Do not "beautify" the CONCAT* macro args. Traditional C will not remove whitespace added here, and thus will fail to concatenate diff --git a/bfd/versados.c b/bfd/versados.c index e1cd9f7..684c3db 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -612,6 +612,7 @@ versados_object_p (abfd) { struct ext_vheader ext; unsigned char len; + tdata_type *tdata_save; if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return NULL; @@ -642,9 +643,12 @@ versados_object_p (abfd) /* OK, looks like a record, build the tdata and read in. */ - if (!versados_mkobject (abfd) - || !versados_scan (abfd)) - return NULL; + tdata_save = abfd->tdata.versados_data; + if (!versados_mkobject (abfd) || !versados_scan (abfd)) + { + abfd->tdata.versados_data = tdata_save; + return NULL; + } return abfd->xvec; } @@ -867,6 +871,7 @@ versados_canonicalize_reloc (abfd, section, relptr, symbols) #define versados_bfd_relax_section bfd_generic_relax_section #define versados_bfd_gc_sections bfd_generic_gc_sections #define versados_bfd_merge_sections bfd_generic_merge_sections +#define versados_bfd_discard_group bfd_generic_discard_group #define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define versados_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols diff --git a/bfd/version.h b/bfd/version.h index d6adfac..da65221 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1 +1 @@ -#define BFD_VERSION_DATE 20020528 +#define BFD_VERSION_DATE 20020824 diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c index d9dcd78..0024122 100644 --- a/bfd/vms-gsd.c +++ b/bfd/vms-gsd.c @@ -426,13 +426,12 @@ _bfd_vms_slurp_gsd (abfd, objtype) else { section->contents = ((unsigned char *) - bfd_malloc (section->_raw_size)); + bfd_zmalloc (section->_raw_size)); if (section->contents == NULL) { bfd_set_error (bfd_error_no_memory); return -1; } - memset (section->contents, 0, (size_t) section->_raw_size); } section->_cooked_size = section->_raw_size; #if VMS_DEBUG @@ -618,10 +617,9 @@ _bfd_vms_slurp_gsd (abfd, objtype) section->vma = (bfd_vma)base_addr; base_addr += section->_raw_size; section->contents = ((unsigned char *) - bfd_malloc (section->_raw_size)); + bfd_zmalloc (section->_raw_size)); if (section->contents == NULL) return -1; - memset (section->contents, 0, (size_t) section->_raw_size); section->_cooked_size = section->_raw_size; #if VMS_DEBUG vms_debug(4, "egsd psc %d (%s, flags %04x=%s) ", diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c index b871a5d..3b043b4 100644 --- a/bfd/vms-misc.c +++ b/bfd/vms-misc.c @@ -292,23 +292,23 @@ _bfd_vms_get_record (abfd) if (PRIV (buf_size) == 0) { + bfd_size_type amt; + if (PRIV (is_vax)) { - PRIV (vms_buf) = (unsigned char *) malloc (OBJ_S_C_MAXRECSIZ); - PRIV (buf_size) = OBJ_S_C_MAXRECSIZ; + amt = OBJ_S_C_MAXRECSIZ; PRIV (file_format) = FF_VAX; } else - PRIV (vms_buf) = (unsigned char *) malloc (6); + amt = 6; + PRIV (vms_buf) = (unsigned char *) bfd_malloc (amt); + PRIV (buf_size) = amt; } vms_buf = PRIV (vms_buf); if (vms_buf == 0) - { - bfd_set_error (bfd_error_no_memory); - return -1; - } + return -1; switch (PRIV (file_format)) { @@ -371,7 +371,7 @@ _bfd_vms_get_record (abfd) if (PRIV (is_vax)) { PRIV (rec_length) = bfd_bread (vms_buf, (bfd_size_type) PRIV (buf_size), - abfd); + abfd); if (PRIV (rec_length) <= 0) { bfd_set_error (bfd_error_file_truncated); @@ -383,7 +383,7 @@ _bfd_vms_get_record (abfd) { /* extract vms record length */ - _bfd_vms_get_header_values (abfd, vms_buf+test_start, NULL, + _bfd_vms_get_header_values (abfd, vms_buf + test_start, NULL, &PRIV (rec_length)); if (PRIV (rec_length) <= 0) @@ -405,13 +405,11 @@ _bfd_vms_get_record (abfd) if (PRIV (rec_length) > PRIV (buf_size)) { PRIV (vms_buf) = ((unsigned char *) - realloc (vms_buf, (size_t) PRIV (rec_length))); + bfd_realloc (vms_buf, + (bfd_size_type) PRIV (rec_length))); vms_buf = PRIV (vms_buf); if (vms_buf == 0) - { - bfd_set_error (bfd_error_no_memory); - return -1; - } + return -1; PRIV (buf_size) = PRIV (rec_length); } @@ -593,7 +591,8 @@ add_new_contents (abfd, section) if (sptr != NULL) return sptr; - newptr = (vms_section *) bfd_malloc ((bfd_size_type) sizeof (vms_section)); + newptr = (vms_section *) bfd_alloc (abfd, + (bfd_size_type) sizeof (vms_section)); if (newptr == (vms_section *) NULL) return NULL; newptr->contents = (unsigned char *) bfd_alloc (abfd, section->_raw_size); @@ -133,6 +133,7 @@ static boolean vms_bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define vms_make_empty_symbol _bfd_generic_make_empty_symbol #define vms_bfd_link_just_syms _bfd_generic_link_just_syms +#define vms_bfd_discard_group bfd_generic_discard_group /*===========================================================================*/ @@ -237,13 +238,10 @@ vms_initialize (abfd) int i; bfd_size_type amt; - if (abfd->tdata.any != 0) - return true; - bfd_set_start_address (abfd, (bfd_vma) -1); amt = sizeof (struct vms_private_data_struct); - abfd->tdata.any = (struct vms_private_data_struct*) bfd_malloc (amt); + abfd->tdata.any = (struct vms_private_data_struct*) bfd_alloc (abfd, amt); if (abfd->tdata.any == 0) return false; @@ -260,49 +258,32 @@ vms_initialize (abfd) PRIV (sections) = NULL; amt = sizeof (struct stack_struct) * STACKSIZE; - PRIV (stack) = (struct stack_struct *) bfd_malloc (amt); + PRIV (stack) = (struct stack_struct *) bfd_alloc (abfd, amt); if (PRIV (stack) == 0) - { - vms_init_no_mem1: - free (abfd->tdata.any); - abfd->tdata.any = 0; - return false; - } + goto error_ret1; PRIV (stackptr) = 0; amt = sizeof (struct bfd_hash_table); - PRIV (vms_symbol_table) = (struct bfd_hash_table *) bfd_malloc (amt); + PRIV (vms_symbol_table) = (struct bfd_hash_table *) bfd_alloc (abfd, amt); if (PRIV (vms_symbol_table) == 0) - { - vms_init_no_mem2: - free (PRIV (stack)); - PRIV (stack) = 0; - goto vms_init_no_mem1; - } + goto error_ret1; if (!bfd_hash_table_init (PRIV (vms_symbol_table), _bfd_vms_hash_newfunc)) - return false; + goto error_ret1; amt = sizeof (struct location_struct) * LOCATION_SAVE_SIZE; - PRIV (location_stack) = (struct location_struct *) bfd_malloc (amt); + PRIV (location_stack) = (struct location_struct *) bfd_alloc (abfd, amt); if (PRIV (location_stack) == 0) - { - vms_init_no_mem3: - free (PRIV (vms_symbol_table)); - PRIV (vms_symbol_table) = 0; - goto vms_init_no_mem2; - } + goto error_ret2; for (i = 0; i < VMS_SECTION_COUNT; i++) PRIV (vms_section_table)[i] = NULL; - PRIV (output_buf) = (unsigned char *) malloc (MAX_OUTREC_SIZE); + amt = MAX_OUTREC_SIZE; + PRIV (output_buf) = (unsigned char *) bfd_alloc (abfd, amt); if (PRIV (output_buf) == 0) - { - free (PRIV (location_stack)); - PRIV (location_stack) = 0; - goto vms_init_no_mem3; - } + goto error_ret2; + PRIV (push_level) = 0; PRIV (pushed_size) = 0; PRIV (length_pos) = 2; @@ -310,6 +291,13 @@ vms_initialize (abfd) PRIV (output_alignment) = 1; return true; + + error_ret2: + bfd_hash_table_free (PRIV (vms_symbol_table)); + error_ret1: + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = 0; + return false; } /* Fill symbol->section with section ptr @@ -393,22 +381,17 @@ vms_object_p (abfd) int prev_type; const struct bfd_target *target_vector = 0; const bfd_arch_info_type *arch = 0; + PTR tdata_save = abfd->tdata.any; #if VMS_DEBUG vms_debug (1, "vms_object_p(%p)\n", abfd); #endif if (!vms_initialize (abfd)) - { - fprintf (stderr, "vms_initialize () failed !!\n"); - return 0; - } + goto error_ret; if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET)) - { - bfd_set_error (bfd_error_file_truncated); - return 0; - } + goto err_wrong_format; prev_type = -1; @@ -422,20 +405,18 @@ vms_object_p (abfd) #if VMS_DEBUG vms_debug (2, "next_record failed\n"); #endif - bfd_set_error (bfd_error_wrong_format); - return 0; + goto err_wrong_format; } if ((prev_type == EOBJ_S_C_EGSD) && (PRIV (rec_type) != EOBJ_S_C_EGSD)) { - if (vms_fixup_sections (abfd) == false) + if (! vms_fixup_sections (abfd)) { #if VMS_DEBUG vms_debug (2, "vms_fixup_sections failed\n"); #endif - bfd_set_error (bfd_error_wrong_format); - return 0; + goto err_wrong_format; } } @@ -487,21 +468,19 @@ vms_object_p (abfd) #if VMS_DEBUG vms_debug (2, "slurp type %d failed with %d\n", prev_type, err); #endif - bfd_set_error (bfd_error_wrong_format); - return 0; + goto err_wrong_format; } } while ((prev_type != EOBJ_S_C_EEOM) && (prev_type != OBJ_S_C_EOM) && (prev_type != OBJ_S_C_EOMW)); if (target_vector == &vms_vax_vec) { - if (vms_fixup_sections (abfd) == false) + if (! vms_fixup_sections (abfd)) { #if VMS_DEBUG vms_debug (2, "vms_fixup_sections failed\n"); #endif - bfd_set_error (bfd_error_wrong_format); - return 0; + goto err_wrong_format; } /* set arch_info to vax */ @@ -528,12 +507,19 @@ vms_object_p (abfd) #if VMS_DEBUG vms_debug (2, "arch not found\n"); #endif - bfd_set_error (bfd_error_wrong_format); - return 0; + goto err_wrong_format; } abfd->arch_info = arch; return target_vector; + + err_wrong_format: + bfd_set_error (bfd_error_wrong_format); + error_ret: + if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL) + bfd_release (abfd, abfd->tdata.any); + abfd->tdata.any = tdata_save; + return NULL; } /* Check the format for a file being read. @@ -561,10 +547,7 @@ vms_mkobject (abfd) #endif if (!vms_initialize (abfd)) - { - fprintf (stderr, "vms_initialize () failed !!\n"); - return 0; - } + return 0; { #ifdef __VAX @@ -645,10 +628,6 @@ static boolean vms_close_and_cleanup (abfd) bfd *abfd; { - asection *sec; - vms_section *es, *es1; - int i; - #if VMS_DEBUG vms_debug (1, "vms_close_and_cleanup(%p)\n", abfd); #endif @@ -656,63 +635,15 @@ vms_close_and_cleanup (abfd) return true; if (PRIV (vms_buf) != NULL) - { - free (PRIV (vms_buf)); - PRIV (vms_buf) = NULL; - } - PRIV (buf_size) = 0; - - if (PRIV (output_buf) != 0) - { - free (PRIV (output_buf)); - PRIV (output_buf) = 0; - } - - sec = abfd->sections; - while (sec != NULL) - { - if (sec->contents) - free (sec->contents); - sec = sec->next; - } + free (PRIV (vms_buf)); if (PRIV (sections) != NULL) - { - free (PRIV (sections)); - PRIV (sections) = NULL; - } + free (PRIV (sections)); if (PRIV (vms_symbol_table)) - { - bfd_hash_table_free (PRIV (vms_symbol_table)); - PRIV (vms_symbol_table) = 0; - } - - if (PRIV (stack)) - { - free (PRIV (stack)); - PRIV (stack) = 0; - } - - if (PRIV (location_stack)) - { - free (PRIV (location_stack)); - PRIV (location_stack) = 0; - } - - for (i = 0; i < VMS_SECTION_COUNT; i++) - { - es = PRIV (vms_section_table)[i]; - while (es != NULL) - { - es1 = es->next; - free (es); - es = es1; - } - PRIV (vms_section_table)[i] = NULL; - } + bfd_hash_table_free (PRIV (vms_symbol_table)); - free (abfd->tdata.any); + bfd_release (abfd, abfd->tdata.any); abfd->tdata.any = NULL; return true; diff --git a/bfd/xcoff-target.h b/bfd/xcoff-target.h index 0787b8d..413511b 100644 --- a/bfd/xcoff-target.h +++ b/bfd/xcoff-target.h @@ -1,5 +1,5 @@ /* Common definitions for backends based on IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001 + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -98,6 +98,7 @@ extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); #define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section #define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections #define _bfd_xcoff_bfd_merge_sections coff_bfd_merge_sections +#define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group #define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section /* XCOFF archives do not have anything which corresponds to an diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 9d66243..a869d7d 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -1086,21 +1086,19 @@ xcoff_link_add_symbols (abfd, info) /* We keep a list of the linker hash table entries that correspond to each external symbol. */ amt = symcount * sizeof (struct xcoff_link_hash_entry *); - sym_hash = (struct xcoff_link_hash_entry **) bfd_alloc (abfd, amt); + sym_hash = (struct xcoff_link_hash_entry **) bfd_zalloc (abfd, amt); if (sym_hash == NULL && symcount != 0) goto error_return; coff_data (abfd)->sym_hashes = (struct coff_link_hash_entry **) sym_hash; - memset (sym_hash, 0, (size_t) amt); /* Because of the weird stuff we are doing with XCOFF csects, we can not easily determine which section a symbol is in, so we store the information in the tdata for the input file. */ amt = symcount * sizeof (asection *); - csect_cache = (asection **) bfd_alloc (abfd, amt); + csect_cache = (asection **) bfd_zalloc (abfd, amt); if (csect_cache == NULL && symcount != 0) goto error_return; xcoff_data (abfd)->csects = csect_cache; - memset (csect_cache, 0, (size_t) amt); /* While splitting sections into csects, we need to assign the relocs correctly. The relocs and the csects must both be in @@ -1109,10 +1107,9 @@ xcoff_link_add_symbols (abfd, info) into reloc_info using the section target_index. */ amt = abfd->section_count + 1; amt *= sizeof (struct reloc_info_struct); - reloc_info = (struct reloc_info_struct *) bfd_malloc (amt); + reloc_info = (struct reloc_info_struct *) bfd_zmalloc (amt); if (reloc_info == NULL) goto error_return; - memset ((PTR) reloc_info, 0, (size_t) amt); /* Read in the relocs and line numbers for each section. */ linesz = bfd_coff_linesz (abfd); @@ -1129,11 +1126,9 @@ xcoff_link_add_symbols (abfd, info) false, (struct internal_reloc *) NULL); amt = o->reloc_count; amt *= sizeof (asection *); - reloc_info[o->target_index].csects = (asection **) bfd_malloc (amt); + reloc_info[o->target_index].csects = (asection **) bfd_zmalloc (amt); if (reloc_info[o->target_index].csects == NULL) goto error_return; - memset (reloc_info[o->target_index].csects, 0, (size_t) amt); - } if ((info->strip == strip_none || info->strip == strip_some) @@ -2883,7 +2878,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, } /* __rtinit */ - if (info->init_function || info->fini_function || rtld == true) + if (info->init_function || info->fini_function || rtld) { struct xcoff_link_hash_entry *hsym; struct internal_ldsym *ldsym; @@ -5892,7 +5887,10 @@ xcoff_write_global_symbol (h, inf) isym.n_value = (h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset + h->root.u.def.value); - isym.n_scnum = h->root.u.def.section->output_section->target_index; + if (bfd_is_abs_section (h->root.u.def.section->output_section)) + isym.n_scnum = N_ABS; + else + isym.n_scnum = h->root.u.def.section->output_section->target_index; isym.n_sclass = C_HIDEXT; aux.x_csect.x_smtyp = XTY_SD; |