]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
merge from mainline
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Sun, 3 Nov 2002 22:01:38 +0000 (22:01 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Sun, 3 Nov 2002 22:01:38 +0000 (22:01 +0000)
78 files changed:
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/aoutx.h
bfd/archive.c
bfd/archures.c
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/bfd.c
bfd/binary.c
bfd/coff-arm.c
bfd/coffcode.h
bfd/coffgen.c
bfd/cofflink.c
bfd/config.bfd
bfd/configure
bfd/configure.in
bfd/doc/ChangeLog
bfd/doc/Makefile.am
bfd/doc/Makefile.in
bfd/dwarf2.c
bfd/ecoff.c
bfd/elf-eh-frame.c
bfd/elf.c
bfd/elf32-arc.c
bfd/elf32-arm.h
bfd/elf32-d10v.c
bfd/elf32-i386-fbsd.c [deleted file]
bfd/elf32-i386.c
bfd/elf32-i386qnx.c [deleted file]
bfd/elf32-ip2k.c
bfd/elf32-m32r.c
bfd/elf32-m68hc11.c
bfd/elf32-m68hc12.c
bfd/elf32-or32.c
bfd/elf32-ppc.c
bfd/elf32-ppcqnx.c [deleted file]
bfd/elf32-qnx.h
bfd/elf32-sh-lin.c [deleted file]
bfd/elf32-sh-nbsd.c [deleted file]
bfd/elf32-sh.c
bfd/elf32-sh64-nbsd.c [deleted file]
bfd/elf32-sh64.c
bfd/elf32-shqnx.c [deleted file]
bfd/elf32-v850.c
bfd/elf64-alpha-fbsd.c [deleted file]
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-ppc.c
bfd/elf64-sh64-nbsd.c [deleted file]
bfd/elf64-sh64.c
bfd/elf64-x86-64.c
bfd/elfarm-nabi.c
bfd/elfarmqnx-nabi.c [deleted file]
bfd/elflink.c
bfd/elflink.h
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/elfxx-target.h
bfd/format.c
bfd/gen-aout.c
bfd/libbfd.c
bfd/libbfd.h
bfd/libcoff.h
bfd/linker.c
bfd/merge.c
bfd/opncls.c
bfd/po/BLD-POTFILES.in
bfd/po/SRC-POTFILES.in
bfd/reloc.c
bfd/section.c
bfd/srec.c
bfd/stabs.c
bfd/syms.c
bfd/targets.c
bfd/version.h
bfd/vms-hdr.c
bfd/xcofflink.c

index f4fb4e00e6016eca1b4c6e5ec43b3146023a6a71..f427ee72a0b6bdb41ec69cecf3db737013aa7cc7 100644 (file)
@@ -1,8 +1,482 @@
+2002-11-03  Hans-Peter Nilsson  <hp@axis.com>
+
+       * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters
+       for bfd_elf32_swap_symbol_out.
+
+2002-10-31  David O'Brien  <obrien@FreeBSD.org>
+
+       * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
+       signed and unsigned in comparison.
+
+2002-10-30  Daniel Jacobowitz  <drow@mvista.com>
+
+       * coffcode.h: Remove extraneous '\'.
+
+2002-10-28  H.J. Lu <hjl@gnu.org>
+
+       * Makefile.am (targets.lo): Depend on Makefile instead of
+       config.status.
+       (archures.lo): Likewise.
+       * Makefile.in: Regenerated.
+
+2002-10-25  Jason Thorpe  <thorpej@wasabisystems.com>
+
+       * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add
+       bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to
+       targ_selvecs.
+
+2002-10-25  Jim Wilson  <wilson@redhat.com>
+
+       * elf64-sh64.c (sh_elf64_relocate_section): Call
+       _bfd_elf_rela_local_sym.  Handle relocs against STT_SECTION symbol
+       of SHF_MERGE section.
+
+2002-10-25  Hans-Peter Nilsson  <hp@axis.com>
+
+       * simple.c: Correct placement of ATTRIBUTE_UNUSED.
+
+2002-10-24  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to
+       unsigned int.  Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to
+       unsigned int.
+       (NAME(aout,final_link)): Cast enum used in assignment.
+       (aout_link_write_symbols): Cast enums in comparisons, int values to
+       boolean, enums in assignments to int.
+       (aout_link_input_section_std): Cast rel->r_index to unsigned int.
+       (aout_link_input_section_ext): Likewise.  Cast enums used in comparisons
+       with unsigned ints.
+       (aout_link_reloc_link_order): Cast enum to int in assignment.
+       * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr
+       calls to char *.
+       * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in
+       assignment.
+       * bfd-in2.h (bfd_set_section_vma): Likewise.
+       * bfd.c (bfd_record_phdr): Cast enums in assignments.
+       * binary.c (bfd_alloc): Cast enum to long.
+       * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean.
+       * dwarf2.c (read_abbrevs): Add casts to enum types.
+       (read_attribute_value): Likewise.
+       (arange_add): Cast result of bfd_zalloc call.
+       (comp_unit_contains_address): Return true and false.
+       (comp_unit_find_nearest_line): Cast return to boolean.
+       * format.c (bfd_check_format_matches, bfd_set_format): Likewise.
+       * gen-aout.c: define macro '_' if not defined.
+       * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR.
+       (bfd_bwrite): Cast bfd_realloc to bfd_byte *.
+       (bfd_write_bigendian_4byte_int): Cast return to boolean.
+       (bfd_seek): Cast bfd_realloc to bfd_byte *.
+       (bfd_generic_is_local_label_name): Cast return to boolean.
+       * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'.
+       * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to
+       struct bfd_hash_entry *.
+       (_bfd_generic_link_hash_newfunc): likewise.
+       (_bfd_generic_final_link): Cast enum to unsigned int.
+       * merge.c (sec_merge_emit): Cast return to boolean.
+       (merge_strings): Add casts to const unsigned char *.
+       * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int.
+       (bfd_generic_get_relocated_section_content): Cast enum to unsigned int.
+       * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result to
+       struct bfd_hash_entry *.
+       (bfd_set_section_content): Add cast to PTR in comparison.
+       * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol,
+       simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous,
+       simple_dummy_unattached_reloc,
+       bfd_simple_get_relocated_section_contents): Add K&R declarations and
+       function definitions.
+       * srec.c (S3Forced): Initialize to false.
+       (srec_get_symtab): Cast return value from bfd_alloc to asymbol *.
+       * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons.
+       (_bfd_discard_section_stabs): Likewise.  Also cast return to boolean.
+       * syms.c (bfd_is_undefined_symclass): Cast return to boolean.
+       (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in
+       comparisons.
+
+2002-10-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic
+       relocs into shared lib non-allocated reloc sections.
+
+2002-10-23  Nathan Tallent  <eraxxon@alumni.rice.edu>
+
+       * dwarf2.c (add_line_info): Ensure that the line_info_table is
+       sorted even when given an out-of-order line sequence.
+       (lookup_address_in_line_info_table): When an exact VMA match is
+       not found, return line information with the closest VMA.
+
+2002-10-23 Ross Alexander <ross.alexander@uk.neceur.com>
+
+       * elf64-hppa.c: Force DT_FLAGS to always be set.  Required by
+       HPUX 11.00 patch PHSS_26559.
+
+2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move
+       the options section into a separate section unless IRIX 6
+       compatibility is enabled.
+
+2002-10-22  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elflink.h (struct elf_link_sort_rela): Turn rel and rela
+       into arrays.
+       (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust.
+       (elf_link_sort_relocs): Likewise.  Take int_rels_per_ext_rel
+       into account.
+       * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose
+       R_MIPS_REL32 with R_MIPS64 if ABI_64_P.
+
+2002-10-21  Graeme Peterson  <gp@qnx.com>
+
+       * targets.c (_bfd_target_vector): Add missing qnx vectors.
+
+2002-10-21  Alan Modra  <amodra@bigpond.net.au>
+
+       * targets.c (bfd_target_list): Don't return the default target twice.
+
+2002-10-21  Elias Athanasopoulos  <eathan@otenet.gr>
+
+       * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace
+       perror with bfd_perror.
+
+2002-10-19  H.J. Lu <hjl@gnu.org>
+
+       * elflink.h (elf_link_add_object_symbols): Correctly handle
+       DT_RPATH and DT_RUNPATH.
+
+2002-10-19  Mark Kettenis  <kettenis@gnu.org>
+
+       * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes.
+
+2002-10-17  Denis Chertykov  <denisc@overta.ru>
+
+       * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code
+       for ip2k port.
+
+2002-10-17  Alan Modra  <amodra@bigpond.net.au>
+
+       * elfxx-target.h (USE_REL): Don't define as 1.
+       * elf32-arm.h (USE_REL): Provide a default define of 0.
+       Use #if rather than #ifdef when testing USE_REL.
+       * elf32-m32r.c: Likewise.
+
+       * elf32-arc.c (USE_REL): Define as 1.
+       * elf32-d10v.c (USE_REL): Likewise.
+       * elf32-m32r.c (USE_REL): Likewise.
+       * elf32-m68hc11.c (USE_REL): Likewise.
+       * elf32-m68hc12.c (USE_REL): Likewise.
+       * elf32-or32.c (USE_REL): Likewise.
+       * elfarm-nabi.c (USE_REL): Likewise.
+
+2002-10-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * config.bfd (s390-*-linux*): Add targ64_selvecs.
+       (s390x-*-linux*): Add targ_selvecs.
+
+2002-10-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,
+       elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo,
+       elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo,
+       elf32-sh64-nbsd.lo, elf32-shqnx.lo.  Add elf32-qnx.lo.
+       (BFD32_BACKENDS_CFILES): Likewise for corresponding C files.
+       (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo.
+       (BFD64_BACKENDS_CFILES): Likewise for corresponding C files.
+       (SOURCE_HFILES): Add elf32-qnx.h.
+       (BUILD_HFILES): Add bfdver.h.
+       Run "make dep-am".
+       * Makefile.in: Regenerate.
+       * configure.in Update bfd vector dependencies.
+       * configure: Regenerate.
+       * elf32-i386-fbsd.c: Delete.  Move code to elf32-i386.c.
+       * elf32-i386qnx.c: Likewise.
+       * elf32-ppcqnx.c: Delete.  Move code to elf32-ppc.c.
+       * elf32-sh-nbsd.c: Delete.  Move code to elf32-sh.c.
+       * elf32-sh-lin.c: Likewise.
+       * elf32-shqnx.c: Likewise.
+       * elf32-sh64-lin.c: Delete.  Move code to elf32-sh64.c.
+       * elf32-sh64-nbsd.c: Likewise.
+       * elf64-sh64-lin.c: Delete.  Move code to elf64-sh64.c.
+       * elf64-sh64-nbsd.c: Likewise.
+       * elfarmqnx-nabi.c: Delete.  Move code to elfarm-nabi.c.
+       * elf32-arm.h (ELF_MAXPAGESIZE): Always define.
+       * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests.
+       * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests.
+       * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define.
+       (elf_backend_is_contained_by_filepos): Likewise.
+       (elf_backend_copy_private_bfd_data_p): Likewise.
+       Globalize and move functions to..
+       * elf32-qnx.c: ..here.  New file.
+       * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests.  Don't
+       emit target vectors when INCLUDE_SHMEDIA.
+       * elf32-sh64.c: Remove ELF_ARCH test.  Move TARGET_* etc. defines to
+       end of file.
+       * elf64-sh64.c: Remove ELF_ARCH test.
+       * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test.
+       * po/BLD-POTFILES.in: Regenerate.
+       * po/SRC-POTFILES.in: Regenerate.
+
+2002-10-16  Alan Modra  <amodra@bigpond.net.au>
+
+       * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects
+       loaded with --just-symbols.
+
+       * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define.
+       * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
+       * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
+       * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
+
+2002-10-15  Richard Henderson  <rth@redhat.com>
+
+       * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd.
+       (BFD64_BACKENDS_CFILES): Likewise.
+       * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha.
+       * elf64-alpha-fbsd.c: Remove file, move code ...
+       * elf64-alpha.c: ... here.
+       * Makefile.in, configure: Rebuild.
+
+2002-10-14  Richard Henderson  <rth@redhat.com>
+
+       * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment
+       VALUE, not ADDEND.
+
+2002-10-14  Stephen Clarke <stephen.clarke@superh.com>
+
+       * elf32-sh.c (elf_sh_link_hash_entry): Replace
+       datalabel_got_offset with union of datalabel_got
+       offset and refcount.
+       (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount.
+       (allocate_dynrelocs): Delete unnecessary code for
+       STT_DATALABEL type.  Create entry in got for
+       datalabel version of symbol if datalabel_got.refcount > 0.
+       (sh_elf_relocate_section): Use datalabel_got union.
+       (sh_elf_gc_sweep_hook): Pull common code to initialize
+       h and eh out of switch statement.  Declare seen_stt_datalabel.
+       Initialize it.  Decrement datalabel_got.refcount for
+       got relocs when seen_stt_datalabel is true.
+       Decrement local_got_refcounts entry for datalabel got relocs
+       of local symbols.
+       (sh_elf_copy_indirect_symbol): Copy datalabel_got field over.
+       (sh_elf_check_relocs): Declare seen_stt_datalabel.
+       Initialize it.  When seen_stt_datalabel is true, increment
+       datalabel_got refcount rather than got.refcount.
+       (sh_elf_finish_dynamic_symbol): Create relocs to
+       initialize got entry for datalabel version of symbol.
+
+2002-10-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * Makefile.am: Run "make dep-am".
+       (BFD_H_FILES): Remove version.h.
+       * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move..
+       * version.h: ..to here.
+       * configure.in (bfd_version_date): Remove.
+       (AC_OUTPUT): Make bfdver.h from version.h.
+       * bfd.c: #include "bfdver.h".
+       * vms-hdr.c: Likewise.
+       * Makefile.in: Regenerate.
+       * bfd-in2.h: Regenerate.
+       * configure: Regenerate.
+       * po/SRC-POTFILES.in: Regenerate.
+
+2002-10-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
+       bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
+       bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
+       bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
+       bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
+       bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
+       bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
+       bfd_mach_ip2022, bfd_mach_ip2022ext,
+       bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
+       * bfd-in2.h: Regenerate.
+
+2002-10-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative
+       endian vector to targ_selvecs.
+
+2002-10-13  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elfxx-mips.c (mips_elf_calculate_relocation): Take
+       save_addend argument.  Don't apply the 32-bit mask to a
+       GPREL32 value if it's to be used in another relocation.  Don't
+       use forced-check computation of local_p to decide whether to
+       add gp0 to GPREL16 value.  Don't use only the lowest 16 bits
+       of the addend of a non-in-place GPREL16 relocation.
+       (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to
+       mips_elf_calculate_relocation().
+
+2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs
+       with symbols in other sections if we relaxed something;  the sections
+       output offsets must be re-computed before.
+
+2002-10-12  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols
+       handling to use Elf_Internal_Sym.
+       (m68hc11_elf_relax_delete_bytes): Likewise.
+
+2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,
+       sh_elf_object_p, dtpoff_base): New functions.
+       (sh_elf_howto_table): Add TLS relocs.
+       (sh_reloc_map): Likewise.
+       (sh_elf_info_to_howto): Support TLS relocs.
+       (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32.
+       (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type):
+       New macros.
+       (sh_elf_obj_tdata): New.
+       (elf_sh_link_hash_table): Add tls_ldm_got.
+       (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got.
+       (allocate_dynrelocs): Support TLS relocs.
+       (sh_elf_size_dynamic_sections): Likewise.
+       (sh_elf_relocate_section): Support TLS relocs.  Don't try to find
+       .rela.got section when found already.  Return false after printing
+       error about unresolvable relocation.
+       (sh_elf_gc_sweep_hook): Support TLS relocs.
+       (sh_elf_check_relocs): Likewise.
+       (sh_elf_finish_dynamic_symbol): Likewise.
+       (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case.
+       * reloc.c: Add SH TLS relocs.
+       * bfd-in2.h, libbfd.h: Regenerate.
+
+2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       * Makefile.in: Regenerated.
+
+2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       * Makefile.am: Run dep-am.
+       (BFD_H_DEP): Add simple.c and linker.c.
+       (BFD32_LIBS): Add simple.lo.
+       (BFD32_LIBS_CFILES): Add simple.c.
+       * Makefile.in: Regenerated.
+       * bfd-in2.h: Regenerated.
+       * simple.c: New file.
+
+2002-10-11  Alan Modra  <amodra@bigpond.net.au>
+
+       * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers.
+       (record_thumb_to_arm_glue): Likewise.
+       * ecoff.c (ecoff_link_add_externals): Likewise.
+       * elf32-arm.h (record_arm_to_thumb_glue): Likewise.
+       (record_thumb_to_arm_glue): Likewise.
+       * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
+       * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
+       * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
+       * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
+       * elf64-ppc.c (func_desc_adjust): Likewise.
+       * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
+       (sh64_elf64_create_dynamic_sections): Likewise.
+       * elflink.c (_bfd_elf_create_got_section): Likewise.
+       (_bfd_elf_create_dynamic_sections): Likewise.
+       (_bfd_elf_create_linker_section): Likewise.
+       * elflink.h (elf_add_default_symbol): Likewise.
+       (elf_link_create_dynamic_sections): Likewise.
+       (NAME(bfd_elf,size_dynamic_sections)): Likewise.
+       * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise.
+       * elfxx-mips.c (mips_elf_create_got_section): Likewise.
+       (_bfd_mips_elf_add_symbol_hook): Likewise.
+       (_bfd_mips_elf_create_dynamic_sections): Likewise.
+       * linker.c (generic_link_add_symbol_list): Likewise.
+       * xcofflink.c (xcoff_link_add_symbols): Likewise.
+
+       * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define.
+
+       * elf64-ppc.c (edit_opd): Only zero opd syms when function is
+       completely removed.  Correct local sym adjustment.
+
+2002-10-10  Stephen Clarke <stephen.clarke@superh.com>
+
+       * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
+       Correct mistake in calculation of address of .got.
+       * elf64-sh64.c (elf_sh64_pic_plt_entry_be,
+       elf_sh64_pic_plt_entry_le): Likewise.
+
+2002-10-09  Richard Shann <richard.shann@superh.com>
+           Stephen Clarke <stephen.clarke@superh.com>
+
+       * Makefile.am: Add entries for elf32-sh64-lin.c and
+       elf64-sh64-lin.c. Regenerate.
+       * Makefile.in: Regenerate.
+       * config.bfd:  Change sh64eb-*-linux* and sh64-*-linux*
+       to use sh64 vectors rather than sh vectors.
+       * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
+       bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
+       * configure: Regenerate.
+       * elf32-sh64-lin.c: New file.
+       * elf64-sh64-lin.c: New file.
+       * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
+       bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
+
+2002-10-08  H.J. Lu <hjl@gnu.org>
+
+       * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
+       IE->LE transition for R_386_TLS_IE.
+
+2002-10-08  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf64-ppc.c (edit_opd): Correct test for discarded sections.
+
+2002-10-07  Mark Elbrecht  <snowball3@softhome.net>
+
+       * cofflink.c (mark_relocs): Don't mark relocations in excluded
+       sections.
+
+2002-10-07  Alan Modra  <amodra@bigpond.net.au>
+
+       * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent
+       code.
+
+       * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx.
+
+2002-10-06  Alan Modra  <amodra@bigpond.net.au>
+
+       * opncls.c: Formatting.
+       (_bfd_new_bfd): Use a smaller section hash table.
+
+2002-10-05  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type
+       of the other two relocations packed with a REL32 to NONE.
+
+2002-10-02  Stephen Clarke <stephen.clarke@superh.com>
+
+       * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
+       (sh_elf_link_hash_newfunc): Initialize it.
+       (allocate_dynrelocs): Transfer gotplt refs from plt.refcount
+       to got.refcount for symbols that are forced local or when
+       we have direct got refs.
+       (sh_elf_gc_sweep_hook): Adjust gotplt_refcount.  Use it
+       to correctly adjust got.refcount and plt.refcount.
+       (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across.
+       (sh_elf_check_relocs): Increment gotplt_refcount.
+
+2002-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf32-i386.c (elf_i386_relocate_section): Fix
+       movl foo@indntpoff, %eax IE->LE transition.
+
+2002-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD
+       sequence and its transitions.
+
+2002-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
+       to st_value + addend in non-code sections.
+       * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
+       R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
+
 2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
-            Ken Raeburn  <raeburn@cygnus.com>
-            Aldy Hernandez  <aldyh@redhat.com>
-            Eric Christopher  <echristo@redhat.com>
-            Richard Sandiford  <rsandifo@redhat.com>
+           Ken Raeburn  <raeburn@cygnus.com>
+           Aldy Hernandez  <aldyh@redhat.com>
+           Eric Christopher  <echristo@redhat.com>
+           Richard Sandiford  <rsandifo@redhat.com>
 
        * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
        (bfd_mach_mips5500): New.
        * elfcode.h (elf_slurp_reloc_table_from_section): Check
        for overflow.
 
-2002-09-17  Stan Cox <scox@redhat.com> 
+2002-09-17  Stan Cox <scox@redhat.com>
 
        * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
        (mips_elf64_final_gp): Don't make up gp value.
 2002-09-10  Michael Snyder  <msnyder@redhat.com>
 
        * irix-core.c (do_sections, do_sections64): New functions.
-       (irix_core_core_file_p): Call new functions do_sections, 
+       (irix_core_core_file_p): Call new functions do_sections,
        do_sections64, depending on corefile (32-bit or 64-bit).
 
 2002-09-09  Richard Henderson  <rth@redhat.com>
 
 2002-09-04  Kevin Buettner  <kevinb@redhat.com>
 
-       * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
-       vector.
+       * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
+       vector.
 
 2002-09-02  Nick Clifton  <nickc@redhat.com>
 
        (v850_elf_relax_section): Replace caching of external symbols
        with caching of internal symbols obtained from calling
        bfd_elf_get_elf_syms().
-        Fixup problems with freeing cached allocated memory blocks.
+       Fixup problems with freeing cached allocated memory blocks.
 
 2002-09-02  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
        value if .init is an SHmedia function.  Similarly for DT_FINI.
        * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
-       
+
 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
 
        * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
 2002-08-22  Kaz Kojima <kkojima@rr.iij4u.or.jp>
 
        * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
-       byte read when reading the return address register column. 
+       byte read when reading the return address register column.
 
 2002-08-22  Nick Clifton  <nickc@redhat.com>
 
        argument declaration.
 
 2002-08-19  Elena Zannoni <ezannoni@redhat.com>
-        * archures.c (bfd_mach_ppc_e500): Added.
-        * bfd-in2.h: Rebuilt.
+
+       * archures.c (bfd_mach_ppc_e500): Added.
+       * bfd-in2.h: Rebuilt.
        * cpu-powerpc.c (bfd_powerpc_archs): Added e500.
 
 2002-08-19  Alan Modra  <amodra@bigpond.net.au>
 2002-08-17  Andrew Cagney  <ac131313@redhat.com>
 
        * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
-       `bfd_byte'.
+       `bfd_byte'.
 
 2002-08-17  Stan Cox  <scox@redhat.com>
 
        * bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
        symbols when looking for section referred to by a relocation.
        * bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
-       
+
 2002-08-15  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-i370.c: Move reloc enum to include/elf/i370.h.
 
 2002-08-09  Graeme Peterson  <gp@qnx.com>
 
-       * Makefile.am: Add entries for elf32-ppcqnx.c, and add 
+       * Makefile.am: Add entries for elf32-ppcqnx.c, and add
        elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c.
        * Makefile.in: Regenerate.
        * config.bfd: Add support for powerpc{le}-*-nto targets.
index 0aa98e3b87f81924084017bb576a7cecdd0dcfab..151fff1d39d6da851abd53c54cc30895463525cf 100644 (file)
@@ -32,7 +32,7 @@ BFD32_LIBS = \
        format.lo init.lo libbfd.lo opncls.lo reloc.lo \
        section.lo syms.lo targets.lo hash.lo linker.lo \
        srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
-       merge.lo dwarf2.lo
+       merge.lo dwarf2.lo simple.lo
 
 BFD64_LIBS = archive64.lo
 
@@ -41,7 +41,7 @@ BFD32_LIBS_CFILES = \
        format.c init.c libbfd.c opncls.c reloc.c \
        section.c syms.c targets.c hash.c linker.c \
        srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
-       merge.c dwarf2.c
+       merge.c dwarf2.c simple.c
 
 BFD64_LIBS_CFILES = archive64.c
 
@@ -203,7 +203,6 @@ BFD32_BACKENDS = \
        elf32-arc.lo \
        elfarm-oabi.lo \
        elfarm-nabi.lo \
-       elfarmqnx-nabi.lo \
        elf32-avr.lo \
        elf32-cris.lo \
        elf32-d10v.lo \
@@ -216,8 +215,6 @@ BFD32_BACKENDS = \
        elf32-hppa.lo \
        elf32-i370.lo \
        elf32-i386.lo \
-       elf32-i386-fbsd.lo \
-       elf32-i386qnx.lo \
        elf32-i860.lo \
        elf32-i960.lo \
        elf32-ia64.lo \
@@ -236,15 +233,11 @@ BFD32_BACKENDS = \
        elf32-or32.lo \
        elf32-pj.lo \
        elf32-ppc.lo \
-       elf32-ppcqnx.lo \
+       elf32-qnx.lo \
        elf32-s390.lo \
        elf32-sh.lo \
-       elf32-sh-lin.lo \
        elf32-sh64.lo \
        elf32-sh64-com.lo \
-       elf32-sh-nbsd.lo \
-       elf32-sh64-nbsd.lo \
-       elf32-shqnx.lo \
        elf32-sparc.lo \
        elf32-v850.lo \
        elf32-vax.lo \
@@ -366,7 +359,6 @@ BFD32_BACKENDS_CFILES = \
        elf32-arc.c \
        elfarm-oabi.c \
        elfarm-nabi.c \
-       elfarmqnx-nabi.c \
        elf32-avr.c \
        elf32-cris.c \
        elf32-d10v.c \
@@ -379,8 +371,6 @@ BFD32_BACKENDS_CFILES = \
        elf32-hppa.c \
        elf32-i370.c \
        elf32-i386.c \
-       elf32-i386-fbsd.c \
-       elf32-i386qnx.c \
        elf32-i860.c \
        elf32-i960.c \
        elf32-ip2k.c \
@@ -398,15 +388,11 @@ BFD32_BACKENDS_CFILES = \
        elf32-or32.c \
        elf32-pj.c \
        elf32-ppc.c \
-       elf32-ppcqnx.c \
+       elf32-qnx.c \
        elf32-sh64.c \
        elf32-sh64-com.c \
        elf32-s390.c \
        elf32-sh.c \
-       elf32-sh-lin.c \
-       elf32-sh-nbsd.c \
-       elf32-sh64-nbsd.c \
-       elf32-shqnx.c \
        elf32-sparc.c \
        elf32-v850.c \
        elf32-vax.c \
@@ -489,7 +475,6 @@ BFD64_BACKENDS = \
        efi-app-ia64.lo \
        elf64-x86-64.lo \
        elf64-alpha.lo \
-       elf64-alpha-fbsd.lo \
        elf64-hppa.lo \
        elf64-ia64.lo \
        elf64-gen.lo \
@@ -497,7 +482,6 @@ BFD64_BACKENDS = \
        elf64-mips.lo \
        elf64-mmix.lo \
        elf64-sh64.lo \
-       elf64-sh64-nbsd.lo \
        elf64-ppc.lo \
        elf64-s390.lo \
        elf64-sparc.lo \
@@ -516,7 +500,6 @@ BFD64_BACKENDS_CFILES = \
        efi-app-ia64.c \
        elf64-x86-64.c \
        elf64-alpha.c \
-       elf64-alpha-fbsd.c \
        elf64-hppa.c \
        elf64-gen.c \
        elfn32-mips.c \
@@ -525,7 +508,6 @@ BFD64_BACKENDS_CFILES = \
        elf64-ppc.c \
        elf64-s390.c \
        elf64-sh64.c \
-       elf64-sh64-nbsd.c \
        elf64-sparc.c \
        elf64.c \
        mmo.c \
@@ -579,16 +561,17 @@ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
 ## This is a list of all .h files which are in the source tree.
 SOURCE_HFILES = \
        aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
-       elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \
-       elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
-       libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
-       libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
-       nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \
-       xcoff-target.h version.h
+       elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf32-qnx.h \
+       elf64-hppa.h elfcode.h elfcore.h elflink.h \
+       freebsd.h genlink.h go32stub.h \
+       libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
+       libnlm.h liboasys.h libpei.h libxcoff.h \
+       netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
+       peicode.h som.h version.h vms.h xcoff-target.h
 
 ## ... and all .h files which are in the build tree.
 BUILD_HFILES = \
-       elf32-target.h elf64-target.h targmatch.h
+       bfdver.h elf32-target.h elf64-target.h targmatch.h
 
 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
 
@@ -671,10 +654,10 @@ targmatch.h: config.bfd targmatch.sed
 # When compiling archures.c and targets.c, supply the default target
 # info from configure.
 
-targets.lo: targets.c config.status
+targets.lo: targets.c Makefile
        $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/targets.c
 
-archures.lo: archures.c config.status
+archures.lo: archures.c Makefile
        $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
 
 elf32-target.h : elfxx-target.h
@@ -806,7 +789,7 @@ stmp-bfd-h: bfd-in3.h
        touch stmp-bfd-h
 
 BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
-       reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h
+       reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c
 BFD64_H_FILES = archive64.c
 LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
 LIBCOFF_H_FILES = libcoff-in.h coffcode.h
@@ -863,7 +846,7 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
 archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
   $(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h
 archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
-bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
+bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
@@ -900,6 +883,7 @@ merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
 dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
+simple.lo: simple.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h
 archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h
 cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h
 cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h
@@ -1115,12 +1099,7 @@ elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
 elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
   $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
-  elf32-arm.h elf32-target.h
-elfarmqnx-nabi.lo: elfarmqnx-nabi.c elfarm-nabi.c $(INCDIR)/elf/arm.h \
-  $(INCDIR)/elf/reloc-macros.h $(INCDIR)/filenames.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-qnx.h \
-  elf32-arm.h elf32-target.h
+  elf32-arm.h elf32-target.h elf32-qnx.h
 elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \
@@ -1167,15 +1146,7 @@ elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
 elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \
-  elf32-target.h
-elf32-i386-fbsd.lo: elf32-i386-fbsd.c $(INCDIR)/filenames.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-i386.c \
-  $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-i386qnx.lo: elf32-i386qnx.c elf32-i386.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-qnx.h elf32-target.h
+  elf32-target.h elf32-qnx.h
 elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \
@@ -1246,11 +1217,10 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
 elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
-  elf32-target.h
-elf32-ppcqnx.lo: elf32-ppcqnx.c elf32-ppc.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-qnx.h elf32-target.h
+  elf32-target.h elf32-qnx.h
+elf32-qnx.lo: elf32-qnx.c $(INCDIR)/filenames.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h elf32-qnx.h
 elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
@@ -1267,24 +1237,7 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
 elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
-  elf32-target.h
-elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \
-  $(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \
-  $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \
-  $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
-  $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-shqnx.lo: elf32-shqnx.c elf32-sh.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-qnx.h elf32-target.h
+  elf32-target.h elf32-qnx.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
@@ -1493,8 +1446,8 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   vms.h
 vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   vms.h
-vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
-  $(INCDIR)/safe-ctype.h vms.h
+vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h vms.h
 vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   vms.h
 vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
@@ -1533,13 +1486,6 @@ elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \
   $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
   $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \
   libecoff.h ecoffswap.h elf64-target.h
-elf64-alpha-fbsd.lo: elf64-alpha-fbsd.c $(INCDIR)/filenames.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf64-alpha.c \
-  $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \
-  $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
-  $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
-  libcoff.h libecoff.h ecoffswap.h elf64-target.h
 elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \
   $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
@@ -1578,10 +1524,6 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
   elf64-target.h
-elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \
-  $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \
-  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf64-target.h
 elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \
index 4816c1718b0bac6369daf4a070c18ead777d0ce1..59d8a65c34e2b21b69a62ed5219aea0c5e7d66ea 100644 (file)
@@ -118,7 +118,6 @@ bfd_default_target_size = @bfd_default_target_size@
 bfd_libs = @bfd_libs@
 bfd_machines = @bfd_machines@
 bfd_version = @bfd_version@
-bfd_version_date = @bfd_version_date@
 bfd_version_string = @bfd_version_string@
 l = @l@
 tdefaults = @tdefaults@
@@ -156,7 +155,7 @@ BFD32_LIBS = \
        format.lo init.lo libbfd.lo opncls.lo reloc.lo \
        section.lo syms.lo targets.lo hash.lo linker.lo \
        srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
-       merge.lo dwarf2.lo
+       merge.lo dwarf2.lo simple.lo
 
 
 BFD64_LIBS = archive64.lo
@@ -166,7 +165,7 @@ BFD32_LIBS_CFILES = \
        format.c init.c libbfd.c opncls.c reloc.c \
        section.c syms.c targets.c hash.c linker.c \
        srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
-       merge.c dwarf2.c
+       merge.c dwarf2.c simple.c
 
 
 BFD64_LIBS_CFILES = archive64.c
@@ -331,7 +330,6 @@ BFD32_BACKENDS = \
        elf32-arc.lo \
        elfarm-oabi.lo \
        elfarm-nabi.lo \
-       elfarmqnx-nabi.lo \
        elf32-avr.lo \
        elf32-cris.lo \
        elf32-d10v.lo \
@@ -344,8 +342,6 @@ BFD32_BACKENDS = \
        elf32-hppa.lo \
        elf32-i370.lo \
        elf32-i386.lo \
-       elf32-i386-fbsd.lo \
-       elf32-i386qnx.lo \
        elf32-i860.lo \
        elf32-i960.lo \
        elf32-ia64.lo \
@@ -364,15 +360,11 @@ BFD32_BACKENDS = \
        elf32-or32.lo \
        elf32-pj.lo \
        elf32-ppc.lo \
-       elf32-ppcqnx.lo \
+       elf32-qnx.lo \
        elf32-s390.lo \
        elf32-sh.lo \
-       elf32-sh-lin.lo \
        elf32-sh64.lo \
        elf32-sh64-com.lo \
-       elf32-sh-nbsd.lo \
-       elf32-sh64-nbsd.lo \
-       elf32-shqnx.lo \
        elf32-sparc.lo \
        elf32-v850.lo \
        elf32-vax.lo \
@@ -495,7 +487,6 @@ BFD32_BACKENDS_CFILES = \
        elf32-arc.c \
        elfarm-oabi.c \
        elfarm-nabi.c \
-       elfarmqnx-nabi.c \
        elf32-avr.c \
        elf32-cris.c \
        elf32-d10v.c \
@@ -508,8 +499,6 @@ BFD32_BACKENDS_CFILES = \
        elf32-hppa.c \
        elf32-i370.c \
        elf32-i386.c \
-       elf32-i386-fbsd.c \
-       elf32-i386qnx.c \
        elf32-i860.c \
        elf32-i960.c \
        elf32-ip2k.c \
@@ -527,15 +516,11 @@ BFD32_BACKENDS_CFILES = \
        elf32-or32.c \
        elf32-pj.c \
        elf32-ppc.c \
-       elf32-ppcqnx.c \
+       elf32-qnx.c \
        elf32-sh64.c \
        elf32-sh64-com.c \
        elf32-s390.c \
        elf32-sh.c \
-       elf32-sh-lin.c \
-       elf32-sh-nbsd.c \
-       elf32-sh64-nbsd.c \
-       elf32-shqnx.c \
        elf32-sparc.c \
        elf32-v850.c \
        elf32-vax.c \
@@ -619,7 +604,6 @@ BFD64_BACKENDS = \
        efi-app-ia64.lo \
        elf64-x86-64.lo \
        elf64-alpha.lo \
-       elf64-alpha-fbsd.lo \
        elf64-hppa.lo \
        elf64-ia64.lo \
        elf64-gen.lo \
@@ -627,7 +611,6 @@ BFD64_BACKENDS = \
        elf64-mips.lo \
        elf64-mmix.lo \
        elf64-sh64.lo \
-       elf64-sh64-nbsd.lo \
        elf64-ppc.lo \
        elf64-s390.lo \
        elf64-sparc.lo \
@@ -647,7 +630,6 @@ BFD64_BACKENDS_CFILES = \
        efi-app-ia64.c \
        elf64-x86-64.c \
        elf64-alpha.c \
-       elf64-alpha-fbsd.c \
        elf64-hppa.c \
        elf64-gen.c \
        elfn32-mips.c \
@@ -656,7 +638,6 @@ BFD64_BACKENDS_CFILES = \
        elf64-ppc.c \
        elf64-s390.c \
        elf64-sh64.c \
-       elf64-sh64-nbsd.c \
        elf64-sparc.c \
        elf64.c \
        mmo.c \
@@ -714,16 +695,17 @@ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
 
 SOURCE_HFILES = \
        aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
-       elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \
-       elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \
-       libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
-       libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
-       nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \
-       xcoff-target.h version.h
+       elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf32-qnx.h \
+       elf64-hppa.h elfcode.h elfcore.h elflink.h \
+       freebsd.h genlink.h go32stub.h \
+       libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
+       libnlm.h liboasys.h libpei.h libxcoff.h \
+       netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \
+       peicode.h som.h version.h vms.h xcoff-target.h
 
 
 BUILD_HFILES = \
-       elf32-target.h elf64-target.h targmatch.h
+       bfdver.h elf32-target.h elf64-target.h targmatch.h
 
 
 HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
@@ -754,7 +736,7 @@ BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
 LOCAL_H_DEPS = libbfd.h sysdep.h config.h
 
 BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
-       reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h
+       reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c
 
 BFD64_H_FILES = archive64.c
 LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
@@ -770,7 +752,7 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =  bfd-in3.h
+CONFIG_CLEAN_FILES =  bfd-in3.h bfdver.h
 LIBRARIES =  $(noinst_LIBRARIES)
 
 
@@ -785,7 +767,7 @@ LTLIBRARIES =  $(bfdlib_LTLIBRARIES)
 libbfd_la_OBJECTS =  archive.lo archures.lo bfd.lo cache.lo coffgen.lo \
 corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo \
 syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo \
-ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo archive64.lo
+ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo archive64.lo
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -793,7 +775,7 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
 DIST_COMMON =  README ./stamp-h.in COPYING ChangeLog Makefile.am \
 Makefile.in TODO acinclude.m4 aclocal.m4 bfd-in2.h config.in configure \
-configure.in
+configure.in version.h
 
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -847,6 +829,8 @@ distclean-hdr:
 maintainer-clean-hdr:
 bfd-in3.h: $(top_builddir)/config.status bfd-in2.h
        cd $(top_builddir) && CONFIG_FILES=$@:bfd-in2.h CONFIG_HEADERS= $(SHELL) ./config.status
+bfdver.h: $(top_builddir)/config.status version.h
+       cd $(top_builddir) && CONFIG_FILES=$@:version.h CONFIG_HEADERS= $(SHELL) ./config.status
 
 mostlyclean-noinstLIBRARIES:
 
@@ -1217,10 +1201,10 @@ targmatch.h: config.bfd targmatch.sed
 # When compiling archures.c and targets.c, supply the default target
 # info from configure.
 
-targets.lo: targets.c config.status
+targets.lo: targets.c Makefile
        $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/targets.c
 
-archures.lo: archures.c config.status
+archures.lo: archures.c Makefile
        $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
 
 elf32-target.h : elfxx-target.h
@@ -1393,7 +1377,7 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
 archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \
   $(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h
 archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h
-bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
+bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
@@ -1430,6 +1414,7 @@ merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
 dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
+simple.lo: simple.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h
 archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h
 cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h
 cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h
@@ -1645,12 +1630,7 @@ elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
 elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
   $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
-  elf32-arm.h elf32-target.h
-elfarmqnx-nabi.lo: elfarmqnx-nabi.c elfarm-nabi.c $(INCDIR)/elf/arm.h \
-  $(INCDIR)/elf/reloc-macros.h $(INCDIR)/filenames.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-qnx.h \
-  elf32-arm.h elf32-target.h
+  elf32-arm.h elf32-target.h elf32-qnx.h
 elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \
@@ -1697,15 +1677,7 @@ elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
 elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \
-  elf32-target.h
-elf32-i386-fbsd.lo: elf32-i386-fbsd.c $(INCDIR)/filenames.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-i386.c \
-  $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-i386qnx.lo: elf32-i386qnx.c elf32-i386.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-qnx.h elf32-target.h
+  elf32-target.h elf32-qnx.h
 elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \
@@ -1776,11 +1748,10 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
 elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
-  elf32-target.h
-elf32-ppcqnx.lo: elf32-ppcqnx.c elf32-ppc.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-qnx.h elf32-target.h
+  elf32-target.h elf32-qnx.h
+elf32-qnx.lo: elf32-qnx.c $(INCDIR)/filenames.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h elf32-qnx.h
 elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
@@ -1797,24 +1768,7 @@ elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
 elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
-  elf32-target.h
-elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \
-  $(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \
-  $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \
-  $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
-  $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-target.h
-elf32-shqnx.lo: elf32-shqnx.c elf32-sh.c $(INCDIR)/filenames.h \
-  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
-  $(INCDIR)/elf/reloc-macros.h elf32-qnx.h elf32-target.h
+  elf32-target.h elf32-qnx.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
@@ -2023,8 +1977,8 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   vms.h
 vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   vms.h
-vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
-  $(INCDIR)/safe-ctype.h vms.h
+vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h vms.h
 vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   vms.h
 vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
@@ -2063,13 +2017,6 @@ elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \
   $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \
   $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \
   libecoff.h ecoffswap.h elf64-target.h
-elf64-alpha-fbsd.lo: elf64-alpha-fbsd.c $(INCDIR)/filenames.h \
-  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf64-alpha.c \
-  $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \
-  $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
-  $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
-  libcoff.h libecoff.h ecoffswap.h elf64-target.h
 elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \
   $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
@@ -2108,10 +2055,6 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
   elf64-target.h
-elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \
-  $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \
-  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
-  $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf64-target.h
 elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \
index 7fa334ab48f2b3c2d8a77c7c791367ecc48d474f..107772dfc328f3ded9ad83c1d1bfe922caef0b07 100644 (file)
@@ -2261,8 +2261,8 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
   /* Now the fun stuff.  */
   if (bfd_header_big_endian (abfd))
     {
-      r_index = ((bytes->r_index[0] << 16)
-                | (bytes->r_index[1] << 8)
+      r_index = (((unsigned int) bytes->r_index[0] << 16)
+                | ((unsigned int) bytes->r_index[1] << 8)
                 | bytes->r_index[2]);
       r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
       r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
@@ -2270,8 +2270,8 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
     }
   else
     {
-      r_index =  ((bytes->r_index[2] << 16)
-                 | (bytes->r_index[1] << 8)
+      r_index =  (((unsigned int) bytes->r_index[2] << 16)
+                 | ((unsigned int) bytes->r_index[1] << 8)
                  | bytes->r_index[0]);
       r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
       r_type = ((bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
@@ -2283,9 +2283,9 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
   /* Base relative relocs are always against the symbol table,
      regardless of the setting of r_extern.  r_extern just reflects
      whether the symbol the reloc is against is local or global.  */
-  if (r_type == RELOC_BASE10
-      || r_type == RELOC_BASE13
-      || r_type == RELOC_BASE22)
+  if (r_type == (unsigned int) RELOC_BASE10
+      || r_type == (unsigned int) RELOC_BASE13
+      || r_type == (unsigned int) RELOC_BASE22)
     r_extern = 1;
 
   if (r_extern && r_index > symcount)
@@ -2320,8 +2320,8 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
   /* Now the fun stuff.  */
   if (bfd_header_big_endian (abfd))
     {
-      r_index = ((bytes->r_index[0] << 16)
-                | (bytes->r_index[1] << 8)
+      r_index = (((unsigned int) bytes->r_index[0] << 16)
+                | ((unsigned int) bytes->r_index[1] << 8)
                 | bytes->r_index[2]);
       r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
       r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
@@ -2333,8 +2333,8 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
     }
   else
     {
-      r_index = ((bytes->r_index[2] << 16)
-                | (bytes->r_index[1] << 8)
+      r_index = (((unsigned int) bytes->r_index[2] << 16)
+                | ((unsigned int) bytes->r_index[1] << 8)
                 | bytes->r_index[0]);
       r_extern  = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
       r_pcrel   = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
@@ -3891,7 +3891,7 @@ NAME(aout,final_link) (abfd, info, callback)
       for (p = o->link_order_head; p != NULL; p = p->next)
        {
          if (p->type == bfd_indirect_link_order)
-           p->u.indirect.section->linker_mark = true;
+           p->u.indirect.section->linker_mark = (unsigned int) true;
        }
     }
 
@@ -4440,7 +4440,7 @@ aout_link_write_symbols (finfo, input_bfd)
             characters in the symbol names, not including the file
             numbers in types (the first number after an open
             parenthesis).  */
-         if (type == N_BINCL)
+         if (type == (int) N_BINCL)
            {
              struct external_nlist *incl_sym;
              int nest;
@@ -4454,13 +4454,13 @@ aout_link_write_symbols (finfo, input_bfd)
                  int incl_type;
 
                  incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
-                 if (incl_type == N_EINCL)
+                 if (incl_type == (int) N_EINCL)
                    {
                      if (nest == 0)
                        break;
                      --nest;
                    }
-                 else if (incl_type == N_BINCL)
+                 else if (incl_type == (int) N_BINCL)
                    ++nest;
                  else if (nest == 0)
                    {
@@ -4485,7 +4485,7 @@ aout_link_write_symbols (finfo, input_bfd)
              /* If we have already included a header file with the
                  same value, then replace this one with an N_EXCL
                  symbol.  */
-             copy = ! finfo->info->keep_memory;
+             copy = (boolean) (! finfo->info->keep_memory);
              incl_entry = aout_link_includes_lookup (&finfo->includes,
                                                      name, true, copy);
              if (incl_entry == NULL)
@@ -4513,7 +4513,7 @@ aout_link_write_symbols (finfo, input_bfd)
                  /* This is a duplicate header file.  We must change
                      it to be an N_EXCL entry, and mark all the
                      included symbols to prevent outputting them.  */
-                 type = N_EXCL;
+                 type = (int) N_EXCL;
 
                  nest = 0;
                  for (incl_sym = sym + 1, incl_map = symbol_map + 1;
@@ -4523,7 +4523,7 @@ aout_link_write_symbols (finfo, input_bfd)
                      int incl_type;
 
                      incl_type = H_GET_8 (input_bfd, incl_sym->e_type);
-                     if (incl_type == N_EINCL)
+                     if (incl_type == (int) N_EINCL)
                        {
                          if (nest == 0)
                            {
@@ -4532,7 +4532,7 @@ aout_link_write_symbols (finfo, input_bfd)
                            }
                          --nest;
                        }
-                     else if (incl_type == N_BINCL)
+                     else if (incl_type == (int) N_BINCL)
                        ++nest;
                      else if (nest == 0)
                        *incl_map = -1;
@@ -4887,8 +4887,8 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
 
        if (bfd_header_big_endian (input_bfd))
          {
-           r_index   =  ((rel->r_index[0] << 16)
-                         | (rel->r_index[1] << 8)
+           r_index   =  (((unsigned int) rel->r_index[0] << 16)
+                         | ((unsigned int) rel->r_index[1] << 8)
                          | rel->r_index[2]);
            r_extern  = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
            r_pcrel   = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
@@ -4900,8 +4900,8 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
          }
        else
          {
-           r_index   = ((rel->r_index[2] << 16)
-                        | (rel->r_index[1] << 8)
+           r_index   = (((unsigned int) rel->r_index[2] << 16)
+                        | ((unsigned int) rel->r_index[1] << 8)
                         | rel->r_index[0]);
            r_extern  = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
            r_pcrel   = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
@@ -5223,8 +5223,8 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
 
       if (bfd_header_big_endian (input_bfd))
        {
-         r_index  = ((rel->r_index[0] << 16)
-                     | (rel->r_index[1] << 8)
+         r_index  = (((unsigned int) rel->r_index[0] << 16)
+                     | ((unsigned int) rel->r_index[1] << 8)
                      | rel->r_index[2]);
          r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
          r_type   = ((rel->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
@@ -5232,8 +5232,8 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
        }
       else
        {
-         r_index  = ((rel->r_index[2] << 16)
-                     | (rel->r_index[1] << 8)
+         r_index  = (((unsigned int) rel->r_index[2] << 16)
+                     | ((unsigned int) rel->r_index[1] << 8)
                      | rel->r_index[0]);
          r_extern = (0 != (rel->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
          r_type   = ((rel->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
@@ -5249,16 +5249,16 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
          /* We are generating a relocateable output file, and must
             modify the reloc accordingly.  */
          if (r_extern
-             || r_type == RELOC_BASE10
-             || r_type == RELOC_BASE13
-             || r_type == RELOC_BASE22)
+             || r_type == (unsigned int) RELOC_BASE10
+             || r_type == (unsigned int) RELOC_BASE13
+             || r_type == (unsigned int) RELOC_BASE22)
            {
              /* If we know the symbol this relocation is against,
                 convert it into a relocation against a section.  This
                 is what the native linker does.  */
-             if (r_type == RELOC_BASE10
-                 || r_type == RELOC_BASE13
-                 || r_type == RELOC_BASE22)
+             if (r_type == (unsigned int) RELOC_BASE10
+                 || r_type == (unsigned int) RELOC_BASE13
+                 || r_type == (unsigned int) RELOC_BASE22)
                h = NULL;
              else
                h = sym_hashes[r_index];
@@ -5426,9 +5426,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
                  relocation = 0;
                }
            }
-         else if (r_type == RELOC_BASE10
-                  || r_type == RELOC_BASE13
-                  || r_type == RELOC_BASE22)
+         else if (r_type == (unsigned int) RELOC_BASE10
+                  || r_type == (unsigned int) RELOC_BASE13
+                  || r_type == (unsigned int) RELOC_BASE22)
            {
              struct external_nlist *sym;
              int type;
@@ -5510,9 +5510,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
              to skip this reloc.  */
          if (hundef
              && ! finfo->info->shared
-             && r_type != RELOC_BASE10
-             && r_type != RELOC_BASE13
-             && r_type != RELOC_BASE22)
+             && r_type != (unsigned int) RELOC_BASE10
+             && r_type != (unsigned int) RELOC_BASE13
+             && r_type != (unsigned int) RELOC_BASE22)
            {
              const char *name;
 
@@ -5526,7 +5526,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
                return false;
            }
 
-         if (r_type != RELOC_SPARC_REV32)
+         if (r_type != (unsigned int) RELOC_SPARC_REV32)
            r = MY_final_link_relocate (howto_table_ext + r_type,
                                        input_bfd, input_section,
                                        contents, r_addr, relocation,
@@ -5555,9 +5555,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
                    if (h != NULL)
                      name = h->root.root.string;
                    else if (r_extern
-                            || r_type == RELOC_BASE10
-                            || r_type == RELOC_BASE13
-                            || r_type == RELOC_BASE22)
+                            || r_type == (unsigned int) RELOC_BASE10
+                            || r_type == (unsigned int) RELOC_BASE13
+                            || r_type == (unsigned int) RELOC_BASE22)
                      name = strings + GET_WORD (input_bfd,
                                                 syms[r_index].e_strx);
                    else
@@ -5673,7 +5673,7 @@ aout_link_reloc_link_order (finfo, o, p)
        int r_relative;
        int r_length;
 
-       r_pcrel = howto->pc_relative;
+       r_pcrel = (int) howto->pc_relative;
        r_baserel = (howto->type & 8) != 0;
        r_jmptable = (howto->type & 16) != 0;
        r_relative = (howto->type & 32) != 0;
index d7ac214c7246bf179916d3fce8811d0b065fc5e4..bfbd6de116ca5b9201cbf915799657ed1925aa5c 100644 (file)
@@ -436,12 +436,12 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
         spaces, so only look for ' ' if we don't find '/'.  */
 
       char *e;
-      e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
+      e = (char *) memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
       if (e == NULL)
        {
-         e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
+         e = (char *) memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
          if (e == NULL)
-           e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
+           e = (char *) memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
        }
 
       if (e != NULL)
@@ -2082,7 +2082,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
   bfd_flush (arch);
   if (bfd_stat (arch, &archstat) == -1)
     {
-      perror (_("Reading archive file mod timestamp"));
+      bfd_perror (_("Reading archive file mod timestamp"));
 
       /* Can't read mod time for some reason.  */
       return true;
@@ -2108,8 +2108,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
       || (bfd_bwrite (hdr.ar_date, (bfd_size_type) sizeof (hdr.ar_date), arch)
          != sizeof (hdr.ar_date)))
     {
-      /* FIXME: bfd can't call perror.  */
-      perror (_("Writing updated armap timestamp"));
+      bfd_perror (_("Writing updated armap timestamp"));
 
       /* Some error while writing.  */
       return true;
index f84fc136d1ec96785c58479d28b49e7e0cab6131..1ab0cfa52c38b7523854113d10efc0e39c5f90f4 100644 (file)
@@ -147,11 +147,11 @@ DESCRIPTION
 .#define bfd_mach_mipsisa32             32
 .#define bfd_mach_mipsisa64             64
 .  bfd_arch_i386,      {* Intel 386 *}
-.#define bfd_mach_i386_i386 0
-.#define bfd_mach_i386_i8086 1
-.#define bfd_mach_i386_i386_intel_syntax 2
-.#define bfd_mach_x86_64 3
-.#define bfd_mach_x86_64_intel_syntax 4
+.#define bfd_mach_i386_i386 1
+.#define bfd_mach_i386_i8086 2
+.#define bfd_mach_i386_i386_intel_syntax 3
+.#define bfd_mach_x86_64 64
+.#define bfd_mach_x86_64_intel_syntax 65
 .  bfd_arch_we32k,     {* AT&T WE32xxx *}
 .  bfd_arch_tahoe,     {* CCI/Harris Tahoe *}
 .  bfd_arch_i860,      {* Intel 860 *}
@@ -167,8 +167,8 @@ DESCRIPTION
 .#define bfd_mach_h8300s  3
 .  bfd_arch_pdp11,     {* DEC PDP-11 *}
 .  bfd_arch_powerpc,   {* PowerPC *}
-.#define bfd_mach_ppc          0
-.#define bfd_mach_ppc64                1
+.#define bfd_mach_ppc          32
+.#define bfd_mach_ppc64                64
 .#define bfd_mach_ppc_403      403
 .#define bfd_mach_ppc_403gc    4030
 .#define bfd_mach_ppc_505      505
@@ -187,13 +187,13 @@ DESCRIPTION
 .#define bfd_mach_ppc_7400     7400
 .#define bfd_mach_ppc_e500      500
 .  bfd_arch_rs6000,    {* IBM RS/6000 *}
-.#define bfd_mach_rs6k         0
+.#define bfd_mach_rs6k         6000
 .#define bfd_mach_rs6k_rs1     6001
 .#define bfd_mach_rs6k_rsc     6003
 .#define bfd_mach_rs6k_rs2     6002
 .  bfd_arch_hppa,      {* HP PA RISC *}
 .  bfd_arch_d10v,      {* Mitsubishi D10V *}
-.#define bfd_mach_d10v         0
+.#define bfd_mach_d10v         1
 .#define bfd_mach_d10v_ts2     2
 .#define bfd_mach_d10v_ts3     3
 .  bfd_arch_d30v,      {* Mitsubishi D30V *}
@@ -205,7 +205,7 @@ DESCRIPTION
 .#define bfd_mach_z8002                2
 .  bfd_arch_h8500,     {* Hitachi H8/500 *}
 .  bfd_arch_sh,        {* Hitachi SH *}
-.#define bfd_mach_sh            0
+.#define bfd_mach_sh            1
 .#define bfd_mach_sh2        0x20
 .#define bfd_mach_sh_dsp     0x2d
 .#define bfd_mach_sh3        0x30
@@ -237,15 +237,15 @@ DESCRIPTION
 .  bfd_arch_tic54x,    {* Texas Instruments TMS320C54X *}
 .  bfd_arch_tic80,     {* TI TMS320c80 (MVP) *}
 .  bfd_arch_v850,      {* NEC V850 *}
-.#define bfd_mach_v850          0
+.#define bfd_mach_v850          1
 .#define bfd_mach_v850e        'E'
 .  bfd_arch_arc,       {* ARC Cores *}
-.#define bfd_mach_arc_5         0
-.#define bfd_mach_arc_6         1
-.#define bfd_mach_arc_7         2
-.#define bfd_mach_arc_8         3
+.#define bfd_mach_arc_5         5
+.#define bfd_mach_arc_6         6
+.#define bfd_mach_arc_7         7
+.#define bfd_mach_arc_8         8
 .  bfd_arch_m32r,      {* Mitsubishi M32R/D *}
-.#define bfd_mach_m32r         0 {* For backwards compatibility.  *}
+.#define bfd_mach_m32r         1 {* For backwards compatibility.  *}
 .#define bfd_mach_m32rx                'x'
 .  bfd_arch_mn10200,   {* Matsushita MN10200 *}
 .  bfd_arch_mn10300,   {* Matsushita MN10300 *}
@@ -254,19 +254,19 @@ DESCRIPTION
 .  bfd_arch_fr30,
 .#define bfd_mach_fr30         0x46523330
 .  bfd_arch_frv,
-.#define bfd_mach_frv          0
-.#define bfd_mach_frvsimple    1
+.#define bfd_mach_frv          1
+.#define bfd_mach_frvsimple    2
 .#define bfd_mach_fr300                300
 .#define bfd_mach_fr400                400
 .#define bfd_mach_frvtomcat    499     {* fr500 prototype *}
 .#define bfd_mach_fr500                500
 .  bfd_arch_mcore,
 .  bfd_arch_ia64,      {* HP/Intel ia64 *}
-.#define bfd_mach_ia64_elf64   0
-.#define bfd_mach_ia64_elf32   1
+.#define bfd_mach_ia64_elf64   64
+.#define bfd_mach_ia64_elf32   32
 .  bfd_arch_ip2k,      {* Ubicom IP2K microcontrollers. *}
-.#define bfd_mach_ip2022       0
-.#define bfd_mach_ip2022ext    1
+.#define bfd_mach_ip2022       1
+.#define bfd_mach_ip2022ext    2
 .  bfd_arch_pj,
 .  bfd_arch_avr,       {* Atmel AVR microcontrollers.  *}
 .#define bfd_mach_avr1         1
@@ -276,12 +276,12 @@ DESCRIPTION
 .#define bfd_mach_avr5         5
 .  bfd_arch_cris,      {* Axis CRIS *}
 .  bfd_arch_s390,      {* IBM s390 *}
-.#define bfd_mach_s390_31       0
-.#define bfd_mach_s390_64       1
+.#define bfd_mach_s390_31       31
+.#define bfd_mach_s390_64       64
 .  bfd_arch_openrisc,  {* OpenRISC *}
 .  bfd_arch_mmix,      {* Donald Knuth's educational processor.  *}
 .  bfd_arch_xstormy16,
-.#define bfd_mach_xstormy16    0
+.#define bfd_mach_xstormy16    1
 .  bfd_arch_last
 .  };
 */
index f30e20d0cbd108e6bbbfb3f5e7a261df8e89497a..f41e3fbf69dee9a0eb3a0d56581949ce5d822075 100644 (file)
@@ -41,10 +41,6 @@ extern "C" {
 #endif
 #endif
 
-#define BFD_VERSION @bfd_version@
-#define BFD_VERSION_DATE @bfd_version_date@
-#define BFD_VERSION_STRING @bfd_version_string@
-
 /* The word size used by BFD on the host.  This may be 64 with a 32
    bit target if the host is 64 bit, or if other 64 bit targets have
    been selected with --enable-targets, or if --enable-64-bit-bfd.  */
@@ -349,7 +345,7 @@ typedef struct sec *sec_ptr;
 
 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
 
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (boolean)true), true)
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (unsigned int)true), true)
 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
 
index 38e5459d20b0bf6b77be7bfdfb1e85060ed4b1f5..018a0fd292cc79b0021614df21165b35da868a74 100644 (file)
@@ -1,7 +1,7 @@
 /* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically 
    generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 
    "section.c", "archures.c", "reloc.c", "syms.c", "bfd.c", "archive.c", 
-   "corefile.c", "targets.c" and "format.c".
+   "corefile.c", "targets.c", "format.c", "linker.c" and "simple.c".
    Run "make headers" in your build bfd/ to regenerate.  */
 
 /* Main header file for the bfd library -- portable access to object files.
@@ -47,10 +47,6 @@ extern "C" {
 #endif
 #endif
 
-#define BFD_VERSION @bfd_version@
-#define BFD_VERSION_DATE @bfd_version_date@
-#define BFD_VERSION_STRING @bfd_version_string@
-
 /* The word size used by BFD on the host.  This may be 64 with a 32
    bit target if the host is 64 bit, or if other 64 bit targets have
    been selected with --enable-targets, or if --enable-64-bit-bfd.  */
@@ -355,7 +351,7 @@ typedef struct sec *sec_ptr;
 
 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
 
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (boolean)true), true)
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (unsigned int)true), true)
 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
 
@@ -1542,11 +1538,11 @@ enum bfd_architecture
 #define bfd_mach_mipsisa32             32
 #define bfd_mach_mipsisa64             64
   bfd_arch_i386,      /* Intel 386 */
-#define bfd_mach_i386_i386 0
-#define bfd_mach_i386_i8086 1
-#define bfd_mach_i386_i386_intel_syntax 2
-#define bfd_mach_x86_64 3
-#define bfd_mach_x86_64_intel_syntax 4
+#define bfd_mach_i386_i386 1
+#define bfd_mach_i386_i8086 2
+#define bfd_mach_i386_i386_intel_syntax 3
+#define bfd_mach_x86_64 64
+#define bfd_mach_x86_64_intel_syntax 65
   bfd_arch_we32k,     /* AT&T WE32xxx */
   bfd_arch_tahoe,     /* CCI/Harris Tahoe */
   bfd_arch_i860,      /* Intel 860 */
@@ -1562,8 +1558,8 @@ enum bfd_architecture
 #define bfd_mach_h8300s  3
   bfd_arch_pdp11,     /* DEC PDP-11 */
   bfd_arch_powerpc,   /* PowerPC */
-#define bfd_mach_ppc           0
-#define bfd_mach_ppc64         1
+#define bfd_mach_ppc           32
+#define bfd_mach_ppc64         64
 #define bfd_mach_ppc_403       403
 #define bfd_mach_ppc_403gc     4030
 #define bfd_mach_ppc_505       505
@@ -1582,13 +1578,13 @@ enum bfd_architecture
 #define bfd_mach_ppc_7400      7400
 #define bfd_mach_ppc_e500      500
   bfd_arch_rs6000,    /* IBM RS/6000 */
-#define bfd_mach_rs6k          0
+#define bfd_mach_rs6k          6000
 #define bfd_mach_rs6k_rs1      6001
 #define bfd_mach_rs6k_rsc      6003
 #define bfd_mach_rs6k_rs2      6002
   bfd_arch_hppa,      /* HP PA RISC */
   bfd_arch_d10v,      /* Mitsubishi D10V */
-#define bfd_mach_d10v          0
+#define bfd_mach_d10v          1
 #define bfd_mach_d10v_ts2      2
 #define bfd_mach_d10v_ts3      3
   bfd_arch_d30v,      /* Mitsubishi D30V */
@@ -1600,7 +1596,7 @@ enum bfd_architecture
 #define bfd_mach_z8002         2
   bfd_arch_h8500,     /* Hitachi H8/500 */
   bfd_arch_sh,        /* Hitachi SH */
-#define bfd_mach_sh            0
+#define bfd_mach_sh            1
 #define bfd_mach_sh2        0x20
 #define bfd_mach_sh_dsp     0x2d
 #define bfd_mach_sh3        0x30
@@ -1632,15 +1628,15 @@ enum bfd_architecture
   bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
   bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
   bfd_arch_v850,      /* NEC V850 */
-#define bfd_mach_v850          0
+#define bfd_mach_v850          1
 #define bfd_mach_v850e         'E'
   bfd_arch_arc,       /* ARC Cores */
-#define bfd_mach_arc_5         0
-#define bfd_mach_arc_6         1
-#define bfd_mach_arc_7         2
-#define bfd_mach_arc_8         3
+#define bfd_mach_arc_5         5
+#define bfd_mach_arc_6         6
+#define bfd_mach_arc_7         7
+#define bfd_mach_arc_8         8
   bfd_arch_m32r,      /* Mitsubishi M32R/D */
-#define bfd_mach_m32r          0 /* For backwards compatibility.  */
+#define bfd_mach_m32r          1 /* For backwards compatibility.  */
 #define bfd_mach_m32rx         'x'
   bfd_arch_mn10200,   /* Matsushita MN10200 */
   bfd_arch_mn10300,   /* Matsushita MN10300 */
@@ -1649,19 +1645,19 @@ enum bfd_architecture
   bfd_arch_fr30,
 #define bfd_mach_fr30          0x46523330
   bfd_arch_frv,
-#define bfd_mach_frv           0
-#define bfd_mach_frvsimple     1
+#define bfd_mach_frv           1
+#define bfd_mach_frvsimple     2
 #define bfd_mach_fr300         300
 #define bfd_mach_fr400         400
 #define bfd_mach_frvtomcat     499     /* fr500 prototype */
 #define bfd_mach_fr500         500
   bfd_arch_mcore,
   bfd_arch_ia64,      /* HP/Intel ia64 */
-#define bfd_mach_ia64_elf64    0
-#define bfd_mach_ia64_elf32    1
+#define bfd_mach_ia64_elf64    64
+#define bfd_mach_ia64_elf32    32
   bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
-#define bfd_mach_ip2022        0
-#define bfd_mach_ip2022ext     1
+#define bfd_mach_ip2022        1
+#define bfd_mach_ip2022ext     2
   bfd_arch_pj,
   bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
 #define bfd_mach_avr1          1
@@ -1671,12 +1667,12 @@ enum bfd_architecture
 #define bfd_mach_avr5          5
   bfd_arch_cris,      /* Axis CRIS */
   bfd_arch_s390,      /* IBM s390 */
-#define bfd_mach_s390_31       0
-#define bfd_mach_s390_64       1
+#define bfd_mach_s390_31       31
+#define bfd_mach_s390_64       64
   bfd_arch_openrisc,  /* OpenRISC */
   bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
   bfd_arch_xstormy16,
-#define bfd_mach_xstormy16     0
+#define bfd_mach_xstormy16     1
   bfd_arch_last
   };
 
@@ -2505,6 +2501,14 @@ field in the instruction.  */
   BFD_RELOC_SH_IMM_HI16,
   BFD_RELOC_SH_IMM_HI16_PCREL,
   BFD_RELOC_SH_PT_16,
+  BFD_RELOC_SH_TLS_GD_32,
+  BFD_RELOC_SH_TLS_LD_32,
+  BFD_RELOC_SH_TLS_LDO_32,
+  BFD_RELOC_SH_TLS_IE_32,
+  BFD_RELOC_SH_TLS_LE_32,
+  BFD_RELOC_SH_TLS_DTPMOD32,
+  BFD_RELOC_SH_TLS_DTPOFF32,
+  BFD_RELOC_SH_TLS_TPOFF32,
 
 /* Thumb 23-, 12- and 9-bit pc-relative branches.  The lowest bit must
 be zero and is not stored in the instruction.  */
@@ -4121,6 +4125,17 @@ bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
 const char *
 bfd_format_string PARAMS ((bfd_format format));
 
+/* Extracted from linker.c.  */
+boolean
+bfd_link_split_section PARAMS ((bfd *abfd, asection *sec));
+
+#define bfd_link_split_section(abfd, sec) \
+       BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
+
+/* Extracted from simple.c.  */
+bfd_byte *
+bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf));
+
 #ifdef __cplusplus
 }
 #endif
index cfd77726a3edcb806420e028c31c96b96f7eb779..bf4516216576e2234f6bac75e45e02dbf5cb49f6 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -196,6 +196,7 @@ CODE_FRAGMENT
 */
 
 #include "bfd.h"
+#include "bfdver.h"
 #include "sysdep.h"
 
 #ifdef ANSI_PROTOTYPES
@@ -1293,10 +1294,10 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
   m->p_type = type;
   m->p_flags = flags;
   m->p_paddr = at;
-  m->p_flags_valid = flags_valid;
-  m->p_paddr_valid = at_valid;
-  m->includes_filehdr = includes_filehdr;
-  m->includes_phdrs = includes_phdrs;
+  m->p_flags_valid = (unsigned int) flags_valid;
+  m->p_paddr_valid = (unsigned int) at_valid;
+  m->includes_filehdr = (unsigned int) includes_filehdr;
+  m->includes_phdrs = (unsigned int) includes_phdrs;
   m->count = count;
   if (count > 0)
     memcpy (m->sections, secs, count * sizeof (asection *));
index fc972b22d133ac80200379656f31fa29d9f3565b..7bddabf5fa818c6f5df8bb75fdc3aba88bc9b78c 100644 (file)
@@ -185,7 +185,7 @@ binary_get_symtab (abfd, alocation)
 
   syms = (asymbol *) bfd_alloc (abfd, amt);
   if (syms == NULL)
-    return false;
+    return (long) false;
 
   /* Start symbol.  */
   syms[0].the_bfd = abfd;
index 5e7f907a9594af9f16291157b597f48449a7c25f..25256a8b7bb38734c2dabc208556a90408f761b4 100644 (file)
@@ -1881,6 +1881,7 @@ record_arm_to_thumb_glue (info, h)
   register asection *               s;
   char *                            tmp_name;
   struct coff_link_hash_entry *     myh;
+  struct bfd_link_hash_entry *      bh;
   struct coff_arm_link_hash_table * globals;
   bfd_vma val;
   bfd_size_type amt;
@@ -1915,10 +1916,10 @@ record_arm_to_thumb_glue (info, h)
      though the section isn't allocated yet, this is where we will be putting
      it.  */
 
+  bh = NULL;
   val = globals->arm_glue_size + 1;
   bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
-                               BSF_GLOBAL, s, val, NULL, true, false,
-                               (struct bfd_link_hash_entry **) & myh);
+                               BSF_GLOBAL, s, val, NULL, true, false, &bh);
 
   free (tmp_name);
 
@@ -1937,6 +1938,7 @@ record_thumb_to_arm_glue (info, h)
   register asection *                s;
   char *                             tmp_name;
   struct coff_link_hash_entry *      myh;
+  struct bfd_link_hash_entry *       bh;
   struct coff_arm_link_hash_table *  globals;
   bfd_vma val;
   bfd_size_type amt;
@@ -1967,12 +1969,13 @@ record_thumb_to_arm_glue (info, h)
       return; /* we've already seen this guy */
     }
 
+  bh = NULL;
   val = globals->thumb_glue_size + 1;
   bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
-                               BSF_GLOBAL, s, val, NULL, true, false,
-                               (struct bfd_link_hash_entry **) &myh);
+                               BSF_GLOBAL, s, val, NULL, true, false, &bh);
 
   /* If we mark it 'thumb', the disassembler will do a better job.  */
+  myh = (struct coff_link_hash_entry *) bh;
   myh->class = C_THUMBEXTFUNC;
 
   free (tmp_name);
@@ -1989,11 +1992,10 @@ record_thumb_to_arm_glue (info, h)
 
   sprintf (tmp_name, globals->support_old_code ? BACK_FROM_ARM : CHANGE_TO_ARM, name);
 
-  myh = NULL;
+  bh = NULL;
   val = globals->thumb_glue_size + (globals->support_old_code ? 8 : 4);
   bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
-                               BSF_LOCAL, s, val, NULL, true, false,
-                               (struct bfd_link_hash_entry **) & myh);
+                               BSF_LOCAL, s, val, NULL, true, false, &bh);
 
   free (tmp_name);
 
index e47b4d0050f38cf3a063aabc67311e480c4363dc..694fb12f4d869f2546bfbcb0ffdee74116c3b9b7 100644 (file)
@@ -1246,7 +1246,7 @@ Special entry points for gdb to swap in coff symbol table parts:
 .           struct coff_link_hash_entry *, struct internal_syment *,
 .           bfd_vma *));
 .
-.  boolean (*_bfd_coff_adjust_symndx)\
+.  boolean (*_bfd_coff_adjust_symndx)
 .    PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
 .           struct internal_reloc *, boolean *));
 .
index ee6c8fce5451efd58833787efa8eb9b017bdc761..21589c6945a9d8cc22e22399c87edb0930e2ae15 100644 (file)
@@ -2196,7 +2196,7 @@ _bfd_coff_is_local_label_name (abfd, name)
      bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
-  return name[0] == '.' && name[1] == 'L';
+  return (boolean) (name[0] == '.' && name[1] == 'L');
 }
 
 /* Provided a BFD, a section and an offset (in bytes, not octets) into the
index eb9388fc71ed5d4ad35adc687968317573715ce7..c1302ee878a28d0dc9dfbe6845ee04c47815a1c1 100644 (file)
@@ -1322,6 +1322,9 @@ mark_relocs (finfo, input_bfd)
 
       if ((a->flags & SEC_RELOC) == 0 || a->reloc_count  < 1)
        continue;
+      /* Don't mark relocs in excluded sections.  */
+      if (a->output_section == bfd_abs_section_ptr)
+       continue;
 
       /* Read in the relocs.  */
       internal_relocs = _bfd_coff_read_internal_relocs
index 4aabfedaf53fe59e96ed83863098e4ce0ff85c35..c37dc75854cbf6ad216c55ff84310b41728ba15d 100644 (file)
@@ -691,11 +691,11 @@ case "${targ}" in
     ;;
   mips*el-*-netbsd*)
     targ_defvec=bfd_elf32_littlemips_vec
-    targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
+    targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
     ;;
   mips*-*-netbsd*)
     targ_defvec=bfd_elf32_bigmips_vec
-    targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
+    targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
     ;;
   mips*-dec-bsd*)
     targ_defvec=aout_mips_little_vec
@@ -915,10 +915,12 @@ case "${targ}" in
 
   s390-*-linux*)
     targ_defvec=bfd_elf32_s390_vec
+    targ64_selvecs=bfd_elf64_s390_vec
     ;;
 #ifdef BFD64
   s390x-*-linux*)
     targ_defvec=bfd_elf64_s390_vec
+    targ_selvecs=bfd_elf32_s390_vec
     ;;
 #endif
 
@@ -934,12 +936,12 @@ case "${targ}" in
     targ_underscore=yes
     ;;
   sh64eb-*-linux*)
-    targ_defvec=bfd_elf32_shblin_vec
-    targ_selvecs="bfd_elf32_shblin_vec bfd_elf32_sh64_vec bfd_elf64_sh64_vec bfd_elf32_sh_vec"
+    targ_defvec=bfd_elf32_sh64blin_vec
+    targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
     ;;
   sh64-*-linux*)
-    targ_defvec=bfd_elf32_shlin_vec
-    targ_selvecs="bfd_elf32_shlin_vec bfd_elf32_sh64l_vec bfd_elf64_sh64l_vec bfd_elf32_shl_vec"
+    targ_defvec=bfd_elf32_sh64lin_vec
+    targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec"
     ;;
 #endif /* BFD64 */
 
@@ -952,9 +954,11 @@ case "${targ}" in
     ;;
   sh*eb-*-linux*)
     targ_defvec=bfd_elf32_shblin_vec
+    targ_selvecs=bfd_elf32_shlin_vec
     ;;
   sh*-*-linux*)
     targ_defvec=bfd_elf32_shlin_vec
+    targ_selvecs=bfd_elf32_shblin_vec
     ;;
 
 #ifdef BFD64
index 2ca10f7e37f50b06cc68eb3fc9c3a7f9357ad15c..794cb62055141f0f23429515f9484e35fa7d1f8d 100755 (executable)
@@ -1206,14 +1206,13 @@ fi
 bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`
 
 bfd_version_string="\"${VERSION}\""
-bfd_version_date=`sed -e 's/.*DATE //' < ${srcdir}/version.h`
 if test x${is_release} = x; then
+  bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
   bfd_version_string="\"${VERSION} ${bfd_version_date}\""
 fi
 
 
 
-
 if test $host != $build; then
   ac_tool_prefix=${host_alias}-
 else
@@ -1223,7 +1222,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1227: checking for $ac_word" >&5
+echo "configure:1226: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1255,7 +1254,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1259: checking for $ac_word" >&5
+echo "configure:1258: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1287,7 +1286,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1291: checking for $ac_word" >&5
+echo "configure:1290: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1402,7 +1401,7 @@ ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1406: checking for ld used by GCC" >&5
+echo "configure:1405: checking for ld used by GCC" >&5
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -1432,10 +1431,10 @@ echo "configure:1406: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1436: checking for GNU ld" >&5
+echo "configure:1435: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1439: checking for non-GNU ld" >&5
+echo "configure:1438: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1470,7 +1469,7 @@ else
 fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1474: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1473: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1487,7 +1486,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1491: checking for $LD option to reload object files" >&5
+echo "configure:1490: checking for $LD option to reload object files" >&5
 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1499,7 +1498,7 @@ reload_flag=$lt_cv_ld_reload_flag
 test -n "$reload_flag" && reload_flag=" $reload_flag"
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1503: checking for BSD-compatible nm" >&5
+echo "configure:1502: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1537,7 +1536,7 @@ NM="$lt_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1541: checking whether ln -s works" >&5
+echo "configure:1540: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1558,7 +1557,7 @@ else
 fi
 
 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1562: checking how to recognise dependant libraries" >&5
+echo "configure:1561: checking how to recognise dependant libraries" >&5
 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1731,13 +1730,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1735: checking for object suffix" >&5
+echo "configure:1734: checking for object suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -1757,7 +1756,7 @@ ac_objext=$ac_cv_objext
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1761: checking for executable suffix" >&5
+echo "configure:1760: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1767,7 +1766,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
@@ -1794,7 +1793,7 @@ case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1798: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1797: checking for ${ac_tool_prefix}file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1856,7 +1855,7 @@ fi
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1860: checking for file" >&5
+echo "configure:1859: checking for file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1927,7 +1926,7 @@ esac
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1931: checking for $ac_word" >&5
+echo "configure:1930: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1959,7 +1958,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1963: checking for $ac_word" >&5
+echo "configure:1962: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1994,7 +1993,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1998: checking for $ac_word" >&5
+echo "configure:1997: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2026,7 +2025,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2030: checking for $ac_word" >&5
+echo "configure:2029: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2093,8 +2092,8 @@ 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 2097 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2096 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case `/usr/bin/file conftest.$ac_objext` in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2113,7 +2112,7 @@ case $host in
 ia64-*-hpux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
-  if { (eval echo configure:2117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:2116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *ELF-32*)
       HPUX_IA64_MODE="32"
@@ -2131,7 +2130,7 @@ ia64-*-hpux*)
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2135: checking whether the C compiler needs -belf" >&5
+echo "configure:2134: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2144,14 +2143,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
 cross_compiling=$ac_cv_prog_cc_cross
 
      cat > conftest.$ac_ext <<EOF
-#line 2148 "configure"
+#line 2147 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -2341,7 +2340,7 @@ if test -z "$target" ; then
 fi
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2345: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2344: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -2364,7 +2363,7 @@ fi
   
 
 echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6
-echo "configure:2368: checking whether to install libbfd" >&5
+echo "configure:2367: checking whether to install libbfd" >&5
   # Check whether --enable-install-libbfd or --disable-install-libbfd was given.
 if test "${enable_install_libbfd+set}" = set; then
   enableval="$enable_install_libbfd"
@@ -2401,7 +2400,7 @@ fi
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2405: checking for executable suffix" >&5
+echo "configure:2404: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2411,7 +2410,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
@@ -2441,7 +2440,7 @@ bfd_default_target_size=32
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2445: checking for $ac_word" >&5
+echo "configure:2444: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2471,7 +2470,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2475: checking for $ac_word" >&5
+echo "configure:2474: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2522,7 +2521,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2526: checking for $ac_word" >&5
+echo "configure:2525: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2554,7 +2553,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2558: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2557: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2565,12 +2564,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2569 "configure"
+#line 2568 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2596,12 +2595,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2600: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2599: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2605: checking whether we are using GNU C" >&5
+echo "configure:2604: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2610,7 +2609,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2629,7 +2628,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2633: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2632: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2663,7 +2662,7 @@ fi
 
 ALL_LINGUAS="fr tr ja es sv da"
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2667: checking how to run the C preprocessor" >&5
+echo "configure:2666: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2678,13 +2677,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2682 "configure"
+#line 2681 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2695,13 +2694,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2699 "configure"
+#line 2698 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2712,13 +2711,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2716 "configure"
+#line 2715 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2745,7 +2744,7 @@ echo "$ac_t""$CPP" 1>&6
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2749: checking for $ac_word" >&5
+echo "configure:2748: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2773,12 +2772,12 @@ else
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2777: checking for ANSI C header files" >&5
+echo "configure:2776: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2782 "configure"
+#line 2781 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2786,7 +2785,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2803,7 +2802,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2807 "configure"
+#line 2806 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2821,7 +2820,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2825 "configure"
+#line 2824 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2842,7 +2841,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2846 "configure"
+#line 2845 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2853,7 +2852,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2877,12 +2876,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2881: checking for working const" >&5
+echo "configure:2880: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2886 "configure"
+#line 2885 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2931,7 +2930,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2952,21 +2951,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2956: checking for inline" >&5
+echo "configure:2955: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2963 "configure"
+#line 2962 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2992,12 +2991,12 @@ EOF
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2996: checking for off_t" >&5
+echo "configure:2995: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3001 "configure"
+#line 3000 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3025,12 +3024,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3029: checking for size_t" >&5
+echo "configure:3028: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3034 "configure"
+#line 3033 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3060,19 +3059,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:3064: checking for working alloca.h" >&5
+echo "configure:3063: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3069 "configure"
+#line 3068 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -3093,12 +3092,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3097: checking for alloca" >&5
+echo "configure:3096: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3102 "configure"
+#line 3101 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -3126,7 +3125,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:3130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -3158,12 +3157,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3162: checking whether alloca needs Cray hooks" >&5
+echo "configure:3161: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3167 "configure"
+#line 3166 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -3188,12 +3187,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3192: checking for $ac_func" >&5
+echo "configure:3191: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3197 "configure"
+#line 3196 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3216,7 +3215,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3243,7 +3242,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3247: checking stack direction for C alloca" >&5
+echo "configure:3246: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3251,7 +3250,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 3255 "configure"
+#line 3254 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -3270,7 +3269,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:3274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -3295,17 +3294,17 @@ for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3299: checking for $ac_hdr" >&5
+echo "configure:3298: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3304 "configure"
+#line 3303 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3334,12 +3333,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3338: checking for $ac_func" >&5
+echo "configure:3337: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3343 "configure"
+#line 3342 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3362,7 +3361,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3387,7 +3386,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3391: checking for working mmap" >&5
+echo "configure:3390: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3395,7 +3394,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3399 "configure"
+#line 3398 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3548,7 +3547,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:3552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3576,17 +3575,17 @@ unistd.h values.h sys/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3580: checking for $ac_hdr" >&5
+echo "configure:3579: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3585 "configure"
+#line 3584 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3616,12 +3615,12 @@ done
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3620: checking for $ac_func" >&5
+echo "configure:3619: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3625 "configure"
+#line 3624 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3644,7 +3643,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3673,12 +3672,12 @@ done
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3677: checking for $ac_func" >&5
+echo "configure:3676: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3682 "configure"
+#line 3681 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3701,7 +3700,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3735,19 +3734,19 @@ EOF
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3739: checking for LC_MESSAGES" >&5
+echo "configure:3738: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3744 "configure"
+#line 3743 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -3768,7 +3767,7 @@ EOF
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3772: checking whether NLS is requested" >&5
+echo "configure:3771: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -3788,7 +3787,7 @@ fi
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3792: checking whether included gettext is requested" >&5
+echo "configure:3791: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -3807,17 +3806,17 @@ fi
 
        ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3811: checking for libintl.h" >&5
+echo "configure:3810: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3816 "configure"
+#line 3815 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3834,19 +3833,19 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3838: checking for gettext in libc" >&5
+echo "configure:3837: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3843 "configure"
+#line 3842 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3862,7 +3861,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
 
           if test "$gt_cv_func_gettext_libc" != "yes"; then
             echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3866: checking for bindtextdomain in -lintl" >&5
+echo "configure:3865: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3870,7 +3869,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3874 "configure"
+#line 3873 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3881,7 +3880,7 @@ int main() {
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3897,19 +3896,19 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3901: checking for gettext in libintl" >&5
+echo "configure:3900: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3906 "configure"
+#line 3905 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3937,7 +3936,7 @@ EOF
              # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3941: checking for $ac_word" >&5
+echo "configure:3940: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3971,12 +3970,12 @@ fi
                for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3975: checking for $ac_func" >&5
+echo "configure:3974: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3980 "configure"
+#line 3979 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3999,7 +3998,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4026,7 +4025,7 @@ done
                # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4030: checking for $ac_word" >&5
+echo "configure:4029: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4062,7 +4061,7 @@ fi
                # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4066: checking for $ac_word" >&5
+echo "configure:4065: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4094,7 +4093,7 @@ else
 fi
 
                cat > conftest.$ac_ext <<EOF
-#line 4098 "configure"
+#line 4097 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4102,7 +4101,7 @@ extern int _nl_msg_cat_cntr;
                               return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
                   DATADIRNAME=share
@@ -4134,7 +4133,7 @@ fi
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4138: checking for $ac_word" >&5
+echo "configure:4137: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4168,7 +4167,7 @@ fi
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4172: checking for $ac_word" >&5
+echo "configure:4171: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4204,7 +4203,7 @@ fi
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4208: checking for $ac_word" >&5
+echo "configure:4207: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4294,7 +4293,7 @@ fi
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4298: checking for catalogs to be installed" >&5
+echo "configure:4297: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -4322,17 +4321,17 @@ echo "configure:4298: checking for catalogs to be installed" >&5
       if test "$CATOBJEXT" = ".cat"; then
         ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:4326: checking for linux/version.h" >&5
+echo "configure:4325: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4331 "configure"
+#line 4330 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4410,7 +4409,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:4414: checking for a BSD compatible install" >&5
+echo "configure:4413: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4493,7 +4492,7 @@ if test "x$cross_compiling" = "xno"; then
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:4497: checking for build system executable suffix" >&5
+echo "configure:4496: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4521,17 +4520,17 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4525: checking for $ac_hdr" >&5
+echo "configure:4524: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4530 "configure"
+#line 4529 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4561,17 +4560,17 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4565: checking for $ac_hdr" >&5
+echo "configure:4564: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4570 "configure"
+#line 4569 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4598,12 +4597,12 @@ fi
 done
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4602: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4601: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4607 "configure"
+#line 4606 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4612,7 +4611,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4637,12 +4636,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4641: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4640: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4646 "configure"
+#line 4645 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4650,7 +4649,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4675,7 +4674,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4679: checking for opendir in -ldir" >&5
+echo "configure:4678: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4683,7 +4682,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4687 "configure"
+#line 4686 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4694,7 +4693,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4716,7 +4715,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4720: checking for opendir in -lx" >&5
+echo "configure:4719: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4724,7 +4723,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4728 "configure"
+#line 4727 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4735,7 +4734,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4760,12 +4759,12 @@ fi
 for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4764: checking for $ac_func" >&5
+echo "configure:4763: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4769 "configure"
+#line 4768 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4788,7 +4787,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4823,12 +4822,12 @@ EOF
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4827: checking whether strstr must be declared" >&5
+echo "configure:4826: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4832 "configure"
+#line 4831 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4849,7 +4848,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:4853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -4870,12 +4869,12 @@ EOF
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4874: checking whether malloc must be declared" >&5
+echo "configure:4873: checking whether malloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4879 "configure"
+#line 4878 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4896,7 +4895,7 @@ int main() {
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:4900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -4917,12 +4916,12 @@ EOF
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4921: checking whether realloc must be declared" >&5
+echo "configure:4920: checking whether realloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4926 "configure"
+#line 4925 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4943,7 +4942,7 @@ int main() {
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:4947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -4964,12 +4963,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4968: checking whether free must be declared" >&5
+echo "configure:4967: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4973 "configure"
+#line 4972 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4990,7 +4989,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:4994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -5011,12 +5010,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:5015: checking whether getenv must be declared" >&5
+echo "configure:5014: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5020 "configure"
+#line 5019 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5037,7 +5036,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:5041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -5224,16 +5223,16 @@ if test "${target}" = "${host}"; then
        # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE
        # have c_impl as a member of struct core_dumpx
        echo $ac_n "checking for c_impl in struct core_dumpx""... $ac_c" 1>&6
-echo "configure:5228: checking for c_impl in struct core_dumpx" >&5
+echo "configure:5227: checking for c_impl in struct core_dumpx" >&5
        cat > conftest.$ac_ext <<EOF
-#line 5230 "configure"
+#line 5229 "configure"
 #include "confdefs.h"
 #include <core.h>
 int main() {
 struct core_dumpx c; c.c_impl = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_ST_C_IMPL 1
@@ -5301,17 +5300,17 @@ rm -f conftest*
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5305: checking for $ac_hdr" >&5
+echo "configure:5304: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5310 "configure"
+#line 5309 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5339,12 +5338,12 @@ done
 
   if test "$ac_cv_header_sys_procfs_h" = yes; then
     echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5343: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:5342: checking for prstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5348 "configure"
+#line 5347 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5353,7 +5352,7 @@ int main() {
 prstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prstatus_t=yes
 else
@@ -5375,12 +5374,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
 
     echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5379: checking for prstatus32_t in sys/procfs.h" >&5
+echo "configure:5378: checking for prstatus32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5384 "configure"
+#line 5383 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5389,7 +5388,7 @@ int main() {
 prstatus32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prstatus32_t=yes
 else
@@ -5411,12 +5410,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6
 
     echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5415: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5414: checking for prstatus_t.pr_who in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5420 "configure"
+#line 5419 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5425,7 +5424,7 @@ int main() {
 prstatus_t avar; void* aref = (void*) &avar.pr_who
 ; return 0; }
 EOF
-if { (eval echo configure:5429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes
 else
@@ -5447,12 +5446,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
 
     echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5451: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
+echo "configure:5450: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5456 "configure"
+#line 5455 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5461,7 +5460,7 @@ int main() {
 prstatus32_t avar; void* aref = (void*) &avar.pr_who
 ; return 0; }
 EOF
-if { (eval echo configure:5465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes
 else
@@ -5483,12 +5482,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6
 
     echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5487: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5486: checking for pstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5492 "configure"
+#line 5491 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5497,7 +5496,7 @@ int main() {
 pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus_t=yes
 else
@@ -5519,12 +5518,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
 
     echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5523: checking for pxstatus_t in sys/procfs.h" >&5
+echo "configure:5522: checking for pxstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5528 "configure"
+#line 5527 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5533,7 +5532,7 @@ int main() {
 pxstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pxstatus_t=yes
 else
@@ -5555,12 +5554,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6
 
     echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5559: checking for pstatus32_t in sys/procfs.h" >&5
+echo "configure:5558: checking for pstatus32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5564 "configure"
+#line 5563 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5569,7 +5568,7 @@ int main() {
 pstatus32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus32_t=yes
 else
@@ -5591,12 +5590,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6
 
     echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5595: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5594: checking for prpsinfo_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5600 "configure"
+#line 5599 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5605,7 +5604,7 @@ int main() {
 prpsinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
 else
@@ -5627,12 +5626,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
 
     echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5631: checking for prpsinfo32_t in sys/procfs.h" >&5
+echo "configure:5630: checking for prpsinfo32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5636 "configure"
+#line 5635 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5641,7 +5640,7 @@ int main() {
 prpsinfo32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes
 else
@@ -5663,12 +5662,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6
 
     echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5667: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5666: checking for psinfo_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5672 "configure"
+#line 5671 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5677,7 +5676,7 @@ int main() {
 psinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psinfo_t=yes
 else
@@ -5699,12 +5698,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
 
     echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5703: checking for psinfo32_t in sys/procfs.h" >&5
+echo "configure:5702: checking for psinfo32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5708 "configure"
+#line 5707 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5713,7 +5712,7 @@ int main() {
 psinfo32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psinfo32_t=yes
 else
@@ -5735,12 +5734,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5739: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5738: checking for lwpstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5744 "configure"
+#line 5743 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5749,7 +5748,7 @@ int main() {
 lwpstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
 else
@@ -5771,12 +5770,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
 
     echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5775: checking for lwpxstatus_t in sys/procfs.h" >&5
+echo "configure:5774: checking for lwpxstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5780 "configure"
+#line 5779 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5785,7 +5784,7 @@ int main() {
 lwpxstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes
 else
@@ -5807,12 +5806,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5811: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:5810: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5816 "configure"
+#line 5815 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5821,7 +5820,7 @@ int main() {
 lwpstatus_t avar; void* aref = (void*) &avar.pr_context
 ; return 0; }
 EOF
-if { (eval echo configure:5825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes
 else
@@ -5843,12 +5842,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6
 
     echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5847: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:5846: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5852 "configure"
+#line 5851 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5857,7 +5856,7 @@ int main() {
 lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
 ; return 0; }
 EOF
-if { (eval echo configure:5861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes
 else
@@ -5879,12 +5878,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6
 
     echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5883: checking for win32_pstatus_t in sys/procfs.h" >&5
+echo "configure:5882: checking for win32_pstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5888 "configure"
+#line 5887 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5893,7 +5892,7 @@ int main() {
 win32_pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
 else
@@ -6062,8 +6061,8 @@ do
     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_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
-    bfd_elf32_bigarm_vec)      tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
-    bfd_elf32_bigarmqnx_vec)   tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
+    bfd_elf32_bigarm_vec)      tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_bigarmqnx_vec)   tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_bigmips_vec)     tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_cris_vec)                tb="$tb elf32-cris.lo elf32.lo $elf" ;;
     bfd_elf32_d10v_vec)                tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
@@ -6075,9 +6074,9 @@ do
     bfd_elf32_hppa_linux_vec)  tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)                tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)                tb="$tb elf32-i370.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_freebsd_vec)        tb="$tb elf32-i386-fbsd.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_vec)                tb="$tb elf32-i386.lo elf32.lo $elf" ;;
-    bfd_elf32_i386qnx_vec)     tb="$tb elf32-i386qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386_freebsd_vec)        tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386_vec)                tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386qnx_vec)     tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i860_vec)                tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i960_vec)                tb="$tb elf32-i960.lo elf32.lo $elf" ;;
@@ -6087,8 +6086,8 @@ do
     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_littlearc_vec)   tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
-    bfd_elf32_littlearm_vec)   tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
-    bfd_elf32_littlearmqnx_vec)        tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
+    bfd_elf32_littlearm_vec)   tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_littlearmqnx_vec)        tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_littlemips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_m32r_vec)                tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
     bfd_elf32_m68hc11_vec)     tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
@@ -6107,26 +6106,28 @@ do
     bfd_elf32_or32_big_vec)    tb="$tb elf32-or32.lo elf32.lo $elf" ;;
     bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
     bfd_elf32_pjl_vec)          tb="$tb elf32-pj.lo elf32.lo $elf";;
-    bfd_elf32_powerpc_vec)     tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
-    bfd_elf32_powerpcle_vec)   tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
-    bfd_elf32_powerpcleqnx_vec)        tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
-    bfd_elf32_powerpcqnx_vec)  tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpc_vec)     tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcle_vec)   tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcleqnx_vec)        tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcqnx_vec)  tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_s390_vec)                tb="$tb elf32-s390.lo elf32.lo $elf" ;;
     # FIXME: We include cofflink.lo not because it's needed for
     # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
     # which needs it but does not list it.  Should be fixed in right place.
     bfd_elf32_sh64_vec)                tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     bfd_elf32_sh64l_vec)       tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
-    bfd_elf32_sh64lnbsd_vec)   tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
-    bfd_elf32_sh64nbsd_vec)    tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
-    bfd_elf32_sh_vec)          tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shblin_vec)      tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shl_vec)         tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shlin_vec)       tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shlnbsd_vec)     tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shlqnx_vec)      tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shqnx_vec)       tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_sh64lin_vec)     tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64blin_vec)    tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64lnbsd_vec)   tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf32_sh64nbsd_vec)    tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf32_sh_vec)          tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shblin_vec)      tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shl_vec)         tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo elf32-qnx.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shlin_vec)       tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlnbsd_vec)     tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlqnx_vec)      tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shqnx_vec)       tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)       tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
@@ -6134,7 +6135,7 @@ do
     bfd_elf32_v850_vec)                tb="$tb elf32-v850.lo elf32.lo $elf" ;;
     bfd_elf32_vax_vec)         tb="$tb elf32-vax.lo elf32.lo $elf" ;;
     bfd_elf32_xstormy16_vec)   tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
-    bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha-fbsd.lo elf64.lo $elf"; target_size=64 ;;
+    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 ;;
@@ -6153,8 +6154,10 @@ do
     bfd_elf64_s390_vec)                tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_sh64_vec)                tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64l_vec)       tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64lnbsd_vec)   tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64nbsd_vec)    tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64lin_vec)     tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+    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 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 ;;
@@ -6340,10 +6343,10 @@ case ${host64}-${target64}-${want64} in
     if test -n "$GCC" ; then
        bad_64bit_gcc=no;
        echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6
-echo "configure:6344: checking for gcc version with buggy 64-bit support" >&5
+echo "configure:6347: checking for gcc version with buggy 64-bit support" >&5
        # Add more tests for gcc versions with non-working 64-bit support here.
        cat > conftest.$ac_ext <<EOF
-#line 6347 "configure"
+#line 6350 "configure"
 #include "confdefs.h"
 :__GNUC__:__GNUC_MINOR__:__i386__:
 EOF
@@ -6388,17 +6391,17 @@ for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6392: checking for $ac_hdr" >&5
+echo "configure:6395: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6397 "configure"
+#line 6400 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6427,12 +6430,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6431: checking for $ac_func" >&5
+echo "configure:6434: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6436 "configure"
+#line 6439 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6455,7 +6458,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6480,7 +6483,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6484: checking for working mmap" >&5
+echo "configure:6487: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6488,7 +6491,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 6492 "configure"
+#line 6495 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6641,7 +6644,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:6645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -6666,12 +6669,12 @@ fi
 for ac_func in madvise mprotect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6670: checking for $ac_func" >&5
+echo "configure:6673: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6675 "configure"
+#line 6678 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6694,7 +6697,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6827,7 +6830,7 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -6887,7 +6890,6 @@ s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@bfd_version@%$bfd_version%g
-s%@bfd_version_date@%$bfd_version_date%g
 s%@bfd_version_string@%$bfd_version_string%g
 s%@AR@%$AR%g
 s%@RANLIB@%$RANLIB%g
@@ -6986,7 +6988,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
index ba38dd423b2d44c20ac0ab54a487950a88384e21..b59089d5e8f86c01755169ff90d6ac7db5420ad2 100644 (file)
@@ -16,17 +16,11 @@ bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\
 changequote([,])dnl
 
 bfd_version_string="\"${VERSION}\""
-bfd_version_date=`sed -e 's/.*DATE //' < ${srcdir}/version.h`
 if test x${is_release} = x; then
-dnl Sad, but we can't use XSTRING here to pick up the date from version.h
-dnl because traditional C doesn't allow it.
+  bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
   bfd_version_string="\"${VERSION} ${bfd_version_date}\""
 fi
-dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string,
-dnl we may as well substitute for bfd_version_date too.  That way we don't
-dnl need to #include version.h
 AC_SUBST(bfd_version)
-AC_SUBST(bfd_version_date)
 AC_SUBST(bfd_version_string)
 
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
@@ -563,8 +557,8 @@ do
     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_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
-    bfd_elf32_bigarm_vec)      tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
-    bfd_elf32_bigarmqnx_vec)   tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
+    bfd_elf32_bigarm_vec)      tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_bigarmqnx_vec)   tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_bigmips_vec)     tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_cris_vec)                tb="$tb elf32-cris.lo elf32.lo $elf" ;;
     bfd_elf32_d10v_vec)                tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
@@ -576,9 +570,9 @@ do
     bfd_elf32_hppa_linux_vec)  tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)                tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_i370_vec)                tb="$tb elf32-i370.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_freebsd_vec)        tb="$tb elf32-i386-fbsd.lo elf32.lo $elf" ;;
-    bfd_elf32_i386_vec)                tb="$tb elf32-i386.lo elf32.lo $elf" ;;
-    bfd_elf32_i386qnx_vec)     tb="$tb elf32-i386qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386_freebsd_vec)        tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386_vec)                tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_i386qnx_vec)     tb="$tb elf32-i386.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i860_vec)                tb="$tb elf32-i860.lo elf32.lo $elf" ;;
     bfd_elf32_i960_vec)                tb="$tb elf32-i960.lo elf32.lo $elf" ;;
@@ -588,8 +582,8 @@ do
     bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
     bfd_elf32_littlearc_vec)   tb="$tb elf32-arc.lo elf32.lo $elf" ;;
     bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
-    bfd_elf32_littlearm_vec)   tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
-    bfd_elf32_littlearmqnx_vec)        tb="$tb elfarmqnx-nabi.lo elfarm-nabi.lo elf32.lo $elf" ;;
+    bfd_elf32_littlearm_vec)   tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_littlearmqnx_vec)        tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_littlemips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_m32r_vec)                tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
     bfd_elf32_m68hc11_vec)     tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;;
@@ -608,26 +602,28 @@ do
     bfd_elf32_or32_big_vec)    tb="$tb elf32-or32.lo elf32.lo $elf" ;;
     bfd_elf32_pj_vec)           tb="$tb elf32-pj.lo elf32.lo $elf";;
     bfd_elf32_pjl_vec)          tb="$tb elf32-pj.lo elf32.lo $elf";;
-    bfd_elf32_powerpc_vec)     tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
-    bfd_elf32_powerpcle_vec)   tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
-    bfd_elf32_powerpcleqnx_vec)        tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
-    bfd_elf32_powerpcqnx_vec)  tb="$tb elf32-ppcqnx.lo elf32-ppc.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpc_vec)     tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcle_vec)   tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcleqnx_vec)        tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
+    bfd_elf32_powerpcqnx_vec)  tb="$tb elf32-ppc.lo elf32-qnx.lo elf32.lo $elf" ;;
     bfd_elf32_s390_vec)                tb="$tb elf32-s390.lo elf32.lo $elf" ;;
     # FIXME: We include cofflink.lo not because it's needed for
     # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
     # which needs it but does not list it.  Should be fixed in right place.
     bfd_elf32_sh64_vec)                tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     bfd_elf32_sh64l_vec)       tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
-    bfd_elf32_sh64lnbsd_vec)   tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
-    bfd_elf32_sh64nbsd_vec)    tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
-    bfd_elf32_sh_vec)          tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shblin_vec)      tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shl_vec)         tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shlin_vec)       tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shlnbsd_vec)     tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shlqnx_vec)      tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
-    bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
-    bfd_elf32_shqnx_vec)       tb="$tb elf32-shqnx.lo elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_sh64lin_vec)     tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64blin_vec)    tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64lnbsd_vec)   tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf32_sh64nbsd_vec)    tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
+    bfd_elf32_sh_vec)          tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shblin_vec)      tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shl_vec)         tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo elf32-qnx.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shlin_vec)       tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlnbsd_vec)     tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shlqnx_vec)      tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
+    bfd_elf32_shqnx_vec)       tb="$tb elf32-sh.lo elf32-qnx.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)       tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
     bfd_elf32_tradbigmips_vec)  tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
     bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
@@ -635,7 +631,7 @@ do
     bfd_elf32_v850_vec)                tb="$tb elf32-v850.lo elf32.lo $elf" ;;
     bfd_elf32_vax_vec)         tb="$tb elf32-vax.lo elf32.lo $elf" ;;
     bfd_elf32_xstormy16_vec)   tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;;
-    bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha-fbsd.lo elf64.lo $elf"; target_size=64 ;;
+    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 ;;
@@ -654,8 +650,10 @@ do
     bfd_elf64_s390_vec)                tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_sh64_vec)                tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64l_vec)       tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64lnbsd_vec)   tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
-    bfd_elf64_sh64nbsd_vec)    tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64lin_vec)     tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+    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 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 ;;
@@ -880,6 +878,6 @@ case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
 esac
 
 rm -f doc/config.status
-AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
+AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in,
 [sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile])
 
index f20113c7f70e160a1f4496515024c80b957106e7..a236bfb32fd2c448c5ff6d44326627429aeb7233 100644 (file)
@@ -1,3 +1,11 @@
+2002-10-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * Makefile.in: Regenerate.
+
+2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       * Makefile.in: Regenerated.
+
 2002-08-29  John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
        * chew.c (paramstuff, outputdots, perform, bang and usage): Remove
index 0787143fcd9de0d24a36eba0ffd063f67f0aeda1..da51daf9cd915c95f0eb3c16e524c732f65219e5 100644 (file)
@@ -248,6 +248,8 @@ BFD_H_DEP = \
        $(srcdir)/../corefile.c         \
        $(srcdir)/../targets.c          \
        $(srcdir)/../format.c           \
+       $(srcdir)/../linker.c           \
+       $(srcdir)/../simple.c           \
        $(srcdir)/header.sed            \
        $(srcdir)/proto.str             \
        $(srcdir)/../version.h          \
index 66a19d1adb88f01d1f2f923966e247e1bfc323ae..d25bbf2c74339e77ce6b662f0ae26712a55d828b 100644 (file)
@@ -119,7 +119,6 @@ bfd_default_target_size = @bfd_default_target_size@
 bfd_libs = @bfd_libs@
 bfd_machines = @bfd_machines@
 bfd_version = @bfd_version@
-bfd_version_date = @bfd_version_date@
 bfd_version_string = @bfd_version_string@
 bfdincludedir = @bfdincludedir@
 bfdlibdir = @bfdlibdir@
@@ -216,6 +215,8 @@ BFD_H_DEP = \
        $(srcdir)/../corefile.c         \
        $(srcdir)/../targets.c          \
        $(srcdir)/../format.c           \
+       $(srcdir)/../linker.c           \
+       $(srcdir)/../simple.c           \
        $(srcdir)/header.sed            \
        $(srcdir)/proto.str             \
        $(srcdir)/../version.h          \
@@ -244,7 +245,7 @@ DIST_COMMON =  ChangeLog Makefile.am Makefile.in
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
 all: all-redirect
 .SUFFIXES:
index 7c000b9890e54562186aaa1f11fda3d42f2cf9c1..063982662bc7582bf1379e37cab654c6e06741d8 100644 (file)
@@ -402,7 +402,7 @@ read_indirect_string (unit, buf, bytes_read_ptr)
       return NULL;
     }
 
-  buf = stash->dwarf_str_buffer + offset;  
+  buf = stash->dwarf_str_buffer + offset;
   if (*buf == '\0')
     return NULL;
   return buf;
@@ -578,7 +578,8 @@ read_abbrevs (abfd, offset, stash)
 
       /* Read in abbrev header.  */
       cur_abbrev->number = abbrev_number;
-      cur_abbrev->tag = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
+      cur_abbrev->tag = (enum dwarf_tag)
+       read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
       abbrev_ptr += bytes_read;
       cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr);
       abbrev_ptr += 1;
@@ -601,8 +602,10 @@ read_abbrevs (abfd, offset, stash)
                return 0;
            }
 
-         cur_abbrev->attrs[cur_abbrev->num_attrs].name = abbrev_name;
-         cur_abbrev->attrs[cur_abbrev->num_attrs++].form = abbrev_form;
+         cur_abbrev->attrs[cur_abbrev->num_attrs].name
+           = (enum dwarf_attribute) abbrev_name;
+         cur_abbrev->attrs[cur_abbrev->num_attrs++].form
+           = (enum dwarf_form) abbrev_form;
          abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
          abbrev_ptr += bytes_read;
          abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
@@ -614,7 +617,7 @@ read_abbrevs (abfd, offset, stash)
       abbrevs[hash_number] = cur_abbrev;
 
       /* Get next abbreviation.
-         Under Irix6 the abbreviations for a compilation unit are not
+        Under Irix6 the abbreviations for a compilation unit are not
         always properly terminated with an abbrev number of 0.
         Exit loop if we encounter an abbreviation which we have
         already read (which means we are about to read the abbreviations
@@ -646,7 +649,7 @@ read_attribute_value (attr, form, unit, info_ptr)
   struct dwarf_block *blk;
   bfd_size_type amt;
 
-  attr->form = form;
+  attr->form = (enum dwarf_form) form;
 
   switch (form)
     {
@@ -806,7 +809,8 @@ struct line_info_table
   char* comp_dir;
   char** dirs;
   struct fileinfo* files;
-  struct line_info* last_line;
+  struct line_info* last_line;  /* largest VMA */
+  struct line_info* lcl_head;   /* local head; used in 'add_line_info' */
 };
 
 struct funcinfo
@@ -817,6 +821,11 @@ struct funcinfo
   bfd_vma high;
 };
 
+/* add_line_info: adds a new entry to the line_info list in the
+   line_info_table, ensuring that the list is sorted.  Note that the
+   line_info list is sorted from highest to lowest VMA (with possible
+   duplicates); that is, line_info->prev_line always accesses an equal
+   or smaller VMA.  */
 static void
 add_line_info (table, address, filename, line, column, end_sequence)
      struct line_info_table* table;
@@ -829,9 +838,72 @@ add_line_info (table, address, filename, line, column, end_sequence)
   bfd_size_type amt = sizeof (struct line_info);
   struct line_info* info = (struct line_info*) bfd_alloc (table->abfd, amt);
 
-  info->prev_line = table->last_line;
-  table->last_line = info;
+  /* Find the correct location for 'info'.  Normally we will receive
+     new line_info data 1) in order and 2) with increasing VMAs.
+     However some compilers break the rules (cf. decode_line_info) and
+     so we include some heuristics for quickly finding the correct
+     location for 'info'. In particular, these heuristics optimize for
+     the common case in which the VMA sequence that we receive is a
+     list of locally sorted VMAs such as
+       p...z a...j  (where a < j < p < z)
 
+     Note: table->lcl_head is used to head an *actual* or *possible*
+     sequence within the list (such as a...j) that is not directly
+     headed by table->last_line
+
+     Note: we may receive duplicate entries from 'decode_line_info'.  */
+
+  while (1)
+    if (!table->last_line
+       || address >= table->last_line->address)
+      {
+       /* Normal case: add 'info' to the beginning of the list */
+       info->prev_line = table->last_line;
+       table->last_line = info;
+
+       /* lcl_head: initialize to head a *possible* sequence at the end.  */
+       if (!table->lcl_head)
+         table->lcl_head = info;
+       break;
+      }
+    else if (!table->lcl_head->prev_line
+            && table->lcl_head->address > address)
+      {
+       /* Abnormal but easy: lcl_head is 1) at the *end* of the line
+          list and 2) the head of 'info'.  */
+       info->prev_line = NULL;
+       table->lcl_head->prev_line = info;
+       break;
+      }
+    else if (table->lcl_head->prev_line
+            && table->lcl_head->address > address
+            && address >= table->lcl_head->prev_line->address)
+      {
+       /* Abnormal but easy: lcl_head is 1) in the *middle* of the line
+          list and 2) the head of 'info'.  */
+       info->prev_line = table->lcl_head->prev_line;
+       table->lcl_head->prev_line = info;
+       break;
+      }
+    else
+      {
+       /* Abnormal and hard: Neither 'last_line' nor 'lcl_head' are valid
+          heads for 'info'.  Reset 'lcl_head' and repeat.  */
+       struct line_info* li2 = table->last_line; /* always non-NULL */
+       struct line_info* li1 = li2->prev_line;
+
+       while (li1)
+         {
+           if (li2->address > address && address >= li1->address)
+             break;
+
+           li2 = li1; /* always non-NULL */
+           li1 = li1->prev_line;
+         }
+       table->lcl_head = li2;
+      }
+
+  /* Set member data of 'info'.  */
   info->address = address;
   info->filename = filename;
   info->line = line;
@@ -908,7 +980,8 @@ arange_add (unit, low_pc, high_pc)
     }
 
   /* Need to allocate a new arange and insert it into the arange list.  */
-  arange = bfd_zalloc (unit->abfd, (bfd_size_type) sizeof (*arange));
+  arange = (struct arange *)
+    bfd_zalloc (unit->abfd, (bfd_size_type) sizeof (*arange));
   arange->low = low_pc;
   arange->high = high_pc;
 
@@ -982,6 +1055,7 @@ decode_line_info (unit, stash)
 
   table->files = NULL;
   table->last_line = NULL;
+  table->lcl_head = NULL;
 
   line_ptr = stash->dwarf_line_buffer + unit->line_offset;
 
@@ -1091,10 +1165,10 @@ decode_line_info (unit, stash)
       int basic_block = 0;
       int end_sequence = 0;
       /* eraxxon@alumni.rice.edu: Against the DWARF2 specs, some
-         compilers generate address sequences that are wildly out of
-         order using DW_LNE_set_address (e.g. Intel C++ 6.0 compiler
-         for ia64-Linux).  Thus, to determine the low and high
-         address, we must compare on every DW_LNS_copy, etc.  */
+        compilers generate address sequences that are wildly out of
+        order using DW_LNE_set_address (e.g. Intel C++ 6.0 compiler
+        for ia64-Linux).  Thus, to determine the low and high
+        address, we must compare on every DW_LNS_copy, etc.  */
       bfd_vma low_pc  = 0;
       bfd_vma high_pc = 0;
 
@@ -1249,19 +1323,31 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr,
      const char **filename_ptr;
      unsigned int *linenumber_ptr;
 {
+  /* Note: table->last_line should be a descendingly sorted list. */
   struct line_info* next_line = table->last_line;
-  struct line_info* each_line;
+  struct line_info* each_line = NULL;
+  *filename_ptr = NULL;
 
   if (!next_line)
     return false;
 
   each_line = next_line->prev_line;
 
+  /* Check for large addresses */
+  if (addr > next_line->address)
+    each_line = NULL; /* ensure we skip over the normal case */
+
+  /* Normal case: search the list; save  */
   while (each_line && next_line)
     {
-      if (!each_line->end_sequence
-         && addr >= each_line->address && addr < next_line->address)
+      /* If we have an address match, save this info.  This allows us
+        to return as good as results as possible for strange debugging
+        info.  */
+      boolean addr_match = false;
+      if (each_line->address <= addr && addr <= next_line->address)
        {
+         addr_match = true;
+
          /* If this line appears to span functions, and addr is in the
             later function, return the first line of that function instead
             of the last line of the earlier one.  This check is for GCC
@@ -1278,16 +1364,22 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr,
              *filename_ptr = each_line->filename;
              *linenumber_ptr = each_line->line;
            }
-         return true;
        }
+
+      if (addr_match && !each_line->end_sequence)
+       return true; /* we have definitely found what we want */
+
       next_line = each_line;
       each_line = each_line->prev_line;
     }
 
-  /* At this point each_line is NULL but next_line is not.  If we found the
-     containing function in this compilation unit, return the first line we
-     have a number for.  This is also for compatibility with GCC 2.95.  */
-  if (function != NULL)
+  /* At this point each_line is NULL but next_line is not.  If we found
+     a candidate end-of-sequence point in the loop above, we can return
+     that (compatibility with a bug in the Intel compiler); otherwise,
+     assuming that we found the containing function for this address in
+     this compilation unit, return the first line we have a number for
+     (compatibility with GCC 2.95).  */
+  if (*filename_ptr == NULL && function != NULL)
     {
       *filename_ptr = next_line->filename;
       *linenumber_ptr = next_line->line;
@@ -1645,18 +1737,18 @@ comp_unit_contains_address (unit, addr)
   struct arange *arange;
 
   if (unit->error)
-    return 0;
+    return false;
 
   arange = &unit->arange;
   do
     {
       if (addr >= arange->low && addr < arange->high)
-       return 1;
+       return true;
       arange = arange->next;
     }
   while (arange);
 
-  return 0;
+  return false;
 }
 
 /* If UNIT contains ADDR, set the output parameters to the values for
@@ -1701,7 +1793,7 @@ comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr,
        }
 
       if (unit->first_child_die_ptr < unit->end_ptr
-          && ! scan_unit_for_functions (unit))
+         && ! scan_unit_for_functions (unit))
        {
          unit->error = 1;
          return false;
@@ -1714,7 +1806,7 @@ comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr,
   line_p = lookup_address_in_line_info_table (unit->line_table, addr,
                                              function, filename_ptr,
                                              linenumber_ptr);
-  return line_p || func_p;
+  return (boolean) (line_p || func_p);
 }
 
 /* Locate a section in a BFD containing debugging info.  The search starts
@@ -1821,7 +1913,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
         return false;
 
       /* There can be more than one DWARF2 info section in a BFD these days.
-         Read them all in and produce one large stash.  We do this in two
+        Read them all in and produce one large stash.  We do this in two
         passes - in the first pass we just accumulate the section sizes.
         In the second pass we read in the section's contents.  The allows
         us to avoid reallocing the data as we add sections to the stash.  */
@@ -1917,7 +2009,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
       stash->info_ptr += addr_size;
 
       if (length > 0)
-        {
+       {
          each = parse_comp_unit (abfd, stash, length, offset_size);
          stash->info_ptr += length;
 
index 47b65822340abe7a1f4a5a0c167fb09f8f005ac2..4f129f602f6eafa2c38ffa26c58369e6b20b2788 100644 (file)
@@ -3837,7 +3837,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
     = backend->debug_swap.swap_ext_in;
   bfd_size_type external_ext_size = backend->debug_swap.external_ext_size;
   unsigned long ext_count;
-  struct ecoff_link_hash_entry **sym_hash;
+  struct bfd_link_hash_entry **sym_hash;
   char *ext_ptr;
   char *ext_end;
   bfd_size_type amt;
@@ -3846,10 +3846,10 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
 
   amt = ext_count;
   amt *= sizeof (struct bfd_link_hash_entry *);
-  sym_hash = (struct ecoff_link_hash_entry **) bfd_alloc (abfd, amt);
+  sym_hash = (struct bfd_link_hash_entry **) bfd_alloc (abfd, amt);
   if (!sym_hash)
     return false;
-  ecoff_data (abfd)->sym_hashes = sym_hash;
+  ecoff_data (abfd)->sym_hashes = (struct ecoff_link_hash_entry **) sym_hash;
 
   ext_ptr = (char *) external_ext;
   ext_end = ext_ptr + ext_count * external_ext_size;
@@ -3980,15 +3980,13 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
 
       name = ssext + esym.asym.iss;
 
-      h = NULL;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, name,
              (flagword) (esym.weakext ? BSF_WEAK : BSF_GLOBAL),
-             section, value, (const char *) NULL, true, true,
-             (struct bfd_link_hash_entry **) &h)))
+             section, value, (const char *) NULL, true, true, sym_hash)))
        return false;
 
-      *sym_hash = h;
+      h = (struct ecoff_link_hash_entry *) *sym_hash;
 
       /* If we are building an ECOFF hash table, save the external
         symbol information.  */
index e80fc6c9d5704ac6d1119cba11afc5a5ad606ec6..b6d2d2f8087375ad6f04bb4f11121e8dfb086418 100644 (file)
@@ -414,7 +414,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
            /* 64-bit .eh_frame is not supported.  */
            goto free_no_table;
          buf += 4;
-         if ((buf - ehbuf) + hdr.length > sec->_raw_size)
+         if ((bfd_size_type) (buf - ehbuf) + hdr.length > sec->_raw_size)
            /* CIE/FDE not contained fully in this .eh_frame input section.  */
            goto free_no_table;
 
index c1e2d118071e25c92919e180b627a680b7d249d6..f184c9fb8eb6188decba1b0ba99f612af9694877 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6803,8 +6803,8 @@ elfcore_grok_note (abfd, note)
 #endif
 
     case NT_PRXFPREG:          /* Linux SSE extension */
-      if (note->namesz == 5
-         && ! strcmp (note->namedata, "LINUX"))
+      if (note->namesz == 6
+         && strcmp (note->namedata, "LINUX") == 0)
        return elfcore_grok_prxfpreg (abfd, note);
       else
        return true;
index ff5c5f4718933d7b7d1db1033287dfd505fa8cb4..fad1a1e86dd0bb99b65ec3dce876e908085c57b5 100644 (file)
@@ -1,5 +1,6 @@
 /* ARC-specific support for 32-bit ELF
-   Copyright 1994, 1995, 1997, 1999, 2001 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1997, 1999, 2001, 2002
+   Free Software Foundation, Inc.
    Contributed by Doug Evans (dje@cygnus.com).
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -39,7 +40,7 @@ static bfd_reloc_status_type arc_elf_b22_pcrel
 /* Try to minimize the amount of space occupied by relocation tables
    on the ROM (not that the ROM won't be swamped by other ELF overhead).  */
 
-#define USE_REL
+#define USE_REL        1
 
 static reloc_howto_type elf_arc_howto_table[] =
 {
index 2d59601fd022aaafec11e29d93b0ce387c5b490c..5901aeaa090c54214851286280afb3cd4a41754e 100644 (file)
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
+#ifndef USE_REL
+#define USE_REL        0
+#endif
+
 typedef unsigned long int insn32;
 typedef unsigned short int insn16;
 
@@ -76,7 +80,7 @@ static boolean elf32_arm_finish_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 static struct bfd_hash_entry * elf32_arm_link_hash_newfunc
   PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-#ifdef USE_REL
+#if USE_REL
 static void arm_add_to_rel
   PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma));
 #endif
@@ -427,6 +431,7 @@ record_arm_to_thumb_glue (link_info, h)
   asection * s;
   char * tmp_name;
   struct elf_link_hash_entry * myh;
+  struct bfd_link_hash_entry * bh;
   struct elf32_arm_link_hash_table * globals;
   bfd_vma val;
 
@@ -460,11 +465,11 @@ record_arm_to_thumb_glue (link_info, h)
   /* The only trick here is using hash_table->arm_glue_size as the value. Even
      though the section isn't allocated yet, this is where we will be putting
      it.  */
+  bh = NULL;
   val = globals->arm_glue_size + 1;
   _bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner,
                                    tmp_name, BSF_GLOBAL, s, val,
-                                   NULL, true, false,
-                                   (struct bfd_link_hash_entry **) &myh);
+                                   NULL, true, false, &bh);
 
   free (tmp_name);
 
@@ -482,6 +487,7 @@ record_thumb_to_arm_glue (link_info, h)
   asection *s;
   char *tmp_name;
   struct elf_link_hash_entry *myh;
+  struct bfd_link_hash_entry *bh;
   struct elf32_arm_link_hash_table *hash_table;
   char bind;
   bfd_vma val;
@@ -513,13 +519,14 @@ record_thumb_to_arm_glue (link_info, h)
       return;
     }
 
+  bh = NULL;
   val = hash_table->thumb_glue_size + 1;
   _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner,
                                    tmp_name, BSF_GLOBAL, s, val,
-                                   NULL, true, false,
-                                   (struct bfd_link_hash_entry **) &myh);
+                                   NULL, true, false, &bh);
 
   /* If we mark it 'Thumb', the disassembler will do a better job.  */
+  myh = (struct elf_link_hash_entry *) bh;
   bind = ELF_ST_BIND (myh->type);
   myh->type = ELF_ST_INFO (bind, STT_ARM_TFUNC);
 
@@ -536,13 +543,11 @@ record_thumb_to_arm_glue (link_info, h)
 
   sprintf (tmp_name, CHANGE_TO_ARM, name);
 
-  myh = NULL;
-
+  bh = NULL;
   val = hash_table->thumb_glue_size + 4,
   _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner,
                                    tmp_name, BSF_LOCAL, s, val,
-                                   NULL, true, false,
-                                   (struct bfd_link_hash_entry **) &myh);
+                                   NULL, true, false, &bh);
 
   free (tmp_name);
 
@@ -1093,7 +1098,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
   local_got_offsets = elf_local_got_offsets (input_bfd);
   r_symndx = ELF32_R_SYM (rel->r_info);
 
-#ifdef USE_REL
+#if USE_REL
   addend = bfd_get_32 (input_bfd, hit_data) & howto->src_mask;
 
   if (addend & ((howto->src_mask + 1) >> 1))
@@ -1369,7 +1374,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
 
     case R_ARM_THM_ABS5:
       /* Support ldr and str instructions for the thumb.  */
-#ifdef USE_REL
+#if USE_REL
       /* Need to refetch addend.  */
       addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask;
       /* ??? Need to determine shift amount from operand size.  */
@@ -1401,7 +1406,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
        bfd_vma        check;
        bfd_signed_vma signed_check;
 
-#ifdef USE_REL
+#if USE_REL
        /* Need to refetch the addend and squish the two 11 bit pieces
           together.  */
        {
@@ -1506,7 +1511,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
        bfd_signed_vma reloc_signed_min = ~ reloc_signed_max;
        bfd_signed_vma signed_check;
 
-#ifdef USE_REL
+#if USE_REL
        /* Need to refetch addend.  */
        addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask;
        if (addend & ((howto->src_mask + 1) >> 1))
@@ -1744,7 +1749,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
     }
 }
 
-#ifdef USE_REL
+#if USE_REL
 /* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS.  */
 static void
 arm_add_to_rel (abfd, address, howto, increment)
@@ -1836,7 +1841,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
   Elf_Internal_Rela *           relend;
   const char *                  name;
 
-#ifndef USE_REL
+#if !USE_REL
   if (info->relocateable)
     return true;
 #endif
@@ -1865,7 +1870,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
           || r_type == R_ARM_GNU_VTINHERIT)
         continue;
 
-#ifdef USE_REL
+#if USE_REL
       elf32_arm_info_to_howto (input_bfd, & bfd_reloc,
                               (Elf_Internal_Rel *) rel);
 #else
@@ -1873,7 +1878,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
 #endif
       howto = bfd_reloc.howto;
 
-#ifdef USE_REL
+#if USE_REL
       if (info->relocateable)
        {
          /* This is a relocateable link.  We don't have to change
@@ -1906,7 +1911,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
        {
          sym = local_syms + r_symndx;
          sec = local_sections[r_symndx];
-#ifdef USE_REL
+#if USE_REL
          relocation = (sec->output_section->vma
                        + sec->output_offset
                        + sym->st_value);
@@ -3648,9 +3653,7 @@ elf32_arm_reloc_type_class (rela)
 
 #define ELF_ARCH                       bfd_arch_arm
 #define ELF_MACHINE_CODE               EM_ARM
-#ifndef ELF_MAXPAGESIZE
 #define ELF_MAXPAGESIZE                        0x8000
-#endif
 
 #define bfd_elf32_bfd_copy_private_bfd_data    elf32_arm_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data   elf32_arm_merge_private_bfd_data
@@ -3677,7 +3680,7 @@ elf32_arm_reloc_type_class (rela)
 #define elf_backend_plt_readonly    1
 #define elf_backend_want_got_plt    1
 #define elf_backend_want_plt_sym    0
-#ifndef USE_REL
+#if !USE_REL
 #define elf_backend_rela_normal     1
 #endif
 
index 1dec0b08a131189f1a6d3d3ed7317bd92e8bfbbb..fe31b925c0aadd9497092aee23a9f4ce26629b8e 100644 (file)
@@ -43,7 +43,7 @@ static boolean elf32_d10v_relocate_section
           asection **));
 
 /* Use REL instead of RELA to save space.  */
-#define USE_REL
+#define USE_REL        1
 
 static reloc_howto_type elf_d10v_howto_table[] =
   {
diff --git a/bfd/elf32-i386-fbsd.c b/bfd/elf32-i386-fbsd.c
deleted file mode 100644 (file)
index 500e0eb..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Intel IA-32 specific support for 32-bit ELF on FreeBSD.
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_LITTLE_SYM      bfd_elf32_i386_freebsd_vec
-#define TARGET_LITTLE_NAME     "elf32-i386-freebsd"
-#define ELF_ARCH               bfd_arch_i386
-#define ELF_MACHINE_CODE       EM_386
-#define ELF_MAXPAGESIZE                0x1000
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf-bfd.h"
-
-/* The kernel recognizes executables as valid only if they carry a
-   "FreeBSD" label in the ELF header.  So we put this label on all
-   executables and (for simplicity) also all other object files.  */
-
-static void elf_i386_post_process_headers
-  PARAMS ((bfd *, struct bfd_link_info *));
-
-static void
-elf_i386_post_process_headers (abfd, link_info)
-     bfd * abfd;
-     struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
-{
-  Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form.  */
-
-  i_ehdrp = elf_elfheader (abfd);
-
-  /* Put an ABI label supported by FreeBSD >= 4.1.  */
-  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
-#ifdef OLD_FREEBSD_ABI_LABEL
-  /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
-  memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
-#endif
-}
-
-#define elf_backend_post_process_headers       elf_i386_post_process_headers
-
-#include "elf32-i386.c"
index b71d78eb073dbb46a9f1fb893499153966c0c3ba..e26ee798afbc750d5724a14467af145be73b76c9 100644 (file)
@@ -2617,36 +2617,40 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
                  BFD_ASSERT (rel->r_offset >= 1);
                  val = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
                  BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size);
-                 if (val != 0xa1)
-                   {
-                     BFD_ASSERT (rel->r_offset >= 2);
-                     type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
-                   }
                  if (val == 0xa1)
                    {
                      /* movl foo, %eax.  */
-                     bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 2);
-                   }
-                 else if (type == 0x8b)
-                   {
-                     /* movl */
-                     BFD_ASSERT ((val & 0xc7) == 0x05);
-                     bfd_put_8 (output_bfd, 0xc7,
-                                contents + rel->r_offset - 2);
-                     bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7),
-                                contents + rel->r_offset - 1);
+                     bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 1);
                    }
-                 else if (type == 0x03)
+                 else
                    {
-                     /* addl */
-                     BFD_ASSERT ((val & 0xc7) == 0x05);
-                     bfd_put_8 (output_bfd, 0x81,
-                                contents + rel->r_offset - 2);
-                     bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7),
-                                contents + rel->r_offset - 1);
+                     BFD_ASSERT (rel->r_offset >= 2);
+                     type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
+                     switch (type)
+                       {
+                       case 0x8b:
+                         /* movl */
+                         BFD_ASSERT ((val & 0xc7) == 0x05);
+                         bfd_put_8 (output_bfd, 0xc7,
+                                    contents + rel->r_offset - 2);
+                         bfd_put_8 (output_bfd,
+                                    0xc0 | ((val >> 3) & 7),
+                                    contents + rel->r_offset - 1);
+                         break;
+                       case 0x03:
+                         /* addl */
+                         BFD_ASSERT ((val & 0xc7) == 0x05);
+                         bfd_put_8 (output_bfd, 0x81,
+                                    contents + rel->r_offset - 2);
+                         bfd_put_8 (output_bfd,
+                                    0xc0 | ((val >> 3) & 7),
+                                    contents + rel->r_offset - 1);
+                         break;
+                       default:
+                         BFD_FAIL ();
+                         break;
+                       }
                    }
-                 else
-                   BFD_FAIL ();
                  bfd_put_32 (output_bfd, -tpoff (info, relocation),
                              contents + rel->r_offset);
                  continue;
@@ -2926,7 +2930,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
 
        case R_386_TLS_LDO_32:
-         if (info->shared)
+         if (info->shared || (input_section->flags & SEC_CODE) == 0)
            relocation -= dtpoff_base (info);
          else
            /* When converting LDO to LE, we must negate.  */
@@ -3344,13 +3348,11 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
   return true;
 }
 
-#ifndef ELF_ARCH
 #define TARGET_LITTLE_SYM              bfd_elf32_i386_vec
 #define TARGET_LITTLE_NAME             "elf32-i386"
 #define ELF_ARCH                       bfd_arch_i386
 #define ELF_MACHINE_CODE               EM_386
 #define ELF_MAXPAGESIZE                        0x1000
-#endif /* ELF_ARCH */
 
 #define elf_backend_can_gc_sections    1
 #define elf_backend_can_refcount       1
@@ -3385,6 +3387,62 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
 #define elf_backend_relocate_section         elf_i386_relocate_section
 #define elf_backend_size_dynamic_sections     elf_i386_size_dynamic_sections
 
-#ifndef ELF32_I386_C_INCLUDED
 #include "elf32-target.h"
+
+/* FreeBSD support.  */
+
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM               bfd_elf32_i386_freebsd_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf32-i386-freebsd"
+
+/* The kernel recognizes executables as valid only if they carry a
+   "FreeBSD" label in the ELF header.  So we put this label on all
+   executables and (for simplicity) also all other object files.  */
+
+static void elf_i386_post_process_headers
+  PARAMS ((bfd *, struct bfd_link_info *));
+
+static void
+elf_i386_post_process_headers (abfd, link_info)
+     bfd *abfd;
+     struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+{
+  Elf_Internal_Ehdr *i_ehdrp;
+
+  i_ehdrp = elf_elfheader (abfd);
+
+  /* Put an ABI label supported by FreeBSD >= 4.1.  */
+  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+#ifdef OLD_FREEBSD_ABI_LABEL
+  /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
+  memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
 #endif
+}
+
+#undef elf_backend_post_process_headers
+#define        elf_backend_post_process_headers      elf_i386_post_process_headers
+
+#define        elf32_bed                       elf32_i386_fbsd_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_post_process_headers
+#undef elf32_bed
+
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM               bfd_elf32_i386qnx_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf32-i386-nto"
+
+#define        elf32_bed                       elf32_i386_qnx_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_set_nonloadable_filepos
+#undef elf_backend_is_contained_by_filepos
+#undef elf_backend_copy_private_bfd_data_p
+#undef elf32_bed
diff --git a/bfd/elf32-i386qnx.c b/bfd/elf32-i386qnx.c
deleted file mode 100644 (file)
index 523eecb..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Intel 80386/80486 QNX specific support for 32-bit ELF
-   Copyright 2002
-   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELF32_I386_C_INCLUDED
-#include "elf32-i386.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM                  bfd_elf32_i386qnx_vec
-
-#include "elf32-target.h"
-
index 01946465ce130c79b0113f68a09de0716cece76e..67da85c058a8bf82f3c14d9e16a9762500aa68fe 100644 (file)
@@ -1671,6 +1671,7 @@ ip2k_elf_gc_sweep_hook (abfd, info, sec, relocs)
 
 #define ELF_ARCH        bfd_arch_ip2k
 #define ELF_MACHINE_CODE EM_IP2K
+#define ELF_MACHINE_ALT1 EM_IP2K_OLD
 #define ELF_MAXPAGESIZE  1 /* No pages on the IP2K */
 
 #define elf_info_to_howto_rel                  NULL
@@ -1689,4 +1690,3 @@ ip2k_elf_gc_sweep_hook (abfd, info, sec, relocs)
 
 
 #include "elf32-target.h"
-
index a2e9e0baafe38c380b20ae422ac8b9244a4fb9a6..7a7d500c8118d31b386cc0117fe1c7b67829f437 100644 (file)
@@ -88,7 +88,11 @@ asection * m32r_elf_gc_mark_hook
    This only saves space in libraries and object files, but perhaps
    relocs will be put in ROM?  All in all though, REL relocs are a pain
    to work with.  */
-#define USE_REL
+#define USE_REL        1
+
+#ifndef USE_REL
+#define USE_REL        0
+#endif
 
 static reloc_howto_type m32r_elf_howto_table[] =
 {
@@ -847,6 +851,7 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
         section already exists a new one is created that follows it which
         screws of _SDA_BASE_ address calcs because output_offset != 0.  */
       struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh;
       asection *s = bfd_get_section_by_name (abfd, ".sdata");
 
       /* The following code was cobbled from elf32-ppc.c and elflink.c.  */
@@ -863,10 +868,10 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
          bfd_set_section_alignment (abfd, s, 2);
        }
 
-      h = (struct elf_link_hash_entry *)
-       bfd_link_hash_lookup (info->hash, "_SDA_BASE_", false, false, false);
+      bh = bfd_link_hash_lookup (info->hash, "_SDA_BASE_",
+                                false, false, false);
 
-      if ((h == NULL || h->root.type == bfd_link_hash_undefined)
+      if ((bh == NULL || bh->type == bfd_link_hash_undefined)
          && !(_bfd_generic_link_add_one_symbol (info,
                                                 abfd,
                                                 "_SDA_BASE_",
@@ -876,8 +881,9 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
                                                 (const char *) NULL,
                                                 false,
                                                 get_elf_backend_data (abfd)->collect,
-                                                (struct bfd_link_hash_entry **) &h)))
+                                                &bh)))
        return false;
+      h = (struct elf_link_hash_entry *) bh;
       h->type = STT_OBJECT;
     }
 
@@ -980,7 +986,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   /* Assume success.  */
   boolean ret = true;
 
-#ifndef USE_REL
+#if !USE_REL
   if (info->relocateable)
     return true;
 #endif
@@ -1024,7 +1030,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
       howto = m32r_elf_howto_table + r_type;
       r_symndx = ELF32_R_SYM (rel->r_info);
 
-#ifdef USE_REL
+#if USE_REL
       if (info->relocateable)
        {
          /* This is a relocateable link.  We don't have to change
@@ -1100,7 +1106,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
              sym = local_syms + r_symndx;
              sec = local_sections[r_symndx];
              sym_name = "<local symbol>";
-#ifndef USE_REL
+#if !USE_REL
              relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
              addend = rel->r_addend;
 #else
@@ -1505,7 +1511,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
             will be at least 4 bytes closer if we can relax.  It'll actually
             be 4 or 8 bytes closer, but we don't know which just yet and
             the difference isn't significant enough to worry about.  */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
          pcrel_value += irel->r_addend;
 #else
          addend = bfd_get_signed_16 (abfd, contents + irel->r_offset + 2);
@@ -1534,7 +1540,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
                     We OR in CODE just in case it's not a nop (technically,
                     CODE currently must be a nop, but for cleanness we
                     allow it to be anything).  */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
                  code = 0x7e000000 | MAKE_PARALLEL (code);
 #else
                  code = (0x7e000000 + (((addend >> 2) & 0xff) << 16)) | MAKE_PARALLEL (code);
@@ -1544,7 +1550,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
              else
                {
                  /* Change the seth rN,foo to a bl24 foo.  */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
                  code = 0xfe000000;
 #else
                  code = 0xfe000000 + ((addend >> 2) & 0xffffff);
@@ -2105,7 +2111,7 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
 #define elf_backend_check_relocs                m32r_elf_check_relocs
 
 #define elf_backend_can_gc_sections             1
-#ifndef USE_REL
+#if !USE_REL
 #define elf_backend_rela_normal                        1
 #endif
 #if 0 /* not yet */
index f189be898cef6440d2a996e4fa6d96e5a3606f76..9f05a9e1d8487851af17adffa8b12aad27a29604 100644 (file)
@@ -62,7 +62,7 @@ boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd *, flagword));
 boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
 
 /* Use REL instead of RELA to save space */
-#define USE_REL
+#define USE_REL        1
 
 /* The Motorola 68HC11 microcontroler only addresses 64Kb.
    We must handle 8 and 16-bit relocations.  The 32-bit relocation
@@ -646,12 +646,11 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
   Elf_Internal_Rela *irel, *irelend;
   bfd_byte *contents = NULL;
   bfd_byte *free_contents = NULL;
-  Elf32_External_Sym *extsyms = NULL;
   Elf32_External_Sym *free_extsyms = NULL;
   Elf_Internal_Rela *prev_insn_branch = NULL;
   Elf_Internal_Rela *prev_insn_group = NULL;
   unsigned insn_group_value = 0;
-  Elf_External_Sym_Shndx *shndx_buf = NULL;
+  Elf_Internal_Sym *isymbuf = NULL;
 
   /* Assume nothing changes.  */
   *again = false;
@@ -693,7 +692,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
     {
       bfd_vma symval;
       bfd_vma value;
-      Elf_Internal_Sym isym;
+      Elf_Internal_Sym *isym;
+      asection *sym_sec;
 
       /* If this isn't something that can be relaxed, then ignore
         this reloc.  */
@@ -777,53 +777,24 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
         }
 
       /* Read this BFD's symbols if we haven't done so already.  */
-      if (extsyms == NULL)
+      if (isymbuf == NULL && symtab_hdr->sh_info != 0)
        {
-         /* Get cached copy if it exists.  */
-         if (symtab_hdr->contents != NULL)
-           extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
-         else
-           {
-             /* Go get them off disk.  */
-             bfd_size_type amt = symtab_hdr->sh_size;
-             extsyms = (Elf32_External_Sym *) bfd_malloc (amt);
-             if (extsyms == NULL)
-               goto error_return;
-             free_extsyms = extsyms;
-             if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
-                 || bfd_bread ((PTR) extsyms, amt, abfd) != amt)
-               goto error_return;
-           }
-
-         if (shndx_hdr->sh_size != 0)
-           {
-             bfd_size_type amt;
-
-             amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx);
-             shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
-             if (shndx_buf == NULL)
-               goto error_return;
-             if (bfd_seek (abfd, shndx_hdr->sh_offset, SEEK_SET) != 0
-                 || bfd_bread ((PTR) shndx_buf, amt, abfd) != amt)
-               goto error_return;
-             shndx_hdr->contents = (PTR) shndx_buf;
-           }
+         isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+         if (isymbuf == NULL)
+           isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+                                           symtab_hdr->sh_info, 0,
+                                           NULL, NULL, NULL);
+         if (isymbuf == NULL)
+           goto error_return;
        }
 
       /* Get the value of the symbol referred to by the reloc.  */
       if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
        {
-         Elf32_External_Sym *esym;
-         Elf_External_Sym_Shndx *shndx;
-         asection *sym_sec;
-
          /* A local symbol.  */
-         esym = extsyms + ELF32_R_SYM (irel->r_info);
-         shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
-         bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
-
-         sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx);
-         symval = (isym.st_value
+         isym = isymbuf + ELF32_R_SYM (irel->r_info);
+          sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+         symval = (isym->st_value
                    + sym_sec->output_section->vma
                    + sym_sec->output_offset);
        }
@@ -847,9 +818,11 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
              continue;
            }
 
+          isym = 0;
+          sym_sec = h->root.u.def.section;
          symval = (h->root.u.def.value
-                   + h->root.u.def.section->output_section->vma
-                   + h->root.u.def.section->output_offset);
+                   + sym_sec->output_section->vma
+                   + sym_sec->output_offset);
        }
 
       if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_RL_GROUP)
@@ -862,10 +835,36 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
            continue;
 
           prev_insn_group = irel;
-          insn_group_value = isym.st_value;
+          insn_group_value = isym->st_value;
           continue;
         }
 
+      /* When we relax some bytes, the size of our section changes.
+         This affects the layout of next input sections that go in our
+         output section.  When the symbol is part of another section that
+         will go in the same output section as the current one, it's
+         final address may now be incorrect (too far).  We must let the
+         linker re-compute all section offsets before processing this
+         reloc.  Code example:
+
+                                Initial             Final
+         .sect .text            section size = 6    section size = 4
+         jmp foo
+         jmp bar
+         .sect .text.foo_bar    output_offset = 6   output_offset = 4
+         foo: rts
+         bar: rts
+
+         If we process the reloc now, the jmp bar is replaced by a
+         relative branch to the initial bar address (output_offset 6).  */
+      if (*again && sym_sec != sec
+          && sym_sec->output_section == sec->output_section)
+        {
+          prev_insn_group = 0;
+          prev_insn_branch = 0;
+          continue;
+        }
+      
       value = symval;
       /* Try to turn a far branch to a near branch.  */
       if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16
@@ -911,6 +910,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
                                               irel->r_offset - 1, 3);
             }
           prev_insn_branch = 0;
+          *again = true;
         }
 
       /* Try to turn a 16 bit address into a 8 bit page0 address.  */
@@ -932,6 +932,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
 
           if (prev_insn_group)
             {
+              unsigned long old_sec_size = sec->_cooked_size;
+              
               /* Note that we've changed the reldection contents, etc.  */
               elf_section_data (sec)->relocs = internal_relocs;
               free_relocs = NULL;
@@ -939,7 +941,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
               elf_section_data (sec)->this_hdr.contents = contents;
               free_contents = NULL;
 
-              symtab_hdr->contents = (bfd_byte *) extsyms;
+              symtab_hdr->contents = (bfd_byte *) isymbuf;
               free_extsyms = NULL;
 
               m68hc11_relax_group (abfd, sec, contents, offset,
@@ -949,6 +951,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
               prev_insn_group = 0;
               irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
                                            R_M68HC11_NONE);
+              if (sec->_cooked_size != old_sec_size)
+                *again = true;
               continue;
             }
           
@@ -968,7 +972,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
           elf_section_data (sec)->this_hdr.contents = contents;
           free_contents = NULL;
 
-          symtab_hdr->contents = (bfd_byte *) extsyms;
+          symtab_hdr->contents = (bfd_byte *) isymbuf;
           free_extsyms = NULL;
 
           /* Fix the opcode.  */
@@ -984,8 +988,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
           irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
                                        R_M68HC11_8);
 
-          /* That will change things, so, we should relax again.
-             Note that this is not required, and it may be slow.  */
+          /* That will change things, so, we should relax again.  */
           *again = true;
         }
       else if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_16)
@@ -1014,7 +1017,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
                   elf_section_data (sec)->this_hdr.contents = contents;
                   free_contents = NULL;
                   
-                  symtab_hdr->contents = (bfd_byte *) extsyms;
+                  symtab_hdr->contents = (bfd_byte *) isymbuf;
                   free_extsyms = NULL;
 
                   /* Shrink the branch.  */
@@ -1027,6 +1030,8 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
                                                R_M68HC11_NONE);
                   m68hc11_elf_relax_delete_bytes (abfd, sec,
                                                   irel->r_offset + 1, 1);
+                  /* That will change things, so, we should relax again.  */
+                  *again = true;
                 }
             }
         }
@@ -1058,7 +1063,7 @@ m68hc11_elf_relax_section (abfd, sec, link_info, again)
       else
        {
          /* Cache the symbols for elf_link_input_bfd.  */
-         symtab_hdr->contents = (unsigned char *) extsyms;
+         symtab_hdr->contents = (unsigned char *) isymbuf;
        }
       free_extsyms = NULL;
     }
@@ -1085,20 +1090,17 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
      int count;
 {
   Elf_Internal_Shdr *symtab_hdr;
-  Elf_Internal_Shdr *shndx_hdr;
-  Elf32_External_Sym *extsyms;
   unsigned int sec_shndx;
-  Elf_External_Sym_Shndx *shndx;
   bfd_byte *contents;
   Elf_Internal_Rela *irel, *irelend;
   bfd_vma toaddr;
-  Elf32_External_Sym *esym, *esymend;
+  Elf_Internal_Sym *isymbuf, *isym, *isymend;
   struct elf_link_hash_entry **sym_hashes;
   struct elf_link_hash_entry **end_hashes;
   unsigned int symcount;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-  extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
+  isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
 
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
@@ -1112,8 +1114,9 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
   /* Actually delete the bytes.  */
   memmove (contents + addr, contents + addr + count,
           (size_t) (toaddr - addr - count));
-  sec->_cooked_size -= count;
 
+  sec->_cooked_size -= count;
+  
   /* Adjust all the relocs.  */
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
     {
@@ -1212,24 +1215,13 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
     }
 
   /* Adjust the local symbols defined in this section.  */
-  shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
-  shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents;
-  esym = extsyms;
-  esymend = esym + symtab_hdr->sh_info;
-  for (; esym < esymend; esym++, shndx = (shndx ? shndx + 1 : NULL))
+  isymend = isymbuf + symtab_hdr->sh_info;
+  for (isym = isymbuf; isym < isymend; isym++)
     {
-      Elf_Internal_Sym isym;
-      Elf_External_Sym_Shndx dummy;
-
-      bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
-
-      if (isym.st_shndx == sec_shndx
-         && isym.st_value > addr
-         && isym.st_value < toaddr)
-       {
-         isym.st_value -= count;
-         bfd_elf32_swap_symbol_out (abfd, &isym, esym, &dummy);
-       }
+      if (isym->st_shndx == sec_shndx
+         && isym->st_value > addr
+         && isym->st_value < toaddr)
+       isym->st_value -= count;
     }
 
   /* Now adjust the global symbols defined in this section.  */
index 9ab8780574c86c9c479072cb8a488f7e754eecac..ea12e3b999e779c72957db0bc28c66a3fa6b83eb 100644 (file)
@@ -54,7 +54,7 @@ boolean _bfd_m68hc12_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
 
 
 /* Use REL instead of RELA to save space */
-#define USE_REL
+#define USE_REL        1
 
 /* The Motorola 68HC11 microcontroler only addresses 64Kb.
    We must handle 8 and 16-bit relocations.  The 32-bit relocation
index a61b09d415258967e2bb0ce8fae66280186527ec..39219e94b090a848f3362b87f3084841d5771a36 100644 (file)
@@ -38,7 +38,7 @@ static bfd_reloc_status_type  or32_elf_jumptarg_reloc          PARAMS ((bfd *, a
 
 /* Try to minimize the amount of space occupied by relocation tables
    on the ROM (not that the ROM won't be swamped by other ELF overhead).  */
-#define USE_REL
+#define USE_REL        1
 
 static reloc_howto_type elf_or32_howto_table[] =
 {
index 6faffd203c0627304ed361860d68e8f37e36f914..56df535f038c25c01bc76092076e388d17e52673 100644 (file)
@@ -3849,7 +3849,25 @@ ppc_elf_grok_psinfo (abfd, note)
 #define elf_backend_grok_psinfo                        ppc_elf_grok_psinfo
 #define elf_backend_reloc_type_class           ppc_elf_reloc_type_class
 
-#ifndef ELF32_PPC_C_INCLUDED
 #include "elf32-target.h"
-#endif
 
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef TARGET_LITTLE_SYM 
+#define        TARGET_LITTLE_SYM               bfd_elf32_powerpcleqnx_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf32-powerpcle-nto"
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                  bfd_elf32_powerpcqnx_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                 "elf32-powerpc-nto"
+
+#define        elf32_bed                       elf32_ppc_qnx_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_set_nonloadable_filepos
+#undef elf_backend_is_contained_by_filepos
+#undef elf_backend_copy_private_bfd_data_p
+#undef elf32_bed
diff --git a/bfd/elf32-ppcqnx.c b/bfd/elf32-ppcqnx.c
deleted file mode 100644 (file)
index 35fbe37..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* PowerPC QNX specific support for 32-bit ELF
-   Copyright 2002 
-   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELF32_PPC_C_INCLUDED
-#include "elf32-ppc.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM 
-#define TARGET_LITTLE_SYM       bfd_elf32_powerpcleqnx_vec
-#undef  TARGET_BIG_SYM
-#define TARGET_BIG_SYM          bfd_elf32_powerpcqnx_vec
-
-#include "elf32-target.h"
-
index d4eefb81508c4590e5d65fd1133c65c7e97a3853..0e79d7e483d5624b5e8a348e5105661ed22eaa06 100644 (file)
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-  /* Returns the end address of the segment + 1.  */
-#define SEGMENT_END(segment, start)                     \
-  (start + (segment->p_memsz > segment->p_filesz        \
-   ? segment->p_memsz : segment->p_filesz))
-
-static boolean elf_qnx_copy_private_bfd_data_p
+boolean elf_qnx_copy_private_bfd_data_p
   PARAMS ((bfd *, asection *, bfd *, asection *));
-static boolean elf_qnx_is_contained_by_filepos
+boolean elf_qnx_is_contained_by_filepos
   PARAMS ((asection *, Elf_Internal_Phdr *));
-static void elf_qnx_set_nonloadable_filepos
+void elf_qnx_set_nonloadable_filepos
   PARAMS ((bfd *, Elf_Internal_Phdr *));
 
-static boolean
-elf_qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec)
-     bfd *ibfd;
-     asection *isec;
-     bfd *obfd;
-     asection *osec;
-{
-  /* We don't use these parameters, but another target might.  */
-  ibfd = ibfd;
-  obfd = obfd;
-  osec = osec;
-
-  return isec->next == NULL;
-}
-
-static boolean
-elf_qnx_is_contained_by_filepos (section, segment)
-     asection *section;
-     Elf_Internal_Phdr *segment;
-{
-  return ((bfd_vma) section->filepos >= segment->p_offset
-          && ((bfd_vma) section->filepos + section->_raw_size
-             <= SEGMENT_END (segment, segment->p_offset)));
-}
-
-static void
-elf_qnx_set_nonloadable_filepos (abfd, phdrs)
-     bfd *abfd;
-     Elf_Internal_Phdr *phdrs;
-{
-  struct elf_segment_map *m;
-  Elf_Internal_Phdr *p;
-  file_ptr off = 0;
-
-  for (m = elf_tdata (abfd)->segment_map, p = phdrs;
-       m != NULL;
-       m = m->next, p++)
-    {
-      unsigned int i;
-      asection **secpp;
-
-      for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
-        {
-          asection *sec;
-
-          sec = *secpp;
-
-          if (p->p_type == PT_LOAD)
-           off = sec->filepos;
-          else
-            {
-              if (i == 0)
-                {
-                  if (sec->filepos)
-                    p->p_offset = sec->filepos;
-                  else
-                    p->p_offset = off;
-                }
-              if (!sec->filepos)
-                {
-                  off += sec->_raw_size;
-                  p->p_filesz += sec->_raw_size;
-                }
-            }
-        }
-    }
-  return;
-}
-
-#ifndef elf_backend_set_nonloadable_filepos
-#define elf_backend_set_nonloadable_filepos elf_qnx_set_nonloadable_filepos
-#endif
-
-#ifndef elf_backend_is_contained_by_filepos
-#define elf_backend_is_contained_by_filepos elf_qnx_is_contained_by_filepos
-#endif
-
-#ifndef elf_backend_copy_private_bfd_data_p
-#define elf_backend_copy_private_bfd_data_p elf_qnx_copy_private_bfd_data_p
-#endif
+#undef elf_backend_set_nonloadable_filepos
+#define        elf_backend_set_nonloadable_filepos elf_qnx_set_nonloadable_filepos
+#undef elf_backend_is_contained_by_filepos
+#define        elf_backend_is_contained_by_filepos elf_qnx_is_contained_by_filepos
+#undef elf_backend_copy_private_bfd_data_p
+#define        elf_backend_copy_private_bfd_data_p elf_qnx_copy_private_bfd_data_p
diff --git a/bfd/elf32-sh-lin.c b/bfd/elf32-sh-lin.c
deleted file mode 100644 (file)
index e0b434d..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Hitachi SH specific support for 32-bit Linux
-   Copyright 2000, 2001 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM bfd_elf32_shblin_vec
-#define TARGET_BIG_NAME "elf32-shbig-linux"
-#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec
-#define TARGET_LITTLE_NAME "elf32-sh-linux"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf/internal.h"
-#include "elf-bfd.h"
-
-static boolean elf32_shlin_grok_prstatus
-  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-static boolean elf32_shlin_grok_psinfo
-  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-
-/* Support for core dump NOTE sections */
-static boolean
-elf32_shlin_grok_prstatus (abfd, note)
-     bfd *abfd;
-     Elf_Internal_Note *note;
-{
-  int offset;
-  unsigned int raw_size;
-
-  switch (note->descsz)
-    {
-      default:
-       return false;
-
-      case 168:                /* Linux/SH */
-       /* pr_cursig */
-       elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
-
-       /* pr_pid */
-       elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
-
-       /* pr_reg */
-       offset = 72;
-       raw_size = 92;
-
-       break;
-    }
-
-  /* Make a ".reg/999" section.  */
-  return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-                                         raw_size, note->descpos + offset);
-}
-
-static boolean
-elf32_shlin_grok_psinfo (abfd, note)
-     bfd *abfd;
-     Elf_Internal_Note *note;
-{
-  switch (note->descsz)
-    {
-      default:
-       return false;
-
-      case 124:                /* Linux/SH elf_prpsinfo */
-       elf_tdata (abfd)->core_program
-        = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
-       elf_tdata (abfd)->core_command
-        = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
-    }
-
-  /* Note that for some reason, a spurious space is tacked
-     onto the end of the args in some (at least one anyway)
-     implementations, so strip it off if it exists.  */
-
-  {
-    char *command = elf_tdata (abfd)->core_command;
-    int n = strlen (command);
-
-    if (0 < n && command[n - 1] == ' ')
-      command[n - 1] = '\0';
-  }
-
-  return true;
-}
-\f
-
-#define elf_backend_grok_prstatus      elf32_shlin_grok_prstatus
-#define elf_backend_grok_psinfo                elf32_shlin_grok_psinfo
-
-
-
-#include "elf32-sh.c"
diff --git a/bfd/elf32-sh-nbsd.c b/bfd/elf32-sh-nbsd.c
deleted file mode 100644 (file)
index 692b057..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Hitachi SH specific support for 32-bit NetBSD
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM bfd_elf32_shnbsd_vec
-#define TARGET_BIG_NAME "elf32-sh-nbsd"
-#define TARGET_LITTLE_SYM bfd_elf32_shlnbsd_vec
-#define TARGET_LITTLE_NAME "elf32-shl-nbsd"
-#define ELF_ARCH bfd_arch_sh
-#define ELF_MACHINE_CODE EM_SH
-#define ELF_MAXPAGESIZE 0x10000
-#define elf_symbol_leading_char 0
-
-#include "elf32-sh.c"
index c8bbe7152dbe10b3251c0cd2291181ce8a79a34a..0f681a805cd0c9c0c670f325dcb2070b9228bef6 100644 (file)
@@ -59,6 +59,12 @@ static bfd_byte *sh_elf_get_relocated_section_contents
 static void sh_elf_copy_indirect_symbol
   PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
           struct elf_link_hash_entry *));
+static int sh_elf_optimized_tls_reloc
+  PARAMS ((struct bfd_link_info *, int, int));
+static boolean sh_elf_mkobject
+  PARAMS((bfd *));
+static boolean sh_elf_object_p
+  PARAMS((bfd *));
 static boolean sh_elf_check_relocs
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
           const Elf_Internal_Rela *));
@@ -82,6 +88,8 @@ static boolean create_got_section
   PARAMS((bfd *, struct bfd_link_info *));
 static boolean sh_elf_create_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_vma dtpoff_base
+  PARAMS ((struct bfd_link_info *));
 static asection * sh_elf_gc_mark_hook
   PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
           struct elf_link_hash_entry *, Elf_Internal_Sym *));
@@ -97,6 +105,10 @@ static enum elf_reloc_type_class sh_elf_reloc_type_class
 #ifdef INCLUDE_SHMEDIA
 inline static void movi_shori_putval PARAMS ((bfd *, unsigned long, char *));
 #endif
+static boolean elf32_shlin_grok_prstatus
+  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
+static boolean elf32_shlin_grok_psinfo
+  PARAMS ((bfd *abfd, Elf_Internal_Note *note));
 
 /* The name of the dynamic interpreter.  This is put in the .interp
    section.  */
@@ -713,14 +725,119 @@ static reloc_howto_type sh_elf_howto_table[] =
   EMPTY_HOWTO (141),
   EMPTY_HOWTO (142),
   EMPTY_HOWTO (143),
-  EMPTY_HOWTO (144),
-  EMPTY_HOWTO (145),
-  EMPTY_HOWTO (146),
-  EMPTY_HOWTO (147),
-  EMPTY_HOWTO (148),
-  EMPTY_HOWTO (149),
-  EMPTY_HOWTO (150),
-  EMPTY_HOWTO (151),
+
+  HOWTO (R_SH_TLS_GD_32,       /* 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, /* */
+        "R_SH_TLS_GD_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_LD_32,       /* 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, /* */
+        "R_SH_TLS_LD_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_LDO_32,      /* 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, /* */
+        "R_SH_TLS_LDO_32",     /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_IE_32,       /* 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, /* */
+        "R_SH_TLS_IE_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_LE_32,       /* 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, /* */
+        "R_SH_TLS_LE_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_DTPMOD32,    /* 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, /* */
+        "R_SH_TLS_DTPMOD32",   /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_DTPOFF32,    /* 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, /* */
+        "R_SH_TLS_DTPOFF32",   /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_TPOFF32,     /* 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, /* */
+        "R_SH_TLS_TPOFF32",    /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
   EMPTY_HOWTO (152),
   EMPTY_HOWTO (153),
   EMPTY_HOWTO (154),
@@ -1776,6 +1893,14 @@ static const struct elf_reloc_map sh_reloc_map[] =
   { BFD_RELOC_VTABLE_ENTRY, R_SH_GNU_VTENTRY },
   { BFD_RELOC_SH_LOOP_START, R_SH_LOOP_START },
   { BFD_RELOC_SH_LOOP_END, R_SH_LOOP_END },
+  { BFD_RELOC_SH_TLS_GD_32, R_SH_TLS_GD_32 },
+  { BFD_RELOC_SH_TLS_LD_32, R_SH_TLS_LD_32 },
+  { BFD_RELOC_SH_TLS_LDO_32, R_SH_TLS_LDO_32 },
+  { BFD_RELOC_SH_TLS_IE_32, R_SH_TLS_IE_32 },
+  { BFD_RELOC_SH_TLS_LE_32, R_SH_TLS_LE_32 },
+  { BFD_RELOC_SH_TLS_DTPMOD32, R_SH_TLS_DTPMOD32 },
+  { BFD_RELOC_SH_TLS_DTPOFF32, R_SH_TLS_DTPOFF32 },
+  { BFD_RELOC_SH_TLS_TPOFF32, R_SH_TLS_TPOFF32 },
   { BFD_RELOC_32_GOT_PCREL, R_SH_GOT32 },
   { BFD_RELOC_32_PLT_PCREL, R_SH_PLT32 },
   { BFD_RELOC_SH_COPY, R_SH_COPY },
@@ -1874,6 +1999,7 @@ sh_elf_info_to_howto (abfd, cache_ptr, dst)
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_2 || r > R_SH_LAST_INVALID_RELOC_2);
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_3 || r > R_SH_LAST_INVALID_RELOC_3);
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_4 || r > R_SH_LAST_INVALID_RELOC_4);
+  BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_5 || r > R_SH_LAST_INVALID_RELOC_5);
 
   cache_ptr->howto = &sh_elf_howto_table[r];
 }
@@ -3047,7 +3173,7 @@ static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] =
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0xce, 0x00, 0x01, 0x10, /* movi  -GOT_BIAS, r17 */
-  0x00, 0xca, 0x45, 0x10, /* sub.l r12, r17, r17 */
+  0x00, 0xc8, 0x45, 0x10, /* add.l r12, r17, r17 */
   0x89, 0x10, 0x09, 0x90, /* ld.l  r17, 8, r25 */
   0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */
   0x89, 0x10, 0x05, 0x10, /* ld.l  r17, 4, r17 */
@@ -3067,7 +3193,7 @@ static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] =
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0x10, 0x01, 0x00, 0xce, /* movi  -GOT_BIAS, r17 */
-  0x10, 0x45, 0xca, 0x00, /* sub.l r12, r17, r17 */
+  0x10, 0x45, 0xc8, 0x00, /* add.l r12, r17, r17 */
   0x90, 0x09, 0x10, 0x89, /* ld.l  r17, 8, r25 */
   0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */
   0x10, 0x05, 0x10, 0x89, /* ld.l  r17, 4, r17 */
@@ -3383,13 +3509,56 @@ struct elf_sh_link_hash_entry
   struct elf_link_hash_entry root;
 
 #ifdef INCLUDE_SHMEDIA
-  bfd_vma datalabel_got_offset;
+  union
+  {
+    bfd_signed_vma refcount;
+    bfd_vma offset;
+  } datalabel_got;
 #endif
 
   /* Track dynamic relocs copied for this symbol.  */
   struct elf_sh_dyn_relocs *dyn_relocs;
+
+  bfd_signed_vma gotplt_refcount;
+
+  enum {
+    GOT_UNKNOWN = 0, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE
+  } tls_type;
+
+  /* If true, R_SH_TLS_TPOFF32 relocation is generated.  */
+  boolean tls_tpoff32;
+};
+
+#define sh_elf_hash_entry(ent) ((struct elf_sh_link_hash_entry *)(ent))
+
+struct sh_elf_obj_tdata
+{
+  struct elf_obj_tdata root;
+
+  /* tls_type for each local got entry.  */
+  char *local_got_tls_type;
 };
 
+#define sh_elf_tdata(abfd) \
+  ((struct sh_elf_obj_tdata *) (abfd)->tdata.any)
+
+#define sh_elf_local_got_tls_type(abfd) \
+  (sh_elf_tdata (abfd)->local_got_tls_type)
+
+/* Override the generic function because we need to store sh_elf_obj_tdata
+   as the specific tdata.  */
+
+static boolean
+sh_elf_mkobject (abfd)
+     bfd *abfd;
+{
+  bfd_size_type amt = sizeof (struct sh_elf_obj_tdata);
+  abfd->tdata.any = bfd_zalloc (abfd, amt);
+  if (abfd->tdata.any == NULL)
+    return false;
+  return true;
+}
+                 
 /* sh ELF linker hash table.  */
 
 struct elf_sh_link_hash_table
@@ -3407,6 +3576,13 @@ struct elf_sh_link_hash_table
 
   /* Small local sym to section mapping cache.  */
   struct sym_sec_cache sym_sec;
+
+  /* A counter or offset to track a TLS got entry.  */
+  union
+    {
+      bfd_signed_vma refcount;
+      bfd_vma offset;
+    } tls_ldm_got;
 };
 
 /* Traverse an sh ELF linker hash table.  */
@@ -3448,13 +3624,13 @@ sh_elf_link_hash_newfunc (entry, table, string)
                                     table, string));
   if (ret != (struct elf_sh_link_hash_entry *) NULL)
     {
-      struct elf_sh_link_hash_entry *eh;
-
-      eh = (struct elf_sh_link_hash_entry *) ret;
-      eh->dyn_relocs = NULL;
+      ret->dyn_relocs = NULL;
+      ret->gotplt_refcount = 0;
 #ifdef INCLUDE_SHMEDIA
-      ret->datalabel_got_offset = (bfd_vma) -1;
+      ret->datalabel_got.refcount = ret->root.got.refcount;
 #endif
+      ret->tls_type = GOT_UNKNOWN;
+      ret->tls_tpoff32 = false;
     }
 
   return (struct bfd_hash_entry *) ret;
@@ -3488,6 +3664,7 @@ sh_elf_link_hash_table_create (abfd)
   ret->sdynbss = NULL;
   ret->srelbss = NULL;
   ret->sym_sec.abfd = NULL;
+  ret->tls_ldm_got.refcount = 0;
 
   return &ret->root.root;
 }
@@ -3579,13 +3756,16 @@ sh_elf_create_dynamic_sections (abfd, info)
     {
       /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
         .plt section.  */
-      struct elf_link_hash_entry *h = NULL;
+      struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh = NULL;
+
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
              (bfd_vma) 0, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             get_elf_backend_data (abfd)->collect, &bh)))
        return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
@@ -3867,6 +4047,18 @@ allocate_dynrelocs (h, inf)
   info = (struct bfd_link_info *) inf;
   htab = sh_elf_hash_table (info);
 
+  eh = (struct elf_sh_link_hash_entry *) h;
+  if ((h->got.refcount > 0
+      || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+      && eh->gotplt_refcount > 0)
+    {
+      /* The symbol has been forced local, or we have some direct got refs,
+         so treat all the gotplt refs as got refs. */
+      h->got.refcount += eh->gotplt_refcount;
+      if (h->plt.refcount >= eh->gotplt_refcount)
+       h->plt.refcount -= eh->gotplt_refcount;
+    }
+
   if (htab->root.dynamic_sections_created
       && h->plt.refcount > 0)
     {
@@ -3928,6 +4120,7 @@ allocate_dynrelocs (h, inf)
     {
       asection *s;
       boolean dyn;
+      int tls_type = sh_elf_hash_entry (h)->tls_type;
 
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
@@ -3939,29 +4132,51 @@ allocate_dynrelocs (h, inf)
        }
 
       s = htab->sgot;
+      h->got.offset = s->_raw_size;
+      s->_raw_size += 4;
+      /* R_SH_TLS_GD needs 2 consecutive GOT slots.  */
+      if (tls_type == GOT_TLS_GD)
+       s->_raw_size += 4;
+      dyn = htab->root.dynamic_sections_created;
+      /* R_SH_TLS_IE_32 needs one dynamic relocation,
+        R_SH_TLS_GD needs one if local symbol and two if global.  */
+      if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
+         || tls_type == GOT_TLS_IE)
+       htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      else if (tls_type == GOT_TLS_GD)
+       htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela);
+      else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
+       htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+    }
+  else
+    h->got.offset = (bfd_vma) -1;
+
 #ifdef INCLUDE_SHMEDIA
-      if (h->type == STT_DATALABEL)
-       {
-         struct elf_sh_link_hash_entry *hsh;
+  if (eh->datalabel_got.refcount > 0)
+    {
+      asection *s;
+      boolean dyn;
 
-         h = (struct elf_link_hash_entry *) h->root.u.i.link;
-         hsh = (struct elf_sh_link_hash_entry *)h;
-         hsh->datalabel_got_offset = s->_raw_size;
+      /* Make sure this symbol is output as a dynamic symbol.
+        Undefined weak syms won't yet be marked as dynamic.  */
+      if (h->dynindx == -1
+         && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+       {
+         if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+           return false;
        }
-      else
-       h->got.offset = s->_raw_size;
-#else
-      h->got.offset = s->_raw_size;
-#endif
+
+      s = htab->sgot;
+      eh->datalabel_got.offset = s->_raw_size;
       s->_raw_size += 4;
       dyn = htab->root.dynamic_sections_created;
       if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
        htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
     }
   else
-    h->got.offset = (bfd_vma) -1;
+    eh->datalabel_got.offset = (bfd_vma) -1;
+#endif
 
-  eh = (struct elf_sh_link_hash_entry *) h;
   if (eh->dyn_relocs == NULL)
     return true;
 
@@ -3992,6 +4207,9 @@ allocate_dynrelocs (h, inf)
     }
   else
     {
+      if (sh_elf_hash_entry (h)->tls_tpoff32)
+       goto keep;
+
       /* For the non-shared case, discard space for relocs against
         symbols which turn out to need copy relocs or are not
         dynamic.  */
@@ -4099,6 +4317,7 @@ sh_elf_size_dynamic_sections (output_bfd, info)
     {
       bfd_signed_vma *local_got;
       bfd_signed_vma *end_local_got;
+      char *local_tls_type;
       bfd_size_type locsymcount;
       Elf_Internal_Shdr *symtab_hdr;
       asection *srel;
@@ -4144,6 +4363,7 @@ sh_elf_size_dynamic_sections (output_bfd, info)
       locsymcount *= 2;
 #endif
       end_local_got = local_got + locsymcount;
+      local_tls_type = sh_elf_local_got_tls_type (ibfd);
       s = htab->sgot;
       srel = htab->srelgot;
       for (; local_got < end_local_got; ++local_got)
@@ -4152,14 +4372,28 @@ sh_elf_size_dynamic_sections (output_bfd, info)
            {
              *local_got = s->_raw_size;
              s->_raw_size += 4;
+             if (*local_tls_type == GOT_TLS_GD)
+               s->_raw_size += 4;
              if (info->shared)
                srel->_raw_size += sizeof (Elf32_External_Rela);
            }
          else
            *local_got = (bfd_vma) -1;
+         ++local_tls_type;
        }
     }
 
+  if (htab->tls_ldm_got.refcount > 0)
+    {
+      /* Allocate 2 got entries and 1 dynamic reloc for R_SH_TLS_LD_32
+        relocs.  */
+      htab->tls_ldm_got.offset = htab->sgot->_raw_size;
+      htab->sgot->_raw_size += 8;
+      htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+    }
+  else
+    htab->tls_ldm_got.offset = -1;
+
   /* Allocate global sym .plt and .got entries, and space for global
      sym dynamic relocs.  */
   elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info);
@@ -4295,6 +4529,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   asection *sgotplt;
   asection *splt;
   asection *sreloc;
+  asection *srelgot;
 
   htab = sh_elf_hash_table (info);
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
@@ -4306,6 +4541,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   sgotplt = htab->sgotplt;
   splt = htab->splt;
   sreloc = NULL;
+  srelgot = NULL;
 
   rel = relocs;
   relend = relocs + input_section->reloc_count;
@@ -4321,6 +4557,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
       bfd_vma addend = (bfd_vma) 0;
       bfd_reloc_status_type r;
       int seen_stt_datalabel = 0;
+      bfd_vma off;
+      int tls_type;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
 
@@ -4342,6 +4580,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
              && r_type <= (int) R_SH_LAST_INVALID_RELOC_3)
          || (   r_type >= (int) R_SH_FIRST_INVALID_RELOC_4
              && r_type <= (int) R_SH_LAST_INVALID_RELOC_4)
+         || (   r_type >= (int) R_SH_FIRST_INVALID_RELOC_5
+             && r_type <= (int) R_SH_LAST_INVALID_RELOC_5)
          || (r_type >= (int) R_SH_FIRST_INVALID_RELOC_2
              && r_type <= (int) R_SH_LAST_INVALID_RELOC_2))
        {
@@ -4512,15 +4752,18 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                             with them here.  */
                          || ((input_section->flags & SEC_DEBUGGING) != 0
                              && (h->elf_link_hash_flags
-                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
+                 || (sec->output_section == NULL
+                     && (sh_elf_hash_entry (h)->tls_type == GOT_TLS_IE
+                         || sh_elf_hash_entry (h)->tls_type == GOT_TLS_GD)))
                relocation = 0;
              else if (sec->output_section == NULL)
                {
                  (*_bfd_error_handler)
-                   (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
+                   (_("%s: unresolvable relocation against symbol `%s' from %s section"),
                     bfd_archive_filename (input_bfd), h->root.root.string,
                     bfd_get_section_name (input_bfd, input_section));
