summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2006-08-22 15:08:47 +0000
committerJoseph Myers <jsm@polyomino.org.uk>2006-08-22 15:08:47 +0000
commit150ddb4e15daf7b71cc7f30cbad13dfff6cd6d76 (patch)
tree2270c98b8ad371d2e747aa35fc18d76e2b13ae02 /bfd
parentdd18ff9757a447d2ba98b72021af4533058b0d83 (diff)
downloadgdb-150ddb4e15daf7b71cc7f30cbad13dfff6cd6d76.tar.gz
Merge changes between binutils-csl-2_17-branchpoint and
binutils-2_17, except for the addition of generated files to CVS.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog605
-rw-r--r--bfd/Makefile.am10
-rw-r--r--bfd/Makefile.in10
-rw-r--r--bfd/aoutf1.h28
-rw-r--r--bfd/bfd-in2.h26
-rw-r--r--bfd/coff-rs6000.c4
-rw-r--r--bfd/config.bfd17
-rwxr-xr-xbfd/configure60
-rw-r--r--bfd/configure.in36
-rw-r--r--bfd/doc/ChangeLog10
-rw-r--r--bfd/doc/bfd.texinfo14
-rw-r--r--bfd/elf-eh-frame.c51
-rw-r--r--bfd/elf32-bfin.c4420
-rw-r--r--bfd/elf32-i386.c39
-rw-r--r--bfd/elf32-m32c.c16
-rw-r--r--bfd/elf32-mips.c149
-rw-r--r--bfd/elf32-ppc.c4
-rw-r--r--bfd/elf32-sparc.c66
-rw-r--r--bfd/elf32-xtensa.c43
-rw-r--r--bfd/elf64-hppa.c66
-rw-r--r--bfd/elf64-ppc.c96
-rw-r--r--bfd/elf64-x86-64.c119
-rw-r--r--bfd/elfcode.h49
-rw-r--r--bfd/elflink.c87
-rw-r--r--bfd/elfxx-ia64.c649
-rw-r--r--bfd/elfxx-mips.c1689
-rw-r--r--bfd/elfxx-mips.h7
-rw-r--r--bfd/elfxx-sparc.c440
-rw-r--r--bfd/elfxx-sparc.h11
-rw-r--r--bfd/libbfd.h22
-rw-r--r--bfd/po/Make-in4
-rw-r--r--bfd/po/SRC-POTFILES.in2
-rw-r--r--bfd/po/es.po1565
-rw-r--r--bfd/reloc.c48
-rw-r--r--bfd/targets.c8
-rw-r--r--bfd/tekhex.c82
-rw-r--r--bfd/version.h2
37 files changed, 8371 insertions, 2183 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 521fcb9c05b..f2f9990819f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,608 @@
+2006-06-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * configure.in: Update version to 2.17.
+ * Makefile.am: Set RELEASE.
+ * configure, Makefile.in: Regenerated.
+
+2006-06-12 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * configure.in: Update version to 2.16.94.
+ * configure: Regenerated.
+
+2006-06-11 Richard Sandiford <richard@codesourcery.com>
+ Thiemo Seufer <ths@mips.com>
+
+ * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size.
+ (STUB_ORI): New macro.
+ (STUB_LI16U): Fix formatting.
+ (MIPS_FUNCTION_STUB_SIZE): Delete.
+ (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise.
+ (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro.
+ (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
+ (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size
+ instead of MIPS_FUNCTION_STUB_SIZE.
+ (count_section_dynsyms): New function, split out from
+ _bfd_mips_elf_final_link.
+ (_bfd_mips_elf_always_size_sections): Get a worst-case estimate
+ of the number of dynamic symbols needed and use it to set up
+ function_stub_size. Use function_stub_size rather than
+ MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section.
+ Use 16-byte stubs for 0x10000 dynamic symbols.
+ (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size
+ instead of MIPS_FUNCTION_STUB_SIZE. Fix formatting.
+ (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Change the
+ size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to
+ MIPS_FUNCTION_STUB_BIG_SIZE. Tweak the check for unhandled dynindxes.
+ Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20.
+ Use STUB_ORI rather than STUB_LI16U for big stubs.
+ (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size.
+ (_bfd_mips_elf_final_link): Use count_section_dynsyms.
+
+2006-06-08 David Daney <ddaney@avtrex.com>
+
+ * elfxx-mips.c (STUB_LI16): Removed.
+ (STUB_LUI): New macro.
+ (STUB_LI16U): Ditto.
+ (STUB_LI16S): Ditto.
+ (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter.
+ (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to
+ MIPS_FUNCTION_STUB_SIZE.
+ (_bfd_mips_elf_always_size_sections): Ditto.
+ (_bfd_mips_elf_size_dynamic_sections): Ditto.
+ (_bfd_mips_elf_finish_dynamic_sections): Ditto.
+ (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation
+ to allow larger symbol table indexes.
+
+2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
+
+ * po/Make-in (pdf, ps): New dummy targets.
+
+2006-06-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ Backport:
+ 2006-05-23 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/2655
+ PR ld/2657
+ * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly
+ update CIE/FDE length. Don't pad to the section alignment.
+
+2006-05-30 Nick Clifton <nickc@redhat.com>
+
+ * po/es.po: Updated Spanish translation.
+
+2006-05-23 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (compare_symbols): Prefer strong dynamic global
+ function syms over other syms.
+
+2006-05-22 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL
+ check.
+ (bfd_elf_final_link): Add a late DT_TEXTREL check.
+ * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define.
+ (mips_elf_create_dynamic_relocation): Set DF_TEXTREL.
+ (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION.
+ Use MIPS_ELF_READONLY_SECTION.
+ (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after
+ creating DT_TEXTREL.
+ (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers
+ if no text relocations were generated.
+
+2006-05-17 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * configure.in: Update version to 2.16.93.
+ * configure: Regenerated.
+
+2006-05-17 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (elf_gc_sweep): Don't specially keep non-alloc,
+ non-load sections if they have relocs.
+
+2006-05-16 Andreas Schwab <schwab@suse.de>
+
+ * aoutf1.h (struct external_sparc_core): Declare c_regs as struct
+ regs instead of an array of int.
+ (struct external_solaris_bcp_core): Likewise.
+ (swapcore_sun3): Use offsetof instead of computing the offset
+ manually.
+ (swapcore_sparc): Likewise. Simplify reference to c_regs.
+ (swapcore_solaris_bcp): Likewise.
+
+2006-05-15 Alan Modra <amodra@bigpond.net.au>
+
+ PR 2658
+ * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
+ -shared link.
+
+2006-05-11 Michael Matz <matz@suse.de>
+
+ * elflink.c (match_group_member): Correctly iterate group
+ members.
+
+2006-05-11 Nick Clifton <nickc@redhat.com>
+
+ PR ld/2607
+ * elfcode.h (valid_section_index_p): New function: Checks for a
+ valid section index. Allows indicies in the range SHN_LOPROC to
+ SHN_HIOS.
+ (elf_object_p): Use valid_section_index_p.
+
+2006-05-11 Nick Clifton <nickc@redhat.com>
+
+ PR ld/2257
+ * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx
+ fields to still be handled as ELF files.
+
+2006-05-10 Alan Modra <amodra@bigpond.net.au>
+
+ PR 2342
+ * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16.
+
+2006-05-10 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize
+ R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in
+ the .toc and referenced by a TLS code sequence.
+ (ppc64_elf_edit_toc): Cater for the unlikely situation that
+ .toc is the first section in a file.
+
+2006-05-03 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ PR binutils/2584
+ * tekhex.c (getvalue): Change return type to bfd_boolean and
+ add the new parameter. Return false if the unexpected character
+ is found.
+ (getsym): Likewise.
+ (first_phase): Change return type to bfd_boolean and return
+ false if the unexpected character is found. Replace abort
+ with returning false.
+ (pass_over): Change return type to bfd_boolean and the type of
+ the second argument to bfd_boolean (*) (bfd *, int, char *).
+ Return false if FUNC returns false.
+ (tekhex_object_p): Return NULL if pass_over fails.
+
+2006-05-02 Paul Brook <paul@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit
+ for R_ARM_REL32.
+
+2006-04-27 Alan Modra <amodra@bigpond.net.au>
+
+ * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix.
+
+2006-04-16 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * configure.in: Update version to 2.16.92.
+ * configure: Regenerated.
+
+2006-04-16 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * po/SRC-POTFILES.in: Regenerated.
+
+2006-04-14 David Heine <dlheine@tensilica.com>
+
+ * elf32-xtensa.c (build_reloc_opcodes): New.
+ (compute_text_actions): Use it to decode opcodes outside inner loop.
+ (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if
+ it is set, use it to get the opcodes for relocations.
+ (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit.
+
+2006-04-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/2513
+ * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type.
+ (GOT_TLS_IE_IE): Likewise.
+ (GOT_TLS_IE_GD): Likewise.
+ (GOT_TLS_IE_MASK): Likewise.
+ (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD
+ and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE
+ respectively.
+ (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD
+ are set, treat tls_type as GOT_TLS_IE_BOTH.
+ (elf_i386_relocate_section): Likewise.
+
+2006-04-07 Randolph Chung <tausq@debian.org>
+
+ * elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
+ (elf64_hppa_grok_psinfo): Likewise.
+ (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
+
+2006-04-06 DJ Delorie <dj@redhat.com>
+
+ * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
+ each plt entry we create.
+
+2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
+
+ * po/Make-in: Add install-html target.
+ * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir
+ htmldir. Add install-html and install-html-recursive targets.
+ * Makefile.in: Regenerate.
+ * configure.in: AC_SUBST for datarootdir, docdir and htmldir.
+ * configure: Regenerate.
+
+2006-04-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes
+ with the skip_relax_pass_0 and skip_relax_pass_1 bits in the
+ section structure.
+
+2006-04-05 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to
+ eliminate warnings.
+
+2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
+ James E Wilson <wilson@specifixinc.com>
+
+ PR ld/2442
+ * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next.
+ (elfNN_ia64_local_hash_entry): Add count, sorted_count and
+ size.
+ (elfNN_ia64_link_hash_entry): Likewise.
+ (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count
+ and size.
+ (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info
+ processing.
+ (elfNN_ia64_hash_hide_symbol): Likewise.
+ (elfNN_ia64_global_dyn_sym_thunk): Likewise.
+ (elfNN_ia64_local_dyn_sym_thunk): Likewise.
+ (elfNN_ia64_global_dyn_info_free): New function.
+ (elfNN_ia64_local_dyn_info_free): Likewise.
+ (elfNN_ia64_hash_table_free): Free local and global
+ elfNN_ia64_dyn_sym_info.
+ (addend_compare): New function.
+ (sort_dyn_sym_info): Likewise.
+ (get_dyn_sym_info): Updated to use binary search for addend.
+ (elfNN_ia64_check_relocs): Scan relocations to create dynamic
+ relocation arrays first.
+
+2006-04-05 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp
+ symbol.
+
+2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/2411
+ * elflink.c (check_dynsym): New.
+ (elf_link_output_extsym): Use it.
+ (bfd_elf_final_link): Likewise.
+
+2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/2404
+ * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
+ symbol from the dynamic definition with the default version if
+ its type and the type of existing regular definition mismatch.
+
+2006-04-05 Richard Sandiford <richard@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config.bfd (sparc-*-vxworks*): New stanza.
+ * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza.
+ (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo.
+ * configure: Regenerate.
+ * elf32-sparc.c: Include elf-vxworks.h.
+ (elf32_sparc_vxworks_link_hash_table_create: New.
+ (elf32_sparc_vxworks_final_write_processing): New.
+ (TARGET_BIG_SYM): Override for VxWorks.
+ (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise.
+ (bfd_elf32_bfd_link_hash_table_create): Likewise.
+ (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise.
+ (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise.
+ (elf_backend_link_output_symbol_hook): Likewise.
+ (elf_backend_emit_relocs): Likewise.
+ (elf_backend_final_write_processing, elf32_bed): Likewise.
+ * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h.
+ (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New.
+ (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New.
+ (_bfd_sparc_elf_link_hash_table_create): Don't initialize
+ build_plt_entry here.
+ (create_got_section): Initialize sgotplt for VxWorks.
+ (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry,
+ plt_header_size and plt_entry_size, with new VxWorks-specific settings.
+ Call elf_vxworks_create_dynamic_sections for VxWorks.
+ (allocate_dynrelocs): Use plt_header_size and plt_entry_size.
+ Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks.
+ (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt
+ for VxWorks. Check for the .got.plt section.
+ (sparc_vxworks_build_plt_entry): New function.
+ (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs.
+ Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_
+ absolute on VxWorks.
+ (sparc32_finish_dyn): Add special handling for DT_RELASZ
+ and DT_PLTGOT on VxWorks.
+ (sparc_vxworks_finish_exec_plt): New.
+ (sparc_vxworks_finish_shared_plt): New.
+ (_bfd_sparc_elf_finish_dynamic_sections): Call them.
+ Use plt_header_size and plt_entry_size.
+ * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks,
+ srelplt2, sgotplt, plt_header_size and plt_entry_size fields.
+ * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h.
+ (elf32-sparc.lo): Likewise.
+ * Makefile.in: Regenerate.
+ * targets.c (bfd_elf32_sparc_vxworks_vec): Declare.
+ (_bfd_target_vector): Add a pointer to it.
+
+2006-03-30 Ben Elliston <bje@au.ibm.com>
+
+ PR ld/2267
+ * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
+ special section number that exceeds the number of ELF sections
+ (eg. SHN_MIPS_SCOMMON).
+
+2006-03-27 Richard Sandiford <richard@codesourcery.com>
+
+ * elfxx-mips.c (mips_got_entry): Add more commentary.
+ (mips_elf_local_got_index): Use the hash table entry to record
+ the GOT index of forced-local symbols.
+ (mips_elf_initialize_tls_index): Rearrange code. Store the index
+ in either the hash table entry or the mips_got_entry, not both.
+ Add more commentary.
+ (mips_elf_multi_got): Make sure the g->next is nonnull when calling
+ mips_elf_initialize_tls_index.
+
+2006-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
+ RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty,
+ reloc_stack_push, reloc_stack_pop, reloc_stack_operate,
+ bfin_areloc_howto_table): Delete. All
+ uses deleted as well.
+ (bfin_reloc_map): Delete all stack relocs.
+ (bfin_info_to_howto, bfin_bfd_reloc_type_lookup,
+ bfin_reloc_type_lookup): Don't support them.
+ (bfin_relocate_section): Don't try to handle them.
+
+ * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec.
+ * configure.in: Likewise.
+ * configure: Regenerate.
+ * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h".
+ (BFIN_RELOC_MAX): Now 0x21.
+ (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs.
+ (bfd_elf32_bfinfdpic_vec): Declare.
+ (IS_FDPIC): New macro.
+ (struct bfinfdpic_elf_link_hash_table): New struct.
+ (bfinfdpic_hash_table, bfinfdpic_got_section,
+ bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section,
+ bfinfdpic_plt_setion, bfinfdpic_pltrel_section,
+ bfinfdpic_relocs_info, bfinfdpic_got_initial_offset,
+ bfinfdpic_plt_initial_offset): Accessor macros for it.
+ (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros.
+ (struct bfinfdpic_relocs_info): New struct.
+ (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES,
+ BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC,
+ DEFAULT_STACK_SIZE): New macros.
+ (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash,
+ bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find,
+ bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local,
+ bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc,
+ _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment,
+ _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section,
+ bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook,
+ _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section,
+ elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry,
+ _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry,
+ _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries,
+ _bfinfdpic_resolve_final_relocs_info,
+ elf32_bfinfdpic_size_dynamic_sections,
+ elf32_bfinfdpic_always_size_sections,
+ elf32_bfinfdpic_modify_segment_map,
+ _bfinfdpic_count_got_plt_entries,
+ elf32_bfinfdpic_finish_dynamic_sections,
+ elf32_bfinfdpic_adjust_dynamic_symbol,
+ elf32_bfinfdpic_finish_dynamic_symbol,
+ elf32_bfinfdpic_elf_use_relative_eh_frame,
+ elf32_bfinfdpic_elf_encode_eh_address,
+ elf32_bfin_object_p, bfin_elf_copy_private_bfd_data,
+ elf32_bfinfdpic_copy_private_bfd_data,
+ (struct _bfinfdpic_dynamic_got_info,
+ struct _bfinfdpic_dynamic_got_plt_info): New structs.
+ (elf32_bfin_print_private_bfd_data): Print PIC flags.
+ (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC.
+ (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed,
+ elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create,
+ elf_backend_always_size_sectinos, elf_backend_modify_segment_map,
+ bfd_elf32_bfd_copy_private_bfd_data,
+ elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
+ elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol,
+ elf_backend_finish_dynamic_sections, elf_backend_relocate_section,
+ elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs,
+ elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p,
+ elf_backend_may_use_rela_p, elf_backend_default_use_rela_p,
+ elf_backend_omit_section_dynsym): Redefine these macros and include
+ "elf32-target.h" again to create the elf32-bfinfdpic target.
+ * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI,
+ BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC,
+ BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI,
+ BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE,
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI,
+ BFD_RELOC_BFIN_GOTOFFLO): New.
+ * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target.
+ (_bfd_target_vector): Add it.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+2006-03-25 Richard Sandiford <richard@codesourcery.com>
+
+ * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as
+ incompatible. Likewise MAC and EMAC code.
+ * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use
+ bfd_get_compatible to set the new bfd architecture. Rely on it
+ to detect incompatibilities.
+
+2006-03-22 Bob Wilson <bob.wilson@acm.org>
+
+ * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that
+ rel->r_addend is zero.
+
+2006-03-22 Richard Sandiford <richard@codesourcery.com>
+
+ * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type
+ of "loc".
+
+2006-03-22 Richard Sandiford <richard@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+ Phil Edwards <phil@codesourcery.com>
+ Zack Weinberg <zack@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * bfd-in2.h: Regenerate.
+ * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas.
+ * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza.
+ (bfd_elf32_littlemips_vxworks_vec): Likewise.
+ (bfd_elf32_bigmips_vec): Add elf-vxworks.lo.
+ (bfd_elf32_littlemips_vec): Likewise.
+ (bfd_elf32_nbigmips_vec): Likewise.
+ (bfd_elf32_nlittlemips_vec): Likewise.
+ (bfd_elf32_ntradbigmips_vec): Likewise.
+ (bfd_elf32_ntradlittlemips_vec): Likewise.
+ (bfd_elf32_tradbigmips_vec): Likewise.
+ (bfd_elf32_tradlittlemips_vec): Likewise.
+ (bfd_elf64_bigmips_vec): Likewise.
+ (bfd_elf64_littlemips_vec): Likewise.
+ (bfd_elf64_tradbigmips_vec): Likewise.
+ (bfd_elf64_tradlittlemips_vec): Likewise.
+ * elf32-mips.c: Include elf-vxworks.h.
+ (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto
+ instead of calling mips_elf32_rtype_to_howto directly.
+ (mips_vxworks_copy_howto_rela): New reloc howto.
+ (mips_vxworks_jump_slot_howto_rela): Likewise.
+ (mips_vxworks_bfd_reloc_type_lookup): New function.
+ (mips_vxworks_rtype_to_howto): Likewise.
+ (mips_vxworks_final_write_processing): Likewise.
+ (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks.
+ (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise.
+ (elf_backend_want_got_plt): Likewise.
+ (elf_backend_want_plt_sym): Likewise.
+ (elf_backend_got_symbol_offset): Likewise.
+ (elf_backend_want_dynbss): Likewise.
+ (elf_backend_may_use_rel_p): Likewise.
+ (elf_backend_may_use_rela_p): Likewise.
+ (elf_backend_default_use_rela_p): Likewise.
+ (elf_backend_got_header_size: Likewise.
+ (elf_backend_plt_readonly): Likewise.
+ (bfd_elf32_bfd_reloc_type_lookup): Likewise.
+ (elf_backend_mips_rtype_to_howto): Likewise.
+ (elf_backend_adjust_dynamic_symbol): Likewise.
+ (elf_backend_finish_dynamic_symbol): Likewise.
+ (bfd_elf32_bfd_link_hash_table_create): Likewise.
+ (elf_backend_add_symbol_hook): Likewise.
+ (elf_backend_link_output_symbol_hook): Likewise.
+ (elf_backend_emit_relocs): Likewise.
+ (elf_backend_final_write_processing: Likewise.
+ (elf_backend_additional_program_headers): Likewise.
+ (elf_backend_modify_segment_map): Likewise.
+ (elf_backend_symbol_processing): Likewise.
+ * elfxx-mips.c: Include elf-vxworks.h.
+ (mips_elf_link_hash_entry): Add is_relocation_target and
+ is_branch_target fields.
+ (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt,
+ srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields.
+ (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros.
+ (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument.
+ Return 3 for VxWorks.
+ (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a
+ mips_elf_link_hash_table. Return 0 for VxWorks.
+ (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a
+ mips_elf_link_hash_table. Update the call to ELF_MIPS_GP_OFFSET.
+ (mips_vxworks_exec_plt0_entry): New variable.
+ (mips_vxworks_exec_plt_entry): Likewise.
+ (mips_vxworks_shared_plt0_entry): Likewise.
+ (mips_vxworks_shared_plt_entry): Likewise.
+ (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields.
+ (mips_elf_rel_dyn_section): Change the bfd argument to a
+ mips_elf_link_hash_table. Use MIPS_ELF_REL_DYN_NAME to get
+ the name of the section.
+ (mips_elf_initialize_tls_slots): Update the call to
+ mips_elf_rel_dyn_section.
+ (mips_elf_gotplt_index): New function.
+ (mips_elf_local_got_index): Add an input_section argument.
+ Update the call to mips_elf_create_local_got_entry.
+ (mips_elf_got_page): Likewise.
+ (mips_elf_got16_entry): Likewise.
+ (mips_elf_create_local_got_entry): Add bfd_link_info and input_section
+ arguments. Create dynamic relocations for each entry on VxWorks.
+ (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE.
+ (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE
+ and MIPS_RESERVED_GOTNO.
+ (mips_elf_create_got_section): Update the uses of
+ MIPS_ELF_GOT_MAX_SIZE. Create .got.plt on VxWorks.
+ (is_gott_symbol): New function.
+ (mips_elf_calculate_relocation): Use a dynobj local variable.
+ Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and
+ mips_elf_got_page_entry. Set G to the .got.plt entry when calculating
+ VxWorks R_MIPS_CALL* relocations. Calculate and use G for all GOT
+ relocations on VxWorks. Add dynamic relocations for references
+ to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Don't
+ create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64
+ in VxWorks executables.
+ (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument.
+ Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry.
+ Don't allocate a null entry on VxWorks.
+ (mips_elf_create_dynamic_relocation): Update the call to
+ mips_elf_rel_dyn_section. Use absolute rather than relative
+ relocations for VxWorks, and make them RELA rather than REL.
+ (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic
+ read-only on VxWorks. Update the call to mips_elf_rel_dyn_section.
+ Create the .plt, .rela.plt, .dynbss and .rela.bss sections on
+ VxWorks. Likewise create the _PROCEDURE_LINKAGE_TABLE symbol.
+ Call elf_vxworks_create_dynamic_sections for VxWorks and
+ initialize the plt_header_size and plt_entry_size fields.
+ (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be
+ used in VxWorks executables. Don't allocate dynamic relocations
+ for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables.
+ Set is_relocation_target for each symbol referenced by a relocation.
+ Allocate .rela.dyn entries for relocations against the special
+ VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols. Create GOT
+ entries for all VxWorks R_MIPS_GOT16 relocations. Don't allocate
+ a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*,
+ R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations. Update the calls
+ to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations.
+ Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26
+ relocations. Don't set no_fn_stub on VxWorks.
+ (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to
+ mips_elf_allocate_dynamic_relocations.
+ (_bfd_mips_vxworks_adjust_dynamic_symbol): New function.
+ (_bfd_mips_elf_always_size_sections): Do not allocate GOT page
+ entries for VxWorks, and do not create multiple GOTs.
+ (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME.
+ Handle .got specially for VxWorks. Update the uses of
+ MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations.
+ Check for sgotplt and splt. Allocate the .rel(a).dyn contents last,
+ once its final size is known. Set DF_TEXTREL for VxWorks. Add
+ DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL
+ tags on VxWorks. Do not add the MIPS-specific tags for VxWorks.
+ (_bfd_mips_vxworks_finish_dynamic_symbol): New function.
+ (mips_vxworks_finish_exec_plt): Likewise.
+ (mips_vxworks_finish_shared_plt): Likewise.
+ (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call
+ to mips_elf_rel_dyn_section. Use a VxWorks-specific value of
+ DT_PLTGOT. Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL,
+ DT_PLTRELSZ and DT_JMPREL. Update the uses of MIPS_RESERVED_GOTNO
+ and mips_elf_rel_dyn_section. Use a different GOT header for
+ VxWorks. Don't sort .rela.dyn on VxWorks. Finish the PLT on VxWorks.
+ (_bfd_mips_elf_link_hash_table_create): Initialize the new
+ mips_elf_link_hash_table fields.
+ (_bfd_mips_vxworks_link_hash_table_create): New function.
+ (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_
+ on VxWorks. Update the call to ELF_MIPS_GP_OFFSET.
+ * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare.
+ (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
+ (_bfd_mips_vxworks_link_hash_table_create): Likewise.
+ * libbfd.h: Regenerate.
+ * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h.
+ (elf32-mips.lo): Likewise.
+ * Makefile.in: Regenerate.
+ * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare.
+ * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare.
+ (bfd_elf32_littlemips_vxworks_vec): Likewise.
+ (_bfd_target_vector): Add entries for them.
+
2006-03-19 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index e4538ed5744..9fc84d069c6 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -3,7 +3,7 @@
AUTOMAKE_OPTIONS = 1.9 cygnus
# Uncomment the following line when doing a release.
-# RELEASE=y
+RELEASE=y
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
@@ -1386,14 +1386,14 @@ elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
+ $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h
elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.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 $(INCDIR)/coff/external.h \
- ecoffswap.h elf32-target.h
+ ecoffswap.h elf32-target.h elf-vxworks.h
elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
@@ -1452,12 +1452,12 @@ elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
- elfxx-sparc.h
+ elfxx-sparc.h elf-vxworks.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
- elfxx-sparc.h elf32-target.h
+ elfxx-sparc.h elf32-target.h elf-vxworks.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index fdd766daf72..5bbf294be9f 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -254,7 +254,7 @@ wordsize = @wordsize@
AUTOMAKE_OPTIONS = 1.9 cygnus
# Uncomment the following line when doing a release.
-# RELEASE=y
+RELEASE=y
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
MKDEP = gcc -MM
@@ -1952,14 +1952,14 @@ elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elfxx-mips.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h
+ $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h elf-vxworks.h
elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
$(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.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 $(INCDIR)/coff/external.h \
- ecoffswap.h elf32-target.h
+ ecoffswap.h elf32-target.h elf-vxworks.h
elf32-mt.lo: elf32-mt.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mt.h \
@@ -2018,12 +2018,12 @@ elfxx-sparc.lo: elfxx-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
- elfxx-sparc.h
+ elfxx-sparc.h elf-vxworks.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \
- elfxx-sparc.h elf32-target.h
+ elfxx-sparc.h elf32-target.h elf-vxworks.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h \
diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h
index cff7b3c7566..cba4fbbeff9 100644
--- a/bfd/aoutf1.h
+++ b/bfd/aoutf1.h
@@ -1,6 +1,6 @@
/* A.out "format 1" file handling code for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001, 2002, 2003, 2004, 2005
+ 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -286,7 +286,7 @@ struct external_sparc_core
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
#define SPARC_CORE_LEN 432
- int c_regs[19]; /* General purpose registers -- MACHDEP SIZE. */
+ struct regs c_regs; /* General purpose registers -- MACHDEP SIZE. */
struct external_exec c_aouthdr; /* A.out header. */
int c_signo; /* Killing signal, if any. */
int c_tsize; /* Text size (bytes). */
@@ -309,7 +309,7 @@ struct external_solaris_bcp_core
int c_magic; /* Corefile magic number. */
int c_len; /* Sizeof (struct core). */
#define SOLARIS_BCP_CORE_LEN 456
- int c_regs[19]; /* General purpose registers -- MACHDEP SIZE. */
+ struct regs c_regs; /* General purpose registers -- MACHDEP SIZE. */
int c_exdata_vp; /* Exdata structure. */
int c_exdata_tsize;
int c_exdata_dsize;
@@ -387,7 +387,7 @@ swapcore_sun3 (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
- intcore->c_regs_pos = (long) (((struct external_sun3_core *) 0)->c_regs);
+ intcore->c_regs_pos = offsetof (struct external_sun3_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
#if ARCH_SIZE == 64
aout_64_swap_exec_header_in
@@ -401,10 +401,10 @@ swapcore_sun3 (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
- intcore->fp_stuff_pos = (long) (((struct external_sun3_core *) 0)->fp_stuff);
+ intcore->fp_stuff_pos = offsetof (struct external_sun3_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
- (file_ptr) (((struct external_sun3_core *) 0)->fp_stuff);
+ offsetof (struct external_sun3_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end. */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
@@ -422,7 +422,7 @@ swapcore_sparc (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
- intcore->c_regs_pos = (long) (((struct external_sparc_core *) 0)->c_regs);
+ intcore->c_regs_pos = offsetof (struct external_sparc_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
#if ARCH_SIZE == 64
aout_64_swap_exec_header_in
@@ -436,10 +436,10 @@ swapcore_sparc (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_data_addr = N_DATADDR (intcore->c_aouthdr);
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
- intcore->fp_stuff_pos = (long) (((struct external_sparc_core *) 0)->fp_stuff);
+ intcore->fp_stuff_pos = offsetof (struct external_sparc_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
- (file_ptr) (((struct external_sparc_core *) 0)->fp_stuff);
+ offsetof (struct external_sparc_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end. */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
@@ -462,7 +462,7 @@ swapcore_sparc (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
{
- bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6);
+ bfd_vma sp = H_GET_32 (abfd, &extcore->c_regs.r_o6);
if (sp < SPARC_USRSTACK_SPARC10)
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
else
@@ -480,7 +480,7 @@ swapcore_solaris_bcp (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_magic = H_GET_32 (abfd, &extcore->c_magic);
intcore->c_len = H_GET_32 (abfd, &extcore->c_len);
- intcore->c_regs_pos = (long) (((struct external_solaris_bcp_core *) 0)->c_regs);
+ intcore->c_regs_pos = offsetof (struct external_solaris_bcp_core, c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
/* The Solaris BCP exdata structure does not contain an a_syms field,
@@ -501,10 +501,10 @@ swapcore_solaris_bcp (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
intcore->c_ssize = H_GET_32 (abfd, &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos =
- (long) (((struct external_solaris_bcp_core *) 0)->fp_stuff);
+ offsetof (struct external_solaris_bcp_core, fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
- (file_ptr) (((struct external_solaris_bcp_core *) 0)->fp_stuff);
+ offsetof (struct external_solaris_bcp_core, fp_stuff);
/* Ucode is the last thing in the struct -- just before the end */
intcore->c_ucode = H_GET_32 (abfd,
(intcore->c_len
@@ -527,7 +527,7 @@ swapcore_solaris_bcp (bfd *abfd, char *ext, struct internal_sunos_core *intcore)
#define SPARC_USRSTACK_SPARC2 ((bfd_vma)0xf8000000)
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
{
- bfd_vma sp = H_GET_32 (abfd, &((struct regs *) &extcore->c_regs[0])->r_o6);
+ bfd_vma sp = H_GET_32 (abfd, &extcore->c_regs.r_o6);
if (sp < SPARC_USRSTACK_SPARC10)
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
else
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 5560fed0d03..bbea0fa85d3 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2592,6 +2592,11 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_MIPS_TLS_TPREL_LO16,
+/* MIPS ELF relocations (VxWorks extensions). */
+ BFD_RELOC_MIPS_COPY,
+ BFD_RELOC_MIPS_JUMP_SLOT,
+
+
/* Fujitsu Frv Relocations. */
BFD_RELOC_FRV_LABEL16,
BFD_RELOC_FRV_LABEL24,
@@ -2706,6 +2711,11 @@ in the instruction. */
BFD_RELOC_X86_64_TPOFF32,
BFD_RELOC_X86_64_GOTOFF64,
BFD_RELOC_X86_64_GOTPC32,
+ BFD_RELOC_X86_64_GOT64,
+ BFD_RELOC_X86_64_GOTPCREL64,
+ BFD_RELOC_X86_64_GOTPC64,
+ BFD_RELOC_X86_64_GOTPLT64,
+ BFD_RELOC_X86_64_PLTOFF64,
BFD_RELOC_X86_64_GOTPC32_TLSDESC,
BFD_RELOC_X86_64_TLSDESC_CALL,
BFD_RELOC_X86_64_TLSDESC,
@@ -3120,6 +3130,22 @@ through 0. */
/* ADI Blackfin Long Jump pcrel. */
BFD_RELOC_BFIN_24_PCREL_JUMP_L,
+/* ADI Blackfin FD-PIC relocations. */
+ BFD_RELOC_BFIN_GOT17M4,
+ BFD_RELOC_BFIN_GOTHI,
+ BFD_RELOC_BFIN_GOTLO,
+ BFD_RELOC_BFIN_FUNCDESC,
+ BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
+ BFD_RELOC_BFIN_FUNCDESC_GOTHI,
+ BFD_RELOC_BFIN_FUNCDESC_GOTLO,
+ BFD_RELOC_BFIN_FUNCDESC_VALUE,
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
+ BFD_RELOC_BFIN_GOTOFF17M4,
+ BFD_RELOC_BFIN_GOTOFFHI,
+ BFD_RELOC_BFIN_GOTOFFLO,
+
/* ADI Blackfin GOT relocation. */
BFD_RELOC_BFIN_GOT,
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 220edf8809c..951587f99b1 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -1,5 +1,5 @@
/* BFD back-end for IBM RS/6000 "XCOFF" files.
- Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
FIXME: Can someone provide a transliteration of this name into ASCII?
Using the following chars caused a compiler warning on HIUX (so I replaced
@@ -2083,7 +2083,7 @@ xcoff_write_archive_contents_old (abfd)
char decbuf[XCOFFARMAG_ELEMENT_SIZE + 1];
memset (&fhdr, 0, sizeof fhdr);
- strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG);
+ (void) strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG);
sprintf (fhdr.firstmemoff, "%d", SIZEOF_AR_FILE_HDR);
sprintf (fhdr.freeoff, "%d", 0);
diff --git a/bfd/config.bfd b/bfd/config.bfd
index b820a15c4d4..a07d77f378e 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -313,7 +313,8 @@ case "${targ}" in
bfin-*-*)
targ_defvec=bfd_elf32_bfin_vec
- tar_underscore=yes
+ targ_selvecs=bfd_elf32_bfinfdpic_vec
+ targ_underscore=yes
;;
c30-*-*aout* | tic30-*-*aout*)
@@ -868,6 +869,16 @@ case "${targ}" in
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
+#ifdef BFD64
+ mips*el-*-vxworks*)
+ targ_defvec=bfd_elf32_littlemips_vxworks_vec
+ targ_selvecs="bfd_elf32_littlemips_vec bfd_elf32_bigmips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ ;;
+ mips*-*-vxworks*)
+ targ_defvec=bfd_elf32_bigmips_vxworks_vec
+ targ_selvecs="bfd_elf32_bigmips_vec bfd_elf32_littlemips_vxworks_vec bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ ;;
+#endif
mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*)
targ_defvec=bfd_elf32_littlemips_vec
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
@@ -1281,6 +1292,10 @@ case "${targ}" in
sparc-*-sysv4*)
targ_defvec=bfd_elf32_sparc_vec
;;
+ sparc-*-vxworks*)
+ targ_defvec=bfd_elf32_sparc_vxworks_vec
+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
+ ;;
sparc-*-netware*)
targ_defvec=bfd_elf32_sparc_vec
targ_selvecs="nlm32_sparc_vec sunos_big_vec"
diff --git a/bfd/configure b/bfd/configure
index 92083027822..203ecfa941e 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL VERSUFFIX REPORT_BUGS_TO WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL VERSUFFIX WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -874,7 +874,6 @@ Optional Packages:
--with-pic try to use only PIC/non-PIC objects default=use both
--with-mmap try using mmap for BFD input files if available
--with-versuffix=SFX Append SFX to the version string
- --with-bugurl=URL Direct users to URL to report a bug
--with-included-gettext use the GNU gettext library included here
Some influential environment variables:
@@ -2838,7 +2837,7 @@ fi
# Define the identity of the package.
PACKAGE=bfd
- VERSION=2.16.91
+ VERSION=2.17
cat >>confdefs.h <<_ACEOF
@@ -4034,7 +4033,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4037 "configure"' > conftest.$ac_ext
+ echo '#line 4036 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -4407,24 +4406,6 @@ else
fi;
-# The location to which bugs should be reported.
-
-# Check whether --with-bugurl or --without-bugurl was given.
-if test "${with_bugurl+set}" = set; then
- withval="$with_bugurl"
- case "$withval" in
- yes) { { echo "$as_me:$LINENO: error: bug URL not specified" >&5
-echo "$as_me: error: bug URL not specified" >&2;}
- { (exit 1); exit 1; }; } ;;
- no) REPORT_BUGS_TO="" ;;
- *) REPORT_BUGS_TO="<URL:$withval>" ;;
- esac
-else
- REPORT_BUGS_TO=""
-
-fi;
-
-
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
@@ -13110,6 +13091,7 @@ do
bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
bfd_elf32_bfin_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+ bfd_elf32_bfinfdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
@@ -13117,7 +13099,9 @@ do
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_bigarm_vxworks_vec)
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_bigmips_vxworks_vec)
+ tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
@@ -13149,7 +13133,9 @@ do
bfd_elf32_littlearm_vxworks_vec)
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_littlemips_vxworks_vec)
+ tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_m32c_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
bfd_elf32_m32rle_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
@@ -13165,10 +13151,10 @@ do
bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
bfd_elf32_msp430_vec) tb="$tb elf32-msp430.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_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.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";;
@@ -13193,9 +13179,10 @@ do
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-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_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.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" ;;
@@ -13206,14 +13193,14 @@ do
bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
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 ;;
- bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
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 ;;
@@ -13224,9 +13211,9 @@ do
bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-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 ;;
+ bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
@@ -15277,7 +15264,6 @@ s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@LN_S@,$LN_S,;t t
s,@LIBTOOL@,$LIBTOOL,;t t
s,@VERSUFFIX@,$VERSUFFIX,;t t
-s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t
s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
s,@NO_WERROR@,$NO_WERROR,;t t
s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
diff --git a/bfd/configure.in b/bfd/configure.in
index cd87c26dab2..f110727b416 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c])
AC_CANONICAL_TARGET
AC_ISC_POSIX
-AM_INIT_AUTOMAKE(bfd, 2.16.91)
+AM_INIT_AUTOMAKE(bfd, 2.17)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
@@ -598,6 +598,7 @@ do
bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
bfd_elf32_bfin_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
+ bfd_elf32_bfinfdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
bfd_elf32_bigarm_vec) tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
@@ -605,7 +606,9 @@ do
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_bigarm_vxworks_vec)
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_bigmips_vxworks_vec)
+ tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_cr16c_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;;
bfd_elf32_crx_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;;
@@ -637,7 +640,9 @@ do
bfd_elf32_littlearm_vxworks_vec)
tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
bfd_elf32_littlearm_vec) tb="$tb elf32-arm.lo elf32.lo elf-vxworks.lo $elf" ;;
- bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_littlemips_vxworks_vec)
+ tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_m32c_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;;
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
bfd_elf32_m32rle_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
@@ -653,10 +658,10 @@ do
bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
bfd_elf32_msp430_vec) tb="$tb elf32-msp430.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_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.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";;
@@ -681,9 +686,10 @@ do
bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
- bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elfxx-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_sparc_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;;
+ bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.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" ;;
@@ -694,14 +700,14 @@ do
bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
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 ;;
- bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
- bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
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 ;;
@@ -712,9 +718,9 @@ do
bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
- bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-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 ;;
+ bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+ bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
+ bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index d4ef2cd4e2c..7909268f98b 100644
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,3 +1,13 @@
+2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
+
+ * bfd.texinfo: Remove local @tex code.
+
+2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
+
+ * Makefile.am: Add install-html and install-html-am targets.
+ Define datarootdir, docdir and htmldir.
+ * Makefile.in: Regenerate.
+
2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
* Makefile.am: Add html target.
diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo
index 975a6ed65fa..34d56ed0c0c 100644
--- a/bfd/doc/bfd.texinfo
+++ b/bfd/doc/bfd.texinfo
@@ -4,20 +4,6 @@
@c 2001, 2002, 2003
@c Free Software Foundation, Inc.
@c
-@tex
-% NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE
-\global\long\def\example{%
-\begingroup
-\let\aboveenvbreak=\par
-\let\afterenvbreak=\par
-\parskip=0pt
-\lisp}
-\global\long\def\Eexample{%
-\Elisp
-\endgroup
-\vskip -\parskip% to cancel out effect of following \par
-}
-@end tex
@synindex fn cp
@ifinfo
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index ab0b995c0c2..5100e72938d 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -1076,12 +1076,12 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
end = buf + ent->size;
new_size = size_of_output_cie_fde (ent, ptr_size);
- /* Install the new size, filling the extra bytes with DW_CFA_nops. */
+ /* Update the size. It may be shrinked. */
+ bfd_put_32 (abfd, new_size - 4, buf);
+
+ /* Filling the extra bytes with DW_CFA_nops. */
if (new_size != ent->size)
- {
- memset (end, 0, new_size - ent->size);
- bfd_put_32 (abfd, new_size - 4, buf);
- }
+ memset (end, 0, new_size - ent->size);
if (ent->cie)
{
@@ -1263,40 +1263,13 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
}
}
- {
- unsigned int alignment = 1 << sec->alignment_power;
- unsigned int pad = sec->size % alignment;
-
- /* Don't pad beyond the raw size of the output section. It
- can happen at the last input section. */
- if (pad
- && ((sec->output_offset + sec->size + pad)
- <= sec->output_section->size))
- {
- bfd_byte *buf;
- unsigned int new_size;
-
- /* Find the last CIE/FDE. */
- ent = sec_info->entry + sec_info->count;
- while (--ent != sec_info->entry)
- if (!ent->removed)
- break;
-
- /* The size of the last CIE/FDE must be at least 4. */
- if (ent->removed || ent->size < 4)
- abort ();
-
- pad = alignment - pad;
- buf = contents + ent->new_offset - sec->output_offset;
- new_size = size_of_output_cie_fde (ent, ptr_size);
-
- /* Pad it with DW_CFA_nop */
- memset (buf + new_size, 0, pad);
- bfd_put_32 (abfd, new_size + pad - 4, buf);
-
- sec->size += pad;
- }
- }
+ /* We don't align the section to its section alignment since the
+ runtime library only expects all CIE/FDE records aligned at
+ the pointer size. _bfd_elf_discard_section_eh_frame should
+ have padded CIE/FDE records to multiple of pointer size with
+ size_of_output_cie_fde. */
+ if ((sec->size % ptr_size) != 0)
+ abort ();
return bfd_set_section_contents (abfd, sec->output_section,
contents, (file_ptr) sec->output_offset,
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 13c32015202..d5a81dbc605 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1,4 +1,4 @@
-/* ADI Blackfin BFD support for 32-bit ELF.
+/* ADI Blackfin BFD support for 32-bit ELF.
Copyright 2005, 2006 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,167 +23,8 @@
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/bfin.h"
-
-/* Handling expression relocations for blackfin. Blackfin
- will generate relocations in an expression form with a stack.
- A relocation such as P1.H = _typenames-4000000;
- will generate the following relocs at offset 4:
-00000004 R_expst_push _typenames
-00000004 R_expst_const .__constant
-00000004 R_expst_sub .__operator
-00000006 R_huimm16 .__operator
-
- The .__constant and .__operator symbol names are fake.
- Special case is a single relocation
- P1.L = _typenames; generates
-00000002 R_luimm16 _typenames
-
- Thus, if you get a R_luimm16, R_huimm16, R_imm16,
- if the stack is not empty, pop the stack and
- put the value, else do the normal thing
- We will currently assume that the max the stack
- would grow to is 100. . */
-
-#define RELOC_STACK_SIZE 100
-static bfd_vma reloc_stack[RELOC_STACK_SIZE];
-static unsigned int reloc_stack_tos = 0;
-
-#define is_reloc_stack_empty() ((reloc_stack_tos > 0) ? 0 : 1)
-
-static void
-reloc_stack_push (bfd_vma value)
-{
- reloc_stack[reloc_stack_tos++] = value;
-}
-
-static bfd_vma
-reloc_stack_pop (void)
-{
- return reloc_stack[--reloc_stack_tos];
-}
-
-static bfd_vma
-reloc_stack_operate (unsigned int oper)
-{
- bfd_vma value;
- switch (oper)
- {
- case R_add:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] + reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_sub:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] - reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_mult:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] * reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_div:
- {
- if (reloc_stack[reloc_stack_tos - 1] == 0)
- {
- _bfd_abort (__FILE__, __LINE__, _("Division by zero. "));
- }
- else
- {
- value =
- reloc_stack[reloc_stack_tos - 2] / reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- }
- break;
- }
- case R_mod:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] % reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_lshift:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] << reloc_stack[reloc_stack_tos -
- 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_rshift:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] >> reloc_stack[reloc_stack_tos -
- 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_and:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] & reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_or:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] | reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_xor:
- {
- value =
- reloc_stack[reloc_stack_tos - 2] ^ reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_land:
- {
- value = reloc_stack[reloc_stack_tos - 2]
- && reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_lor:
- {
- value = reloc_stack[reloc_stack_tos - 2]
- || reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 2;
- break;
- }
- case R_neg:
- {
- value = -reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos--;
- break;
- }
- case R_comp:
- {
- value = ~reloc_stack[reloc_stack_tos - 1];
- reloc_stack_tos -= 1;
- break;
- }
- default:
- {
- fprintf (stderr, "bfin relocation : Internal bug\n");
- return 0;
- }
- }
-
- reloc_stack_push (value);
-
- return value;
-}
+#include "elf/dwarf2.h"
+#include "hashtab.h"
/* FUNCTION : bfin_pltpc_reloc
ABSTRACT : TODO : figure out how to handle pltpc relocs. */
@@ -195,10 +36,10 @@ bfin_pltpc_reloc (
PTR data ATTRIBUTE_UNUSED,
asection *input_section ATTRIBUTE_UNUSED,
bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_reloc_status_type flag = bfd_reloc_ok;
- return flag;
+ return flag;
}
@@ -221,49 +62,44 @@ bfin_pcrel24_reloc (bfd *abfd,
if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
return bfd_reloc_outofrange;
- if (!is_reloc_stack_empty ())
- relocation = reloc_stack_pop();
+ if (bfd_is_und_section (symbol->section)
+ && (symbol->flags & BSF_WEAK) == 0
+ && !relocatable)
+ return bfd_reloc_undefined;
+
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
else
- {
- if (bfd_is_und_section (symbol->section)
- && (symbol->flags & BSF_WEAK) == 0
- && !relocatable)
- return bfd_reloc_undefined;
+ relocation = symbol->value;
- if (bfd_is_com_section (symbol->section))
- relocation = 0;
- else
- relocation = symbol->value;
+ output_section = symbol->section->output_section;
+
+ if (relocatable)
+ output_base = 0;
+ else
+ output_base = output_section->vma;
- output_section = symbol->section->output_section;
+ if (!relocatable || !strcmp (symbol->name, symbol->section->name))
+ relocation += output_base + symbol->section->output_offset;
+
+ if (!relocatable && !strcmp (symbol->name, symbol->section->name))
+ relocation += reloc_entry->addend;
- if (relocatable)
- output_base = 0;
- else
- output_base = output_section->vma;
-
- if (!relocatable || !strcmp (symbol->name, symbol->section->name))
- relocation += output_base + symbol->section->output_offset;
-
- if (!relocatable && !strcmp (symbol->name, symbol->section->name))
- relocation += reloc_entry->addend;
- }
-
relocation -= input_section->output_section->vma + input_section->output_offset;
relocation -= reloc_entry->address;
if (howto->complain_on_overflow != complain_overflow_dont)
{
bfd_reloc_status_type status;
- status= bfd_check_overflow (howto->complain_on_overflow,
- howto->bitsize,
- howto->rightshift,
- bfd_arch_bits_per_address(abfd),
- relocation);
+ status = bfd_check_overflow (howto->complain_on_overflow,
+ howto->bitsize,
+ howto->rightshift,
+ bfd_arch_bits_per_address(abfd),
+ relocation);
if (status != bfd_reloc_ok)
return status;
}
-
+
/* if rightshift is 1 and the number odd, return error. */
if (howto->rightshift && (relocation & 0x01))
{
@@ -286,11 +122,11 @@ bfin_pcrel24_reloc (bfd *abfd,
short x;
/* We are getting reloc_entry->address 2 byte off from
- the start of instruction. Assuming absolute postion
- of the reloc data. But, following code had been written assuming
- reloc address is starting at begining of instruction.
- To compensate that I have increased the value of
- relocation by 1 (effectively 2) and used the addr -2 instead of addr. */
+ the start of instruction. Assuming absolute postion
+ of the reloc data. But, following code had been written assuming
+ reloc address is starting at begining of instruction.
+ To compensate that I have increased the value of
+ relocation by 1 (effectively 2) and used the addr -2 instead of addr. */
relocation += 1;
x = bfd_get_16 (abfd, (bfd_byte *) data + addr - 2);
@@ -305,30 +141,32 @@ bfin_pcrel24_reloc (bfd *abfd,
}
static bfd_reloc_status_type
-bfin_push_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol,
- PTR data ATTRIBUTE_UNUSED,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+bfin_imm16_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ PTR data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
- bfd_vma relocation;
+ bfd_vma relocation, x;
+ bfd_size_type reloc_addr = reloc_entry->address;
bfd_vma output_base = 0;
+ reloc_howto_type *howto = reloc_entry->howto;
asection *output_section;
bfd_boolean relocatable = (output_bfd != NULL);
+ /* Is the address of the relocation really within the section? */
+ if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
+ return bfd_reloc_outofrange;
+
if (bfd_is_und_section (symbol->section)
&& (symbol->flags & BSF_WEAK) == 0
&& !relocatable)
return bfd_reloc_undefined;
- /* Is the address of the relocation really within the section? */
- if (reloc_entry->address > bfd_get_section_limit(abfd, input_section))
- return bfd_reloc_outofrange;
-
output_section = symbol->section->output_section;
- relocation = symbol->value;
+ relocation = symbol->value;
/* Convert input-section-relative symbol value to absolute. */
if (relocatable)
@@ -336,7 +174,7 @@ bfin_push_reloc (bfd *abfd ATTRIBUTE_UNUSED,
else
output_base = output_section->vma;
- if (!relocatable || !strcmp(symbol->name, symbol->section->name))
+ if (!relocatable || !strcmp (symbol->name, symbol->section->name))
relocation += output_base + symbol->section->output_offset;
/* Add in supplied addend. */
@@ -347,105 +185,6 @@ bfin_push_reloc (bfd *abfd ATTRIBUTE_UNUSED,
reloc_entry->address += input_section->output_offset;
reloc_entry->addend += symbol->section->output_offset;
}
-
- /* Now that we have the value, push it. */
- reloc_stack_push (relocation);
-
- return bfd_reloc_ok;
-}
-
-static bfd_reloc_status_type
-bfin_oper_reloc (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)
-{
- bfd_boolean relocatable = (output_bfd != NULL);
-
- /* Just call the operation based on the reloc_type. */
- reloc_stack_operate (reloc_entry->howto->type);
-
- if (relocatable)
- reloc_entry->address += input_section->output_offset;
-
- return bfd_reloc_ok;
-}
-
-static bfd_reloc_status_type
-bfin_const_reloc (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)
-{
- bfd_boolean relocatable = (output_bfd != NULL);
-
- /* Push the addend portion of the relocation. */
- reloc_stack_push (reloc_entry->addend);
-
- if (relocatable)
- reloc_entry->address += input_section->output_offset;
-
- return bfd_reloc_ok;
-}
-
-static bfd_reloc_status_type
-bfin_imm16_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- PTR data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
-{
- bfd_vma relocation, x;
- bfd_size_type reloc_addr = reloc_entry->address;
- bfd_vma output_base = 0;
- reloc_howto_type *howto = reloc_entry->howto;
- asection *output_section;
- bfd_boolean relocatable = (output_bfd != NULL);
-
- /* Is the address of the relocation really within the section? */
- if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
- return bfd_reloc_outofrange;
-
- if (is_reloc_stack_empty ())
- {
- if (bfd_is_und_section (symbol->section)
- && (symbol->flags & BSF_WEAK) == 0
- && !relocatable)
- return bfd_reloc_undefined;
-
- output_section = symbol->section->output_section;
- relocation = symbol->value;
-
- /* Convert input-section-relative symbol value to absolute. */
- if (relocatable)
- output_base = 0;
- else
- output_base = output_section->vma;
-
- if (!relocatable || !strcmp (symbol->name, symbol->section->name))
- relocation += output_base + symbol->section->output_offset;
-
- /* Add in supplied addend. */
- relocation += reloc_entry->addend;
- }
- else
- {
- relocation = reloc_stack_pop ();
- }
-
- if (relocatable)
- {
- reloc_entry->address += input_section->output_offset;
- reloc_entry->addend += symbol->section->output_offset;
- }
else
{
reloc_entry->addend = 0;
@@ -455,15 +194,14 @@ bfin_imm16_reloc (bfd *abfd,
{
bfd_reloc_status_type flag;
flag = bfd_check_overflow (howto->complain_on_overflow,
- howto->bitsize,
- howto->rightshift,
- bfd_arch_bits_per_address(abfd),
- relocation);
+ howto->bitsize,
+ howto->rightshift,
+ bfd_arch_bits_per_address(abfd),
+ relocation);
if (flag != bfd_reloc_ok)
- return flag;
+ return flag;
}
-
/* Here the variable relocation holds the final address of the
symbol we are relocating against, plus any addend. */
@@ -481,7 +219,7 @@ bfin_byte4_reloc (bfd *abfd,
PTR data,
asection *input_section,
bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation, x;
bfd_size_type addr = reloc_entry->address;
@@ -493,39 +231,31 @@ bfin_byte4_reloc (bfd *abfd,
if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
return bfd_reloc_outofrange;
- if (is_reloc_stack_empty ())
- {
- if (bfd_is_und_section (symbol->section)
- && (symbol->flags & BSF_WEAK) == 0
- && !relocatable)
- return bfd_reloc_undefined;
-
- output_section = symbol->section->output_section;
- relocation = symbol->value;
- /* Convert input-section-relative symbol value to absolute. */
- if (relocatable)
- output_base = 0;
- else
- output_base = output_section->vma;
-
- if ((symbol->name
- && symbol->section->name
- && !strcmp (symbol->name, symbol->section->name))
- || !relocatable)
- {
- relocation += output_base + symbol->section->output_offset;
- }
+ if (bfd_is_und_section (symbol->section)
+ && (symbol->flags & BSF_WEAK) == 0
+ && !relocatable)
+ return bfd_reloc_undefined;
- relocation += reloc_entry->addend;
- }
+ output_section = symbol->section->output_section;
+ relocation = symbol->value;
+ /* Convert input-section-relative symbol value to absolute. */
+ if (relocatable)
+ output_base = 0;
else
+ output_base = output_section->vma;
+
+ if ((symbol->name
+ && symbol->section->name
+ && !strcmp (symbol->name, symbol->section->name))
+ || !relocatable)
{
- relocation = reloc_stack_pop();
- relocation += reloc_entry->addend;
+ relocation += output_base + symbol->section->output_offset;
}
+ relocation += reloc_entry->addend;
+
if (relocatable)
- {
+ {
/* This output will be relocatable ... like ld -r. */
reloc_entry->address += input_section->output_offset;
reloc_entry->addend += symbol->section->output_offset;
@@ -540,7 +270,7 @@ bfin_byte4_reloc (bfd *abfd,
x = relocation & 0xFFFF0000;
x >>=16;
bfd_put_16 (abfd, x, (unsigned char *) data + addr + 2);
-
+
x = relocation & 0x0000FFFF;
bfd_put_16 (abfd, x, (unsigned char *) data + addr);
return bfd_reloc_ok;
@@ -568,42 +298,34 @@ bfin_bfd_reloc (bfd *abfd,
if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
return bfd_reloc_outofrange;
- if (is_reloc_stack_empty())
- {
- if (bfd_is_und_section (symbol->section)
- && (symbol->flags & BSF_WEAK) == 0
- && !relocatable)
- return bfd_reloc_undefined;
+ if (bfd_is_und_section (symbol->section)
+ && (symbol->flags & BSF_WEAK) == 0
+ && !relocatable)
+ return bfd_reloc_undefined;
- /* Get symbol value. (Common symbols are special.) */
- if (bfd_is_com_section (symbol->section))
- relocation = 0;
- else
- relocation = symbol->value;
-
- output_section = symbol->section->output_section;
-
- /* Convert input-section-relative symbol value to absolute. */
- if (relocatable)
- output_base = 0;
- else
- output_base = output_section->vma;
-
- if (!relocatable || !strcmp (symbol->name, symbol->section->name))
- relocation += output_base + symbol->section->output_offset;
-
- if (!relocatable && !strcmp (symbol->name, symbol->section->name))
- {
- /* Add in supplied addend. */
- relocation += reloc_entry->addend;
- }
-
- }
+ /* Get symbol value. (Common symbols are special.) */
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
else
+ relocation = symbol->value;
+
+ output_section = symbol->section->output_section;
+
+ /* Convert input-section-relative symbol value to absolute. */
+ if (relocatable)
+ output_base = 0;
+ else
+ output_base = output_section->vma;
+
+ if (!relocatable || !strcmp (symbol->name, symbol->section->name))
+ relocation += output_base + symbol->section->output_offset;
+
+ if (!relocatable && !strcmp (symbol->name, symbol->section->name))
{
- relocation = reloc_stack_pop();
+ /* Add in supplied addend. */
+ relocation += reloc_entry->addend;
}
-
+
/* Here the variable relocation holds the final address of the
symbol we are relocating against, plus any addend. */
@@ -625,15 +347,15 @@ bfin_bfd_reloc (bfd *abfd,
{
bfd_reloc_status_type status;
- status = bfd_check_overflow (howto->complain_on_overflow,
+ status = bfd_check_overflow (howto->complain_on_overflow,
howto->bitsize,
- howto->rightshift,
+ howto->rightshift,
bfd_arch_bits_per_address(abfd),
relocation);
if (status != bfd_reloc_ok)
return status;
}
-
+
/* If rightshift is 1 and the number odd, return error. */
if (howto->rightshift && (relocation & 0x01))
{
@@ -647,7 +369,7 @@ bfin_bfd_reloc (bfd *abfd,
relocation <<= (bfd_vma) howto->bitpos;
-#define DOIT(x) \
+#define DOIT(x) \
x = ( (x & ~howto->dst_mask) | (relocation & howto->dst_mask))
/* handle 8 and 16 bit relocations here. */
@@ -673,41 +395,9 @@ bfin_bfd_reloc (bfd *abfd,
return bfd_reloc_other;
}
- return bfd_reloc_ok;
+ return bfd_reloc_ok;
}
-#if 0
-static bfd_reloc_status_type bfin_bfd_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_imm16_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_pcrel24_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_pltpc_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_const_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_oper_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_byte4_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_reloc_status_type bfin_push_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-
-static bfd_boolean bfin_is_local_label_name
- PARAMS ((bfd *, const char *));
-#endif
-bfd_boolean bfd_bfin_elf32_create_embedded_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, char **));
-
-
/* HOWTO Table for blackfin.
Blackfin relocations are fairly complicated.
Some of the salient features are
@@ -722,7 +412,7 @@ bfd_boolean bfd_bfin_elf32_create_embedded_relocs
the relocation stack. . */
#define BFIN_RELOC_MIN 0
-#define BFIN_RELOC_MAX 0x13
+#define BFIN_RELOC_MAX 0x21
#define BFIN_GNUEXT_RELOC_MIN 0x40
#define BFIN_GNUEXT_RELOC_MAX 0x43
#define BFIN_ARELOC_MIN 0xE0
@@ -786,7 +476,7 @@ static reloc_howto_type bfin_howto_table [] =
0, /* src_mask. */
0x000003FF, /* dst_mask. */
TRUE), /* pcrel_offset. */
-
+
HOWTO (R_pcrel12_jump, /* type. */
1, /* rightshift. */
/* the offset is actually 13 bit
@@ -832,7 +522,7 @@ static reloc_howto_type bfin_howto_table [] =
0, /* src_mask. */
0x0000FFFF, /* dst_mask. */
TRUE), /* pcrel_offset. */
-
+
HOWTO (R_huimm16, /* type. */
16, /* rightshift. */
1, /* size (0 = byte, 1 = short, 2 = long). */
@@ -1014,289 +704,229 @@ static reloc_howto_type bfin_howto_table [] =
0, /* src_mask. */
0x000003FF, /* dst_mask. */
FALSE), /* pcrel_offset. */
-};
-
-static reloc_howto_type bfin_areloc_howto_table [] =
-{
- HOWTO (R_push,
- 0,
- 2,
- 0,
- FALSE,
- 0,
- complain_overflow_dont,
- bfin_push_reloc,
- "R_expst_push",
- FALSE,
- 0,
- 0,
- FALSE),
-
- HOWTO (R_const,
- 0,
- 2,
- 0,
- FALSE,
- 0,
- complain_overflow_dont,
- bfin_const_reloc,
- "R_expst_const",
- FALSE,
- 0,
- 0,
- FALSE),
-
- HOWTO (R_add,
- 0,
- 0,
- 0,
- FALSE,
- 0,
- complain_overflow_dont,
- bfin_oper_reloc,
- "R_expst_add",
- FALSE,
- 0,
- 0,
- FALSE),
-
- HOWTO (R_sub,
- 0,
- 0,
- 0,
- FALSE,
- 0,
- complain_overflow_dont,
- bfin_oper_reloc,
- "R_expst_sub",
- FALSE,
- 0,
- 0,
- FALSE),
-
- HOWTO (R_mult,
- 0,
- 0,
- 0,
- FALSE,
- 0,
- complain_overflow_dont,
- bfin_oper_reloc,
- "R_expst_mult",
- FALSE,
- 0,
- 0,
- FALSE),
-
- HOWTO (R_div, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_div", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_mod, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_mod", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_lshift, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_lshift", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_rshift, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_rshift", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_and, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_and", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_or, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_or", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_xor, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_xor", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_land, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_land", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_lor, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_lor", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
- HOWTO (R_len, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_len", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
- HOWTO (R_neg, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_neg", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_comp, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_comp", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_page, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_page", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_hwpage, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_hwpage", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
-
- HOWTO (R_addr, /* type. */
- 0, /* rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- bfin_oper_reloc, /* special_function. */
- "R_expst_addr", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
+ /* A 18-bit signed operand with the GOT offset for the address of
+ the symbol. */
+ HOWTO (R_BFIN_GOT17M4, /* type */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_GOT12", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The upper 16 bits of the GOT offset for the address of the
+ symbol. */
+ HOWTO (R_BFIN_GOTHI, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_GOTHI", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The lower 16 bits of the GOT offset for the address of the
+ symbol. */
+ HOWTO (R_BFIN_GOTLO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_GOTLO", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The 32-bit address of the canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 12-bit signed operand with the GOT offset for the address of
+ canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC_GOT17M4, /* type */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC_GOT17M4", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The upper 16 bits of the GOT offset for the address of the
+ canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC_GOTHI, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC_GOTHI", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The lower 16 bits of the GOT offset for the address of the
+ canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC_GOTLO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC_GOTLO", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The 32-bit address of the canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC_VALUE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC_VALUE", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 12-bit signed operand with the GOT offset for the address of
+ canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC_GOTOFF17M4, /* type */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC_GOTOFF17M4", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The upper 16 bits of the GOT offset for the address of the
+ canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC_GOTOFFHI, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC_GOTOFFHI", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The lower 16 bits of the GOT offset for the address of the
+ canonical descriptor of a function. */
+ HOWTO (R_BFIN_FUNCDESC_GOTOFFLO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_FUNCDESC_GOTOFFLO", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* A 12-bit signed operand with the GOT offset for the address of
+ the symbol. */
+ HOWTO (R_BFIN_GOTOFF17M4, /* type */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_GOTOFF17M4", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The upper 16 bits of the GOT offset for the address of the
+ symbol. */
+ HOWTO (R_BFIN_GOTOFFHI, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_GOTOFFHI", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ /* The lower 16 bits of the GOT offset for the address of the
+ symbol. */
+ HOWTO (R_BFIN_GOTOFFLO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_BFIN_GOTOFFLO", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
static reloc_howto_type bfin_gnuext_howto_table [] =
@@ -1389,29 +1019,24 @@ static const struct bfin_reloc_map bfin_reloc_map [] =
{ BFD_RELOC_BFIN_11_PCREL, R_pcrel11 },
{ BFD_RELOC_BFIN_GOT, R_got },
{ BFD_RELOC_BFIN_PLTPC, R_pltpc },
+
+ { BFD_RELOC_BFIN_GOT17M4, R_BFIN_GOT17M4 },
+ { BFD_RELOC_BFIN_GOTHI, R_BFIN_GOTHI },
+ { BFD_RELOC_BFIN_GOTLO, R_BFIN_GOTLO },
+ { BFD_RELOC_BFIN_FUNCDESC, R_BFIN_FUNCDESC },
+ { BFD_RELOC_BFIN_FUNCDESC_GOT17M4, R_BFIN_FUNCDESC_GOT17M4 },
+ { BFD_RELOC_BFIN_FUNCDESC_GOTHI, R_BFIN_FUNCDESC_GOTHI },
+ { BFD_RELOC_BFIN_FUNCDESC_GOTLO, R_BFIN_FUNCDESC_GOTLO },
+ { BFD_RELOC_BFIN_FUNCDESC_VALUE, R_BFIN_FUNCDESC_VALUE },
+ { BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, R_BFIN_FUNCDESC_GOTOFF17M4 },
+ { BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, R_BFIN_FUNCDESC_GOTOFFHI },
+ { BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, R_BFIN_FUNCDESC_GOTOFFLO },
+ { BFD_RELOC_BFIN_GOTOFF17M4, R_BFIN_GOTOFF17M4 },
+ { BFD_RELOC_BFIN_GOTOFFHI, R_BFIN_GOTOFFHI },
+ { BFD_RELOC_BFIN_GOTOFFLO, R_BFIN_GOTOFFLO },
+
{ BFD_RELOC_VTABLE_INHERIT, R_BFIN_GNU_VTINHERIT },
{ BFD_RELOC_VTABLE_ENTRY, R_BFIN_GNU_VTENTRY },
- { BFD_ARELOC_BFIN_PUSH, R_push },
- { BFD_ARELOC_BFIN_CONST, R_const },
- { BFD_ARELOC_BFIN_ADD, R_add },
- { BFD_ARELOC_BFIN_SUB, R_sub },
- { BFD_ARELOC_BFIN_MULT, R_mult },
- { BFD_ARELOC_BFIN_DIV, R_div },
- { BFD_ARELOC_BFIN_MOD, R_mod },
- { BFD_ARELOC_BFIN_LSHIFT, R_lshift },
- { BFD_ARELOC_BFIN_RSHIFT, R_rshift },
- { BFD_ARELOC_BFIN_AND, R_and },
- { BFD_ARELOC_BFIN_OR, R_or },
- { BFD_ARELOC_BFIN_XOR, R_xor },
- { BFD_ARELOC_BFIN_LAND, R_land },
- { BFD_ARELOC_BFIN_LOR, R_lor },
- { BFD_ARELOC_BFIN_LEN, R_len },
- { BFD_ARELOC_BFIN_NEG, R_neg },
- { BFD_ARELOC_BFIN_COMP, R_comp },
- { BFD_ARELOC_BFIN_PAGE, R_page },
- { BFD_ARELOC_BFIN_HWPAGE, R_hwpage },
- { BFD_ARELOC_BFIN_ADDR, R_addr }
-
};
@@ -1427,9 +1052,6 @@ bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
if (r_type <= BFIN_RELOC_MAX)
cache_ptr->howto = &bfin_howto_table [r_type];
- else if (r_type >= BFIN_ARELOC_MIN && r_type <= BFIN_ARELOC_MAX)
- cache_ptr->howto = &bfin_areloc_howto_table [r_type - BFIN_ARELOC_MIN];
-
else if (r_type >= BFIN_GNUEXT_RELOC_MIN && r_type <= BFIN_GNUEXT_RELOC_MAX)
cache_ptr->howto = &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
@@ -1452,9 +1074,6 @@ bfin_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
if (r_type <= BFIN_RELOC_MAX && r_type > BFIN_RELOC_MIN)
return &bfin_howto_table [r_type];
- else if (r_type >= BFIN_ARELOC_MIN && r_type <= BFIN_ARELOC_MAX)
- return &bfin_areloc_howto_table [r_type - BFIN_ARELOC_MIN];
-
else if (r_type >= BFIN_GNUEXT_RELOC_MIN && r_type <= BFIN_GNUEXT_RELOC_MAX)
return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
@@ -1469,9 +1088,6 @@ bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
if (r_type <= BFIN_RELOC_MAX)
return &bfin_howto_table [r_type];
- else if (r_type >= BFIN_ARELOC_MIN && r_type <= BFIN_ARELOC_MAX)
- return &bfin_areloc_howto_table [r_type - BFIN_ARELOC_MIN];
-
else if (r_type >= BFIN_GNUEXT_RELOC_MIN && r_type <= BFIN_GNUEXT_RELOC_MAX)
return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
@@ -1492,6 +1108,797 @@ bfin_is_local_label_name (
return _bfd_elf_is_local_label_name (abfd, label);
}
+extern const bfd_target bfd_elf32_bfinfdpic_vec;
+#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_bfinfdpic_vec)
+
+/* An extension of the elf hash table data structure, containing some
+ additional Blackfin-specific data. */
+struct bfinfdpic_elf_link_hash_table
+{
+ struct elf_link_hash_table elf;
+
+ /* A pointer to the .got section. */
+ asection *sgot;
+ /* A pointer to the .rel.got section. */
+ asection *sgotrel;
+ /* A pointer to the .rofixup section. */
+ asection *sgotfixup;
+ /* A pointer to the .plt section. */
+ asection *splt;
+ /* A pointer to the .rel.plt section. */
+ asection *spltrel;
+ /* GOT base offset. */
+ bfd_vma got0;
+ /* Location of the first non-lazy PLT entry, i.e., the number of
+ bytes taken by lazy PLT entries. */
+ bfd_vma plt0;
+ /* A hash table holding information about which symbols were
+ referenced with which PIC-related relocations. */
+ struct htab *relocs_info;
+};
+
+/* Get the Blackfin ELF linker hash table from a link_info structure. */
+
+#define bfinfdpic_hash_table(info) \
+ ((struct bfinfdpic_elf_link_hash_table *) ((info)->hash))
+
+#define bfinfdpic_got_section(info) \
+ (bfinfdpic_hash_table (info)->sgot)
+#define bfinfdpic_gotrel_section(info) \
+ (bfinfdpic_hash_table (info)->sgotrel)
+#define bfinfdpic_gotfixup_section(info) \
+ (bfinfdpic_hash_table (info)->sgotfixup)
+#define bfinfdpic_plt_section(info) \
+ (bfinfdpic_hash_table (info)->splt)
+#define bfinfdpic_pltrel_section(info) \
+ (bfinfdpic_hash_table (info)->spltrel)
+#define bfinfdpic_relocs_info(info) \
+ (bfinfdpic_hash_table (info)->relocs_info)
+#define bfinfdpic_got_initial_offset(info) \
+ (bfinfdpic_hash_table (info)->got0)
+#define bfinfdpic_plt_initial_offset(info) \
+ (bfinfdpic_hash_table (info)->plt0)
+
+/* Create a Blackfin ELF linker hash table. */
+
+static struct bfd_link_hash_table *
+bfinfdpic_elf_link_hash_table_create (bfd *abfd)
+{
+ struct bfinfdpic_elf_link_hash_table *ret;
+ bfd_size_type amt = sizeof (struct bfinfdpic_elf_link_hash_table);
+
+ ret = bfd_zalloc (abfd, amt);
+ if (ret == NULL)
+ return NULL;
+
+ if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd,
+ _bfd_elf_link_hash_newfunc,
+ sizeof (struct elf_link_hash_entry)))
+ {
+ free (ret);
+ return NULL;
+ }
+
+ return &ret->elf.root;
+}
+
+/* Decide whether a reference to a symbol can be resolved locally or
+ not. If the symbol is protected, we want the local address, but
+ its function descriptor must be assigned by the dynamic linker. */
+#define BFINFDPIC_SYM_LOCAL(INFO, H) \
+ (_bfd_elf_symbol_refs_local_p ((H), (INFO), 1) \
+ || ! elf_hash_table (INFO)->dynamic_sections_created)
+#define BFINFDPIC_FUNCDESC_LOCAL(INFO, H) \
+ ((H)->dynindx == -1 || ! elf_hash_table (INFO)->dynamic_sections_created)
+
+/* This structure collects information on what kind of GOT, PLT or
+ function descriptors are required by relocations that reference a
+ certain symbol. */
+struct bfinfdpic_relocs_info
+{
+ /* The index of the symbol, as stored in the relocation r_info, if
+ we have a local symbol; -1 otherwise. */
+ long symndx;
+ union
+ {
+ /* The input bfd in which the symbol is defined, if it's a local
+ symbol. */
+ bfd *abfd;
+ /* If symndx == -1, the hash table entry corresponding to a global
+ symbol (even if it turns out to bind locally, in which case it
+ should ideally be replaced with section's symndx + addend). */
+ struct elf_link_hash_entry *h;
+ } d;
+ /* The addend of the relocation that references the symbol. */
+ bfd_vma addend;
+
+ /* The fields above are used to identify an entry. The fields below
+ contain information on how an entry is used and, later on, which
+ locations it was assigned. */
+ /* The following 2 fields record whether the symbol+addend above was
+ ever referenced with a GOT relocation. The 17M4 suffix indicates a
+ GOT17M4 relocation; hilo is used for GOTLO/GOTHI pairs. */
+ unsigned got17m4:1;
+ unsigned gothilo:1;
+ /* Whether a FUNCDESC relocation references symbol+addend. */
+ unsigned fd:1;
+ /* Whether a FUNCDESC_GOT relocation references symbol+addend. */
+ unsigned fdgot17m4:1;
+ unsigned fdgothilo:1;
+ /* Whether a FUNCDESC_GOTOFF relocation references symbol+addend. */
+ unsigned fdgoff17m4:1;
+ unsigned fdgoffhilo:1;
+ /* Whether symbol+addend is referenced with GOTOFF17M4, GOTOFFLO or
+ GOTOFFHI relocations. The addend doesn't really matter, since we
+ envision that this will only be used to check whether the symbol
+ is mapped to the same segment as the got. */
+ unsigned gotoff:1;
+ /* Whether symbol+addend is referenced by a LABEL24 relocation. */
+ unsigned call:1;
+ /* Whether symbol+addend is referenced by a 32 or FUNCDESC_VALUE
+ relocation. */
+ unsigned sym:1;
+ /* Whether we need a PLT entry for a symbol. Should be implied by
+ something like:
+ (call && symndx == -1 && ! BFINFDPIC_SYM_LOCAL (info, d.h)) */
+ unsigned plt:1;
+ /* Whether a function descriptor should be created in this link unit
+ for symbol+addend. Should be implied by something like:
+ (plt || fdgotoff17m4 || fdgotofflohi
+ || ((fd || fdgot17m4 || fdgothilo)
+ && (symndx != -1 || BFINFDPIC_FUNCDESC_LOCAL (info, d.h)))) */
+ unsigned privfd:1;
+ /* Whether a lazy PLT entry is needed for this symbol+addend.
+ Should be implied by something like:
+ (privfd && symndx == -1 && ! BFINFDPIC_SYM_LOCAL (info, d.h)
+ && ! (info->flags & DF_BIND_NOW)) */
+ unsigned lazyplt:1;
+ /* Whether we've already emitted GOT relocations and PLT entries as
+ needed for this symbol. */
+ unsigned done:1;
+
+ /* The number of R_byte4_data, R_BFIN_FUNCDESC and R_BFIN_FUNCDESC_VALUE
+ relocations referencing the symbol. */
+ unsigned relocs32, relocsfd, relocsfdv;
+
+ /* The number of .rofixups entries and dynamic relocations allocated
+ for this symbol, minus any that might have already been used. */
+ unsigned fixups, dynrelocs;
+
+ /* The offsets of the GOT entries assigned to symbol+addend, to the
+ function descriptor's address, and to a function descriptor,
+ respectively. Should be zero if unassigned. The offsets are
+ counted from the value that will be assigned to the PIC register,
+ not from the beginning of the .got section. */
+ bfd_signed_vma got_entry, fdgot_entry, fd_entry;
+ /* The offsets of the PLT entries assigned to symbol+addend,
+ non-lazy and lazy, respectively. If unassigned, should be
+ (bfd_vma)-1. */
+ bfd_vma plt_entry, lzplt_entry;
+};
+
+/* Compute a hash with the key fields of an bfinfdpic_relocs_info entry. */
+static hashval_t
+bfinfdpic_relocs_info_hash (const void *entry_)
+{
+ const struct bfinfdpic_relocs_info *entry = entry_;
+
+ return (entry->symndx == -1
+ ? (long) entry->d.h->root.root.hash
+ : entry->symndx + (long) entry->d.abfd->id * 257) + entry->addend;
+}
+
+/* Test whether the key fields of two bfinfdpic_relocs_info entries are
+ identical. */
+static int
+bfinfdpic_relocs_info_eq (const void *entry1, const void *entry2)
+{
+ const struct bfinfdpic_relocs_info *e1 = entry1;
+ const struct bfinfdpic_relocs_info *e2 = entry2;
+
+ return e1->symndx == e2->symndx && e1->addend == e2->addend
+ && (e1->symndx == -1 ? e1->d.h == e2->d.h : e1->d.abfd == e2->d.abfd);
+}
+
+/* Find or create an entry in a hash table HT that matches the key
+ fields of the given ENTRY. If it's not found, memory for a new
+ entry is allocated in ABFD's obstack. */
+static struct bfinfdpic_relocs_info *
+bfinfdpic_relocs_info_find (struct htab *ht,
+ bfd *abfd,
+ const struct bfinfdpic_relocs_info *entry,
+ enum insert_option insert)
+{
+ struct bfinfdpic_relocs_info **loc =
+ (struct bfinfdpic_relocs_info **) htab_find_slot (ht, entry, insert);
+
+ if (! loc)
+ return NULL;
+
+ if (*loc)
+ return *loc;
+
+ *loc = bfd_zalloc (abfd, sizeof (**loc));
+
+ if (! *loc)
+ return *loc;
+
+ (*loc)->symndx = entry->symndx;
+ (*loc)->d = entry->d;
+ (*loc)->addend = entry->addend;
+ (*loc)->plt_entry = (bfd_vma)-1;
+ (*loc)->lzplt_entry = (bfd_vma)-1;
+
+ return *loc;
+}
+
+/* Obtain the address of the entry in HT associated with H's symbol +
+ addend, creating a new entry if none existed. ABFD is only used
+ for memory allocation purposes. */
+inline static struct bfinfdpic_relocs_info *
+bfinfdpic_relocs_info_for_global (struct htab *ht,
+ bfd *abfd,
+ struct elf_link_hash_entry *h,
+ bfd_vma addend,
+ enum insert_option insert)
+{
+ struct bfinfdpic_relocs_info entry;
+
+ entry.symndx = -1;
+ entry.d.h = h;
+ entry.addend = addend;
+
+ return bfinfdpic_relocs_info_find (ht, abfd, &entry, insert);
+}
+
+/* Obtain the address of the entry in HT associated with the SYMNDXth
+ local symbol of the input bfd ABFD, plus the addend, creating a new
+ entry if none existed. */
+inline static struct bfinfdpic_relocs_info *
+bfinfdpic_relocs_info_for_local (struct htab *ht,
+ bfd *abfd,
+ long symndx,
+ bfd_vma addend,
+ enum insert_option insert)
+{
+ struct bfinfdpic_relocs_info entry;
+
+ entry.symndx = symndx;
+ entry.d.abfd = abfd;
+ entry.addend = addend;
+
+ return bfinfdpic_relocs_info_find (ht, abfd, &entry, insert);
+}
+
+/* Merge fields set by check_relocs() of two entries that end up being
+ mapped to the same (presumably global) symbol. */
+
+inline static void
+bfinfdpic_pic_merge_early_relocs_info (struct bfinfdpic_relocs_info *e2,
+ struct bfinfdpic_relocs_info const *e1)
+{
+ e2->got17m4 |= e1->got17m4;
+ e2->gothilo |= e1->gothilo;
+ e2->fd |= e1->fd;
+ e2->fdgot17m4 |= e1->fdgot17m4;
+ e2->fdgothilo |= e1->fdgothilo;
+ e2->fdgoff17m4 |= e1->fdgoff17m4;
+ e2->fdgoffhilo |= e1->fdgoffhilo;
+ e2->gotoff |= e1->gotoff;
+ e2->call |= e1->call;
+ e2->sym |= e1->sym;
+}
+
+/* Every block of 65535 lazy PLT entries shares a single call to the
+ resolver, inserted in the 32768th lazy PLT entry (i.e., entry #
+ 32767, counting from 0). All other lazy PLT entries branch to it
+ in a single instruction. */
+
+#define LZPLT_RESOLVER_EXTRA 10
+#define LZPLT_NORMAL_SIZE 6
+#define LZPLT_ENTRIES 1362
+
+#define BFINFDPIC_LZPLT_BLOCK_SIZE ((bfd_vma) LZPLT_NORMAL_SIZE * LZPLT_ENTRIES + LZPLT_RESOLVER_EXTRA)
+#define BFINFDPIC_LZPLT_RESOLV_LOC (LZPLT_NORMAL_SIZE * LZPLT_ENTRIES / 2)
+
+/* Add a dynamic relocation to the SRELOC section. */
+
+inline static bfd_vma
+_bfinfdpic_add_dyn_reloc (bfd *output_bfd, asection *sreloc, bfd_vma offset,
+ int reloc_type, long dynindx, bfd_vma addend,
+ struct bfinfdpic_relocs_info *entry)
+{
+ Elf_Internal_Rela outrel;
+ bfd_vma reloc_offset;
+
+ outrel.r_offset = offset;
+ outrel.r_info = ELF32_R_INFO (dynindx, reloc_type);
+ outrel.r_addend = addend;
+
+ reloc_offset = sreloc->reloc_count * sizeof (Elf32_External_Rel);
+ BFD_ASSERT (reloc_offset < sreloc->size);
+ bfd_elf32_swap_reloc_out (output_bfd, &outrel,
+ sreloc->contents + reloc_offset);
+ sreloc->reloc_count++;
+
+ /* If the entry's index is zero, this relocation was probably to a
+ linkonce section that got discarded. We reserved a dynamic
+ relocation, but it was for another entry than the one we got at
+ the time of emitting the relocation. Unfortunately there's no
+ simple way for us to catch this situation, since the relocation
+ is cleared right before calling relocate_section, at which point
+ we no longer know what the relocation used to point to. */
+ if (entry->symndx)
+ {
+ BFD_ASSERT (entry->dynrelocs > 0);
+ entry->dynrelocs--;
+ }
+
+ return reloc_offset;
+}
+
+/* Add a fixup to the ROFIXUP section. */
+
+static bfd_vma
+_bfinfdpic_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
+ struct bfinfdpic_relocs_info *entry)
+{
+ bfd_vma fixup_offset;
+
+ if (rofixup->flags & SEC_EXCLUDE)
+ return -1;
+
+ fixup_offset = rofixup->reloc_count * 4;
+ if (rofixup->contents)
+ {
+ BFD_ASSERT (fixup_offset < rofixup->size);
+ bfd_put_32 (output_bfd, offset, rofixup->contents + fixup_offset);
+ }
+ rofixup->reloc_count++;
+
+ if (entry && entry->symndx)
+ {
+ /* See discussion about symndx == 0 in _bfinfdpic_add_dyn_reloc
+ above. */
+ BFD_ASSERT (entry->fixups > 0);
+ entry->fixups--;
+ }
+
+ return fixup_offset;
+}
+
+/* Find the segment number in which OSEC, and output section, is
+ located. */
+
+static unsigned
+_bfinfdpic_osec_to_segment (bfd *output_bfd, asection *osec)
+{
+ struct elf_segment_map *m;
+ Elf_Internal_Phdr *p;
+
+ /* Find the segment that contains the output_section. */
+ for (m = elf_tdata (output_bfd)->segment_map,
+ p = elf_tdata (output_bfd)->phdr;
+ m != NULL;
+ m = m->next, p++)
+ {
+ int i;
+
+ for (i = m->count - 1; i >= 0; i--)
+ if (m->sections[i] == osec)
+ break;
+
+ if (i >= 0)
+ break;
+ }
+
+ return p - elf_tdata (output_bfd)->phdr;
+}
+
+inline static bfd_boolean
+_bfinfdpic_osec_readonly_p (bfd *output_bfd, asection *osec)
+{
+ unsigned seg = _bfinfdpic_osec_to_segment (output_bfd, osec);
+
+ return ! (elf_tdata (output_bfd)->phdr[seg].p_flags & PF_W);
+}
+
+/* Generate relocations for GOT entries, function descriptors, and
+ code for PLT and lazy PLT entries. */
+
+inline static bfd_boolean
+_bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
+ bfd *output_bfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ Elf_Internal_Sym *sym,
+ bfd_vma addend)
+
+{
+ bfd_vma fd_lazy_rel_offset = (bfd_vma)-1;
+ int dynindx = -1;
+
+ if (entry->done)
+ return TRUE;
+ entry->done = 1;
+
+ if (entry->got_entry || entry->fdgot_entry || entry->fd_entry)
+ {
+ /* If the symbol is dynamic, consider it for dynamic
+ relocations, otherwise decay to section + offset. */
+ if (entry->symndx == -1 && entry->d.h->dynindx != -1)
+ dynindx = entry->d.h->dynindx;
+ else
+ {
+ if (sec->output_section
+ && ! bfd_is_abs_section (sec->output_section)
+ && ! bfd_is_und_section (sec->output_section))
+ dynindx = elf_section_data (sec->output_section)->dynindx;
+ else
+ dynindx = 0;
+ }
+ }
+
+ /* Generate relocation for GOT entry pointing to the symbol. */
+ if (entry->got_entry)
+ {
+ int idx = dynindx;
+ bfd_vma ad = addend;
+
+ /* If the symbol is dynamic but binds locally, use
+ section+offset. */
+ if (sec && (entry->symndx != -1
+ || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+ {
+ if (entry->symndx == -1)
+ ad += entry->d.h->root.u.def.value;
+ else
+ ad += sym->st_value;
+ ad += sec->output_offset;
+ if (sec->output_section && elf_section_data (sec->output_section))
+ idx = elf_section_data (sec->output_section)->dynindx;
+ else
+ idx = 0;
+ }
+
+ /* If we're linking an executable at a fixed address, we can
+ omit the dynamic relocation as long as the symbol is local to
+ this module. */
+ if (info->executable && !info->pie
+ && (entry->symndx != -1
+ || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+ {
+ if (sec)
+ ad += sec->output_section->vma;
+ if (entry->symndx != -1
+ || entry->d.h->root.type != bfd_link_hash_undefweak)
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section (info),
+ bfinfdpic_got_section (info)->output_section
+ ->vma
+ + bfinfdpic_got_section (info)->output_offset
+ + bfinfdpic_got_initial_offset (info)
+ + entry->got_entry, entry);
+ }
+ else
+ _bfinfdpic_add_dyn_reloc (output_bfd, bfinfdpic_gotrel_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ bfinfdpic_got_section (info),
+ bfinfdpic_got_initial_offset (info)
+ + entry->got_entry)
+ + bfinfdpic_got_section (info)
+ ->output_section->vma
+ + bfinfdpic_got_section (info)->output_offset,
+ R_byte4_data, idx, ad, entry);
+
+ bfd_put_32 (output_bfd, ad,
+ bfinfdpic_got_section (info)->contents
+ + bfinfdpic_got_initial_offset (info)
+ + entry->got_entry);
+ }
+
+ /* Generate relocation for GOT entry pointing to a canonical
+ function descriptor. */
+ if (entry->fdgot_entry)
+ {
+ int reloc, idx;
+ bfd_vma ad = 0;
+
+ if (! (entry->symndx == -1
+ && entry->d.h->root.type == bfd_link_hash_undefweak
+ && BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+ {
+ /* If the symbol is dynamic and there may be dynamic symbol
+ resolution because we are, or are linked with, a shared
+ library, emit a FUNCDESC relocation such that the dynamic
+ linker will allocate the function descriptor. If the
+ symbol needs a non-local function descriptor but binds
+ locally (e.g., its visibility is protected, emit a
+ dynamic relocation decayed to section+offset. */
+ if (entry->symndx == -1
+ && ! BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h)
+ && BFINFDPIC_SYM_LOCAL (info, entry->d.h)
+ && !(info->executable && !info->pie))
+ {
+ reloc = R_BFIN_FUNCDESC;
+ idx = elf_section_data (entry->d.h->root.u.def.section
+ ->output_section)->dynindx;
+ ad = entry->d.h->root.u.def.section->output_offset
+ + entry->d.h->root.u.def.value;
+ }
+ else if (entry->symndx == -1
+ && ! BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h))
+ {
+ reloc = R_BFIN_FUNCDESC;
+ idx = dynindx;
+ ad = addend;
+ if (ad)
+ return FALSE;
+ }
+ else
+ {
+ /* Otherwise, we know we have a private function descriptor,
+ so reference it directly. */
+ if (elf_hash_table (info)->dynamic_sections_created)
+ BFD_ASSERT (entry->privfd);
+ reloc = R_byte4_data;
+ idx = elf_section_data (bfinfdpic_got_section (info)
+ ->output_section)->dynindx;
+ ad = bfinfdpic_got_section (info)->output_offset
+ + bfinfdpic_got_initial_offset (info) + entry->fd_entry;
+ }
+
+ /* If there is room for dynamic symbol resolution, emit the
+ dynamic relocation. However, if we're linking an
+ executable at a fixed location, we won't have emitted a
+ dynamic symbol entry for the got section, so idx will be
+ zero, which means we can and should compute the address
+ of the private descriptor ourselves. */
+ if (info->executable && !info->pie
+ && (entry->symndx != -1
+ || BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h)))
+ {
+ ad += bfinfdpic_got_section (info)->output_section->vma;
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section (info),
+ bfinfdpic_got_section (info)
+ ->output_section->vma
+ + bfinfdpic_got_section (info)
+ ->output_offset
+ + bfinfdpic_got_initial_offset (info)
+ + entry->fdgot_entry, entry);
+ }
+ else
+ _bfinfdpic_add_dyn_reloc (output_bfd,
+ bfinfdpic_gotrel_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ bfinfdpic_got_section (info),
+ bfinfdpic_got_initial_offset (info)
+ + entry->fdgot_entry)
+ + bfinfdpic_got_section (info)
+ ->output_section->vma
+ + bfinfdpic_got_section (info)
+ ->output_offset,
+ reloc, idx, ad, entry);
+ }
+
+ bfd_put_32 (output_bfd, ad,
+ bfinfdpic_got_section (info)->contents
+ + bfinfdpic_got_initial_offset (info)
+ + entry->fdgot_entry);
+ }
+
+ /* Generate relocation to fill in a private function descriptor in
+ the GOT. */
+ if (entry->fd_entry)
+ {
+ int idx = dynindx;
+ bfd_vma ad = addend;
+ bfd_vma ofst;
+ long lowword, highword;
+
+ /* If the symbol is dynamic but binds locally, use
+ section+offset. */
+ if (sec && (entry->symndx != -1
+ || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+ {
+ if (entry->symndx == -1)
+ ad += entry->d.h->root.u.def.value;
+ else
+ ad += sym->st_value;
+ ad += sec->output_offset;
+ if (sec->output_section && elf_section_data (sec->output_section))
+ idx = elf_section_data (sec->output_section)->dynindx;
+ else
+ idx = 0;
+ }
+
+ /* If we're linking an executable at a fixed address, we can
+ omit the dynamic relocation as long as the symbol is local to
+ this module. */
+ if (info->executable && !info->pie
+ && (entry->symndx != -1 || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
+ {
+ if (sec)
+ ad += sec->output_section->vma;
+ ofst = 0;
+ if (entry->symndx != -1
+ || entry->d.h->root.type != bfd_link_hash_undefweak)
+ {
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section (info),
+ bfinfdpic_got_section (info)
+ ->output_section->vma
+ + bfinfdpic_got_section (info)
+ ->output_offset
+ + bfinfdpic_got_initial_offset (info)
+ + entry->fd_entry, entry);
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section (info),
+ bfinfdpic_got_section (info)
+ ->output_section->vma
+ + bfinfdpic_got_section (info)
+ ->output_offset
+ + bfinfdpic_got_initial_offset (info)
+ + entry->fd_entry + 4, entry);
+ }
+ }
+ else
+ {
+ ofst
+ = _bfinfdpic_add_dyn_reloc (output_bfd,
+ entry->lazyplt
+ ? bfinfdpic_pltrel_section (info)
+ : bfinfdpic_gotrel_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ bfinfdpic_got_section (info),
+ bfinfdpic_got_initial_offset (info)
+ + entry->fd_entry)
+ + bfinfdpic_got_section (info)
+ ->output_section->vma
+ + bfinfdpic_got_section (info)
+ ->output_offset,
+ R_BFIN_FUNCDESC_VALUE, idx, ad, entry);
+ }
+
+ /* If we've omitted the dynamic relocation, just emit the fixed
+ addresses of the symbol and of the local GOT base offset. */
+ if (info->executable && !info->pie && sec && sec->output_section)
+ {
+ lowword = ad;
+ highword = bfinfdpic_got_section (info)->output_section->vma
+ + bfinfdpic_got_section (info)->output_offset
+ + bfinfdpic_got_initial_offset (info);
+ }
+ else if (entry->lazyplt)
+ {
+ if (ad)
+ return FALSE;
+
+ fd_lazy_rel_offset = ofst;
+
+ /* A function descriptor used for lazy or local resolving is
+ initialized such that its high word contains the output
+ section index in which the PLT entries are located, and
+ the low word contains the address of the lazy PLT entry
+ entry point, that must be within the memory region
+ assigned to that section. */
+ lowword = entry->lzplt_entry + 4
+ + bfinfdpic_plt_section (info)->output_offset
+ + bfinfdpic_plt_section (info)->output_section->vma;
+ highword = _bfinfdpic_osec_to_segment
+ (output_bfd, bfinfdpic_plt_section (info)->output_section);
+ }
+ else
+ {
+ /* A function descriptor for a local function gets the index
+ of the section. For a non-local function, it's
+ disregarded. */
+ lowword = ad;
+ if (entry->symndx == -1 && entry->d.h->dynindx != -1
+ && entry->d.h->dynindx == idx)
+ highword = 0;
+ else
+ highword = _bfinfdpic_osec_to_segment
+ (output_bfd, sec->output_section);
+ }
+
+ bfd_put_32 (output_bfd, lowword,
+ bfinfdpic_got_section (info)->contents
+ + bfinfdpic_got_initial_offset (info)
+ + entry->fd_entry);
+ bfd_put_32 (output_bfd, highword,
+ bfinfdpic_got_section (info)->contents
+ + bfinfdpic_got_initial_offset (info)
+ + entry->fd_entry + 4);
+ }
+
+ /* Generate code for the PLT entry. */
+ if (entry->plt_entry != (bfd_vma) -1)
+ {
+ bfd_byte *plt_code = bfinfdpic_plt_section (info)->contents
+ + entry->plt_entry;
+
+ BFD_ASSERT (entry->fd_entry);
+
+ /* Figure out what kind of PLT entry we need, depending on the
+ location of the function descriptor within the GOT. */
+ if (entry->fd_entry >= -(1 << (18 - 1))
+ && entry->fd_entry + 4 < (1 << (18 - 1)))
+ {
+ /* P1 = [P3 + fd_entry]; P3 = [P3 + fd_entry + 4] */
+ bfd_put_32 (output_bfd,
+ 0xe519 | ((entry->fd_entry << 14) & 0xFFFF0000),
+ plt_code);
+ bfd_put_32 (output_bfd,
+ 0xe51b | (((entry->fd_entry + 4) << 14) & 0xFFFF0000),
+ plt_code + 4);
+ plt_code += 8;
+ }
+ else
+ {
+ /* P1.L = fd_entry; P1.H = fd_entry;
+ P3 = P3 + P1;
+ P1 = [P3];
+ P3 = [P3 + 4]; */
+ bfd_put_32 (output_bfd,
+ 0xe109 | (entry->fd_entry << 16),
+ plt_code);
+ bfd_put_32 (output_bfd,
+ 0xe149 | (entry->fd_entry & 0xFFFF0000),
+ plt_code + 4);
+ bfd_put_16 (output_bfd, 0x5ad9, plt_code + 8);
+ bfd_put_16 (output_bfd, 0x9159, plt_code + 10);
+ bfd_put_16 (output_bfd, 0xac5b, plt_code + 12);
+ plt_code += 14;
+ }
+ /* JUMP (P1) */
+ bfd_put_16 (output_bfd, 0x0051, plt_code);
+ }
+
+ /* Generate code for the lazy PLT entry. */
+ if (entry->lzplt_entry != (bfd_vma) -1)
+ {
+ bfd_byte *lzplt_code = bfinfdpic_plt_section (info)->contents
+ + entry->lzplt_entry;
+ bfd_vma resolverStub_addr;
+
+ bfd_put_32 (output_bfd, fd_lazy_rel_offset, lzplt_code);
+ lzplt_code += 4;
+
+ resolverStub_addr = entry->lzplt_entry / BFINFDPIC_LZPLT_BLOCK_SIZE
+ * BFINFDPIC_LZPLT_BLOCK_SIZE + BFINFDPIC_LZPLT_RESOLV_LOC;
+ if (resolverStub_addr >= bfinfdpic_plt_initial_offset (info))
+ resolverStub_addr = bfinfdpic_plt_initial_offset (info) - LZPLT_NORMAL_SIZE - LZPLT_RESOLVER_EXTRA;
+
+ if (entry->lzplt_entry == resolverStub_addr)
+ {
+ /* This is a lazy PLT entry that includes a resolver call.
+ P2 = [P3];
+ R3 = [P3 + 4];
+ JUMP (P2); */
+ bfd_put_32 (output_bfd,
+ 0xa05b915a,
+ lzplt_code);
+ bfd_put_16 (output_bfd, 0x0052, lzplt_code + 4);
+ }
+ else
+ {
+ /* JUMP.S resolverStub */
+ bfd_put_16 (output_bfd,
+ 0x2000
+ | (((resolverStub_addr - entry->lzplt_entry)
+ / 2) & (((bfd_vma)1 << 12) - 1)),
+ lzplt_code);
+ }
+ }
+
+ return TRUE;
+}
+
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table or procedure linkage
@@ -1656,6 +2063,746 @@ elf32_bfin_reloc_type_class (const Elf_Internal_Rela * rela)
return reloc_class_normal;
}
}
+
+/* Relocate an Blackfin 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 relocatable
+ 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 relocatable 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 bfd_boolean
+bfinfdpic_relocate_section (bfd * output_bfd,
+ 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;
+ unsigned isec_segment, got_segment, plt_segment,
+ check_segment[2];
+ int silence_segment_error = !(info->shared || info->pie);
+
+ if (info->relocatable)
+ return TRUE;
+
+ symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+ relend = relocs + input_section->reloc_count;
+
+ isec_segment = _bfinfdpic_osec_to_segment (output_bfd,
+ input_section->output_section);
+ if (IS_FDPIC (output_bfd) && bfinfdpic_got_section (info))
+ got_segment = _bfinfdpic_osec_to_segment (output_bfd,
+ bfinfdpic_got_section (info)
+ ->output_section);
+ else
+ got_segment = -1;
+ if (IS_FDPIC (output_bfd) && elf_hash_table (info)->dynamic_sections_created)
+ plt_segment = _bfinfdpic_osec_to_segment (output_bfd,
+ bfinfdpic_plt_section (info)
+ ->output_section);
+ else
+ plt_segment = -1;
+
+ 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;
+ asection *osec;
+ struct bfinfdpic_relocs_info *picrel;
+ bfd_vma orig_addend = rel->r_addend;
+
+ r_type = ELF32_R_TYPE (rel->r_info);
+
+ if (r_type == R_BFIN_GNU_VTINHERIT
+ || r_type == R_BFIN_GNU_VTENTRY)
+ continue;
+
+ /* This is a final link. */
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ howto = bfin_reloc_type_lookup (input_bfd, r_type);
+ if (howto == NULL)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
+ h = NULL;
+ sym = NULL;
+ sec = NULL;
+
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ osec = sec = local_sections [r_symndx];
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ 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)
+ && ! BFINFDPIC_SYM_LOCAL (info, h))
+ {
+ sec = NULL;
+ relocation = 0;
+ }
+ else
+ 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->unresolved_syms_in_objects == RM_IGNORE
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
+ relocation = 0;
+ else
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset,
+ (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
+ || ELF_ST_VISIBILITY (h->other)))))
+ return FALSE;
+ relocation = 0;
+ }
+ osec = sec;
+ }
+
+ switch (r_type)
+ {
+ case R_pcrel24:
+ case R_pcrel24_jump_l:
+ case R_byte4_data:
+ if (! IS_FDPIC (output_bfd))
+ goto non_fdpic;
+
+ case R_BFIN_GOT17M4:
+ case R_BFIN_GOTHI:
+ case R_BFIN_GOTLO:
+ case R_BFIN_FUNCDESC_GOT17M4:
+ case R_BFIN_FUNCDESC_GOTHI:
+ case R_BFIN_FUNCDESC_GOTLO:
+ case R_BFIN_GOTOFF17M4:
+ case R_BFIN_GOTOFFHI:
+ case R_BFIN_GOTOFFLO:
+ case R_BFIN_FUNCDESC_GOTOFF17M4:
+ case R_BFIN_FUNCDESC_GOTOFFHI:
+ case R_BFIN_FUNCDESC_GOTOFFLO:
+ case R_BFIN_FUNCDESC:
+ case R_BFIN_FUNCDESC_VALUE:
+ if (h != NULL)
+ picrel = bfinfdpic_relocs_info_for_global (bfinfdpic_relocs_info
+ (info), input_bfd, h,
+ orig_addend, INSERT);
+ else
+ /* In order to find the entry we created before, we must
+ use the original addend, not the one that may have been
+ modified by _bfd_elf_rela_local_sym(). */
+ picrel = bfinfdpic_relocs_info_for_local (bfinfdpic_relocs_info
+ (info), input_bfd, r_symndx,
+ orig_addend, INSERT);
+ if (! picrel)
+ return FALSE;
+
+ if (!_bfinfdpic_emit_got_relocs_plt_entries (picrel, output_bfd, info,
+ osec, sym,
+ rel->r_addend))
+ {
+ (*_bfd_error_handler)
+ (_("%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"),
+ input_bfd, input_section, rel->r_offset, name);
+ return FALSE;
+
+ }
+
+ break;
+
+ default:
+ non_fdpic:
+ picrel = NULL;
+ if (h && ! BFINFDPIC_SYM_LOCAL (info, h))
+ {
+ info->callbacks->warning
+ (info, _("relocation references symbol not defined in the module"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ break;
+ }
+
+ switch (r_type)
+ {
+ case R_pcrel24:
+ case R_pcrel24_jump_l:
+ check_segment[0] = isec_segment;
+ if (! IS_FDPIC (output_bfd))
+ check_segment[1] = isec_segment;
+ else if (picrel->plt)
+ {
+ relocation = bfinfdpic_plt_section (info)->output_section->vma
+ + bfinfdpic_plt_section (info)->output_offset
+ + picrel->plt_entry;
+ check_segment[1] = plt_segment;
+ }
+ /* We don't want to warn on calls to undefined weak symbols,
+ as calls to them must be protected by non-NULL tests
+ anyway, and unprotected calls would invoke undefined
+ behavior. */
+ else if (picrel->symndx == -1
+ && picrel->d.h->root.type == bfd_link_hash_undefweak)
+ check_segment[1] = check_segment[0];
+ else
+ check_segment[1] = sec
+ ? _bfinfdpic_osec_to_segment (output_bfd, sec->output_section)
+ : (unsigned)-1;
+ break;
+
+ case R_BFIN_GOT17M4:
+ case R_BFIN_GOTHI:
+ case R_BFIN_GOTLO:
+ relocation = picrel->got_entry;
+ check_segment[0] = check_segment[1] = got_segment;
+ break;
+
+ case R_BFIN_FUNCDESC_GOT17M4:
+ case R_BFIN_FUNCDESC_GOTHI:
+ case R_BFIN_FUNCDESC_GOTLO:
+ relocation = picrel->fdgot_entry;
+ check_segment[0] = check_segment[1] = got_segment;
+ break;
+
+ case R_BFIN_GOTOFFHI:
+ case R_BFIN_GOTOFF17M4:
+ case R_BFIN_GOTOFFLO:
+ relocation -= bfinfdpic_got_section (info)->output_section->vma
+ + bfinfdpic_got_section (info)->output_offset
+ + bfinfdpic_got_initial_offset (info);
+ check_segment[0] = got_segment;
+ check_segment[1] = sec
+ ? _bfinfdpic_osec_to_segment (output_bfd, sec->output_section)
+ : (unsigned)-1;
+ break;
+
+ case R_BFIN_FUNCDESC_GOTOFF17M4:
+ case R_BFIN_FUNCDESC_GOTOFFHI:
+ case R_BFIN_FUNCDESC_GOTOFFLO:
+ relocation = picrel->fd_entry;
+ check_segment[0] = check_segment[1] = got_segment;
+ break;
+
+ case R_BFIN_FUNCDESC:
+ {
+ int dynindx;
+ bfd_vma addend = rel->r_addend;
+
+ if (! (h && h->root.type == bfd_link_hash_undefweak
+ && BFINFDPIC_SYM_LOCAL (info, h)))
+ {
+ /* If the symbol is dynamic and there may be dynamic
+ symbol resolution because we are or are linked with a
+ shared library, emit a FUNCDESC relocation such that
+ the dynamic linker will allocate the function
+ descriptor. If the symbol needs a non-local function
+ descriptor but binds locally (e.g., its visibility is
+ protected, emit a dynamic relocation decayed to
+ section+offset. */
+ if (h && ! BFINFDPIC_FUNCDESC_LOCAL (info, h)
+ && BFINFDPIC_SYM_LOCAL (info, h)
+ && !(info->executable && !info->pie))
+ {
+ dynindx = elf_section_data (h->root.u.def.section
+ ->output_section)->dynindx;
+ addend += h->root.u.def.section->output_offset
+ + h->root.u.def.value;
+ }
+ else if (h && ! BFINFDPIC_FUNCDESC_LOCAL (info, h))
+ {
+ if (addend)
+ {
+ info->callbacks->warning
+ (info, _("R_BFIN_FUNCDESC references dynamic symbol with nonzero addend"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ dynindx = h->dynindx;
+ }
+ else
+ {
+ /* Otherwise, we know we have a private function
+ descriptor, so reference it directly. */
+ BFD_ASSERT (picrel->privfd);
+ r_type = R_byte4_data;
+ dynindx = elf_section_data (bfinfdpic_got_section (info)
+ ->output_section)->dynindx;
+ addend = bfinfdpic_got_section (info)->output_offset
+ + bfinfdpic_got_initial_offset (info)
+ + picrel->fd_entry;
+ }
+
+ /* If there is room for dynamic symbol resolution, emit
+ the dynamic relocation. However, if we're linking an
+ executable at a fixed location, we won't have emitted a
+ dynamic symbol entry for the got section, so idx will
+ be zero, which means we can and should compute the
+ address of the private descriptor ourselves. */
+ if (info->executable && !info->pie
+ && (!h || BFINFDPIC_FUNCDESC_LOCAL (info, h)))
+ {
+ addend += bfinfdpic_got_section (info)->output_section->vma;
+ if ((bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ {
+ if (_bfinfdpic_osec_readonly_p (output_bfd,
+ input_section
+ ->output_section))
+ {
+ info->callbacks->warning
+ (info,
+ _("cannot emit fixups in read-only section"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section
+ (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ input_section, rel->r_offset)
+ + input_section
+ ->output_section->vma
+ + input_section->output_offset,
+ picrel);
+ }
+ }
+ else if ((bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ {
+ if (_bfinfdpic_osec_readonly_p (output_bfd,
+ input_section
+ ->output_section))
+ {
+ info->callbacks->warning
+ (info,
+ _("cannot emit dynamic relocations in read-only section"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ _bfinfdpic_add_dyn_reloc (output_bfd,
+ bfinfdpic_gotrel_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ input_section, rel->r_offset)
+ + input_section
+ ->output_section->vma
+ + input_section->output_offset,
+ r_type, dynindx, addend, picrel);
+ }
+ else
+ addend += bfinfdpic_got_section (info)->output_section->vma;
+ }
+
+ /* We want the addend in-place because dynamic
+ relocations are REL. Setting relocation to it should
+ arrange for it to be installed. */
+ relocation = addend - rel->r_addend;
+ }
+ check_segment[0] = check_segment[1] = got_segment;
+ break;
+
+ case R_byte4_data:
+ if (! IS_FDPIC (output_bfd))
+ {
+ check_segment[0] = check_segment[1] = -1;
+ break;
+ }
+ /* Fall through. */
+ case R_BFIN_FUNCDESC_VALUE:
+ {
+ int dynindx;
+ bfd_vma addend = rel->r_addend;
+
+ /* If the symbol is dynamic but binds locally, use
+ section+offset. */
+ if (h && ! BFINFDPIC_SYM_LOCAL (info, h))
+ {
+ if (addend && r_type == R_BFIN_FUNCDESC_VALUE)
+ {
+ info->callbacks->warning
+ (info, _("R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ dynindx = h->dynindx;
+ }
+ else
+ {
+ if (h)
+ addend += h->root.u.def.value;
+ else
+ addend += sym->st_value;
+ if (osec)
+ addend += osec->output_offset;
+ if (osec && osec->output_section
+ && ! bfd_is_abs_section (osec->output_section)
+ && ! bfd_is_und_section (osec->output_section))
+ dynindx = elf_section_data (osec->output_section)->dynindx;
+ else
+ dynindx = 0;
+ }
+
+ /* If we're linking an executable at a fixed address, we
+ can omit the dynamic relocation as long as the symbol
+ is defined in the current link unit (which is implied
+ by its output section not being NULL). */
+ if (info->executable && !info->pie
+ && (!h || BFINFDPIC_SYM_LOCAL (info, h)))
+ {
+ if (osec)
+ addend += osec->output_section->vma;
+ if (IS_FDPIC (input_bfd)
+ && (bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ {
+ if (_bfinfdpic_osec_readonly_p (output_bfd,
+ input_section
+ ->output_section))
+ {
+ info->callbacks->warning
+ (info,
+ _("cannot emit fixups in read-only section"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ if (!h || h->root.type != bfd_link_hash_undefweak)
+ {
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section
+ (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ input_section, rel->r_offset)
+ + input_section
+ ->output_section->vma
+ + input_section->output_offset,
+ picrel);
+ if (r_type == R_BFIN_FUNCDESC_VALUE)
+ _bfinfdpic_add_rofixup
+ (output_bfd,
+ bfinfdpic_gotfixup_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ input_section, rel->r_offset)
+ + input_section->output_section->vma
+ + input_section->output_offset + 4, picrel);
+ }
+ }
+ }
+ else
+ {
+ if ((bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ {
+ if (_bfinfdpic_osec_readonly_p (output_bfd,
+ input_section
+ ->output_section))
+ {
+ info->callbacks->warning
+ (info,
+ _("cannot emit dynamic relocations in read-only section"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ _bfinfdpic_add_dyn_reloc (output_bfd,
+ bfinfdpic_gotrel_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ input_section, rel->r_offset)
+ + input_section
+ ->output_section->vma
+ + input_section->output_offset,
+ r_type, dynindx, addend, picrel);
+ }
+ else if (osec)
+ addend += osec->output_section->vma;
+ /* We want the addend in-place because dynamic
+ relocations are REL. Setting relocation to it
+ should arrange for it to be installed. */
+ relocation = addend - rel->r_addend;
+ }
+
+ if (r_type == R_BFIN_FUNCDESC_VALUE)
+ {
+ /* If we've omitted the dynamic relocation, just emit
+ the fixed addresses of the symbol and of the local
+ GOT base offset. */
+ if (info->executable && !info->pie
+ && (!h || BFINFDPIC_SYM_LOCAL (info, h)))
+ bfd_put_32 (output_bfd,
+ bfinfdpic_got_section (info)->output_section->vma
+ + bfinfdpic_got_section (info)->output_offset
+ + bfinfdpic_got_initial_offset (info),
+ contents + rel->r_offset + 4);
+ else
+ /* A function descriptor used for lazy or local
+ resolving is initialized such that its high word
+ contains the output section index in which the
+ PLT entries are located, and the low word
+ contains the offset of the lazy PLT entry entry
+ point into that section. */
+ bfd_put_32 (output_bfd,
+ h && ! BFINFDPIC_SYM_LOCAL (info, h)
+ ? 0
+ : _bfinfdpic_osec_to_segment (output_bfd,
+ sec
+ ->output_section),
+ contents + rel->r_offset + 4);
+ }
+ }
+ check_segment[0] = check_segment[1] = got_segment;
+ break;
+
+ default:
+ check_segment[0] = isec_segment;
+ check_segment[1] = sec
+ ? _bfinfdpic_osec_to_segment (output_bfd, sec->output_section)
+ : (unsigned)-1;
+ break;
+ }
+
+ if (check_segment[0] != check_segment[1] && IS_FDPIC (output_bfd))
+ {
+#if 1 /* If you take this out, remove the #error from fdpic-static-6.d
+ in the ld testsuite. */
+ /* This helps catch problems in GCC while we can't do more
+ than static linking. The idea is to test whether the
+ input file basename is crt0.o only once. */
+ if (silence_segment_error == 1)
+ silence_segment_error =
+ (strlen (input_bfd->filename) == 6
+ && strcmp (input_bfd->filename, "crt0.o") == 0)
+ || (strlen (input_bfd->filename) > 6
+ && strcmp (input_bfd->filename
+ + strlen (input_bfd->filename) - 7,
+ "/crt0.o") == 0)
+ ? -1 : 0;
+#endif
+ if (!silence_segment_error
+ /* We don't want duplicate errors for undefined
+ symbols. */
+ && !(picrel && picrel->symndx == -1
+ && picrel->d.h->root.type == bfd_link_hash_undefined))
+ info->callbacks->warning
+ (info,
+ (info->shared || info->pie)
+ ? _("relocations between different segments are not supported")
+ : _("warning: relocation references a different segment"),
+ name, input_bfd, input_section, rel->r_offset);
+ if (!silence_segment_error && (info->shared || info->pie))
+ return FALSE;
+ elf_elfheader (output_bfd)->e_flags |= EF_BFIN_PIC;
+ }
+
+ switch (r_type)
+ {
+ case R_BFIN_GOTOFFHI:
+ /* We need the addend to be applied before we shift the
+ value right. */
+ relocation += rel->r_addend;
+ /* Fall through. */
+ case R_BFIN_GOTHI:
+ case R_BFIN_FUNCDESC_GOTHI:
+ case R_BFIN_FUNCDESC_GOTOFFHI:
+ relocation >>= 16;
+ /* Fall through. */
+
+ case R_BFIN_GOTLO:
+ case R_BFIN_FUNCDESC_GOTLO:
+ case R_BFIN_GOTOFFLO:
+ case R_BFIN_FUNCDESC_GOTOFFLO:
+ relocation &= 0xffff;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (r_type)
+ {
+ case R_pcrel24:
+ case R_pcrel24_jump_l:
+ if (! IS_FDPIC (output_bfd) || ! picrel->plt)
+ break;
+ /* Fall through. */
+
+ /* When referencing a GOT entry, a function descriptor or a
+ PLT, we don't want the addend to apply to the reference,
+ but rather to the referenced symbol. The actual entry
+ will have already been created taking the addend into
+ account, so cancel it out here. */
+ case R_BFIN_GOT17M4:
+ case R_BFIN_GOTHI:
+ case R_BFIN_GOTLO:
+ case R_BFIN_FUNCDESC_GOT17M4:
+ case R_BFIN_FUNCDESC_GOTHI:
+ case R_BFIN_FUNCDESC_GOTLO:
+ case R_BFIN_FUNCDESC_GOTOFF17M4:
+ case R_BFIN_FUNCDESC_GOTOFFHI:
+ case R_BFIN_FUNCDESC_GOTOFFLO:
+ /* Note that we only want GOTOFFHI, not GOTOFFLO or GOTOFF17M4
+ here, since we do want to apply the addend to the others.
+ Note that we've applied the addend to GOTOFFHI before we
+ shifted it right. */
+ case R_BFIN_GOTOFFHI:
+ relocation -= rel->r_addend;
+ break;
+
+ default:
+ break;
+ }
+
+ if (r_type == R_pcrel24
+ || r_type == R_pcrel24_jump_l)
+ {
+ bfd_vma x;
+ bfd_vma address = rel->r_offset;
+
+ relocation += rel->r_addend;
+
+ /* Perform usual pc-relative correction. */
+ relocation -= input_section->output_section->vma + input_section->output_offset;
+ relocation -= address;
+
+ /* We are getting reloc_entry->address 2 byte off from
+ the start of instruction. Assuming absolute postion
+ of the reloc data. But, following code had been written assuming
+ reloc address is starting at begining of instruction.
+ To compensate that I have increased the value of
+ relocation by 1 (effectively 2) and used the addr -2 instead of addr. */
+
+ relocation += 2;
+ address -= 2;
+
+ relocation >>= 1;
+
+ x = bfd_get_16 (input_bfd, contents + address);
+ x = (x & 0xff00) | ((relocation >> 16) & 0xff);
+ bfd_put_16 (input_bfd, x, contents + address);
+
+ x = bfd_get_16 (input_bfd, contents + address + 2);
+ x = relocation & 0xFFFF;
+ bfd_put_16 (input_bfd, x, contents + address + 2);
+ r = bfd_reloc_ok;
+ }
+ else
+ 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 *) NULL;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ r = info->callbacks->reloc_overflow
+ (info, (h ? &h->root : NULL), 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;
+
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ 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 bfd_boolean
bfin_relocate_section (bfd * output_bfd,
@@ -1735,63 +2882,15 @@ bfin_relocate_section (bfd * output_bfd,
}
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 (!
- (!strcmp (h->root.root.string, ".__constant")
- || !strcmp (h->root.root.string, ".__operator")))
- {
- bfd_boolean warned;
- h = NULL;
- RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
- r_symndx, symtab_hdr, sym_hashes,
- h, sec, relocation,
- unresolved_reloc, warned);
-
- }
+ bfd_boolean warned;
+ h = NULL;
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+ unresolved_reloc, warned);
}
address = rel->r_offset;
- /* First, get stack relocs out of the way. */
- switch (r_type)
- {
- case R_push:
- reloc_stack_push (relocation + rel->r_addend);
- r = bfd_reloc_ok;
- goto done_reloc;
- case R_const:
- reloc_stack_push (rel->r_addend);
- r = bfd_reloc_ok;
- goto done_reloc;
- case R_add:
- case R_sub:
- case R_mult:
- case R_div:
- case R_mod:
- case R_lshift:
- case R_rshift:
- case R_neg:
- case R_and:
- case R_or:
- case R_xor:
- case R_land:
- case R_lor:
- case R_comp:
- case R_page:
- case R_hwpage:
- reloc_stack_operate (r_type);
- r = bfd_reloc_ok;
- goto done_reloc;
-
- default:
- if (!is_reloc_stack_empty())
- relocation = reloc_stack_pop ();
- break;
- }
/* Then, process normally. */
switch (r_type)
@@ -1917,10 +3016,10 @@ bfin_relocate_section (bfd * output_bfd,
/* We are getting reloc_entry->address 2 byte off from
the start of instruction. Assuming absolute postion
- of the reloc data. But, following code had been written assuming
+ of the reloc data. But, following code had been written assuming
reloc address is starting at begining of instruction.
- To compensate that I have increased the value of
- relocation by 1 (effectively 2) and used the addr -2 instead of addr. */
+ To compensate that I have increased the value of
+ relocation by 1 (effectively 2) and used the addr -2 instead of addr. */
relocation += 2;
address -= 2;
@@ -1947,7 +3046,6 @@ bfin_relocate_section (bfd * output_bfd,
break;
}
- done_reloc:
/* Dynamic relocs are not propagated for SEC_DEBUGGING sections
because such sections are not SEC_ALLOC and thus ld.so will
not process them. */
@@ -2040,6 +3138,17 @@ bfin_gc_mark_hook (asection * sec,
/* Update the got entry reference counts for the section being removed. */
static bfd_boolean
+bfinfdpic_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *sec ATTRIBUTE_UNUSED,
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED)
+{
+ return TRUE;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+
+static bfd_boolean
bfin_gc_sweep_hook (bfd * abfd,
struct bfd_link_info *info,
asection * sec,
@@ -2107,35 +3216,1509 @@ bfin_gc_sweep_hook (bfd * abfd,
break;
}
}
+ return TRUE;
+}
+
+/* We need dynamic symbols for every section, since segments can
+ relocate independently. */
+static bfd_boolean
+_bfinfdpic_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info
+ ATTRIBUTE_UNUSED,
+ asection *p ATTRIBUTE_UNUSED)
+{
+ switch (elf_section_data (p)->this_hdr.sh_type)
+ {
+ case SHT_PROGBITS:
+ case SHT_NOBITS:
+ /* If sh_type is yet undecided, assume it could be
+ SHT_PROGBITS/SHT_NOBITS. */
+ case SHT_NULL:
+ return FALSE;
+
+ /* There shouldn't be section relative relocations
+ against any other section. */
+ default:
+ return TRUE;
+ }
+}
+
+/* Create a .got section, as well as its additional info field. This
+ is almost entirely copied from
+ elflink.c:_bfd_elf_create_got_section(). */
+
+static bfd_boolean
+_bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
+{
+ flagword flags, pltflags;
+ asection *s;
+ struct elf_link_hash_entry *h;
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ int ptralign;
+ int offset;
+
+ /* This function may be called more than once. */
+ s = bfd_get_section_by_name (abfd, ".got");
+ if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0)
+ return TRUE;
+
+ /* Machine specific: although pointers are 32-bits wide, we want the
+ GOT to be aligned to a 64-bit boundary, such that function
+ descriptors in it can be accessed with 64-bit loads and
+ stores. */
+ ptralign = 3;
+
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED);
+ pltflags = flags;
+
+ s = bfd_make_section_with_flags (abfd, ".got", flags);
+ if (s == NULL
+ || !bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+
+ if (bed->want_got_plt)
+ {
+ s = bfd_make_section_with_flags (abfd, ".got.plt", flags);
+ if (s == NULL
+ || !bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+ }
+
+ if (bed->want_got_sym)
+ {
+ /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got
+ (or .got.plt) section. We don't do this in the linker script
+ because we don't want to define the symbol if we are not creating
+ a global offset table. */
+ h = _bfd_elf_define_linkage_sym (abfd, info, s, "_GLOBAL_OFFSET_TABLE_");
+ elf_hash_table (info)->hgot = h;
+ if (h == NULL)
+ return FALSE;
+
+ /* Machine-specific: we want the symbol for executables as
+ well. */
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* The first bit of the global offset table is the header. */
+ s->size += bed->got_header_size;
+
+ /* This is the machine-specific part. Create and initialize section
+ data for the got. */
+ if (IS_FDPIC (abfd))
+ {
+ bfinfdpic_got_section (info) = s;
+ bfinfdpic_relocs_info (info) = htab_try_create (1,
+ bfinfdpic_relocs_info_hash,
+ bfinfdpic_relocs_info_eq,
+ (htab_del) NULL);
+ if (! bfinfdpic_relocs_info (info))
+ return FALSE;
+
+ s = bfd_make_section_with_flags (abfd, ".rel.got",
+ (flags | SEC_READONLY));
+ if (s == NULL
+ || ! bfd_set_section_alignment (abfd, s, 2))
+ return FALSE;
+
+ bfinfdpic_gotrel_section (info) = s;
+
+ /* Machine-specific. */
+ s = bfd_make_section_with_flags (abfd, ".rofixup",
+ (flags | SEC_READONLY));
+ if (s == NULL
+ || ! bfd_set_section_alignment (abfd, s, 2))
+ return FALSE;
+
+ bfinfdpic_gotfixup_section (info) = s;
+ offset = -2048;
+ flags = BSF_GLOBAL;
+ }
+ else
+ {
+ offset = 2048;
+ flags = BSF_GLOBAL | BSF_WEAK;
+ }
return TRUE;
}
+/* Make sure the got and plt sections exist, and that our pointers in
+ the link hash table point to them. */
-/* Merge backend specific data from an object file to the output
- object file when linking. */
static bfd_boolean
-elf32_bfin_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
+elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
{
- flagword out_flags;
- flagword in_flags;
+ /* This is mostly copied from
+ elflink.c:_bfd_elf_create_dynamic_sections(). */
+ flagword flags, pltflags;
+ asection *s;
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
+ /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
+ .rel[a].bss sections. */
+
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED);
+
+ pltflags = flags;
+ pltflags |= SEC_CODE;
+ if (bed->plt_not_loaded)
+ pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS);
+ if (bed->plt_readonly)
+ pltflags |= SEC_READONLY;
+
+ s = bfd_make_section (abfd, ".plt");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, pltflags)
+ || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ return FALSE;
+ /* Blackfin-specific: remember it. */
+ bfinfdpic_plt_section (info) = s;
+
+ if (bed->want_plt_sym)
+ {
+ /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
+ .plt section. */
+ struct elf_link_hash_entry *h;
+ struct bfd_link_hash_entry *bh = NULL;
- if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
- || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ if (! (_bfd_generic_link_add_one_symbol
+ (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, 0, NULL,
+ FALSE, get_elf_backend_data (abfd)->collect, &bh)))
+ return FALSE;
+ h = (struct elf_link_hash_entry *) bh;
+ h->def_regular = 1;
+ h->type = STT_OBJECT;
+
+ if (! info->executable
+ && ! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* Blackfin-specific: we want rel relocations for the plt. */
+ s = bfd_make_section (abfd, ".rel.plt");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ return FALSE;
+ /* Blackfin-specific: remember it. */
+ bfinfdpic_pltrel_section (info) = s;
+
+ /* Blackfin-specific: we want to create the GOT in the Blackfin way. */
+ if (! _bfin_create_got_section (abfd, info))
+ return FALSE;
+
+ /* Blackfin-specific: make sure we created everything we wanted. */
+ BFD_ASSERT (bfinfdpic_got_section (info) && bfinfdpic_gotrel_section (info)
+ /* && bfinfdpic_gotfixup_section (info) */
+ && bfinfdpic_plt_section (info)
+ && bfinfdpic_pltrel_section (info));
+
+ if (bed->want_dynbss)
+ {
+ /* The .dynbss section is a place to put symbols which are defined
+ by dynamic objects, are referenced by regular objects, and are
+ not functions. We must allocate space for them in the process
+ image and use a R_*_COPY reloc to tell the dynamic linker to
+ initialize them at run time. The linker script puts the .dynbss
+ section into the .bss section of the final image. */
+ s = bfd_make_section (abfd, ".dynbss");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED))
+ return FALSE;
+
+ /* The .rel[a].bss section holds copy relocs. This section is not
+ normally needed. We need to create it here, though, so that the
+ linker will map it to an output section. We can't just create it
+ only if we need it, because we will not know whether we need it
+ until we have seen all the input files, and the first time the
+ main linker code calls BFD after examining all the input files
+ (size_dynamic_sections) the input sections have already been
+ mapped to the output sections. If the section turns out not to
+ be needed, we can discard it later. We will never need this
+ section when generating a shared object, since they do not use
+ copy relocs. */
+ if (! info->shared)
+ {
+ s = bfd_make_section (abfd,
+ (bed->default_use_rela_p
+ ? ".rela.bss" : ".rel.bss"));
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
+
+#define DEFAULT_STACK_SIZE 0x20000
+
+/* This structure is used to collect the number of entries present in
+ each addressable range of the got. */
+struct _bfinfdpic_dynamic_got_info
+{
+ /* Several bits of information about the current link. */
+ struct bfd_link_info *info;
+ /* Total size needed for GOT entries within the 18- or 32-bit
+ ranges. */
+ bfd_vma got17m4, gothilo;
+ /* Total size needed for function descriptor entries within the 18-
+ or 32-bit ranges. */
+ bfd_vma fd17m4, fdhilo;
+ /* Total size needed function descriptor entries referenced in PLT
+ entries, that would be profitable to place in offsets close to
+ the PIC register. */
+ bfd_vma fdplt;
+ /* Total size needed by lazy PLT entries. */
+ bfd_vma lzplt;
+ /* Number of relocations carried over from input object files. */
+ unsigned long relocs;
+ /* Number of fixups introduced by relocations in input object files. */
+ unsigned long fixups;
+};
+
+/* Compute the total GOT size required by each symbol in each range.
+ Symbols may require up to 4 words in the GOT: an entry pointing to
+ the symbol, an entry pointing to its function descriptor, and a
+ private function descriptors taking two words. */
+
+static int
+_bfinfdpic_count_got_plt_entries (void **entryp, void *dinfo_)
+{
+ struct bfinfdpic_relocs_info *entry = *entryp;
+ struct _bfinfdpic_dynamic_got_info *dinfo = dinfo_;
+ unsigned relocs = 0, fixups = 0;
+
+ /* Allocate space for a GOT entry pointing to the symbol. */
+ if (entry->got17m4)
+ dinfo->got17m4 += 4;
+ else if (entry->gothilo)
+ dinfo->gothilo += 4;
+ else
+ entry->relocs32--;
+ entry->relocs32++;
+
+ /* Allocate space for a GOT entry pointing to the function
+ descriptor. */
+ if (entry->fdgot17m4)
+ dinfo->got17m4 += 4;
+ else if (entry->fdgothilo)
+ dinfo->gothilo += 4;
+ else
+ entry->relocsfd--;
+ entry->relocsfd++;
+
+ /* Decide whether we need a PLT entry, a function descriptor in the
+ GOT, and a lazy PLT entry for this symbol. */
+ entry->plt = entry->call
+ && entry->symndx == -1 && ! BFINFDPIC_SYM_LOCAL (dinfo->info, entry->d.h)
+ && elf_hash_table (dinfo->info)->dynamic_sections_created;
+ entry->privfd = entry->plt
+ || entry->fdgoff17m4 || entry->fdgoffhilo
+ || ((entry->fd || entry->fdgot17m4 || entry->fdgothilo)
+ && (entry->symndx != -1
+ || BFINFDPIC_FUNCDESC_LOCAL (dinfo->info, entry->d.h)));
+ entry->lazyplt = entry->privfd
+ && entry->symndx == -1 && ! BFINFDPIC_SYM_LOCAL (dinfo->info, entry->d.h)
+ && ! (dinfo->info->flags & DF_BIND_NOW)
+ && elf_hash_table (dinfo->info)->dynamic_sections_created;
+
+ /* Allocate space for a function descriptor. */
+ if (entry->fdgoff17m4)
+ dinfo->fd17m4 += 8;
+ else if (entry->privfd && entry->plt)
+ dinfo->fdplt += 8;
+ else if (entry->privfd)
+ dinfo->fdhilo += 8;
+ else
+ entry->relocsfdv--;
+ entry->relocsfdv++;
+
+ if (entry->lazyplt)
+ dinfo->lzplt += LZPLT_NORMAL_SIZE;
+
+ if (!dinfo->info->executable || dinfo->info->pie)
+ relocs = entry->relocs32 + entry->relocsfd + entry->relocsfdv;
+ else
+ {
+ if (entry->symndx != -1 || BFINFDPIC_SYM_LOCAL (dinfo->info, entry->d.h))
+ {
+ if (entry->symndx != -1
+ || entry->d.h->root.type != bfd_link_hash_undefweak)
+ fixups += entry->relocs32 + 2 * entry->relocsfdv;
+ }
+ else
+ relocs += entry->relocs32 + entry->relocsfdv;
+
+ if (entry->symndx != -1
+ || BFINFDPIC_FUNCDESC_LOCAL (dinfo->info, entry->d.h))
+ {
+ if (entry->symndx != -1
+ || entry->d.h->root.type != bfd_link_hash_undefweak)
+ fixups += entry->relocsfd;
+ }
+ else
+ relocs += entry->relocsfd;
+ }
+
+ entry->dynrelocs += relocs;
+ entry->fixups += fixups;
+ dinfo->relocs += relocs;
+ dinfo->fixups += fixups;
+
+ return 1;
+}
+
+/* This structure is used to assign offsets to got entries, function
+ descriptors, plt entries and lazy plt entries. */
+
+struct _bfinfdpic_dynamic_got_plt_info
+{
+ /* Summary information collected with _bfinfdpic_count_got_plt_entries. */
+ struct _bfinfdpic_dynamic_got_info g;
+
+ /* For each addressable range, we record a MAX (positive) and MIN
+ (negative) value. CUR is used to assign got entries, and it's
+ incremented from an initial positive value to MAX, then from MIN
+ to FDCUR (unless FDCUR wraps around first). FDCUR is used to
+ assign function descriptors, and it's decreased from an initial
+ non-positive value to MIN, then from MAX down to CUR (unless CUR
+ wraps around first). All of MIN, MAX, CUR and FDCUR always point
+ to even words. ODD, if non-zero, indicates an odd word to be
+ used for the next got entry, otherwise CUR is used and
+ incremented by a pair of words, wrapping around when it reaches
+ MAX. FDCUR is decremented (and wrapped) before the next function
+ descriptor is chosen. FDPLT indicates the number of remaining
+ slots that can be used for function descriptors used only by PLT
+ entries. */
+ struct _bfinfdpic_dynamic_got_alloc_data
+ {
+ bfd_signed_vma max, cur, odd, fdcur, min;
+ bfd_vma fdplt;
+ } got17m4, gothilo;
+};
+
+/* Determine the positive and negative ranges to be used by each
+ offset range in the GOT. FDCUR and CUR, that must be aligned to a
+ double-word boundary, are the minimum (negative) and maximum
+ (positive) GOT offsets already used by previous ranges, except for
+ an ODD entry that may have been left behind. GOT and FD indicate
+ the size of GOT entries and function descriptors that must be
+ placed within the range from -WRAP to WRAP. If there's room left,
+ up to FDPLT bytes should be reserved for additional function
+ descriptors. */
+
+inline static bfd_signed_vma
+_bfinfdpic_compute_got_alloc_data (struct _bfinfdpic_dynamic_got_alloc_data *gad,
+ bfd_signed_vma fdcur,
+ bfd_signed_vma odd,
+ bfd_signed_vma cur,
+ bfd_vma got,
+ bfd_vma fd,
+ bfd_vma fdplt,
+ bfd_vma wrap)
+{
+ bfd_signed_vma wrapmin = -wrap;
+
+ /* Start at the given initial points. */
+ gad->fdcur = fdcur;
+ gad->cur = cur;
+
+ /* If we had an incoming odd word and we have any got entries that
+ are going to use it, consume it, otherwise leave gad->odd at
+ zero. We might force gad->odd to zero and return the incoming
+ odd such that it is used by the next range, but then GOT entries
+ might appear to be out of order and we wouldn't be able to
+ shorten the GOT by one word if it turns out to end with an
+ unpaired GOT entry. */
+ if (odd && got)
+ {
+ gad->odd = odd;
+ got -= 4;
+ odd = 0;
+ }
+ else
+ gad->odd = 0;
+
+ /* If we're left with an unpaired GOT entry, compute its location
+ such that we can return it. Otherwise, if got doesn't require an
+ odd number of words here, either odd was already zero in the
+ block above, or it was set to zero because got was non-zero, or
+ got was already zero. In the latter case, we want the value of
+ odd to carry over to the return statement, so we don't want to
+ reset odd unless the condition below is true. */
+ if (got & 4)
+ {
+ odd = cur + got;
+ got += 4;
+ }
+
+ /* Compute the tentative boundaries of this range. */
+ gad->max = cur + got;
+ gad->min = fdcur - fd;
+ gad->fdplt = 0;
+
+ /* If function descriptors took too much space, wrap some of them
+ around. */
+ if (gad->min < wrapmin)
+ {
+ gad->max += wrapmin - gad->min;
+ gad->min = wrapmin;
+ }
+ /* If there is space left and we have function descriptors
+ referenced in PLT entries that could take advantage of shorter
+ offsets, place them here. */
+ else if (fdplt && gad->min > wrapmin)
+ {
+ bfd_vma fds;
+ if ((bfd_vma) (gad->min - wrapmin) < fdplt)
+ fds = gad->min - wrapmin;
+ else
+ fds = fdplt;
+
+ fdplt -= fds;
+ gad->min -= fds;
+ gad->fdplt += fds;
+ }
+
+ /* If GOT entries took too much space, wrap some of them around.
+ This may well cause gad->min to become lower than wrapmin. This
+ will cause a relocation overflow later on, so we don't have to
+ report it here . */
+ if ((bfd_vma) gad->max > wrap)
+ {
+ gad->min -= gad->max - wrap;
+ gad->max = wrap;
+ }
+ /* If there is more space left, try to place some more function
+ descriptors for PLT entries. */
+ else if (fdplt && (bfd_vma) gad->max < wrap)
+ {
+ bfd_vma fds;
+ if ((bfd_vma) (wrap - gad->max) < fdplt)
+ fds = wrap - gad->max;
+ else
+ fds = fdplt;
+
+ fdplt -= fds;
+ gad->max += fds;
+ gad->fdplt += fds;
+ }
+
+ /* If odd was initially computed as an offset past the wrap point,
+ wrap it around. */
+ if (odd > gad->max)
+ odd = gad->min + odd - gad->max;
+
+ /* _bfinfdpic_get_got_entry() below will always wrap gad->cur if needed
+ before returning, so do it here too. This guarantees that,
+ should cur and fdcur meet at the wrap point, they'll both be
+ equal to min. */
+ if (gad->cur == gad->max)
+ gad->cur = gad->min;
+
+ return odd;
+}
+
+/* Compute the location of the next GOT entry, given the allocation
+ data for a range. */
+
+inline static bfd_signed_vma
+_bfinfdpic_get_got_entry (struct _bfinfdpic_dynamic_got_alloc_data *gad)
+{
+ bfd_signed_vma ret;
+
+ if (gad->odd)
+ {
+ /* If there was an odd word left behind, use it. */
+ ret = gad->odd;
+ gad->odd = 0;
+ }
+ else
+ {
+ /* Otherwise, use the word pointed to by cur, reserve the next
+ as an odd word, and skip to the next pair of words, possibly
+ wrapping around. */
+ ret = gad->cur;
+ gad->odd = gad->cur + 4;
+ gad->cur += 8;
+ if (gad->cur == gad->max)
+ gad->cur = gad->min;
+ }
+
+ return ret;
+}
+
+/* Compute the location of the next function descriptor entry in the
+ GOT, given the allocation data for a range. */
+
+inline static bfd_signed_vma
+_bfinfdpic_get_fd_entry (struct _bfinfdpic_dynamic_got_alloc_data *gad)
+{
+ /* If we're at the bottom, wrap around, and only then allocate the
+ next pair of words. */
+ if (gad->fdcur == gad->min)
+ gad->fdcur = gad->max;
+ return gad->fdcur -= 8;
+}
+
+/* Assign GOT offsets for every GOT entry and function descriptor.
+ Doing everything in a single pass is tricky. */
+
+static int
+_bfinfdpic_assign_got_entries (void **entryp, void *info_)
+{
+ struct bfinfdpic_relocs_info *entry = *entryp;
+ struct _bfinfdpic_dynamic_got_plt_info *dinfo = info_;
+
+ if (entry->got17m4)
+ entry->got_entry = _bfinfdpic_get_got_entry (&dinfo->got17m4);
+ else if (entry->gothilo)
+ entry->got_entry = _bfinfdpic_get_got_entry (&dinfo->gothilo);
+
+ if (entry->fdgot17m4)
+ entry->fdgot_entry = _bfinfdpic_get_got_entry (&dinfo->got17m4);
+ else if (entry->fdgothilo)
+ entry->fdgot_entry = _bfinfdpic_get_got_entry (&dinfo->gothilo);
+
+ if (entry->fdgoff17m4)
+ entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->got17m4);
+ else if (entry->plt && dinfo->got17m4.fdplt)
+ {
+ dinfo->got17m4.fdplt -= 8;
+ entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->got17m4);
+ }
+ else if (entry->plt)
+ {
+ dinfo->gothilo.fdplt -= 8;
+ entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->gothilo);
+ }
+ else if (entry->privfd)
+ entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->gothilo);
+
+ return 1;
+}
+
+/* Assign GOT offsets to private function descriptors used by PLT
+ entries (or referenced by 32-bit offsets), as well as PLT entries
+ and lazy PLT entries. */
+
+static int
+_bfinfdpic_assign_plt_entries (void **entryp, void *info_)
+{
+ struct bfinfdpic_relocs_info *entry = *entryp;
+ struct _bfinfdpic_dynamic_got_plt_info *dinfo = info_;
+
+ /* If this symbol requires a local function descriptor, allocate
+ one. */
+ if (entry->privfd && entry->fd_entry == 0)
+ {
+ if (dinfo->got17m4.fdplt)
+ {
+ entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->got17m4);
+ dinfo->got17m4.fdplt -= 8;
+ }
+ else
+ {
+ BFD_ASSERT (dinfo->gothilo.fdplt);
+ entry->fd_entry = _bfinfdpic_get_fd_entry (&dinfo->gothilo);
+ dinfo->gothilo.fdplt -= 8;
+ }
+ }
+
+ if (entry->plt)
+ {
+ int size;
+
+ /* We use the section's raw size to mark the location of the
+ next PLT entry. */
+ entry->plt_entry = bfinfdpic_plt_section (dinfo->g.info)->size;
+
+ /* Figure out the length of this PLT entry based on the
+ addressing mode we need to reach the function descriptor. */
+ BFD_ASSERT (entry->fd_entry);
+ if (entry->fd_entry >= -(1 << (18 - 1))
+ && entry->fd_entry + 4 < (1 << (18 - 1)))
+ size = 10;
+ else
+ size = 16;
+
+ bfinfdpic_plt_section (dinfo->g.info)->size += size;
+ }
+
+ if (entry->lazyplt)
+ {
+ entry->lzplt_entry = dinfo->g.lzplt;
+ dinfo->g.lzplt += LZPLT_NORMAL_SIZE;
+ /* If this entry is the one that gets the resolver stub, account
+ for the additional instruction. */
+ if (entry->lzplt_entry % BFINFDPIC_LZPLT_BLOCK_SIZE
+ == BFINFDPIC_LZPLT_RESOLV_LOC)
+ dinfo->g.lzplt += LZPLT_RESOLVER_EXTRA;
+ }
+
+ return 1;
+}
+
+/* Follow indirect and warning hash entries so that each got entry
+ points to the final symbol definition. P must point to a pointer
+ to the hash table we're traversing. Since this traversal may
+ modify the hash table, we set this pointer to NULL to indicate
+ we've made a potentially-destructive change to the hash table, so
+ the traversal must be restarted. */
+static int
+_bfinfdpic_resolve_final_relocs_info (void **entryp, void *p)
+{
+ struct bfinfdpic_relocs_info *entry = *entryp;
+ htab_t *htab = p;
+
+ if (entry->symndx == -1)
+ {
+ struct elf_link_hash_entry *h = entry->d.h;
+ struct bfinfdpic_relocs_info *oentry;
+
+ 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 (entry->d.h == h)
+ return 1;
+
+ oentry = bfinfdpic_relocs_info_for_global (*htab, 0, h, entry->addend,
+ NO_INSERT);
+
+ if (oentry)
+ {
+ /* Merge the two entries. */
+ bfinfdpic_pic_merge_early_relocs_info (oentry, entry);
+ htab_clear_slot (*htab, entryp);
+ return 1;
+ }
+
+ entry->d.h = h;
+
+ /* If we can't find this entry with the new bfd hash, re-insert
+ it, and get the traversal restarted. */
+ if (! htab_find (*htab, entry))
+ {
+ htab_clear_slot (*htab, entryp);
+ entryp = htab_find_slot (*htab, entry, INSERT);
+ if (! *entryp)
+ *entryp = entry;
+ /* Abort the traversal, since the whole table may have
+ moved, and leave it up to the parent to restart the
+ process. */
+ *(htab_t *)p = NULL;
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/* Set the sizes of the dynamic sections. */
+
+static bfd_boolean
+elf32_bfinfdpic_size_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
+{
+ bfd *dynobj;
+ asection *s;
+ struct _bfinfdpic_dynamic_got_plt_info gpinfo;
+ bfd_signed_vma odd;
+ bfd_vma limit;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Set the contents of the .interp section to the interpreter. */
+ if (info->executable)
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+
+ memset (&gpinfo, 0, sizeof (gpinfo));
+ gpinfo.g.info = info;
+
+ for (;;)
+ {
+ htab_t relocs = bfinfdpic_relocs_info (info);
+
+ htab_traverse (relocs, _bfinfdpic_resolve_final_relocs_info, &relocs);
+
+ if (relocs == bfinfdpic_relocs_info (info))
+ break;
+ }
+
+ htab_traverse (bfinfdpic_relocs_info (info), _bfinfdpic_count_got_plt_entries,
+ &gpinfo.g);
+
+ odd = 12;
+ /* Compute the total size taken by entries in the 18-bit range,
+ to tell how many PLT function descriptors we can bring into it
+ without causing it to overflow. */
+ limit = odd + gpinfo.g.got17m4 + gpinfo.g.fd17m4;
+ if (limit < (bfd_vma)1 << 18)
+ limit = ((bfd_vma)1 << 18) - limit;
+ else
+ limit = 0;
+ if (gpinfo.g.fdplt < limit)
+ limit = gpinfo.g.fdplt;
+
+ /* Determine the ranges of GOT offsets that we can use for each
+ range of addressing modes. */
+ odd = _bfinfdpic_compute_got_alloc_data (&gpinfo.got17m4,
+ 0,
+ odd,
+ 16,
+ gpinfo.g.got17m4,
+ gpinfo.g.fd17m4,
+ limit,
+ (bfd_vma)1 << (18-1));
+ odd = _bfinfdpic_compute_got_alloc_data (&gpinfo.gothilo,
+ gpinfo.got17m4.min,
+ odd,
+ gpinfo.got17m4.max,
+ gpinfo.g.gothilo,
+ gpinfo.g.fdhilo,
+ gpinfo.g.fdplt - gpinfo.got17m4.fdplt,
+ (bfd_vma)1 << (32-1));
+
+ /* Now assign (most) GOT offsets. */
+ htab_traverse (bfinfdpic_relocs_info (info), _bfinfdpic_assign_got_entries,
+ &gpinfo);
+
+ bfinfdpic_got_section (info)->size = gpinfo.gothilo.max
+ - gpinfo.gothilo.min
+ /* If an odd word is the last word of the GOT, we don't need this
+ word to be part of the GOT. */
+ - (odd + 4 == gpinfo.gothilo.max ? 4 : 0);
+ if (bfinfdpic_got_section (info)->size == 0)
+ bfinfdpic_got_section (info)->flags |= SEC_EXCLUDE;
+ else if (bfinfdpic_got_section (info)->size == 12
+ && ! elf_hash_table (info)->dynamic_sections_created)
+ {
+ bfinfdpic_got_section (info)->flags |= SEC_EXCLUDE;
+ bfinfdpic_got_section (info)->size = 0;
+ }
+ else
+ {
+ bfinfdpic_got_section (info)->contents =
+ (bfd_byte *) bfd_zalloc (dynobj,
+ bfinfdpic_got_section (info)->size);
+ if (bfinfdpic_got_section (info)->contents == NULL)
+ return FALSE;
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ /* Subtract the number of lzplt entries, since those will generate
+ relocations in the pltrel section. */
+ bfinfdpic_gotrel_section (info)->size =
+ (gpinfo.g.relocs - gpinfo.g.lzplt / LZPLT_NORMAL_SIZE)
+ * get_elf_backend_data (output_bfd)->s->sizeof_rel;
+ else
+ BFD_ASSERT (gpinfo.g.relocs == 0);
+ if (bfinfdpic_gotrel_section (info)->size == 0)
+ bfinfdpic_gotrel_section (info)->flags |= SEC_EXCLUDE;
+ else
+ {
+ bfinfdpic_gotrel_section (info)->contents =
+ (bfd_byte *) bfd_zalloc (dynobj,
+ bfinfdpic_gotrel_section (info)->size);
+ if (bfinfdpic_gotrel_section (info)->contents == NULL)
+ return FALSE;
+ }
+
+ bfinfdpic_gotfixup_section (info)->size = (gpinfo.g.fixups + 1) * 4;
+ if (bfinfdpic_gotfixup_section (info)->size == 0)
+ bfinfdpic_gotfixup_section (info)->flags |= SEC_EXCLUDE;
+ else
+ {
+ bfinfdpic_gotfixup_section (info)->contents =
+ (bfd_byte *) bfd_zalloc (dynobj,
+ bfinfdpic_gotfixup_section (info)->size);
+ if (bfinfdpic_gotfixup_section (info)->contents == NULL)
+ return FALSE;
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ bfinfdpic_pltrel_section (info)->size =
+ gpinfo.g.lzplt / LZPLT_NORMAL_SIZE * get_elf_backend_data (output_bfd)->s->sizeof_rel;
+ if (bfinfdpic_pltrel_section (info)->size == 0)
+ bfinfdpic_pltrel_section (info)->flags |= SEC_EXCLUDE;
+ else
+ {
+ bfinfdpic_pltrel_section (info)->contents =
+ (bfd_byte *) bfd_zalloc (dynobj,
+ bfinfdpic_pltrel_section (info)->size);
+ if (bfinfdpic_pltrel_section (info)->contents == NULL)
+ return FALSE;
+ }
+ }
+
+ /* Add 4 bytes for every block of at most 65535 lazy PLT entries,
+ such that there's room for the additional instruction needed to
+ call the resolver. Since _bfinfdpic_assign_got_entries didn't
+ account for them, our block size is 4 bytes smaller than the real
+ block size. */
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ bfinfdpic_plt_section (info)->size = gpinfo.g.lzplt
+ + ((gpinfo.g.lzplt + (BFINFDPIC_LZPLT_BLOCK_SIZE - 4) - LZPLT_NORMAL_SIZE)
+ / (BFINFDPIC_LZPLT_BLOCK_SIZE - 4) * LZPLT_RESOLVER_EXTRA);
+ }
+
+ /* Reset it, such that _bfinfdpic_assign_plt_entries() can use it to
+ actually assign lazy PLT entries addresses. */
+ gpinfo.g.lzplt = 0;
+
+ /* Save information that we're going to need to generate GOT and PLT
+ entries. */
+ bfinfdpic_got_initial_offset (info) = -gpinfo.gothilo.min;
+
+ if (get_elf_backend_data (output_bfd)->want_got_sym)
+ elf_hash_table (info)->hgot->root.u.def.value
+ += bfinfdpic_got_initial_offset (info);
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ bfinfdpic_plt_initial_offset (info) =
+ bfinfdpic_plt_section (info)->size;
+
+ htab_traverse (bfinfdpic_relocs_info (info), _bfinfdpic_assign_plt_entries,
+ &gpinfo);
+
+ /* Allocate the PLT section contents only after
+ _bfinfdpic_assign_plt_entries has a chance to add the size of the
+ non-lazy PLT entries. */
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ if (bfinfdpic_plt_section (info)->size == 0)
+ bfinfdpic_plt_section (info)->flags |= SEC_EXCLUDE;
+ else
+ {
+ bfinfdpic_plt_section (info)->contents =
+ (bfd_byte *) bfd_zalloc (dynobj,
+ bfinfdpic_plt_section (info)->size);
+ if (bfinfdpic_plt_section (info)->contents == NULL)
+ return FALSE;
+ }
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ if (bfinfdpic_got_section (info)->size)
+ if (!_bfd_elf_add_dynamic_entry (info, DT_PLTGOT, 0))
+ return FALSE;
+
+ if (bfinfdpic_pltrel_section (info)->size)
+ if (!_bfd_elf_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+ || !_bfd_elf_add_dynamic_entry (info, DT_PLTREL, DT_REL)
+ || !_bfd_elf_add_dynamic_entry (info, DT_JMPREL, 0))
+ return FALSE;
+
+ if (bfinfdpic_gotrel_section (info)->size)
+ if (!_bfd_elf_add_dynamic_entry (info, DT_REL, 0)
+ || !_bfd_elf_add_dynamic_entry (info, DT_RELSZ, 0)
+ || !_bfd_elf_add_dynamic_entry (info, DT_RELENT,
+ sizeof (Elf32_External_Rel)))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static bfd_boolean
+elf32_bfinfdpic_always_size_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
+{
+ if (!info->relocatable)
+ {
+ struct elf_link_hash_entry *h;
+ asection *sec;
+
+ /* Force a PT_GNU_STACK segment to be created. */
+ if (! elf_tdata (output_bfd)->stack_flags)
+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
+
+ /* Define __stacksize if it's not defined yet. */
+ h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize",
+ FALSE, FALSE, FALSE);
+ if (! h || h->root.type != bfd_link_hash_defined
+ || h->type != STT_OBJECT
+ || !h->def_regular)
+ {
+ struct bfd_link_hash_entry *bh = NULL;
+
+ if (!(_bfd_generic_link_add_one_symbol
+ (info, output_bfd, "__stacksize",
+ BSF_GLOBAL, bfd_abs_section_ptr, DEFAULT_STACK_SIZE,
+ (const char *) NULL, FALSE,
+ get_elf_backend_data (output_bfd)->collect, &bh)))
+ return FALSE;
+
+ h = (struct elf_link_hash_entry *) bh;
+ h->def_regular = 1;
+ h->type = STT_OBJECT;
+ }
+
+ /* Create a stack section, and set its alignment. */
+ sec = bfd_make_section (output_bfd, ".stack");
+
+ if (sec == NULL
+ || ! bfd_set_section_alignment (output_bfd, sec, 3))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static bfd_boolean
+elf32_bfinfdpic_modify_segment_map (bfd *output_bfd,
+ struct bfd_link_info *info)
+{
+ struct elf_segment_map *m;
+
+ /* objcopy and strip preserve what's already there using
+ elf32_bfinfdpic_copy_private_bfd_data (). */
+ if (! info)
return TRUE;
- in_flags = elf_elfheader (ibfd)->e_flags;
- out_flags = elf_elfheader (obfd)->e_flags;
+ for (m = elf_tdata (output_bfd)->segment_map; m != NULL; m = m->next)
+ if (m->p_type == PT_GNU_STACK)
+ break;
- if (!elf_flags_init (obfd))
+ if (m)
{
- elf_flags_init (obfd) = TRUE;
- elf_elfheader (obfd)->e_flags = in_flags;
+ asection *sec = bfd_get_section_by_name (output_bfd, ".stack");
+ struct elf_link_hash_entry *h;
+
+ if (sec)
+ {
+ /* Obtain the pointer to the __stacksize symbol. */
+ h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize",
+ FALSE, FALSE, FALSE);
+ 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;
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined);
+
+ /* Set the section size from the symbol value. We
+ intentionally ignore the symbol section. */
+ if (h->root.type == bfd_link_hash_defined)
+ sec->size = h->root.u.def.value;
+ else
+ sec->size = DEFAULT_STACK_SIZE;
+
+ /* Add the stack section to the PT_GNU_STACK segment,
+ such that its size and alignment requirements make it
+ to the segment. */
+ m->sections[m->count] = sec;
+ m->count++;
+ }
+ }
+
+ return TRUE;
+}
+
+static bfd_boolean
+elf32_bfinfdpic_finish_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
+{
+ bfd *dynobj;
+ asection *sdyn;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ if (bfinfdpic_got_section (info))
+ {
+ BFD_ASSERT (bfinfdpic_gotrel_section (info)->size
+ == (bfinfdpic_gotrel_section (info)->reloc_count
+ * sizeof (Elf32_External_Rel)));
+
+ if (bfinfdpic_gotfixup_section (info))
+ {
+ struct elf_link_hash_entry *hgot = elf_hash_table (info)->hgot;
+ bfd_vma got_value = hgot->root.u.def.value
+ + hgot->root.u.def.section->output_section->vma
+ + hgot->root.u.def.section->output_offset;
+
+ _bfinfdpic_add_rofixup (output_bfd, bfinfdpic_gotfixup_section (info),
+ got_value, 0);
+
+ if (bfinfdpic_gotfixup_section (info)->size
+ != (bfinfdpic_gotfixup_section (info)->reloc_count * 4))
+ {
+ (*_bfd_error_handler)
+ ("LINKER BUG: .rofixup section size mismatch");
+ return FALSE;
+ }
+ }
+ }
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ BFD_ASSERT (bfinfdpic_pltrel_section (info)->size
+ == (bfinfdpic_pltrel_section (info)->reloc_count
+ * sizeof (Elf32_External_Rel)));
+ }
+
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ Elf32_External_Dyn * dyncon;
+ Elf32_External_Dyn * dynconend;
+
+ BFD_ASSERT (sdyn != NULL);
+
+ dyncon = (Elf32_External_Dyn *) sdyn->contents;
+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
+
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ break;
+
+ case DT_PLTGOT:
+ dyn.d_un.d_ptr = bfinfdpic_got_section (info)->output_section->vma
+ + bfinfdpic_got_section (info)->output_offset
+ + bfinfdpic_got_initial_offset (info);
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_JMPREL:
+ dyn.d_un.d_ptr = bfinfdpic_pltrel_section (info)
+ ->output_section->vma
+ + bfinfdpic_pltrel_section (info)->output_offset;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTRELSZ:
+ dyn.d_un.d_val = bfinfdpic_pltrel_section (info)->size;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+ regular object. */
+
+static bfd_boolean
+elf32_bfinfdpic_adjust_dynamic_symbol
+(struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+{
+ bfd * dynobj;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ /* Make sure we know what is going on here. */
+ BFD_ASSERT (dynobj != NULL
+ && (h->u.weakdef != NULL
+ || (h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)));
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->u.weakdef != NULL)
+ {
+ BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
+ || h->u.weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->u.weakdef->root.u.def.section;
+ h->root.u.def.value = h->u.weakdef->root.u.def.value;
+ }
+
+ return TRUE;
+}
+
+/* Perform any actions needed for dynamic symbols. */
+
+static bfd_boolean
+elf32_bfinfdpic_finish_dynamic_symbol
+(bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
+{
+ return TRUE;
+}
+
+/* Decide whether to attempt to turn absptr or lsda encodings in
+ shared libraries into pcrel within the given input section. */
+
+static bfd_boolean
+bfinfdpic_elf_use_relative_eh_frame
+(bfd *input_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *eh_frame_section ATTRIBUTE_UNUSED)
+{
+ /* We can't use PC-relative encodings in FDPIC binaries, in general. */
+ return FALSE;
+}
+
+/* Adjust the contents of an eh_frame_hdr section before they're output. */
+
+static bfd_byte
+bfinfdpic_elf_encode_eh_address (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *osec, bfd_vma offset,
+ asection *loc_sec, bfd_vma loc_offset,
+ bfd_vma *encoded)
+{
+ struct elf_link_hash_entry *h;
+
+ h = elf_hash_table (info)->hgot;
+ BFD_ASSERT (h && h->root.type == bfd_link_hash_defined);
+
+ if (! h || (_bfinfdpic_osec_to_segment (abfd, osec)
+ == _bfinfdpic_osec_to_segment (abfd, loc_sec->output_section)))
+ return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
+ loc_sec, loc_offset, encoded);
+
+ BFD_ASSERT (_bfinfdpic_osec_to_segment (abfd, osec)
+ == (_bfinfdpic_osec_to_segment
+ (abfd, h->root.u.def.section->output_section)));
+
+ *encoded = osec->vma + offset
+ - (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+
+ return DW_EH_PE_datarel | DW_EH_PE_sdata4;
+}
+
+
+
+/* Look through the relocs for a section during the first phase.
+
+ Besides handling virtual table relocs for gc, we have to deal with
+ all sorts of PIC-related relocations. We describe below the
+ general plan on how to handle such relocations, even though we only
+ collect information at this point, storing them in hash tables for
+ perusal of later passes.
+
+ 32 relocations are propagated to the linker output when creating
+ position-independent output. LO16 and HI16 relocations are not
+ supposed to be encountered in this case.
+
+ LABEL16 should always be resolvable by the linker, since it's only
+ used by branches.
+
+ LABEL24, on the other hand, is used by calls. If it turns out that
+ the target of a call is a dynamic symbol, a PLT entry must be
+ created for it, which triggers the creation of a private function
+ descriptor and, unless lazy binding is disabled, a lazy PLT entry.
+
+ GPREL relocations require the referenced symbol to be in the same
+ segment as _gp, but this can only be checked later.
+
+ All GOT, GOTOFF and FUNCDESC relocations require a .got section to
+ exist. LABEL24 might as well, since it may require a PLT entry,
+ that will require a got.
+
+ Non-FUNCDESC GOT relocations require a GOT entry to be created
+ regardless of whether the symbol is dynamic. However, since a
+ global symbol that turns out to not be exported may have the same
+ address of a non-dynamic symbol, we don't assign GOT entries at
+ this point, such that we can share them in this case. A relocation
+ for the GOT entry always has to be created, be it to offset a
+ private symbol by the section load address, be it to get the symbol
+ resolved dynamically.
+
+ FUNCDESC GOT relocations require a GOT entry to be created, and
+ handled as if a FUNCDESC relocation was applied to the GOT entry in
+ an object file.
+
+ FUNCDESC relocations referencing a symbol that turns out to NOT be
+ dynamic cause a private function descriptor to be created. The
+ FUNCDESC relocation then decays to a 32 relocation that points at
+ the private descriptor. If the symbol is dynamic, the FUNCDESC
+ relocation is propagated to the linker output, such that the
+ dynamic linker creates the canonical descriptor, pointing to the
+ dynamically-resolved definition of the function.
+
+ Non-FUNCDESC GOTOFF relocations must always refer to non-dynamic
+ symbols that are assigned to the same segment as the GOT, but we
+ can only check this later, after we know the complete set of
+ symbols defined and/or exported.
+
+ FUNCDESC GOTOFF relocations require a function descriptor to be
+ created and, unless lazy binding is disabled or the symbol is not
+ dynamic, a lazy PLT entry. Since we can't tell at this point
+ whether a symbol is going to be dynamic, we have to decide later
+ whether to create a lazy PLT entry or bind the descriptor directly
+ to the private function.
+
+ FUNCDESC_VALUE relocations are not supposed to be present in object
+ files, but they may very well be simply propagated to the linker
+ output, since they have no side effect.
+
+
+ A function descriptor always requires a FUNCDESC_VALUE relocation.
+ Whether it's in .plt.rel or not depends on whether lazy binding is
+ enabled and on whether the referenced symbol is dynamic.
+
+ The existence of a lazy PLT requires the resolverStub lazy PLT
+ entry to be present.
+
+
+ As for assignment of GOT, PLT and lazy PLT entries, and private
+ descriptors, we might do them all sequentially, but we can do
+ better than that. For example, we can place GOT entries and
+ private function descriptors referenced using 12-bit operands
+ closer to the PIC register value, such that these relocations don't
+ overflow. Those that are only referenced with LO16 relocations
+ could come next, but we may as well place PLT-required function
+ descriptors in the 12-bit range to make them shorter. Symbols
+ referenced with LO16/HI16 may come next, but we may place
+ additional function descriptors in the 16-bit range if we can
+ reliably tell that we've already placed entries that are ever
+ referenced with only LO16. PLT entries are therefore generated as
+ small as possible, while not introducing relocation overflows in
+ GOT or FUNCDESC_GOTOFF relocations. Lazy PLT entries could be
+ generated before or after PLT entries, but not intermingled with
+ them, such that we can have more lazy PLT entries in range for a
+ branch to the resolverStub. The resolverStub should be emitted at
+ the most distant location from the first lazy PLT entry such that
+ it's still in range for a branch, or closer, if there isn't a need
+ for so many lazy PLT entries. Additional lazy PLT entries may be
+ emitted after the resolverStub, as long as branches are still in
+ range. If the branch goes out of range, longer lazy PLT entries
+ are emitted.
+
+ We could further optimize PLT and lazy PLT entries by giving them
+ priority in assignment to closer-to-gr17 locations depending on the
+ number of occurrences of references to them (assuming a function
+ that's called more often is more important for performance, so its
+ PLT entry should be faster), or taking hints from the compiler.
+ Given infinite time and money... :-) */
+
+static bfd_boolean
+bfinfdpic_check_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, **sym_hashes_end;
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+ bfd *dynobj;
+ struct bfinfdpic_relocs_info *picrel;
+
+ if (info->relocatable)
+ 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;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ 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))
+ {
+ case R_BFIN_GOT17M4:
+ case R_BFIN_GOTHI:
+ case R_BFIN_GOTLO:
+ case R_BFIN_FUNCDESC_GOT17M4:
+ case R_BFIN_FUNCDESC_GOTHI:
+ case R_BFIN_FUNCDESC_GOTLO:
+ case R_BFIN_GOTOFF17M4:
+ case R_BFIN_GOTOFFHI:
+ case R_BFIN_GOTOFFLO:
+ case R_BFIN_FUNCDESC_GOTOFF17M4:
+ case R_BFIN_FUNCDESC_GOTOFFHI:
+ case R_BFIN_FUNCDESC_GOTOFFLO:
+ case R_BFIN_FUNCDESC:
+ case R_BFIN_FUNCDESC_VALUE:
+ if (! IS_FDPIC (abfd))
+ goto bad_reloc;
+ /* Fall through. */
+ case R_pcrel24:
+ case R_pcrel24_jump_l:
+ case R_byte4_data:
+ if (IS_FDPIC (abfd) && ! dynobj)
+ {
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! _bfin_create_got_section (abfd, info))
+ return FALSE;
+ }
+ if (! IS_FDPIC (abfd))
+ {
+ picrel = NULL;
+ break;
+ }
+ if (h != NULL)
+ {
+ if (h->dynindx == -1)
+ switch (ELF_ST_VISIBILITY (h->other))
+ {
+ case STV_INTERNAL:
+ case STV_HIDDEN:
+ break;
+ default:
+ bfd_elf_link_record_dynamic_symbol (info, h);
+ break;
+ }
+ picrel
+ = bfinfdpic_relocs_info_for_global (bfinfdpic_relocs_info (info),
+ abfd, h,
+ rel->r_addend, INSERT);
+ }
+ else
+ picrel = bfinfdpic_relocs_info_for_local (bfinfdpic_relocs_info
+ (info), abfd, r_symndx,
+ rel->r_addend, INSERT);
+ if (! picrel)
+ return FALSE;
+ break;
+
+ default:
+ picrel = NULL;
+ break;
+ }
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_pcrel24:
+ case R_pcrel24_jump_l:
+ if (IS_FDPIC (abfd))
+ picrel->call = 1;
+ break;
+
+ case R_BFIN_FUNCDESC_VALUE:
+ picrel->relocsfdv++;
+ if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ picrel->relocs32--;
+ /* Fall through. */
+
+ case R_byte4_data:
+ if (! IS_FDPIC (abfd))
+ break;
+
+ picrel->sym = 1;
+ if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ picrel->relocs32++;
+ break;
+
+ case R_BFIN_GOT17M4:
+ picrel->got17m4 = 1;
+ break;
+
+ case R_BFIN_GOTHI:
+ case R_BFIN_GOTLO:
+ picrel->gothilo = 1;
+ break;
+
+ case R_BFIN_FUNCDESC_GOT17M4:
+ picrel->fdgot17m4 = 1;
+ break;
+
+ case R_BFIN_FUNCDESC_GOTHI:
+ case R_BFIN_FUNCDESC_GOTLO:
+ picrel->fdgothilo = 1;
+ break;
+
+ case R_BFIN_GOTOFF17M4:
+ case R_BFIN_GOTOFFHI:
+ case R_BFIN_GOTOFFLO:
+ picrel->gotoff = 1;
+ break;
+
+ case R_BFIN_FUNCDESC_GOTOFF17M4:
+ picrel->fdgoff17m4 = 1;
+ break;
+
+ case R_BFIN_FUNCDESC_GOTOFFHI:
+ case R_BFIN_FUNCDESC_GOTOFFLO:
+ picrel->fdgoffhilo = 1;
+ break;
+
+ case R_BFIN_FUNCDESC:
+ picrel->fd = 1;
+ picrel->relocsfd++;
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_BFIN_GNU_VTINHERIT:
+ if (!bfd_elf_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_BFIN_GNU_VTENTRY:
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+
+ case R_huimm16:
+ case R_luimm16:
+ case R_pcrel12_jump_s:
+ case R_pcrel10:
+ break;
+
+ default:
+ bad_reloc:
+ (*_bfd_error_handler)
+ (_("%B: unsupported relocation type %i"),
+ abfd, ELF32_R_TYPE (rel->r_info));
+ return FALSE;
+ }
}
return TRUE;
}
+/* Set the right machine number for a Blackfin ELF file. */
+
+static bfd_boolean
+elf32_bfin_object_p (bfd *abfd)
+{
+ bfd_default_set_arch_mach (abfd, bfd_arch_bfin, 0);
+ return (((elf_elfheader (abfd)->e_flags & EF_BFIN_FDPIC) != 0)
+ == (IS_FDPIC (abfd)));
+}
static bfd_boolean
elf32_bfin_set_private_flags (bfd * abfd, flagword flags)
@@ -2145,29 +4728,170 @@ elf32_bfin_set_private_flags (bfd * abfd, flagword flags)
return TRUE;
}
+/* Copy backend specific data from one object module to another. */
+
+static bfd_boolean
+bfin_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return TRUE;
+
+ BFD_ASSERT (!elf_flags_init (obfd)
+ || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
+
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+ elf_flags_init (obfd) = TRUE;
+ return TRUE;
+}
+
+static bfd_boolean
+elf32_bfinfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+ unsigned i;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return TRUE;
+
+ if (! bfin_elf_copy_private_bfd_data (ibfd, obfd))
+ return FALSE;
+
+ if (! elf_tdata (ibfd) || ! elf_tdata (ibfd)->phdr
+ || ! elf_tdata (obfd) || ! elf_tdata (obfd)->phdr)
+ return TRUE;
+
+ /* Copy the stack size. */
+ for (i = 0; i < elf_elfheader (ibfd)->e_phnum; i++)
+ if (elf_tdata (ibfd)->phdr[i].p_type == PT_GNU_STACK)
+ {
+ Elf_Internal_Phdr *iphdr = &elf_tdata (ibfd)->phdr[i];
+
+ for (i = 0; i < elf_elfheader (obfd)->e_phnum; i++)
+ if (elf_tdata (obfd)->phdr[i].p_type == PT_GNU_STACK)
+ {
+ memcpy (&elf_tdata (obfd)->phdr[i], iphdr, sizeof (*iphdr));
+
+ /* Rewrite the phdrs, since we're only called after they
+ were first written. */
+ if (bfd_seek (obfd, (bfd_signed_vma) get_elf_backend_data (obfd)
+ ->s->sizeof_ehdr, SEEK_SET) != 0
+ || get_elf_backend_data (obfd)->s
+ ->write_out_phdrs (obfd, elf_tdata (obfd)->phdr,
+ elf_elfheader (obfd)->e_phnum) != 0)
+ return FALSE;
+ break;
+ }
+
+ break;
+ }
+
+ return TRUE;
+}
+
/* Display the flags field. */
static bfd_boolean
elf32_bfin_print_private_bfd_data (bfd * abfd, PTR ptr)
{
FILE *file = (FILE *) ptr;
+ flagword flags;
BFD_ASSERT (abfd != NULL && ptr != NULL);
/* Print normal ELF private data. */
_bfd_elf_print_private_bfd_data (abfd, ptr);
- /* Ignore init flag - it may not be set, despite the flags field
- containing valid data. */
+ flags = elf_elfheader (abfd)->e_flags;
/* xgettext:c-format */
fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
+ if (flags & EF_BFIN_PIC)
+ fprintf (file, " -fpic");
+
+ if (flags & EF_BFIN_FDPIC)
+ fprintf (file, " -mfdpic");
+
fputc ('\n', file);
return TRUE;
}
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+
+static bfd_boolean
+elf32_bfin_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+ flagword old_flags, old_partial;
+ flagword new_flags, new_partial;
+ bfd_boolean error = FALSE;
+
+ new_flags = elf_elfheader (ibfd)->e_flags;
+ old_flags = elf_elfheader (obfd)->e_flags;
+
+ if (new_flags & EF_BFIN_FDPIC)
+ new_flags &= ~EF_BFIN_PIC;
+
+#ifdef DEBUG
+ (*_bfd_error_handler) ("old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s, filename = %s",
+ old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no",
+ bfd_get_filename (ibfd));
+#endif
+
+ if (!elf_flags_init (obfd)) /* First call, no flags set. */
+ {
+ elf_flags_init (obfd) = TRUE;
+ old_flags = new_flags;
+ }
+
+ else if (new_flags == old_flags) /* Compatible flags are ok. */
+ ;
+
+ else /* Possibly incompatible flags. */
+ {
+ /* We don't have to do anything if the pic flags are the same, or the new
+ module(s) were compiled with -mlibrary-pic. */
+ new_partial = (new_flags & EF_BFIN_PIC_FLAGS);
+ old_partial = (old_flags & EF_BFIN_PIC_FLAGS);
+ if (new_partial == old_partial)
+ ;
+
+ /* If we have mixtures of -fpic and -fPIC, or in both bits. */
+ else if (new_partial != 0 && old_partial != 0)
+ old_flags |= new_partial;
+
+ /* One module was compiled for pic and the other was not, see if we have
+ had any relocations that are not pic-safe. */
+ else
+ old_flags |= new_partial;
+
+ }
+
+ /* Update the old flags now with changes made above. */
+ elf_elfheader (obfd)->e_flags = old_flags;
+
+ if (((new_flags & EF_BFIN_FDPIC) == 0)
+ != (! IS_FDPIC (ibfd)))
+ {
+ error = TRUE;
+ if (IS_FDPIC (obfd))
+ (*_bfd_error_handler)
+ (_("%s: cannot link non-fdpic object file into fdpic executable"),
+ bfd_get_filename (ibfd));
+ else
+ (*_bfd_error_handler)
+ (_("%s: cannot link fdpic object file into non-fdpic executable"),
+ bfd_get_filename (ibfd));
+ }
+
+ if (error)
+ bfd_set_error (bfd_error_bad_value);
+
+ return !error;
+}
+
/* bfin ELF linker hash entry. */
struct bfin_link_hash_entry
@@ -2192,7 +4916,7 @@ struct bfin_link_hash_table
static struct bfd_hash_entry *
bfin_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table, const char *string)
+ struct bfd_hash_table *table, const char *string)
{
struct bfd_hash_entry *ret = entry;
@@ -2219,13 +4943,13 @@ bfin_link_hash_table_create (bfd * abfd)
struct bfin_link_hash_table *ret;
bfd_size_type amt = sizeof (struct bfin_link_hash_table);
- ret = (struct bfin_link_hash_table *) bfd_malloc (amt);
- if (ret == (struct bfin_link_hash_table *) NULL)
+ ret = bfd_zalloc (abfd, amt);
+ if (ret == NULL)
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
bfin_link_hash_newfunc,
- sizeof (struct bfin_link_hash_entry)))
+ sizeof (struct elf_link_hash_entry)))
{
free (ret);
return NULL;
@@ -2512,9 +5236,6 @@ bfin_discard_copies (struct elf_link_hash_entry *h, PTR inf)
return TRUE;
}
-/* Set the sizes of the dynamic sections. */
-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
-
static bfd_boolean
bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info)
@@ -2660,7 +5381,7 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
return TRUE;
}
-
+
/* Given a .data section and a .emreloc in-memory section, store
relocation information into the .emreloc section which can be
used at runtime to relocate the section. This is called by the
@@ -2668,6 +5389,9 @@ bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
after the add_symbols entry point has been called for all the
objects, and before the final_link entry point is called. */
+bfd_boolean bfd_bfin_elf32_create_embedded_relocs
+ PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, char **));
+
bfd_boolean
bfd_bfin_elf32_create_embedded_relocs (
bfd *abfd,
@@ -2783,17 +5507,18 @@ error_return:
free (internal_relocs);
return FALSE;
}
-
+
#define TARGET_LITTLE_SYM bfd_elf32_bfin_vec
#define TARGET_LITTLE_NAME "elf32-bfin"
#define ELF_ARCH bfd_arch_bfin
-#define ELF_MACHINE_CODE EM_BLACKFIN
+#define ELF_MACHINE_CODE EM_BLACKFIN
#define ELF_MAXPAGESIZE 0x1000
#define elf_symbol_leading_char '_'
#define bfd_elf32_bfd_reloc_type_lookup bfin_bfd_reloc_type_lookup
#define elf_info_to_howto bfin_info_to_howto
#define elf_info_to_howto_rel 0
+#define elf_backend_object_p elf32_bfin_object_p
#define bfd_elf32_bfd_is_local_label_name \
bfin_is_local_label_name
@@ -2808,7 +5533,7 @@ error_return:
bfin_link_hash_table_create
#define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link
-#define elf_backend_check_relocs bfin_check_relocs
+#define elf_backend_check_relocs bfin_check_relocs
#define elf_backend_adjust_dynamic_symbol \
bfin_adjust_dynamic_symbol
#define elf_backend_size_dynamic_sections \
@@ -2835,5 +5560,74 @@ error_return:
#define elf_backend_got_header_size 12
#define elf_backend_rela_normal 1
+#include "elf32-target.h"
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_bfinfdpic_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-bfinfdpic"
+#undef elf32_bed
+#define elf32_bed elf32_bfinfdpic_bed
+
+#undef elf_backend_gc_sweep_hook
+#define elf_backend_gc_sweep_hook bfinfdpic_gc_sweep_hook
+
+#undef elf_backend_got_header_size
+#define elf_backend_got_header_size 0
+
+#undef elf_backend_relocate_section
+#define elf_backend_relocate_section bfinfdpic_relocate_section
+#undef elf_backend_check_relocs
+#define elf_backend_check_relocs bfinfdpic_check_relocs
+
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+ bfinfdpic_elf_link_hash_table_create
+#undef elf_backend_always_size_sections
+#define elf_backend_always_size_sections \
+ elf32_bfinfdpic_always_size_sections
+#undef elf_backend_modify_segment_map
+#define elf_backend_modify_segment_map \
+ elf32_bfinfdpic_modify_segment_map
+#undef bfd_elf32_bfd_copy_private_bfd_data
+#define bfd_elf32_bfd_copy_private_bfd_data \
+ elf32_bfinfdpic_copy_private_bfd_data
+
+#undef elf_backend_create_dynamic_sections
+#define elf_backend_create_dynamic_sections \
+ elf32_bfinfdpic_create_dynamic_sections
+#undef elf_backend_adjust_dynamic_symbol
+#define elf_backend_adjust_dynamic_symbol \
+ elf32_bfinfdpic_adjust_dynamic_symbol
+#undef elf_backend_size_dynamic_sections
+#define elf_backend_size_dynamic_sections \
+ elf32_bfinfdpic_size_dynamic_sections
+#undef elf_backend_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol \
+ elf32_bfinfdpic_finish_dynamic_symbol
+#undef elf_backend_finish_dynamic_sections
+#define elf_backend_finish_dynamic_sections \
+ elf32_bfinfdpic_finish_dynamic_sections
+
+#undef elf_backend_can_make_relative_eh_frame
+#define elf_backend_can_make_relative_eh_frame \
+ bfinfdpic_elf_use_relative_eh_frame
+#undef elf_backend_can_make_lsda_relative_eh_frame
+#define elf_backend_can_make_lsda_relative_eh_frame \
+ bfinfdpic_elf_use_relative_eh_frame
+#undef elf_backend_encode_eh_address
+#define elf_backend_encode_eh_address \
+ bfinfdpic_elf_encode_eh_address
+
+#undef elf_backend_may_use_rel_p
+#define elf_backend_may_use_rel_p 1
+#undef elf_backend_may_use_rela_p
+#define elf_backend_may_use_rela_p 1
+/* We use REL for dynamic relocations only. */
+#undef elf_backend_default_use_rela_p
+#define elf_backend_default_use_rela_p 1
+
+#undef elf_backend_omit_section_dynsym
+#define elf_backend_omit_section_dynsym _bfinfdpic_link_omit_section_dynsym
#include "elf32-target.h"
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index bc44cba972c..754aa52254d 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -582,6 +582,10 @@ struct elf_i386_link_hash_entry
#define GOT_TLS_IE_NEG 6
#define GOT_TLS_IE_BOTH 7
#define GOT_TLS_GDESC 8
+#define GOT_TLS_MASK 0x0f
+#define GOT_TLS_IE_IE 0x10
+#define GOT_TLS_IE_GD 0x20
+#define GOT_TLS_IE_MASK 0x30
#define GOT_TLS_GD_BOTH_P(type) \
((type) == (GOT_TLS_GD | GOT_TLS_GDESC))
#define GOT_TLS_GD_P(type) \
@@ -1007,12 +1011,25 @@ elf_i386_check_relocs (bfd *abfd,
case R_386_TLS_IE_32:
if (ELF32_R_TYPE (rel->r_info) == r_type)
tls_type = GOT_TLS_IE_NEG;
+ else if (h
+ && ELF32_R_TYPE (rel->r_info) == R_386_TLS_GD)
+ /* If this is a GD->IE transition, we may use either
+ of R_386_TLS_TPOFF and R_386_TLS_TPOFF32. But if
+ we may have both R_386_TLS_IE and R_386_TLS_GD,
+ we can't share the same R_386_TLS_TPOFF since
+ they require different offsets. So we remember
+ it comes from R_386_TLS_GD. */
+ tls_type = GOT_TLS_IE | GOT_TLS_IE_GD;
else
- /* If this is a GD->IE transition, we may use either of
- R_386_TLS_TPOFF and R_386_TLS_TPOFF32. */
tls_type = GOT_TLS_IE;
break;
case R_386_TLS_IE:
+ if (h)
+ {
+ /* We remember it comes from R_386_TLS_IE. */
+ tls_type = GOT_TLS_IE_POS | GOT_TLS_IE_IE;
+ break;
+ }
case R_386_TLS_GOTIE:
tls_type = GOT_TLS_IE_POS; break;
}
@@ -1052,7 +1069,8 @@ elf_i386_check_relocs (bfd *abfd,
tls_type |= old_tls_type;
/* If a TLS symbol is accessed using IE at least once,
there is no point to use dynamic model for it. */
- else if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN
+ else if (old_tls_type != tls_type
+ && old_tls_type != GOT_UNKNOWN
&& (! GOT_TLS_GD_ANY_P (old_tls_type)
|| (tls_type & GOT_TLS_IE) == 0))
{
@@ -1682,6 +1700,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
asection *s;
bfd_boolean dyn;
int tls_type = elf_i386_hash_entry(h)->tls_type;
+
+ /* If we have both R_386_TLS_IE and R_386_TLS_GD, GOT_TLS_IE_BOTH
+ should be used. */
+ if ((tls_type & GOT_TLS_IE_MASK)
+ == (GOT_TLS_IE_IE | GOT_TLS_IE_GD))
+ tls_type = GOT_TLS_IE_BOTH;
+ else
+ tls_type &= GOT_TLS_MASK;
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -2685,6 +2711,13 @@ elf_i386_relocate_section (bfd *output_bfd,
else if (h != NULL)
{
tls_type = elf_i386_hash_entry(h)->tls_type;
+ /* If we have both R_386_TLS_IE and R_386_TLS_GD,
+ GOT_TLS_IE_BOTH should be used. */
+ if ((tls_type & GOT_TLS_IE_MASK)
+ == (GOT_TLS_IE_IE | GOT_TLS_IE_GD))
+ tls_type = GOT_TLS_IE_BOTH;
+ else
+ tls_type &= GOT_TLS_MASK;
if (!info->shared && h->dynindx == -1 && (tls_type & GOT_TLS_IE))
r_type = R_386_TLS_LE_32;
}
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index f56efd2e4da..5e9f3ab28a2 100644
--- a/bfd/elf32-m32c.c
+++ b/bfd/elf32-m32c.c
@@ -482,6 +482,22 @@ m32c_elf_relocate_section
relocation = (splt->output_section->vma
+ splt->output_offset
+ (*plt_offset & -2));
+ if (name)
+ {
+ char *newname = bfd_malloc (strlen(name)+5);
+ strcpy (newname, name);
+ strcat(newname, ".plt");
+ _bfd_generic_link_add_one_symbol (info,
+ input_bfd,
+ newname,
+ BSF_FUNCTION | BSF_WEAK,
+ splt,
+ (*plt_offset & -2),
+ 0,
+ 1,
+ 0,
+ 0);
+ }
}
}
break;
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 3cdaeeec6d6..6ed4ad35f62 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#include "elf-bfd.h"
#include "elfxx-mips.h"
#include "elf/mips.h"
+#include "elf-vxworks.h"
/* Get the ECOFF swapping routines. */
#include "coff/sym.h"
@@ -1319,10 +1320,12 @@ mips_elf32_rtype_to_howto (unsigned int r_type,
static void
mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)
{
+ const struct elf_backend_data *bed;
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- cache_ptr->howto = mips_elf32_rtype_to_howto (r_type, FALSE);
+ bed = get_elf_backend_data (abfd);
+ cache_ptr->howto = bed->elf_backend_mips_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
@@ -1619,3 +1622,147 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
/* Include the target file again for this target. */
#include "elf32-target.h"
+
+
+/* Specific to VxWorks. */
+static reloc_howto_type mips_vxworks_copy_howto_rela =
+ HOWTO (R_MIPS_COPY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_COPY", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
+ FALSE); /* pcrel_offset */
+
+/* Specific to VxWorks. */
+static reloc_howto_type mips_vxworks_jump_slot_howto_rela =
+ HOWTO (R_MIPS_JUMP_SLOT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_JUMP_SLOT", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
+ FALSE); /* pcrel_offset */
+
+/* Implement elf_backend_bfd_reloc_type_lookup for VxWorks. */
+
+static reloc_howto_type *
+mips_vxworks_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
+{
+ switch (code)
+ {
+ case BFD_RELOC_MIPS_COPY:
+ return &mips_vxworks_copy_howto_rela;
+ case BFD_RELOC_MIPS_JUMP_SLOT:
+ return &mips_vxworks_jump_slot_howto_rela;
+ default:
+ return bfd_elf32_bfd_reloc_type_lookup (abfd, code);
+ }
+}
+
+/* Implement elf_backend_mips_rtype_to_lookup for VxWorks. */
+
+static reloc_howto_type *
+mips_vxworks_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p)
+{
+ switch (r_type)
+ {
+ case R_MIPS_COPY:
+ return &mips_vxworks_copy_howto_rela;
+ case R_MIPS_JUMP_SLOT:
+ return &mips_vxworks_jump_slot_howto_rela;
+ default:
+ return mips_elf32_rtype_to_howto (r_type, rela_p);
+ }
+}
+
+/* Implement elf_backend_final_write_processing for VxWorks. */
+
+static void
+mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+ _bfd_mips_elf_final_write_processing (abfd, linker);
+ elf_vxworks_final_write_processing (abfd, linker);
+}
+
+#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_NAME
+#undef TARGET_BIG_SYM
+#undef TARGET_BIG_NAME
+
+#define TARGET_LITTLE_SYM bfd_elf32_littlemips_vxworks_vec
+#define TARGET_LITTLE_NAME "elf32-littlemips-vxworks"
+#define TARGET_BIG_SYM bfd_elf32_bigmips_vxworks_vec
+#define TARGET_BIG_NAME "elf32-bigmips-vxworks"
+
+#undef elf32_bed
+#define elf32_bed elf32_mips_vxworks_bed
+
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE 0x1000
+
+#undef elf_backend_want_got_plt
+#define elf_backend_want_got_plt 1
+#undef elf_backend_want_plt_sym
+#define elf_backend_want_plt_sym 1
+#undef elf_backend_got_symbol_offset
+#define elf_backend_got_symbol_offset 0
+#undef elf_backend_want_dynbss
+#define elf_backend_want_dynbss 1
+#undef elf_backend_may_use_rel_p
+#define elf_backend_may_use_rel_p 0
+#undef elf_backend_may_use_rela_p
+#define elf_backend_may_use_rela_p 1
+#undef elf_backend_default_use_rela_p
+#define elf_backend_default_use_rela_p 1
+#undef elf_backend_got_header_size
+#define elf_backend_got_header_size (4 * 3)
+#undef elf_backend_plt_readonly
+#define elf_backend_plt_readonly 1
+
+#undef bfd_elf32_bfd_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_type_lookup \
+ mips_vxworks_bfd_reloc_type_lookup
+#undef elf_backend_mips_rtype_to_howto
+#define elf_backend_mips_rtype_to_howto \
+ mips_vxworks_rtype_to_howto
+#undef elf_backend_adjust_dynamic_symbol
+#define elf_backend_adjust_dynamic_symbol \
+ _bfd_mips_vxworks_adjust_dynamic_symbol
+#undef elf_backend_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol \
+ _bfd_mips_vxworks_finish_dynamic_symbol
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+ _bfd_mips_vxworks_link_hash_table_create
+#undef elf_backend_add_symbol_hook
+#define elf_backend_add_symbol_hook \
+ elf_vxworks_add_symbol_hook
+#undef elf_backend_link_output_symbol_hook
+#define elf_backend_link_output_symbol_hook \
+ elf_vxworks_link_output_symbol_hook
+#undef elf_backend_emit_relocs
+#define elf_backend_emit_relocs \
+ elf_vxworks_emit_relocs
+#undef elf_backend_final_write_processing
+#define elf_backend_final_write_processing \
+ mips_vxworks_final_write_processing
+
+#undef elf_backend_additional_program_headers
+#undef elf_backend_modify_segment_map
+#undef elf_backend_symbol_processing
+/* NOTE: elf_backend_rela_normal is not defined for MIPS. */
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 6a2d5170d78..53d1046bb8c 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -5181,6 +5181,10 @@ ppc_elf_relax_section (bfd *abfd,
else if (r_type != R_PPC_PLTREL24)
toff += irel->r_addend;
+ /* Attempted -shared link of non-pic code loses. */
+ if (tsec->output_section == NULL)
+ continue;
+
symaddr = tsec->output_section->vma + tsec->output_offset + toff;
roff = irel->r_offset;
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 031b3034a8b..3bfb38a3d44 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -26,6 +26,7 @@
#include "elf/sparc.h"
#include "opcode/sparc.h"
#include "elfxx-sparc.h"
+#include "elf-vxworks.h"
/* Support for core dump NOTE sections. */
@@ -215,3 +216,68 @@ elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela)
#define elf_backend_rela_normal 1
#include "elf32-target.h"
+
+/* A wrapper around _bfd_sparc_elf_link_hash_table_create that identifies
+ the target system as VxWorks. */
+
+static struct bfd_link_hash_table *
+elf32_sparc_vxworks_link_hash_table_create (bfd *abfd)
+{
+ struct bfd_link_hash_table *ret;
+
+ ret = _bfd_sparc_elf_link_hash_table_create (abfd);
+ if (ret)
+ {
+ struct _bfd_sparc_elf_link_hash_table *htab;
+
+ htab = (struct _bfd_sparc_elf_link_hash_table *) ret;
+ htab->is_vxworks = 1;
+ }
+ return ret;
+}
+
+/* A final_write_processing hook that does both the SPARC- and VxWorks-
+ specific handling. */
+
+static void
+elf32_sparc_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+ elf32_sparc_final_write_processing (abfd, linker);
+ elf_vxworks_final_write_processing (abfd, linker);
+}
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_sparc_vxworks_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-sparc-vxworks"
+
+#undef ELF_MINPAGESIZE
+#define ELF_MINPAGESIZE 0x1000
+
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+ elf32_sparc_vxworks_link_hash_table_create
+
+#undef elf_backend_want_got_plt
+#define elf_backend_want_got_plt 1
+#undef elf_backend_plt_readonly
+#define elf_backend_plt_readonly 1
+#undef elf_backend_got_header_size
+#define elf_backend_got_header_size 12
+#undef elf_backend_add_symbol_hook
+#define elf_backend_add_symbol_hook \
+ elf_vxworks_add_symbol_hook
+#undef elf_backend_link_output_symbol_hook
+#define elf_backend_link_output_symbol_hook \
+ elf_vxworks_link_output_symbol_hook
+#undef elf_backend_emit_relocs
+#define elf_backend_emit_relocs \
+ elf_vxworks_emit_relocs
+#undef elf_backend_final_write_processing
+#define elf_backend_final_write_processing \
+ elf32_sparc_vxworks_final_write_processing
+
+#undef elf32_bed
+#define elf32_bed sparc_elf_vxworks_bed
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 18610c720f5..7a41d628577 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -640,7 +640,6 @@ xtensa_read_table_entries (bfd *abfd,
{
bfd_vma sym_off = get_elf_r_symndx_offset (abfd, r_symndx);
BFD_ASSERT (sym_off == 0);
- BFD_ASSERT (rel->r_addend == 0);
blocks[block_count].address =
(section_addr + sym_off + rel->r_addend
+ bfd_get_32 (abfd, table_data + rel->r_offset));
@@ -5767,7 +5766,8 @@ static bfd_boolean compute_text_actions
static bfd_boolean compute_ebb_proposed_actions (ebb_constraint *);
static bfd_boolean compute_ebb_actions (ebb_constraint *);
static bfd_boolean check_section_ebb_pcrels_fit
- (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *);
+ (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *,
+ const xtensa_opcode *);
static bfd_boolean check_section_ebb_reduces (const ebb_constraint *);
static void text_action_add_proposed
(text_action_list *, const ebb_constraint *, asection *);
@@ -6303,6 +6303,24 @@ find_associated_l32r_irel (bfd *abfd,
}
+static xtensa_opcode *
+build_reloc_opcodes (bfd *abfd,
+ asection *sec,
+ bfd_byte *contents,
+ Elf_Internal_Rela *internal_relocs)
+{
+ unsigned i;
+ xtensa_opcode *reloc_opcodes =
+ (xtensa_opcode *) bfd_malloc (sizeof (xtensa_opcode) * sec->reloc_count);
+ for (i = 0; i < sec->reloc_count; i++)
+ {
+ Elf_Internal_Rela *irel = &internal_relocs[i];
+ reloc_opcodes[i] = get_relocation_opcode (abfd, sec, contents, irel);
+ }
+ return reloc_opcodes;
+}
+
+
/* The compute_text_actions function will build a list of potential
transformation actions for code in the extended basic block of each
longcall that is optimized to a direct call. From this list we
@@ -6319,6 +6337,7 @@ compute_text_actions (bfd *abfd,
asection *sec,
struct bfd_link_info *link_info)
{
+ xtensa_opcode *reloc_opcodes = NULL;
xtensa_relax_info *relax_info;
bfd_byte *contents;
Elf_Internal_Rela *internal_relocs;
@@ -6424,11 +6443,17 @@ compute_text_actions (bfd *abfd,
ebb->start_reloc_idx = i;
ebb->end_reloc_idx = i;
+ /* Precompute the opcode for each relocation. */
+ if (reloc_opcodes == NULL)
+ reloc_opcodes = build_reloc_opcodes (abfd, sec, contents,
+ internal_relocs);
+
if (!extend_ebb_bounds (ebb)
|| !compute_ebb_proposed_actions (&ebb_table)
|| !compute_ebb_actions (&ebb_table)
|| !check_section_ebb_pcrels_fit (abfd, sec, contents,
- internal_relocs, &ebb_table)
+ internal_relocs, &ebb_table,
+ reloc_opcodes)
|| !check_section_ebb_reduces (&ebb_table))
{
/* If anything goes wrong or we get unlucky and something does
@@ -6460,6 +6485,8 @@ error_return:
release_internal_relocs (sec, internal_relocs);
if (prop_table)
free (prop_table);
+ if (reloc_opcodes)
+ free (reloc_opcodes);
return ok;
}
@@ -7027,7 +7054,8 @@ check_section_ebb_pcrels_fit (bfd *abfd,
asection *sec,
bfd_byte *contents,
Elf_Internal_Rela *internal_relocs,
- const ebb_constraint *constraint)
+ const ebb_constraint *constraint,
+ const xtensa_opcode *reloc_opcodes)
{
unsigned i, j;
Elf_Internal_Rela *irel;
@@ -7118,7 +7146,10 @@ check_section_ebb_pcrels_fit (bfd *abfd,
xtensa_opcode opcode;
int opnum;
- opcode = get_relocation_opcode (abfd, sec, contents, irel);
+ if (reloc_opcodes)
+ opcode = reloc_opcodes[i];
+ else
+ opcode = get_relocation_opcode (abfd, sec, contents, irel);
if (opcode == XTENSA_UNDEFINED)
{
ok = FALSE;
@@ -7815,7 +7846,7 @@ move_shared_literal (asection *sec,
relocs_fit = check_section_ebb_pcrels_fit (target_sec->owner, target_sec,
target_sec_cache->contents,
target_sec_cache->relocs,
- &ebb_table);
+ &ebb_table, NULL);
if (!relocs_fit)
return FALSE;
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 4e0b83c96be..58798ae3794 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -2542,6 +2542,68 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info)
return TRUE;
}
+/* Support for core dump NOTE sections. */
+
+static bfd_boolean
+elf64_hppa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
+{
+ int offset;
+ size_t size;
+
+ switch (note->descsz)
+ {
+ default:
+ return FALSE;
+
+ case 760: /* Linux/hppa */
+ /* 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 + 32);
+
+ /* pr_reg */
+ offset = 112;
+ size = 640;
+
+ break;
+ }
+
+ /* Make a ".reg/999" section. */
+ return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+ size, note->descpos + offset);
+}
+
+static bfd_boolean
+elf64_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+{
+ char * command;
+ int n;
+
+ switch (note->descsz)
+ {
+ default:
+ return FALSE;
+
+ case 136: /* Linux/hppa elf_prpsinfo. */
+ elf_tdata (abfd)->core_program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
+ elf_tdata (abfd)->core_command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 56, 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. */
+ command = elf_tdata (abfd)->core_command;
+ n = strlen (command);
+
+ if (0 < n && command[n - 1] == ' ')
+ command[n - 1] = '\0';
+
+ return TRUE;
+}
+
/* Return the number of additional phdrs we will need.
The generic ELF code only creates PT_PHDRs for executables. The HP
@@ -2775,7 +2837,9 @@ const struct elf_size_info hppa64_elf_size_info =
elf64_hppa_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
elf64_hppa_finish_dynamic_sections
-
+#define elf_backend_grok_prstatus elf64_hppa_grok_prstatus
+#define elf_backend_grok_psinfo elf64_hppa_grok_psinfo
+
/* Stuff for the BFD linker: */
#define bfd_elf64_bfd_link_hash_table_create \
elf64_hppa_hash_table_create
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index fc8c182e83d..33327f44cba 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2623,6 +2623,32 @@ compare_symbols (const void *ap, const void *bp)
if (a->value + a->section->vma > b->value + b->section->vma)
return 1;
+ /* For syms with the same value, prefer strong dynamic global function
+ syms over other syms. */
+ if ((a->flags & BSF_GLOBAL) != 0 && (b->flags & BSF_GLOBAL) == 0)
+ return -1;
+
+ if ((a->flags & BSF_GLOBAL) == 0 && (b->flags & BSF_GLOBAL) != 0)
+ return 1;
+
+ if ((a->flags & BSF_FUNCTION) != 0 && (b->flags & BSF_FUNCTION) == 0)
+ return -1;
+
+ if ((a->flags & BSF_FUNCTION) == 0 && (b->flags & BSF_FUNCTION) != 0)
+ return 1;
+
+ if ((a->flags & BSF_WEAK) == 0 && (b->flags & BSF_WEAK) != 0)
+ return -1;
+
+ if ((a->flags & BSF_WEAK) != 0 && (b->flags & BSF_WEAK) == 0)
+ return 1;
+
+ if ((a->flags & BSF_DYNAMIC) != 0 && (b->flags & BSF_DYNAMIC) == 0)
+ return -1;
+
+ if ((a->flags & BSF_DYNAMIC) == 0 && (b->flags & BSF_DYNAMIC) != 0)
+ return 1;
+
return 0;
}
@@ -6696,12 +6722,22 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
{
Elf_Internal_Sym *locsyms = NULL;
+ asection *toc = bfd_get_section_by_name (ibfd, ".toc");
+ unsigned char *toc_ref = NULL;
- for (sec = ibfd->sections; sec != NULL; sec = sec->next)
+ /* Look at all the sections for this file, with TOC last. */
+ for (sec = (ibfd->sections == toc && toc && toc->next ? toc->next
+ : ibfd->sections);
+ sec != NULL;
+ sec = (sec == toc ? NULL
+ : sec->next == NULL ? toc
+ : sec->next == toc && toc->next ? toc->next
+ : sec->next))
if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section))
{
Elf_Internal_Rela *relstart, *rel, *relend;
int expecting_tls_get_addr;
+ long toc_ref_index = 0;
/* Read the relocations. */
relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL,
@@ -6730,6 +6766,8 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
err_free_rel:
if (elf_section_data (sec)->relocs != relstart)
free (relstart);
+ if (toc_ref != NULL)
+ free (toc_ref);
if (locsyms != NULL
&& (elf_tdata (ibfd)->symtab_hdr.contents
!= (unsigned char *) locsyms))
@@ -6837,8 +6875,12 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
rel - 1, ibfd);
if (retval == 0)
goto err_free_rel;
- if (toc_tls != NULL)
- expecting_tls_get_addr = retval > 1;
+ if (retval > 1 && toc_tls != NULL)
+ {
+ expecting_tls_get_addr = 1;
+ if (toc_ref != NULL)
+ toc_ref[toc_ref_index] = 1;
+ }
}
if (expecting_tls_get_addr)
@@ -6856,8 +6898,40 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
expecting_tls_get_addr = 0;
continue;
+ case R_PPC64_TOC16:
+ case R_PPC64_TOC16_LO:
+ case R_PPC64_TLS:
+ expecting_tls_get_addr = 0;
+ if (sym_sec == toc && toc != NULL)
+ {
+ /* Mark this toc entry as referenced by a TLS
+ code sequence. We can do that now in the
+ case of R_PPC64_TLS, and after checking for
+ tls_get_addr for the TOC16 relocs. */
+ if (toc_ref == NULL)
+ {
+ toc_ref = bfd_zmalloc (toc->size / 8);
+ if (toc_ref == NULL)
+ goto err_free_rel;
+ }
+ if (h != NULL)
+ value = h->root.u.def.value;
+ else
+ value = sym->st_value;
+ value += rel->r_addend;
+ BFD_ASSERT (value < toc->size && value % 8 == 0);
+ toc_ref_index = value / 8;
+ if (r_type == R_PPC64_TLS)
+ toc_ref[toc_ref_index] = 1;
+ }
+ continue;
+
case R_PPC64_TPREL64:
expecting_tls_get_addr = 0;
+ if (sec != toc
+ || toc_ref == NULL
+ || !toc_ref[rel->r_offset / 8])
+ continue;
if (ok_tprel)
{
/* IE -> LE */
@@ -6870,6 +6944,10 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
case R_PPC64_DTPMOD64:
expecting_tls_get_addr = 0;
+ if (sec != toc
+ || toc_ref == NULL
+ || !toc_ref[rel->r_offset / 8])
+ continue;
if (rel + 1 < relend
&& (rel[1].r_info
== ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64))
@@ -6948,6 +7026,9 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
free (relstart);
}
+ if (toc_ref != NULL)
+ free (toc_ref);
+
if (locsyms != NULL
&& (elf_tdata (ibfd)->symtab_hdr.contents
!= (unsigned char *) locsyms))
@@ -7143,13 +7224,14 @@ ppc64_elf_edit_toc (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
return FALSE;
}
- /* Now check all kept sections that might reference the toc. */
- for (sec = ibfd->sections;
+ /* Now check all kept sections that might reference the toc.
+ Check the toc itself last. */
+ for (sec = (ibfd->sections == toc && toc->next ? toc->next
+ : ibfd->sections);
sec != NULL;
- /* Check the toc itself last. */
sec = (sec == toc ? NULL
- : sec->next == toc && sec->next->next ? sec->next->next
: sec->next == NULL ? toc
+ : sec->next == toc && toc->next ? toc->next
: sec->next))
{
int repeat;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 504a19b7b98..9befd69c5df 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -31,8 +31,8 @@
#define MINUS_ONE (~ (bfd_vma) 0)
/* The relocation "howto" table. Order of fields:
- type, size, bitsize, pc_relative, complain_on_overflow,
- special_function, name, partial_inplace, src_mask, dst_pack, pcrel_offset. */
+ type, rightshift, size, bitsize, pc_relative, bitpos, complain_on_overflow,
+ special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset. */
static reloc_howto_type x86_64_elf_howto_table[] =
{
HOWTO(R_X86_64_NONE, 0, 0, 0, FALSE, 0, complain_overflow_dont,
@@ -112,11 +112,21 @@ static reloc_howto_type x86_64_elf_howto_table[] =
HOWTO(R_X86_64_GOTPC32, 0, 2, 32, TRUE, 0, complain_overflow_signed,
bfd_elf_generic_reloc, "R_X86_64_GOTPC32",
FALSE, 0xffffffff, 0xffffffff, TRUE),
- EMPTY_HOWTO (27),
- EMPTY_HOWTO (28),
- EMPTY_HOWTO (29),
- EMPTY_HOWTO (30),
- EMPTY_HOWTO (31),
+ HOWTO(R_X86_64_GOT64, 0, 4, 64, FALSE, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_GOT64", FALSE, MINUS_ONE, MINUS_ONE,
+ FALSE),
+ HOWTO(R_X86_64_GOTPCREL64, 0, 4, 64, TRUE, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_GOTPCREL64", FALSE, MINUS_ONE,
+ MINUS_ONE, TRUE),
+ HOWTO(R_X86_64_GOTPC64, 0, 4, 64, TRUE, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_GOTPC64",
+ FALSE, MINUS_ONE, MINUS_ONE, TRUE),
+ HOWTO(R_X86_64_GOTPLT64, 0, 4, 64, FALSE, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_GOTPLT64", FALSE, MINUS_ONE,
+ MINUS_ONE, FALSE),
+ HOWTO(R_X86_64_PLTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_PLTOFF64", FALSE, MINUS_ONE,
+ MINUS_ONE, FALSE),
EMPTY_HOWTO (32),
EMPTY_HOWTO (33),
HOWTO(R_X86_64_GOTPC32_TLSDESC, 0, 2, 32, TRUE, 0,
@@ -185,6 +195,11 @@ static const struct elf_reloc_map x86_64_reloc_map[] =
{ BFD_RELOC_64_PCREL, R_X86_64_PC64, },
{ BFD_RELOC_X86_64_GOTOFF64, R_X86_64_GOTOFF64, },
{ BFD_RELOC_X86_64_GOTPC32, R_X86_64_GOTPC32, },
+ { BFD_RELOC_X86_64_GOT64, R_X86_64_GOT64, },
+ { BFD_RELOC_X86_64_GOTPCREL64,R_X86_64_GOTPCREL64, },
+ { BFD_RELOC_X86_64_GOTPC64, R_X86_64_GOTPC64, },
+ { BFD_RELOC_X86_64_GOTPLT64, R_X86_64_GOTPLT64, },
+ { BFD_RELOC_X86_64_PLTOFF64, R_X86_64_PLTOFF64, },
{ BFD_RELOC_X86_64_GOTPC32_TLSDESC, R_X86_64_GOTPC32_TLSDESC, },
{ BFD_RELOC_X86_64_TLSDESC_CALL, R_X86_64_TLSDESC_CALL, },
{ BFD_RELOC_X86_64_TLSDESC, R_X86_64_TLSDESC, },
@@ -777,6 +792,9 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
case R_X86_64_GOT32:
case R_X86_64_GOTPCREL:
case R_X86_64_TLSGD:
+ case R_X86_64_GOT64:
+ case R_X86_64_GOTPCREL64:
+ case R_X86_64_GOTPLT64:
case R_X86_64_GOTPC32_TLSDESC:
case R_X86_64_TLSDESC_CALL:
/* This symbol requires a global offset table entry. */
@@ -795,6 +813,14 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
if (h != NULL)
{
+ if (r_type == R_X86_64_GOTPLT64)
+ {
+ /* This relocation indicates that we also need
+ a PLT entry, as this is a function. We don't need
+ a PLT entry for local symbols. */
+ h->needs_plt = 1;
+ h->plt.refcount += 1;
+ }
h->got.refcount += 1;
old_tls_type = elf64_x86_64_hash_entry (h)->tls_type;
}
@@ -858,6 +884,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
case R_X86_64_GOTOFF64:
case R_X86_64_GOTPC32:
+ case R_X86_64_GOTPC64:
create_got:
if (htab->sgot == NULL)
{
@@ -885,6 +912,16 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
h->plt.refcount += 1;
break;
+ case R_X86_64_PLTOFF64:
+ /* This tries to form the 'address' of a function relative
+ to GOT. For global symbols we need a PLT entry. */
+ if (h != NULL)
+ {
+ h->needs_plt = 1;
+ h->plt.refcount += 1;
+ }
+ goto create_got;
+
case R_X86_64_8:
case R_X86_64_16:
case R_X86_64_32:
@@ -1189,8 +1226,13 @@ elf64_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
case R_X86_64_GOTTPOFF:
case R_X86_64_GOT32:
case R_X86_64_GOTPCREL:
+ case R_X86_64_GOT64:
+ case R_X86_64_GOTPCREL64:
+ case R_X86_64_GOTPLT64:
if (h != NULL)
{
+ if (r_type == R_X86_64_GOTPLT64 && h->plt.refcount > 0)
+ h->plt.refcount -= 1;
if (h->got.refcount > 0)
h->got.refcount -= 1;
}
@@ -1215,6 +1257,7 @@ elf64_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
/* Fall thru */
case R_X86_64_PLT32:
+ case R_X86_64_PLTOFF64:
if (h != NULL)
{
if (h->plt.refcount > 0)
@@ -2096,11 +2139,23 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
copied into the output file to be resolved at run time. */
switch (r_type)
{
+ asection *base_got;
case R_X86_64_GOT32:
+ case R_X86_64_GOT64:
/* Relocation is to the entry for this symbol in the global
offset table. */
case R_X86_64_GOTPCREL:
- /* Use global offset table as symbol value. */
+ case R_X86_64_GOTPCREL64:
+ /* Use global offset table entry as symbol value. */
+ case R_X86_64_GOTPLT64:
+ /* This is the same as GOT64 for relocation purposes, but
+ indicates the existence of a PLT entry. The difficulty is,
+ that we must calculate the GOT slot offset from the PLT
+ offset, if this symbol got a PLT entry (it was global).
+ Additionally if it's computed from the PLT entry, then that
+ GOT offset is relative to .got.plt, not to .got. */
+ base_got = htab->sgot;
+
if (htab->sgot == NULL)
abort ();
@@ -2109,6 +2164,19 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
bfd_boolean dyn;
off = h->got.offset;
+ if (h->needs_plt
+ && h->plt.offset != (bfd_vma)-1
+ && off == (bfd_vma)-1)
+ {
+ /* We can't use h->got.offset here to save
+ state, or even just remember the offset, as
+ finish_dynamic_symbol would use that as offset into
+ .got. */
+ bfd_vma plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+ off = (plt_index + 3) * GOT_ENTRY_SIZE;
+ base_got = htab->sgotplt;
+ }
+
dyn = htab->elf.dynamic_sections_created;
if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
@@ -2133,7 +2201,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
else
{
bfd_put_64 (output_bfd, relocation,
- htab->sgot->contents + off);
+ base_got->contents + off);
+ /* Note that this is harmless for the GOTPLT64 case,
+ as -1 | 1 still is -1. */
h->got.offset |= 1;
}
}
@@ -2155,7 +2225,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
else
{
bfd_put_64 (output_bfd, relocation,
- htab->sgot->contents + off);
+ base_got->contents + off);
if (info->shared)
{
@@ -2169,8 +2239,8 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (s == NULL)
abort ();
- outrel.r_offset = (htab->sgot->output_section->vma
- + htab->sgot->output_offset
+ outrel.r_offset = (base_got->output_section->vma
+ + base_got->output_offset
+ off);
outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE);
outrel.r_addend = relocation;
@@ -2186,9 +2256,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
if (off >= (bfd_vma) -2)
abort ();
- relocation = htab->sgot->output_section->vma
- + htab->sgot->output_offset + off;
- if (r_type != R_X86_64_GOTPCREL)
+ relocation = base_got->output_section->vma
+ + base_got->output_offset + off;
+ if (r_type != R_X86_64_GOTPCREL && r_type != R_X86_64_GOTPCREL64)
relocation -= htab->sgotplt->output_section->vma
- htab->sgotplt->output_offset;
@@ -2224,12 +2294,31 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
break;
case R_X86_64_GOTPC32:
+ case R_X86_64_GOTPC64:
/* Use global offset table as symbol value. */
relocation = htab->sgotplt->output_section->vma
+ htab->sgotplt->output_offset;
unresolved_reloc = FALSE;
break;
+ case R_X86_64_PLTOFF64:
+ /* Relocation is PLT entry relative to GOT. For local
+ symbols it's the symbol itself relative to GOT. */
+ if (h != NULL
+ /* See PLT32 handling. */
+ && h->plt.offset != (bfd_vma) -1
+ && htab->splt != NULL)
+ {
+ relocation = (htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + h->plt.offset);
+ unresolved_reloc = FALSE;
+ }
+
+ relocation -= htab->sgotplt->output_section->vma
+ + htab->sgotplt->output_offset;
+ break;
+
case R_X86_64_PLT32:
/* Relocation is to the entry for this symbol in the
procedure linkage table. */
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index f7f85ba2056..1f8ec2b2b2c 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -458,6 +458,25 @@ elf_file_p (Elf_External_Ehdr *x_ehdrp)
&& (x_ehdrp->e_ident[EI_MAG3] == ELFMAG3));
}
+/* Determines if a given section index is valid. */
+
+static inline bfd_boolean
+valid_section_index_p (unsigned index, unsigned num_sections)
+{
+ /* Note: We allow SHN_UNDEF as a valid section index. */
+ if (index < SHN_LORESERVE || index > SHN_HIRESERVE)
+ return index < num_sections;
+
+ /* We disallow the use of reserved indcies, except for those
+ with OS or Application specific meaning. The test make use
+ of the knowledge that:
+ SHN_LORESERVE == SHN_LOPROC
+ and
+ SHN_HIPROC == SHN_LOOS - 1 */
+ /* XXX - Should we allow SHN_XINDEX as a valid index here ? */
+ return (index >= SHN_LOPROC && index <= SHN_HIOS);
+}
+
/* Check to see if the file associated with ABFD matches the target vector
that ABFD points to.
@@ -545,7 +564,7 @@ elf_object_p (bfd *abfd)
if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL)
goto got_wrong_format_error;
- /* As a simple sanity check, verify that the what BFD thinks is the
+ /* As a simple sanity check, verify that what BFD thinks is the
size of each section header table entry actually matches the size
recorded in the file, but only if there are any sections. */
if (i_ehdrp->e_shentsize != sizeof (x_shdr) && i_ehdrp->e_shnum != 0)
@@ -711,17 +730,13 @@ elf_object_p (bfd *abfd)
elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex);
/* Sanity check sh_link and sh_info. */
- if (i_shdrp[shindex].sh_link >= num_sec
- || (i_shdrp[shindex].sh_link >= SHN_LORESERVE
- && i_shdrp[shindex].sh_link <= SHN_HIRESERVE))
+ if (! valid_section_index_p (i_shdrp[shindex].sh_link, num_sec))
goto got_wrong_format_error;
if (((i_shdrp[shindex].sh_flags & SHF_INFO_LINK)
|| i_shdrp[shindex].sh_type == SHT_RELA
|| i_shdrp[shindex].sh_type == SHT_REL)
- && (i_shdrp[shindex].sh_info >= num_sec
- || (i_shdrp[shindex].sh_info >= SHN_LORESERVE
- && i_shdrp[shindex].sh_info <= SHN_HIRESERVE)))
+ && ! valid_section_index_p (i_shdrp[shindex].sh_info, num_sec))
goto got_wrong_format_error;
/* If the section is loaded, but not page aligned, clear
@@ -739,12 +754,19 @@ elf_object_p (bfd *abfd)
/* A further sanity check. */
if (i_ehdrp->e_shnum != 0)
{
- if (i_ehdrp->e_shstrndx >= elf_numsections (abfd)
- || (i_ehdrp->e_shstrndx >= SHN_LORESERVE
- && i_ehdrp->e_shstrndx <= SHN_HIRESERVE))
- goto got_wrong_format_error;
+ if (! valid_section_index_p (i_ehdrp->e_shstrndx, elf_numsections (abfd)))
+ {
+ /* PR 2257:
+ We used to just goto got_wrong_format_error here
+ but there are binaries in existance for which this test
+ will prevent the binutils from working with them at all.
+ So we are kind, and reset the string index value to 0
+ so that at least some processing can be done. */
+ i_ehdrp->e_shstrndx = SHN_UNDEF;
+ _bfd_error_handler (_("warning: %s has a corrupt string table index - ignoring"), abfd->filename);
+ }
}
- else if (i_ehdrp->e_shstrndx != 0)
+ else if (i_ehdrp->e_shstrndx != SHN_UNDEF)
goto got_wrong_format_error;
/* Read in the program headers. */
@@ -1340,10 +1362,9 @@ elf_slurp_reloc_table_from_section (bfd *abfd,
}
else
{
- asymbol **ps, *s;
+ asymbol **ps;
ps = symbols + ELF_R_SYM (rela.r_info) - 1;
- s = *ps;
relent->sym_ptr_ptr = ps;
}
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 8c1c3c14328..8600d465d18 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -889,6 +889,26 @@ _bfd_elf_merge_symbol (bfd *abfd,
&& h->root.type != bfd_link_hash_undefweak
&& h->root.type != bfd_link_hash_common);
+ /* When we try to create a default indirect symbol from the dynamic
+ definition with the default version, we skip it if its type and
+ the type of existing regular definition mismatch. We only do it
+ if the existing regular definition won't be dynamic. */
+ if (pold_alignment == NULL
+ && !info->shared
+ && !info->export_dynamic
+ && !h->ref_dynamic
+ && newdyn
+ && newdef
+ && !olddyn
+ && (olddef || h->root.type == bfd_link_hash_common)
+ && ELF_ST_TYPE (sym->st_info) != h->type
+ && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
+ && h->type != STT_NOTYPE)
+ {
+ *skip = TRUE;
+ return TRUE;
+ }
+
/* Check TLS symbol. We don't check undefined symbol introduced by
"ld -u". */
if ((ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS)
@@ -2790,10 +2810,6 @@ _bfd_elf_add_dynamic_entry (struct bfd_link_info *info,
if (! is_elf_hash_table (hash_table))
return FALSE;
- if (info->warn_shared_textrel && info->shared && tag == DT_TEXTREL)
- _bfd_error_handler
- (_("warning: creating a DT_TEXTREL in a shared object."));
-
bed = get_elf_backend_data (hash_table->dynobj);
s = bfd_get_section_by_name (hash_table->dynobj, ".dynamic");
BFD_ASSERT (s != NULL);
@@ -6184,6 +6200,24 @@ elf_link_output_sym (struct elf_final_link_info *finfo,
return TRUE;
}
+/* Return TRUE if the dynamic symbol SYM in ABFD is supported. */
+
+static bfd_boolean
+check_dynsym (bfd *abfd, Elf_Internal_Sym *sym)
+{
+ if (sym->st_shndx > SHN_HIRESERVE)
+ {
+ /* The gABI doesn't support dynamic symbols in output sections
+ beyond 64k. */
+ (*_bfd_error_handler)
+ (_("%B: Too many sections: %d (>= %d)"),
+ abfd, bfd_count_sections (abfd), SHN_LORESERVE);
+ bfd_set_error (bfd_error_nonrepresentable_section);
+ return FALSE;
+ }
+ 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.
@@ -6616,6 +6650,11 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
sym.st_name = h->dynstr_index;
esym = finfo->dynsym_sec->contents + h->dynindx * bed->s->sizeof_sym;
+ if (! check_dynsym (finfo->output_bfd, &sym))
+ {
+ eoinfo->failed = TRUE;
+ return FALSE;
+ }
bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0);
bucketcount = elf_hash_table (finfo->info)->bucketcount;
@@ -6715,7 +6754,7 @@ unsigned int
_bfd_elf_default_action_discarded (asection *sec)
{
if (sec->flags & SEC_DEBUGGING)
- return 0;
+ return PRETEND;
if (strcmp (".eh_frame", sec->name) == 0)
return 0;
@@ -6739,6 +6778,7 @@ match_group_member (asection *sec, asection *group)
if (bfd_elf_match_symbols_in_sections (s, sec))
return s;
+ s = elf_next_in_group (s);
if (s == first)
break;
}
@@ -7665,7 +7705,7 @@ elf_fixup_link_order (bfd *abfd, asection *o)
struct bfd_link_order *p;
bfd *sub;
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
- int elfsec;
+ unsigned elfsec;
struct bfd_link_order **sections;
asection *s, *other_sec, *linkorder_sec;
bfd_vma offset;
@@ -7682,7 +7722,8 @@ elf_fixup_link_order (bfd *abfd, asection *o)
sub = s->owner;
if (bfd_get_flavour (sub) == bfd_target_elf_flavour
&& elf_elfheader (sub)->e_ident[EI_CLASS] == bed->s->elfclass
- && (elfsec = _bfd_elf_section_from_bfd_section (sub, s)) != -1
+ && (elfsec = _bfd_elf_section_from_bfd_section (sub, s))
+ && elfsec < elf_numsections (sub)
&& elf_elfsections (sub)[elfsec]->sh_flags & SHF_LINK_ORDER)
{
seen_linkorder++;
@@ -8305,6 +8346,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
indx = elf_section_data (s)->this_idx;
BFD_ASSERT (indx > 0);
sym.st_shndx = indx;
+ if (! check_dynsym (abfd, &sym))
+ return FALSE;
sym.st_value = s->vma;
dest = dynsym + dynindx * bed->s->sizeof_sym;
if (last_local < dynindx)
@@ -8339,6 +8382,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
sym.st_shndx =
elf_section_data (s->output_section)->this_idx;
+ if (! check_dynsym (abfd, &sym))
+ return FALSE;
sym.st_value = (s->output_section->vma
+ s->output_offset
+ e->isym.st_value);
@@ -8619,6 +8664,32 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if (! (*bed->elf_backend_finish_dynamic_sections) (abfd, info))
goto error_return;
+ /* Check for DT_TEXTREL (late, in case the backend removes it). */
+ if (info->warn_shared_textrel && info->shared)
+ {
+ bfd_byte *dyncon, *dynconend;
+
+ /* Fix up .dynamic entries. */
+ o = bfd_get_section_by_name (dynobj, ".dynamic");
+ BFD_ASSERT (o != NULL);
+
+ dyncon = o->contents;
+ dynconend = o->contents + o->size;
+ for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
+ {
+ Elf_Internal_Dyn dyn;
+
+ bed->s->swap_dyn_in (dynobj, dyncon, &dyn);
+
+ if (dyn.d_tag == DT_TEXTREL)
+ {
+ _bfd_error_handler
+ (_("warning: creating a DT_TEXTREL in a shared object."));
+ break;
+ }
+ }
+ }
+
for (o = dynobj->sections; o != NULL; o = o->next)
{
if ((o->flags & SEC_HAS_CONTENTS) == 0
@@ -8929,7 +9000,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
{
/* Keep debug and special sections. */
if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0
- || (o->flags & (SEC_ALLOC | SEC_LOAD)) == 0)
+ || (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
o->gc_mark = 1;
if (o->gc_mark)
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index f0bb0fa60ad..6b3257afdf1 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -80,9 +80,6 @@ struct elfNN_ia64_dyn_sym_info
/* The addend for which this entry is relevant. */
bfd_vma addend;
- /* Next addend in the list. */
- struct elfNN_ia64_dyn_sym_info *next;
-
bfd_vma got_offset;
bfd_vma fptr_offset;
bfd_vma pltoff_offset;
@@ -133,6 +130,13 @@ struct elfNN_ia64_local_hash_entry
{
int id;
unsigned int r_sym;
+ /* The number of elements in elfNN_ia64_dyn_sym_info array. */
+ unsigned int count;
+ /* The number of sorted elements in elfNN_ia64_dyn_sym_info array. */
+ unsigned int sorted_count;
+ /* The size of elfNN_ia64_dyn_sym_info array. */
+ unsigned int size;
+ /* The array of elfNN_ia64_dyn_sym_info. */
struct elfNN_ia64_dyn_sym_info *info;
/* TRUE if this hash entry's addends was translated for
@@ -143,6 +147,13 @@ struct elfNN_ia64_local_hash_entry
struct elfNN_ia64_link_hash_entry
{
struct elf_link_hash_entry root;
+ /* The number of elements in elfNN_ia64_dyn_sym_info array. */
+ unsigned int count;
+ /* The number of sorted elements in elfNN_ia64_dyn_sym_info array. */
+ unsigned int sorted_count;
+ /* The size of elfNN_ia64_dyn_sym_info array. */
+ unsigned int size;
+ /* The array of elfNN_ia64_dyn_sym_info. */
struct elfNN_ia64_dyn_sym_info *info;
};
@@ -852,6 +863,12 @@ elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
bfd_putl64 (t0, hit_addr);
bfd_putl64 (t1, hit_addr + 8);
}
+
+/* Rename some of the generic section flags to better document how they
+ are used here. */
+#define skip_relax_pass_0 need_finalize_relax
+#define skip_relax_pass_1 has_gp_reloc
+
/* These functions do relaxation for IA-64 ELF. */
@@ -880,6 +897,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
bfd_boolean changed_contents = FALSE;
bfd_boolean changed_relocs = FALSE;
bfd_boolean changed_got = FALSE;
+ bfd_boolean skip_relax_pass_0 = TRUE;
+ bfd_boolean skip_relax_pass_1 = TRUE;
bfd_vma gp = 0;
/* Assume we're not going to change any sizes, and we'll only need
@@ -891,11 +910,11 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
return FALSE;
/* Nothing to do if there are no relocations or there is no need for
- the relax finalize pass. */
+ the current pass. */
if ((sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
- || (!link_info->need_relax_finalize
- && sec->need_finalize_relax == 0))
+ || (link_info->relax_pass == 0 && sec->skip_relax_pass_0)
+ || (link_info->relax_pass == 1 && sec->skip_relax_pass_1))
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -936,20 +955,19 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
case R_IA64_PCREL21BI:
case R_IA64_PCREL21M:
case R_IA64_PCREL21F:
- /* In the finalize pass, all br relaxations are done. We can
- skip it. */
- if (!link_info->need_relax_finalize)
+ /* In pass 1, all br relaxations are done. We can skip it. */
+ if (link_info->relax_pass == 1)
continue;
+ skip_relax_pass_0 = FALSE;
is_branch = TRUE;
break;
case R_IA64_PCREL60B:
- /* We can't optimize brl to br before the finalize pass since
- br relaxations will increase the code size. Defer it to
- the finalize pass. */
- if (link_info->need_relax_finalize)
+ /* We can't optimize brl to br in pass 0 since br relaxations
+ will increase the code size. Defer it to pass 1. */
+ if (link_info->relax_pass == 0)
{
- sec->need_finalize_relax = 1;
+ skip_relax_pass_1 = FALSE;
continue;
}
is_branch = TRUE;
@@ -957,12 +975,11 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
case R_IA64_LTOFF22X:
case R_IA64_LDXMOV:
- /* We can't relax ldx/mov before the finalize pass since
- br relaxations will increase the code size. Defer it to
- the finalize pass. */
- if (link_info->need_relax_finalize)
+ /* We can't relax ldx/mov in pass 0 since br relaxations will
+ increase the code size. Defer it to pass 1. */
+ if (link_info->relax_pass == 0)
{
- sec->need_finalize_relax = 1;
+ skip_relax_pass_1 = FALSE;
continue;
}
is_branch = FALSE;
@@ -1352,8 +1369,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
}
}
- if (!link_info->need_relax_finalize)
- sec->need_finalize_relax = 0;
+ if (link_info->relax_pass == 0)
+ {
+ /* Pass 0 is only needed to relax br. */
+ sec->skip_relax_pass_0 = skip_relax_pass_0;
+ sec->skip_relax_pass_1 = skip_relax_pass_1;
+ }
*again = changed_contents || changed_relocs;
return TRUE;
@@ -1369,6 +1390,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
free (internal_relocs);
return FALSE;
}
+#undef skip_relax_pass_0
+#undef skip_relax_pass_1
static void
elfNN_ia64_relax_ldxmov (contents, off)
@@ -1799,6 +1822,9 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string)
table, string));
ret->info = NULL;
+ ret->count = 0;
+ ret->sorted_count = 0;
+ ret->size = 0;
return (struct bfd_hash_entry *) ret;
}
@@ -1829,16 +1855,25 @@ elfNN_ia64_hash_copy_indirect (info, xdir, xind)
if (ind->info != NULL)
{
struct elfNN_ia64_dyn_sym_info *dyn_i;
- struct elfNN_ia64_dyn_sym_info **pdyn;
+ unsigned int count;
+
+ if (dir->info)
+ free (dir->info);
+
+ dir->info = ind->info;
+ dir->count = ind->count;
+ dir->sorted_count = ind->sorted_count;
+ dir->size = ind->size;
- pdyn = &dir->info;
- while ((dyn_i = *pdyn) != NULL)
- pdyn = &dyn_i->next;
- *pdyn = dyn_i = ind->info;
ind->info = NULL;
+ ind->count = 0;
+ ind->sorted_count = 0;
+ ind->size = 0;
/* Fix up the dyn_sym_info pointers to the global symbol. */
- for (; dyn_i; dyn_i = dyn_i->next)
+ for (count = dir->count, dyn_i = dir->info;
+ count != 0;
+ count--, dyn_i++)
dyn_i->h = &dir->root;
}
@@ -1864,12 +1899,15 @@ elfNN_ia64_hash_hide_symbol (info, xh, force_local)
{
struct elfNN_ia64_link_hash_entry *h;
struct elfNN_ia64_dyn_sym_info *dyn_i;
+ unsigned int count;
h = (struct elfNN_ia64_link_hash_entry *)xh;
_bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
- for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next)
+ for (count = h->count, dyn_i = h->info;
+ count != 0;
+ count--, dyn_i++)
{
dyn_i->want_plt2 = 0;
dyn_i->want_plt = 0;
@@ -1937,6 +1975,51 @@ elfNN_ia64_hash_table_create (abfd)
return &ret->root.root;
}
+/* Free the global elfNN_ia64_dyn_sym_info array. */
+
+static bfd_boolean
+elfNN_ia64_global_dyn_info_free (void **xentry,
+ PTR unused ATTRIBUTE_UNUSED)
+{
+ struct elfNN_ia64_link_hash_entry *entry
+ = (struct elfNN_ia64_link_hash_entry *) xentry;
+
+ if (entry->root.root.type == bfd_link_hash_warning)
+ entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link;
+
+ if (entry->info)
+ {
+ free (entry->info);
+ entry->info = NULL;
+ entry->count = 0;
+ entry->sorted_count = 0;
+ entry->size = 0;
+ }
+
+ return TRUE;
+}
+
+/* Free the local elfNN_ia64_dyn_sym_info array. */
+
+static bfd_boolean
+elfNN_ia64_local_dyn_info_free (void **slot,
+ PTR unused ATTRIBUTE_UNUSED)
+{
+ struct elfNN_ia64_local_hash_entry *entry
+ = (struct elfNN_ia64_local_hash_entry *) *slot;
+
+ if (entry->info)
+ {
+ free (entry->info);
+ entry->info = NULL;
+ entry->count = 0;
+ entry->sorted_count = 0;
+ entry->size = 0;
+ }
+
+ return TRUE;
+}
+
/* Destroy IA-64 linker hash table. */
static void
@@ -1946,9 +2029,15 @@ elfNN_ia64_hash_table_free (hash)
struct elfNN_ia64_link_hash_table *ia64_info
= (struct elfNN_ia64_link_hash_table *) hash;
if (ia64_info->loc_hash_table)
- htab_delete (ia64_info->loc_hash_table);
+ {
+ htab_traverse (ia64_info->loc_hash_table,
+ elfNN_ia64_local_dyn_info_free, NULL);
+ htab_delete (ia64_info->loc_hash_table);
+ }
if (ia64_info->loc_hash_memory)
objalloc_free ((struct objalloc *) ia64_info->loc_hash_memory);
+ elf_link_hash_traverse (&ia64_info->root,
+ elfNN_ia64_global_dyn_info_free, NULL);
_bfd_generic_link_hash_table_free (hash);
}
@@ -1970,11 +2059,14 @@ elfNN_ia64_global_dyn_sym_thunk (xentry, xdata)
struct elfNN_ia64_dyn_sym_traverse_data *data
= (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
struct elfNN_ia64_dyn_sym_info *dyn_i;
+ unsigned int count;
if (entry->root.root.type == bfd_link_hash_warning)
entry = (struct elfNN_ia64_link_hash_entry *) entry->root.root.u.i.link;
- for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
+ for (count = entry->count, dyn_i = entry->info;
+ count != 0;
+ count--, dyn_i++)
if (! (*data->func) (dyn_i, data->data))
return FALSE;
return TRUE;
@@ -1990,11 +2082,14 @@ elfNN_ia64_local_dyn_sym_thunk (slot, xdata)
struct elfNN_ia64_dyn_sym_traverse_data *data
= (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
struct elfNN_ia64_dyn_sym_info *dyn_i;
+ unsigned int count;
- for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
+ for (count = entry->count, dyn_i = entry->info;
+ count != 0;
+ count--, dyn_i++)
if (! (*data->func) (dyn_i, data->data))
- return 0;
- return 1;
+ return FALSE;
+ return TRUE;
}
static void
@@ -2103,8 +2198,129 @@ get_local_sym_hash (ia64_info, abfd, rel, create)
return ret;
}
+/* Used to sort elfNN_ia64_dyn_sym_info array. */
+
+static int
+addend_compare (const void *xp, const void *yp)
+{
+ const struct elfNN_ia64_dyn_sym_info *x
+ = (const struct elfNN_ia64_dyn_sym_info *) xp;
+ const struct elfNN_ia64_dyn_sym_info *y
+ = (const struct elfNN_ia64_dyn_sym_info *) yp;
+
+ return x->addend - y->addend;
+}
+
+/* Sort elfNN_ia64_dyn_sym_info array and remove duplicates. */
+
+static unsigned int
+sort_dyn_sym_info (struct elfNN_ia64_dyn_sym_info *info,
+ unsigned int count)
+{
+ bfd_vma curr, prev;
+ unsigned int i, dup, diff, dest, src, len;
+
+ qsort (info, count, sizeof (*info), addend_compare);
+
+ /* Find the first duplicate. */
+ prev = info [0].addend;
+ for (i = 1; i < count; i++)
+ {
+ curr = info [i].addend;
+ if (curr == prev)
+ break;
+ prev = curr;
+ }
+
+ /* Remove duplicates. */
+ if (i < count)
+ {
+ /* We need to move a block of elements to here. */
+ dest = i++;
+ while (i < count)
+ {
+ curr = info [i].addend;
+
+ /* Move a block of elements whose first one is different from
+ the previous. */
+ if (curr == prev)
+ {
+ for (src = i + 1; src < count; src++)
+ if (info [src].addend != curr)
+ break;
+ }
+ else
+ src = i;
+
+ if (src >= count)
+ break;
+
+ /* Find the next duplicate. */
+ prev = info [src].addend;
+ for (dup = src + 1; dup < count; dup++)
+ {
+ curr = info [dup].addend;
+ if (curr == prev)
+ break;
+ prev = curr;
+ }
+
+ /* How much to move. */
+ len = dup - src;
+ i = dup + 1;
+
+ if (len == 1 && dup < count)
+ {
+ /* If we only move 1 element, we combine it with the next
+ one. Find the next different one. */
+ for (diff = dup + 1, src++; diff < count; diff++, src++)
+ if (info [diff].addend != curr)
+ break;
+
+ if (diff < count)
+ {
+ /* Find the next duplicate. */
+ prev = info [diff].addend;
+ for (dup = diff + 1; dup < count; dup++)
+ {
+ curr = info [dup].addend;
+ if (curr == prev)
+ break;
+ prev = curr;
+ diff++;
+ }
+
+ len = diff - src + 1;
+ i = diff + 1;
+ }
+ }
+
+ memmove (&info [dest], &info [src], len * sizeof (*info));
+
+ dest += len;
+ }
+
+ count = dest;
+ }
+
+ return count;
+}
+
/* Find and/or create a descriptor for dynamic symbol info. This will
- vary based on global or local symbol, and the addend to the reloc. */
+ vary based on global or local symbol, and the addend to the reloc.
+
+ We don't sort when inserting. Also, we sort and eliminate
+ duplicates if there is an unsorted section. Typically, this will
+ only happen once, because we do all insertions before lookups. We
+ then use bsearch to do a lookup. This also allows lookups to be
+ fast. So we have fast insertion (O(log N) due to duplicate check),
+ fast lookup (O(log N)) and one sort (O(N log N) expected time).
+ Previously, all lookups were O(N) because of the use of the linked
+ list and also all insertions were O(N) because of the check for
+ duplicates. There are some complications here because the array
+ size grows occasionally, which may add an O(N) factor, but this
+ should be rare. Also, we free the excess array allocation, which
+ requires a copy which is O(N), but this only happens once. */
static struct elfNN_ia64_dyn_sym_info *
get_dyn_sym_info (ia64_info, h, abfd, rel, create)
@@ -2114,12 +2330,22 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create)
const Elf_Internal_Rela *rel;
bfd_boolean create;
{
- struct elfNN_ia64_dyn_sym_info **pp;
- struct elfNN_ia64_dyn_sym_info *dyn_i;
+ struct elfNN_ia64_dyn_sym_info **info_p, *info, *dyn_i, key;
+ unsigned int *count_p, *sorted_count_p, *size_p;
+ unsigned int count, sorted_count, size;
bfd_vma addend = rel ? rel->r_addend : 0;
+ bfd_size_type amt;
if (h)
- pp = &((struct elfNN_ia64_link_hash_entry *)h)->info;
+ {
+ struct elfNN_ia64_link_hash_entry *global_h;
+
+ global_h = (struct elfNN_ia64_link_hash_entry *) h;
+ info_p = &global_h->info;
+ count_p = &global_h->count;
+ sorted_count_p = &global_h->sorted_count;
+ size_p = &global_h->size;
+ }
else
{
struct elfNN_ia64_local_hash_entry *loc_h;
@@ -2131,18 +2357,107 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create)
return NULL;
}
- pp = &loc_h->info;
+ info_p = &loc_h->info;
+ count_p = &loc_h->count;
+ sorted_count_p = &loc_h->sorted_count;
+ size_p = &loc_h->size;
}
- for (dyn_i = *pp; dyn_i && dyn_i->addend != addend; dyn_i = *pp)
- pp = &dyn_i->next;
-
- if (dyn_i == NULL && create)
+ count = *count_p;
+ sorted_count = *sorted_count_p;
+ size = *size_p;
+ info = *info_p;
+ if (create)
{
- dyn_i = ((struct elfNN_ia64_dyn_sym_info *)
- bfd_zalloc (abfd, (bfd_size_type) sizeof *dyn_i));
- *pp = dyn_i;
+ /* When we create the array, we don't check for duplicates,
+ except in the previously sorted section if one exists, and
+ against the last inserted entry. This allows insertions to
+ be fast. */
+ if (info)
+ {
+ if (sorted_count)
+ {
+ /* Try bsearch first on the sorted section. */
+ key.addend = addend;
+ dyn_i = bsearch (&key, info, sorted_count,
+ sizeof (*info), addend_compare);
+
+ if (dyn_i)
+ {
+ return dyn_i;
+ }
+ }
+
+ /* Do a quick check for the last inserted entry. */
+ dyn_i = info + count - 1;
+ if (dyn_i->addend == addend)
+ {
+ return dyn_i;
+ }
+ }
+
+ if (size == 0)
+ {
+ /* It is the very first element. We create the array of size
+ 1. */
+ size = 1;
+ amt = size * sizeof (*info);
+ info = bfd_malloc (amt);
+ }
+ else if (size <= count)
+ {
+ /* We double the array size every time when we reach the
+ size limit. */
+ size += size;
+ amt = size * sizeof (*info);
+ info = bfd_realloc (info, amt);
+ }
+ else
+ goto has_space;
+
+ if (info == NULL)
+ return NULL;
+ *size_p = size;
+ *info_p = info;
+
+has_space:
+ /* Append the new one to the array. */
+ dyn_i = info + count;
+ memset (dyn_i, 0, sizeof (*dyn_i));
dyn_i->addend = addend;
+
+ /* We increment count only since the new ones are unsorted and
+ may have duplicate. */
+ (*count_p)++;
+ }
+ else
+ {
+ /* It is a lookup without insertion. Sort array if part of the
+ array isn't sorted. */
+ if (count != sorted_count)
+ {
+ count = sort_dyn_sym_info (info, count);
+ *count_p = count;
+ *sorted_count_p = count;
+ }
+
+ /* Free unused memory. */
+ if (size != count)
+ {
+ amt = count * sizeof (*info);
+ info = bfd_malloc (amt);
+ if (info != NULL)
+ {
+ memcpy (info, *info_p, amt);
+ free (*info_p);
+ *size_p = count;
+ *info_p = info;
+ }
+ }
+
+ key.addend = addend;
+ dyn_i = bsearch (&key, info, count,
+ sizeof (*info), addend_compare);
}
return dyn_i;
@@ -2368,6 +2683,23 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
Elf_Internal_Shdr *symtab_hdr;
const Elf_Internal_Rela *rel;
asection *got, *fptr, *srel, *pltoff;
+ enum {
+ NEED_GOT = 1,
+ NEED_GOTX = 2,
+ NEED_FPTR = 4,
+ NEED_PLTOFF = 8,
+ NEED_MIN_PLT = 16,
+ NEED_FULL_PLT = 32,
+ NEED_DYNREL = 64,
+ NEED_LTOFF_FPTR = 128,
+ NEED_TPREL = 256,
+ NEED_DTPMOD = 512,
+ NEED_DTPREL = 1024
+ };
+ int need_entry;
+ struct elf_link_hash_entry *h;
+ unsigned long r_symndx;
+ bfd_boolean maybe_dynamic;
if (info->relocatable)
return TRUE;
@@ -2378,29 +2710,181 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
got = fptr = srel = pltoff = NULL;
relend = relocs + sec->reloc_count;
+
+ /* We scan relocations first to create dynamic relocation arrays. We
+ modified get_dyn_sym_info to allow fast insertion and support fast
+ lookup in the next loop. */
+ for (rel = relocs; rel < relend; ++rel)
+ {
+ r_symndx = ELFNN_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ long indx = r_symndx - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ 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;
+ }
+ else
+ h = NULL;
+
+ /* 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 = (h && ((!info->executable
+ && (!info->symbolic
+ || info->unresolved_syms_in_shared_libs == RM_IGNORE))
+ || !h->def_regular
+ || h->root.type == bfd_link_hash_defweak));
+
+ need_entry = 0;
+ switch (ELFNN_R_TYPE (rel->r_info))
+ {
+ case R_IA64_TPREL64MSB:
+ case R_IA64_TPREL64LSB:
+ if (info->shared || maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ break;
+
+ case R_IA64_LTOFF_TPREL22:
+ need_entry = NEED_TPREL;
+ if (info->shared)
+ info->flags |= DF_STATIC_TLS;
+ break;
+
+ case R_IA64_DTPREL32MSB:
+ case R_IA64_DTPREL32LSB:
+ case R_IA64_DTPREL64MSB:
+ case R_IA64_DTPREL64LSB:
+ if (info->shared || maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ break;
+
+ case R_IA64_LTOFF_DTPREL22:
+ need_entry = NEED_DTPREL;
+ break;
+
+ case R_IA64_DTPMOD64MSB:
+ case R_IA64_DTPMOD64LSB:
+ if (info->shared || maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ break;
+
+ case R_IA64_LTOFF_DTPMOD22:
+ need_entry = NEED_DTPMOD;
+ break;
+
+ case R_IA64_LTOFF_FPTR22:
+ case R_IA64_LTOFF_FPTR64I:
+ case R_IA64_LTOFF_FPTR32MSB:
+ case R_IA64_LTOFF_FPTR32LSB:
+ case R_IA64_LTOFF_FPTR64MSB:
+ case R_IA64_LTOFF_FPTR64LSB:
+ need_entry = NEED_FPTR | NEED_GOT | NEED_LTOFF_FPTR;
+ break;
+
+ case R_IA64_FPTR64I:
+ case R_IA64_FPTR32MSB:
+ case R_IA64_FPTR32LSB:
+ case R_IA64_FPTR64MSB:
+ case R_IA64_FPTR64LSB:
+ if (info->shared || h)
+ need_entry = NEED_FPTR | NEED_DYNREL;
+ else
+ need_entry = NEED_FPTR;
+ break;
+
+ case R_IA64_LTOFF22:
+ case R_IA64_LTOFF64I:
+ need_entry = NEED_GOT;
+ break;
+
+ case R_IA64_LTOFF22X:
+ need_entry = NEED_GOTX;
+ break;
+
+ case R_IA64_PLTOFF22:
+ case R_IA64_PLTOFF64I:
+ case R_IA64_PLTOFF64MSB:
+ case R_IA64_PLTOFF64LSB:
+ need_entry = NEED_PLTOFF;
+ if (h)
+ {
+ if (maybe_dynamic)
+ need_entry |= NEED_MIN_PLT;
+ }
+ else
+ {
+ (*info->callbacks->warning)
+ (info, _("@pltoff reloc against local symbol"), 0,
+ abfd, 0, (bfd_vma) 0);
+ }
+ break;
+
+ case R_IA64_PCREL21B:
+ case R_IA64_PCREL60B:
+ /* Depending on where this symbol is defined, we may or may not
+ need a full plt entry. Only skip if we know we'll not need
+ the entry -- static or symbolic, and the symbol definition
+ has already been seen. */
+ if (maybe_dynamic && rel->r_addend == 0)
+ need_entry = NEED_FULL_PLT;
+ break;
+
+ case R_IA64_IMM14:
+ case R_IA64_IMM22:
+ case R_IA64_IMM64:
+ case R_IA64_DIR32MSB:
+ case R_IA64_DIR32LSB:
+ case R_IA64_DIR64MSB:
+ case R_IA64_DIR64LSB:
+ /* Shared objects will always need at least a REL relocation. */
+ if (info->shared || maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ break;
+
+ case R_IA64_IPLTMSB:
+ case R_IA64_IPLTLSB:
+ /* Shared objects will always need at least a REL relocation. */
+ if (info->shared || maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ break;
+
+ case R_IA64_PCREL22:
+ case R_IA64_PCREL64I:
+ case R_IA64_PCREL32MSB:
+ case R_IA64_PCREL32LSB:
+ case R_IA64_PCREL64MSB:
+ case R_IA64_PCREL64LSB:
+ if (maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ break;
+ }
+
+ if (!need_entry)
+ continue;
+
+ if ((need_entry & NEED_FPTR) != 0
+ && rel->r_addend)
+ {
+ (*info->callbacks->warning)
+ (info, _("non-zero addend in @fptr reloc"), 0,
+ abfd, 0, (bfd_vma) 0);
+ }
+
+ if (get_dyn_sym_info (ia64_info, h, abfd, rel, TRUE) == NULL)
+ return FALSE;
+ }
+
+ /* Now, we only do lookup without insertion, which is very fast
+ with the modified get_dyn_sym_info. */
for (rel = relocs; rel < relend; ++rel)
{
- enum {
- NEED_GOT = 1,
- NEED_GOTX = 2,
- NEED_FPTR = 4,
- NEED_PLTOFF = 8,
- NEED_MIN_PLT = 16,
- NEED_FULL_PLT = 32,
- NEED_DYNREL = 64,
- NEED_LTOFF_FPTR = 128,
- NEED_TPREL = 256,
- NEED_DTPMOD = 512,
- NEED_DTPREL = 1024
- };
-
- struct elf_link_hash_entry *h = NULL;
- unsigned long r_symndx = ELFNN_R_SYM (rel->r_info);
struct elfNN_ia64_dyn_sym_info *dyn_i;
- int need_entry;
- bfd_boolean maybe_dynamic;
int dynrel_type = R_IA64_NONE;
+ r_symndx = ELFNN_R_SYM (rel->r_info);
if (r_symndx >= symtab_hdr->sh_info)
{
/* We're dealing with a global symbol -- find its hash entry
@@ -2413,18 +2897,18 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
h->ref_regular = 1;
}
+ else
+ h = NULL;
/* 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->executable
- && (!info->symbolic
- || info->unresolved_syms_in_shared_libs == RM_IGNORE))
- || !h->def_regular
- || h->root.type == bfd_link_hash_defweak))
- maybe_dynamic = TRUE;
+ maybe_dynamic = (h && ((!info->executable
+ && (!info->symbolic
+ || info->unresolved_syms_in_shared_libs == RM_IGNORE))
+ || !h->def_regular
+ || h->root.type == bfd_link_hash_defweak));
need_entry = 0;
switch (ELFNN_R_TYPE (rel->r_info))
@@ -2508,12 +2992,6 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
if (maybe_dynamic)
need_entry |= NEED_MIN_PLT;
}
- else
- {
- (*info->callbacks->warning)
- (info, _("@pltoff reloc against local symbol"), 0,
- abfd, 0, (bfd_vma) 0);
- }
break;
case R_IA64_PCREL21B:
@@ -2562,15 +3040,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
if (!need_entry)
continue;
- if ((need_entry & NEED_FPTR) != 0
- && rel->r_addend)
- {
- (*info->callbacks->warning)
- (info, _("non-zero addend in @fptr reloc"), 0,
- abfd, 0, (bfd_vma) 0);
- }
-
- dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, TRUE);
+ dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, FALSE);
/* Record whether or not this is a local symbol. */
dyn_i->h = h;
@@ -4145,8 +4615,11 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
if (loc_h && ! loc_h->sec_merge_done)
{
struct elfNN_ia64_dyn_sym_info *dynent;
+ unsigned int count;
- for (dynent = loc_h->info; dynent; dynent = dynent->next)
+ for (count = loc_h->count, dynent = loc_h->info;
+ count != 0;
+ count--, dynent++)
{
msec = sym_sec;
dynent->addend =
@@ -4161,6 +4634,10 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
- sym_sec->output_section->vma
- sym_sec->output_offset;
}
+
+ qsort (loc_h->info, loc_h->count,
+ sizeof (*loc_h->info), addend_compare);
+
loc_h->sec_merge_done = 1;
}
}
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 7f124b091af..d2c41c01a41 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -34,6 +34,7 @@
#include "elf-bfd.h"
#include "elfxx-mips.h"
#include "elf/mips.h"
+#include "elf-vxworks.h"
/* Get the ECOFF swapping routines. */
#include "coff/sym.h"
@@ -43,8 +44,39 @@
#include "hashtab.h"
-/* This structure is used to hold .got entries while estimating got
- sizes. */
+/* This structure is used to hold information about one GOT entry.
+ There are three types of entry:
+
+ (1) absolute addresses
+ (abfd == NULL)
+ (2) SYMBOL + OFFSET addresses, where SYMBOL is local to an input bfd
+ (abfd != NULL, symndx >= 0)
+ (3) global and forced-local symbols
+ (abfd != NULL, symndx == -1)
+
+ Type (3) entries are treated differently for different types of GOT.
+ In the "master" GOT -- i.e. the one that describes every GOT
+ reference needed in the link -- the mips_got_entry is keyed on both
+ the symbol and the input bfd that references it. If it turns out
+ that we need multiple GOTs, we can then use this information to
+ create separate GOTs for each input bfd.
+
+ However, we want each of these separate GOTs to have at most one
+ entry for a given symbol, so their type (3) entries are keyed only
+ on the symbol. The input bfd given by the "abfd" field is somewhat
+ arbitrary in this case.
+
+ This means that when there are multiple GOTs, each GOT has a unique
+ mips_got_entry for every symbol within it. We can therefore use the
+ mips_got_entry fields (tls_type and gotidx) to track the symbol's
+ GOT index.
+
+ However, if it turns out that we need only a single GOT, we continue
+ to use the master GOT to describe it. There may therefore be several
+ mips_got_entries for the same symbol, each with a different input bfd.
+ We want to make sure that each symbol gets a unique GOT entry, so when
+ there's a single GOT, we use the symbol's hash entry, not the
+ mips_got_entry fields, to track a symbol's GOT index. */
struct mips_got_entry
{
/* The input bfd in which the symbol is defined. */
@@ -246,6 +278,12 @@ struct mips_elf_link_hash_entry
the initial global GOT entry to a local GOT entry. */
bfd_boolean forced_local;
+ /* Are we referenced by some kind of relocation? */
+ bfd_boolean is_relocation_target;
+
+ /* Are we referenced by branch relocations? */
+ bfd_boolean is_branch_target;
+
#define GOT_NORMAL 0
#define GOT_TLS_GD 1
#define GOT_TLS_LDM 2
@@ -283,6 +321,22 @@ struct mips_elf_link_hash_table
bfd_vma rld_value;
/* This is set if we see any mips16 stub sections. */
bfd_boolean mips16_stubs_seen;
+ /* True if we're generating code for VxWorks. */
+ bfd_boolean is_vxworks;
+ /* Shortcuts to some dynamic sections, or NULL if they are not
+ being used. */
+ asection *srelbss;
+ asection *sdynbss;
+ asection *srelplt;
+ asection *srelplt2;
+ asection *sgotplt;
+ asection *splt;
+ /* The size of the PLT header in bytes (VxWorks only). */
+ bfd_vma plt_header_size;
+ /* The size of a PLT entry in bytes (VxWorks only). */
+ bfd_vma plt_entry_size;
+ /* The size of a function stub entry in bytes. */
+ bfd_vma function_stub_size;
};
#define TLS_RELOC_P(r_type) \
@@ -433,8 +487,8 @@ typedef struct runtime_pdr {
#define rpdNil ((pRPDR) 0)
static struct mips_got_entry *mips_elf_create_local_got_entry
- (bfd *, bfd *, struct mips_got_info *, asection *, bfd_vma, unsigned long,
- struct mips_elf_link_hash_entry *, int);
+ (bfd *, struct bfd_link_info *, bfd *, struct mips_got_info *, asection *,
+ asection *, bfd_vma, unsigned long, struct mips_elf_link_hash_entry *, int);
static bfd_boolean mips_elf_sort_hash_table_f
(struct mips_elf_link_hash_entry *, void *);
static bfd_vma mips_elf_high
@@ -483,6 +537,11 @@ static bfd *reldyn_sorting_bfd;
#define MIPS_ELF_OPTIONS_SECTION_NAME_P(NAME) \
(strcmp (NAME, ".MIPS.options") == 0 || strcmp (NAME, ".options") == 0)
+/* Whether the section is readonly. */
+#define MIPS_ELF_READONLY_SECTION(sec) \
+ ((sec->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) \
+ == (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
+
/* The name of the stub section. */
#define MIPS_ELF_STUB_SECTION_NAME(abfd) ".MIPS.stubs"
@@ -490,6 +549,10 @@ static bfd *reldyn_sorting_bfd;
#define MIPS_ELF_REL_SIZE(abfd) \
(get_elf_backend_data (abfd)->s->sizeof_rel)
+/* The size of an external RELA relocation. */
+#define MIPS_ELF_RELA_SIZE(abfd) \
+ (get_elf_backend_data (abfd)->s->sizeof_rela)
+
/* The size of an external dynamic table entry. */
#define MIPS_ELF_DYN_SIZE(abfd) \
(get_elf_backend_data (abfd)->s->sizeof_dyn)
@@ -540,36 +603,47 @@ static bfd *reldyn_sorting_bfd;
== (ABI_64_P (abfd) ? sizeof (Elf64_External_Rela) \
: sizeof (Elf32_External_Rela))))
+/* The name of the dynamic relocation section. */
+#define MIPS_ELF_REL_DYN_NAME(INFO) \
+ (mips_elf_hash_table (INFO)->is_vxworks ? ".rela.dyn" : ".rel.dyn")
+
/* 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)
#define MINUS_TWO (((bfd_vma)0) - 2)
/* The number of local .got entries we reserve. */
-#define MIPS_RESERVED_GOTNO (2)
+#define MIPS_RESERVED_GOTNO(INFO) \
+ (mips_elf_hash_table (INFO)->is_vxworks ? 3 : 2)
/* The offset of $gp from the beginning of the .got section. */
-#define ELF_MIPS_GP_OFFSET(abfd) (0x7ff0)
+#define ELF_MIPS_GP_OFFSET(INFO) \
+ (mips_elf_hash_table (INFO)->is_vxworks ? 0x0 : 0x7ff0)
/* The maximum size of the GOT for it to be addressable using 16-bit
offsets from $gp. */
-#define MIPS_ELF_GOT_MAX_SIZE(abfd) (ELF_MIPS_GP_OFFSET(abfd) + 0x7fff)
+#define MIPS_ELF_GOT_MAX_SIZE(INFO) (ELF_MIPS_GP_OFFSET (INFO) + 0x7fff)
/* Instructions which appear in a stub. */
-#define STUB_LW(abfd) \
- ((ABI_64_P (abfd) \
- ? 0xdf998010 /* ld t9,0x8010(gp) */ \
- : 0x8f998010)) /* lw t9,0x8010(gp) */
-#define STUB_MOVE(abfd) \
- ((ABI_64_P (abfd) \
- ? 0x03e0782d /* daddu t7,ra */ \
- : 0x03e07821)) /* addu t7,ra */
-#define STUB_JALR 0x0320f809 /* jalr t9,ra */
-#define STUB_LI16(abfd) \
- ((ABI_64_P (abfd) \
- ? 0x64180000 /* daddiu t8,zero,0 */ \
- : 0x24180000)) /* addiu t8,zero,0 */
-#define MIPS_FUNCTION_STUB_SIZE (16)
+#define STUB_LW(abfd) \
+ ((ABI_64_P (abfd) \
+ ? 0xdf998010 /* ld t9,0x8010(gp) */ \
+ : 0x8f998010)) /* lw t9,0x8010(gp) */
+#define STUB_MOVE(abfd) \
+ ((ABI_64_P (abfd) \
+ ? 0x03e0782d /* daddu t7,ra */ \
+ : 0x03e07821)) /* addu t7,ra */
+#define STUB_LUI(VAL) (0x3c180000 + (VAL)) /* lui t8,VAL */
+#define STUB_JALR 0x0320f809 /* jalr t9,ra */
+#define STUB_ORI(VAL) (0x37180000 + (VAL)) /* ori t8,t8,VAL */
+#define STUB_LI16U(VAL) (0x34180000 + (VAL)) /* ori t8,zero,VAL unsigned */
+#define STUB_LI16S(abfd, VAL) \
+ ((ABI_64_P (abfd) \
+ ? (0x64180000 + (VAL)) /* daddiu t8,zero,VAL sign extended */ \
+ : (0x24180000 + (VAL)))) /* addiu t8,zero,VAL sign extended */
+
+#define MIPS_FUNCTION_STUB_NORMAL_SIZE 16
+#define MIPS_FUNCTION_STUB_BIG_SIZE 20
/* The name of the dynamic interpreter. This is put in the .interp
section. */
@@ -636,6 +710,44 @@ static bfd *reldyn_sorting_bfd;
#define CALL_STUB ".mips16.call."
#define CALL_FP_STUB ".mips16.call.fp."
+/* The format of the first PLT entry in a VxWorks executable. */
+static const bfd_vma mips_vxworks_exec_plt0_entry[] = {
+ 0x3c190000, /* lui t9, %hi(_GLOBAL_OFFSET_TABLE_) */
+ 0x27390000, /* addiu t9, t9, %lo(_GLOBAL_OFFSET_TABLE_) */
+ 0x8f390008, /* lw t9, 8(t9) */
+ 0x00000000, /* nop */
+ 0x03200008, /* jr t9 */
+ 0x00000000 /* nop */
+};
+
+/* The format of subsequent PLT entries. */
+static const bfd_vma mips_vxworks_exec_plt_entry[] = {
+ 0x10000000, /* b .PLT_resolver */
+ 0x24180000, /* li t8, <pltindex> */
+ 0x3c190000, /* lui t9, %hi(<.got.plt slot>) */
+ 0x27390000, /* addiu t9, t9, %lo(<.got.plt slot>) */
+ 0x8f390000, /* lw t9, 0(t9) */
+ 0x00000000, /* nop */
+ 0x03200008, /* jr t9 */
+ 0x00000000 /* nop */
+};
+
+/* The format of the first PLT entry in a VxWorks shared object. */
+static const bfd_vma mips_vxworks_shared_plt0_entry[] = {
+ 0x8f990008, /* lw t9, 8(gp) */
+ 0x00000000, /* nop */
+ 0x03200008, /* jr t9 */
+ 0x00000000, /* nop */
+ 0x00000000, /* nop */
+ 0x00000000 /* nop */
+};
+
+/* The format of subsequent PLT entries. */
+static const bfd_vma mips_vxworks_shared_plt_entry[] = {
+ 0x10000000, /* b .PLT_resolver */
+ 0x24180000 /* li t8, <pltindex> */
+};
+
/* Look up an entry in a MIPS ELF linker hash table. */
#define mips_elf_link_hash_lookup(table, string, create, copy, follow) \
@@ -715,6 +827,8 @@ mips_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
ret->call_stub = NULL;
ret->call_fp_stub = NULL;
ret->forced_local = FALSE;
+ ret->is_branch_target = FALSE;
+ ret->is_relocation_target = FALSE;
ret->tls_type = GOT_NORMAL;
}
@@ -1896,14 +2010,19 @@ mips_elf_multi_got_entry_eq (const void *entry1, const void *entry2)
: e1->d.h == e2->d.h);
}
-/* Returns the dynamic relocation section for DYNOBJ. */
+/* Return the dynamic relocation section. If it doesn't exist, try to
+ create a new it if CREATE_P, otherwise return NULL. Also return NULL
+ if creation fails. */
static asection *
-mips_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p)
+mips_elf_rel_dyn_section (struct bfd_link_info *info, bfd_boolean create_p)
{
- static const char dname[] = ".rel.dyn";
+ const char *dname;
asection *sreloc;
+ bfd *dynobj;
+ dname = MIPS_ELF_REL_DYN_NAME (info);
+ dynobj = elf_hash_table (info)->dynobj;
sreloc = bfd_get_section_by_name (dynobj, dname);
if (sreloc == NULL && create_p)
{
@@ -2121,7 +2240,7 @@ mips_elf_initialize_tls_slots (bfd *abfd, bfd_vma got_offset,
|| h->root.root.type == bfd_link_hash_undefweak);
/* Emit necessary relocations. */
- sreloc = mips_elf_rel_dyn_section (dynobj, FALSE);
+ sreloc = mips_elf_rel_dyn_section (info, FALSE);
/* General Dynamic. */
if (*tls_type_p & GOT_TLS_GD)
@@ -2240,14 +2359,46 @@ mips_tls_got_index (bfd *abfd, bfd_vma got_index, unsigned char *tls_type,
return got_index;
}
-/* Returns the GOT offset at which the indicated address can be found.
- If there is not yet a GOT entry for this value, create one. If
- R_SYMNDX refers to a TLS symbol, create a TLS GOT entry instead.
- Returns -1 if no satisfactory GOT offset can be found. */
+/* Return the offset from _GLOBAL_OFFSET_TABLE_ of the .got.plt entry
+ for global symbol H. .got.plt comes before the GOT, so the offset
+ will be negative. */
+
+static bfd_vma
+mips_elf_gotplt_index (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
+{
+ bfd_vma plt_index, got_address, got_value;
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
+ BFD_ASSERT (h->plt.offset != (bfd_vma) -1);
+
+ /* Calculate the index of the symbol's PLT entry. */
+ plt_index = (h->plt.offset - htab->plt_header_size) / htab->plt_entry_size;
+
+ /* Calculate the address of the associated .got.plt entry. */
+ got_address = (htab->sgotplt->output_section->vma
+ + htab->sgotplt->output_offset
+ + plt_index * 4);
+
+ /* Calculate the value of _GLOBAL_OFFSET_TABLE_. */
+ got_value = (htab->root.hgot->root.u.def.section->output_section->vma
+ + htab->root.hgot->root.u.def.section->output_offset
+ + htab->root.hgot->root.u.def.value);
+
+ return got_address - got_value;
+}
+
+/* Return the GOT offset for address VALUE, which was derived from
+ a symbol belonging to INPUT_SECTION. If there is not yet a GOT
+ entry for this value, create one. If R_SYMNDX refers to a TLS symbol,
+ create a TLS GOT entry instead. Return -1 if no satisfactory GOT
+ offset can be found. */
static bfd_vma
mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
- bfd_vma value, unsigned long r_symndx,
+ asection *input_section, bfd_vma value,
+ unsigned long r_symndx,
struct mips_elf_link_hash_entry *h, int r_type)
{
asection *sgot;
@@ -2256,14 +2407,23 @@ mips_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
- entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot, value,
+ entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot,
+ input_section, value,
r_symndx, h, r_type);
if (!entry)
return MINUS_ONE;
if (TLS_RELOC_P (r_type))
- return mips_tls_got_index (abfd, entry->gotidx, &entry->tls_type, r_type,
- info, h, value);
+ {
+ if (entry->symndx == -1 && g->next == NULL)
+ /* A type (3) entry in the single-GOT case. We use the symbol's
+ hash table entry to track the index. */
+ return mips_tls_got_index (abfd, h->tls_got_offset, &h->tls_type,
+ r_type, info, h, value);
+ else
+ return mips_tls_got_index (abfd, entry->gotidx, &entry->tls_type,
+ r_type, info, h, value);
+ }
else
return entry->gotidx;
}
@@ -2350,26 +2510,27 @@ mips_elf_global_got_index (bfd *abfd, bfd *ibfd, struct elf_link_hash_entry *h,
return index;
}
-/* Find a GOT entry that is within 32KB of the VALUE. These entries
- are supposed to be placed at small offsets in the GOT, i.e.,
- within 32KB of GP. Return the index into the GOT for this page,
- and store the offset from this entry to the desired address in
- OFFSETP, if it is non-NULL. */
+/* Find a GOT page entry that points to within 32KB of VALUE, which was
+ calculated from a symbol belonging to INPUT_SECTION. These entries
+ are supposed to be placed at small offsets in the GOT, i.e., within
+ 32KB of GP. Return the index of the GOT entry, or -1 if no entry
+ could be created. If OFFSETP is nonnull, use it to return the
+ offset of the GOT entry from VALUE. */
static bfd_vma
mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
- bfd_vma value, bfd_vma *offsetp)
+ asection *input_section, bfd_vma value, bfd_vma *offsetp)
{
asection *sgot;
struct mips_got_info *g;
- bfd_vma index;
+ bfd_vma page, index;
struct mips_got_entry *entry;
g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
- entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot,
- (value + 0x8000)
- & (~(bfd_vma)0xffff), 0,
+ page = (value + 0x8000) & ~(bfd_vma) 0xffff;
+ entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot,
+ input_section, page, 0,
NULL, R_MIPS_GOT_PAGE);
if (!entry)
@@ -2383,30 +2544,32 @@ mips_elf_got_page (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
return index;
}
-/* Find a GOT entry whose higher-order 16 bits are the same as those
- for value. Return the index into the GOT for this entry. */
+/* Find a local GOT entry for an R_MIPS_GOT16 relocation against VALUE,
+ which was calculated from a symbol belonging to INPUT_SECTION.
+ EXTERNAL is true if the relocation was against a global symbol
+ that has been forced local. */
static bfd_vma
mips_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
- bfd_vma value, bfd_boolean external)
+ asection *input_section, bfd_vma value,
+ bfd_boolean external)
{
asection *sgot;
struct mips_got_info *g;
struct mips_got_entry *entry;
+ /* GOT16 relocations against local symbols are followed by a LO16
+ relocation; those against global symbols are not. Thus if the
+ symbol was originally local, the GOT16 relocation should load the
+ equivalent of %hi(VALUE), otherwise it should load VALUE itself. */
if (! external)
- {
- /* Although the ABI says that it is "the high-order 16 bits" that we
- want, it is really the %high value. The complete value is
- calculated with a `addiu' of a LO16 relocation, just as with a
- HI16/LO16 pair. */
- value = mips_elf_high (value) << 16;
- }
+ value = mips_elf_high (value) << 16;
g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
- entry = mips_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, 0, NULL,
- R_MIPS_GOT16);
+ entry = mips_elf_create_local_got_entry (abfd, info, ibfd, g, sgot,
+ input_section, value, 0,
+ NULL, R_MIPS_GOT16);
if (entry)
return entry->gotidx;
else
@@ -2431,20 +2594,24 @@ mips_elf_got_offset_from_index (bfd *dynobj, bfd *output_bfd,
return sgot->output_section->vma + sgot->output_offset + index - gp;
}
-/* Create a local GOT entry for VALUE. Return the index of the entry,
- or -1 if it could not be created. If R_SYMNDX refers to a TLS symbol,
- create a TLS entry instead. */
+/* Create and return a local GOT entry for VALUE, which was calculated
+ from a symbol belonging to INPUT_SECTON. Return NULL if it could not
+ be created. If R_SYMNDX refers to a TLS symbol, create a TLS entry
+ instead. */
static struct mips_got_entry *
-mips_elf_create_local_got_entry (bfd *abfd, bfd *ibfd,
- struct mips_got_info *gg,
- asection *sgot, bfd_vma value,
- unsigned long r_symndx,
+mips_elf_create_local_got_entry (bfd *abfd, struct bfd_link_info *info,
+ bfd *ibfd, struct mips_got_info *gg,
+ asection *sgot, asection *input_section,
+ bfd_vma value, unsigned long r_symndx,
struct mips_elf_link_hash_entry *h,
int r_type)
{
struct mips_got_entry entry, **loc;
struct mips_got_info *g;
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
entry.abfd = NULL;
entry.symndx = -1;
@@ -2517,6 +2684,33 @@ mips_elf_create_local_got_entry (bfd *abfd, bfd *ibfd,
MIPS_ELF_PUT_WORD (abfd, value,
(sgot->contents + entry.gotidx));
+ /* These GOT entries need a dynamic relocation on VxWorks. Because
+ the offset between segments is not fixed, the relocation must be
+ against a symbol in the same segment as the original symbol.
+ The easiest way to do this is to take INPUT_SECTION's output
+ section and emit a relocation against its section symbol. */
+ if (htab->is_vxworks)
+ {
+ Elf_Internal_Rela outrel;
+ asection *s, *output_section;
+ bfd_byte *loc;
+ bfd_vma got_address;
+ int dynindx;
+
+ s = mips_elf_rel_dyn_section (info, FALSE);
+ output_section = input_section->output_section;
+ dynindx = elf_section_data (output_section)->dynindx;
+ got_address = (sgot->output_section->vma
+ + sgot->output_offset
+ + entry.gotidx);
+
+ loc = s->contents + (s->reloc_count++ * sizeof (Elf32_External_Rela));
+ outrel.r_offset = got_address;
+ outrel.r_info = ELF32_R_INFO (dynindx, R_MIPS_32);
+ outrel.r_addend = value - output_section->vma;
+ bfd_elf32_swap_reloca_out (abfd, &outrel, loc);
+ }
+
return *loc;
}
@@ -2892,7 +3086,7 @@ mips_elf_merge_gots (void **bfd2got_, void *p)
{
unsigned int primary_total = lcount + tcount + arg->global_count;
if (primary_total * MIPS_ELF_GOT_SIZE (bfd2got->bfd)
- >= MIPS_ELF_GOT_MAX_SIZE (bfd2got->bfd))
+ >= MIPS_ELF_GOT_MAX_SIZE (arg->info))
too_many_for_tls = TRUE;
}
@@ -2975,55 +3169,54 @@ mips_elf_merge_gots (void **bfd2got_, void *p)
return 1;
}
-/* Set the TLS GOT index for the GOT entry in ENTRYP. */
+/* Set the TLS GOT index for the GOT entry in ENTRYP. ENTRYP's NEXT field
+ is null iff there is just a single GOT. */
static int
mips_elf_initialize_tls_index (void **entryp, void *p)
{
struct mips_got_entry *entry = (struct mips_got_entry *)*entryp;
struct mips_got_info *g = p;
+ bfd_vma next_index;
/* We're only interested in TLS symbols. */
if (entry->tls_type == 0)
return 1;
- if (entry->symndx == -1)
+ next_index = MIPS_ELF_GOT_SIZE (entry->abfd) * (long) g->tls_assigned_gotno;
+
+ if (entry->symndx == -1 && g->next == NULL)
{
- /* There may be multiple mips_got_entry structs for a global variable
- if there is just one GOT. Just do this once. */
- if (g->next == NULL)
+ /* A type (3) got entry in the single-GOT case. We use the symbol's
+ hash table entry to track its index. */
+ if (entry->d.h->tls_type & GOT_TLS_OFFSET_DONE)
+ return 1;
+ entry->d.h->tls_type |= GOT_TLS_OFFSET_DONE;
+ entry->d.h->tls_got_offset = next_index;
+ }
+ else
+ {
+ if (entry->tls_type & GOT_TLS_LDM)
{
- if (entry->d.h->tls_type & GOT_TLS_OFFSET_DONE)
+ /* There are separate mips_got_entry objects for each input bfd
+ that requires an LDM entry. Make sure that all LDM entries in
+ a GOT resolve to the same index. */
+ if (g->tls_ldm_offset != MINUS_TWO && g->tls_ldm_offset != MINUS_ONE)
{
- entry->gotidx = entry->d.h->tls_got_offset;
+ entry->gotidx = g->tls_ldm_offset;
return 1;
}
- entry->d.h->tls_type |= GOT_TLS_OFFSET_DONE;
+ g->tls_ldm_offset = next_index;
}
+ entry->gotidx = next_index;
}
- else if (entry->tls_type & GOT_TLS_LDM)
- {
- /* Similarly, there may be multiple structs for the LDM entry. */
- if (g->tls_ldm_offset != MINUS_TWO && g->tls_ldm_offset != MINUS_ONE)
- {
- entry->gotidx = g->tls_ldm_offset;
- return 1;
- }
- }
-
- /* Initialize the GOT offset. */
- entry->gotidx = MIPS_ELF_GOT_SIZE (entry->abfd) * (long) g->tls_assigned_gotno;
- if (g->next == NULL && entry->symndx == -1)
- entry->d.h->tls_got_offset = entry->gotidx;
+ /* Account for the entries we've just allocated. */
if (entry->tls_type & (GOT_TLS_GD | GOT_TLS_LDM))
g->tls_assigned_gotno += 2;
if (entry->tls_type & GOT_TLS_IE)
g->tls_assigned_gotno += 1;
- if (entry->tls_type & GOT_TLS_LDM)
- g->tls_ldm_offset = entry->gotidx;
-
return 1;
}
@@ -3207,9 +3400,9 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
/* Taking out PAGES entries is a worst-case estimate. We could
compute the maximum number of pages that each separate input bfd
uses, but it's probably not worth it. */
- got_per_bfd_arg.max_count = ((MIPS_ELF_GOT_MAX_SIZE (abfd)
+ got_per_bfd_arg.max_count = ((MIPS_ELF_GOT_MAX_SIZE (info)
/ MIPS_ELF_GOT_SIZE (abfd))
- - MIPS_RESERVED_GOTNO - pages);
+ - MIPS_RESERVED_GOTNO (info) - pages);
/* The number of globals that will be included in the primary GOT.
See the calls to mips_elf_set_global_got_offset below for more
information. */
@@ -3344,21 +3537,24 @@ mips_elf_multi_got (bfd *abfd, struct bfd_link_info *info,
{
struct mips_got_info *gn;
- assign += MIPS_RESERVED_GOTNO;
+ assign += MIPS_RESERVED_GOTNO (info);
g->assigned_gotno = assign;
g->local_gotno += assign + pages;
assign = g->local_gotno + g->global_gotno + g->tls_gotno;
+ /* Take g out of the direct list, and push it onto the reversed
+ list that gg points to. g->next is guaranteed to be nonnull after
+ this operation, as required by mips_elf_initialize_tls_index. */
+ gn = g->next;
+ g->next = gg->next;
+ gg->next = g;
+
/* Set up any TLS entries. We always place the TLS entries after
all non-TLS entries. */
g->tls_assigned_gotno = g->local_gotno + g->global_gotno;
htab_traverse (g->got_entries, mips_elf_initialize_tls_index, g);
- /* Take g out of the direct list, and push it onto the reversed
- list that gg points to. */
- gn = g->next;
- g->next = gg->next;
- gg->next = g;
+ /* Move onto the next GOT. It will be a secondary GOT if nonull. */
g = gn;
/* Mark global symbols in every non-primary GOT as ineligible for
@@ -3540,6 +3736,9 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
struct bfd_link_hash_entry *bh;
struct mips_got_info *g;
bfd_size_type amt;
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
/* This function may be called more than once. */
s = mips_elf_got_section (abfd, TRUE);
@@ -3589,8 +3788,8 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
g->global_gotsym = NULL;
g->global_gotno = 0;
g->tls_gotno = 0;
- g->local_gotno = MIPS_RESERVED_GOTNO;
- g->assigned_gotno = MIPS_RESERVED_GOTNO;
+ g->local_gotno = MIPS_RESERVED_GOTNO (info);
+ g->assigned_gotno = MIPS_RESERVED_GOTNO (info);
g->bfd2got = NULL;
g->next = NULL;
g->tls_ldm_offset = MINUS_ONE;
@@ -3602,9 +3801,33 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
mips_elf_section_data (s)->elf.this_hdr.sh_flags
|= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
+ /* VxWorks also needs a .got.plt section. */
+ if (htab->is_vxworks)
+ {
+ s = bfd_make_section_with_flags (abfd, ".got.plt",
+ SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+ if (s == NULL || !bfd_set_section_alignment (abfd, s, 4))
+ return FALSE;
+
+ htab->sgotplt = s;
+ }
return TRUE;
}
+/* Return true if H refers to the special VxWorks __GOTT_BASE__ or
+ __GOTT_INDEX__ symbols. These symbols are only special for
+ shared objects; they are not used in executables. */
+
+static bfd_boolean
+is_gott_symbol (struct bfd_link_info *info, struct elf_link_hash_entry *h)
+{
+ return (mips_elf_hash_table (info)->is_vxworks
+ && info->shared
+ && (strcmp (h->root.root.string, "__GOTT_BASE__") == 0
+ || strcmp (h->root.root.string, "__GOTT_INDEX__") == 0));
+}
+
/* Calculate the value produced by the RELOCATION (which comes from
the INPUT_BFD). The ADDEND is the addend to use for this
RELOCATION; RELOCATION->R_ADDEND is ignored.
@@ -3667,6 +3890,11 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
bfd_boolean overflowed_p;
/* TRUE if this relocation refers to a MIPS16 function. */
bfd_boolean target_is_16_bit_code_p = FALSE;
+ struct mips_elf_link_hash_table *htab;
+ bfd *dynobj;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ htab = mips_elf_hash_table (info);
/* Parse the relocation. */
r_symndx = ELF_R_SYM (input_bfd, relocation->r_info);
@@ -3916,52 +4144,61 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
/* Find the index into the GOT where this value is located. */
if (r_type == R_MIPS_TLS_LDM)
{
- g = mips_elf_local_got_index (abfd, input_bfd, info, 0, 0, NULL,
- r_type);
+ g = mips_elf_local_got_index (abfd, input_bfd, info,
+ sec, 0, 0, NULL, r_type);
if (g == MINUS_ONE)
return bfd_reloc_outofrange;
}
else if (!local_p)
{
- /* GOT_PAGE may take a non-zero addend, that is ignored in a
- GOT_PAGE relocation that decays to GOT_DISP because the
- symbol turns out to be global. The addend is then added
- as GOT_OFST. */
- BFD_ASSERT (addend == 0 || r_type == R_MIPS_GOT_PAGE);
- g = mips_elf_global_got_index (elf_hash_table (info)->dynobj,
- input_bfd,
- (struct elf_link_hash_entry *) h,
- r_type, info);
- if (h->tls_type == GOT_NORMAL
- && (! elf_hash_table(info)->dynamic_sections_created
- || (info->shared
- && (info->symbolic || h->root.forced_local)
- && h->root.def_regular)))
+ /* On VxWorks, CALL relocations should refer to the .got.plt
+ entry, which is initialized to point at the PLT stub. */
+ if (htab->is_vxworks
+ && (r_type == R_MIPS_CALL_HI16
+ || r_type == R_MIPS_CALL_LO16
+ || r_type == R_MIPS_CALL16))
{
- /* This is a static link or a -Bsymbolic link. The
- symbol is defined locally, or was forced to be local.
- We must initialize this entry in the GOT. */
- bfd *tmpbfd = elf_hash_table (info)->dynobj;
- asection *sgot = mips_elf_got_section (tmpbfd, FALSE);
- MIPS_ELF_PUT_WORD (tmpbfd, symbol, sgot->contents + g);
+ BFD_ASSERT (addend == 0);
+ BFD_ASSERT (h->root.needs_plt);
+ g = mips_elf_gotplt_index (info, &h->root);
+ }
+ else
+ {
+ /* GOT_PAGE may take a non-zero addend, that is ignored in a
+ GOT_PAGE relocation that decays to GOT_DISP because the
+ symbol turns out to be global. The addend is then added
+ as GOT_OFST. */
+ BFD_ASSERT (addend == 0 || r_type == R_MIPS_GOT_PAGE);
+ g = mips_elf_global_got_index (dynobj, input_bfd,
+ &h->root, r_type, info);
+ if (h->tls_type == GOT_NORMAL
+ && (! elf_hash_table(info)->dynamic_sections_created
+ || (info->shared
+ && (info->symbolic || h->root.forced_local)
+ && h->root.def_regular)))
+ {
+ /* This is a static link or a -Bsymbolic link. The
+ symbol is defined locally, or was forced to be local.
+ We must initialize this entry in the GOT. */
+ asection *sgot = mips_elf_got_section (dynobj, FALSE);
+ MIPS_ELF_PUT_WORD (dynobj, symbol, sgot->contents + g);
+ }
}
}
- else if (r_type == R_MIPS_GOT16 || r_type == R_MIPS_CALL16)
- /* There's no need to create a local GOT entry here; the
- calculation for a local GOT16 entry does not involve G. */
+ else if (!htab->is_vxworks
+ && (r_type == R_MIPS_CALL16 || (r_type == R_MIPS_GOT16)))
+ /* The calculation below does not involve "g". */
break;
else
{
- g = mips_elf_local_got_index (abfd, input_bfd,
- info, symbol + addend, r_symndx, h,
- r_type);
+ g = mips_elf_local_got_index (abfd, input_bfd, info, sec,
+ symbol + addend, r_symndx, h, r_type);
if (g == MINUS_ONE)
return bfd_reloc_outofrange;
}
/* Convert GOT indices to actual offsets. */
- g = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
- abfd, input_bfd, g);
+ g = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, g);
break;
case R_MIPS_HI16:
@@ -3974,10 +4211,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
case R_MIPS16_GPREL:
gp0 = _bfd_get_gp_value (input_bfd);
gp = _bfd_get_gp_value (abfd);
- if (elf_hash_table (info)->dynobj)
- gp += mips_elf_adjust_gp (abfd,
- mips_elf_got_info
- (elf_hash_table (info)->dynobj, NULL),
+ if (dynobj)
+ gp += mips_elf_adjust_gp (abfd, mips_elf_got_info (dynobj, NULL),
input_bfd);
break;
@@ -3988,6 +4223,27 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
if (gnu_local_gp_p)
symbol = gp;
+ /* Relocations against the VxWorks __GOTT_BASE__ and __GOTT_INDEX__
+ symbols are resolved by the loader. Add them to .rela.dyn. */
+ if (h != NULL && is_gott_symbol (info, &h->root))
+ {
+ Elf_Internal_Rela outrel;
+ bfd_byte *loc;
+ asection *s;
+
+ s = mips_elf_rel_dyn_section (info, FALSE);
+ loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
+
+ outrel.r_offset = (input_section->output_section->vma
+ + input_section->output_offset
+ + relocation->r_offset);
+ outrel.r_info = ELF32_R_INFO (h->root.dynindx, r_type);
+ outrel.r_addend = addend;
+ bfd_elf32_swap_reloca_out (abfd, &outrel, loc);
+ *valuep = 0;
+ return bfd_reloc_ok;
+ }
+
/* Figure out what kind of relocation is being performed. */
switch (r_type)
{
@@ -4003,7 +4259,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
case R_MIPS_REL32:
case R_MIPS_64:
if ((info->shared
- || (elf_hash_table (info)->dynamic_sections_created
+ || (!htab->is_vxworks
+ && htab->root.dynamic_sections_created
&& h != NULL
&& h->root.def_dynamic
&& !h->root.def_regular))
@@ -4014,7 +4271,11 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
against a symbol in a shared library, then we can't know
where the symbol will end up. So, we create a relocation
record in the output, and leave the job up to the dynamic
- linker. */
+ linker.
+
+ In VxWorks executables, references to external symbols
+ are handled using copy relocs or PLT stubs, so there's
+ no need to add a dynamic relocation here. */
value = addend;
if (!mips_elf_create_dynamic_relocation (abfd,
info,
@@ -4166,22 +4427,20 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
case R_MIPS_GOT16:
case R_MIPS_CALL16:
- if (local_p)
+ /* VxWorks does not have separate local and global semantics for
+ R_MIPS_GOT16; every relocation evaluates to "G". */
+ if (!htab->is_vxworks && local_p)
{
bfd_boolean forced;
- /* The special case is when the symbol is forced to be local. We
- need the full address in the GOT since no R_MIPS_LO16 relocation
- follows. */
forced = ! mips_elf_local_relocation_p (input_bfd, relocation,
local_sections, FALSE);
- value = mips_elf_got16_entry (abfd, input_bfd, info,
+ value = mips_elf_got16_entry (abfd, input_bfd, info, sec,
symbol + addend, forced);
if (value == MINUS_ONE)
return bfd_reloc_outofrange;
value
- = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
- abfd, input_bfd, value);
+ = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, value);
overflowed_p = mips_elf_overflow_p (value, 16);
break;
}
@@ -4231,17 +4490,18 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
0. */
if (! local_p)
goto got_disp;
- value = mips_elf_got_page (abfd, input_bfd, info, symbol + addend, NULL);
+ value = mips_elf_got_page (abfd, input_bfd, info, sec,
+ symbol + addend, NULL);
if (value == MINUS_ONE)
return bfd_reloc_outofrange;
- value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
- abfd, input_bfd, value);
+ value = mips_elf_got_offset_from_index (dynobj, abfd, input_bfd, value);
overflowed_p = mips_elf_overflow_p (value, 16);
break;
case R_MIPS_GOT_OFST:
if (local_p)
- mips_elf_got_page (abfd, input_bfd, info, symbol + addend, &value);
+ mips_elf_got_page (abfd, input_bfd, info, sec,
+ symbol + addend, &value);
else
value = addend;
overflowed_p = mips_elf_overflow_p (value, 16);
@@ -4426,23 +4686,31 @@ mips_elf_stub_section_p (bfd *abfd ATTRIBUTE_UNUSED, asection *section)
|| strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0);
}
-/* Add room for N relocations to the .rel.dyn section in ABFD. */
+/* Add room for N relocations to the .rel(a).dyn section in ABFD. */
static void
-mips_elf_allocate_dynamic_relocations (bfd *abfd, unsigned int n)
+mips_elf_allocate_dynamic_relocations (bfd *abfd, struct bfd_link_info *info,
+ unsigned int n)
{
asection *s;
+ struct mips_elf_link_hash_table *htab;
- s = mips_elf_rel_dyn_section (abfd, FALSE);
+ htab = mips_elf_hash_table (info);
+ s = mips_elf_rel_dyn_section (info, FALSE);
BFD_ASSERT (s != NULL);
- if (s->size == 0)
+ if (htab->is_vxworks)
+ s->size += n * MIPS_ELF_RELA_SIZE (abfd);
+ else
{
- /* Make room for a null element. */
- s->size += MIPS_ELF_REL_SIZE (abfd);
- ++s->reloc_count;
+ if (s->size == 0)
+ {
+ /* Make room for a null element. */
+ s->size += MIPS_ELF_REL_SIZE (abfd);
+ ++s->reloc_count;
+ }
+ s->size += n * MIPS_ELF_REL_SIZE (abfd);
}
- s->size += n * MIPS_ELF_REL_SIZE (abfd);
}
/* Create a rel.dyn relocation for the dynamic linker to resolve. REL
@@ -4464,10 +4732,12 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
int r_type;
long indx;
bfd_boolean defined_p;
+ struct mips_elf_link_hash_table *htab;
+ htab = mips_elf_hash_table (info);
r_type = ELF_R_TYPE (output_bfd, rel->r_info);
dynobj = elf_hash_table (info)->dynobj;
- sreloc = mips_elf_rel_dyn_section (dynobj, FALSE);
+ sreloc = mips_elf_rel_dyn_section (info, FALSE);
BFD_ASSERT (sreloc != NULL);
BFD_ASSERT (sreloc->contents != NULL);
BFD_ASSERT (sreloc->reloc_count * MIPS_ELF_REL_SIZE (output_bfd)
@@ -4552,10 +4822,15 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
if (defined_p && r_type != R_MIPS_REL32)
*addendp += symbol;
- /* 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, (unsigned long) indx,
- R_MIPS_REL32);
+ if (htab->is_vxworks)
+ /* VxWorks uses non-relative relocations for this. */
+ outrel[0].r_info = ELF32_R_INFO (indx, R_MIPS_32);
+ else
+ /* 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, (unsigned long) indx,
+ R_MIPS_REL32);
+
/* For strict adherence to the ABI specification, we should
generate a R_MIPS_64 relocation record by itself before the
_REL32/_64 record as well, such that the addend is read in as
@@ -4593,6 +4868,15 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
(sreloc->contents
+ sreloc->reloc_count * sizeof (Elf64_Mips_External_Rel)));
}
+ else if (htab->is_vxworks)
+ {
+ /* VxWorks uses RELA rather than REL dynamic relocations. */
+ outrel[0].r_addend = *addendp;
+ bfd_elf32_swap_reloca_out
+ (output_bfd, &outrel[0],
+ (sreloc->contents
+ + sreloc->reloc_count * sizeof (Elf32_External_Rela)));
+ }
else
bfd_elf32_swap_reloc_out
(output_bfd, &outrel[0],
@@ -4637,6 +4921,12 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
}
}
+ /* If we've written this relocation for a readonly section,
+ we need to set DF_TEXTREL again, so that we do not delete the
+ DT_TEXTREL tag. */
+ if (MIPS_ELF_READONLY_SECTION (input_section))
+ info->flags |= DF_TEXTREL;
+
return TRUE;
}
@@ -5609,23 +5899,29 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flagword flags;
register asection *s;
const char * const *namep;
+ struct mips_elf_link_hash_table *htab;
+ htab = mips_elf_hash_table (info);
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED | SEC_READONLY);
- /* Mips ABI requests the .dynamic section to be read only. */
- s = bfd_get_section_by_name (abfd, ".dynamic");
- if (s != NULL)
+ /* The psABI requires a read-only .dynamic section, but the VxWorks
+ EABI doesn't. */
+ if (!htab->is_vxworks)
{
- if (! bfd_set_section_flags (abfd, s, flags))
- return FALSE;
+ s = bfd_get_section_by_name (abfd, ".dynamic");
+ if (s != NULL)
+ {
+ if (! bfd_set_section_flags (abfd, s, flags))
+ return FALSE;
+ }
}
/* We need to create .got section. */
if (! mips_elf_create_got_section (abfd, info, FALSE))
return FALSE;
- if (! mips_elf_rel_dyn_section (elf_hash_table (info)->dynobj, TRUE))
+ if (! mips_elf_rel_dyn_section (info, TRUE))
return FALSE;
/* Create .stub section. */
@@ -5746,6 +6042,45 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
}
}
+ if (htab->is_vxworks)
+ {
+ /* Create the .plt, .rela.plt, .dynbss and .rela.bss sections.
+ Also create the _PROCEDURE_LINKAGE_TABLE symbol. */
+ if (!_bfd_elf_create_dynamic_sections (abfd, info))
+ return FALSE;
+
+ /* Cache the sections created above. */
+ htab->sdynbss = bfd_get_section_by_name (abfd, ".dynbss");
+ htab->srelbss = bfd_get_section_by_name (abfd, ".rela.bss");
+ htab->srelplt = bfd_get_section_by_name (abfd, ".rela.plt");
+ htab->splt = bfd_get_section_by_name (abfd, ".plt");
+ if (!htab->sdynbss
+ || (!htab->srelbss && !info->shared)
+ || !htab->srelplt
+ || !htab->splt)
+ abort ();
+
+ /* Do the usual VxWorks handling. */
+ if (!elf_vxworks_create_dynamic_sections (abfd, info, &htab->srelplt2))
+ return FALSE;
+
+ /* Work out the PLT sizes. */
+ if (info->shared)
+ {
+ htab->plt_header_size
+ = 4 * ARRAY_SIZE (mips_vxworks_shared_plt0_entry);
+ htab->plt_entry_size
+ = 4 * ARRAY_SIZE (mips_vxworks_shared_plt_entry);
+ }
+ else
+ {
+ htab->plt_header_size
+ = 4 * ARRAY_SIZE (mips_vxworks_exec_plt0_entry);
+ htab->plt_entry_size
+ = 4 * ARRAY_SIZE (mips_vxworks_exec_plt_entry);
+ }
+ }
+
return TRUE;
}
@@ -5767,10 +6102,12 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
asection *sgot;
asection *sreloc;
const struct elf_backend_data *bed;
+ struct mips_elf_link_hash_table *htab;
if (info->relocatable)
return TRUE;
+ htab = mips_elf_hash_table (info);
dynobj = elf_hash_table (info)->dynobj;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
@@ -6012,13 +6349,24 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (! mips_elf_create_got_section (dynobj, info, FALSE))
return FALSE;
g = mips_elf_got_info (dynobj, &sgot);
+ if (htab->is_vxworks && !info->shared)
+ {
+ (*_bfd_error_handler)
+ (_("%B: GOT reloc at 0x%lx not expected in executables"),
+ abfd, (unsigned long) rel->r_offset);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
break;
case R_MIPS_32:
case R_MIPS_REL32:
case R_MIPS_64:
+ /* In VxWorks executables, references to external symbols
+ are handled using copy relocs or PLT stubs, so there's
+ no need to add a dynamic relocation here. */
if (dynobj == NULL
- && (info->shared || h != NULL)
+ && (info->shared || (h != NULL && !htab->is_vxworks))
&& (sec->flags & SEC_ALLOC) != 0)
elf_hash_table (info)->dynobj = dynobj = abfd;
break;
@@ -6028,15 +6376,35 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
}
}
- if (!h && (r_type == R_MIPS_CALL_LO16
- || r_type == R_MIPS_GOT_LO16
- || r_type == R_MIPS_GOT_DISP))
+ if (h)
+ {
+ ((struct mips_elf_link_hash_entry *) h)->is_relocation_target = TRUE;
+
+ /* Relocations against the special VxWorks __GOTT_BASE__ and
+ __GOTT_INDEX__ symbols must be left to the loader. Allocate
+ room for them in .rela.dyn. */
+ if (is_gott_symbol (info, h))
+ {
+ if (sreloc == NULL)
+ {
+ sreloc = mips_elf_rel_dyn_section (info, TRUE);
+ if (sreloc == NULL)
+ return FALSE;
+ }
+ mips_elf_allocate_dynamic_relocations (dynobj, info, 1);
+ }
+ }
+ else if (r_type == R_MIPS_CALL_LO16
+ || r_type == R_MIPS_GOT_LO16
+ || r_type == R_MIPS_GOT_DISP
+ || (r_type == R_MIPS_GOT16 && htab->is_vxworks))
{
/* We may need a local GOT entry for this relocation. We
don't count R_MIPS_GOT_PAGE because we can estimate the
maximum number of pages needed by looking at the size of
the segment. Similar comments apply to R_MIPS_GOT16 and
- R_MIPS_CALL16. We don't count R_MIPS_GOT_HI16, or
+ R_MIPS_CALL16, except on VxWorks, where GOT relocations
+ always evaluate to "G". We don't count R_MIPS_GOT_HI16, or
R_MIPS_CALL_HI16 because these are always followed by an
R_MIPS_GOT_LO16 or R_MIPS_CALL_LO16. */
if (! mips_elf_record_local_got_symbol (abfd, r_symndx,
@@ -6061,8 +6429,11 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_MIPS_CALL_LO16:
if (h != NULL)
{
- /* This symbol requires a global offset table entry. */
- if (! mips_elf_record_global_got_symbol (h, abfd, info, g, 0))
+ /* VxWorks call relocations point the function's .got.plt
+ entry, which will be allocated by adjust_dynamic_symbol.
+ Otherwise, this symbol requires a global GOT entry. */
+ if (!htab->is_vxworks
+ && !mips_elf_record_global_got_symbol (h, abfd, info, g, 0))
return FALSE;
/* We need a stub, not a plt entry for the undefined
@@ -6148,25 +6519,25 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_MIPS_32:
case R_MIPS_REL32:
case R_MIPS_64:
- if ((info->shared || h != NULL)
+ /* In VxWorks executables, references to external symbols
+ are handled using copy relocs or PLT stubs, so there's
+ no need to add a .rela.dyn entry for this relocation. */
+ if ((info->shared || (h != NULL && !htab->is_vxworks))
&& (sec->flags & SEC_ALLOC) != 0)
{
if (sreloc == NULL)
{
- sreloc = mips_elf_rel_dyn_section (dynobj, TRUE);
+ sreloc = mips_elf_rel_dyn_section (info, TRUE);
if (sreloc == NULL)
return FALSE;
}
-#define MIPS_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
if (info->shared)
{
/* When creating a shared object, we must copy these
reloc types into the output file as R_MIPS_REL32
- relocs. We make room for this reloc in the
- .rel.dyn reloc section. */
- mips_elf_allocate_dynamic_relocations (dynobj, 1);
- if ((sec->flags & MIPS_READONLY_SECTION)
- == MIPS_READONLY_SECTION)
+ relocs. Make room for this reloc in .rel(a).dyn. */
+ mips_elf_allocate_dynamic_relocations (dynobj, info, 1);
+ if (MIPS_ELF_READONLY_SECTION (sec))
/* We tell the dynamic linker that there are
relocations against the text segment. */
info->flags |= DF_TEXTREL;
@@ -6179,8 +6550,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
defined in a dynamic object. */
hmips = (struct mips_elf_link_hash_entry *) h;
++hmips->possibly_dynamic_relocs;
- if ((sec->flags & MIPS_READONLY_SECTION)
- == MIPS_READONLY_SECTION)
+ if (MIPS_ELF_READONLY_SECTION (sec))
/* We need it to tell the dynamic linker if there
are relocations against the text segment. */
hmips->readonly_reloc = TRUE;
@@ -6189,8 +6559,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* Even though we don't directly need a GOT entry for
this symbol, a symbol must have a dynamic symbol
table index greater that DT_MIPS_GOTSYM if there are
- dynamic relocations against it. */
- if (h != NULL)
+ dynamic relocations against it. This does not apply
+ to VxWorks, which does not have the usual coupling
+ between global GOT entries and .dynsym entries. */
+ if (h != NULL && !htab->is_vxworks)
{
if (dynobj == NULL)
elf_hash_table (info)->dynobj = dynobj = abfd;
@@ -6207,7 +6579,16 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
sizeof (Elf32_External_crinfo);
break;
+ case R_MIPS_PC16:
+ if (h)
+ ((struct mips_elf_link_hash_entry *) h)->is_branch_target = TRUE;
+ break;
+
case R_MIPS_26:
+ if (h)
+ ((struct mips_elf_link_hash_entry *) h)->is_branch_target = TRUE;
+ /* Fall through. */
+
case R_MIPS_GPREL16:
case R_MIPS_LITERAL:
case R_MIPS_GPREL32:
@@ -6235,24 +6616,21 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
}
/* We must not create a stub for a symbol that has relocations
- related to taking the function's address. */
- switch (r_type)
- {
- default:
- if (h != NULL)
- {
- struct mips_elf_link_hash_entry *mh;
-
- mh = (struct mips_elf_link_hash_entry *) h;
- mh->no_fn_stub = TRUE;
- }
- break;
- case R_MIPS_CALL16:
- case R_MIPS_CALL_HI16:
- case R_MIPS_CALL_LO16:
- case R_MIPS_JALR:
- break;
- }
+ related to taking the function's address. This doesn't apply to
+ VxWorks, where CALL relocs refer to a .got.plt entry instead of
+ a normal .got entry. */
+ if (!htab->is_vxworks && h != NULL)
+ switch (r_type)
+ {
+ default:
+ ((struct mips_elf_link_hash_entry *) h)->no_fn_stub = TRUE;
+ break;
+ case R_MIPS_CALL16:
+ case R_MIPS_CALL_HI16:
+ case R_MIPS_CALL_LO16:
+ case R_MIPS_JALR:
+ break;
+ }
/* If this reloc is not a 16 bit call, and it has a global
symbol, then we will need the fn_stub if there is one.
@@ -6459,7 +6837,9 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
bfd *dynobj;
struct mips_elf_link_hash_entry *hmips;
asection *s;
+ struct mips_elf_link_hash_table *htab;
+ htab = mips_elf_hash_table (info);
dynobj = elf_hash_table (info)->dynobj;
/* Make sure we know what is going on here. */
@@ -6479,8 +6859,8 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
&& (h->root.type == bfd_link_hash_defweak
|| !h->def_regular))
{
- mips_elf_allocate_dynamic_relocations (dynobj,
- hmips->possibly_dynamic_relocs);
+ mips_elf_allocate_dynamic_relocations
+ (dynobj, info, hmips->possibly_dynamic_relocs);
if (hmips->readonly_reloc)
/* We tell the dynamic linker that there are relocations
against the text segment. */
@@ -6512,7 +6892,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
h->plt.offset = s->size;
/* Make room for this stub code. */
- s->size += MIPS_FUNCTION_STUB_SIZE;
+ s->size += htab->function_stub_size;
/* The last half word of the stub will be filled with the index
of this symbol in .dynsym section. */
@@ -6545,7 +6925,187 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
return TRUE;
}
+
+/* Likewise, for VxWorks. */
+
+bfd_boolean
+_bfd_mips_vxworks_adjust_dynamic_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
+{
+ bfd *dynobj;
+ struct mips_elf_link_hash_entry *hmips;
+ struct mips_elf_link_hash_table *htab;
+ unsigned int power_of_two;
+
+ htab = mips_elf_hash_table (info);
+ dynobj = elf_hash_table (info)->dynobj;
+ hmips = (struct mips_elf_link_hash_entry *) h;
+
+ /* Make sure we know what is going on here. */
+ BFD_ASSERT (dynobj != NULL
+ && (h->needs_plt
+ || h->needs_copy
+ || h->u.weakdef != NULL
+ || (h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)));
+
+ /* If the symbol is defined by a dynamic object, we need a PLT stub if
+ either (a) we want to branch to the symbol or (b) we're linking an
+ executable that needs a canonical function address. In the latter
+ case, the canonical address will be the address of the executable's
+ load stub. */
+ if ((hmips->is_branch_target
+ || (!info->shared
+ && h->type == STT_FUNC
+ && hmips->is_relocation_target))
+ && h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular
+ && !h->forced_local)
+ h->needs_plt = 1;
+
+ /* Locally-binding symbols do not need a PLT stub; we can refer to
+ the functions directly. */
+ else if (h->needs_plt
+ && (SYMBOL_CALLS_LOCAL (info, h)
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)))
+ {
+ h->needs_plt = 0;
+ return TRUE;
+ }
+
+ if (h->needs_plt)
+ {
+ /* If this is the first symbol to need a PLT entry, allocate room
+ for the header, and for the header's .rela.plt.unloaded entries. */
+ if (htab->splt->size == 0)
+ {
+ htab->splt->size += htab->plt_header_size;
+ if (!info->shared)
+ htab->srelplt2->size += 2 * sizeof (Elf32_External_Rela);
+ }
+
+ /* Assign the next .plt entry to this symbol. */
+ h->plt.offset = htab->splt->size;
+ htab->splt->size += htab->plt_entry_size;
+
+ /* If the output file has no definition of the symbol, set the
+ symbol's value to the address of the stub. For executables,
+ point at the PLT load stub rather than the lazy resolution stub;
+ this stub will become the canonical function address. */
+ if (!h->def_regular)
+ {
+ h->root.u.def.section = htab->splt;
+ h->root.u.def.value = h->plt.offset;
+ if (!info->shared)
+ h->root.u.def.value += 8;
+ }
+
+ /* Make room for the .got.plt entry and the R_JUMP_SLOT relocation. */
+ htab->sgotplt->size += 4;
+ htab->srelplt->size += sizeof (Elf32_External_Rela);
+
+ /* Make room for the .rela.plt.unloaded relocations. */
+ if (!info->shared)
+ htab->srelplt2->size += 3 * sizeof (Elf32_External_Rela);
+
+ return TRUE;
+ }
+
+ /* If a function symbol is defined by a dynamic object, and we do not
+ need a PLT stub for it, the symbol's value should be zero. */
+ if (h->type == STT_FUNC
+ && h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)
+ {
+ h->root.u.def.value = 0;
+ return TRUE;
+ }
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->u.weakdef != NULL)
+ {
+ BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
+ || h->u.weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->u.weakdef->root.u.def.section;
+ h->root.u.def.value = h->u.weakdef->root.u.def.value;
+ return TRUE;
+ }
+
+ /* This is a reference to a symbol defined by a dynamic object which
+ is not a function. */
+ if (info->shared)
+ return TRUE;
+
+ /* We must allocate the symbol in our .dynbss section, which will
+ become part of the .bss section of the executable. There will be
+ an entry for this symbol in the .dynsym section. The dynamic
+ object will contain position independent code, so all references
+ from the dynamic object to this symbol will go through the global
+ offset table. The dynamic linker will use the .dynsym entry to
+ determine the address it must put in the global offset table, so
+ both the dynamic object and the regular object will refer to the
+ same memory location for the variable. */
+
+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+ {
+ htab->srelbss->size += sizeof (Elf32_External_Rela);
+ h->needs_copy = 1;
+ }
+
+ /* We need to figure out the alignment required for this symbol. */
+ power_of_two = bfd_log2 (h->size);
+ if (power_of_two > 4)
+ power_of_two = 4;
+
+ /* Apply the required alignment. */
+ htab->sdynbss->size = BFD_ALIGN (htab->sdynbss->size,
+ (bfd_size_type) 1 << power_of_two);
+ if (power_of_two > bfd_get_section_alignment (dynobj, htab->sdynbss)
+ && !bfd_set_section_alignment (dynobj, htab->sdynbss, power_of_two))
+ return FALSE;
+
+ /* Define the symbol as being at this point in the section. */
+ h->root.u.def.section = htab->sdynbss;
+ h->root.u.def.value = htab->sdynbss->size;
+
+ /* Increment the section size to make room for the symbol. */
+ htab->sdynbss->size += h->size;
+
+ return TRUE;
+}
+/* Return the number of dynamic section symbols required by OUTPUT_BFD.
+ The number might be exact or a worst-case estimate, depending on how
+ much information is available to elf_backend_omit_section_dynsym at
+ the current linking stage. */
+
+static bfd_size_type
+count_section_dynsyms (bfd *output_bfd, struct bfd_link_info *info)
+{
+ bfd_size_type count;
+
+ count = 0;
+ if (info->shared)
+ {
+ asection *p;
+ const struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (output_bfd);
+ for (p = output_bfd->sections; p ; p = p->next)
+ if ((p->flags & SEC_EXCLUDE) == 0
+ && (p->flags & SEC_ALLOC) != 0
+ && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p))
+ ++count;
+ }
+ return count;
+}
+
/* This function is called after all the input files have been read,
and the input sections have been assigned to output sections. We
check for any mips16 stub sections that we can discard. */
@@ -6562,8 +7122,12 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
int i;
bfd_size_type loadable_size = 0;
bfd_size_type local_gotno;
+ bfd_size_type dynsymcount;
bfd *sub;
struct mips_elf_count_tls_arg count_tls_arg;
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
/* The .reginfo section has a fixed size. */
ri = bfd_get_section_by_name (output_bfd, ".reginfo");
@@ -6617,14 +7181,32 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
relocations, then GLOBAL_GOTSYM will be NULL. */
i = 0;
+ /* Get a worst-case estimate of the number of dynamic symbols needed.
+ At this point, dynsymcount does not account for section symbols
+ and count_section_dynsyms may overestimate the number that will
+ be needed. */
+ dynsymcount = (elf_hash_table (info)->dynsymcount
+ + count_section_dynsyms (output_bfd, info));
+
+ /* Determine the size of one stub entry. */
+ htab->function_stub_size = (dynsymcount > 0x10000
+ ? MIPS_FUNCTION_STUB_BIG_SIZE
+ : MIPS_FUNCTION_STUB_NORMAL_SIZE);
+
/* In the worst case, we'll get one stub per dynamic symbol, plus
one to account for the dummy entry at the end required by IRIX
rld. */
- loadable_size += MIPS_FUNCTION_STUB_SIZE * (i + 1);
+ loadable_size += htab->function_stub_size * (i + 1);
- /* Assume there are two loadable segments consisting of
- contiguous sections. Is 5 enough? */
- local_gotno = (loadable_size >> 16) + 5;
+ if (htab->is_vxworks)
+ /* There's no need to allocate page entries for VxWorks; R_MIPS_GOT16
+ relocations against local symbols evaluate to "G", and the EABI does
+ not include R_MIPS_GOT_PAGE. */
+ local_gotno = 0;
+ else
+ /* Assume there are two loadable segments consisting of contiguous
+ sections. Is 5 enough? */
+ local_gotno = (loadable_size >> 16) + 5;
g->local_gotno += local_gotno;
s->size += g->local_gotno * MIPS_ELF_GOT_SIZE (output_bfd);
@@ -6645,7 +7227,10 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd,
mips_elf_resolve_final_got_entries (g);
- if (s->size > MIPS_ELF_GOT_MAX_SIZE (output_bfd))
+ /* VxWorks does not support multiple GOTs. It initializes $gp to
+ __GOTT_BASE__[__GOTT_INDEX__], the value of which is set by the
+ dynamic loader. */
+ if (!htab->is_vxworks && s->size > MIPS_ELF_GOT_MAX_SIZE (info))
{
if (! mips_elf_multi_got (output_bfd, info, g, s, local_gotno))
return FALSE;
@@ -6667,9 +7252,11 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
struct bfd_link_info *info)
{
bfd *dynobj;
- asection *s;
+ asection *s, *sreldyn;
bfd_boolean reltext;
+ struct mips_elf_link_hash_table *htab;
+ htab = mips_elf_hash_table (info);
dynobj = elf_hash_table (info)->dynobj;
BFD_ASSERT (dynobj != NULL);
@@ -6691,6 +7278,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
determined the sizes of the various dynamic sections. Allocate
memory for them. */
reltext = FALSE;
+ sreldyn = NULL;
for (s = dynobj->sections; s != NULL; s = s->next)
{
const char *name;
@@ -6711,7 +7299,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
/* If this relocation section applies to a read only
section, then we probably need a DT_TEXTREL entry.
- If the relocation section is .rel.dyn, we always
+ If the relocation section is .rel(a).dyn, we always
assert a DT_TEXTREL entry rather than testing whether
there exists a relocation to a read only section or
not. */
@@ -6721,12 +7309,12 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
if ((target != NULL
&& (target->flags & SEC_READONLY) != 0
&& (target->flags & SEC_ALLOC) != 0)
- || strcmp (outname, ".rel.dyn") == 0)
+ || strcmp (outname, MIPS_ELF_REL_DYN_NAME (info)) == 0)
reltext = TRUE;
/* We use the reloc_count field as a counter if we need
to copy relocs into the output file. */
- if (strcmp (name, ".rel.dyn") != 0)
+ if (strcmp (name, MIPS_ELF_REL_DYN_NAME (info)) != 0)
s->reloc_count = 0;
/* If combreloc is enabled, elf_link_sort_relocs() will
@@ -6738,7 +7326,23 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
info->combreloc = 0;
}
}
- else if (strncmp (name, ".got", 4) == 0)
+ else if (htab->is_vxworks && strcmp (name, ".got") == 0)
+ {
+ /* Executables do not need a GOT. */
+ if (info->shared)
+ {
+ /* Allocate relocations for all but the reserved entries. */
+ struct mips_got_info *g;
+ unsigned int count;
+
+ g = mips_elf_got_info (dynobj, NULL);
+ count = (g->global_gotno
+ + g->local_gotno
+ - MIPS_RESERVED_GOTNO (info));
+ mips_elf_allocate_dynamic_relocations (dynobj, info, count);
+ }
+ }
+ else if (!htab->is_vxworks && strncmp (name, ".got", 4) == 0)
{
/* _bfd_mips_elf_always_size_sections() has already done
most of the work, but some symbols may have been mapped
@@ -6783,7 +7387,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
BFD_ASSERT (g->assigned_gotno == g->next->local_gotno
+ g->next->global_gotno
+ g->next->tls_gotno
- + MIPS_RESERVED_GOTNO);
+ + MIPS_RESERVED_GOTNO (info));
}
}
}
@@ -6803,26 +7407,29 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
}
if (needed_relocs)
- mips_elf_allocate_dynamic_relocations (dynobj, needed_relocs);
+ mips_elf_allocate_dynamic_relocations (dynobj, info,
+ needed_relocs);
}
else if (strcmp (name, MIPS_ELF_STUB_SECTION_NAME (output_bfd)) == 0)
{
/* IRIX rld assumes that the function stub isn't at the end
- of .text section. So put a dummy. XXX */
- s->size += MIPS_FUNCTION_STUB_SIZE;
+ of .text section. So put a dummy. XXX */
+ s->size += htab->function_stub_size;
}
else if (! info->shared
&& ! mips_elf_hash_table (info)->use_rld_obj_head
&& strncmp (name, ".rld_map", 8) == 0)
{
- /* We add a room for __rld_map. It will be filled in by the
+ /* We add a room for __rld_map. It will be filled in by the
rtld to contain a pointer to the _r_debug structure. */
s->size += 4;
}
else if (SGI_COMPAT (output_bfd)
&& strncmp (name, ".compact_rel", 12) == 0)
s->size += mips_elf_hash_table (info)->compact_rel_size;
- else if (strncmp (name, ".init", 5) != 0)
+ else if (strncmp (name, ".init", 5) != 0
+ && s != htab->sgotplt
+ && s != htab->splt)
{
/* It's not one of our sections, so don't allocate space. */
continue;
@@ -6837,6 +7444,14 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
if ((s->flags & SEC_HAS_CONTENTS) == 0)
continue;
+ /* Allocate memory for this section last, since we may increase its
+ size above. */
+ if (strcmp (name, MIPS_ELF_REL_DYN_NAME (info)) == 0)
+ {
+ sreldyn = s;
+ continue;
+ }
+
/* Allocate memory for the section contents. */
s->contents = bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
@@ -6846,6 +7461,17 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
}
}
+ /* Allocate memory for the .rel(a).dyn section. */
+ if (sreldyn != NULL)
+ {
+ sreldyn->contents = bfd_zalloc (dynobj, sreldyn->size);
+ if (sreldyn->contents == NULL)
+ {
+ bfd_set_error (bfd_error_no_memory);
+ return FALSE;
+ }
+ }
+
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
@@ -6875,60 +7501,96 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
}
}
- if (reltext && SGI_COMPAT (output_bfd))
+ if (reltext && (SGI_COMPAT (output_bfd) || htab->is_vxworks))
info->flags |= DF_TEXTREL;
if ((info->flags & DF_TEXTREL) != 0)
{
if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
return FALSE;
+
+ /* Clear the DF_TEXTREL flag. It will be set again if we
+ write out an actual text relocation; we may not, because
+ at this point we do not know whether e.g. any .eh_frame
+ absolute relocations have been converted to PC-relative. */
+ info->flags &= ~DF_TEXTREL;
}
if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0))
return FALSE;
- if (mips_elf_rel_dyn_section (dynobj, FALSE))
+ if (htab->is_vxworks)
{
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
- return FALSE;
+ /* VxWorks uses .rela.dyn instead of .rel.dyn. It does not
+ use any of the DT_MIPS_* tags. */
+ if (mips_elf_rel_dyn_section (info, FALSE))
+ {
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELA, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELASZ, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELAENT, 0))
+ return FALSE;
+ }
+ if (htab->splt->size > 0)
+ {
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTREL, 0))
+ return FALSE;
+
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_JMPREL, 0))
+ return FALSE;
+
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTRELSZ, 0))
+ return FALSE;
+ }
}
+ else
+ {
+ if (mips_elf_rel_dyn_section (info, FALSE))
+ {
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_VERSION, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_FLAGS, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
+ return FALSE;
+ }
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_BASE_ADDRESS, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_VERSION, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LOCAL_GOTNO, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_FLAGS, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_SYMTABNO, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_BASE_ADDRESS, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LOCAL_GOTNO, 0))
+ return FALSE;
- if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_SYMTABNO, 0))
+ return FALSE;
- if (IRIX_COMPAT (dynobj) == ict_irix5
- && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
+ return FALSE;
- if (IRIX_COMPAT (dynobj) == ict_irix6
- && (bfd_get_section_by_name
- (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj)))
- && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
- return FALSE;
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
+ return FALSE;
+
+ if (IRIX_COMPAT (dynobj) == ict_irix5
+ && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0))
+ return FALSE;
+
+ if (IRIX_COMPAT (dynobj) == ict_irix6
+ && (bfd_get_section_by_name
+ (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj)))
+ && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
+ return FALSE;
+ }
}
return TRUE;
@@ -7389,13 +8051,16 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
asection *sgot;
struct mips_got_info *g, *gg;
const char *name;
+ int idx;
+ struct mips_elf_link_hash_table *htab;
+ htab = mips_elf_hash_table (info);
dynobj = elf_hash_table (info)->dynobj;
if (h->plt.offset != MINUS_ONE)
{
asection *s;
- bfd_byte stub[MIPS_FUNCTION_STUB_SIZE];
+ bfd_byte stub[MIPS_FUNCTION_STUB_BIG_SIZE];
/* This symbol has a stub. Set it up. */
@@ -7405,18 +8070,42 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
MIPS_ELF_STUB_SECTION_NAME (dynobj));
BFD_ASSERT (s != NULL);
- /* FIXME: Can h->dynindx be more than 64K? */
- if (h->dynindx & 0xffff0000)
+ BFD_ASSERT ((htab->function_stub_size == MIPS_FUNCTION_STUB_BIG_SIZE)
+ || (h->dynindx <= 0xffff));
+
+ /* Values up to 2^31 - 1 are allowed. Larger values would cause
+ sign extension at runtime in the stub, resulting in a negative
+ index value. */
+ if (h->dynindx & ~0x7fffffff)
return FALSE;
/* Fill the stub. */
- bfd_put_32 (output_bfd, STUB_LW (output_bfd), stub);
- bfd_put_32 (output_bfd, STUB_MOVE (output_bfd), stub + 4);
- bfd_put_32 (output_bfd, STUB_JALR, stub + 8);
- bfd_put_32 (output_bfd, STUB_LI16 (output_bfd) + h->dynindx, stub + 12);
+ idx = 0;
+ bfd_put_32 (output_bfd, STUB_LW (output_bfd), stub + idx);
+ idx += 4;
+ bfd_put_32 (output_bfd, STUB_MOVE (output_bfd), stub + idx);
+ idx += 4;
+ if (htab->function_stub_size == MIPS_FUNCTION_STUB_BIG_SIZE)
+ {
+ bfd_put_32 (output_bfd, STUB_LUI ((h->dynindx >> 16) & 0x7fff),
+ stub + idx);
+ idx += 4;
+ }
+ bfd_put_32 (output_bfd, STUB_JALR, stub + idx);
+ idx += 4;
+
+ /* If a large stub is not required and sign extension is not a
+ problem, then use legacy code in the stub. */
+ if (htab->function_stub_size == MIPS_FUNCTION_STUB_BIG_SIZE)
+ bfd_put_32 (output_bfd, STUB_ORI (h->dynindx & 0xffff), stub + idx);
+ else if (h->dynindx & ~0x7fff)
+ bfd_put_32 (output_bfd, STUB_LI16U (h->dynindx & 0xffff), stub + idx);
+ else
+ bfd_put_32 (output_bfd, STUB_LI16S (output_bfd, h->dynindx),
+ stub + idx);
BFD_ASSERT (h->plt.offset <= s->size);
- memcpy (s->contents + h->plt.offset, stub, MIPS_FUNCTION_STUB_SIZE);
+ memcpy (s->contents + h->plt.offset, stub, htab->function_stub_size);
/* Mark the symbol as undefined. plt.offset != -1 occurs
only for the referenced symbol. */
@@ -7584,6 +8273,268 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
return TRUE;
}
+/* Likewise, for VxWorks. */
+
+bfd_boolean
+_bfd_mips_vxworks_finish_dynamic_symbol (bfd *output_bfd,
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
+{
+ bfd *dynobj;
+ asection *sgot;
+ struct mips_got_info *g;
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
+ dynobj = elf_hash_table (info)->dynobj;
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+ bfd_byte *loc;
+ bfd_vma plt_address, plt_index, got_address, got_offset, branch_offset;
+ Elf_Internal_Rela rel;
+ static const bfd_vma *plt_entry;
+
+ BFD_ASSERT (h->dynindx != -1);
+ BFD_ASSERT (htab->splt != NULL);
+ BFD_ASSERT (h->plt.offset <= htab->splt->size);
+
+ /* Calculate the address of the .plt entry. */
+ plt_address = (htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + h->plt.offset);
+
+ /* Calculate the index of the entry. */
+ plt_index = ((h->plt.offset - htab->plt_header_size)
+ / htab->plt_entry_size);
+
+ /* Calculate the address of the .got.plt entry. */
+ got_address = (htab->sgotplt->output_section->vma
+ + htab->sgotplt->output_offset
+ + plt_index * 4);
+
+ /* Calculate the offset of the .got.plt entry from
+ _GLOBAL_OFFSET_TABLE_. */
+ got_offset = mips_elf_gotplt_index (info, h);
+
+ /* Calculate the offset for the branch at the start of the PLT
+ entry. The branch jumps to the beginning of .plt. */
+ branch_offset = -(h->plt.offset / 4 + 1) & 0xffff;
+
+ /* Fill in the initial value of the .got.plt entry. */
+ bfd_put_32 (output_bfd, plt_address,
+ htab->sgotplt->contents + plt_index * 4);
+
+ /* Find out where the .plt entry should go. */
+ loc = htab->splt->contents + h->plt.offset;
+
+ if (info->shared)
+ {
+ plt_entry = mips_vxworks_shared_plt_entry;
+ bfd_put_32 (output_bfd, plt_entry[0] | branch_offset, loc);
+ bfd_put_32 (output_bfd, plt_entry[1] | plt_index, loc + 4);
+ }
+ else
+ {
+ bfd_vma got_address_high, got_address_low;
+
+ plt_entry = mips_vxworks_exec_plt_entry;
+ got_address_high = ((got_address + 0x8000) >> 16) & 0xffff;
+ got_address_low = got_address & 0xffff;
+
+ bfd_put_32 (output_bfd, plt_entry[0] | branch_offset, loc);
+ bfd_put_32 (output_bfd, plt_entry[1] | plt_index, loc + 4);
+ bfd_put_32 (output_bfd, plt_entry[2] | got_address_high, loc + 8);
+ bfd_put_32 (output_bfd, plt_entry[3] | got_address_low, loc + 12);
+ bfd_put_32 (output_bfd, plt_entry[4], loc + 16);
+ bfd_put_32 (output_bfd, plt_entry[5], loc + 20);
+ bfd_put_32 (output_bfd, plt_entry[6], loc + 24);
+ bfd_put_32 (output_bfd, plt_entry[7], loc + 28);
+
+ loc = (htab->srelplt2->contents
+ + (plt_index * 3 + 2) * sizeof (Elf32_External_Rela));
+
+ /* Emit a relocation for the .got.plt entry. */
+ rel.r_offset = got_address;
+ rel.r_info = ELF32_R_INFO (htab->root.hplt->indx, R_MIPS_32);
+ rel.r_addend = h->plt.offset;
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+
+ /* Emit a relocation for the lui of %hi(<.got.plt slot>). */
+ loc += sizeof (Elf32_External_Rela);
+ rel.r_offset = plt_address + 8;
+ rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_HI16);
+ rel.r_addend = got_offset;
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+
+ /* Emit a relocation for the addiu of %lo(<.got.plt slot>). */
+ loc += sizeof (Elf32_External_Rela);
+ rel.r_offset += 4;
+ rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_LO16);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+ }
+
+ /* Emit an R_MIPS_JUMP_SLOT relocation against the .got.plt entry. */
+ loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rela);
+ rel.r_offset = got_address;
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_JUMP_SLOT);
+ rel.r_addend = 0;
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+
+ if (!h->def_regular)
+ sym->st_shndx = SHN_UNDEF;
+ }
+
+ BFD_ASSERT (h->dynindx != -1 || h->forced_local);
+
+ sgot = mips_elf_got_section (dynobj, FALSE);
+ BFD_ASSERT (sgot != NULL);
+ BFD_ASSERT (mips_elf_section_data (sgot) != NULL);
+ g = mips_elf_section_data (sgot)->u.got_info;
+ BFD_ASSERT (g != NULL);
+
+ /* See if this symbol has an entry in the GOT. */
+ if (g->global_gotsym != NULL
+ && h->dynindx >= g->global_gotsym->dynindx)
+ {
+ bfd_vma offset;
+ Elf_Internal_Rela outrel;
+ bfd_byte *loc;
+ asection *s;
+
+ /* Install the symbol value in the GOT. */
+ offset = mips_elf_global_got_index (dynobj, output_bfd, h,
+ R_MIPS_GOT16, info);
+ MIPS_ELF_PUT_WORD (output_bfd, sym->st_value, sgot->contents + offset);
+
+ /* Add a dynamic relocation for it. */
+ s = mips_elf_rel_dyn_section (info, FALSE);
+ loc = s->contents + (s->reloc_count++ * sizeof (Elf32_External_Rela));
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + offset);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_32);
+ outrel.r_addend = 0;
+ bfd_elf32_swap_reloca_out (dynobj, &outrel, loc);
+ }
+
+ /* Emit a copy reloc, if needed. */
+ if (h->needs_copy)
+ {
+ Elf_Internal_Rela rel;
+
+ BFD_ASSERT (h->dynindx != -1);
+
+ rel.r_offset = (h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset
+ + h->root.u.def.value);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_COPY);
+ rel.r_addend = 0;
+ bfd_elf32_swap_reloca_out (output_bfd, &rel,
+ htab->srelbss->contents
+ + (htab->srelbss->reloc_count
+ * sizeof (Elf32_External_Rela)));
+ ++htab->srelbss->reloc_count;
+ }
+
+ /* If this is a mips16 symbol, force the value to be even. */
+ if (sym->st_other == STO_MIPS16)
+ sym->st_value &= ~1;
+
+ return TRUE;
+}
+
+/* Install the PLT header for a VxWorks executable and finalize the
+ contents of .rela.plt.unloaded. */
+
+static void
+mips_vxworks_finish_exec_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+ Elf_Internal_Rela rela;
+ bfd_byte *loc;
+ bfd_vma got_value, got_value_high, got_value_low, plt_address;
+ static const bfd_vma *plt_entry;
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
+ plt_entry = mips_vxworks_exec_plt0_entry;
+
+ /* Calculate the value of _GLOBAL_OFFSET_TABLE_. */
+ got_value = (htab->root.hgot->root.u.def.section->output_section->vma
+ + htab->root.hgot->root.u.def.section->output_offset
+ + htab->root.hgot->root.u.def.value);
+
+ got_value_high = ((got_value + 0x8000) >> 16) & 0xffff;
+ got_value_low = got_value & 0xffff;
+
+ /* Calculate the address of the PLT header. */
+ plt_address = htab->splt->output_section->vma + htab->splt->output_offset;
+
+ /* Install the PLT header. */
+ loc = htab->splt->contents;
+ bfd_put_32 (output_bfd, plt_entry[0] | got_value_high, loc);
+ bfd_put_32 (output_bfd, plt_entry[1] | got_value_low, loc + 4);
+ bfd_put_32 (output_bfd, plt_entry[2], loc + 8);
+ bfd_put_32 (output_bfd, plt_entry[3], loc + 12);
+ bfd_put_32 (output_bfd, plt_entry[4], loc + 16);
+ bfd_put_32 (output_bfd, plt_entry[5], loc + 20);
+
+ /* Output the relocation for the lui of %hi(_GLOBAL_OFFSET_TABLE_). */
+ loc = htab->srelplt2->contents;
+ rela.r_offset = plt_address;
+ rela.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_HI16);
+ rela.r_addend = 0;
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* Output the relocation for the following addiu of
+ %lo(_GLOBAL_OFFSET_TABLE_). */
+ rela.r_offset += 4;
+ rela.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_LO16);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* Fix up the remaining relocations. They may have the wrong
+ symbol index for _G_O_T_ or _P_L_T_ depending on the order
+ in which symbols were output. */
+ while (loc < htab->srelplt2->contents + htab->srelplt2->size)
+ {
+ Elf_Internal_Rela rel;
+
+ bfd_elf32_swap_reloca_in (output_bfd, loc, &rel);
+ rel.r_info = ELF32_R_INFO (htab->root.hplt->indx, R_MIPS_32);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ bfd_elf32_swap_reloca_in (output_bfd, loc, &rel);
+ rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_HI16);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ bfd_elf32_swap_reloca_in (output_bfd, loc, &rel);
+ rel.r_info = ELF32_R_INFO (htab->root.hgot->indx, R_MIPS_LO16);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+ loc += sizeof (Elf32_External_Rela);
+ }
+}
+
+/* Install the PLT header for a VxWorks shared library. */
+
+static void
+mips_vxworks_finish_shared_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+ unsigned int i;
+ struct mips_elf_link_hash_table *htab;
+
+ htab = mips_elf_hash_table (info);
+
+ /* We just need to copy the entry byte-by-byte. */
+ for (i = 0; i < ARRAY_SIZE (mips_vxworks_shared_plt0_entry); i++)
+ bfd_put_32 (output_bfd, mips_vxworks_shared_plt0_entry[i],
+ htab->splt->contents + i * 4);
+}
+
/* Finish up the dynamic sections. */
bfd_boolean
@@ -7594,7 +8545,9 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
asection *sdyn;
asection *sgot;
struct mips_got_info *gg, *g;
+ struct mips_elf_link_hash_table *htab;
+ htab = mips_elf_hash_table (info);
dynobj = elf_hash_table (info)->dynobj;
sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
@@ -7614,6 +8567,7 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
if (elf_hash_table (info)->dynamic_sections_created)
{
bfd_byte *b;
+ int dyn_to_skip = 0, dyn_skipped = 0;
BFD_ASSERT (sdyn != NULL);
BFD_ASSERT (g != NULL);
@@ -7637,11 +8591,14 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
switch (dyn.d_tag)
{
case DT_RELENT:
- s = mips_elf_rel_dyn_section (dynobj, FALSE);
- BFD_ASSERT (s != NULL);
dyn.d_un.d_val = MIPS_ELF_REL_SIZE (dynobj);
break;
+ case DT_RELAENT:
+ BFD_ASSERT (htab->is_vxworks);
+ dyn.d_un.d_val = MIPS_ELF_RELA_SIZE (dynobj);
+ break;
+
case DT_STRSZ:
/* Rewrite DT_STRSZ. */
dyn.d_un.d_val =
@@ -7650,9 +8607,20 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
case DT_PLTGOT:
name = ".got";
- s = bfd_get_section_by_name (output_bfd, name);
- BFD_ASSERT (s != NULL);
- dyn.d_un.d_ptr = s->vma;
+ if (htab->is_vxworks)
+ {
+ /* _GLOBAL_OFFSET_TABLE_ is defined to be the beginning
+ of the ".got" section in DYNOBJ. */
+ s = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ }
+ else
+ {
+ s = bfd_get_section_by_name (output_bfd, name);
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma;
+ }
break;
case DT_MIPS_RLD_VERSION:
@@ -7718,7 +8686,7 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_MIPS_HIPAGENO:
- dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO;
+ dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO (info);
break;
case DT_MIPS_RLD_MAP:
@@ -7731,25 +8699,96 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
dyn.d_un.d_ptr = s->vma;
break;
+ case DT_RELASZ:
+ BFD_ASSERT (htab->is_vxworks);
+ /* The count does not include the JUMP_SLOT relocations. */
+ if (htab->srelplt)
+ dyn.d_un.d_val -= htab->srelplt->size;
+ break;
+
+ case DT_PLTREL:
+ BFD_ASSERT (htab->is_vxworks);
+ dyn.d_un.d_val = DT_RELA;
+ break;
+
+ case DT_PLTRELSZ:
+ BFD_ASSERT (htab->is_vxworks);
+ dyn.d_un.d_val = htab->srelplt->size;
+ break;
+
+ case DT_JMPREL:
+ BFD_ASSERT (htab->is_vxworks);
+ dyn.d_un.d_val = (htab->srelplt->output_section->vma
+ + htab->srelplt->output_offset);
+ break;
+
+ case DT_TEXTREL:
+ /* If we didn't need any text relocations after all, delete
+ the dynamic tag. */
+ if (!(info->flags & DF_TEXTREL))
+ {
+ dyn_to_skip = MIPS_ELF_DYN_SIZE (dynobj);
+ swap_out_p = FALSE;
+ }
+ break;
+
+ case DT_FLAGS:
+ /* If we didn't need any text relocations after all, clear
+ DF_TEXTREL from DT_FLAGS. */
+ if (!(info->flags & DF_TEXTREL))
+ dyn.d_un.d_val &= ~DF_TEXTREL;
+ else
+ swap_out_p = FALSE;
+ break;
+
default:
swap_out_p = FALSE;
break;
}
- if (swap_out_p)
+ if (swap_out_p || dyn_skipped)
(*get_elf_backend_data (dynobj)->s->swap_dyn_out)
- (dynobj, &dyn, b);
+ (dynobj, &dyn, b - dyn_skipped);
+
+ if (dyn_to_skip)
+ {
+ dyn_skipped += dyn_to_skip;
+ dyn_to_skip = 0;
+ }
}
+
+ /* Wipe out any trailing entries if we shifted down a dynamic tag. */
+ if (dyn_skipped > 0)
+ memset (b - dyn_skipped, 0, dyn_skipped);
}
- /* The first entry of the global offset table will be filled at
- runtime. The second entry will be used by some runtime loaders.
- This isn't the case of IRIX rld. */
if (sgot != NULL && sgot->size > 0)
{
- MIPS_ELF_PUT_WORD (output_bfd, 0, sgot->contents);
- MIPS_ELF_PUT_WORD (output_bfd, 0x80000000,
- sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
+ if (htab->is_vxworks)
+ {
+ /* The first entry of the global offset table points to the
+ ".dynamic" section. The second is initialized by the
+ loader and contains the shared library identifier.
+ The third is also initialized by the loader and points
+ to the lazy resolution stub. */
+ MIPS_ELF_PUT_WORD (output_bfd,
+ sdyn->output_offset + sdyn->output_section->vma,
+ sgot->contents);
+ MIPS_ELF_PUT_WORD (output_bfd, 0,
+ sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
+ MIPS_ELF_PUT_WORD (output_bfd, 0,
+ sgot->contents
+ + 2 * MIPS_ELF_GOT_SIZE (output_bfd));
+ }
+ else
+ {
+ /* The first entry of the global offset table will be filled at
+ runtime. The second entry will be used by some runtime loaders.
+ This isn't the case of IRIX rld. */
+ MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents);
+ MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000,
+ sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
+ }
}
if (sgot != NULL)
@@ -7823,7 +8862,7 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
decided not to make. This is for the n64 irix rld,
which doesn't seem to apply any relocations if there
are trailing null entries. */
- s = mips_elf_rel_dyn_section (dynobj, FALSE);
+ s = mips_elf_rel_dyn_section (info, FALSE);
dyn.d_un.d_val = (s->reloc_count
* (ABI_64_P (output_bfd)
? sizeof (Elf64_Mips_External_Rel)
@@ -7869,32 +8908,45 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
{
file_ptr dummy_offset;
- BFD_ASSERT (s->size >= MIPS_FUNCTION_STUB_SIZE);
- dummy_offset = s->size - MIPS_FUNCTION_STUB_SIZE;
+ BFD_ASSERT (s->size >= htab->function_stub_size);
+ dummy_offset = s->size - htab->function_stub_size;
memset (s->contents + dummy_offset, 0,
- MIPS_FUNCTION_STUB_SIZE);
+ htab->function_stub_size);
}
}
}
- /* We need to sort the entries of the dynamic relocation section. */
-
- s = mips_elf_rel_dyn_section (dynobj, FALSE);
-
- if (s != NULL
- && s->size > (bfd_vma)2 * MIPS_ELF_REL_SIZE (output_bfd))
+ /* The psABI says that the dynamic relocations must be sorted in
+ increasing order of r_symndx. The VxWorks EABI doesn't require
+ this, and because the code below handles REL rather than RELA
+ relocations, using it for VxWorks would be outright harmful. */
+ if (!htab->is_vxworks)
{
- reldyn_sorting_bfd = output_bfd;
+ s = mips_elf_rel_dyn_section (info, FALSE);
+ if (s != NULL
+ && s->size > (bfd_vma)2 * MIPS_ELF_REL_SIZE (output_bfd))
+ {
+ reldyn_sorting_bfd = output_bfd;
- if (ABI_64_P (output_bfd))
- qsort ((Elf64_External_Rel *) s->contents + 1, s->reloc_count - 1,
- sizeof (Elf64_Mips_External_Rel), sort_dynamic_relocs_64);
- else
- qsort ((Elf32_External_Rel *) s->contents + 1, s->reloc_count - 1,
- sizeof (Elf32_External_Rel), sort_dynamic_relocs);
+ if (ABI_64_P (output_bfd))
+ qsort ((Elf64_External_Rel *) s->contents + 1,
+ s->reloc_count - 1, sizeof (Elf64_Mips_External_Rel),
+ sort_dynamic_relocs_64);
+ else
+ qsort ((Elf32_External_Rel *) s->contents + 1,
+ s->reloc_count - 1, sizeof (Elf32_External_Rel),
+ sort_dynamic_relocs);
+ }
}
}
+ if (htab->is_vxworks && htab->splt->size > 0)
+ {
+ if (info->shared)
+ mips_vxworks_finish_shared_plt (output_bfd, info);
+ else
+ mips_vxworks_finish_exec_plt (output_bfd, info);
+ }
return TRUE;
}
@@ -8962,9 +10014,37 @@ _bfd_mips_elf_link_hash_table_create (bfd *abfd)
ret->use_rld_obj_head = FALSE;
ret->rld_value = 0;
ret->mips16_stubs_seen = FALSE;
+ ret->is_vxworks = FALSE;
+ ret->srelbss = NULL;
+ ret->sdynbss = NULL;
+ ret->srelplt = NULL;
+ ret->srelplt2 = NULL;
+ ret->sgotplt = NULL;
+ ret->splt = NULL;
+ ret->plt_header_size = 0;
+ ret->plt_entry_size = 0;
+ ret->function_stub_size = 0;
return &ret->root.root;
}
+
+/* Likewise, but indicate that the target is VxWorks. */
+
+struct bfd_link_hash_table *
+_bfd_mips_vxworks_link_hash_table_create (bfd *abfd)
+{
+ struct bfd_link_hash_table *ret;
+
+ ret = _bfd_mips_elf_link_hash_table_create (abfd);
+ if (ret)
+ {
+ struct mips_elf_link_hash_table *htab;
+
+ htab = (struct mips_elf_link_hash_table *) ret;
+ htab->is_vxworks = 1;
+ }
+ return ret;
+}
/* We need to use a special link routine to handle the .reginfo and
the .mdebug sections. We need to merge all instances of these
@@ -8987,6 +10067,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
EXTR esym;
unsigned int i;
bfd_size_type amt;
+ struct mips_elf_link_hash_table *htab;
static const char * const secname[] =
{
@@ -9003,6 +10084,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
generic size_dynamic_sections renumbered them out from under us.
Rather than trying somehow to prevent the renumbering, just do
the sort again. */
+ htab = mips_elf_hash_table (info);
if (elf_hash_table (info)->dynamic_sections_created)
{
bfd *dynobj;
@@ -9017,18 +10099,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
we count the sections after (possibly) removing the .options
section above. */
- dynsecsymcount = 0;
- if (info->shared)
- {
- asection * p;
-
- for (p = abfd->sections; p ; p = p->next)
- if ((p->flags & SEC_EXCLUDE) == 0
- && (p->flags & SEC_ALLOC) != 0
- && !(*bed->elf_backend_omit_section_dynsym) (abfd, info, p))
- ++ dynsecsymcount;
- }
-
+ dynsecsymcount = count_section_dynsyms (abfd, info);
if (! mips_elf_sort_hash_table (info, dynsecsymcount + 1))
return FALSE;
@@ -9053,6 +10124,14 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
elf_gp (abfd) = (h->u.def.value
+ h->u.def.section->output_section->vma
+ h->u.def.section->output_offset);
+ else if (htab->is_vxworks
+ && (h = bfd_link_hash_lookup (info->hash,
+ "_GLOBAL_OFFSET_TABLE_",
+ FALSE, FALSE, TRUE))
+ && h->type == bfd_link_hash_defined)
+ elf_gp (abfd) = (h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset
+ + h->u.def.value);
else if (info->relocatable)
{
bfd_vma lo = MINUS_ONE;
@@ -9064,7 +10143,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
lo = o->vma;
/* And calculate GP relative to that. */
- elf_gp (abfd) = lo + ELF_MIPS_GP_OFFSET (abfd);
+ elf_gp (abfd) = lo + ELF_MIPS_GP_OFFSET (info);
}
else
{
@@ -9796,6 +10875,12 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
new_flags &= ~EF_MIPS_UCODE;
old_flags &= ~EF_MIPS_UCODE;
+ /* Don't care about the PIC flags from dynamic objects; they are
+ PIC by design. */
+ if ((new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0
+ && (ibfd->flags & DYNAMIC) != 0)
+ new_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC);
+
if (new_flags == old_flags)
return TRUE;
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index 07e661d81c0..6c3c9a30f6e 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -48,6 +48,8 @@ extern bfd_boolean _bfd_mips_elf_check_relocs
(bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
extern bfd_boolean _bfd_mips_elf_adjust_dynamic_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *);
+extern bfd_boolean _bfd_mips_vxworks_adjust_dynamic_symbol
+ (struct bfd_link_info *, struct elf_link_hash_entry *);
extern bfd_boolean _bfd_mips_elf_always_size_sections
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_mips_elf_size_dynamic_sections
@@ -58,6 +60,9 @@ extern bfd_boolean _bfd_mips_elf_relocate_section
extern bfd_boolean _bfd_mips_elf_finish_dynamic_symbol
(bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
Elf_Internal_Sym *);
+extern bfd_boolean _bfd_mips_vxworks_finish_dynamic_symbol
+ (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ Elf_Internal_Sym *);
extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections
(bfd *, struct bfd_link_info *);
extern void _bfd_mips_elf_final_write_processing
@@ -90,6 +95,8 @@ extern bfd_byte *_bfd_elf_mips_get_relocated_section_contents
bfd_byte *, bfd_boolean, asymbol **);
extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
(bfd *);
+extern struct bfd_link_hash_table *_bfd_mips_vxworks_link_hash_table_create
+ (bfd *);
extern bfd_boolean _bfd_mips_elf_final_link
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_mips_elf_merge_private_bfd_data
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index cb5f7cbba9b..ef7ff482d2e 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -23,10 +23,12 @@
#include "sysdep.h"
#include "bfdlink.h"
#include "libbfd.h"
+#include "libiberty.h"
#include "elf-bfd.h"
#include "elf/sparc.h"
#include "opcode/sparc.h"
#include "elfxx-sparc.h"
+#include "elf-vxworks.h"
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */
#define MINUS_ONE (~ (bfd_vma) 0)
@@ -697,6 +699,50 @@ sparc64_plt_entry_build (bfd *output_bfd, asection *splt, bfd_vma offset,
return index - 4;
}
+/* The format of the first PLT entry in a VxWorks executable. */
+static const bfd_vma sparc_vxworks_exec_plt0_entry[] =
+ {
+ 0x05000000, /* sethi %hi(_GLOBAL_OFFSET_TABLE_+8), %g2 */
+ 0x8410a000, /* or %g2, %lo(_GLOBAL_OFFSET_TABLE_+8), %g2 */
+ 0xc4008000, /* ld [ %g2 ], %g2 */
+ 0x81c08000, /* jmp %g2 */
+ 0x01000000 /* nop */
+ };
+
+/* The format of subsequent PLT entries. */
+static const bfd_vma sparc_vxworks_exec_plt_entry[] =
+ {
+ 0x03000000, /* sethi %hi(_GLOBAL_OFFSET_TABLE_+f@got), %g1 */
+ 0x82106000, /* or %g1, %lo(_GLOBAL_OFFSET_TABLE_+f@got), %g1 */
+ 0xc2004000, /* ld [ %g1 ], %g1 */
+ 0x81c04000, /* jmp %g1 */
+ 0x01000000, /* nop */
+ 0x03000000, /* sethi %hi(f@pltindex), %g1 */
+ 0x10800000, /* b _PLT_resolve */
+ 0x82106000 /* or %g1, %lo(f@pltindex), %g1 */
+ };
+
+/* The format of the first PLT entry in a VxWorks shared object. */
+static const bfd_vma sparc_vxworks_shared_plt0_entry[] =
+ {
+ 0xc405e008, /* ld [ %l7 + 8 ], %g2 */
+ 0x81c08000, /* jmp %g2 */
+ 0x01000000 /* nop */
+ };
+
+/* The format of subsequent PLT entries. */
+static const bfd_vma sparc_vxworks_shared_plt_entry[] =
+ {
+ 0x03000000, /* sethi %hi(f@got), %g1 */
+ 0x82106000, /* or %g1, %lo(f@got), %g1 */
+ 0xc205c001, /* ld [ %l7 + %g1 ], %g1 */
+ 0x81c04000, /* jmp %g1 */
+ 0x01000000, /* nop */
+ 0x03000000, /* sethi %hi(f@pltindex), %g1 */
+ 0x10800000, /* b _PLT_resolve */
+ 0x82106000 /* or %g1, %lo(f@pltindex), %g1 */
+ };
+
#define SPARC_ELF_PUT_WORD(htab, bfd, val, ptr) \
htab->put_word(bfd, val, ptr)
@@ -781,7 +827,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd)
ret->append_rela = sparc_elf_append_rela_64;
ret->r_info = sparc_elf_r_info_64;
ret->r_symndx = sparc_elf_r_symndx_64;
- ret->build_plt_entry = sparc64_plt_entry_build;
ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF64;
ret->dtpmod_reloc = R_SPARC_TLS_DTPMOD64;
ret->tpoff_reloc = R_SPARC_TLS_TPOFF64;
@@ -798,7 +843,6 @@ _bfd_sparc_elf_link_hash_table_create (bfd *abfd)
ret->append_rela = sparc_elf_append_rela_32;
ret->r_info = sparc_elf_r_info_32;
ret->r_symndx = sparc_elf_r_symndx_32;
- ret->build_plt_entry = sparc32_plt_entry_build;
ret->dtpoff_reloc = R_SPARC_TLS_DTPOFF32;
ret->dtpmod_reloc = R_SPARC_TLS_DTPMOD32;
ret->tpoff_reloc = R_SPARC_TLS_TPOFF32;
@@ -846,6 +890,14 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
|| ! bfd_set_section_alignment (dynobj, htab->srelgot,
htab->word_align_power))
return FALSE;
+
+ if (htab->is_vxworks)
+ {
+ htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
+ if (!htab->sgotplt)
+ return FALSE;
+ }
+
return TRUE;
}
@@ -872,6 +924,41 @@ _bfd_sparc_elf_create_dynamic_sections (bfd *dynobj,
if (!info->shared)
htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss");
+ if (htab->is_vxworks)
+ {
+ if (!elf_vxworks_create_dynamic_sections (dynobj, info, &htab->srelplt2))
+ return FALSE;
+ if (info->shared)
+ {
+ htab->plt_header_size
+ = 4 * ARRAY_SIZE (sparc_vxworks_shared_plt0_entry);
+ htab->plt_entry_size
+ = 4 * ARRAY_SIZE (sparc_vxworks_shared_plt_entry);
+ }
+ else
+ {
+ htab->plt_header_size
+ = 4 * ARRAY_SIZE (sparc_vxworks_exec_plt0_entry);
+ htab->plt_entry_size
+ = 4 * ARRAY_SIZE (sparc_vxworks_exec_plt_entry);
+ }
+ }
+ else
+ {
+ if (ABI_64_P (dynobj))
+ {
+ htab->build_plt_entry = sparc64_plt_entry_build;
+ htab->plt_header_size = PLT64_HEADER_SIZE;
+ htab->plt_entry_size = PLT64_ENTRY_SIZE;
+ }
+ else
+ {
+ htab->build_plt_entry = sparc32_plt_entry_build;
+ htab->plt_header_size = PLT32_HEADER_SIZE;
+ htab->plt_entry_size = PLT32_ENTRY_SIZE;
+ }
+ }
+
if (!htab->splt || !htab->srelplt || !htab->sdynbss
|| (!info->shared && !htab->srelbss))
abort ();
@@ -1807,10 +1894,15 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
{
asection *s = htab->splt;
- /* The first four entries in .plt is reserved. */
+ /* Allocate room for the header. */
if (s->size == 0)
- s->size = (SPARC_ELF_WORD_BYTES(htab) == 8 ?
- PLT64_HEADER_SIZE : PLT32_HEADER_SIZE);
+ {
+ s->size = htab->plt_header_size;
+
+ /* Allocate space for the .rela.plt.unloaded relocations. */
+ if (htab->is_vxworks && !info->shared)
+ htab->srelplt2->size = sizeof (Elf32_External_Rela) * 2;
+ }
/* The procedure linkage table size is bounded by the magnitude
of the offset we can describe in the entry. */
@@ -1847,11 +1939,20 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
}
/* Make room for this entry. */
- s->size += (SPARC_ELF_WORD_BYTES(htab) == 8 ?
- PLT64_ENTRY_SIZE : PLT32_ENTRY_SIZE);
+ s->size += htab->plt_entry_size;
/* We also need to make an entry in the .rela.plt section. */
htab->srelplt->size += SPARC_ELF_RELA_BYTES (htab);
+
+ if (htab->is_vxworks)
+ {
+ /* Allocate space for the .got.plt entry. */
+ htab->sgotplt->size += 4;
+
+ /* ...and for the .rela.plt.unloaded relocations. */
+ if (!info->shared)
+ htab->srelplt2->size += sizeof (Elf32_External_Rela) * 3;
+ }
}
else
{
@@ -2153,6 +2254,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info);
if (! ABI_64_P (output_bfd)
+ && !htab->is_vxworks
&& elf_hash_table (info)->dynamic_sections_created)
{
/* Make space for the trailing nop in .plt. */
@@ -2179,7 +2281,8 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd,
if (s == htab->splt
|| s == htab->sgot
- || s == htab->sdynbss)
+ || s == htab->sdynbss
+ || s == htab->sgotplt)
{
/* Strip this section if we don't need it; see the
comment below. */
@@ -3428,6 +3531,97 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
return TRUE;
}
+/* Build a VxWorks PLT entry. PLT_INDEX is the index of the PLT entry
+ and PLT_OFFSET is the byte offset from the start of .plt. GOT_OFFSET
+ is the offset of the associated .got.plt entry from
+ _GLOBAL_OFFSET_TABLE_. */
+
+static void
+sparc_vxworks_build_plt_entry (bfd *output_bfd, struct bfd_link_info *info,
+ bfd_vma plt_offset, bfd_vma plt_index,
+ bfd_vma got_offset)
+{
+ bfd_vma got_base;
+ const bfd_vma *plt_entry;
+ struct _bfd_sparc_elf_link_hash_table *htab;
+ bfd_byte *loc;
+ Elf_Internal_Rela rela;
+
+ htab = _bfd_sparc_elf_hash_table (info);
+ if (info->shared)
+ {
+ plt_entry = sparc_vxworks_shared_plt_entry;
+ got_base = 0;
+ }
+ else
+ {
+ plt_entry = sparc_vxworks_exec_plt_entry;
+ got_base = (htab->elf.hgot->root.u.def.value
+ + htab->elf.hgot->root.u.def.section->output_offset
+ + htab->elf.hgot->root.u.def.section->output_section->vma);
+ }
+
+ /* Fill in the entry in the procedure linkage table. */
+ bfd_put_32 (output_bfd, plt_entry[0] + ((got_base + got_offset) >> 10),
+ htab->splt->contents + plt_offset);
+ bfd_put_32 (output_bfd, plt_entry[1] + ((got_base + got_offset) & 0x3ff),
+ htab->splt->contents + plt_offset + 4);
+ bfd_put_32 (output_bfd, plt_entry[2],
+ htab->splt->contents + plt_offset + 8);
+ bfd_put_32 (output_bfd, plt_entry[3],
+ htab->splt->contents + plt_offset + 12);
+ bfd_put_32 (output_bfd, plt_entry[4],
+ htab->splt->contents + plt_offset + 16);
+ bfd_put_32 (output_bfd, plt_entry[5] + (plt_index >> 10),
+ htab->splt->contents + plt_offset + 20);
+ /* PC-relative displacement for a branch to the start of
+ the PLT section. */
+ bfd_put_32 (output_bfd, plt_entry[6] + (((-plt_offset - 24) >> 2)
+ & 0x003fffff),
+ htab->splt->contents + plt_offset + 24);
+ bfd_put_32 (output_bfd, plt_entry[7] + (plt_index & 0x3ff),
+ htab->splt->contents + plt_offset + 28);
+
+ /* Fill in the .got.plt entry, pointing initially at the
+ second half of the PLT entry. */
+ BFD_ASSERT (htab->sgotplt != NULL);
+ bfd_put_32 (output_bfd,
+ htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + plt_offset + 20,
+ htab->sgotplt->contents + got_offset);
+
+ /* Add relocations to .rela.plt.unloaded. */
+ if (!info->shared)
+ {
+ loc = (htab->srelplt2->contents
+ + (2 + 3 * plt_index) * sizeof (Elf32_External_Rela));
+
+ /* Relocate the initial sethi. */
+ rela.r_offset = (htab->splt->output_section->vma
+ + htab->splt->output_offset
+ + plt_offset);
+ rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
+ rela.r_addend = got_offset;
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* Likewise the following or. */
+ rela.r_offset += 4;
+ rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* Relocate the .got.plt entry. */
+ rela.r_offset = (htab->sgotplt->output_section->vma
+ + htab->sgotplt->output_offset
+ + got_offset);
+ rela.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_SPARC_32);
+ rela.r_addend = plt_offset + 20;
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ }
+}
+
/* Finish up dynamic symbol handling. We set the contents of various
dynamic sections here. */
@@ -3449,7 +3643,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd,
asection *srela;
Elf_Internal_Rela rela;
bfd_byte *loc;
- bfd_vma r_offset;
+ bfd_vma r_offset, got_offset;
int rela_index;
/* This symbol has an entry in the PLT. Set it up. */
@@ -3460,23 +3654,48 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd,
srela = htab->srelplt;
BFD_ASSERT (splt != NULL && srela != NULL);
- /* Fill in the entry in the procedure linkage table. */
- rela_index = SPARC_ELF_BUILD_PLT_ENTRY (htab, output_bfd, splt,
- h->plt.offset, splt->size,
- &r_offset);
-
/* Fill in the entry in the .rela.plt section. */
- rela.r_offset = r_offset
- + (splt->output_section->vma + splt->output_offset);
- if (! ABI_64_P (output_bfd)
- || h->plt.offset < (PLT64_LARGE_THRESHOLD * PLT64_ENTRY_SIZE))
+ if (htab->is_vxworks)
{
+ /* Work out the index of this PLT entry. */
+ rela_index = ((h->plt.offset - htab->plt_header_size)
+ / htab->plt_entry_size);
+
+ /* Calculate the offset of the associated .got.plt entry.
+ The first three entries are reserved. */
+ got_offset = (rela_index + 3) * 4;
+
+ sparc_vxworks_build_plt_entry (output_bfd, info, h->plt.offset,
+ rela_index, got_offset);
+
+
+ /* On VxWorks, the relocation points to the .got.plt entry,
+ not the .plt entry. */
+ rela.r_offset = (htab->sgotplt->output_section->vma
+ + htab->sgotplt->output_offset
+ + got_offset);
rela.r_addend = 0;
}
else
{
- rela.r_addend = -(h->plt.offset + 4)
- -(splt->output_section->vma + splt->output_offset);
+ /* Fill in the entry in the procedure linkage table. */
+ rela_index = SPARC_ELF_BUILD_PLT_ENTRY (htab, output_bfd, splt,
+ h->plt.offset, splt->size,
+ &r_offset);
+
+ rela.r_offset = r_offset
+ + (splt->output_section->vma + splt->output_offset);
+ if (! ABI_64_P (output_bfd)
+ || h->plt.offset < (PLT64_LARGE_THRESHOLD * PLT64_ENTRY_SIZE))
+ {
+ rela.r_addend = 0;
+ }
+ else
+ {
+ rela.r_addend = (-(h->plt.offset + 4)
+ - splt->output_section->vma
+ - splt->output_offset);
+ }
}
rela.r_info = SPARC_ELF_R_INFO (htab, NULL, h->dynindx, R_SPARC_JMP_SLOT);
@@ -3577,10 +3796,12 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd,
SPARC_ELF_APPEND_RELA (htab, output_bfd, s, &rela);
}
- /* Mark some specially defined symbols as absolute. */
+ /* Mark some specially defined symbols as absolute. On VxWorks,
+ _GLOBAL_OFFSET_TABLE_ is not absolute: it is relative to the
+ ".got" section. Likewise _PROCEDURE_LINKAGE_TABLE_ and ".plt". */
if (strcmp (h->root.root.string, "_DYNAMIC") == 0
- || h == htab->elf.hgot
- || h == htab->elf.hplt)
+ || (!htab->is_vxworks
+ && (h == htab->elf.hgot || h == htab->elf.hplt)))
sym->st_shndx = SHN_ABS;
return TRUE;
@@ -3648,13 +3869,14 @@ sparc64_finish_dyn (bfd *output_bfd, struct bfd_link_info *info,
#endif
static bfd_boolean
-sparc32_finish_dyn (bfd *output_bfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED,
+sparc32_finish_dyn (bfd *output_bfd, struct bfd_link_info *info,
bfd *dynobj, asection *sdyn,
asection *splt ATTRIBUTE_UNUSED)
{
Elf32_External_Dyn *dyncon, *dynconend;
+ struct _bfd_sparc_elf_link_hash_table *htab;
+ htab = _bfd_sparc_elf_hash_table (info);
dyncon = (Elf32_External_Dyn *) sdyn->contents;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
@@ -3665,34 +3887,150 @@ sparc32_finish_dyn (bfd *output_bfd,
bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
- switch (dyn.d_tag)
+ if (htab->is_vxworks && dyn.d_tag == DT_RELASZ)
{
- case DT_PLTGOT: name = ".plt"; size = FALSE; break;
- case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break;
- case DT_JMPREL: name = ".rela.plt"; size = FALSE; break;
- default: name = NULL; size = FALSE; break;
+ /* On VxWorks, DT_RELASZ should not include the relocations
+ in .rela.plt. */
+ if (htab->srelplt)
+ {
+ dyn.d_un.d_val -= htab->srelplt->size;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ }
}
-
- if (name != NULL)
+ else if (htab->is_vxworks && dyn.d_tag == DT_PLTGOT)
{
- asection *s;
+ /* On VxWorks, DT_PLTGOT should point to the start of the GOT,
+ not to the start of the PLT. */
+ if (htab->sgotplt)
+ {
+ dyn.d_un.d_val = (htab->sgotplt->output_section->vma
+ + htab->sgotplt->output_offset);
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ }
+ }
+ else
+ {
+ switch (dyn.d_tag)
+ {
+ case DT_PLTGOT: name = ".plt"; size = FALSE; break;
+ case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break;
+ case DT_JMPREL: name = ".rela.plt"; size = FALSE; break;
+ default: name = NULL; size = FALSE; break;
+ }
- s = bfd_get_section_by_name (output_bfd, name);
- if (s == NULL)
- dyn.d_un.d_val = 0;
- else
+ if (name != NULL)
{
- if (! size)
- dyn.d_un.d_ptr = s->vma;
+ asection *s;
+
+ s = bfd_get_section_by_name (output_bfd, name);
+ if (s == NULL)
+ dyn.d_un.d_val = 0;
else
- dyn.d_un.d_val = s->size;
+ {
+ if (! size)
+ dyn.d_un.d_ptr = s->vma;
+ else
+ dyn.d_un.d_val = s->size;
+ }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
}
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
}
}
return TRUE;
}
+/* Install the first PLT entry in a VxWorks executable and make sure that
+ .rela.plt.unloaded relocations have the correct symbol indexes. */
+
+static void
+sparc_vxworks_finish_exec_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+ struct _bfd_sparc_elf_link_hash_table *htab;
+ Elf_Internal_Rela rela;
+ bfd_vma got_base;
+ bfd_byte *loc;
+
+ htab = _bfd_sparc_elf_hash_table (info);
+
+ /* Calculate the absolute value of _GLOBAL_OFFSET_TABLE_. */
+ got_base = (htab->elf.hgot->root.u.def.section->output_section->vma
+ + htab->elf.hgot->root.u.def.section->output_offset
+ + htab->elf.hgot->root.u.def.value);
+
+ /* Install the initial PLT entry. */
+ bfd_put_32 (output_bfd,
+ sparc_vxworks_exec_plt0_entry[0] + ((got_base + 8) >> 10),
+ htab->splt->contents);
+ bfd_put_32 (output_bfd,
+ sparc_vxworks_exec_plt0_entry[1] + ((got_base + 8) & 0x3ff),
+ htab->splt->contents + 4);
+ bfd_put_32 (output_bfd,
+ sparc_vxworks_exec_plt0_entry[2],
+ htab->splt->contents + 8);
+ bfd_put_32 (output_bfd,
+ sparc_vxworks_exec_plt0_entry[3],
+ htab->splt->contents + 12);
+ bfd_put_32 (output_bfd,
+ sparc_vxworks_exec_plt0_entry[4],
+ htab->splt->contents + 16);
+
+ loc = htab->srelplt2->contents;
+
+ /* Add an unloaded relocation for the initial entry's "sethi". */
+ rela.r_offset = (htab->splt->output_section->vma
+ + htab->splt->output_offset);
+ rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
+ rela.r_addend = 8;
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* Likewise the following "or". */
+ rela.r_offset += 4;
+ rela.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* Fix up the remaining .rela.plt.unloaded relocations. They may have
+ the wrong symbol index for _G_O_T_ or _P_L_T_ depending on the order
+ in which symbols were output. */
+ while (loc < htab->srelplt2->contents + htab->srelplt2->size)
+ {
+ Elf_Internal_Rela rel;
+
+ /* The entry's initial "sethi" (against _G_O_T_). */
+ bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
+ rel.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_HI22);
+ bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* The following "or" (also against _G_O_T_). */
+ bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
+ rel.r_info = ELF32_R_INFO (htab->elf.hgot->indx, R_SPARC_LO10);
+ bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+ loc += sizeof (Elf32_External_Rela);
+
+ /* The .got.plt entry (against _P_L_T_). */
+ bfd_elf32_swap_reloc_in (output_bfd, loc, &rel);
+ rel.r_info = ELF32_R_INFO (htab->elf.hplt->indx, R_SPARC_32);
+ bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+ loc += sizeof (Elf32_External_Rela);
+ }
+}
+
+/* Install the first PLT entry in a VxWorks shared object. */
+
+static void
+sparc_vxworks_finish_shared_plt (bfd *output_bfd, struct bfd_link_info *info)
+{
+ struct _bfd_sparc_elf_link_hash_table *htab;
+ unsigned int i;
+
+ htab = _bfd_sparc_elf_hash_table (info);
+ for (i = 0; i < ARRAY_SIZE (sparc_vxworks_shared_plt0_entry); i++)
+ bfd_put_32 (output_bfd, sparc_vxworks_shared_plt0_entry[i],
+ htab->splt->contents + i * 4);
+}
+
bfd_boolean
_bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
{
@@ -3726,18 +4064,24 @@ _bfd_sparc_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
/* Initialize the contents of the .plt section. */
if (splt->size > 0)
{
- if (ABI_64_P (output_bfd))
- memset (splt->contents, 0, 4 * PLT64_ENTRY_SIZE);
+ if (htab->is_vxworks)
+ {
+ if (info->shared)
+ sparc_vxworks_finish_shared_plt (output_bfd, info);
+ else
+ sparc_vxworks_finish_exec_plt (output_bfd, info);
+ }
else
{
- memset (splt->contents, 0, 4 * PLT32_ENTRY_SIZE);
- bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP,
- splt->contents + splt->size - 4);
+ memset (splt->contents, 0, htab->plt_header_size);
+ if (!ABI_64_P (output_bfd))
+ bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP,
+ splt->contents + splt->size - 4);
}
}
- elf_section_data (splt->output_section)->this_hdr.sh_entsize =
- (ABI_64_P (output_bfd) ? PLT64_ENTRY_SIZE : PLT32_ENTRY_SIZE);
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize
+ = htab->plt_entry_size;
}
/* Set the first entry in the global offset table to the address of
diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h
index 624aea52787..0a5a88b6fe3 100644
--- a/bfd/elfxx-sparc.h
+++ b/bfd/elfxx-sparc.h
@@ -61,6 +61,15 @@ struct _bfd_sparc_elf_link_hash_table
/* Small local sym to section mapping cache. */
struct sym_sec_cache sym_sec;
+ /* True if the target system is VxWorks. */
+ int is_vxworks;
+
+ /* The (unloaded but important) .rela.plt.unloaded section, for VxWorks. */
+ asection *srelplt2;
+
+ /* .got.plt is only used on VxWorks. */
+ asection *sgotplt;
+
void (*put_word) (bfd *, bfd_vma, void *);
void (*append_rela) (bfd *, asection *, Elf_Internal_Rela *);
bfd_vma (*r_info) (Elf_Internal_Rela *, bfd_vma, bfd_vma);
@@ -70,6 +79,8 @@ struct _bfd_sparc_elf_link_hash_table
int dynamic_interpreter_size;
unsigned int word_align_power;
unsigned int align_power_max;
+ unsigned int plt_header_size;
+ unsigned int plt_entry_size;
int bytes_per_word;
int bytes_per_rela;
int dtpoff_reloc;
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index c303c31290b..0c5cfe44e0f 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -972,6 +972,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MIPS_TLS_TPREL_HI16",
"BFD_RELOC_MIPS_TLS_TPREL_LO16",
+ "BFD_RELOC_MIPS_COPY",
+ "BFD_RELOC_MIPS_JUMP_SLOT",
+
"BFD_RELOC_FRV_LABEL16",
"BFD_RELOC_FRV_LABEL24",
"BFD_RELOC_FRV_LO16",
@@ -1062,6 +1065,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_X86_64_TPOFF32",
"BFD_RELOC_X86_64_GOTOFF64",
"BFD_RELOC_X86_64_GOTPC32",
+ "BFD_RELOC_X86_64_GOT64",
+ "BFD_RELOC_X86_64_GOTPCREL64",
+ "BFD_RELOC_X86_64_GOTPC64",
+ "BFD_RELOC_X86_64_GOTPLT64",
+ "BFD_RELOC_X86_64_PLTOFF64",
"BFD_RELOC_X86_64_GOTPC32_TLSDESC",
"BFD_RELOC_X86_64_TLSDESC_CALL",
"BFD_RELOC_X86_64_TLSDESC",
@@ -1377,6 +1385,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_BFIN_12_PCREL_JUMP_S",
"BFD_RELOC_BFIN_24_PCREL_CALL_X",
"BFD_RELOC_BFIN_24_PCREL_JUMP_L",
+ "BFD_RELOC_BFIN_GOT17M4",
+ "BFD_RELOC_BFIN_GOTHI",
+ "BFD_RELOC_BFIN_GOTLO",
+ "BFD_RELOC_BFIN_FUNCDESC",
+ "BFD_RELOC_BFIN_FUNCDESC_GOT17M4",
+ "BFD_RELOC_BFIN_FUNCDESC_GOTHI",
+ "BFD_RELOC_BFIN_FUNCDESC_GOTLO",
+ "BFD_RELOC_BFIN_FUNCDESC_VALUE",
+ "BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4",
+ "BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI",
+ "BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO",
+ "BFD_RELOC_BFIN_GOTOFF17M4",
+ "BFD_RELOC_BFIN_GOTOFFHI",
+ "BFD_RELOC_BFIN_GOTOFFLO",
"BFD_RELOC_BFIN_GOT",
"BFD_RELOC_BFIN_PLTPC",
"BFD_ARELOC_BFIN_PUSH",
diff --git a/bfd/po/Make-in b/bfd/po/Make-in
index 3d1f3424828..f11ccb41cef 100644
--- a/bfd/po/Make-in
+++ b/bfd/po/Make-in
@@ -1,6 +1,6 @@
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-# Copyright 2001, 2003 Free Software Foundation, Inc.
+# Copyright 2001, 2003, 2006 Free Software Foundation, Inc.
#
# This file may be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
@@ -199,7 +199,7 @@ check: all
cat-id-tbl.o: ../intl/libgettext.h
-html dvi info tags TAGS ID:
+html dvi pdf ps info tags TAGS ID:
mostlyclean:
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in
index 1c11480185b..8bcf979a5bf 100644
--- a/bfd/po/SRC-POTFILES.in
+++ b/bfd/po/SRC-POTFILES.in
@@ -115,6 +115,7 @@ cpu-v850.c
cpu-vax.c
cpu-w65.c
cpu-we32k.c
+cpu-xc16x.c
cpu-xstormy16.c
cpu-xtensa.c
cpu-z80.c
@@ -174,6 +175,7 @@ elf32-sh-symbian.c
elf32-sparc.c
elf32-v850.c
elf32-vax.c
+elf32-xc16x.c
elf32-xstormy16.c
elf32-xtensa.c
elf64-alpha.c
diff --git a/bfd/po/es.po b/bfd/po/es.po
index 2b6642224e0..2a95afee256 100644
--- a/bfd/po/es.po
+++ b/bfd/po/es.po
@@ -1,65 +1,65 @@
-# Mensajes en español para bfd 2.15.96.
-# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2002, 2003, 2004, 2005.
+# Mensajes en español para bfd 2.16.93.
+# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2002, 2003, 2004, 2005, 2006.
#
msgid ""
msgstr ""
-"Project-Id-Version: bfd 2.15.96\n"
+"Project-Id-Version: bfd 2.16.93\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-03-05 22:14+1030\n"
-"PO-Revision-Date: 2005-03-14 17:11-0600\n"
+"POT-Creation-Date: 2005-10-25 22:24+0930\n"
+"PO-Revision-Date: 2006-05-27 11:34-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:204
+#: aout-adobe.c:127
msgid "%B: Unknown section type in a.out.adobe file: %x\n"
msgstr "%B: Tipo de sección desconocido en el fichero a.out.adobe: %x\n"
-#: aout-cris.c:207
+#: aout-cris.c:202
#, c-format
msgid "%s: Invalid relocation type exported: %d"
msgstr "%s: Tipo de reubicación exportado inválido: %d"
-#: aout-cris.c:251
+#: aout-cris.c:245
msgid "%B: Invalid relocation type imported: %d"
msgstr "%B: Tipo de reubicación importado inválido: %d"
-#: aout-cris.c:262
+#: aout-cris.c:256
msgid "%B: Bad relocation record imported: %d"
msgstr "%B: Registro de reubicación importado erróneo: %d"
-#: aoutx.h:1287 aoutx.h:1626
+#: aoutx.h:1244 aoutx.h:1578
#, 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"
-#: aoutx.h:1592
+#: aoutx.h:1544
#, 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"
-#: aoutx.h:1594
+#: aoutx.h:1546
msgid "*unknown*"
msgstr "*desconocido*"
-#: aoutx.h:3682
+#: aoutx.h:5281
#, c-format
msgid "%s: relocatable link from %s to %s not supported"
msgstr "%s: el enlace reubicable de %s a %s no está soportado"
-#: archive.c:1729
+#: archive.c:1760
msgid "Warning: writing archive was slow: rewriting timestamp\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:1992
+#: archive.c:2019
msgid "Reading archive file mod timestamp"
msgstr "Leyendo el archivo de la modificación de marca de tiempo del fichero"
-#: archive.c:2018
+#: archive.c:2043
msgid "Writing updated armap timestamp"
msgstr "Escribiendo la marca de tiempo actualizada de armap"
@@ -143,22 +143,22 @@ msgstr "Fichero demasiado grande"
msgid "#<Invalid error code>"
msgstr "#<Código de error inválido>"
-#: bfd.c:768
+#: bfd.c:771
#, c-format
msgid "BFD %s assertion fail %s:%d"
msgstr "falló la aseveración BFD %s %s:%d"
-#: bfd.c:784
+#: bfd.c:787
#, c-format
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:788
+#: bfd.c:791
#, 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"
-#: bfd.c:790
+#: bfd.c:793
msgid "Please report this bug.\n"
msgstr "Por favor reporte este bicho.\n"
@@ -172,54 +172,59 @@ 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"
-#: binary.c:309
+#: binary.c:285
#, 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."
-#: coff64-rs6000.c:2107 coff-rs6000.c:3608
+#: coff64-rs6000.c:2109 coff-rs6000.c:3610
msgid "%B: symbol `%s' has unrecognized smclas %d"
msgstr "%B: el símbolo `%s' tiene smclas %d no reconocido"
-#: coff-a29k.c:120
-msgid "Missing IHCONST"
-msgstr "IHCONST faltante"
-
-#: coff-a29k.c:181
-msgid "Missing IHIHALF"
-msgstr "IHIHALF faltante"
-
-#: coff-a29k.c:213 coff-or32.c:227
-msgid "Unrecognized reloc"
-msgstr "Reubicación no reconocida"
-
-#: coff-a29k.c:409
-msgid "missing IHCONST reloc"
-msgstr "reubicación IHCONST faltante"
+#: coff-alpha.c:489
+msgid ""
+"%B: Cannot handle compressed Alpha binaries.\n"
+" Use compiler flags, or objZ, to generate uncompressed binaries."
+msgstr ""
+"%B: No se pueden manejar binarios Alpha comprimidos.\n"
+" Use las opciones del compilador, o objZ, para generar binarios sin comprimir."
-#: coff-a29k.c:499
-msgid "missing IHIHALF reloc"
-msgstr "reubicación IHIHALF faltante"
+#: coff-alpha.c:646
+msgid "%B: unknown/unsupported relocation type %d"
+msgstr "%B: tipo de reubicación %d desconocida/sin soporte"
-#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1972 coff-mips.c:985
+#: coff-alpha.c:898 coff-alpha.c:935 coff-alpha.c:2007 coff-mips.c:985
msgid "GP relative relocation used when GP not defined"
msgstr "se usó una reubicación GP relativa cuando GP no estaba definido"
-#: coff-alpha.c:1467
+#: coff-alpha.c:1484
msgid "using multiple gp values"
msgstr "usando valores múltiples de gp"
-#: coff-arm.c:1066 elf32-arm.c:1425
+#: coff-alpha.c:1543
+msgid "%B: unsupported relocation: ALPHA_R_GPRELHIGH"
+msgstr "%B: tipo de reubicación sin soporte: ALPHA_R_GPRELHIGH"
+
+#: coff-alpha.c:1550
+msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW"
+msgstr "%B: tipo de reubicación sin soporte: ALPHA_R_GPRELLOW"
+
+#: coff-alpha.c:1557 elf32-m32r.c:2471 elf64-alpha.c:3912 elf64-alpha.c:4038
+#: elf32-ia64.c:4108 elf64-ia64.c:4108
+msgid "%B: unknown relocation type %d"
+msgstr "%B: tipo de reubicación %d desconocido"
+
+#: coff-arm.c:990 elf32-arm.c:1926
#, c-format
msgid "%B: unable to find THUMB glue '%s' for `%s'"
msgstr "%B: no se puede encontrar el pegamento THUMB '%s' para `%s'"
-#: coff-arm.c:1096 elf32-arm.c:1459
+#: coff-arm.c:1019 elf32-arm.c:1960
#, c-format
msgid "%B: unable to find ARM glue '%s' for `%s'"
msgstr "%B: no se puede encontrar el pegamento ARM '%s' para `%s'"
-#: coff-arm.c:1394 elf32-arm.c:2165
+#: coff-arm.c:1319 elf32-arm.c:2683
#, c-format
msgid ""
"%B(%s): warning: interworking not enabled.\n"
@@ -228,7 +233,7 @@ msgstr ""
"%B(%s): aviso: interoperabilidad no activada.\n"
" primer suceso: %B: llamada arm a thumb"
-#: coff-arm.c:1484
+#: coff-arm.c:1409
#, c-format
msgid ""
"%B(%s): warning: interworking not enabled.\n"
@@ -239,148 +244,148 @@ msgstr ""
" primer suceso: %B: llamada arm a thumb\n"
" considere reenlazar con --support-old-code activado"
-#: coff-arm.c:1776 cofflink.c:3013 coff-tic80.c:687
+#: coff-arm.c:1702 cofflink.c:3015 coff-tic80.c:695
msgid "%B: bad reloc address 0x%lx in section `%A'"
msgstr "%B: dirección de reubicación 0x%lx errónea en la sección `%A'"
-#: coff-arm.c:2110
+#: coff-arm.c:2028
msgid "%B: illegal symbol index in reloc: %d"
msgstr "%B: índice de símbolos ilegal en la reubicación: %d"
-#: coff-arm.c:2243
+#: coff-arm.c:2158
#, c-format
msgid "ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"
msgstr "ERROR: %B está compilado para APCS-%d, mientras que %B está compilado para APCS-%d"
-#: coff-arm.c:2259 elf32-arm.c:3583
+#: coff-arm.c:2174 elf32-arm.c:5093
#, c-format
msgid "ERROR: %B passes floats in float registers, whereas %B passes them in integer registers"
msgstr "ERROR: %B pasa números de coma flotante en registros de coma flotante, mientras que %B los pasa en registros enteros"
-#: coff-arm.c:2262 elf32-arm.c:3587
+#: coff-arm.c:2177 elf32-arm.c:5097
#, c-format
msgid "ERROR: %B passes floats in integer registers, whereas %B passes them in float registers"
msgstr "ERROR: %B pasa números de coma flotante en registros enteros, mientras que %B los pasa en registros de coma flotante"
-#: coff-arm.c:2276
+#: coff-arm.c:2191
#, c-format
msgid "ERROR: %B is compiled as position independent code, whereas target %B is absolute position"
msgstr "ERROR: %B está compilado como código independiente de posición, mientras que el objetivo %B es de posición absoluta"
-#: coff-arm.c:2279
+#: coff-arm.c:2194
#, c-format
msgid "ERROR: %B is compiled as absolute position code, whereas target %B is position independent"
msgstr "ERROR: %B está compilado como código de posición absoluta, mientras que el objetivo %B es independiente de posición"
-#: coff-arm.c:2307 elf32-arm.c:3652
+#: coff-arm.c:2222 elf32-arm.c:5162
#, c-format
msgid "Warning: %B supports interworking, whereas %B does not"
msgstr "Aviso: %B soporta interoperabilidad, mientras que %B no"
-#: coff-arm.c:2310 elf32-arm.c:3658
+#: coff-arm.c:2225 elf32-arm.c:5168
#, c-format
msgid "Warning: %B does not support interworking, whereas %B does"
msgstr "Aviso: %B no soporta interoperabilidad, mientras que %B sí"
-#: coff-arm.c:2336
+#: coff-arm.c:2249
#, c-format
msgid "private flags = %x:"
msgstr "opciones privadas = %x:"
-#: coff-arm.c:2344 elf32-arm.c:3709
+#: coff-arm.c:2257 elf32-arm.c:5219
#, c-format
msgid " [floats passed in float registers]"
msgstr "[números de coma flotante pasados en registros de coma flotante]"
-#: coff-arm.c:2346
+#: coff-arm.c:2259
#, c-format
msgid " [floats passed in integer registers]"
msgstr "[números de coma flotante pasados en registros enteros]"
-#: coff-arm.c:2349 elf32-arm.c:3712
+#: coff-arm.c:2262 elf32-arm.c:5222
#, c-format
msgid " [position independent]"
msgstr "[independiente de posición]"
-#: coff-arm.c:2351
+#: coff-arm.c:2264
#, c-format
msgid " [absolute position]"
msgstr "[posición absoluta]"
-#: coff-arm.c:2355
+#: coff-arm.c:2268
#, c-format
msgid " [interworking flag not initialised]"
msgstr "[opción de interoperabilidad no iniciada]"
-#: coff-arm.c:2357
+#: coff-arm.c:2270
#, c-format
msgid " [interworking supported]"
msgstr "[soporte para interoperabilidad]"
-#: coff-arm.c:2359
+#: coff-arm.c:2272
#, c-format
msgid " [interworking not supported]"
msgstr "[sin soporte para interoperabilidad]"
-#: coff-arm.c:2407 elf32-arm.c:3390
+#: coff-arm.c:2318 elf32-arm.c:4571
#, c-format
msgid "Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"
msgstr "Aviso: No se establece la opción de interoperabilidad de %B ya que se había especificado con anterioridad como no interoperable"
-#: coff-arm.c:2411 elf32-arm.c:3394
+#: coff-arm.c:2322 elf32-arm.c:4575
#, c-format
msgid "Warning: Clearing the interworking flag of %B due to outside request"
msgstr "Aviso: Limpiando la opción de interoperabilidad de %B debido a una petición externa"
-#: coffcode.h:859
+#: coffcode.h:849
msgid "%B: warning: COMDAT symbol '%s' does not match section name '%s'"
msgstr "%B: aviso: el símbolo COMDAT '%s' no coincide con el nombre de sección '%s'"
#. Generate a warning message rather using the 'unhandled'
#. variable as this will allow some .sys files generate by
#. other toolchains to be processed. See bugzilla issue 196.
-#: coffcode.h:1072
+#: coffcode.h:1061
msgid "%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"
msgstr "%B: Aviso: Se ignora la opción de sección IMAGE_SCN_MEM_NOT_PAGED en la sección %s"
-#: coffcode.h:1127
+#: coffcode.h:1116
msgid "%B (%s): Section flag %s (0x%x) ignored"
msgstr "%B (%s): Se ignora la opción de sección %s (0x%x)"
-#: coffcode.h:2255
+#: coffcode.h:2204
#, c-format
msgid "Unrecognized TI COFF target id '0x%x'"
msgstr "Id de objetivo TI COFF '0x%x' no reconocido"
-#: coffcode.h:4375
+#: coffcode.h:4211
msgid "%B: warning: line number table read failed"
msgstr "%B: aviso: falló la lectura de tabla de números de línea"
-#: coffcode.h:4407
+#: coffcode.h:4243
msgid "%B: warning: illegal symbol index %ld in line numbers"
msgstr "%B: aviso: índice de símbolos %ld ilegal en los números de línea"
-#: coffcode.h:4421
+#: coffcode.h:4257
msgid "%B: warning: duplicate line number information for `%s'"
msgstr "%B: aviso: información duplicada de números de línea para `%s'"
-#: coffcode.h:4771
+#: coffcode.h:4597
msgid "%B: Unrecognized storage class %d for %s symbol `%s'"
msgstr "%B: Clase de almacenamiento %d no reconocida para %s símbolo `%s'"
-#: coffcode.h:4904
+#: coffcode.h:4723
msgid "warning: %B: local symbol `%s' has no section"
msgstr "aviso: %B: el símbolo local `%s' no tiene sección"
-#: coffcode.h:5010 coff-i860.c:586 coff-tic54x.c:376
+#: coffcode.h:4827 coff-i860.c:586 coff-tic54x.c:376
msgid "%B: warning: illegal symbol index %ld in relocs"
msgstr "%B: aviso: índice de símbolos %ld ilegal en reubicaciones"
-#: coffcode.h:5048
+#: coffcode.h:4865
msgid "%B: illegal relocation type %d at address 0x%lx"
msgstr "%B: tipo de reubicación %d ilegal en la dirección 0x%lx"
-#: coffgen.c:1594
+#: coffgen.c:1511
msgid "%B: bad string table size %lu"
msgstr "%B: tamaño de tabla de cadenas %lu erróneo"
@@ -398,7 +403,7 @@ msgstr "La reubicación `%s' aún no está implementada\n"
msgid "uncertain calling convention for non-COFF symbol"
msgstr "convención de llamada incierta para un símbolo que no es COFF"
-#: cofflink.c:507 elflink.c:3955
+#: cofflink.c:507 elflink.c:3948
msgid "Warning: type of symbol `%s' changed from %d to %d in %B"
msgstr "Aviso: el tipo del símbolo `%s' cambió de %d a %d en %B"
@@ -406,17 +411,17 @@ msgstr "Aviso: el tipo del símbolo `%s' cambió de %d a %d en %B"
msgid "%B: relocs in section `%A', but it has no contents"
msgstr "%B: reubicaciones en la sección `%A', pero no tiene contenido"
-#: cofflink.c:2624 coffswap.h:890
+#: cofflink.c:2624 coffswap.h:823
#, c-format
msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
msgstr "%s: %s: desbordamiento de reubicación: 0x%lx > 0xffff"
-#: cofflink.c:2633 coffswap.h:876
+#: cofflink.c:2633 coffswap.h:809
#, 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"
-#: coff-m68k.c:482 elf32-m68k.c:2128
+#: coff-m68k.c:482 elf32-bfin.c:2722 elf32-m68k.c:2193
msgid "unsupported reloc type"
msgstr "tipo de reubicación sin soporte"
@@ -444,17 +449,21 @@ msgstr "Tipo de Reubicación no Reconocida"
msgid "GP relative relocation when _gp not defined"
msgstr "reubicación GP relativa cuando _gp no está definido"
-#: coff-rs6000.c:2783
+#: coff-or32.c:227
+msgid "Unrecognized reloc"
+msgstr "Reubicación no reconocida"
+
+#: coff-rs6000.c:2785
#, c-format
msgid "%s: unsupported relocation type 0x%02x"
msgstr "%s: tipo de reubicación 0x%02x sin soporte"
-#: coff-rs6000.c:2876
+#: coff-rs6000.c:2878
#, 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-tic4x.c:174 coff-tic54x.c:282 coff-tic80.c:450
+#: coff-tic4x.c:174 coff-tic54x.c:282 coff-tic80.c:458
#, c-format
msgid "Unrecognized reloc type 0x%x"
msgstr "Tipo de reubicación 0x%x no reconocida"
@@ -478,72 +487,76 @@ msgstr "ERROR: %B está compilado para el EP9312, mientras que %B está compilado
msgid "warning: unable to update contents of %s section in %s"
msgstr "aviso: no se puede actualizar el contenido de la sección %s en %s"
-#: dwarf2.c:296
+#: dwarf2.c:315
msgid "Dwarf Error: Can't find .debug_str section."
msgstr "Error de Dwarf: No se puede encontrar la sección .debug_str."
-#: dwarf2.c:314
+#: dwarf2.c:333
#, c-format
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:388
+#: dwarf2.c:426
msgid "Dwarf Error: Can't find .debug_abbrev section."
msgstr "Error de Dwarf: No se puede encontrar la sección .debug_abbrev."
-#: dwarf2.c:403
+#: dwarf2.c:441
#, 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:601
+#: dwarf2.c:656
#, c-format
msgid "Dwarf Error: Invalid or unhandled FORM value: %u."
msgstr "Error de Dwarf: Valor de FORM inválido o no manejado: %u."
-#: dwarf2.c:773
+#: dwarf2.c:856
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)."
-#: dwarf2.c:866
+#: dwarf2.c:947
msgid "Dwarf Error: Can't find .debug_line section."
msgstr "Error de Dwarf: No se puede encontrar lan sección .debug_line."
-#: dwarf2.c:883
+#: dwarf2.c:964
#, 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:1088
+#: dwarf2.c:1192
msgid "Dwarf Error: mangled line number section."
msgstr "Error de Dwarf: sección de números de línea revuelta."
-#: dwarf2.c:1285 dwarf2.c:1343 dwarf2.c:1498
+#: dwarf2.c:1382
+msgid "Dwarf Error: Can't find .debug_ranges section."
+msgstr "Error de Dwarf: No se puede encontrar lan sección .debug_ranges."
+
+#: dwarf2.c:1544 dwarf2.c:1660 dwarf2.c:1930
#, c-format
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:1459
+#: dwarf2.c:1891
#, c-format
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:1466
+#: dwarf2.c:1898
#, 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'."
-#: dwarf2.c:1489
+#: dwarf2.c:1921
#, c-format
msgid "Dwarf Error: Bad abbrev number: %u."
msgstr "Error de Dwarf: Número de abreviación erróneo: %u."
-#: ecoff.c:1269
+#: ecoff.c:1227
#, c-format
msgid "Unknown basic type %d"
msgstr "Tipo básico %d desconocido"
-#: ecoff.c:1529
+#: ecoff.c:1484
#, c-format
msgid ""
"\n"
@@ -552,7 +565,7 @@ msgstr ""
"\n"
" Símbolo final+1: %ld"
-#: ecoff.c:1536 ecoff.c:1539
+#: ecoff.c:1491 ecoff.c:1494
#, c-format
msgid ""
"\n"
@@ -561,7 +574,7 @@ msgstr ""
"\n"
" Primer símbolo: %ld"
-#: ecoff.c:1551
+#: ecoff.c:1506
#, c-format
msgid ""
"\n"
@@ -570,7 +583,7 @@ msgstr ""
"\n"
" Símbolo final+1: %-7ld Tipo: %s"
-#: ecoff.c:1558
+#: ecoff.c:1513
#, c-format
msgid ""
"\n"
@@ -579,7 +592,7 @@ msgstr ""
"\n"
" Símbolo local: %ld"
-#: ecoff.c:1566
+#: ecoff.c:1521
#, c-format
msgid ""
"\n"
@@ -588,7 +601,7 @@ msgstr ""
"\n"
" struct; símbolo final+1: %ld"
-#: ecoff.c:1571
+#: ecoff.c:1526
#, c-format
msgid ""
"\n"
@@ -597,7 +610,7 @@ msgstr ""
"\n"
" union; símbolo final+1: %ld"
-#: ecoff.c:1576
+#: ecoff.c:1531
#, c-format
msgid ""
"\n"
@@ -606,7 +619,7 @@ msgstr ""
"\n"
" enum; símbolo final+1: %ld"
-#: ecoff.c:1582
+#: ecoff.c:1537
#, c-format
msgid ""
"\n"
@@ -615,16 +628,16 @@ msgstr ""
"\n"
" Tipo: %s"
-#: elf32-arm.c:1794
+#: elf32-arm.c:2315
msgid "%B: BE8 images only valid in big-endian mode."
msgstr "%B: las imágenes BE8 sólo son válidas en modo big-endian."
-#: elf32-arm.c:1953
+#: elf32-arm.c:2471
#, c-format
msgid "Invalid TARGET2 relocation type '%s'."
msgstr "Tipo de reubicación TARGET2 '%s' inválido."
-#: elf32-arm.c:2060
+#: elf32-arm.c:2578
msgid ""
"%B(%s): warning: interworking not enabled.\n"
" first occurrence: %B: thumb call to arm"
@@ -632,212 +645,298 @@ msgstr ""
"%s(%s): aviso: interoperabilidad no activada.\n"
" primer suceso: %B: llamada thumb para arm"
-#: elf32-arm.c:2476
+#: elf32-arm.c:3044
msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'."
msgstr "\\%B: Aviso: La instrucción Arm BLX apunta a la función Arm '%s'."
-#: elf32-arm.c:2665
+#: elf32-arm.c:3227
msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'."
msgstr "%B: Aviso: La instrucción Thumb BLX apunta a la función thumb '%s'."
-#: elf32-arm.c:3185 elf32-sh.c:4610 elf64-sh64.c:1537
+#: elf32-arm.c:3889
+msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object"
+msgstr "%B(%A+0x%lx): la reubicación R_ARM_TLS_LE32 no se permite en objetos compartidos"
+
+#: elf32-arm.c:4290 elf32-sh.c:4618 elf64-sh64.c:1537
msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section"
msgstr "%B(%A+0x%lx): reubicación %s contra la sección SEC_MERGE"
-#: elf32-arm.c:3277
-msgid "%B(%A): warning: unresolvable relocation %d against symbol `%s'"
-msgstr "%B(%A): aviso: reubicación %d sin resolución contra el símbolo `%s'"
+#: elf32-arm.c:4351 elf64-ppc.c:9672
+msgid "%B(%A+0x%lx): %s used with TLS symbol %s"
+msgstr "%B(%A+0x%lx): se usó %s con el símbolo TLS %s"
-#: elf32-arm.c:3329 elf32-avr.c:875 elf32-cr16c.c:773 elf32-cris.c:1502
-#: elf32-crx.c:911 elf32-d10v.c:564 elf32-fr30.c:595 elf32-frv.c:4107
-#: elf32-h8300.c:494 elf32-i860.c:1189 elf32-ip2k.c:1550 elf32-iq2000.c:611
-#: elf32-m32r.c:3250 elf32-m68hc1x.c:1189 elf32-msp430.c:503
-#: elf32-openrisc.c:415 elf32-v850.c:1749 elf32-xstormy16.c:954
-#: elf64-mmix.c:1517 elf-m10200.c:427 elf-m10300.c:1527
+#: elf32-arm.c:4352 elf64-ppc.c:9673
+msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s"
+msgstr "%B(%A+0x%lx): se usó %s con el símbolo %s que no es TLS"
+
+#: elf32-arm.c:4375 elf32-i386.c:3038 elf32-m32r.c:2653 elf32-m68k.c:1737
+#: elf32-ppc.c:6561 elf32-s390.c:3012 elf32-sh.c:4717 elf32-xtensa.c:2311
+#: elf64-ppc.c:10825 elf64-s390.c:3010 elf64-sh64.c:1626 elf64-x86-64.c:2522
+#: elf-hppa.h:1413 elf-m10300.c:1460 elfxx-sparc.c:3137
+msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
+msgstr "%B(%A+0x%lx): reubicación %s sin resolución contra el símbolo `%s'"
+
+#: elf32-arm.c:4411 elf32-avr.c:880 elf32-cr16c.c:773 elf32-cris.c:1502
+#: elf32-crx.c:911 elf32-d10v.c:536 elf32-fr30.c:595 elf32-frv.c:4107
+#: elf32-h8300.c:494 elf32-i860.c:1189 elf32-ip2k.c:1474 elf32-iq2000.c:616
+#: elf32-m32c.c:465 elf32-m32r.c:3111 elf32-m68hc1x.c:1194 elf32-ms1.c:373
+#: elf32-msp430.c:508 elf32-openrisc.c:383 elf32-v850.c:1672
+#: elf32-xstormy16.c:909 elf64-mmix.c:1517 elf-m10200.c:427 elf-m10300.c:1509
msgid "internal error: out of range error"
msgstr "error interno: error fuera de rango"
-#: elf32-arm.c:3333 elf32-avr.c:879 elf32-cr16c.c:777 elf32-cris.c:1506
-#: elf32-crx.c:915 elf32-d10v.c:568 elf32-fr30.c:599 elf32-frv.c:4111
-#: elf32-h8300.c:498 elf32-i860.c:1193 elf32-iq2000.c:615 elf32-m32r.c:3254
-#: elf32-m68hc1x.c:1193 elf32-msp430.c:507 elf32-openrisc.c:419
-#: elf32-v850.c:1753 elf32-xstormy16.c:958 elf64-mmix.c:1521 elf-m10200.c:431
-#: elf-m10300.c:1531 elfxx-mips.c:7179
+#: elf32-arm.c:4415 elf32-avr.c:884 elf32-cr16c.c:777 elf32-cris.c:1506
+#: elf32-crx.c:915 elf32-d10v.c:540 elf32-fr30.c:599 elf32-frv.c:4111
+#: elf32-h8300.c:498 elf32-i860.c:1193 elf32-iq2000.c:620 elf32-m32c.c:469
+#: elf32-m32r.c:3115 elf32-m68hc1x.c:1198 elf32-msp430.c:512
+#: elf32-openrisc.c:387 elf32-v850.c:1676 elf32-xstormy16.c:913
+#: elf64-mmix.c:1521 elf-m10200.c:431 elf-m10300.c:1513 elfxx-mips.c:7212
msgid "internal error: unsupported relocation error"
msgstr "error interno: error de reubicación sin soporte"
-#: elf32-arm.c:3337 elf32-cr16c.c:781 elf32-crx.c:919 elf32-d10v.c:572
-#: elf32-h8300.c:502 elf32-m32r.c:3258 elf32-m68hc1x.c:1197 elf-m10200.c:435
-#: elf-m10300.c:1535
+#: elf32-arm.c:4419 elf32-cr16c.c:781 elf32-crx.c:919 elf32-d10v.c:544
+#: elf32-h8300.c:502 elf32-m32r.c:3119 elf32-m68hc1x.c:1202 elf-m10200.c:435
+#: elf-m10300.c:1517
msgid "internal error: dangerous error"
msgstr "error interno: error peligroso"
-#: elf32-arm.c:3341 elf32-avr.c:887 elf32-cr16c.c:785 elf32-cris.c:1514
-#: elf32-crx.c:923 elf32-d10v.c:576 elf32-fr30.c:607 elf32-frv.c:4119
-#: elf32-h8300.c:506 elf32-i860.c:1201 elf32-ip2k.c:1565 elf32-iq2000.c:623
-#: elf32-m32r.c:3262 elf32-m68hc1x.c:1201 elf32-msp430.c:515
-#: elf32-openrisc.c:427 elf32-v850.c:1773 elf32-xstormy16.c:966
-#: elf64-mmix.c:1529 elf-m10200.c:439 elf-m10300.c:1539
+#: elf32-arm.c:4423 elf32-avr.c:892 elf32-cr16c.c:785 elf32-cris.c:1514
+#: elf32-crx.c:923 elf32-d10v.c:548 elf32-fr30.c:607 elf32-frv.c:4119
+#: elf32-h8300.c:506 elf32-i860.c:1201 elf32-ip2k.c:1489 elf32-iq2000.c:628
+#: elf32-m32c.c:477 elf32-m32r.c:3123 elf32-m68hc1x.c:1206 elf32-ms1.c:381
+#: elf32-msp430.c:520 elf32-openrisc.c:395 elf32-v850.c:1696
+#: elf32-xstormy16.c:921 elf64-mmix.c:1529 elf-m10200.c:439 elf-m10300.c:1521
msgid "internal error: unknown error"
msgstr "error interno: error desconocido"
-#: elf32-arm.c:3440
+#: elf32-arm.c:4664
msgid "Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"
msgstr "Aviso: Limpiando la opción de interoperación en %B porque se ha enlazado con él código no interoperable en %B"
-#: elf32-arm.c:3559
+#: elf32-arm.c:4751
+msgid "ERROR: %B uses VFP register arguments, %B does not"
+msgstr "ERROR: %B utiliza argumentos de registro VFP, mientras que %B no"
+
+#: elf32-arm.c:4798
+msgid "ERROR: %B: Conflicting architecture profiles %c/%c"
+msgstr "ERROR: %B: Perfiles de arquitecturas en conflicto %c/%c"
+
+#: elf32-arm.c:4813
+msgid "Warning: %B: Conflicting platform configuration"
+msgstr "Aviso: %B: Configuración de plataformas en conflicto"
+
+#: elf32-arm.c:4821
+msgid "ERROR: %B: Conflicting use of R9"
+msgstr "ERROR: %B: Uso en conflicto de R9"
+
+#: elf32-arm.c:4833
+msgid "ERROR: %B: SB relative addressing conflicts with use of R9"
+msgstr "ERROR: %B: El direccionamiento relativo a SB tiene conflictos con el uso de R9"
+
+#: elf32-arm.c:4855
+msgid "ERROR: %B: Conflicting definitions of wchar_t"
+msgstr "ERROR: %B: Definiciones en conflicto de wchar_t"
+
+#: elf32-arm.c:4881
+msgid "ERROR: %B: Conflicting enum sizes"
+msgstr "ERROR: %B: Tamaños de enum en conflicto"
+
+#: elf32-arm.c:4892
+msgid "ERROR: %B uses iWMMXt register arguments, %B does not"
+msgstr "ERROR: %B utiliza argumentos de registro iWMMXt, mientras que %B no"
+
+#: elf32-arm.c:4912
+msgid "ERROR: %B: Must be processed by '%s' toolchain"
+msgstr "ERROR: %B: Se debe procesar por la cadena de compilación '%s'"
+
+#: elf32-arm.c:4932 elf32-arm.c:4951
+msgid "ERROR: %B: Incompatible object tag '%s':%d"
+msgstr "ERROR: %B: Etiqueta de objeto '%s' incompatible:%d"
+
+#: elf32-arm.c:4961
+msgid "Warning: %B: Unknown EABI object attribute %d"
+msgstr "Aviso: %B: Atributo de objeto EABI %d desconocido"
+
+#: elf32-arm.c:5069
msgid "ERROR: Source object %B has EABI version %d, but target %B has EABI version %d"
msgstr "ERROR: El objeto fuente %B tiene EABI versión %d, pero el objetivo %B tiene EABI versión %d"
-#: elf32-arm.c:3572
+#: elf32-arm.c:5082
msgid "ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"
msgstr "ERROR: %B está compilado para APCS-%d mientras que el objetivo %B usa APCS-%d"
-#: elf32-arm.c:3597
+#: elf32-arm.c:5107
msgid "ERROR: %B uses VFP instructions, whereas %B does not"
msgstr "ERROR: %B utiliza instrucciones VFP, mientras que %B no"
-#: elf32-arm.c:3601
+#: elf32-arm.c:5111
msgid "ERROR: %B uses FPA instructions, whereas %B does not"
msgstr "ERROR: %B utiliza instrucciones FPA, mientras que %B no"
-#: elf32-arm.c:3611
+#: elf32-arm.c:5121
msgid "ERROR: %B uses Maverick instructions, whereas %B does not"
msgstr "ERROR: %B utiliza instrucciones Maverick, mientras que %B no"
-#: elf32-arm.c:3615
+#: elf32-arm.c:5125
msgid "ERROR: %B does not use Maverick instructions, whereas %B does"
msgstr "ERROR: %B no utiliza instrucciones Maverick, mientras que %B sí"
-#: elf32-arm.c:3634
+#: elf32-arm.c:5144
msgid "ERROR: %B uses software FP, whereas %B uses hardware FP"
msgstr "ERROR: %B utiliza FP de software, mientras que %B utiliza FP de hardware"
-#: elf32-arm.c:3638
+#: elf32-arm.c:5148
msgid "ERROR: %B uses hardware FP, whereas %B uses software FP"
msgstr "ERROR: %B utiliza FP de hardware, mientras que %B utiliza FP de software"
#. Ignore init flag - it may not be set, despite the flags field
#. containing valid data.
#. Ignore init flag - it may not be set, despite the flags field containing valid data.
-#: elf32-arm.c:3685 elf32-cris.c:3243 elf32-m68hc1x.c:1333 elf32-m68k.c:397
-#: elf32-vax.c:546 elfxx-mips.c:9846
+#: elf32-arm.c:5195 elf32-bfin.c:2164 elf32-cris.c:3243 elf32-m68hc1x.c:1338
+#: elf32-m68k.c:428 elf32-vax.c:528 elfxx-mips.c:9933
#, c-format
msgid "private flags = %lx:"
msgstr "opciones privadas = %lx:"
-#: elf32-arm.c:3694
+#: elf32-arm.c:5204
#, c-format
msgid " [interworking enabled]"
msgstr " [interoperabilidad activada]"
-#: elf32-arm.c:3702
+#: elf32-arm.c:5212
#, c-format
msgid " [VFP float format]"
msgstr " [formato de coma flotante VFP]"
-#: elf32-arm.c:3704
+#: elf32-arm.c:5214
#, c-format
msgid " [Maverick float format]"
msgstr " [formato de coma flotante Maverick]"
-#: elf32-arm.c:3706
+#: elf32-arm.c:5216
#, c-format
msgid " [FPA float format]"
msgstr " [formato de coma flotante FPA]"
-#: elf32-arm.c:3715
+#: elf32-arm.c:5225
#, c-format
msgid " [new ABI]"
msgstr " [ABI nuevo]"
-#: elf32-arm.c:3718
+#: elf32-arm.c:5228
#, c-format
msgid " [old ABI]"
msgstr " [ABI antiguo]"
-#: elf32-arm.c:3721
+#: elf32-arm.c:5231
#, c-format
msgid " [software FP]"
msgstr " [FP por software]"
-#: elf32-arm.c:3730
+#: elf32-arm.c:5240
#, c-format
msgid " [Version1 EABI]"
msgstr " [EABI Version1]"
-#: elf32-arm.c:3733 elf32-arm.c:3744
+#: elf32-arm.c:5243 elf32-arm.c:5254
#, c-format
msgid " [sorted symbol table]"
msgstr " [tabla de símbolos ordenados]"
-#: elf32-arm.c:3735 elf32-arm.c:3746
+#: elf32-arm.c:5245 elf32-arm.c:5256
#, c-format
msgid " [unsorted symbol table]"
msgstr " [tabla de símbolos sin ordenar]"
-#: elf32-arm.c:3741
+#: elf32-arm.c:5251
#, c-format
msgid " [Version2 EABI]"
msgstr " [EABI Version2]"
-#: elf32-arm.c:3749
+#: elf32-arm.c:5259
#, c-format
msgid " [dynamic symbols use segment index]"
msgstr " [los símbolos dinámicos utilizan índices de segmento]"
-#: elf32-arm.c:3752
+#: elf32-arm.c:5262
#, c-format
msgid " [mapping symbols precede others]"
msgstr " [el mapeo de símbolos precede a otros]"
-#: elf32-arm.c:3759
+#: elf32-arm.c:5269
#, c-format
msgid " [Version3 EABI]"
msgstr " [EABI Version3]"
-#: elf32-arm.c:3763
+#: elf32-arm.c:5273
#, c-format
msgid " [Version4 EABI]"
msgstr " [EABI Version4]"
-#: elf32-arm.c:3766
+#: elf32-arm.c:5276
#, c-format
msgid " [BE8]"
msgstr " [BE8]"
-#: elf32-arm.c:3769
+#: elf32-arm.c:5279
#, c-format
msgid " [LE8]"
msgstr " [LE8]"
-#: elf32-arm.c:3775
+#: elf32-arm.c:5285
#, c-format
msgid " <EABI version unrecognised>"
msgstr " <versión de EABI no reconocida>"
-#: elf32-arm.c:3782
+#: elf32-arm.c:5292
#, c-format
msgid " [relocatable executable]"
msgstr " [ejecutable reubicable]"
-#: elf32-arm.c:3785
+#: elf32-arm.c:5295
#, c-format
msgid " [has entry point]"
msgstr " [tiene punto de entrada]"
-#: elf32-arm.c:3790
+#: elf32-arm.c:5300
#, c-format
msgid "<Unrecognised flag bits set>"
msgstr "<Conjunto de bits de opción no reconocidos>"
-#: elf32-avr.c:883 elf32-cris.c:1510 elf32-fr30.c:603 elf32-frv.c:4115
-#: elf32-i860.c:1197 elf32-ip2k.c:1561 elf32-iq2000.c:619 elf32-msp430.c:511
-#: elf32-openrisc.c:423 elf32-v850.c:1757 elf32-xstormy16.c:962
-#: elf64-mmix.c:1525
+#: elf32-arm.c:5536 elf32-i386.c:902 elf32-s390.c:989 elf32-xtensa.c:784
+#: elf64-s390.c:942 elf64-x86-64.c:666 elfxx-sparc.c:1016
+msgid "%B: bad symbol index: %d"
+msgstr "%B: índice de símbolos erróneo: %d"
+
+#: elf32-arm.c:6023 elf32-cris.c:2385 elf32-hppa.c:1813 elf32-i370.c:491
+#: elf32-i386.c:1465 elf32-m32r.c:1913 elf32-m68k.c:1088 elf32-ppc.c:4145
+#: elf32-s390.c:1686 elf32-sh.c:3920 elf32-vax.c:1059 elf64-ppc.c:5717
+#: elf64-s390.c:1659 elf64-sh64.c:3442 elf64-x86-64.c:1252 elf-m10300.c:4107
+#: elfxx-sparc.c:1720
+#, c-format
+msgid "dynamic variable `%s' is zero size"
+msgstr "la variable dinámica `%s' es de tamaño cero"
+
+#: elf32-avr.c:888 elf32-cris.c:1510 elf32-fr30.c:603 elf32-frv.c:4115
+#: elf32-i860.c:1197 elf32-ip2k.c:1485 elf32-iq2000.c:624 elf32-m32c.c:473
+#: elf32-ms1.c:377 elf32-msp430.c:516 elf32-openrisc.c:391 elf32-v850.c:1680
+#: elf32-xstormy16.c:917 elf64-mmix.c:1525
msgid "internal error: dangerous relocation"
msgstr "error interno: reubicación peligrosa"
+#: elf32-bfin.c:96
+msgid "Division by zero. "
+msgstr "División por cero. "
+
+#: elf32-bfin.c:1958
+msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
+msgstr "%B(%A+0x%lx): reubicación sin resolución contra el símbolo `%s'"
+
+#: elf32-bfin.c:1991 elf32-i386.c:3079 elf32-m68k.c:1778 elf32-s390.c:3064
+#: elf64-s390.c:3062 elf64-x86-64.c:2567
+msgid "%B(%A+0x%lx): reloc against `%s': error %d"
+msgstr "%B(%A+0x%lx): reubicación contra `%s': error %d"
+
#: elf32-cris.c:1050
msgid "%B, section %A: unresolvable relocation %s against symbol `%s'"
msgstr "%B, sección %A: reubicación %s sin resolución contra el símbolo `%s'"
@@ -874,7 +973,7 @@ msgstr "%B, sección %A: la reubicación %s sin GOT creado"
msgid "%B: Internal inconsistency; no relocation section %s"
msgstr "%B: Inconsistencia interna; no se encuentra la sección de reubicación %s"
-#: elf32-cris.c:2507
+#: elf32-cris.c:2520
msgid ""
"%B, section %A:\n"
" v10/v32 compatible object %s must not contain a PIC relocation"
@@ -882,7 +981,7 @@ msgstr ""
"%B, sección %A:\n"
" el objeto %s compatible con v10/v32 no debe contener una reubicación PIC"
-#: elf32-cris.c:2694 elf32-cris.c:2762
+#: elf32-cris.c:2707 elf32-cris.c:2775
msgid ""
"%B, section %A:\n"
" relocation %s should not be used in a shared object; recompile with -fPIC"
@@ -1009,276 +1108,251 @@ msgstr "%B(%A+0x%lx): reubicación contra `%s': %s"
msgid "relocation references a different segment"
msgstr "la reubicación referencía un segmento diferente"
-#: elf32-frv.c:6344
+#: elf32-frv.c:6324
msgid "%B: unsupported relocation type %i"
msgstr "%B: tipo de reubicación %i sin soporte"
-#: elf32-frv.c:6662
+#: elf32-frv.c:6642
#, 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:6715 elf32-iq2000.c:796
+#: elf32-frv.c:6695 elf32-iq2000.c:801 elf32-m32c.c:785
#, 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:6727
+#: elf32-frv.c:6707
#, 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:6748
+#: elf32-frv.c:6728
#, c-format
msgid "%s: cannot link non-fdpic object file into fdpic executable"
msgstr "%s: enlazando código que no es fdpic en un ejecutable fdpic"
-#: elf32-frv.c:6752
+#: elf32-frv.c:6732
#, c-format
msgid "%s: cannot link fdpic object file into non-fdpic executable"
msgstr "%s: enlazando código fdpic en un ejecutable que no es fdpic"
-#: elf32-frv.c:6777 elf32-iq2000.c:833
+#: elf32-frv.c:6757 elf32-iq2000.c:838 elf32-m32c.c:821 elf32-ms1.c:596
#, c-format
msgid "private flags = 0x%lx:"
msgstr "opciones privadas = 0x%lx:"
-#: elf32-gen.c:83 elf64-gen.c:83
+#: elf32-gen.c:68 elf64-gen.c:68
msgid "%B: Relocations in generic ELF (EM: %d)"
msgstr "%B: Reubicaciones en ELF genérico (EM: %d)"
-#: elf32-hppa.c:542 elf32-m68hc1x.c:161 elf64-ppc.c:3644
+#: elf32-hppa.c:569 elf32-m68hc1x.c:161 elf64-ppc.c:3660
msgid "%B: cannot create stub entry %s"
msgstr "%B: no se puede crear la entrada de cabo %s"
-#: elf32-hppa.c:795 elf32-hppa.c:3359
+#: elf32-hppa.c:822 elf32-hppa.c:3411
msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"
msgstr "%B(%A+0x%lx): no se puede alcanzar %s, recompile con -ffuntion-sections"
-#: elf32-hppa.c:1176
+#: elf32-hppa.c:1212
msgid "%B: relocation %s can not be used when making a shared object; recompile with -fPIC"
msgstr "%B: no se puede usar la reubicación %s cuando se hace un objeto compartido; recompile con -fPIC"
-#: elf32-hppa.c:1370
+#: elf32-hppa.c:1405
#, 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:2623
+#: elf32-hppa.c:2677
msgid "%B: duplicate export stub %s"
msgstr "%B: cabo de exportación %s duplicado"
-#: elf32-hppa.c:3214
+#: elf32-hppa.c:3266
msgid "%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
msgstr "%B(%A+0x%lx): la compostura %s para la insn 0x%x no tiene soporte en un enlazado que no es compartido"
-#: elf32-hppa.c:3844
+#: elf32-hppa.c:3895
msgid "%B(%A+0x%lx): cannot handle %s for %s"
msgstr "%B(%A+0x%lx): no se puede manejar %s para %s"
-#: elf32-hppa.c:4137
+#: elf32-hppa.c:4189
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:326
+#: elf32-i386.c:327 elf32-s390.c:368 elf64-ppc.c:2124 elf64-s390.c:390
+#: elf64-x86-64.c:204
msgid "%B: invalid relocation type %d"
msgstr "%B: tipo de reubicación %d inválido"
-#: elf32-i386.c:865 elf32-s390.c:985 elf32-sparc.c:910 elf32-xtensa.c:788
-#: elf64-s390.c:938 elf64-x86-64.c:646
-msgid "%B: bad symbol index: %d"
-msgstr "%B: índice de símbolos erróneo: %d"
-
-#: elf32-i386.c:973 elf32-s390.c:1162 elf32-sh.c:6388 elf32-sparc.c:1033
-#: elf64-s390.c:1124
+#: elf32-i386.c:1015 elf32-s390.c:1171 elf32-sh.c:6389 elf64-s390.c:1133
+#: elfxx-sparc.c:1144
msgid "%B: `%s' accessed both as normal and thread local symbol"
msgstr "%B: se accesó `%s' como un símbolo normal y un símbolo local de hilo"
-#: elf32-i386.c:1088 elf32-s390.c:1271 elf64-ppc.c:4676 elf64-s390.c:1236
-#: elf64-x86-64.c:882
+#: elf32-i386.c:1130 elf32-s390.c:1280 elf64-ppc.c:4731 elf64-s390.c:1245
+#: elf64-x86-64.c:910
msgid "%B: bad relocation section name `%s'"
msgstr "%B: nombre de sección de reubicación `%s' erróneo"
-#: elf32-i386.c:2043
+#: elf32-i386.c:2149
msgid "%B: unrecognized relocation (0x%x) in section `%A'"
msgstr "%B: no se reconoce la dirección de reubicación (0x%lx) en la sección `%A'"
-#: elf32-i386.c:2287
+#: elf32-i386.c:2409
msgid "%B: relocation R_386_GOTOFF against protected function `%s' can not be used when making a shared object"
msgstr "%B: no se puede usar la reubicación R_386_GOTOFF contra la función protegida `%s' cuando se hace un objeto compartido"
-#: elf32-i386.c:2931 elf32-m68k.c:1700 elf32-s390.c:2993 elf32-sparc.c:2859
-#: elf32-xtensa.c:2321 elf64-s390.c:2990 elf64-sparc.c:2684
-#: elf64-x86-64.c:2438
-msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
-msgstr "%B(%A+0x%lx): reubicación sin resolución contra el símbolo `%s'"
-
-#: elf32-i386.c:2971 elf32-m68k.c:1740 elf32-s390.c:3044 elf64-s390.c:3041
-#: elf64-x86-64.c:2482
-msgid "%B(%A+0x%lx): reloc against `%s': error %d"
-msgstr "%B(%A+0x%lx): reubicación contra `%s': error %d"
-
-#: elf32-ip2k.c:557 elf32-ip2k.c:563 elf32-ip2k.c:726 elf32-ip2k.c:732
+#: elf32-ip2k.c:853 elf32-ip2k.c:859 elf32-ip2k.c:926 elf32-ip2k.c:932
msgid "ip2k relaxer: switch table without complete matching relocation information."
msgstr "relajador ip2k: tabla switch sin información completa de reubicación de coincidencias."
-#: elf32-ip2k.c:580 elf32-ip2k.c:759
+#: elf32-ip2k.c:876 elf32-ip2k.c:959
msgid "ip2k relaxer: switch table header corrupt."
msgstr "relajador ip2k: encabezado de tabla switch corrupto."
-#: elf32-ip2k.c:1377
+#: elf32-ip2k.c:1301
#, c-format
msgid "ip2k linker: missing page instruction at 0x%08lx (dest = 0x%08lx)."
msgstr "enlazador ip2k: instrucción de página faltante en 0x%08lx (dest = 0x%08lx)."
-#: elf32-ip2k.c:1391
+#: elf32-ip2k.c:1317
#, c-format
msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)."
msgstr "enlazador ip2k: instrucción de página redundante en 0x%08lx (dest = 0x%08lx)."
#. Only if it's not an unresolved symbol.
-#: elf32-ip2k.c:1557
+#: elf32-ip2k.c:1481
msgid "unsupported relocation between data/insn address spaces"
msgstr "reubicación sin soporte entre espacios de direcciones datos/insn"
-#: elf32-iq2000.c:809
+#: elf32-iq2000.c:814 elf32-m32c.c:797
#, 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-m32r.c:1530
+#: elf32-m32r.c:1436
msgid "SDA relocation when _SDA_BASE_ not defined"
msgstr "reubicación SDA cuando _SDA_BASE_ no está definido"
-#: elf32-m32r.c:2604 elf64-alpha.c:4181 elf64-alpha.c:4307 elf32-ia64.c:3910
-#: elf64-ia64.c:3910
-msgid "%B: unknown relocation type %d"
-msgstr "%B: tipo de reubicación %d desconocido"
-
-#: elf32-m32r.c:2789 elf64-sh64.c:1626 elf-m10300.c:1481
-#, 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"
-
-#: elf32-m32r.c:3187
+#: elf32-m32r.c:3048
msgid "%B: The target (%s) of an %s relocation is in the wrong section (%A)"
msgstr "%B: El objetivo (%s) de una reubicación %s está en la sección errónea (%A)"
-#: elf32-m32r.c:3719
+#: elf32-m32r.c:3576
msgid "%B: Instruction set mismatch with previous modules"
msgstr "%B: Conjunto de instrucciones no coincidente con módulos previos"
-#: elf32-m32r.c:3741
+#: elf32-m32r.c:3597
#, c-format
msgid "private flags = %lx"
msgstr "opciones privadas = %lx"
-#: elf32-m32r.c:3746
+#: elf32-m32r.c:3602
#, c-format
msgid ": m32r instructions"
msgstr ": instrucciones m32r"
-#: elf32-m32r.c:3747
+#: elf32-m32r.c:3603
#, c-format
msgid ": m32rx instructions"
msgstr ": instrucciones m32rx"
-#: elf32-m32r.c:3748
+#: elf32-m32r.c:3604
#, c-format
msgid ": m32r2 instructions"
msgstr ": instrucciones m32r2"
-#: elf32-m68hc1x.c:1101
+#: elf32-m68hc1x.c:1106
#, c-format
msgid "Reference to the far symbol `%s' using a wrong relocation may result in incorrect execution"
msgstr "Una referencia al símbolo far `%s' usando una reubicación incorrecta puede resultar en una ejecución incorrecta"
-#: elf32-m68hc1x.c:1124
+#: elf32-m68hc1x.c:1129
#, c-format
msgid "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked address [%lx:%04lx] (%lx)"
msgstr "la dirección almacenada [%lx:%04lx] (%lx) no está en el mismo banco que la dirección almacenada actual [%lx:%04lx] (%lx)"
-#: elf32-m68hc1x.c:1143
+#: elf32-m68hc1x.c:1148
#, c-format
msgid "reference to a banked address [%lx:%04lx] in the normal address space at %04lx"
msgstr "referencia a una dirección almacenada [%lx:%04lx] en el espacio normal de direcciones en %04lx"
-#: elf32-m68hc1x.c:1276
+#: elf32-m68hc1x.c:1281
msgid "%B: linking files compiled for 16-bit integers (-mshort) and others for 32-bit integers"
msgstr "%B: enlazando ficheros compilados con enteros de 16-bit (-mshort) y otros con enteros de 32-bit"
-#: elf32-m68hc1x.c:1283
+#: elf32-m68hc1x.c:1288
msgid "%B: linking files compiled for 32-bit double (-fshort-double) and others for 64-bit double"
msgstr "%B: enlazando ficheros compilados con dobles de 32-bit (-fshort-double) y otros con dobles de 64-bit"
-#: elf32-m68hc1x.c:1292
+#: elf32-m68hc1x.c:1297
msgid "%B: linking files compiled for HCS12 with others compiled for HC12"
msgstr "%B: enlazando ficheros compilados para HCS12, con otros compilados para HC12"
-#: elf32-m68hc1x.c:1308 elf32-ppc.c:2298 elf64-sparc.c:3090 elfxx-mips.c:9807
+#: elf32-m68hc1x.c:1313 elf32-ppc.c:3576 elf64-sparc.c:696 elfxx-mips.c:9894
msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
msgstr "%B: usa campos de e_flags diferentes (0x%lx) que los módulos previos (0x%lx)"
-#: elf32-m68hc1x.c:1336
+#: elf32-m68hc1x.c:1341
#, c-format
msgid "[abi=32-bit int, "
msgstr "[abi=int de 32-bit, "
-#: elf32-m68hc1x.c:1338
+#: elf32-m68hc1x.c:1343
#, c-format
msgid "[abi=16-bit int, "
msgstr "[abi=int de 16-bit, "
-#: elf32-m68hc1x.c:1341
+#: elf32-m68hc1x.c:1346
#, c-format
msgid "64-bit double, "
msgstr "doble de 64-bit, "
-#: elf32-m68hc1x.c:1343
+#: elf32-m68hc1x.c:1348
#, c-format
msgid "32-bit double, "
msgstr "doble de 32-bit, "
-#: elf32-m68hc1x.c:1346
+#: elf32-m68hc1x.c:1351
#, c-format
msgid "cpu=HC11]"
msgstr "cpu=HC11]"
-#: elf32-m68hc1x.c:1348
+#: elf32-m68hc1x.c:1353
#, c-format
msgid "cpu=HCS12]"
msgstr "cpu=HCS12]"
-#: elf32-m68hc1x.c:1350
+#: elf32-m68hc1x.c:1355
#, c-format
msgid "cpu=HC12]"
msgstr "cpu=HC12]"
-#: elf32-m68hc1x.c:1353
+#: elf32-m68hc1x.c:1358
#, c-format
msgid " [memory=bank-model]"
msgstr " [memoria=modelo de bancos]"
-#: elf32-m68hc1x.c:1355
+#: elf32-m68hc1x.c:1360
#, c-format
msgid " [memory=flat]"
msgstr " [memoria=plana]"
-#: elf32-m68k.c:400
+#: elf32-m68k.c:431
#, c-format
msgid " [cpu32]"
msgstr " [cpu32]"
-#: elf32-m68k.c:403
+#: elf32-m68k.c:434
#, c-format
msgid " [m68000]"
msgstr " [m68000]"
-#: elf32-mcore.c:353 elf32-mcore.c:455
+#: elf32-mcore.c:98 elf32-mcore.c:428
msgid "%B: Relocation %s (%d) is not currently supported.\n"
msgstr "%B: La reubicación %s (%d) actualmente no tiene soporte.\n"
-#: elf32-mcore.c:441
+#: elf32-mcore.c:414
msgid "%B: Unknown relocation type %d\n"
msgstr "%B: Tipo de reubicación %d desconocido\n"
@@ -1295,128 +1369,124 @@ msgstr "la reubicación gp relativa de 32bits sucede para un símbolo externo"
msgid "Linking mips16 objects into %s format is not supported"
msgstr "Enlazar objetos mips16 en el formato %s no tiene soporte"
-#: elf32-ppc.c:2181
+#: elf32-ppc.c:1652
#, c-format
msgid "generic linker can't handle %s"
msgstr "el enlazador genérico no puede manejar %s"
-#: elf32-ppc.c:2263
-msgid "%B: compiled with -mrelocatable and linked with modules compiled normally"
-msgstr "%B: compilado con -mrelocatable y enlazado con módulos compilados de forma normal"
+#: elf32-ppc.c:2080
+msgid "corrupt or empty %s section in %B"
+msgstr "sección %s corrupta o vacía en %B"
-#: elf32-ppc.c:2271
-msgid "%B: compiled normally and linked with modules compiled with -mrelocatable"
-msgstr "%B: compilado de forma normal y enlazado con módulos compilados con -mrelocatable"
+#: elf32-ppc.c:2087
+msgid "unable to read in %s section from %B"
+msgstr "no se puede leer en la sección %s desde %B"
+
+#: elf32-ppc.c:2093
+msgid "corrupt %s section in %B"
+msgstr "sección %s corrupta en %B"
+
+#: elf32-ppc.c:2136
+msgid "warning: unable to set size of %s section in %B"
+msgstr "aviso: no se puede establecer el tamaño de la sección %s en %B"
+
+#: elf32-ppc.c:2183
+msgid "failed to allocate space for new APUinfo section."
+msgstr "no se puede reservar espacio para la nueva sección APUinfo."
+
+#: elf32-ppc.c:2202
+msgid "failed to compute new APUinfo section."
+msgstr "no se puede calcular la nueva sección APUinfo."
+
+#: elf32-ppc.c:2205
+msgid "failed to install new APUinfo section."
+msgstr "no se puede instalar la nueva sección APUinfo."
-#: elf32-ppc.c:3526
+#: elf32-ppc.c:2941
msgid "%B: relocation %s cannot be used when making a shared object"
msgstr "%B: no se puede usar la reubicación %s cuando se hace un objeto compartido"
#. It does not make sense to have a procedure linkage
#. table entry for a local symbol.
-#: elf32-ppc.c:3731
+#: elf32-ppc.c:3211
msgid "%B(%A+0x%lx): %s reloc against local symbol"
msgstr "%B(%A+0x%lx): reubicación %s contra un símbolo local"
-#: elf32-ppc.c:4935 elf64-ppc.c:9967
+#: elf32-ppc.c:3541
+msgid "%B: compiled with -mrelocatable and linked with modules compiled normally"
+msgstr "%B: compilado con -mrelocatable y enlazado con módulos compilados de forma normal"
+
+#: elf32-ppc.c:3549
+msgid "%B: compiled normally and linked with modules compiled with -mrelocatable"
+msgstr "%B: compilado de forma normal y enlazado con módulos compilados con -mrelocatable"
+
+#: elf32-ppc.c:5768 elf64-ppc.c:10186
msgid "%B: unknown relocation type %d for symbol %s"
msgstr "%B: tipo de reubicación %d desconocido para el símbolo %s"
-#: elf32-ppc.c:5184
+#: elf32-ppc.c:6018
msgid "%B(%A+0x%lx): non-zero addend on %s reloc against `%s'"
msgstr "%B(%A+0x%lx): adición que no es cero en la reubicación %s contra `%s'"
-#: elf32-ppc.c:5510 elf32-ppc.c:5536 elf32-ppc.c:5595
+#: elf32-ppc.c:6365 elf32-ppc.c:6391 elf32-ppc.c:6450
msgid "%B: the target (%s) of a %s relocation is in the wrong output section (%s)"
msgstr "%B: el objetivo (%s) de una reubicación %s está en la sección de salida errónea (%s)"
-#: elf32-ppc.c:5650
+#: elf32-ppc.c:6505
msgid "%B: relocation %s is not yet supported for symbol %s."
msgstr "%B: la reubicación %s aún no tiene soporte para el símbolo %s."
-#: elf32-ppc.c:5705 elf64-ppc.c:10606
-msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
-msgstr "%B(%A+0x%lx): reubicación %s sin resolución contra el símbolo `%s'"
-
-#: elf32-ppc.c:5756 elf64-ppc.c:10653
+#: elf32-ppc.c:6610 elf64-ppc.c:10872
msgid "%B(%A+0x%lx): %s reloc against `%s': error %d"
msgstr "%B(%A+0x%lx): reubicación %s contra `%s': error %d"
-#: elf32-ppc.c:5999
-msgid "corrupt or empty %s section in %B"
-msgstr "sección %s corrupta o vacía en %B"
-
-#: elf32-ppc.c:6006
-msgid "unable to read in %s section from %B"
-msgstr "no se puede leer en la sección %s desde %B"
-
-#: elf32-ppc.c:6012
-msgid "corrupt %s section in %B"
-msgstr "sección %s corrupta en %B"
-
-#: elf32-ppc.c:6055
-msgid "warning: unable to set size of %s section in %B"
-msgstr "aviso: no se puede establecer el tamaño de la sección %s en %B"
-
-#: elf32-ppc.c:6104
-msgid "failed to allocate space for new APUinfo section."
-msgstr "no se puede reservar espacio para la nueva sección APUinfo."
-
-#: elf32-ppc.c:6123
-msgid "failed to compute new APUinfo section."
-msgstr "no se puede calcular la nueva sección APUinfo."
-
-#: elf32-ppc.c:6126
-msgid "failed to install new APUinfo section."
-msgstr "no se puede instalar la nueva sección APUinfo."
-
-#: elf32-s390.c:2234 elf64-s390.c:2205
+#: elf32-s390.c:2253 elf64-s390.c:2225
msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s"
msgstr "%B(%A+0x%lx): instrucción inválida para la reubicación TLS %s"
-#: elf32-sh64.c:218 elf64-sh64.c:2319
+#: elf32-sh64.c:218 elf64-sh64.c:2322
#, 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-sh64.c:221 elf64-sh64.c:2322
+#: elf32-sh64.c:221 elf64-sh64.c:2325
#, 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:223 elf64-sh64.c:2324
+#: elf32-sh64.c:223 elf64-sh64.c:2327
#, 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:445 elf64-sh64.c:2890
+#: elf32-sh64.c:446 elf64-sh64.c:2899
#, c-format
msgid "%s: encountered datalabel symbol in input"
msgstr "%s: se encontró un símbolo datalabel en la entrada"
-#: elf32-sh64.c:522
+#: 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:525
+#: 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:543
+#: 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:592
+#: elf32-sh64.c:593
msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n"
msgstr "%B: error: tipo de reubicación %d sin alinear en %08x reubicación %p\n"
-#: elf32-sh64.c:668
+#: elf32-sh64.c:669
#, c-format
msgid "%s: could not write out added .cranges entries"
msgstr "%s: no se pueden escribir las entradas .cranges agregadas"
-#: elf32-sh64.c:728
+#: elf32-sh64.c:729
#, c-format
msgid "%s: could not write out sorted .cranges entries"
msgstr "%s: no se pueden escribir las entradas .cranges ordenadas"
@@ -1453,31 +1523,27 @@ msgstr "%B: 0x%lx: aviso: cuenta errónea"
msgid "%B: 0x%lx: fatal: reloc overflow while relaxing"
msgstr "%B: 0x%lx: fatal: desbordamiento de reubicación durante la relajación"
-#: elf32-sh.c:4558 elf64-sh64.c:1509
+#: elf32-sh.c:4566 elf64-sh64.c:1509
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:4709
-msgid "%B(%A): unresolvable relocation against symbol `%s'"
-msgstr "%B(%A+0x%lx): reubicación sin resolución contra el símbolo `%s'"
-
-#: elf32-sh.c:4779
+#: elf32-sh.c:4791
msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"
msgstr "%B: 0x%lx: fatal: objetivo de ramificación sin alineación para la reubicación de soporte de relajamiento"
-#: elf32-sh.c:4812 elf32-sh.c:4827
+#: elf32-sh.c:4824 elf32-sh.c:4839
msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"
msgstr "%B: 0x%lx: fatal: reubicación %s sin alineación 0x%lx"
-#: elf32-sh.c:4841
+#: elf32-sh.c:4853
msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
msgstr "%B: 0x%lx: fatal: la reubicación R_SH_PSHA %d no está en el rango -32..32"
-#: elf32-sh.c:4855
+#: elf32-sh.c:4867
msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
msgstr "%B: 0x%lx: fatal: la reubicación R_SH_PSHL %d no está en el rango -32..32"
-#: elf32-sh.c:6599 elf64-alpha.c:4725
+#: elf32-sh.c:6601 elf64-alpha.c:4466
msgid "%B: TLS local exec code cannot be linked into shared objects"
msgstr "%B: el código de ejecución local TLS no se puede enlazar en objetos compartidos"
@@ -1493,214 +1559,209 @@ msgstr "%B: Orden .directive no reconocida: %s"
msgid "%B: Failed to add renamed symbol %s"
msgstr "%B: Falló al agregar el símbolo renombrado %s"
-#: elf32-sparc.c:2501 elf64-sparc.c:2340
-msgid "%B: probably compiled without -fPIC?"
-msgstr "%B: ¿Compilado probablemente sin -fPIC?"
-
-#: elf32-sparc.c:3324
+#: elf32-sparc.c:87
msgid "%B: compiled for a 64 bit system and target is 32 bit"
msgstr "%B: compilado para un sistema de 64 bit y el objetivo es de 32 bit"
-#: elf32-sparc.c:3337
+#: elf32-sparc.c:100
msgid "%B: linking little endian files with big endian files"
msgstr "%B: enlazando ficheros little endian con ficheros big endian"
-#: elf32-v850.c:769
+#: elf32-v850.c:160
#, c-format
msgid "Variable `%s' cannot occupy in multiple small data regions"
msgstr "La variable `%s' no puede ocupar múltiples regiones de datos small"
-#: elf32-v850.c:772
+#: elf32-v850.c:163
#, 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"
-#: elf32-v850.c:775
+#: elf32-v850.c:166
#, 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"
-#: elf32-v850.c:778
+#: elf32-v850.c:169
#, 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"
-#: elf32-v850.c:781
+#: elf32-v850.c:172
#, 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"
-#: elf32-v850.c:1090
+#: elf32-v850.c:475
#, c-format
msgid "FAILED to find previous HI16 reloc\n"
msgstr "FALLO para encontrar la reubicación HI16 previa\n"
-#: elf32-v850.c:1761
+#: elf32-v850.c:1684
msgid "could not locate special linker symbol __gp"
msgstr "no se puede localizar el símbolo especial del enlazador __gp"
-#: elf32-v850.c:1765
+#: elf32-v850.c:1688
msgid "could not locate special linker symbol __ep"
msgstr "no se puede localizar el símbolo especial del enlazador __ep"
-#: elf32-v850.c:1769
+#: elf32-v850.c:1692
msgid "could not locate special linker symbol __ctbp"
msgstr "no se puede localizar el símbolo especial del enlazador __ctbp"
-#: elf32-v850.c:1954
+#: elf32-v850.c:1870
msgid "%B: Architecture mismatch with previous modules"
msgstr "%B: No coincide la arquitectura con los módulos previos"
-#: elf32-v850.c:1975
+#: elf32-v850.c:1889
#, c-format
msgid "private flags = %lx: "
msgstr "opciones privadas = %lx: "
-#: elf32-v850.c:1980
+#: elf32-v850.c:1894
#, c-format
msgid "v850 architecture"
msgstr "arquitectura v850"
-#: elf32-v850.c:1981
+#: elf32-v850.c:1895
#, c-format
msgid "v850e architecture"
msgstr "arquitectura v850e"
-#: elf32-v850.c:1982
+#: elf32-v850.c:1896
#, c-format
msgid "v850e1 architecture"
msgstr "arquitectura v850e1"
-#: elf32-vax.c:549
+#: elf32-vax.c:531
#, c-format
msgid " [nonpic]"
msgstr " [no pic]"
-#: elf32-vax.c:552
+#: elf32-vax.c:534
#, c-format
msgid " [d-float]"
msgstr " [flotante-d]"
-#: elf32-vax.c:555
+#: elf32-vax.c:537
#, c-format
msgid " [g-float]"
msgstr " [flotante-g]"
-#: elf32-vax.c:663
+#: elf32-vax.c:647
#, 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:1636
+#: elf32-vax.c:1604
#, 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:1760
+#: elf32-vax.c:1728
#, 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:1766
+#: elf32-vax.c:1734
#, 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-xstormy16.c:462 elf32-ia64.c:2394 elf64-ia64.c:2394
+#: elf32-xstormy16.c:425 elf32-ia64.c:2563 elf64-ia64.c:2563
msgid "non-zero addend in @fptr reloc"
msgstr "adición que no es cero en la reubicación @fptr"
-#: elf32-xtensa.c:709
+#: elf32-xtensa.c:705
msgid "%B(%A): invalid property table"
msgstr "%B(%A): tabla de propiedades inválida"
-#: elf32-xtensa.c:2209
+#: elf32-xtensa.c:2199
msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)"
msgstr "%B(%A+0x%lx): desplazamiento de reubicación fuera de rango (tamaño=0x%x)"
-#: elf32-xtensa.c:2266
+#: elf32-xtensa.c:2256
msgid "dynamic relocation in read-only section"
msgstr "reubicación dinámica en la sección de sólo lectura"
-#: elf32-xtensa.c:2430
+#: elf32-xtensa.c:2421
msgid "internal inconsistency in size of .got.loc section"
msgstr "inconsistencia interna en el tamaño de la sección .got.loc"
-#: elf32-xtensa.c:2744
+#: elf32-xtensa.c:2735
msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x"
msgstr "%B: tipo de máquina incompatible. La salida es 0x%x. La entrada es 0x%x"
-#: elf32-xtensa.c:3890 elf32-xtensa.c:3898
+#: elf32-xtensa.c:3881 elf32-xtensa.c:3889
msgid "Attempt to convert L32R/CALLX to CALL failed"
msgstr "Falló el intento de convertir L32R/CALLX a CALL"
-#: elf32-xtensa.c:5476 elf32-xtensa.c:5552 elf32-xtensa.c:6505
-#: elf32-xtensa.c:6559
+#: elf32-xtensa.c:5467 elf32-xtensa.c:5543 elf32-xtensa.c:6496
+#: elf32-xtensa.c:6550
msgid "%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"
msgstr "%B(%A+0x%lx): no se puede decodificar la instrucción; posible falta de coincidencia de la configuración"
-#: elf32-xtensa.c:6378 elf32-xtensa.c:6541
+#: elf32-xtensa.c:6369 elf32-xtensa.c:6532
msgid "%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY relocation; possible configuration mismatch"
msgstr "%B(%A+0x%lx): no se puede decodificar la instrucción para la reubicación XTENSA_ASM_SIMPLIFY; posible falta de coincidencia de la configuración"
-#: elf32-xtensa.c:7859
+#: elf32-xtensa.c:7855
msgid "invalid relocation address"
msgstr "dirección de reubicación inválida"
-#: elf32-xtensa.c:7908
+#: elf32-xtensa.c:7904
msgid "overflow after relaxation"
msgstr "desbordamiento después de la relajación"
-#: elf32-xtensa.c:9036
+#: elf32-xtensa.c:9032
msgid "%B(%A+0x%lx): unexpected fix for %s relocation"
msgstr "%B(%A+0x%lx): compostura inesperada para la reubicación %s"
-#: elf64-alpha.c:1069
+#: elf64-alpha.c:443
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:3557
-#, c-format
-msgid "Symbol %s has no GOT subsection for offset 0x%x"
-msgstr "El símbolo %s no tiene subsección GOT para el desplazamiento 0x%x"
-
-#: elf64-alpha.c:3642
+#: elf64-alpha.c:2363
msgid "%B: .got subsegment exceeds 64K (size %d)"
msgstr "%B: el subsegmento .got excede los 64K (tamaño %d)"
-#: elf64-alpha.c:4479 elf64-alpha.c:4491
+#: elf64-alpha.c:4210 elf64-alpha.c:4222
msgid "%B: gp-relative relocation against dynamic symbol %s"
msgstr "%B: reubicación gp relativa contra el símbolo dinámico %s"
-#: elf64-alpha.c:4517 elf64-alpha.c:4650
+#: elf64-alpha.c:4248 elf64-alpha.c:4383
msgid "%B: pc-relative relocation against dynamic symbol %s"
msgstr "%B: reubicación relativa al pc contra el símbolo dinámico %s"
-#: elf64-alpha.c:4545
+#: elf64-alpha.c:4276
msgid "%B: change in gp: BRSGP %s"
msgstr "%B: cambio en gp: BRSGP %s"
-#: elf64-alpha.c:4570
+#: elf64-alpha.c:4301
msgid "<unknown>"
msgstr "<desconocido>"
-#: elf64-alpha.c:4575
+#: elf64-alpha.c:4306
msgid "%B: !samegp reloc against symbol without .prologue: %s"
msgstr "%B: reubicación !samegp contra un símbolo sin .prologue: %s"
-#: elf64-alpha.c:4626
+#: elf64-alpha.c:4358
msgid "%B: unhandled dynamic relocation against %s"
msgstr "%B: reubicación dinámica sin manejar contra %s"
-#: elf64-alpha.c:4709
+#: elf64-alpha.c:4390
+msgid "%B: pc-relative relocation against undefined weak symbol %s"
+msgstr "%B: reubicación relativa al pc contra el símbolo débil sin definir %s"
+
+#: elf64-alpha.c:4450
msgid "%B: dtp-relative relocation against dynamic symbol %s"
msgstr "%B: reubicación relativa a dtp contra el símbolo dinámico %s"
-#: elf64-alpha.c:4732
+#: elf64-alpha.c:4473
msgid "%B: tp-relative relocation against dynamic symbol %s"
msgstr "%B: reubicación relativa a tp contra el símbolo dinámico %s"
-#: elf64-hppa.c:2085
+#: elf64-hppa.c:2046
#, 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"
@@ -1744,16 +1805,16 @@ msgstr "%s: la directiva LOCAL sólo es válida con un registro o un valor absolut
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:2201
+#: elf64-mmix.c:2207
#, 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"
-#: elf64-mmix.c:2260
+#: elf64-mmix.c:2265
msgid "Register section has contents\n"
msgstr "La sección de registros no tiene contenido\n"
-#: elf64-mmix.c:2453
+#: elf64-mmix.c:2457
#, c-format
msgid ""
"Internal inconsistency: remaining %u != max %u.\n"
@@ -1762,60 +1823,73 @@ msgstr ""
"Inconsistencia interna: %u restante != %u máximo.\n"
" Por favor reporte este bicho."
-#: elf64-ppc.c:2490 libbfd.c:826
+#: elf64-ppc.c:2500 libbfd.c:931
msgid "%B: compiled for a big endian system and target is little endian"
msgstr "%B: compilado para un sistema big endian y el objetivo es little endian"
-#: elf64-ppc.c:2493 libbfd.c:828
+#: elf64-ppc.c:2503 libbfd.c:933
msgid "%B: compiled for a little endian system and target is big endian"
msgstr "%B: compilado para un sistema little endian y el objetivo es big endian"
-#: elf64-ppc.c:5640
+#: elf64-ppc.c:5707
#, c-format
msgid "copy reloc against `%s' requires lazy plt linking; avoid setting LD_BIND_NOW=1 or upgrade gcc"
msgstr "la reubicación de copia contra `%s' requiere de enlazado plt suelto; evite establecer LD_BIND_NOW=1 o actualice gcc"
-#: elf64-ppc.c:6043
+#: elf64-ppc.c:6155
+msgid "dynreloc miscount for %B, section %A"
+msgstr "cuenta errónea de la reubicación dinámica de %B, sección %A"
+
+#: elf64-ppc.c:6257
msgid "%B: .opd is not a regular array of opd entries"
msgstr "%B: .opd no es una matriz regular de entradas opd"
-#: elf64-ppc.c:6052
+#: elf64-ppc.c:6266
msgid "%B: unexpected reloc type %u in .opd section"
msgstr "%B: tipo de reubicación %u inesperado en la sección .opd"
-#: elf64-ppc.c:6072
+#: elf64-ppc.c:6287
msgid "%B: undefined sym `%s' in .opd section"
msgstr "%B: símbolo `%s' indefinido en la sección .opd"
-#: elf64-ppc.c:6757 elf64-ppc.c:7132
+#: elf64-ppc.c:6939 elf64-ppc.c:7318
#, c-format
msgid "%s defined in removed toc entry"
msgstr "se definió %s en la entrada toc eliminada"
-#: elf64-ppc.c:7921
+#: elf64-ppc.c:8041
+#, c-format
+msgid "long branch stub `%s' offset overflow"
+msgstr "desbordamiento del desplazamiento de stub de ramificación long `%s'"
+
+#: elf64-ppc.c:8116
#, c-format
msgid "can't find branch stub `%s'"
msgstr "no se puede encontrar la ramificación de cabo `%s'"
-#: elf64-ppc.c:7960 elf64-ppc.c:8036
+#: elf64-ppc.c:8155 elf64-ppc.c:8231
#, c-format
msgid "linkage table error against `%s'"
msgstr "error de la tabla de enlazado contra `%s'"
-#: elf64-ppc.c:8165
+#: elf64-ppc.c:8360
#, c-format
msgid "can't build branch stub `%s'"
msgstr "no se puede construir la ramificación de cabos `%s'"
-#: elf64-ppc.c:9093
+#: elf64-ppc.c:8784
+msgid "%B section %A exceeds stub group size"
+msgstr "%B sección %A excede el tamaño de grupo de stub"
+
+#: elf64-ppc.c:9295
msgid ".glink and .plt too far apart"
msgstr ".glink y .plt están demasiado alejados"
-#: elf64-ppc.c:9206
+#: elf64-ppc.c:9408
msgid "stubs don't match calculated size"
msgstr "los cabos no coinciden con el tamaño calculado"
-#: elf64-ppc.c:9218
+#: elf64-ppc.c:9420
#, c-format
msgid ""
"linker stubs in %u group%s\n"
@@ -1832,88 +1906,84 @@ msgstr ""
" ajuste toc long %lu\n"
" llamada plt %lu"
-#: elf64-ppc.c:9455
-msgid "%B(%A+0x%lx): %s used with TLS symbol %s"
-msgstr "%B(%A+0x%lx): se usó %s con el símbolo TLS %s"
-
-#: elf64-ppc.c:9456
-msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s"
-msgstr "%B(%A+0x%lx): se usó %s con el símbolo %s que no es TLS"
-
-#: elf64-ppc.c:9856
+#: elf64-ppc.c:10075
msgid "%B(%A+0x%lx): automatic multiple TOCs not supported using your crt files; recompile with -mminimal-toc or upgrade gcc"
msgstr "%B(%A+0x%lx): los TOCs múltiples automáticos no tienen soporte utilizando sus ficheros crt; recompile con -mminimal-toc o actualice gcc"
-#: elf64-ppc.c:9864
+#: elf64-ppc.c:10083
msgid "%B(%A+0x%lx): sibling call optimization to `%s' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `%s' extern"
msgstr "%B(%A+0x%lx): la optimización de llamada hermana a `%s' no permite TOCs múltiples automáticos; recompile con -mminimal-toc ó -fno-optimize-sibling-calls, o vuelva `%s' externa"
-#: elf64-ppc.c:10508
+#: elf64-ppc.c:10727
msgid "%B: relocation %s is not supported for symbol %s."
msgstr "%B: la reubicación %s no tiene soporte para el símbolo %s."
-#: elf64-ppc.c:10587
+#: elf64-ppc.c:10806
msgid "%B: error: relocation %s not a multiple of %d"
msgstr "%B: error: la reubicación %s no es un múltiplo de %d"
-#: elf64-sh64.c:1673
+#: elf64-sh64.c:1676
#, 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"
-#: elf64-sparc.c:1419
-msgid "%B: check_relocs: unhandled reloc type %d"
-msgstr "%B: check_relocs: tipo de reubicación %d sin manejar"
-
-#: elf64-sparc.c:1455
+#: elf64-sparc.c:438
msgid "%B: Only registers %%g[2367] can be declared using STT_REGISTER"
msgstr "%B: Solamente los registros %%g[2367] se pueden declarar utilizando STT_REGISTER"
-#: elf64-sparc.c:1475
+#: elf64-sparc.c:458
msgid "Register %%g%d used incompatibly: %s in %B, previously %s in %B"
msgstr "El registro %%g%d se usó de forma incompatible: %s en %B, previamente %s en %B"
-#: elf64-sparc.c:1498
+#: elf64-sparc.c:481
msgid "Symbol `%s' has differing types: REGISTER in %B, previously %s in %B"
msgstr "El símbolo `%s' tiene tipos divergentes: REGISTER en %B, previamente %s en %B"
-#: elf64-sparc.c:1543
+#: elf64-sparc.c:526
msgid "Symbol `%s' has differing types: %s in %B, previously REGISTER in %B"
msgstr "El símbolo `%s' tiene tipos divergentes: %s en %B, previamente REGISTER en %B"
-#: elf64-sparc.c:3071
+#: elf64-sparc.c:677
msgid "%B: linking UltraSPARC specific with HAL specific code"
msgstr "%B: enlazando código específico de UltraSPARC con código específico de HAL"
-#: elf64-x86-64.c:667 elf64-x86-64.c:792 elf64-x86-64.c:1988
+#: elf64-x86-64.c:692 elf64-x86-64.c:818 elf64-x86-64.c:2069
msgid "%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"
msgstr "%B: no se puede usar la reubicación %s contra `%s' cuando se hace un objeto compartido; recompile con -fPIC"
-#: elf64-x86-64.c:735
+#: elf64-x86-64.c:760
msgid "%B: %s' accessed both as normal and thread local symbol"
msgstr "%B: se accesó `%s' como un símbolo normal y como un símbolo local de hilo"
-#: elf64-x86-64.c:1984
+#: elf64-x86-64.c:2000
+msgid "%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be used when making a shared object"
+msgstr "%B: no se puede usar la reubicación R_X86_64_GOTOFF contra la función protegida `%s' cuando se hace un objeto compartido"
+
+#: elf64-x86-64.c:2065
msgid "%B: relocation R_X86_64_PC32 against protected function `%s' can not be used when making a shared object"
msgstr "%B: no se puede usar la reubicación R_X86_64_PC32 contra la función protegida `%' cuando se hace un objeto compartido"
-#: elf.c:296
+#: elf.c:288
msgid "%B: invalid string offset %u >= %lu for section `%s'"
msgstr "%B: desplazamiento de cadena inválido %u >= %lu para la sección `%s'"
-#: elf.c:543
+#: elf.c:552
msgid "%B: invalid SHT_GROUP entry"
msgstr "%B: entrada SHT_GROUP inválida"
-#: elf.c:613
+#: elf.c:622
msgid "%B: no group info for section %A"
msgstr "%B: no hay información de grupo para la sección %A"
-#: elf.c:650
+#: elf.c:652 elf.c:3091 elflink.c:7588
+msgid "%B: warning: sh_link not set for section `%A'"
+msgstr "%B: aviso: no se estableción sh_link para la sección `%A'"
+
+#: elf.c:688
msgid "%B: unknown [%d] section `%s' in group [%s]"
msgstr "%B: sección [%d] desconocida `%s' en el grupo [%s]"
-#: elf.c:1011
+#: elf.c:1071
#, c-format
msgid ""
"\n"
@@ -1922,7 +1992,7 @@ msgstr ""
"\n"
"Encabezado del Programa:\n"
-#: elf.c:1063
+#: elf.c:1123
#, c-format
msgid ""
"\n"
@@ -1931,7 +2001,7 @@ msgstr ""
"\n"
"Sección Dinámica:\n"
-#: elf.c:1188
+#: elf.c:1248
#, c-format
msgid ""
"\n"
@@ -1940,7 +2010,7 @@ msgstr ""
"\n"
"Definiciones de versión:\n"
-#: elf.c:1211
+#: elf.c:1273
#, c-format
msgid ""
"\n"
@@ -1949,358 +2019,375 @@ msgstr ""
"\n"
"Referencias de Versión:\n"
-#: elf.c:1216
+#: elf.c:1278
#, c-format
msgid " required from %s:\n"
msgstr " requerido desde %s:\n"
-#: elf.c:1905
+#: elf.c:1985
msgid "%B: invalid link %lu for reloc section %s (index %u)"
msgstr "%B: enlace %lu inválido para la sección de reubicación %s (índice %u)"
-#: elf.c:2910
-msgid "%B: warning: sh_link not set for section `%S'"
-msgstr "%B: aviso: no se estableció sh_link para la sección `%S'"
+#: elf.c:3062
+msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'"
+msgstr "%B: sh_link de la sección `%A' apunta a la sección descartada `%A' de `%B'"
-#: elf.c:3904
+#: elf.c:4070
msgid "%B: Not enough room for program headers (allocated %u, need %u)"
msgstr "%B: No hay suficiente espacio para los encabezados del programa (%u asignados, %u necesarios)"
-#: elf.c:4010
+#: elf.c:4173
msgid "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section"
msgstr "%B: La primera sección en el segmento PT_DYNAMIC no es la sección .dynamic"
-#: elf.c:4054
+#: elf.c:4217
msgid "%B: Not enough room for program headers, try linking with -N"
msgstr "%B: No hay suficiente espacio para los encabezados del programa, pruebe enlazar con -N"
-#: elf.c:4145
+#: elf.c:4308
msgid "%B: section %A lma 0x%lx overlaps previous sections"
msgstr "%B: la sección %A lma 0x%lx traslapa las secciones anteriores"
-#: elf.c:4546
+#: elf.c:4709
msgid "%B: warning: allocated section `%s' not in segment"
msgstr "%B: aviso: la sección asignada `%s' no está en el segmento"
-#: elf.c:4850
+#: elf.c:5002
msgid "%B: symbol `%s' required but not present"
msgstr "%B: se requiere el símbolo `%s' pero no está presente"
-#: elf.c:5147
+#: elf.c:5299
msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n"
msgstr "%B: aviso: Se detectó un segmento cargable vacío, ¿ esto es intencional ?\n"
-#: elf.c:5761
+#: elf.c:5961
#, c-format
msgid "Unable to find equivalent output section for symbol '%s' from section '%s'"
msgstr "No se puede encontrar la sección de salida equivalente para el símbolo '%s' de la sección '%s'"
-#: elf.c:6620
+#: elf.c:6917
msgid "%B: unsupported relocation type %s"
msgstr "%B: tipo de reubicación %s sin soporte"
-#: elfcode.h:1039
+#: elfcode.h:1110
#, 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)"
-#: elfcode.h:1266
+#: elfcode.h:1337
#, c-format
msgid "%s(%s): relocation %d has invalid symbol index %ld"
msgstr "%s(%s): la reubicación %d tiene un índice de símbolo %ld inválido"
-#: elf-hppa.h:1401 elf-hppa.h:1427 elf-hppa.h:1442
+#: elf-hppa.h:1443 elf-hppa.h:1458
msgid "%B(%A): warning: unresolvable relocation against symbol `%s'"
msgstr "%B(%A): aviso: reubicación sin resolución contra el símbolo `%s'"
-#: elflink.c:941
+#: elflink.c:907
msgid "%s: TLS definition in %B section %A mismatches non-TLS definition in %B section %A"
msgstr "%s: la definición TLS en %B sección %A no coincide con la definición que no es TLS en %B sección %A"
-#: elflink.c:945
+#: elflink.c:911
msgid "%s: TLS reference in %B mismatches non-TLS reference in %B"
msgstr "%s: la referencia TLS en %b no coincide con la referencia que no es TLS en %B"
-#: elflink.c:949
+#: elflink.c:915
msgid "%s: TLS definition in %B section %A mismatches non-TLS reference in %B"
msgstr "%s: la definición TLS en %B sección %A no coincide con la referencia que no es TLS en %B"
-#: elflink.c:953
+#: elflink.c:919
msgid "%s: TLS reference in %B mismatches non-TLS definition in %B section %A"
msgstr "%s: la referencia TLS en %B no coincide con la definición que no es TLS en %B sección %A"
-#: elflink.c:1508
+#: elflink.c:1491
msgid "%B: unexpected redefinition of indirect versioned symbol `%s'"
msgstr "%B: redefinición inesperada del símbolo con versión indirecta `%s'"
-#: elflink.c:1825
+#: elflink.c:1807
msgid "%B: undefined versioned symbol name %s"
msgstr "%B: nombre de símbolo con versión %s sin definir"
-#: elflink.c:1974
+#: elflink.c:1955
msgid "%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'"
msgstr "%B: índice de símbolos de reubicación inválido (0x%lx >= 0x%lx) erróneo para el desplazamiento 0x%lx en la sección `%A'"
-#: elflink.c:2164
+#: elflink.c:2147
msgid "%B: relocation size mismatch in %B section %A"
msgstr "%B: el tamaño de reubicación no coincide en %B sección %A"
-#: elflink.c:2454
+#: elflink.c:2437
#, 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.c:2775
+#: elflink.c:2761
msgid "warning: creating a DT_TEXTREL in a shared object."
msgstr "aviso: se crea un DT_TEXTREL en un objeto compartido."
-#: elflink.c:3702
+#: elflink.c:3696
msgid "%B: %s: invalid version %u (max %d)"
msgstr "%B: %s: versión %u inválida (máximo %d)"
-#: elflink.c:3738
+#: elflink.c:3732
msgid "%B: %s: invalid needed version %d"
msgstr "%B: %s: versión requerida %d inválida"
-#: elflink.c:3919
+#: elflink.c:3912
msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
msgstr "Aviso: la alineación %u del símbolo `%s' en %B es más pequeña que %u en %B"
-#: elflink.c:3931
+#: elflink.c:3924
msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
msgstr "Aviso: el tamaño del símbolo `%s' cambió de %lu en %B a %lu en %B"
-#: elflink.c:4098
+#: elflink.c:4091
#, c-format
msgid "%s: invalid DSO for symbol `%s' definition"
msgstr "%s: DSO inválido para la definición del símbolo `%s'"
-#: elflink.c:5155
+#: elflink.c:5152
#, c-format
msgid "%s: undefined version: %s"
msgstr "%s: versión sin definir: %s"
-#: elflink.c:5221
+#: elflink.c:5219
msgid "%B: .preinit_array section is not allowed in DSO"
msgstr "%B: no se permite la sección .preinit_array en DSO"
-#: elflink.c:5961
+#: elflink.c:5978
msgid "Not enough memory to sort relocations"
msgstr "No hay suficiente memoria para ordenar las reubicaciones"
-#: elflink.c:6352
+#: elflink.c:6369
msgid "%B: %s symbol `%s' in %B is referenced by DSO"
msgstr "%B: el símbolo %s `%s' en %B está referenciado por DSO"
-#: elflink.c:6433
+#: elflink.c:6452
msgid "%B: could not find output section %A for input section %A"
msgstr "%B: no se puede encontrar la sección de salida %A para la sección de entrada %A"
-#: elflink.c:6530
+#: elflink.c:6549
msgid "%B: %s symbol `%s' isn't defined"
msgstr "%B: el símbolo %s `%s' no está definido"
-#: elflink.c:7017
-msgid "`%s' referenced in section `%A' of %B: defined in discarded section `%A' of %B\n"
-msgstr "`%s' referido en la sección `%A' de %B: se definió en la sección descartada `%A' de %B\n"
+#: elflink.c:7024
+msgid "error: %B contains a reloc (0x%s) for section %A that references a non-existent global symbol"
+msgstr "error: %B contiene una reubicación (0x%s) para la sección %A que refiere a un símbolo global que no existe"
-#: elflink.c:7551
-msgid "%B: warning: sh_link not set for section `%A'"
-msgstr "%B: aviso: no se estableción sh_link para la sección `%A'"
+#: elflink.c:7058
+msgid "%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' of %B\n"
+msgstr "%X`%s' referido en la sección `%A' de %B: se definió en la sección descartada `%A' de %B\n"
+
+#: elflink.c:7665
+msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections"
+msgstr "%A tiene tanto secciones ordenadas [`%A' en %B] como desordenadas [`%A' en %B]"
-#: elflink.c:7624
+#: elflink.c:7670
#, c-format
msgid "%A has both ordered and unordered sections"
msgstr "%A tiene tanto secciones ordenadas como desordenadas"
-#: elflink.c:8437 elflink.c:8478
+#: elflink.c:8487 elflink.c:8528
msgid "%B: could not find output section %s"
msgstr "%B: no se puede encontrar la sección de salida %s"
-#: elflink.c:8442
+#: elflink.c:8492
#, c-format
msgid "warning: %s section has zero size"
msgstr "aviso: la sección %s es de tamaño cero"
-#: elflink.c:9017
+#: elflink.c:9087
msgid "Warning: gc-sections option ignored"
msgstr "Aviso: se ignora la opción gc-sections"
-#: elflink.c:9606
-msgid "%B: ignoring duplicate section `%A'\n"
-msgstr "%B: se ignora la sección duplicada `%A'\n"
+#: elflink.c:9704
+msgid "%B: ignoring duplicate section `%A'"
+msgstr "%B: se ignora la sección duplicada `%A'"
-#: elflink.c:9613 elflink.c:9620
-msgid "%B: duplicate section `%A' has different size\n"
-msgstr "%B: la sección duplicada `%A' tiene tamaño diferente\n"
+#: elflink.c:9711 elflink.c:9718
+msgid "%B: duplicate section `%A' has different size"
+msgstr "%B: la sección duplicada `%A' tiene tamaño diferente"
-#: elflink.c:9628 elflink.c:9633
-msgid "%B: warning: could not read contents of section `%A'\n"
-msgstr "%B: aviso: no se puede leer el contenido de la sección `%A'\n"
+#: elflink.c:9726 elflink.c:9731
+msgid "%B: warning: could not read contents of section `%A'"
+msgstr "%B: aviso: no se puede leer el contenido de la sección `%A'"
-#: elflink.c:9637
-msgid "%B: warning: duplicate section `%A' has different contents\n"
-msgstr "%B: aviso: la sección duplicada `%A' tiene contenido diferente\n"
+#: elflink.c:9735
+msgid "%B: warning: duplicate section `%A' has different contents"
+msgstr "%B: aviso: la sección duplicada `%A' tiene contenido diferente"
-#: elfxx-mips.c:860
+#: elfxx-mips.c:866
msgid "static procedure (no name)"
msgstr "procedimiento estático (sin nombre)"
-#: elfxx-mips.c:2508
+#: elfxx-mips.c:2513
msgid "not enough GOT space for local GOT entries"
msgstr "no hay suficiente espacio GOT para entradas GOT locales"
-#: elfxx-mips.c:4353
+#: elfxx-mips.c:4356
msgid "%B: %A+0x%lx: jump to stub routine which is not jal"
msgstr "%B: %A+0x%lx: salto a una rutina cabo la cual no es jal"
-#: elfxx-mips.c:5919
+#: elfxx-mips.c:4993 elfxx-mips.c:5214
+msgid "%B: Warning: bad `%s' option size %u smaller than its header"
+msgstr "%B: Aviso: el tamaño de opción `%s' %u erróneo es más pequeño que su encabezado"
+
+#: elfxx-mips.c:5965
msgid "%B: Malformed reloc detected for section %s"
msgstr "%B: Se detectó una reubicación malformada para la sección %s"
-#: elfxx-mips.c:5995
+#: elfxx-mips.c:6041
msgid "%B: CALL16 reloc at 0x%lx not against global symbol"
msgstr "%B: la reubicación CALL16 en 0x%lx no es contra un símbolo global"
-#: elfxx-mips.c:9308
+#: elfxx-mips.c:9380
#, c-format
msgid "%s: illegal section name `%s'"
msgstr "%s: nombre de sección `%s' ilegal"
-#: elfxx-mips.c:9632
+#: elfxx-mips.c:9719
msgid "%B: endianness incompatible with that of the selected emulation"
msgstr "%B: la endianez es incompatible con aquella de la emulación seleccionada"
-#: elfxx-mips.c:9644
+#: elfxx-mips.c:9731
msgid "%B: ABI is incompatible with that of the selected emulation"
msgstr "%B: la ABI es incompatible con aquella de la emulación seleccionada"
-#: elfxx-mips.c:9716
+#: elfxx-mips.c:9803
msgid "%B: warning: linking PIC files with non-PIC files"
msgstr "%B: aviso: enlazando ficheros PIC con ficheros que no son PIC"
-#: elfxx-mips.c:9733
+#: elfxx-mips.c:9820
msgid "%B: linking 32-bit code with 64-bit code"
msgstr "%B: enlazando código de 32-bit con código de 64-bit"
-#: elfxx-mips.c:9761
+#: elfxx-mips.c:9848
msgid "%B: linking %s module with previous %s modules"
msgstr "%B: enlazando el módulo %s con módulos %s previos"
-#: elfxx-mips.c:9784
+#: elfxx-mips.c:9871
msgid "%B: ABI mismatch: linking %s module with previous %s modules"
msgstr "%B: no coincide el ABI: enlazando el módulo %s con módulos %s previos"
-#: elfxx-mips.c:9849
+#: elfxx-mips.c:9936
#, c-format
msgid " [abi=O32]"
msgstr " [abi=O32]"
-#: elfxx-mips.c:9851
+#: elfxx-mips.c:9938
#, c-format
msgid " [abi=O64]"
msgstr " [abi=O64]"
-#: elfxx-mips.c:9853
+#: elfxx-mips.c:9940
#, c-format
msgid " [abi=EABI32]"
msgstr " [abi=EABI32]"
-#: elfxx-mips.c:9855
+#: elfxx-mips.c:9942
#, c-format
msgid " [abi=EABI64]"
msgstr " [abi=EABI64]"
-#: elfxx-mips.c:9857
+#: elfxx-mips.c:9944
#, c-format
msgid " [abi unknown]"
msgstr " [abi desconocido]"
-#: elfxx-mips.c:9859
+#: elfxx-mips.c:9946
#, c-format
msgid " [abi=N32]"
msgstr " [abi=N32]"
-#: elfxx-mips.c:9861
+#: elfxx-mips.c:9948
#, c-format
msgid " [abi=64]"
msgstr " [abi=64]"
-#: elfxx-mips.c:9863
+#: elfxx-mips.c:9950
#, c-format
msgid " [no abi set]"
msgstr " [no hay conjunto abi]"
-#: elfxx-mips.c:9866
+#: elfxx-mips.c:9953
#, c-format
msgid " [mips1]"
msgstr " [mips1]"
-#: elfxx-mips.c:9868
+#: elfxx-mips.c:9955
#, c-format
msgid " [mips2]"
msgstr " [mips2]"
-#: elfxx-mips.c:9870
+#: elfxx-mips.c:9957
#, c-format
msgid " [mips3]"
msgstr " [mips3]"
-#: elfxx-mips.c:9872
+#: elfxx-mips.c:9959
#, c-format
msgid " [mips4]"
msgstr " [mips4]"
-#: elfxx-mips.c:9874
+#: elfxx-mips.c:9961
#, c-format
msgid " [mips5]"
msgstr " [mips5]"
-#: elfxx-mips.c:9876
+#: elfxx-mips.c:9963
#, c-format
msgid " [mips32]"
msgstr " [mips32]"
-#: elfxx-mips.c:9878
+#: elfxx-mips.c:9965
#, c-format
msgid " [mips64]"
msgstr " [mips64]"
-#: elfxx-mips.c:9880
+#: elfxx-mips.c:9967
#, c-format
msgid " [mips32r2]"
msgstr " [mips32r2]"
-#: elfxx-mips.c:9882
+#: elfxx-mips.c:9969
#, c-format
msgid " [mips64r2]"
msgstr " [mips64r2]"
-#: elfxx-mips.c:9884
+#: elfxx-mips.c:9971
#, c-format
msgid " [unknown ISA]"
msgstr " [ISA desconocido]"
-#: elfxx-mips.c:9887
+#: elfxx-mips.c:9974
#, c-format
msgid " [mdmx]"
msgstr " [mdmx]"
-#: elfxx-mips.c:9890
+#: elfxx-mips.c:9977
#, c-format
msgid " [mips16]"
msgstr " [mips16]"
-#: elfxx-mips.c:9893
+#: elfxx-mips.c:9980
#, c-format
msgid " [32bitmode]"
msgstr " [modo 32bit]"
-#: elfxx-mips.c:9895
+#: elfxx-mips.c:9982
#, c-format
msgid " [not 32bitmode]"
msgstr " [no es modo 32bit]"
+#: elfxx-sparc.c:402
+#, c-format
+msgid "invalid relocation type %d"
+msgstr "tipo de reubicación %d inválido"
+
+#: elfxx-sparc.c:2783
+msgid "%B: probably compiled without -fPIC?"
+msgstr "%B: ¿Compilado probablemente sin -fPIC?"
+
#: i386linux.c:457 m68klinux.c:461 sparclinux.c:458
#, c-format
msgid "Output file requires shared library `%s'\n"
@@ -2321,75 +2408,75 @@ msgstr "El símbolo %s no está definido para composturas\n"
msgid "Warning: fixup count mismatch\n"
msgstr "Aviso: no coincide la cuenta de composturas\n"
-#: ieee.c:293
+#: ieee.c:157
#, c-format
msgid "%s: string too long (%d chars, max 65535)"
msgstr "%s: la cadena es demasiado larga (%d caracteres, máximo 65535)"
-#: ieee.c:428
+#: ieee.c:284
#, c-format
msgid "%s: unrecognized symbol `%s' flags 0x%x"
msgstr "%s: símbolo `%s' no reconocido opciones 0x%x"
-#: ieee.c:938
+#: ieee.c:786
msgid "%B: unimplemented ATI record %u for symbol %u"
msgstr "%B: grabación ATI %u sin implementar para el símbolo %u"
-#: ieee.c:962
+#: ieee.c:810
msgid "%B: unexpected ATN type %d in external part"
msgstr "%B: tipo ATN %d inesperado en la parte externa"
-#: ieee.c:984
+#: ieee.c:832
msgid "%B: unexpected type after ATN"
msgstr "%B: tipo inesperado después de ATN"
-#: ihex.c:264
+#: ihex.c:228
msgid "%B:%d: unexpected character `%s' in Intel Hex file"
msgstr "%B:%d: carácter `%s' inesperado en el fichero Hexadecimal de Intel"
-#: ihex.c:372
+#: ihex.c:335
msgid "%B:%u: bad checksum in Intel Hex file (expected %u, found %u)"
msgstr "%B:%u: suma de comprobación errónea en el fichero Hexadecimal de Intel (se esperaba %u, se obtuvo %u)"
-#: ihex.c:426
+#: ihex.c:389
msgid "%B:%u: bad extended address record length in Intel Hex file"
msgstr "%B:%u: longitud de registro de dirección extendida errónea en el fichero Hexadecimal de Intel"
-#: ihex.c:443
+#: ihex.c:406
msgid "%B:%u: bad extended start address length in Intel Hex file"
msgstr "%B:%u: longitud de dirección de inicio extendida errónea en el fichero Hexadecimal de Intel"
-#: ihex.c:460
+#: ihex.c:423
msgid "%B:%u: bad extended linear address record length in Intel Hex file"
msgstr "%B:%u: longitud de registro de dirección lineal extendida errónea en el fichero Hexadecimal de Intel"
-#: ihex.c:477
+#: ihex.c:440
msgid "%B:%u: bad extended linear start address length in Intel Hex file"
msgstr "%B:%u: longitud de dirección de inicio lineal extendida errónea en el fichero Hexadecimal de Intel"
-#: ihex.c:494
+#: ihex.c:457
msgid "%B:%u: unrecognized ihex type %u in Intel Hex file"
msgstr "%B:%u: tipo ihex %u no reconocido en el fichero Hexadecimal de Intel"
-#: ihex.c:619
+#: ihex.c:578
msgid "%B: internal error in ihex_read_section"
msgstr "%B: error interno en ihex_read_section"
-#: ihex.c:653
+#: ihex.c:612
msgid "%B: bad section length in ihex_read_section"
msgstr "%B: longitud de sección errónea en ihex_read_section"
-#: ihex.c:870
+#: ihex.c:824
#, 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"
-#: libbfd.c:856
+#: libbfd.c:961
#, c-format
msgid "Deprecated %s called at %s line %d in %s\n"
msgstr "Se llamó a %s que es obsoleto en %s línea %d en %s\n"
-#: libbfd.c:859
+#: libbfd.c:964
#, c-format
msgid "Deprecated %s called\n"
msgstr "Se llamó a %s que es obsoleto\n"
@@ -2398,20 +2485,20 @@ msgstr "Se llamó a %s que es obsoleto\n"
msgid "%B: indirect symbol `%s' to `%s' is a loop"
msgstr "%B: el símbolo indirecto `%s' para `%s' es un ciclo"
-#: linker.c:2741
+#: linker.c:2740
#, c-format
msgid "Attempt to do relocatable link with %s input and %s output"
msgstr "Se intentó hacer un enlace reubicable con entrada %s y salida %s"
-#: linker.c:3038
+#: linker.c:3037
msgid "%B: warning: ignoring duplicate section `%A'\n"
msgstr "%B: aviso: se ignora la sección duplicada `%A'\n"
-#: linker.c:3052
+#: linker.c:3051
msgid "%B: warning: duplicate section `%A' has different size\n"
msgstr "%B: aviso: la sección duplicada `%A' es de tamaño diferente\n"
-#: merge.c:796
+#: merge.c:817
#, c-format
msgid "%s: access beyond end of merged section (%ld)"
msgstr "%s: acceso más allá del final de la sección mezclada (%ld)"
@@ -2486,62 +2573,62 @@ msgstr "%s: fichero mmo inválido: el número de fichero %d `%s' ya se había intro
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:1891
+#: mmo.c:1892
#, 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"
-#: mmo.c:1927
+#: mmo.c:1928
#, 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"
-#: mmo.c:1940
+#: mmo.c:1941
#, 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"
-#: mmo.c:2647
+#: mmo.c:2649
#, 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:2890
+#: mmo.c:2892
#, 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"
-#: mmo.c:2982
+#: mmo.c:2984
#, 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"
-#: mmo.c:3027
+#: mmo.c:3029
#, 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"
-#: mmo.c:3079
+#: mmo.c:3081
#, 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"
-#: mmo.c:3130
+#: mmo.c:3132
#, 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:3136
+#: mmo.c:3138
#, 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:3141
+#: mmo.c:3143
#, 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"
-#: oasys.c:1033
+#: oasys.c:876
#, c-format
msgid "%s: can not represent section `%s' in oasys"
msgstr "%s: no se puede representar la sección `%s' en oasys"
@@ -2552,56 +2639,55 @@ msgid "Unhandled OSF/1 core file section type %d\n"
msgstr "Tipo de sección de fichero núcleo OSF/1 %d sin manejar\n"
#. XXX code yet to be written.
-#: peicode.h:760
+#: peicode.h:731
msgid "%B: Unhandled import type; %x"
msgstr "%B: Tipo de importación sin manejar; %x"
-#: peicode.h:765
+#: peicode.h:736
msgid "%B: Unrecognised import type; %x"
msgstr "%B: Tipo de importación no reconocida; %x"
-#: peicode.h:779
+#: peicode.h:750
msgid "%B: Unrecognised import name type; %x"
msgstr "%B: Tipo de nombre de importación no reconocida; %x"
-#: peicode.h:1169
+#: peicode.h:1120
msgid "%B: Unrecognised machine type (0x%x) in Import Library Format archive"
msgstr "%B: Tipo de máquina (0x%x) no reconocida en el archivo de Formato de Importación de Bibliotecas"
-#: peicode.h:1181
+#: peicode.h:1132
msgid "%B: Recognised but unhandled machine type (0x%x) in Import Library Format archive"
msgstr "%B: Tipo de máquina (0x%x) reconocida pero sin manejar en el archivo de Formato de Importación de Bibliotecas"
-#: peicode.h:1199
+#: peicode.h:1150
msgid "%B: size field is zero in Import Library Format header"
msgstr "%B: el tamaño del campo es cero en el encabezado del Formato de Importación de Bibliotecas"
-#: peicode.h:1230
+#: peicode.h:1181
msgid "%B: string not null terminated in ILF object file."
msgstr "%B: cadena no terminada en null en el fichero objeto ILF."
-#: pe-mips.c:627
+#: pe-mips.c:588
msgid "%B: `ld -r' not supported with PE MIPS objects\n"
msgstr "%B: `ld -r' no tiene soporte con objetos PE MIPS\n"
#. OK, at this point the following variables are set up:
#. src = VMA of the memory we're fixing up
#. mem = pointer to memory we're fixing up
-#. val = VMA of what we need to refer to
-#.
-#: pe-mips.c:749
+#. val = VMA of what we need to refer to.
+#: pe-mips.c:704
msgid "%B: unimplemented %s\n"
msgstr "%B: %s sin implementar\n"
-#: pe-mips.c:775
+#: pe-mips.c:730
msgid "%B: jump too far away\n"
msgstr "%B: salto demasiado lejos\n"
-#: pe-mips.c:801
+#: pe-mips.c:756
msgid "%B: bad pair/reflo after refhi\n"
msgstr "%B: pair/reflo erróneo después de refhi\n"
-#: ppcboot.c:418
+#: ppcboot.c:419
#, c-format
msgid ""
"\n"
@@ -2610,27 +2696,27 @@ msgstr ""
"\n"
"encabezado de ppcboot:\n"
-#: ppcboot.c:419
+#: ppcboot.c:420
#, c-format
msgid "Entry offset = 0x%.8lx (%ld)\n"
msgstr "Desplazamiento de entrada = 0x%.8lx (%ld)\n"
-#: ppcboot.c:420
+#: ppcboot.c:421
#, c-format
msgid "Length = 0x%.8lx (%ld)\n"
msgstr "Longitud = 0x%.8lx (%ld)\n"
-#: ppcboot.c:423
+#: ppcboot.c:424
#, c-format
msgid "Flag field = 0x%.2x\n"
msgstr "Campo de opciones = 0x%.2x\n"
-#: ppcboot.c:429
+#: ppcboot.c:430
#, c-format
msgid "Partition name = \"%s\"\n"
msgstr "Nombre de la partición = \"%s\"\n"
-#: ppcboot.c:448
+#: ppcboot.c:449
#, c-format
msgid ""
"\n"
@@ -2639,22 +2725,22 @@ msgstr ""
"\n"
"Partición[%d] inicio = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
-#: ppcboot.c:454
+#: ppcboot.c:455
#, c-format
msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
msgstr "Partición[%d] fin = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
-#: ppcboot.c:460
+#: ppcboot.c:461
#, c-format
msgid "Partition[%d] sector = 0x%.8lx (%ld)\n"
msgstr "Partición[%d] sector = 0x%.8lx (%ld)\n"
-#: ppcboot.c:461
+#: ppcboot.c:462
#, c-format
msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
msgstr "Partición[%d] longitud = 0x%.8lx (%ld)\n"
-#: som.c:5269
+#: som.c:5069
#, c-format
msgid ""
"\n"
@@ -2663,15 +2749,15 @@ msgstr ""
"\n"
"Encabezado Auxiliar de Ejecución\n"
-#: som.c:5543
+#: som.c:5330
msgid "som_sizeof_headers unimplemented"
msgstr "som_sizeof_headers sin implementar"
-#: srec.c:302
+#: srec.c:259
msgid "%B:%d: Unexpected character `%s' in S-record file\n"
msgstr "%B:%d: Caractér `%s' inesperado en el fichero S-record\n"
-#: stabs.c:296
+#: stabs.c:276
msgid "%B(%A+0x%lx): Stabs entry has invalid string index."
msgstr "%B(%A+0x%lx): La entrada de cabos tiene una cadena índice inválida."
@@ -2679,118 +2765,118 @@ msgstr "%B(%A+0x%lx): La entrada de cabos tiene una cadena índice inválida."
msgid "Unsupported .stab relocation"
msgstr "Reubicación .stab sin soporte"
-#: vms-gsd.c:356
+#: vms-gsd.c:337
#, c-format
msgid "bfd_make_section (%s) failed"
msgstr "bfd_make_section (%s) falló"
-#: vms-gsd.c:371
+#: vms-gsd.c:352
#, c-format
msgid "bfd_set_section_flags (%s, %x) failed"
msgstr "bfd_set_section_flags (%s, %x) falló"
-#: vms-gsd.c:407
+#: vms-gsd.c:387
#, c-format
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:702
+#: vms-gsd.c:678
#, c-format
msgid "unknown gsd/egsd subtype %d"
msgstr "subtipo de gsd/egsd %d desconocido"
-#: vms-hdr.c:409
+#: vms-hdr.c:327
msgid "Object module NOT error-free !\n"
msgstr "¡ El módulo objeto NO está libre de errores !\n"
-#: vms-misc.c:541
+#: vms-misc.c:473
#, c-format
msgid "Stack overflow (%d) in _bfd_vms_push"
msgstr "Desbordamiento de la pila (%d) en _bfd_vms_push"
-#: vms-misc.c:559
+#: vms-misc.c:488
msgid "Stack underflow in _bfd_vms_pop"
msgstr "Desbordamiento por debajo de la pila en _bfd_vms_pop"
-#: vms-misc.c:912
+#: vms-misc.c:802
msgid "_bfd_vms_output_counted called with zero bytes"
msgstr "se llamó _bfd_vms_output_counted con cero bytes"
-#: vms-misc.c:917
+#: vms-misc.c:807
msgid "_bfd_vms_output_counted called with too many bytes"
msgstr "se llamó _bfd_vms_output_counted con demasiados bytes"
-#: vms-misc.c:1048
+#: vms-misc.c:925
#, c-format
msgid "Symbol %s replaced by %s\n"
msgstr "El símbolo %s fue reemplazado por %s\n"
-#: vms-misc.c:1111
+#: vms-misc.c:984
#, c-format
msgid "failed to enter %s"
msgstr "falló la introducción de %s"
-#: vms-tir.c:102
+#: vms-tir.c:55
msgid "No Mem !"
msgstr "¡ No hay Memoria !"
-#: vms-tir.c:383
+#: vms-tir.c:298
#, c-format
msgid "bad section index in %s"
msgstr "Índice de sección erróneo en %s"
-#: vms-tir.c:396
+#: vms-tir.c:311
#, c-format
msgid "unsupported STA cmd %s"
msgstr "orden STA %s sin soporte"
-#: vms-tir.c:401 vms-tir.c:1247
+#: vms-tir.c:316 vms-tir.c:1118
#, c-format
msgid "reserved STA cmd %d"
msgstr "orden STA %d reservada"
-#: vms-tir.c:502 vms-tir.c:525
+#: vms-tir.c:408 vms-tir.c:430
#, c-format
msgid "%s: no symbol \"%s\""
msgstr "%s: no existe el símbolo \"%s\""
-#. unsigned shift
-#. rotate
+#. Unsigned shift.
+#. Rotate.
#. Redefine symbol to current location.
#. Define a literal.
-#: vms-tir.c:592 vms-tir.c:704 vms-tir.c:814 vms-tir.c:832 vms-tir.c:840
-#: vms-tir.c:849 vms-tir.c:1570
+#: vms-tir.c:495 vms-tir.c:604 vms-tir.c:702 vms-tir.c:719 vms-tir.c:726
+#: vms-tir.c:734 vms-tir.c:1438
#, c-format
msgid "%s: not supported"
msgstr "%s: no tiene soporte"
-#: vms-tir.c:597 vms-tir.c:1425
+#: vms-tir.c:500 vms-tir.c:1295
#, c-format
msgid "%s: not implemented"
msgstr "%s: sin implementar"
-#: vms-tir.c:601 vms-tir.c:1429
+#: vms-tir.c:504 vms-tir.c:1299
#, c-format
msgid "reserved STO cmd %d"
msgstr "orden STO %d reservada"
-#: vms-tir.c:719 vms-tir.c:1575
+#: vms-tir.c:619 vms-tir.c:1443
#, c-format
msgid "reserved OPR cmd %d"
msgstr "orden OPR %d reservada"
-#: vms-tir.c:787 vms-tir.c:1639
+#: vms-tir.c:679 vms-tir.c:1507
#, c-format
msgid "reserved CTL cmd %d"
msgstr "orden CTL %d reservada"
#. stack byte from image
#. arg: none.
-#: vms-tir.c:1155
+#: vms-tir.c:1026
msgid "stack-from-image not implemented"
msgstr "pila-desde-imagen sin implementar"
-#: vms-tir.c:1173
+#: vms-tir.c:1044
msgid "stack-entry-mask not fully implemented"
msgstr "pila-máscara-entrada no está completamente implementado"
@@ -2801,262 +2887,262 @@ msgstr "pila-máscara-entrada no está completamente implementado"
#.
#. compare argument descriptor with symbol argument (ARG$V_PASSMECH)
#. and stack TRUE (args match) or FALSE (args dont match) value.
-#: vms-tir.c:1187
+#: vms-tir.c:1058
msgid "PASSMECH not fully implemented"
msgstr "PASSMECH no está completamente implementado"
-#: vms-tir.c:1206
+#: vms-tir.c:1077
msgid "stack-local-symbol not fully implemented"
msgstr "pila-símbolo-local no está completamente implementado"
-#: vms-tir.c:1219
+#: vms-tir.c:1090
msgid "stack-literal not fully implemented"
msgstr "pila-literal no está completamente implementado"
-#: vms-tir.c:1240
+#: vms-tir.c:1111
msgid "stack-local-symbol-entry-point-mask not fully implemented"
msgstr "pila-símbolo-local-máscara-punto-entrada no está completamente implementado"
-#: vms-tir.c:1517 vms-tir.c:1529 vms-tir.c:1541 vms-tir.c:1553 vms-tir.c:1618
-#: vms-tir.c:1626 vms-tir.c:1634
+#: vms-tir.c:1385 vms-tir.c:1397 vms-tir.c:1409 vms-tir.c:1421 vms-tir.c:1486
+#: vms-tir.c:1494 vms-tir.c:1502
#, c-format
msgid "%s: not fully implemented"
msgstr "%s: no está completamente implementado"
-#: vms-tir.c:1691
+#: vms-tir.c:1560
#, c-format
msgid "obj code %d not found"
msgstr "no se encontró el código objeto %d"
-#: vms-tir.c:2029
+#: vms-tir.c:1868
#, c-format
msgid "SEC_RELOC with no relocs in section %s"
msgstr "SEC_RELOC sin reubicaciones en la sección %s"
-#: vms-tir.c:2304
+#: vms-tir.c:2150
#, c-format
msgid "Unhandled relocation %s"
msgstr "Reubicación %s sin manejar"
-#: xcofflink.c:1243
+#: xcofflink.c:564
+#, 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:585
+#, c-format
+msgid "%s: dynamic object with no .loader section"
+msgstr "%s: objeto dinámico sin sección .loader"
+
+#: xcofflink.c:1148
msgid "%B: `%s' has line numbers but no enclosing section"
msgstr "%B: `%s' tiene números de línea pero no una sección contenedora"
-#: xcofflink.c:1296
+#: xcofflink.c:1200
msgid "%B: class %d symbol `%s' has no aux entries"
msgstr "%B: clase %d símbolo `%s' no tiene entradas auxiliares"
-#: xcofflink.c:1319
+#: xcofflink.c:1223
msgid "%B: symbol `%s' has unrecognized csect type %d"
msgstr "%B: el símbolo `%s' tiene un tipo csect %d no reconocido"
-#: xcofflink.c:1331
+#: xcofflink.c:1235
msgid "%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
msgstr "%B: símbolo XTY_ER `%s' erróneo: clase %d scnum %d scnlen %d"
-#: xcofflink.c:1367
+#: xcofflink.c:1271
msgid "%B: XMC_TC0 symbol `%s' is class %d scnlen %d"
msgstr "%B: símbolo XMC_TCO `%s' es clase %d scnlen %d"
-#: xcofflink.c:1518
+#: xcofflink.c:1417
msgid "%B: csect `%s' not in enclosing section"
msgstr "%B: csect `%s' no está contenido en una sección"
-#: xcofflink.c:1625
+#: xcofflink.c:1524
msgid "%B: misplaced XTY_LD `%s'"
msgstr "%B: XTY_LD `%s' mal ubicado"
-#: xcofflink.c:1956
+#: xcofflink.c:1839
msgid "%B: reloc %s:%d not in csect"
msgstr "%B: la reubicación %s:%d no está en csect"
-#: xcofflink.c:2093
-#, 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:2114
-#, c-format
-msgid "%s: dynamic object with no .loader section"
-msgstr "%s: objeto dinámico sin sección .loader"
-
-#: xcofflink.c:2759
+#: xcofflink.c:2637
#, c-format
msgid "%s: no such symbol"
msgstr "%s: no hay tal símbolo"
-#: xcofflink.c:2892
-msgid "error: undefined symbol __rtinit"
-msgstr "error: símbolo __rtinit indefinido"
-
-#: xcofflink.c:3449
+#: xcofflink.c:2866
#, c-format
msgid "warning: attempt to export undefined symbol `%s'"
msgstr "aviso: intento de exportar el símbolo sin definir `%s'"
-#: xcofflink.c:4444
+#: xcofflink.c:3033
+msgid "error: undefined symbol __rtinit"
+msgstr "error: símbolo __rtinit indefinido"
+
+#: xcofflink.c:3653
#, 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"
-#: xcofflink.c:5285
+#: xcofflink.c:4489
msgid "%B: loader reloc in unrecognized section `%A'"
msgstr "%B: reubicación del cargador en la sección `%A' no reconocida"
-#: xcofflink.c:5306
+#: xcofflink.c:4510
msgid "%B: `%s' in loader reloc but not loader sym"
msgstr "%B: `%s' en la reubicación del cargador pero no es un símbolo del cargador"
-#: xcofflink.c:5321
+#: xcofflink.c:4525
msgid "%B: loader reloc in read-only section %A"
msgstr "%B: reubicación del cargador en la sección de sólo lectura %A"
-#: xcofflink.c:5747 xcofflink.c:5809 xcofflink.c:6111
+#: xcofflink.c:4934 xcofflink.c:4996 xcofflink.c:5291
#, 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:6122
+#: xcofflink.c:5302
#, 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"
-#: elf32-ia64.c:987 elf64-ia64.c:987
+#: elf32-ia64.c:1139 elf64-ia64.c:1139
msgid "%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."
msgstr "%B: No se puede relajar br en 0x%lx en la sección `%A'. Por favor use brl o ramificación indirecta."
-#: elf32-ia64.c:2339 elf64-ia64.c:2339
+#: elf32-ia64.c:2508 elf64-ia64.c:2508
msgid "@pltoff reloc against local symbol"
msgstr "reubicación @pltoff contra un símbolo local"
-#: elf32-ia64.c:3757 elf64-ia64.c:3757
+#: elf32-ia64.c:3955 elf64-ia64.c:3955
#, c-format
msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
msgstr "%s: segmento de datos short desbordado (0x%lx >= 0x400000)"
-#: elf32-ia64.c:3768 elf64-ia64.c:3768
+#: elf32-ia64.c:3966 elf64-ia64.c:3966
#, c-format
msgid "%s: __gp does not cover short data segment"
msgstr "%s: __gp no cubre el segmento de datos short"
-#: elf32-ia64.c:4015 elf64-ia64.c:4015
+#: elf32-ia64.c:4213 elf64-ia64.c:4213
msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
msgstr "%B: código que no es pic con reubicación imm contra el símbolo dinámico %s"
-#: elf32-ia64.c:4080 elf64-ia64.c:4080
+#: elf32-ia64.c:4280 elf64-ia64.c:4280
msgid "%B: @gprel relocation against dynamic symbol %s"
msgstr "%B: reubicación @gprel contra el símbolo dinámico %s"
-#: elf32-ia64.c:4140 elf64-ia64.c:4140
+#: elf32-ia64.c:4343 elf64-ia64.c:4343
msgid "%B: linking non-pic code in a position independent executable"
msgstr "%B: enlazando código que no es pic en un ejecutable independiente de posición"
-#: elf32-ia64.c:4277 elf64-ia64.c:4277
+#: elf32-ia64.c:4480 elf64-ia64.c:4480
msgid "%B: @internal branch to dynamic symbol %s"
msgstr "%B: ramificación @internal al símbolo dinámico %s"
-#: elf32-ia64.c:4279 elf64-ia64.c:4279
+#: elf32-ia64.c:4482 elf64-ia64.c:4482
msgid "%B: speculation fixup to dynamic symbol %s"
msgstr "%B: compostura de especulación al símbolo dinámico %s"
-#: elf32-ia64.c:4281 elf64-ia64.c:4281
+#: elf32-ia64.c:4484 elf64-ia64.c:4484
msgid "%B: @pcrel relocation against dynamic symbol %s"
msgstr "%B: reubicación @pcrel contra el símbolo dinámico %s"
-#: elf32-ia64.c:4488 elf64-ia64.c:4488
+#: elf32-ia64.c:4691 elf64-ia64.c:4691
msgid "unsupported reloc"
msgstr "reubicación sin soporte"
-#: elf32-ia64.c:4528 elf64-ia64.c:4528
+#: elf32-ia64.c:4724 elf64-ia64.c:4724
msgid "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> 0x1000000)."
msgstr "%B: No se puede relajar br (%s) a `%s' en 0x%lx en la sección `%A' con tamaño 0x%lx (> 0x1000000)."
-#: elf32-ia64.c:4789 elf64-ia64.c:4789
+#: elf32-ia64.c:4985 elf64-ia64.c:4985
msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
msgstr "%B: enlazando deferencias-captura-en-NULL con ficheros que no son de captura"
-#: elf32-ia64.c:4798 elf64-ia64.c:4798
+#: elf32-ia64.c:4994 elf64-ia64.c:4994
msgid "%B: linking big-endian files with little-endian files"
msgstr "%B: enlazando ficheros big-endian con ficheros little-endian"
-#: elf32-ia64.c:4807 elf64-ia64.c:4807
+#: elf32-ia64.c:5003 elf64-ia64.c:5003
msgid "%B: linking 64-bit files with 32-bit files"
msgstr "%B: enlazando ficheros de 64-bit con ficheros de 32-bit"
-#: elf32-ia64.c:4816 elf64-ia64.c:4816
+#: elf32-ia64.c:5012 elf64-ia64.c:5012
msgid "%B: linking constant-gp files with non-constant-gp files"
msgstr "%B: enlazando ficheros de gp constante con ficheros con gp no constante"
-#: elf32-ia64.c:4826 elf64-ia64.c:4826
+#: elf32-ia64.c:5022 elf64-ia64.c:5022
msgid "%B: linking auto-pic files with non-auto-pic files"
msgstr "%B: enlazando ficheros de pic automático con ficheros sin pic automático"
-#: peigen.c:1014 pepigen.c:1014
+#: peigen.c:979 pepigen.c:979
#, c-format
msgid "%s: line number overflow: 0x%lx > 0xffff"
msgstr "%s: desbordamiento de número de línea: 0x%lx > 0xffff"
-#: peigen.c:1041 pepigen.c:1041
+#: peigen.c:1006 pepigen.c:1006
msgid "Export Directory [.edata (or where ever we found it)]"
msgstr "Directorio de Exportación [.edata (o donde quiera que se encuentre)]"
-#: peigen.c:1042 pepigen.c:1042
+#: peigen.c:1007 pepigen.c:1007
msgid "Import Directory [parts of .idata]"
msgstr "Directorio de Importación [partes de .idata]"
-#: peigen.c:1043 pepigen.c:1043
+#: peigen.c:1008 pepigen.c:1008
msgid "Resource Directory [.rsrc]"
msgstr "Directorio de Recursos [.rsrc]"
-#: peigen.c:1044 pepigen.c:1044
+#: peigen.c:1009 pepigen.c:1009
msgid "Exception Directory [.pdata]"
msgstr "Directorio de Excepciones [.pdata]"
-#: peigen.c:1045 pepigen.c:1045
+#: peigen.c:1010 pepigen.c:1010
msgid "Security Directory"
msgstr "Directorio de Seguridad"
-#: peigen.c:1046 pepigen.c:1046
+#: peigen.c:1011 pepigen.c:1011
msgid "Base Relocation Directory [.reloc]"
msgstr "Directorio de Reubicación Base [.reloc]"
-#: peigen.c:1047 pepigen.c:1047
+#: peigen.c:1012 pepigen.c:1012
msgid "Debug Directory"
msgstr "Directorio de Depuración"
-#: peigen.c:1048 pepigen.c:1048
+#: peigen.c:1013 pepigen.c:1013
msgid "Description Directory"
msgstr "Directorio de Descripciones"
-#: peigen.c:1049 pepigen.c:1049
+#: peigen.c:1014 pepigen.c:1014
msgid "Special Directory"
msgstr "Directorio Especial"
-#: peigen.c:1050 pepigen.c:1050
+#: peigen.c:1015 pepigen.c:1015
msgid "Thread Storage Directory [.tls]"
msgstr "Directorio de Almacenamiento de Hilos [.tls]"
-#: peigen.c:1051 pepigen.c:1051
+#: peigen.c:1016 pepigen.c:1016
msgid "Load Configuration Directory"
msgstr "Directorio de Carga de Configuraciones"
-#: peigen.c:1052 pepigen.c:1052
+#: peigen.c:1017 pepigen.c:1017
msgid "Bound Import Directory"
msgstr "Directorio de Importación de Relaciones"
-#: peigen.c:1053 pepigen.c:1053
+#: peigen.c:1018 pepigen.c:1018
msgid "Import Address Table Directory"
msgstr "Directorio de Importación de Tablas de Direcciones"
-#: peigen.c:1054 pepigen.c:1054
+#: peigen.c:1019 pepigen.c:1019
msgid "Delay Import Directory"
msgstr "Directorio de Retardo de Importación"
-#: peigen.c:1055 peigen.c:1056 pepigen.c:1055 pepigen.c:1056
+#: peigen.c:1020 peigen.c:1021 pepigen.c:1020 pepigen.c:1021
msgid "Reserved"
msgstr "Reservado"
-#: peigen.c:1118 pepigen.c:1118
+#: peigen.c:1081 pepigen.c:1081
#, c-format
msgid ""
"\n"
@@ -3065,7 +3151,7 @@ msgstr ""
"\n"
"Hay una tabla de importación, pero la sección que la contiene no se puede encontrar\n"
-#: peigen.c:1123 pepigen.c:1123
+#: peigen.c:1086 pepigen.c:1086
#, c-format
msgid ""
"\n"
@@ -3074,7 +3160,7 @@ msgstr ""
"\n"
"Hay una tabla de importación en %s en 0x%lx\n"
-#: peigen.c:1159 pepigen.c:1159
+#: peigen.c:1129 pepigen.c:1129
#, c-format
msgid ""
"\n"
@@ -3083,12 +3169,12 @@ msgstr ""
"\n"
"Se localizó el descriptor de función en la dirección de inicio: %04lx\n"
-#: peigen.c:1162 pepigen.c:1162
+#: peigen.c:1132 pepigen.c:1132
#, 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"
-#: peigen.c:1170 pepigen.c:1170
+#: peigen.c:1140 pepigen.c:1140
#, c-format
msgid ""
"\n"
@@ -3097,7 +3183,7 @@ msgstr ""
"\n"
"¡No está la sección reldata! No se decodificó el descriptor de función.\n"
-#: peigen.c:1175 pepigen.c:1175
+#: peigen.c:1145 pepigen.c:1145
#, c-format
msgid ""
"\n"
@@ -3106,7 +3192,7 @@ msgstr ""
"\n"
"Las Tablas de Importación (se interpretaron los contenidos de la sección %s)\n"
-#: peigen.c:1178 pepigen.c:1178
+#: peigen.c:1148 pepigen.c:1148
#, c-format
msgid ""
" vma: Hint Time Forward DLL First\n"
@@ -3115,7 +3201,7 @@ msgstr ""
" vma: Pista Fecha Adelante DLL Primero\n"
" Tabla Estampa Cadena Nombre Thunk\n"
-#: peigen.c:1223 pepigen.c:1223
+#: peigen.c:1196 pepigen.c:1196
#, c-format
msgid ""
"\n"
@@ -3124,12 +3210,12 @@ msgstr ""
"\n"
"\tNombre de la DLL: %s\n"
-#: peigen.c:1234 pepigen.c:1234
+#: peigen.c:1207 pepigen.c:1207
#, c-format
msgid "\tvma: Hint/Ord Member-Name Bound-To\n"
msgstr "\tvma: Pista/Ord Nombre-Miembro Unido-A\n"
-#: peigen.c:1259 pepigen.c:1259
+#: peigen.c:1232 pepigen.c:1232
#, c-format
msgid ""
"\n"
@@ -3138,7 +3224,7 @@ msgstr ""
"\n"
"Hay un thunk inicial, pero la sección que lo contiene no se puede encontrar\n"
-#: peigen.c:1399 pepigen.c:1399
+#: peigen.c:1365 pepigen.c:1365
#, c-format
msgid ""
"\n"
@@ -3147,7 +3233,16 @@ msgstr ""
"\n"
"Hay una tabla de exportación, pero la sección que la contiene no se puede encontrar\n"
-#: peigen.c:1404 pepigen.c:1404
+#: peigen.c:1374 pepigen.c:1374
+#, c-format
+msgid ""
+"\n"
+"There is an export table in %s, but it does not fit into that section\n"
+msgstr ""
+"\n"
+"Hay una tabla de exportación en %s, pero no cabe en esa sección\n"
+
+#: peigen.c:1380 pepigen.c:1380
#, c-format
msgid ""
"\n"
@@ -3156,7 +3251,7 @@ msgstr ""
"\n"
"Hay una tabla de exportación en %s en 0x%lx\n"
-#: peigen.c:1435 pepigen.c:1435
+#: peigen.c:1408 pepigen.c:1408
#, c-format
msgid ""
"\n"
@@ -3167,68 +3262,68 @@ msgstr ""
"Las Tablas de Exportación (se interpretaron los contenidos de la sección %s)\n"
"\n"
-#: peigen.c:1439 pepigen.c:1439
+#: peigen.c:1412 pepigen.c:1412
#, c-format
msgid "Export Flags \t\t\t%lx\n"
msgstr "Opciones de Exportación \t\t\t%lx\n"
-#: peigen.c:1442 pepigen.c:1442
+#: peigen.c:1415 pepigen.c:1415
#, c-format
msgid "Time/Date stamp \t\t%lx\n"
msgstr "marca de Hora/Fecha \t\t%lx\n"
-#: peigen.c:1445 pepigen.c:1445
+#: peigen.c:1418 pepigen.c:1418
#, c-format
msgid "Major/Minor \t\t\t%d/%d\n"
msgstr "Mayor/Menor \t\t\t%d/%d\n"
-#: peigen.c:1448 pepigen.c:1448
+#: peigen.c:1421 pepigen.c:1421
#, c-format
msgid "Name \t\t\t\t"
msgstr "Nombre \t\t\t\t"
-#: peigen.c:1454 pepigen.c:1454
+#: peigen.c:1427 pepigen.c:1427
#, c-format
msgid "Ordinal Base \t\t\t%ld\n"
msgstr "Base Ordinal \t\t\t%ld\n"
-#: peigen.c:1457 pepigen.c:1457
+#: peigen.c:1430 pepigen.c:1430
#, c-format
msgid "Number in:\n"
msgstr "Número en:\n"
-#: peigen.c:1460 pepigen.c:1460
+#: peigen.c:1433 pepigen.c:1433
#, c-format
msgid "\tExport Address Table \t\t%08lx\n"
msgstr "\tTabla de Exportación de Direcciones \t\t%08lx\n"
-#: peigen.c:1464 pepigen.c:1464
+#: peigen.c:1437 pepigen.c:1437
#, c-format
msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n"
msgstr "\tTabla [Nombre Puntero/Ordinal]\t%08lx\n"
-#: peigen.c:1467 pepigen.c:1467
+#: peigen.c:1440 pepigen.c:1440
#, c-format
msgid "Table Addresses\n"
msgstr "Direcciones de la Tabla\n"
-#: peigen.c:1470 pepigen.c:1470
+#: peigen.c:1443 pepigen.c:1443
#, c-format
msgid "\tExport Address Table \t\t"
msgstr "\tTabla de Exportación de Direcciones \t\t"
-#: peigen.c:1475 pepigen.c:1475
+#: peigen.c:1448 pepigen.c:1448
#, c-format
msgid "\tName Pointer Table \t\t"
msgstr "\tNombre de la Tabla de Punteros \t\t"
# continuar aqui
-#: peigen.c:1480 pepigen.c:1480
+#: peigen.c:1453 pepigen.c:1453
#, c-format
msgid "\tOrdinal Table \t\t\t"
msgstr "\tTabla Ordinal \t\t\t"
-#: peigen.c:1495 pepigen.c:1495
+#: peigen.c:1467 pepigen.c:1467
#, c-format
msgid ""
"\n"
@@ -3237,15 +3332,15 @@ msgstr ""
"\n"
"Tabla de Exportación de Direcciones -- Base Ordinal %ld\n"
-#: peigen.c:1514 pepigen.c:1514
+#: peigen.c:1486 pepigen.c:1486
msgid "Forwarder RVA"
msgstr "RVA Adelantador"
-#: peigen.c:1525 pepigen.c:1525
+#: peigen.c:1497 pepigen.c:1497
msgid "Export RVA"
msgstr "RVA Exportador"
-#: peigen.c:1532 pepigen.c:1532
+#: peigen.c:1504 pepigen.c:1504
#, c-format
msgid ""
"\n"
@@ -3254,12 +3349,12 @@ msgstr ""
"\n"
"Tabla [Puntero a Ordinal/Nombre]\n"
-#: peigen.c:1587 pepigen.c:1587
+#: peigen.c:1557 pepigen.c:1557
#, 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:1591 pepigen.c:1591
+#: peigen.c:1561 pepigen.c:1561
#, c-format
msgid ""
"\n"
@@ -3268,12 +3363,12 @@ msgstr ""
"\n"
"La Tabla de Funciones (se interpretaron los contenidos de la sección .pdata)\n"
-#: peigen.c:1594 pepigen.c:1594
+#: peigen.c:1564 pepigen.c:1564
#, c-format
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:1596 pepigen.c:1596
+#: peigen.c:1566 pepigen.c:1566
#, c-format
msgid ""
" vma:\t\tBegin End EH EH PrologEnd Exception\n"
@@ -3282,22 +3377,22 @@ msgstr ""
" vma:\t\tInicio Fin EH EH FinPrólogo Excepción\n"
" \t\tDirecc Direcc Asa Datos Dirección Máscara\n"
-#: peigen.c:1666 pepigen.c:1666
+#: peigen.c:1636 pepigen.c:1636
#, c-format
msgid " Register save millicode"
msgstr " Registro para guardar milicódigo"
-#: peigen.c:1669 pepigen.c:1669
+#: peigen.c:1639 pepigen.c:1639
#, c-format
msgid " Register restore millicode"
msgstr " Registro para restaurar milicódigo"
-#: peigen.c:1672 pepigen.c:1672
+#: peigen.c:1642 pepigen.c:1642
#, c-format
msgid " Glue code sequence"
msgstr " Secuencia de código pegamento"
-#: peigen.c:1724 pepigen.c:1724
+#: peigen.c:1692 pepigen.c:1692
#, c-format
msgid ""
"\n"
@@ -3308,7 +3403,7 @@ msgstr ""
"\n"
"Reubicaciones de Fichero Base PE (se interpretaron los contenidos de la sección .reloc)\n"
-#: peigen.c:1754 pepigen.c:1754
+#: peigen.c:1722 pepigen.c:1722
#, c-format
msgid ""
"\n"
@@ -3317,7 +3412,7 @@ msgstr ""
"\n"
"Dirección Virtual: %08lx Tamaño del trozo %ld (0x%lx) Número de composturas %ld\n"
-#: peigen.c:1767 pepigen.c:1767
+#: peigen.c:1735 pepigen.c:1735
#, c-format
msgid "\treloc %4d offset %4x [%4lx] %s"
msgstr "\treubicación %4d desplazamiento %4x [%4lx] %s"
@@ -3325,7 +3420,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:1807 pepigen.c:1807
+#: peigen.c:1773 pepigen.c:1773
#, c-format
msgid ""
"\n"
@@ -3334,6 +3429,36 @@ msgstr ""
"\n"
"Características 0x%x\n"
+#~ msgid "Missing IHCONST"
+#~ msgstr "IHCONST faltante"
+
+#~ msgid "Missing IHIHALF"
+#~ msgstr "IHIHALF faltante"
+
+#~ msgid "missing IHCONST reloc"
+#~ msgstr "reubicación IHCONST faltante"
+
+#~ msgid "missing IHIHALF reloc"
+#~ msgstr "reubicación IHIHALF faltante"
+
+#~ msgid "%B(%A): warning: unresolvable relocation %d against symbol `%s'"
+#~ msgstr "%B(%A): aviso: reubicación %d sin resolución contra el símbolo `%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"
+
+#~ msgid "%B(%A): unresolvable relocation against symbol `%s'"
+#~ msgstr "%B(%A+0x%lx): reubicación sin resolución contra el símbolo `%s'"
+
+#~ msgid "Symbol %s has no GOT subsection for offset 0x%x"
+#~ msgstr "El símbolo %s no tiene subsección GOT para el desplazamiento 0x%x"
+
+#~ msgid "%B: check_relocs: unhandled reloc type %d"
+#~ msgstr "%B: check_relocs: tipo de reubicación %d sin manejar"
+
+#~ msgid "%B: warning: sh_link not set for section `%S'"
+#~ msgstr "%B: aviso: no se estableció sh_link para la sección `%S'"
+
#~ msgid " first occurrence: %s: arm call to thumb"
#~ msgstr " primera ocurrencia: %s: llamada arm a thumb"
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 24797828098..06ded9b9a8a 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2140,6 +2140,14 @@ ENUMDOC
COMMENT
ENUM
+ BFD_RELOC_MIPS_COPY
+ENUMX
+ BFD_RELOC_MIPS_JUMP_SLOT
+ENUMDOC
+ MIPS ELF relocations (VxWorks extensions).
+COMMENT
+
+ENUM
BFD_RELOC_FRV_LABEL16
ENUMX
BFD_RELOC_FRV_LABEL24
@@ -2344,6 +2352,16 @@ ENUMX
ENUMX
BFD_RELOC_X86_64_GOTPC32
ENUMX
+ BFD_RELOC_X86_64_GOT64
+ENUMX
+ BFD_RELOC_X86_64_GOTPCREL64
+ENUMX
+ BFD_RELOC_X86_64_GOTPC64
+ENUMX
+ BFD_RELOC_X86_64_GOTPLT64
+ENUMX
+ BFD_RELOC_X86_64_PLTOFF64
+ENUMX
BFD_RELOC_X86_64_GOTPC32_TLSDESC
ENUMX
BFD_RELOC_X86_64_TLSDESC_CALL
@@ -3093,6 +3111,36 @@ ENUM
ENUMDOC
ADI Blackfin Long Jump pcrel.
ENUM
+ BFD_RELOC_BFIN_GOT17M4
+ENUMX
+ BFD_RELOC_BFIN_GOTHI
+ENUMX
+ BFD_RELOC_BFIN_GOTLO
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC_GOT17M4
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC_GOTHI
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC_GOTLO
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC_VALUE
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI
+ENUMX
+ BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO
+ENUMX
+ BFD_RELOC_BFIN_GOTOFF17M4
+ENUMX
+ BFD_RELOC_BFIN_GOTOFFHI
+ENUMX
+ BFD_RELOC_BFIN_GOTOFFLO
+ENUMDOC
+ ADI Blackfin FD-PIC relocations.
+ENUM
BFD_RELOC_BFIN_GOT
ENUMDOC
ADI Blackfin GOT relocation.
diff --git a/bfd/targets.c b/bfd/targets.c
index 99f300644d1..849eb944fbe 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -554,12 +554,14 @@ extern const bfd_target bfd_efi_app_ia32_vec;
extern const bfd_target bfd_efi_app_ia64_vec;
extern const bfd_target bfd_elf32_avr_vec;
extern const bfd_target bfd_elf32_bfin_vec;
+extern const bfd_target bfd_elf32_bfinfdpic_vec;
extern const bfd_target bfd_elf32_big_generic_vec;
extern const bfd_target bfd_elf32_bigarc_vec;
extern const bfd_target bfd_elf32_bigarm_vec;
extern const bfd_target bfd_elf32_bigarm_symbian_vec;
extern const bfd_target bfd_elf32_bigarm_vxworks_vec;
extern const bfd_target bfd_elf32_bigmips_vec;
+extern const bfd_target bfd_elf32_bigmips_vxworks_vec;
extern const bfd_target bfd_elf32_cr16c_vec;
extern const bfd_target bfd_elf32_cris_vec;
extern const bfd_target bfd_elf32_crx_vec;
@@ -590,6 +592,7 @@ extern const bfd_target bfd_elf32_littlearm_vec;
extern const bfd_target bfd_elf32_littlearm_symbian_vec;
extern const bfd_target bfd_elf32_littlearm_vxworks_vec;
extern const bfd_target bfd_elf32_littlemips_vec;
+extern const bfd_target bfd_elf32_littlemips_vxworks_vec;
extern const bfd_target bfd_elf32_m32c_vec;
extern const bfd_target bfd_elf32_m32r_vec;
extern const bfd_target bfd_elf32_m32rle_vec;
@@ -631,6 +634,7 @@ extern const bfd_target bfd_elf32_shlin_vec;
extern const bfd_target bfd_elf32_shlnbsd_vec;
extern const bfd_target bfd_elf32_shnbsd_vec;
extern const bfd_target bfd_elf32_sparc_vec;
+extern const bfd_target bfd_elf32_sparc_vxworks_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;
@@ -852,6 +856,7 @@ static const bfd_target * const _bfd_target_vector[] = {
#endif
&bfd_elf32_avr_vec,
&bfd_elf32_bfin_vec,
+ &bfd_elf32_bfinfdpic_vec,
/* This, and other vectors, may not be used in any *.mt configuration.
But that does not mean they are unnecessary. If configured with
@@ -863,6 +868,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_bigarm_symbian_vec,
&bfd_elf32_bigarm_vxworks_vec,
&bfd_elf32_bigmips_vec,
+ &bfd_elf32_bigmips_vxworks_vec,
&bfd_elf32_cr16c_vec,
&bfd_elf32_cris_vec,
&bfd_elf32_crx_vec,
@@ -897,6 +903,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_littlearm_symbian_vec,
&bfd_elf32_littlearm_vxworks_vec,
&bfd_elf32_littlemips_vec,
+ &bfd_elf32_littlemips_vxworks_vec,
&bfd_elf32_m32c_vec,
&bfd_elf32_m32r_vec,
&bfd_elf32_m32rle_vec,
@@ -942,6 +949,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_sh64blin_vec,
#endif
&bfd_elf32_sparc_vec,
+ &bfd_elf32_sparc_vxworks_vec,
&bfd_elf32_tradbigmips_vec,
&bfd_elf32_tradlittlemips_vec,
&bfd_elf32_us_cris_vec,
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
index 559f21afb5c..afe42cc948a 100644
--- a/bfd/tekhex.c
+++ b/bfd/tekhex.c
@@ -264,36 +264,50 @@ typedef struct tekhex_data_struct
#define enda(x) (x->vma + x->size)
-static bfd_vma
-getvalue (char **srcp)
+static bfd_boolean
+getvalue (char **srcp, bfd_vma *valuep)
{
char *src = *srcp;
bfd_vma value = 0;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+
+ if (!ISHEX (*src))
+ return FALSE;
+ len = hex_value (*src++);
if (len == 0)
len = 16;
while (len--)
- value = value << 4 | hex_value(*src++);
+ {
+ if (!ISHEX (*src))
+ return FALSE;
+ value = value << 4 | hex_value (*src++);
+ }
*srcp = src;
- return value;
+ *valuep = value;
+ return TRUE;
}
-static unsigned int
-getsym (char *dstp, char **srcp)
+static bfd_boolean
+getsym (char *dstp, char **srcp, unsigned int *lenp)
{
char *src = *srcp;
unsigned int i;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+
+ if (!ISHEX (*src))
+ return FALSE;
+ len = hex_value (*src++);
if (len == 0)
len = 16;
for (i = 0; i < len; i++)
dstp[i] = src[i];
dstp[i] = 0;
*srcp = src + i;
- return len;
+ *lenp = len;
+ return TRUE;
}
static struct data_struct *
@@ -333,11 +347,12 @@ insert_byte (bfd *abfd, int value, bfd_vma addr)
/* The first pass is to find the names of all the sections, and see
how big the data is. */
-static void
+static bfd_boolean
first_phase (bfd *abfd, int type, char *src)
{
asection *section = bfd_abs_section_ptr;
unsigned int len;
+ bfd_vma val;
char sym[17]; /* A symbol can only be 16chars long. */
switch (type)
@@ -345,7 +360,10 @@ first_phase (bfd *abfd, int type, char *src)
case '6':
/* Data record - read it and store it. */
{
- bfd_vma addr = getvalue (&src);
+ bfd_vma addr;
+
+ if (!getvalue (&src, &addr))
+ return FALSE;
while (*src)
{
@@ -355,17 +373,18 @@ first_phase (bfd *abfd, int type, char *src)
}
}
- return;
+ return TRUE;
case '3':
/* Symbol record, read the segment. */
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
section = bfd_get_section_by_name (abfd, sym);
if (section == NULL)
{
char *n = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!n)
- abort (); /* FIXME. */
+ return FALSE;
memcpy (n, sym, len + 1);
section = bfd_make_section (abfd, n);
}
@@ -375,8 +394,11 @@ first_phase (bfd *abfd, int type, char *src)
{
case '1': /* Section range. */
src++;
- section->vma = getvalue (&src);
- section->size = getvalue (&src) - section->vma;
+ if (!getvalue (&src, &section->vma))
+ return FALSE;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ section->size = val - section->vma;
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
break;
case '0':
@@ -393,35 +415,42 @@ first_phase (bfd *abfd, int type, char *src)
char stype = (*src);
if (!new)
- abort (); /* FIXME. */
+ return FALSE;
new->symbol.the_bfd = abfd;
src++;
abfd->symcount++;
abfd->flags |= HAS_SYMS;
new->prev = abfd->tdata.tekhex_data->symbols;
abfd->tdata.tekhex_data->symbols = new;
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!new->symbol.name)
- abort (); /* FIXME. */
+ return FALSE;
memcpy ((char *) (new->symbol.name), sym, len + 1);
new->symbol.section = section;
if (stype <= '4')
new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
else
new->symbol.flags = BSF_LOCAL;
- new->symbol.value = getvalue (&src) - section->vma;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ new->symbol.value = val - section->vma;
}
+ default:
+ return FALSE;
}
}
}
+
+ return TRUE;
}
/* Pass over a tekhex, calling one of the above functions on each
record. */
-static void
-pass_over (bfd *abfd, void (*func) (bfd *, int, char *))
+static bfd_boolean
+pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *))
{
unsigned int chars_on_line;
bfd_boolean eof = FALSE;
@@ -462,8 +491,11 @@ pass_over (bfd *abfd, void (*func) (bfd *, int, char *))
/* Put a null at the end. */
src[chars_on_line] = 0;
- func (abfd, type, src);
+ if (!func (abfd, type, src))
+ return FALSE;
}
+
+ return TRUE;
}
static long
@@ -524,7 +556,9 @@ tekhex_object_p (bfd *abfd)
tekhex_mkobject (abfd);
- pass_over (abfd, first_phase);
+ if (!pass_over (abfd, first_phase))
+ return NULL;
+
return abfd->xvec;
}
diff --git a/bfd/version.h b/bfd/version.h
index 0ab4127a0a5..004c17cc86e 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20060320
+#define BFD_VERSION_DATE 20060623
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_SUFFIX @bfd_version_suffix@
#define BFD_VERSION_STRING @bfd_version_string@ BFD_VERSION_SUFFIX