From bc13a0c5958e501561da1e6b4a3ca1fadda52059 Mon Sep 17 00:00:00 2001 From: obrien Date: Tue, 26 Jun 2001 16:57:43 +0000 Subject: Import of GNU Binutils version 2.11.2. --- contrib/binutils/bfd/ChangeLog | 566 +++++++++ contrib/binutils/bfd/Makefile.am | 107 +- contrib/binutils/bfd/Makefile.in | 565 ++++++++- contrib/binutils/bfd/aclocal.m4 | 18 - contrib/binutils/bfd/aout-arm.c | 3 +- contrib/binutils/bfd/aout-encap.c | 2 +- contrib/binutils/bfd/aout-sparcle.c | 2 +- contrib/binutils/bfd/aout-target.h | 3 +- contrib/binutils/bfd/aout-tic30.c | 2 +- contrib/binutils/bfd/aout0.c | 3 +- contrib/binutils/bfd/aout32.c | 2 +- contrib/binutils/bfd/aout64.c | 2 +- contrib/binutils/bfd/aoutf1.h | 2 +- contrib/binutils/bfd/aoutx.h | 7 +- contrib/binutils/bfd/archive.c | 3 +- contrib/binutils/bfd/archures.c | 24 +- contrib/binutils/bfd/armnetbsd.c | 2 +- contrib/binutils/bfd/bfd-in.h | 3 +- contrib/binutils/bfd/bfd-in2.h | 25 +- contrib/binutils/bfd/bfd.c | 3 +- contrib/binutils/bfd/binary.c | 3 +- contrib/binutils/bfd/cache.c | 2 +- contrib/binutils/bfd/coff-alpha.c | 27 +- contrib/binutils/bfd/coff-arm.c | 67 +- contrib/binutils/bfd/coff-aux.c | 2 +- contrib/binutils/bfd/coff-i386.c | 13 +- contrib/binutils/bfd/coff-ppc.c | 3 +- contrib/binutils/bfd/coff-sparc.c | 2 +- contrib/binutils/bfd/coff-tic30.c | 2 +- contrib/binutils/bfd/coff-z8k.c | 3 +- contrib/binutils/bfd/coffcode.h | 635 +++++----- contrib/binutils/bfd/coffgen.c | 3 +- contrib/binutils/bfd/cofflink.c | 3 +- contrib/binutils/bfd/coffswap.h | 3 +- contrib/binutils/bfd/config.bfd | 18 +- contrib/binutils/bfd/config.in | 3 + contrib/binutils/bfd/configure | 961 ++++++++------- contrib/binutils/bfd/configure.in | 13 +- contrib/binutils/bfd/corefile.c | 3 +- contrib/binutils/bfd/cpu-alpha.c | 2 +- contrib/binutils/bfd/cpu-arm.c | 2 +- contrib/binutils/bfd/cpu-i386.c | 3 +- contrib/binutils/bfd/cpu-powerpc.c | 2 +- contrib/binutils/bfd/cpu-sparc.c | 2 +- contrib/binutils/bfd/cpu-v850.c | 2 +- contrib/binutils/bfd/cpu-z8k.c | 2 +- contrib/binutils/bfd/demo64.c | 2 +- contrib/binutils/bfd/doc/ChangeLog | 5 + contrib/binutils/bfd/doc/Makefile.in | 2 +- contrib/binutils/bfd/doc/archures.texi | 5 + contrib/binutils/bfd/doc/bfd.texinfo | 6 +- contrib/binutils/bfd/doc/bfdint.texi | 5 +- contrib/binutils/bfd/doc/chew.c | 2 +- contrib/binutils/bfd/doc/reloc.texi | 13 + contrib/binutils/bfd/doc/section.texi | 4 + contrib/binutils/bfd/dwarf1.c | 2 +- contrib/binutils/bfd/dwarf2.c | 9 +- contrib/binutils/bfd/ecoff.c | 38 +- contrib/binutils/bfd/ecofflink.c | 3 +- contrib/binutils/bfd/ecoffswap.h | 5 +- contrib/binutils/bfd/elf-bfd.h | 9 +- contrib/binutils/bfd/elf.c | 133 ++- contrib/binutils/bfd/elf32-arm.h | 62 +- contrib/binutils/bfd/elf32-i386.c | 59 +- contrib/binutils/bfd/elf32-ppc.c | 3 +- contrib/binutils/bfd/elf32-sparc.c | 64 +- contrib/binutils/bfd/elf32-v850.c | 4 +- contrib/binutils/bfd/elf32.c | 2 +- contrib/binutils/bfd/elf64-alpha.c | 64 +- contrib/binutils/bfd/elf64-gen.c | 12 +- contrib/binutils/bfd/elf64-sparc.c | 91 +- contrib/binutils/bfd/elfarm-nabi.c | 2 +- contrib/binutils/bfd/elfarm-oabi.c | 2 +- contrib/binutils/bfd/elfcode.h | 12 +- contrib/binutils/bfd/elfcore.h | 3 +- contrib/binutils/bfd/elflink.c | 7 +- contrib/binutils/bfd/elflink.h | 290 +++-- contrib/binutils/bfd/elfxx-target.h | 5 +- contrib/binutils/bfd/format.c | 3 +- contrib/binutils/bfd/freebsd.h | 3 +- contrib/binutils/bfd/gen-aout.c | 3 +- contrib/binutils/bfd/genlink.h | 2 +- contrib/binutils/bfd/hash.c | 3 +- contrib/binutils/bfd/host-aout.c | 2 +- contrib/binutils/bfd/i386aout.c | 3 +- contrib/binutils/bfd/i386bsd.c | 2 +- contrib/binutils/bfd/i386freebsd.c | 2 +- contrib/binutils/bfd/i386linux.c | 2 +- contrib/binutils/bfd/i386netbsd.c | 3 +- contrib/binutils/bfd/ieee.c | 7 +- contrib/binutils/bfd/ihex.c | 2 +- contrib/binutils/bfd/init.c | 3 +- contrib/binutils/bfd/libaout.h | 3 +- contrib/binutils/bfd/libbfd-in.h | 5 +- contrib/binutils/bfd/libbfd.c | 13 +- contrib/binutils/bfd/libbfd.h | 18 +- contrib/binutils/bfd/libcoff-in.h | 9 +- contrib/binutils/bfd/libcoff.h | 9 +- contrib/binutils/bfd/libecoff.h | 2 +- contrib/binutils/bfd/libieee.h | 2 +- contrib/binutils/bfd/linker.c | 11 +- contrib/binutils/bfd/netbsd-core.c | 3 +- contrib/binutils/bfd/netbsd.h | 2 +- contrib/binutils/bfd/opncls.c | 3 +- contrib/binutils/bfd/osf-core.c | 2 +- contrib/binutils/bfd/pe-arm.c | 2 +- contrib/binutils/bfd/pe-i386.c | 2 +- contrib/binutils/bfd/pe-ppc.c | 2 +- contrib/binutils/bfd/peXXigen.c | 2043 ++++++++++++++++++++++++++++++++ contrib/binutils/bfd/po/Make-in | 61 +- contrib/binutils/bfd/ppcboot.c | 3 +- contrib/binutils/bfd/ptrace-core.c | 3 +- contrib/binutils/bfd/reloc.c | 29 +- contrib/binutils/bfd/reloc16.c | 2 +- contrib/binutils/bfd/sco5-core.c | 2 +- contrib/binutils/bfd/section.c | 23 +- contrib/binutils/bfd/sparclinux.c | 2 +- contrib/binutils/bfd/sparcnetbsd.c | 3 +- contrib/binutils/bfd/srec.c | 3 +- contrib/binutils/bfd/stab-syms.c | 3 +- contrib/binutils/bfd/stabs.c | 2 +- contrib/binutils/bfd/syms.c | 3 +- contrib/binutils/bfd/sysdep.h | 3 +- contrib/binutils/bfd/targets.c | 17 +- contrib/binutils/bfd/tekhex.c | 2 +- contrib/binutils/bfd/trad-core.c | 3 +- 126 files changed, 5044 insertions(+), 1341 deletions(-) create mode 100644 contrib/binutils/bfd/peXXigen.c (limited to 'contrib/binutils/bfd') diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog index 380d1ff..6227438 100644 --- a/contrib/binutils/bfd/ChangeLog +++ b/contrib/binutils/bfd/ChangeLog @@ -1,3 +1,569 @@ +2001-06-19 Philip Blundell + + * configure.in: Set version to 2.11.2. + * configure: Regenerate. + +2001-06-19 Andreas Jaeger + + Merge from mainline sources: + 2001-06-19 Andreas Jaeger + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix creation of + dynamic symbols. + 2001-06-07 Andreas Jaeger + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Add an + assertion. + (elf64_x86_64_check_relocs): Set an alignment of 8 for .rela + sections; handle further relocations. + 2001-06-01 Andreas Jaeger + * elf64-x86-64.c (elf64_x86_64_relocate_section): Add PC8 + relocation, small reformatting. + +2001-06-14 Nick Clifton + + Merge from mainline sources: + 2001-04-27 Sean McNeil + * config.bfd: Add arm-vxworks target. + * coff-arm (coff_arm_relocate_section): Add in symbol value to + addend (fro VXworks targets). + 2001-03-06 Nick Clifton + * elf32-arm.h (elf32_arm_final_link_relocate): Clear bit zero + of offset in BLX(1) instruction. + * coff-arm.c (coff_arm_relocate_section): Clear bit zero of + offset in BLX(1) instruction. + Fix formatting. + 2001-03-06 Nick Clifton + * coff-arm.c (coff_arm_reloc_type_lookup): Add + BFD_RELOC_THUMB_PCREL_BLX. + 2001-05-04 Nick Clifton + * elf32-arm.h (elf32_arm_final_link_relocate): Set + EF_ARM_HASENTRY if the start address is set. + +2001-06-11 Alan Modra + + * configure.in (): Move powerpc-*-*bsd* after + powerpc-*-freebsd*. + + Merge from mainline. + 2001-06-02 H.J. Lu + * elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX + and ELFOSABI_HPUX. + * elf64-hppa.c (elf64_hppa_object_p): Likewise. + + 2001-06-02 Hans-Peter Nilsson + * section.c (_bfd_strip_section_from_output): Handle NULL + output_section. + + 2001-05-30 Alan Modra + * elf32-hppa.c (elf32_hppa_check_relocs): Don't NEED_PLT for + millicode. Don't allocate .got and .rela.got space here.. + (elf32_hppa_gc_sweep_hook): ..and no need to deallocate here.. + (elf32_hppa_adjust_dynamic_symbol): ..and don't allocate .plt and + .rela.plt here.. + (hppa_handle_PIC_calls): ..nor here.. + (allocate_plt_and_got): ..instead do it all here. New function. + (elf32_hppa_size_dynamic_sections): Allocate local .got space and + call allocate_plt_and_got. No need to zap .got if not dynamic. + (elf32_hppa_final_link): Call regular bfd_final_link instead of + gc_common_final_link. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf32_hppa_relocate_section): Use it here. + (elf32_hppa_finish_dynamic_symbol): Remove superfluous test of + dynamic_sections_created. + (hppa_type_of_stub): Don't LONG_BRANCH_VIA_PLT if millicode sym. + + 2001-05-28 Thiemo Seufer + * elflink.h (elf_link_size_reloc_section): Use bfd_zmalloc instead of + a zeroing loop. + (elf_link_output_relocs): Handle MIPS ELF64 relocations correctly. + (elf_link_input_bfd): Likewise. + (elf_reloc_link_order): Likewise. + (elf_finish_pointer_linker_section): Typo. Handle MIPS ELF64 + relocations correctly. + + 2001-05-28 Alan Modra + * elf32-hppa.c (elf32_hppa_relocate_section): Set up .plt entries + for symbols forced local that need plabels. + (elf32_hppa_adjust_dynamic_symbol): Don't allocate space in + .plt.rela for local syms if non-shared. + (hppa_build_one_stub): Mask lsb of plt.offset. + (elf32_hppa_finish_dynamic_symbol): Abort if lsb of plt.offset set. + (clobber_millicode_symbols): Correct comment. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + + 2001-05-25 Alan Modra + * elf32-hppa.c (elf32_hppa_relocate_section): Don't allow + undefined millicode syms in shared libs. + (hppa_build_one_stub): Turn BFD_ASSERTs into aborts. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (elf32_hppa_finish_dynamic_sections): Likewise. + + 2001-05-23 Alexandre Oliva + * elf64-sparc.c (sparc64_elf_slurp_reloc_table): Fix typo + s/ENTIRES/ENTRIES/. + + 2001-05-23 Thiemo Seufer + * reloc.c (bfd_reloc_code_real): Add MIPS ELF64 relocations. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * aoutx.h (aout_@var{size}_machine_type): Add MIPS r12k support. + * archures.c (bfd_mach_mips12000): Define. + * cpu-mips.c (arch_info_struct): Add MIPS r12k support. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Add MIPS r12k + support. + (_bfd_mips_elf_size_dynamic_sections): Use official bfd typedef. + * bfd-in2.h: Regenerate. + * elfxx-target.h: Do not redefine bfd_elfNN_bfd_make_debug_symbol. + + 2001-05-23 Nick Clifton + * elf-bfd.h (NUM_SHDR_ENTRIES): New macro: compute the number + of entries in a structured section. + * elf.c: Use new macro. + * elf32-i386.c: Use new macro. + * elf32-mips.c: Use new macro. + * elf64-alpha.c: Use new macro. + * elf64-sparc.c: Use new macro. + * elfcode.h: Use new macro. + * elflink.h: Use new macro. + + 2001-05-21 Andreas Jaeger + * dwarf2.c (decode_line_info): Fix error message. + (read_abbrevs): Fix test for offset as suggested by Alan Modra and + adjust error message. + + 2001-05-17 H.J. Lu + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the + version definition to basename of the output filename. + + 2001-05-15 Alexandre Oliva + * elf-m10300.c (mn10300_elf_relax_section): Don't relax + negative 32-bit operands to 16 operands when the operand is + going to be zero-extended by the modified opcode. + + 2001-05-11 Jakub Jelinek + * elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind + sections as well. + (elfNN_ia64_final_write_processing): Map .gnu.linkonce.ia64unw.FOO + to .gnu.linkonce.t.FOO text section. + + 2001-05-11 Nick Clifton + * dwarf1.c (_bfd_dwarf1_find_nearest_line): Change type of 'addr' + to be unsigned long, in order to match its use. + + 2001-05-10 H.J. Lu + * linker.c (_bfd_generic_link_add_one_symbol): Check loop on + indirect symbols. + + 2001-05-09 H.J. Lu + * elflink.h (elf_link_add_object_symbols): Fix a typo. Allocate + versymhdr->sh_size bytes for extversym instead of hdr->sh_size. + Remove the unused veriable `dynver'. + + 2001-05-07 Thiemo Seufer + * elf.c (_bfd_elf_slurp_version_tables): Change maxidx to unsigned, it + is always a positive integer. Cast away sign mismatch. + * elf32-mips.c: Fix misleading comment and typo. + (_bfd_mips_elf_section_from_bfd_section): Remove unused attribute, use + correct data type. + * elflink.c: Fix typo. + (_bfd_elf_create_dynamic_sections): Remove superfluous initialization. + * ecoffswap.h (ecoff_swap_fdr_in): Cast away sign mismatch. + + 2001-05-03 Nick Clifton + * targets.c (_bfd_target_vector_entries): Compute value based on + the size of the _bfd_target_vector and not bfd_target_vector. + + 2001-05-03 Andreas Jaeger + * elf64-gen.c (elf_generic_info_to_howto): Add unused attribute. + (elf_generic_info_to_howto_rel): Likewise. + * coff-alpha.c (reloc_nil): Likewise. + (alpha_ecoff_bad_format_hook): Likewise. + (alpha_adjust_reloc_out): Likewise. + (alpha_bfd_reloc_type_lookup): Likewise. + (alpha_convert_external_reloc): Likewise. + * elf64-alpha.c (elf64_alpha_reloc_nil): Likewise. + (elf64_alpha_reloc_bad): Likewise. + (elf64_alpha_reloc_gpdisp): Likewise. + (elf64_alpha_bfd_reloc_type_lookup): Likewise. + (elf64_alpha_info_to_howto): Likewise. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_create_got_section): Likewise. + (elf64_alpha_is_local_label_name): Likewise. + (elf64_alpha_merge_ind_symbols): Likewise. + * elf64-mips.c (mips_elf64_reloc_type_lookup): Likewise. + (mips_elf64_get_reloc_upper_bound): Likewise. + * nlm32-alpha.c (nlm_alpha_mangle_relocs): Likewise. + (nlm_alpha_get_public_offset): Likewise. + + 2001-04-30 H.J. Lu + * elf.c (_bfd_elf_link_hash_hide_symbol): Set dynindx to -1 + only for ELF_LINK_FORCED_LOCAL. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. + * elflink.h (elf_fix_symbol_flags): Set ELF_LINK_FORCED_LOCAL + if the symbol has hidden or internal visibility. + + 2001-04-14 Mark Elbrecht + * coffcode.h (coff_write_object_contents): Use + bfd_coff_swap_filehdr_out instead of coff_swap_filehdr_out. + + 2001-04-09 Hans-Peter Nilsson + * elflink.h (elf_fix_symbol_flags): For non-default visibilities, + only hide symbols marked STV_INTERNAL or STV_HIDDEN. + + 2001-04-05 Steven J. Hill + * config.bfd (mips*el*-*-linux-gnu*): Use traditional little + endian MIPS ELF target. + (mips*-*-linux-gnu*): Use traditional big endian MIPS ELF target. + * configure.in (bfd_elf64_tradbigmips_vec): New. Traditional + 64bit big endian MIPS ELF target. + (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little + endian MIPS ELF target. + * configure: Regenerated. + * elf32-mips.c (IRIX_COMPAT): Handle traditional 64bit and + little endian targets. + (mips_elf_sym_is_global): Handle traditional targets. + * elf64-mips.c (bfd_elf64_tradbigmips_vec): New. Traditional + 64bit big endian MIPS ELF target. + (bfd_elf64_tradlittlemips_vec): New. Traditional 64bit little + endian MIPS ELF target. + * targets.c: (_bfd_target_vector): Add bfd_elf64_tradbigmips_vec + and bfd_elf64_tradlittlemips_vec. + + 2001-04-04 Alan Modra + * elflink.h (elf_fix_symbol_flags): Call elf_backend_hide_symbol + when -Bsymbolic causes a symbol to no longer need a .plt entry. + + 2001-04-03 David Mosberger + * efi-app-ia32.c (ALIGN_SECTIONS_IN_FILE): Deleted. + + 2001-03-30 H.J. Lu + * efi-app-ia32.c (PEI_TARGET_SUBSYSTEM): Rename from ... + (PEI_DEFAULT_TARGET_SUBSYSTEM): This. + + 2001-03-23 Nick Clifton + * Makefile.am (BUILD_CFILES): New variable: List of C source + files created in build directory. + (BUILD_HFILES): New variable: List of header files created in + build directory. + (POTFILES): Delete. + (po/POTFILES.in): Replace rule with empty entry. + (po/SRC-POTFILES.in): New rule: Create a list of source files + in the source directory. + (po/BLD-POTFILES.in): New rule: Create a list of source files + in the build directory. + (MOSTLYCLEAN): Do not delete source files created in build + directory. + * Makefile.in: Regenerate. + * configure.in: Insert SRC-POTFILES.in and BLD-POTFILES.in + into po/Makefile. + * configure: Regenerate. + * po/Make-in: Replace occurrences of POTFILES with SRC-POTFILES + and BLD_POTFILES. + Add .. to the search path when building bfd.pot. + Delete POTFILES when performing distclean. + Add comment describing why distclean is broken in maintainer mode. + * po/POTFILES.in: Delete. + * po/SRC-POTFILES.in: New file. + * po/BLD-POTFILES.in: New file. + * po/bfd.pot: Regenerate. + + 2001-03-06 Igor Shevlyakov + * archures.c (bfd_default_scan): Add Coldfire CPUs. + * bfd-in2.h: Regenerate. + * cpu-m68k.c: Add Coldfire CPUs for arch table. + * ieee.c (ieee_write_processor): Set proper id for + Coldfire CPUs. + + 2001-02-27 H.J. Lu + * aoutx.h (NAME(aout,bfd_free_cached_info)): Return true if + abfd->tdata.aout_data == NULL. + + 2001-02-26 Nick Clifton + * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Tidy + up, replacing multiple if statements with a switch. + (handle_COMDAT): New function. + + 2001-02-26 H.J. Lu + * coffcode.h (styp_to_sec_flags) [COFF_WITH_PE version]: Issue + a warning for section flags we do not handle instead of + aborting. + + 2001-02-19 Jakub Jelinek + * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Likewise. + + 2001-02-18 Jim Kingdon + * irix-core.c (irix_core_core_file_p): Set the architecture (GDB + multiarch needs it). + + 2001-02-18 H.J. Lu + * elflink.h (elf_link_input_bfd): Ignore invalid section symbol + index. + + 2001-02-18 Kazu Hirata + * vms-misc.c: Fix formatting. + + 2001-02-16 Kazu Hirata + * vms.c: Fix formatting. + + 2001-02-14 H.J. Lu + * elf.c (elf_find_function): New function. + (_bfd_elf_find_nearest_line): Call elf_find_function () to find + the file name and function name. + + 2001-02-14 Nick Clifton + * Makefile.am (BFD32_BACKENDS_CFILES): Remove peigen.c + (BFD64_BACKENDS): Add pepigen.c + Add rules to create peigen.c and pepigen.c from peXXigen.c. + + 2001-02-14 H.J. Lu + * libcoff-in.h (pe_tdata): Add members target_subsystem and + force_minimum_alignment. + + 2001-02-13 Kazu Hirata + * vms.c (vms_print_symbol): Remove unreachable code. + * rs6000-core.c: Fix formatting. + + 2001-02-13 David Mosberger + * peicode.h (coff_swap_filehdr_out) [COFF_IMAGE_WITH_PE]: Define + as _bfd_XXi_only_swap_filehdr_out. + (pe_mkobject) [PEI_FORCE_MINIMUM_ALIGNMENT]: Set + pe->force_minimum_alignment to TRUE. + (pe_mkobject) [PEI_TARGET_SUBSYSTEM]: Set pe->target_subsystem to + PEI_TARGET_SUBSYSTEM. + (pe_print_private_bfd_data): Call + _bfd_XX_print_private_bfd_data_common() instead of + _bfd_pe_print_private_bfd_data_common(). + (pe_bfd_copy_private_bfd_data): Call + _bfd_XX_bfd_copy_private_bfd_data_common() instead of + _bfd_pe_bfd_copy_private_bfd_data_common(). + (coff_bfd_copy_private_section_data): Define as + _bfd_XX_bfd_copy_private_section_data instead of + _bfd_pe_bfd_copy_private_section_data. + (coff_get_symbol_info): Define as _bfd_XX_get_symbol_info instead + of a _bfd_pe_get_symbol_info. + * peigen.c: Delete. + * peXXigen.c: Renamed from peigen.c. + (COFF_WITH_XX): Define this macro (will get expanded into + COFF_WITH_pep or COFF_WITH_pe, depending on whether this is being + compiled as peigen.c or pepigen.c. + [COFF_WITH_pep]: Include "coff/ia64.h" instead of "coff/i386.h" to + define the canonical PEP structures and definitions. + (_bfd_XXi_swap_aouthdr_out): If pe->force_minimum_alignment is in + effect, enforce minimum file and section alignments. If + extra->Subsystem is IMAGE_SUBSYSTEM_UNKNOWN, set it to + pe->target_subsystem (this defaults to IMAGE_SUBSYSTEM_UNKNOWN, + so, by default, this is a no-op). + * libpei.h: Rename COFF_WITH_PEP to COFF_WITH_pep. + (_bfd_XX_bfd_copy_private_bfd_data_common): Add macros to map + _bfd_XXfoo to _bfd_pepfoo if COFF_WIT_PEP is defined and to + _bfd_pefoo if it's not defined. Use these macros to define + coff swap macros. + * libcoff.h (pe_tdata): Add members target_subsystem and + force_minimum_alignment. + * efi-app-ia64.c (COFF_WITH_pep): Rename COFF_WITH_PEP to + COFF_WITH_pep. + (PEI_TARGET_SUBSYSTEM): Rename from PEI_DEFAULT_TARGET_SUBSYSTEM. + * configure.in (bfd_efi_app_ia64_vec): Use pepigen.lo instead of + peigen.lo. + * coff-ia64.c: Rename COFF_WITH_PEP to COFF_WITH_pep. + (AOUTSZ): Rename PEP64AOUTSZ and PEP64AOUTHDR to PEPAOUTSZ and + PEPAOUTHDR. + * Makefile.in (BFD64_BACKENDS): Mention pepigen.lo. + (BFD64_BACKENDS_CFILES): Mention pepigen.c + (peigen.c): Add rule to generate from peXXigen.c. + (pepigen.c): Ditto. + (pepigen.lo): List dependencies for pepigen.lo. + + 2001-02-11 H.J. Lu + * elflink.h (elf_bfd_final_link): Use file_align for SYMTAB + alignment. + + 2001-02-11 Maciej W. Rozycki + * elf32-mips.c (mips_elf_create_dynamic_relocation): Undo patch + from 2000-10-13. Do not add the symbol's value for R_MIPS_REL32 + relocations against dynsym symbols. + * elf32-mips.c (elf_mips_howto_table): Fix the comment on + the R_MIPS_26 relocation. + (mips_elf_calculate_relocation): Use (p + 4) instead of p for + the R_MIPS_26 relocation. + (mips_elf_perform_relocation): Fix the comment on the R_MIPS16_26 + relocation. + * elf64-mips.c (mips_elf64_howto_table_rel): Fix the comment on + the R_MIPS_26 relocation. + (mips_elf64_howto_table_rela): Likewise. + * elf32-mips.c (struct mips_elf_link_hash_entry): Added no_fn_stub + member to mark symbols that have non-CALL relocations against + them. + (mips_elf_link_hash_newfunc): Initialize no_fn_stub. + (mips_elf_calculate_relocation): Handle R_MIPS_CALL16 like + R_MIPS_GOT16. + (_bfd_mips_elf_check_relocs): Set no_fn_stub for a symbol if a + non-CALL relocation against it is encountered. + (_bfd_mips_elf_copy_indirect_symbol): Merge no_fn_stub as well. + (_bfd_mips_elf_adjust_dynamic_symbol): Only create a stub if + no_fn_stub is not set. + * elf32-mips.c (mips_elf_output_extsym): Get the output section + information from the real symbol for indirect ones. + Check no_fn_stub to find out if a symbol has a function stub + indeed. + + 2001-02-09 Jakub Jelinek + * elf64-sparc.c (sparc64_elf_copy_private_bfd_data): New function. + + 2001-02-09 Mark Kettenis + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Treat R_SPARC_UA32 + similar to R_SPARC_32. + * elf64-sparc.c (sparc64_elf_howto_table): Likewise. + + 2001-02-08 Richard Henderson + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Respect weakness + before visibility. Locally defined protected symbols are not + dynamic. + + 2001-02-07 Jakub Jelinek + * elflink.h (is_global_symbol_definition): Rename to + is_global_data_symbol_definition and have it reject function + symbols. + (elf_link_is_defined_archive_symbol): Use renamed function. + + 2001-02-07 Todd Vierling + * libbfd-in.h (bfd_target_vector): Change extern array to pointer. + * libbfd.h (bfd_target_vector): Likewise. + * targets.c (bfd_target_vector): Rename to _bfd_target_vector and + make static; create pointer reference named bfd_target_vector. + (_bfd_target_vector_entries): Calculate this based on the array + typed _bfd_target_vector. + + 2001-02-06 H.J. Lu + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Only hidden and + internal symbols are not dynamic. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. + + 2001-02-06 Kazu Hirata + * elf-m10200.c: Fix formatting. + + 2001-02-01 Kazu Hirata + * elf-m10300.c: Fix formatting. + +2001-06-10 Philip Blundell + + * configure.in: Set version to 2.11.1. + * configure: Regenerate. + +2001-06-09 Philip Blundell + + * elf32-arm.h (elf32_arm_plt0_entry): Correct error in last + change. + (elf32_arm_plt_entry): Likewise. + +2001-06-07 Alan Modra + + * Most files: Update copyright notices. + +2001-05-29 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Handle R_X86_64_64. + (elf64_x86_64_relocate_section): Likewise. + +2001-05-28 Andreas Jaeger + + * elf64-x86-64.c (elf64_86_64_size_info): Remove, we can use the + generic version since we want a hashsize of 4. + (elf_backend_size_info): Likewise. + +2001-05-28 Nicolas Pitre + + * elf32-arm.h: Fix PLT generation for big endian ARM. + +2001-05-28 Jeff Sturm + + * reloc.c: Add BFD_RELOC_SPARC_UA16 and BFD_RELOC_SPARC_UA64. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * elf32-sparc.c: Enable BFD_RELOC_SPARC_UA16, BFD_RELOC_SPARC_UA32 + and BFD_RELOC_SPARC_UA64 mapping + * elf64-sparc.c: Likewise. + +2001-05-23 Alan Modra + + Merge from mainline. + 2001-05-17 Alan Modra + * elf32-hppa.c (hppa_build_one_stub): Add an assert to check + plt.offset. + + 2001-05-16 Alan Modra + * section.c (asection): Add linker_has_input field. + (STD_SECTION): Adjust initialization to suit. + * ecoff.c (bfd_debug_section): Likewise. + * bfd-in2.h: Regenerate. + + 2001-05-07 Thiemo Seufer + * ecoff.c (bfd_debug_section): Fix initialization. + + 2001-05-12 Peter Targett + * cpu-arc.c (arch_info_struct): Add entry 'base' representing old + name for 'arc5' core versions. + (bfd_arc_arch): Make bfd_mach_arc_6 default. + * elf32-arc.c (arc_elf_object_p): Make E_ARC_MACH_ARC6 default + architecture. + (arc_elf_final_write_processing): Make bfd_mach_arc_6 default. + + 2001-05-08 Ian Lance Taylor + * coff-i386.c (coff_i386_reloc): Don't dump core if output_bfd is + NULL or is not COFF. + (coff_i386_rtype_to_howto): Don't dump core if output section + owner is not COFF. + + 2001-04-13 Roger Sayle + * coff-i386.c (TARGET_SYM): SEC_READONLY is an applicable section + flag on pe-i386 targets. + + 2001-04-26 H.J. Lu + * elf32-i386.c (elf_i386_check_relocs): Verify if r_symndx is + valid. + + 2001-04-05 David Mosberger + * elf32-i386.c (elf_i386_fake_sections): Treat ".reloc" as an + ordinary "progbits" section. + +2001-05-04 Richard Henderson + + * elf64-alpha.c (SREL16, SREL32, SREL64): Set pcrel_offset true. + +2001-04-30 Andreas Jaeger , Andreas Schwab + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Correct test for + R_X86_64_GOTPCREL, don't use assignments instead of comparisons. + +2001-04-27 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Only swap + out handled entries. + (elf64_x86_64_finish_dynamic_symbol): Set up GOT entries. + (elf64_x86_64_relocate_section): Fix GOTPCREL calculation. + (elf64_x86_64_relocate_section): Merge entries for GOTPCREL and + GOT32. + +2001-04-30 Alan Modra + + * elf32-hppa.c (final_link_relocate): Branch to .+8 for + calls to undefined weak symbols. + +2001-04-19 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_plt0_entry): Fix instructions. + (elf64_x86_64_plt_entry): Likewise. + (elf64_x86_64_finish_dynamic_sections): Fix PLT0 generation. + (elf64_x86_64_finish_dynamic_symbol): Fix PLT generation. + 2001-03-31 Philip Blundell From 2001-03-26 H.J. Lu diff --git a/contrib/binutils/bfd/Makefile.am b/contrib/binutils/bfd/Makefile.am index b6741bc..630cbe1 100644 --- a/contrib/binutils/bfd/Makefile.am +++ b/contrib/binutils/bfd/Makefile.am @@ -385,7 +385,6 @@ BFD32_BACKENDS_CFILES = \ pei-sh.c \ pe-mips.c \ pei-mips.c \ - peigen.c \ ppcboot.c \ reloc16.c \ riscix.c \ @@ -420,7 +419,8 @@ BFD64_BACKENDS = \ elf64-sparc.lo \ elf64.lo \ nlm32-alpha.lo \ - nlm64.lo + nlm64.lo \ + pepigen.lo BFD64_BACKENDS_CFILES = \ aout64.c \ @@ -431,7 +431,6 @@ BFD64_BACKENDS_CFILES = \ elf64-x86-64.c \ elf64-alpha.c \ elf64-hppa.c \ - elf64-ia64.c \ elf64-gen.c \ elf64-mips.c \ elf64-sparc.c \ @@ -469,13 +468,18 @@ TDEFAULTS = @tdefaults@ INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl # C source files that correspond to .o's. -CFILES = \ +SOURCE_CFILES = \ $(BFD_LIBS_CFILES) \ $(ALL_MACHINES_CFILES) \ $(BFD32_BACKENDS_CFILES) \ $(BFD64_BACKENDS_CFILES) \ $(OPTIONAL_BACKENDS_CFILES) +BUILD_CFILES = \ + elf32-ia64.c elf64-ia64.c peigen.c pepigen.c + +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 \ @@ -485,15 +489,32 @@ SOURCE_HFILES = \ libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h -HFILES = \ - elf32-target.h elf64-target.h targmatch.h \ - $(SOURCE_HFILES) +## ... and all .h files which are in the build tree. +BUILD_HFILES = \ + elf32-target.h elf64-target.h targmatch.h + +HFILES = $(SOURCE_HFILES) $(BUILD_HFILES) + +SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES) +BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES) + +po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES) + for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp \ + && mv tmp $(srcdir)/po/SRC-POTFILES.in + +po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES) + for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp \ + && mv tmp $(srcdir)/po/BLD-POTFILES.in -POTFILES = $(CFILES) $(SOURCE_HFILES) +# The following target is retained for upgrade purposes. +# This target used to exist in older versions of this makefile, and was +# referenced by /po/Makefile (which is created from /po/Make-in) +# So old versions of /po/Makefile will try to regenerate themselves +# when make is next run, but that dependency cannot be completed without a build +# of po/POTFILES.in. Hence the presence of this rule. This rule will be deleted +# once it is no longer needed - probably in the fall of 2001. +po/POTFILES.in: -po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ - && mv tmp $(srcdir)/po/POTFILES.in diststuff: info @@ -535,6 +556,7 @@ stamp-lib: libbfd.la libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \ if [ -f $$libtooldir/libbfd.a ]; then \ cp $$libtooldir/libbfd.a libbfd.tmp; \ + $(RANLIB) libbfd.tmp; \ $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \ else true; fi touch stamp-lib @@ -578,6 +600,16 @@ elf64-ia64.c : elfxx-ia64.c sed -e s/NN/64/g < $(srcdir)/elfxx-ia64.c > elf64-ia64.new mv -f elf64-ia64.new elf64-ia64.c +peigen.c : peXXigen.c + rm -f peigen.c + sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new + mv -f peigen.new peigen.c + +pepigen.c : peXXigen.c + rm -f pepigen.c + sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new + mv -f pepigen.new pepigen.c + BFD_H_DEPS= $(INCDIR)/ansidecl.h LOCAL_H_DEPS= libbfd.h sysdep.h config.h $(BFD_LIBS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) @@ -690,12 +722,13 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h touch stmp-lcoff-h -MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \ - targmatch.h +MOSTLYCLEANFILES = ofiles stamp-ofiles CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ stmp-bin2-h stmp-lbfd-h stmp-lcoff-h +DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) + # We want to rerun configure if config.bfd or configure.host change. config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host $(SHELL) ./config.status --recheck @@ -737,6 +770,9 @@ stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def +dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h @@ -905,9 +941,6 @@ cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h -dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h ecoff.lo: ecoff.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def libaout.h $(INCDIR)/aout/aout64.h \ @@ -978,10 +1011,6 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1185,9 +1214,6 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ libpei.h -peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h libpei.h ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/internal.h libcoff.h @@ -1242,6 +1268,10 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h +elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/x86-64.h \ + $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/alpha.h \ @@ -1249,18 +1279,11 @@ elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ libecoff.h ecoffswap.h elf64-target.h -elf64-hppa.lo: elf64-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ - libhppa.h elf64-hppa.h elf-hppa.h elf64-target.h -elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf64-target.h -elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h \ - $(INCDIR)/elf/reloc-macros.h elf64-target.h +elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \ + elf64-hppa.h elf-hppa.h elf64-target.h elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf64-target.h @@ -1296,4 +1319,18 @@ sco5-core.lo: sco5-core.c $(INCDIR)/filenames.h libaout.h \ trad-core.lo: trad-core.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h cisco-core.lo: cisco-core.c $(INCDIR)/filenames.h +elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ + $(INCDIR)/elf/reloc-macros.h elf64-target.h +peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h libpei.h +pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/ia64.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h libpei.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/contrib/binutils/bfd/Makefile.in b/contrib/binutils/bfd/Makefile.in index 0c60c1c..10beb2d 100644 --- a/contrib/binutils/bfd/Makefile.in +++ b/contrib/binutils/bfd/Makefile.in @@ -144,41 +144,447 @@ BFD_H = bfd.h # for the debugger, so if you are downloading things as S-records you # need two copies of the executable, one to download and one for the # debugger). -BFD_LIBS = archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo dwarf2.lo +BFD_LIBS = \ + archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \ + format.lo init.lo libbfd.lo opncls.lo reloc.lo \ + section.lo syms.lo targets.lo hash.lo linker.lo \ + srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \ + dwarf2.lo -BFD_LIBS_CFILES = archive.c archures.c bfd.c cache.c coffgen.c corefile.c format.c init.c libbfd.c opncls.c reloc.c section.c syms.c targets.c hash.c linker.c srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c dwarf2.c +BFD_LIBS_CFILES = \ + archive.c archures.c bfd.c cache.c coffgen.c corefile.c \ + format.c init.c libbfd.c opncls.c reloc.c \ + section.c syms.c targets.c hash.c linker.c \ + srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \ + dwarf2.c # This list is alphabetized to make it easier to keep in sync # with the decls and initializer in archures.c. -ALL_MACHINES = cpu-a29k.lo cpu-alpha.lo cpu-arc.lo cpu-arm.lo cpu-avr.lo cpu-cris.lo cpu-d10v.lo cpu-d30v.lo cpu-fr30.lo cpu-h8300.lo cpu-h8500.lo cpu-hppa.lo cpu-ia64.lo cpu-i370.lo cpu-i386.lo cpu-i860.lo cpu-i960.lo cpu-m32r.lo cpu-m68hc11.lo cpu-m68hc12.lo cpu-m68k.lo cpu-m88k.lo cpu-m10200.lo cpu-m10300.lo cpu-mcore.lo cpu-mips.lo cpu-ns32k.lo cpu-pj.lo cpu-powerpc.lo cpu-rs6000.lo cpu-sh.lo cpu-sparc.lo cpu-tic30.lo cpu-tic54x.lo cpu-tic80.lo cpu-v850.lo cpu-vax.lo cpu-we32k.lo cpu-w65.lo cpu-z8k.lo - - -ALL_MACHINES_CFILES = cpu-a29k.c cpu-alpha.c cpu-arc.c cpu-arm.c cpu-avr.c cpu-cris.c cpu-d10v.c cpu-d30v.c cpu-fr30.c cpu-h8300.c cpu-h8500.c cpu-hppa.c cpu-ia64.c cpu-i370.c cpu-i386.c cpu-i860.c cpu-i960.c cpu-m32r.c cpu-m68hc11.c cpu-m68hc12.c cpu-m68k.c cpu-m88k.c cpu-m10200.c cpu-m10300.c cpu-mcore.c cpu-mips.c cpu-ns32k.c cpu-pj.c cpu-powerpc.c cpu-rs6000.c cpu-sh.c cpu-sparc.c cpu-tic30.c cpu-tic54x.c cpu-tic80.c cpu-v850.c cpu-vax.c cpu-we32k.c cpu-w65.c cpu-z8k.c +ALL_MACHINES = \ + cpu-a29k.lo \ + cpu-alpha.lo \ + cpu-arc.lo \ + cpu-arm.lo \ + cpu-avr.lo \ + cpu-cris.lo \ + cpu-d10v.lo \ + cpu-d30v.lo \ + cpu-fr30.lo \ + cpu-h8300.lo \ + cpu-h8500.lo \ + cpu-hppa.lo \ + cpu-ia64.lo \ + cpu-i370.lo \ + cpu-i386.lo \ + cpu-i860.lo \ + cpu-i960.lo \ + cpu-m32r.lo \ + cpu-m68hc11.lo \ + cpu-m68hc12.lo \ + cpu-m68k.lo \ + cpu-m88k.lo \ + cpu-m10200.lo \ + cpu-m10300.lo \ + cpu-mcore.lo \ + cpu-mips.lo \ + cpu-ns32k.lo \ + cpu-pj.lo \ + cpu-powerpc.lo \ + cpu-rs6000.lo \ + cpu-sh.lo \ + cpu-sparc.lo \ + cpu-tic30.lo \ + cpu-tic54x.lo \ + cpu-tic80.lo \ + cpu-v850.lo \ + cpu-vax.lo \ + cpu-we32k.lo \ + cpu-w65.lo \ + cpu-z8k.lo + + +ALL_MACHINES_CFILES = \ + cpu-a29k.c \ + cpu-alpha.c \ + cpu-arc.c \ + cpu-arm.c \ + cpu-avr.c \ + cpu-cris.c \ + cpu-d10v.c \ + cpu-d30v.c \ + cpu-fr30.c \ + cpu-h8300.c \ + cpu-h8500.c \ + cpu-hppa.c \ + cpu-ia64.c \ + cpu-i370.c \ + cpu-i386.c \ + cpu-i860.c \ + cpu-i960.c \ + cpu-m32r.c \ + cpu-m68hc11.c \ + cpu-m68hc12.c \ + cpu-m68k.c \ + cpu-m88k.c \ + cpu-m10200.c \ + cpu-m10300.c \ + cpu-mcore.c \ + cpu-mips.c \ + cpu-ns32k.c \ + cpu-pj.c \ + cpu-powerpc.c \ + cpu-rs6000.c \ + cpu-sh.c \ + cpu-sparc.c \ + cpu-tic30.c \ + cpu-tic54x.c \ + cpu-tic80.c \ + cpu-v850.c \ + cpu-vax.c \ + cpu-we32k.c \ + cpu-w65.c \ + cpu-z8k.c # The .o files needed by all of the 32 bit vectors that are configured into # target_vector in targets.c if configured with --enable-targets=all. -BFD32_BACKENDS = aout-adobe.lo aout-arm.lo aout-cris.lo aout-ns32k.lo aout-sparcle.lo aout-tic30.lo aout0.lo aout32.lo armnetbsd.lo bout.lo cf-i386lynx.lo cf-m68klynx.lo cf-sparclynx.lo coff-a29k.lo coff-apollo.lo coff-arm.lo coff-aux.lo coff-h8300.lo coff-h8500.lo coff-i386.lo coff-go32.lo coff-i860.lo coff-i960.lo coff-m68k.lo coff-m88k.lo coff-mips.lo coff-pmac.lo coff-rs6000.lo coff-sh.lo coff-sparc.lo coff-stgo32.lo coff-svm68k.lo coff-tic30.lo coff-tic54x.lo coff-tic80.lo coff-u68k.lo coff-we32k.lo coff-w65.lo coff-z8k.lo cofflink.lo dwarf1.lo ecoff.lo ecofflink.lo efi-app-ia32.lo elf.lo elf32-arc.lo elfarm-oabi.lo elfarm-nabi.lo elf32-avr.lo elf32-cris.lo elf32-d10v.lo elf32-d30v.lo elf32-fr30.lo elf32-gen.lo elf32-hppa.lo elf32-i370.lo elf32-i386.lo elf32-i860.lo elf32-i960.lo elf32-ia64.lo elf32-m32r.lo elf32-m68hc11.lo elf32-m68hc12.lo elf32-m68k.lo elf32-m88k.lo elf-m10200.lo elf-m10300.lo elf32-mcore.lo elf32-mips.lo elf32-pj.lo elf32-ppc.lo elf32-sh.lo elf32-sh-lin.lo elf32-sparc.lo elf32-v850.lo elf32.lo elflink.lo epoc-pe-arm.lo epoc-pei-arm.lo hp300bsd.lo hp300hpux.lo som.lo i386aout.lo i386bsd.lo i386dynix.lo i386freebsd.lo i386linux.lo i386lynx.lo i386msdos.lo i386netbsd.lo i386mach3.lo i386os9k.lo ieee.lo m68k4knetbsd.lo m68klinux.lo m68klynx.lo m68knetbsd.lo m88kmach3.lo mipsbsd.lo newsos3.lo nlm.lo nlm32-i386.lo nlm32-sparc.lo nlm32-ppc.lo nlm32.lo ns32knetbsd.lo oasys.lo pc532-mach.lo pe-arm.lo pei-arm.lo pe-i386.lo pei-i386.lo pe-mcore.lo pei-mcore.lo pe-ppc.lo pei-ppc.lo pe-sh.lo pei-sh.lo pe-mips.lo pei-mips.lo peigen.lo ppcboot.lo reloc16.lo riscix.lo sparclinux.lo sparclynx.lo sparcnetbsd.lo sunos.lo vaxnetbsd.lo versados.lo vms.lo vms-gsd.lo vms-hdr.lo vms-misc.lo vms-tir.lo xcofflink.lo - - -BFD32_BACKENDS_CFILES = aout-adobe.c aout-arm.c aout-cris.c aout-ns32k.c aout-sparcle.c aout-tic30.c aout0.c aout32.c armnetbsd.c bout.c cf-i386lynx.c cf-m68klynx.c cf-sparclynx.c coff-a29k.c coff-apollo.c coff-arm.c coff-aux.c coff-h8300.c coff-h8500.c coff-i386.c coff-i860.c coff-go32.c coff-i960.c coff-m68k.c coff-m88k.c coff-mips.c coff-pmac.c coff-rs6000.c coff-sh.c coff-sparc.c coff-stgo32.c coff-svm68k.c coff-tic30.c coff-tic54x.c coff-tic80.c coff-u68k.c coff-we32k.c coff-w65.c coff-z8k.c cofflink.c dwarf1.c ecoff.c ecofflink.c efi-app-ia32.c elf.c elf32-arc.c elfarm-oabi.c elfarm-nabi.c elf32-avr.c elf32-cris.c elf32-d10v.c elf32-d30v.c elf32-fr30.c elf32-gen.c elf32-hppa.c elf32-i370.c elf32-i386.c elf32-i860.c elf32-i960.c elf32-m32r.c elf32-m68k.c elf32-m68hc11.c elf32-m68hc12.c elf32-m88k.c elf-m10200.c elf-m10300.c elf32-mcore.c elf32-mips.c elf32-pj.c elf32-ppc.c elf32-sh.c elf32-sh-lin.c elf32-sparc.c elf32-v850.c elf32.c elflink.c epoc-pe-arm.c epoc-pei-arm.c hp300bsd.c hp300hpux.c som.c i386aout.c i386bsd.c i386dynix.c i386freebsd.c i386linux.c i386lynx.c i386msdos.c i386netbsd.c i386mach3.c i386os9k.c ieee.c m68k4knetbsd.c m68klinux.c m68klynx.c m68knetbsd.c m88kmach3.c mipsbsd.c newsos3.c nlm.c nlm32-i386.c nlm32-sparc.c nlm32-ppc.c nlm32.c ns32knetbsd.c oasys.c pc532-mach.c pe-arm.c pei-arm.c pe-i386.c pei-i386.c pe-mcore.c pei-mcore.c pe-ppc.c pei-ppc.c pe-sh.c pei-sh.c pe-mips.c pei-mips.c peigen.c ppcboot.c reloc16.c riscix.c sparclinux.c sparclynx.c sparcnetbsd.c sunos.c vaxnetbsd.c versados.c vms.c vms-gsd.c vms-hdr.c vms-misc.c vms-tir.c xcofflink.c +BFD32_BACKENDS = \ + aout-adobe.lo \ + aout-arm.lo \ + aout-cris.lo \ + aout-ns32k.lo \ + aout-sparcle.lo \ + aout-tic30.lo \ + aout0.lo \ + aout32.lo \ + armnetbsd.lo \ + bout.lo \ + cf-i386lynx.lo \ + cf-m68klynx.lo \ + cf-sparclynx.lo \ + coff-a29k.lo \ + coff-apollo.lo \ + coff-arm.lo \ + coff-aux.lo \ + coff-h8300.lo \ + coff-h8500.lo \ + coff-i386.lo \ + coff-go32.lo \ + coff-i860.lo \ + coff-i960.lo \ + coff-m68k.lo \ + coff-m88k.lo \ + coff-mips.lo \ + coff-pmac.lo \ + coff-rs6000.lo \ + coff-sh.lo \ + coff-sparc.lo \ + coff-stgo32.lo \ + coff-svm68k.lo \ + coff-tic30.lo \ + coff-tic54x.lo \ + coff-tic80.lo \ + coff-u68k.lo \ + coff-we32k.lo \ + coff-w65.lo \ + coff-z8k.lo \ + cofflink.lo \ + dwarf1.lo \ + ecoff.lo \ + ecofflink.lo \ + efi-app-ia32.lo \ + elf.lo \ + elf32-arc.lo \ + elfarm-oabi.lo \ + elfarm-nabi.lo \ + elf32-avr.lo \ + elf32-cris.lo \ + elf32-d10v.lo \ + elf32-d30v.lo \ + elf32-fr30.lo \ + elf32-gen.lo \ + elf32-hppa.lo \ + elf32-i370.lo \ + elf32-i386.lo \ + elf32-i860.lo \ + elf32-i960.lo \ + elf32-ia64.lo \ + elf32-m32r.lo \ + elf32-m68hc11.lo \ + elf32-m68hc12.lo \ + elf32-m68k.lo \ + elf32-m88k.lo \ + elf-m10200.lo \ + elf-m10300.lo \ + elf32-mcore.lo \ + elf32-mips.lo \ + elf32-pj.lo \ + elf32-ppc.lo \ + elf32-sh.lo \ + elf32-sh-lin.lo \ + elf32-sparc.lo \ + elf32-v850.lo \ + elf32.lo \ + elflink.lo \ + epoc-pe-arm.lo \ + epoc-pei-arm.lo \ + hp300bsd.lo \ + hp300hpux.lo \ + som.lo \ + i386aout.lo \ + i386bsd.lo \ + i386dynix.lo \ + i386freebsd.lo \ + i386linux.lo \ + i386lynx.lo \ + i386msdos.lo \ + i386netbsd.lo \ + i386mach3.lo \ + i386os9k.lo \ + ieee.lo \ + m68k4knetbsd.lo \ + m68klinux.lo \ + m68klynx.lo \ + m68knetbsd.lo \ + m88kmach3.lo \ + mipsbsd.lo \ + newsos3.lo \ + nlm.lo \ + nlm32-i386.lo \ + nlm32-sparc.lo \ + nlm32-ppc.lo \ + nlm32.lo \ + ns32knetbsd.lo \ + oasys.lo \ + pc532-mach.lo \ + pe-arm.lo \ + pei-arm.lo \ + pe-i386.lo \ + pei-i386.lo \ + pe-mcore.lo \ + pei-mcore.lo \ + pe-ppc.lo \ + pei-ppc.lo \ + pe-sh.lo \ + pei-sh.lo \ + pe-mips.lo \ + pei-mips.lo \ + peigen.lo \ + ppcboot.lo \ + reloc16.lo \ + riscix.lo \ + sparclinux.lo \ + sparclynx.lo \ + sparcnetbsd.lo \ + sunos.lo \ + vaxnetbsd.lo \ + versados.lo \ + vms.lo \ + vms-gsd.lo \ + vms-hdr.lo \ + vms-misc.lo \ + vms-tir.lo \ + xcofflink.lo + + +BFD32_BACKENDS_CFILES = \ + aout-adobe.c \ + aout-arm.c \ + aout-cris.c \ + aout-ns32k.c \ + aout-sparcle.c \ + aout-tic30.c \ + aout0.c \ + aout32.c \ + armnetbsd.c \ + bout.c \ + cf-i386lynx.c \ + cf-m68klynx.c \ + cf-sparclynx.c \ + coff-a29k.c \ + coff-apollo.c \ + coff-arm.c \ + coff-aux.c \ + coff-h8300.c \ + coff-h8500.c \ + coff-i386.c \ + coff-i860.c \ + coff-go32.c \ + coff-i960.c \ + coff-m68k.c \ + coff-m88k.c \ + coff-mips.c \ + coff-pmac.c \ + coff-rs6000.c \ + coff-sh.c \ + coff-sparc.c \ + coff-stgo32.c \ + coff-svm68k.c \ + coff-tic30.c \ + coff-tic54x.c \ + coff-tic80.c \ + coff-u68k.c \ + coff-we32k.c \ + coff-w65.c \ + coff-z8k.c \ + cofflink.c \ + dwarf1.c \ + ecoff.c \ + ecofflink.c \ + efi-app-ia32.c \ + elf.c \ + elf32-arc.c \ + elfarm-oabi.c \ + elfarm-nabi.c \ + elf32-avr.c \ + elf32-cris.c \ + elf32-d10v.c \ + elf32-d30v.c \ + elf32-fr30.c \ + elf32-gen.c \ + elf32-hppa.c \ + elf32-i370.c \ + elf32-i386.c \ + elf32-i860.c \ + elf32-i960.c \ + elf32-m32r.c \ + elf32-m68k.c \ + elf32-m68hc11.c \ + elf32-m68hc12.c \ + elf32-m88k.c \ + elf-m10200.c \ + elf-m10300.c \ + elf32-mcore.c \ + elf32-mips.c \ + elf32-pj.c \ + elf32-ppc.c \ + elf32-sh.c \ + elf32-sh-lin.c \ + elf32-sparc.c \ + elf32-v850.c \ + elf32.c \ + elflink.c \ + epoc-pe-arm.c \ + epoc-pei-arm.c \ + hp300bsd.c \ + hp300hpux.c \ + som.c \ + i386aout.c \ + i386bsd.c \ + i386dynix.c \ + i386freebsd.c \ + i386linux.c \ + i386lynx.c \ + i386msdos.c \ + i386netbsd.c \ + i386mach3.c \ + i386os9k.c \ + ieee.c \ + m68k4knetbsd.c \ + m68klinux.c \ + m68klynx.c \ + m68knetbsd.c \ + m88kmach3.c \ + mipsbsd.c \ + newsos3.c \ + nlm.c \ + nlm32-i386.c \ + nlm32-sparc.c \ + nlm32-ppc.c \ + nlm32.c \ + ns32knetbsd.c \ + oasys.c \ + pc532-mach.c \ + pe-arm.c \ + pei-arm.c \ + pe-i386.c \ + pei-i386.c \ + pe-mcore.c \ + pei-mcore.c \ + pe-ppc.c \ + pei-ppc.c \ + pe-sh.c \ + pei-sh.c \ + pe-mips.c \ + pei-mips.c \ + ppcboot.c \ + reloc16.c \ + riscix.c \ + sparclinux.c \ + sparclynx.c \ + sparcnetbsd.c \ + sunos.c \ + vaxnetbsd.c \ + versados.c \ + vms.c \ + vms-gsd.c \ + vms-hdr.c \ + vms-misc.c \ + vms-tir.c \ + xcofflink.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 # and --enable-64-bit-bfd. -BFD64_BACKENDS = aout64.lo coff-alpha.lo coff64-rs6000.lo demo64.lo efi-app-ia64.lo elf64-x86-64.lo elf64-alpha.lo elf64-hppa.lo elf64-ia64.lo elf64-gen.lo elf64-mips.lo elf64-sparc.lo elf64.lo nlm32-alpha.lo nlm64.lo - - -BFD64_BACKENDS_CFILES = aout64.c coff-alpha.c coff64-rs6000.c demo64.c efi-app-ia64.c elf64-x86-64.c elf64-alpha.c elf64-hppa.c elf64-ia64.c elf64-gen.c elf64-mips.c elf64-sparc.c elf64.c nlm32-alpha.c nlm64.c - - -OPTIONAL_BACKENDS = aix386-core.lo hpux-core.lo irix-core.lo lynx-core.lo osf-core.lo sco5-core.lo trad-core.lo cisco-core.lo - - -OPTIONAL_BACKENDS_CFILES = aix386-core.c hpux-core.c irix-core.c lynx-core.c osf-core.c sco5-core.c trad-core.c cisco-core.c +BFD64_BACKENDS = \ + aout64.lo \ + coff-alpha.lo \ + coff64-rs6000.lo \ + demo64.lo \ + efi-app-ia64.lo \ + elf64-x86-64.lo \ + elf64-alpha.lo \ + elf64-hppa.lo \ + elf64-ia64.lo \ + elf64-gen.lo \ + elf64-mips.lo \ + elf64-sparc.lo \ + elf64.lo \ + nlm32-alpha.lo \ + nlm64.lo \ + pepigen.lo + + +BFD64_BACKENDS_CFILES = \ + aout64.c \ + coff-alpha.c \ + coff64-rs6000.c \ + demo64.c \ + efi-app-ia64.c \ + elf64-x86-64.c \ + elf64-alpha.c \ + elf64-hppa.c \ + elf64-gen.c \ + elf64-mips.c \ + elf64-sparc.c \ + elf64.c \ + nlm32-alpha.c \ + nlm64.c + + +OPTIONAL_BACKENDS = \ + aix386-core.lo \ + hpux-core.lo \ + irix-core.lo \ + lynx-core.lo \ + osf-core.lo \ + sco5-core.lo \ + trad-core.lo \ + cisco-core.lo + + +OPTIONAL_BACKENDS_CFILES = \ + aix386-core.c \ + hpux-core.c \ + irix-core.c \ + lynx-core.c \ + osf-core.c \ + sco5-core.c \ + trad-core.c \ + cisco-core.c # These are defined by configure.in: @@ -191,16 +597,37 @@ TDEFAULTS = @tdefaults@ INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl # C source files that correspond to .o's. -CFILES = $(BFD_LIBS_CFILES) $(ALL_MACHINES_CFILES) $(BFD32_BACKENDS_CFILES) $(BFD64_BACKENDS_CFILES) $(OPTIONAL_BACKENDS_CFILES) +SOURCE_CFILES = \ + $(BFD_LIBS_CFILES) \ + $(ALL_MACHINES_CFILES) \ + $(BFD32_BACKENDS_CFILES) \ + $(BFD64_BACKENDS_CFILES) \ + $(OPTIONAL_BACKENDS_CFILES) + + +BUILD_CFILES = \ + elf32-ia64.c elf64-ia64.c peigen.c pepigen.c + + +CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) +SOURCE_HFILES = \ + aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \ + elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \ + elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \ + libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \ + libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ + nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h -SOURCE_HFILES = aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h +BUILD_HFILES = \ + elf32-target.h elf64-target.h targmatch.h -HFILES = elf32-target.h elf64-target.h targmatch.h $(SOURCE_HFILES) +HFILES = $(SOURCE_HFILES) $(BUILD_HFILES) -POTFILES = $(CFILES) $(SOURCE_HFILES) +SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES) +BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES) # Various kinds of .o files to put in libbfd.a: # BFD_BACKENDS Routines the configured targets need. @@ -224,16 +651,19 @@ libbfd_a_SOURCES = BFD_H_DEPS = $(INCDIR)/ansidecl.h LOCAL_H_DEPS = libbfd.h sysdep.h config.h -BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c +BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \ + reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c LIBCOFF_H_FILES = libcoff-in.h coffcode.h -MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles targmatch.h +MOSTLYCLEANFILES = ofiles stamp-ofiles +CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ + stmp-bin2-h stmp-lbfd-h stmp-lcoff-h -CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib stmp-bin2-h stmp-lbfd-h stmp-lcoff-h +DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h @@ -526,7 +956,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ @@ -585,6 +1015,7 @@ clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLIBRARIES \ @@ -642,9 +1073,22 @@ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean -po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ - && mv tmp $(srcdir)/po/POTFILES.in +po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES) + for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp \ + && mv tmp $(srcdir)/po/SRC-POTFILES.in + +po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES) + for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp \ + && mv tmp $(srcdir)/po/BLD-POTFILES.in + +# The following target is retained for upgrade purposes. +# This target used to exist in older versions of this makefile, and was +# referenced by /po/Makefile (which is created from /po/Make-in) +# So old versions of /po/Makefile will try to regenerate themselves +# when make is next run, but that dependency cannot be completed without a build +# of po/POTFILES.in. Hence the presence of this rule. This rule will be deleted +# once it is no longer needed - probably in the fall of 2001. +po/POTFILES.in: diststuff: info @@ -667,6 +1111,7 @@ stamp-lib: libbfd.la libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \ if [ -f $$libtooldir/libbfd.a ]; then \ cp $$libtooldir/libbfd.a libbfd.tmp; \ + $(RANLIB) libbfd.tmp; \ $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \ else true; fi touch stamp-lib @@ -709,6 +1154,16 @@ elf64-ia64.c : elfxx-ia64.c rm -f elf64-ia64.c sed -e s/NN/64/g < $(srcdir)/elfxx-ia64.c > elf64-ia64.new mv -f elf64-ia64.new elf64-ia64.c + +peigen.c : peXXigen.c + rm -f peigen.c + sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new + mv -f peigen.new peigen.c + +pepigen.c : peXXigen.c + rm -f pepigen.c + sed -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new + mv -f pepigen.new pepigen.c $(BFD_LIBS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) $(BFD_MACHINES): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) $(BFD_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) @@ -853,6 +1308,9 @@ stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def stab-syms.lo: stab-syms.c libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab.def +dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h @@ -1021,9 +1479,6 @@ cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h -dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h ecoff.lo: ecoff.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def libaout.h $(INCDIR)/aout/aout64.h \ @@ -1094,10 +1549,6 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1301,9 +1752,6 @@ pei-mips.lo: pei-mips.c $(INCDIR)/filenames.h pe-mips.c \ $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ libpei.h -peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h libpei.h ppcboot.lo: ppcboot.c $(INCDIR)/filenames.h reloc16.lo: reloc16.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/internal.h libcoff.h @@ -1358,6 +1806,10 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ coff-ia64.c $(INCDIR)/coff/ia64.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h +elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/x86-64.h \ + $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/alpha.h \ @@ -1365,18 +1817,11 @@ elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ libecoff.h ecoffswap.h elf64-target.h -elf64-hppa.lo: elf64-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h \ - libhppa.h elf64-hppa.h elf-hppa.h elf64-target.h -elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf64-target.h -elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h \ - $(INCDIR)/elf/reloc-macros.h elf64-target.h +elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/hppa.h $(INCDIR)/elf/reloc-macros.h libhppa.h \ + elf64-hppa.h elf-hppa.h elf64-target.h elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf64-target.h @@ -1412,6 +1857,20 @@ sco5-core.lo: sco5-core.c $(INCDIR)/filenames.h libaout.h \ trad-core.lo: trad-core.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h cisco-core.lo: cisco-core.c $(INCDIR)/filenames.h +elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ + $(INCDIR)/elf/reloc-macros.h elf64-target.h +peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h libpei.h +pepigen.lo: pepigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/ia64.h $(INCDIR)/coff/pe.h libcoff.h \ + $(INCDIR)/bfdlink.h libpei.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/contrib/binutils/bfd/aclocal.m4 b/contrib/binutils/bfd/aclocal.m4 index 45cc339..9f18aaf 100644 --- a/contrib/binutils/bfd/aclocal.m4 +++ b/contrib/binutils/bfd/aclocal.m4 @@ -136,24 +136,6 @@ AC_DEFUN([CY_WITH_NLS],) AC_SUBST(INTLLIBS) ]) -#serial 1 -# This test replaces the one in autoconf. -# Currently this macro should have the same name as the autoconf macro -# because gettext's gettext.m4 (distributed in the automake package) -# still uses it. Otherwise, the use in gettext.m4 makes autoheader -# give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX - -undefine([AC_ISC_POSIX]) - -AC_DEFUN(AC_ISC_POSIX, - [ - dnl This test replaces the obsolescent AC_ISC_POSIX kludge. - AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) - ] -) - # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. diff --git a/contrib/binutils/bfd/aout-arm.c b/contrib/binutils/bfd/aout-arm.c index 182c1c6..ddb0325 100644 --- a/contrib/binutils/bfd/aout-arm.c +++ b/contrib/binutils/bfd/aout-arm.c @@ -1,5 +1,6 @@ /* BFD back-end for raw ARM a.out binaries. - Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aout-encap.c b/contrib/binutils/bfd/aout-encap.c index 5f8a511..77d6358 100644 --- a/contrib/binutils/bfd/aout-encap.c +++ b/contrib/binutils/bfd/aout-encap.c @@ -1,5 +1,5 @@ /* BFD back-end for a.out files encapsulated with COFF headers. - Copyright (C) 1990, 1991 Free Software Foundation, Inc. + Copyright 1990, 1991, 1994, 1995, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aout-sparcle.c b/contrib/binutils/bfd/aout-sparcle.c index 903b136..d8ad8a5 100644 --- a/contrib/binutils/bfd/aout-sparcle.c +++ b/contrib/binutils/bfd/aout-sparcle.c @@ -1,5 +1,5 @@ /* BFD backend for sparc little-endian aout binaries. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright 1996 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aout-target.h b/contrib/binutils/bfd/aout-target.h index 1902cdf..2e74e37 100644 --- a/contrib/binutils/bfd/aout-target.h +++ b/contrib/binutils/bfd/aout-target.h @@ -1,5 +1,6 @@ /* Define a target vector and some small routines for a variant of a.out. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aout-tic30.c b/contrib/binutils/bfd/aout-tic30.c index f0f4d3d..a3e977d 100644 --- a/contrib/binutils/bfd/aout-tic30.c +++ b/contrib/binutils/bfd/aout-tic30.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 a.out binaries. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aout0.c b/contrib/binutils/bfd/aout0.c index 5bc7ae0..1d4c66e 100644 --- a/contrib/binutils/bfd/aout0.c +++ b/contrib/binutils/bfd/aout0.c @@ -1,5 +1,6 @@ /* BFD backend for SunOS style a.out with flags set to 0 - Copyright (C) 1990, 91, 92, 93, 1994 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aout32.c b/contrib/binutils/bfd/aout32.c index bfc40b4..afe7fa2 100644 --- a/contrib/binutils/bfd/aout32.c +++ b/contrib/binutils/bfd/aout32.c @@ -1,5 +1,5 @@ /* BFD back-end for 32-bit a.out files. - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aout64.c b/contrib/binutils/bfd/aout64.c index 84036c8..0f31dab 100644 --- a/contrib/binutils/bfd/aout64.c +++ b/contrib/binutils/bfd/aout64.c @@ -1,5 +1,5 @@ /* BFD back-end for 64-bit a.out files. - Copyright 1990, 1991, 1992 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/aoutf1.h b/contrib/binutils/bfd/aoutf1.h index 4ad49a1..a62c68d 100644 --- a/contrib/binutils/bfd/aoutf1.h +++ b/contrib/binutils/bfd/aoutf1.h @@ -1,5 +1,5 @@ /* A.out "format 1" file handling code for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h index 94a46b0..490ead7 100644 --- a/contrib/binutils/bfd/aoutx.h +++ b/contrib/binutils/bfd/aoutx.h @@ -1,5 +1,6 @@ /* BFD semi-generic back-end for a.out binaries. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, + 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -775,6 +776,7 @@ NAME(aout,machine_type) (arch, machine, unknown) case bfd_mach_mips4650: case bfd_mach_mips8000: case bfd_mach_mips10000: + case bfd_mach_mips12000: case bfd_mach_mips16: case bfd_mach_mips32: case bfd_mach_mips32_4k: @@ -2906,7 +2908,8 @@ NAME(aout,bfd_free_cached_info) (abfd) { asection *o; - if (bfd_get_format (abfd) != bfd_object) + if (bfd_get_format (abfd) != bfd_object + || abfd->tdata.aout_data == NULL) return true; #define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; } diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c index 14dc770..0a6f023 100644 --- a/contrib/binutils/bfd/archive.c +++ b/contrib/binutils/bfd/archive.c @@ -1,5 +1,6 @@ /* BFD back-end for archive files (libraries). - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. diff --git a/contrib/binutils/bfd/archures.c b/contrib/binutils/bfd/archures.c index 84b7744..8f7f9de 100644 --- a/contrib/binutils/bfd/archures.c +++ b/contrib/binutils/bfd/archures.c @@ -1,5 +1,6 @@ /* BFD library support routines for architectures. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. @@ -79,6 +80,10 @@ DESCRIPTION .#define bfd_mach_m68040 6 .#define bfd_mach_m68060 7 .#define bfd_mach_cpu32 8 +.#define bfd_mach_mcf5200 9 +.#define bfd_mach_mcf5206e 10 +.#define bfd_mach_mcf5307 11 +.#define bfd_mach_mcf5407 12 . bfd_arch_vax, {* DEC Vax *} . bfd_arch_i960, {* Intel 960 *} . {* The order of the following is important. @@ -130,6 +135,7 @@ DESCRIPTION .#define bfd_mach_mips6000 6000 .#define bfd_mach_mips8000 8000 .#define bfd_mach_mips10000 10000 +.#define bfd_mach_mips12000 12000 .#define bfd_mach_mips16 16 .#define bfd_mach_mips32 32 .#define bfd_mach_mips32_4k 3204113 {* 32, 04, octal 'K' *} @@ -848,6 +854,22 @@ bfd_default_scan (info, string) arch = bfd_arch_m68k; number = bfd_mach_cpu32; break; + case 5200: + arch = bfd_arch_m68k; + number = bfd_mach_mcf5200; + break; + case 5206: + arch = bfd_arch_m68k; + number = bfd_mach_mcf5206e; + break; + case 5307: + arch = bfd_arch_m68k; + number = bfd_mach_mcf5307; + break; + case 5407: + arch = bfd_arch_m68k; + number = bfd_mach_mcf5407; + break; case 32000: arch = bfd_arch_we32k; diff --git a/contrib/binutils/bfd/armnetbsd.c b/contrib/binutils/bfd/armnetbsd.c index 05d8ad0..aa6a882 100644 --- a/contrib/binutils/bfd/armnetbsd.c +++ b/contrib/binutils/bfd/armnetbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for NetBSD/ARM a.out-ish binaries. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/bfd-in.h b/contrib/binutils/bfd/bfd-in.h index 683aa0f..62ce58b 100644 --- a/contrib/binutils/bfd/bfd-in.h +++ b/contrib/binutils/bfd/bfd-in.h @@ -1,5 +1,6 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. diff --git a/contrib/binutils/bfd/bfd-in2.h b/contrib/binutils/bfd/bfd-in2.h index b8e864b..08456db 100644 --- a/contrib/binutils/bfd/bfd-in2.h +++ b/contrib/binutils/bfd/bfd-in2.h @@ -1,5 +1,6 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -1114,6 +1115,10 @@ typedef struct sec /* A mark flag used by some of the linker backends. */ unsigned int linker_mark : 1; + /* Another mark flag used by some of the linker backends. Set for + output sections that have a input section. */ + unsigned int linker_has_input : 1; + /* A mark flag used by some linker backends for garbage collection. */ unsigned int gc_mark : 1; @@ -1348,6 +1353,10 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 +#define bfd_mach_mcf5200 9 +#define bfd_mach_mcf5206e 10 +#define bfd_mach_mcf5307 11 +#define bfd_mach_mcf5407 12 bfd_arch_vax, /* DEC Vax */ bfd_arch_i960, /* Intel 960 */ /* The order of the following is important. @@ -1399,6 +1408,7 @@ enum bfd_architecture #define bfd_mach_mips6000 6000 #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 +#define bfd_mach_mips12000 12000 #define bfd_mach_mips16 16 #define bfd_mach_mips32 32 #define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */ @@ -1897,7 +1907,9 @@ relocation types already defined. */ BFD_RELOC_SPARC_GLOB_DAT, BFD_RELOC_SPARC_JMP_SLOT, BFD_RELOC_SPARC_RELATIVE, + BFD_RELOC_SPARC_UA16, BFD_RELOC_SPARC_UA32, + BFD_RELOC_SPARC_UA64, /* I think these are specific to SPARC a.out (e.g., Sun 4). */ BFD_RELOC_SPARC_BASE13, @@ -2049,6 +2061,17 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MIPS_GOT_PAGE, BFD_RELOC_MIPS_GOT_OFST, BFD_RELOC_MIPS_GOT_DISP, + BFD_RELOC_MIPS_SHIFT5, + BFD_RELOC_MIPS_SHIFT6, + BFD_RELOC_MIPS_INSERT_A, + BFD_RELOC_MIPS_INSERT_B, + BFD_RELOC_MIPS_DELETE, + BFD_RELOC_MIPS_HIGHEST, + BFD_RELOC_MIPS_HIGHER, + BFD_RELOC_MIPS_SCN_DISP, + BFD_RELOC_MIPS_REL16, + BFD_RELOC_MIPS_RELGOT, + BFD_RELOC_MIPS_JALR, /* i386/elf relocations */ diff --git a/contrib/binutils/bfd/bfd.c b/contrib/binutils/bfd/bfd.c index 2e172c9..3afcd3d 100644 --- a/contrib/binutils/bfd/bfd.c +++ b/contrib/binutils/bfd/bfd.c @@ -1,5 +1,6 @@ /* Generic BFD library interface and support routines. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/binary.c b/contrib/binutils/bfd/binary.c index 771e431..b80343b 100644 --- a/contrib/binutils/bfd/binary.c +++ b/contrib/binutils/bfd/binary.c @@ -1,5 +1,6 @@ /* BFD back-end for binary objects. - Copyright 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cache.c b/contrib/binutils/bfd/cache.c index 063373c..da16409 100644 --- a/contrib/binutils/bfd/cache.c +++ b/contrib/binutils/bfd/cache.c @@ -1,5 +1,5 @@ /* BFD library -- caching of file descriptors. - Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). diff --git a/contrib/binutils/bfd/coff-alpha.c b/contrib/binutils/bfd/coff-alpha.c index 41e4710..b3cd0c7 100644 --- a/contrib/binutils/bfd/coff-alpha.c +++ b/contrib/binutils/bfd/coff-alpha.c @@ -1,5 +1,6 @@ /* BFD back-end for ALPHA Extended-Coff files. - Copyright 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . @@ -127,13 +128,13 @@ reloc_nil PARAMS ((bfd *, arelent *, asymbol *, PTR, static bfd_reloc_status_type reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message) - bfd *abfd; - arelent *reloc; - asymbol *sym; - PTR data; - asection *sec; - bfd *output_bfd; - char **error_message; + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc ATTRIBUTE_UNUSED; + asymbol *sym ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + bfd *output_bfd ATTRIBUTE_UNUSED; + char **error_message ATTRIBUTE_UNUSED; { return bfd_reloc_ok; } @@ -472,7 +473,7 @@ alpha_ecoff_object_p (abfd) static boolean alpha_ecoff_bad_format_hook (abfd, filehdr) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; PTR filehdr; { struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; @@ -707,7 +708,7 @@ alpha_adjust_reloc_in (abfd, intern, rptr) static void alpha_adjust_reloc_out (abfd, rel, intern) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; const arelent *rel; struct internal_reloc *intern; { @@ -1175,7 +1176,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, static reloc_howto_type * alpha_bfd_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { int alpha_type; @@ -1249,7 +1250,7 @@ alpha_bfd_reloc_type_lookup (abfd, code) static bfd_vma alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; bfd *input_bfd; struct external_reloc *ext_rel; @@ -2012,7 +2013,7 @@ static boolean alpha_adjust_headers (abfd, fhdr, ahdr) bfd *abfd; struct internal_filehdr *fhdr; - struct internal_aouthdr *ahdr; + struct internal_aouthdr *ahdr ATTRIBUTE_UNUSED; { if ((abfd->flags & (DYNAMIC | EXEC_P)) == (DYNAMIC | EXEC_P)) fhdr->f_flags |= F_ALPHA_CALL_SHARED; diff --git a/contrib/binutils/bfd/coff-arm.c b/contrib/binutils/bfd/coff-arm.c index 7ec7b8e..8bb4e6c 100644 --- a/contrib/binutils/bfd/coff-arm.c +++ b/contrib/binutils/bfd/coff-arm.c @@ -1,5 +1,6 @@ /* BFD back-end for ARM COFF files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -853,6 +854,7 @@ coff_arm_reloc_type_lookup (abfd, code) ASTD (BFD_RELOC_THUMB_PCREL_BRANCH9, ARM_THUMB9); ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12); ASTD (BFD_RELOC_THUMB_PCREL_BRANCH23, ARM_THUMB23); + ASTD (BFD_RELOC_THUMB_PCREL_BLX, ARM_THUMB23); #endif default: return (CONST struct reloc_howto_struct *) 0; } @@ -1242,12 +1244,18 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { if (info->relocateable) continue; -#if 0 /* We must not ignore the symbol value. If the symbol is - within the same section, the relocation should have already - been fixed, but if it is not, we'll be handed a reloc into - the beginning of the symbol's section, so we must not cancel - out the symbol's value, otherwise we'll be adding it in - twice. */ + /* FIXME - it is not clear which targets need this next test + and which do not. It is known that it is needed for the + VXworks target (hence the #ifdef), but it is also known + that it was supressed for other (arm) targets. This ought + to be sorted out one day. */ +#ifdef VXWORKS + /* We must not ignore the symbol value. If the symbol is + within the same section, the relocation should have already + been fixed, but if it is not, we'll be handed a reloc into + the beginning of the symbol's section, so we must not cancel + out the symbol's value, otherwise we'll be adding it in + twice. */ if (sym != NULL && sym->n_scnum != 0) addend += sym->n_value; #endif @@ -1587,18 +1595,18 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (size == 4); - /* howto->pc_relative should be TRUE for type 14 BRANCH23 */ + /* howto->pc_relative should be TRUE for type 14 BRANCH23. */ relocation -= (input_section->output_section->vma + input_section->output_offset); - /* howto->pcrel_offset should be TRUE for type 14 BRANCH23 */ + /* howto->pcrel_offset should be TRUE for type 14 BRANCH23. */ relocation -= address; /* No need to negate the relocation with BRANCH23. */ /* howto->complain_on_overflow == complain_overflow_signed for BRANCH23. */ /* howto->rightshift == 1 */ - /* Drop unwanted bits from the value we are relocating to. */ + /* Drop unwanted bits from the value we are relocating to. */ check = relocation >> howto->rightshift; /* If this is a signed value, the rightshift just dropped @@ -1612,13 +1620,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, /* Get the value from the object file. */ if (bfd_big_endian (input_bfd)) - { - add = (((x) & 0x07ff0000) >> 4) | (((x) & 0x7ff) << 1); - } + add = (((x) & 0x07ff0000) >> 4) | (((x) & 0x7ff) << 1); else - { - add = ((((x) & 0x7ff) << 12) | (((x) & 0x07ff0000) >> 15)); - } + add = ((((x) & 0x7ff) << 12) | (((x) & 0x07ff0000) >> 15)); /* Get the value from the object file with an appropriate sign. The expression involving howto->src_mask isolates the upper @@ -1628,18 +1632,16 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, can not get the upper bit, but that does not matter since signed_add needs no adjustment to become negative in that case. */ - signed_add = add; if ((add & (((~ src_mask) >> 1) & src_mask)) != 0) signed_add -= (((~ src_mask) >> 1) & src_mask) << 1; + /* howto->bitpos == 0 */ /* Add the value from the object file, shifted so that it is a straight number. */ - /* howto->bitpos == 0 */ - signed_check += signed_add; - relocation += signed_add; + relocation += signed_add; BFD_ASSERT (howto->complain_on_overflow == complain_overflow_signed); @@ -1648,21 +1650,26 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, || signed_check < reloc_signed_min) overflow = true; - /* Put RELOCATION into the correct bits: */ - + /* For the BLX(1) instruction remove bit 0 of the adjusted offset. + Bit 0 can only be set if the upper insn is at a half-word boundary, + since the destination address, an ARM instruction, must always be + on a word boundary. The semantics of the BLX (1) instruction, + however, are that bit 0 in the offset must always be 0, and the + corresponding bit 1 in the target address will be set from bit + 1 of the source address. */ + if ((x & 0x18000000) == 0x08000000) + relocation &= ~0x2; + + /* Put the relocation into the correct bits. */ if (bfd_big_endian (input_bfd)) - { - relocation = (((relocation & 0xffe) >> 1) | ((relocation << 4) & 0x07ff0000)); - } + relocation = (((relocation & 0xffe) >> 1) | ((relocation << 4) & 0x07ff0000)); else - { - relocation = (((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff)); - } + relocation = (((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff)); - /* Add RELOCATION to the correct bits of X: */ + /* Add the relocation to the correct bits of X. */ x = ((x & ~howto->dst_mask) | relocation); - /* Put the relocated value back in the object file: */ + /* Put the relocated value back in the object file. */ bfd_put_32 (input_bfd, x, location); rstat = overflow ? bfd_reloc_overflow : bfd_reloc_ok; diff --git a/contrib/binutils/bfd/coff-aux.c b/contrib/binutils/bfd/coff-aux.c index 5bc9b8b..53822f0 100644 --- a/contrib/binutils/bfd/coff-aux.c +++ b/contrib/binutils/bfd/coff-aux.c @@ -1,5 +1,5 @@ /* BFD back-end for Apple M68K COFF A/UX 3.x files. - Copyright 1996, 1997 Free Software Foundation, Inc. + Copyright 1996, 1997, 2000 Free Software Foundation, Inc. Written by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/coff-i386.c b/contrib/binutils/bfd/coff-i386.c index 83d67c4..7d4ab5a 100644 --- a/contrib/binutils/bfd/coff-i386.c +++ b/contrib/binutils/bfd/coff-i386.c @@ -1,5 +1,6 @@ /* BFD back-end for Intel 386 COFF files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -128,7 +129,9 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #ifdef COFF_WITH_PE /* FIXME: How should this case be handled? */ - if (reloc_entry->howto->type == R_IMAGEBASE) + if (reloc_entry->howto->type == R_IMAGEBASE + && output_bfd != NULL + && bfd_get_flavour(output_bfd) == bfd_target_coff_flavour) diff -= pe_data (output_bfd)->pe_opthdr.ImageBase; #endif @@ -488,7 +491,9 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp) *addendp -= sym->n_value; } - if (rel->r_type == R_IMAGEBASE) + if (rel->r_type == R_IMAGEBASE + && (bfd_get_flavour(sec->output_section->owner) + == bfd_target_coff_flavour)) { *addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase; } @@ -575,7 +580,7 @@ const bfd_target (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ #ifdef COFF_WITH_PE - | SEC_LINK_ONCE | SEC_LINK_DUPLICATES + | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY #endif | SEC_CODE | SEC_DATA), diff --git a/contrib/binutils/bfd/coff-ppc.c b/contrib/binutils/bfd/coff-ppc.c index 798399d..2bf296a 100644 --- a/contrib/binutils/bfd/coff-ppc.c +++ b/contrib/binutils/bfd/coff-ppc.c @@ -1,5 +1,6 @@ /* BFD back-end for PowerPC Microsoft Portable Executable files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Original version pieced together by Kim Knuttila (krk@cygnus.com) diff --git a/contrib/binutils/bfd/coff-sparc.c b/contrib/binutils/bfd/coff-sparc.c index 9367770..0f592de 100644 --- a/contrib/binutils/bfd/coff-sparc.c +++ b/contrib/binutils/bfd/coff-sparc.c @@ -1,5 +1,5 @@ /* BFD back-end for Sparc COFF files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/coff-tic30.c b/contrib/binutils/bfd/coff-tic30.c index 267ca97..5b8ffd4 100644 --- a/contrib/binutils/bfd/coff-tic30.c +++ b/contrib/binutils/bfd/coff-tic30.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 coff binaries. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/coff-z8k.c b/contrib/binutils/bfd/coff-z8k.c index 7ad0630..817b6dc 100644 --- a/contrib/binutils/bfd/coff-z8k.c +++ b/contrib/binutils/bfd/coff-z8k.c @@ -1,5 +1,6 @@ /* BFD back-end for Zilog Z800n COFF binaries. - Copyright 1992, 93, 94, 95, 1997 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001 + Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h index fce0491..2cdc137 100644 --- a/contrib/binutils/bfd/coffcode.h +++ b/contrib/binutils/bfd/coffcode.h @@ -1,5 +1,6 @@ /* Support for the generic parts of most COFF variants, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -339,6 +340,9 @@ static long coff_canonicalize_reloc #ifndef coff_mkobject_hook static PTR coff_mkobject_hook PARAMS ((bfd *, PTR, PTR)); #endif +#ifdef COFF_WITH_PE +static flagword handle_COMDAT PARAMS ((bfd *, flagword, PTR, const char *, asection *)); +#endif /* void warning(); */ @@ -698,329 +702,382 @@ styp_to_sec_flags (abfd, hdr, name, section) #else /* COFF_WITH_PE */ -/* The PE version; see above for the general comments. - - Since to set the SEC_LINK_ONCE and associated flags, we have to - look at the symbol table anyway, we return the symbol table index - of the symbol being used as the COMDAT symbol. This is admittedly - ugly, but there's really nowhere else that we have access to the - required information. FIXME: Is the COMDAT symbol index used for - any purpose other than objdump? */ - static flagword -styp_to_sec_flags (abfd, hdr, name, section) - bfd *abfd ATTRIBUTE_UNUSED; +handle_COMDAT (abfd, sec_flags, hdr, name, section) + bfd * abfd; + flagword sec_flags; PTR hdr; const char *name; asection *section; { struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr; - long styp_flags = internal_s->s_flags; - flagword sec_flags = 0; - - if (styp_flags & STYP_DSECT) - abort (); /* Don't know what to do */ -#ifdef SEC_NEVER_LOAD - if (styp_flags & STYP_NOLOAD) - sec_flags |= SEC_NEVER_LOAD; -#endif - if (styp_flags & STYP_GROUP) - abort (); /* Don't know what to do */ - /* skip IMAGE_SCN_TYPE_NO_PAD */ - if (styp_flags & STYP_COPY) - abort (); /* Don't know what to do */ - if (styp_flags & IMAGE_SCN_CNT_CODE) - sec_flags |= SEC_CODE | SEC_ALLOC | SEC_LOAD; - if (styp_flags & IMAGE_SCN_CNT_INITIALIZED_DATA) - sec_flags |= SEC_DATA | SEC_ALLOC | SEC_LOAD; - if (styp_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) - sec_flags |= SEC_ALLOC; - if (styp_flags & IMAGE_SCN_LNK_OTHER) - abort (); /* Don't know what to do */ - if (styp_flags & IMAGE_SCN_LNK_INFO) - { - /* We mark these as SEC_DEBUGGING, but only if COFF_PAGE_SIZE is - defined. coff_compute_section_file_positions uses - COFF_PAGE_SIZE to ensure that the low order bits of the - section VMA and the file offset match. If we don't know - COFF_PAGE_SIZE, we can't ensure the correct correspondence, - and demand page loading of the file will fail. */ -#ifdef COFF_PAGE_SIZE - sec_flags |= SEC_DEBUGGING; -#endif - } - if (styp_flags & STYP_OVER) - abort (); /* Don't know what to do */ - if (styp_flags & IMAGE_SCN_LNK_REMOVE) - sec_flags |= SEC_EXCLUDE; - - if (styp_flags & IMAGE_SCN_MEM_SHARED) - sec_flags |= SEC_SHARED; - /* COMDAT: see below */ - if (styp_flags & IMAGE_SCN_MEM_DISCARDABLE) - sec_flags |= SEC_DEBUGGING; - if (styp_flags & IMAGE_SCN_MEM_NOT_CACHED) - abort ();/* Don't know what to do */ - if (styp_flags & IMAGE_SCN_MEM_NOT_PAGED) - abort (); /* Don't know what to do */ - - /* We infer from the distinct read/write/execute bits the settings - of some of the bfd flags; the actual values, should we need them, - are also in pei_section_data (abfd, section)->pe_flags. */ - - if (styp_flags & IMAGE_SCN_MEM_EXECUTE) - sec_flags |= SEC_CODE; /* Probably redundant */ - /* IMAGE_SCN_MEM_READ is simply ignored, assuming it always to be true. */ - if ((styp_flags & IMAGE_SCN_MEM_WRITE) == 0) - sec_flags |= SEC_READONLY; - - /* COMDAT gets very special treatment. */ - if (styp_flags & IMAGE_SCN_LNK_COMDAT) + bfd_byte *esymstart, *esym, *esymend; + int seen_state = 0; + char *target_name = NULL; + + sec_flags |= SEC_LINK_ONCE; + + /* Unfortunately, the PE format stores essential information in + the symbol table, of all places. We need to extract that + information now, so that objdump and the linker will know how + to handle the section without worrying about the symbols. We + can't call slurp_symtab, because the linker doesn't want the + swapped symbols. */ + + /* COMDAT sections are special. The first symbol is the section + symbol, which tells what kind of COMDAT section it is. The + second symbol is the "comdat symbol" - the one with the + unique name. GNU uses the section symbol for the unique + name; MS uses ".text" for every comdat section. Sigh. - DJ */ + + /* This is not mirrored in sec_to_styp_flags(), but there + doesn't seem to be a need to, either, and it would at best be + rather messy. */ + + if (! _bfd_coff_get_external_symbols (abfd)) + return sec_flags; + + esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd); + esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd); + + while (esym < esymend) { - sec_flags |= SEC_LINK_ONCE; - - /* Unfortunately, the PE format stores essential information in - the symbol table, of all places. We need to extract that - information now, so that objdump and the linker will know how - to handle the section without worrying about the symbols. We - can't call slurp_symtab, because the linker doesn't want the - swapped symbols. */ - - /* COMDAT sections are special. The first symbol is the section - symbol, which tells what kind of COMDAT section it is. The - second symbol is the "comdat symbol" - the one with the - unique name. GNU uses the section symbol for the unique - name; MS uses ".text" for every comdat section. Sigh. - DJ */ - - /* This is not mirrored in sec_to_styp_flags(), but there - doesn't seem to be a need to, either, and it would at best be - rather messy. */ - - if (_bfd_coff_get_external_symbols (abfd)) + struct internal_syment isym; + char buf[SYMNMLEN + 1]; + const char *symname; + + bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &isym); + + if (sizeof (internal_s->s_name) > SYMNMLEN) { - bfd_byte *esymstart, *esym, *esymend; - int seen_state = 0; - char *target_name = NULL; + /* This case implies that the matching + symbol name will be in the string table. */ + abort (); + } - esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd); - esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd); + if (isym.n_scnum == section->target_index) + { + /* According to the MSVC documentation, the first + TWO entries with the section # are both of + interest to us. The first one is the "section + symbol" (section name). The second is the comdat + symbol name. Here, we've found the first + qualifying entry; we distinguish it from the + second with a state flag. + + In the case of gas-generated (at least until that + is fixed) .o files, it isn't necessarily the + second one. It may be some other later symbol. + + Since gas also doesn't follow MS conventions and + emits the section similar to .text$, where + is the name we're looking for, we + distinguish the two as follows: + + If the section name is simply a section name (no + $) we presume it's MS-generated, and look at + precisely the second symbol for the comdat name. + If the section name has a $, we assume it's + gas-generated, and look for (whatever + follows the $) as the comdat symbol. */ + + /* All 3 branches use this */ + symname = _bfd_coff_internal_syment_name (abfd, &isym, buf); + + if (symname == NULL) + abort (); - while (esym < esymend) + switch (seen_state) { - struct internal_syment isym; - char buf[SYMNMLEN + 1]; - const char *symname; + case 0: + { + /* The first time we've seen the symbol. */ + union internal_auxent aux; + + seen_state = 1; + + /* If it isn't the stuff we're expecting, die; + The MS documentation is vague, but it + appears that the second entry serves BOTH + as the comdat symbol and the defining + symbol record (either C_STAT or C_EXT, + possibly with an aux entry with debug + information if it's a function.) It + appears the only way to find the second one + is to count. (On Intel, they appear to be + adjacent, but on Alpha, they have been + found separated.) + + Here, we think we've found the first one, + but there's some checking we can do to be + sure. */ + + if (! (isym.n_sclass == C_STAT + && isym.n_type == T_NULL + && isym.n_value == 0)) + abort (); - bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &isym); + /* FIXME LATER: MSVC generates section names + like .text for comdats. Gas generates + names like .text$foo__Fv (in the case of a + function). See comment above for more. */ - if (sizeof (internal_s->s_name) > SYMNMLEN) - { - /* This case implies that the matching symbol name - will be in the string table. */ + if (strcmp (name, symname) != 0) abort (); - } - if (isym.n_scnum == section->target_index) - { - /* According to the MSVC documentation, the first - TWO entries with the section # are both of - interest to us. The first one is the "section - symbol" (section name). The second is the comdat - symbol name. Here, we've found the first - qualifying entry; we distinguish it from the - second with a state flag. - - In the case of gas-generated (at least until that - is fixed) .o files, it isn't necessarily the - second one. It may be some other later symbol. - - Since gas also doesn't follow MS conventions and - emits the section similar to .text$, where - is the name we're looking for, we - distinguish the two as follows: - - If the section name is simply a section name (no - $) we presume it's MS-generated, and look at - precisely the second symbol for the comdat name. - If the section name has a $, we assume it's - gas-generated, and look for (whatever - follows the $) as the comdat symbol. */ - - /* All 3 branches use this */ - symname = _bfd_coff_internal_syment_name (abfd, &isym, buf); - - if (symname == NULL) - abort (); - - switch (seen_state) - { - case 0: - { - /* The first time we've seen the symbol. */ - union internal_auxent aux; - - seen_state = 1; - - /* If it isn't the stuff we're expecting, die; - The MS documentation is vague, but it - appears that the second entry serves BOTH - as the comdat symbol and the defining - symbol record (either C_STAT or C_EXT, - possibly with an aux entry with debug - information if it's a function.) It - appears the only way to find the second one - is to count. (On Intel, they appear to be - adjacent, but on Alpha, they have been - found separated.) - - Here, we think we've found the first one, - but there's some checking we can do to be - sure. */ - - if (! (isym.n_sclass == C_STAT - && isym.n_type == T_NULL - && isym.n_value == 0)) - abort (); - - /* FIXME LATER: MSVC generates section names - like .text for comdats. Gas generates - names like .text$foo__Fv (in the case of a - function). See comment above for more. */ - - if (strcmp (name, symname) != 0) - abort (); - - /* This is the section symbol. */ - - bfd_coff_swap_aux_in (abfd, (PTR) (esym + bfd_coff_symesz (abfd)), - isym.n_type, isym.n_sclass, - 0, isym.n_numaux, (PTR) &aux); - - target_name = strchr (name, '$'); - if (target_name != NULL) - { - /* Gas mode. */ - seen_state = 2; - /* Skip the `$'. */ - target_name += 1; - } - - /* FIXME: Microsoft uses NODUPLICATES and - ASSOCIATIVE, but gnu uses ANY and - SAME_SIZE. Unfortunately, gnu doesn't do - the comdat symbols right. So, until we can - fix it to do the right thing, we are - temporarily disabling comdats for the MS - types (they're used in DLLs and C++, but we - don't support *their* C++ libraries anyway - - DJ. */ - - /* Cygwin does not follow the MS style, and - uses ANY and SAME_SIZE where NODUPLICATES - and ASSOCIATIVE should be used. For - Interix, we just do the right thing up - front. */ - - switch (aux.x_scn.x_comdat) - { - case IMAGE_COMDAT_SELECT_NODUPLICATES: + /* This is the section symbol. */ + bfd_coff_swap_aux_in (abfd, (PTR) (esym + bfd_coff_symesz (abfd)), + isym.n_type, isym.n_sclass, + 0, isym.n_numaux, (PTR) &aux); + + target_name = strchr (name, '$'); + if (target_name != NULL) + { + /* Gas mode. */ + seen_state = 2; + /* Skip the `$'. */ + target_name += 1; + } + + /* FIXME: Microsoft uses NODUPLICATES and + ASSOCIATIVE, but gnu uses ANY and + SAME_SIZE. Unfortunately, gnu doesn't do + the comdat symbols right. So, until we can + fix it to do the right thing, we are + temporarily disabling comdats for the MS + types (they're used in DLLs and C++, but we + don't support *their* C++ libraries anyway + - DJ. */ + + /* Cygwin does not follow the MS style, and + uses ANY and SAME_SIZE where NODUPLICATES + and ASSOCIATIVE should be used. For + Interix, we just do the right thing up + front. */ + + switch (aux.x_scn.x_comdat) + { + case IMAGE_COMDAT_SELECT_NODUPLICATES: #ifdef STRICT_PE_FORMAT - sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY; + sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY; #else - sec_flags &= ~SEC_LINK_ONCE; + sec_flags &= ~SEC_LINK_ONCE; #endif - break; + break; - case IMAGE_COMDAT_SELECT_ANY: - sec_flags |= SEC_LINK_DUPLICATES_DISCARD; - break; + case IMAGE_COMDAT_SELECT_ANY: + sec_flags |= SEC_LINK_DUPLICATES_DISCARD; + break; - case IMAGE_COMDAT_SELECT_SAME_SIZE: - sec_flags |= SEC_LINK_DUPLICATES_SAME_SIZE; - break; + case IMAGE_COMDAT_SELECT_SAME_SIZE: + sec_flags |= SEC_LINK_DUPLICATES_SAME_SIZE; + break; - case IMAGE_COMDAT_SELECT_EXACT_MATCH: - /* Not yet fully implemented ??? */ - sec_flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS; - break; + case IMAGE_COMDAT_SELECT_EXACT_MATCH: + /* Not yet fully implemented ??? */ + sec_flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS; + break; - /* debug$S gets this case; other - implications ??? */ + /* debug$S gets this case; other + implications ??? */ - /* There may be no symbol... we'll search - the whole table... Is this the right - place to play this game? Or should we do - it when reading it in. */ - case IMAGE_COMDAT_SELECT_ASSOCIATIVE: + /* There may be no symbol... we'll search + the whole table... Is this the right + place to play this game? Or should we do + it when reading it in. */ + case IMAGE_COMDAT_SELECT_ASSOCIATIVE: #ifdef STRICT_PE_FORMAT - /* FIXME: This is not currently implemented. */ - sec_flags |= SEC_LINK_DUPLICATES_DISCARD; + /* FIXME: This is not currently implemented. */ + sec_flags |= SEC_LINK_DUPLICATES_DISCARD; #else - sec_flags &= ~SEC_LINK_ONCE; + sec_flags &= ~SEC_LINK_ONCE; #endif - break; + break; - default: /* 0 means "no symbol" */ - /* debug$F gets this case; other - implications ??? */ - sec_flags |= SEC_LINK_DUPLICATES_DISCARD; - break; - } - } - break; + default: /* 0 means "no symbol" */ + /* debug$F gets this case; other + implications ??? */ + sec_flags |= SEC_LINK_DUPLICATES_DISCARD; + break; + } + } + break; - case 2: - /* Gas mode: the first matching on partial name. */ + case 2: + /* Gas mode: the first matching on partial name. */ #ifndef TARGET_UNDERSCORE #define TARGET_UNDERSCORE 0 #endif - /* Is this the name we're looking for? */ - if (strcmp (target_name, - symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0) - { - /* Not the name we're looking for */ - esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd); - continue; - } - /* Fall through. */ - case 1: - /* MSVC mode: the lexically second symbol (or - drop through from the above). */ - { - char *newname; - - /* This must the the second symbol with the - section #. It is the actual symbol name. - Intel puts the two adjacent, but Alpha (at - least) spreads them out. */ - - section->comdat = - bfd_alloc (abfd, sizeof (struct bfd_comdat_info)); - if (section->comdat == NULL) - abort (); - section->comdat->symbol = - (esym - esymstart) / bfd_coff_symesz (abfd); - - newname = bfd_alloc (abfd, strlen (symname) + 1); - if (newname == NULL) - abort (); - - strcpy (newname, symname); - section->comdat->name = newname; - - } - - goto breakloop; - } + /* Is this the name we're looking for? */ + if (strcmp (target_name, + symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0) + { + /* Not the name we're looking for */ + esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd); + continue; } + /* Fall through. */ + case 1: + /* MSVC mode: the lexically second symbol (or + drop through from the above). */ + { + char *newname; - esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd); + /* This must the the second symbol with the + section #. It is the actual symbol name. + Intel puts the two adjacent, but Alpha (at + least) spreads them out. */ + + section->comdat = + bfd_alloc (abfd, sizeof (struct bfd_comdat_info)); + if (section->comdat == NULL) + abort (); + + section->comdat->symbol = + (esym - esymstart) / bfd_coff_symesz (abfd); + + newname = bfd_alloc (abfd, strlen (symname) + 1); + if (newname == NULL) + abort (); + + strcpy (newname, symname); + section->comdat->name = newname; + } + + goto breakloop; } - breakloop: - /* SunOS requires a statement after any label. */ - ; } + + esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd); + } + + breakloop: + return sec_flags; +} + + +/* The PE version; see above for the general comments. + + Since to set the SEC_LINK_ONCE and associated flags, we have to + look at the symbol table anyway, we return the symbol table index + of the symbol being used as the COMDAT symbol. This is admittedly + ugly, but there's really nowhere else that we have access to the + required information. FIXME: Is the COMDAT symbol index used for + any purpose other than objdump? */ + +static flagword +styp_to_sec_flags (abfd, hdr, name, section) + bfd *abfd; + PTR hdr; + const char *name; + asection *section; +{ + struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr; + long styp_flags = internal_s->s_flags; + flagword sec_flags; + + /* Assume read only unless IMAGE_SCN_MEM_WRITE is specified. */ + sec_flags = SEC_READONLY; + + /* Process each flag bit in styp_flags in turn. */ + while (styp_flags) + { + long flag = styp_flags & - styp_flags; + char * unhandled = NULL; + + styp_flags &= ~ flag; + + /* We infer from the distinct read/write/execute bits the settings + of some of the bfd flags; the actual values, should we need them, + are also in pei_section_data (abfd, section)->pe_flags. */ + + switch (flag) + { + case STYP_DSECT: + unhandled = "STYP_DSECT"; + break; + case STYP_GROUP: + unhandled = "STYP_GROUP"; + break; + case STYP_COPY: + unhandled = "STYP_COPY"; + break; + case STYP_OVER: + unhandled = "STYP_OVER"; + break; +#ifdef SEC_NEVER_LOAD + case STYP_NOLOAD: + sec_flags |= SEC_NEVER_LOAD; + break; +#endif + case IMAGE_SCN_MEM_READ: + /* Ignored, assume it always to be true. */ + break; + case IMAGE_SCN_TYPE_NO_PAD: + /* Skip. */ + break; + case IMAGE_SCN_LNK_OTHER: + unhandled = "IMAGE_SCN_LNK_OTHER"; + break; + case IMAGE_SCN_MEM_NOT_CACHED: + unhandled = "IMAGE_SCN_MEM_NOT_CACHED"; + break; + case IMAGE_SCN_MEM_NOT_PAGED: + unhandled = "IMAGE_SCN_MEM_NOT_PAGED"; + break; + case IMAGE_SCN_MEM_EXECUTE: + sec_flags |= SEC_CODE; + break; + case IMAGE_SCN_MEM_WRITE: + sec_flags &= ~ SEC_READONLY; + break; + case IMAGE_SCN_MEM_DISCARDABLE: + sec_flags |= SEC_DEBUGGING; + break; + case IMAGE_SCN_MEM_SHARED: + sec_flags |= SEC_SHARED; + break; + case IMAGE_SCN_LNK_REMOVE: + sec_flags |= SEC_EXCLUDE; + break; + case IMAGE_SCN_CNT_CODE: + sec_flags |= SEC_CODE | SEC_ALLOC | SEC_LOAD; + break; + case IMAGE_SCN_CNT_INITIALIZED_DATA: + sec_flags |= SEC_DATA | SEC_ALLOC | SEC_LOAD; + break; + case IMAGE_SCN_CNT_UNINITIALIZED_DATA: + sec_flags |= SEC_ALLOC; + break; + case IMAGE_SCN_LNK_INFO: + /* We mark these as SEC_DEBUGGING, but only if COFF_PAGE_SIZE is + defined. coff_compute_section_file_positions uses + COFF_PAGE_SIZE to ensure that the low order bits of the + section VMA and the file offset match. If we don't know + COFF_PAGE_SIZE, we can't ensure the correct correspondence, + and demand page loading of the file will fail. */ +#ifdef COFF_PAGE_SIZE + sec_flags |= SEC_DEBUGGING; +#endif + break; + case IMAGE_SCN_LNK_COMDAT: + /* COMDAT gets very special treatment. */ + sec_flags = handle_COMDAT (abfd, sec_flags, hdr, name, section); + break; + default: + /* Silently ignore for now. */ + break; + } + + /* If the section flag was not handled, report it here. This will allow + users of the BFD library to report a problem but continue executing. + Tools which need to be aware of these problems (such as the linker) + can override the default bfd_error_handler to intercept these reports. */ + if (unhandled != NULL) + (*_bfd_error_handler) + (_("%s (%s): Section flag %s (0x%x) ignored"), + bfd_get_filename (abfd), name, unhandled, flag); } #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE) @@ -3965,7 +4022,7 @@ coff_write_object_contents (abfd) if (buff == NULL) return false; - coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff); + bfd_coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff); amount = bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd); free (buff); diff --git a/contrib/binutils/bfd/coffgen.c b/contrib/binutils/bfd/coffgen.c index 35e8f71..82bfdc8 100644 --- a/contrib/binutils/bfd/coffgen.c +++ b/contrib/binutils/bfd/coffgen.c @@ -1,5 +1,6 @@ /* Support for the generic parts of COFF, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/cofflink.c b/contrib/binutils/bfd/cofflink.c index 223ccbf..96b005b 100644 --- a/contrib/binutils/bfd/cofflink.c +++ b/contrib/binutils/bfd/cofflink.c @@ -1,5 +1,6 @@ /* COFF specific linker code. - Copyright 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/coffswap.h b/contrib/binutils/bfd/coffswap.h index 2f89afb..2ff0a32 100644 --- a/contrib/binutils/bfd/coffswap.h +++ b/contrib/binutils/bfd/coffswap.h @@ -1,5 +1,5 @@ /* Generic COFF swapping routines, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -286,6 +286,7 @@ coff_swap_filehdr_in (abfd, src, dst) { FILHDR *filehdr_src = (FILHDR *) src; struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst; + #ifdef COFF_ADJUST_FILEHDR_IN_PRE COFF_ADJUST_FILEHDR_IN_PRE (abfd, src, dst); #endif diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd index cd4abc3..c2eb274 100755 --- a/contrib/binutils/bfd/config.bfd +++ b/contrib/binutils/bfd/config.bfd @@ -139,6 +139,12 @@ case "${targ}" in targ_selvecs=armcoff_big_vec targ_underscore=yes ;; + arm-*-vxworks*) + targ_defvec=armcoff_little_vec + targ_selvecs=armcoff_big_vec + targ_underscore=yes + targ_cflags=-DVXWORKS + ;; arm-*-rtems*) targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec @@ -657,14 +663,22 @@ case "${targ}" in targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" ;; - mips*el*-*-linux-gnu* | mips*el*-*-openbsd*) + mips*el*-*-openbsd*) targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; - mips*-*-linux-gnu* | mips*-*-openbsd*) + mips*el*-*-linux-gnu*) + targ_defvec=bfd_elf32_tradlittlemips_vec + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec" + ;; + mips*-*-openbsd*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" ;; + mips*-*-linux-gnu*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; mn10200-*-*) targ_defvec=bfd_elf32_mn10200_vec diff --git a/contrib/binutils/bfd/config.in b/contrib/binutils/bfd/config.in index 74af3d3..9440d71 100644 --- a/contrib/binutils/bfd/config.in +++ b/contrib/binutils/bfd/config.in @@ -25,6 +25,9 @@ /* Define to `long' if doesn't define. */ #undef off_t +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + /* Define to `unsigned' if doesn't define. */ #undef size_t diff --git a/contrib/binutils/bfd/configure b/contrib/binutils/bfd/configure index d348425..75270e2 100755 --- a/contrib/binutils/bfd/configure +++ b/contrib/binutils/bfd/configure @@ -732,49 +732,249 @@ test "$host_alias" != "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:739: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi - echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 -echo "configure:738: checking for strerror in -lcposix" >&5 -ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:769: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lcposix $LIBS" -cat > conftest.$ac_ext <&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:820: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 863 "configure" #include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror(); -int main() { -strerror() -; return 0; } +main(){return(0);} EOF -if { (eval echo configure:757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +if { (eval echo configure:868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:894: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:899: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:927: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no fi rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:959: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lcposix" + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi else echo "$ac_t""no" 1>&6 + ISC= fi - - # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -788,7 +988,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:792: checking for a BSD compatible install" >&5 +echo "configure:992: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -841,7 +1041,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:845: checking whether build environment is sane" >&5 +echo "configure:1045: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -898,7 +1098,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:902: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1102: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -927,7 +1127,7 @@ fi PACKAGE=bfd -VERSION=2.11 +VERSION=2.11.2 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -944,7 +1144,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:948: checking for working aclocal" >&5 +echo "configure:1148: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -957,7 +1157,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:961: checking for working autoconf" >&5 +echo "configure:1161: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -970,7 +1170,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:974: checking for working automake" >&5 +echo "configure:1174: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -983,7 +1183,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:987: checking for working autoheader" >&5 +echo "configure:1187: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -996,7 +1196,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1000: checking for working makeinfo" >&5 +echo "configure:1200: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1019,7 +1219,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1023: checking for $ac_word" >&5 +echo "configure:1223: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1051,7 +1251,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1055: checking for $ac_word" >&5 +echo "configure:1255: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1083,7 +1283,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1087: checking for $ac_word" >&5 +echo "configure:1287: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1186,228 +1386,6 @@ else enable_fast_install=yes fi -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1193: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1223: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1274: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1306: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1317 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1348: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1353: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1381: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -1420,7 +1398,7 @@ ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1424: checking for ld used by GCC" >&5 +echo "configure:1402: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1450,10 +1428,10 @@ echo "configure:1424: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1454: checking for GNU ld" >&5 +echo "configure:1432: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1457: checking for non-GNU ld" >&5 +echo "configure:1435: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1488,7 +1466,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1492: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1470: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1505,7 +1483,7 @@ with_gnu_ld=$ac_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1509: checking for $LD option to reload object files" >&5 +echo "configure:1487: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1517,7 +1495,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1521: checking for BSD-compatible nm" >&5 +echo "configure:1499: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1555,7 +1533,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1559: checking whether ln -s works" >&5 +echo "configure:1537: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1576,7 +1554,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1580: checking how to recognise dependant libraries" >&5 +echo "configure:1558: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1719,13 +1697,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1723: checking for object suffix" >&5 +echo "configure:1701: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1745,7 +1723,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1749: checking for executable suffix" >&5 +echo "configure:1727: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1755,7 +1733,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1782,7 +1760,7 @@ case "$deplibs_check_method" in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1786: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1764: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1844,7 +1822,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1848: checking for file" >&5 +echo "configure:1826: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1915,7 +1893,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1919: checking for $ac_word" >&5 +echo "configure:1897: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1947,7 +1925,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1951: checking for $ac_word" >&5 +echo "configure:1929: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1982,7 +1960,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1986: checking for $ac_word" >&5 +echo "configure:1964: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2014,7 +1992,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2018: checking for $ac_word" >&5 +echo "configure:1996: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2081,8 +2059,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case "$host" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2085 "configure"' > conftest.$ac_ext - if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2063 "configure"' > conftest.$ac_ext + if { (eval echo configure:2064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -2103,7 +2081,7 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2107: checking whether the C compiler needs -belf" >&5 +echo "configure:2085: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2116,14 +2094,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2333,7 +2311,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:2337: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:2315: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -2358,7 +2336,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:2362: checking for executable suffix" >&5 +echo "configure:2340: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2368,7 +2346,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:2350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -2397,7 +2375,7 @@ target64=false # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2401: checking for $ac_word" >&5 +echo "configure:2379: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2427,7 +2405,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2431: checking for $ac_word" >&5 +echo "configure:2409: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2478,7 +2456,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2482: checking for $ac_word" >&5 +echo "configure:2460: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2510,7 +2488,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2514: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2492: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2521,12 +2499,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2525 "configure" +#line 2503 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2552,12 +2530,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2556: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2534: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2561: checking whether we are using GNU C" >&5 +echo "configure:2539: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2566,7 +2544,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2585,7 +2563,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2589: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2567: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2619,7 +2597,7 @@ fi ALL_LINGUAS= echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2623: checking how to run the C preprocessor" >&5 +echo "configure:2601: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2634,13 +2612,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2622: \"$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 : @@ -2651,13 +2629,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2639: \"$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 : @@ -2668,13 +2646,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2656: \"$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 : @@ -2701,7 +2679,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2705: checking for $ac_word" >&5 +echo "configure:2683: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2729,12 +2707,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2733: checking for ANSI C header files" >&5 +echo "configure:2711: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2742,7 +2720,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2724: \"$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* @@ -2759,7 +2737,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2777,7 +2755,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2798,7 +2776,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2809,7 +2787,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2833,12 +2811,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2837: checking for working const" >&5 +echo "configure:2815: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2908,21 +2886,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2912: checking for inline" >&5 +echo "configure:2890: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2948,12 +2926,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2952: checking for off_t" >&5 +echo "configure:2930: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2981,12 +2959,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2985: checking for size_t" >&5 +echo "configure:2963: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3016,19 +2994,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3020: checking for working alloca.h" >&5 +echo "configure:2998: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3049,12 +3027,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3053: checking for alloca" >&5 +echo "configure:3031: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3114,12 +3092,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3118: checking whether alloca needs Cray hooks" >&5 +echo "configure:3096: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3148: checking for $ac_func" >&5 +echo "configure:3126: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3154: \"$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 @@ -3199,7 +3177,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3203: checking stack direction for C alloca" >&5 +echo "configure:3181: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3207,7 +3185,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3251,17 +3229,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3255: checking for $ac_hdr" >&5 +echo "configure:3233: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3243: \"$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* @@ -3290,12 +3268,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3294: checking for $ac_func" >&5 +echo "configure:3272: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3300: \"$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 @@ -3343,7 +3321,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3347: checking for working mmap" >&5 +echo "configure:3325: 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 @@ -3351,7 +3329,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3473: \"$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 @@ -3519,17 +3497,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3523: checking for $ac_hdr" >&5 +echo "configure:3501: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3511: \"$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* @@ -3559,12 +3537,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3563: checking for $ac_func" >&5 +echo "configure:3541: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3569: \"$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 @@ -3616,12 +3594,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3620: checking for $ac_func" >&5 +echo "configure:3598: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3626: \"$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 @@ -3678,19 +3656,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3682: checking for LC_MESSAGES" >&5 +echo "configure:3660: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3711,7 +3689,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3715: checking whether NLS is requested" >&5 +echo "configure:3693: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3731,7 +3709,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3735: checking whether included gettext is requested" >&5 +echo "configure:3713: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3750,17 +3728,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3754: checking for libintl.h" >&5 +echo "configure:3732: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3742: \"$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* @@ -3777,19 +3755,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3781: checking for gettext in libc" >&5 +echo "configure:3759: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3805,7 +3783,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3809: checking for bindtextdomain in -lintl" >&5 +echo "configure:3787: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3813,7 +3791,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3840,19 +3818,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3844: checking for gettext in libintl" >&5 +echo "configure:3822: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3880,7 +3858,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3884: checking for $ac_word" >&5 +echo "configure:3862: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3914,12 +3892,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3918: checking for $ac_func" >&5 +echo "configure:3896: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3924: \"$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 @@ -3969,7 +3947,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3973: checking for $ac_word" >&5 +echo "configure:3951: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4005,7 +3983,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4009: checking for $ac_word" >&5 +echo "configure:3987: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4037,7 +4015,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4077,7 +4055,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4081: checking for $ac_word" >&5 +echo "configure:4059: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4111,7 +4089,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4115: checking for $ac_word" >&5 +echo "configure:4093: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4147,7 +4125,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4151: checking for $ac_word" >&5 +echo "configure:4129: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4237,7 +4215,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4241: checking for catalogs to be installed" >&5 +echo "configure:4219: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4265,17 +4243,17 @@ echo "configure:4241: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4269: checking for linux/version.h" >&5 +echo "configure:4247: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4257: \"$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* @@ -4353,7 +4331,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:4357: checking for a BSD compatible install" >&5 +echo "configure:4335: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4436,7 +4414,7 @@ if test "x$cross_compiling" = "xno"; then EXEEXT_FOR_BUILD='$(EXEEXT)' else echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6 -echo "configure:4440: checking for build system executable suffix" >&5 +echo "configure:4418: checking for build system executable suffix" >&5 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4464,17 +4442,17 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4468: checking for $ac_hdr" >&5 +echo "configure:4446: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4456: \"$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* @@ -4504,17 +4482,17 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4508: checking for $ac_hdr" >&5 +echo "configure:4486: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4496: \"$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* @@ -4541,12 +4519,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4545: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4523: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4555,7 +4533,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4580,12 +4558,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4584: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4562: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -4593,7 +4571,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4618,7 +4596,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4622: checking for opendir in -ldir" >&5 +echo "configure:4600: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4626,7 +4604,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4659,7 +4637,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4663: checking for opendir in -lx" >&5 +echo "configure:4641: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4667,7 +4645,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4703,12 +4681,12 @@ fi for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4707: checking for $ac_func" >&5 +echo "configure:4685: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4713: \"$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 @@ -4766,12 +4744,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4770: checking whether strstr must be declared" >&5 +echo "configure:4748: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4792,7 +4770,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4813,12 +4791,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4817: checking whether malloc must be declared" >&5 +echo "configure:4795: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4839,7 +4817,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4860,12 +4838,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4864: checking whether realloc must be declared" >&5 +echo "configure:4842: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4886,7 +4864,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4907,12 +4885,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4911: checking whether free must be declared" >&5 +echo "configure:4889: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4933,7 +4911,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4954,12 +4932,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4958: checking whether getenv must be declared" >&5 +echo "configure:4936: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4980,7 +4958,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5152,12 +5130,12 @@ if test "${target}" = "${host}"; then ;; rs6000-*-aix4*) COREFILE=rs6000-core.lo ;; rs6000-*-*) COREFILE=rs6000-core.lo ;; - powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; powerpc-*-aix4*) COREFILE=rs6000-core.lo ;; powerpc-*-aix*) COREFILE=rs6000-core.lo ;; powerpc-*-beos*) ;; powerpc-*-freebsd*) COREFILE='' ;; powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; + powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; sparc-*-netbsd* | sparc-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -5199,17 +5177,17 @@ if test "${target}" = "${host}"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5203: checking for $ac_hdr" >&5 +echo "configure:5181: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5191: \"$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* @@ -5237,12 +5215,12 @@ done if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5241: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5219: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5273,12 +5251,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5277: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5255: checking for prstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5309,12 +5287,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5313: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5291: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -5345,12 +5323,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5349: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5327: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else @@ -5381,12 +5359,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5385: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5363: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5417,12 +5395,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5421: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5399: checking for pxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5453,12 +5431,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6 echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5457: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5435: checking for pstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5489,12 +5467,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5493: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5471: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5525,12 +5503,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5529: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5507: checking for prpsinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5561,12 +5539,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5565: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5543: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5597,12 +5575,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5601: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5579: checking for psinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5633,12 +5611,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5637: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5615: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5669,12 +5647,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5673: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5651: checking for lwpxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5705,12 +5683,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5709: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5687: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -5741,12 +5719,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5745: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5723: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -5777,12 +5755,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5781: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5759: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -5934,7 +5912,7 @@ do b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; - bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo peigen.lo cofflink.lo" + bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo" target64=true ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" target64=true ;; @@ -6002,6 +5980,10 @@ do target64=true ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf" target64=true ;; + bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" + target64=true ;; + bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" + target64=true ;; cisco_core_big_vec) tb="$tb cisco-core.lo" ;; cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; @@ -6185,17 +6167,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6189: checking for $ac_hdr" >&5 +echo "configure:6171: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6181: \"$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* @@ -6224,12 +6206,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6228: checking for $ac_func" >&5 +echo "configure:6210: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6238: \"$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 @@ -6277,7 +6259,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6281: checking for working mmap" >&5 +echo "configure:6263: 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 @@ -6285,7 +6267,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6411: \"$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 @@ -6450,12 +6432,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6454: checking for $ac_func" >&5 +echo "configure:6436: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6464: \"$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 @@ -6658,6 +6640,7 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g +s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g @@ -6671,7 +6654,6 @@ s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g -s%@CC@%$CC%g s%@LN_S@%$LN_S%g s%@OBJEXT@%$OBJEXT%g s%@EXEEXT@%$EXEEXT%g @@ -6934,10 +6916,11 @@ cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile +sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/contrib/binutils/bfd/configure.in b/contrib/binutils/bfd/configure.in index eeb3eb7..b639e3b 100644 --- a/contrib/binutils/bfd/configure.in +++ b/contrib/binutils/bfd/configure.in @@ -7,7 +7,7 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.11) +AM_INIT_AUTOMAKE(bfd, 2.11.2) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -304,12 +304,12 @@ changequote([,])dnl ;; rs6000-*-aix4*) COREFILE=rs6000-core.lo ;; rs6000-*-*) COREFILE=rs6000-core.lo ;; - powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; powerpc-*-aix4*) COREFILE=rs6000-core.lo ;; powerpc-*-aix*) COREFILE=rs6000-core.lo ;; powerpc-*-beos*) ;; powerpc-*-freebsd*) COREFILE='' ;; powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; + powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; sparc-*-netbsd* | sparc-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -485,7 +485,7 @@ do b_out_vec_big_host) tb="$tb bout.lo aout32.lo" ;; b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; - bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo peigen.lo cofflink.lo" + bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo" target64=true ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" target64=true ;; @@ -553,6 +553,10 @@ do target64=true ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf" target64=true ;; + bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" + target64=true ;; + bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo $elf ecofflink.lo" + target64=true ;; cisco_core_big_vec) tb="$tb cisco-core.lo" ;; cisco_core_little_vec) tb="$tb cisco-core.lo" ;; cris_aout_vec) tb="$tb aout-cris.lo" ;; @@ -741,4 +745,5 @@ esac rm -f doc/config.status AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in, -[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile]) +[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]) + diff --git a/contrib/binutils/bfd/corefile.c b/contrib/binutils/bfd/corefile.c index 061383f..3ce0785 100644 --- a/contrib/binutils/bfd/corefile.c +++ b/contrib/binutils/bfd/corefile.c @@ -1,5 +1,6 @@ /* Core file generic interface routines for BFD. - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 2000 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cpu-alpha.c b/contrib/binutils/bfd/cpu-alpha.c index 48a16e3..93fc69c 100644 --- a/contrib/binutils/bfd/cpu-alpha.c +++ b/contrib/binutils/bfd/cpu-alpha.c @@ -1,5 +1,5 @@ /* BFD support for the Alpha architecture. - Copyright 1992 Free Software Foundation, Inc. + Copyright 1992, 1993, 1998, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cpu-arm.c b/contrib/binutils/bfd/cpu-arm.c index 91507f8..8cd64e9 100644 --- a/contrib/binutils/bfd/cpu-arm.c +++ b/contrib/binutils/bfd/cpu-arm.c @@ -1,5 +1,5 @@ /* BFD support for the ARM processor - Copyright 1994, 95, 97, 1999 Free Software Foundation, Inc. + Copyright 1994, 1997, 1999, 2000 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cpu-i386.c b/contrib/binutils/bfd/cpu-i386.c index c3e9baf..860d91a 100644 --- a/contrib/binutils/bfd/cpu-i386.c +++ b/contrib/binutils/bfd/cpu-i386.c @@ -1,5 +1,6 @@ /* BFD support for the Intel 386 architecture. - Copyright 1992, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1992, 1994, 1995, 1996, 1998, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cpu-powerpc.c b/contrib/binutils/bfd/cpu-powerpc.c index 2e41899..235ec29 100644 --- a/contrib/binutils/bfd/cpu-powerpc.c +++ b/contrib/binutils/bfd/cpu-powerpc.c @@ -1,5 +1,5 @@ /* BFD PowerPC CPU definition - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 2000 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cpu-sparc.c b/contrib/binutils/bfd/cpu-sparc.c index 5c777d2..dbc83ba 100644 --- a/contrib/binutils/bfd/cpu-sparc.c +++ b/contrib/binutils/bfd/cpu-sparc.c @@ -1,5 +1,5 @@ /* BFD support for the SPARC architecture. - Copyright (C) 1992, 94, 95, 96, 97, 2000 Free Software Foundation, Inc. + Copyright 1992, 1995, 1996, 1998, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cpu-v850.c b/contrib/binutils/bfd/cpu-v850.c index 55606f8..5eb5b74 100644 --- a/contrib/binutils/bfd/cpu-v850.c +++ b/contrib/binutils/bfd/cpu-v850.c @@ -1,5 +1,5 @@ /* BFD support for the NEC V850 processor - Copyright 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/cpu-z8k.c b/contrib/binutils/bfd/cpu-z8k.c index 29682c1..643932a 100644 --- a/contrib/binutils/bfd/cpu-z8k.c +++ b/contrib/binutils/bfd/cpu-z8k.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Z800n architecture. - Copyright (C) 1992 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 2000 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/demo64.c b/contrib/binutils/bfd/demo64.c index c91381d..b64499b 100644 --- a/contrib/binutils/bfd/demo64.c +++ b/contrib/binutils/bfd/demo64.c @@ -1,5 +1,5 @@ /* BFD backend for demonstration 64-bit a.out binaries. - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog index 57326a9..363ea91 100644 --- a/contrib/binutils/bfd/doc/ChangeLog +++ b/contrib/binutils/bfd/doc/ChangeLog @@ -1,3 +1,8 @@ +2001-06-11 Alan Modra + + * bfdint.texi (BFD target vector miscellaneous): --oformat, not + -oformat. + 2001-01-25 Kazu Hirata * chew.c: Do not output trailing whitespaces in type and diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in index dfc33e1..d4c30a6 100644 --- a/contrib/binutils/bfd/doc/Makefile.in +++ b/contrib/binutils/bfd/doc/Makefile.in @@ -194,7 +194,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = gtar +TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: diff --git a/contrib/binutils/bfd/doc/archures.texi b/contrib/binutils/bfd/doc/archures.texi index b363780..5924e7b 100644 --- a/contrib/binutils/bfd/doc/archures.texi +++ b/contrib/binutils/bfd/doc/archures.texi @@ -46,6 +46,10 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 +#define bfd_mach_mcf5200 9 +#define bfd_mach_mcf5206e 10 +#define bfd_mach_mcf5307 11 +#define bfd_mach_mcf5407 12 bfd_arch_vax, /* DEC Vax */ bfd_arch_i960, /* Intel 960 */ /* The order of the following is important. @@ -97,6 +101,7 @@ enum bfd_architecture #define bfd_mach_mips6000 6000 #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 +#define bfd_mach_mips12000 12000 #define bfd_mach_mips16 16 #define bfd_mach_mips32 32 #define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */ diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo index 9803371..bcc9c38 100644 --- a/contrib/binutils/bfd/doc/bfd.texinfo +++ b/contrib/binutils/bfd/doc/bfd.texinfo @@ -1,6 +1,8 @@ \input texinfo.tex @setfilename bfd.info -@c $Id: bfd.texinfo,v 1.2 2000/11/15 18:24:49 nickc Exp $ +@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000 +@c Free Software Foundation, Inc. +@c @tex % NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE \global\long\def\example{% @@ -62,7 +64,7 @@ notice identical to this one except for the removal of this paragraph @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.2 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.2.2.1 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Support\par \hfill sac\@cygnus.com\par diff --git a/contrib/binutils/bfd/doc/bfdint.texi b/contrib/binutils/bfd/doc/bfdint.texi index b0a0182..5aa8ed3 100644 --- a/contrib/binutils/bfd/doc/bfdint.texi +++ b/contrib/binutils/bfd/doc/bfdint.texi @@ -1,4 +1,7 @@ \input texinfo +@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, +@c 2000 +@c Free Software Foundation, Inc. @setfilename bfdint.info @settitle BFD Internals @@ -293,7 +296,7 @@ The target vector starts with a set of constants. @item name The name of the target vector. This is an arbitrary string. This is how the target vector is named in command line options for tools which -use BFD, such as the @samp{-oformat} linker option. +use BFD, such as the @samp{--oformat} linker option. @item flavour A general description of the type of target. The following flavours are diff --git a/contrib/binutils/bfd/doc/chew.c b/contrib/binutils/bfd/doc/chew.c index 7b98ccf..843e441 100644 --- a/contrib/binutils/bfd/doc/chew.c +++ b/contrib/binutils/bfd/doc/chew.c @@ -1,5 +1,5 @@ /* chew - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. Contributed by steve chamberlain @cygnus diff --git a/contrib/binutils/bfd/doc/reloc.texi b/contrib/binutils/bfd/doc/reloc.texi index eb31eca..52fa2bd 100644 --- a/contrib/binutils/bfd/doc/reloc.texi +++ b/contrib/binutils/bfd/doc/reloc.texi @@ -599,7 +599,9 @@ Reloc types used for i960/b.out. @deffnx {} BFD_RELOC_SPARC_GLOB_DAT @deffnx {} BFD_RELOC_SPARC_JMP_SLOT @deffnx {} BFD_RELOC_SPARC_RELATIVE +@deffnx {} BFD_RELOC_SPARC_UA16 @deffnx {} BFD_RELOC_SPARC_UA32 +@deffnx {} BFD_RELOC_SPARC_UA64 SPARC ELF relocations. There is probably some overlap with other relocation types already defined. @end deffn @@ -752,6 +754,17 @@ Relocation against a MIPS literal section. @deffnx {} BFD_RELOC_MIPS_GOT_PAGE @deffnx {} BFD_RELOC_MIPS_GOT_OFST @deffnx {} BFD_RELOC_MIPS_GOT_DISP +@deffnx {} BFD_RELOC_MIPS_SHIFT5 +@deffnx {} BFD_RELOC_MIPS_SHIFT6 +@deffnx {} BFD_RELOC_MIPS_INSERT_A +@deffnx {} BFD_RELOC_MIPS_INSERT_B +@deffnx {} BFD_RELOC_MIPS_DELETE +@deffnx {} BFD_RELOC_MIPS_HIGHEST +@deffnx {} BFD_RELOC_MIPS_HIGHER +@deffnx {} BFD_RELOC_MIPS_SCN_DISP +@deffnx {} BFD_RELOC_MIPS_REL16 +@deffnx {} BFD_RELOC_MIPS_RELGOT +@deffnx {} BFD_RELOC_MIPS_JALR MIPS ELF relocations. @end deffn @deffn {} BFD_RELOC_386_GOT32 diff --git a/contrib/binutils/bfd/doc/section.texi b/contrib/binutils/bfd/doc/section.texi index 4b0ec017..0167def 100644 --- a/contrib/binutils/bfd/doc/section.texi +++ b/contrib/binutils/bfd/doc/section.texi @@ -321,6 +321,10 @@ typedef struct sec /* A mark flag used by some of the linker backends. */ unsigned int linker_mark : 1; + /* Another mark flag used by some of the linker backends. Set for + output sections that have a input section. */ + unsigned int linker_has_input : 1; + /* A mark flag used by some linker backends for garbage collection. */ unsigned int gc_mark : 1; diff --git a/contrib/binutils/bfd/dwarf1.c b/contrib/binutils/bfd/dwarf1.c index b96adc5..2fef2ef 100644 --- a/contrib/binutils/bfd/dwarf1.c +++ b/contrib/binutils/bfd/dwarf1.c @@ -458,7 +458,7 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, struct dwarf1_unit* eachUnit; /* What address are we looking for? */ - bfd_vma addr = offset + section->vma; + unsigned long addr = (unsigned long)(offset + section->vma); *filename_ptr = NULL; *functionname_ptr = NULL; diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c index 141c686..4a03273 100644 --- a/contrib/binutils/bfd/dwarf2.c +++ b/contrib/binutils/bfd/dwarf2.c @@ -1,5 +1,6 @@ /* DWARF 2 support. - Copyright 1994, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -436,9 +437,9 @@ read_abbrevs (abfd, offset, stash) return 0; } - if (offset > stash->dwarf_abbrev_size) + if (offset >= stash->dwarf_abbrev_size) { - (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)."), + (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) greater than or equal to abbrev size (%u)."), offset, stash->dwarf_abbrev_size ); bfd_set_error (bfd_error_bad_value); return 0; @@ -803,7 +804,7 @@ decode_line_info (unit, stash) below. */ if (unit->line_offset >= stash->dwarf_line_size) { - (*_bfd_error_handler) (_("Dwarf Error: Line offset (%u) bigger than line size (%u)."), + (*_bfd_error_handler) (_("Dwarf Error: Line offset (%u) greater than or equal to line size (%u)."), unit->line_offset, stash->dwarf_line_size); bfd_set_error (bfd_error_bad_value); return 0; diff --git a/contrib/binutils/bfd/ecoff.c b/contrib/binutils/bfd/ecoff.c index f22112b..db60638 100644 --- a/contrib/binutils/bfd/ecoff.c +++ b/contrib/binutils/bfd/ecoff.c @@ -1,5 +1,5 @@ /* Generic ECOFF (Extended-COFF) routines. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -74,20 +74,28 @@ static unsigned int ecoff_armap_hash PARAMS ((CONST char *s, static asection bfd_debug_section = { - /* name, index, next, flags, set_vma, reloc_done, linker_mark, gc_mark */ - "*DEBUG*", 0, 0, 0, 0, 0, 0, 0, - /* vma, lma, _cooked_size, _raw_size, output_offset, output_section, */ - 0, 0, 0, 0, 0, NULL, - /* alig, reloc..., orel..., reloc_count, filepos, rel_..., line_... */ - 0, 0, 0, 0, 0, 0, 0, - /* userdata, contents, lineno, lineno_count */ - 0, 0, 0, 0, - /* comdat_info, moving_line_filepos, target_index, used_by_bfd, */ - NULL, 0, 0, 0, - /* cons, owner, symbol */ - 0, 0, (struct symbol_cache_entry *) NULL, - /* symbol_ptr_ptr, link_order_head, ..._tail */ - (struct symbol_cache_entry **) NULL, NULL, NULL + /* name, id, index, next, flags, user_set_vma, reloc_done, */ + "*DEBUG*", 0, 0, NULL, 0, 0, 0, + /* linker_mark, linker_has_input, gc_mark, segment_mark, */ + 0, 0, 0, 0, + /* vma, lma, _cooked_size, _raw_size, */ + 0, 0, 0, 0, + /* output_offset, output_section, alignment_power, */ + 0, NULL, 0, + /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ + NULL, NULL, 0, 0, 0, + /* line_filepos, userdata, contents, lineno, lineno_count, */ + 0, NULL, NULL, NULL, 0, + /* comdat, kept_section, moving_line_filepos, */ + NULL, NULL, 0, + /* target_index, used_by_bfd, constructor_chain, owner, */ + 0, NULL, NULL, NULL, + /* symbol, */ + (struct symbol_cache_entry *) NULL, + /* symbol_ptr_ptr, */ + (struct symbol_cache_entry **) NULL, + /* link_order_head, link_order_tail */ + NULL, NULL }; /* Create an ECOFF object. */ diff --git a/contrib/binutils/bfd/ecofflink.c b/contrib/binutils/bfd/ecofflink.c index 9b2e0f5..37b3538 100644 --- a/contrib/binutils/bfd/ecofflink.c +++ b/contrib/binutils/bfd/ecofflink.c @@ -1,5 +1,6 @@ /* Routines to link ECOFF debugging information. - Copyright 1993, 94, 95, 96, 97, 99, 2000 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 2000 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/ecoffswap.h b/contrib/binutils/bfd/ecoffswap.h index 70d548d..dd6fa6f 100644 --- a/contrib/binutils/bfd/ecoffswap.h +++ b/contrib/binutils/bfd/ecoffswap.h @@ -1,5 +1,6 @@ /* Generic ECOFF swapping routines, for BFD. - Copyright 1992, 1993, 1994, 1995, 1996, 2000 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -195,7 +196,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->f_adr); intern->rss = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rss); #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - if (intern->rss == 0xffffffff) + if (intern->rss == (signed long) 0xffffffff) intern->rss = -1; #endif intern->issBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_issBase); diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h index 4a36629..b162290 100644 --- a/contrib/binutils/bfd/elf-bfd.h +++ b/contrib/binutils/bfd/elf-bfd.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for ELF files. - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999, 2000 Free Software - Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -27,6 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/external.h" #include "bfdlink.h" +/* The number of entries in a section is its size divided by the size + of a single entry. This is normally only applicaable to reloc and + symbol table sections. */ +#define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize) + /* If size isn't specified as 64 or 32, NAME macro should fail. */ #ifndef NAME #if ARCH_SIZE==64 diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c index 5ae24ee..f98b49c 100644 --- a/contrib/binutils/bfd/elf.c +++ b/contrib/binutils/bfd/elf.c @@ -1,5 +1,6 @@ /* ELF executable support for BFD. - Copyright 1993, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -56,6 +57,10 @@ static INLINE int sym_is_global PARAMS ((bfd *, asymbol *)); static boolean elf_map_symbols PARAMS ((bfd *)); static bfd_size_type get_program_header_size PARAMS ((bfd *)); static boolean elfcore_read_notes PARAMS ((bfd *, bfd_vma, bfd_vma)); +static boolean elf_find_function PARAMS ((bfd *, asection *, + asymbol **, + bfd_vma, const char **, + const char **)); /* Swap version information in and out. The version information is currently size independent. If that ever changes, this code will @@ -805,8 +810,8 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) break; case bfd_print_symbol_all: { - CONST char *section_name; - CONST char *name = NULL; + const char *section_name; + const char *name = NULL; struct elf_backend_data *bed; unsigned char st_other; @@ -1002,8 +1007,9 @@ _bfd_elf_link_hash_hide_symbol (info, h) struct elf_link_hash_entry *h; { h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - h->dynindx = -1; h->plt.offset = (bfd_vma) -1; + if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + h->dynindx = -1; } /* Initialize an ELF linker hash table. */ @@ -1423,7 +1429,7 @@ bfd_section_from_shdr (abfd, shindex) } *hdr2 = *hdr; elf_elfsections (abfd)[shindex] = hdr2; - target_sect->reloc_count += hdr->sh_size / hdr->sh_entsize; + target_sect->reloc_count += NUM_SHDR_ENTRIES (hdr); target_sect->flags |= SEC_RELOC; target_sect->relocation = NULL; target_sect->rel_filepos = hdr->sh_offset; @@ -3390,7 +3396,7 @@ prep_headers (abfd) case bfd_arch_cris: i_ehdrp->e_machine = EM_CRIS; break; - /* also note that EM_M32, AT&T WE32100 is unknown to bfd */ + /* Also note that EM_M32, AT&T WE32100 is unknown to bfd. */ default: i_ehdrp->e_machine = EM_NONE; } @@ -4727,8 +4733,8 @@ _bfd_elf_slurp_version_tables (abfd) { _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem); - if ((iverdefmem.vd_ndx & VERSYM_VERSION) > maxidx) - maxidx = iverdefmem.vd_ndx & VERSYM_VERSION; + if ((iverdefmem.vd_ndx & ((unsigned) VERSYM_VERSION)) > maxidx) + maxidx = iverdefmem.vd_ndx & ((unsigned) VERSYM_VERSION); everdef = ((Elf_External_Verdef *) ((bfd_byte *) everdef + iverdefmem.vd_next)); @@ -4971,53 +4977,24 @@ _bfd_elf_set_arch_mach (abfd, arch, machine) return bfd_default_set_arch_mach (abfd, arch, machine); } -/* Find the nearest line to a particular section and offset, for error - reporting. */ +/* Find the function to a particular section and offset, + for error reporting. */ -boolean -_bfd_elf_find_nearest_line (abfd, - section, - symbols, - offset, - filename_ptr, - functionname_ptr, - line_ptr) - bfd *abfd; +static boolean +elf_find_function (abfd, section, symbols, offset, + filename_ptr, functionname_ptr) + bfd *abfd ATTRIBUTE_UNUSED; asection *section; asymbol **symbols; bfd_vma offset; - CONST char **filename_ptr; - CONST char **functionname_ptr; - unsigned int *line_ptr; + const char **filename_ptr; + const char **functionname_ptr; { - boolean found; const char *filename; asymbol *func; bfd_vma low_func; asymbol **p; - if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr)) - return true; - - if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr, 0, - &elf_tdata (abfd)->dwarf2_find_line_info)) - return true; - - if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, - &found, filename_ptr, - functionname_ptr, line_ptr, - &elf_tdata (abfd)->line_info)) - return false; - if (found) - return true; - - if (symbols == NULL) - return false; - filename = NULL; func = NULL; low_func = 0; @@ -5054,8 +5031,70 @@ _bfd_elf_find_nearest_line (abfd, if (func == NULL) return false; - *filename_ptr = filename; - *functionname_ptr = bfd_asymbol_name (func); + if (filename_ptr) + *filename_ptr = filename; + if (functionname_ptr) + *functionname_ptr = bfd_asymbol_name (func); + + return true; +} + +/* Find the nearest line to a particular section and offset, + for error reporting. */ + +boolean +_bfd_elf_find_nearest_line (abfd, section, symbols, offset, + filename_ptr, functionname_ptr, line_ptr) + bfd *abfd; + asection *section; + asymbol **symbols; + bfd_vma offset; + const char **filename_ptr; + const char **functionname_ptr; + unsigned int *line_ptr; +{ + boolean found; + + if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, + filename_ptr, functionname_ptr, + line_ptr)) + { + if (!*functionname_ptr) + elf_find_function (abfd, section, symbols, offset, + *filename_ptr ? NULL : filename_ptr, + functionname_ptr); + + return true; + } + + if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, + filename_ptr, functionname_ptr, + line_ptr, 0, + &elf_tdata (abfd)->dwarf2_find_line_info)) + { + if (!*functionname_ptr) + elf_find_function (abfd, section, symbols, offset, + *filename_ptr ? NULL : filename_ptr, + functionname_ptr); + + return true; + } + + if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, + &found, filename_ptr, + functionname_ptr, line_ptr, + &elf_tdata (abfd)->line_info)) + return false; + if (found) + return true; + + if (symbols == NULL) + return false; + + if (! elf_find_function (abfd, section, symbols, offset, + filename_ptr, functionname_ptr)) + return false; + *line_ptr = 0; return true; } diff --git a/contrib/binutils/bfd/elf32-arm.h b/contrib/binutils/bfd/elf32-arm.h index 0f2ac8a..66edd6d 100644 --- a/contrib/binutils/bfd/elf32-arm.h +++ b/contrib/binutils/bfd/elf32-arm.h @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -78,22 +78,22 @@ static int elf32_thumb_to_arm_stub this. It is set up so that any shared library function that is called before the relocation has been set up calls the dynamic linker first. */ -static const bfd_byte elf32_arm_plt0_entry [PLT_ENTRY_SIZE] = +static const unsigned long elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] = { - 0x04, 0xe0, 0x2d, 0xe5, /* str lr, [sp, #-4]! */ - 0x10, 0xe0, 0x9f, 0xe5, /* ldr lr, [pc, #16] */ - 0x0e, 0xe0, 0x8f, 0xe0, /* adr lr, pc, lr */ - 0x08, 0xf0, 0xbe, 0xe5 /* ldr pc, [lr, #8]! */ + 0xe52de004, /* str lr, [sp, #-4]! */ + 0xe59fe010, /* ldr lr, [pc, #16] */ + 0xe08fe00e, /* add lr, pc, lr */ + 0xe5bef008 /* ldr pc, [lr, #8]! */ }; /* Subsequent entries in a procedure linkage table look like this. */ -static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] = +static const unsigned long elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = { - 0x04, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc, #4] */ - 0x0c, 0xc0, 0x8f, 0xe0, /* add ip, pc, ip */ - 0x00, 0xf0, 0x9c, 0xe5, /* ldr pc, [ip] */ - 0x00, 0x00, 0x00, 0x00 /* offset to symbol in got */ + 0xe59fc004, /* ldr ip, [pc, #4] */ + 0xe08fc00c, /* add ip, pc, ip */ + 0xe59cf000, /* ldr pc, [ip] */ + 0x00000000 /* offset to symbol in got */ }; /* The ARM linker needs to keep track of the number of relocs that it @@ -1019,6 +1019,18 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, bfd_signed_vma signed_addend; struct elf32_arm_link_hash_table * globals; + /* If the start address has been set, then set the EF_ARM_HASENTRY + flag. Setting this more than once is redundant, but the cost is + not too high, and it keeps the code simple. + + The test is done here, rather than somewhere else, because the + start address is only set just before the final link commences. + + Note - if the user deliberately sets a start address of 0, the + flag will not be set. */ + if (bfd_get_start_address (output_bfd) != 0) + elf_elfheader (output_bfd)->e_flags |= EF_ARM_HASENTRY; + globals = elf32_arm_hash_table (info); dynobj = elf_hash_table (info)->dynobj; @@ -1434,6 +1446,18 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 12) & 0x7ff); lower_insn = (lower_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 1) & 0x7ff); +#ifndef OLD_ARM_ABI + if (r_type == R_ARM_THM_XPC22 + && ((lower_insn & 0x1800) == 0x0800)) + /* Remove bit zero of the adjusted offset. Bit zero can only be + set if the upper insn is at a half-word boundary, since the + destination address, an ARM instruction, must always be on a + word boundary. The semantics of the BLX (1) instruction, however, + are that bit zero in the offset must always be zero, and the + corresponding bit one in the target address will be set from bit + one of the source address. */ + lower_insn &= ~1; +#endif /* Put the relocated value back in the object file: */ bfd_put_16 (input_bfd, upper_insn, hit_data); bfd_put_16 (input_bfd, lower_insn, hit_data + 2); @@ -3135,9 +3159,12 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) got_offset = (plt_index + 3) * 4; /* Fill in the entry in the procedure linkage table. */ - memcpy (splt->contents + h->plt.offset, - elf32_arm_plt_entry, - PLT_ENTRY_SIZE); + bfd_put_32 (output_bfd, elf32_arm_plt_entry[0], + splt->contents + h->plt.offset + 0); + bfd_put_32 (output_bfd, elf32_arm_plt_entry[1], + splt->contents + h->plt.offset + 4); + bfd_put_32 (output_bfd, elf32_arm_plt_entry[2], + splt->contents + h->plt.offset + 8); bfd_put_32 (output_bfd, (sgot->output_section->vma + sgot->output_offset @@ -3333,7 +3360,12 @@ elf32_arm_finish_dynamic_sections (output_bfd, info) /* Fill in the first entry in the procedure linkage table. */ if (splt->_raw_size > 0) - memcpy (splt->contents, elf32_arm_plt0_entry, PLT_ENTRY_SIZE); + { + bfd_put_32 (output_bfd, elf32_arm_plt0_entry[0], splt->contents + 0); + bfd_put_32 (output_bfd, elf32_arm_plt0_entry[1], splt->contents + 4); + bfd_put_32 (output_bfd, elf32_arm_plt0_entry[2], splt->contents + 8); + bfd_put_32 (output_bfd, elf32_arm_plt0_entry[3], splt->contents + 12); + } /* UnixWare sets the entsize of .plt to 4, although that doesn't really seem like the right value. */ diff --git a/contrib/binutils/bfd/elf32-i386.c b/contrib/binutils/bfd/elf32-i386.c index 4ad2c2b..b838d3a 100644 --- a/contrib/binutils/bfd/elf32-i386.c +++ b/contrib/binutils/bfd/elf32-i386.c @@ -1,5 +1,5 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright 1993, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -501,6 +501,20 @@ elf_i386_check_relocs (abfd, info, sec, relocs) r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) + { + if (abfd->my_archive) + (*_bfd_error_handler) (_("%s(%s): bad symbol index: %d"), + bfd_get_filename (abfd->my_archive), + bfd_get_filename (abfd), + r_symndx); + else + (*_bfd_error_handler) (_("%s: bad symbol index: %d"), + bfd_get_filename (abfd), + r_symndx); + return false; + } + if (r_symndx < symtab_hdr->sh_info) h = NULL; else @@ -686,7 +700,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) (*_bfd_error_handler) (_("%s: bad relocation section name `%s\'"), bfd_get_filename (abfd), name); - } + } sreloc = bfd_get_section_by_name (dynobj, name); if (sreloc == NULL) @@ -818,7 +832,7 @@ elf_i386_gc_mark_hook (abfd, info, rel, h, sym) static boolean elf_i386_gc_sweep_hook (abfd, info, sec, relocs) bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct bfd_link_info *info; asection *sec; const Elf_Internal_Rela *relocs; { @@ -2066,6 +2080,44 @@ elf_i386_finish_dynamic_sections (output_bfd, info) return true; } +/* Set the correct type for an x86 ELF section. We do this by the + section name, which is a hack, but ought to work. */ + +static boolean +elf_i386_fake_sections (abfd, hdr, sec) + bfd *abfd ATTRIBUTE_UNUSED; + Elf32_Internal_Shdr *hdr; + asection *sec; +{ + register const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ".reloc") == 0) + /* + * This is an ugly, but unfortunately necessary hack that is + * needed when producing EFI binaries on x86. It tells + * elf.c:elf_fake_sections() not to consider ".reloc" as a section + * containing ELF relocation info. We need this hack in order to + * be able to generate ELF binaries that can be translated into + * EFI applications (which are essentially COFF objects). Those + * files contain a COFF ".reloc" section inside an ELFNN object, + * which would normally cause BFD to segfault because it would + * attempt to interpret this section as containing relocation + * entries for section "oc". With this hack enabled, ".reloc" + * will be treated as a normal data section, which will avoid the + * segfault. However, you won't be able to create an ELFNN binary + * with a section named "oc" that needs relocations, but that's + * the kind of ugly side-effects you get when detecting section + * types based on their names... In practice, this limitation is + * unlikely to bite. + */ + hdr->sh_type = SHT_PROGBITS; + + return true; +} + + #define TARGET_LITTLE_SYM bfd_elf32_i386_vec #define TARGET_LITTLE_NAME "elf32-i386" #define ELF_ARCH bfd_arch_i386 @@ -2096,5 +2148,6 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define elf_backend_gc_sweep_hook elf_i386_gc_sweep_hook #define elf_backend_relocate_section elf_i386_relocate_section #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections +#define elf_backend_fake_sections elf_i386_fake_sections #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c index d3152ce..ab803f4 100644 --- a/contrib/binutils/bfd/elf32-ppc.c +++ b/contrib/binutils/bfd/elf32-ppc.c @@ -1,5 +1,6 @@ /* PowerPC-specific support for 32-bit ELF - Copyright 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/elf32-sparc.c b/contrib/binutils/bfd/elf32-sparc.c index 4e9c6c2..091cd39 100644 --- a/contrib/binutils/bfd/elf32-sparc.c +++ b/contrib/binutils/bfd/elf32-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for 32-bit ELF - Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -85,7 +85,7 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] = HOWTO(R_SPARC_GLOB_DAT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GLOB_DAT",false,0,0x00000000,true), HOWTO(R_SPARC_JMP_SLOT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",false,0,0x00000000,true), HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true), - HOWTO(R_SPARC_UA32, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0x00000000,true), + HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true), HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PLT32", false,0,0x00000000,true), HOWTO(R_SPARC_HIPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HIPLT22", false,0,0x00000000,true), HOWTO(R_SPARC_LOPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_LOPLT10", false,0,0x00000000,true), @@ -120,9 +120,9 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] = HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_REV32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", false,0,0xffffffff,true), + HOWTO(R_SPARC_UA64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", false,0,(~ (bfd_vma)0), true), + HOWTO(R_SPARC_UA16, 0,1,16,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", false,0,0x0000ffff,true), + HOWTO(R_SPARC_REV32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", false,0,0xffffffff,true), }; static reloc_howto_type elf32_sparc_vtinherit_howto = HOWTO (R_SPARC_GNU_VTINHERIT, 0,2,0,false,0,complain_overflow_dont, NULL, "R_SPARC_GNU_VTINHERIT", false,0, 0, false); @@ -159,26 +159,27 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_SPARC_JMP_SLOT, R_SPARC_JMP_SLOT }, { BFD_RELOC_SPARC_RELATIVE, R_SPARC_RELATIVE }, { BFD_RELOC_SPARC_WDISP22, R_SPARC_WDISP22 }, - /* ??? Doesn't dwarf use this? */ -/*{ BFD_RELOC_SPARC_UA32, R_SPARC_UA32 }, not used?? */ - {BFD_RELOC_SPARC_10, R_SPARC_10}, - {BFD_RELOC_SPARC_11, R_SPARC_11}, - {BFD_RELOC_SPARC_64, R_SPARC_64}, - {BFD_RELOC_SPARC_OLO10, R_SPARC_OLO10}, - {BFD_RELOC_SPARC_HH22, R_SPARC_HH22}, - {BFD_RELOC_SPARC_HM10, R_SPARC_HM10}, - {BFD_RELOC_SPARC_LM22, R_SPARC_LM22}, - {BFD_RELOC_SPARC_PC_HH22, R_SPARC_PC_HH22}, - {BFD_RELOC_SPARC_PC_HM10, R_SPARC_PC_HM10}, - {BFD_RELOC_SPARC_PC_LM22, R_SPARC_PC_LM22}, - {BFD_RELOC_SPARC_WDISP16, R_SPARC_WDISP16}, - {BFD_RELOC_SPARC_WDISP19, R_SPARC_WDISP19}, - {BFD_RELOC_SPARC_7, R_SPARC_7}, - {BFD_RELOC_SPARC_5, R_SPARC_5}, - {BFD_RELOC_SPARC_6, R_SPARC_6}, - {BFD_RELOC_SPARC_REV32, R_SPARC_REV32 }, - {BFD_RELOC_VTABLE_INHERIT, R_SPARC_GNU_VTINHERIT}, - {BFD_RELOC_VTABLE_ENTRY, R_SPARC_GNU_VTENTRY}, + { BFD_RELOC_SPARC_UA16, R_SPARC_UA16 }, + { BFD_RELOC_SPARC_UA32, R_SPARC_UA32 }, + { BFD_RELOC_SPARC_UA64, R_SPARC_UA64 }, + { BFD_RELOC_SPARC_10, R_SPARC_10 }, + { BFD_RELOC_SPARC_11, R_SPARC_11 }, + { BFD_RELOC_SPARC_64, R_SPARC_64 }, + { BFD_RELOC_SPARC_OLO10, R_SPARC_OLO10 }, + { BFD_RELOC_SPARC_HH22, R_SPARC_HH22 }, + { BFD_RELOC_SPARC_HM10, R_SPARC_HM10 }, + { BFD_RELOC_SPARC_LM22, R_SPARC_LM22 }, + { BFD_RELOC_SPARC_PC_HH22, R_SPARC_PC_HH22 }, + { BFD_RELOC_SPARC_PC_HM10, R_SPARC_PC_HM10 }, + { BFD_RELOC_SPARC_PC_LM22, R_SPARC_PC_LM22 }, + { BFD_RELOC_SPARC_WDISP16, R_SPARC_WDISP16 }, + { BFD_RELOC_SPARC_WDISP19, R_SPARC_WDISP19 }, + { BFD_RELOC_SPARC_7, R_SPARC_7 }, + { BFD_RELOC_SPARC_5, R_SPARC_5 }, + { BFD_RELOC_SPARC_6, R_SPARC_6 }, + { BFD_RELOC_SPARC_REV32, R_SPARC_REV32 }, + { BFD_RELOC_VTABLE_INHERIT, R_SPARC_GNU_VTINHERIT }, + { BFD_RELOC_VTABLE_ENTRY, R_SPARC_GNU_VTENTRY }, }; static reloc_howto_type * @@ -551,7 +552,9 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) case R_SPARC_22: case R_SPARC_13: case R_SPARC_LO10: + case R_SPARC_UA16: case R_SPARC_UA32: + case R_SPARC_UA64: if (h != NULL) h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; @@ -1218,7 +1221,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_SPARC_22 || r_type == R_SPARC_13 || r_type == R_SPARC_LO10 + || r_type == R_SPARC_UA16 || r_type == R_SPARC_UA32 + || r_type == R_SPARC_UA64 || ((r_type == R_SPARC_PC10 || r_type == R_SPARC_PC22) && strcmp (h->root.root.string, @@ -1405,7 +1410,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_22: case R_SPARC_13: case R_SPARC_LO10: + case R_SPARC_UA16: case R_SPARC_UA32: + case R_SPARC_UA64: if (info->shared) { Elf_Internal_Rela outrel; @@ -1759,6 +1766,13 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + == 0) + sym->st_value = 0; } } diff --git a/contrib/binutils/bfd/elf32-v850.c b/contrib/binutils/bfd/elf32-v850.c index e71866c..3df0914 100644 --- a/contrib/binutils/bfd/elf32-v850.c +++ b/contrib/binutils/bfd/elf32-v850.c @@ -1,5 +1,6 @@ /* V850-specific support for 32-bit ELF - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1325,7 +1326,6 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) relocation -= reloc->address; } #endif - reloc->addend = relocation; return bfd_reloc_ok; } diff --git a/contrib/binutils/bfd/elf32.c b/contrib/binutils/bfd/elf32.c index 2d3bebf..bfadd5c 100644 --- a/contrib/binutils/bfd/elf32.c +++ b/contrib/binutils/bfd/elf32.c @@ -1,5 +1,5 @@ /* ELF 32-bit executable support for BFD. - Copyright 1993 Free Software Foundation, Inc. + Copyright 1993, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/elf64-alpha.c b/contrib/binutils/bfd/elf64-alpha.c index 197dcff..bd89a7b 100644 --- a/contrib/binutils/bfd/elf64-alpha.c +++ b/contrib/binutils/bfd/elf64-alpha.c @@ -1,5 +1,6 @@ /* Alpha specific support for 64-bit ELF - Copyright 1996, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -240,13 +241,24 @@ alpha_elf_dynamic_symbol_p (h, info) if (h->dynindx == -1) return false; - if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) - return false; if (h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_defweak) return true; + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_DEFAULT: + break; + case STV_HIDDEN: + case STV_INTERNAL: + return false; + case STV_PROTECTED: + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + return false; + break; + } + if ((info->shared && !info->symbolic) || ((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) @@ -554,7 +566,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + true), /* pcrel_offset */ /* 32 bit PC relative offset. */ HOWTO (R_ALPHA_SREL32, /* type */ @@ -569,7 +581,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = false, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + true), /* pcrel_offset */ /* A 64 bit PC relative offset. */ HOWTO (R_ALPHA_SREL64, /* type */ @@ -584,7 +596,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = false, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + true), /* pcrel_offset */ /* Push a value on the reloc evaluation stack. */ /* Not implemented -- it's dumb. */ @@ -855,13 +867,13 @@ static reloc_howto_type elf64_alpha_howto_table[] = static bfd_reloc_status_type elf64_alpha_reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc; - asymbol *sym; - PTR data; + asymbol *sym ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; asection *sec; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { if (output_bfd) reloc->address += sec->output_offset; @@ -872,13 +884,13 @@ elf64_alpha_reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message) static bfd_reloc_status_type elf64_alpha_reloc_bad (abfd, reloc, sym, data, sec, output_bfd, error_message) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc; - asymbol *sym; - PTR data; + asymbol *sym ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; asection *sec; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { if (output_bfd) reloc->address += sec->output_offset; @@ -935,7 +947,7 @@ elf64_alpha_reloc_gpdisp (abfd, reloc_entry, sym, data, input_section, output_bfd, err_msg) bfd *abfd; arelent *reloc_entry; - asymbol *sym; + asymbol *sym ATTRIBUTE_UNUSED; PTR data; asection *input_section; bfd *output_bfd; @@ -1016,7 +1028,7 @@ static const struct elf_reloc_map elf64_alpha_reloc_map[] = static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { const struct elf_reloc_map *i, *e; @@ -1034,7 +1046,7 @@ elf64_alpha_bfd_reloc_type_lookup (abfd, code) static void elf64_alpha_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf64_Internal_Rela *dst; { @@ -1836,8 +1848,8 @@ elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd *abfd; struct bfd_link_info *info; const Elf_Internal_Sym *sym; - const char **namep; - flagword *flagsp; + const char **namep ATTRIBUTE_UNUSED; + flagword *flagsp ATTRIBUTE_UNUSED; asection **secp; bfd_vma *valp; { @@ -1872,7 +1884,7 @@ elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) static boolean elf64_alpha_create_got_section(abfd, info) bfd *abfd; - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; { asection *s; @@ -2075,7 +2087,7 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) static boolean elf64_alpha_is_local_label_name (abfd, name) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; const char *name; { return name[0] == '$'; @@ -2727,7 +2739,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h) static boolean elf64_alpha_merge_ind_symbols (hi, dummy) struct alpha_elf_link_hash_entry *hi; - PTR dummy; + PTR dummy ATTRIBUTE_UNUSED; { struct alpha_elf_link_hash_entry *hs; @@ -2819,7 +2831,7 @@ elf64_alpha_can_merge_gots (a, b) Elf_Internal_Shdr *symtab_hdr = &elf_tdata (bsub)->symtab_hdr; int i, n; - n = symtab_hdr->sh_size / symtab_hdr->sh_entsize - symtab_hdr->sh_info; + n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info; for (i = 0; i < n; ++i) { struct alpha_elf_got_entry *ae, *be; @@ -2891,7 +2903,7 @@ elf64_alpha_merge_gots (a, b) hashes = alpha_elf_sym_hashes (bsub); symtab_hdr = &elf_tdata (bsub)->symtab_hdr; - n = symtab_hdr->sh_size / symtab_hdr->sh_entsize - symtab_hdr->sh_info; + n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info; for (i = 0; i < n; ++i) { struct alpha_elf_got_entry *ae, *be, **pbe, **start; @@ -4715,8 +4727,8 @@ const struct elf_size_info alpha_elf_size_info = #define TARGET_LITTLE_SYM bfd_elf64_alpha_vec #define TARGET_LITTLE_NAME "elf64-alpha" #define ELF_ARCH bfd_arch_alpha -#define ELF_MACHINE_CODE EM_ALPHA -#define ELF_MAXPAGESIZE 0x10000 +#define ELF_MACHINE_CODE EM_ALPHA +#define ELF_MAXPAGESIZE 0x10000 #define bfd_elf64_bfd_link_hash_table_create \ elf64_alpha_bfd_link_hash_table_create diff --git a/contrib/binutils/bfd/elf64-gen.c b/contrib/binutils/bfd/elf64-gen.c index c071934..db68a07 100644 --- a/contrib/binutils/bfd/elf64-gen.c +++ b/contrib/binutils/bfd/elf64-gen.c @@ -1,5 +1,5 @@ /* Generic support for 64-bit ELF - Copyright 1993, 1995, 1998 Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -42,23 +42,23 @@ static reloc_howto_type dummy = static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf64_Internal_Rela *elf_reloc; + Elf64_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } static void elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf64_Internal_Rel *elf_reloc; + Elf64_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } -static boolean +static boolean elf64_generic_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; diff --git a/contrib/binutils/bfd/elf64-sparc.c b/contrib/binutils/bfd/elf64-sparc.c index 0627913..bd32b6e 100644 --- a/contrib/binutils/bfd/elf64-sparc.c +++ b/contrib/binutils/bfd/elf64-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for 64-bit ELF - Copyright (C) 1993, 95, 96, 97, 98, 99, 2000 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -63,6 +63,8 @@ static boolean sparc64_elf_add_symbol_hook static void sparc64_elf_symbol_processing PARAMS ((bfd *, asymbol *)); +static boolean sparc64_elf_copy_private_bfd_data + PARAMS ((bfd *, bfd *)); static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); @@ -118,7 +120,7 @@ static reloc_howto_type sparc64_elf_howto_table[] = HOWTO(R_SPARC_GLOB_DAT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GLOB_DAT",false,0,0x00000000,true), HOWTO(R_SPARC_JMP_SLOT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",false,0,0x00000000,true), HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true), - HOWTO(R_SPARC_UA32, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0x00000000,true), + HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true), #ifndef SPARC64_OLD_RELOCS /* These aren't implemented yet. */ HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PLT32", false,0,0x00000000,true), @@ -186,31 +188,32 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_SPARC_JMP_SLOT, R_SPARC_JMP_SLOT }, { BFD_RELOC_SPARC_RELATIVE, R_SPARC_RELATIVE }, { BFD_RELOC_SPARC_WDISP22, R_SPARC_WDISP22 }, - /* ??? Doesn't dwarf use this? */ -/*{ BFD_RELOC_SPARC_UA32, R_SPARC_UA32 }, not used?? */ - {BFD_RELOC_SPARC_10, R_SPARC_10}, - {BFD_RELOC_SPARC_11, R_SPARC_11}, - {BFD_RELOC_SPARC_64, R_SPARC_64}, - {BFD_RELOC_SPARC_OLO10, R_SPARC_OLO10}, - {BFD_RELOC_SPARC_HH22, R_SPARC_HH22}, - {BFD_RELOC_SPARC_HM10, R_SPARC_HM10}, - {BFD_RELOC_SPARC_LM22, R_SPARC_LM22}, - {BFD_RELOC_SPARC_PC_HH22, R_SPARC_PC_HH22}, - {BFD_RELOC_SPARC_PC_HM10, R_SPARC_PC_HM10}, - {BFD_RELOC_SPARC_PC_LM22, R_SPARC_PC_LM22}, - {BFD_RELOC_SPARC_WDISP16, R_SPARC_WDISP16}, - {BFD_RELOC_SPARC_WDISP19, R_SPARC_WDISP19}, - {BFD_RELOC_SPARC_7, R_SPARC_7}, - {BFD_RELOC_SPARC_5, R_SPARC_5}, - {BFD_RELOC_SPARC_6, R_SPARC_6}, - {BFD_RELOC_SPARC_DISP64, R_SPARC_DISP64}, - {BFD_RELOC_SPARC_PLT64, R_SPARC_PLT64}, - {BFD_RELOC_SPARC_HIX22, R_SPARC_HIX22}, - {BFD_RELOC_SPARC_LOX10, R_SPARC_LOX10}, - {BFD_RELOC_SPARC_H44, R_SPARC_H44}, - {BFD_RELOC_SPARC_M44, R_SPARC_M44}, - {BFD_RELOC_SPARC_L44, R_SPARC_L44}, - {BFD_RELOC_SPARC_REGISTER, R_SPARC_REGISTER} + { BFD_RELOC_SPARC_UA16, R_SPARC_UA16 }, + { BFD_RELOC_SPARC_UA32, R_SPARC_UA32 }, + { BFD_RELOC_SPARC_UA64, R_SPARC_UA64 }, + { BFD_RELOC_SPARC_10, R_SPARC_10 }, + { BFD_RELOC_SPARC_11, R_SPARC_11 }, + { BFD_RELOC_SPARC_64, R_SPARC_64 }, + { BFD_RELOC_SPARC_OLO10, R_SPARC_OLO10 }, + { BFD_RELOC_SPARC_HH22, R_SPARC_HH22 }, + { BFD_RELOC_SPARC_HM10, R_SPARC_HM10 }, + { BFD_RELOC_SPARC_LM22, R_SPARC_LM22 }, + { BFD_RELOC_SPARC_PC_HH22, R_SPARC_PC_HH22 }, + { BFD_RELOC_SPARC_PC_HM10, R_SPARC_PC_HM10 }, + { BFD_RELOC_SPARC_PC_LM22, R_SPARC_PC_LM22 }, + { BFD_RELOC_SPARC_WDISP16, R_SPARC_WDISP16 }, + { BFD_RELOC_SPARC_WDISP19, R_SPARC_WDISP19 }, + { BFD_RELOC_SPARC_7, R_SPARC_7 }, + { BFD_RELOC_SPARC_5, R_SPARC_5 }, + { BFD_RELOC_SPARC_6, R_SPARC_6 }, + { BFD_RELOC_SPARC_DISP64, R_SPARC_DISP64 }, + { BFD_RELOC_SPARC_PLT64, R_SPARC_PLT64 }, + { BFD_RELOC_SPARC_HIX22, R_SPARC_HIX22 }, + { BFD_RELOC_SPARC_LOX10, R_SPARC_LOX10 }, + { BFD_RELOC_SPARC_H44, R_SPARC_H44 }, + { BFD_RELOC_SPARC_M44, R_SPARC_M44 }, + { BFD_RELOC_SPARC_L44, R_SPARC_L44 }, + { BFD_RELOC_SPARC_REGISTER, R_SPARC_REGISTER } }; static reloc_howto_type * @@ -394,7 +397,7 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) return true; rel_hdr = &d->this_hdr; - asect->reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize; + asect->reloc_count = NUM_SHDR_ENTRIES (rel_hdr); rel_hdr2 = NULL; } @@ -994,7 +997,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) srelgot = NULL; sreloc = NULL; - rel_end = relocs + sec->reloc_count; + rel_end = relocs + NUM_SHDR_ENTRIES (& elf_section_data (sec)->rel_hdr); for (rel = relocs; rel < rel_end; rel++) { unsigned long r_symndx; @@ -1900,7 +1903,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, sgot = splt = sreloc = NULL; rel = relocs; - relend = relocs + input_section->reloc_count; + relend = relocs + NUM_SHDR_ENTRIES (& elf_section_data (input_section)->rel_hdr); for (; rel < relend; rel++) { int r_type; @@ -2705,6 +2708,13 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + == 0) + sym->st_value = 0; } } @@ -2893,6 +2903,24 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) /* Functions for dealing with the e_flags field. */ +/* Copy backend specific data from one object module to another */ +static boolean +sparc64_elf_copy_private_bfd_data (ibfd, obfd) + bfd *ibfd, *obfd; +{ + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + BFD_ASSERT (!elf_flags_init (obfd) + || (elf_elfheader (obfd)->e_flags + == elf_elfheader (ibfd)->e_flags)); + + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + elf_flags_init (obfd) = true; + return true; +} + /* Merge backend specific data from an object file to the output object file when linking. */ @@ -3114,7 +3142,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_print_symbol_all #define elf_backend_output_arch_syms \ sparc64_elf_output_arch_syms - +#define bfd_elf64_bfd_copy_private_bfd_data \ + sparc64_elf_copy_private_bfd_data #define bfd_elf64_bfd_merge_private_bfd_data \ sparc64_elf_merge_private_bfd_data diff --git a/contrib/binutils/bfd/elfarm-nabi.c b/contrib/binutils/bfd/elfarm-nabi.c index 55e1f03..ee91e36 100644 --- a/contrib/binutils/bfd/elfarm-nabi.c +++ b/contrib/binutils/bfd/elfarm-nabi.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM new abi option. - Copyright 1999 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/elfarm-oabi.c b/contrib/binutils/bfd/elfarm-oabi.c index e49ea9c..b4f93f0 100644 --- a/contrib/binutils/bfd/elfarm-oabi.c +++ b/contrib/binutils/bfd/elfarm-oabi.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM old abi option. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/elfcode.h b/contrib/binutils/bfd/elfcode.h index 1a5f63a..b02a399 100644 --- a/contrib/binutils/bfd/elfcode.h +++ b/contrib/binutils/bfd/elfcode.h @@ -1,6 +1,6 @@ /* ELF executable support for BFD. - Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999, 2000 Free - Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -1372,11 +1372,9 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) return true; rel_hdr = &d->rel_hdr; - reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize; + reloc_count = NUM_SHDR_ENTRIES (rel_hdr); rel_hdr2 = d->rel_hdr2; - reloc_count2 = (rel_hdr2 - ? (rel_hdr2->sh_size / rel_hdr2->sh_entsize) - : 0); + reloc_count2 = (rel_hdr2 ? NUM_SHDR_ENTRIES (rel_hdr2) : 0); BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2); BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset @@ -1393,7 +1391,7 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) return true; rel_hdr = &d->this_hdr; - reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize; + reloc_count = NUM_SHDR_ENTRIES (rel_hdr); rel_hdr2 = NULL; reloc_count2 = 0; } diff --git a/contrib/binutils/bfd/elfcore.h b/contrib/binutils/bfd/elfcore.h index 2c99e8b..ef71762 100644 --- a/contrib/binutils/bfd/elfcore.h +++ b/contrib/binutils/bfd/elfcore.h @@ -1,5 +1,6 @@ /* ELF core file support for BFD. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c index bfaf44b..b971311 100644 --- a/contrib/binutils/bfd/elflink.c +++ b/contrib/binutils/bfd/elflink.c @@ -1,5 +1,6 @@ /* ELF linking support for BFD. - Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -107,7 +108,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) flagword flags, pltflags; register asection *s; struct elf_backend_data *bed = get_elf_backend_data (abfd); - int ptralign = 0; + int ptralign; switch (bed->s->arch_size) { @@ -332,7 +333,7 @@ elf_link_renumber_hash_table_dynsyms (h, data) return true; } -/* Assign dynsym indicies. In a shared library we generate a section +/* Assign dynsym indices. In a shared library we generate a section symbol for each output section, which come first. Next come all of the back-end allocated local dynamic syms, followed by the rest of the global symbols. */ diff --git a/contrib/binutils/bfd/elflink.h b/contrib/binutils/bfd/elflink.h index d3b44e8..26808ab 100644 --- a/contrib/binutils/bfd/elflink.h +++ b/contrib/binutils/bfd/elflink.h @@ -1,5 +1,6 @@ /* ELF linker support. - Copyright 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -80,9 +81,9 @@ elf_bfd_link_add_symbols (abfd, info) } } -/* Return true iff this is a non-common definition of a symbol. */ +/* Return true iff this is a non-common, definition of a non-function symbol. */ static boolean -is_global_symbol_definition (abfd, sym) +is_global_data_symbol_definition (abfd, sym) bfd * abfd ATTRIBUTE_UNUSED; Elf_Internal_Sym * sym; { @@ -91,6 +92,10 @@ is_global_symbol_definition (abfd, sym) && ELF_ST_BIND (sym->st_info) < STB_LOOS) return false; + /* Function symbols do not count. */ + if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) + return false; + /* If the section is undefined, then so is the symbol. */ if (sym->st_shndx == SHN_UNDEF) return false; @@ -116,7 +121,7 @@ is_global_symbol_definition (abfd, sym) } /* Search the symbol table of the archive element of the archive ABFD - whoes archove map contains a mention of SYMDEF, and determine if + whose archive map contains a mention of SYMDEF, and determine if the symbol is defined in this element. */ static boolean elf_link_is_defined_archive_symbol (abfd, symdef) @@ -201,7 +206,7 @@ elf_link_is_defined_archive_symbol (abfd, symdef) if (strcmp (name, symdef->name) == 0) { - result = is_global_symbol_definition (abfd, & sym); + result = is_global_data_symbol_definition (abfd, & sym); break; } } @@ -890,7 +895,6 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Sym *buf = NULL; struct elf_link_hash_entry **sym_hash; boolean dynamic; - bfd_byte *dynver = NULL; Elf_External_Versym *extversym = NULL; Elf_External_Versym *ever; Elf_External_Dyn *dynbuf = NULL; @@ -1018,7 +1022,7 @@ elf_link_add_object_symbols (abfd, info) Elf_Internal_Shdr *versymhdr; versymhdr = &elf_tdata (abfd)->dynversym_hdr; - extversym = (Elf_External_Versym *) bfd_malloc (hdr->sh_size); + extversym = (Elf_External_Versym *) bfd_malloc (versymhdr->sh_size); if (extversym == NULL) goto error_return; if (bfd_seek (abfd, versymhdr->sh_offset, SEEK_SET) != 0 @@ -2169,8 +2173,6 @@ elf_link_add_object_symbols (abfd, info) free (buf); if (dynbuf != NULL) free (dynbuf); - if (dynver != NULL) - free (dynver); if (extversym != NULL) free (extversym); return false; @@ -2451,13 +2453,13 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs, Elf_Internal_Rel *irel; erel = (Elf_External_Rel *) external_relocs; - erelend = erel + shdr->sh_size / shdr->sh_entsize; + erelend = erel + NUM_SHDR_ENTRIES (shdr); irela = internal_relocs; irel = bfd_alloc (abfd, (bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rel))); for (; erel < erelend; erel++, irela += bed->s->int_rels_per_ext_rel) { - unsigned char i; + unsigned int i; if (bed->s->swap_reloc_in) (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, irel); @@ -2481,7 +2483,7 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs, BFD_ASSERT (shdr->sh_entsize == sizeof (Elf_External_Rela)); erela = (Elf_External_Rela *) external_relocs; - erelaend = erela + shdr->sh_size / shdr->sh_entsize; + erelaend = erela + NUM_SHDR_ENTRIES (shdr); irela = internal_relocs; for (; erela < erelaend; erela++, irela += bed->s->int_rels_per_ext_rel) { @@ -2561,7 +2563,7 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, (abfd, elf_section_data (o)->rel_hdr2, ((bfd_byte *) external_relocs) + rel_hdr->sh_size, - internal_relocs + (rel_hdr->sh_size / rel_hdr->sh_entsize + internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr) * bed->s->int_rels_per_ext_rel))) goto error_return; @@ -2952,14 +2954,13 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } } + eif.info = info; + eif.failed = false; + /* If we are supposed to export all symbols into the dynamic symbol table (this is not the normal case), then do so. */ if (export_dynamic) { - struct elf_info_failed eif; - - eif.failed = false; - eif.info = info; elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol, (PTR) &eif); if (eif.failed) @@ -2981,8 +2982,6 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, /* Find all symbols which were defined in a dynamic object and make the backend pick a reasonable value for them. */ - eif.failed = false; - eif.info = info; elf_link_hash_traverse (elf_hash_table (info), elf_adjust_dynamic_symbol, (PTR) &eif); @@ -3513,16 +3512,24 @@ elf_fix_symbol_flags (h, eif) /* If -Bsymbolic was used (which means to bind references to global symbols to the definition within the shared object), and this symbol was defined in a regular object, then it actually doesn't - need a PLT entry. Likewise, if the symbol has any kind of - visibility (internal, hidden, or protected), it doesn't need a - PLT. */ + need a PLT entry, and we can accomplish that by forcing it local. + Likewise, if the symbol has hidden or internal visibility. + FIXME: It might be that we also do not need a PLT for other + non-hidden visibilities, but we would have to tell that to the + backend specifically; we can't just clear PLT-related data here. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 && eif->info->shared - && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other)) + && (eif->info->symbolic + || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) { - h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT; - h->plt.offset = (bfd_vma) -1; + struct elf_backend_data *bed; + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + (*bed->elf_backend_hide_symbol) (eif->info, h); } /* If this is a weak defined symbol in a dynamic object, and we know @@ -4086,7 +4093,6 @@ elf_link_size_reloc_section (abfd, rel_hdr, o) Elf_Internal_Shdr *rel_hdr; asection *o; { - register struct elf_link_hash_entry **p, **pend; unsigned reloc_count; /* Figure out how many relocations there will be. */ @@ -4110,16 +4116,15 @@ elf_link_size_reloc_section (abfd, rel_hdr, o) first time we are called. */ if (elf_section_data (o)->rel_hashes == NULL) { + struct elf_link_hash_entry **p; + p = ((struct elf_link_hash_entry **) - bfd_malloc (o->reloc_count - * sizeof (struct elf_link_hash_entry *))); + bfd_zmalloc (o->reloc_count + * sizeof (struct elf_link_hash_entry *))); if (p == NULL && o->reloc_count != 0) return false; elf_section_data (o)->rel_hashes = p; - pend = p + o->reloc_count; - for (; p < pend; p++) - *p = NULL; } return true; @@ -4139,6 +4144,24 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) { unsigned int i; struct elf_backend_data *bed = get_elf_backend_data (abfd); + Elf_Internal_Rel *irel; + Elf_Internal_Rela *irela; + + irel = (Elf_Internal_Rel *) bfd_zmalloc (sizeof (Elf_Internal_Rel) + * bed->s->int_rels_per_ext_rel); + if (irel == NULL) + { + (*_bfd_error_handler) (_("Error: out of memory")); + abort (); + } + + irela = (Elf_Internal_Rela *) bfd_zmalloc (sizeof (Elf_Internal_Rela) + * bed->s->int_rels_per_ext_rel); + if (irela == NULL) + { + (*_bfd_error_handler) (_("Error: out of memory")); + abort (); + } for (i = 0; i < count; i++, rel_hash++) { @@ -4150,41 +4173,50 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel)) { Elf_External_Rel *erel; - Elf_Internal_Rel irel; + unsigned int j; erel = (Elf_External_Rel *) rel_hdr->contents + i; if (bed->s->swap_reloc_in) - (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, &irel); + (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, irel); else - elf_swap_reloc_in (abfd, erel, &irel); - irel.r_info = ELF_R_INFO ((*rel_hash)->indx, - ELF_R_TYPE (irel.r_info)); + elf_swap_reloc_in (abfd, erel, irel); + + for (j = 0; j < bed->s->int_rels_per_ext_rel; j++) + irel[j].r_info = ELF_R_INFO ((*rel_hash)->indx, + ELF_R_TYPE (irel[j].r_info)); + if (bed->s->swap_reloc_out) - (*bed->s->swap_reloc_out) (abfd, &irel, (bfd_byte *) erel); + (*bed->s->swap_reloc_out) (abfd, irel, (bfd_byte *) erel); else - elf_swap_reloc_out (abfd, &irel, erel); + elf_swap_reloc_out (abfd, irel, erel); } else { Elf_External_Rela *erela; - Elf_Internal_Rela irela; + unsigned int j; BFD_ASSERT (rel_hdr->sh_entsize == sizeof (Elf_External_Rela)); erela = (Elf_External_Rela *) rel_hdr->contents + i; if (bed->s->swap_reloca_in) - (*bed->s->swap_reloca_in) (abfd, (bfd_byte *) erela, &irela); + (*bed->s->swap_reloca_in) (abfd, (bfd_byte *) erela, irela); else - elf_swap_reloca_in (abfd, erela, &irela); - irela.r_info = ELF_R_INFO ((*rel_hash)->indx, - ELF_R_TYPE (irela.r_info)); + elf_swap_reloca_in (abfd, erela, irela); + + for (j = 0; j < bed->s->int_rels_per_ext_rel; j++) + irela[j].r_info = ELF_R_INFO ((*rel_hash)->indx, + ELF_R_TYPE (irela[j].r_info)); + if (bed->s->swap_reloca_out) - (*bed->s->swap_reloca_out) (abfd, &irela, (bfd_byte *) erela); + (*bed->s->swap_reloca_out) (abfd, irela, (bfd_byte *) erela); else - elf_swap_reloca_out (abfd, &irela, erela); + elf_swap_reloca_out (abfd, irela, erela); } } + + free (irel); + free (irela); } /* Do the final step of an ELF link. */ @@ -4382,11 +4414,9 @@ elf_bfd_final_link (abfd, info) rel_count2 = &esdo->rel_count; } - *rel_count += (esdi->rel_hdr.sh_size - / esdi->rel_hdr.sh_entsize); + *rel_count += NUM_SHDR_ENTRIES (& esdi->rel_hdr); if (esdi->rel_hdr2) - *rel_count2 += (esdi->rel_hdr2->sh_size - / esdi->rel_hdr2->sh_entsize); + *rel_count2 += NUM_SHDR_ENTRIES (esdi->rel_hdr2); } } @@ -4431,7 +4461,7 @@ elf_bfd_final_link (abfd, info) /* sh_link is set in assign_section_numbers. */ /* sh_info is set below. */ /* sh_offset is set just below. */ - symtab_hdr->sh_addralign = 4; /* FIXME: system dependent? */ + symtab_hdr->sh_addralign = bed->s->file_align; off = elf_tdata (abfd)->next_file_pos; off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, true); @@ -5384,33 +5414,50 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, bed = get_elf_backend_data (output_bfd); irela = internal_relocs; - irelaend = irela + input_rel_hdr->sh_size / input_rel_hdr->sh_entsize; + irelaend = irela + NUM_SHDR_ENTRIES (input_rel_hdr) + * bed->s->int_rels_per_ext_rel; + if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel)) { Elf_External_Rel *erel; + Elf_Internal_Rel *irel; + + irel = (Elf_Internal_Rel *) bfd_zmalloc (bed->s->int_rels_per_ext_rel + * sizeof (Elf_Internal_Rel)); + if (irel == NULL) + { + (*_bfd_error_handler) (_("Error: out of memory")); + abort (); + } erel = ((Elf_External_Rel *) output_rel_hdr->contents + *rel_countp); - for (; irela < irelaend; irela++, erel++) + for (; irela < irelaend; irela += bed->s->int_rels_per_ext_rel, erel++) { - Elf_Internal_Rel irel; + unsigned int i; + + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) + { + irel[i].r_offset = irela[i].r_offset; + irel[i].r_info = irela[i].r_info; + BFD_ASSERT (irela[i].r_addend == 0); + } - irel.r_offset = irela->r_offset; - irel.r_info = irela->r_info; - BFD_ASSERT (irela->r_addend == 0); if (bed->s->swap_reloc_out) - (*bed->s->swap_reloc_out) (output_bfd, &irel, (PTR) erel); + (*bed->s->swap_reloc_out) (output_bfd, irel, (PTR) erel); else - elf_swap_reloc_out (output_bfd, &irel, erel); + elf_swap_reloc_out (output_bfd, irel, erel); } + + free (irel); } else { Elf_External_Rela *erela; - BFD_ASSERT (input_rel_hdr->sh_entsize - == sizeof (Elf_External_Rela)); + BFD_ASSERT (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rela)); + erela = ((Elf_External_Rela *) output_rel_hdr->contents + *rel_countp); - for (; irela < irelaend; irela++, erela++) + for (; irela < irelaend; irela += bed->s->int_rels_per_ext_rel, erela++) if (bed->s->swap_reloca_out) (*bed->s->swap_reloca_out) (output_bfd, irela, (PTR) erela); else @@ -5419,7 +5466,7 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, /* Bump the counter, so that we know where to add the next set of relocations. */ - *rel_countp += input_rel_hdr->sh_size / input_rel_hdr->sh_entsize; + *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr); } /* Link an input file into the linker output file. This function @@ -5511,14 +5558,24 @@ elf_link_input_bfd (finfo, input_bfd) } } + name = NULL; if (isym->st_shndx == SHN_UNDEF) - isec = bfd_und_section_ptr; + { + isec = bfd_und_section_ptr; + name = isec->name; + } else if (isym->st_shndx > 0 && isym->st_shndx < SHN_LORESERVE) isec = section_from_elf_index (input_bfd, isym->st_shndx); else if (isym->st_shndx == SHN_ABS) - isec = bfd_abs_section_ptr; + { + isec = bfd_abs_section_ptr; + name = isec->name; + } else if (isym->st_shndx == SHN_COMMON) - isec = bfd_com_section_ptr; + { + isec = bfd_com_section_ptr; + name = isec->name; + } else { /* Who knows? */ @@ -5537,7 +5594,18 @@ elf_link_input_bfd (finfo, input_bfd) /* Save away all section symbol values. */ if (isec != NULL) - isec->symbol->value = isym->st_value; + { + if (name) + { + if (isec->symbol->value != isym->st_value) + (*_bfd_error_handler) + (_("%s: invalid section symbol index 0x%x (%s) ingored"), + bfd_get_filename (input_bfd), isym->st_shndx, + name); + continue; + } + isec->symbol->value = isym->st_value; + } /* If this is a discarded link-once section symbol, update it's value to that of the kept section symbol. The @@ -5711,21 +5779,28 @@ elf_link_input_bfd (finfo, input_bfd) Elf_Internal_Rela *irelaend; struct elf_link_hash_entry **rel_hash; Elf_Internal_Shdr *input_rel_hdr; + unsigned int next_erel; /* Adjust the reloc addresses and symbol indices. */ irela = internal_relocs; - irelaend = - irela + o->reloc_count * bed->s->int_rels_per_ext_rel; + irelaend = irela + + o->reloc_count * bed->s->int_rels_per_ext_rel; rel_hash = (elf_section_data (o->output_section)->rel_hashes + elf_section_data (o->output_section)->rel_count + elf_section_data (o->output_section)->rel_count2); - for (; irela < irelaend; irela++, rel_hash++) + for (next_erel = 0; irela < irelaend; irela++, next_erel++) { unsigned long r_symndx; Elf_Internal_Sym *isym; asection *sec; + if (next_erel == bed->s->int_rels_per_ext_rel) + { + rel_hash++; + next_erel = 0; + } + irela->r_offset += o->output_offset; /* Relocs in an executable have to be virtual addresses. */ @@ -5742,7 +5817,7 @@ elf_link_input_bfd (finfo, input_bfd) && finfo->sections[r_symndx] == NULL)) { struct elf_link_hash_entry *rh; - long indx; + unsigned long indx; /* This is a reloc against a global symbol. We have not yet output all the local symbols, so @@ -5850,8 +5925,8 @@ elf_link_input_bfd (finfo, input_bfd) elf_link_output_relocs (output_bfd, o, input_rel_hdr, internal_relocs); - internal_relocs - += input_rel_hdr->sh_size / input_rel_hdr->sh_entsize; + internal_relocs += NUM_SHDR_ENTRIES (input_rel_hdr) + * bed->s->int_rels_per_ext_rel; input_rel_hdr = elf_section_data (o)->rel_hdr2; if (input_rel_hdr) elf_link_output_relocs (output_bfd, o, @@ -6018,32 +6093,52 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) if (rel_hdr->sh_type == SHT_REL) { - Elf_Internal_Rel irel; + Elf_Internal_Rel *irel; Elf_External_Rel *erel; + unsigned int i; + + irel = (Elf_Internal_Rel *) bfd_zmalloc (bed->s->int_rels_per_ext_rel + * sizeof (Elf_Internal_Rel)); + if (irel == NULL) + return false; + + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) + irel[i].r_offset = offset; + irel[0].r_info = ELF_R_INFO (indx, howto->type); - irel.r_offset = offset; - irel.r_info = ELF_R_INFO (indx, howto->type); erel = ((Elf_External_Rel *) rel_hdr->contents + elf_section_data (output_section)->rel_count); + if (bed->s->swap_reloc_out) - (*bed->s->swap_reloc_out) (output_bfd, &irel, (bfd_byte *) erel); + (*bed->s->swap_reloc_out) (output_bfd, irel, (bfd_byte *) erel); else - elf_swap_reloc_out (output_bfd, &irel, erel); + elf_swap_reloc_out (output_bfd, irel, erel); + + free (irel); } else { - Elf_Internal_Rela irela; + Elf_Internal_Rela *irela; Elf_External_Rela *erela; + unsigned int i; + + irela = (Elf_Internal_Rela *) bfd_zmalloc (bed->s->int_rels_per_ext_rel + * sizeof (Elf_Internal_Rela)); + if (irela == NULL) + return false; + + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) + irela[i].r_offset = offset; + irela[0].r_info = ELF_R_INFO (indx, howto->type); + irela[0].r_addend = addend; - irela.r_offset = offset; - irela.r_info = ELF_R_INFO (indx, howto->type); - irela.r_addend = addend; erela = ((Elf_External_Rela *) rel_hdr->contents + elf_section_data (output_section)->rel_count); + if (bed->s->swap_reloca_out) - (*bed->s->swap_reloca_out) (output_bfd, &irela, (bfd_byte *) erela); + (*bed->s->swap_reloca_out) (output_bfd, irela, (bfd_byte *) erela); else - elf_swap_reloca_out (output_bfd, &irela, erela); + elf_swap_reloca_out (output_bfd, irela, erela); } ++elf_section_data (output_section)->rel_count; @@ -6180,7 +6275,7 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) #define bfd_put_ptr(BFD,VAL,ADDR) bfd_put_32 (BFD, VAL, ADDR) #endif -/* Fill in the address for a pointer generated in alinker section. */ +/* Fill in the address for a pointer generated in a linker section. */ bfd_vma elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, relocation, rel, relative_reloc) @@ -6247,7 +6342,17 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca if (info->shared) { asection *srel = lsect->rel_section; - Elf_Internal_Rela outrel; + Elf_Internal_Rela *outrel; + struct elf_backend_data *bed = get_elf_backend_data (output_bfd); + unsigned int i; + + outrel = (Elf_Internal_Rela *) bfd_zmalloc (sizeof (Elf_Internal_Rela) + * bed->s->int_rels_per_ext_rel); + if (outrel == NULL) + { + (*_bfd_error_handler) (_("Error: out of memory")); + return 0; + } /* We need to generate a relative reloc for the dynamic linker. */ if (!srel) @@ -6256,16 +6361,19 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca BFD_ASSERT (srel != NULL); - outrel.r_offset = (lsect->section->output_section->vma - + lsect->section->output_offset - + linker_section_ptr->offset); - outrel.r_info = ELF_R_INFO (0, relative_reloc); - outrel.r_addend = 0; - elf_swap_reloca_out (output_bfd, &outrel, + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) + outrel[i].r_offset = (lsect->section->output_section->vma + + lsect->section->output_offset + + linker_section_ptr->offset); + outrel[0].r_info = ELF_R_INFO (0, relative_reloc); + outrel[0].r_addend = 0; + elf_swap_reloca_out (output_bfd, outrel, (((Elf_External_Rela *) lsect->section->contents) + elf_section_data (lsect->section)->rel_count)); ++elf_section_data (lsect->section)->rel_count; + + free (outrel); } } } diff --git a/contrib/binutils/bfd/elfxx-target.h b/contrib/binutils/bfd/elfxx-target.h index e69036f..3ec9820 100644 --- a/contrib/binutils/bfd/elfxx-target.h +++ b/contrib/binutils/bfd/elfxx-target.h @@ -1,5 +1,6 @@ /* Target definitions for NN-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -110,8 +111,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections #endif +#ifndef bfd_elfNN_bfd_make_debug_symbol #define bfd_elfNN_bfd_make_debug_symbol \ ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) +#endif #ifndef bfd_elfNN_bfd_copy_private_symbol_data #define bfd_elfNN_bfd_copy_private_symbol_data \ diff --git a/contrib/binutils/bfd/format.c b/contrib/binutils/bfd/format.c index ad4a6a8..6afcb60 100644 --- a/contrib/binutils/bfd/format.c +++ b/contrib/binutils/bfd/format.c @@ -1,5 +1,6 @@ /* Generic BFD support for file formats. - Copyright (C) 1990, 91, 92, 93, 94, 95, 1999 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/freebsd.h b/contrib/binutils/bfd/freebsd.h index 0203d99..c2e3af0 100644 --- a/contrib/binutils/bfd/freebsd.h +++ b/contrib/binutils/bfd/freebsd.h @@ -1,5 +1,6 @@ /* BFD back-end definitions used by all FreeBSD targets. - Copyright (C) 1990, 1991, 1992, 1996, 2000 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/gen-aout.c b/contrib/binutils/bfd/gen-aout.c index b5ed91a..088fc09 100644 --- a/contrib/binutils/bfd/gen-aout.c +++ b/contrib/binutils/bfd/gen-aout.c @@ -1,5 +1,6 @@ /* Generate parameters for an a.out system. - Copyright (C) 1990, 91, 92, 93, 94, 98 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/genlink.h b/contrib/binutils/bfd/genlink.h index 0e0a8de..215666a 100644 --- a/contrib/binutils/bfd/genlink.h +++ b/contrib/binutils/bfd/genlink.h @@ -1,5 +1,5 @@ /* genlink.h -- interface to the BFD generic linker - Copyright 1993, 1994 Free Software Foundation, Inc. + Copyright 1993, 1994, 1996 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/hash.c b/contrib/binutils/bfd/hash.c index a1bca28..11d54fd 100644 --- a/contrib/binutils/bfd/hash.c +++ b/contrib/binutils/bfd/hash.c @@ -1,5 +1,6 @@ /* hash.c -- hash table routines for BFD - Copyright (C) 1993, 94, 95, 97, 1999 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1997, 1999, 2001 + Free Software Foundation, Inc. Written by Steve Chamberlain This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/host-aout.c b/contrib/binutils/bfd/host-aout.c index 99643dc..a53cf09 100644 --- a/contrib/binutils/bfd/host-aout.c +++ b/contrib/binutils/bfd/host-aout.c @@ -1,5 +1,5 @@ /* BFD backend for local host's a.out binaries - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1995 Free Software Foundation, Inc. Written by Cygnus Support. Probably John Gilmore's fault. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/i386aout.c b/contrib/binutils/bfd/i386aout.c index d0b2cff..1192dd4 100644 --- a/contrib/binutils/bfd/i386aout.c +++ b/contrib/binutils/bfd/i386aout.c @@ -1,5 +1,6 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 91, 92, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1996, 1997 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/i386bsd.c b/contrib/binutils/bfd/i386bsd.c index 2328fe3..98c48cd 100644 --- a/contrib/binutils/bfd/i386bsd.c +++ b/contrib/binutils/bfd/i386bsd.c @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries under BSD. - Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/i386freebsd.c b/contrib/binutils/bfd/i386freebsd.c index 7a6371b..f9684e4 100644 --- a/contrib/binutils/bfd/i386freebsd.c +++ b/contrib/binutils/bfd/i386freebsd.c @@ -1,5 +1,5 @@ /* BFD back-end for FreeBSD/386 a.out-ish binaries. - Copyright (C) 1990, 1991, 1992, 1996 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1996 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/i386linux.c b/contrib/binutils/bfd/i386linux.c index 5df2a11..5fee098 100644 --- a/contrib/binutils/bfd/i386linux.c +++ b/contrib/binutils/bfd/i386linux.c @@ -1,5 +1,5 @@ /* BFD back-end for linux flavored i386 a.out binaries. - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/i386netbsd.c b/contrib/binutils/bfd/i386netbsd.c index 327b6f9..0e01763 100644 --- a/contrib/binutils/bfd/i386netbsd.c +++ b/contrib/binutils/bfd/i386netbsd.c @@ -1,5 +1,6 @@ /* BFD back-end for NetBSD/386 a.out-ish binaries. - Copyright (C) 1990, 91, 92, 94, 95, 96, 1998 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/ieee.c b/contrib/binutils/bfd/ieee.c index 70f0d13..8414424 100644 --- a/contrib/binutils/bfd/ieee.c +++ b/contrib/binutils/bfd/ieee.c @@ -1,5 +1,6 @@ /* BFD back-end for ieee-695 objects. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -3581,6 +3582,10 @@ ieee_write_processor (abfd) case bfd_mach_m68040: id = "68040"; break; case bfd_mach_m68060: id = "68060"; break; case bfd_mach_cpu32: id = "cpu32"; break; + case bfd_mach_mcf5200:id = "5200"; break; + case bfd_mach_mcf5206e:id = "5206e"; break; + case bfd_mach_mcf5307:id = "5307"; break; + case bfd_mach_mcf5407:id = "5407"; break; } if (! ieee_write_id (abfd, id)) diff --git a/contrib/binutils/bfd/ihex.c b/contrib/binutils/bfd/ihex.c index d00c59b..738da81 100644 --- a/contrib/binutils/bfd/ihex.c +++ b/contrib/binutils/bfd/ihex.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel Hex objects. - Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. Written by Ian Lance Taylor of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/init.c b/contrib/binutils/bfd/init.c index 1fa1d50..198b979 100644 --- a/contrib/binutils/bfd/init.c +++ b/contrib/binutils/bfd/init.c @@ -1,5 +1,6 @@ /* bfd initialization stuff - Copyright (C) 1990, 91, 92, 93, 94, 1995 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/libaout.h b/contrib/binutils/bfd/libaout.h index 1682428..b3efdce 100644 --- a/contrib/binutils/bfd/libaout.h +++ b/contrib/binutils/bfd/libaout.h @@ -1,5 +1,6 @@ /* BFD back-end data structures for a.out (and similar) files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/libbfd-in.h b/contrib/binutils/bfd/libbfd-in.h index fb5f210..dc2cd11 100644 --- a/contrib/binutils/bfd/libbfd-in.h +++ b/contrib/binutils/bfd/libbfd-in.h @@ -1,6 +1,7 @@ /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -521,7 +522,7 @@ extern bfd *bfd_last_cache; /* List of supported target vectors, and the default vector (if bfd_default_vector[0] is NULL, there is no default). */ -extern const bfd_target * const bfd_target_vector[]; +extern const bfd_target * const *bfd_target_vector; extern const bfd_target *bfd_default_vector[]; /* Functions shared by the ECOFF and MIPS ELF backends, which have no diff --git a/contrib/binutils/bfd/libbfd.c b/contrib/binutils/bfd/libbfd.c index 8b846f0..695df8d 100644 --- a/contrib/binutils/bfd/libbfd.c +++ b/contrib/binutils/bfd/libbfd.c @@ -1,5 +1,6 @@ /* Assorted BFD support routines, only used internally. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -231,6 +232,7 @@ real_read (where, a,b, file) if (a == 0 || b == 0) return 0; + #if defined (__VAX) && defined (VMS) /* Apparently fread on Vax VMS does not keep the record length information. */ @@ -746,7 +748,6 @@ bfd_seek (abfd, position, direction) file_position += abfd->origin; result = fseek (f, file_position, direction); - if (result != 0) { int hold_errno = errno; @@ -959,7 +960,7 @@ bfd_putb16 (data, addr) register bfd_byte *addr; { addr[0] = (bfd_byte) (data >> 8); - addr[1] = (bfd_byte )data; + addr[1] = (bfd_byte) data; } void @@ -967,7 +968,7 @@ bfd_putl16 (data, addr) bfd_vma data; register bfd_byte *addr; { - addr[0] = (bfd_byte )data; + addr[0] = (bfd_byte) data; addr[1] = (bfd_byte) (data >> 8); } @@ -1126,7 +1127,7 @@ bfd_putb32 (data, addr) addr[0] = (bfd_byte) (data >> 24); addr[1] = (bfd_byte) (data >> 16); addr[2] = (bfd_byte) (data >> 8); - addr[3] = (bfd_byte)data; + addr[3] = (bfd_byte) data; } void @@ -1134,7 +1135,7 @@ bfd_putl32 (data, addr) bfd_vma data; register bfd_byte *addr; { - addr[0] = (bfd_byte)data; + addr[0] = (bfd_byte) data; addr[1] = (bfd_byte) (data >> 8); addr[2] = (bfd_byte) (data >> 16); addr[3] = (bfd_byte) (data >> 24); diff --git a/contrib/binutils/bfd/libbfd.h b/contrib/binutils/bfd/libbfd.h index d6e3939..997856a 100644 --- a/contrib/binutils/bfd/libbfd.h +++ b/contrib/binutils/bfd/libbfd.h @@ -1,6 +1,7 @@ /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -521,7 +522,7 @@ extern bfd *bfd_last_cache; /* List of supported target vectors, and the default vector (if bfd_default_vector[0] is NULL, there is no default). */ -extern const bfd_target * const bfd_target_vector[]; +extern const bfd_target * const *bfd_target_vector; extern const bfd_target *bfd_default_vector[]; /* Functions shared by the ECOFF and MIPS ELF backends, which have no @@ -646,7 +647,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SPARC_GLOB_DAT", "BFD_RELOC_SPARC_JMP_SLOT", "BFD_RELOC_SPARC_RELATIVE", + "BFD_RELOC_SPARC_UA16", "BFD_RELOC_SPARC_UA32", + "BFD_RELOC_SPARC_UA64", "BFD_RELOC_SPARC_BASE13", "BFD_RELOC_SPARC_BASE22", "BFD_RELOC_SPARC_10", @@ -706,6 +709,17 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MIPS_GOT_PAGE", "BFD_RELOC_MIPS_GOT_OFST", "BFD_RELOC_MIPS_GOT_DISP", + "BFD_RELOC_MIPS_SHIFT5", + "BFD_RELOC_MIPS_SHIFT6", + "BFD_RELOC_MIPS_INSERT_A", + "BFD_RELOC_MIPS_INSERT_B", + "BFD_RELOC_MIPS_DELETE", + "BFD_RELOC_MIPS_HIGHEST", + "BFD_RELOC_MIPS_HIGHER", + "BFD_RELOC_MIPS_SCN_DISP", + "BFD_RELOC_MIPS_REL16", + "BFD_RELOC_MIPS_RELGOT", + "BFD_RELOC_MIPS_JALR", "BFD_RELOC_386_GOT32", "BFD_RELOC_386_PLT32", diff --git a/contrib/binutils/bfd/libcoff-in.h b/contrib/binutils/bfd/libcoff-in.h index e5f5f9e..8368cc8 100644 --- a/contrib/binutils/bfd/libcoff-in.h +++ b/contrib/binutils/bfd/libcoff-in.h @@ -1,5 +1,6 @@ /* BFD COFF object file private structure. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -121,6 +122,8 @@ typedef struct pe_tdata int has_reloc_section; boolean (*in_reloc_p) PARAMS((bfd *, reloc_howto_type *)); flagword real_flags; + int target_subsystem; + boolean force_minimum_alignment; } pe_data_type; #define pe_data(bfd) ((bfd)->tdata.pe_obj_data) @@ -160,10 +163,10 @@ struct xcoff_tdata short cputype; /* maxdata from optional header. */ - bfd_size_type maxdata; + bfd_vma maxdata; /* maxstack from optional header. */ - bfd_size_type maxstack; + bfd_vma maxstack; /* Used by the XCOFF backend linker. */ asection **csects; diff --git a/contrib/binutils/bfd/libcoff.h b/contrib/binutils/bfd/libcoff.h index 5115538..34fed2d 100644 --- a/contrib/binutils/bfd/libcoff.h +++ b/contrib/binutils/bfd/libcoff.h @@ -1,5 +1,6 @@ /* BFD COFF object file private structure. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -121,6 +122,8 @@ typedef struct pe_tdata int has_reloc_section; boolean (*in_reloc_p) PARAMS((bfd *, reloc_howto_type *)); flagword real_flags; + int target_subsystem; + boolean force_minimum_alignment; } pe_data_type; #define pe_data(bfd) ((bfd)->tdata.pe_obj_data) @@ -160,10 +163,10 @@ struct xcoff_tdata short cputype; /* maxdata from optional header. */ - bfd_size_type maxdata; + bfd_vma maxdata; /* maxstack from optional header. */ - bfd_size_type maxstack; + bfd_vma maxstack; /* Used by the XCOFF backend linker. */ asection **csects; diff --git a/contrib/binutils/bfd/libecoff.h b/contrib/binutils/bfd/libecoff.h index 4561805..934ada1 100644 --- a/contrib/binutils/bfd/libecoff.h +++ b/contrib/binutils/bfd/libecoff.h @@ -1,5 +1,5 @@ /* BFD ECOFF object file private structure. - Copyright (C) 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1999 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/libieee.h b/contrib/binutils/bfd/libieee.h index 30e806e..aba9cb9 100644 --- a/contrib/binutils/bfd/libieee.h +++ b/contrib/binutils/bfd/libieee.h @@ -1,5 +1,5 @@ /* IEEE-695 object file formats: definitions internal to BFD. - Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1996 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Steve Chamberlain's fault. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/linker.c b/contrib/binutils/bfd/linker.c index 1fb3cc5..82805f9 100644 --- a/contrib/binutils/bfd/linker.c +++ b/contrib/binutils/bfd/linker.c @@ -1,5 +1,5 @@ /* linker.c -- BFD linker routines - Copyright (C) 1993, 94, 95, 96, 97, 98, 1999 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support @@ -1801,6 +1801,15 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, copy, false); if (inh == (struct bfd_link_hash_entry *) NULL) return false; + if (inh->type == bfd_link_hash_indirect + && inh->u.i.link == h) + { + (*_bfd_error_handler) + (_("%s: indirect symbol `%s' to `%s' is a loop"), + bfd_get_filename (abfd), name, string); + bfd_set_error (bfd_error_invalid_operation); + return false; + } if (inh->type == bfd_link_hash_new) { inh->type = bfd_link_hash_undefined; diff --git a/contrib/binutils/bfd/netbsd-core.c b/contrib/binutils/bfd/netbsd-core.c index b94c4a1..c93d6a4 100644 --- a/contrib/binutils/bfd/netbsd-core.c +++ b/contrib/binutils/bfd/netbsd-core.c @@ -1,5 +1,6 @@ /* BFD back end for NetBSD style core files - Copyright 1988, 89, 91, 92, 93, 96, 1998 Free Software Foundation, Inc. + Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000 + Free Software Foundation, Inc. Written by Paul Kranenburg, EUR This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/netbsd.h b/contrib/binutils/bfd/netbsd.h index d717824..0558032 100644 --- a/contrib/binutils/bfd/netbsd.h +++ b/contrib/binutils/bfd/netbsd.h @@ -1,5 +1,5 @@ /* BFD back-end definitions used by all NetBSD targets. - Copyright (C) 1990, 91, 92, 94, 95, 96, 97, 98, 2000 + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c index 39947da..0c3d2c9 100644 --- a/contrib/binutils/bfd/opncls.c +++ b/contrib/binutils/bfd/opncls.c @@ -1,5 +1,6 @@ /* opncls.c -- open and close a BFD. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, + 2001 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/osf-core.c b/contrib/binutils/bfd/osf-core.c index 4f4fc12..c458ecf 100644 --- a/contrib/binutils/bfd/osf-core.c +++ b/contrib/binutils/bfd/osf-core.c @@ -1,5 +1,5 @@ /* BFD back-end for OSF/1 core files. - Copyright 1993, 94, 95, 97, 1998 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1998, 1999 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/pe-arm.c b/contrib/binutils/bfd/pe-arm.c index a4e128b..dbb4789 100644 --- a/contrib/binutils/bfd/pe-arm.c +++ b/contrib/binutils/bfd/pe-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for ARM PECOFF files. - Copyright 1995, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/pe-i386.c b/contrib/binutils/bfd/pe-i386.c index 1e7e66e..7ced147 100644 --- a/contrib/binutils/bfd/pe-i386.c +++ b/contrib/binutils/bfd/pe-i386.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 PECOFF files. - Copyright 1995, 1996, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/pe-ppc.c b/contrib/binutils/bfd/pe-ppc.c index f96e68b..adbf317 100644 --- a/contrib/binutils/bfd/pe-ppc.c +++ b/contrib/binutils/bfd/pe-ppc.c @@ -1,5 +1,5 @@ /* BFD back-end for PowerPC PECOFF files. - Copyright 1995 Free Software Foundation, Inc. + Copyright 1995, 1996, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/peXXigen.c b/contrib/binutils/bfd/peXXigen.c new file mode 100644 index 0000000..0e1eaea --- /dev/null +++ b/contrib/binutils/bfd/peXXigen.c @@ -0,0 +1,2043 @@ +/* Support for the generic parts of PE/PEI; the common executable parts. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + Written by Cygnus Solutions. + +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. */ + +/* Most of this hacked by Steve Chamberlain . + + PE/PEI rearrangement (and code added): Donn Terry + Softway Systems, Inc. +*/ + +/* Hey look, some documentation [and in a place you expect to find it]! + + The main reference for the pei format is "Microsoft Portable Executable + and Common Object File Format Specification 4.1". Get it if you need to + do some serious hacking on this code. + + Another reference: + "Peering Inside the PE: A Tour of the Win32 Portable Executable + File Format", MSJ 1994, Volume 9. + + The *sole* difference between the pe format and the pei format is that the + latter has an MSDOS 2.0 .exe header on the front that prints the message + "This app must be run under Windows." (or some such). + (FIXME: Whether that statement is *really* true or not is unknown. + Are there more subtle differences between pe and pei formats? + For now assume there aren't. If you find one, then for God sakes + document it here!) + + The Microsoft docs use the word "image" instead of "executable" because + the former can also refer to a DLL (shared library). Confusion can arise + because the `i' in `pei' also refers to "image". The `pe' format can + also create images (i.e. executables), it's just that to run on a win32 + system you need to use the pei format. + + FIXME: Please add more docs here so the next poor fool that has to hack + on this code has a chance of getting something accomplished without + wasting too much time. +*/ + +/* This expands into COFF_WITH_pe or COFF_WITH_pep depending on whether + we're compiling for straight PE or PE+. */ +#define COFF_WITH_XX + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "coff/internal.h" + +/* NOTE: it's strange to be including an architecture specific header + in what's supposed to be general (to PE/PEI) code. However, that's + where the definitions are, and they don't vary per architecture + within PE/PEI, so we get them from there. FIXME: The lack of + variance is an assumption which may prove to be incorrect if new + PE/PEI targets are created. */ +#ifdef COFF_WITH_pep +# include "coff/ia64.h" +#else +# include "coff/i386.h" +#endif + +#include "coff/pe.h" +#include "libcoff.h" +#include "libpei.h" + +#ifdef COFF_WITH_pep +# undef AOUTSZ +# define AOUTSZ PEPAOUTSZ +# define PEAOUTHDR PEPAOUTHDR +#endif + +/* FIXME: This file has various tests of POWERPC_LE_PE. Those tests + worked when the code was in peicode.h, but no longer work now that + the code is in peigen.c. PowerPC NT is said to be dead. If + anybody wants to revive the code, you will have to figure out how + to handle those issues. */ + +static void add_data_entry + PARAMS ((bfd *, struct internal_extra_pe_aouthdr *, int, char *, bfd_vma)); +static boolean pe_print_pdata PARAMS ((bfd *, PTR)); +static boolean pe_print_reloc PARAMS ((bfd *, PTR)); + +/**********************************************************************/ + +void +_bfd_XXi_swap_sym_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + SYMENT *ext = (SYMENT *) ext1; + struct internal_syment *in = (struct internal_syment *) in1; + + if (ext->e.e_name[0] == 0) + { + in->_n._n_n._n_zeroes = 0; + in->_n._n_n._n_offset = + bfd_h_get_32 (abfd, (bfd_byte *) ext->e.e.e_offset); + } + else + { + memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); + } + + in->n_value = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_value); + in->n_scnum = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_scnum); + if (sizeof (ext->e_type) == 2) + { + in->n_type = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_type); + } + else + { + in->n_type = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_type); + } + in->n_sclass = bfd_h_get_8 (abfd, ext->e_sclass); + in->n_numaux = bfd_h_get_8 (abfd, ext->e_numaux); + +#ifndef STRICT_PE_FORMAT + /* This is for Gnu-created DLLs. */ + + /* The section symbols for the .idata$ sections have class 0x68 + (C_SECTION), which MS documentation indicates is a section + symbol. Unfortunately, the value field in the symbol is simply a + copy of the .idata section's flags rather than something useful. + When these symbols are encountered, change the value to 0 so that + they will be handled somewhat correctly in the bfd code. */ + if (in->n_sclass == C_SECTION) + { + in->n_value = 0x0; + +#if 0 + /* FIXME: This is clearly wrong. The problem seems to be that + undefined C_SECTION symbols appear in the first object of a + MS generated .lib file, and the symbols are not defined + anywhere. */ + in->n_scnum = 1; + + /* I have tried setting the class to 3 and using the following + to set the section number. This will put the address of the + pointer to the string kernel32.dll at addresses 0 and 0x10 + off start of idata section which is not correct. */ +#if 0 + if (strcmp (in->_n._n_name, ".idata$4") == 0) + in->n_scnum = 3; + else + in->n_scnum = 2; +#endif +#else + /* Create synthetic empty sections as needed. DJ */ + if (in->n_scnum == 0) + { + asection *sec; + for (sec = abfd->sections; sec; sec = sec->next) + { + if (strcmp (sec->name, in->n_name) == 0) + { + in->n_scnum = sec->target_index; + break; + } + } + } + if (in->n_scnum == 0) + { + int unused_section_number = 0; + asection *sec; + char *name; + for (sec = abfd->sections; sec; sec = sec->next) + if (unused_section_number <= sec->target_index) + unused_section_number = sec->target_index + 1; + + name = bfd_alloc (abfd, strlen (in->n_name) + 10); + if (name == NULL) + return; + strcpy (name, in->n_name); + sec = bfd_make_section_anyway (abfd, name); + + sec->vma = 0; + sec->lma = 0; + sec->_cooked_size = 0; + sec->_raw_size = 0; + sec->filepos = 0; + sec->rel_filepos = 0; + sec->reloc_count = 0; + sec->line_filepos = 0; + sec->lineno_count = 0; + sec->userdata = NULL; + sec->next = (asection *) NULL; + sec->flags = 0; + sec->alignment_power = 2; + sec->flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD; + + sec->target_index = unused_section_number; + + in->n_scnum = unused_section_number; + } + in->n_sclass = C_STAT; +#endif + } +#endif + +#ifdef coff_swap_sym_in_hook + /* This won't work in peigen.c, but since it's for PPC PE, it's not + worth fixing. */ + coff_swap_sym_in_hook (abfd, ext1, in1); +#endif +} + +unsigned int +_bfd_XXi_swap_sym_out (abfd, inp, extp) + bfd *abfd; + PTR inp; + PTR extp; +{ + struct internal_syment *in = (struct internal_syment *) inp; + SYMENT *ext = (SYMENT *) extp; + if (in->_n._n_name[0] == 0) + { + bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); + bfd_h_put_32 (abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e.e.e_offset); + } + else + { + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); + } + + bfd_h_put_32 (abfd, in->n_value, (bfd_byte *) ext->e_value); + bfd_h_put_16 (abfd, in->n_scnum, (bfd_byte *) ext->e_scnum); + if (sizeof (ext->e_type) == 2) + { + bfd_h_put_16 (abfd, in->n_type, (bfd_byte *) ext->e_type); + } + else + { + bfd_h_put_32 (abfd, in->n_type, (bfd_byte *) ext->e_type); + } + bfd_h_put_8 (abfd, in->n_sclass, ext->e_sclass); + bfd_h_put_8 (abfd, in->n_numaux, ext->e_numaux); + + return SYMESZ; +} + +void +_bfd_XXi_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) + bfd *abfd; + PTR ext1; + int type; + int class; + int indx ATTRIBUTE_UNUSED; + int numaux ATTRIBUTE_UNUSED; + PTR in1; +{ + AUXENT *ext = (AUXENT *) ext1; + union internal_auxent *in = (union internal_auxent *) in1; + + switch (class) + { + case C_FILE: + if (ext->x_file.x_fname[0] == 0) + { + in->x_file.x_n.x_zeroes = 0; + in->x_file.x_n.x_offset = + bfd_h_get_32 (abfd, (bfd_byte *) ext->x_file.x_n.x_offset); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } + return; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) + { + in->x_scn.x_scnlen = GET_SCN_SCNLEN (abfd, ext); + in->x_scn.x_nreloc = GET_SCN_NRELOC (abfd, ext); + in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext); + in->x_scn.x_checksum = + bfd_h_get_32 (abfd, (bfd_byte *) ext->x_scn.x_checksum); + in->x_scn.x_associated = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_scn.x_associated); + in->x_scn.x_comdat = + bfd_h_get_8 (abfd, (bfd_byte *) ext->x_scn.x_comdat); + return; + } + break; + } + + in->x_sym.x_tagndx.l = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_tagndx); + in->x_sym.x_tvndx = bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_tvndx); + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR (abfd, ext); + in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX (abfd, ext); + } + else + { + in->x_sym.x_fcnary.x_ary.x_dimen[0] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + in->x_sym.x_fcnary.x_ary.x_dimen[1] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + in->x_sym.x_fcnary.x_ary.x_dimen[2] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + in->x_sym.x_fcnary.x_ary.x_dimen[3] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + } + + if (ISFCN (type)) + { + in->x_sym.x_misc.x_fsize = + bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); + } + else + { + in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO (abfd, ext); + in->x_sym.x_misc.x_lnsz.x_size = GET_LNSZ_SIZE (abfd, ext); + } +} + +unsigned int +_bfd_XXi_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) + bfd *abfd; + PTR inp; + int type; + int class; + int indx ATTRIBUTE_UNUSED; + int numaux ATTRIBUTE_UNUSED; + PTR extp; +{ + union internal_auxent *in = (union internal_auxent *) inp; + AUXENT *ext = (AUXENT *) extp; + + memset ((PTR) ext, 0, AUXESZ); + switch (class) + { + case C_FILE: + if (in->x_file.x_fname[0] == 0) + { + bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); + bfd_h_put_32 (abfd, + in->x_file.x_n.x_offset, + (bfd_byte *) ext->x_file.x_n.x_offset); + } + else + { + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + } + return AUXESZ; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) + { + PUT_SCN_SCNLEN (abfd, in->x_scn.x_scnlen, ext); + PUT_SCN_NRELOC (abfd, in->x_scn.x_nreloc, ext); + PUT_SCN_NLINNO (abfd, in->x_scn.x_nlinno, ext); + bfd_h_put_32 (abfd, in->x_scn.x_checksum, + (bfd_byte *) ext->x_scn.x_checksum); + bfd_h_put_16 (abfd, in->x_scn.x_associated, + (bfd_byte *) ext->x_scn.x_associated); + bfd_h_put_8 (abfd, in->x_scn.x_comdat, + (bfd_byte *) ext->x_scn.x_comdat); + return AUXESZ; + } + break; + } + + bfd_h_put_32 (abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); + bfd_h_put_16 (abfd, in->x_sym.x_tvndx, (bfd_byte *) ext->x_sym.x_tvndx); + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + PUT_FCN_LNNOPTR (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext); + PUT_FCN_ENDNDX (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext); + } + else + { + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + } + + if (ISFCN (type)) + bfd_h_put_32 (abfd, in->x_sym.x_misc.x_fsize, + (bfd_byte *) ext->x_sym.x_misc.x_fsize); + else + { + PUT_LNSZ_LNNO (abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext); + PUT_LNSZ_SIZE (abfd, in->x_sym.x_misc.x_lnsz.x_size, ext); + } + + return AUXESZ; +} + +void +_bfd_XXi_swap_lineno_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + LINENO *ext = (LINENO *) ext1; + struct internal_lineno *in = (struct internal_lineno *) in1; + + in->l_addr.l_symndx = bfd_h_get_32 (abfd, (bfd_byte *) ext->l_addr.l_symndx); + in->l_lnno = GET_LINENO_LNNO (abfd, ext); +} + +unsigned int +_bfd_XXi_swap_lineno_out (abfd, inp, outp) + bfd *abfd; + PTR inp; + PTR outp; +{ + struct internal_lineno *in = (struct internal_lineno *) inp; + struct external_lineno *ext = (struct external_lineno *) outp; + bfd_h_put_32 (abfd, in->l_addr.l_symndx, (bfd_byte *) + ext->l_addr.l_symndx); + + PUT_LINENO_LNNO (abfd, in->l_lnno, ext); + return LINESZ; +} + +void +_bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) + bfd *abfd; + PTR aouthdr_ext1; + PTR aouthdr_int1; +{ + struct internal_extra_pe_aouthdr *a; + PEAOUTHDR *src = (PEAOUTHDR *) (aouthdr_ext1); + AOUTHDR *aouthdr_ext = (AOUTHDR *) aouthdr_ext1; + struct internal_aouthdr *aouthdr_int = (struct internal_aouthdr *)aouthdr_int1; + + aouthdr_int->magic = bfd_h_get_16 (abfd, (bfd_byte *) aouthdr_ext->magic); + aouthdr_int->vstamp = bfd_h_get_16 (abfd, (bfd_byte *) aouthdr_ext->vstamp); + aouthdr_int->tsize = + GET_AOUTHDR_TSIZE (abfd, (bfd_byte *) aouthdr_ext->tsize); + aouthdr_int->dsize = + GET_AOUTHDR_DSIZE (abfd, (bfd_byte *) aouthdr_ext->dsize); + aouthdr_int->bsize = + GET_AOUTHDR_BSIZE (abfd, (bfd_byte *) aouthdr_ext->bsize); + aouthdr_int->entry = + GET_AOUTHDR_ENTRY (abfd, (bfd_byte *) aouthdr_ext->entry); + aouthdr_int->text_start = + GET_AOUTHDR_TEXT_START (abfd, (bfd_byte *) aouthdr_ext->text_start); +#ifndef COFF_WITH_pep + /* PE32+ does not have data_start member! */ + aouthdr_int->data_start = + GET_AOUTHDR_DATA_START (abfd, (bfd_byte *) aouthdr_ext->data_start); +#endif + + a = &aouthdr_int->pe; + a->ImageBase = GET_OPTHDR_IMAGE_BASE (abfd, (bfd_byte *) src->ImageBase); + a->SectionAlignment = bfd_h_get_32 (abfd, (bfd_byte *) src->SectionAlignment); + a->FileAlignment = bfd_h_get_32 (abfd, (bfd_byte *) src->FileAlignment); + a->MajorOperatingSystemVersion = + bfd_h_get_16 (abfd, (bfd_byte *) src->MajorOperatingSystemVersion); + a->MinorOperatingSystemVersion = + bfd_h_get_16 (abfd, (bfd_byte *) src->MinorOperatingSystemVersion); + a->MajorImageVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MajorImageVersion); + a->MinorImageVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MinorImageVersion); + a->MajorSubsystemVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MajorSubsystemVersion); + a->MinorSubsystemVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MinorSubsystemVersion); + a->Reserved1 = bfd_h_get_32 (abfd, (bfd_byte *) src->Reserved1); + a->SizeOfImage = bfd_h_get_32 (abfd, (bfd_byte *) src->SizeOfImage); + a->SizeOfHeaders = bfd_h_get_32 (abfd, (bfd_byte *) src->SizeOfHeaders); + a->CheckSum = bfd_h_get_32 (abfd, (bfd_byte *) src->CheckSum); + a->Subsystem = bfd_h_get_16 (abfd, (bfd_byte *) src->Subsystem); + a->DllCharacteristics = bfd_h_get_16 (abfd, (bfd_byte *) src->DllCharacteristics); + a->SizeOfStackReserve = GET_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, (bfd_byte *) src->SizeOfStackReserve); + a->SizeOfStackCommit = GET_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, (bfd_byte *) src->SizeOfStackCommit); + a->SizeOfHeapReserve = GET_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, (bfd_byte *) src->SizeOfHeapReserve); + a->SizeOfHeapCommit = GET_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, (bfd_byte *) src->SizeOfHeapCommit); + a->LoaderFlags = bfd_h_get_32 (abfd, (bfd_byte *) src->LoaderFlags); + a->NumberOfRvaAndSizes = bfd_h_get_32 (abfd, (bfd_byte *) src->NumberOfRvaAndSizes); + + { + int idx; + for (idx = 0; idx < 16; idx++) + { + /* If data directory is empty, rva also should be 0. */ + int size = + bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][1]); + a->DataDirectory[idx].Size = size; + + if (size) + { + a->DataDirectory[idx].VirtualAddress = + bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][0]); + } + else + a->DataDirectory[idx].VirtualAddress = 0; + } + } + + if (aouthdr_int->entry) + { + aouthdr_int->entry += a->ImageBase; +#ifndef COFF_WITH_pep + aouthdr_int->entry &= 0xffffffff; +#endif + } + if (aouthdr_int->tsize) + { + aouthdr_int->text_start += a->ImageBase; +#ifndef COFF_WITH_pep + aouthdr_int->text_start &= 0xffffffff; +#endif + } +#ifndef COFF_WITH_pep + /* PE32+ does not have data_start member! */ + if (aouthdr_int->dsize) + { + aouthdr_int->data_start += a->ImageBase; + aouthdr_int->data_start &= 0xffffffff; + } +#endif + +#ifdef POWERPC_LE_PE + /* These three fields are normally set up by ppc_relocate_section. + In the case of reading a file in, we can pick them up from the + DataDirectory. */ + first_thunk_address = a->DataDirectory[12].VirtualAddress; + thunk_size = a->DataDirectory[12].Size; + import_table_size = a->DataDirectory[1].Size; +#endif + +} + +/* A support function for below. */ + +static void +add_data_entry (abfd, aout, idx, name, base) + bfd *abfd; + struct internal_extra_pe_aouthdr *aout; + int idx; + char *name; + bfd_vma base; +{ + asection *sec = bfd_get_section_by_name (abfd, name); + + /* add import directory information if it exists */ + if ((sec != NULL) + && (coff_section_data (abfd, sec) != NULL) + && (pei_section_data (abfd, sec) != NULL)) + { + /* If data directory is empty, rva also should be 0 */ + int size = pei_section_data (abfd, sec)->virt_size; + aout->DataDirectory[idx].Size = size; + + if (size) + { + aout->DataDirectory[idx].VirtualAddress = + (sec->vma - base) & 0xffffffff; + sec->flags |= SEC_DATA; + } + } +} + +unsigned int +_bfd_XXi_swap_aouthdr_out (abfd, in, out) + bfd *abfd; + PTR in; + PTR out; +{ + struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *) in; + pe_data_type *pe = pe_data (abfd); + struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; + PEAOUTHDR *aouthdr_out = (PEAOUTHDR *) out; + bfd_vma sa, fa, ib; + + if (pe->force_minimum_alignment) + { + if (!extra->FileAlignment) + extra->FileAlignment = PE_DEF_FILE_ALIGNMENT; + if (!extra->SectionAlignment) + extra->SectionAlignment = PE_DEF_SECTION_ALIGNMENT; + } + + if (extra->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN) + extra->Subsystem = pe->target_subsystem; + + sa = extra->SectionAlignment; + fa = extra->FileAlignment; + ib = extra->ImageBase; + + if (aouthdr_in->tsize) + { + aouthdr_in->text_start -= ib; +#ifndef COFF_WITH_pep + aouthdr_in->text_start &= 0xffffffff; +#endif + } + if (aouthdr_in->dsize) + { + aouthdr_in->data_start -= ib; +#ifndef COFF_WITH_pep + aouthdr_in->data_start &= 0xffffffff; +#endif + } + if (aouthdr_in->entry) + { + aouthdr_in->entry -= ib; +#ifndef COFF_WITH_pep + aouthdr_in->entry &= 0xffffffff; +#endif + } + +#define FA(x) (((x) + fa -1 ) & (- fa)) +#define SA(x) (((x) + sa -1 ) & (- sa)) + + /* We like to have the sizes aligned. */ + + aouthdr_in->bsize = FA (aouthdr_in->bsize); + + extra->NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; + + /* first null out all data directory entries .. */ + memset (extra->DataDirectory, sizeof (extra->DataDirectory), 0); + + add_data_entry (abfd, extra, 0, ".edata", ib); + + /* Don't call add_data_entry for .idata$2 or .idata$5. It's done in + bfd_coff_final_link where all the required information is + available. */ + + /* However, until other .idata fixes are made (pending patch), the + entry for .idata is needed for backwards compatability. FIXME. */ + add_data_entry (abfd, extra, 1, ".idata", ib); + + add_data_entry (abfd, extra, 2, ".rsrc", ib); + + add_data_entry (abfd, extra, 3, ".pdata", ib); + + /* For some reason, the virtual size (which is what's set by + add_data_entry) for .reloc is not the same as the size recorded + in this slot by MSVC; it doesn't seem to cause problems (so far), + but since it's the best we've got, use it. It does do the right + thing for .pdata. */ + if (pe->has_reloc_section) + add_data_entry (abfd, extra, 5, ".reloc", ib); + + { + asection *sec; + bfd_vma dsize = 0; + bfd_vma isize = SA(abfd->sections->filepos); + bfd_vma tsize = 0; + + for (sec = abfd->sections; sec; sec = sec->next) + { + int rounded = FA(sec->_raw_size); + + if (sec->flags & SEC_DATA) + dsize += rounded; + if (sec->flags & SEC_CODE) + tsize += rounded; + /* The image size is the total VIRTUAL size (which is what is + in the virt_size field). Files have been seen (from MSVC + 5.0 link.exe) where the file size of the .data segment is + quite small compared to the virtual size. Without this + fix, strip munges the file. */ + isize += SA (FA (pei_section_data (abfd, sec)->virt_size)); + } + + aouthdr_in->dsize = dsize; + aouthdr_in->tsize = tsize; + extra->SizeOfImage = isize; + } + + extra->SizeOfHeaders = abfd->sections->filepos; + bfd_h_put_16 (abfd, aouthdr_in->magic, (bfd_byte *) aouthdr_out->standard.magic); + +#define LINKER_VERSION 256 /* That is, 2.56 */ + + /* This piece of magic sets the "linker version" field to + LINKER_VERSION. */ + bfd_h_put_16 (abfd, + LINKER_VERSION / 100 + (LINKER_VERSION % 100) * 256, + (bfd_byte *) aouthdr_out->standard.vstamp); + + PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, (bfd_byte *) aouthdr_out->standard.tsize); + PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, (bfd_byte *) aouthdr_out->standard.dsize); + PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, (bfd_byte *) aouthdr_out->standard.bsize); + PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, (bfd_byte *) aouthdr_out->standard.entry); + PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start, + (bfd_byte *) aouthdr_out->standard.text_start); + +#ifndef COFF_WITH_pep + /* PE32+ does not have data_start member! */ + PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, + (bfd_byte *) aouthdr_out->standard.data_start); +#endif + + PUT_OPTHDR_IMAGE_BASE (abfd, extra->ImageBase, + (bfd_byte *) aouthdr_out->ImageBase); + bfd_h_put_32 (abfd, extra->SectionAlignment, + (bfd_byte *) aouthdr_out->SectionAlignment); + bfd_h_put_32 (abfd, extra->FileAlignment, + (bfd_byte *) aouthdr_out->FileAlignment); + bfd_h_put_16 (abfd, extra->MajorOperatingSystemVersion, + (bfd_byte *) aouthdr_out->MajorOperatingSystemVersion); + bfd_h_put_16 (abfd, extra->MinorOperatingSystemVersion, + (bfd_byte *) aouthdr_out->MinorOperatingSystemVersion); + bfd_h_put_16 (abfd, extra->MajorImageVersion, + (bfd_byte *) aouthdr_out->MajorImageVersion); + bfd_h_put_16 (abfd, extra->MinorImageVersion, + (bfd_byte *) aouthdr_out->MinorImageVersion); + bfd_h_put_16 (abfd, extra->MajorSubsystemVersion, + (bfd_byte *) aouthdr_out->MajorSubsystemVersion); + bfd_h_put_16 (abfd, extra->MinorSubsystemVersion, + (bfd_byte *) aouthdr_out->MinorSubsystemVersion); + bfd_h_put_32 (abfd, extra->Reserved1, + (bfd_byte *) aouthdr_out->Reserved1); + bfd_h_put_32 (abfd, extra->SizeOfImage, + (bfd_byte *) aouthdr_out->SizeOfImage); + bfd_h_put_32 (abfd, extra->SizeOfHeaders, + (bfd_byte *) aouthdr_out->SizeOfHeaders); + bfd_h_put_32 (abfd, extra->CheckSum, + (bfd_byte *) aouthdr_out->CheckSum); + bfd_h_put_16 (abfd, extra->Subsystem, + (bfd_byte *) aouthdr_out->Subsystem); + bfd_h_put_16 (abfd, extra->DllCharacteristics, + (bfd_byte *) aouthdr_out->DllCharacteristics); + PUT_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, extra->SizeOfStackReserve, + (bfd_byte *) aouthdr_out->SizeOfStackReserve); + PUT_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, extra->SizeOfStackCommit, + (bfd_byte *) aouthdr_out->SizeOfStackCommit); + PUT_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, extra->SizeOfHeapReserve, + (bfd_byte *) aouthdr_out->SizeOfHeapReserve); + PUT_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, extra->SizeOfHeapCommit, + (bfd_byte *) aouthdr_out->SizeOfHeapCommit); + bfd_h_put_32 (abfd, extra->LoaderFlags, + (bfd_byte *) aouthdr_out->LoaderFlags); + bfd_h_put_32 (abfd, extra->NumberOfRvaAndSizes, + (bfd_byte *) aouthdr_out->NumberOfRvaAndSizes); + { + int idx; + for (idx = 0; idx < 16; idx++) + { + bfd_h_put_32 (abfd, extra->DataDirectory[idx].VirtualAddress, + (bfd_byte *) aouthdr_out->DataDirectory[idx][0]); + bfd_h_put_32 (abfd, extra->DataDirectory[idx].Size, + (bfd_byte *) aouthdr_out->DataDirectory[idx][1]); + } + } + + return AOUTSZ; +} + +unsigned int +_bfd_XXi_only_swap_filehdr_out (abfd, in, out) + bfd *abfd; + PTR in; + PTR out; +{ + int idx; + struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in; + struct external_PEI_filehdr *filehdr_out = (struct external_PEI_filehdr *) out; + + if (pe_data (abfd)->has_reloc_section) + filehdr_in->f_flags &= ~F_RELFLG; + + if (pe_data (abfd)->dll) + filehdr_in->f_flags |= F_DLL; + + filehdr_in->pe.e_magic = DOSMAGIC; + filehdr_in->pe.e_cblp = 0x90; + filehdr_in->pe.e_cp = 0x3; + filehdr_in->pe.e_crlc = 0x0; + filehdr_in->pe.e_cparhdr = 0x4; + filehdr_in->pe.e_minalloc = 0x0; + filehdr_in->pe.e_maxalloc = 0xffff; + filehdr_in->pe.e_ss = 0x0; + filehdr_in->pe.e_sp = 0xb8; + filehdr_in->pe.e_csum = 0x0; + filehdr_in->pe.e_ip = 0x0; + filehdr_in->pe.e_cs = 0x0; + filehdr_in->pe.e_lfarlc = 0x40; + filehdr_in->pe.e_ovno = 0x0; + + for (idx = 0; idx < 4; idx++) + filehdr_in->pe.e_res[idx] = 0x0; + + filehdr_in->pe.e_oemid = 0x0; + filehdr_in->pe.e_oeminfo = 0x0; + + for (idx = 0; idx < 10; idx++) + filehdr_in->pe.e_res2[idx] = 0x0; + + filehdr_in->pe.e_lfanew = 0x80; + + /* This next collection of data are mostly just characters. It + appears to be constant within the headers put on NT exes. */ + filehdr_in->pe.dos_message[0] = 0x0eba1f0e; + filehdr_in->pe.dos_message[1] = 0xcd09b400; + filehdr_in->pe.dos_message[2] = 0x4c01b821; + filehdr_in->pe.dos_message[3] = 0x685421cd; + filehdr_in->pe.dos_message[4] = 0x70207369; + filehdr_in->pe.dos_message[5] = 0x72676f72; + filehdr_in->pe.dos_message[6] = 0x63206d61; + filehdr_in->pe.dos_message[7] = 0x6f6e6e61; + filehdr_in->pe.dos_message[8] = 0x65622074; + filehdr_in->pe.dos_message[9] = 0x6e757220; + filehdr_in->pe.dos_message[10] = 0x206e6920; + filehdr_in->pe.dos_message[11] = 0x20534f44; + filehdr_in->pe.dos_message[12] = 0x65646f6d; + filehdr_in->pe.dos_message[13] = 0x0a0d0d2e; + filehdr_in->pe.dos_message[14] = 0x24; + filehdr_in->pe.dos_message[15] = 0x0; + filehdr_in->pe.nt_signature = NT_SIGNATURE; + + bfd_h_put_16 (abfd, filehdr_in->f_magic, (bfd_byte *) filehdr_out->f_magic); + bfd_h_put_16 (abfd, filehdr_in->f_nscns, (bfd_byte *) filehdr_out->f_nscns); + + bfd_h_put_32 (abfd, time (0), (bfd_byte *) filehdr_out->f_timdat); + PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr, + (bfd_byte *) filehdr_out->f_symptr); + bfd_h_put_32 (abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms); + bfd_h_put_16 (abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr); + bfd_h_put_16 (abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags); + + /* put in extra dos header stuff. This data remains essentially + constant, it just has to be tacked on to the beginning of all exes + for NT */ + bfd_h_put_16 (abfd, filehdr_in->pe.e_magic, (bfd_byte *) filehdr_out->e_magic); + bfd_h_put_16 (abfd, filehdr_in->pe.e_cblp, (bfd_byte *) filehdr_out->e_cblp); + bfd_h_put_16 (abfd, filehdr_in->pe.e_cp, (bfd_byte *) filehdr_out->e_cp); + bfd_h_put_16 (abfd, filehdr_in->pe.e_crlc, (bfd_byte *) filehdr_out->e_crlc); + bfd_h_put_16 (abfd, filehdr_in->pe.e_cparhdr, + (bfd_byte *) filehdr_out->e_cparhdr); + bfd_h_put_16 (abfd, filehdr_in->pe.e_minalloc, + (bfd_byte *) filehdr_out->e_minalloc); + bfd_h_put_16 (abfd, filehdr_in->pe.e_maxalloc, + (bfd_byte *) filehdr_out->e_maxalloc); + bfd_h_put_16 (abfd, filehdr_in->pe.e_ss, (bfd_byte *) filehdr_out->e_ss); + bfd_h_put_16 (abfd, filehdr_in->pe.e_sp, (bfd_byte *) filehdr_out->e_sp); + bfd_h_put_16 (abfd, filehdr_in->pe.e_csum, (bfd_byte *) filehdr_out->e_csum); + bfd_h_put_16 (abfd, filehdr_in->pe.e_ip, (bfd_byte *) filehdr_out->e_ip); + bfd_h_put_16 (abfd, filehdr_in->pe.e_cs, (bfd_byte *) filehdr_out->e_cs); + bfd_h_put_16 (abfd, filehdr_in->pe.e_lfarlc, (bfd_byte *) filehdr_out->e_lfarlc); + bfd_h_put_16 (abfd, filehdr_in->pe.e_ovno, (bfd_byte *) filehdr_out->e_ovno); + { + int idx; + for (idx = 0; idx < 4; idx++) + bfd_h_put_16 (abfd, filehdr_in->pe.e_res[idx], + (bfd_byte *) filehdr_out->e_res[idx]); + } + bfd_h_put_16 (abfd, filehdr_in->pe.e_oemid, (bfd_byte *) filehdr_out->e_oemid); + bfd_h_put_16 (abfd, filehdr_in->pe.e_oeminfo, + (bfd_byte *) filehdr_out->e_oeminfo); + { + int idx; + for (idx = 0; idx < 10; idx++) + bfd_h_put_16 (abfd, filehdr_in->pe.e_res2[idx], + (bfd_byte *) filehdr_out->e_res2[idx]); + } + bfd_h_put_32 (abfd, filehdr_in->pe.e_lfanew, (bfd_byte *) filehdr_out->e_lfanew); + + { + int idx; + for (idx = 0; idx < 16; idx++) + bfd_h_put_32 (abfd, filehdr_in->pe.dos_message[idx], + (bfd_byte *) filehdr_out->dos_message[idx]); + } + + /* Also put in the NT signature. */ + bfd_h_put_32 (abfd, filehdr_in->pe.nt_signature, + (bfd_byte *) filehdr_out->nt_signature); + + return FILHSZ; +} + +unsigned int +_bfd_XX_only_swap_filehdr_out (abfd, in, out) + bfd *abfd; + PTR in; + PTR out; +{ + struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in; + FILHDR *filehdr_out = (FILHDR *) out; + + bfd_h_put_16 (abfd, filehdr_in->f_magic, (bfd_byte *) filehdr_out->f_magic); + bfd_h_put_16 (abfd, filehdr_in->f_nscns, (bfd_byte *) filehdr_out->f_nscns); + bfd_h_put_32 (abfd, filehdr_in->f_timdat, (bfd_byte *) filehdr_out->f_timdat); + PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr, + (bfd_byte *) filehdr_out->f_symptr); + bfd_h_put_32 (abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms); + bfd_h_put_16 (abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr); + bfd_h_put_16 (abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags); + + return FILHSZ; +} + +unsigned int +_bfd_XXi_swap_scnhdr_out (abfd, in, out) + bfd *abfd; + PTR in; + PTR out; +{ + struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in; + SCNHDR *scnhdr_ext = (SCNHDR *) out; + unsigned int ret = SCNHSZ; + bfd_vma ps; + bfd_vma ss; + + memcpy (scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name)); + + PUT_SCNHDR_VADDR (abfd, + ((scnhdr_int->s_vaddr + - pe_data (abfd)->pe_opthdr.ImageBase) + & 0xffffffff), + (bfd_byte *) scnhdr_ext->s_vaddr); + + /* NT wants the size data to be rounded up to the next + NT_FILE_ALIGNMENT, but zero if it has no content (as in .bss, + sometimes). */ + + if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0) + { + ps = scnhdr_int->s_size; + ss = 0; + } + else + { + ps = scnhdr_int->s_paddr; + ss = scnhdr_int->s_size; + } + + PUT_SCNHDR_SIZE (abfd, ss, + (bfd_byte *) scnhdr_ext->s_size); + + /* s_paddr in PE is really the virtual size. */ + PUT_SCNHDR_PADDR (abfd, ps, (bfd_byte *) scnhdr_ext->s_paddr); + + PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr, + (bfd_byte *) scnhdr_ext->s_scnptr); + PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr, + (bfd_byte *) scnhdr_ext->s_relptr); + PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, + (bfd_byte *) scnhdr_ext->s_lnnoptr); + + /* Extra flags must be set when dealing with NT. All sections should also + have the IMAGE_SCN_MEM_READ (0x40000000) flag set. In addition, the + .text section must have IMAGE_SCN_MEM_EXECUTE (0x20000000) and the data + sections (.idata, .data, .bss, .CRT) must have IMAGE_SCN_MEM_WRITE set + (this is especially important when dealing with the .idata section since + the addresses for routines from .dlls must be overwritten). If .reloc + section data is ever generated, we must add IMAGE_SCN_MEM_DISCARDABLE + (0x02000000). Also, the resource data should also be read and + writable. */ + + /* FIXME: alignment is also encoded in this field, at least on ppc (krk) */ + /* FIXME: even worse, I don't see how to get the original alignment field*/ + /* back... */ + + { + int flags = scnhdr_int->s_flags; + bfd_h_put_32 (abfd, flags, (bfd_byte *) scnhdr_ext->s_flags); + } + + if (coff_data (abfd)->link_info + && ! coff_data (abfd)->link_info->relocateable + && ! coff_data (abfd)->link_info->shared + && strcmp (scnhdr_int->s_name, ".text") == 0) + { + /* By inference from looking at MS output, the 32 bit field + which is the combintion of the number_of_relocs and + number_of_linenos is used for the line number count in + executables. A 16-bit field won't do for cc1. The MS + document says that the number of relocs is zero for + executables, but the 17-th bit has been observed to be there. + Overflow is not an issue: a 4G-line program will overflow a + bunch of other fields long before this! */ + bfd_h_put_16 (abfd, scnhdr_int->s_nlnno & 0xffff, + (bfd_byte *) scnhdr_ext->s_nlnno); + bfd_h_put_16 (abfd, scnhdr_int->s_nlnno >> 16, + (bfd_byte *) scnhdr_ext->s_nreloc); + } + else + { + if (scnhdr_int->s_nlnno <= 0xffff) + bfd_h_put_16 (abfd, scnhdr_int->s_nlnno, + (bfd_byte *) scnhdr_ext->s_nlnno); + else + { + (*_bfd_error_handler) (_("%s: line number overflow: 0x%lx > 0xffff"), + bfd_get_filename (abfd), + scnhdr_int->s_nlnno); + bfd_set_error (bfd_error_file_truncated); + bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); + ret = 0; + } + if (scnhdr_int->s_nreloc <= 0xffff) + bfd_h_put_16 (abfd, scnhdr_int->s_nreloc, + (bfd_byte *) scnhdr_ext->s_nreloc); + else + { + /* PE can deal with large #s of relocs, but not here */ + bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + scnhdr_int->s_flags |= IMAGE_SCN_LNK_NRELOC_OVFL; + bfd_h_put_32 (abfd, scnhdr_int->s_flags, + (bfd_byte *) scnhdr_ext->s_flags); +#if 0 + (*_bfd_error_handler) (_("%s: reloc overflow 1: 0x%lx > 0xffff"), + bfd_get_filename (abfd), + scnhdr_int->s_nreloc); + bfd_set_error (bfd_error_file_truncated); + bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + ret = 0; +#endif + } + } + return ret; +} + +static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = { + N_("Export Directory [.edata (or where ever we found it)]"), + N_("Import Directory [parts of .idata]"), + N_("Resource Directory [.rsrc]"), + N_("Exception Directory [.pdata]"), + N_("Security Directory"), + N_("Base Relocation Directory [.reloc]"), + N_("Debug Directory"), + N_("Description Directory"), + N_("Special Directory"), + N_("Thread Storage Directory [.tls]"), + N_("Load Configuration Directory"), + N_("Bound Import Directory"), + N_("Import Address Table Directory"), + N_("Delay Import Directory"), + N_("Reserved"), + N_("Reserved") +}; + +/**********************************************************************/ +#ifdef POWERPC_LE_PE +/* The code for the PPC really falls in the "architecture dependent" + category. However, it's not clear that anyone will ever care, so + we're ignoring the issue for now; if/when PPC matters, some of this + may need to go into peicode.h, or arguments passed to enable the + PPC- specific code. */ +#endif + +/**********************************************************************/ +static boolean +pe_print_idata (abfd, vfile) + bfd *abfd; + PTR vfile; +{ + FILE *file = (FILE *) vfile; + bfd_byte *data; + asection *section; + bfd_signed_vma adj; + +#ifdef POWERPC_LE_PE + asection *rel_section = bfd_get_section_by_name (abfd, ".reldata"); +#endif + + bfd_size_type datasize = 0; + bfd_size_type dataoff; + bfd_size_type i; + int onaline = 20; + + pe_data_type *pe = pe_data (abfd); + struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; + + bfd_vma addr; + + addr = extra->DataDirectory[1].VirtualAddress; + + if (addr == 0 && extra->DataDirectory[1].Size == 0) + { + /* Maybe the extra header isn't there. Look for the section. */ + section = bfd_get_section_by_name (abfd, ".idata"); + if (section == NULL) + return true; + + addr = section->vma; + datasize = bfd_section_size (abfd, section); + if (datasize == 0) + return true; + } + else + { + addr += extra->ImageBase; + for (section = abfd->sections; section != NULL; section = section->next) + { + datasize = bfd_section_size (abfd, section); + if (addr >= section->vma && addr < section->vma + datasize) + break; + } + + if (section == NULL) + { + fprintf (file, + _("\nThere is an import table, but the section containing it could not be found\n")); + return true; + } + } + + fprintf (file, _("\nThere is an import table in %s at 0x%lx\n"), + section->name, (unsigned long) addr); + + dataoff = addr - section->vma; + datasize -= dataoff; + +#ifdef POWERPC_LE_PE + if (rel_section != 0 && bfd_section_size (abfd, rel_section) != 0) + { + /* The toc address can be found by taking the starting address, + which on the PPC locates a function descriptor. The + descriptor consists of the function code starting address + followed by the address of the toc. The starting address we + get from the bfd, and the descriptor is supposed to be in the + .reldata section. */ + + bfd_vma loadable_toc_address; + bfd_vma toc_address; + bfd_vma start_address; + bfd_byte *data = 0; + int offset; + + data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, + rel_section)); + if (data == NULL && bfd_section_size (abfd, rel_section) != 0) + return false; + + bfd_get_section_contents (abfd, + rel_section, + (PTR) data, 0, + bfd_section_size (abfd, rel_section)); + + offset = abfd->start_address - rel_section->vma; + + start_address = bfd_get_32 (abfd, data + offset); + loadable_toc_address = bfd_get_32 (abfd, data + offset + 4); + toc_address = loadable_toc_address - 32768; + + fprintf (file, + _("\nFunction descriptor located at the start address: %04lx\n"), + (unsigned long int) (abfd->start_address)); + fprintf (file, + _("\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"), + start_address, loadable_toc_address, toc_address); + } + else + { + fprintf (file, + _("\nNo reldata section! Function descriptor not decoded.\n")); + } +#endif + + fprintf (file, + _("\nThe Import Tables (interpreted %s section contents)\n"), + section->name); + fprintf (file, + _(" vma: Hint Time Forward DLL First\n")); + fprintf (file, + _(" Table Stamp Chain Name Thunk\n")); + + data = (bfd_byte *) bfd_malloc (dataoff + datasize); + if (data == NULL) + return false; + + /* Read the whole section. Some of the fields might be before dataoff. */ + if (! bfd_get_section_contents (abfd, section, (PTR) data, + 0, dataoff + datasize)) + return false; + + adj = section->vma - extra->ImageBase; + + for (i = 0; i < datasize; i += onaline) + { + bfd_vma hint_addr; + bfd_vma time_stamp; + bfd_vma forward_chain; + bfd_vma dll_name; + bfd_vma first_thunk; + int idx = 0; + bfd_size_type j; + char *dll; + + /* print (i + extra->DataDirectory[1].VirtualAddress) */ + fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff)); + + if (i + 20 > datasize) + { + /* Check stuff. */ + ; + } + + hint_addr = bfd_get_32 (abfd, data + i + dataoff); + time_stamp = bfd_get_32 (abfd, data + i + 4 + dataoff); + forward_chain = bfd_get_32 (abfd, data + i + 8 + dataoff); + dll_name = bfd_get_32 (abfd, data + i + 12 + dataoff); + first_thunk = bfd_get_32 (abfd, data + i + 16 + dataoff); + + fprintf (file, "%08lx %08lx %08lx %08lx %08lx\n", + (unsigned long) hint_addr, + (unsigned long) time_stamp, + (unsigned long) forward_chain, + (unsigned long) dll_name, + (unsigned long) first_thunk); + + if (hint_addr == 0 && first_thunk == 0) + break; + + dll = (char *) data + dll_name - adj; + fprintf (file, _("\n\tDLL Name: %s\n"), dll); + + if (hint_addr != 0) + { + fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); + + idx = hint_addr - adj; + + for (j = 0; j < datasize; j += 4) + { + unsigned long member = bfd_get_32 (abfd, data + idx + j); + + if (member == 0) + break; + if (member & 0x80000000) + fprintf (file, "\t%04lx\t %4lu", member, + member & 0x7fffffff); + else + { + int ordinal; + char *member_name; + + ordinal = bfd_get_16 (abfd, data + member - adj); + member_name = (char *) data + member - adj + 2; + fprintf (file, "\t%04lx\t %4d %s", + member, ordinal, member_name); + } + + /* If the time stamp is not zero, the import address + table holds actual addresses. */ + if (time_stamp != 0 + && first_thunk != 0 + && first_thunk != hint_addr) + fprintf (file, "\t%04lx", + (long) bfd_get_32 (abfd, data + first_thunk - adj + j)); + + fprintf (file, "\n"); + } + } + + if (hint_addr != first_thunk && time_stamp == 0) + { + int differ = 0; + int idx2; + + idx2 = first_thunk - adj; + + for (j = 0; j < datasize; j += 4) + { + int ordinal; + char *member_name; + bfd_vma hint_member = 0; + bfd_vma iat_member; + + if (hint_addr != 0) + hint_member = bfd_get_32 (abfd, data + idx + j); + iat_member = bfd_get_32 (abfd, data + idx2 + j); + + if (hint_addr == 0 && iat_member == 0) + break; + + if (hint_addr == 0 || hint_member != iat_member) + { + if (differ == 0) + { + fprintf (file, + _("\tThe Import Address Table (difference found)\n")); + fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); + differ = 1; + } + if (iat_member == 0) + { + fprintf (file, + _("\t>>> Ran out of IAT members!\n")); + } + else + { + ordinal = bfd_get_16 (abfd, data + iat_member - adj); + member_name = (char *) data + iat_member - adj + 2; + fprintf (file, "\t%04lx\t %4d %s\n", + (unsigned long) iat_member, + ordinal, + member_name); + } + } + + if (hint_addr != 0 && hint_member == 0) + break; + } + if (differ == 0) + { + fprintf (file, + _("\tThe Import Address Table is identical\n")); + } + } + + fprintf (file, "\n"); + + } + + free (data); + + return true; +} + +static boolean +pe_print_edata (abfd, vfile) + bfd *abfd; + PTR vfile; +{ + FILE *file = (FILE *) vfile; + bfd_byte *data; + asection *section; + + bfd_size_type datasize = 0; + bfd_size_type dataoff; + bfd_size_type i; + + bfd_signed_vma adj; + struct EDT_type { + long export_flags; /* reserved - should be zero */ + long time_stamp; + short major_ver; + short minor_ver; + bfd_vma name; /* rva - relative to image base */ + long base; /* ordinal base */ + unsigned long num_functions; /* Number in the export address table */ + unsigned long num_names; /* Number in the name pointer table */ + bfd_vma eat_addr; /* rva to the export address table */ + bfd_vma npt_addr; /* rva to the Export Name Pointer Table */ + bfd_vma ot_addr; /* rva to the Ordinal Table */ + } edt; + + pe_data_type *pe = pe_data (abfd); + struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; + + bfd_vma addr; + + addr = extra->DataDirectory[0].VirtualAddress; + + if (addr == 0 && extra->DataDirectory[0].Size == 0) + { + /* Maybe the extra header isn't there. Look for the section. */ + section = bfd_get_section_by_name (abfd, ".edata"); + if (section == NULL) + return true; + + addr = section->vma; + datasize = bfd_section_size (abfd, section); + if (datasize == 0) + return true; + } + else + { + addr += extra->ImageBase; + for (section = abfd->sections; section != NULL; section = section->next) + { + datasize = bfd_section_size (abfd, section); + if (addr >= section->vma && addr < section->vma + datasize) + break; + } + + if (section == NULL) + { + fprintf (file, + _("\nThere is an export table, but the section containing it could not be found\n")); + return true; + } + } + + fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"), + section->name, (unsigned long) addr); + + dataoff = addr - section->vma; + datasize -= dataoff; + + data = (bfd_byte *) bfd_malloc (datasize); + if (data == NULL) + return false; + + if (! bfd_get_section_contents (abfd, section, (PTR) data, dataoff, + datasize)) + return false; + + /* Go get Export Directory Table. */ + edt.export_flags = bfd_get_32 (abfd, data + 0); + edt.time_stamp = bfd_get_32 (abfd, data + 4); + edt.major_ver = bfd_get_16 (abfd, data + 8); + edt.minor_ver = bfd_get_16 (abfd, data + 10); + edt.name = bfd_get_32 (abfd, data + 12); + edt.base = bfd_get_32 (abfd, data + 16); + edt.num_functions = bfd_get_32 (abfd, data + 20); + edt.num_names = bfd_get_32 (abfd, data + 24); + edt.eat_addr = bfd_get_32 (abfd, data + 28); + edt.npt_addr = bfd_get_32 (abfd, data + 32); + edt.ot_addr = bfd_get_32 (abfd, data + 36); + + adj = section->vma - extra->ImageBase + dataoff; + + /* Dump the EDT first first */ + fprintf (file, + _("\nThe Export Tables (interpreted %s section contents)\n\n"), + section->name); + + fprintf (file, + _("Export Flags \t\t\t%lx\n"), (unsigned long) edt.export_flags); + + fprintf (file, + _("Time/Date stamp \t\t%lx\n"), (unsigned long) edt.time_stamp); + + fprintf (file, + _("Major/Minor \t\t\t%d/%d\n"), edt.major_ver, edt.minor_ver); + + fprintf (file, + _("Name \t\t\t\t")); + fprintf_vma (file, edt.name); + fprintf (file, + " %s\n", data + edt.name - adj); + + fprintf (file, + _("Ordinal Base \t\t\t%ld\n"), edt.base); + + fprintf (file, + _("Number in:\n")); + + fprintf (file, + _("\tExport Address Table \t\t%08lx\n"), + edt.num_functions); + + fprintf (file, + _("\t[Name Pointer/Ordinal] Table\t%08lx\n"), edt.num_names); + + fprintf (file, + _("Table Addresses\n")); + + fprintf (file, + _("\tExport Address Table \t\t")); + fprintf_vma (file, edt.eat_addr); + fprintf (file, "\n"); + + fprintf (file, + _("\tName Pointer Table \t\t")); + fprintf_vma (file, edt.npt_addr); + fprintf (file, "\n"); + + fprintf (file, + _("\tOrdinal Table \t\t\t")); + fprintf_vma (file, edt.ot_addr); + fprintf (file, "\n"); + + /* The next table to find is the Export Address Table. It's basically + a list of pointers that either locate a function in this dll, or + forward the call to another dll. Something like: + typedef union { + long export_rva; + long forwarder_rva; + } export_address_table_entry; + */ + + fprintf (file, + _("\nExport Address Table -- Ordinal Base %ld\n"), + edt.base); + + for (i = 0; i < edt.num_functions; ++i) + { + bfd_vma eat_member = bfd_get_32 (abfd, + data + edt.eat_addr + (i * 4) - adj); + if (eat_member == 0) + continue; + + if (eat_member - adj <= datasize) + { + /* This rva is to a name (forwarding function) in our section. */ + /* Should locate a function descriptor. */ + fprintf (file, + "\t[%4ld] +base[%4ld] %04lx %s -- %s\n", + (long) i, + (long) (i + edt.base), + (unsigned long) eat_member, + _("Forwarder RVA"), + data + eat_member - adj); + } + else + { + /* Should locate a function descriptor in the reldata section. */ + fprintf (file, + "\t[%4ld] +base[%4ld] %04lx %s\n", + (long) i, + (long) (i + edt.base), + (unsigned long) eat_member, + _("Export RVA")); + } + } + + /* The Export Name Pointer Table is paired with the Export Ordinal Table. */ + /* Dump them in parallel for clarity. */ + fprintf (file, + _("\n[Ordinal/Name Pointer] Table\n")); + + for (i = 0; i < edt.num_names; ++i) + { + bfd_vma name_ptr = bfd_get_32 (abfd, + data + + edt.npt_addr + + (i*4) - adj); + + char *name = (char *) data + name_ptr - adj; + + bfd_vma ord = bfd_get_16 (abfd, + data + + edt.ot_addr + + (i*2) - adj); + fprintf (file, + "\t[%4ld] %s\n", (long) ord, name); + } + + free (data); + + return true; +} + +/* This really is architecture dependent. On IA-64, a .pdata entry + consists of three dwords containing relative virtual addresses that + specify the start and end address of the code range the entry + covers and the address of the corresponding unwind info data. */ + +static boolean +pe_print_pdata (abfd, vfile) + bfd *abfd; + PTR vfile; +{ +#ifdef COFF_WITH_pep +# define PDATA_ROW_SIZE (3*8) +#else +# define PDATA_ROW_SIZE (5*4) +#endif + FILE *file = (FILE *) vfile; + bfd_byte *data = 0; + asection *section = bfd_get_section_by_name (abfd, ".pdata"); + bfd_size_type datasize = 0; + bfd_size_type i; + bfd_size_type start, stop; + int onaline = PDATA_ROW_SIZE; + + if (section == NULL + || coff_section_data (abfd, section) == NULL + || pei_section_data (abfd, section) == NULL) + return true; + + stop = pei_section_data (abfd, section)->virt_size; + if ((stop % onaline) != 0) + fprintf (file, + _("Warning, .pdata section size (%ld) is not a multiple of %d\n"), + (long) stop, onaline); + + fprintf (file, + _("\nThe Function Table (interpreted .pdata section contents)\n")); +#ifdef COFF_WITH_pep + fprintf (file, + _(" vma:\t\t\tBegin Address End Address Unwind Info\n")); +#else + fprintf (file, + _(" vma:\t\tBegin End EH EH PrologEnd Exception\n")); + fprintf (file, + _(" \t\tAddress Address Handler Data Address Mask\n")); +#endif + + if (bfd_section_size (abfd, section) == 0) + return true; + + data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section)); + datasize = bfd_section_size (abfd, section); + if (data == NULL && datasize != 0) + return false; + + bfd_get_section_contents (abfd, + section, + (PTR) data, 0, + bfd_section_size (abfd, section)); + + start = 0; + + for (i = start; i < stop; i += onaline) + { + bfd_vma begin_addr; + bfd_vma end_addr; + bfd_vma eh_handler; + bfd_vma eh_data; + bfd_vma prolog_end_addr; + int em_data; + + if (i + PDATA_ROW_SIZE > stop) + break; + + begin_addr = GET_PDATA_ENTRY (abfd, data + i ); + end_addr = GET_PDATA_ENTRY (abfd, data + i + 4); + eh_handler = GET_PDATA_ENTRY (abfd, data + i + 8); + eh_data = GET_PDATA_ENTRY (abfd, data + i + 12); + prolog_end_addr = GET_PDATA_ENTRY (abfd, data + i + 16); + + if (begin_addr == 0 && end_addr == 0 && eh_handler == 0 + && eh_data == 0 && prolog_end_addr == 0) + { + /* We are probably into the padding of the section now. */ + break; + } + + em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3); + eh_handler &= ~(bfd_vma) 0x3; + prolog_end_addr &= ~(bfd_vma) 0x3; + + fputc (' ', file); + fprintf_vma (file, i + section->vma); fputc ('\t', file); + fprintf_vma (file, begin_addr); fputc (' ', file); + fprintf_vma (file, end_addr); fputc (' ', file); + fprintf_vma (file, eh_handler); +#ifndef COFF_WITH_pep + fputc (' ', file); + fprintf_vma (file, eh_data); fputc (' ', file); + fprintf_vma (file, prolog_end_addr); + fprintf (file, " %x", em_data); +#endif + +#ifdef POWERPC_LE_PE + if (eh_handler == 0 && eh_data != 0) + { + /* Special bits here, although the meaning may be a little + mysterious. The only one I know for sure is 0x03. */ + /* Code Significance */ + /* 0x00 None */ + /* 0x01 Register Save Millicode */ + /* 0x02 Register Restore Millicode */ + /* 0x03 Glue Code Sequence */ + switch (eh_data) + { + case 0x01: + fprintf (file, _(" Register save millicode")); + break; + case 0x02: + fprintf (file, _(" Register restore millicode")); + break; + case 0x03: + fprintf (file, _(" Glue code sequence")); + break; + default: + break; + } + } +#endif + fprintf (file, "\n"); + } + + free (data); + + return true; +} + +#define IMAGE_REL_BASED_HIGHADJ 4 +static const char * const tbl[] = { + "ABSOLUTE", + "HIGH", + "LOW", + "HIGHLOW", + "HIGHADJ", + "MIPS_JMPADDR", + "SECTION", + "REL32", + "RESERVED1", + "MIPS_JMPADDR16", + "DIR64", + "HIGH3ADJ" + "UNKNOWN", /* MUST be last */ +}; + +static boolean +pe_print_reloc (abfd, vfile) + bfd *abfd; + PTR vfile; +{ + FILE *file = (FILE *) vfile; + bfd_byte *data = 0; + asection *section = bfd_get_section_by_name (abfd, ".reloc"); + bfd_size_type datasize = 0; + bfd_size_type i; + bfd_size_type start, stop; + + if (section == NULL) + return true; + + if (bfd_section_size (abfd, section) == 0) + return true; + + fprintf (file, + _("\n\nPE File Base Relocations (interpreted .reloc section contents)\n")); + + data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section)); + datasize = bfd_section_size (abfd, section); + if (data == NULL && datasize != 0) + return false; + + bfd_get_section_contents (abfd, + section, + (PTR) data, 0, + bfd_section_size (abfd, section)); + + start = 0; + + stop = bfd_section_size (abfd, section); + + for (i = start; i < stop;) + { + int j; + bfd_vma virtual_address; + long number, size; + + /* The .reloc section is a sequence of blocks, with a header consisting + of two 32 bit quantities, followed by a number of 16 bit entries */ + + virtual_address = bfd_get_32 (abfd, data+i); + size = bfd_get_32 (abfd, data+i+4); + number = (size - 8) / 2; + + if (size == 0) + { + break; + } + + fprintf (file, + _("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"), + (unsigned long) virtual_address, size, size, number); + + for (j = 0; j < number; ++j) + { + unsigned short e = bfd_get_16 (abfd, data + i + 8 + j * 2); + unsigned int t = (e & 0xF000) >> 12; + int off = e & 0x0FFF; + + if (t >= sizeof (tbl) / sizeof (tbl[0])) + t = (sizeof (tbl) / sizeof (tbl[0])) - 1; + + fprintf (file, + _("\treloc %4d offset %4x [%4lx] %s"), + j, off, (long) (off + virtual_address), tbl[t]); + + /* HIGHADJ takes an argument, - the next record *is* the + low 16 bits of addend. */ + if (t == IMAGE_REL_BASED_HIGHADJ) + { + fprintf (file, " (%4x)", + ((unsigned int) + bfd_get_16 (abfd, data + i + 8 + j * 2 + 2))); + j++; + } + + fprintf (file, "\n"); + } + i += size; + } + + free (data); + + return true; +} + +/* Print out the program headers. */ + +boolean +_bfd_XX_print_private_bfd_data_common (abfd, vfile) + bfd *abfd; + PTR vfile; +{ + FILE *file = (FILE *) vfile; + int j; + pe_data_type *pe = pe_data (abfd); + struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr; + const char *subsystem_name = NULL; + + /* The MS dumpbin program reportedly ands with 0xff0f before + printing the characteristics field. Not sure why. No reason to + emulate it here. */ + fprintf (file, _("\nCharacteristics 0x%x\n"), pe->real_flags); +#undef PF +#define PF(x, y) if (pe->real_flags & x) { fprintf (file, "\t%s\n", y); } + PF (F_RELFLG, "relocations stripped"); + PF (F_EXEC, "executable"); + PF (F_LNNO, "line numbers stripped"); + PF (F_LSYMS, "symbols stripped"); + PF (0x80, "little endian"); + PF (F_AR32WR, "32 bit words"); + PF (0x200, "debugging information removed"); + PF (0x1000, "system file"); + PF (F_DLL, "DLL"); + PF (0x8000, "big endian"); +#undef PF + + /* ctime implies '\n'. */ + fprintf (file, "\nTime/Date\t\t%s", ctime (&pe->coff.timestamp)); + fprintf (file, "\nImageBase\t\t"); + fprintf_vma (file, i->ImageBase); + fprintf (file, "\nSectionAlignment\t"); + fprintf_vma (file, i->SectionAlignment); + fprintf (file, "\nFileAlignment\t\t"); + fprintf_vma (file, i->FileAlignment); + fprintf (file, "\nMajorOSystemVersion\t%d\n", i->MajorOperatingSystemVersion); + fprintf (file, "MinorOSystemVersion\t%d\n", i->MinorOperatingSystemVersion); + fprintf (file, "MajorImageVersion\t%d\n", i->MajorImageVersion); + fprintf (file, "MinorImageVersion\t%d\n", i->MinorImageVersion); + fprintf (file, "MajorSubsystemVersion\t%d\n", i->MajorSubsystemVersion); + fprintf (file, "MinorSubsystemVersion\t%d\n", i->MinorSubsystemVersion); + fprintf (file, "Win32Version\t\t%08lx\n", i->Reserved1); + fprintf (file, "SizeOfImage\t\t%08lx\n", i->SizeOfImage); + fprintf (file, "SizeOfHeaders\t\t%08lx\n", i->SizeOfHeaders); + fprintf (file, "CheckSum\t\t%08lx\n", i->CheckSum); + switch (i->Subsystem) + { + case IMAGE_SUBSYSTEM_UNKNOWN: + subsystem_name = "unspecified"; + break; + case IMAGE_SUBSYSTEM_NATIVE: + subsystem_name = "NT native"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_GUI: + subsystem_name = "Windows GUI"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_CUI: + subsystem_name = "Windows CUI"; + break; + case IMAGE_SUBSYSTEM_POSIX_CUI: + subsystem_name = "POSIX CUI"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: + subsystem_name = "Wince CUI"; + break; + case IMAGE_SUBSYSTEM_EFI_APPLICATION: + subsystem_name = "EFI application"; + break; + case IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: + subsystem_name = "EFI boot service driver"; + break; + case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: + subsystem_name = "EFI runtime driver"; + break; + } + fprintf (file, "Subsystem\t\t%08x", i->Subsystem); + if (subsystem_name) + fprintf (file, "\t(%s)", subsystem_name); + fprintf (file, "\nDllCharacteristics\t%08x\n", i->DllCharacteristics); + fprintf (file, "SizeOfStackReserve\t"); + fprintf_vma (file, i->SizeOfStackReserve); + fprintf (file, "\nSizeOfStackCommit\t"); + fprintf_vma (file, i->SizeOfStackCommit); + fprintf (file, "\nSizeOfHeapReserve\t"); + fprintf_vma (file, i->SizeOfHeapReserve); + fprintf (file, "\nSizeOfHeapCommit\t"); + fprintf_vma (file, i->SizeOfHeapCommit); + fprintf (file, "\nLoaderFlags\t\t%08lx\n", i->LoaderFlags); + fprintf (file, "NumberOfRvaAndSizes\t%08lx\n", i->NumberOfRvaAndSizes); + + fprintf (file, "\nThe Data Directory\n"); + for (j = 0; j < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; j++) + { + fprintf (file, "Entry %1x ", j); + fprintf_vma (file, i->DataDirectory[j].VirtualAddress); + fprintf (file, " %08lx ", i->DataDirectory[j].Size); + fprintf (file, "%s\n", dir_names[j]); + } + + pe_print_idata (abfd, vfile); + pe_print_edata (abfd, vfile); + pe_print_pdata (abfd, vfile); + pe_print_reloc (abfd, vfile); + + return true; +} + +/* Copy any private info we understand from the input bfd + to the output bfd. */ + +boolean +_bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd) + bfd *ibfd, *obfd; +{ + /* One day we may try to grok other private data. */ + if (ibfd->xvec->flavour != bfd_target_coff_flavour + || obfd->xvec->flavour != bfd_target_coff_flavour) + return true; + + pe_data (obfd)->pe_opthdr = pe_data (ibfd)->pe_opthdr; + pe_data (obfd)->dll = pe_data (ibfd)->dll; + + /* for strip: if we removed .reloc, we'll make a real mess of things + if we don't remove this entry as well. */ + if (! pe_data (obfd)->has_reloc_section) + { + pe_data (obfd)->pe_opthdr.DataDirectory[5].VirtualAddress = 0; + pe_data (obfd)->pe_opthdr.DataDirectory[5].Size = 0; + } + return true; +} + +/* Copy private section data. */ +boolean +_bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) + bfd *ibfd; + asection *isec; + bfd *obfd; + asection *osec; +{ + if (bfd_get_flavour (ibfd) != bfd_target_coff_flavour + || bfd_get_flavour (obfd) != bfd_target_coff_flavour) + return true; + + if (coff_section_data (ibfd, isec) != NULL + && pei_section_data (ibfd, isec) != NULL) + { + if (coff_section_data (obfd, osec) == NULL) + { + osec->used_by_bfd = + (PTR) bfd_zalloc (obfd, sizeof (struct coff_section_tdata)); + if (osec->used_by_bfd == NULL) + return false; + } + if (pei_section_data (obfd, osec) == NULL) + { + coff_section_data (obfd, osec)->tdata = + (PTR) bfd_zalloc (obfd, sizeof (struct pei_section_tdata)); + if (coff_section_data (obfd, osec)->tdata == NULL) + return false; + } + pei_section_data (obfd, osec)->virt_size = + pei_section_data (ibfd, isec)->virt_size; + pei_section_data (obfd, osec)->pe_flags = + pei_section_data (ibfd, isec)->pe_flags; + } + + return true; +} + +void +_bfd_XX_get_symbol_info (abfd, symbol, ret) + bfd *abfd; + asymbol *symbol; + symbol_info *ret; +{ + coff_get_symbol_info (abfd, symbol, ret); +#if 0 /* This code no longer appears to be necessary. + ImageBase has already been added in by coff_swap_scnhdr_in. */ + if (pe_data (abfd) != NULL + && ((symbol->flags & BSF_DEBUGGING) == 0 + || (symbol->flags & BSF_DEBUGGING_RELOC) != 0) + && ! bfd_is_abs_section (symbol->section)) + ret->value += pe_data (abfd)->pe_opthdr.ImageBase; +#endif +} + +/* Handle the .idata section and other things that need symbol table + access. */ + +boolean +_bfd_XXi_final_link_postscript (abfd, pfinfo) + bfd *abfd; + struct coff_final_link_info *pfinfo; +{ + struct coff_link_hash_entry *h1; + struct bfd_link_info *info = pfinfo->info; + + /* There are a few fields that need to be filled in now while we + have symbol table access. + + The .idata subsections aren't directly available as sections, but + they are in the symbol table, so get them from there. */ + + /* The import directory. This is the address of .idata$2, with size + of .idata$2 + .idata$3. */ + h1 = coff_link_hash_lookup (coff_hash_table (info), + ".idata$2", false, false, true); + if (h1 != NULL) + { + pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset); + h1 = coff_link_hash_lookup (coff_hash_table (info), + ".idata$4", false, false, true); + pe_data (abfd)->pe_opthdr.DataDirectory[1].Size = + ((h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset) + - pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress); + + /* The import address table. This is the size/address of + .idata$5. */ + h1 = coff_link_hash_lookup (coff_hash_table (info), + ".idata$5", false, false, true); + pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress = + (h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset); + h1 = coff_link_hash_lookup (coff_hash_table (info), + ".idata$6", false, false, true); + pe_data (abfd)->pe_opthdr.DataDirectory[12].Size = + ((h1->root.u.def.value + + h1->root.u.def.section->output_section->vma + + h1->root.u.def.section->output_offset) + - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress); + } + + /* If we couldn't find idata$2, we either have an excessively + trivial program or are in DEEP trouble; we have to assume trivial + program.... */ + return true; +} diff --git a/contrib/binutils/bfd/po/Make-in b/contrib/binutils/bfd/po/Make-in index 0552db1..2414748 100644 --- a/contrib/binutils/bfd/po/Make-in +++ b/contrib/binutils/bfd/po/Make-in @@ -46,10 +46,16 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) SOURCES = cat-id-tbl.c POFILES = @POFILES@ GMOFILES = @GMOFILES@ -DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +DISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \ stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) -POTFILES = \ +# Note - the following line gets processed by bfd/configure and amended +# to contain the full list of source dir POTFILES. +SRC-POTFILES = \ + +# Note - the following line gets processed by bfd/configure and amended +# to contain the full list of build dir POTFILES. +BLD-POTFILES = \ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ @@ -82,10 +88,17 @@ all: all-@USE_NLS@ all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot all-no: -$(srcdir)/$(PACKAGE).pot: $(POTFILES) - $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ +$(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) \ + --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/SRC-POTFILES.in + $(XGETTEXT) --default-domain=$(PACKAGE) \ + --directory=.. \ + --directory=. \ --add-comments --keyword=_ --keyword=N_ \ - --files-from=$(srcdir)/POTFILES.in + --join-existing \ + --files-from=$(srcdir)/BLD-POTFILES.in rm -f $(srcdir)/$(PACKAGE).pot mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot @@ -191,7 +204,8 @@ mostlyclean: clean: mostlyclean distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m + rm -f SRC-POTFILES BLD-POTFILES SRC-POTFILES.in BLD-POTFILES.in maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @@ -225,23 +239,48 @@ update-po: Makefile fi; \ done -POTFILES: POTFILES.in +SRC-POTFILES: SRC-POTFILES.in ( if test 'x$(srcdir)' != 'x.'; then \ posrcprefix='$(top_srcdir)/'; \ else \ posrcprefix="../"; \ fi; \ rm -f $@-t $@ \ - && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + && (sed -e '/^#/d' \ + -e '/^[ ]*$$/d' \ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ | sed -e '$$s/\\$$//') > $@-t \ && chmod a-w $@-t \ && mv $@-t $@ ) -POTFILES.in: @MAINT@ ../Makefile - cd .. && $(MAKE) po/POTFILES.in +BLD-POTFILES: BLD-POTFILES.in + ( rm -f $@-t $@ \ + && (sed -e '/^#/d' \ + -e '/^[ ]*$$/d' \ + -e "s@.*@ ../& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +SRC-POTFILES.in: @MAINT@ ../Makefile + cd .. && $(MAKE) po/SRC-POTFILES.in -Makefile: Make-in ../config.status POTFILES +BLD-POTFILES.in: @MAINT@ ../Makefile + cd .. && $(MAKE) po/BLD-POTFILES.in + +# Note - The presence of SRC-POTFILES and BLD-POTFILES as dependencies +# here breaks the implementation of the 'distclean' rule for maintainers. +# This is because if 'make distclean' is run in the BFD directory, the +# Makefile there will be deleted before 'distclean' is made here, and so +# the dependency SRC-POTFILES -> SRC-POTFILES.in -> ../Makefile cannot +# be satisfied. +# +# The SRC-POTFILES and BLD-POTFILES dependencies cannot be removed, +# however since it is necessary that these files be built during +# *configure* time, so that configure can insert them into the +# po/Makefile that it is creating, so that the Makefile will have +# the correct dependencies. +Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES cd .. \ && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \ CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/contrib/binutils/bfd/ppcboot.c b/contrib/binutils/bfd/ppcboot.c index d92a0a6..b2250a0 100644 --- a/contrib/binutils/bfd/ppcboot.c +++ b/contrib/binutils/bfd/ppcboot.c @@ -1,5 +1,6 @@ /* BFD back-end for PPCbug boot records. - Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/ptrace-core.c b/contrib/binutils/bfd/ptrace-core.c index 2c19f6d..704391a 100644 --- a/contrib/binutils/bfd/ptrace-core.c +++ b/contrib/binutils/bfd/ptrace-core.c @@ -1,5 +1,6 @@ /* BFD backend for core files which use the ptrace_user structure - Copyright 1993, 94, 95, 96, 1998 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001 + Free Software Foundation, Inc. The structure of this file is based on trad-core.c written by John Gilmore of Cygnus Support. Modified to work with the ptrace_user structure by Kevin A. Buettner. diff --git a/contrib/binutils/bfd/reloc.c b/contrib/binutils/bfd/reloc.c index f37a6a9..1c45f6f 100644 --- a/contrib/binutils/bfd/reloc.c +++ b/contrib/binutils/bfd/reloc.c @@ -1,5 +1,6 @@ /* BFD support for handling relocation entries. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -1799,7 +1800,11 @@ ENUMX ENUMX BFD_RELOC_SPARC_RELATIVE ENUMX + BFD_RELOC_SPARC_UA16 +ENUMX BFD_RELOC_SPARC_UA32 +ENUMX + BFD_RELOC_SPARC_UA64 ENUMDOC SPARC ELF relocations. There is probably some overlap with other relocation types already defined. @@ -2036,6 +2041,28 @@ ENUMX BFD_RELOC_MIPS_GOT_OFST ENUMX BFD_RELOC_MIPS_GOT_DISP +ENUMX + BFD_RELOC_MIPS_SHIFT5 +ENUMX + BFD_RELOC_MIPS_SHIFT6 +ENUMX + BFD_RELOC_MIPS_INSERT_A +ENUMX + BFD_RELOC_MIPS_INSERT_B +ENUMX + BFD_RELOC_MIPS_DELETE +ENUMX + BFD_RELOC_MIPS_HIGHEST +ENUMX + BFD_RELOC_MIPS_HIGHER +ENUMX + BFD_RELOC_MIPS_SCN_DISP +ENUMX + BFD_RELOC_MIPS_REL16 +ENUMX + BFD_RELOC_MIPS_RELGOT +ENUMX + BFD_RELOC_MIPS_JALR COMMENT ENUMDOC MIPS ELF relocations. diff --git a/contrib/binutils/bfd/reloc16.c b/contrib/binutils/bfd/reloc16.c index cb9636f..7de8d95 100644 --- a/contrib/binutils/bfd/reloc16.c +++ b/contrib/binutils/bfd/reloc16.c @@ -1,5 +1,5 @@ /* 8 and 16 bit COFF relocation functions, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/sco5-core.c b/contrib/binutils/bfd/sco5-core.c index 5d5677e..62f9c98 100644 --- a/contrib/binutils/bfd/sco5-core.c +++ b/contrib/binutils/bfd/sco5-core.c @@ -1,5 +1,5 @@ /* BFD back end for SCO5 core files (U-area and raw sections) - Copyright 1998 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. Written by Jouke Numan This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/section.c b/contrib/binutils/bfd/section.c index 13e10d3..fc03ce9 100644 --- a/contrib/binutils/bfd/section.c +++ b/contrib/binutils/bfd/section.c @@ -1,5 +1,6 @@ /* Object file "section" support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -362,6 +363,10 @@ CODE_FRAGMENT . {* A mark flag used by some of the linker backends. *} . unsigned int linker_mark : 1; . +. {* Another mark flag used by some of the linker backends. Set for +. output sections that have a input section. *} +. unsigned int linker_has_input : 1; +. . {* A mark flag used by some linker backends for garbage collection. *} . unsigned int gc_mark : 1; . @@ -564,11 +569,14 @@ static const asymbol global_syms[] = /* name, id, index, next, flags, user_set_vma, reloc_done, */ \ { NAME, IDX, 0, NULL, FLAGS, 0, 0, \ \ - /* linker_mark, gc_mark, segment_mark, vma, lma, _cooked_size, */ \ - 0, 1, 0, 0, 0, 0, \ + /* linker_mark, linker_has_input, gc_mark, segment_mark, */ \ + 0, 0, 1, 0, \ + \ + /* vma, lma, _cooked_size, _raw_size, */ \ + 0, 0, 0, 0, \ \ - /* _raw_size, output_offset, output_section, alignment_power, */ \ - 0, 0, (struct sec *) &SEC, 0, \ + /* output_offset, output_section, alignment_power, */ \ + 0, (struct sec *) &SEC, 0, \ \ /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ NULL, NULL, 0, 0, 0, \ @@ -1203,6 +1211,11 @@ _bfd_strip_section_from_output (info, s) orders have not yet been set up. So why are we checking them? -- Ian */ os = s->output_section; + + /* Handle a section that wasn't output. */ + if (os == NULL) + return; + for (p = os->link_order_head, pp = NULL; p != NULL; pp = p, p = p->next) if (p->type == bfd_indirect_link_order && p->u.indirect.section == s) diff --git a/contrib/binutils/bfd/sparclinux.c b/contrib/binutils/bfd/sparclinux.c index 57bf6c6..b877018 100644 --- a/contrib/binutils/bfd/sparclinux.c +++ b/contrib/binutils/bfd/sparclinux.c @@ -1,5 +1,5 @@ /* BFD back-end for linux flavored sparc a.out binaries. - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/sparcnetbsd.c b/contrib/binutils/bfd/sparcnetbsd.c index c21f063..9cb9637 100644 --- a/contrib/binutils/bfd/sparcnetbsd.c +++ b/contrib/binutils/bfd/sparcnetbsd.c @@ -1,5 +1,6 @@ /* BFD back-end for NetBSD/sparc a.out-ish binaries. - Copyright (C) 1990, 91, 92, 94, 95, 97, 1998 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/srec.c b/contrib/binutils/bfd/srec.c index 5602239..33dfaa7 100644 --- a/contrib/binutils/bfd/srec.c +++ b/contrib/binutils/bfd/srec.c @@ -1,5 +1,6 @@ /* BFD back-end for s-record objects. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . diff --git a/contrib/binutils/bfd/stab-syms.c b/contrib/binutils/bfd/stab-syms.c index 4b0827f..a685e31 100644 --- a/contrib/binutils/bfd/stab-syms.c +++ b/contrib/binutils/bfd/stab-syms.c @@ -1,5 +1,6 @@ /* Table of stab names for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 2000 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/stabs.c b/contrib/binutils/bfd/stabs.c index eb9ce8a..15b1af5 100644 --- a/contrib/binutils/bfd/stabs.c +++ b/contrib/binutils/bfd/stabs.c @@ -1,5 +1,5 @@ /* Stabs in sections linking support. - Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c index 8f4c92f..311806e 100644 --- a/contrib/binutils/bfd/syms.c +++ b/contrib/binutils/bfd/syms.c @@ -1,5 +1,6 @@ /* Generic symbol-table support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/sysdep.h b/contrib/binutils/bfd/sysdep.h index e344eaf..bab1c51 100644 --- a/contrib/binutils/bfd/sysdep.h +++ b/contrib/binutils/bfd/sysdep.h @@ -1,5 +1,6 @@ /* sysdep.h -- handle host dependencies for the BFD library - Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c index 8f831f0..cfbe6ad 100644 --- a/contrib/binutils/bfd/targets.c +++ b/contrib/binutils/bfd/targets.c @@ -1,5 +1,6 @@ /* Generic target-file-type support for the BFD library. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -560,6 +561,8 @@ extern const bfd_target bfd_elf64_ia64_big_vec; extern const bfd_target bfd_elf64_ia64_little_vec; extern const bfd_target bfd_elf64_little_generic_vec; extern const bfd_target bfd_elf64_littlemips_vec; +extern const bfd_target bfd_elf64_tradbigmips_vec; +extern const bfd_target bfd_elf64_tradlittlemips_vec; extern const bfd_target bfd_elf64_sparc_vec; extern const bfd_target bfd_elf64_x86_64_vec; extern const bfd_target bfd_powerpc_pe_vec; @@ -682,7 +685,7 @@ extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; extern const bfd_target ptrace_core_vec; -const bfd_target * const bfd_target_vector[] = { +static const bfd_target * const _bfd_target_vector[] = { #ifdef SELECT_VECS @@ -762,18 +765,21 @@ const bfd_target * const bfd_target_vector[] = { &bfd_elf32_m68hc12_vec, &bfd_elf32_m68k_vec, &bfd_elf32_m88k_vec, - &bfd_elf32_sparc_vec, &bfd_elf32_pj_vec, &bfd_elf32_pjl_vec, &bfd_elf32_powerpc_vec, &bfd_elf32_powerpcle_vec, + &bfd_elf32_sparc_vec, &bfd_elf32_v850_vec, &bfd_elf32_fr30_vec, &bfd_elf32_mcore_big_vec, &bfd_elf32_mcore_little_vec, &bfd_elf32_tradbigmips_vec, &bfd_elf32_tradlittlemips_vec, -#ifdef BFD64 /* No one seems to use this. */ +#ifdef BFD64 + &bfd_elf64_tradbigmips_vec, + &bfd_elf64_tradlittlemips_vec, + /* No one seems to use this. */ &bfd_elf64_big_generic_vec, &bfd_elf64_little_generic_vec, #endif @@ -971,6 +977,7 @@ const bfd_target * const bfd_target_vector[] = { NULL /* end of list marker */ }; +const bfd_target * const *bfd_target_vector = _bfd_target_vector; /* bfd_default_vector[0] contains either the address of the default vector, if there is one, or zero if there isn't. */ @@ -985,7 +992,7 @@ const bfd_target *bfd_default_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. */ -const size_t _bfd_target_vector_entries = sizeof (bfd_target_vector)/sizeof (*bfd_target_vector); +const size_t _bfd_target_vector_entries = sizeof (_bfd_target_vector)/sizeof (*_bfd_target_vector); /* This array maps configuration triplets onto BFD vectors. */ diff --git a/contrib/binutils/bfd/tekhex.c b/contrib/binutils/bfd/tekhex.c index e5fa95a..ccfe7d8 100644 --- a/contrib/binutils/bfd/tekhex.c +++ b/contrib/binutils/bfd/tekhex.c @@ -1,5 +1,5 @@ /* BFD backend for Extended Tektronix Hex Format objects. - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . diff --git a/contrib/binutils/bfd/trad-core.c b/contrib/binutils/bfd/trad-core.c index 194da15..872ad54 100644 --- a/contrib/binutils/bfd/trad-core.c +++ b/contrib/binutils/bfd/trad-core.c @@ -1,5 +1,6 @@ /* BFD back end for traditional Unix core files (U-area and raw sections) - Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 98, 99, 2000 + Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, + 2000 Free Software Foundation, Inc. Written by John Gilmore of Cygnus Support. -- cgit v1.1