-                 relocation = 0;
+                 return false;
                }
              else
                relocation = ((h->root.u.def.value
@@ -4765,7 +5008,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
          if (h != NULL)
            {
-             bfd_vma off;
              boolean dyn;
 
              off = h->got.offset;
@@ -4775,7 +5017,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                  struct elf_sh_link_hash_entry *hsh;
 
                  hsh = (struct elf_sh_link_hash_entry *)h;
-                 off = hsh->datalabel_got_offset;
+                 off = hsh->datalabel_got.offset;
                }
 #endif
              BFD_ASSERT (off != (bfd_vma) -1);
@@ -4811,7 +5053,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                          struct elf_sh_link_hash_entry *hsh;
 
                          hsh = (struct elf_sh_link_hash_entry *)h;
-                         hsh->datalabel_got_offset |= 1;
+                         hsh->datalabel_got.offset |= 1;
                        }
                      else
 #endif
@@ -4823,8 +5065,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else
            {
-             bfd_vma off;
-
 #ifdef INCLUDE_SHMEDIA
              if (rel->r_addend)
                {
@@ -4858,11 +5098,14 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
                  if (info->shared)
                    {
-                     asection *srelgot;
                      Elf_Internal_Rela outrel;
 
-                     srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
-                     BFD_ASSERT (srelgot != NULL);
+                     if (srelgot == NULL)
+                       {
+                         srelgot = bfd_get_section_by_name (dynobj,
+                                                            ".rela.got");
+                         BFD_ASSERT (srelgot != NULL);
+                       }
 
                      outrel.r_offset = (sgot->output_section->vma
                                         + sgot->output_offset
@@ -4996,92 +5239,536 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                   rel->r_offset, sec, start, end);
            break;
          }
-       }
 
-    relocation_done:
-      if (r != bfd_reloc_ok)
-       {
-         switch (r)
+       case R_SH_TLS_GD_32:
+       case R_SH_TLS_IE_32:
+         r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
+         tls_type = GOT_UNKNOWN;
+         if (h == NULL && local_got_offsets)
+           tls_type = sh_elf_local_got_tls_type (input_bfd) [r_symndx];
+         else if (h != NULL)
            {
-           default:
-           case bfd_reloc_outofrange:
-             abort ();
-           case bfd_reloc_overflow:
-             {
-               const char *name;
-
-               if (h != NULL)
-                 name = h->root.root.string;
-               else
-                 {
-                   name = (bfd_elf_string_from_elf_section
-                           (input_bfd, symtab_hdr->sh_link, sym->st_name));
-                   if (name == NULL)
-                     return false;
-                   if (*name == '\0')
-                     name = bfd_section_name (input_bfd, sec);
-                 }
-               if (! ((*info->callbacks->reloc_overflow)
-                      (info, name, howto->name, (bfd_vma) 0,
-                       input_bfd, input_section, rel->r_offset)))
-                 return false;
-             }
-             break;
+             tls_type = sh_elf_hash_entry (h)->tls_type;
+             if (! info->shared
+                 && (h->dynindx == -1
+                     || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+                 && (tls_type == GOT_TLS_IE
+                     || sh_elf_hash_entry (h)->tls_tpoff32))
+               r_type = R_SH_TLS_LE_32;
            }
-       }
-    }
 
-  return true;
-}
+         if (r_type == R_SH_TLS_GD_32 && tls_type == GOT_TLS_IE)
+           r_type = R_SH_TLS_IE_32;
 
-/* This is a version of bfd_generic_get_relocated_section_contents
-   which uses sh_elf_relocate_section.  */
+         if (r_type == R_SH_TLS_LE_32)
+           {
+             bfd_vma offset;
+             unsigned short insn;
+             int indx;
+             Elf_Internal_Rela outrel;
 
-static bfd_byte *
-sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
-                                      data, relocateable, symbols)
-     bfd *output_bfd;
-     struct bfd_link_info *link_info;
-     struct bfd_link_order *link_order;
-     bfd_byte *data;
-     boolean relocateable;
-     asymbol **symbols;
-{
-  Elf_Internal_Shdr *symtab_hdr;
-  asection *input_section = link_order->u.indirect.section;
-  bfd *input_bfd = input_section->owner;
-  asection **sections = NULL;
-  Elf_Internal_Rela *internal_relocs = NULL;
-  Elf_Internal_Sym *isymbuf = NULL;
+             if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_GD_32)
+               {
+                 /* GD->LE transition:
+                      mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+                      jsr @r1; add r12,r4; bra 3f; nop; .align 2; 
+                      1: .long x$TLSGD; 2: .long __tls_get_addr@PLT; 3:
+                    We change it into:
+                      mov.l 1f,r4; stc gbr,r0; add r4,r0; nop;
+                      nop; nop; ...
+                      1: .long x@TPOFF; 2: .long __tls_get_addr@PLT; 3:.  */
+
+                 offset = rel->r_offset;
+                 BFD_ASSERT (offset >= 16);
+                 /* Size of GD instructions is 16 or 18.  */
+                 offset -= 16;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                 if ((insn & 0xff00) == 0xc700)
+                   {
+                     BFD_ASSERT (offset >= 2);
+                     offset -= 2;
+                     insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                   }
 
-  /* We only need to handle the case of relaxing, or of having a
-     particular set of section contents, specially.  */
-  if (relocateable
-      || elf_section_data (input_section)->this_hdr.contents == NULL)
-    return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
-                                                      link_order, data,
-                                                      relocateable,
-                                                      symbols);
+                 BFD_ASSERT ((insn & 0xff00) == 0xd400);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 2);
+                 BFD_ASSERT ((insn & 0xff00) == 0xc700);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 4);
+                 BFD_ASSERT ((insn & 0xff00) == 0xd100);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 6);
+                 BFD_ASSERT (insn == 0x310c);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 8);
+                 BFD_ASSERT (insn == 0x410b);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 10);
+                 BFD_ASSERT (insn == 0x34cc);
+
+                 bfd_put_16 (output_bfd, 0x0012, contents + offset + 2);
+                 bfd_put_16 (output_bfd, 0x304c, contents + offset + 4);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 6);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+               }
+             else
+               {
+                 int index;
+
+                 /* IE->LE transition:
+                    mov.l 1f,r0; stc gbr,rN; mov.l @(r0,r12),rM;
+                    bra 2f; add ...; .align 2; 1: x@GOTTPOFF; 2:
+                    We change it into:
+                    mov.l .Ln,rM; stc gbr,rN; nop; ...;
+                    1: x@TPOFF; 2:.  */
+
+                 offset = rel->r_offset;
+                 BFD_ASSERT (offset >= 16);
+                 /* Size of IE instructions is 10 or 12.  */
+                 offset -= 10;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                 if ((insn & 0xf0ff) == 0x0012)
+                   {
+                     BFD_ASSERT (offset >= 2);
+                     offset -= 2;
+                     insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                   }
 
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+                 BFD_ASSERT ((insn & 0xff00) == 0xd000);
+                 index = insn & 0x00ff;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 2);
+                 BFD_ASSERT ((insn & 0xf0ff) == 0x0012);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 4);
+                 BFD_ASSERT ((insn & 0xf0ff) == 0x00ce);
+                 insn = 0xd000 | (insn & 0x0f00) | index;
+                 bfd_put_16 (output_bfd, insn, contents + offset + 0);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 4);
+               }
 
