diff options
Diffstat (limited to 'bfd')
50 files changed, 1624 insertions, 1321 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7e6a412..479674b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,334 @@ +2002-11-15 Kazu Hirata <kazu@cs.umass.edu> + + * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away + jsr after a short jump. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + +2002-11-15 Klee Dienes <kdienes@apple.com> + + * pef.c (bfd_pef_convert_architecture): Move declaration of + ARCH_POWERPC and ARCH_M68K to the start of the function. + +2002-11-14 Svein E. Seldal <Svein.Seldal@solidas.com> + + * coff-tic4x.c (tic4x_howto_table): Formatting fixup + +2002-11-14 Hans-Peter Nilsson <hp@bitrange.com> + + * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): + For bpo_gregs_section->contents, allocate _raw_size, not + _cooked_size. + +2002-11-13 Klee Dienes <kdienes@apple.com> + + * config.bfd: Add entries for powerpc-*-darwin and cousins. + +2002-11-13 H.J. Lu <hjl@gnu.org> + + * elfcode.h (elf_object_p): Don't restore abfd->arch_info. + +2002-11-13 Klee Dienes <kdienes@apple.com> + Alan Modra <amodra@bigpond.net.au> + + * bfd.c (struct bfd_preserve): New. + (bfd_preserve_save): New function. + (bfd_preserve_restore): Ditto. + (bfd_preserve_finish): Ditto. + * bfd-in2.h: Regenerate. + * mach-o.c: Formatting. + (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned. + (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish. + (bfd_mach_o_core_p): Ditto. + (bfd_mach_o_scan): Pass in mdata. + * mach-o.h (bfd_mach_o_scan): Update prototype. + * pef.c: Formatting. + (bfd_pef_object_p): Use bfd_preserve_save/restore/finish. + (bfd_pef_xlib_object_p): Ditto. + (bfd_pef_scan): Pass in mdata. Move version check to bfd_pef_object_p. + * pef.h (bfd_pef_scan): Update prototype. + * xsym.c: Formatting, K&R fixes. + (bfd_sym_object_p): Use bfd_preserve_save/restore/finish. + (bfd_sym_scan): New function split out from bfd_sym_object_p. + * xsym.h (bfd_sym_scan): Declare. + * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish. + * elfcore.h (elf_core_file_p): Likewise. + * targets.c (_bfd_target_vector): Revert 2002-11-08 change. + +2002-11-12 Nick Clifton <nickc@redhat.com> + + * po/da.po: Updated Danish translation. + +2002-11-12 Alan Modra <amodra@bigpond.net.au> + + * elflink.h (elf_link_add_object_symbols): Optimize stabs for + relocatable link too. + (elf_link_input_bfd): When emitting relocs, adjust offsets for + eh_frame and stab sections. Zap deleted relocs. + (elf_reloc_symbol_deleted_p): Return true for zero r_symndx. + (elf_bfd_discard_info): Run for relocatable link too. + * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd. Make global. + Handle ld -r case. + (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here. + * elf64-ppc.h (ppc64_elf_edit_opd): Declare. + + * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c. + (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise. + (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise. + (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR. + (struct eh_frame_hdr_info): Add "hdr_sec", remove "split". + (struct elf_link_hash_table): Add eh_info. + (struct elf_obj_tdata): Change eh_frame_hdr to an asection *. + (_bfd_elf_discard_section_eh_frame): Update prototype. + (_bfd_elf_discard_section_eh_frame_hdr): Likewise. + (_bfd_elf_write_section_eh_frame): Likewise. + (_bfd_elf_write_section_eh_frame_hdr): Likewise. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec" + param. Get "hdr_info" from link hash table. + (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param. Get + header section from link hash table. Save header section to elf_tdata. + (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec". Use + header section from link hash table. Don't alloc hdr_info. Clear + hdr_sec instead of setting "strip". + (_bfd_elf_eh_frame_section_offset): Formatting. + (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param. + Get header section from link hash table. + (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param. + Get header section from link hash table. + * elf.c (map_sections_to_segments): Use cached eh_frame_hdr. + (get_program_header_size): Likewise. + (_bfd_elf_section_offset): Formatting. + * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header + section pointer in link hash table. + (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr + and _bfd_elf_write_section_eh_frame calls. Update comment about + eh_frame entries. + (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and + _bfd_elf_discard_section_eh_frame_hdr calls. Remove "ehdr". + + * po/SRC-POTFILES.in: Regenerate. + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero + relocs for discarded FDEs. Remove dead code. + (_bfd_elf_write_section_eh_frame_hdr): Remove dead code. + * elflink.h (elf_bfd_discard_info): Don't save edited relocs. + Tidy conditions under which stabs are edited. Formatting. + * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows + from discarded relocs. + * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output + section adjustments after testing magic values. + +2002-11-12 Thomas Moestl <tmm@FreeBSD.org> + + * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct + references to large plt symbols. + +2002-11-12 Klee Dienes <kdienes@apple.com> + + * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when + looking for an unused section name. + +2002-11-11 Kazu Hirata <kazu@cs.umass.edu> + + * coff-h8300.c: Fix formatting. + * elf32-h8300.c: Likewise. + * reloc16.c: Likewise. + +2002-11-09 Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com> + + * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output + section when dynamic section unused; _bfd_strip_section_from_output + instead. + +2002-11-08 Alan Modra <amodra@bigpond.net.au> + + * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec + and sym_vec. + + * dwarf2.c: Revert last change. + +2002-11-07 Michal Ludvig <mludvig@suse.cz> + + * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, + _bfd_dwarf2_find_nearest_line): Use + bfd_simple_get_relocated_section_contents() instead of + bfd_get_section_contents(). + * reloc.c (bfd_perform_relocation): Add sanity check. + * simple.c (simple_get_relocated_section_contents): If the section + does not have any relocs associated with it, just return the + unadjusted contents. + +2002-11-07 Hans-Peter Nilsson <hp@axis.com> + + * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOT, + case R_CRIS_32_GOT>: Correct test for filling in constant .got + contents, enabling for a non-DSO, for symbols defined in the + program with --export-dynamic. + +2002-11-07 Alan Modra <amodra@bigpond.net.au> + + * elf64-ppc.c: Comment typo fixes. + (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input. + +2002-11-07 Nick Clifton <nickc@redhat.com> + + * po/da.po: Updated Danish translation. + +2002-11-06 Alexandre Oliva <aoliva@redhat.com> + + * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate + exactly three internal relocs per external reloc. Set reloc_count + to the external reloc count. + +2002-11-06 Klee Dienes <kdienes@apple.com> + + * coff-stgo32.c (stub_bytes): Mark as const. + Fix comment formatting. + +2002-11-06 Klee Dienes <kdienes@apple.com> + + * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and + xsym.lo. + (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c. + (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h + * archures.c (enum bfd_architecture): Add bfd_arch_m98k. + * bfd.c (struct bfd): Add private data for mach-o, pef, and sym. + * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and + sym. + (_bfd_target_vector): Add target vectors for mach-o, pef, and sym. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * xsym.c: New file. Contains support for the Apple/Metrowerks + xSYM debugging format. + * xsym.h: New file. + * pef.c: New file. Contains support for the Apple Code Fragment + Manager Preferred Executable Format + * pef.h: New file. + * pef-traceback.h: New file. Contains support for parsing PowerPC + traceback tables as used by PEF executables (and perhaps other + systems as well). + * mach-o.c: New file. Contains support for the Mach-O object file + format. + * mach-o.h: New file. + * mach-o-target.c: New file. Declares the mach-o targets + themselves. Included three times by mach-o.c; each time with a + different set of macros set. + +2002-11-06 Graeme Peterson <gp@qnx.com> + + * Makefile.am: Remove entries for elf32-qnx.[ch]. + * Makefile.in: Regenerate. + * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec, + ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use + bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. + * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec, + bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec, + and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets. + bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. + * configure: Regenerate. + * elf32-qnx.c: Remove. + * elf32-qnx.h: Remove. + * elf.c: Remove calls to QNX specific set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf32-i386.c: Remove QNX extended bfd support. + * elf32-ppc.c: Remove QNX extended bfd support. + * elf32-sh.c: Remove QNX extended bfd support. + * elfarm-nabi.c: Remove QNX extended bfd support. + * targets.c: Remove qnx vectors. + * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove + (elf_backend_is_contained_by_filepos): Remove. + (elf_backend_copy_private_bfd_data_p): Remove. + * po/SRC-POTFILES.in: Regenerate. + +2002-11-06 David O'Brien <obrien@FreeBSD.org> + Alan Modra <amodra@bigpond.net.au> + + * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of + dynamic relocs against section symbols for the output section vma. + +2002-11-05 Alan Modra <amodra@bigpond.net.au> + + * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn, + t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove. + +2002-11-05 Kaz Kojima <kkojima@rr.iij4u.or.jp> + Alan Modra <amodra@bigpond.net.au> + + * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64 + vectors in target_selvecs. + (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors + in target_selvecs. + (sh-*-netbsdelf*): Likewise. + * configure.in (assocvecs): New variable. Handle assocvecs like + selvecs. + * configure: Regenerate. + * format.c (bfd_check_format_matches): Store bfd_target pointers + in matching_vector instead of target names. Select first target + from bfd_associated_vector that matches a list of ambiguous targets. + * targets.c (_bfd_associated_vector): New array. + (bfd_associated_vector): New variable. + (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec. + * libbfd-in.h (bfd_associated_vector): Declare. + * libbfd.h: Regenerate. + +2002-11-05 Elias Athanasopoulos <eathan@otenet.gr> + + * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is + non-NULL before dereferencing. + +2002-11-04 Kaz Kojima <kkojima@rr.iij4u.or.jp> + + * vms.c (vms_object_p): Restore the start address when returning + NULL. + +2002-11-04 Alan Modra <amodra@bigpond.net.au> + Hans-Peter Nilsson <hp@axis.com> + + * elflink.h (struct elf_final_link_info): Add shndxbuf_size. + (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields. + Set up a larger symshndxbuf, and write it out. Free it on + exit rather than freeing symbuf twice. Correct section index + on output section symbol loop. + (elf_link_output_sym): Accumulate symbol extension section + indices, reallocating symshndxbuf rather than writing it out. + (elf_link_flush_output_syms): Don't flush symshndxbuf. + * elf.c (assign_section_numbers): Init i_shdrp to all zero. + Use bfd_zalloc to clear i_shdrp[0] too. + +2002-11-03 Stephen Clarke <stephen.clarke@earthling.net> + + * elf32-sh64-com.c (sh64_address_in_cranges): Use + _raw_size of cranges section if _cooked_size not yet set. + +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 diff --git a/bfd/Makefile.am b/bfd/Makefile.am index ecd583a..0c1a798 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -233,7 +233,6 @@ BFD32_BACKENDS = \ elf32-or32.lo \ elf32-pj.lo \ elf32-ppc.lo \ - elf32-qnx.lo \ elf32-s390.lo \ elf32-sh.lo \ elf32-sh64.lo \ @@ -267,6 +266,7 @@ BFD32_BACKENDS = \ m68klynx.lo \ m68knetbsd.lo \ m88kmach3.lo \ + mach-o.lo \ mipsbsd.lo \ newsos3.lo \ nlm.lo \ @@ -278,6 +278,7 @@ BFD32_BACKENDS = \ oasys.lo \ pc532-mach.lo \ pdp11.lo \ + pef.lo \ pe-arm.lo \ pei-arm.lo \ pe-i386.lo \ @@ -307,7 +308,8 @@ BFD32_BACKENDS = \ vms-hdr.lo \ vms-misc.lo \ vms-tir.lo \ - xcofflink.lo + xcofflink.lo \ + xsym.lo BFD32_BACKENDS_CFILES = \ aout-adobe.c \ @@ -388,7 +390,6 @@ BFD32_BACKENDS_CFILES = \ elf32-or32.c \ elf32-pj.c \ elf32-ppc.c \ - elf32-qnx.c \ elf32-sh64.c \ elf32-sh64-com.c \ elf32-s390.c \ @@ -422,6 +423,7 @@ BFD32_BACKENDS_CFILES = \ m68klynx.c \ m68knetbsd.c \ m88kmach3.c \ + mach-o.c \ mipsbsd.c \ newsos3.c \ nlm.c \ @@ -433,6 +435,7 @@ BFD32_BACKENDS_CFILES = \ oasys.c \ pc532-mach.c \ pdp11.c \ + pef.c \ pe-arm.c \ pei-arm.c \ pe-i386.c \ @@ -461,7 +464,8 @@ BFD32_BACKENDS_CFILES = \ vms-hdr.c \ vms-misc.c \ vms-tir.c \ - xcofflink.c + xcofflink.c \ + xsym.c # The .o files needed by all of the 64 bit vectors that are configured into # target_vector in targets.c if configured with --enable-targets=all @@ -561,13 +565,14 @@ 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 elf32-qnx.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 libxcoff.h \ + libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \ netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \ - peicode.h som.h version.h vms.h xcoff-target.h + pef.h pef-traceback.h peicode.h som.h version.h \ + vms.h xcoff-target.h xsym.h ## ... and all .h files which are in the build tree. BUILD_HFILES = \ @@ -654,10 +659,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 @@ -1099,7 +1104,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 elf32-qnx.h + elf32-arm.h elf32-target.h elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ @@ -1146,7 +1151,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-qnx.h + elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ @@ -1217,10 +1222,7 @@ 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-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-target.h elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ @@ -1237,7 +1239,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-qnx.h + elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ @@ -1332,6 +1334,8 @@ m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -1363,6 +1367,8 @@ pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ pdp11.lo: pdp11.c $(INCDIR)/filenames.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h $(INCDIR)/safe-ctype.h +pef.lo: pef.c pef.h pef-traceback.h $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ @@ -1455,6 +1461,7 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \ libxcoff.h +xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h aix5ppc-core.lo: aix5ppc-core.c aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index a3a0d40..0104743 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -360,7 +360,6 @@ BFD32_BACKENDS = \ elf32-or32.lo \ elf32-pj.lo \ elf32-ppc.lo \ - elf32-qnx.lo \ elf32-s390.lo \ elf32-sh.lo \ elf32-sh64.lo \ @@ -394,6 +393,7 @@ BFD32_BACKENDS = \ m68klynx.lo \ m68knetbsd.lo \ m88kmach3.lo \ + mach-o.lo \ mipsbsd.lo \ newsos3.lo \ nlm.lo \ @@ -405,6 +405,7 @@ BFD32_BACKENDS = \ oasys.lo \ pc532-mach.lo \ pdp11.lo \ + pef.lo \ pe-arm.lo \ pei-arm.lo \ pe-i386.lo \ @@ -434,7 +435,8 @@ BFD32_BACKENDS = \ vms-hdr.lo \ vms-misc.lo \ vms-tir.lo \ - xcofflink.lo + xcofflink.lo \ + xsym.lo BFD32_BACKENDS_CFILES = \ @@ -516,7 +518,6 @@ BFD32_BACKENDS_CFILES = \ elf32-or32.c \ elf32-pj.c \ elf32-ppc.c \ - elf32-qnx.c \ elf32-sh64.c \ elf32-sh64-com.c \ elf32-s390.c \ @@ -550,6 +551,7 @@ BFD32_BACKENDS_CFILES = \ m68klynx.c \ m68knetbsd.c \ m88kmach3.c \ + mach-o.c \ mipsbsd.c \ newsos3.c \ nlm.c \ @@ -561,6 +563,7 @@ BFD32_BACKENDS_CFILES = \ oasys.c \ pc532-mach.c \ pdp11.c \ + pef.c \ pe-arm.c \ pei-arm.c \ pe-i386.c \ @@ -589,7 +592,8 @@ BFD32_BACKENDS_CFILES = \ vms-hdr.c \ vms-misc.c \ vms-tir.c \ - xcofflink.c + xcofflink.c \ + xsym.c # The .o files needed by all of the 64 bit vectors that are configured into @@ -695,13 +699,14 @@ 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 elf32-qnx.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 libxcoff.h \ + libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \ netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \ - peicode.h som.h version.h vms.h xcoff-target.h + pef.h pef-traceback.h peicode.h som.h version.h \ + vms.h xcoff-target.h xsym.h BUILD_HFILES = \ @@ -780,7 +785,7 @@ configure.in version.h DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES) OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS) @@ -1201,10 +1206,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 @@ -1630,7 +1635,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 elf32-qnx.h + elf32-arm.h elf32-target.h elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ @@ -1677,7 +1682,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-qnx.h + elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ @@ -1748,10 +1753,7 @@ 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-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-target.h elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ @@ -1768,7 +1770,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-qnx.h + elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ @@ -1863,6 +1865,8 @@ m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -1894,6 +1898,8 @@ pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ pdp11.lo: pdp11.c $(INCDIR)/filenames.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h $(INCDIR)/safe-ctype.h +pef.lo: pef.c pef.h pef-traceback.h $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ @@ -1986,6 +1992,7 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \ libxcoff.h +xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h aix5ppc-core.lo: aix5ppc-core.c aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ diff --git a/bfd/archures.c b/bfd/archures.c index 1ab0cfa..485fef2 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -4,21 +4,21 @@ Free Software Foundation, Inc. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -160,6 +160,7 @@ DESCRIPTION . bfd_arch_alliant, {* Alliant *} . bfd_arch_convex, {* Convex *} . bfd_arch_m88k, {* Motorola 88xxx *} +. bfd_arch_m98k, {* Motorola 98xxx *} . bfd_arch_pyramid, {* Pyramid Technology *} . bfd_arch_h8300, {* Hitachi H8/300 *} .#define bfd_mach_h8300 1 diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 018a0fd..8f4a48b 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1551,6 +1551,7 @@ enum bfd_architecture bfd_arch_alliant, /* Alliant */ bfd_arch_convex, /* Convex */ bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_m98k, /* Motorola 98xxx */ bfd_arch_pyramid, /* Pyramid Technology */ bfd_arch_h8300, /* Hitachi H8/300 */ #define bfd_mach_h8300 1 @@ -3533,6 +3534,11 @@ struct _bfd struct cisco_core_struct *cisco_core_data; struct versados_data_struct *versados_data; struct netbsd_core_struct *netbsd_core_data; + struct mach_o_data_struct *mach_o_data; + struct mach_o_fat_data_struct *mach_o_fat_data; + struct bfd_pef_data_struct *pef_data; + struct bfd_pef_xlib_data_struct *pef_xlib_data; + struct bfd_sym_data_struct *sym_data; PTR any; } tdata; @@ -3733,6 +3739,27 @@ extern bfd_byte *bfd_get_relocated_section_contents boolean bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative)); +struct bfd_preserve +{ + PTR marker; + PTR tdata; + flagword flags; + const struct bfd_arch_info *arch_info; + struct sec *sections; + struct sec **section_tail; + unsigned int section_count; + struct bfd_hash_table section_htab; +}; + +boolean +bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *)); + +void +bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *)); + +void +bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *)); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); @@ -3795,7 +3822,11 @@ enum bfd_flavour bfd_target_msdos_flavour, bfd_target_ovax_flavour, bfd_target_evax_flavour, - bfd_target_mmo_flavour + bfd_target_mmo_flavour, + bfd_target_mach_o_flavour, + bfd_target_pef_flavour, + bfd_target_pef_xlib_flavour, + bfd_target_sym_flavour }; enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -4,21 +4,21 @@ Free Software Foundation, Inc. Written by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* SECTION @@ -180,6 +180,11 @@ CODE_FRAGMENT . struct cisco_core_struct *cisco_core_data; . struct versados_data_struct *versados_data; . struct netbsd_core_struct *netbsd_core_data; +. struct mach_o_data_struct *mach_o_data; +. struct mach_o_fat_data_struct *mach_o_fat_data; +. struct bfd_pef_data_struct *pef_data; +. struct bfd_pef_xlib_data_struct *pef_xlib_data; +. struct bfd_sym_data_struct *sym_data; . PTR any; . } . tdata; @@ -1387,3 +1392,133 @@ bfd_alt_mach_code (abfd, alternative) return false; } + +/* +CODE_FRAGMENT + +.struct bfd_preserve +.{ +. PTR marker; +. PTR tdata; +. flagword flags; +. const struct bfd_arch_info *arch_info; +. struct sec *sections; +. struct sec **section_tail; +. unsigned int section_count; +. struct bfd_hash_table section_htab; +.}; +. +*/ + +/* +FUNCTION + bfd_preserve_save + +SYNOPSIS + boolean bfd_preserve_save (bfd *, struct bfd_preserve *); + +DESCRIPTION + When testing an object for compatibility with a particular + target back-end, the back-end object_p function needs to set + up certain fields in the bfd on successfully recognizing the + object. This typically happens in a piecemeal fashion, with + failures possible at many points. On failure, the bfd is + supposed to be restored to its initial state, which is + virtually impossible. However, restoring a subset of the bfd + state works in practice. This function stores the subset and + reinitializes the bfd. + +*/ + +boolean +bfd_preserve_save (abfd, preserve) + bfd *abfd; + struct bfd_preserve *preserve; +{ + preserve->tdata = abfd->tdata.any; + preserve->arch_info = abfd->arch_info; + preserve->flags = abfd->flags; + + preserve->sections = abfd->sections; + preserve->section_tail = abfd->section_tail; + preserve->section_count = abfd->section_count; + preserve->section_htab = abfd->section_htab; + + if (! bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + return false; + + abfd->tdata.any = NULL; + abfd->arch_info = &bfd_default_arch_struct; + abfd->flags = 0; + + abfd->sections = NULL; + abfd->section_tail = &abfd->sections; + abfd->section_count = 0; + + return true; +} + +/* +FUNCTION + bfd_preserve_restore + +SYNOPSIS + void bfd_preserve_restore (bfd *, struct bfd_preserve *); + +DESCRIPTION + This function restores bfd state saved by bfd_preserve_save. + If MARKER is non-NULL in struct bfd_preserve then that block + and all subsequently bfd_alloc'd memory is freed. + +*/ + +void +bfd_preserve_restore (abfd, preserve) + bfd *abfd; + struct bfd_preserve *preserve; +{ + bfd_hash_table_free (&abfd->section_htab); + + abfd->tdata.any = preserve->tdata; + abfd->arch_info = preserve->arch_info; + abfd->flags = preserve->flags; + + abfd->section_htab = preserve->section_htab; + abfd->sections = preserve->sections; + abfd->section_tail = preserve->section_tail; + abfd->section_count = preserve->section_count; + + /* bfd_release frees all memory more recently bfd_alloc'd than + its arg, as well as its arg. */ + if (preserve->marker != NULL) + { + bfd_release (abfd, preserve->marker); + preserve->marker = NULL; + } +} + +/* +FUNCTION + bfd_preserve_finish + +SYNOPSIS + void bfd_preserve_finish (bfd *, struct bfd_preserve *); + +DESCRIPTION + This function should be called when the bfd state saved by + bfd_preserve_save is no longer needed. ie. when the back-end + object_p function returns with success. + +*/ + +void +bfd_preserve_finish (abfd, preserve) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_preserve *preserve; +{ + /* It would be nice to be able to free more memory here, eg. old + tdata, but that's not possible since these blocks are sitting + inside bfd_alloc'd memory. The section hash is on a separate + objalloc. */ + bfd_hash_table_free (&preserve->section_htab); +} diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index 82b7bca..c83015e 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -4,21 +4,21 @@ Free Software Foundation, Inc. Written by Steve Chamberlain, <sac@cygnus.com>. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -87,8 +87,7 @@ static boolean h8300_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info * the generic linker hash table, not the COFF backend linker hash table! We use this to attach additional data structures we need while linking on the h8300. */ -struct h8300_coff_link_hash_table -{ +struct h8300_coff_link_hash_table { /* The main hash table. */ struct generic_link_hash_table root; @@ -135,7 +134,7 @@ funcvec_hash_newfunc (entry, gen_table, string) /* Call the allocation method of the superclass. */ ret = ((struct funcvec_hash_entry *) - bfd_hash_newfunc ((struct bfd_hash_entry *) ret, gen_table, string)); + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, gen_table, string)); if (ret == NULL) return NULL; @@ -165,8 +164,8 @@ funcvec_hash_table_init (table, abfd, newfunc) struct funcvec_hash_table *table; bfd *abfd; struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); + struct bfd_hash_table *, + const char *)); { /* Initialize our local fields, then call the generic initialization routine. */ @@ -232,8 +231,7 @@ special (abfd, reloc_entry, symbol, data, input_section, output_bfd, return bfd_reloc_ok; } -static reloc_howto_type howto_table[] = -{ +static reloc_howto_type howto_table[] = { HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, special, "8", false, 0x000000ff, 0x000000ff, false), HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, special, "16", false, 0x0000ffff, 0x0000ffff, false), HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, special, "32", false, 0xffffffff, 0xffffffff, false), @@ -270,9 +268,9 @@ static reloc_howto_type howto_table[] = /* Turn a howto into a reloc number. */ #define SELECT_RELOC(x,howto) \ - { x.r_type = select_reloc(howto); } + { x.r_type = select_reloc (howto); } -#define BADMAG(x) (H8300BADMAG(x) && H8300HBADMAG(x) && H8300SBADMAG(x)) +#define BADMAG(x) (H8300BADMAG (x) && H8300HBADMAG (x) && H8300SBADMAG (x)) #define H8300 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ @@ -365,15 +363,15 @@ rtype2howto (internal, dst) } } -#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) +#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry) /* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ - cache_ptr->addend = ext_reloc.r_offset; + cache_ptr->addend = ext_reloc.r_offset; #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ - reloc_processing(relent, reloc, symbols, abfd, section) + reloc_processing (relent, reloc, symbols, abfd, section) static void reloc_processing (relent, reloc, symbols, abfd, section) @@ -483,8 +481,15 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) /* If the distance is within -128..+128 inclusive, then we can relax this jump. +128 is valid since the target will move two bytes closer if we do relax this branch. */ - if ((int)gap >= -128 && (int)gap <= 128 ) + if ((int) gap >= -128 && (int) gap <= 128) { + bfd_byte code; + + if (!bfd_get_section_contents (abfd, input_section, & code, + reloc->address, 1)) + break; + code = bfd_get_8 (abfd, & code); + /* It's possible we may be able to eliminate this branch entirely; if the previous instruction is a branch around this instruction, and there's no label at this instruction, then we can reverse @@ -496,9 +501,25 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) lab1: lab1: This saves 4 bytes instead of two, and should be relatively - common. */ - - if (gap <= 126 + common. + + Only perform this optimisation for jumps (code 0x5a) not + subroutine calls, as otherwise it could transform: + + mov.w r0,r0 + beq .L1 + jsr @_bar + .L1: rts + _bar: rts + into: + mov.w r0,r0 + bne _bar + rts + _bar: rts + + which changes the call (jsr) into a branch (bne). */ + if (code == 0x5a + && gap <= 126 && last_reloc && last_reloc->howto->type == R_PCRBYTE) { @@ -546,7 +567,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) /* If the distance is within -128..+128 inclusive, then we can relax this jump. +128 is valid since the target will move two bytes closer if we do relax this branch. */ - if ((int)gap >= -128 && (int)gap <= 128 ) + if ((int) gap >= -128 && (int) gap <= 128) { /* Change the reloc type. */ reloc->howto = howto_table + 15; @@ -736,7 +757,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, /* Sanity check. */ if (value <= 0xff || (value >= 0x0000ff00 && value <= 0x0000ffff) - || (value >= 0x00ffff00 && value <= 0x00ffffff) + || (value >= 0x00ffff00 && value <= 0x00ffffff) || (value >= 0xffffff00 && value <= 0xffffffff)) { /* Everything looks OK. Apply the relocation and update the @@ -804,7 +825,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, /* Fix the opcode. For all the move insns, we simply need to turn off bit 0x20 in the previous byte. */ - data[dst_address - 1] &= ~0x20; + data[dst_address - 1] &= ~0x20; dst_address += 2; src_address += 4; } @@ -815,7 +836,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, reloc->howto->name, reloc->addend, input_section->owner, input_section, reloc->address))) abort (); - } + } break; /* A 16bit absolute branch that is now an 8-bit pc-relative branch. */ @@ -912,14 +933,14 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, abort (); } - /* Output the target. */ - bfd_put_8 (abfd, gap, data + dst_address - 1); + /* Output the target. */ + bfd_put_8 (abfd, gap, data + dst_address - 1); - /* We don't advance dst_address -- the 8bit reloc is applied at - dst_address - 1, so the next insn should begin at dst_address. */ - src_address += 2; + /* We don't advance dst_address -- the 8bit reloc is applied at + dst_address - 1, so the next insn should begin at dst_address. */ + src_address += 2; - break; + break; /* Similarly for a 24bit absolute that is now 8 bits. */ case R_JMPL2: diff --git a/bfd/coff-stgo32.c b/bfd/coff-stgo32.c index 5d867ea..5c80b11 100644 --- a/bfd/coff-stgo32.c +++ b/bfd/coff-stgo32.c @@ -32,8 +32,7 @@ image and NOT in the file. To be compatible with any existing executables I have fixed this - here and NOT in the DJGPP startup code. - */ + here and NOT in the DJGPP startup code. */ #define TARGET_SYM go32stubbedcoff_vec #define TARGET_NAME "coff-go32-exe" @@ -55,40 +54,32 @@ #include "bfd.h" -/* At first the prototypes */ +/* At first the prototypes. */ static void -adjust_filehdr_in_post PARAMS ((bfd * abfd, PTR src, PTR dst)); +adjust_filehdr_in_post PARAMS ((bfd *, PTR, PTR)); static void -adjust_filehdr_out_pre PARAMS ((bfd * abfd, PTR in, PTR out)); +adjust_filehdr_out_pre PARAMS ((bfd *, PTR, PTR)); static void -adjust_filehdr_out_post PARAMS ((bfd * abfd, PTR in, PTR out)); - +adjust_filehdr_out_post PARAMS ((bfd *, PTR, PTR)); static void -adjust_scnhdr_in_post PARAMS ((bfd * abfd, PTR ext, PTR in)); +adjust_scnhdr_in_post PARAMS ((bfd *, PTR, PTR)); static void -adjust_scnhdr_out_pre PARAMS ((bfd * abfd, PTR in, PTR out)); +adjust_scnhdr_out_pre PARAMS ((bfd *, PTR, PTR)); static void -adjust_scnhdr_out_post PARAMS ((bfd * abfd, PTR in, PTR out)); - +adjust_scnhdr_out_post PARAMS ((bfd *, PTR, PTR)); static void -adjust_aux_in_post PARAMS ((bfd * abfd, PTR ext1, int type, int class, int indx, - int numaux, PTR in1)); +adjust_aux_in_post PARAMS ((bfd *, PTR, int, int, int, int, PTR)); static void -adjust_aux_out_pre PARAMS ((bfd * abfd, PTR inp, int type, int class, int indx, - int numaux, PTR extp)); +adjust_aux_out_pre PARAMS ((bfd *, PTR, int, int, int, int, PTR)); static void -adjust_aux_out_post PARAMS ((bfd * abfd, PTR inp, int type, int class, int indx, - int numaux, PTR extp)); - +adjust_aux_out_post PARAMS ((bfd *, PTR, int, int, int, int, PTR)); static void -create_go32_stub PARAMS ((bfd * abfd)); +create_go32_stub PARAMS ((bfd *)); -/* - All that ..._PRE and ...POST functions are called from the corresponding +/* All that ..._PRE and ...POST functions are called from the corresponding coff_swap... functions. The ...PRE functions are called at the beginning - of the function and the ...POST functions at the end of the swap routines. - */ + of the function and the ...POST functions at the end of the swap routines. */ #define COFF_ADJUST_FILEHDR_IN_POST adjust_filehdr_in_post #define COFF_ADJUST_FILEHDR_OUT_PRE adjust_filehdr_out_pre @@ -103,23 +94,23 @@ create_go32_stub PARAMS ((bfd * abfd)); #define COFF_ADJUST_AUX_OUT_POST adjust_aux_out_post static boolean - go32_stubbed_coff_bfd_copy_private_bfd_data PARAMS ((bfd * ibfd, bfd * obfd)); + go32_stubbed_coff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); #define coff_bfd_copy_private_bfd_data go32_stubbed_coff_bfd_copy_private_bfd_data #include "coff-i386.c" -/* I hold in the usrdata the stub */ +/* I hold in the usrdata the stub. */ #define bfd_coff_go32stub bfd_usrdata /* This macro is used, because I cannot assume the endianess of the - host system */ + host system. */ #define _H(index) (H_GET_16 (abfd, (header+index*2))) /* These bytes are a 2048-byte DOS executable, which loads the COFF - image into memory and then runs it. It is called 'stub' */ + image into memory and then runs it. It is called 'stub'. */ -static unsigned char stub_bytes[STUBSIZE] = +static const unsigned char stub_bytes[STUBSIZE] = { #include "go32stub.h" }; @@ -129,10 +120,10 @@ static unsigned char stub_bytes[STUBSIZE] = technique is in any function the same. For the ...in function, all the pointers are adjusted by adding STUBSIZE and for the ...out function, it is subtracted first and after calling the - standard swap function it is reset to the old value */ + standard swap function it is reset to the old value. */ /* This macro is used for adjusting the filepointers, which - is done only, if the pointer is nonzero */ + is done only, if the pointer is nonzero. */ #define ADJUST_VAL(val,diff) \ if (val != 0) val += diff @@ -148,13 +139,13 @@ adjust_filehdr_in_post (abfd, src, dst) ADJUST_VAL (filehdr_dst->f_symptr, STUBSIZE); - /* Save now the stub to be used later */ + /* Save now the stub to be used later. */ bfd_coff_go32stub (abfd) = (PTR) bfd_alloc (abfd, (bfd_size_type) STUBSIZE); /* Since this function returns no status, I do not set here any bfd_error_... That means, before the use of bfd_coff_go32stub (), this value - should be checked if it is != NULL */ + should be checked if it is != NULL. */ if (bfd_coff_go32stub (abfd) == NULL) return; memcpy (bfd_coff_go32stub (abfd), filehdr_src->stub, STUBSIZE); @@ -169,14 +160,14 @@ adjust_filehdr_out_pre (abfd, in, out) struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in; FILHDR *filehdr_out = (FILHDR *) out; - /* Generate the stub */ + /* Generate the stub. */ create_go32_stub (abfd); - /* Copy the stub to the file header */ + /* Copy the stub to the file header. */ if (bfd_coff_go32stub (abfd) != NULL) memcpy (filehdr_out->stub, bfd_coff_go32stub (abfd), STUBSIZE); else - /* use the default */ + /* Use the default. */ memcpy (filehdr_out->stub, stub_bytes, STUBSIZE); ADJUST_VAL (filehdr_in->f_symptr, -STUBSIZE); @@ -189,7 +180,7 @@ adjust_filehdr_out_post (abfd, in, out) PTR out ATTRIBUTE_UNUSED; { struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in; - /* undo the above change */ + /* Undo the above change. */ ADJUST_VAL (filehdr_in->f_symptr, STUBSIZE); } @@ -286,8 +277,7 @@ adjust_aux_out_post (abfd, inp, type, class, indx, numaux, extp) } } -/* - That's the function, which creates the stub. There are +/* That's the function, which creates the stub. There are different cases from where the stub is taken. At first the environment variable $(GO32STUB) is checked and then $(STUB) if it was not set. @@ -297,14 +287,13 @@ adjust_aux_out_post (abfd, inp, type, class, indx, numaux, extp) file. If there was any error, the standard stub (compiled in this file) - is taken. - */ + is taken. */ static void create_go32_stub (abfd) bfd *abfd; { - /* Do it only once */ + /* Do it only once. */ if (bfd_coff_go32stub (abfd) == NULL) { char *stub; @@ -315,9 +304,9 @@ create_go32_stub (abfd) unsigned long coff_start; long exe_start; - /* Check at first the environment variable $(GO32STUB) */ + /* Check at first the environment variable $(GO32STUB). */ stub = getenv ("GO32STUB"); - /* Now check the environment variable $(STUB) */ + /* Now check the environment variable $(STUB). */ if (stub == NULL) stub = getenv ("STUB"); if (stub == NULL) @@ -336,19 +325,19 @@ create_go32_stub (abfd) close (f); goto stub_end; } - if (_H (0) != 0x5a4d) /* it is not an exe file */ + if (_H (0) != 0x5a4d) /* It is not an exe file. */ { close (f); goto stub_end; } /* Compute the size of the stub (it is every thing up - to the beginning of the coff image) */ + to the beginning of the coff image). */ coff_start = (long) _H (2) * 512L; if (_H (1)) coff_start += (long) _H (1) - 512L; /* Currently there is only a fixed stub size of 2048 bytes - supported */ + supported. */ if (coff_start != 2048) { close (f); @@ -370,7 +359,7 @@ create_go32_stub (abfd) close (f); goto stub_end; } - /* Now we found a correct stub (hopefully) */ + /* Now we found a correct stub (hopefully). */ bfd_coff_go32stub (abfd) = (PTR) bfd_alloc (abfd, (bfd_size_type) coff_start); if (bfd_coff_go32stub (abfd) == NULL) @@ -389,39 +378,35 @@ create_go32_stub (abfd) } stub_end: /* There was something wrong above, so use now the standard builtin - stub */ + stub. */ if (bfd_coff_go32stub (abfd) == NULL) { bfd_coff_go32stub (abfd) = (PTR) bfd_alloc (abfd, (bfd_size_type) STUBSIZE); if (bfd_coff_go32stub (abfd) == NULL) - { - return; - } - + return; memcpy (bfd_coff_go32stub (abfd), stub_bytes, STUBSIZE); } } /* If ibfd was a stubbed coff image, copy the stub from that bfd - to the new obfd. - */ + to the new obfd. */ static boolean go32_stubbed_coff_bfd_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; { - /* check if both are the same targets */ + /* Check if both are the same targets. */ if (ibfd->xvec != obfd->xvec) return true; - /* check if both have a valid stub */ + /* Check if both have a valid stub. */ if (bfd_coff_go32stub (ibfd) == NULL || bfd_coff_go32stub (obfd) == NULL) return true; - /* Now copy the stub */ + /* Now copy the stub. */ memcpy (bfd_coff_go32stub (obfd), bfd_coff_go32stub (ibfd), STUBSIZE); return true; diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c index 561d161..8afd04a 100644 --- a/bfd/coff-tic4x.c +++ b/bfd/coff-tic4x.c @@ -123,20 +123,20 @@ tic4x_relocation (abfd, reloc_entry, symbol, data, input_section, reloc_howto_type tic4x_howto_table[] = { - HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "RELWORD", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "RELWORD", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_bitfield, tic4x_relocation, "REL24", true, 0x00ffffff, 0x00ffffff, false), - HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_dont, tic4x_relocation, "RELLONG", true, 0xffffffff, 0xffffffff, false), - HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "PCRWORD", true, 0x0000ffff, 0x0000ffff, false), - HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "PCR24", true, 0x00ffffff, 0x00ffffff, false), - HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTLS16", true, 0x0000ffff, 0x0000ffff, false), - HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTMS8", true, 0x0000ffff, 0x0000ffff, false), - HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "ARELWORD", true, 0x0000ffff, 0x0000ffff, false), - HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_signed, tic4x_relocation, "AREL24", true, 0x00ffffff, 0x00ffffff, false), - HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_signed, tic4x_relocation, "ARELLONG", true, 0xffffffff, 0xffffffff, false), - HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "APCRWORD", true, 0x0000ffff, 0x0000ffff, false), - HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "APCR24", true, 0x00ffffff, 0x00ffffff, false), - HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTLS16", true, 0x0000ffff, 0x0000ffff, false), - HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTMS8", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_dont, tic4x_relocation, "RELLONG", true, 0xffffffff, 0xffffffff, false), + HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "PCRWORD", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "PCR24", true, 0x00ffffff, 0x00ffffff, false), + HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTLS16", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTMS8", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "ARELWORD", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_signed, tic4x_relocation, "AREL24", true, 0x00ffffff, 0x00ffffff, false), + HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_signed, tic4x_relocation, "ARELLONG", true, 0xffffffff, 0xffffffff, false), + HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "APCRWORD", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "APCR24", true, 0x00ffffff, 0x00ffffff, false), + HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTLS16", true, 0x0000ffff, 0x0000ffff, false), + HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTMS8", true, 0x0000ffff, 0x0000ffff, false), }; #define HOWTO_SIZE (sizeof(tic4x_howto_table) / sizeof(tic4x_howto_table[0])) diff --git a/bfd/coffcode.h b/bfd/coffcode.h index e47b4d0..694fb12 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -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 *)); . diff --git a/bfd/config.bfd b/bfd/config.bfd index fdc7bbe..9270d7e 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -139,8 +139,8 @@ case "${targ}" in targ_underscore=yes ;; arm-*-nto* | nto*arm*) - targ_defvec=bfd_elf32_littlearmqnx_vec - targ_selvecs=bfd_elf32_bigarmqnx_vec + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec ;; arm-*-riscix*) targ_defvec=riscix_vec @@ -370,8 +370,8 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; - i[3456]86-*-nto-qnx*) - targ_defvec=bfd_elf32_i386qnx_vec + i[3456]86-*-nto*) + targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; i[3456]86-*-chorus*) @@ -393,6 +393,11 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386coff_vec i386aout_vec" ;; + i[3456]86-*-darwin* | i[3456]86-*-macos10* | i[3456]86-*-rhapsody*) + targ_defvec=mach_o_le_vec + targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" + targ_archs="bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch" + ;; i[3456]86-sequent-bsd*) targ_defvec=i386dynix_vec targ_underscore=yes @@ -691,11 +696,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 @@ -885,6 +890,11 @@ case "${targ}" in targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; + powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*) + targ_defvec=mach_o_be_vec + targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" + targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch" + ;; powerpc-*-macos* | powerpc-*-mpw*) targ_defvec=pmac_xcoff_vec ;; @@ -893,12 +903,12 @@ case "${targ}" in targ_selvecs="nlm32_powerpc_vec rs6000coff_vec" ;; powerpc-*-nto*) - targ_defvec=bfd_elf32_powerpcqnx_vec - targ_selvecs="rs6000coff_vec bfd_elf32_powerpcleqnx_vec ppcboot_vec" + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" ;; powerpcle-*-nto*) - targ_defvec=bfd_elf32_powerpcleqnx_vec - targ_selvecs="rs6000coff_vec bfd_elf32_powerpcqnx_vec ppcboot_vec" + targ_defvec=bfd_elf32_powerpcle_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" ;; powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ @@ -949,7 +959,7 @@ case "${targ}" in targ_defvec=bfd_elf32_shblin_vec targ_selvecs=bfd_elf32_shlin_vec #ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" #endif ;; sh*eb-*-linux*) @@ -985,7 +995,7 @@ case "${targ}" in targ_defvec=bfd_elf32_shlnbsd_vec targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" #ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" #endif ;; sh*le-*-netbsdelf*) @@ -996,7 +1006,7 @@ case "${targ}" in targ_defvec=bfd_elf32_shnbsd_vec targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" #ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" #endif ;; sh*-*-netbsdelf*) @@ -1021,8 +1031,8 @@ case "${targ}" in targ_underscore=yes ;; sh-*-nto*) - targ_defvec=bfd_elf32_shqnx_vec - targ_selvecs="bfd_elf32_shlqnx_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" + targ_defvec=bfd_elf32_sh_vec + targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" targ_underscore=yes ;; sh-*-pe) diff --git a/bfd/configure b/bfd/configure index 794cb62..6eb4abb 100755 --- a/bfd/configure +++ b/bfd/configure @@ -5975,12 +5975,14 @@ fi all_targets=false defvec= selvecs= +assocvecs= selarchs= TDEFINES= for targ in $target $canon_targets do if test "x$targ" = "xall"; then all_targets=true + assocvecs="$assocvecs $targ_defvec $targ_selvecs" else . $srcdir/config.bfd if test "x$targ" = "x$target"; then @@ -6011,6 +6013,17 @@ done selvecs="$f" +# uniq the associated vectors in all the configured targets. +f="" +for i in $assocvecs ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +assocvecs="$f" + + # uniq the architectures in all the configured targets. f="" for i in $selarchs ; do @@ -6061,8 +6074,7 @@ 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-qnx.lo elf32.lo $elf" ;; - bfd_elf32_bigarmqnx_vec) tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; @@ -6074,9 +6086,8 @@ 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.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_i386_freebsd_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; + bfd_elf32_i386_vec) tb="$tb elf32-i386.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" ;; @@ -6086,8 +6097,7 @@ 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-qnx.lo elf32.lo $elf" ;; - bfd_elf32_littlearmqnx_vec) tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; @@ -6106,10 +6116,8 @@ 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-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_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; # FIXME: We include cofflink.lo not because it's needed for # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec @@ -6120,14 +6128,12 @@ do 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_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.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.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo 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" ;; @@ -6320,9 +6326,12 @@ if test x${all_targets} = xtrue ; then selvecs= havevecs= selarchs= + test -n "$assocvecs" && + assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` else # all_targets is true # Only set these if they will be nonempty, for the clever echo. havevecs= + assocvecs= test -n "$selvecs" && havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'` test -n "$selvecs" && @@ -6343,10 +6352,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:6347: checking for gcc version with buggy 64-bit support" >&5 +echo "configure:6356: 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 6350 "configure" +#line 6359 "configure" #include "confdefs.h" :__GNUC__:__GNUC_MINOR__:__i386__: EOF @@ -6383,6 +6392,7 @@ esac tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" +test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'" test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}" @@ -6391,17 +6401,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:6395: checking for $ac_hdr" >&5 +echo "configure:6405: 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 6400 "configure" +#line 6410 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6415: \"$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* @@ -6430,12 +6440,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6434: checking for $ac_func" >&5 +echo "configure:6444: 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 6439 "configure" +#line 6449 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6458,7 +6468,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6472: \"$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 @@ -6483,7 +6493,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6487: checking for working mmap" >&5 +echo "configure:6497: 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 @@ -6491,7 +6501,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 6495 "configure" +#line 6505 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -6644,7 +6654,7 @@ main() } EOF -if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6658: \"$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 @@ -6669,12 +6679,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6673: checking for $ac_func" >&5 +echo "configure:6683: 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 6678 "configure" +#line 6688 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6697,7 +6707,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/bfd/configure.in b/bfd/configure.in index b59089d..cb39e8f 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -471,12 +471,14 @@ fi all_targets=false defvec= selvecs= +assocvecs= selarchs= TDEFINES= for targ in $target $canon_targets do if test "x$targ" = "xall"; then all_targets=true + assocvecs="$assocvecs $targ_defvec $targ_selvecs" else . $srcdir/config.bfd if test "x$targ" = "x$target"; then @@ -507,6 +509,17 @@ done selvecs="$f" +# uniq the associated vectors in all the configured targets. +f="" +for i in $assocvecs ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +assocvecs="$f" + + # uniq the architectures in all the configured targets. f="" for i in $selarchs ; do @@ -557,8 +570,7 @@ 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-qnx.lo elf32.lo $elf" ;; - bfd_elf32_bigarmqnx_vec) tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;; + bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; @@ -570,9 +582,8 @@ 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.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_i386_freebsd_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; + bfd_elf32_i386_vec) tb="$tb elf32-i386.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" ;; @@ -582,8 +593,7 @@ 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-qnx.lo elf32.lo $elf" ;; - bfd_elf32_littlearmqnx_vec) tb="$tb elfarm-nabi.lo elf32-qnx.lo elf32.lo $elf" ;; + bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; @@ -602,10 +612,8 @@ 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-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_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; + bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_s390_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; # FIXME: We include cofflink.lo not because it's needed for # bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec @@ -616,14 +624,12 @@ do 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_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.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.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo 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" ;; @@ -816,9 +822,12 @@ if test x${all_targets} = xtrue ; then selvecs= havevecs= selarchs= + test -n "$assocvecs" && + assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` else # all_targets is true # Only set these if they will be nonempty, for the clever echo. havevecs= + assocvecs= test -n "$selvecs" && havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'` test -n "$selvecs" && @@ -866,6 +875,7 @@ AC_SUBST(bfd_default_target_size) tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" +test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'" test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}" AC_SUBST(tdefaults) diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index d25bbf2..ec09ffb 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -245,7 +245,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index dcccc48..2fae2b4 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -235,11 +235,79 @@ enum elf_link_info_type ELF_INFO_TYPE_STABS, ELF_INFO_TYPE_MERGE, ELF_INFO_TYPE_EH_FRAME, - ELF_INFO_TYPE_EH_FRAME_HDR, ELF_INFO_TYPE_JUST_SYMS, ELF_INFO_TYPE_LAST }; +/* Structures used by the eh_frame optimization code. */ +struct cie_header +{ + unsigned int length; + unsigned int id; +}; + +struct cie +{ + struct cie_header hdr; + unsigned char version; + unsigned char augmentation[20]; + unsigned int code_align; + int data_align; + unsigned int ra_column; + unsigned int augmentation_size; + struct elf_link_hash_entry *personality; + unsigned char per_encoding; + unsigned char lsda_encoding; + unsigned char fde_encoding; + unsigned char initial_insn_length; + unsigned char make_relative; + unsigned char make_lsda_relative; + unsigned char initial_instructions[50]; +}; + +struct eh_cie_fde +{ + unsigned int offset; + unsigned int size; + asection *sec; + unsigned int new_offset; + unsigned char fde_encoding; + unsigned char lsda_encoding; + unsigned char lsda_offset; + unsigned char cie : 1; + unsigned char removed : 1; + unsigned char make_relative : 1; + unsigned char make_lsda_relative : 1; + unsigned char per_encoding_relative : 1; +}; + +struct eh_frame_sec_info +{ + unsigned int count; + unsigned int alloced; + struct eh_cie_fde entry[1]; +}; + +struct eh_frame_array_ent +{ + bfd_vma initial_loc; + bfd_vma fde; +}; + +struct eh_frame_hdr_info +{ + struct cie last_cie; + asection *last_cie_sec; + asection *hdr_sec; + unsigned int last_cie_offset; + unsigned int fde_count, array_count; + struct eh_frame_array_ent *array; + /* TRUE if .eh_frame_hdr should contain the sorted search table. + We build it if we successfully read all .eh_frame input sections + and recognize them. */ + boolean table; +}; + /* Cached start, size and alignment of PT_TLS segment. */ struct elf_link_tls_segment { @@ -294,6 +362,9 @@ struct elf_link_hash_table /* A pointer to information used to merge SEC_MERGE sections. */ PTR merge_info; + /* Used by eh_frame code when editing .eh_frame. */ + struct eh_frame_hdr_info eh_info; + /* A linked list of local symbols to be added to .dynsym. */ struct elf_link_local_dynamic_entry *dynlocal; @@ -770,22 +841,6 @@ struct elf_backend_data boolean (*elf_backend_write_section) PARAMS ((bfd *, asection *, bfd_byte *)); - /* This function, if defined, sets up the file positions for non PT_LOAD - segments, especially for segments containing non-allocated sections. */ - void (*set_nonloadable_filepos) - PARAMS ((bfd *, Elf_Internal_Phdr *)); - - /* This function, if defined, returns true if the section is contained - within the segment. File positions are compared. */ - boolean (*is_contained_by_filepos) - PARAMS ((asection *, Elf_Internal_Phdr *)); - - /* This function, if defined, returns true if copy_private_bfd_data - should be called. It provides a way of overriding default - test conditions in _bfd_elf_copy_private_section_data. */ - boolean (*copy_private_bfd_data_p) - PARAMS ((bfd *, asection *, bfd *, asection *)); - /* The level of IRIX compatibility we're striving for. MIPS ELF specific function. */ irix_compat_t (*elf_backend_mips_irix_compat) @@ -1134,12 +1189,12 @@ struct elf_obj_tdata include this field for a MIPS ELF target. */ asection **local_stubs; - /* Used to determine if the e_flags field has been initialized */ - boolean flags_init; - /* Used to determine if PT_GNU_EH_FRAME segment header should be created. */ - boolean eh_frame_hdr; + asection *eh_frame_hdr; + + /* Used to determine if the e_flags field has been initialized */ + boolean flags_init; /* Number of symbol version definitions we are about to emit. */ unsigned int cverdefs; @@ -1382,16 +1437,16 @@ extern void _bfd_elf_strtab_finalize PARAMS ((struct elf_strtab_hash *)); extern boolean _bfd_elf_discard_section_eh_frame - PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, + PARAMS ((bfd *, struct bfd_link_info *, asection *, boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *)); extern boolean _bfd_elf_discard_section_eh_frame_hdr - PARAMS ((bfd *, struct bfd_link_info *, asection *)); + PARAMS ((bfd *, struct bfd_link_info *)); extern bfd_vma _bfd_elf_eh_frame_section_offset PARAMS ((bfd *, asection *, bfd_vma)); extern boolean _bfd_elf_write_section_eh_frame - PARAMS ((bfd *, asection *, asection *, bfd_byte *)); + PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_byte *)); extern boolean _bfd_elf_write_section_eh_frame_hdr - PARAMS ((bfd *, asection *)); + PARAMS ((bfd *, struct bfd_link_info *)); extern boolean _bfd_elf_maybe_strip_eh_frame_hdr PARAMS ((struct bfd_link_info *)); diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index e80fc6c..fa152ab 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -26,74 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define EH_FRAME_HDR_SIZE 8 -struct cie_header -{ - unsigned int length; - unsigned int id; -}; - -struct cie -{ - struct cie_header hdr; - unsigned char version; - unsigned char augmentation[20]; - unsigned int code_align; - int data_align; - unsigned int ra_column; - unsigned int augmentation_size; - struct elf_link_hash_entry *personality; - unsigned char per_encoding; - unsigned char lsda_encoding; - unsigned char fde_encoding; - unsigned char initial_insn_length; - unsigned char make_relative; - unsigned char make_lsda_relative; - unsigned char initial_instructions[50]; -}; - -struct eh_cie_fde -{ - unsigned int offset; - unsigned int size; - asection *sec; - unsigned int new_offset; - unsigned char fde_encoding; - unsigned char lsda_encoding; - unsigned char lsda_offset; - unsigned char cie : 1; - unsigned char removed : 1; - unsigned char make_relative : 1; - unsigned char make_lsda_relative : 1; - unsigned char per_encoding_relative : 1; -}; - -struct eh_frame_sec_info -{ - unsigned int count; - unsigned int alloced; - struct eh_cie_fde entry[1]; -}; - -struct eh_frame_array_ent -{ - bfd_vma initial_loc; - bfd_vma fde; -}; - -struct eh_frame_hdr_info -{ - struct cie last_cie; - asection *last_cie_sec; - unsigned int last_cie_offset; - unsigned int fde_count, array_count; - struct eh_frame_array_ent *array; - /* TRUE if .eh_frame_hdr should contain the sorted search table. - We build it if we successfully read all .eh_frame input sections - and recognize them. */ - boolean table; - boolean strip; -}; - static bfd_vma read_unsigned_leb128 PARAMS ((bfd *, char *, unsigned int *)); static bfd_signed_vma read_signed_leb128 @@ -282,11 +214,11 @@ int cie_compare (c1, c2) deleted. */ boolean -_bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, +_bfd_elf_discard_section_eh_frame (abfd, info, sec, reloc_symbol_deleted_p, cookie) bfd *abfd; struct bfd_link_info *info; - asection *sec, *ehdrsec; + asection *sec; boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR)); struct elf_reloc_cookie *cookie; { @@ -294,12 +226,12 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, bfd_byte *last_cie, *last_fde; struct cie_header hdr; struct cie cie; + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; struct eh_frame_sec_info *sec_info = NULL; unsigned int leb128_tmp; unsigned int cie_usage_count, last_cie_ndx, i, offset; unsigned int make_relative, make_lsda_relative; - Elf_Internal_Rela *rel; bfd_size_type new_size; unsigned int ptr_size; @@ -317,10 +249,8 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, return false; } - BFD_ASSERT (elf_section_data (ehdrsec)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR); - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (ehdrsec)->sec_info; + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; /* Read the frame unwind information from abfd. */ @@ -414,7 +344,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; @@ -555,10 +485,9 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, + ((buf - ehbuf + per_width - 1) & ~((bfd_size_type) per_width - 1))); ENSURE_NO_RELOCS (buf); - rel = GET_RELOC (buf); /* Ensure we have a reloc here, against a global symbol. */ - if (rel != NULL) + if (GET_RELOC (buf) != NULL) { unsigned long r_symndx; @@ -626,8 +555,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, goto free_no_table; ENSURE_NO_RELOCS (buf); - rel = GET_RELOC (buf); - if (rel == NULL) + if (GET_RELOC (buf) == NULL) /* This should not happen. */ goto free_no_table; if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie)) @@ -636,7 +564,6 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, be deleted. */ new_size -= hdr.length + 4; sec_info->entry[sec_info->count].removed = 1; - memset (rel, 0, sizeof (*rel)); } else { @@ -654,7 +581,6 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, cie_usage_count++; hdr_info->fde_count++; } - cookie->rel = rel; if (cie.lsda_encoding != DW_EH_PE_omit) { unsigned int dummy; @@ -745,36 +671,27 @@ free_no_table: input sections. It finalizes the size of .eh_frame_hdr section. */ boolean -_bfd_elf_discard_section_eh_frame_hdr (abfd, info, sec) +_bfd_elf_discard_section_eh_frame_hdr (abfd, info) bfd *abfd; struct bfd_link_info *info; - asection *sec; { + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; - unsigned int ptr_size; - - ptr_size = (elf_elfheader (abfd)->e_ident[EI_CLASS] - == ELFCLASS64) ? 8 : 4; - - if ((elf_section_data (sec)->sec_info_type - != ELF_INFO_TYPE_EH_FRAME_HDR) - || ! info->eh_frame_hdr) - { - _bfd_strip_section_from_output (info, sec); - return false; - } + asection *sec; - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (sec)->sec_info; - if (hdr_info->strip) + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + sec = hdr_info->hdr_sec; + if (sec == NULL) return false; + sec->_cooked_size = EH_FRAME_HDR_SIZE; if (hdr_info->table) sec->_cooked_size += 4 + hdr_info->fde_count * 8; /* Request program headers to be recalculated. */ elf_tdata (abfd)->program_header_size = 0; - elf_tdata (abfd)->eh_frame_hdr = true; + elf_tdata (abfd)->eh_frame_hdr = sec; return true; } @@ -787,21 +704,21 @@ boolean _bfd_elf_maybe_strip_eh_frame_hdr (info) struct bfd_link_info *info; { - asection *sec, *o; + asection *o; bfd *abfd; + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; - sec = bfd_get_section_by_name (elf_hash_table (info)->dynobj, ".eh_frame_hdr"); - if (sec == NULL || bfd_is_abs_section (sec->output_section)) + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + if (hdr_info->hdr_sec == NULL) return true; - hdr_info - = bfd_zmalloc (sizeof (struct eh_frame_hdr_info)); - if (hdr_info == NULL) - return false; - - elf_section_data (sec)->sec_info = hdr_info; - elf_section_data (sec)->sec_info_type = ELF_INFO_TYPE_EH_FRAME_HDR; + if (bfd_is_abs_section (hdr_info->hdr_sec->output_section)) + { + hdr_info->hdr_sec = NULL; + return true; + } abfd = NULL; if (info->eh_frame_hdr) @@ -816,11 +733,12 @@ _bfd_elf_maybe_strip_eh_frame_hdr (info) if (abfd == NULL) { - _bfd_strip_section_from_output (info, sec); - hdr_info->strip = true; + _bfd_strip_section_from_output (info, hdr_info->hdr_sec); + hdr_info->hdr_sec = NULL; + return true; } - else - hdr_info->table = true; + + hdr_info->table = true; return true; } @@ -878,9 +796,8 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) for run-time relocation against LSDA field. */ if (sec_info->entry[mid].make_lsda_relative && ! sec_info->entry[mid].cie - && (offset - == (sec_info->entry[mid].offset + 8 - + sec_info->entry[mid].lsda_offset))) + && (offset == (sec_info->entry[mid].offset + 8 + + sec_info->entry[mid].lsda_offset))) return (bfd_vma) -2; return (offset + sec_info->entry[mid].new_offset @@ -891,12 +808,14 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) contents. */ boolean -_bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) +_bfd_elf_write_section_eh_frame (abfd, info, sec, contents) bfd *abfd; - asection *sec, *ehdrsec; + struct bfd_link_info *info; + asection *sec; bfd_byte *contents; { struct eh_frame_sec_info *sec_info; + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; unsigned int i; bfd_byte *p, *buf; @@ -914,19 +833,13 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) sec->_raw_size); sec_info = (struct eh_frame_sec_info *) elf_section_data (sec)->sec_info; - hdr_info = NULL; - if (ehdrsec - && (elf_section_data (ehdrsec)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR)) - { - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (ehdrsec)->sec_info; - if (hdr_info->table && hdr_info->array == NULL) - hdr_info->array - = bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array)); - if (hdr_info->array == NULL) - hdr_info = NULL; - } + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + if (hdr_info->table && hdr_info->array == NULL) + hdr_info->array + = bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array)); + if (hdr_info->array == NULL) + hdr_info = NULL; p = contents; for (i = 0; i < sec_info->count; ++i) @@ -1174,24 +1087,21 @@ vma_compare (a, b) sorted by increasing initial_loc) */ boolean -_bfd_elf_write_section_eh_frame_hdr (abfd, sec) +_bfd_elf_write_section_eh_frame_hdr (abfd, info) bfd *abfd; - asection *sec; + struct bfd_link_info *info; { + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; - unsigned int ptr_size; + asection *sec; bfd_byte *contents; asection *eh_frame_sec; bfd_size_type size; - ptr_size = (elf_elfheader (sec->owner)->e_ident[EI_CLASS] - == ELFCLASS64) ? 8 : 4; - - BFD_ASSERT (elf_section_data (sec)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR); - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (sec)->sec_info; - if (hdr_info->strip) + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + sec = hdr_info->hdr_sec; + if (sec == NULL) return true; size = EH_FRAME_HDR_SIZE; @@ -2671,18 +2671,17 @@ assign_section_numbers (abfd) /* Set up the list of section header pointers, in agreement with the indices. */ amt = section_number * sizeof (Elf_Internal_Shdr *); - i_shdrp = (Elf_Internal_Shdr **) bfd_alloc (abfd, amt); + i_shdrp = (Elf_Internal_Shdr **) bfd_zalloc (abfd, amt); if (i_shdrp == NULL) return false; amt = sizeof (Elf_Internal_Shdr); - i_shdrp[0] = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); + i_shdrp[0] = (Elf_Internal_Shdr *) bfd_zalloc (abfd, amt); if (i_shdrp[0] == NULL) { bfd_release (abfd, i_shdrp); return false; } - memset (i_shdrp[0], 0, sizeof (Elf_Internal_Shdr)); elf_elfsections (abfd) = i_shdrp; @@ -3450,10 +3449,9 @@ map_sections_to_segments (abfd) /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME segment. */ - eh_frame_hdr = NULL; - if (elf_tdata (abfd)->eh_frame_hdr) - eh_frame_hdr = bfd_get_section_by_name (abfd, ".eh_frame_hdr"); - if (eh_frame_hdr != NULL && (eh_frame_hdr->flags & SEC_LOAD)) + eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; + if (eh_frame_hdr != NULL + && (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0) { amt = sizeof (struct elf_segment_map); m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); @@ -3462,7 +3460,7 @@ map_sections_to_segments (abfd) m->next = NULL; m->p_type = PT_GNU_EH_FRAME; m->count = 1; - m->sections[0] = eh_frame_hdr; + m->sections[0] = eh_frame_hdr->output_section; *pm = m; pm = &m->next; @@ -3960,11 +3958,6 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a } } - /* If additional nonloadable filepos adjustments are required, - do them now. */ - if (bed->set_nonloadable_filepos) - (*bed->set_nonloadable_filepos) (abfd, phdrs); - /* Clear out any program headers we allocated but did not use. */ for (; count < alloc; count++, p++) { @@ -4038,8 +4031,7 @@ get_program_header_size (abfd) ++segs; } - if (elf_tdata (abfd)->eh_frame_hdr - && bfd_get_section_by_name (abfd, ".eh_frame_hdr") != NULL) + if (elf_tdata (abfd)->eh_frame_hdr) { /* We need a PT_GNU_EH_FRAME segment. */ ++segs; @@ -4560,13 +4552,6 @@ copy_private_bfd_data (ibfd, obfd) && (section->lma + section->_raw_size \ <= SEGMENT_END (segment, base))) - /* Returns true if the given section is contained within the - given segment. Filepos addresses are compared in an elf - backend function. */ -#define IS_CONTAINED_BY_FILEPOS(sec, seg, bed) \ - (bed->is_contained_by_filepos \ - && (*bed->is_contained_by_filepos) (sec, seg)) - /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */ #define IS_COREFILE_NOTE(p, s) \ (p->p_type == PT_NOTE \ @@ -4602,9 +4587,7 @@ copy_private_bfd_data (ibfd, obfd) ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ : IS_CONTAINED_BY_VMA (section, segment)) \ && (section->flags & SEC_ALLOC) != 0) \ - || IS_COREFILE_NOTE (segment, section) \ - || (IS_CONTAINED_BY_FILEPOS (section, segment, bed) \ - && (section->flags & SEC_ALLOC) == 0)) \ + || IS_COREFILE_NOTE (segment, section)) \ && section->output_section != NULL \ && ! section->segment_mark) @@ -4849,7 +4832,6 @@ copy_private_bfd_data (ibfd, obfd) /* Match up the physical address of the segment with the LMA address of the output section. */ if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr) - || IS_CONTAINED_BY_FILEPOS (section, segment, bed) || IS_COREFILE_NOTE (segment, section) || (bed->want_p_paddr_set_to_zero && IS_CONTAINED_BY_VMA (output_section, segment)) @@ -5086,7 +5068,6 @@ copy_private_bfd_data (ibfd, obfd) #undef SEGMENT_END #undef IS_CONTAINED_BY_VMA #undef IS_CONTAINED_BY_LMA -#undef IS_CONTAINED_BY_FILEPOS #undef IS_COREFILE_NOTE #undef IS_SOLARIS_PT_INTERP #undef INCLUDE_SECTION_IN_SEGMENT @@ -5106,26 +5087,12 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) asection *osec; { Elf_Internal_Shdr *ihdr, *ohdr; - const struct elf_backend_data *bed = get_elf_backend_data (ibfd); if (ibfd->xvec->flavour != bfd_target_elf_flavour || obfd->xvec->flavour != bfd_target_elf_flavour) return true; - /* Copy over private BFD data if it has not already been copied. - This must be done here, rather than in the copy_private_bfd_data - entry point, because the latter is called after the section - contents have been set, which means that the program headers have - already been worked out. The backend function provides a way to - override the test conditions and code path for the call to - copy_private_bfd_data. */ - if (bed->copy_private_bfd_data_p) - { - if ((*bed->copy_private_bfd_data_p) (ibfd, isec, obfd, osec)) - if (! copy_private_bfd_data (ibfd, obfd)) - return false; - } - else if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL) + if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL) { asection *s; @@ -7358,9 +7325,9 @@ _bfd_elf_section_offset (abfd, info, sec, offset) switch (sec_data->sec_info_type) { case ELF_INFO_TYPE_STABS: - return _bfd_stab_section_offset - (abfd, &elf_hash_table (info)->merge_info, sec, &sec_data->sec_info, - offset); + return _bfd_stab_section_offset (abfd, + &elf_hash_table (info)->merge_info, + sec, &sec_data->sec_info, offset); case ELF_INFO_TYPE_EH_FRAME: return _bfd_elf_eh_frame_section_offset (abfd, sec, offset); default: diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 5901aea..d0e7085 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -367,13 +367,6 @@ static const insn16 t2a1_bx_pc_insn = 0x4778; static const insn16 t2a2_noop_insn = 0x46c0; static const insn32 t2a3_b_insn = 0xea000000; -static const insn16 t2a1_push_insn = 0xb540; -static const insn16 t2a2_ldr_insn = 0x4e03; -static const insn16 t2a3_mov_insn = 0x46fe; -static const insn16 t2a4_bx_insn = 0x4730; -static const insn32 t2a5_pop_insn = 0xe8bd4040; -static const insn32 t2a6_bx_insn = 0xe12fff1e; - #ifndef ELFARM_NABI_C_INCLUDED boolean bfd_elf32_arm_allocate_interworking_sections (info) @@ -3225,19 +3218,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if (strip) { - asection ** spp; - - for (spp = &s->output_section->owner->sections; - *spp != NULL; - spp = &(*spp)->next) - { - if (*spp == s->output_section) - { - bfd_section_list_remove (s->output_section->owner, spp); - --s->output_section->owner->section_count; - break; - } - } + _bfd_strip_section_from_output (info, s); continue; } diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 8eff52d..dfbdbe7 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1022,7 +1022,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (off != (bfd_vma) -1); if (!elf_hash_table (info)->dynamic_sections_created - || (! info->shared && h->dynindx == -1) + || (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) || (info->shared && (info->symbolic || h->dynindx == -1) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index c1c77ec..9cb900b 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -2,21 +2,21 @@ Copyright 1993, 1995, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -61,8 +61,7 @@ static bfd_reloc_status_type special /* This does not include any relocation information, but should be good enough for GDB or objdump to read the file. */ -static reloc_howto_type h8_elf_howto_table[] = -{ +static reloc_howto_type h8_elf_howto_table[] = { #define R_H8_NONE_X 0 HOWTO (R_H8_NONE, /* type */ 0, /* rightshift */ @@ -221,16 +220,14 @@ static reloc_howto_type h8_elf_howto_table[] = /* This structure is used to map BFD reloc codes to H8 ELF relocs. */ -struct elf_reloc_map -{ +struct elf_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; unsigned char howto_index; }; /* An array mapping BFD reloc codes to SH ELF relocs. */ -static const struct elf_reloc_map h8_reloc_map[] = -{ +static const struct elf_reloc_map h8_reloc_map[] = { { BFD_RELOC_NONE, R_H8_NONE_X }, { BFD_RELOC_32, R_H8_DIR32_X }, { BFD_RELOC_16, R_H8_DIR16_X }, @@ -271,7 +268,7 @@ elf32_h8_info_to_howto (abfd, bfd_reloc, elf_reloc) r = ELF32_R_TYPE (elf_reloc->r_info); for (i = 0; i < sizeof (h8_elf_howto_table) / sizeof (reloc_howto_type); i++) - if (h8_elf_howto_table[i].type== r) + if (h8_elf_howto_table[i].type == r) { bfd_reloc->howto = &h8_elf_howto_table[i]; return; @@ -830,14 +827,34 @@ elf32_h8_relax_section (abfd, sec, link_info, again) elf_section_data (sec)->this_hdr.contents = contents; symtab_hdr->contents = (unsigned char *) isymbuf; + /* Get the instruction code being relaxed. */ + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + /* If the previous instruction conditionally jumped around this instruction, we may be able to reverse the condition and redirect the previous instruction to the target of this instruction. Such sequences are used by the compiler to deal with - long conditional branches. */ - if ((int) gap <= 130 + long conditional branches. + + Only perform this optimisation for jumps (code 0x5a) not + subroutine calls, as otherwise it could transform: + + mov.w r0,r0 + beq .L1 + jsr @_bar + .L1: rts + _bar: rts + into: + mov.w r0,r0 + bne _bar + rts + _bar: rts + + which changes the call (jsr) into a branch (bne). */ + if (code == 0x5a + && (int) gap <= 130 && (int) gap >= -128 && last_reloc && ELF32_R_TYPE (last_reloc->r_info) == R_H8_PCREL8 @@ -870,11 +887,10 @@ elf32_h8_relax_section (abfd, sec, link_info, again) = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), ELF32_R_TYPE (R_H8_NONE)); - last_reloc->r_info + last_reloc->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), - ELF32_R_TYPE (R_H8_PCREL8)); - last_reloc->r_addend = irel->r_addend; - + ELF32_R_TYPE (R_H8_PCREL8)); + last_reloc->r_addend = irel->r_addend; code = bfd_get_8 (abfd, contents + last_reloc->r_offset - 1); @@ -894,9 +910,6 @@ elf32_h8_relax_section (abfd, sec, link_info, again) } } - /* We could not eliminate this jump, so just shorten it. */ - code = bfd_get_8 (abfd, contents + irel->r_offset - 1); - if (code == 0x5e) bfd_put_8 (abfd, 0x55, contents + irel->r_offset - 1); else if (code == 0x5a) @@ -938,18 +951,18 @@ elf32_h8_relax_section (abfd, sec, link_info, again) /* If the distance is within -126..+130 inclusive, then we can relax this jump. +130 is valid since the target will move two bytes closer if we do relax this branch. */ - if ((int)gap >= -126 && (int)gap <= 130) + if ((int) gap >= -126 && (int) gap <= 130) { - unsigned char code; + unsigned char code; - /* Note that we've changed the relocs, section contents, + /* Note that we've changed the relocs, section contents, etc. */ - elf_section_data (sec)->relocs = internal_relocs; - elf_section_data (sec)->this_hdr.contents = contents; + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; symtab_hdr->contents = (unsigned char *) isymbuf; - /* Get the opcode. */ - code = bfd_get_8 (abfd, contents + irel->r_offset - 2); + /* Get the opcode. */ + code = bfd_get_8 (abfd, contents + irel->r_offset - 2); if (code == 0x58) { @@ -967,18 +980,18 @@ elf32_h8_relax_section (abfd, sec, link_info, again) abort (); /* Fix the relocation's type. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_H8_PCREL8); - irel->r_offset--; + irel->r_offset--; - /* Delete two bytes of data. */ - if (!elf32_h8_relax_delete_bytes (abfd, sec, + /* Delete two bytes of data. */ + if (!elf32_h8_relax_delete_bytes (abfd, sec, irel->r_offset + 1, 2)) goto error_return; - /* That will change things, so, we should relax again. + /* That will change things, so, we should relax again. Note that this is not required, and it may be slow. */ - *again = true; + *again = true; } break; } @@ -990,53 +1003,53 @@ elf32_h8_relax_section (abfd, sec, link_info, again) bfd_vma value = symval + irel->r_addend; if ((bfd_get_mach (abfd) == bfd_mach_h8300 - && value >= 0xff00 - && value <= 0xffff) - || ((bfd_get_mach (abfd) == bfd_mach_h8300h + && value >= 0xff00 + && value <= 0xffff) + || ((bfd_get_mach (abfd) == bfd_mach_h8300h || bfd_get_mach (abfd) == bfd_mach_h8300s) && value >= 0xffff00 && value <= 0xffffff)) { - unsigned char code; + unsigned char code; - /* Note that we've changed the relocs, section contents, + /* Note that we've changed the relocs, section contents, etc. */ - elf_section_data (sec)->relocs = internal_relocs; - elf_section_data (sec)->this_hdr.contents = contents; + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; symtab_hdr->contents = (unsigned char *) isymbuf; - /* Get the opcode. */ - code = bfd_get_8 (abfd, contents + irel->r_offset - 2); + /* Get the opcode. */ + code = bfd_get_8 (abfd, contents + irel->r_offset - 2); - /* Sanity check. */ - if (code != 0x6a) + /* Sanity check. */ + if (code != 0x6a) abort (); - code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); - if ((code & 0xf0) == 0x00) + if ((code & 0xf0) == 0x00) bfd_put_8 (abfd, (code & 0xf) | 0x20, - contents + irel->r_offset - 2); - else if ((code & 0xf0) == 0x80) + contents + irel->r_offset - 2); + else if ((code & 0xf0) == 0x80) bfd_put_8 (abfd, (code & 0xf) | 0x30, - contents + irel->r_offset - 2); - else + contents + irel->r_offset - 2); + else abort (); - /* Fix the relocation's type. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_H8_DIR8); - /* Delete two bytes of data. */ - if (!elf32_h8_relax_delete_bytes (abfd, sec, + /* Delete two bytes of data. */ + if (!elf32_h8_relax_delete_bytes (abfd, sec, irel->r_offset + 1, 2)) goto error_return; - /* That will change things, so, we should relax again. + /* That will change things, so, we should relax again. Note that this is not required, and it may be slow. */ - *again = true; + *again = true; } break; } @@ -1048,52 +1061,52 @@ elf32_h8_relax_section (abfd, sec, link_info, again) bfd_vma value = symval + irel->r_addend; if ((bfd_get_mach (abfd) == bfd_mach_h8300 - && value >= 0xff00 - && value <= 0xffff) - || ((bfd_get_mach (abfd) == bfd_mach_h8300h + && value >= 0xff00 + && value <= 0xffff) + || ((bfd_get_mach (abfd) == bfd_mach_h8300h || bfd_get_mach (abfd) == bfd_mach_h8300s) && value >= 0xffff00 && value <= 0xffffff)) { - unsigned char code; + unsigned char code; - /* Note that we've changed the relocs, section contents, + /* Note that we've changed the relocs, section contents, etc. */ - elf_section_data (sec)->relocs = internal_relocs; - elf_section_data (sec)->this_hdr.contents = contents; + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; symtab_hdr->contents = (unsigned char *) isymbuf; - /* Get the opcode. */ - code = bfd_get_8 (abfd, contents + irel->r_offset - 2); + /* Get the opcode. */ + code = bfd_get_8 (abfd, contents + irel->r_offset - 2); - /* Sanity check. */ - if (code != 0x6a) + /* Sanity check. */ + if (code != 0x6a) abort (); - code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); - if ((code & 0xf0) == 0x00) + if ((code & 0xf0) == 0x00) bfd_put_8 (abfd, (code & 0xf) | 0x20, - contents + irel->r_offset - 2); - else if ((code & 0xf0) == 0x80) + contents + irel->r_offset - 2); + else if ((code & 0xf0) == 0x80) bfd_put_8 (abfd, (code & 0xf) | 0x30, - contents + irel->r_offset - 2); - else + contents + irel->r_offset - 2); + else abort (); - /* Fix the relocation's type. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_H8_DIR8); - /* Delete two bytes of data. */ - if (!elf32_h8_relax_delete_bytes (abfd, sec, irel->r_offset, 2)) + /* Delete two bytes of data. */ + if (!elf32_h8_relax_delete_bytes (abfd, sec, irel->r_offset, 2)) goto error_return; - /* That will change things, so, we should relax again. + /* That will change things, so, we should relax again. Note that this is not required, and it may be slow. */ - *again = true; + *again = true; } } @@ -1107,34 +1120,34 @@ elf32_h8_relax_section (abfd, sec, link_info, again) if (value <= 0x7fff || value >= 0xff8000) { - unsigned char code; + unsigned char code; - /* Note that we've changed the relocs, section contents, + /* Note that we've changed the relocs, section contents, etc. */ - elf_section_data (sec)->relocs = internal_relocs; - elf_section_data (sec)->this_hdr.contents = contents; + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; symtab_hdr->contents = (unsigned char *) isymbuf; - /* Get the opcode. */ - code = bfd_get_8 (abfd, contents + irel->r_offset - 1); + /* Get the opcode. */ + code = bfd_get_8 (abfd, contents + irel->r_offset - 1); - /* We just need to turn off bit 0x20. */ - code &= ~0x20; + /* We just need to turn off bit 0x20. */ + code &= ~0x20; - bfd_put_8 (abfd, code, contents + irel->r_offset - 1); + bfd_put_8 (abfd, code, contents + irel->r_offset - 1); - /* Fix the relocation's type. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + /* Fix the relocation's type. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_H8_DIR16A8); - /* Delete two bytes of data. */ - if (!elf32_h8_relax_delete_bytes (abfd, sec, + /* Delete two bytes of data. */ + if (!elf32_h8_relax_delete_bytes (abfd, sec, irel->r_offset + 1, 2)) goto error_return; - /* That will change things, so, we should relax again. + /* That will change things, so, we should relax again. Note that this is not required, and it may be slow. */ - *again = true; + *again = true; } break; } diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index e26ee79..ed601a7 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -3429,20 +3429,3 @@ elf_i386_post_process_headers (abfd, link_info) #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-ppc.c b/bfd/elf32-ppc.c index 56df535..243ff14 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -3850,24 +3850,3 @@ ppc_elf_grok_psinfo (abfd, note) #define elf_backend_reloc_type_class ppc_elf_reloc_type_class #include "elf32-target.h" - -/* 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-qnx.c b/bfd/elf32-qnx.c deleted file mode 100644 index b397c38..0000000 --- a/bfd/elf32-qnx.c +++ /dev/null @@ -1,92 +0,0 @@ -/* 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. */ - -#include "bfd.h" -#include "sysdep.h" -#include "elf-bfd.h" -#include "elf32-qnx.h" - -/* 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)) - -boolean -elf_qnx_copy_private_bfd_data_p (ibfd, isec, obfd, osec) - bfd *ibfd ATTRIBUTE_UNUSED; - asection *isec; - bfd *obfd ATTRIBUTE_UNUSED; - asection *osec ATTRIBUTE_UNUSED; -{ - return isec->next == NULL; -} - -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))); -} - -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; -} diff --git a/bfd/elf32-qnx.h b/bfd/elf32-qnx.h deleted file mode 100644 index 0e79d7e..0000000 --- a/bfd/elf32-qnx.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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. */ - -boolean elf_qnx_copy_private_bfd_data_p - PARAMS ((bfd *, asection *, bfd *, asection *)); -boolean elf_qnx_is_contained_by_filepos - PARAMS ((asection *, Elf_Internal_Phdr *)); -void elf_qnx_set_nonloadable_filepos - PARAMS ((bfd *, Elf_Internal_Phdr *)); - -#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.c b/bfd/elf32-sh.c index 0f681a8..f52245b 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -7449,29 +7449,6 @@ elf32_shlin_grok_psinfo (abfd, note) #include "elf32-target.h" -/* 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 diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c index ae2cab4..df0c463 100644 --- a/bfd/elf32-sh64-com.c +++ b/bfd/elf32-sh64-com.c @@ -127,7 +127,7 @@ sh64_address_in_cranges (cranges, addr, rangep) else { cranges_contents - = bfd_malloc (cranges->_cooked_size == 0 + = bfd_malloc (cranges->_cooked_size != 0 ? cranges->_cooked_size : cranges->_raw_size); if (cranges_contents == NULL) return false; diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 57ed958..bf92ccf 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -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-mips.c b/bfd/elf64-mips.c index bf98c91..f06d065 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -2073,7 +2073,7 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr) rela.r_addend = 0; } - /* Each entry represents up to three actual relocations. */ + /* Each entry represents exactly three actual relocations. */ used_sym = false; used_ssym = false; @@ -2096,27 +2096,6 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr) break; } - if (type == R_MIPS_NONE) - { - /* There are no more relocations in this entry. If this - is the first entry, we need to generate a dummy - relocation so that the generic linker knows that - there has been a break in the sequence of relocations - applying to a particular address. */ - if (ir == 0) - { - relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - relent->address = rela.r_offset; - else - relent->address = rela.r_offset - asect->vma; - relent->addend = 0; - relent->howto = &howto_table[(int) R_MIPS_NONE]; - ++relent; - } - break; - } - /* Some types require symbols, whereas some do not. */ switch (type) { @@ -2194,7 +2173,7 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr) } } - asect->reloc_count += relent - relents; + asect->reloc_count += (relent - relents) / 3; if (allocated != NULL) free (allocated); diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 8b76f34..939d12f 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -2170,8 +2170,11 @@ _bfd_mmix_finalize_linker_allocated_gregs (abfd, link_info) n_gregs = gregdata->n_allocated_bpo_gregs; + /* We need to have a _raw_size contents even though there's only + _cooked_size worth of data, since the generic relocation machinery + will allocate and copy that much temporarily. */ bpo_gregs_section->contents - = contents = bfd_alloc (bpo_greg_owner, bpo_gregs_section->_cooked_size); + = contents = bfd_alloc (bpo_greg_owner, bpo_gregs_section->_raw_size); if (contents == NULL) return false; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index da7c53f..384348e 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -1658,6 +1658,7 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd) { /* Check if we have the same endianess. */ if (ibfd->xvec->byteorder != obfd->xvec->byteorder + && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) { const char *msg; @@ -1785,19 +1786,19 @@ struct ppc_dyn_relocs ppc_stub_plt_branch: Similar to the above, but a 24 bit branch in the stub section won't reach its destination. - . addis %r12,%r2,xxx@ha - . ld %r11,xxx@l(%r12) + . addis %r12,%r2,xxx@toc@ha + . ld %r11,xxx@toc@l(%r12) . mtctr %r11 . bctr ppc_stub_plt_call: Used to call a function in a shared library. - . addis %r12,%r2,xxx@ha + . addis %r12,%r2,xxx@toc@ha . std %r2,40(%r1) - . ld %r11,xxx+0@l(%r12) - . ld %r2,xxx+8@l(%r12) + . ld %r11,xxx+0@toc@l(%r12) + . ld %r2,xxx+8@toc@l(%r12) . mtctr %r11 - . ld %r11,xxx+16@l(%r12) + . ld %r11,xxx+16@toc@l(%r12) . bctr */ @@ -1971,8 +1972,6 @@ static boolean ppc64_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static void ppc64_elf_hide_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); -static boolean edit_opd - PARAMS ((bfd *, struct bfd_link_info *)); static boolean allocate_dynrelocs PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean readonly_dynrelocs @@ -3538,8 +3537,8 @@ ppc64_elf_hide_symbol (info, h, force_local) } } -static boolean -edit_opd (obfd, info) +boolean +ppc64_elf_edit_opd (obfd, info) bfd *obfd; struct bfd_link_info *info; { @@ -3556,6 +3555,7 @@ edit_opd (obfd, info) Elf_Internal_Sym *local_syms; struct elf_link_hash_entry **sym_hashes; bfd_vma offset; + bfd_size_type amt; long *adjust; boolean need_edit; @@ -3563,9 +3563,16 @@ edit_opd (obfd, info) if (sec == NULL) continue; + amt = sec->_raw_size * sizeof (long) / 24; adjust = (long *) elf_section_data (sec)->tdata; - BFD_ASSERT (adjust != NULL); - memset (adjust, 0, (size_t) sec->_raw_size * sizeof (long) / 24); + if (adjust == NULL) + { + /* Must be a ld -r link. ie. check_relocs hasn't been + called. */ + adjust = (long *) bfd_zalloc (obfd, amt); + elf_section_data (sec)->tdata = adjust; + } + memset (adjust, 0, (size_t) amt); if (sec->output_section == bfd_abs_section_ptr) continue; @@ -3768,14 +3775,29 @@ edit_opd (obfd, info) { /* Arrange for the function descriptor sym to be dropped. */ - struct elf_link_hash_entry *fdh; + struct ppc_link_hash_entry *fdh; struct ppc_link_hash_entry *fh; fh = (struct ppc_link_hash_entry *) h; - BFD_ASSERT (fh->is_func); - fdh = fh->oh; - fdh->root.u.def.value = 0; - fdh->root.u.def.section = sym_sec; + fdh = (struct ppc_link_hash_entry *) fh->oh; + if (fdh == NULL) + { + const char *fd_name; + struct ppc_link_hash_table *htab; + + fd_name = h->root.root.string + 1; + htab = ppc_hash_table (info); + fdh = (struct ppc_link_hash_entry *) + elf_link_hash_lookup (&htab->elf, fd_name, + false, false, false); + fdh->is_func_descriptor = 1; + fdh->oh = &fh->elf; + fh->is_func = 1; + fh->oh = &fdh->elf; + } + + fdh->elf.root.u.def.value = 0; + fdh->elf.root.u.def.section = sym_sec; } } else @@ -3788,13 +3810,28 @@ edit_opd (obfd, info) to this location in the opd section. We've checked above that opd relocs are ordered. */ - struct elf_link_hash_entry *fdh; + struct ppc_link_hash_entry *fdh; struct ppc_link_hash_entry *fh; fh = (struct ppc_link_hash_entry *) h; - BFD_ASSERT (fh->is_func); - fdh = fh->oh; - fdh->root.u.def.value = wptr - sec->contents; + fdh = (struct ppc_link_hash_entry *) fh->oh; + if (fdh == NULL) + { + const char *fd_name; + struct ppc_link_hash_table *htab; + + fd_name = h->root.root.string + 1; + htab = ppc_hash_table (info); + fdh = (struct ppc_link_hash_entry *) + elf_link_hash_lookup (&htab->elf, fd_name, + false, false, false); + fdh->is_func_descriptor = 1; + fdh->oh = &fh->elf; + fh->is_func = 1; + fh->oh = &fdh->elf; + } + + fdh->elf.root.u.def.value = wptr - sec->contents; } else { @@ -4144,9 +4181,6 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) } } - if (!edit_opd (output_bfd, info)) - return false; - /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index cabc388..21178d5 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ boolean ppc64_elf_mark_entry_syms PARAMS ((struct bfd_link_info *)); +boolean ppc64_elf_edit_opd + PARAMS ((bfd *, struct bfd_link_info *)); bfd_vma ppc64_elf_toc PARAMS ((bfd *)); int ppc64_elf_setup_section_lists diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index f79d76c..ae4e57a 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -1563,6 +1563,9 @@ sparc64_elf_adjust_dynamic_symbol (info, h) if (s->_raw_size == 0) s->_raw_size = PLT_HEADER_SIZE; + /* To simplify matters later, just store the plt index here. */ + h->plt.offset = s->_raw_size / PLT_ENTRY_SIZE; + /* If this symbol is not defined in a regular file, and we are not generating a shared library, then set the symbol to this location in the .plt. This is required to make function @@ -1572,12 +1575,9 @@ sparc64_elf_adjust_dynamic_symbol (info, h) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { h->root.u.def.section = s; - h->root.u.def.value = s->_raw_size; + h->root.u.def.value = sparc64_elf_plt_entry_offset (h->plt.offset); } - /* To simplify matters later, just store the plt index here. */ - h->plt.offset = s->_raw_size / PLT_ENTRY_SIZE; - /* Make room for this entry. */ s->_raw_size += PLT_ENTRY_SIZE; @@ -2164,11 +2164,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else { + outrel.r_addend = relocation + rel->r_addend; if (r_type == R_SPARC_64) - { - outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; - } + outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE); else { long indx; @@ -2198,6 +2196,13 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; indx = elf_section_data (osec)->dynindx; + /* We are turning this relocation into one + against a section symbol, so subtract out + the output section's address but not the + offset of the input section in the output + section. */ + outrel.r_addend -= osec->vma; + /* FIXME: we really should be able to link non-pic shared libraries. */ if (indx == 0) @@ -2216,7 +2221,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, ELF64_R_TYPE_INFO ( ELF64_R_TYPE_DATA (rel->r_info), r_type)); - outrel.r_addend = relocation + rel->r_addend; } } @@ -2580,11 +2584,10 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* The Solaris native linker silently disregards overflows. We don't, but this breaks stabs debugging info, whose relocations are only 32-bits wide. Ignore - overflows in this case. */ + overflows for discarded entries. */ if (r_type == R_SPARC_32 - && (input_section->flags & SEC_DEBUGGING) != 0 - && strcmp (bfd_section_name (input_bfd, input_section), - ".stab") == 0) + && _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset) == (bfd_vma) -1) break; if (h != NULL) diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c index bd34a14..dcf6808 100644 --- a/bfd/elfarm-nabi.c +++ b/bfd/elfarm-nabi.c @@ -750,26 +750,3 @@ elf32_arm_nabi_grok_psinfo (abfd, note) #define elf_backend_grok_psinfo elf32_arm_nabi_grok_psinfo #include "elf32-arm.h" - -/* 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/elfcode.h b/bfd/elfcode.h index 4f54cd3..f523972 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -505,16 +505,6 @@ elf_file_p (x_ehdrp) && (x_ehdrp->e_ident[EI_MAG3] == ELFMAG3)); } -struct bfd_preserve -{ - const struct bfd_arch_info *arch_info; - struct elf_obj_tdata *tdata; - struct bfd_hash_table section_htab; - struct sec *sections; - struct sec **section_tail; - unsigned int section_count; -}; - /* Check to see if the file associated with ABFD matches the target vector that ABFD points to. @@ -536,11 +526,10 @@ elf_object_p (abfd) char *shstrtab; /* Internal copy of section header stringtab */ struct elf_backend_data *ebd; struct bfd_preserve preserve; - struct elf_obj_tdata *new_tdata = NULL; asection *s; bfd_size_type amt; - preserve.arch_info = abfd->arch_info; + preserve.marker = NULL; /* Read in the ELF header in external format. */ @@ -584,24 +573,14 @@ elf_object_p (abfd) the tdata pointer in the bfd. */ amt = sizeof (struct elf_obj_tdata); - new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); - if (new_tdata == NULL) + preserve.marker = bfd_zalloc (abfd, amt); + if (preserve.marker == NULL) goto got_no_match; - preserve.tdata = elf_tdata (abfd); - elf_tdata (abfd) = new_tdata; - - /* Clear section information, since there might be a recognized bfd that - we now check if we can replace, and we don't want to append to it. */ - preserve.sections = abfd->sections; - preserve.section_tail = abfd->section_tail; - preserve.section_count = abfd->section_count; - preserve.section_htab = abfd->section_htab; - abfd->sections = NULL; - abfd->section_tail = &abfd->sections; - abfd->section_count = 0; - if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + if (!bfd_preserve_save (abfd, &preserve)) goto got_no_match; + elf_tdata (abfd) = preserve.marker; + /* Now that we know the byte order, swap in the rest of the header */ i_ehdrp = elf_elfheader (abfd); elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp); @@ -633,8 +612,10 @@ elf_object_p (abfd) /* Check that the ELF e_machine field matches what this particular BFD format expects. */ if (ebd->elf_machine_code != i_ehdrp->e_machine - && (ebd->elf_machine_alt1 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt1) - && (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2)) + && (ebd->elf_machine_alt1 == 0 + || i_ehdrp->e_machine != ebd->elf_machine_alt1) + && (ebd->elf_machine_alt2 == 0 + || i_ehdrp->e_machine != ebd->elf_machine_alt2)) { const bfd_target * const *target_ptr; @@ -844,11 +825,8 @@ elf_object_p (abfd) } } - /* It would be nice to be able to free more memory here, eg. old - elf_elfsections, old tdata, but that's not possible since these - blocks are sitting inside obj_alloc'd memory. */ - bfd_hash_table_free (&preserve.section_htab); - return (abfd->xvec); + bfd_preserve_finish (abfd, &preserve); + return abfd->xvec; got_wrong_format_error: /* There is way too much undoing of half-known state here. The caller, @@ -863,18 +841,8 @@ elf_object_p (abfd) bfd_set_error (bfd_error_wrong_format); got_no_match: - abfd->arch_info = preserve.arch_info; - if (new_tdata != NULL) - { - /* bfd_release frees all memory more recently bfd_alloc'd than - its arg, as well as its arg. */ - bfd_release (abfd, new_tdata); - elf_tdata (abfd) = preserve.tdata; - abfd->section_htab = preserve.section_htab; - abfd->sections = preserve.sections; - abfd->section_tail = preserve.section_tail; - abfd->section_count = preserve.section_count; - } + if (preserve.marker != NULL) + bfd_preserve_restore (abfd, &preserve); return NULL; } diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 7db5f72..264ff55 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -85,18 +85,18 @@ elf_core_file_p (abfd) unsigned int phindex; struct elf_backend_data *ebd; struct bfd_preserve preserve; - struct elf_obj_tdata *new_tdata = NULL; bfd_size_type amt; - preserve.arch_info = abfd->arch_info; + preserve.marker = NULL; /* Read in the ELF header in external format. */ if (bfd_bread ((PTR) &x_ehdr, (bfd_size_type) sizeof (x_ehdr), abfd) != sizeof (x_ehdr)) { if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; + goto wrong; + else + goto fail; } /* Check the magic number. */ @@ -126,24 +126,14 @@ elf_core_file_p (abfd) /* Give abfd an elf_obj_tdata. */ amt = sizeof (struct elf_obj_tdata); - new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return NULL; - preserve.tdata = elf_tdata (abfd); - elf_tdata (abfd) = new_tdata; - - /* Clear section information, since there might be a recognized bfd that - we now check if we can replace, and we don't want to append to it. */ - preserve.sections = abfd->sections; - preserve.section_tail = abfd->section_tail; - preserve.section_count = abfd->section_count; - preserve.section_htab = abfd->section_htab; - abfd->sections = NULL; - abfd->section_tail = &abfd->sections; - abfd->section_count = 0; - if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + preserve.marker = bfd_zalloc (abfd, amt); + if (preserve.marker == NULL) + goto fail; + if (!bfd_preserve_save (abfd, &preserve)) goto fail; + elf_tdata (abfd) = preserve.marker; + /* Swap in the rest of the header, now that we have the byte order. */ i_ehdrp = elf_elfheader (abfd); elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp); @@ -248,7 +238,7 @@ elf_core_file_p (abfd) goto wrong; } - bfd_hash_table_free (&preserve.section_htab); + bfd_preserve_finish (abfd, &preserve); return abfd->xvec; wrong: @@ -264,17 +254,7 @@ wrong: bfd_set_error (bfd_error_wrong_format); fail: - abfd->arch_info = preserve.arch_info; - if (new_tdata != NULL) - { - /* bfd_release frees all memory more recently bfd_alloc'd than - its arg, as well as its arg. */ - bfd_release (abfd, new_tdata); - elf_tdata (abfd) = preserve.tdata; - abfd->section_htab = preserve.section_htab; - abfd->sections = preserve.sections; - abfd->section_tail = preserve.section_tail; - abfd->section_count = preserve.section_count; - } + if (preserve.marker != NULL) + bfd_preserve_restore (abfd, &preserve); return NULL; } diff --git a/bfd/elflink.h b/bfd/elflink.h index 03be87a..721b361 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2208,10 +2208,9 @@ elf_link_add_object_symbols (abfd, info) } } - /* If this is a non-traditional, non-relocateable link, try to - optimize the handling of the .stab/.stabstr sections. */ + /* If this is a non-traditional link, try to optimize the handling + of the .stab/.stabstr sections. */ if (! dynamic - && ! info->relocateable && ! info->traditional_format && info->hash->creator->flavour == bfd_target_elf_flavour && is_elf_hash_table (info) @@ -2342,6 +2341,7 @@ elf_link_create_dynamic_sections (abfd, info) || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return false; + elf_hash_table (info)->eh_info.hdr_sec = s; } /* Create sections to hold version informations. These are removed @@ -4494,6 +4494,8 @@ struct elf_final_link_info size_t symbuf_count; /* Number of symbols which fit in symbuf. */ size_t symbuf_size; + /* And same for symshndxbuf. */ + size_t shndxbuf_size; }; static boolean elf_link_output_sym @@ -4919,6 +4921,7 @@ elf_bfd_final_link (abfd, info) Elf_Internal_Sym elfsym; unsigned int i; Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *symtab_shndx_hdr; Elf_Internal_Shdr *symstrtab_hdr; struct elf_backend_data *bed = get_elf_backend_data (abfd); struct elf_outext_info eoinfo; @@ -4972,6 +4975,7 @@ elf_bfd_final_link (abfd, info) finfo.symbuf = NULL; finfo.symshndxbuf = NULL; finfo.symbuf_count = 0; + finfo.shndxbuf_size = 0; finfo.first_tls_sec = NULL; for (o = abfd->sections; o != (asection *) NULL; o = o->next) if ((o->flags & SEC_THREAD_LOCAL) != 0 @@ -5192,9 +5196,7 @@ elf_bfd_final_link (abfd, info) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* sh_name is set in prep_headers. */ symtab_hdr->sh_type = SHT_SYMTAB; - symtab_hdr->sh_flags = 0; - symtab_hdr->sh_addr = 0; - symtab_hdr->sh_size = 0; + /* sh_flags, sh_addr and sh_size all start off zero. */ symtab_hdr->sh_entsize = sizeof (Elf_External_Sym); /* sh_link is set in assign_section_numbers. */ /* sh_info is set below. */ @@ -5221,9 +5223,11 @@ elf_bfd_final_link (abfd, info) goto error_return; if (elf_numsections (abfd) > SHN_LORESERVE) { - amt = finfo.symbuf_size; + /* Wild guess at number of output symbols. realloc'd as needed. */ + amt = 2 * max_sym_count + elf_numsections (abfd) + 1000; + finfo.shndxbuf_size = amt; amt *= sizeof (Elf_External_Sym_Shndx); - finfo.symshndxbuf = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + finfo.symshndxbuf = (Elf_External_Sym_Shndx *) bfd_zmalloc (amt); if (finfo.symshndxbuf == NULL) goto error_return; } @@ -5283,7 +5287,7 @@ elf_bfd_final_link (abfd, info) if (! elf_link_output_sym (&finfo, (const char *) NULL, &elfsym, o)) goto error_return; - if (i == SHN_LORESERVE) + if (i == SHN_LORESERVE - 1) i += SHN_HIRESERVE + 1 - SHN_LORESERVE; } } @@ -5558,6 +5562,24 @@ elf_bfd_final_link (abfd, info) /* Now we know the size of the symtab section. */ off += symtab_hdr->sh_size; + symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + if (symtab_shndx_hdr->sh_name != 0) + { + symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX; + symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx); + symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx); + amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx); + symtab_shndx_hdr->sh_size = amt; + + off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr, + off, true); + + if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0 + || (bfd_bwrite ((PTR) finfo.symshndxbuf, amt, abfd) != amt)) + return false; + } + + /* Finish up and write out the symbol string table (.strtab) section. */ symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; @@ -5832,17 +5854,10 @@ elf_bfd_final_link (abfd, info) goto error_return; } - if (info->eh_frame_hdr && elf_hash_table (info)->dynobj) + if (info->eh_frame_hdr) { - o = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - ".eh_frame_hdr"); - if (o - && (elf_section_data (o)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR)) - { - if (! _bfd_elf_write_section_eh_frame_hdr (abfd, o)) - goto error_return; - } + if (! _bfd_elf_write_section_eh_frame_hdr (abfd, info)) + goto error_return; } if (finfo.symstrtab != NULL) @@ -5866,7 +5881,7 @@ elf_bfd_final_link (abfd, info) if (finfo.symbuf != NULL) free (finfo.symbuf); if (finfo.symshndxbuf != NULL) - free (finfo.symbuf); + free (finfo.symshndxbuf); for (o = abfd->sections; o != NULL; o = o->next) { if ((o->flags & SEC_RELOC) != 0 @@ -5900,7 +5915,7 @@ elf_bfd_final_link (abfd, info) if (finfo.symbuf != NULL) free (finfo.symbuf); if (finfo.symshndxbuf != NULL) - free (finfo.symbuf); + free (finfo.symshndxbuf); for (o = abfd->sections; o != NULL; o = o->next) { if ((o->flags & SEC_RELOC) != 0 @@ -5959,11 +5974,24 @@ elf_link_output_sym (finfo, name, elfsym, input_sec) dest = finfo->symbuf + finfo->symbuf_count; destshndx = finfo->symshndxbuf; if (destshndx != NULL) - destshndx += finfo->symbuf_count; - elf_swap_symbol_out (finfo->output_bfd, elfsym, (PTR) dest, (PTR) destshndx); - ++finfo->symbuf_count; + { + if (bfd_get_symcount (finfo->output_bfd) >= finfo->shndxbuf_size) + { + bfd_size_type amt; - ++ bfd_get_symcount (finfo->output_bfd); + amt = finfo->shndxbuf_size * sizeof (Elf_External_Sym_Shndx); + finfo->symshndxbuf = destshndx = bfd_realloc (destshndx, amt * 2); + if (destshndx == NULL) + return false; + memset ((char *) destshndx + amt, 0, amt); + finfo->shndxbuf_size *= 2; + } + destshndx += bfd_get_symcount (finfo->output_bfd); + } + + elf_swap_symbol_out (finfo->output_bfd, elfsym, (PTR) dest, (PTR) destshndx); + finfo->symbuf_count += 1; + bfd_get_symcount (finfo->output_bfd) += 1; return true; } @@ -5988,20 +6016,6 @@ elf_link_flush_output_syms (finfo) return false; hdr->sh_size += amt; - - if (finfo->symshndxbuf != NULL) - { - hdr = &elf_tdata (finfo->output_bfd)->symtab_shndx_hdr; - pos = hdr->sh_offset + hdr->sh_size; - amt = finfo->symbuf_count * sizeof (Elf_External_Sym_Shndx); - if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0 - || (bfd_bwrite ((PTR) finfo->symshndxbuf, amt, finfo->output_bfd) - != amt)) - return false; - - hdr->sh_size += amt; - } - finfo->symbuf_count = 0; } @@ -6818,12 +6832,7 @@ elf_link_input_bfd (finfo, input_bfd) from discarded sections and section symbols from removed link-once sections. Complain about relocs against discarded sections. Zero relocs against removed - link-once sections. We should really complain if - anything in the final link tries to use it, but - DWARF-based exception handling might have an entry in - .eh_frame to describe a routine in the linkonce section, - and it turns out to be hard to remove the .eh_frame - entry too. FIXME. */ + link-once sections. */ if (!finfo->info->relocateable && !elf_section_ignore_discarded_relocs (o)) { @@ -6972,6 +6981,16 @@ elf_link_input_bfd (finfo, input_bfd) next_erel = 0; } + irela->r_offset = _bfd_elf_section_offset (output_bfd, + finfo->info, o, + irela->r_offset); + if (irela->r_offset >= (bfd_vma) -2) + { + /* This is a reloc for a deleted entry or somesuch. */ + memset (irela, 0, sizeof (*irela)); + continue; + } + irela->r_offset += o->output_offset; /* Relocs in an executable have to be virtual addresses. */ @@ -7145,19 +7164,14 @@ elf_link_input_bfd (finfo, input_bfd) return false; break; case ELF_INFO_TYPE_MERGE: - if (! (_bfd_write_merged_section - (output_bfd, o, elf_section_data (o)->sec_info))) + if (! _bfd_write_merged_section (output_bfd, o, + elf_section_data (o)->sec_info)) return false; break; case ELF_INFO_TYPE_EH_FRAME: { - asection *ehdrsec; - - ehdrsec - = bfd_get_section_by_name (elf_hash_table (finfo->info)->dynobj, - ".eh_frame_hdr"); - if (! (_bfd_elf_write_section_eh_frame (output_bfd, o, ehdrsec, - contents))) + if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info, + o, contents)) return false; } break; @@ -8329,7 +8343,7 @@ elf_reloc_symbol_deleted_p (offset, cookie) for (; rcookie->rel < rcookie->relend; rcookie->rel++) { - unsigned long r_symndx = ELF_R_SYM (rcookie->rel->r_info); + unsigned long r_symndx; if (! rcookie->bad_symtab) if (rcookie->rel->r_offset > offset) @@ -8337,6 +8351,10 @@ elf_reloc_symbol_deleted_p (offset, cookie) if (rcookie->rel->r_offset != offset) continue; + r_symndx = ELF_R_SYM (rcookie->rel->r_info); + if (r_symndx == SHN_UNDEF) + return true; + if (r_symndx >= rcookie->locsymcount || ELF_ST_BIND (rcookie->locsyms[r_symndx].st_info) != STB_LOCAL) { @@ -8388,24 +8406,18 @@ elf_bfd_discard_info (output_bfd, info) struct bfd_link_info *info; { struct elf_reloc_cookie cookie; - asection *stab, *eh, *ehdr; + asection *stab, *eh; Elf_Internal_Shdr *symtab_hdr; struct elf_backend_data *bed; bfd *abfd; + unsigned int count; boolean ret = false; - boolean strip = info->strip == strip_all || info->strip == strip_debugger; - if (info->relocateable - || info->traditional_format + if (info->traditional_format || info->hash->creator->flavour != bfd_target_elf_flavour || ! is_elf_hash_table (info)) return false; - ehdr = NULL; - if (elf_hash_table (info)->dynobj != NULL) - ehdr = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - ".eh_frame_hdr"); - for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) { if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) @@ -8416,27 +8428,22 @@ elf_bfd_discard_info (output_bfd, info) if ((abfd->flags & DYNAMIC) != 0) continue; - eh = NULL; - if (ehdr) - { - eh = bfd_get_section_by_name (abfd, ".eh_frame"); - if (eh && (eh->_raw_size == 0 - || bfd_is_abs_section (eh->output_section))) - eh = NULL; - } + eh = bfd_get_section_by_name (abfd, ".eh_frame"); + if (eh != NULL + && (eh->_raw_size == 0 + || bfd_is_abs_section (eh->output_section))) + eh = NULL; - stab = NULL; - if (!strip) - { - stab = bfd_get_section_by_name (abfd, ".stab"); - if (stab && (stab->_raw_size == 0 - || bfd_is_abs_section (stab->output_section))) - stab = NULL; - } - if ((! stab - || elf_section_data(stab)->sec_info_type != ELF_INFO_TYPE_STABS) - && ! eh - && (strip || ! bed->elf_backend_discard_info)) + stab = bfd_get_section_by_name (abfd, ".stab"); + if (stab != NULL + && (stab->_raw_size == 0 + || bfd_is_abs_section (stab->output_section) + || elf_section_data (stab)->sec_info_type != ELF_INFO_TYPE_STABS)) + stab = NULL; + + if (stab == NULL + && eh == NULL + && bed->elf_backend_discard_info == NULL) continue; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -8445,8 +8452,7 @@ elf_bfd_discard_info (output_bfd, info) cookie.bad_symtab = elf_bad_symtab (abfd); if (cookie.bad_symtab) { - cookie.locsymcount = - symtab_hdr->sh_size / sizeof (Elf_External_Sym); + cookie.locsymcount = symtab_hdr->sh_size / sizeof (Elf_External_Sym); cookie.extsymoff = 0; } else @@ -8465,16 +8471,19 @@ elf_bfd_discard_info (output_bfd, info) return false; } - if (stab) + if (stab != NULL) { - cookie.rels = (NAME(_bfd_elf,link_read_relocs) - (abfd, stab, (PTR) NULL, (Elf_Internal_Rela *) NULL, - info->keep_memory)); - if (cookie.rels) + cookie.rels = NULL; + count = stab->reloc_count; + if (count != 0) + cookie.rels = (NAME(_bfd_elf,link_read_relocs) + (abfd, stab, (PTR) NULL, (Elf_Internal_Rela *) NULL, + info->keep_memory)); + if (cookie.rels != NULL) { cookie.rel = cookie.rels; - cookie.relend = - cookie.rels + stab->reloc_count * bed->s->int_rels_per_ext_rel; + cookie.relend = cookie.rels; + cookie.relend += count * bed->s->int_rels_per_ext_rel; if (_bfd_discard_section_stabs (abfd, stab, elf_section_data (stab)->sec_info, elf_reloc_symbol_deleted_p, @@ -8485,39 +8494,32 @@ elf_bfd_discard_info (output_bfd, info) } } - if (eh) + if (eh != NULL) { cookie.rels = NULL; - cookie.rel = NULL; - cookie.relend = NULL; - if (eh->reloc_count) + count = eh->reloc_count; + if (count != 0) cookie.rels = (NAME(_bfd_elf,link_read_relocs) (abfd, eh, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->keep_memory)); - if (cookie.rels) - { - cookie.rel = cookie.rels; - cookie.relend = - cookie.rels + eh->reloc_count * bed->s->int_rels_per_ext_rel; - } - if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, ehdr, + cookie.rel = cookie.rels; + cookie.relend = cookie.rels; + if (cookie.rels != NULL) + cookie.relend += count * bed->s->int_rels_per_ext_rel; + + if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, elf_reloc_symbol_deleted_p, &cookie)) - { - /* Relocs have been edited. Ensure edited version is - used later in relocate_section. */ - elf_section_data (eh)->relocs = cookie.rels; - ret = true; - } - if (cookie.rels && elf_section_data (eh)->relocs != cookie.rels) + ret = true; + + if (cookie.rels != NULL + && elf_section_data (eh)->relocs != cookie.rels) free (cookie.rels); } - if (bed->elf_backend_discard_info) - { - if (bed->elf_backend_discard_info (abfd, &cookie, info)) - ret = true; - } + if (bed->elf_backend_discard_info != NULL + && (*bed->elf_backend_discard_info) (abfd, &cookie, info)) + ret = true; if (cookie.locsyms != NULL && symtab_hdr->contents != (unsigned char *) cookie.locsyms) @@ -8529,8 +8531,10 @@ elf_bfd_discard_info (output_bfd, info) } } - if (ehdr && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info, ehdr)) + if (info->eh_frame_hdr + && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info)) ret = true; + return ret; } diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 5da8e43..ddd86fb 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -3204,13 +3204,11 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, { Elf_Internal_Rela outrel; - offset += sec->output_section->vma + sec->output_offset; - BFD_ASSERT (dynindx != -1); outrel.r_info = ELFNN_R_INFO (dynindx, type); outrel.r_addend = addend; outrel.r_offset = _bfd_elf_section_offset (abfd, info, sec, offset); - if ((outrel.r_offset | 1) == (bfd_vma) -1) + if (outrel.r_offset >= (bfd_vma) -2) { /* Run for the hills. We shouldn't be outputting a relocation for this. So do what everyone else does and output a no-op. */ @@ -3218,6 +3216,8 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, outrel.r_addend = 0; outrel.r_offset = 0; } + else + outrel.r_offset += sec->output_section->vma + sec->output_offset; bfd_elfNN_swap_reloca_out (abfd, &outrel, ((ElfNN_External_Rela *) srel->contents diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 4f5b81c..f5b6a35 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -385,15 +385,6 @@ #ifndef elf_backend_write_section #define elf_backend_write_section NULL #endif -#ifndef elf_backend_set_nonloadable_filepos -#define elf_backend_set_nonloadable_filepos NULL -#endif -#ifndef elf_backend_is_contained_by_filepos -#define elf_backend_is_contained_by_filepos NULL -#endif -#ifndef elf_backend_copy_private_bfd_data_p -#define elf_backend_copy_private_bfd_data_p NULL -#endif #ifndef elf_backend_mips_irix_compat #define elf_backend_mips_irix_compat NULL #endif @@ -492,9 +483,6 @@ static const struct elf_backend_data elfNN_bed = elf_backend_discard_info, elf_backend_ignore_discarded_relocs, elf_backend_write_section, - elf_backend_set_nonloadable_filepos, - elf_backend_is_contained_by_filepos, - elf_backend_copy_private_bfd_data_p, elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto, elf_backend_ecoff_debug_swap, diff --git a/bfd/format.c b/bfd/format.c index ef6b46e..33291d0 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -119,8 +119,9 @@ bfd_check_format_matches (abfd, format, matching) char ***matching; { extern const bfd_target binary_vec; - const bfd_target * const *target, *save_targ, *right_targ, *ar_right_targ; - char **matching_vector = NULL; + const bfd_target * const *target; + const bfd_target **matching_vector = NULL; + const bfd_target *save_targ, *right_targ, *ar_right_targ; int match_count; int ar_match_index; @@ -145,8 +146,8 @@ bfd_check_format_matches (abfd, format, matching) bfd_size_type amt; *matching = NULL; - amt = sizeof (char *) * 2 * _bfd_target_vector_entries; - matching_vector = (char **) bfd_malloc (amt); + amt = sizeof (*matching_vector) * 2 * _bfd_target_vector_entries; + matching_vector = (const bfd_target **) bfd_malloc (amt); if (!matching_vector) return false; } @@ -170,7 +171,7 @@ bfd_check_format_matches (abfd, format, matching) abfd->xvec = right_targ; /* Set the target as returned. */ if (matching) - free (matching_vector); + free ((PTR) matching_vector); return true; /* File position has moved, BTW. */ } @@ -193,7 +194,7 @@ bfd_check_format_matches (abfd, format, matching) abfd->format = bfd_unknown; if (matching) - free (matching_vector); + free ((PTR) matching_vector); bfd_set_error (bfd_error_file_not_recognized); @@ -236,7 +237,7 @@ bfd_check_format_matches (abfd, format, matching) } if (matching) - matching_vector[match_count] = temp->name; + matching_vector[match_count] = temp; match_count++; @@ -259,7 +260,7 @@ bfd_check_format_matches (abfd, format, matching) if (ar_right_targ != bfd_default_vector[0]) ar_right_targ = *target; if (matching) - matching_vector[ar_match_index] = (*target)->name; + matching_vector[ar_match_index] = *target; ar_match_index++; } else if (err != bfd_error_wrong_format) @@ -268,7 +269,7 @@ bfd_check_format_matches (abfd, format, matching) abfd->format = bfd_unknown; if (matching) - free (matching_vector); + free ((PTR) matching_vector); return false; } @@ -289,7 +290,27 @@ bfd_check_format_matches (abfd, format, matching) { memcpy (matching_vector, matching_vector + _bfd_target_vector_entries, - sizeof (char *) * match_count); + sizeof (*matching_vector) * match_count); + } + } + } + + if (match_count > 1 && bfd_associated_vector != NULL) + { + const bfd_target * const *assoc = bfd_associated_vector; + + while ((right_targ = *assoc++) != NULL) + { + int i = match_count; + + while (--i >= 0) + if (matching_vector[i] == right_targ) + break; + + if (i >= 0) + { + match_count = 1; + break; } } } @@ -299,7 +320,7 @@ bfd_check_format_matches (abfd, format, matching) abfd->xvec = right_targ; /* Change BFD's target permanently. */ if (matching) - free (matching_vector); + free ((PTR) matching_vector); return true; /* File position has moved, BTW. */ } @@ -312,7 +333,7 @@ bfd_check_format_matches (abfd, format, matching) bfd_set_error (bfd_error_file_not_recognized); if (matching) - free (matching_vector); + free ((PTR) matching_vector); } else { @@ -320,8 +341,15 @@ bfd_check_format_matches (abfd, format, matching) if (matching) { - *matching = matching_vector; + *matching = (char **) matching_vector; matching_vector[match_count] = NULL; + /* Return target names. This is a little nasty. Maybe we + should do another bfd_malloc? */ + while (--match_count >= 0) + { + const char *name = matching_vector[match_count]->name; + *(const char **) &matching_vector[match_count] = name; + } } } diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index 776dcd6..00d5bd3 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -567,6 +567,9 @@ extern bfd *bfd_last_cache; extern const bfd_target * const *bfd_target_vector; extern const bfd_target *bfd_default_vector[]; +/* List of associated target vectors. */ +extern const bfd_target * const *bfd_associated_vector; + /* Functions shared by the ECOFF and MIPS ELF backends, which have no other common header files. */ diff --git a/bfd/libbfd.h b/bfd/libbfd.h index ef001f3..6d40e91 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -572,6 +572,9 @@ extern bfd *bfd_last_cache; extern const bfd_target * const *bfd_target_vector; extern const bfd_target *bfd_default_vector[]; +/* List of associated target vectors. */ +extern const bfd_target * const *bfd_associated_vector; + /* Functions shared by the ECOFF and MIPS ELF backends, which have no other common header files. */ diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index c95e01e..e11e314 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -152,8 +152,6 @@ elf32-openrisc.c elf32-or32.c elf32-pj.c elf32-ppc.c -elf32-qnx.c -elf32-qnx.h elf32-s390.c elf32-sh.c elf32-sh64-com.c @@ -225,6 +223,8 @@ m68klinux.c m68klynx.c m68knetbsd.c m88kmach3.c +mach-o.c +mach-o.h merge.c mipsbsd.c mmo.c @@ -253,6 +253,9 @@ pe-mcore.c pe-mips.c pe-ppc.c pe-sh.c +pef-traceback.h +pef.c +pef.h pei-arm.c pei-i386.c pei-mcore.c @@ -293,3 +296,5 @@ vms.c vms.h xcoff-target.h xcofflink.c +xsym.c +xsym.h diff --git a/bfd/po/da.po b/bfd/po/da.po index 6f18484..89ed7d0 100644 --- a/bfd/po/da.po +++ b/bfd/po/da.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: bfd 2.12.91\n" "POT-Creation-Date: 2002-07-23 15:55-0400\n" -"PO-Revision-Date: 2002-09-07 21:55+0200\n" +"PO-Revision-Date: 2002-11-09 23:25+0100\n" "Last-Translator: Keld Simonsen <keld@dkuug.dk>\n" "Language-Team: Danish <dansk@klid.dk>\n" "MIME-Version: 1.0\n" @@ -21,27 +21,27 @@ msgstr "%s: Ukendt sektionstype i a.out.adobe-fil: %x\n" #: aout-cris.c:208 #, c-format msgid "%s: Invalid relocation type exported: %d" -msgstr "%s: Ugyldig relokaliseringstype eksporteret: %d" +msgstr "%s: Ugyldig relokeringstype eksporteret: %d" #: aout-cris.c:252 #, c-format msgid "%s: Invalid relocation type imported: %d" -msgstr "%s: Ugyldig relokaliseringstype importeret: %d" +msgstr "%s: Ugyldig relokeringstype importeret: %d" #: aout-cris.c:263 #, c-format msgid "%s: Bad relocation record imported: %d" -msgstr "%s: Fejlagtig relokaliseringstype importeret: %d" +msgstr "%s: Fejlagtig relokeringstype importeret: %d" #: aoutx.h:1282 aoutx.h:1699 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" -msgstr "%s: kan ikke representere sektionen \"%s\" i a.out-objektfilformat" +msgstr "%s: kan ikke repræsentere sektionen \"%s\" i a.out-objektfilformat" #: aoutx.h:1669 #, c-format msgid "%s: can not represent section for symbol `%s' in a.out object file format" -msgstr "%s: kan ikke representere sektion for symbolet \"%s\" i a.out-objektfilformat" +msgstr "%s: kan ikke repræsentere sektion for symbolet \"%s\" i a.out-objektfilformat" #: aoutx.h:1671 msgid "*unknown*" @@ -50,7 +50,7 @@ msgstr "*ukendt*" #: aoutx.h:3732 #, c-format msgid "%s: relocateable link from %s to %s not supported" -msgstr "%s: relokaliseringsbar lænke fra %s til %s understøttes inte" +msgstr "%s: relokérbar lænke fra %s til %s understøttes ikke" #: archive.c:1826 msgid "Warning: writing archive was slow: rewriting timestamp\n" @@ -99,7 +99,7 @@ msgstr "Ingen symboler" #: bfd.c:282 msgid "Archive has no index; run ranlib to add one" -msgstr "Arkivet har intet index; kør ranlib for at tilføje ét" +msgstr "Arkivet har intet indeks; kør ranlib til at tilføje ét" #: bfd.c:283 msgid "No more archived files" @@ -181,19 +181,19 @@ msgstr "IHIHALF mangler" #: coff-a29k.c:212 coff-or32.c:229 msgid "Unrecognized reloc" -msgstr "Ukendt relokalisering" +msgstr "Ukendt relokering" #: coff-a29k.c:408 msgid "missing IHCONST reloc" -msgstr "IHCONST-relokalisering mangler" +msgstr "IHCONST-relokering mangler" #: coff-a29k.c:498 msgid "missing IHIHALF reloc" -msgstr "IHIHALF-relokalisering mangler" +msgstr "IHIHALF-relokering mangler" #: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432 msgid "GP relative relocation used when GP not defined" -msgstr "GP-relativ relokalisering bruges når GP ikke er defineret" +msgstr "GP-relativ relokering bruges når GP ikke er defineret" #: coff-alpha.c:1485 msgid "using multiple gp values" @@ -231,22 +231,22 @@ msgstr " overvej omlænkning med --support-old-code aktiveret" #: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3031 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" -msgstr "%s: fejlagtig relokaliseringsadresse 0x%lx i sektionen \"%s\"" +msgstr "%s: fejlagtig relokeringsadresse 0x%lx i sektionen \"%s\"" #: coff-arm.c:2127 #, c-format msgid "%s: illegal symbol index in reloc: %d" -msgstr "%s: utilladt symbolindex i relokalisering: %d" +msgstr "%s: ikke tilladt symbolindeks i relokering: %d" #: coff-arm.c:2255 #, c-format msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" -msgstr "FEJL: %s kompileret for APCS-%d, mens %s er kompileret for APCS-%d" +msgstr "FEJL: %s oversat for APCS-%d, mens %s er oversat for APCS-%d" #: coff-arm.c:2270 elf32-arm.h:2297 #, c-format msgid "ERROR: %s passes floats in float registers, whereas %s passes them in integer registers" -msgstr "FEJL: %s overfører flydende tal i flydende talsregister, mens %s overfører dem i heltalsregister" +msgstr "FEJL: %s overfører flydende tal i flydendetalsregister, mens %s overfører dem i heltalsregister" #: coff-arm.c:2273 elf32-arm.h:2302 #, c-format @@ -256,12 +256,12 @@ msgstr "FEJL: %s overfører flydende tal i heltalsregister, mens %s overfører dem #: coff-arm.c:2288 #, c-format msgid "ERROR: %s is compiled as position independent code, whereas target %s is absolute position" -msgstr "FEJL: %s er kompileret som positionsuafhængig kode, mens målet %s har absolut position" +msgstr "FEJL: %s er oversat som positionsuafhængig kode, mens målet %s har absolut position" #: coff-arm.c:2291 #, c-format msgid "ERROR: %s is compiled as absolute position code, whereas target %s is position independent" -msgstr "FEJL: %s er kompileret som kode med absolut position, mens målet %s er positionsuafhængigt" +msgstr "FEJL: %s er oversat som kode med absolut position, mens målet %s er positionsuafhængigt" #: coff-arm.c:2320 elf32-arm.h:2358 #, c-format @@ -322,31 +322,31 @@ msgstr "usikker kaldskonvention for ikke-COFF-symbol" #: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844 msgid "unsupported reloc type" -msgstr "relokaliseringstypen understøttes ikke" +msgstr "relokeringstypen understøttes ikke" #: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609 msgid "GP relative relocation when _gp not defined" -msgstr "GP-relativ relokalisering når _gp ikke var defineret" +msgstr "GP-relativ relokering når _gp ikke var defineret" #. No other sections should appear in -membedded-pic #. code. #: coff-mips.c:2466 msgid "reloc against unsupported section" -msgstr "relokalisering mod sektion som ikke understøttes" +msgstr "relokering mod sektion som ikke understøttes" #: coff-mips.c:2474 msgid "reloc not properly aligned" -msgstr "relokalisering ikke på lige grænse" +msgstr "relokering ikke på passende afrundet adresse" #: coff-rs6000.c:2766 #, c-format msgid "%s: unsupported relocation type 0x%02x" -msgstr "%s: relokaliseringstypen 0x%02x understøttes ikke" +msgstr "%s: relokeringstypen 0x%02x understøttes ikke" #: coff-rs6000.c:2859 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" -msgstr "%s: TOC-relokalisering ved 0x%x til symbolet \"%s\" uden nogen TOC-post" +msgstr "%s: TOC-relokering ved 0x%x til symbolet \"%s\" uden nogen TOC-post" #: coff-rs6000.c:3590 coff64-rs6000.c:2091 #, c-format @@ -356,17 +356,17 @@ msgstr "%s: symbolet \"%s\" har ukendt smclas %d" #: coff-tic54x.c:279 coff-tic80.c:449 #, c-format msgid "Unrecognized reloc type 0x%x" -msgstr "Ukendt relokaliseringstype 0x%x" +msgstr "Ukendt relokeringstype 0x%x" #: coff-tic54x.c:390 coffcode.h:4974 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" -msgstr "%s: advarsel: utilladt symbolindex %ld i relokaliseringerne" +msgstr "%s: advarsel: ikke tilladt symbolindeks %ld i relokeringerne" #: coff-w65.c:363 #, c-format msgid "ignoring reloc %s\n" -msgstr "ignorerer relokalisering %s\n" +msgstr "ignorerer relokering %s\n" #: coffcode.h:1086 #, c-format @@ -381,7 +381,7 @@ msgstr "Ukendt TI COFF-mål-id \"0x%x\"" #: coffcode.h:4365 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" -msgstr "%s: advarsel: utilladt symbolindex %ld i linjenummer" +msgstr "%s: advarsel: ikke tilladt symbolindeks %ld i linjenumre" #: coffcode.h:4379 #, c-format @@ -401,7 +401,7 @@ msgstr "advarsel: %s: lokalt symbol \"%s\" har ingen sektion" #: coffcode.h:5012 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" -msgstr "%s: utilladt relokaliseringstype %d på adresse 0x%lx" +msgstr "%s: ikke tilladt relokeringstype %d på adresse 0x%lx" #: coffgen.c:1661 #, c-format @@ -416,12 +416,12 @@ msgstr "Advarsel: typen på symbol \"%s\" ændredes fra %d til %d i %s" #: cofflink.c:2321 #, c-format msgid "%s: relocs in section `%s', but it has no contents" -msgstr "%s: relokaliseringer i sektionen \"%s\", men den har intet indhold" +msgstr "%s: relokeringer i sektionen \"%s\", men den har intet indhold" #: cofflink.c:2664 coffswap.h:877 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" -msgstr "%s: %s: relokalisering giver overløb: 0x%lx > 0xffff" +msgstr "%s: %s: relokering giver overløb: 0x%lx > 0xffff" #: cofflink.c:2673 coffswap.h:864 #, c-format @@ -444,7 +444,7 @@ msgstr "Dwarf-fejl: Kan ikke finde sektionen .debug_abbrev." #: dwarf2.c:560 #, c-format msgid "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size (%lu)." -msgstr "Dwarf-fejl: Forkortningsafstanden (%lu) større end eller lig med størrelsen .debug_abbrev (%lu)." +msgstr "Dwarf-fejl: Forkortelsesafstanden (%lu) større end eller lig med størrelsen .debug_abbrev (%lu)." #: dwarf2.c:757 #, c-format @@ -471,7 +471,7 @@ msgstr "Dwarf-fejl: vanskabt linjenummerssektion." #: dwarf2.c:1355 dwarf2.c:1566 #, c-format msgid "Dwarf Error: Could not find abbrev number %u." -msgstr "Dwarf-fejl: Kunne ikke finde forkortningsnumret %u." +msgstr "Dwarf-fejl: Kunne ikke finde forkortelsesnumret %u." #: dwarf2.c:1527 #, c-format @@ -486,7 +486,7 @@ msgstr "Dwarf-fejl: fandt adressestørrelsen \"%u\", denne læser kan ikke håndter #: dwarf2.c:1557 #, c-format msgid "Dwarf Error: Bad abbrev number: %u." -msgstr "Dwarf-fejl: Fejlagtigt forkortningsnummer: %u." +msgstr "Dwarf-fejl: Fejlagtigt forkortelsesnummer: %u." #: ecoff.c:1318 #, c-format @@ -518,7 +518,7 @@ msgid "" " End+1 symbol: %-7ld Type: %s" msgstr "" "\n" -" Symbol slut+1: %-7ld Typ: %s" +" Symbol slut+1: %-7ld Type: %s" #: ecoff.c:1607 #, c-format @@ -569,21 +569,21 @@ msgstr "" #: elf64-sh64.c:1659 #, c-format msgid "%s: warning: unresolvable relocation against symbol `%s' from %s section" -msgstr "%s: advarsel: uløselig relokalisering mod symbol \"%s\" fra sektionen %s" +msgstr "%s: advarsel: uløselig relokering mod symbol \"%s\" fra sektionen %s" #: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2084 elf32-avr.c:833 #: elf32-cris.c:1403 elf32-d10v.c:481 elf32-fr30.c:635 elf32-frv.c:809 #: elf32-h8300.c:548 elf32-i860.c:1031 elf32-m32r.c:1278 elf32-openrisc.c:439 #: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302 msgid "internal error: out of range error" -msgstr "intern fejl: udenfor intervallet" +msgstr "intern fejl: uden for intervallet" #: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2088 elf32-avr.c:837 #: elf32-cris.c:1407 elf32-d10v.c:485 elf32-fr30.c:639 elf32-frv.c:813 #: elf32-h8300.c:552 elf32-i860.c:1035 elf32-m32r.c:1282 elf32-openrisc.c:443 #: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5264 msgid "internal error: unsupported relocation error" -msgstr "intern fejl: relokaliseringen understøttes ikke" +msgstr "intern fejl: relokeringen understøttes ikke" #: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2092 elf32-d10v.c:489 #: elf32-h8300.c:556 elf32-m32r.c:1286 @@ -652,7 +652,7 @@ msgstr " kræves fra %s:\n" #: elf.c:1902 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" -msgstr "%s: ugyldig lænke %lu for relokaliseringssektion %s (index %u)" +msgstr "%s: ugyldig lænke %lu for relokeringssektion %s (indeks %u)" #: elf.c:3603 #, c-format @@ -677,7 +677,7 @@ msgstr "%s: advarsel: allokeret sektion \"%s\" ikke i segment" #: elf.c:4472 #, c-format msgid "%s: symbol `%s' required but not present" -msgstr "%s: symbol \"%s\" kræves men er ikke tilstede" +msgstr "%s: symbol \"%s\" kræves, men er ikke tilstede" #: elf.c:4749 #, c-format @@ -687,7 +687,7 @@ msgstr "%s: advarsel: Tomt indlæsningsbart segment opdaget, er dette meningen?\n #: elf.c:6193 #, c-format msgid "%s: unsupported relocation type %s" -msgstr "%s: relokaliseringstypen %s understøttes ikke" +msgstr "%s: relokeringstypen %s understøttes ikke" #: elf32-arm.h:1221 #, c-format @@ -702,12 +702,12 @@ msgstr "%s: Advarsel: Thumb BLX-instruktionen bruger thumb-funktionen \"%s\" som #: elf32-arm.h:1914 elf32-sh.c:4125 #, c-format msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" -msgstr "%s(%s+0x%lx): %s relokalisering mod SEC_MERGE-sektion" +msgstr "%s(%s+0x%lx): %s relokering mod SEC_MERGE-sektion" #: elf32-arm.h:2008 #, c-format msgid "%s: warning: unresolvable relocation %d against symbol `%s' from %s section" -msgstr "%s: advarsel: uløselig relokalisering %d mod symbol \"%s\" fra sektionen %s" +msgstr "%s: advarsel: uløselig relokering %d mod symbol \"%s\" fra sektionen %s" #: elf32-arm.h:2176 #, c-format @@ -717,12 +717,12 @@ msgstr "Advarsel: Fjerner samvirkendeflaget i %s eftersom ikke-samvirkende kode #: elf32-arm.h:2271 #, c-format msgid "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d" -msgstr "FEJL: %s er kompileret for EABI version %d, mens %s er kompileret for version %d" +msgstr "FEJL: %s er oversat for EABI version %d, mens %s er oversat for version %d" #: elf32-arm.h:2285 #, c-format msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" -msgstr "FEJL: %s er kompileret for APCS-%d, mens målet %s bruger APCS-%d" +msgstr "FEJL: %s er oversat for APCS-%d, mens målet %s bruger APCS-%d" #: elf32-arm.h:2313 #, c-format @@ -794,7 +794,7 @@ msgstr " [Version2 EABI]" #: elf32-arm.h:2457 msgid " [dynamic symbols use segment index]" -msgstr " [dynamiske symboler bruger segmentindex]" +msgstr " [dynamiske symboler bruger segmentindeks]" #: elf32-arm.h:2460 msgid " [mapping symbols precede others]" @@ -806,7 +806,7 @@ msgstr " <EABI-version genkendes ikke>" #: elf32-arm.h:2474 msgid " [relocatable executable]" -msgstr " [relokaliseringsbar kørbar fil]" +msgstr " [relokérbar kørbar fil]" #: elf32-arm.h:2477 msgid " [has entry point]" @@ -820,17 +820,17 @@ msgstr "<Ukendte flagbit er sat>" #: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699 #: elf32-xstormy16.c:941 elf64-mmix.c:1310 msgid "internal error: dangerous relocation" -msgstr "intern fejl: farlig relokalisering" +msgstr "intern fejl: farlig relokering" #: elf32-cris.c:949 #, c-format msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" -msgstr "%s: uløselig relokalisering %s mod symbol \"%s\" fra sektionen %s" +msgstr "%s: uløselig relokering %s mod symbol \"%s\" fra sektionen %s" #: elf32-cris.c:1012 #, c-format msgid "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" -msgstr "%s: Hverken nogen PLT eller GOT for relokalisering %s mod symbol \"%s\" fra sektionen %s" +msgstr "%s: Hverken nogen PLT eller GOT for relokering %s mod symbol \"%s\" fra sektionen %s" #: elf32-cris.c:1015 elf32-cris.c:1141 msgid "[whose name is lost]" @@ -839,27 +839,27 @@ msgstr "[hvis navn er tabt]" #: elf32-cris.c:1130 #, c-format msgid "%s: relocation %s with non-zero addend %d against local symbol from %s section" -msgstr "%s: relokalisering %s med ikke-tomt addendum %d mod lokalt symbol fra sektionen %s" +msgstr "%s: relokering %s med ikke-tomt addendum %d mod lokalt symbol fra sektionen %s" #: elf32-cris.c:1137 #, c-format msgid "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" -msgstr "%s: relokalisering %s med ikke-tomt addendum %d mod symbol \"%s\" fra sektionen %s" +msgstr "%s: relokering %s med ikke-tomt addendum %d mod symbol \"%s\" fra sektionen %s" #: elf32-cris.c:1155 #, c-format msgid "%s: relocation %s is not allowed for global symbol: `%s' from %s section" -msgstr "%s: relokaliseringen %s er ikke tilladt for globalt symbol: \"%s\" fra sektionen %s" +msgstr "%s: relokeringen %s er ikke tilladt for globalt symbol: \"%s\" fra sektionen %s" #: elf32-cris.c:1170 #, c-format msgid "%s: relocation %s in section %s with no GOT created" -msgstr "%s: relokalisering %s i sektionen %s uden GOT oprettet" +msgstr "%s: relokering %s i sektionen %s uden GOT oprettet" #: elf32-cris.c:1288 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" -msgstr "%s: Intern inkonsistens; ingen relokaliseringssektion %s" +msgstr "%s: Intern inkonsistens; ingen relokeringssektion %s" #: elf32-cris.c:2514 #, c-format @@ -868,31 +868,31 @@ msgid "" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" "%s, sektion %s:\n" -" relokaliseringen %s bør ikke bruges i et delt objekt; genoversæt med -fPIC" +" relokeringen %s bør ikke bruges i et delt objekt; genoversæt med -fPIC" #: elf32-cris.c:2991 msgid " [symbols have a _ prefix]" -msgstr " [symboler har et _-prefix]" +msgstr " [symboler har et _-præfiks]" #: elf32-cris.c:3030 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" -msgstr "%s: bruger symboler med _-prefix, men skriver fil med symboler uden prefix" +msgstr "%s: bruger symboler med _-præfiks, men skriver fil med symboler uden præfiks" #: elf32-cris.c:3031 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" -msgstr "%s: bruger symboler uden prefix, men skriver fil med symboler med _-prefix" +msgstr "%s: bruger symboler uden præfiks, men skriver fil med symboler med _-præfiks" #: elf32-frv.c:1217 #, c-format msgid "%s: compiled with %s and linked with modules that use non-pic relocations" -msgstr "%s: kompileret med %s og lænket med moduler som bruger ikke-pic-relokalisering" +msgstr "%s: oversat med %s og lænket med moduler som bruger ikke-pic-relokering" #: elf32-frv.c:1267 #, c-format msgid "%s: compiled with %s and linked with modules compiled with %s" -msgstr "%s: kompileret med %s og lænket med moduler som kompileredes med %s" +msgstr "%s: oversat med %s og lænket med moduler som oversattes med %s" #: elf32-frv.c:1279 #, c-format @@ -907,7 +907,7 @@ msgstr "private flag = 0x%lx:" #: elf32-gen.c:82 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" -msgstr "%s: Relokalisering i generisk ELF (EM: %d)" +msgstr "%s: Relokering i generisk ELF (EM: %d)" #: elf32-hppa.c:671 elf64-ppc.c:2323 #, c-format @@ -922,17 +922,17 @@ msgstr "%s(%s+0x%lx): kan ikke nå %s, genoversæt med -ffunction-sections" #: elf32-hppa.c:1338 elf64-x86-64.c:673 #, c-format msgid "%s: relocation %s can not be used when making a shared object; recompile with -fPIC" -msgstr "%s: relokaliseringen %s kan ikke bruges når et delt objekt oprettes; genoversæt med -fPIC" +msgstr "%s: relokeringen %s kan ikke bruges når et delt objekt oprettes; genoversæt med -fPIC" #: elf32-hppa.c:1358 #, c-format msgid "%s: relocation %s should not be used when making a shared object; recompile with -fPIC" -msgstr "%s: relokaliseringen %s bør ikke bruges når et delt objekt oprettes; genoversæt med -fPIC" +msgstr "%s: relokeringen %s bør ikke bruges når et delt objekt oprettes; genoversæt med -fPIC" #: elf32-hppa.c:1551 #, c-format msgid "Could not find relocation section for %s" -msgstr "Kunne ikke finde relokaliseringssektion for %s" +msgstr "Kunne ikke finde relokeringssektion for %s" #: elf32-hppa.c:2855 #, c-format @@ -956,12 +956,12 @@ msgstr ".got-sektionen følger ikke umiddelbart efter .plt-sektion" #: elf32-i386.c:379 #, c-format msgid "%s: invalid relocation type %d" -msgstr "%s: ugyldig relokaliseringstype %d" +msgstr "%s: ugyldig relokeringstype %d" #: elf32-i386.c:876 elf32-s390.c:649 elf64-s390.c:595 elf64-x86-64.c:591 #, c-format msgid "%s: bad symbol index: %d" -msgstr "%s: fejlagtigt symbolindex: %d" +msgstr "%s: fejlagtigt symbolindeks: %d" #: elf32-i386.c:948 #, c-format @@ -972,7 +972,7 @@ msgstr "%s: \"%s\" kaldt både som lokalt normalt symbol og lokalt trådsymbol" #: elf64-x86-64.c:761 #, c-format msgid "%s: bad relocation section name `%s'" -msgstr "%s: fejlagtig relokaliseringssektionsnavn \"%s\"" +msgstr "%s: fejlagtig relokeringssektionsnavn \"%s\"" #: elf32-i386.c:1159 elf64-alpha.c:4768 #, c-format @@ -983,28 +983,28 @@ msgstr "%s: lokal TLS-eksekveringskode kan ikke lænkes ind i delte objekter" #: elf64-s390.c:1945 elf64-sparc.c:2578 elf64-x86-64.c:1948 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" -msgstr "%s(%s+0x%lx): uløselig relokalisering mod symbol \"%s\"" +msgstr "%s(%s+0x%lx): uløselig relokering mod symbol \"%s\"" #: elf32-i386.c:2784 elf32-s390.c:2019 elf64-ppc.c:5977 elf64-s390.c:1983 #: elf64-x86-64.c:1986 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" -msgstr "%s(%s+0x%lx): relokalisering mod \"%s\": fejl %d" +msgstr "%s(%s+0x%lx): relokering mod \"%s\": fejl %d" #: elf32-m32r.c:924 msgid "SDA relocation when _SDA_BASE_ not defined" -msgstr "SDA-relokalisering når _SDA_BASE_ ikke er defineret" +msgstr "SDA-relokering når _SDA_BASE_ ikke er defineret" #: elf32-ia64.c:3687 elf32-m32r.c:1013 elf32-ppc.c:2987 elf64-alpha.c:4185 #: elf64-alpha.c:4313 elf64-ia64.c:3687 #, c-format msgid "%s: unknown relocation type %d" -msgstr "%s: ukendt relokaliseringstype %d" +msgstr "%s: ukendt relokeringstype %d" #: elf32-m32r.c:1221 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" -msgstr "%s: Målet (%s) for en %s-relokalisering er i forkert sektion (%s)" +msgstr "%s: Målet (%s) for en %s-relokering er i forkert sektion (%s)" #: elf32-m32r.c:1947 #, c-format @@ -1035,16 +1035,16 @@ msgstr " [m68000]" #: elf32-mcore.c:354 elf32-mcore.c:457 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" -msgstr "%s: Relokalisering %s (%d) understøttes ikke i øjeblikket.\n" +msgstr "%s: Relokering %s (%d) understøttes ikke i øjeblikket.\n" #: elf32-mcore.c:442 #, c-format msgid "%s: Unknown relocation type %d\n" -msgstr "%s: Ukendt relokaliseringstype %d\n" +msgstr "%s: Ukendt relokeringstype %d\n" #: elf32-mips.c:1152 elf64-mips.c:1783 msgid "32bits gp relative relocation occurs for an external symbol" -msgstr "32-bit gp-relativ relokalisering forekom for et eksternt symbol" +msgstr "32-bit gp-relativ relokering forekom for et eksternt symbol" #: elf32-mips.c:1301 #, c-format @@ -1054,12 +1054,12 @@ msgstr "Lænkning af mips16-objekter til %s-format understøttes ikke" #: elf32-ppc.c:1460 #, c-format msgid "%s: compiled with -mrelocatable and linked with modules compiled normally" -msgstr "%s: kompileret med -mrelocatable og lænket med moduler som kompileredes normalt" +msgstr "%s: oversat med -mrelocatable og lænket med moduler som oversattes normalt" #: elf32-ppc.c:1468 #, c-format msgid "%s: compiled normally and linked with modules compiled with -mrelocatable" -msgstr "%s: kompileret normalt og lænket med moduler som kompileredes med -mrelocatable" +msgstr "%s: oversat normalt og lænket med moduler som oversattes med -mrelocatable" #: elf32-ppc.c:1494 elf64-sparc.c:2989 elfxx-mips.c:7713 #, c-format @@ -1074,22 +1074,22 @@ msgstr "%s: Ukendt speciallænkertype %d" #: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" -msgstr "%s: relokaliseringen %s kan ikke bruges når et delt objekt oprettes" +msgstr "%s: relokeringen %s kan ikke bruges når et delt objekt oprettes" #: elf32-ppc.c:3126 elf64-ppc.c:5473 #, c-format msgid "%s: unknown relocation type %d for symbol %s" -msgstr "%s: ukendt relokaliseringstype %d for symbol %s" +msgstr "%s: ukendt relokeringstype %d for symbol %s" #: elf32-ppc.c:3482 elf32-ppc.c:3503 elf32-ppc.c:3553 #, c-format msgid "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" -msgstr "%s: Målet (%s) for en %s-relokalisering er i forkert uddatasektion (%s)" +msgstr "%s: Målet (%s) for en %s-relokering er i forkert uddatasektion (%s)" #: elf32-ppc.c:3619 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." -msgstr "%s: Relokaliseringen %s understøttes ikke endnu for symbol %s." +msgstr "%s: Relokeringen %s understøttes ikke endnu for symbol %s." #: elf32-sh.c:1964 #, c-format @@ -1109,7 +1109,7 @@ msgstr "%s: 0x%lx: advarsel: fejlagtig R_SH_USES-indlæsningsafstand" #: elf32-sh.c:2008 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" -msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet relokalisering" +msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet relokering" #: elf32-sh.c:2036 #, c-format @@ -1119,7 +1119,7 @@ msgstr "%s: 0x%lx: advarsel: symbol i uventet sektion" #: elf32-sh.c:2153 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" -msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet COUNT-relokalisering" +msgstr "%s: 0x%lx: advarsel: kunne ikke finde forventet COUNT-relokering" #: elf32-sh.c:2162 #, c-format @@ -1129,7 +1129,7 @@ msgstr "%s: 0x%lx: advarsel: fejlagtigt antal" #: elf32-sh.c:2550 elf32-sh.c:2926 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" -msgstr "%s: 0x%lx: fatalt: relokalisering giver overløb ved forenklingen" +msgstr "%s: 0x%lx: fatalt: relokering giver overløb ved forenklingen" #: elf32-sh.c:4073 elf64-sh64.c:1576 msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" @@ -1138,17 +1138,17 @@ msgstr "Uventet STO_SH5_ISA32 på lokalt symbol håndteres ikke" #: elf32-sh.c:4284 #, c-format msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" -msgstr "%s: 0x%lx: fatalt: ujusteret grenmål for relokalisering for forenklingsunderstøttelse" +msgstr "%s: 0x%lx: fatalt: ujusteret grenmål for relokering for forenklingsunderstøttelse" #: elf32-sh64.c:203 elf64-sh64.c:2364 #, c-format msgid "%s: compiled as 32-bit object and %s is 64-bit" -msgstr "%s: kompileret som 32-bitsobjekt og %s er 64-bit" +msgstr "%s: oversat som 32-bitsobjekt og %s er 64-bit" #: elf32-sh64.c:206 elf64-sh64.c:2367 #, c-format msgid "%s: compiled as 64-bit object and %s is 32-bit" -msgstr "%s: kompileret som 64-bitsobjekt og %s er 32-bit" +msgstr "%s: oversat som 64-bitsobjekt og %s er 32-bit" #: elf32-sh64.c:208 elf64-sh64.c:2369 #, c-format @@ -1176,27 +1176,27 @@ msgstr "%s: GAS-fejl: uventet PTB-instruktion med R_SH_PT_16" #: elf32-sh64.c:593 elf64-sh64.c:1703 #, c-format msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" -msgstr "%s: fejl: ojusteret relokaliseringstype %d på %08x relokalisering %08x\n" +msgstr "%s: fejl: ujusteret relokeringstype %d på %08x relokering %08x\n" #: elf32-sh64.c:677 -#, c-format +#, fuzzy, c-format msgid "%s: could not write out added .cranges entries" -msgstr "%s: kunne ikke udskrive tilføjede .cranges-poster" +msgstr "%s: kunne ikke udskrive tilføjede .crangives-poster" #: elf32-sh64.c:739 -#, c-format +#, fuzzy, c-format msgid "%s: could not write out sorted .cranges entries" -msgstr "%s: kunne ikke udskrive sorterede cranges-poster" +msgstr "%s: kunne ikke udskrive sorterede crangives-poster" #: elf32-sparc.c:1535 elf64-sparc.c:2224 #, c-format msgid "%s: probably compiled without -fPIC?" -msgstr "%s: nok kompileret uden -fPIC?" +msgstr "%s: nok oversat uden -fPIC?" #: elf32-sparc.c:2002 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" -msgstr "%s: kompileret for et 64-bitssystem og målet er 32-bit" +msgstr "%s: oversat for et 64-bitssystem og målet er 32-bit" #: elf32-sparc.c:2016 #, c-format @@ -1204,22 +1204,22 @@ msgid "%s: linking little endian files with big endian files" msgstr "%s: lænker little endian-filer med big endian-filer" #: elf32-v850.c:682 -#, c-format +#, fuzzy, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "Variabel \"%s\" kan ikke befinde sig i flere små dataområder" #: elf32-v850.c:685 -#, c-format +#, fuzzy, c-format msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "Variabel \"%s\" kan kun være i et af de små, tomme og bittesmå dataområder" #: elf32-v850.c:688 -#, c-format +#, fuzzy, c-format msgid "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "Variabel \"%s\" kan ikke være i både små og tomme dataområder samtidigt" #: elf32-v850.c:691 -#, c-format +#, fuzzy, c-format msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "Variabel \"%s\" kan ikke være i både små og bittesmå dataområder samtidigt" @@ -1230,7 +1230,7 @@ msgstr "Variabel \"%s\" kan ikke være i både tomme og bittesmå dataområder samti #: elf32-v850.c:1072 msgid "FAILED to find previous HI16 reloc\n" -msgstr "MISLYKKEDES med at finde tidligere HI16-relokalisering\n" +msgstr "MISLYKKEDES med at finde tidligere HI16-relokering\n" #: elf32-v850.c:1703 msgid "could not locate special linker symbol __gp" @@ -1291,20 +1291,20 @@ msgstr "%s: advarsel: PLT-addendum %d til \"%s\" fra sektionen %s ignoreredes" #: elf32-vax.c:1814 #, c-format msgid "%s: warning: %s relocation against symbol `%s' from %s section" -msgstr "%s: advarsel: %s-relokalisering mod symbol \"%s\" fra sektionen %s" +msgstr "%s: advarsel: %s-relokering mod symbol \"%s\" fra sektionen %s" #: elf32-vax.c:1820 #, c-format msgid "%s: warning: %s relocation to 0x%x from %s section" -msgstr "%s: advarsel: %s-relokalisering til 0x%x fra sektionen %s" +msgstr "%s: advarsel: %s-relokering til 0x%x fra sektionen %s" #: elf32-ia64.c:2280 elf32-xstormy16.c:414 elf64-ia64.c:2280 msgid "non-zero addend in @fptr reloc" -msgstr "ikke-tomt addendum i @fptr-relokalisering" +msgstr "ikke-tomt addendum i @fptr-relokering" #: elf64-alpha.c:1097 msgid "GPDISP relocation did not find ldah and lda instructions" -msgstr "GPDISP-relokalisering fandt ingen ldah- og lda-instruktioner" +msgstr "GPDISP-relokering fandt ingen ldah- og lda-instruktioner" #: elf64-alpha.c:3675 #, c-format @@ -1314,12 +1314,12 @@ msgstr "%s: .got-subsegment overskrider 64 kB (størrelse %d)" #: elf64-alpha.c:4498 elf64-alpha.c:4510 #, c-format msgid "%s: gp-relative relocation against dynamic symbol %s" -msgstr "%s: gp-relativ relokalisering mod dynamisk symbol %s" +msgstr "%s: gp-relativ relokering mod dynamisk symbol %s" #: elf64-alpha.c:4536 elf64-alpha.c:4676 #, c-format msgid "%s: pc-relative relocation against dynamic symbol %s" -msgstr "%s: pc-relativ relokalisering mod dynamisk symbol %s" +msgstr "%s: pc-relativ relokering mod dynamisk symbol %s" #: elf64-alpha.c:4564 #, c-format @@ -1333,27 +1333,27 @@ msgstr "<ukendt>" #: elf64-alpha.c:4594 #, c-format msgid "%s: !samegp reloc against symbol without .prologue: %s" -msgstr "%s: !samegp-relokalisering mod symbol uden .prologue: %s" +msgstr "%s: !samegp-relokering mod symbol uden .prologue: %s" #: elf64-alpha.c:4639 #, c-format msgid "%s: unhandled dynamic relocation against %s" -msgstr "%s: uhåndteret dynamisk relokalisering mod %s" +msgstr "%s: uhåndteret dynamisk relokering mod %s" #: elf64-alpha.c:4752 #, c-format msgid "%s: dtp-relative relocation against dynamic symbol %s" -msgstr "%s: dtp-relativ relokalisering mod dynamisk symbol %s" +msgstr "%s: dtp-relativ relokering mod dynamisk symbol %s" #: elf64-alpha.c:4775 #, c-format msgid "%s: tp-relative relocation against dynamic symbol %s" -msgstr "%s: tp-relativ relokalisering mod dynamisk symbol %s" +msgstr "%s: tp-relativ relokering mod dynamisk symbol %s" #: elf64-hppa.c:2080 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" -msgstr "stubpost for %s kan ikke læse in .plt, dp-afstand = %ld" +msgstr "stubpost for %s kan ikke indlæse .plt, dp-afstand = %ld" #: elf64-mmix.c:1002 #, c-format @@ -1361,28 +1361,28 @@ msgid "" "%s: Internal inconsistency error for value for\n" " linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n" msgstr "" -"%s: Intern inkkonsistensfejl for værdien for\n" -" lænkerallokeret globalt register: lænket: 0x%lx%08lx != afslappet: 0x%lx%08lx\n" +"%s: Intern inkonsistensfejl for værdien for\n" +" lænkerallokeret globalt register: lænket: 0x%lx%08lx != forenklet: 0x%lx%08lx\n" #: elf64-mmix.c:1386 #, c-format msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s" -msgstr "%s: base-plus-afstandsrelokalisering mod registersymbol: (ukendt) i %s" +msgstr "%s: base-plus-afstandsrelokering mod registersymbol: (ukendt) i %s" #: elf64-mmix.c:1391 #, c-format msgid "%s: base-plus-offset relocation against register symbol: %s in %s" -msgstr "%s: base-plus-afstandsrelokalisering mod registersymbol: %s i %s" +msgstr "%s: base-plus-afstandsrelokering mod registersymbol: %s i %s" #: elf64-mmix.c:1435 #, c-format msgid "%s: register relocation against non-register symbol: (unknown) in %s" -msgstr "%s: registerrelokalisering mod ikke-registersymbol: (ukendt) i %s" +msgstr "%s: registerrelokering mod ikke-registersymbol: (ukendt) i %s" #: elf64-mmix.c:1440 #, c-format msgid "%s: register relocation against non-register symbol: %s in %s" -msgstr "%s: registerrelokalisering mod ikke-registersymbol: %s i %s" +msgstr "%s: registerrelokering mod ikke-registersymbol: %s i %s" #: elf64-mmix.c:1477 #, c-format @@ -1415,17 +1415,17 @@ msgstr "" #: elf64-ppc.c:1669 libbfd.c:1435 #, c-format msgid "%s: compiled for a big endian system and target is little endian" -msgstr "%s: kompileret for et big endian-system og målet er little endian" +msgstr "%s: oversat for et big endian-system og målet er little endian" #: elf64-ppc.c:1671 libbfd.c:1437 #, c-format msgid "%s: compiled for a little endian system and target is big endian" -msgstr "%s: kompileret for et little endian-system og målet er big endian" +msgstr "%s: oversat for et little endian-system og målet er big endian" #: elf64-ppc.c:3610 #, c-format msgid "%s: unexpected reloc type %u in .opd section" -msgstr "%s: uventet relokaliseringstype %u i .opd-sektion" +msgstr "%s: uventet relokeringstype %u i .opd-sektion" #: elf64-ppc.c:3630 #, c-format @@ -1459,17 +1459,17 @@ msgstr "stubbe stemmer ikke overens med beregnet størrelse" #: elf64-ppc.c:5828 #, c-format msgid "%s: Relocation %s is not supported for symbol %s." -msgstr "%s: Relokaliseringen %s understøttes ikke for symbol %s." +msgstr "%s: Relokeringen %s understøttes ikke for symbol %s." #: elf64-ppc.c:5872 #, c-format msgid "%s: error: relocation %s not a multiple of 4" -msgstr "%s: fejl: relokaliseringen %s er ikke en multipel af 4" +msgstr "%s: fejl: relokeringen %s er ikke en multipel af 4" #: elf64-sparc.c:1280 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" -msgstr "%s: check_relocs: uhåndteret relokaliseringstype %d" +msgstr "%s: check_relocs: uhåndteret relokeringstype %d" #: elf64-sparc.c:1317 #, c-format @@ -1504,7 +1504,7 @@ msgstr "%s: versionsantal (%ld) stemmer ikke med symbolantal (%ld)" #: elflink.c:440 #, c-format msgid "%s: Section %s is too large to add hole of %ld bytes" -msgstr "%s: Sektionen %s er for stor til at stoppa hul med %ld byte i" +msgstr "%s: Sektionen %s er for stor til at stoppe hul med %ld byte i" #: elflink.h:1090 #, c-format @@ -1547,7 +1547,7 @@ msgstr "Fejl: ikke mere hukommelse" #: elflink.h:4781 msgid "Not enough memory to sort relocations" -msgstr "Ikke nok hukommelse til at sortere relokaliseringer" +msgstr "Ikke nok hukommelse til at sortere relokeringer" #: elflink.h:5682 elflink.h:5725 #, c-format @@ -1567,15 +1567,15 @@ msgstr "%s: kunne ikke finde uddatasektionen %s for inddatasektionen %s" #: elflink.h:6486 #, c-format msgid "%s: relocation size mismatch in %s section %s" -msgstr "%s: relokaliseringsstørrelsen stemmer ikke overens i %s-sektionen %s" +msgstr "%s: relokeringsstørrelsen stemmer ikke overens i %s-sektionen %s" #: elflink.h:6849 msgid "warning: relocation against removed section; zeroing" -msgstr "advarsel: relokalisering mod fjernet sektion; nulstiller" +msgstr "advarsel: relokering mod fjernet sektion; nulstiller" #: elflink.h:6879 msgid "warning: relocation against removed section" -msgstr "advarsel: relokalisering mod fjernet sektion" +msgstr "advarsel: relokering mod fjernet sektion" #: elflink.h:6892 #, c-format @@ -1598,12 +1598,12 @@ msgstr "%s: %s+0x%lx: hop til stubrutine som ikke er jal" #: elfxx-mips.c:4270 #, c-format msgid "%s: Malformed reloc detected for section %s" -msgstr "%s: Fejlagtig relokalisering for sektion %s opdaget" +msgstr "%s: Fejlagtig relokering for sektion %s opdaget" #: elfxx-mips.c:4348 #, c-format msgid "%s: CALL16 reloc at 0x%lx not against global symbol" -msgstr "%s: CALL16-relokalisering ved 0x%lx er ikke mod globalt symbol" +msgstr "%s: CALL16-relokering ved 0x%lx er ikke mod globalt symbol" #: elfxx-mips.c:7301 #, c-format @@ -1763,37 +1763,37 @@ msgstr "%s: uventet type efter ATN" #: ihex.c:258 #, c-format msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" -msgstr "%s:%d: uventet tegn \"%s\" i hexadecimal Intel-fil\n" +msgstr "%s:%d: uventet tegn \"%s\" i heksadecimal Intel-fil\n" #: ihex.c:366 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" -msgstr "%s:%u: fejlagtig kontrolsum i hexadecimal Intel-fil (forventede %u, fandt %u)" +msgstr "%s:%u: fejlagtig kontrolsum i heksadecimal Intel-fil (forventede %u, fandt %u)" #: ihex.c:420 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" -msgstr "%s:%u: fejlagtig længde på post for udvidet adresse i hexadecimal Intel-fil" +msgstr "%s:%u: fejlagtig længde på post for udvidet adresse i heksadecimal Intel-fil" #: ihex.c:437 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" -msgstr "%s:%u: fejlagtig længde på udvidet startadresse i hexadecimal Intel-fil" +msgstr "%s:%u: fejlagtig længde på udvidet startadresse i heksadecimal Intel-fil" #: ihex.c:454 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" -msgstr "%s:%u: fejlagtig længde på post for udvidet lineær adresse i hexadecimal Intel-fil" +msgstr "%s:%u: fejlagtig længde på post for udvidet lineær adresse i heksadecimal Intel-fil" #: ihex.c:471 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" -msgstr "%s:%u: fejlagtig længde på post for udvidet lineær startadresse i hexadecimal Intel-fil" +msgstr "%s:%u: fejlagtig længde på post for udvidet lineær startadresse i heksadecimal Intel-fil" #: ihex.c:488 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" -msgstr "%s:%u: ukendt ihex-type %u i hexadecimal Intel-fil\n" +msgstr "%s:%u: ukendt ihex-type %u i heksadecimal Intel-fil\n" #: ihex.c:607 #, c-format @@ -1808,7 +1808,7 @@ msgstr "%s: fejlagtig sektionslængde i ihex_read_sektion" #: ihex.c:860 #, c-format msgid "%s: address 0x%s out of range for Intel Hex file" -msgstr "%s: adressen 0x%s er udenfor intervallet for hexadecimal Intel-fil" +msgstr "%s: adressen 0x%s er uden for intervallet for heksadecimal Intel-fil" #: libbfd.c:492 #, c-format @@ -1837,7 +1837,7 @@ msgstr "%s: indirekte symbol \"%s\" til \"%s\" er en løkke" #: linker.c:2776 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" -msgstr "Forsøg at lave en relokaliseringsbar lænke med %s-inddata og %s-uddata" +msgstr "Forsøg at lave en relokérbar lænke med %s-inddata og %s-uddata" #: merge.c:892 #, c-format @@ -1852,7 +1852,7 @@ msgstr "%s: Ingen kerne til at allokere sektionsnavn %s\n" #: mmo.c:536 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" -msgstr "%s: Ingen kerne for at allokere et %d byte langt symbol\n" +msgstr "%s: Ingen kerne til at allokere et %d byte langt symbol\n" #: mmo.c:1245 #, c-format @@ -1862,12 +1862,12 @@ msgstr "%s: ugyldig mmo-fil: initieringsværdi for $255 er ikke \"Main\"\n" #: mmo.c:1391 #, c-format msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n" -msgstr "%s: bred tegnsekvens som ikke understøttes 0x%02X 0x%02X efter symbolnavnet som begynder med \"%s\"\n" +msgstr "%s: bred tegn-sekvens som ikke understøttes 0x%02X 0x%02X efter symbolnavnet som begynder med \"%s\"\n" #: mmo.c:1633 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" -msgstr "%s: ugyldig mmo-fil: lopkod \"%d\" understøttes ikke\n" +msgstr "%s: ugyldig mmo-fil: lopkode \"%d\" understøttes ikke\n" #: mmo.c:1643 #, c-format @@ -2028,7 +2028,7 @@ msgstr "%s: Ukendt maskintype (0x%x) i Import Library Format-arkiv" #: peicode.h:1174 #, c-format msgid "%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive" -msgstr "%s: Kendt men uhåndteret maskintype (0x%x) i Import Library Format-arkiv" +msgstr "%s: Kendt, men uhåndteret maskintype (0x%x) i Import Library Format-arkiv" #: peicode.h:1191 #, c-format @@ -2101,15 +2101,15 @@ msgstr "som_sizeof_headers er ikke implementeret" msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "%s:%d: Uventet tegn \"%s\" i S-postfil\n" -# Vad er stabs? +# Hvad er stabs? #: stabs.c:319 #, c-format msgid "%s(%s+0x%lx): Stabs entry has invalid string index." -msgstr "%s(%s+0x%lx): Stabpost har ugyldigt strengindex." +msgstr "%s(%s+0x%lx): Stabpost har ugyldigt strengindeks." #: syms.c:1044 msgid "Unsupported .stab relocation" -msgstr ".stab-relokalisering som ikke understøttes" +msgstr ".stab-relokering som ikke understøttes" #: vms-gsd.c:356 #, c-format @@ -2150,7 +2150,7 @@ msgstr "_bfd_vms_output_counted kaldt med nul byte" #: vms-misc.c:924 msgid "_bfd_vms_output_counted called with too many bytes" -msgstr "_bfd_vms_output_counted called kaldt med for mange byte" +msgstr "_bfd_vms_output_counted kaldt med for mange byte" #: vms-misc.c:1055 #, c-format @@ -2169,7 +2169,7 @@ msgstr "Ingen hukommelse!" #: vms-tir.c:362 #, c-format msgid "bad section index in %s" -msgstr "fejlagtigt sektionsindex i %s" +msgstr "fejlagtigt sektionsindeks i %s" #: vms-tir.c:375 #, c-format @@ -2263,17 +2263,17 @@ msgstr "objektkode %d kunne ikke findes" #: vms-tir.c:2019 #, c-format msgid "SEC_RELOC with no relocs in section %s" -msgstr "SEC_RELOC uden relokaliseringer i sektion %s" +msgstr "SEC_RELOC uden relokeringer i sektion %s" #: vms-tir.c:2307 #, c-format msgid "Unhandled relocation %s" -msgstr "Uhåndteret relokalisering %s" +msgstr "Uhåndteret relokering %s" #: xcofflink.c:1243 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" -msgstr "%s: \"%s\" har linjenumre men ingen omsluttende sektion" +msgstr "%s: \"%s\" har linjenumre, men ingen omsluttende sektion" #: xcofflink.c:1296 #, c-format @@ -2308,7 +2308,7 @@ msgstr "%s: fejlagtigt placeret XTY_LD \"%s\"" #: xcofflink.c:1957 #, c-format msgid "%s: reloc %s:%d not in csect" -msgstr "%s: relokaliseringen %s:%d er ikke i csect" +msgstr "%s: relokeringen %s:%d er ikke i csect" #: xcofflink.c:2092 #, c-format @@ -2337,26 +2337,26 @@ msgstr "advarsel: forsøg på at eksportere udefineret symbol \"%s\"" #: xcofflink.c:4447 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" -msgstr "TOC giver overløb: 0x%lx > 0x10000; prøv -mminimal-toc ved kompilering" +msgstr "TOC giver overløb: 0x%lx > 0x10000; prøv -mminimal-toc ved oversættelse" #: xcofflink.c:5287 xcofflink.c:5756 xcofflink.c:5818 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" -msgstr "%s: indlæserrelokalisering i ukendt sektion \"%s\"" +msgstr "%s: indlæserrelokering i ukendt sektion \"%s\"" #: xcofflink.c:5309 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" -msgstr "%s: \"%s\" i indlæserrelokalisering men ikke indlæsersym" +msgstr "%s: \"%s\" i indlæserrelokering, men ikke indlæsersym" #: xcofflink.c:5324 #, c-format msgid "%s: loader reloc in read-only section %s" -msgstr "%s: indlæserrelokalisering i skrivebeskyttet sektion %s" +msgstr "%s: indlæserrelokering i skrivebeskyttet sektion %s" #: elf32-ia64.c:2222 elf64-ia64.c:2222 msgid "@pltoff reloc against local symbol" -msgstr "@pltoff-relokalisering mod lokalt symbol" +msgstr "@pltoff-relokering mod lokalt symbol" #: elf32-ia64.c:3562 elf64-ia64.c:3562 #, c-format @@ -2376,12 +2376,12 @@ msgstr "%s: lænker ikke-pic-kode i delt bibliotek" #: elf32-ia64.c:3891 elf64-ia64.c:3891 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" -msgstr "%s: @gprel-relokalisering mod dynamisk symbol %s" +msgstr "%s: @gprel-relokering mod dynamisk symbol %s" #: elf32-ia64.c:4030 elf64-ia64.c:4030 #, c-format msgid "%s: dynamic relocation against speculation fixup" -msgstr "%s: dynamisk relokalisering uden spekulationsrettelser" +msgstr "%s: dynamisk relokering uden spekulationsrettelser" #: elf32-ia64.c:4038 elf64-ia64.c:4038 #, c-format @@ -2390,7 +2390,7 @@ msgstr "%s: spekulationsfix mod udefineret svagt symbol" #: elf32-ia64.c:4271 elf64-ia64.c:4271 msgid "unsupported reloc" -msgstr "relokaliseringen understøttes ikke" +msgstr "relokeringen understøttes ikke" #: elf32-ia64.c:4551 elf64-ia64.c:4551 #, c-format @@ -2425,11 +2425,11 @@ msgstr "%s: linjenummer giver overløb: 0x%lx > 0xffff" #: peigen.c:979 pepigen.c:979 #, c-format msgid "%s: reloc overflow 1: 0x%lx > 0xffff" -msgstr "%s: relokalisering giver overløb 1: 0x%lx > 0xffff" +msgstr "%s: relokering giver overløb 1: 0x%lx > 0xffff" #: peigen.c:993 pepigen.c:993 msgid "Export Directory [.edata (or where ever we found it)]" -msgstr "Exportkatalog [.edata (eller hvor vi fandt det)]" +msgstr "Eksportkatalog [.edata (eller hvor vi fandt det)]" #: peigen.c:994 pepigen.c:994 msgid "Import Directory [parts of .idata]" @@ -2449,7 +2449,7 @@ msgstr "Sikkerhedskatalog" #: peigen.c:998 pepigen.c:998 msgid "Base Relocation Directory [.reloc]" -msgstr "Baserelokaliseringskatalog [.reloc]" +msgstr "Baserelokeringskatalog [.reloc]" #: peigen.c:999 pepigen.c:999 msgid "Debug Directory" @@ -2535,7 +2535,7 @@ msgstr "" "\n" "Importtabellerne (tolket indhold i %s-sektion)\n" -# Vad er thunk? +# Hvad er thunk? #: peigen.c:1130 pepigen.c:1130 msgid "" " vma: Hint Time Forward DLL First\n" @@ -2555,7 +2555,7 @@ msgstr "" #: peigen.c:1192 pepigen.c:1192 msgid "\tvma: Hint/Ord Member-Name Bound-To\n" -msgstr "\tvma: Tips/Ordn Medlemsnavn Bundet till\n" +msgstr "\tvma: Tips/Ordn Medlemsnavn Bundet til\n" #: peigen.c:1217 pepigen.c:1217 msgid "" @@ -2580,7 +2580,7 @@ msgid "" "There is an export table in %s at 0x%lx\n" msgstr "" "\n" -"Det findes en eksporttabel i %s ved 0x%lx\n" +"Der findes en eksporttabel i %s ved 0x%lx\n" #: peigen.c:1393 pepigen.c:1393 #, c-format @@ -2600,7 +2600,7 @@ msgstr "Eksportflag \t\t\t%lx\n" #: peigen.c:1400 pepigen.c:1400 #, c-format msgid "Time/Date stamp \t\t%lx\n" -msgstr "Tids/datostempel \t\t%lx\n" +msgstr "Tids-/datostempel \t\t%lx\n" #: peigen.c:1403 pepigen.c:1403 #, c-format @@ -2694,7 +2694,7 @@ msgid "" " \t\tAddress Address Handler Data Address Mask\n" msgstr "" " vma:\t\tStart- Slut- EH- EH- Prologsluts- Undtagelses-\n" -" \t\tadresse adresse håndterere data adresse maske\n" +" \t\tadresse adresse håndterer data adresse maske\n" #: peigen.c:1624 pepigen.c:1624 msgid " Register save millicode" @@ -2716,7 +2716,7 @@ msgid "" msgstr "" "\n" "\n" -"PE-filbaserelokaliseringer (tolket indhold i .reloc-sektionen)\n" +"PE-filbaserelokeringer (tolket indhold i .reloc-sektionen)\n" #: peigen.c:1712 pepigen.c:1712 #, c-format @@ -2730,7 +2730,7 @@ msgstr "" #: peigen.c:1725 pepigen.c:1725 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" -msgstr "\trelokalisering %4d afstand %4x [%4lx] %s" +msgstr "\trelokering %4d afstand %4x [%4lx] %s" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to diff --git a/bfd/reloc.c b/bfd/reloc.c index b13f672..0885e03 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -4,21 +4,21 @@ Free Software Foundation, Inc. Written by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* SECTION @@ -645,7 +645,8 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd && ! howto->partial_inplace) + if ((output_bfd && ! howto->partial_inplace) + || reloc_target_output_section == NULL) output_base = 0; else output_base = reloc_target_output_section->vma; diff --git a/bfd/reloc16.c b/bfd/reloc16.c index 1db8daf..44d4f4f 100644 --- a/bfd/reloc16.c +++ b/bfd/reloc16.c @@ -199,30 +199,31 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) shrinks = (unsigned *) bfd_zmalloc (amt); /* Loop until nothing changes in this section. */ - do { - arelent **parent; - unsigned int i; - long j; - - another_pass = 0; - - for (i = 0, parent = reloc_vector; *parent; parent++, i++) - { - /* Let the target/machine dependent code examine each reloc - in this section and attempt to shrink it. */ - shrink = bfd_coff_reloc16_estimate (abfd, input_section, *parent, - shrinks[i], link_info); - - /* If it shrunk, note it in the shrinks array and set up for - another pass. */ - if (shrink != shrinks[i]) - { - another_pass = 1; - for (j = i + 1; j <= reloc_count; j++) - shrinks[j] += shrink - shrinks[i]; - } - } - } + do + { + arelent **parent; + unsigned int i; + long j; + + another_pass = 0; + + for (i = 0, parent = reloc_vector; *parent; parent++, i++) + { + /* Let the target/machine dependent code examine each reloc + in this section and attempt to shrink it. */ + shrink = bfd_coff_reloc16_estimate (abfd, input_section, *parent, + shrinks[i], link_info); + + /* If it shrunk, note it in the shrinks array and set up for + another pass. */ + if (shrink != shrinks[i]) + { + another_pass = 1; + for (j = i + 1; j <= reloc_count; j++) + shrinks[j] += shrink - shrinks[i]; + } + } + } while (another_pass); shrink = shrinks[reloc_count]; @@ -235,12 +236,12 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) } bfd_byte * -bfd_coff_reloc16_get_relocated_section_contents(in_abfd, - link_info, - link_order, - data, - relocateable, - symbols) +bfd_coff_reloc16_get_relocated_section_contents (in_abfd, + link_info, + link_order, + data, + relocateable, + symbols) bfd *in_abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; @@ -266,11 +267,11 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, symbols); /* Read in the section. */ - if (!bfd_get_section_contents(input_bfd, - input_section, - data, - (bfd_vma) 0, - input_section->_raw_size)) + if (!bfd_get_section_contents (input_bfd, + input_section, + data, + (bfd_vma) 0, + input_section->_raw_size)) return NULL; reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); diff --git a/bfd/simple.c b/bfd/simple.c index 10178a4..f0f5ee6 100644 --- a/bfd/simple.c +++ b/bfd/simple.c @@ -138,6 +138,21 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf) int storage_needed, number_of_symbols; asymbol **symbol_table; + if (! (sec->flags & SEC_RELOC)) + { + bfd_size_type size = bfd_section_size (abfd, sec); + + if (outbuf == NULL) + contents = bfd_malloc (size); + else + contents = outbuf; + + if (contents) + bfd_get_section_contents (abfd, sec, contents, 0, size); + + return contents; + } + /* In order to use bfd_get_relocated_section_contents, we need to forge some data structures that it expects. */ diff --git a/bfd/targets.c b/bfd/targets.c index e665898..6a68eaa 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -4,21 +4,21 @@ Free Software Foundation, Inc. Written by Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + This file is part of BFD, the Binary File Descriptor library. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -155,7 +155,11 @@ DESCRIPTION . bfd_target_msdos_flavour, . bfd_target_ovax_flavour, . bfd_target_evax_flavour, -. bfd_target_mmo_flavour +. bfd_target_mmo_flavour, +. bfd_target_mach_o_flavour, +. bfd_target_pef_flavour, +. bfd_target_pef_xlib_flavour, +. bfd_target_sym_flavour .}; . .enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -508,7 +512,6 @@ extern const bfd_target bfd_elf32_big_generic_vec; extern const bfd_target bfd_elf32_bigarc_vec; extern const bfd_target bfd_elf32_bigarm_oabi_vec; extern const bfd_target bfd_elf32_bigarm_vec; -extern const bfd_target bfd_elf32_bigarmqnx_vec; extern const bfd_target bfd_elf32_bigmips_vec; extern const bfd_target bfd_elf32_cris_vec; extern const bfd_target bfd_elf32_d10v_vec; @@ -522,7 +525,6 @@ extern const bfd_target bfd_elf32_hppa_vec; extern const bfd_target bfd_elf32_i370_vec; extern const bfd_target bfd_elf32_i386_freebsd_vec; extern const bfd_target bfd_elf32_i386_vec; -extern const bfd_target bfd_elf32_i386qnx_vec; extern const bfd_target bfd_elf32_i860_little_vec; extern const bfd_target bfd_elf32_i860_vec; extern const bfd_target bfd_elf32_i960_vec; @@ -533,7 +535,6 @@ extern const bfd_target bfd_elf32_little_generic_vec; extern const bfd_target bfd_elf32_littlearc_vec; extern const bfd_target bfd_elf32_littlearm_oabi_vec; extern const bfd_target bfd_elf32_littlearm_vec; -extern const bfd_target bfd_elf32_littlearmqnx_vec; extern const bfd_target bfd_elf32_littlemips_vec; extern const bfd_target bfd_elf32_m32r_vec; extern const bfd_target bfd_elf32_m68hc11_vec; @@ -554,8 +555,6 @@ extern const bfd_target bfd_elf32_pj_vec; extern const bfd_target bfd_elf32_pjl_vec; extern const bfd_target bfd_elf32_powerpc_vec; extern const bfd_target bfd_elf32_powerpcle_vec; -extern const bfd_target bfd_elf32_powerpcleqnx_vec; -extern const bfd_target bfd_elf32_powerpcqnx_vec; extern const bfd_target bfd_elf32_s390_vec; extern const bfd_target bfd_elf32_sh64_vec; extern const bfd_target bfd_elf32_sh64l_vec; @@ -568,9 +567,7 @@ extern const bfd_target bfd_elf32_shblin_vec; extern const bfd_target bfd_elf32_shl_vec; extern const bfd_target bfd_elf32_shlin_vec; extern const bfd_target bfd_elf32_shlnbsd_vec; -extern const bfd_target bfd_elf32_shlqnx_vec; extern const bfd_target bfd_elf32_shnbsd_vec; -extern const bfd_target bfd_elf32_shqnx_vec; extern const bfd_target bfd_elf32_sparc_vec; extern const bfd_target bfd_elf32_tradbigmips_vec; extern const bfd_target bfd_elf32_tradlittlemips_vec; @@ -652,6 +649,9 @@ extern const bfd_target m68knetbsd_vec; extern const bfd_target m68ksysvcoff_vec; extern const bfd_target m88kbcs_vec; extern const bfd_target m88kmach3_vec; +extern const bfd_target mach_o_be_vec; +extern const bfd_target mach_o_le_vec; +extern const bfd_target mach_o_fat_vec; extern const bfd_target mcore_pe_big_vec; extern const bfd_target mcore_pe_little_vec; extern const bfd_target mcore_pei_big_vec; @@ -668,6 +668,8 @@ extern const bfd_target or32coff_big_vec; extern const bfd_target pc532machaout_vec; extern const bfd_target pc532netbsd_vec; extern const bfd_target pdp11_aout_vec; +extern const bfd_target pef_vec; +extern const bfd_target pef_xlib_vec; extern const bfd_target pmac_xcoff_vec; extern const bfd_target ppcboot_vec; extern const bfd_target riscix_vec; @@ -687,6 +689,7 @@ extern const bfd_target sparclynx_aout_vec; extern const bfd_target sparclynx_coff_vec; extern const bfd_target sparcnetbsd_vec; extern const bfd_target sunos_big_vec; +extern const bfd_target sym_vec; extern const bfd_target tic30_aout_vec; extern const bfd_target tic30_coff_vec; extern const bfd_target tic4x_coff0_beh_vec; @@ -793,7 +796,6 @@ 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, @@ -807,7 +809,6 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_i370_vec, &bfd_elf32_i386_freebsd_vec, &bfd_elf32_i386_vec, - &bfd_elf32_i386qnx_vec, &bfd_elf32_i860_little_vec, &bfd_elf32_i860_vec, &bfd_elf32_i960_vec, @@ -820,7 +821,6 @@ 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, @@ -843,22 +843,20 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_pjl_vec, &bfd_elf32_powerpc_vec, &bfd_elf32_powerpcle_vec, - &bfd_elf32_powerpcleqnx_vec, - &bfd_elf32_powerpcqnx_vec, &bfd_elf32_s390_vec, &bfd_elf32_sh_vec, &bfd_elf32_shblin_vec, &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, &bfd_elf32_sh64lnbsd_vec, &bfd_elf32_sh64nbsd_vec, + &bfd_elf32_sh64lin_vec, + &bfd_elf32_sh64blin_vec, #endif &bfd_elf32_sparc_vec, &bfd_elf32_tradbigmips_vec, @@ -889,6 +887,8 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_sh64l_vec, &bfd_elf64_sh64lnbsd_vec, &bfd_elf64_sh64nbsd_vec, + &bfd_elf64_sh64lin_vec, + &bfd_elf64_sh64blin_vec, #if 0 &bfd_elf64_sparc_vec, #endif @@ -967,6 +967,9 @@ static const bfd_target * const _bfd_target_vector[] = { &m68ksysvcoff_vec, &m88kbcs_vec, &m88kmach3_vec, + &mach_o_be_vec, + &mach_o_le_vec, + &mach_o_fat_vec, &mcore_pe_big_vec, &mcore_pe_little_vec, &mcore_pei_big_vec, @@ -994,6 +997,8 @@ static const bfd_target * const _bfd_target_vector[] = { &pc532machaout_vec, &pc532netbsd_vec, &pdp11_aout_vec, + &pef_vec, + &pef_xlib_vec, #if 0 /* This has the same magic number as RS/6000. */ &pmac_xcoff_vec, @@ -1023,6 +1028,7 @@ static const bfd_target * const _bfd_target_vector[] = { &sparclynx_coff_vec, &sparcnetbsd_vec, &sunos_big_vec, + &sym_vec, &tic30_aout_vec, &tic30_coff_vec, &tic54x_coff0_beh_vec, @@ -1106,6 +1112,17 @@ const bfd_target *bfd_default_vector[] = { NULL }; +/* bfd_associated_vector[] contains the associated target vectors used + to reduce the ambiguity in bfd_check_format_matches. */ + +static const bfd_target *_bfd_associated_vector[] = { +#ifdef ASSOCIATED_VECS + ASSOCIATED_VECS, +#endif + NULL +}; +const bfd_target * const *bfd_associated_vector = _bfd_associated_vector; + /* When there is an ambiguous match, bfd_check_format_matches puts the names of the matching targets in an array. This variable is the maximum number of entries that the array could possibly need. */ diff --git a/bfd/version.h b/bfd/version.h index cb9b9a4..001aec5 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,3 +1,3 @@ -#define BFD_VERSION_DATE 20021025 +#define BFD_VERSION_DATE 20021115 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_string@ diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c index 0024122..10fbb2d 100644 --- a/bfd/vms-gsd.c +++ b/bfd/vms-gsd.c @@ -420,7 +420,7 @@ _bfd_vms_slurp_gsd (abfd, objtype) { bfd_set_error (bfd_error_no_memory); return -1; - } + } } } else @@ -661,13 +661,13 @@ _bfd_vms_slurp_gsd (abfd, objtype) } else /* symbol reference */ { - symbol->name = + symbol->name = _bfd_vms_save_counted_string (vms_rec+8); #if VMS_DEBUG vms_debug(4, "egsd sym ref #%d (%s, %04x=%s)\n", abfd->symcount, symbol->name, old_flags, flag2str(gsyflagdesc, old_flags)); #endif - symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME); + symbol->section = bfd_make_section (abfd, BFD_UND_SECTION_NAME); } symbol->flags = new_flags; @@ -901,7 +901,7 @@ _bfd_vms_write_gsd (abfd, objtype) unsigned long ca_psindx = 0; unsigned long psindx; - if (old_flags & BSF_FUNCTION) + if ((old_flags & BSF_FUNCTION) && symbol->udata.p != NULL) { code_address = ((asymbol *) (symbol->udata.p))->value; ca_psindx = ((asymbol *) (symbol->udata.p))->section->index; @@ -382,6 +382,7 @@ vms_object_p (abfd) const struct bfd_target *target_vector = 0; const bfd_arch_info_type *arch = 0; PTR tdata_save = abfd->tdata.any; + bfd_vma saddr_save = bfd_get_start_address (abfd); #if VMS_DEBUG vms_debug (1, "vms_object_p(%p)\n", abfd); @@ -519,6 +520,7 @@ vms_object_p (abfd) if (abfd->tdata.any != tdata_save && abfd->tdata.any != NULL) bfd_release (abfd, abfd->tdata.any); abfd->tdata.any = tdata_save; + bfd_set_start_address (abfd, saddr_save); return NULL; } |