-  memcpy (data, elf_section_data (input_section)->this_hdr.contents,
-         (size_t) input_section->_raw_size);
+             if (sreloc == NULL)
+               {
+                 const char *name;
 
-  if ((input_section->flags & SEC_RELOC) != 0
-      && input_section->reloc_count > 0)
-    {
-      asection **secpp;
-      Elf_Internal_Sym *isym, *isymend;
-      bfd_size_type amt;
+                 name = (bfd_elf_string_from_elf_section
+                         (input_bfd,
+                          elf_elfheader (input_bfd)->e_shstrndx,
+                          elf_section_data (input_section)->rel_hdr.sh_name));
+                 if (name == NULL)
+                   return false;
 
-      internal_relocs = (_bfd_elf32_link_read_relocs
-                        (input_bfd, input_section, (PTR) NULL,
-                         (Elf_Internal_Rela *) NULL, false));
-      if (internal_relocs == NULL)
-       goto error_return;
+                 BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                             && strcmp (bfd_get_section_name (input_bfd,
+                                                              input_section),
+                                        name + 5) == 0);
 
-      if (symtab_hdr->sh_info != 0)
+                 sreloc = bfd_get_section_by_name (dynobj, name);
+                 BFD_ASSERT (sreloc != NULL);
+               }
+
+             indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+             outrel.r_offset = (input_section->output_section->vma
+                                + input_section->output_offset
+                                + rel->r_offset);
+             outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+             if (indx == 0)
+               outrel.r_addend = relocation - dtpoff_base (info);
+             else
+               outrel.r_addend = 0;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                        (((Elf32_External_Rela *)
+                                          sreloc->contents)
+                                         + sreloc->reloc_count));
+             ++sreloc->reloc_count;
+
+             continue;
+           }
+
+         sgot = htab->sgot;
+         if (sgot == NULL)
+           abort ();
+
+         if (h != NULL)
+           off = h->got.offset;
+         else
+           {
+             if (local_got_offsets == NULL)
+               abort ();
+
+             off = local_got_offsets[r_symndx];
+           }
+
+         if ((off & 1) != 0)
+           off &= ~1;
+          else
+           {
+             Elf_Internal_Rela outrel;
+             Elf32_External_Rela *loc;
+             int dr_type, indx;
+
+             if (srelgot == NULL)
+               {
+                 srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+                 BFD_ASSERT (srelgot != NULL);
+               }
+
+             outrel.r_offset = (sgot->output_section->vma
+                                + sgot->output_offset + off);
+
+             indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+             dr_type = (r_type == R_SH_TLS_GD_32 ? R_SH_TLS_DTPMOD32 :
+                        R_SH_TLS_TPOFF32);
+             if (dr_type == R_SH_TLS_TPOFF32 && indx == 0)
+               outrel.r_addend = relocation - dtpoff_base (info);
+             else
+               outrel.r_addend = 0;
+             outrel.r_info = ELF32_R_INFO (indx, dr_type);
+             loc = (Elf32_External_Rela *) srelgot->contents;
+             loc += srelgot->reloc_count++;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+
+             if (r_type == R_SH_TLS_GD_32)
+               {
+                 if (indx == 0)
+                   {
+                     bfd_put_32 (output_bfd,
+                                 relocation - dtpoff_base (info),
+                                 sgot->contents + off + 4);
+                   }
+                 else
+                   {
+                     outrel.r_info = ELF32_R_INFO (indx,
+                                                   R_SH_TLS_DTPOFF32);
+                     outrel.r_offset += 4;
+                     outrel.r_addend = 0;
+                     srelgot->reloc_count++;
+                     loc++;
+                     bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                               loc);
+                   }
+               }
+
+             if (h != NULL)
+               h->got.offset |= 1;
+             else
+               local_got_offsets[r_symndx] |= 1;
+           }
+
+         if (off >= (bfd_vma) -2)
+           abort ();
+
+         if (r_type == (int) ELF32_R_TYPE (rel->r_info))
+           relocation = sgot->output_offset + off;
+         else
+           {
+             bfd_vma offset;
+             unsigned short insn;
+
+             /* GD->IE transition:
+                  mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+                  jsr @r1; add r12,r4; bra 3f; nop; .align 2;
+                  1: .long x$TLSGD; 2: .long __tls_get_addr@PLT; 3:
+                We change it into:
+                  mov.l 1f,r0; stc gbr,r4; mov.l @(r0,r12),r0; add r4,r0;
+                  nop; nop; bra 3f; nop; .align 2;
+                  1: .long x@TPOFF; 2:...; 3:.  */
+
+             offset = rel->r_offset;
+             BFD_ASSERT (offset >= 16);
+             /* Size of GD instructions is 16 or 18.  */
+             offset -= 16;
+             insn = bfd_get_16 (input_bfd, contents + offset + 0);
+             if ((insn & 0xff00) == 0xc700)
+               {
+                 BFD_ASSERT (offset >= 2);
+                 offset -= 2;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+               }
+
+             BFD_ASSERT ((insn & 0xff00) == 0xd400);
+
+             /* Replace mov.l 1f,R4 with mov.l 1f,r0.  */
+             bfd_put_16 (output_bfd, insn & 0xf0ff, contents + offset);
+
+             insn = bfd_get_16 (input_bfd, contents + offset + 2);
+             BFD_ASSERT ((insn & 0xff00) == 0xc700);
+             insn = bfd_get_16 (input_bfd, contents + offset + 4);
+             BFD_ASSERT ((insn & 0xff00) == 0xd100);
+             insn = bfd_get_16 (input_bfd, contents + offset + 6);
+             BFD_ASSERT (insn == 0x310c);
+             insn = bfd_get_16 (input_bfd, contents + offset + 8);
+             BFD_ASSERT (insn == 0x410b);
+             insn = bfd_get_16 (input_bfd, contents + offset + 10);
+             BFD_ASSERT (insn == 0x34cc);
+
+             bfd_put_16 (output_bfd, 0x0412, contents + offset + 2);
+             bfd_put_16 (output_bfd, 0x00ce, contents + offset + 4);
+             bfd_put_16 (output_bfd, 0x304c, contents + offset + 6);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+
+             bfd_put_32 (output_bfd, sgot->output_offset + off,
+                         contents + rel->r_offset);
+
+             continue;
+         }
+
+         addend = rel->r_addend;
+
+         goto final_link_relocate;
+
+       case R_SH_TLS_LD_32:
+         if (! info->shared)
+           {
+             bfd_vma offset;
+             unsigned short insn;
+
+             /* LD->LE transition:
+                  mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+                  jsr @r1; add r12,r4; bra 3f; nop; .align 2;
+                  1: .long x$TLSLD; 2: .long __tls_get_addr@PLT; 3:
+                We change it into:
+                  stc gbr,r0; nop; nop; nop;
+                  nop; nop; bra 3f; ...; 3:.  */
+
+             offset = rel->r_offset;
+             BFD_ASSERT (offset >= 16);
+             /* Size of LD instructions is 16 or 18.  */
+             offset -= 16;
+             insn = bfd_get_16 (input_bfd, contents + offset + 0);
+             if ((insn & 0xff00) == 0xc700)
+               {
+                 BFD_ASSERT (offset >= 2);
+                 offset -= 2;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+               }
+
+             BFD_ASSERT ((insn & 0xff00) == 0xd400);
+             insn = bfd_get_16 (input_bfd, contents + offset + 2);
+             BFD_ASSERT ((insn & 0xff00) == 0xc700);
+             insn = bfd_get_16 (input_bfd, contents + offset + 4);
+             BFD_ASSERT ((insn & 0xff00) == 0xd100);
+             insn = bfd_get_16 (input_bfd, contents + offset + 6);
+             BFD_ASSERT (insn == 0x310c);
+             insn = bfd_get_16 (input_bfd, contents + offset + 8);
+             BFD_ASSERT (insn == 0x410b);
+             insn = bfd_get_16 (input_bfd, contents + offset + 10);
+             BFD_ASSERT (insn == 0x34cc);
+
+             bfd_put_16 (output_bfd, 0x0012, contents + offset + 0);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 2);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 4);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 6);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+
+             continue;
+           }
+
+         sgot = htab->sgot;
+         if (sgot == NULL)
+           abort ();
+
+         off = htab->tls_ldm_got.offset;
+         if (off & 1)
+           off &= ~1;
+         else
+           {
+             Elf_Internal_Rela outrel;
+             Elf32_External_Rela *loc;
+
+             srelgot = htab->srelgot;
+             if (srelgot == NULL)
+               abort ();
+
+             outrel.r_offset = (sgot->output_section->vma
+                                + sgot->output_offset + off);
+             outrel.r_addend = 0;
+             outrel.r_info = ELF32_R_INFO (0, R_SH_TLS_DTPMOD32);
+             loc = (Elf32_External_Rela *) srelgot->contents;
+             loc += srelgot->reloc_count++;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+             htab->tls_ldm_got.offset |= 1;
+           }
+
+         relocation = sgot->output_offset + off;
+         addend = rel->r_addend;
+
+         goto final_link_relocate;
+
+       case R_SH_TLS_LDO_32:
+         if (! info->shared)
+           {
+             int indx;
+             Elf_Internal_Rela outrel;
+
+             if (sreloc == NULL)
+               {
+                 const char *name;
+
+                 name = (bfd_elf_string_from_elf_section
+                         (input_bfd,
+                          elf_elfheader (input_bfd)->e_shstrndx,
+                          elf_section_data (input_section)->rel_hdr.sh_name));
+                 if (name == NULL)
+                   return false;
+
+                 BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                             && strcmp (bfd_get_section_name (input_bfd,
+                                                              input_section),
+                                        name + 5) == 0);
+
+                 sreloc = bfd_get_section_by_name (dynobj, name);
+                 BFD_ASSERT (sreloc != NULL);
+               }
+
+             indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+             outrel.r_offset = (input_section->output_section->vma
+                                + input_section->output_offset
+                                + rel->r_offset);
+             outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+             if (indx == 0)
+               outrel.r_addend = relocation - dtpoff_base (info);
+             else
+               outrel.r_addend = 0;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                        (((Elf32_External_Rela *)
+                                          sreloc->contents)
+                                         + sreloc->reloc_count));
+             ++sreloc->reloc_count;
+
+             continue;
+           }
+         else
+           relocation -= dtpoff_base (info);
+
+         addend = rel->r_addend;
+         goto final_link_relocate;
+
+       case R_SH_TLS_LE_32:
+         {
+           int indx;
+           Elf_Internal_Rela outrel;
+
+           if (sreloc == NULL)
+             {
+               const char *name;
+
+               name = (bfd_elf_string_from_elf_section
+                       (input_bfd,
+                        elf_elfheader (input_bfd)->e_shstrndx,
+                        elf_section_data (input_section)->rel_hdr.sh_name));
+               if (name == NULL)
+                 return false;
+
+               BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                           && strcmp (bfd_get_section_name (input_bfd,
+                                                            input_section),
+                                      name + 5) == 0);
+
+               sreloc = bfd_get_section_by_name (dynobj, name);
+               BFD_ASSERT (sreloc != NULL);
+             }
+
+           indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+           outrel.r_offset = (input_section->output_section->vma
+                              + input_section->output_offset
+                              + rel->r_offset);
+           outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+           if (indx == 0)
+             outrel.r_addend = relocation - dtpoff_base (info);
+           else
+             outrel.r_addend = 0;
+           bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                      (((Elf32_External_Rela *)
+                                        sreloc->contents)
+                                       + sreloc->reloc_count));
+           ++sreloc->reloc_count;
+
+           continue;
+         }
+       }
+
+    relocation_done:
+      if (r != bfd_reloc_ok)
+       {
+         switch (r)
+           {
+           default:
+           case bfd_reloc_outofrange:
+             abort ();
+           case bfd_reloc_overflow:
+             {
+               const char *name;
+
+               if (h != NULL)
+                 name = h->root.root.string;
+               else
+                 {
+                   name = (bfd_elf_string_from_elf_section
+                           (input_bfd, symtab_hdr->sh_link, sym->st_name));
+                   if (name == NULL)
+                     return false;
+                   if (*name == '\0')
+                     name = bfd_section_name (input_bfd, sec);
+                 }
+               if (! ((*info->callbacks->reloc_overflow)
+                      (info, name, howto->name, (bfd_vma) 0,
+                       input_bfd, input_section, rel->r_offset)))
+                 return false;
+             }
+             break;
+           }
+       }
+    }
+
+  return true;
+}
+
+/* This is a version of bfd_generic_get_relocated_section_contents
+   which uses sh_elf_relocate_section.  */
+
+static bfd_byte *
+sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
+                                      data, relocateable, symbols)
+     bfd *output_bfd;
+     struct bfd_link_info *link_info;
+     struct bfd_link_order *link_order;
+     bfd_byte *data;
+     boolean relocateable;
+     asymbol **symbols;
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  asection *input_section = link_order->u.indirect.section;
+  bfd *input_bfd = input_section->owner;
+  asection **sections = NULL;
+  Elf_Internal_Rela *internal_relocs = NULL;
+  Elf_Internal_Sym *isymbuf = NULL;
+
+  /* We only need to handle the case of relaxing, or of having a
+     particular set of section contents, specially.  */
+  if (relocateable
+      || elf_section_data (input_section)->this_hdr.contents == NULL)
+    return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
+                                                      link_order, data,
+                                                      relocateable,
+                                                      symbols);
+
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+
+  memcpy (data, elf_section_data (input_section)->this_hdr.contents,
+         (size_t) input_section->_raw_size);
+
+  if ((input_section->flags & SEC_RELOC) != 0
+      && input_section->reloc_count > 0)
+    {
+      asection **secpp;
+      Elf_Internal_Sym *isym, *isymend;
+      bfd_size_type amt;
+
+      internal_relocs = (_bfd_elf32_link_read_relocs
+                        (input_bfd, input_section, (PTR) NULL,
+                         (Elf_Internal_Rela *) NULL, false));
+      if (internal_relocs == NULL)
+       goto error_return;
+
+      if (symtab_hdr->sh_info != 0)
        {
          isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
          if (isymbuf == NULL)
@@ -5143,6 +5830,20 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
   return NULL;
 }
 
+/* Return the base VMA address which should be subtracted from real addresses
+   when resolving @dtpoff relocation.
+   This is PT_TLS segment p_vaddr.  */
+
+static bfd_vma
+dtpoff_base (info)
+     struct bfd_link_info *info;
+{
+ /* If tls_segment is NULL, we should have signalled an error already.  */
+ if (elf_hash_table (info)->tls_segment == NULL)
+   return 0;
+  return elf_hash_table (info)->tls_segment->start;
+}
+
 static asection *
 sh_elf_gc_mark_hook (sec, info, rel, h, sym)
      asection *sec;
@@ -5200,6 +5901,7 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
   const Elf_Internal_Rela *rel, *relend;
   unsigned long r_symndx;
   struct elf_link_hash_entry *h;
+  struct elf_sh_link_hash_entry *eh;
 
   elf_section_data (sec)->local_dynrel = NULL;
 
@@ -5209,114 +5911,170 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
 
   relend = relocs + sec->reloc_count;
   for (rel = relocs; rel < relend; rel++)
-    switch (ELF32_R_TYPE (rel->r_info))
-      {
-      case R_SH_GOT32:
-      case R_SH_GOTOFF:
-      case R_SH_GOTPC:
+    {
 #ifdef INCLUDE_SHMEDIA
-      case R_SH_GOT_LOW16:
-      case R_SH_GOT_MEDLOW16:
-      case R_SH_GOT_MEDHI16:
-      case R_SH_GOT_HI16:
-      case R_SH_GOT10BY4:
-      case R_SH_GOT10BY8:
-      case R_SH_GOTOFF_LOW16:
-      case R_SH_GOTOFF_MEDLOW16:
-      case R_SH_GOTOFF_MEDHI16:
-      case R_SH_GOTOFF_HI16:
-      case R_SH_GOTPC_LOW16:
-      case R_SH_GOTPC_MEDLOW16:
-      case R_SH_GOTPC_MEDHI16:
-      case R_SH_GOTPC_HI16:
+      int seen_stt_datalabel = 0;
 #endif
-       r_symndx = ELF32_R_SYM (rel->r_info);
-       if (r_symndx >= symtab_hdr->sh_info)
-         {
-           h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-           if (h->got.refcount > 0)
-             h->got.refcount -= 1;
-         }
-       else if (local_got_refcounts != NULL)
-         {
-           if (local_got_refcounts[r_symndx] > 0)
-             local_got_refcounts[r_symndx] -= 1;
-         }
-       break;
-
-      case R_SH_DIR32:
-      case R_SH_REL32:
-       r_symndx = ELF32_R_SYM (rel->r_info);
-       if (r_symndx >= symtab_hdr->sh_info)
-         {
-           struct elf_sh_link_hash_entry *eh;
-           struct elf_sh_dyn_relocs **pp;
-           struct elf_sh_dyn_relocs *p;
 
-           h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-
-           if (!info->shared && h->plt.refcount > 0)
-             h->plt.refcount -= 1;
+      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];
+#ifdef INCLUDE_SHMEDIA
+         while (h->root.type == bfd_link_hash_indirect
+                || h->root.type == bfd_link_hash_warning)
+           {
+             seen_stt_datalabel |= h->type == STT_DATALABEL;
+             h = (struct elf_link_hash_entry *) h->root.u.i.link;
+           }
+#endif
+       }
+      eh = (struct elf_sh_link_hash_entry *) h;
 
-           eh = (struct elf_sh_link_hash_entry *) h;
+      switch (sh_elf_optimized_tls_reloc (info, ELF32_R_TYPE (rel->r_info),
+                                         ELF32_R_SYM (rel->r_info)
+                                         >= symtab_hdr->sh_info))
+       {
+       case R_SH_TLS_LD_32:
+         if (sh_elf_hash_table (info)->tls_ldm_got.refcount > 0)
+           sh_elf_hash_table (info)->tls_ldm_got.refcount -= 1;
+         break;
 
-           for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
-             if (p->sec == sec)
+       case R_SH_GOT32:
+       case R_SH_GOTOFF:
+       case R_SH_GOTPC:
+#ifdef INCLUDE_SHMEDIA
+       case R_SH_GOT_LOW16:
+       case R_SH_GOT_MEDLOW16:
+       case R_SH_GOT_MEDHI16:
+       case R_SH_GOT_HI16:
+       case R_SH_GOT10BY4:
+       case R_SH_GOT10BY8:
+       case R_SH_GOTOFF_LOW16:
+       case R_SH_GOTOFF_MEDLOW16:
+       case R_SH_GOTOFF_MEDHI16:
+       case R_SH_GOTOFF_HI16:
+       case R_SH_GOTPC_LOW16:
+       case R_SH_GOTPC_MEDLOW16:
+       case R_SH_GOTPC_MEDHI16:
+       case R_SH_GOTPC_HI16:
+#endif
+       case R_SH_TLS_GD_32:
+       case R_SH_TLS_IE_32:
+         if (h != NULL)
+           {
+#ifdef INCLUDE_SHMEDIA
+             if (seen_stt_datalabel)
                {
-                 if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
-                   p->pc_count -= 1;
-                 p->count -= 1;
-                 if (p->count == 0)
-                   *pp = p->next;
-                 break;
+                 if (eh->datalabel_got.refcount > 0)
+                   eh->datalabel_got.refcount -= 1;
                }
-         }
-       break;
+             else
+#endif
+               if (h->got.refcount > 0)
+                 h->got.refcount -= 1;
+           }
+         else if (local_got_refcounts != NULL)
+           {
+#ifdef INCLUDE_SHMEDIA
+             if (rel->r_addend & 1)
+               {
+                 if (local_got_refcounts[symtab_hdr->sh_info + r_symndx] > 0)
+                   local_got_refcounts[symtab_hdr->sh_info + r_symndx] -= 1;
+               }
+             else
+#endif
+               if (local_got_refcounts[r_symndx] > 0)
+                 local_got_refcounts[r_symndx] -= 1;
+           }
+         break;
+
+       case R_SH_DIR32:
+       case R_SH_REL32:
+         if (h != NULL)
+           {
+             struct elf_sh_dyn_relocs **pp;
+             struct elf_sh_dyn_relocs *p;
+
+
+             if (!info->shared && h->plt.refcount > 0)
+               h->plt.refcount -= 1;
+
+             for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+               if (p->sec == sec)
+                 {
+                   if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
+                     p->pc_count -= 1;
+                   p->count -= 1;
+                   if (p->count == 0)
+                     *pp = p->next;
+                   break;
+                 }
+           }
+         break;
 
-      case R_SH_PLT32:
+       case R_SH_PLT32:
 #ifdef INCLUDE_SHMEDIA
-      case R_SH_PLT_LOW16:
-      case R_SH_PLT_MEDLOW16:
-      case R_SH_PLT_MEDHI16:
-      case R_SH_PLT_HI16:
+       case R_SH_PLT_LOW16:
+       case R_SH_PLT_MEDLOW16:
+       case R_SH_PLT_MEDHI16:
+       case R_SH_PLT_HI16:
 #endif
-       r_symndx = ELF32_R_SYM (rel->r_info);
-       if (r_symndx >= symtab_hdr->sh_info)
-         {
-           h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-           if (h->plt.refcount > 0)
-             h->plt.refcount -= 1;
-         }
-       break;
+         if (h != NULL)
+           {
+             if (h->plt.refcount > 0)
+               h->plt.refcount -= 1;
+           }
+         break;
 
-      case R_SH_GOTPLT32:
+       case R_SH_GOTPLT32:
+#ifdef INCLUDE_SHMEDIA
+       case R_SH_GOTPLT_LOW16:
+       case R_SH_GOTPLT_MEDLOW16:
+       case R_SH_GOTPLT_MEDHI16:
+       case R_SH_GOTPLT_HI16:
+       case R_SH_GOTPLT10BY4:
+       case R_SH_GOTPLT10BY8:
+#endif
+         if (h != NULL)
+           {
+             if (eh->gotplt_refcount > 0)
+               {
+                 eh->gotplt_refcount -= 1;
+                 if (h->plt.refcount > 0)
+                   h->plt.refcount -= 1;
+               }
+#ifdef INCLUDE_SHMEDIA
+             else if (seen_stt_datalabel)
+               {
+                 if (eh->datalabel_got.refcount > 0)
+                   eh->datalabel_got.refcount -= 1;
+               }
+#endif
+             else if (h->got.refcount > 0)
+               h->got.refcount -= 1;
+           }
+         else if (local_got_refcounts != NULL)
+           {
 #ifdef INCLUDE_SHMEDIA
-      case R_SH_GOTPLT_LOW16:
-      case R_SH_GOTPLT_MEDLOW16:
-      case R_SH_GOTPLT_MEDHI16:
-      case R_SH_GOTPLT_HI16:
-      case R_SH_GOTPLT10BY4:
-      case R_SH_GOTPLT10BY8:
+             if (rel->r_addend & 1)
+               {
+                 if (local_got_refcounts[symtab_hdr->sh_info + r_symndx] > 0)
+                   local_got_refcounts[symtab_hdr->sh_info + r_symndx] -= 1;
+               }
+             else
 #endif
-       r_symndx = ELF32_R_SYM (rel->r_info);
-       if (r_symndx >= symtab_hdr->sh_info)
-         {
-           h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-           if (h->got.refcount > 0)
-             h->got.refcount -= 1;
-           if (h->plt.refcount > 0)
-             h->plt.refcount -= 1;
-         }
-       else if (local_got_refcounts != NULL)
-         {
-           if (local_got_refcounts[r_symndx] > 0)
-             local_got_refcounts[r_symndx] -= 1;
-         }
-       break;
+               if (local_got_refcounts[r_symndx] > 0)
+                 local_got_refcounts[r_symndx] -= 1;
+           }
+         break;
 
-      default:
-       break;
-      }
+       default:
+         break;
+       }
+    }
 
   return true;
 }
@@ -5329,6 +6087,9 @@ sh_elf_copy_indirect_symbol (bed, dir, ind)
      struct elf_link_hash_entry *dir, *ind;
 {
   struct elf_sh_link_hash_entry *edir, *eind;
+#ifdef INCLUDE_SHMEDIA
+  bfd_signed_vma tmp;
+#endif
 
   edir = (struct elf_sh_link_hash_entry *) dir;
   eind = (struct elf_sh_link_hash_entry *) ind;
@@ -5365,10 +6126,52 @@ sh_elf_copy_indirect_symbol (bed, dir, ind)
       edir->dyn_relocs = eind->dyn_relocs;
       eind->dyn_relocs = NULL;
     }
+  edir->gotplt_refcount = eind->gotplt_refcount;
+  eind->gotplt_refcount = 0;
+#ifdef INCLUDE_SHMEDIA
+  tmp = edir->datalabel_got.refcount;
+  if (tmp < 1)
+    {
+      edir->datalabel_got.refcount = eind->datalabel_got.refcount;
+      eind->datalabel_got.refcount = tmp;
+    }
+  else
+    BFD_ASSERT (eind->datalabel_got.refcount < 1);
+#endif
+
+  if (ind->root.type == bfd_link_hash_indirect
+      && dir->got.refcount <= 0)
+    {
+      edir->tls_type = eind->tls_type;
+      eind->tls_type = GOT_UNKNOWN;
+    }
 
   _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
 
+static int
+sh_elf_optimized_tls_reloc (info, r_type, is_local)
+     struct bfd_link_info *info;
+     int r_type;
+     int is_local;
+{
+  if (info->shared)
+    return r_type;
+
+  switch (r_type)
+    {
+    case R_SH_TLS_GD_32:
+    case R_SH_TLS_IE_32:
+      if (is_local)
+       return R_SH_TLS_LE_32;
+      return R_SH_TLS_IE_32;
+    case R_SH_TLS_LD_32:
+      return R_SH_TLS_LE_32;
+    }
+
+  return r_type;
+}
+
 /* Look through the relocs for a section during the first phase.
    Since we don't do .gots or .plts, we just need to consider the
    virtual table relocs for gc.  */
@@ -5390,6 +6193,8 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
   asection *sgot;
   asection *srelgot;
   asection *sreloc;
+  unsigned int r_type;
+  int tls_type, old_tls_type;
 
   sgot = NULL;
   srelgot = NULL;
@@ -5413,17 +6218,42 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
     {
       struct elf_link_hash_entry *h;
       unsigned long r_symndx;
+#ifdef INCLUDE_SHMEDIA
+      int seen_stt_datalabel = 0;
+#endif
 
       r_symndx = ELF32_R_SYM (rel->r_info);
+      r_type = ELF32_R_TYPE (rel->r_info);
+
       if (r_symndx < symtab_hdr->sh_info)
        h = NULL;
       else
-       h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+       {
+         h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+#ifdef INCLUDE_SHMEDIA
+         while (h->root.type == bfd_link_hash_indirect
+                || h->root.type == bfd_link_hash_warning)
+           {
+             seen_stt_datalabel |= h->type == STT_DATALABEL;
+             h = (struct elf_link_hash_entry *) h->root.u.i.link;
+           }
+#endif
+       }
+
+      r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
+      if (! info->shared
+         && r_type == R_SH_TLS_IE_32
+         && h != NULL
+         && h->root.type != bfd_link_hash_undefined
+         && h->root.type != bfd_link_hash_undefweak
+         && (h->dynindx == -1
+             || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+       r_type = R_SH_TLS_LE_32;
 
       /* Some relocs require a global offset table.  */
       if (htab->sgot == NULL)
        {
-         switch (ELF32_R_TYPE (rel->r_info))
+         switch (r_type)
            {
            case R_SH_GOTPLT32:
            case R_SH_GOT32:
@@ -5451,6 +6281,9 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
            case R_SH_GOTPC_MEDHI16:
            case R_SH_GOTPC_HI16:
 #endif
+           case R_SH_TLS_GD_32:
+           case R_SH_TLS_LD_32:
+           case R_SH_TLS_IE_32:
              if (dynobj == NULL)
                htab->root.dynobj = dynobj = abfd;
              if (! create_got_section (dynobj, info))
@@ -5462,7 +6295,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
            }
        }
 
-      switch (ELF32_R_TYPE (rel->r_info))
+      switch (r_type)
        {
          /* This relocation describes the C++ object vtable hierarchy.
             Reconstruct it for later use during GC.  */
@@ -5479,6 +6312,12 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
          break;
 
        force_got:
+       case R_SH_TLS_IE_32:
+         if (info->shared)
+           info->flags |= DF_STATIC_TLS;
+
+         /* FALLTHROUGH */
+       case R_SH_TLS_GD_32:
        case R_SH_GOT32:
 #ifdef INCLUDE_SHMEDIA
        case R_SH_GOT_LOW16:
@@ -5488,8 +6327,34 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
        case R_SH_GOT10BY4:
        case R_SH_GOT10BY8:
 #endif
+         switch (r_type)
+           {
+           default:
+             tls_type = GOT_NORMAL;
+             break;
+           case R_SH_TLS_GD_32:
+             tls_type = GOT_TLS_GD;
+             break;
+           case R_SH_TLS_IE_32:
+             tls_type = GOT_TLS_IE;
+             break;
+           }
+
          if (h != NULL)
-           h->got.refcount += 1;
+           {
+#ifdef INCLUDE_SHMEDIA
+             if (seen_stt_datalabel)
+               {
+                 struct elf_sh_link_hash_entry *eh = 
+                   (struct elf_sh_link_hash_entry *)h;
+
+                 eh->datalabel_got.refcount += 1;
+               }
+             else
+#endif
+               h->got.refcount += 1;
+             old_tls_type = sh_elf_hash_entry (h)->tls_type;
+           }
          else
            {
              bfd_signed_vma *local_got_refcounts;
@@ -5508,14 +6373,59 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
                     codelabel local GOT offsets.  */
                  size *= 2;
 #endif
+                 size += symtab_hdr->sh_info;
                  local_got_refcounts = ((bfd_signed_vma *)
                                         bfd_zalloc (abfd, size));
                  if (local_got_refcounts == NULL)
                    return false;
                  elf_local_got_refcounts (abfd) = local_got_refcounts;
+#ifdef         INCLUDE_SHMEDIA
+                 /* Take care of both the datalabel and codelabel local
+                    GOT offsets.  */
+                 sh_elf_local_got_tls_type (abfd)
+                   = (char *) (local_got_refcounts + 2 * symtab_hdr->sh_info);
+#else
+                 sh_elf_local_got_tls_type (abfd)
+                   = (char *) (local_got_refcounts + symtab_hdr->sh_info);
+#endif
+               }
+#ifdef INCLUDE_SHMEDIA
+             if (rel->r_addend & 1)
+               local_got_refcounts[symtab_hdr->sh_info + r_symndx] += 1;
+             else
+#endif
+               local_got_refcounts[r_symndx] += 1;
+             old_tls_type = sh_elf_local_got_tls_type (abfd) [r_symndx];
+           }
+
+         /* If a TLS symbol is accessed using IE at least once,
+            there is no point to use dynamic model for it.  */
+         if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN
+             && (old_tls_type != GOT_TLS_GD || tls_type != GOT_TLS_IE))
+           {
+             if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD)
+               tls_type = GOT_TLS_IE;
+             else
+               {
+                 (*_bfd_error_handler)
+                   (_("%s: `%s' accessed both as normal and thread local symbol"),
+                    bfd_archive_filename (abfd), h->root.root.string);
+                 return false;
                }
-             local_got_refcounts[r_symndx] += 1;
            }
+
+         if (old_tls_type != tls_type)
+           {
+             if (h != NULL)
+               sh_elf_hash_entry (h)->tls_type = tls_type;
+             else
+               sh_elf_local_got_tls_type (abfd) [r_symndx] = tls_type;
+           }
+
+         break;
+
+       case R_SH_TLS_LD_32:
+         sh_elf_hash_table(info)->tls_ldm_got.refcount += 1;
          break;
 
        case R_SH_GOTPLT32:
@@ -5539,6 +6449,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
 
          h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount += 1;
+         ((struct elf_sh_link_hash_entry *) h)->gotplt_refcount += 1;
 
          break;
 
@@ -5597,7 +6508,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
             symbol.  */
          if ((info->shared
               && (sec->flags & SEC_ALLOC) != 0
-              && (ELF32_R_TYPE (rel->r_info) != R_SH_REL32
+              && (r_type != R_SH_REL32
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
@@ -5687,11 +6598,110 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
                }
 
              p->count += 1;
-             if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
+             if (r_type == R_SH_REL32)
                p->pc_count += 1;
            }
 
          break;
+
+       case R_SH_TLS_LE_32:
+         if (info->shared)
+           {
+             (*_bfd_error_handler) (_("%s: TLS local exec code cannot be linked into shared objects"),
+                                    bfd_archive_filename (abfd));
+             return false;
+           }
+
+         if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_LD_32)
+           break;
+
+         /* FALLTHROUGH */
+       case R_SH_TLS_LDO_32:
+         /* We make a R_SH_TLS_TPOFF32 relocation. Count it as a
+            copy relocation.  */
+         if (! info->shared)
+           {
+             struct elf_sh_dyn_relocs *p;
+             struct elf_sh_dyn_relocs **head;
+
+             if (dynobj == NULL)
+               htab->root.dynobj = dynobj = abfd;
+
+             if (sreloc == NULL)
+               {
+                 const char *name;
+
+                 name = (bfd_elf_string_from_elf_section
+                         (abfd,
+                          elf_elfheader (abfd)->e_shstrndx,
+                          elf_section_data (sec)->rel_hdr.sh_name));
+                 if (name == NULL)
+                   return false;
+
+                 BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                             && strcmp (bfd_get_section_name (abfd, sec),
+                                        name + 5) == 0);
+
+                 sreloc = bfd_get_section_by_name (dynobj, name);
+                 if (sreloc == NULL)
+                   {
+                     flagword flags;
+
+                     sreloc = bfd_make_section (dynobj, name);
+                     flags = (SEC_HAS_CONTENTS | SEC_READONLY
+                              | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+                     if ((sec->flags & SEC_ALLOC) != 0)
+                       flags |= SEC_ALLOC | SEC_LOAD;
+                     if (sreloc == NULL
+                         || ! bfd_set_section_flags (dynobj, sreloc, flags)
+                         || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+                       return false;
+                   }
+                 elf_section_data (sec)->sreloc = sreloc;
+                 if (sec->flags & SEC_READONLY)
+                   info->flags |= DF_TEXTREL;
+               }
+
+             /* If this is a global symbol, we count the number of
+                relocations we need for this symbol.  */
+             if (h != NULL)
+               head = &((struct elf_sh_link_hash_entry *) h)->dyn_relocs;
+             else
+               {
+                 asection *s;
+
+                 /* Track dynamic relocs needed for local syms too.  */
+                 s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
+                                                sec, r_symndx);
+                 if (s == NULL)
+                   return false;
+
+                 head = ((struct elf_sh_dyn_relocs **)
+                         &elf_section_data (s)->local_dynrel);
+               }
+
+             p = *head;
+             if (p == NULL || p->sec != sec)
+               {
+                 bfd_size_type amt = sizeof (*p);
+                 p = ((struct elf_sh_dyn_relocs *) bfd_alloc (dynobj, amt));
+                 if (p == NULL)
+                   return false;
+                 p->next = *head;
+                 *head = p;
+                 p->sec = sec;
+                 p->count = 0;
+                 p->pc_count = 0;
+               }
+
+             p->count += 1;
+             if (h)
+               sh_elf_hash_entry (h)->tls_tpoff32 = true;
+           }
+         break;
+
+       default:
+         break;
        }
     }
 
@@ -5812,6 +6822,29 @@ sh_elf_merge_private_data (ibfd, obfd)
 }
 #endif /* not sh_elf_merge_private_data */
 
+/* Override the generic function because we need to store sh_elf_obj_tdata
+   as the specific tdata.  We set also the machine architecture from flags
+   here.  */
+
+static boolean
+sh_elf_object_p (abfd)
+  bfd *abfd;
+{
+  struct sh_elf_obj_tdata *new_tdata;
+  bfd_size_type amt = sizeof (struct sh_elf_obj_tdata);
+
+  if (sh_elf_set_mach_from_flags (abfd) == false)
+    return false;
+
+  /* Allocate our special target data.  */
+  new_tdata = bfd_zalloc (abfd, amt);
+  if (new_tdata == NULL)
+    return false;
+  new_tdata->root = *abfd->tdata.elf_obj_data;
+  abfd->tdata.any = new_tdata;
+  return true;
+}
+
 /* Finish up dynamic symbol handling.  We set the contents of various
    dynamic sections here.  */
 
@@ -5968,7 +7001,9 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
        }
     }
 
-  if (h->got.offset != (bfd_vma) -1)
+  if (h->got.offset != (bfd_vma) -1
+      && sh_elf_hash_entry (h)->tls_type != GOT_TLS_GD
+      && sh_elf_hash_entry (h)->tls_type != GOT_TLS_IE)
     {
       asection *sgot;
       asection *srel;
@@ -6014,6 +7049,60 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
       ++srel->reloc_count;
     }
 
+#ifdef INCLUDE_SHMEDIA
+  {
+    struct elf_sh_link_hash_entry *eh;
+
+    eh = (struct elf_sh_link_hash_entry *) h;
+    if (eh->datalabel_got.offset != (bfd_vma) -1)
+      {
+       asection *sgot;
+       asection *srel;
+       Elf_Internal_Rela rel;
+
+       /* This symbol has a datalabel entry in the global offset table.
+          Set it up.  */
+
+       sgot = htab->sgot;
+       srel = htab->srelgot;
+       BFD_ASSERT (sgot != NULL && srel != NULL);
+
+       rel.r_offset = (sgot->output_section->vma
+                       + sgot->output_offset
+                       + (eh->datalabel_got.offset &~ (bfd_vma) 1));
+
+       /* If this is a static link, or it is a -Bsymbolic link and the
+          symbol is defined locally or was forced to be local because
+          of a version file, we just want to emit a RELATIVE reloc.
+          The entry in the global offset table will already have been
+          initialized in the relocate_section function.  */
+       if (info->shared
+           && (info->symbolic
+               || h->dynindx == -1
+               || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+           && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+         {
+           rel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE);
+           rel.r_addend = (h->root.u.def.value
+                           + h->root.u.def.section->output_section->vma
+                           + h->root.u.def.section->output_offset);
+         }
+       else
+         {
+           bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents
+                       + eh->datalabel_got.offset);
+           rel.r_info = ELF32_R_INFO (h->dynindx, R_SH_GLOB_DAT);
+           rel.r_addend = 0;
+         }
+
+       bfd_elf32_swap_reloca_out (output_bfd, &rel,
+                                  ((Elf32_External_Rela *) srel->contents
+                                   + srel->reloc_count));
+       ++srel->reloc_count;
+      }
+  }
+#endif
+
   if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
     {
       asection *s;
@@ -6239,7 +7328,71 @@ sh_elf_reloc_type_class (rela)
     }
 }
 
-#ifndef ELF_ARCH
+/* Support for Linux core dump NOTE sections */
+static boolean
+elf32_shlin_grok_prstatus (abfd, note)
+     bfd *abfd;
+     Elf_Internal_Note *note;
+{
+  int offset;
+  unsigned int raw_size;
+
+  switch (note->descsz)
+    {
+      default:
+       return false;
+
+      case 168:                /* Linux/SH */
+       /* pr_cursig */
+       elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+
+       /* pr_pid */
+       elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
+
+       /* pr_reg */
+       offset = 72;
+       raw_size = 92;
+
+       break;
+    }
+
+  /* Make a ".reg/999" section.  */
+  return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+                                         raw_size, note->descpos + offset);
+}
+
+static boolean
+elf32_shlin_grok_psinfo (abfd, note)
+     bfd *abfd;
+     Elf_Internal_Note *note;
+{
+  switch (note->descsz)
+    {
+      default:
+       return false;
+
+      case 124:                /* Linux/SH elf_prpsinfo */
+       elf_tdata (abfd)->core_program
+        = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
+       elf_tdata (abfd)->core_command
+        = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
+    }
+
+  /* Note that for some reason, a spurious space is tacked
+     onto the end of the args in some (at least one anyway)
+     implementations, so strip it off if it exists.  */
+
+  {
+    char *command = elf_tdata (abfd)->core_command;
+    int n = strlen (command);
+
+    if (0 < n && command[n - 1] == ' ')
+      command[n - 1] = '\0';
+  }
+
+  return true;
+}
+
 #define TARGET_BIG_SYM         bfd_elf32_sh_vec
 #define TARGET_BIG_NAME                "elf32-sh"
 #define TARGET_LITTLE_SYM      bfd_elf32_shl_vec
@@ -6249,7 +7402,6 @@ sh_elf_reloc_type_class (rela)
 #define ELF_MAXPAGESIZE                128
 
 #define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
 
 #define bfd_elf32_bfd_reloc_type_lookup        sh_elf_reloc_type_lookup
 #define elf_info_to_howto              sh_elf_info_to_howto
@@ -6257,7 +7409,8 @@ sh_elf_reloc_type_class (rela)
 #define elf_backend_relocate_section   sh_elf_relocate_section
 #define bfd_elf32_bfd_get_relocated_section_contents \
                                        sh_elf_get_relocated_section_contents
-#define elf_backend_object_p           sh_elf_set_mach_from_flags
+#define bfd_elf32_mkobject             sh_elf_mkobject
+#define elf_backend_object_p           sh_elf_object_p
 #define bfd_elf32_bfd_set_private_bfd_flags \
                                        sh_elf_set_private_flags
 #define bfd_elf32_bfd_copy_private_bfd_data \
@@ -6292,7 +7445,74 @@ sh_elf_reloc_type_class (rela)
 #define elf_backend_got_header_size    12
 #define elf_backend_plt_header_size    PLT_ENTRY_SIZE
 
-#ifndef ELF32_SH_C_INCLUDED
+#ifndef INCLUDE_SHMEDIA
+
 #include "elf32-target.h"
-#endif
 
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef TARGET_LITTLE_SYM 
+#define        TARGET_LITTLE_SYM               bfd_elf32_shlqnx_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf32-shl-nto"
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                  bfd_elf32_shqnx_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                 "elf32-sh-nto"
+#undef ELF_MAXPAGESIZE
+#define        ELF_MAXPAGESIZE                 0x1000
+
+#define        elf32_bed                       elf32_sh_qnx_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_set_nonloadable_filepos
+#undef elf_backend_is_contained_by_filepos
+#undef elf_backend_copy_private_bfd_data_p
+#undef elf32_bed
+
+/* NetBSD support.  */
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                  bfd_elf32_shnbsd_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                 "elf32-sh-nbsd"
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM               bfd_elf32_shlnbsd_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf32-shl-nbsd"
+#undef ELF_MAXPAGESIZE
+#define        ELF_MAXPAGESIZE                 0x10000
+#undef elf_symbol_leading_char
+#define        elf_symbol_leading_char         0
+
+#define        elf32_bed                       elf32_sh_nbsd_bed
+
+#include "elf32-target.h"
+
+#undef elf32_bed
+
+/* Linux support.  */
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                  bfd_elf32_shblin_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                 "elf32-shbig-linux"
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM               bfd_elf32_shlin_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf32-sh-linux"
+
+#undef elf_backend_grok_prstatus
+#define        elf_backend_grok_prstatus       elf32_shlin_grok_prstatus
+#undef elf_backend_grok_psinfo
+#define        elf_backend_grok_psinfo         elf32_shlin_grok_psinfo
+
+#define        elf32_bed                       elf32_sh_lin_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_grok_prstatus
+#undef elf_backend_grok_psinfo
+#undef elf32_bed
+
+#endif /* INCLUDE_SHMEDIA */
diff --git a/bfd/elf32-sh64-nbsd.c b/bfd/elf32-sh64-nbsd.c
deleted file mode 100644 (file)
index 2d3e3d9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SuperH SH64 specific support for 32-bit NetBSD
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM         bfd_elf32_sh64nbsd_vec
-#define TARGET_BIG_NAME                "elf32-sh64-nbsd"
-#define TARGET_LITTLE_SYM      bfd_elf32_sh64lnbsd_vec
-#define TARGET_LITTLE_NAME     "elf32-sh64l-nbsd"
-#define ELF_ARCH               bfd_arch_sh
-#define ELF_MACHINE_CODE       EM_SH
-#define ELF_MAXPAGESIZE                0x10000
-#define elf_symbol_leading_char        0
-
-#include "elf32-sh64.c"
index 7a38fb22410a0c782e2229b5436e9da248c53813..c0df73d4d82efecc5d0ae0753fd473f89f891fb7 100644 (file)
@@ -89,18 +89,6 @@ static void sh64_find_section_for_address PARAMS ((bfd *, asection *, PTR));
    define it true here.  */
 #define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) true
 
-#ifndef ELF_ARCH
-#define TARGET_BIG_SYM         bfd_elf32_sh64_vec
-#define TARGET_BIG_NAME                "elf32-sh64"
-#define TARGET_LITTLE_SYM      bfd_elf32_sh64l_vec
-#define TARGET_LITTLE_NAME     "elf32-sh64l"
-#define ELF_ARCH               bfd_arch_sh
-#define ELF_MACHINE_CODE       EM_SH
-#define ELF_MAXPAGESIZE                128
-
-#define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
-
 #define GOT_BIAS (-((long)-32768))
 #define INCLUDE_SHMEDIA
 #include "elf32-sh.c"
@@ -411,16 +399,19 @@ sh64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
       if (h == NULL)
        {
          /* No previous datalabel symbol.  Make one.  */
+         struct bfd_link_hash_entry *bh = NULL;
+         struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
          if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
                                                  flags, *secp, *valp,
                                                  *namep, false,
-                                                 get_elf_backend_data (abfd)->collect,
-                                                 (struct bfd_link_hash_entry **) &h))
+                                                 bed->collect, &bh))
            {
              free (dl_name);
              return false;
            }
 
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
          h->type = STT_DATALABEL;
        }
@@ -742,3 +733,50 @@ sh64_elf_final_write_processing (abfd, linker)
        }
     }
 }
+
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM          bfd_elf32_sh64_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME         "elf32-sh64"
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM       bfd_elf32_sh64l_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME      "elf32-sh64l"
+
+#include "elf32-target.h"
+
+/* NetBSD support.  */
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM          bfd_elf32_sh64nbsd_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME         "elf32-sh64-nbsd"
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM       bfd_elf32_sh64lnbsd_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME      "elf32-sh64l-nbsd"
+#undef ELF_MAXPAGESIZE
+#define        ELF_MAXPAGESIZE         0x10000
+#undef elf_symbol_leading_char
+#define        elf_symbol_leading_char 0
+
+#define        elf32_bed               elf32_sh64_nbsd_bed
+
+#include "elf32-target.h"
+
+#undef elf32_bed
+
+/* Linux support.  */
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM          bfd_elf32_sh64blin_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME         "elf32-sh64big-linux"
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM       bfd_elf32_sh64lin_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME      "elf32-sh64-linux"
+
+#define        elf32_bed               elf32_sh64_lin_bed
+
+#include "elf32-target.h"
+
+#undef elf32_bed
diff --git a/bfd/elf32-shqnx.c b/bfd/elf32-shqnx.c
deleted file mode 100644 (file)
index a27c0f2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Hitachi SH QNX specific support for 32-bit ELF
-   Copyright 2002   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELF32_SH_C_INCLUDED
-#include "elf32-sh.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM 
-#define TARGET_LITTLE_SYM       bfd_elf32_shlqnx_vec
-#undef  TARGET_BIG_SYM
-#define TARGET_BIG_SYM          bfd_elf32_shqnx_vec
-
-#include "elf32-target.h"
-
index 57ed958b32fa42dfa7391e47a1fa021eb73f9752..bf92ccf98f355e475228e4d3d31a88f429ccc5f7 100644 (file)
@@ -2388,7 +2388,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
          if (isym.st_value + isym.st_size >= toaddr)
            isym.st_size += count;          
          
-         bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+         bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
        }
       else if (isym.st_shndx == sec_shndx
               && isym.st_value < addr + count)
@@ -2401,7 +2401,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
              && isym.st_value <  addr + count)
            isym.st_value = addr;
 
-         bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+         bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
        }
     }
 
@@ -2426,7 +2426,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
          if ((sym_hash)->root.u.def.value + isym.st_size >= toaddr)
            {
              isym.st_size += count;
-             bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+             bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
            }
 
          (sym_hash)->root.u.def.value -= count;
@@ -2445,7 +2445,7 @@ v850_elf_relax_delete_bytes (abfd, sec, addr, toaddr, count)
              && (sym_hash)->root.u.def.value < addr + count)
            (sym_hash)->root.u.def.value = addr;
 
-         bfd_elf32_swap_symbol_out (abfd, & isym, shndx, esym);
+         bfd_elf32_swap_symbol_out (abfd, & isym, esym, shndx);
        }
 
       if (shndx)
diff --git a/bfd/elf64-alpha-fbsd.c b/bfd/elf64-alpha-fbsd.c
deleted file mode 100644 (file)
index 061b0b8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Alpha specific support for 64-bit ELF on FreeBSD.
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_LITTLE_SYM      bfd_elf64_alpha_freebsd_vec
-#define TARGET_LITTLE_NAME     "elf64-alpha-freebsd"
-#define ELF_ARCH               bfd_arch_alpha
-#define ELF_MACHINE_CODE       EM_ALPHA
-#define ELF_MAXPAGESIZE                0x10000
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "elf-bfd.h"
-
-/* The kernel recognizes executables as valid only if they carry a
-   "FreeBSD" label in the ELF header.  So we put this label on all
-   executables and (for simplicity) also all other object files.  */
-
-static void elf_alpha_post_process_headers
-  PARAMS ((bfd *, struct bfd_link_info *));
-
-static void
-elf_alpha_post_process_headers (abfd, link_info)
-     bfd * abfd;
-     struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
-{
-  Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form.  */
-
-  i_ehdrp = elf_elfheader (abfd);
-
-  /* Put an ABI label supported by FreeBSD >= 4.1.  */
-  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
-#ifdef OLD_FREEBSD_ABI_LABEL
-  /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
-  memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
-#endif
-}
-
-#define elf_backend_post_process_headers       elf_alpha_post_process_headers
-
-#include "elf64-alpha.c"
index e1d095d523125c54d7ebf43ac15013570297911e..ab053f96bfa3de1d34776860fac7ffce9bf10f14 100644 (file)
@@ -2480,6 +2480,7 @@ elf64_alpha_create_dynamic_sections (abfd, info)
 {
   asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
 
   /* We need to create .plt, .rela.plt, .got, and .rela.got sections.  */
 
@@ -2495,13 +2496,13 @@ elf64_alpha_create_dynamic_sections (abfd, info)
 
   /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
      .plt section.  */
-  h = NULL;
+  bh = NULL;
   if (! (_bfd_generic_link_add_one_symbol
         (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
          (bfd_vma) 0, (const char *) NULL, false,
-         get_elf_backend_data (abfd)->collect,
-         (struct bfd_link_hash_entry **) &h)))
+         get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
@@ -2539,13 +2540,13 @@ elf64_alpha_create_dynamic_sections (abfd, info)
      dynobj's .got 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 = NULL;
+  bh = NULL;
   if (!(_bfd_generic_link_add_one_symbol
        (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL,
         alpha_elf_tdata(abfd)->got, (bfd_vma) 0, (const char *) NULL,
-        false, get_elf_backend_data (abfd)->collect,
-        (struct bfd_link_hash_entry **) &h)))
+        false, get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
@@ -3099,7 +3100,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
 
        case R_ALPHA_REFLONG:
        case R_ALPHA_REFQUAD:
-         if (info->shared || maybe_dynamic)
+         if ((info->shared && (sec->flags & SEC_ALLOC)) || maybe_dynamic)
            need = NEED_DYNREL;
          break;
 
@@ -4576,7 +4577,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
              case STO_ALPHA_NOPV:
                break;
              case STO_ALPHA_STD_GPLOAD:
-               addend += 8;
+               value += 8;
                break;
              default:
                if (h != NULL)
@@ -5509,13 +5510,11 @@ static const struct elf_size_info alpha_elf_size_info =
   NULL
 };
 
-#ifndef ELF_ARCH
 #define TARGET_LITTLE_SYM      bfd_elf64_alpha_vec
 #define TARGET_LITTLE_NAME     "elf64-alpha"
 #define ELF_ARCH               bfd_arch_alpha
 #define ELF_MACHINE_CODE       EM_ALPHA
 #define ELF_MAXPAGESIZE        0x10000
-#endif /* ELF_ARCH */
 
 #define bfd_elf64_bfd_link_hash_table_create \
   elf64_alpha_bfd_link_hash_table_create
@@ -5581,3 +5580,42 @@ static const struct elf_size_info alpha_elf_size_info =
 #define elf_backend_plt_header_size PLT_HEADER_SIZE
 
 #include "elf64-target.h"
+\f
+/* FreeBSD support.  */
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM      bfd_elf64_alpha_freebsd_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME     "elf64-alpha-freebsd"
+
+/* The kernel recognizes executables as valid only if they carry a
+   "FreeBSD" label in the ELF header.  So we put this label on all
+   executables and (for simplicity) also all other object files.  */
+
+static void elf64_alpha_fbsd_post_process_headers
+  PARAMS ((bfd *, struct bfd_link_info *));
+
+static void
+elf64_alpha_fbsd_post_process_headers (abfd, link_info)
+     bfd * abfd;
+     struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
+{
+  Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form.  */
+
+  i_ehdrp = elf_elfheader (abfd);
+
+  /* Put an ABI label supported by FreeBSD >= 4.1.  */
+  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+#ifdef OLD_FREEBSD_ABI_LABEL
+  /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
+  memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
+#endif
+}
+
+#undef elf_backend_post_process_headers
+#define elf_backend_post_process_headers \
+  elf64_alpha_fbsd_post_process_headers
+
+#define elf64_bed elf64_alpha_fbsd_bed
+
+#include "elf64-target.h"
index aef822a02f2d2dc286191e5f15d023bd9b6f77c9..3c8e00f2b4aee30415614dfad78fda632779c5b2 100644 (file)
@@ -1855,6 +1855,11 @@ elf64_hppa_size_dynamic_sections (output_bfd, info)
            return false;
        }
 
+      /* Force DT_FLAGS to always be set.
+        Required by HPUX 11.00 patch PHSS_26559.  */
+      if (!add_dynamic_entry (DT_FLAGS, (info)->flags))
+       return false;
+
       if (plt)
        {
          if (!add_dynamic_entry (DT_PLTRELSZ, 0)
index 91610aae7e8782580395211a48fb491f932ec7f8..da7c53f6e3a33eef83dd60a64921fcca3457664e 100644 (file)
@@ -3166,6 +3166,7 @@ func_desc_adjust (h, inf)
        {
          bfd *abfd;
          asymbol *newsym;
+         struct bfd_link_hash_entry *bh;
 
          abfd = h->root.u.undef.abfd;
          newsym = bfd_make_empty_symbol (abfd);
@@ -3176,13 +3177,14 @@ func_desc_adjust (h, inf)
          if (h->root.type == bfd_link_hash_undefweak)
            newsym->flags |= BSF_WEAK;
 
+         bh = &fdh->root;
          if ( !(_bfd_generic_link_add_one_symbol
                 (info, abfd, newsym->name, newsym->flags,
-                 newsym->section, newsym->value, NULL, false, false,
-                 (struct bfd_link_hash_entry **) &fdh)))
+                 newsym->section, newsym->value, NULL, false, false, &bh)))
            {
              return false;
            }
+         fdh = (struct elf_link_hash_entry *) bh;
          fdh->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
        }
 
@@ -3675,12 +3677,16 @@ edit_opd (obfd, info)
              break;
            }
 
-         if (sym_sec->output_section == bfd_abs_section_ptr)
-           {
-             /* OK, we've found a function that's excluded from the
-                link.  */
-             need_edit = true;
-           }
+         /* opd entries are always for functions defined in the
+            current input bfd.  If the symbol isn't defined in the
+            input bfd, then we won't be using the function in this
+            bfd;  It must be defined in a linkonce section in another
+            bfd, or is weak.  It's also possible that we are
+            discarding the function due to a linker script /DISCARD/,
+            which we test for via the output_section.  */
+         if (sym_sec->owner != ibfd
+             || sym_sec->output_section == bfd_abs_section_ptr)
+           need_edit = true;
 
          offset += 24;
        }
@@ -3754,10 +3760,11 @@ edit_opd (obfd, info)
                                                              sym->st_shndx);
                    }
 
-                 skip = sym_sec->output_section == bfd_abs_section_ptr;
+                 skip = (sym_sec->owner != ibfd
+                         || sym_sec->output_section == bfd_abs_section_ptr);
                  if (skip)
                    {
-                     if (h != NULL)
+                     if (h != NULL && sym_sec->owner == ibfd)
                        {
                          /* Arrange for the function descriptor sym
                             to be dropped.  */
@@ -3797,8 +3804,7 @@ edit_opd (obfd, info)
                             for the function descriptor sym which we
                             don't have at the moment.  So keep an
                             array of adjustments.  */ 
-                         adjust[(rel->r_offset + wptr - rptr) / 24]
-                           = wptr - rptr;
+                         adjust[rel->r_offset / 24] = wptr - rptr;
                        }
 
                      if (wptr != rptr)
@@ -5161,6 +5167,7 @@ ppc64_elf_build_stubs (info)
            }
          bfd_put_32 (htab->sglink->owner,
                      B_DOT | ((htab->sglink->contents - p) & 0x3fffffc), p);
+         indx++;
          p += 4;
        }
       htab->sglink->_cooked_size = p - htab->sglink->contents;
diff --git a/bfd/elf64-sh64-nbsd.c b/bfd/elf64-sh64-nbsd.c
deleted file mode 100644 (file)
index 43e4eaf..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SuperH SH64 specific support for 64-bit NetBSD
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of BFD, the Binary File Descriptor library.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define TARGET_BIG_SYM         bfd_elf64_sh64nbsd_vec
-#define TARGET_BIG_NAME                "elf64-sh64-nbsd"
-#define TARGET_LITTLE_SYM      bfd_elf64_sh64lnbsd_vec
-#define TARGET_LITTLE_NAME     "elf64-sh64l-nbsd"
-#define ELF_ARCH               bfd_arch_sh
-#define ELF_MACHINE_CODE       EM_SH
-#define ELF_MAXPAGESIZE                0x10000
-#define elf_symbol_leading_char        0
-
-#include "elf64-sh64.c"
index 4fb695f1011831f6fca00c7f23eaada3d6b81ac8..da02505d5c538081a09b92a3a8dc70eb70716b9a 100644 (file)
@@ -1588,6 +1588,35 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
 
              continue;
            }
+         else if (! howto->partial_inplace)
+           {
+             relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+             relocation |= ((sym->st_other & STO_SH5_ISA32) != 0);
+           }
+         else if ((sec->flags & SEC_MERGE)
+                  && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+           {
+             asection *msec;
+
+             if (howto->rightshift || howto->src_mask != 0xffffffff)
+               {
+                 (*_bfd_error_handler)
+                   (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"),
+                    bfd_archive_filename (input_bfd),
+                    bfd_get_section_name (input_bfd, input_section),
+                    (long) rel->r_offset, howto->name);
+                 return false;
+               }
+
+              addend = bfd_get_32 (input_bfd, contents + rel->r_offset);
+              msec = sec;
+              addend =
+               _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend)
+               - relocation;
+             addend += msec->output_section->vma + msec->output_offset;
+             bfd_put_32 (input_bfd, addend, contents + rel->r_offset);
+             addend = 0;
+           }
        }
       else
        {
@@ -2915,16 +2944,19 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
       if (h == NULL)
        {
          /* No previous datalabel symbol.  Make one.  */
+         struct bfd_link_hash_entry *bh = NULL;
+         struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
          if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
                                                  flags, *secp, *valp,
                                                  *namep, false,
-                                                 get_elf_backend_data (abfd)->collect,
-                                                 (struct bfd_link_hash_entry **) &h))
+                                                 bed->collect, &bh))
            {
              free (dl_name);
              return false;
            }
 
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
          h->type = STT_DATALABEL;
        }
@@ -3108,7 +3140,7 @@ static const bfd_byte elf_sh64_pic_plt_entry_be[PLT_ENTRY_SIZE] =
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0xce, 0x00, 0x01, 0x10, /* movi  -GOT_BIAS, r17 */
-  0x00, 0xcb, 0x45, 0x10, /* sub   r12, r17, r17 */
+  0x00, 0xc9, 0x45, 0x10, /* add   r12, r17, r17 */
   0x8d, 0x10, 0x09, 0x90, /* ld.q  r17, 16, r25 */
   0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */
   0x8d, 0x10, 0x05, 0x10, /* ld.q  r17, 8, r17 */
@@ -3128,7 +3160,7 @@ static const bfd_byte elf_sh64_pic_plt_entry_le[PLT_ENTRY_SIZE] =
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0x10, 0x01, 0x00, 0xce, /* movi  -GOT_BIAS, r17 */
-  0x10, 0x45, 0xcb, 0x00, /* sub   r12, r17, r17 */
+  0x10, 0x45, 0xc9, 0x00, /* add   r12, r17, r17 */
   0x90, 0x09, 0x10, 0x8d, /* ld.q  r17, 16, r25 */
   0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */
   0x10, 0x05, 0x10, 0x8d, /* ld.q  r17, 8, r17 */
@@ -3287,13 +3319,15 @@ sh64_elf64_create_dynamic_sections (abfd, info)
     {
       /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
         .plt section.  */
-      struct elf_link_hash_entry *h = NULL;
+      struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh = NULL;
+
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
-             (bfd_vma) 0, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             (bfd_vma) 0, (const char *) NULL, false, bed->collect, &bh)))
        return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
@@ -4124,8 +4158,6 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info)
   return true;
 }
 
-
-#ifndef ELF_ARCH
 #define TARGET_BIG_SYM         bfd_elf64_sh64_vec
 #define TARGET_BIG_NAME                "elf64-sh64"
 #define TARGET_LITTLE_SYM      bfd_elf64_sh64l_vec
@@ -4135,7 +4167,6 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info)
 #define ELF_MAXPAGESIZE                128
 
 #define elf_symbol_leading_char '_'
-#endif /* ELF_ARCH */
 
 #define bfd_elf64_bfd_reloc_type_lookup        sh_elf64_reloc_type_lookup
 #define elf_info_to_howto              sh_elf64_info_to_howto
@@ -4190,3 +4221,34 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info)
 #define elf_backend_plt_header_size    PLT_ENTRY_SIZE
 
 #include "elf64-target.h"
+
+/* NetBSD support.  */
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                  bfd_elf64_sh64nbsd_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                 "elf64-sh64-nbsd"
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM               bfd_elf64_sh64lnbsd_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf64-sh64l-nbsd"
+#undef ELF_MAXPAGESIZE
+#define        ELF_MAXPAGESIZE                 0x10000
+#undef elf_symbol_leading_char
+#define        elf_symbol_leading_char         0
+
+#define        elf64_bed                       elf64_sh64_nbsd_bed
+
+#include "elf64-target.h"
+
+/* Linux support.  */
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                  bfd_elf64_sh64blin_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                 "elf64-sh64big-linux"
+#undef TARGET_LITTLE_SYM
+#define        TARGET_LITTLE_SYM               bfd_elf64_sh64lin_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf64-sh64-linux"
+
+#define        INCLUDED_TARGET_FILE
+#include "elf64-target.h"
index fa2f2ee5ec1ebf17d4ddf8b801b0a36f033e88c4..cbb961f370a0c5cc801eab493381d07ba0532581 100644 (file)
@@ -2224,31 +2224,32 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
              if (ELF64_R_TYPE (rel->r_info) == R_X86_64_TLSGD)
                {
                  unsigned int i;
-                 static unsigned char tlsgd[7]
-                   = { 0x66, 0x66, 0x66, 0x66, 0x48, 0x8d, 0x3d };
+                 static unsigned char tlsgd[8]
+                   = { 0x66, 0x48, 0x8d, 0x3d, 0x66, 0x66, 0x48, 0xe8 };
 
                  /* GD->LE transition.
-                    .long 0x66666666; leaq foo@tlsgd(%rip), %rdi
-                    callq __tls_get_addr@plt
+                    .byte 0x66; leaq foo@tlsgd(%rip), %rdi
+                    .word 0x6666; rex64; call __tls_get_addr@plt
                     Change it into:
                     movq %fs:0, %rax
                     leaq foo@tpoff(%rax), %rax */
-                 BFD_ASSERT (rel->r_offset >= 7);
-                 for (i = 0; i < 7; i++)
+                 BFD_ASSERT (rel->r_offset >= 4);
+                 for (i = 0; i < 4; i++)
                    BFD_ASSERT (bfd_get_8 (input_bfd,
-                                          contents + rel->r_offset - 7 + i)
+                                          contents + rel->r_offset - 4 + i)
                                == tlsgd[i]);
-                 BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
-                 BFD_ASSERT (bfd_get_8 (input_bfd,
-                                        contents + rel->r_offset + 4)
-                             == 0xe8);
+                 BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size);
+                 for (i = 0; i < 4; i++)
+                   BFD_ASSERT (bfd_get_8 (input_bfd,
+                                          contents + rel->r_offset + 4 + i)
+                               == tlsgd[i+4]);
                  BFD_ASSERT (rel + 1 < relend);
                  BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32);
-                 memcpy (contents + rel->r_offset - 7,
+                 memcpy (contents + rel->r_offset - 4,
                          "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x8d\x80\0\0\0",
                          16);
                  bfd_put_32 (output_bfd, tpoff (info, relocation),
-                             contents + rel->r_offset + 5);
+                             contents + rel->r_offset + 8);
                  /* Skip R_X86_64_PLT32.  */
                  rel++;
                  continue;
@@ -2397,27 +2398,28 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
          else
            {
              unsigned int i;
-             static unsigned char tlsgd[7]
-               = { 0x66, 0x66, 0x66, 0x66, 0x48, 0x8d, 0x3d };
+             static unsigned char tlsgd[8]
+               = { 0x66, 0x48, 0x8d, 0x3d, 0x66, 0x66, 0x48, 0xe8 };
 
              /* GD->IE transition.
-                .long 0x66666666; leaq foo@tlsgd(%rip), %rdi
-                callq __tls_get_addr@plt
+                .byte 0x66; leaq foo@tlsgd(%rip), %rdi
+                .word 0x6666; rex64; call __tls_get_addr@plt
                 Change it into:
                 movq %fs:0, %rax
                 addq foo@gottpoff(%rip), %rax */
-             BFD_ASSERT (rel->r_offset >= 7);
-             for (i = 0; i < 7; i++)
+             BFD_ASSERT (rel->r_offset >= 4);
+             for (i = 0; i < 4; i++)
                BFD_ASSERT (bfd_get_8 (input_bfd,
-                                      contents + rel->r_offset - 7 + i)
+                                      contents + rel->r_offset - 4 + i)
                            == tlsgd[i]);
-             BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
-             BFD_ASSERT (bfd_get_8 (input_bfd,
-                                    contents + rel->r_offset + 4)
-                         == 0xe8);
+             BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size);
+             for (i = 0; i < 4; i++)
+               BFD_ASSERT (bfd_get_8 (input_bfd,
+                                      contents + rel->r_offset + 4 + i)
+                           == tlsgd[i+4]);
              BFD_ASSERT (rel + 1 < relend);
              BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32);
-             memcpy (contents + rel->r_offset - 7,
+             memcpy (contents + rel->r_offset - 4,
                      "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x03\x05\0\0\0",
                      16);
 
@@ -2426,9 +2428,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
                            - rel->r_offset
                            - input_section->output_section->vma
                            - input_section->output_offset
-                           - 9);
+                           - 12);
              bfd_put_32 (output_bfd, relocation,
-                         contents + rel->r_offset + 5);
+                         contents + rel->r_offset + 8);
              /* Skip R_X86_64_PLT32.  */
              rel++;
              continue;
@@ -2496,7 +2498,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
 
        case R_X86_64_DTPOFF32:
-         if (info->shared)
+         if (info->shared || (input_section->flags & SEC_CODE) == 0)
            relocation -= dtpoff_base (info);
          else
            relocation = tpoff (info, relocation);
index 1c07dc8ca603ce78a9d291435e9f5da092f8e1ae..bd34a14d2582e64323a4ceca80570e77d96e0188 100644 (file)
@@ -1,5 +1,5 @@
 /* 32-bit ELF support for ARM new abi option.
-   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -27,7 +27,7 @@
 #define NUM_ELEM(a)  (sizeof (a) / (sizeof (a)[0]))
 #endif
 
-#define USE_REL
+#define USE_REL        1
 
 #define TARGET_LITTLE_SYM               bfd_elf32_littlearm_vec
 #define TARGET_LITTLE_NAME              "elf32-littlearm"
@@ -749,6 +749,27 @@ elf32_arm_nabi_grok_psinfo (abfd, note)
 #define elf_backend_grok_prstatus      elf32_arm_nabi_grok_prstatus
 #define elf_backend_grok_psinfo                elf32_arm_nabi_grok_psinfo
 
-#ifndef ELFARM_NABI_C_INCLUDED
 #include "elf32-arm.h"
-#endif
+
+/* QNX support.  */
+#include "elf32-qnx.h"
+
+#undef TARGET_LITTLE_SYM 
+#define        TARGET_LITTLE_SYM               bfd_elf32_littlearmqnx_vec
+#undef TARGET_LITTLE_NAME
+#define        TARGET_LITTLE_NAME              "elf32-littlearm-nto"
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                  bfd_elf32_bigarmqnx_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                 "elf32-bigarm-nto"
+#undef ELF_MAXPAGESIZE
+#define        ELF_MAXPAGESIZE                 0x1000
+
+#define        elf32_bed                       elf32_arm_qnx_bed
+
+#include "elf32-target.h"
+
+#undef elf_backend_set_nonloadable_filepos
+#undef elf_backend_is_contained_by_filepos
+#undef elf_backend_copy_private_bfd_data_p
+#undef elf32_bed
diff --git a/bfd/elfarmqnx-nabi.c b/bfd/elfarmqnx-nabi.c
deleted file mode 100644 (file)
index 7647b3d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ARM new abi QNX specific support for 32-bit ELF
-   Copyright 2002   Free Software Foundation, Inc.
-
-   This file is part of BFD, the Binary File Descriptor library.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#define ELFARM_NABI_C_INCLUDED
-#include "elfarm-nabi.c"
-
-#include "elf32-qnx.h"
-
-#undef  TARGET_LITTLE_SYM 
-#define TARGET_LITTLE_SYM       bfd_elf32_littlearmqnx_vec
-#undef  TARGET_BIG_SYM
-#define TARGET_BIG_SYM          bfd_elf32_bigarmqnx_vec
-
-/* QNX Neutrino for ARM has a max pagesize of 0x1000.  */
-#undef  ELF_MAXPAGESIZE
-#define ELF_MAXPAGESIZE        0x1000
-
-#include "elf32-arm.h"
index f8cc645ad76f528e806ffb3ae4c46b635d0fd297..d6da588a1537965b0c4b41f062d6178148ac20e8 100644 (file)
@@ -33,6 +33,7 @@ _bfd_elf_create_got_section (abfd, info)
   flagword flags;
   register asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   struct elf_backend_data *bed = get_elf_backend_data (abfd);
   int ptralign;
 
@@ -79,12 +80,13 @@ _bfd_elf_create_got_section (abfd, info)
         (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 = NULL;
+      bh = NULL;
       if (!(_bfd_generic_link_add_one_symbol
            (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
             bed->got_symbol_offset, (const char *) NULL, false,
-            bed->collect, (struct bfd_link_hash_entry **) &h)))
+            bed->collect, &bh)))
        return false;
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
@@ -151,13 +153,15 @@ _bfd_elf_create_dynamic_sections (abfd, info)
     {
       /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
         .plt section.  */
-      struct elf_link_hash_entry *h = NULL;
+      struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh = NULL;
+
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
              (bfd_vma) 0, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             get_elf_backend_data (abfd)->collect, &bh)))
        return false;
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
@@ -546,29 +550,27 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
 
       if (lsect->sym_name)
        {
-         struct elf_link_hash_entry *h = NULL;
+         struct elf_link_hash_entry *h;
+         struct bfd_link_hash_entry *bh;
+
 #ifdef DEBUG
          fprintf (stderr, "Adding %s to section %s\n",
                   lsect->sym_name,
                   lsect->name);
 #endif
-         h = (struct elf_link_hash_entry *)
-           bfd_link_hash_lookup (info->hash, lsect->sym_name, false, false, false);
-
-         if ((h == NULL || h->root.type == bfd_link_hash_undefined)
-             && !(_bfd_generic_link_add_one_symbol (info,
-                                                    abfd,
-                                                    lsect->sym_name,
-                                                    BSF_GLOBAL,
-                                                    s,
-                                                    ((lsect->hole_size)
-                                                     ? s->_raw_size - lsect->hole_size + lsect->sym_offset
-                                                     : lsect->sym_offset),
-                                                    (const char *) NULL,
-                                                    false,
-                                                    get_elf_backend_data (abfd)->collect,
-                                                    (struct bfd_link_hash_entry **) &h)))
-           return (elf_linker_section_t *)0;
+         bh = bfd_link_hash_lookup (info->hash, lsect->sym_name,
+                                    false, false, false);
+
+         if ((bh == NULL || bh->type == bfd_link_hash_undefined)
+             && !(_bfd_generic_link_add_one_symbol
+                  (info, abfd, lsect->sym_name, BSF_GLOBAL, s,
+                   (lsect->hole_size
+                    ? s->_raw_size - lsect->hole_size + lsect->sym_offset
+                    : lsect->sym_offset),
+                   (const char *) NULL, false,
+                   get_elf_backend_data (abfd)->collect, &bh)))
+           return (elf_linker_section_t *) 0;
+         h = (struct elf_link_hash_entry *) bh;
 
          if ((defaults->which != LINKER_SECTION_SDATA)
              && (defaults->which != LINKER_SECTION_SDATA2))
@@ -579,7 +581,7 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
 
          if (info->shared
              && ! _bfd_elf_link_record_dynamic_symbol (info, h))
-           return (elf_linker_section_t *)0;
+           return (elf_linker_section_t *) 0;
        }
     }
 
index 85160e90257c6f1261081d46044842d1d44f65e4..03be87acddbb179f0b6bd233d365ddadb1dcdf1c 100644 (file)
@@ -921,6 +921,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
   boolean size_change_ok;
   char *shortname;
   struct elf_link_hash_entry *hi;
+  struct bfd_link_hash_entry *bh;
   struct elf_backend_data *bed;
   boolean collect;
   boolean dynamic;
@@ -979,11 +980,12 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
 
   if (! override)
     {
+      bh = &hi->root;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr,
-             (bfd_vma) 0, name, false, collect,
-             (struct bfd_link_hash_entry **) &hi)))
+             (bfd_vma) 0, name, false, collect, &bh)))
        return false;
+      hi = (struct elf_link_hash_entry *) bh;
     }
   else
     {
@@ -1098,11 +1100,12 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
     }
   else
     {
+      bh = &hi->root;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, shortname, BSF_INDIRECT,
-             bfd_ind_section_ptr, (bfd_vma) 0, name, false,
-             collect, (struct bfd_link_hash_entry **) &hi)))
+             bfd_ind_section_ptr, (bfd_vma) 0, name, false, collect, &bh)))
        return false;
+      hi = (struct elf_link_hash_entry *) bh;
 
       /* If there is a duplicate definition somewhere, then HI may not
         point to an indirect symbol.  We will have reported an error
@@ -1295,6 +1298,14 @@ elf_link_add_object_symbols (abfd, info)
       const char *name;
       bfd_size_type oldsize;
       bfd_size_type strindex;
+      struct bfd_link_needed_list *rpath = NULL, *runpath = NULL;
+
+      /* ld --just-symbols and dynamic objects don't mix very well.
+        Test for --just-symbols by looking at info set up by
+        _bfd_elf_link_just_syms.  */
+      if ((s = abfd->sections) != NULL
+         && elf_section_data (s)->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
+       goto error_return;
 
       /* Find the name to use in a DT_NEEDED entry that refers to this
         object.  If the object has a DT_SONAME entry, we use it.
@@ -1324,8 +1335,6 @@ elf_link_add_object_symbols (abfd, info)
          Elf_External_Dyn *extdynend;
          int elfsec;
          unsigned long shlink;
-         int rpath;
-         int runpath;
 
          dynbuf = (Elf_External_Dyn *) bfd_malloc (s->_raw_size);
          if (dynbuf == NULL)
@@ -1342,8 +1351,6 @@ elf_link_add_object_symbols (abfd, info)
 
          extdyn = dynbuf;
          extdynend = extdyn + s->_raw_size / sizeof (Elf_External_Dyn);
-         rpath = 0;
-         runpath = 0;
          for (; extdyn < extdynend; extdyn++)
            {
              Elf_Internal_Dyn dyn;
@@ -1387,13 +1394,6 @@ elf_link_add_object_symbols (abfd, info)
                  char *fnm, *anm;
                  unsigned int tagv = dyn.d_un.d_val;
 
-                 /* When we see DT_RPATH before DT_RUNPATH, we have
-                    to clear runpath.  Do _NOT_ bfd_release, as that
-                    frees all more recently bfd_alloc'd blocks as
-                    well.  */
-                 if (rpath && hash_table->runpath)
-                   hash_table->runpath = NULL;
-
                  amt = sizeof (struct bfd_link_needed_list);
                  n = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt);
                  fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
@@ -1407,13 +1407,11 @@ elf_link_add_object_symbols (abfd, info)
                  n->name = anm;
                  n->by = abfd;
                  n->next = NULL;
-                 for (pn = & hash_table->runpath;
+                 for (pn = & runpath;
                       *pn != NULL;
                       pn = &(*pn)->next)
                    ;
                  *pn = n;
-                 runpath = 1;
-                 rpath = 0;
                }
              /* Ignore DT_RPATH if we have seen DT_RUNPATH.  */
              if (!runpath && dyn.d_tag == DT_RPATH)
@@ -1439,18 +1437,32 @@ elf_link_add_object_symbols (abfd, info)
                  n->name = anm;
                  n->by = abfd;
                  n->next = NULL;
-                 for (pn = & hash_table->runpath;
+                 for (pn = & rpath;
                       *pn != NULL;
                       pn = &(*pn)->next)
                    ;
                  *pn = n;
-                 rpath = 1;
                }
            }
 
          free (dynbuf);
        }
 
+      /* DT_RUNPATH overrides DT_RPATH.  Do _NOT_ bfd_release, as that
+        frees all more recently bfd_alloc'd blocks as well.  */
+      if (runpath)
+       rpath = runpath;
+
+      if (rpath)
+       {
+         struct bfd_link_needed_list **pn;
+         for (pn = & hash_table->runpath;
+              *pn != NULL;
+              pn = &(*pn)->next)
+           ;
+         *pn = rpath;
+       }
+
       /* We do not want to include any of the sections in a dynamic
         object in the output file.  We hack by simply clobbering the
         list of sections in the BFD.  This could be handled more
@@ -2292,6 +2304,7 @@ elf_link_create_dynamic_sections (abfd, info)
   flagword flags;
   register asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   struct elf_backend_data *bed;
 
   if (! is_elf_hash_table (info))
@@ -2384,12 +2397,12 @@ elf_link_create_dynamic_sections (abfd, info)
      creating a .dynamic section.  We don't want to define it if there
      is no .dynamic section, since on some ELF platforms the start up
      code examines it to decide how to initialize the process.  */
-  h = NULL;
+  bh = NULL;
   if (! (_bfd_generic_link_add_one_symbol
         (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0,
-         (const char *) NULL, false, get_elf_backend_data (abfd)->collect,
-         (struct bfd_link_hash_entry **) &h)))
+         (const char *) 0, false, get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
@@ -3326,19 +3339,20 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
              unsigned int cdeps;
              struct bfd_elf_version_deps *n;
              struct elf_link_hash_entry *h;
+             struct bfd_link_hash_entry *bh;
 
              cdeps = 0;
              for (n = t->deps; n != NULL; n = n->next)
                ++cdeps;
 
              /* Add a symbol representing this version.  */
-             h = NULL;
+             bh = NULL;
              if (! (_bfd_generic_link_add_one_symbol
                     (info, dynobj, t->name, BSF_GLOBAL, bfd_abs_section_ptr,
                      (bfd_vma) 0, (const char *) NULL, false,
-                     get_elf_backend_data (dynobj)->collect,
-                     (struct bfd_link_hash_entry **) &h)))
+                     get_elf_backend_data (dynobj)->collect, &bh)))
                return false;
+             h = (struct elf_link_hash_entry *) bh;
              h->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF;
              h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
              h->type = STT_OBJECT;
@@ -4655,8 +4669,9 @@ struct elf_link_sort_rela
   enum elf_reloc_type_class type;
   union
   {
-    Elf_Internal_Rel rel;
-    Elf_Internal_Rela rela;
+    /* We use these as arrays of size int_rels_per_ext_rel.  */
+    Elf_Internal_Rel rel[1];
+    Elf_Internal_Rela rela[1];
   } u;
 };
 
@@ -4676,13 +4691,13 @@ elf_link_sort_cmp1 (A, B)
     return 1;
   if (relativea > relativeb)
     return -1;
-  if (ELF_R_SYM (a->u.rel.r_info) < ELF_R_SYM (b->u.rel.r_info))
+  if (ELF_R_SYM (a->u.rel->r_info) < ELF_R_SYM (b->u.rel->r_info))
     return -1;
-  if (ELF_R_SYM (a->u.rel.r_info) > ELF_R_SYM (b->u.rel.r_info))
+  if (ELF_R_SYM (a->u.rel->r_info) > ELF_R_SYM (b->u.rel->r_info))
     return 1;
-  if (a->u.rel.r_offset < b->u.rel.r_offset)
+  if (a->u.rel->r_offset < b->u.rel->r_offset)
     return -1;
-  if (a->u.rel.r_offset > b->u.rel.r_offset)
+  if (a->u.rel->r_offset > b->u.rel->r_offset)
     return 1;
   return 0;
 }
@@ -4706,9 +4721,9 @@ elf_link_sort_cmp2 (A, B)
     return -1;
   if (copya > copyb)
     return 1;
-  if (a->u.rel.r_offset < b->u.rel.r_offset)
+  if (a->u.rel->r_offset < b->u.rel->r_offset)
     return -1;
-  if (a->u.rel.r_offset > b->u.rel.r_offset)
+  if (a->u.rel->r_offset > b->u.rel->r_offset)
     return 1;
   return 0;
 }
@@ -4726,6 +4741,7 @@ elf_link_sort_relocs (abfd, info, psec)
   size_t i, j, ret;
   struct elf_link_sort_rela *rela;
   struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  int i2e = bed->s->int_rels_per_ext_rel;
 
   reldyn = bfd_get_section_by_name (abfd, ".rela.dyn");
   if (reldyn == NULL || reldyn->_raw_size == 0)
@@ -4749,7 +4765,23 @@ elf_link_sort_relocs (abfd, info, psec)
   if (size != reldyn->_raw_size)
     return 0;
 
-  rela = (struct elf_link_sort_rela *) bfd_zmalloc (sizeof (*rela) * count);
+  /* We waste some memory here when N = i2e is greater than 1, since
+     we allocate space for N * sizeof (*rela) where sizeof (*rela) +
+     (N - 1) * sizeof (Elf_Internal_Rel/Rela) would do.  Also, we use
+     rela[k] only when k is a multiple of N, and then we index the
+     array within the union, such that rela[k].u.rel[i], i < N, is the
+     (i+1)th internal relocation corresponding to the (k/N)th external
+     relocation.  This is done such that the relocation swap-in and
+     swap-out functions can gen pointers to arrays of internal
+     relocations that form a single external relocation.
+
+     If C permitted arrays of structures with dynamic sizes, we could
+     do better, but trying to avoid wasting space at the end of the
+     chunk from rela[k] to rela[k+N-1] would require us to allocate a
+     separate array of pointers and since most ports have N == 1, this
+     would be more wasteful.  */
+  rela = (struct elf_link_sort_rela *) bfd_zmalloc
+    (sizeof (*rela) * count * i2e);
   if (rela == NULL)
     {
       (*info->callbacks->warning)
@@ -4770,15 +4802,16 @@ elf_link_sort_relocs (abfd, info, psec)
 
            erel = (Elf_External_Rel *) o->contents;
            erelend = (Elf_External_Rel *) (o->contents + o->_raw_size);
-           s = rela + o->output_offset / sizeof (Elf_External_Rel);
-           for (; erel < erelend; erel++, s++)
+           s = rela + (o->output_offset / sizeof (Elf_External_Rel) * i2e);
+           for (; erel < erelend; erel++, s += i2e)
              {
                if (bed->s->swap_reloc_in)
-                 (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, &s->u.rel);
+                 (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel,
+                                           s->u.rel);
                else
-                 elf_swap_reloc_in (abfd, erel, &s->u.rel);
+                 elf_swap_reloc_in (abfd, erel, s->u.rel);
 
-               s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
+               s->type = (*bed->elf_backend_reloc_type_class) (s->u.rela);
              }
          }
        else
@@ -4788,30 +4821,34 @@ elf_link_sort_relocs (abfd, info, psec)
 
            erela = (Elf_External_Rela *) o->contents;
            erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
-           s = rela + o->output_offset / sizeof (Elf_External_Rela);
-           for (; erela < erelaend; erela++, s++)
+           s = rela + (o->output_offset / sizeof (Elf_External_Rela) * i2e);
+           for (; erela < erelaend; erela++, s += i2e)
              {
                if (bed->s->swap_reloca_in)
                  (*bed->s->swap_reloca_in) (dynobj, (bfd_byte *) erela,
-                                            &s->u.rela);
+                                            s->u.rela);
                else
-                 elf_swap_reloca_in (dynobj, erela, &s->u.rela);
+                 elf_swap_reloca_in (dynobj, erela, s->u.rela);
 
-               s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
+               s->type = (*bed->elf_backend_reloc_type_class) (s->u.rela);
              }
          }
       }
 
-  qsort (rela, (size_t) count, sizeof (*rela), elf_link_sort_cmp1);
-  for (ret = 0; ret < count && rela[ret].type == reloc_class_relative; ret++)
+  qsort (rela, (size_t) count, sizeof (*rela) * i2e, elf_link_sort_cmp1);
+  for (ret = 0; ret < count * i2e && rela[ret].type == reloc_class_relative;
+       ret += i2e)
     ;
-  for (i = ret, j = ret; i < count; i++)
+  for (i = ret, j = ret; i < count * i2e; i += i2e)
     {
-      if (ELF_R_SYM (rela[i].u.rel.r_info) != ELF_R_SYM (rela[j].u.rel.r_info))
+      if (ELF_R_SYM (rela[i].u.rel->r_info)
+         != ELF_R_SYM (rela[j].u.rel->r_info))
        j = i;
-      rela[i].offset = rela[j].u.rel.r_offset;
+      rela[i].offset = rela[j].u.rel->r_offset;
     }
-  qsort (rela + ret, (size_t) count - ret, sizeof (*rela), elf_link_sort_cmp2);
+  ret /= i2e;
+  qsort (rela + ret, (size_t) count - ret,
+        sizeof (*rela) * i2e, elf_link_sort_cmp2);
 
   for (o = dynobj->sections; o != NULL; o = o->next)
     if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED))
@@ -4825,14 +4862,14 @@ elf_link_sort_relocs (abfd, info, psec)
 
            erel = (Elf_External_Rel *) o->contents;
            erelend = (Elf_External_Rel *) (o->contents + o->_raw_size);
-           s = rela + o->output_offset / sizeof (Elf_External_Rel);
-           for (; erel < erelend; erel++, s++)
+           s = rela + (o->output_offset / sizeof (Elf_External_Rel) * i2e);
+           for (; erel < erelend; erel++, s += i2e)
              {
                if (bed->s->swap_reloc_out)
-                 (*bed->s->swap_reloc_out) (abfd, &s->u.rel,
+                 (*bed->s->swap_reloc_out) (abfd, s->u.rel,
                                             (bfd_byte *) erel);
                else
-                 elf_swap_reloc_out (abfd, &s->u.rel, erel);
+                 elf_swap_reloc_out (abfd, s->u.rel, erel);
              }
          }
        else
@@ -4842,14 +4879,14 @@ elf_link_sort_relocs (abfd, info, psec)
 
            erela = (Elf_External_Rela *) o->contents;
            erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
-           s = rela + o->output_offset / sizeof (Elf_External_Rela);
-           for (; erela < erelaend; erela++, s++)
+           s = rela + (o->output_offset / sizeof (Elf_External_Rela) * i2e);
+           for (; erela < erelaend; erela++, s += i2e)
              {
                if (bed->s->swap_reloca_out)
-                 (*bed->s->swap_reloca_out) (dynobj, &s->u.rela,
+                 (*bed->s->swap_reloca_out) (dynobj, s->u.rela,
                                              (bfd_byte *) erela);
                else
-                 elf_swap_reloca_out (dynobj, &s->u.rela, erela);
+                 elf_swap_reloca_out (dynobj, s->u.rela, erela);
              }
          }
       }
@@ -6815,20 +6852,12 @@ elf_link_input_bfd (finfo, input_bfd)
                           || h->root.type == bfd_link_hash_defweak)
                          && elf_discarded_section (h->root.u.def.section))
                        {
-#if BFD_VERSION_DATE < 20031005
                          if ((o->flags & SEC_DEBUGGING) != 0)
                            {
-#if BFD_VERSION_DATE > 20021005
-                             (*finfo->info->callbacks->warning)
-                               (finfo->info,
-                                _("warning: relocation against removed section; zeroing"),
-                                NULL, input_bfd, o, rel->r_offset);
-#endif
                              BFD_ASSERT (r_symndx != 0);
                              memset (rel, 0, sizeof (*rel));
                            }
                          else
-#endif
                            {
                              if (! ((*finfo->info->callbacks->undefined_symbol)
                                     (finfo->info, h->root.root.string,
@@ -6844,23 +6873,15 @@ elf_link_input_bfd (finfo, input_bfd)
 
                      if (sec != NULL && elf_discarded_section (sec))
                        {
-#if BFD_VERSION_DATE < 20031005
                          if ((o->flags & SEC_DEBUGGING) != 0
                              || (sec->flags & SEC_LINK_ONCE) != 0)
                            {
-#if BFD_VERSION_DATE > 20021005
-                             (*finfo->info->callbacks->warning)
-                               (finfo->info,
-                                _("warning: relocation against removed section"),
-                                NULL, input_bfd, o, rel->r_offset);
-#endif
                              BFD_ASSERT (r_symndx != 0);
                              rel->r_info
                                = ELF_R_INFO (0, ELF_R_TYPE (rel->r_info));
                              rel->r_addend = 0;
                            }
                          else
-#endif
                            {
                              boolean ok;
                              const char *msg
index 2a29347365f297c32c1e5e0f73de783ea5d6074a..5da8e43b7f8ede321cfa5d679d20da1aaa96baf0 100644 (file)
@@ -647,13 +647,14 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
    not support brl, and so it gets emulated by the kernel.  */
 #undef USE_BRL
 
+#ifdef USE_BRL
 static const bfd_byte oor_brl[16] =
 {
   0x05, 0x00, 0x00, 0x00, 0x01, 0x00,  /*  [MLX]        nop.m 0            */
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*               brl.sptk.few tgt;; */
   0x00, 0x00, 0x00, 0xc0
 };
-
+#else
 static const bfd_byte oor_ip[48] =
 {
   0x04, 0x00, 0x00, 0x00, 0x01, 0x00,  /*  [MLX]        nop.m 0            */
@@ -666,6 +667,7 @@ static const bfd_byte oor_ip[48] =
   0x60, 0x80, 0x04, 0x80, 0x03, 0x00,  /*               mov b6=r16         */
   0x60, 0x00, 0x80, 0x00               /*               br b6;;            */
 };
+#endif
 \f
 /* These functions do relaxation for IA-64 ELF.
 
@@ -1282,6 +1284,7 @@ elfNN_ia64_aix_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
        {
          struct elf_backend_data *bed;
          struct elfNN_ia64_link_hash_table *ia64_info;
+         struct bfd_link_hash_entry *bh = NULL;
 
          bed = get_elf_backend_data (abfd);
          ia64_info = elfNN_ia64_hash_table (info);
@@ -1290,9 +1293,10 @@ elfNN_ia64_aix_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
                (info, abfd, *namep, BSF_GLOBAL,
                 bfd_get_section_by_name (abfd, ".bss"),
                 bed->got_symbol_offset, (const char *) NULL, false,
-                bed->collect, (struct bfd_link_hash_entry **) &h)))
+                bed->collect, &bh)))
            return false;
 
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_OBJECT;
 
index 3c8bb5d8be8a1f7d3031ccf1bae9a4ec73960b0e..bc81458987a637031222f9d6da15d2009f3b0ece 100644 (file)
@@ -345,7 +345,7 @@ static bfd_reloc_status_type mips_elf_calculate_relocation
   PARAMS ((bfd *, bfd *, asection *, struct bfd_link_info *,
           const Elf_Internal_Rela *, bfd_vma, reloc_howto_type *,
           Elf_Internal_Sym *, asection **, bfd_vma *, const char **,
-          boolean *));
+          boolean *, boolean));
 static bfd_vma mips_elf_obtain_contents
   PARAMS ((reloc_howto_type *, const Elf_Internal_Rela *, bfd *, bfd_byte *));
 static boolean mips_elf_perform_relocation
@@ -1901,6 +1901,7 @@ mips_elf_create_got_section (abfd, info)
   flagword flags;
   register asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   struct mips_got_info *g;
   bfd_size_type amt;
 
@@ -1920,13 +1921,14 @@ mips_elf_create_got_section (abfd, info)
   /* Define the symbol _GLOBAL_OFFSET_TABLE_.  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 = NULL;
+  bh = NULL;
   if (! (_bfd_generic_link_add_one_symbol
         (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
          (bfd_vma) 0, (const char *) NULL, false,
-         get_elf_backend_data (abfd)->collect,
-         (struct bfd_link_hash_entry **) &h)))
+         get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
@@ -2004,7 +2006,7 @@ static bfd_reloc_status_type
 mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
                               relocation, addend, howto, local_syms,
                               local_sections, valuep, namep,
-                              require_jalxp)
+                              require_jalxp, save_addend)
      bfd *abfd;
      bfd *input_bfd;
      asection *input_section;
@@ -2017,6 +2019,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
      bfd_vma *valuep;
      const char **namep;
      boolean *require_jalxp;
+     boolean save_addend;
 {
   /* The eventual value we will return.  */
   bfd_vma value;
@@ -2041,7 +2044,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
   struct mips_elf_link_hash_entry *h = NULL;
   /* True if the symbol referred to by this relocation is a local
      symbol.  */
-  boolean local_p;
+  boolean local_p, was_local_p;
   /* True if the symbol referred to by this relocation is "_gp_disp".  */
   boolean gp_disp_p = false;
   Elf_Internal_Shdr *symtab_hdr;
@@ -2069,6 +2072,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   local_p = mips_elf_local_relocation_p (input_bfd, relocation,
                                         local_sections, false);
+  was_local_p = local_p;
   if (! elf_bad_symtab (input_bfd))
     extsymoff = symtab_hdr->sh_info;
   else
@@ -2456,10 +2460,19 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
         order.  We don't need to do anything special here; the
         differences are handled in mips_elf_perform_relocation.  */
     case R_MIPS_GPREL16:
-      if (local_p)
-       value = mips_elf_sign_extend (addend, 16) + symbol + gp0 - gp;
-      else
-       value = mips_elf_sign_extend (addend, 16) + symbol - gp;
+      /* Only sign-extend the addend if it was extracted from the
+        instruction.  If the addend was separate, leave it alone,
+        otherwise we may lose significant bits.  */
+      if (howto->partial_inplace)
+       addend = mips_elf_sign_extend (addend, 16);
+      value = symbol + addend - gp;
+      /* If the symbol was local, any earlier relocatable links will
+        have adjusted its addend with the gp offset, so compensate
+        for that now.  Don't do it for symbols forced local in this
+        link, though, since they won't have had the gp offset applied
+        to them before.  */
+      if (was_local_p)
+       value += gp0;
       overflowed_p = mips_elf_overflow_p (value, 16);
       break;
 
@@ -2492,7 +2505,9 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
       break;
 
     case R_MIPS_GPREL32:
-      value = (addend + symbol + gp0 - gp) & howto->dst_mask;
+      value = (addend + symbol + gp0 - gp);
+      if (!save_addend)
+       value &= howto->dst_mask;
       break;
 
     case R_MIPS_PC16:
@@ -2938,6 +2953,12 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
         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);
+      outrel[1].r_info = ELF_R_INFO (output_bfd, (unsigned long) 0,
+                                    ABI_64_P (output_bfd)
+                                    ? R_MIPS_64
+                                    : R_MIPS_NONE);
+      outrel[2].r_info = ELF_R_INFO (output_bfd, (unsigned long) 0,
+                                    R_MIPS_NONE);
 
       /* Adjust the output offset of the relocation to reference the
         correct location in the output file.  */
@@ -3825,15 +3846,17 @@ _bfd_mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
       && strcmp (*namep, "__rld_obj_head") == 0)
     {
       struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh;
 
       /* Mark __rld_obj_head as dynamic.  */
-      h = NULL;
+      bh = NULL;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, *namep, BSF_GLOBAL, *secp,
              (bfd_vma) *valp, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             get_elf_backend_data (abfd)->collect, &bh)))
        return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
@@ -3889,6 +3912,7 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
      struct bfd_link_info *info;
 {
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   flagword flags;
   register asection *s;
   const char * const *namep;
@@ -3947,13 +3971,14 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
     {
       for (namep = mips_elf_dynsym_rtproc_names; *namep != NULL; namep++)
        {
-         h = NULL;
+         bh = NULL;
          if (! (_bfd_generic_link_add_one_symbol
                 (info, abfd, *namep, BSF_GLOBAL, bfd_und_section_ptr,
                  (bfd_vma) 0, (const char *) NULL, false,
-                 get_elf_backend_data (abfd)->collect,
-                 (struct bfd_link_hash_entry **) &h)))
+                 get_elf_backend_data (abfd)->collect, &bh)))
            return false;
+
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
          h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_SECTION;
@@ -3989,26 +4014,17 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
 
   if (!info->shared)
     {
-      h = NULL;
-      if (SGI_COMPAT (abfd))
-       {
-         if (!(_bfd_generic_link_add_one_symbol
-               (info, abfd, "_DYNAMIC_LINK", BSF_GLOBAL, bfd_abs_section_ptr,
-                (bfd_vma) 0, (const char *) NULL, false,
-                get_elf_backend_data (abfd)->collect,
-                (struct bfd_link_hash_entry **) &h)))
-           return false;
-       }
-      else
-       {
-         /* For normal mips it is _DYNAMIC_LINKING.  */
-         if (!(_bfd_generic_link_add_one_symbol
-               (info, abfd, "_DYNAMIC_LINKING", BSF_GLOBAL,
-                bfd_abs_section_ptr, (bfd_vma) 0, (const char *) NULL, false,
-                get_elf_backend_data (abfd)->collect,
-                (struct bfd_link_hash_entry **) &h)))
-           return false;
-       }
+      const char *name;
+
+      name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING";
+      bh = NULL;
+      if (!(_bfd_generic_link_add_one_symbol
+           (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr,
+            (bfd_vma) 0, (const char *) NULL, false,
+            get_elf_backend_data (abfd)->collect, &bh)))
+       return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_SECTION;
@@ -4025,26 +4041,15 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
          s = bfd_get_section_by_name (abfd, ".rld_map");
          BFD_ASSERT (s != NULL);
 
-         h = NULL;
-         if (SGI_COMPAT (abfd))
-           {
-             if (!(_bfd_generic_link_add_one_symbol
-                   (info, abfd, "__rld_map", BSF_GLOBAL, s,
-                    (bfd_vma) 0, (const char *) NULL, false,
-                    get_elf_backend_data (abfd)->collect,
-                    (struct bfd_link_hash_entry **) &h)))
-               return false;
-           }
-         else
-           {
-             /* For normal mips the symbol is __RLD_MAP.  */
-             if (!(_bfd_generic_link_add_one_symbol
-                   (info, abfd, "__RLD_MAP", BSF_GLOBAL, s,
-                    (bfd_vma) 0, (const char *) NULL, false,
-                    get_elf_backend_data (abfd)->collect,
-                    (struct bfd_link_hash_entry **) &h)))
-               return false;
-           }
+         name = SGI_COMPAT (abfd) ? "__rld_map" : "__RLD_MAP";
+         bh = NULL;
+         if (!(_bfd_generic_link_add_one_symbol
+               (info, abfd, name, BSF_GLOBAL, s,
+                (bfd_vma) 0, (const char *) NULL, false,
+                get_elf_backend_data (abfd)->collect, &bh)))
+           return false;
+
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
          h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_OBJECT;
@@ -5261,7 +5266,8 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                             input_section, info, rel,
                                             addend, howto, local_syms,
                                             local_sections, &value,
-                                            &name, &require_jalx))
+                                            &name, &require_jalx,
+                                            use_saved_addend_p))
        {
        case bfd_reloc_continue:
          /* There's nothing to do.  */
@@ -6131,7 +6137,12 @@ _bfd_mips_elf_modify_segment_map (abfd)
      .dynamic end up in PT_DYNAMIC.  However, we do have to insert a
      PT_OPTIONS segment immediately following the program header
      table.  */
-  if (NEWABI_P (abfd))
+  if (NEWABI_P (abfd)
+      /* On non-IRIX6 new abi, we'll have already created a segment
+        for this section, so don't create another.  I'm not sure this
+        is not also the case for IRIX 6, but I can't test it right
+        now.  */
+      && IRIX_COMPAT (abfd) == ict_irix6)
     {
       for (s = abfd->sections; s; s = s->next)
        if (elf_section_data (s)->this_hdr.sh_type == SHT_MIPS_OPTIONS)
index 8da72568f27eb3f5c9f26d7a64601b3c1f008166..4f5b81c9757e2f821e0313c2b519ec187d3c51e7 100644 (file)
    For backwards compatibility, we still support this usage.  */
 #ifndef USE_REL
 #define USE_REL 0
-#else
-#undef USE_REL
-#define USE_REL 1
 #endif
 
 /* Use these in new code.  */
index 1efa9e24547ef4a276f58ad3cf1ed69936c183df..ef6b46edfb81639321544fe7180eee3c9b8f17f8 100644 (file)
@@ -132,7 +132,7 @@ bfd_check_format_matches (abfd, format, matching)
     }
 
   if (abfd->format != bfd_unknown)
-    return abfd->format == format;
+    return (boolean) (abfd->format == format);
 
   /* Since the target type was defaulted, check them
      all in the hope that one will be uniquely recognized.  */
@@ -355,7 +355,7 @@ bfd_set_format (abfd, format)
     }
 
   if (abfd->format != bfd_unknown)
-    return abfd->format == format;
+    return (boolean) (abfd->format == format);
 
   /* Presume the answer is yes.  */
   abfd->format = format;
index 1bba14adb5bc3578843892adaa164aaabaf00390..b6720e87dc97c1ad497bf51c5d7927cf712fbcc0 100644 (file)
@@ -21,6 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "/usr/include/a.out.h"
 #include <stdio.h>
 
+#ifndef _
+#define _(X) X
+#endif
+
 int
 main (argc, argv)
      int argc; char** argv;
index 29170a0d561da230cc973c43db78522caf196ae9..f21abbcd6ce9e86eef7ee6aaa098a4ef7d5458c8 100644 (file)
@@ -186,9 +186,9 @@ bfd_realloc (ptr, size)
     }
 
   if (ptr == NULL)
-    ret = malloc ((size_t) size);
+    ret = (PTR) malloc ((size_t) size);
   else
-    ret = realloc (ptr, (size_t) size);
+    ret = (PTR) realloc (ptr, (size_t) size);
 
   if (ret == NULL && (size_t) size != 0)
     bfd_set_error (bfd_error_no_memory);
@@ -562,7 +562,7 @@ bfd_bwrite (ptr, size, abfd)
          newsize = (bim->size + 127) & ~(bfd_size_type) 127;
          if (newsize > oldsize)
            {
-             bim->buffer = bfd_realloc (bim->buffer, newsize);
+             bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize);
              if (bim->buffer == 0)
                {
                  bim->size = 0;
@@ -608,7 +608,7 @@ bfd_write_bigendian_4byte_int (abfd, i)
 {
   bfd_byte buffer[4];
   bfd_putb32 ((bfd_vma) i, buffer);
-  return bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4;
+  return (boolean) (bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4);
 }
 
 bfd_vma
@@ -706,7 +706,7 @@ bfd_seek (abfd, position, direction)
              newsize = (bim->size + 127) & ~(bfd_size_type) 127;
              if (newsize > oldsize)
                {
-                 bim->buffer = bfd_realloc (bim->buffer, newsize);
+                 bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize);
                  if (bim->buffer == 0)
                    {
                      bim->size = 0;
@@ -1414,7 +1414,7 @@ bfd_generic_is_local_label_name (abfd, name)
 {
   char locals_prefix = (bfd_get_symbol_leading_char (abfd) == '_') ? 'L' : '.';
 
-  return (name[0] == locals_prefix);
+  return (boolean) (name[0] == locals_prefix);
 }
 
 /*  Can be used from / for bfd_merge_private_bfd_data to check that
index 96e55d7c54750b5685bc0d7ea4a614a473b9bf2c..ef001f335308b302e3e743334aa84a8b3156d45a 100644 (file)
@@ -1005,6 +1005,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_SH_IMM_HI16",
   "BFD_RELOC_SH_IMM_HI16_PCREL",
   "BFD_RELOC_SH_PT_16",
+  "BFD_RELOC_SH_TLS_GD_32",
+  "BFD_RELOC_SH_TLS_LD_32",
+  "BFD_RELOC_SH_TLS_LDO_32",
+  "BFD_RELOC_SH_TLS_IE_32",
+  "BFD_RELOC_SH_TLS_LE_32",
+  "BFD_RELOC_SH_TLS_DTPMOD32",
+  "BFD_RELOC_SH_TLS_DTPOFF32",
+  "BFD_RELOC_SH_TLS_TPOFF32",
   "BFD_RELOC_THUMB_PCREL_BRANCH9",
   "BFD_RELOC_THUMB_PCREL_BRANCH12",
   "BFD_RELOC_THUMB_PCREL_BRANCH23",
index 88b0909829610e5f4db50973d8ec3736d8939c2b..ea9c5700b1fc8250da9d73239b4ae0ebbb4dffff 100644 (file)
@@ -784,7 +784,7 @@ typedef struct
             struct coff_link_hash_entry *, struct internal_syment *,
             bfd_vma *));
 
-  boolean (*_bfd_coff_adjust_symndx)\
+  boolean (*_bfd_coff_adjust_symndx)
     PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
             struct internal_reloc *, boolean *));
 
index 242f8bd7625de2a78d9e1df12b4f69117acae91a..a5ded1f58836befe5af09bee5796db6b369aafc8 100644 (file)
@@ -449,7 +449,8 @@ _bfd_link_hash_newfunc (entry, table, string)
      subclass.  */
   if (entry == NULL)
     {
-      entry = bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry));
+      entry = (struct bfd_hash_entry *)
+       bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry));
       if (entry == NULL)
        return entry;
     }
@@ -645,8 +646,8 @@ _bfd_generic_link_hash_newfunc (entry, table, string)
      subclass.  */
   if (entry == NULL)
     {
-      entry = bfd_hash_allocate (table,
-                                sizeof (struct generic_link_hash_entry));
+      entry = (struct bfd_hash_entry *)
+       bfd_hash_allocate (table, sizeof (struct generic_link_hash_entry));
       if (entry == NULL)
        return entry;
     }
@@ -1305,6 +1306,7 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)
          const char *name;
          const char *string;
          struct generic_link_hash_entry *h;
+         struct bfd_link_hash_entry *bh;
 
          name = bfd_asymbol_name (p);
          if (((p->flags & BSF_INDIRECT) != 0
@@ -1326,12 +1328,12 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)
          else
            string = NULL;
 
-         h = NULL;
+         bh = NULL;
          if (! (_bfd_generic_link_add_one_symbol
                 (info, abfd, name, p->flags, bfd_get_section (p),
-                 p->value, string, false, collect,
-                 (struct bfd_link_hash_entry **) &h)))
+                 p->value, string, false, collect, &bh)))
            return false;
+         h = (struct generic_link_hash_entry *) bh;
 
          /* If this is a constructor symbol, and the linker didn't do
              anything with it, then we want to just pass the symbol
@@ -2018,7 +2020,7 @@ _bfd_generic_final_link (abfd, info)
   for (o = abfd->sections; o != NULL; o = o->next)
     for (p = o->link_order_head; p != NULL; p = p->next)
       if (p->type == bfd_indirect_link_order)
-       p->u.indirect.section->linker_mark = true;
+       p->u.indirect.section->linker_mark = (unsigned int) true;
 
   /* Build the output symbol table.  */
   for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
index ce61207251f36b6a961f8e68ba91c94f540c5758..9dc2e7083443eb7b5731c5a9447abf6bb627956c 100644 (file)
@@ -353,7 +353,7 @@ sec_merge_emit (abfd, entry)
   if (alignment_power)
     free (pad);
 
-  return entry == NULL || entry->secinfo != secinfo;
+  return (boolean) (entry == NULL || entry->secinfo != secinfo);
 }
 
 /* This function is called for each input file from the add_symbols
@@ -667,7 +667,7 @@ merge_strings (sinfo)
        break;
       if (e->len > 4 * e->u.entsize)
        {
-         s = e->root.string + e->len - e->u.entsize;
+         s = (const unsigned char *) (e->root.string + e->len - e->u.entsize);
          hash = 0;
          for (i = 0; i < 4 * e->u.entsize; i++)
            {
@@ -690,7 +690,7 @@ merge_strings (sinfo)
          else
            *p = (PTR) e;
        }
-      s = e->root.string + e->len - e->u.entsize;
+      s = (const unsigned char *) (e->root.string + e->len - e->u.entsize);
       hash = 0;
       for (i = 0; i < e->u.entsize; i++)
        {
index cdf08df05dd4c1500f31655988781aea83f88709..af8ff7e4a63585a1707e906b3a13a651b49c96a1 100644 (file)
@@ -63,7 +63,9 @@ _bfd_new_bfd ()
   nbfd->direction = no_direction;
   nbfd->iostream = NULL;
   nbfd->where = 0;
-  if (!bfd_hash_table_init (&nbfd->section_htab, bfd_section_hash_newfunc))
+  if (!bfd_hash_table_init_n (&nbfd->section_htab,
+                             bfd_section_hash_newfunc,
+                             251))
     {
       free (nbfd);
       return NULL;
@@ -124,7 +126,7 @@ FUNCTION
        bfd_openr
 
 SYNOPSIS
-        bfd *bfd_openr(const char *filename, const char *target);
+       bfd *bfd_openr(const char *filename, const char *target);
 
 DESCRIPTION
        Open the file @var{filename} (using <<fopen>>) with the target
@@ -134,7 +136,8 @@ DESCRIPTION
        that function.
 
        If <<NULL>> is returned then an error has occured.   Possible errors
-       are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or <<system_call>> error.
+       are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or
+       <<system_call>> error.
 */
 
 bfd *
@@ -179,28 +182,28 @@ bfd_openr (filename, target)
        the file descriptor too, even though we didn't open it.  */
 /*
 FUNCTION
-         bfd_fdopenr
+       bfd_fdopenr
 
 SYNOPSIS
-         bfd *bfd_fdopenr(const char *filename, const char *target, int fd);
+       bfd *bfd_fdopenr(const char *filename, const char *target, int fd);
 
 DESCRIPTION
-         <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to <<fopen>>.
-        It opens a BFD on a file already described by the @var{fd}
-        supplied.
-
-        When the file is later <<bfd_close>>d, the file descriptor will be closed.
-
-        If the caller desires that this file descriptor be cached by BFD
-        (opened as needed, closed as needed to free descriptors for
-        other opens), with the supplied @var{fd} used as an initial
-        file descriptor (but subject to closure at any time), call
-        bfd_set_cacheable(bfd, 1) on the returned BFD.  The default is to
-        assume no cacheing; the file descriptor will remain open until
-        <<bfd_close>>, and will not be affected by BFD operations on other
-        files.
-
-         Possible errors are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
+       <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to
+       <<fopen>>.  It opens a BFD on a file already described by the
+       @var{fd} supplied.
+
+       When the file is later <<bfd_close>>d, the file descriptor will
+       be closed.  If the caller desires that this file descriptor be
+       cached by BFD (opened as needed, closed as needed to free
+       descriptors for other opens), with the supplied @var{fd} used as
+       an initial file descriptor (but subject to closure at any time),
+       call bfd_set_cacheable(bfd, 1) on the returned BFD.  The default
+       is to assume no cacheing; the file descriptor will remain open
+       until <<bfd_close>>, and will not be affected by BFD operations
+       on other files.
+
+       Possible errors are <<bfd_error_no_memory>>,
+       <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
 */
 
 bfd *
@@ -389,10 +392,10 @@ SYNOPSIS
 
 DESCRIPTION
 
-       Close a BFD. If the BFD was open for writing,
-       then pending operations are completed and the file written out
-       and closed. If the created file is executable, then
-       <<chmod>> is called to mark it as such.
+       Close a BFD. If the BFD was open for writing, then pending
+       operations are completed and the file written out and closed.
+       If the created file is executable, then <<chmod>> is called
+       to mark it as such.
 
        All memory attached to the BFD is released.
 
@@ -431,7 +434,7 @@ bfd_close (abfd)
 
       if (stat (abfd->filename, &buf) == 0)
        {
-         unsigned int mask = umask (0);
+         unsigned int mask = umask (0);
 
          umask (mask);
          chmod (abfd->filename,
@@ -453,10 +456,10 @@ SYNOPSIS
        boolean bfd_close_all_done(bfd *);
 
 DESCRIPTION
-       Close a BFD.  Differs from <<bfd_close>>
-       since it does not complete any pending operations.  This
-       routine would be used if the application had just used BFD for
-       swapping and didn't want to use any of the writing code.
+       Close a BFD.  Differs from <<bfd_close>> since it does not
+       complete any pending operations.  This routine would be used
+       if the application had just used BFD for swapping and didn't
+       want to use any of the writing code.
 
        If the created file is executable, then <<chmod>> is called
        to mark it as such.
@@ -507,10 +510,9 @@ SYNOPSIS
        bfd *bfd_create(const char *filename, bfd *templ);
 
 DESCRIPTION
-       Create a new BFD in the manner of
-       <<bfd_openw>>, but without opening a file. The new BFD
-       takes the target from the target used by @var{template}. The
-       format is always set to <<bfd_object>>.
+       Create a new BFD in the manner of <<bfd_openw>>, but without
+       opening a file. The new BFD takes the target from the target
+       used by @var{template}. The format is always set to <<bfd_object>>.
 */
 
 bfd *
index 28f599de3d615fc65ee939555ace326de1764d73..2dbe723a50ef0743372e74af4ccb3ad2d8e8ba7f 100644 (file)
@@ -1,3 +1,4 @@
+bfdver.h
 elf32-ia64.c
 elf32-target.h
 elf64-ia64.c
index 27ce9a93a6732376c3ece6dd4cafcea36bb5eec8..c95e01ead0435a523a1e324692f5beb0fc9f307f 100644 (file)
@@ -137,9 +137,7 @@ elf32-h8300.c
 elf32-hppa.c
 elf32-hppa.h
 elf32-i370.c
-elf32-i386-fbsd.c
 elf32-i386.c
-elf32-i386qnx.c
 elf32-i860.c
 elf32-i960.c
 elf32-ip2k.c
@@ -154,21 +152,17 @@ elf32-openrisc.c
 elf32-or32.c
 elf32-pj.c
 elf32-ppc.c
-elf32-ppcqnx.c
+elf32-qnx.c
+elf32-qnx.h
 elf32-s390.c
-elf32-sh-lin.c
-elf32-sh-nbsd.c
 elf32-sh.c
 elf32-sh64-com.c
-elf32-sh64-nbsd.c
 elf32-sh64.c
-elf32-shqnx.c
 elf32-sparc.c
 elf32-v850.c
 elf32-vax.c
 elf32-xstormy16.c
 elf32.c
-elf64-alpha-fbsd.c
 elf64-alpha.c
 elf64-gen.c
 elf64-hppa.c
@@ -177,14 +171,12 @@ elf64-mips.c
 elf64-mmix.c
 elf64-ppc.c
 elf64-s390.c
-elf64-sh64-nbsd.c
 elf64-sh64.c
 elf64-sparc.c
 elf64-x86-64.c
 elf64.c
 elfarm-nabi.c
 elfarm-oabi.c
-elfarmqnx-nabi.c
 elfcode.h
 elfcore.h
 elflink.c
@@ -274,6 +266,7 @@ reloc16.c
 riscix.c
 sco5-core.c
 section.c
+simple.c
 som.c
 som.h
 sparclinux.c
index 71f17402be095b7508a2cdde607d3e212279e7a4..b13f6722c1a661a95da7db5f0c904f46a6114e29 100644 (file)
@@ -2575,6 +2575,22 @@ ENUMX
   BFD_RELOC_SH_IMM_HI16_PCREL
 ENUMX
   BFD_RELOC_SH_PT_16
+ENUMX
+  BFD_RELOC_SH_TLS_GD_32
+ENUMX
+  BFD_RELOC_SH_TLS_LD_32
+ENUMX
+  BFD_RELOC_SH_TLS_LDO_32
+ENUMX
+  BFD_RELOC_SH_TLS_IE_32
+ENUMX
+  BFD_RELOC_SH_TLS_LE_32
+ENUMX
+  BFD_RELOC_SH_TLS_DTPMOD32
+ENUMX
+  BFD_RELOC_SH_TLS_DTPOFF32
+ENUMX
+  BFD_RELOC_SH_TLS_TPOFF32
 ENUMDOC
   Hitachi SH relocs.  Not all of these appear in object files.
 
@@ -3685,7 +3701,7 @@ const char *
 bfd_get_reloc_code_name (code)
      bfd_reloc_code_real_type code;
 {
-  if (code > BFD_RELOC_UNUSED)
+  if ((int) code > (int) BFD_RELOC_UNUSED)
     return 0;
   return bfd_reloc_code_real_names[(int)code];
 }
@@ -3813,7 +3829,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
 
   /* We're not relaxing the section, so just copy the size info.  */
   input_section->_cooked_size = input_section->_raw_size;
-  input_section->reloc_done = true;
+  input_section->reloc_done = (unsigned int) true;
 
   reloc_count = bfd_canonicalize_reloc (input_bfd,
                                        input_section,
index 51b21c70fbbf2f65b4bfce57889621f50324b7b8..b5871e9bbfa78265b5461deb338f751441a6d3bc 100644 (file)
@@ -643,7 +643,8 @@ bfd_section_hash_newfunc (entry, table, string)
      subclass.  */
   if (entry == NULL)
     {
-      entry = bfd_hash_allocate (table, sizeof (struct section_hash_entry));
+      entry = (struct bfd_hash_entry *)
+       bfd_hash_allocate (table, sizeof (struct section_hash_entry));
       if (entry == NULL)
        return entry;
     }
@@ -1186,7 +1187,7 @@ bfd_set_section_contents (abfd, section, location, offset, count)
 
   /* Record a copy of the data in memory if desired.  */
   if (section->contents
-      && location != section->contents + offset)
+      && location != (PTR) (section->contents + offset))
     memcpy (section->contents + offset, location, (size_t) count);
 
   if (BFD_SEND (abfd, _bfd_set_section_contents,
index 129b2ba4bb53cbbcf987e81a4943414f1143c485..6c29fa16881893cf4d92049dea95b87b53f77959 100644 (file)
@@ -181,7 +181,7 @@ unsigned int Chunk = DEFAULT_CHUNK;
 /* The type of srec output (free or forced to S3).
    This variable can be modified by objcopy's --srec-forceS3
    parameter.  */
-boolean S3Forced = 0;
+boolean S3Forced = false;
 
 /* When writing an S-record file, the S-records can not be output as
    they are seen.  This structure is used to hold them in memory.  */
@@ -1203,7 +1203,7 @@ srec_get_symtab (abfd, alocation)
 
       csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol));
       if (csymbols == NULL && symcount != 0)
-       return false;
+       return (long) false;
       abfd->tdata.srec_data->csymbols = csymbols;
 
       for (s = abfd->tdata.srec_data->symbols, c = csymbols;
index e225d9cd60d7ef70a82cfd701ca0992161cd6fe7..0cb37412983d3d53a8a759f6de545f1359bd9727 100644 (file)
@@ -331,7 +331,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
         symbol, ignoring nesting, adding up all the characters in the
         symbol names, not including the file numbers in types (the
         first number after an open parenthesis).  */
-      if (type == N_BINCL)
+      if (type == (int) N_BINCL)
        {
          bfd_vma val;
          int nest;
@@ -351,13 +351,13 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
              incl_type = incl_sym[TYPEOFF];
              if (incl_type == 0)
                break;
-             else if (incl_type == N_EINCL)
+             else if (incl_type == (int) N_EINCL)
                {
                  if (nest == 0)
                    break;
                  --nest;
                }
-             else if (incl_type == N_BINCL)
+             else if (incl_type == (int) N_BINCL)
                ++nest;
              else if (nest == 0)
                {
@@ -400,7 +400,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
            goto error_return;
          ne->offset = sym - stabbuf;
          ne->val = val;
-         ne->type = N_BINCL;
+         ne->type = (int) N_BINCL;
          ne->next = secinfo->excls;
          secinfo->excls = ne;
 
@@ -422,7 +422,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
 
              /* We have seen this header file before.  Tell the final
                 pass to change the type to N_EXCL.  */
-             ne->type = N_EXCL;
+             ne->type = (int) N_EXCL;
 
              /* Mark the skipped symbols.  */
 
@@ -435,7 +435,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
 
                  incl_type = incl_sym[TYPEOFF];
 
-                 if (incl_type == N_EINCL)
+                 if (incl_type == (int) N_EINCL)
                    {
                      if (nest == 0)
                        {
@@ -445,7 +445,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
                        }
                      --nest;
                    }
-                 else if (incl_type == N_BINCL)
+                 else if (incl_type == (int) N_BINCL)
                    ++nest;
                  else if (nest == 0)
                    {
@@ -597,7 +597,7 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo,
 
       type = sym[TYPEOFF];
 
-      if (type == N_FUN)
+      if (type == (int) N_FUN)
        {
          int strx = bfd_get_32 (abfd, sym + STRDXOFF);
 
@@ -624,7 +624,7 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo,
       else if (deleting == -1)
        {
          /* Outside of a function.  Check for deleted variables.  */
-         if (type == N_STSYM || type == N_LCSYM)
+         if (type == (int) N_STSYM || type == (int) N_LCSYM)
            if ((*reloc_symbol_deleted_p) (sym + VALOFF - stabbuf, cookie))
              {
                *pstridx = -1;
@@ -674,7 +674,7 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo,
       BFD_ASSERT (offset != 0);
     }
 
-  return (skip > 0);
+  return (boolean) (skip > 0);
 
  error_return:
   if (stabbuf != NULL)
index 6eea2d807dfb5ed4151fe1a54ca3c7ef38486801..b135726c33417dc2ff79399dc9d66f76e4d0d0f8 100644 (file)
@@ -713,7 +713,7 @@ boolean
 bfd_is_undefined_symclass (symclass)
      int symclass;
 {
-  return symclass == 'U' || symclass == 'w' || symclass == 'v';
+  return (boolean) (symclass == 'U' || symclass == 'w' || symclass == 'v');
 }
 
 /*
@@ -1070,7 +1070,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
       saw_fun = 1;
       for (stab = info->stabs; stab < info->stabs + stabsize; stab += STABSIZE)
        {
-         if (stab[TYPEOFF] == N_SO)
+         if (stab[TYPEOFF] == (bfd_byte) N_SO)
            {
              /* N_SO with null name indicates EOF */
              if (bfd_get_32 (abfd, stab + STRDXOFF) == 0)
@@ -1084,12 +1084,12 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
 
              /* two N_SO's in a row is a filename and directory. Skip */
              if (stab + STABSIZE < info->stabs + stabsize
-                 && *(stab + STABSIZE + TYPEOFF) == N_SO)
+                 && *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
                {
                  stab += STABSIZE;
                }
            }
-         else if (stab[TYPEOFF] == N_FUN)
+         else if (stab[TYPEOFF] == (bfd_byte) N_FUN)
            {
              saw_fun = 1;
              ++info->indextablesize;
@@ -1158,7 +1158,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
                {
                  last_stab = stab;
                  if (stab + STABSIZE >= info->stabs + stabsize
-                     || *(stab + STABSIZE + TYPEOFF) != N_SO)
+                     || *(stab + STABSIZE + TYPEOFF) != (bfd_byte) N_SO)
                    {
                      directory_name = NULL;
                    }
index b9be8e7535f196f3193ced8451aa7d78a60d11ea..e665898bc63780e0b71a7fb114dae8fc416a783c 100644 (file)
@@ -559,6 +559,8 @@ extern const bfd_target bfd_elf32_powerpcqnx_vec;
 extern const bfd_target bfd_elf32_s390_vec;
 extern const bfd_target bfd_elf32_sh64_vec;
 extern const bfd_target bfd_elf32_sh64l_vec;
+extern const bfd_target bfd_elf32_sh64lin_vec;
+extern const bfd_target bfd_elf32_sh64blin_vec;
 extern const bfd_target bfd_elf32_sh64lnbsd_vec;
 extern const bfd_target bfd_elf32_sh64nbsd_vec;
 extern const bfd_target bfd_elf32_sh_vec;
@@ -595,6 +597,8 @@ extern const bfd_target bfd_elf64_powerpcle_vec;
 extern const bfd_target bfd_elf64_s390_vec;
 extern const bfd_target bfd_elf64_sh64_vec;
 extern const bfd_target bfd_elf64_sh64l_vec;
+extern const bfd_target bfd_elf64_sh64lin_vec;
+extern const bfd_target bfd_elf64_sh64blin_vec;
 extern const bfd_target bfd_elf64_sh64lnbsd_vec;
 extern const bfd_target bfd_elf64_sh64nbsd_vec;
 extern const bfd_target bfd_elf64_sparc_vec;
@@ -789,6 +793,7 @@ static const bfd_target * const _bfd_target_vector[] = {
        &bfd_elf32_bigarc_vec,
        &bfd_elf32_bigarm_oabi_vec,
        &bfd_elf32_bigarm_vec,
+       &bfd_elf32_bigarmqnx_vec,
        &bfd_elf32_bigmips_vec,
        &bfd_elf32_cris_vec,
        &bfd_elf32_d10v_vec,
@@ -815,6 +820,7 @@ static const bfd_target * const _bfd_target_vector[] = {
        &bfd_elf32_littlearc_vec,
        &bfd_elf32_littlearm_oabi_vec,
        &bfd_elf32_littlearm_vec,
+       &bfd_elf32_littlearmqnx_vec,
        &bfd_elf32_littlemips_vec,
        &bfd_elf32_m32r_vec,
        &bfd_elf32_m68hc11_vec,
@@ -845,7 +851,9 @@ static const bfd_target * const _bfd_target_vector[] = {
         &bfd_elf32_shl_vec,
         &bfd_elf32_shlin_vec,
        &bfd_elf32_shlnbsd_vec,
+       &bfd_elf32_shlqnx_vec,
        &bfd_elf32_shnbsd_vec,
+       &bfd_elf32_shqnx_vec,
 #ifdef BFD64
        &bfd_elf32_sh64_vec,
        &bfd_elf32_sh64l_vec,
@@ -1269,14 +1277,17 @@ bfd_target_list ()
     vec_length++;
 
   amt = (vec_length + 1) * sizeof (char **);
-  name_ptr = name_list = (const char **) bfd_zmalloc (amt);
+  name_ptr = name_list = (const char **) bfd_malloc (amt);
 
   if (name_list == NULL)
     return NULL;
 
   for (target = &bfd_target_vector[0]; *target != NULL; target++)
-    *(name_ptr++) = (*target)->name;
+    if (target == &bfd_target_vector[0]
+       || *target != bfd_target_vector[0])
+      *name_ptr++ = (*target)->name;
 
+  *name_ptr = NULL;
   return name_list;
 }
 
index 6a77c2a2dcd62f487a927ad8990e6096c4ee8dc0..09b1f04dec29aacfe4c8d0e11f3a804b54608850 100644 (file)
@@ -1 +1,3 @@
-#define BFD_VERSION_DATE 20020930
+#define BFD_VERSION_DATE 20021103
+#define BFD_VERSION @bfd_version@
+#define BFD_VERSION_STRING @bfd_version_string@
index fa8af97305503b679a37e8488e1312555311153a..fbeb42e4eb342bbb720ec2391d93ebbe119ec728 100644 (file)
@@ -25,6 +25,7 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "bfd.h"
+#include "bfdver.h"
 #include "sysdep.h"
 #include "bfdlink.h"
 #include "safe-ctype.h"
index a869d7d3d6d9838c44a7f85bf7c9e6122a4586c0..e4e4755cddbff26ac8633c46e7a3ed021c253900 100644 (file)
@@ -1986,6 +1986,7 @@ xcoff_link_add_symbols (abfd, info)
                      && h->descriptor == NULL)
                    {
                      struct xcoff_link_hash_entry *hds;
+                     struct bfd_link_hash_entry *bh;
 
                      hds = xcoff_link_hash_lookup (xcoff_hash_table (info),
                                                    h->root.root.string + 1,
@@ -1994,13 +1995,14 @@ xcoff_link_add_symbols (abfd, info)
                        goto error_return;
                      if (hds->root.type == bfd_link_hash_new)
                        {
+                         bh = &hds->root;
                          if (! (_bfd_generic_link_add_one_symbol
                                 (info, abfd, hds->root.root.string,
                                  (flagword) 0, bfd_und_section_ptr,
                                  (bfd_vma) 0, (const char *) NULL, false,
-                                 true,
-                                 (struct bfd_link_hash_entry **) &hds)))
+                                 true, &bh)))
                            goto error_return;
+                         hds = (struct xcoff_link_hash_entry *) bh;
                        }
                      hds->flags |= XCOFF_DESCRIPTOR;
                      BFD_ASSERT ((hds->flags & XCOFF_CALLED) == 0