diff options
Diffstat (limited to 'contrib/binutils/bfd')
125 files changed, 22339 insertions, 15032 deletions
diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog index 638ea67..380d1ff 100644 --- a/contrib/binutils/bfd/ChangeLog +++ b/contrib/binutils/bfd/ChangeLog @@ -1,10 +1,1015 @@ +2001-03-31 Philip Blundell <philb@gnu.org> + + From 2001-03-26 H.J. Lu <hjl@gnu.org> + * elf32-gen.c (elf32_generic_link_add_symbols): New. Check + if there are any relocations for generic ELF. + (bfd_elf32_bfd_link_add_symbols): Defined to + elf32_generic_link_add_symbols. + * elf64-gen.c (elf64_generic_link_add_symbols): New. Check + if there are any relocations for generic ELF. + (bfd_elf64_bfd_link_add_symbols): Defined to + elf64_generic_link_add_symbols. + +2001-03-21 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (elf32_hppa_set_gp): Check sec->output_section + non-NULL before attempting to dereference. + +2001-03-20 Andreas Schwab <schwab@suse.de> + + * elf32-m68k.c (elf_m68k_relocate_section): Don't need the + relocation value when resolving a reference from a debugging + section. + +2001-03-16 Philip Blundell <philb@gnu.org> + + * configure: Regenerate. + +2001-03-16 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Add maybe_pic_call. + (hppa_link_hash_newfunc): Init it. + (hppa_type_of_stub): Only use non-PIC to PIC call stub if caller + section appears to be non-PIC. + (final_link_relocate): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Set maybe_pic_call for any + possible candidate function, and set pic_call for those that will + only have a .plt entry for the PIC call stub. + (hppa_handle_PIC_calls): Set maybe_pic_call. + + * elf32-hppa.c: Correct field selector in stub comments. + (clobber_millicode_symbols): Formatting fix. + +2001-03-11 Philip Blundell <philb@gnu.org> + + * configure.in: Set version to 2.11. + + * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make PLT + entries that could serve as a definition for a weak symbol. + +2001-03-07 Andreas Jaeger <aj@suse.de> + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix handling of + some relocation values. + +2001-02-28 Andreas Jaeger <aj@suse.de> + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Add relocation + to addend. + +2001-02-26 Andreas Jaeger <aj@suse.de> + + * elf64-x86-64.c (x86_64_elf_howto_table): Fix order of entries. + +2001-02-21 David Mosberger <davidm@hpl.hp.com> + + * cpu-ia64-opc.c (elf64_ia64_operands}: Fix typo: error string for + C8 said "1" instead of "8". Clarify error string for IMM22: + "signed integer" instead of just "integer". + +2001-02-20 Andreas Jaeger <aj@suse.de> + + * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Don't make + PLT entries that could serve as a definition for a weak symbol. + +2001-02-18 David O'Brien <obrien@FreeBSD> + + * configure.in: Recognize FreeBSD/arm, FreeBSD/PowerPC, and treat + FreeBSD/i386-CURRENT differently until I can figure out the needed + corefile changes. + * configure: Regenerate. + * config.bfd: Recognize FreeBSD/x86-64, FreeBSD/ia64, FreeBSD/arm, + FreeBSD/PowerPC, and FreeBSD/sparc64. + +2001-02-14 Philip Blundell <pb@futuretv.com> + + From 2001-02-06 H.J. Lu <hjl@gnu.org> + * bfd/peicode.h (coff_swap_filehdr_in): Remove the e_magic + checking. + (pe_bfd_object_p): Rewrite with external_PEI_DOS_hdr and + external_PEI_IMAGE_hdr. + +2001-02-14 Bo Thorsen <bo@suse.de> + + * elf64-x86-64.c: Small formatting fixes and rearrangements of code. + (elf64_86_64_size_info): Struct added to fix a problem + with the hashtable string entries. + (elf64_x86_64_adjust_dynamic_symbol): Add generation of .got.plt. + (elf64_x86_64_size_dynamic_sections): A FIXME removed. + (elf64_x86_64_size_dynamic_sections): Fix a dynamic entry and + remove the FIXME for this. + (elf64_x86_64_adjust_dynamic_symbol): Fix check for unneeded .plt + section. Also removed the FIXME for it. + (x86_64_elf_howto_table): Use bfd_elf_generic_reloc. + (ELF_DYNAMIC_INTERPRETER): Fix the name of the dynamic linker. + (elf64_x86_64_finish_dynamic_sections): Enable .got.plt writing. + +2001-02-14 Philip Blundell <pb@futuretv.com> + + From 2001-02-08 H.J. Lu <hjl@gnu.org> + * elf32-i386.c (elf_i386_check_relocs): Reserve R_386_32 + relocation entries for weak definitions when building DSO with + -Bsymbolic. + +2001-02-13 Richard Henderson <rth@redhat.com> + + * elfxx-ia64.c (elfNN_ia64_final_link): Set __gp if required + and not user provided. + +2001-02-13 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (elf32_hppa_set_gp): Handle weak $global$. If + $global$ referenced but not defined, set its value here. + +2001-02-09 Bo Thorsen <bo@suse.de> + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Set .rela.got section + alignment to 3. + (elf64_x86_64_check_relocs): Write R_X86_64_GOTPCREL GOT entry + and relocation. + (elf64_x86_64_relocate_section): Fix formatting. + (elf64_x86_64_relocate_section): Fix addend for relocation of + R_X86_64_(8|16|32|PC8|PC16|PC32). + +Mon Feb 12 17:44:39 CET 2001 Jan Hubicka <jh@suse.cz> + + * elf64-x86-64.c (x86_64_elf_howto): Fix name of R_X86_64_GOTPCREL. + +2001-02-10 Nick Clifton <nickc@redhat.com> + + * elf32-v850.c (v850_elf_reloc): Do not convert reloc addend to PC + rel, it will be handled later on. + +2001-02-09 David Mosberger <davidm@hpl.hp.com> + + * elfxx-ia64.c (is_unwind_section_name): New function. Returns + true if section name is an unwind table section name. + (elfNN_ia64_additional_program_headers): Count each unwind section + separately. + (elfNN_ia64_modify_segment_map): Install one unwind program header + for each unwind separate section. Note: normally the linker + script merges the unwind sections that go into a single segment, + so this still generates at most one unwind program header per + segment. + + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Accept any section + name for SHT_IA_64_UNWIND, not just .IA_64.unwind. + (elfNN_ia64_fake_sections): Mark sections with names that start + with .IA_64.unwind but not with .IA_64.unwind_info as an IA-64 + unwind section. + + * elfxx-ia64.c (elfNN_ia64_final_write_processing): New function. + Use it to make sh_info in unwind section point to the text section + it applies to. + +2001-02-07 Mark Elbrecht <snowball3@bigfoot.com> + + * coffgen.c (coff_find_nearest_line): If stabs info is successfully + found, do not attempt to find dwarf2 info before returning. + +2001-01-30 Alan Modra <alan@linuxcare.com.au> + + * elf64-hppa.c (elf64_hppa_elf_get_symbol_type): New function. + (elf_backend_get_symbol_type): Define. + (elf64_hppa_object_p): Set architecture and machine from elf + header flags. + +2001-01-30 Curtis L. Janssen <cljanss@ca.sandia.gov> + + * elf64-alpha.c (elf64_alpha_find_nearest_line): Query dwarf2 + before mdebug. + +2001-01-26 Richard Henderson <rth@redhat.com> + + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Return false + for non-default visibility. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise, but + delete ugly macro and replace with pretty function. + +2001-01-25 Mark Elbrecht <snowball3@bigfoot.com> + + * coff-go32.c: Update copyright. + * coff-stgo32.c: Likewise. + * coff-go32.c (COFF_LONG_FILENAMES): Define. + * coff-stgo32.c (COFF_LONG_FILENAMES): Likewise. + * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Remove .bss entry. + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2001-01-25 Kazu Hirata <kazu@hxi.com> + + * bfd-in2.h: Rebuild. + * libbfd.h: Likewise. + +2001-01-23 H.J. Lu <hjl@gnu.org> + + * bfd-in2.h: Rebuild. + +2001-01-23 H.J. Lu <hjl@gnu.org> + + * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_buf) + is NULL or PRIV(vms_rec) is outside of the buffer. + +2001-01-23 Kazu Hirata <kazu@hxi.com> + + * coff64-rs6000.c: Fix formatting. + * coff-arm.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-pmac.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * elf32.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sparc.c: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elfxx-ia64.c: Likewise. + + * aoutx.h: Fix formatting. + * bfd.c: Likewise. + * bfd-in2.h: Likewise. + * bfd-in.h: Likewise. + * cpu-i386.c: Likewise. + * cpu-m68hc11.c: Likewise. + * dwarf2.c: Likewise. + * elf64-x86-64.c: Likewise. + * format.c: Likewise. + * freebsd.h: Likewise. + * hash.c: Likewise. + * hp300hpux.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + +2001-01-22 Bo Thorsen <bo@suse.de> + + * elf64-x86-64.c: Added PIC support for X86-64. + (elf64_x86_64_link_hash_newfunc): Function added. + (elf64_x86_64_link_hash_table_create): Likewise. + (elf64_x86_64_check_relocs): Likewise. + (elf64_x86_64_gc_mark_hook): Likewise. + (elf64_x86_64_gc_sweep_hook): Likewise. + (elf64_x86_64_adjust_dynamic_symbol): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_discard_copies): Likewise. + (elf64_x86_64_finish_dynamic_symbol): Likewise. + (elf64_x86_64_finish_dynamic_sections): Likewise. + (elf64_x86_64_relocate_section): Add relocation of PIC sections. + +2001-01-21 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * Makefile.am (install-data-local): Make use of $(DESTDIR). + * Makefile.in: Regenerate. + +2001-01-21 Kazu Hirata <kazu@hxi.com> + + * coff-a29k.c: Fix formatting. + +2001-01-19 H.J. Lu <hjl@gnu.org> + + * elf32-i386.c (elf_i386_check_relocs): Report files with bad + relocation section names. + (elf_i386_relocate_section): Report files with bad relocation + section names and return false. + +2001-01-17 Bo Thorsen <bo@suse.de> + + * targets.c: Alphabetize list of xvecs. + +2001-01-14 Alan Modra <alan@linuxcare.com.au> + + * config.bfd: Add linux target variant for elfxx-hppa. + * configure.in: Recognize bfd_elf32_hppa_linux_vec and + bfd_elf64_hppa_linux_vec. + * configure: Regenerate. + * elf64-hppa.c: Include elf64-target.h again to support linux + target variant. + (elf64_hppa_post_process_headers): Set ELFOSABI_LINUX for linux. + * elf32-hppa.c: Include elf32-target.h again to support linux + target variant. + (elf32_hppa_post_process_headers): New function. + (elf_backend_post_process_headers): Define. + * targets.c (bfd_target_vector): Add bfd_elf64_hppa_linux_vec and + bfd_elf32_hppa_linux_vec. + + * elf32-hppa.c (elf32_hppa_link_hash_table): Add text_segment_base, + and data_segment_base fields. + (elf32_hppa_link_hash_table_create ): Init them. + (elf32_hppa_check_relocs): Update comments. + (hppa_record_segment_addr): New function. + (elf32_hppa_relocate_section): Call it. + (final_link_relocate): Handle R_PARISC_SEGREL32. + (elf32_hppa_final_link): New function. + (bfd_elf32_bfd_final_link): Define to call it. + (hppa_unwind_entry_compare): New function. + * cache.c (bfd_open_file): Create files in write+read mode. + + * elf-hppa.h (elf_hppa_howto_table): Set bitsize value for + SEGREL32 and numerous other relocs. Change duplicate + R_PARISC_NONE relocs to R_PARISC_UNIMPLEMENTED. + + * opncls.c (bfd_fdopenr): Add parens like the comment says around + O_ACCMODE. + + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Don't create + .plt entries for DT_INIT and DT_FINI. + (elf32_hppa_finish_dynamic_sections): Remove special handling of + DT_INIT and DT_FINI. + + * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Use 16-bit + offsets for stub .plt access if wide mode. Check offset in range. + +2001-01-13 Nick Clifton <nickc@redhat.com> + + * elf32-fr30.c (fr30_elf_howto_table): Remove spurious blank + line. + + * coffcode.h (coff_canonicalize_reloc): Remove spurious blank + line. + +2001-01-12 Alan Modra <alan@linuxcare.com.au> + + * configure.in ([bfd_elf64_x86_64_vec]): Set target64. + * configure: Regenerate. + +2001-01-11 Peter Targett <peter.targett@arccores.com> + + * bfd-in2.h (bfd_architecture): Add bfd_mach_arc_5, + bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8 for ARC variants. + * cpu-arc.c (arch_info_struct): Add entries for variants. + (bfd_arc_arch) Set default to bfd_mach_arc_5. + (arc_get_mach) Don't assume machine names prefixed arc- before + testing. + * elf32-arc.c (arc_elf_object_p): Set machine number based on new + selections. + (arc_elf_final_write_processing) Likewise. + (ELF_MACHINE_CODE) Use EM_ARC. + +2001-01-10 Nick Clifton <nickc@redhat.com> + + * coff-arm.c (LOCAL_LABEL_PREFIX): Change definition to "". + +2001-01-07 Philip Blundell <philb@gnu.org> + + * README: Replace `bug-gnu-utils@gnu.org' with + `bug-binutils@gnu.org'. + +2001-01-04 Kazu Hirata <kazu@hxi.com> + + * som.c: Fix formatting. + +2001-01-03 Kazu Hirata <kazu@hxi.com> + + * ecoffswap.h: Fix formatting. + * elf-bfd.h: Likewise. + * elfarm-nabi.c: Likewise. + * elfarm-oabi.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-target.h: Likewise. + * libbfd.c: Likewise + * linker.c: Likewise. + * lynx-core.c: Likewise. + +2001-01-02 Kazu Hirata <kazu@hxi.com> + + * pc532-mach.c: Fix formatting. + * pe-arm.c: Likewise. + * pe-i386.c: Likewise. + * pe-mips.c: Likewise. + * pe-ppc.c: Likewise. + * pe-sh.c: Likewise. + * pei-mips.c: Likewise. + * pei-sh.c: Likewise. + * peicode.h: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + +2001-01-01 Kazu Hirata <kazu@hxi.com> + + * reloc.c: Fix formatting. + * riscix.c: Likewise. + * rs6000-core.c: Likewise. + * xcoff-target.h: Likewise. + +2000-12-29 Hans-Peter Nilsson <hp@bitrange.com> + + * elfcode.h (elf_object_p): Also restore the bfd mach field on + error, by calling bfd_default_set_arch_mach with incoming + values. + +2000-12-26 Kazu Hirata <kazu@hxi.com> + + * vaxnetbsd.c: Fix formatting. + * versados.c: Likewise. + * vms-gsd.c: Likewise. + * vms-hdr.c: Likewise. + * vms-misc.c: Likewise. + +2000-12-25 Alexandre Oliva <aoliva@redhat.com> + + * archive.c (coff_write_armap): Don't write more than symbol_count + `archive_member_file_ptr's. + +2000-12-25 Kazu Hirata <kazu@hxi.com> + + * vms-tir.c: Fix formatting. + +2000-12-23 Kazu Hirata <kazu@hxi.com> + + * vms.c: Fix formatting. + * vms.h: Likewise. + +2000-12-21 Santeri Paavolainen <santtu@ssh.com> + + * vms-hdr.c: Include alloca.h if HAVE_ALLOCA_H is defined. + + * peicode.h (pe_ILF_object_p): Add const to import of TARGET_LITTLE_SYM. + + * elf32-m32r.c (m32r_elf_generic_reloc): Add cast to avoid (void *) + arithmetic. + + * elf32-fr30.c: Add casts to avoid (void *) arithmetic. + + * coffcode.h (styp_to_sec_flags): Add empty statement after label. + +2000-12-21 Richard Sandiford <rsandifo@redhat.com> + + * libbfd.c (bfd_get_bits): Added + (bfd_put_bits): Likewise + * bfd-in.h: Declared the above. + * bfd-in2.h: Regenerated. + +2000-12-20 Kazu Hirata <kazu@hxi.com> + + * targets.c: Fix formatting. + * tekhex.c: Likewise. + * trad-core.c: Likewise. + +2000-12-19 Kazu Hirata <kazu@hxi.com> + + * sco5-core.c: Fix formatting. + * section.c: Likewise. + * sparclinux.c: Likewise. + * sparclynx.c: Likewise. + * sparcnetbsd.c: Likewise. + * srec.c: Likewise. + * stabs.c: Likewise. + * stab-syms.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * sysdep.h: Likewise. + +2000-12-18 Nick Clifton <nickc@redhat.com> + + * coff-arm.c (EXTRA_S_FLAGS): Only define if not already + defined. + * epoc-pe-arm.c (EXTRA_S_FLAGS): Define. + * epoc-pei-arm.c (EXTRA_S_FLAGS): Define. + +2000-12-18 Nick Clifton <nickc@redhat.com> + + * vms-misc.c (_bfd_vms_get_record): Add default case to + file_format switch. + +2000-12-15 Miloslav Trmac <mitr@volny.cz> + + * elfcore.h (elf_core_file_p): Move to the start of the program + headers before attempting to read them. + +2000-12-14 Kazu Hirata <kazu@hxi.com> + + * peigen.c: Fix formatting. + * som.c: Likewise. + * som.h: Likewise. + +2000-12-13 Kazu Hirata <kazu@hxi.com> + + * peigen.c: Fix formatting. + +2000-12-12 Jim Wilson <wilson@redhat.com> + + * elfxx-ia64.c (get_dyn_sym_info): Cast %p argument to void *. + +2000-12-08 Mark Salter <msalter@redhat.com> + + * binary.c (binary_set_section_contents): Ignore sections + with zero size. + +2000-12-12 Kazu Hirata <kazu@hxi.com> + + * m68klinux.c: Fix formatting. + * m68knetbsd.c: Likewise. + * mipsbsd.c: Likewise. + * netbsd-core.c: Likewise. + * netbsd.h: Likewise. + * newsos3.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * nlmswap.h: Likewise. + * nlm-target.h: Likewise. + * ns32knetbsd.c: Likewise. + +2000-12-10 Fred Fish <fnf@be.com> + + * elflink.h (elf_link_output_extsym): Don't complain about undefined + symbols in shared objects if allow_shlib_undefined is true. + +2000-12-12 Nick Clifton <nickc@redhat.com> + + * cpu-sh.c: Fix formattng. + * elf.c: Fix formattng. + * elf32-mips.c: Fix formattng. + * elf32-sh.c: Fix formattng. + * elf64-alpha.c: Fix formattng. + +2000-12-09 Nick Clifton <nickc@redhat.com> + + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Pass + dwarf2_find_line_info as last parameter to invocation of + _bfd_dwarf2_find_nearest_line. + * elf32-arm.h (elf32_arm_find_nearest_line): Pass + dwarf2_find_line_info as last parameter to invocation of + _bfd_dwarf2_find_nearest_line. + +2000-12-08 Mark Elbrecht <snowball3@bigfoot.com> + + * Makefile.am (BFD32_BACKENDS): Move dwarf2.lo from here... + (BFD_LIBS): ...to here. + (BFD32_BACKENDS_CFILES): Move dwarf2.c from here... + (BFD_LIBS_CFILES): ...to here. + * Makefile.in: Regenerate. + * configure.in: Remove dwarf.lo from the elf shell variable. + * configure: Regenerate. + * libcoff-in.h (coff_tdata): Add pointer dwarf2_find_line_info. + * libcoff.h: Regenerate. + * coffgen.c (coff_find_nearest_line): Call + _bfd_dwarf2_find_nearest_line. + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add parameter. Update + accordingly. + (read_abbrevs): Likewise + (decode_line_info): Likewise. + (parse_comp_unit): Likewise. + (comp_unit_find_nearest_line): Likewise. + * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. + * libbfd.h: Regenerate. + * elf.c (_bfd_elf_find_nearest_line): Update call. + * elf-bfd.h (elf_obj_tdata): Change dwarf2_find_line_info to type PTR. + * dwarf2.c (concat_filename): Use IS_ABSOLUTE_PATH. + * coffcode.h (STYP_XCOFF_DEBUG, STYP_DEBUG_INFO): New macros. + (sec_to_styp_flags): Use them. Handle DWARF2 sections. + (styp_to_sec_flags): Handle DWARF2 sections. + * elf32-arm.h (elf32_arm_find_nearest_line): Add parameter to call + to _bfd_find_nearest_line. + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Add parameter to + call to _bfd_find_nearest_line. + +2000-12-08 Kazu Hirata <kazu@hxi.com> + + * coffgen.c: Fix formatting. + * elf-m10300.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i960.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-sparc.c: Likewise. + +2000-12-07 Kazu Hirata <kazu@hxi.com> + + * elf32-ppc.c: Fix formatting. + * elf64-x86-64.c: Likewise. + +2000-12-06 Ulf Carlsson <ulfc@engr.sgi.com> + + From Ralf Baechle <ralf@gnu.org> + + * elf32-mips.c (elf32_mips_merge_private_bfd_data): Always permit + BFDs containing no sections or empty .text, .data or .bss sections + to be merged, regardless of their flags. + +2000-12-06 Kazu Hirata <kazu@hxi.com> + + * elf32-m32r.c: Fix formatting. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-pj.c: Likewise. + * elf32-ppc.c: Likewise. + +2000-12-05 Kazu Hirata <kazu@hxi.com> + + * elf32-fr30.c: Fix formatting. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-i960.c: Likewise. + +2000-12-03 Kazu Hirata <kazu@hxi.com> + + * elf32-arm.h: Fix formatting. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-d10v.c: Likewise. + * elf32-d30v.c: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + +2000-12-01 Chris Demetriou <cgd@sibyte.com> + + * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mips32 and + bfd_mach_mips32_4k. Update FIXME comment. + * archures.c (bfd_mach_mips32): New constant. + (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to + the latter, renumber it. + * bfd-in2.h (bfd_mach_mips32): New constant. + (bfd_mach_mips4K, bfd_mach_mips32_4k) Rename the former to + the latter, renumber it. + * cpu-mips.c (I_mips32): New constant. + (I_mips4K, I_mips32_4k): Rename the former to the latter. + (arch_info_struct): Add bfd_mach_mips32 entry, replace + bfd_mach_mips4K entry with bfd_mach_mips32_4k entry. + * elf32-mips.c (elf_mips_isa): Add E_MIPS_ARCH_32 case. + (elf_mips_mach): Likewise. Also, replace E_MIPS_MACH_MIPS32 + with E_MIPS_MACH_MIPS32_4K. + (_bfd_mips_elf_final_write_processing): Replace + bfd_mach_mips4K with bfd_mach_mips32_4k case, add + bfd_mach_mips32 case. + (_bfd_mips_elf_merge_private_bfd_data): Generalize ISA mixing + comparison with support for MIPS32. + (_bfd_mips_elf_print_private_bfd_data): Print ISA name for + MIPS32. + + * aoutx.h (NAME(aout,machine_type)): Add cases for + bfd_mach_mips5 and bfd_mach_mips64. + * archures.c (bfd_mach_mips5, bfd_mach_mips64): New constants. + * bfd-in2.h (bfd_mach_mips5, bfd_mach_mips64): Likewise. + * cpu_mips.c (I_mips5, I_mips64): New definitions. + (arch_info_struct): Add entries for bfd_mach_mips5 and + bfd_mach_mips64. + * elf32-mips.c (elf_mips_isa, elf_mips_mach, + _bfd_mips_elf_print_private_bfd_data): Add cases for + E_MIPS_ARCH_5 and E_MIPS_ARCH_64. + (_bfd_mips_elf_final_write_processing): Add cases for + bfd_mach_mips5 and bfd_mach_mips64. + + * bfd/aoutx.h (NAME(aout,machine_type)): Add a + bfd_mach_mips_sb1 case. + * bfd/archures.c (bfd_mach_mips_sb1): New constant. + * bfd/bfd-in2.h (bfd_mach_mips_sb1): New constant. + * bfd/cpu-mips.c (I_sb1): New constant. + (arch_info_struct): Add entry for bfd_mach_mips_sb1. + * bfd/elf32-mips.c (elf_mips_mach): Add case for + E_MIPS_MACH_SB1. + (_bfd_mips_elf_final_write_processing): Add case for + bfd_mach_mips_sb1. + +2000-12-01 Joel Sherrill <joel@OARcorp.com> + + * config.bfd (arm-*-rtems*, a29k-*rtems*): New targets. + (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. + (sparc*-*-rtems*): Switched from a.out to ELF. + +2000-11-30 Jan Hubicka <jh@suse.cz> + + * Makefile.am (BFD64_BACKENDS): Add elf64-x86-64.lo + BFD64_BACKENDS_CFILES): Add elf64-x86-64.c + (elf64-x86-64.lo): Add dependencies. + * archures.c (DESCRIPTION): Add bfd_mach_x86_64, + bfd_mach_x86_64_intel_syntax. + * elf.c (prep_headers): Use EM_x86_64 for 64bit output. + * config.bfd (x86_64): Add. + * configure.in: Add support for bfd_elf64_x86_64_vec. + * cpu-i386.c (bfd_x86_64_arch_intel_syntax, bfd_x86_64_arch): Add. + (bfd_i386_arch, i8086_ar): Link in. + * elf64-x86-64.c: New file. + * reloc.c (ENUMDOC): Add BFD_RELOC_X86_64*. + * targets.c (bfd_elf64_x86_64_vec): Add. + (bfd_target_vect): Add bfd_elf64_x86_64_vec. + +2000-11-30 Kazu Hirata <kazu@hxi.com> + + * xcofflink.c: Fix formatting. + +2000-11-28 Kazu Hirata <kazu@hxi.com> + + * aoutx.h: Fix formatting. + * bfd-in.h: Likewise. + * bfd-in2.h: Likewise. + * cache.c: Likewise. + * cisco-core.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffswap.h: Likewise. + * corefile.c: Likewise. + * elf32-mips.c: Likewise. + +2000-11-27 Kazu Hirata <kazu@hxi.com> + + * aout-adobe.c: Fix formatting. + * coff64-rs6000.c: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + +2000-11-27 Philip Blundell <pb@futuretv.com> + + * libcoff-in.h (coff_tdata): Add `strings_written' flag. + (obj_coff_strings_written): New accessor macro for above. + * libcoff.h: Regenerate. + * cofflink.c (_bfd_coff_final_link): Say that we wrote the + strings. + * coffcode.h (coff_write_object_contents): No need to write out + the string table if it's already been done. + +2000-11-22 Philip Blundell <pb@futuretv.com> + + * cofflink.c (_bfd_coff_generic_relocate_section): Don't object to + weak undefined symbols. + +2000-11-24 Nick Clifton <nickc@redhat.com> + + * archures.c (bfd_mach_arm_5TE): Define. + (bfd_mach_arm+XScale): Define. + * bfd-in2.h: Regenerate. + + * coff-arm.c (coff_arm_reloc_type_lookup): Accept + BFD_RELOC_ARM_PCREL_BLX. + + * coffcode.h (coff_set_flags): Set flags for 5t, 5te and + XScale machine numbers. + + * config.bfd (xscale-elf): Add target. + (xscale-coff): Add target. + + * cpu-arm.c: Add xscale machine name. + Add v5t, v5te and XScale machine numbers. + +2000-11-23 Kazu Hirata <kazu@hxi.com> + + * aix386-core.c: Fix formatting. + +2000-11-22 Jim Wilson <wilson@redhat.com> + + * coff-ia64.c (howto_table): Use EMPTY_HOWTO. + (in_reloc_p): Add ATTRIBUTE_UNUSED to unused parameters. + * cpu-ia64-opc.c (ins_rsvd, ext_rsvd, ins_const, ext_const): Likewise. + (ins_imms_scaled): Initialize sign_bit at function entry. + (elf64_ia64_operands): Add missing initializers. + * elfxx-ia64.c (elfNN_ia64_reloc, elfNN_ia64_reloc_type_lookup, + elfNN_ia64_info_to_howto, elfNN_ia64_fake_sections, + elfNN_ia64_add_symbol_hook, elfNN_ia64_is_local_label_name, + elfNN_ia64_local_hash_table_init, get_fptr, get_pltoff, + elfNN_ia64_adjust_dynamic_symbol): Add ATTRIBUTE_UNUSED for unused + parameters. + (elfNN_ia64_info_to_howto): Initialize free_relocs, free_contents, + and free_extsyms at function entry. + (elfNN_add_symbol_hook): Add unsigned cast to bfd_get_gp_size result. + (elfNN_ia64_create_dynamic_sections): Delete unused local h. + (get_got): Delete unused local srel. + (elfNN_ia64_check_relocs): Initialize dynrel_type when declared. + (elfNN_ia64_relocate_section): Delete unused local dynindx. + +2000-11-21 Kazu Hirata <kazu@hxi.com> + + * coff-a29k.c: Fix formatting. + * coff-h8500.c: Likewise. + * coff-i960.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-stgo32.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-w65.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-hppa.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + +2000-11-21 Nick Clifton <nickc@redhat.com> + + * elf32-sh.c (sh_elf_reloc_loop): Fix compile time warning, and + remove possibility of infinite loop. + +2000-11-20 Kazu Hirata <kazu@hxi.com> + + * aix386-core.c: Fix formatting. + * aout-adobe.c: Likewise. + * aout-arm.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bfd-in.h: Likewise. + * bfd-in2.h: Likewise. + * bfd.c: Likewise. + * bout.c: Likewise. + +2000-11-17 H.J. Lu <hjl@gnu.org> + + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Don't create + pltoff entries for DT_INIT and DT_FINI. + (elfNN_ia64_final_link): Don't set DT_INIT/FINI entries. + (elfNN_ia64_finish_dynamic_sections): Don't fill in DT_INIT/FINI + entries. + +2000-11-16 Richard Henderson <rth@redhat.com> + + * elfxx-ia64.c (elfNN_ia64_check_relocs): Handle IPLT relocs. + (allocate_dynrel_entries): Likewise. + (elfNN_ia64_relocate_section): Likewise. Set REL addends correctly. + (set_pltoff_entry): Likewise. + (ia64_howto_table): Remove R_IA64_SEGBASE, and R_IA64_EPLT[ML]SB + (elfNN_ia64_reloc_type_lookup): Likewise. + (elfNN_ia64_install_value): Likewise. + (elfNN_ia64_relocate_section): Likewise. + * reloc.c (BFD_RELOC_IA64_SEGBASE): Remove. + (BFD_RELOC_IA64_EPLTMSB, BFD_RELOC_IA64_EPLTLSB): Remove. + +2000-11-16 Kazu Hirata <kazu@hxi.com> + + * cpu-a29k.c: Fix formatting. + * cpu-alpha.c: Likewise. + * cpu-arm.c: Likewise. + * cpu-avr.c: Likewise. + * cpu-d10v.c: Likewise. + * cpu-h8500.c: Likewise. + * cpu-hppa.c: Likewise. + * cpu-i370.c: Likewise. + * cpu-i386.c: Likewise. + * cpu-i960.c: Likewise. + * cpu-ia64-opc.c: Likewise. + * cpu-ia64.c: Likewise. + * cpu-m32r.c: Likewise. + * cpu-m68hc11.c: Likewise. + * cpu-m68hc12.c: Likewise. + * cpu-m68k.c: Likewise. + * cpu-m88k.c: Likewise. + * cpu-mips.c: Likewise. + * cpu-ns32k.c: Likewise. + * cpu-pj.c: Likewise. + * cpu-powerpc.c: Likewise. + * cpu-sh.c: Likewise. + * cpu-sparc.c: Likewise. + * cpu-tic54x.c: Likewise. + * cpu-v850.c: Likewise. + * cpu-vax.c: Likewise. + * cpu-w65.c: Likewise. + * cpu-we32k.c: Likewise. + * cpu-z8k.c: Likewise. + * dwarf1.c: Likewise. + * dwarf2.c: Likewise. + +2000-11-15 Kazu Hirata <kazu@hxi.com> + + * coff-arm.c: Fix formatting. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-sparc.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff-w65.c: Likewise. + * coff-we32k.c: Likewise. + * coff-z8k.c: Likewise. + +2000-11-15 Richard Henderson <rth@redhat.com> + + * elf64-alpha.c (elf64_alpha_check_relocs): Create the reloc + section with the same ALLOC|LOAD flags as the source section. + +2000-11-14 Jakub Jelinek <jakub@redhat.com> + + * elf64-alpha.c (elf64_alpha_relax_opt_call): Only check bits used + by STO_ALPHA constants. + +2000-11-14 Kazu Hirata <kazu@hxi.com> + + * coff-pmac.c: Fix formatting. + * coff-ppc.c: Likewise. + +2000-11-13 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_link_add_object_symbols): Also add indirect + symbols for common symbols with the default version. + +2000-11-09 Philip Blundell <pb@futuretv.com> + + * section.c (STD_SECTION): Set gc_mark flag. + +2000-11-11 Kazu Hirata <kazu@hxi.com> + + * coff-i960.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + +2000-11-11 Bernd Schmidt <bernds@cygnus.co.uk> + + * elf32-sh.c (sh_elf_relocate_section): Ignore R_SH_NONE relocs. + +2000-11-10 Kazu Hirata <kazu@hxi.com> + + * coff-h8300.c: Fix formatting. + * coff-h8500.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + +2000-11-09 Kazu Hirata <kazu@hxi.com> + + * archive.c: Fix formatting. + * archures.c: Likewise. + +2000-11-07 Richard Henderson <rth@redhat.com> + + * elfxx-ia64.c (elf64_ia64_final_link): New local unwind_output_sec. + Set it before bfd_elf64_bfd_final_link call. Use it after the call. + * section.c (bfd_set_section_contents): Call memcpy if + section->contents set and location not equal to contents plus offset. + +2000-11-08 Kazu Hirata <kazu@hxi.com> + + * bfd-in.h: Fix formatting. + * bfd-in2.h: Likewise. + * bfd.c: Likewise. + * binary.c: Likewise. + * bout.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-apollo.c: Likewise. + * coff-aux.c: Likewise. + +2000-11-07 Kazu Hirata <kazu@hxi.com> + + * aix386-core.c: Fix formatting. + * aoutf1.h: Likewise. + * aoutx.h: Likewise. + * archures.c: Likewise. + * armnetbsd.c: Likewise. + 2000-11-07 Alan Modra <alan@linuxcare.com.au> * coff-h8300.c (special): Adjust reloc address. - From mainline 2000-04-03 Kazu Hirata <kazu@hxi.com> - * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to - the R_PCRWORD_B case. +2000-11-06 Steve Ellcey <sje@cup.hp.com> + + * archures.c (bfd_mach_ia64_elf64, bfd_mach_ia64_elf32): Add defines + to differentiate elf32 and elf64 on ia64. + * bfd-in2.h: Regenerate. + * config.bfd: Add target for "ia64*-*-hpux*". + * configure.in: Add bfd_elf32_ia64_big_vec to selvecs switch. + * configure: Regenerate. + * cpu-ia64.c (bfd_ia64_elf32_arch): Add elf32 arch info structure. + * targets.c: Add bfd_target bfd_elf32_ia64_big_vec. + + * Makefile.am: Make elf32-ia64.c and elf64-ia64.c derived objects + from elfxx-ia64.c. Add depenency rules for making elf32-ia64.lo. + * Makefile.in: Regnerate. + * elf64-ia64.c: Deleted. + * elfxx-ia64.c: New file, paramaterized version of elf64-ia64.c. + +2000-11-06 Kazu Hirata <kazu@hxi.com> + + * aout-adobe.c: Fix formatting. + * aout-arm.c: Likewise. + * aout-cris.c: Likewise. + * aout-encap.c: Likewise. + * aout-ns32k.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. 2000-11-05 Philip Blundell <philb@gnu.org> @@ -17,148 +1022,1854 @@ if a relocation for an undefined symbol also results in an overflow. +2000-11-06 Christopher Faylor <cgf@cygnus.com> + + * config.bfd: Add support for Sun Chorus. + +2000-11-05 David O'Brien <obrien@FreeBSD.org> + + * configure.in: Recognize alpha-*-freebsd*. + * configure: Regenerate. + +2000-11-02 Luciano Gemme <ishitawa@yahoo.com> + + * srec.c (CHUNK): Rename to DEFAULT_CHUNK. + (Chunk): New global variable set by a parameter in objcopy.c. + (S3Forced): New global variable set by a parameter in + objcopy.c. + (srec_set_section_contents): If S3Forced is true, always generate + S3 records. + (srec_write_section): Use 'Chunk' to limit maximum length of S + records. + +2000-11-02 Per Lundberg <plundis@chaosdev.org> + + * config.bfd: Add support for i[3456]86-chaosdev-storm-chaos. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * po/bfd.pot: Regenerate. + 2000-10-31 Philip Blundell <philb@gnu.org> * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle EF_SOFT_FLOAT if it is defined. - From 2000-05-23 H.J. Lu <hjl@gnu.org> - * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. - 2000-10-27 Philip Blundell <philb@gnu.org> * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse attempts to mix PIC code with non-PIC, just mark the output as being position dependent. - (elf32_arm_merge_private_bfd_data): Likewise. Print an error - message for EF_SOFT_FLOAT mismatches. Display diagnostics for + (elf32_arm_merge_private_bfd_data): Likewise. Print an error + message for EF_SOFT_FLOAT mismatches. Display diagnostics for all mismatches, not just the first one. - -2000-10-23 Philip Blundell <pb@futuretv.com> - From 2000-05-23 H.J. Lu <hjl@gnu.org> - * elf64-alpha.c (elf64_alpha_relocate_section): Check - h->root.other not h->other. - * elf32-mips.c (mips_elf_calculate_relocation): Likewise. +2000-10-25 Chris Demetriou <cgd@sibyte.com> -2000-10-23 Philip Blundell <pb@futuretv.com> + * ieee.c (ieee_archive_p): Plug one of many possible + memory leaks in error handling. - * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Undo previous - accidental checkin. +2000-10-20 Jakub Jelinek <jakub@redhat.com> -2000-10-22 Philip Blundell <philb@gnu.org> + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data, + elf32_sparc_object_p, elf32_sparc_final_write_processing): + Support v8plusb. + * elf64-sparc.c (sparc64_elf_merge_private_bfd_data, + sparc64_elf_object_p): Support v9b. + * archures.c: Declare v8plusb and v9b machines. + * bfd-in2.h: Ditto. + * cpu-sparc.c: Ditto. - * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make - PLT entries that could serve as a definition for a weak symbol. +2000-10-16 Geoffrey Keating <geoffk@shoggoth.cygnus.com> - From 2000-06-05 H.J. Lu <hjl@gnu.org> - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag - an error when seeing an undefined symbol with hidden/internal - attribute. It is handled in *_relocate_section (). + * elf64-sparc.c (sparc64_elf_relocate_section): Clear the location + of a GOT reloc. - From 2000-05-23 H.J. Lu <hjl@gnu.org> - * elf32-i386.c (elf_i386_relocate_section): Don't allow the - undefined symbol with the non-default visibility attributes. - * elf-hppa.h (elf_hppa_relocate_section): Likewise. - * elf32-arm.h (elf32_arm_relocate_section): Likewise. - * elf32-i370.c (i370_elf_relocate_section): Likewise. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-mcore.c (mcore_elf_relocate_section): Likewise. - * elf32-mips.c (mips_elf_calculate_relocation): Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): New macro. + (SYMBOL_CALLS_LOCAL): New macro. + (ppc_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL. + (ppc_elf_check_relocs): Use SYMBOL_REFERENCES_LOCAL. + (ppc_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL. + (ppc_elf_relocate_section): Use flag variable to determine + whether the relocation refers to a local symbol. + Test whether a PLTREL24 reloc will produce a reloc by looking + to see whether a PLT entry was made. -2000-10-16 Geoffrey Keating <geoffk@cygnus.com> +2000-10-14 Geoffrey Keating <geoffk@shoggoth.cygnus.com> - From 2000-10-14 Geoffrey Keating <geoffk@cygnus.com> * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT entries that could serve as a definition for a weak symbol. -2000-10-15 Philip Blundell <philb@gnu.org> +2000-10-13 Ulf Carlsson <ulfc@engr.sgi.com> + + From Ralf Baechle <ralf@gnu.org> + + * elf32-mips.c (mips_elf_create_dynamic_relocation): New argument + local_p. Add symbol value only for non-R_MIPS_REL32 relocations + against local symbols. + (_bfd_mips_elf_finish_dynamic_sections): Undo patch from 2000-10-01. + +2000-10-12 Alan Modra <alan@linuxcare.com.au> + + * section.c (struct sec): Add kept_section. + (struct bfd_comdat_info): Remove sec, we can use above. + (STD_SECTION): Add initializer. + (bfd_make_section_anyway): Init here too. + + * bfd-in2.h: Regenerate. + + * elflink.h (elf_link_add_object_symbols): Remove unnecessary + zeroing of `flags'. + (elf_link_input_bfd): Set all asection->symbol->value's here, and + fudge values for discarded link-once section symbols. + + * elf64-hppa.c: Include alloca-conf.h + +2000-10-11 Alan Modra <alan@linuxcare.com.au> + + * elf.c (swap_out_syms): Revert 2000-10-07 changes. + + * ieee.c (ieee_make_empty_symbol): Oops, bfd_zalloc needs another arg. + +2000-10-10 Alan Modra <alan@linuxcare.com.au> + + * ieee.c (ieee_make_empty_symbol): Use bfd_zalloc, not bfd_zmalloc. + +2000-10-10 Tom Rix <trix@redhat.com> + + * section.c (bfd_make_section_anyway): Release newsect ptr when + newsect->symbol fails to alloc. Use bfd_release instead of free. + +2000-10-09 Richard Henderson <rth@cygnus.com + + * elf64-ia64.c (elf64_ia64_unwind_entry_compare_bfd): New. + (elf64_ia64_unwind_entry_compare): New. + (elf64_ia64_final_link): Sort the .IA_64.unwind section. + +2000-10-07 Alan Modra <alan@linuxcare.com.au> + + * elflink.h (size_dynamic_sections): Don't create various tags if + .dynstr is excluded from the link. Don't set first dynsym entry + if dynsymcount is zero. + (elf_bfd_final_link): Don't try to swap out dynamic syms if + .dynsym excluded from the link. Don't try to write any dynamic + sections excluded from the link. + + * elf.c (swap_out_syms): Handle global section symbols. + +2000-10-05 DJ Delorie <dj@redhat.com> + + * peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs + * coffcode.h (coff_set_alignment_hook): read extended reloc count + (coff_write_relocs): write extended reloc count + (coff_write_object_contents): account for extended relocs + +2000-10-05 Jim Wilson <wilson@cygnus.com> + + * elf-bfd.h (struct elf_backend_data): Add elf_backend_section_flags + field. + * elf.c (_bfd_elf_make_section_from_shdr): Call the + elf_backend_section_flags function. + * elf64-ia64.c (elf64_ia64_section_from_shdr): Delete flag conversion + code. + (elf64_ia64_section_flags): New function containing flag conversion + code. + (elf_backend_section_flags): Define to elf64_ia64_section_flags. + * elfxx-target.h (elf_backend_section_flags): Define. + (elfNN_bed): Initialize elf_backend_section_flags field. + +2000-10-02 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (elf32_hppa_check_relocs): Correct call to + _bfd_elf32_gc_record_vtable. Correct a comment. + +2000-10-01 Ulf Carlsson <ulfc@engr.sgi.com> + + From Ralf Baechle <ralf@gnu.org> + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Mark gld + produces binaries with got[1] = 0x80000001 to differenciate them + for the dynamic linker from the broken binaries produced by old + versions. + +2000-09-30 Petr Sorfa <petrs@sco.com> + + * elf.c (elfcore_grok_pstatus): Check for size of pxstatus_t. + (elfcore_grok_lwpstatus): Check for size of lwpxstatus_t. + * configure.in: Add check for pxstatus_t and lwpxstatus_t. + * configure: Regenerate. + +2000-09-27 Hans-Peter Nilsson <hp@axis.com> + + Define two bfd_targets for absence and presence of leading + underscore on symbols. Make sure to only link same kind. + * elf32-cris.c (cris_elf_object_p, + cris_elf_final_write_processing, cris_elf_print_private_bfd_data, + cris_elf_merge_private_bfd_data): New. + (elf_backend_object_p, elf_backend_final_write_processing, + bfd_elf32_bfd_print_private_bfd_data, + bfd_elf32_bfd_merge_private_bfd_data): Define. + <Target vector definition>: Include elf32-target.h twice with + different macro settings: + (TARGET_LITTLE_SYM): First as bfd_elf32_cris_vec, then as + bfd_elf32_us_cris_vec. + (TARGET_LITTLE_NAME): First as "elf32-cris", then "elf32-us-cris". + (elf_symbol_leading_char): First as 0, then '_'. + (INCLUDED_TARGET_FILE): Define for second include of elf32-target.h. + * config.bfd (cris-*-*): Add bfd_elf32_us_cris_vec to targ_selvecs. + * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vector. + * configure: Regenerate. + * targets.c: Declare bfd_elf32_us_cris_vec. + * po/bfd.pot: Regenerate. + +2000-09-29 Momchil Velikov <velco@fadata.bg> + + * elf32-arm.h (arm_add_to_rel): Correctly adjust the addend for + R_ARM_THM_PC22 relocations. + +2000-09-29 NIIBE Yutaka <gniibe@chroot.org> + + * elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath. + +2000-09-29 Momchil Velikov <velco@fadata.bg> + + * elf.c (elf_fake_sections): Do not mark the section SHT_NOBITS if + is has the SEC_HAS_CONTENTS flag set. + +2000-09-28 Örjan Friberg <orjanf@axis.com> + Hans-Peter Nilsson <hp@axis.com> + + * aout-cris.c (N_TXTADDR): Define. + +2000-09-28 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * som.c: Include alloca-conf.h. + * Makefile.am: "make dep-am" + * Makefile.in: Regenerate. + +2000-09-27 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (plt_stub): New. + (PLT_STUB_ENTRY): Define. + (elf32_hppa_link_hash_table): Change multi_subspace to packed + boolean. Add need_plt_stub, has_12bit_branch and has_17bit_branch. + (elf32_hppa_link_hash_table_create): Init to suit. + (elf32_hppa_check_relocs): Set has_12bit_branch and + has_17bit_branch as appropriate. + (elf32_hppa_adjust_dynamic_symbol): Set need_plt_stub for + non-local functions. + (elf32_hppa_size_dynamic_sections): Correct setting of reltext. + Add space for plt_stub as needed. + (elf32_hppa_finish_dynamic_symbol): Point .plt entries for global + functions at plt_stub. + (elf32_hppa_finish_dynamic_sections): Write plt_stub. + (elf32_hppa_create_dynamic_sections): Leave .plt executable. + + * elf32-hppa.h (elf32_hppa_size_stubs): Add group_size param. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. Use it instead + of fixed size, and if negative, disable handling of input sections + before stub section. Set up default stub group size depending + on detected branch relocs. + (hppa_build_one_stub): Use lrsel and rrsel for import stubs to + ensure different offsets from sym_value aren't rounded to + different 2k blocks. Use lrsel and rrsel for other stubs too for + consistency rather than necessity. + (elf32_hppa_check_relocs): Handle R_PARISC_DIR14F. + (final_link_relocate): Likewise. + (elf32_hppa_relocate_section): Likewise. + + * elf-hppa.h (elf_hppa_howto_table): Add R_PARISC_DIR14F reloc. + (_bfd_elf_hppa_gen_reloc_type): Generate them. + (elf_hppa_final_link_relocate): Handle them. + (elf_hppa_relocate_insn): Likewise. + (_bfd_elf_hppa_gen_reloc_type): Add missing e_ldsel and e_rdsel cases. + +2000-09-26 Hans-Peter Nilsson <hp@axis.com> + + * elfcode.h (elf_object_p): Preserve and clear abfd section + information. Restore at error. + +2000-09-26 Paul Sokolovsky <Paul.Sokolovsky@technologist.com> + + * peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory + is empty, make sure that its rva also 0. NT loader dislikes + having otherwise. + +2000-09-26 Steve Ellcey <sje@cup.hp.com> + + * som.c (som_bfd_derive_misc_symbol_info): Make weak symbols + global by default. + +2000-09-21 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (elf32_hppa_check_relocs): Fix weak sym handling in + currently unused RELATIVE_DYNAMIC_RELOCS code. + (hppa_discard_copies): Likewise. + (elf32_hppa_size_stubs): Size `input_list' array correctly. Correct + comments. Don't check non-code output sections for stub grouping. + +2000-09-20 Alan Modra <alan@linuxcare.com.au> + + * section.c (bfd_get_unique_section_name): Return NULL if + bfd_malloc fails. + +2000-09-19 Michael Sokolov <msokolov@ivan.Harhan.ORG> + + * elf32-m68k.c (elf_cpu32_plt0_entry): Change the PLT entry 0 + instruction sequence to actually work. + (elf_m68k_finish_dynamic_sections): Change the patch-in offset + accordingly. + +2000-09-18 Alexandre Oliva <aoliva@redhat.com> + + * elf32-sh.c (sh_elf_relocate_section): Use + _bfd_final_link_relocate to apply the relocation against a section + symbol, when doing relocatable links. + +2000-09-18 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (elf32_hppa_stub_hash_entry): Rename input_section + to id_sec. + (stub_hash_newfunc): Here too. + (hppa_add_stub): And here. + (elf32_hppa_link_hash_table): Remove stub_section_created, + reloc_section_created, first_init_sec and first_fini_sec. Add + stub_group. + (elf32_hppa_link_hash_table_create): Init to suit. + (hppa_get_stub_entry): Add support for grouping stub sections. + (hppa_add_stub): Likewise. Remove sec_count param and init/fini + section code. Index stub vars by section->id. + (elf32_hppa_size_stubs): Likewise. Remove duplicated function + exit paths. Zap allocation of above removed vars. Refine + link-once test. + + * elf32-hppa.h (elf32_hppa_size_stubs): Add output_bfd param. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. + (hppa_get_stub_entry): Pass in pointer to elf32_hppa_link_hash_table + rather than pointer to bfd_link_info. + (hppa_add_stub): Likewise. + (final_link_relocate): Likewise. + +2000-09-17 David Huggins-Daines <dhd@linuxcare.com> + + (elf32_hppa_size_stubs): Don't try to build stubs for discarded + link-once sections. + +2000-09-16 Alexandre Oliva <aoliva@redhat.com> + + * elf32-sh.c (ELF_MAXPAGESIZE): Define to 128, to match + ld/emulparams/shelf.sh. + +2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG> + + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function. + * bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration. + * bfd-in2.h: Regenerate. + +2000-09-15 Kenneth Block <Kenneth.Block@compaq.com> + + * bfd/elf64-alpha.c (elf64_alpha_relax_with_lituse): ld performs + LITUSE relocations incorrectly if -relax is specified on the ld + command line and the displacement field of the load or store + instruction is non-zero. (Patch by paul.winalski@compaq.com) + +2000-09-15 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (hppa_add_stub): Dont set first_init_sec and + first_fini_sec here. + (elf32_hppa_size_stubs): Instead correctly find the first .init + and .fini section here. + +2000-09-15 David Huggins-Daines <dhd@linuxcare.com> + + * elf32-hppa.c (clobber_millicode_symbols): New function. + (elf32_hppa_size_dynamic_sections): Call it. + +2000-09-14 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.c (elf32_hppa_link_hash_entry): Make pic_call + packed. Add plabel, plt_abs packed booleans. + (hppa_link_hash_newfunc): Init new fields. + (PLABEL_PLT_ENTRY_SIZE): Define. + (hppa_stub_name): Use size_t len vars. + (hppa_add_stub): Likewise. + (elf32_hppa_build_stubs): Likewise. + (hppa_build_one_stub): Kill some compiler warnings. + (elf32_hppa_check_relocs): Always generate a plt entry for PLABELs + if dynamic linking. Munge the local plt offsets into + local_got_refcounts. Set h->plabel for all global PLABELs. Use + size_t len vars. Add assert for plabel addend. + (elf32_hppa_gc_sweep_hook): Sweep local plt entries too. + (elf32_hppa_hide_symbol): New function. + (elf_backend_hide_symbol): Define. + (elf32_hppa_adjust_dynamic_symbol): Don't throw away plt entries + with h->plabel set. Don't make plt entries to have dynamic syms + when they have been forced local. If plt entry is used by a + plabel, make it PLABEL_PLT_ENTRY_SIZE. + (elf32_hppa_size_dynamic_sections): Set plt_abs for init fns. + Set up .plt offsets for local syms. + (elf32_hppa_relocate_section): Initialise plt entries for local + syms. Leave weak undefined plabels zero. Make global plabel + relocs against function symbol, and leave the addend zero. + Use *ABS* DIR32 relocs instead of SEGREL32 for dynamic got relocs. + (elf32_hppa_finish_dynamic_symbol): Set up IPLT relocs for + non-dynamic syms. Init extra plt for plabels. Use *ABS* DIR32 + relocs instead of SEGREL32 for dynamic got relocs. + (elf32_hppa_finish_dynamic_sections): Reserve one more .got entry. + (elf_backend_got_header_size): Adjust. + (elf32_hppa_set_gp): Calculate an "ideal" LTP. + + * elf32-hppa.c (LONG_BRANCH_VIA_PLT): Define. + (hppa_type_of_stub): Use it instead of #if 0 + (hppa_discard_copies): Use it here too. + (elf32_hppa_size_dynamic_sections): And here. + + * elf32-hppa.c (elf32_hppa_link_hash_table): Remove `offset' field. + (elf32_hppa_link_hash_table_create): And here. + (hppa_build_one_stub): And here. Instead keep track of stub + offset using _raw_size. + (elf32_hppa_size_stubs): Likewise. + (elf32_hppa_build_stubs): Likewise. + (hppa_size_one_stub): Likewise. Resize reloc section too. + + * elf32-hppa.c (hppa_add_stub): Correct first_init_sec and + first_fini_sec handling. Don't search for reloc section or set + hplink->reloc_section_created here. + (elf32_hppa_size_stubs): Instead search for reloc sections, and + set reloc_section_created here. + (hppa_handle_PIC_calls): Set ELF_LINK_HASH_NEEDS_PLT. + (elf32_hppa_size_dynamic_sections): Make a .plt entry for DT_INIT + and DT_FINI. + (elf32_hppa_finish_dynamic_sections): Set DT_INIT and DT_FINI. + + * elf32-hppa.c (hppa_build_one_stub): Replace `elf_hash_table (info)' + with `hplink->root.'. + (elf32_hppa_check_relocs): Likewise. + (elf32_hppa_gc_sweep_hook): Likewise. + (elf32_hppa_adjust_dynamic_symbol): Likewise. + (hppa_handle_PIC_calls): Likewise. + (elf32_hppa_size_dynamic_sections): Likewise. + (elf32_hppa_set_gp): Likewise. + (elf32_hppa_relocate_section): Likewise. + (elf32_hppa_finish_dynamic_symbol): Likewise. + (elf32_hppa_finish_dynamic_sections): Likewise. + + From David Huggins-Daines <dhd@linuxcare.com> + * elf32-hppa.c (hppa_type_of_stub): Generate import stubs for + defined weak symbols in shared links. + (final_link_relocate): Calls to defined weak symbols in shared + objects must go via import stubs, as the target might not be known + at link time. + +2000-09-14 Alexandre Oliva <aoliva@redhat.com> + + * elf32-sh.c (sh_elf_howto_table): Moved R_SH_GOT32, R_SH_PLT32, + R_SH_COPY, R_SH_GLOB_DAT, R_SH_JMP_SLOT, R_SH_RELATIVE, + R_SH_GOTOFF, R_SH_GOTPC) to the range from 160 to 167. Replaced + the original entries with EMPTY_HOWTOs, and added new ones to fill + in the gap. + (sh_elf_info_to_howto): Make sure the new gap isn't used. + (sh_elf_relocate_section): Likewise. + +2000-09-13 Anders Norlander <anorland@acc.umu.se> + + * cpu-mips.c (arch_info_struct): Add mips:4K + * bfd-in2.h (bfd_mach_mips4K): New define. + * archures.c: Add bfd_mach_mips4K to comment. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Return + E_MIPS_ARCH_2 for bfd_mach_mips4K. + +2000-09-13 Marco Franzen <marcof@thyron.com> + + * som.c (som_write_symbol_strings): Do not used fixed buffers, + use size_t as a counter. + (som_write_space_strings): Similarly. + +2000-09-12 Jason Eckhardt <jle@cygnus.com> + + * elf32-i860.c (elf32_i860_relocate_pc26): New function + and prototype. + (elf32_i860_relocate_section): Invoke new function from here. + +2000-09-11 Michael Sokolov <msokolov@ivan.Harhan.ORG> + + * elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names + static. + +2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG> + + * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Emit 8 NULs for + target section name instead of dumping core when the target symbol is + undefined. + +2000-09-09 Kazu Hirata <kazu@hxi.com> + + * riscix.c: Remove DEFUN. + +2000-09-08 Nick Clifton <nickc@redhat.com> - From 2000-09-08 Nick Clifton <nickc@redhat.com> * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not initialise flags in output bfd if the input bfd is the default architecture with the default flags. - From 2000-09-03 Philip Blundell <philb@gnu.org> +2000-09-08 Kazu Hirata <kazu@hxi.com> + + * archive.c: Fix formatting. + * coff-arm.c: Likewise. + * doc/chew.c: Likewise. + +2000-09-08 Alan Modra <alan@linuxcare.com.au> + + * section.c (bfd_get_unique_section_name): Put a dot before the + numeric suffix. + +2000-09-07 Kazu Hirata <kazu@hxi.com> + + * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID. + * elf.c: Fix formatting. + +2000-09-07 Alexandre Oliva <aoliva@redhat.com> + + * config.bfd (sh-*-linux*): Added. + * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New. + * targets.c: Declare them. + * elf32-sh-lin.c: New file. + * Makefile.am: Compile it. + * elf32-sh.c: Don't override defines from elf32-sh-lin.c. + * configure, Makefile.in: Rebuilt. + +2000-09-06 Geoffrey Keating <geoffk@cygnus.com> + + * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss + pseduo-section when determining where the TOC ends. + + * coff-rs6000.c (_bfd_xcoff_swap_aux_out): Use bfd_h_put_16 to + output x_tvndx as it is only two bytes wide. + + * coff-rs6000.c (xcoff_howto_table): A modifiable branch-absolute + reloc is 26 or 32 bits wide. + + * coff-rs6000.c (_bfd_xcoff_rtype2howto): The bitsize is irrelevant + for relocs that don't change anything. Also look at the full + 6 bits of bitsize. + +2000-09-06 Philip Blundell <philb@gnu.org> + + * config.bfd (arm*-*-uclinux*): New target. + +2000-09-06 Alexandre Oliva <aoliva@redhat.com> + + * configure: Rebuilt with new libtool.m4. + +2000-09-06 Alan Modra <alan@linuxcare.com.au> + + * section.c (bfd_get_unique_section_name): Avoid c++ reserved + word for variable name. + * bfd-in2.h: Regenerate. + +2000-09-05 Nick Clifton <nickc@redhat.com> + + * config.in: Regenerate. + * libbfd.h: Regenerate. + * po/bfd.pot: Regenerate. + * doc/bfdint.texi: Remove CVS date string - it foils compares with + local versions. + +2000-09-05 Steven Johnson <sbjohnson@ozemail.com.au> + + * cpu-powerpc.c (arch_info_struct): Added MPC860 Family entry. + +2000-09-05 Alan Modra <alan@linuxcare.com.au> + + Shared library and PIC support. + * elf32-hppa.c (PLT_ENTRY_SIZE): New. + (GOT_ENTRY_SIZE): New. + (ELF_DYNAMIC_INTERPRETER): New. + (STUB_SUFFIX): Define. + (LONG_BRANCH_PIC_IN_SHLIB): Define. + (RELATIVE_DYNAMIC_RELOCS): Define. + (enum elf32_hppa_stub_type): New. + (struct elf32_hppa_stub_hash_entry): Rename offset to + stub_offset. Add a number of new fields. + (struct elf32_hppa_link_hash_entry): New. + (struct elf32_hppa_link_hash_table): Add numerous fields. Remove + global_value. + (elf32_hppa_hash_table): Rename to hppa_link_hash_table. + (elf32_hppa_stub_hash_lookup): Rename to hppa_stub_hash_lookup. + (elf32_hppa_stub_hash_newfunc): Rename to stub_hash_newfunc. Init + new fields. + (hppa_link_hash_newfunc): New function. + (elf32_hppa_link_hash_table_create): Use above function. Init new + fields. + (elf32_hppa_stub_name): Rename to hppa_stub_name. Pass in reloc + instead of addend, and remove sym_name from args. Don't use + symbol name for local syms, instead use sym index. + (elf32_hppa_size_of_stub): Rename to hppa_type_of_stub, and return + stub type rather than size. Pass in hash and handle import stub + case. Also pass in reloc instead of offset so we can calculate + PCREL22F and PCREL12F branches properly. + (elf32_hppa_build_one_stub): Rename to hppa_build_one_stub. Build + import and export stubs too. + (elf32_hppa_size_one_stub): Rename to hppa_size_one_stub. Handle + import and export stub sizing. + (elf32_hppa_check_relocs): New function. + (elf32_hppa_adjust_dynamic_symbol): New function. + (hppa_discard_copies): New function. + (elf32_hppa_size_dynamic_sections): New function. + (elf_backend_size_dynamic_sections): Define. + (elf32_hppa_finish_dynamic_symbol): New function. + (elf_backend_finish_dynamic_symbol): Define. + (elf32_hppa_size_stubs): Stash params in link hash table, and move + some local vars into the link hash table too. For shared links, + trundle over function syms, generating export stubs. Handle + PCREL22F branches. Break out stub creation code from here.. + (hppa_add_stub): .. to here. New function. + (elf32_hppa_final_link): Rename to elf32_hppa_set_gp, and don't + call the bfd linker. Use elf_gp to record global pointer. + Calculate a value from sections if $global$ is missing. + (bfd_elf32_bfd_final_link): Define as _bfd_elf32_gc_common_final_link. + (elf32_hppa_gc_mark_hook): New function. + (elf_backend_gc_mark_hook): Define. + (elf32_hppa_gc_sweep_hook): New function. + (elf_backend_gc_sweep_hook): Define. + (elf32_hppa_bfd_final_link_relocate): Rename to final_link_relocate. + Add rel to args, and remove howto, input_bfd, offset, addend, + sym_name as we can recalculate these locally. Handle calls to + dynamic objects, extra PIC relocs, PCREL22F branches. Change + handling of undefined weak syms. Check that stubs are in range. + Only look for import stubs on PCREL17F and PCREL22F relocs. Add + message on hitting a DPREL21L reloc that needs fixing. Subtract + off PC for PCREL14F. Break out code that does a stub lookup from + here.. + (hppa_get_stub_entry): ..to here. New function. + (elf32_hppa_relocate_insn): Merge into final_link_relocate. + (elf32_hppa_relocate_section): Handle got and plt relocs, dynamic + relocs, etc. etc. + (elf32_hppa_finish_dynamic_sections): New function. + (elf_backend_finish_dynamic_sections): Define. + (elf_backend_final_write_processing) Define. + (hppa_handle_PIC_calls): New function. + (elf32_hppa_build_stubs): Call it. Pass link_info to + hppa_build_one_stub. + (elf32_hppa_create_dynamic_sections): New function + to create .plt and .got then set .plt flags correctly. + (elf_backend_create_dynamic_sections): Define. + (elf32_hppa_object_p): New function. + (elf_backend_object_p): Define. + (elf32_hppa_elf_get_symbol_type): New function. + (elf_backend_get_symbol_type): Define. + (elf_backend_can_gc_sections): Define. + (elf_backend_want_got_plt): Define. + (elf_backend_plt_alignment): Set to 2. + (elf_backend_plt_readonly): Define. + (elf_backend_want_plt_sym): Define. + (elf_backend_got_header_size): Reserve one entry. + + * elf32-hppa.h (elf32_hppa_build_stubs): Don't pass stub bfd. + (elf32_hppa_size_stubs): Pass in multi_subspace. + (elf32_hppa_set_gp): Declare. + + * section.c (SEC_HAS_GOT_REF): Define new flag for asection. + (bfd_get_unique_section_name): New function. + * bfd_in2.h: Regenerate. + + * elf64-hppa.c (elf64_hppa_check_relocs): Handle R_PARISC_PCREL12F. + (elf64_hppa_size_dynamic_sections): Remove the FIXME at bfd_zalloc + comment. + + From David Huggins-Daines <dhd@linuxcare.com> + * elf64-hppa.c (elf64_hppa_check_relocs): Fix a warning. + (elf64_hppa_mark_exported_functions): Set dyn_h->st_shndx. + (elf64_hppa_link_output_symbol_hook): Test dyn_h->st_shndx has + been updated in finish_dynamic_symbol before modifying function + symbol. + + * elf-hppa.h (elf_hppa_howto_table): Restructure into groups of + eight entries. Replace NULL with bfd_elf_generic_reloc. Add + R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT and R_PARISC_PCREL12F. + (_bfd_elf_hppa_gen_reloc_type): Handle R_PARISC_GNU_VT*. Add some + comments. Handle format == 12 for R_HPPA_PCREL_CALL. + (elf_hppa_final_link_relocate): Handle R_PARISC_PCREL12F. + (elf_hppa_relocate_insn): Likewise. Reformat some comments. + (elf_hppa_final_write_processing): Expose it for ARCH_SIZE == 32. + + From David Huggins-Daines <dhd@linuxcare.com> + * elf-hppa.h (elf_hppa_is_local_label_name): Accept the SysV/ELF + style of local labels as well. + +2000-09-03 Philip Blundell <philb@gnu.org> + * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate references to undefined symbols in debugging sections. - From 2000-05-30 H.J. Lu <hjl@gnu.org> - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the - visibility bits if the symbol is undefined. Correctly handle - weak undefined symbols with hidden and internal attributes. - * elflink.h (elf_link_add_object_symbols): Always turn the - symbol into local if it has the hidden or internal attribute. +2000-09-02 H.J. Lu <hjl@gnu.org> - From 2000-05-22 H.J. Lu <hjl@gnu.org> - * elflink.h (elf_link_output_extsym): Clear the visibility - field for symbols not defined locally. + * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, + BFD_RELOC_SH_GOTPC): Move them from the MIPS section to the SH + section. - From 2000-05-03 Martin v. Löwis <loewis@informatik.hu-berlin.de> - * elflink.h (elf_link_add_object_symbols): Reset dynindx for - hidden and internal symbols. - (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with - visibility. - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not - assign a PLT or GOT entry to symbols with hidden and - internal visibility. +2000-09-02 Jason Eckhardt <jle@cygnus.com> -2000-10-16 Philip Blundell <pb@futuretv.com> + * elf32-i860.c (bfd_elf32_bfd_is_local_label_name): Define macro. + (elf32_i860_is_local_label_name): New function and prototype. - * configure.in: Set version to 2.10.1. +2000-09-02 Nick Clifton <nickc@redhat.com> + + * configure.in: Increase version number to 2.10.91. * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/bfd.pot: Regenerate. -2000-09-24 H.J. Lu <hjl@gnu.org> +2000-09-02 Daniel Berlin <dberlin@redhat.com> - From 2000-04-20 H.J. Lu <hjl@gnu.org> - * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 - patch to symbols defined by a shared object. + * elf.c (_bfd_elf_make_section_from_shdr): Add + .gnu.linkobce.wi. to the list of debug section names. -2000-09-06 Philip Blundell <philb@gnu.org> +2000-09-02 Nick Clifton <nickc@redhat.com> - Merge from mainline: - - 2000-05-31 Ulrich Drepper <drepper@redhat.com> + * dwarf2.c (find_debug_info): New function: Locate a section + containing dwarf2 debug information. + (bfd_dwarf2_find_nearest_line): Find all sections containing + debug information and include them in the stash. - * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version - definitions. We must not assume they are sorted in the file - according to their index numbers. +2000-09-01 Niibe Yutaka <gniibe@m17n.org>, Kaz Kojima <kkojima@rr.iij4u.or.jp>, Alexandre Oliva <aoliva@redhat.com> -2000-09-06 Philip Blundell <philb@gnu.org> + * elf32-sh.c (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT, + R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): New. + (sh_reloc_map): Add new relocs. + (sh_elf_check_relocs, sh_elf_link_hash_newfunc, + sh_elf_link_hash_table_create, sh_elf_adjust_dynamic_symbol, + sh_elf_size_dynamic_sections, sh_elf_finish_dynamic_symbol, + sh_elf_finishe_dynamic_sections, sh_elf_discard_copies): New + functions. + (ELF_DYNAMIC_INTERPRETER, PLT_ENTRY_SIZE): Define. + (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le, + elf_sh_plt_entry_be, elf_sh_plt_entry_le, + elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): + New array constants. + (elf_sh_plt0_entry, elf_sh_plt_entry, elf_sh_pic_plt_entry): + New variables. + (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, + elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset, + elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset, + elf_sh_plt_reloc_offset): Define. + (elf_sh_pcrel_relocs_copied, elf_sh_link_hash_entry, + elf_sh_link_hash_table): New structs. + (sh_elf_link_hash_traverse, sh_elf_hash_table): New macros. + (sh_elf_relocate_section, sh_elf_check_relocs): Handle new + relocation types. + (elf_backend_create_dynamic_sections, + bfd_elf32_bfd_link_hash_table_create, + elf_backend_adjust_dynamic_symbol, + elf_backend_size_dynamic_sections, + elf_backend_finish_dynamic_symbol, + elf_backend_finish_dynamic_sections, elf_backend_want_got_plt, + elf_backend_plt_readonly, elf_backend_want_plt_sym, + elf_backend_got_header_size, elf_backend_plt_header_size): + Define. + * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, BFD_RELOC_SH_GOTPC): + New relocs. + * bfd-in2.h, libbfd.h: Rebuilt. - * config.bfd (arm*-*-uclinux*): New target. - (armeb-*-elf, arm*b-*-linux-gnu*): Likewise. +2000-09-01 Alan Modra <alan@linuxcare.com.au> + + * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert 2000-08-27 + change. + +2000-08-31 J"orn Rennecke <amylaar@cygnus.co.uk> + + * elf32-sh.c (sh_elf_merge_private_data): If ibfd's elf header flags + not initialized, set them to indicate the SH1 instruction set. + +2000-08-31 Alexandre Oliva <aoliva@redhat.com> + + * acinclude.m4: Include libtool and gettext macros from the + top level. + * aclocal.m4, configure: Rebuilt. + +2000-08-29 Michael Snyder <msnyder@seadog.cygnus.com> + + * elf.c: Eliminate references to __sparcv9 macro; replace with + autoconf variables HAVE_PSINFO32_T etc. + * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T, + HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO. + * config.in: Ditto. + * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can + detect the above typedefs. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto. + * aclocal.m4: Ditto. + * configure: Regenerate. + +2000-08-27 Alan Modra <alan@linuxcare.com.au> + + * elf32-i386.c (elf_i386_check_relocs): Keep info on relocs copied + for any shared link, not just shared -Bsymbolic. + (elf_i386_size_dynamic_sections): Call elf_i386_discard_copies on + any shared link, and pass link info to it. + (elf_i386_size_dynamic_sections): Update comment. + (elf_i386_discard_copies): Modify to discard relocs for symbols + that have been forced local. + (elf_i386_finish_dynamic_symbol): Don't copy relocs for symbols + that have been forced local. + +2000-08-24 Denis Chertykov <denisc@overta.ru> & Nick Clifton <nickc@redhat.com> + + * elflink.h (elf_link_add_object_symbols): Allow common + symbols to have an alignment of 1 if explicitly requested, and + not overridden by other definitions. 2000-08-22 Doug Kwan <dkwan@transmeta.com> * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo. * coffcode.h (coff_set_flags): Add detection of w65 architecture. -2000-04-14 Matthew Green <mrg@cygnus.com> - - * config.bfd: Add NetBSD/sparc64 support. +2000-08-22 H.J. Lu <hjl@gnu.org> + + * elf-bfd.h (elf_link_hash_table): Add runpath. + + * bfd-in.h (bfd_elf_get_runpath_list): New prototype. + * bfd-in2.h: Rebuilt. + + * elf.c (_bfd_elf_link_hash_table_init): Initialize the + "runpath" field to NULL. + (bfd_elf_get_runpath_list): New function. + + * elflink.h (elf_link_add_object_symbols): Record DT_RPATH and + DT_RUNPATH entries. + +2000-08-22 Alexandre Oliva <aoliva@redhat.com> + + * elf32-sh.c (sh_elf_relocate_section) [R_SH_IND12W, + R_SH_DIR8WPN, R_SH_DIR8WPZ, R_SH_DIR8WPL]: Handle them + explicitly. Improve validation of r_type. + +2000-08-21 H.J. Lu <hjl@gnu.org> + + * elf32-i386.c (elf_i386_size_dynamic_sections): Zero out the + dynamic allocated content space. Add a comment to remind us that + one day this ought to be fixed. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + +2000-08-21 Jason Eckhardt <jle@cygnus.com> + + * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate + field with the newly relocated value instead of adding it to the + existing immediate field. + (elf32_i860_relocate_splitn): Likewise. + (elf32_i860_relocate_highadj): Likewise. + +2000-08-16 Jason Eckhardt <jle@cygnus.com> + + * elf32-i860.c (elf32_i860_relocate_pc16): Implemented function (it + was previously just a stub). + +2000-08-16 Alexandre Oliva <aoliva@redhat.com> + + * elflink.c (_bfd_elf_create_got_section): Don't abort(). + Formatting fixes. + (_bfd_elf_create_dynamic_sections): Likewise. + +2000-08-16 Andrew Macleod <amacleod@cygnus.com> + + * elf64-sparc.c (sparc64_elf_relocate_section): Set relocation address + for undefined symbols to be the beginning of the section. + + * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Don't allocate + four extra entries at the beginning of the .rela.plt section. + (sparc64_elf_finish_dynamic_symbol): Adjust the offset in the .rela.plt + section to account for the four reserved entries in the .plt section. + +2000-08-15 Geoffrey Keating <geoffk@cygnus.com> + + * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Add ori r0,r0,0 + to the list of NOPs we recognize after a branch-and-link. + Use the ori NOP when one is needed. + + * coff-rs6000.c (_bfd_xcoff_slurp_armap): Finish implementation + for large archives. + +2000-08-14 Jim Wilson <wilson@cygnus.com> + + * elf64-ia64.c (elf64_ia64_merge_private_bfd_data): Handle + EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP, and EF_IA_64_NOFUNCDESC_CONS_GP. + (elf64_ia64_print_private_bfd_data): Likewise. Also handle + EF_IA_64_ABSOLUTE. + +2000-08-11 Alexandre Oliva <aoliva@redhat.com> + + * elf32-sh.c (sh_elf_set_mach_from_flags): Make it static. + +2000-08-10 Jason Eckhardt <jle@cygnus.com> + + * elf32-i860.c (elf32_i860_relocate_section): New function. + (i860_final_link_relocate): New function. + (elf32_i860_relocate_splitn): New function. + (elf32_i860_relocate_pc16): New function. + (elf32_i860_relocate_highadj): New function. + (elf32_i860_howto): Minor adjustments to some relocations. + (elf_info_to_howto_rel): Define. + (elf_backend_relocate_section): Define. + +2000-08-10 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.h: Fix formatting. + +2000-08-10 Bernd Schmidt <bernds@cygnus.co.uk> + + * elf32-sh.c (sh_elf_reloc_loop): Make LAST_SYMBOL_SECTION static. + +2000-08-08 Jason Eckhardt <jle@cygnus.com> + + * elf32-i860.c (elf32_i860_howto_table): Updated some fields. + +2000-08-07 Kazu Hirata <kazu@hxi.com> + + * ieee.c (ieee_write_debug_part): Rewrite a comment. + * elf64-ia64.c: Fix a typo. + +2000-08-05 Jason Eckhardt <jle@cygnus.com> + + * elf32-i860 (elf32_i860_howto_table): New structure. + (lookup_howto): New function. + (elf32_i860_reloc_type_lookup): New function. + (elf32_i860_info_to_howto_rela): New function. + (elf_code_to_howto_index): New structure. + (elf_info_to_howto): Re-define as elf32_i860_info_to_howto_rela. + (bfd_elf32_bfd_reloc_type_lookup): Re-define as + elf32_i860_reloc_type_lookup. + +2000-08-04 Rodney Brown <RodneyBrown@pmsc.com> + + * som.c (struct fixup_format): Constify `format'. + (som_hppa_howto_table): Use SOM_HOWTO macro. + (try_prev_fixup, hppa_som_reloc): Decorate unused parameter. + (som_bfd_reloc_type_lookup): Likewise. + (compare_subspaces): Remove unused `count1', `count2'. + (som_begin_writing): Remove unused `total_reloc_size'. + (som_bfd_derive_misc_symbol_info): Decorate unused parameter. + (som_print_symbol, som_bfd_is_local_label_name): Likewise. + (som_set_reloc_info): Constify `cp'. Remove unused `addend'. + (som_find_nearest_line): Decorate unused parameter(s). + (som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise. + (som_bfd_link_split_section): Likewise. + +2000-08-03 Nick Clifton <nickc@cygnus.com> + + * section.c: Restore backed out code. + * elf.c: Restore backed out code. + (copy_private_bfd_data): Fix bug preventing stipped dynamic + binaries from working. + * bfd-in2.h: Regenerate. + +2000-08-03 H.J. Lu <hjl@gnu.org> + + * section.c: Back out the change made by Nick Clifton + <nickc@cygnus.com> on 2000-07-31. It breaks stripping dynamic + binaries. + * bfd-in2.h: Likewise. + * elf.c: Likewise. + +2000-08-03 Alexandre Oliva <aoliva@redhat.com> + + * elf32-sh.c (sh_elf_reloc_loop): Warning removal. + +2000-07-31 Jason Eckhardt <jle@cygnus.com> + + * reloc.c (BFD_RELOC_860_*): New bfd relocs for i860. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-07-31 Nick Clifton <nickc@cygnus.com> + + * section.c (struct sec): Add new boolean field 'segment_mark'. + (STD_SECTION): Initialise new field to zero. + + * bfd-in2.h: Regenerate. + + * elf.c (copy_private_bfd_data): Reorganise section to segment + mapping to cope with moved sections requiring new segments, + and overlapping segments. + (SEGMENT_END): New macro: Return the end address of a segment. + (IS_CONTAINED_BY_VMA): New macro: Determine if a segment + contains a section by comparing their VMA addresses. + (IS_CONTAINED_BY_LMA): New macro: Determine if a segment + contains a section by comparing their LMA addresses. + (INCLUDE_SECTION_IN_SEGMENT): New macro: Determine if a + section should be included in a segment. + (SEGMENT_AFTER_SEGMENT): New macro: Determine if one segment + follows another in memory. + (SEGMENT_OVERLAPS_SEGMENT): New macro: Determine if two + segments overlap. + +2000-07-22 Jason Eckhardt <jle@cygnus.com> + + * cpu-i860.c: Added comments. + + * elf32-i860.c (TARGET_LITTLE_SYM): Defined to + bfd_elf32_i860_little_vec. + (TARGET_LITTLE_NAME): Defined to "elf32-i860-little". + (ELF_MAXPAGESIZE): Changed to 4096. + + * targets.c (bfd_elf32_i860_little_vec): Declaration of + new target. + (bfd_target_vector): Added bfd_elf32_i860_little_vec. + + * config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added + config for little endian elf32 i860. + (targ_defvec): Define for the new config above + as "bfd_elf32_i860_little_vec". + (targ_selvecs): Define for the new config above + as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec" + + * configure.in (bfd_elf32_i860_little_vec): Added recognition + of new target vec. + + * configure: Regenerated. + +2000-07-27 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_merge_symbol): Take one more argument, + dt_needed, to indicate if the symbol comes from a DT_NEEDED + entry. Don't overide the existing weak definition if dt_needed + is true. + (elf_link_add_object_symbols): Pass dt_needed to + elf_merge_symbol (). + +2000-07-27 Nick Clifton <nickc@cygnus.com> + + * elflink.h (elf_link_size_reloc_section): Zeroes the section's + allocated contents. + +2000-07-25 Geoffrey Keating <geoffk@cygnus.com> + + * configure.host (*-*-aix*): AIX has 'long long' always. + + * coff-rs6000.c (xcoff_write_one_armap_big): New procedure. + (xcoff_write_armap_big): Write both 32-bit and 64-bit armaps. + (xcoff_write_archive_contents_big): Don't update the offset + of the symbol table, xcoff_write_armap will do it. + +2000-07-23 Ulf Carlsson <ulfc@engr.sgi.com> + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead + of dynobj for SGI_COMPAT checks. + +2000-07-21 Michael Sokolov <msokolov@ivan.Harhan.ORG> + + * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): New function. + * bfd-in.h (bfd_m68k_coff_create_embedded_relocs): Add declaration. + * bfd-in2.h: Regenerate. + +2000-07-21 Nick Clifton <nickc@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Detect out of + range symbol indices in relocs and issue an error message. + +2000-07-20 H.J. Lu <hjl@gnu.org> + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't check + info->new_dtags when setting DT_FLAGS_1. It will only be set + by the new linker options. It shouldn't break anything. + +2000-07-20 H.J. Lu <hjl@gnu.org> + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set DT_FLAGS_1 + only if info->new_dtags is true. + +2000-07-20 H.J. Lu <hjl@gnu.org> + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set + DT_RUNPATH and DT_FLAGS only if info->new_dtags is true. + +2000-07-20 Hans-Peter Nilsson <hp@axis.com> + + * Makefile.am (ALL_MACHINES): Add cpu-cris.lo. + (ALL_MACHINES_CFILES): Add cpu-cris.c. + (BFD32_BACKENDS): Add aout-cris.lo and elf32-cris.lo. + (BFD32_BACKENDS_CFILES): Add aout-cris.c and elf32-cris.c. + (cpu-cris.lo, aout-cris.lo, elf32-cris.lo): New rules. + * Makefile.in: Rebuild. + * aclocal.m4: Rebuild. + * aoutx.h (NAME(aout,machine_type)): Add case for bfd_arch_cris. + * archures.c (enum bfd_architecture): Add bfd_arch_cris. + (bfd_cris_arch): Declare. + (bfd_archures_list): Add bfd_cris_arch. + * bfd-in2.h: Rebuild. + * config.bfd: (cris-*-*): New target. + * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vectors. + * configure: Rebuild. + * elf.c (prep_headers): Add bfd_arch_cris. + * libbfd.h: Rebuild. + * libaout.h (enum machine_type): Add M_CRIS. + * reloc.c: Add CRIS relocations. + * targets.c (bfd_elf32_cris_vec, cris_aout_vec): Declare. + (bfd_target_vect): Add bfd_elf32_cris_vec and cris_aout_vec. + * cpu-cris.c, aout-cris.c, elf32-cris.c: New files. + * po/POTFILES.in, po/bfd.pot: Regenerate. + +2000-07-19 H.J. Lu <hjl@gnu.org> + + * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set + DF_TEXTREL if DT_TEXTREL is set. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also + set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if + DT_RPATH is set. + Set the DT_FLAGS and DT_FLAGS_1 entries if necessary. + +2000-07-19 H.J. Lu <hjl@gnu.org> + + * bfd-in.h (bfd_elf_set_dt_needed_soname): New. + * bfd-in2.h: Rebuild. + + * elf-bfd.h (elf_obj_tdata): Add dt_soname. + (elf_dt_soname): New. + + * elf.c (bfd_elf_set_dt_needed_soname): New. + + * elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED + entry if the shared object loaded by DT_NEEDED is used to + resolve the reference in a regular object. + +2000-07-19 H.J. Lu <hjl@gnu.org> + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_CONFIG, + DT_DEPAUDIT and DT_AUDIT as strings. + +2000-07-19 Nick Clifton <nickc@cygnus.com> + + * format.c: Fix formatting. + +2000-07-19 H.J. Lu <hjl@gnu.org> + + * elf.c (_bfd_elf_print_private_bfd_data): Fix DT_CHECKSUM. + +2000-07-19 H.J. Lu <hjl@gnu.org> + + * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_BIND_NOW, + DT_INIT_ARRAY, DT_FINI_ARRAY, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ, + DT_RUNPATH, DT_FLAGS, DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ, + DT_PLTPADSZ, DT_MOVEENT, DT_MOVESZ, DT_FEATURE, DT_POSFLAG_1, + DT_SYMINSZ, DT_SYMINENT, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT, + DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT, DT_RELCOUNT, + DT_FLAGS_1, DT_USED and DT_CHECKSUM. + +2000-07-18 Andrew Cagney <cagney@b1.cygnus.com> + + * elf.c (bfd_elf_get_sign_extend_vma, bfd_elf_get_arch_size): Move + renamed functions from here... + (assign_section_numbers): Use renamed functions. + (prep_headers): Use renamed functions. + + * bfd.c (bfd_get_sign_extend_vma, bfd_get_arch_size): ...To here. + * bfd-in.h (bfd_get_sign_extend_vma, bfd_get_arch_size): Update. + * bfd-in2.h: Regenerate. + +2000-07-18 Ulf Carlsson <ulfc@engr.sgi.com> + + * elf32-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Add + parenthesis in if statement. + +2000-07-17 Koundinya K <kk@ddeorg.soft.net> + + Enable the support for Traditional MIPS. + * elf32-mips.c (IRIX_COMPAT): Recognize bfd_elf32_tradbigmips_vecand + return ict_none appropriately for traditional mips targets. + (STUB_LW): Change 0x8f998000 to 0x8f998010 for traditional mips. + (STUB_MOVE): Conditionalize for traditonal mips. + (STUB_LI16): Likewise. + (_bfd_mips_elf_modify_segment_map): Conditionalize to avoid making + room for RTPROC header. + (_bfd_mips_elf_modify_segment_map): For a normal mips executable set + the permission for the PT_DYNAMIC as read, write and execute. + (mips_elf_calculate_relocation): Check for the symbol _DYNAMIC_LINKING + for traditonal mips. + (_bfd_mips_elf_create_dynamic_sections): Add the symbol + _DYNAMIC_LINKING for traditonal mips. + (_bfd_mips_elf_create_dynamic_sections): Add the symbol __RLD_MAP + in case of traditonal mips. + (_bfd_mips_elf_adjust_dynamic_symbol): Create a stub only if a PLT + entry is required. For a function if PLT is not required then set the + corresponding hash table entry to 0. + (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG entry for + traditonal mips. + (_bfd_mips_elf_finish_dynamic_symbol): for a undefined symbol in a + shared object set the value to 0. + (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol + _DYNAMIC_LINKING for traditonal mips. + (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol __RLD_MAP + for traditonal mips. + +2000-07-15 H.J. Lu <hjl@gnu.org> + + * aoutx.h (translate_to_native_sym_flags): Handle BSF_LOCAL. + +2000-07-12 Charles Wilson <cwilson@ece.gatech.edu> + + * libbfd.c (bfd_seek): fix 'seek beyond EOF' error when writing + out a structure that is BFD_IN_MEMORY. + +2000-07-11 Alan Modra <alan@linuxcare.com.au> + + * elf64-hppa.c (get_dyn_name): Pass in section pointer instead of + bfd pointer. Print section id instead of bfd pointer for local + syms. Prefix addend with `+' for global syms as well as local. + Correct calculation of name component lengths. + (elf64_hppa_check_relocs): Update call to get_dyn_name. + + From David Huggins-Daines <dhd@linuxcare.com> + * elf-hppa.h (elf_hppa_relocate_section): Update calls here too. + * elf64-hppa.c (elf64_hppa_check_relocs): Fix some warnings. + (elf64_hppa_modify_segment_map): Likewise. + +2000-07-11 Andrew Cagney <cagney@b1.cygnus.com> + + * elf.c (bfd_elf_get_sign_extend_vma): Return tendency of VMA + addresses to be "naturally" sign extended. Return -1 if unknown. + * bfd-in.h (bfd_elf_get_sign_extend_vma): Add declaration. + * bfd-in2.h: Regenerate. + +2000-07-11 Andrew Cagney <cagney@b1.cygnus.com> + + * ecoffswap.h (ecoff_get_off, ecoff_put_off): Add ECOFF_SIGNED_32 + and ECOF_SIGNED_64 to list ways to extract an offset. + (ecoff_swap_fdr_in, ecoff_swap_fdr_out, ecoff_swap_pdr_in, + ecoff_swap_pdr_out, ecoff_swap_ext_in, ecoff_swap_ext_out): + Update. + * elf64-mips.c (ECOFF_SIGNED_64): Define instead of ECOFF_64. + * elf32-mips.c (ECOFF_SIGNED_32): Define instead of ECOFF_32. + +2000-07-11 Andrew Cagney <cagney@b1.cygnus.com> + + * elfcode.h (elf_object_p): Use bfd_set_start_address and not + bfd_get_start_address. + (elf_swap_ehdr_in): Sign extend e_entry when applicable. + (elf_swap_ehdr_out): Ditto. + +2000-07-10 Alexander Aganichev <AAganichev@hypercom.com> + + * archures.c (bfd_default_scan): Add set of bfd_mach_ cases for + compatibility with older binutils. + +2000-07-10 Alan Modra <alan@linuxcare.com.au> + + * section.c (bfd_make_section_anyway): Start section_id at 0x10. + (STD_SECTION): Avoid negative ids, instead use 0 to 3. + + From Ryan Bradetich <rbradetich@uswest.net> + * dwarf1.c (parse_die): Cure signed/unsigned char warnings. + (parse_line_table): Ditto. + (_bfd_dwarf1_find_nearest_line): Ditto. + * syms.c (cmpindexentry): Remove extra `*' from params. + +2000-07-09 Koundinya K <kk@ddeorg.soft.net> + + * elf32-mips.c (sort_dynamic_relocs): New Function. + (_bfd_mips_elf_finish_dynamic_sections): Call sort_dynamic_relocs + via qsort to sort the dynamic relocations in increasing r_symndx + value. + +2000-07-09 Alan Modra <alan@linuxcare.com.au> + + * elf64-hppa.c (elf64_hppa_dyn_hash_table_init): Add + ATTRIBUTE_UNUSED to unused args. + (get_opd): Likewise. + (get_plt): Likewise. + (get_dlt): Likewise. + (get_stub): Likewise. + (elf64_hppa_adjust_dynamic_symbol): Likewise. + (elf64_hppa_link_output_symbol_hook): Likewise. + (elf64_hppa_check_relocs): Delete unused var. + (elf64_hppa_size_dynamic_sections): Likewise. + (elf64_hppa_finalize_opd): Likewise. + (elf64_hppa_finalize_dynreloc): Likewise. + (elf64_hppa_modify_segment_map): Likewise. + (elf64_hppa_finish_dynamic_sections): Likewise. + + * elf-hppa.h (elf_hppa_final_write_processing): Add + ATTRIBUTE_UNUSED to unused args. + (elf_hppa_final_link_relocate): Likewise. + (elf_hppa_record_segment_addrs): Add paretheses. + (elf_hppa_relocate_section): Constify dyn_name. + + From David Huggins-Daines <dhd@linuxcare.com> + * config.bfd: Add hppa*64*-*-linux-gnu 64-bit target, and + rearrange case statement so that it gets preferred to 32-bit ones. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Use + asection->id instead of address of asection structure. + (elf32_hppa_size_stubs): Likewise. + + * elf32-hppa.c (elf32_hppa_size_stubs): Use just one stub section + for .init* and .fini*. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Mask pointers + and addends used in stub names to 32 bits. + (elf32_hppa_size_stubs): Likewise. + + * elf-hppa.h (elf_hppa_final_link_relocate): Don't sum addend + twice for R_PARISC_GPREL64. Use bfd_put_32 for R_PARISC_PCREL32, + not bfd_put_64. Fix minor comment typo and formatting. + + Changes to create multiple linker stubs, positioned immediately + before the section where they are required. + * elf32-hppa.c: Don't include hppa_stubs.h. + (elf32_hppa_stub_hash_entry): Add a pointer to the stub section. + (elf32_hppa_stub_hash_table): Delete. + (elf32_hppa_link_hash_entry): Delete. + (elf32_hppa_link_hash_table): Use plain bfd_hash_table for + stub_hash_table, and store the struct here rather than a pointer. + Delete output_symbol_count. Add offset array. Change + global_value to a bfd_vma. + (elf32_hppa_stub_hash_lookup): Use table instead of table->root. + (elf32_hppa_stub_hash_traverse): Delete. + (elf32_hppa_name_of_stub): Delete. + (elf32_hppa_link_hash_lookup): Delete. + (elf32_hppa_link_hash_traverse): Delete. + (elf32_hppa_stub_hash_table_init): Delete. + (elf32_hppa_size_of_stub): Pass input section and offset rather + than location and calculate location here. Don't pass name as all + stubs are now the same size. + (elf32_hppa_stub_hash_newfunc): Init new fields. + (elf32_hppa_link_hash_table_create): Likewise, and stub_hash_table + too. + (elf32_hppa_bfd_final_link_relocate): Cast enums to int before + comparing against ints. Rewrite stub handling code. + (elf32_hppa_relocate_section): Make r_type and r_symndx unsigned. + Case enums to int before comparing against ints. Remove + bfd_reloc_dangerous case. + (elf32_hppa_build_one_stub): Rewrite. + (elf32_hppa_size_one_stub): New function. + (elf32_hppa_build_stubs): Rewrite. + (elf32_hppa_size_stubs): Pass in linker call-back functions. + Rewrite stub-handling specific code. + + * elf32-hppa.h (elf32_hppa_size_stubs): Update prototype. + + * elf64-hppa.c (elf64_hppa_dyn_hash_entry): Fix a comment typo. + + * hppa_stubs.h: Delete. + * Makefile.am (SOURCE_HFILES): Remove hppa_stubs.h + (elf32-hppa.lo): Remove hppa_stubs.h from dependencies. + * Makefile.in: Regenerate. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle e_nlsel and + e_nlrsel. + + * libhppa.h (hppa_field_adjust): Correct e_nsel case. + + * elf32-hppa.c (elf32_hppa_relocate_section): Mention the offset + and section name for bfd_reloc_notsupported error message. + (elf32_hppa_bfd_final_link_relocate): Print reasons for returning + bfd_reloc_notsupported. + (elf32_hppa_relocate_section): Add ATTRIBUTE_UNUSED to output_bfd. + + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Handle + undefined weak symbols for all relocs. + (elf32_hppa_size_of_stub): Adjust calculation by 8 since branch + offsets are relative to one past the delay slot. + (elf32_hppa_size_stubs): Account for reloc addend when calculating + branch destination. Put addend into stub name too. + (elf32_hppa_bfd_final_link_relocate): Account for reloc addend and + adjust by 8 when deciding whether a linker stub is needed. Put + addend into stub name as for above. + + * elf32-hppa.c (hppa_elf_relocate_insn): Change signed/unsigned on + various args and vars. + (elf32_hppa_bfd_final_link_relocate): Here too. + (elf32_hppa_size_stubs): Rename index -> indx. Use e_indx for + inner block var to avoid shadowing. + + * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Make `field' arg + unsigned. + * elf64-hppa.h (_bfd_elf64_hppa_gen_reloc_type): Ditto. + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Ditto. + (elf_hppa_fake_sections): Rename local var to avoid shadowing. + + * libhppa.h: Change practically all unsigned ints to plain ints. + Remove tests on gcc version. Instead use ATTRIBUTE_UNUSED for + prototypes. + + From Ryan Bradetich <rbradetich@uswest.net> + * libhppa.h (hppa_opcode_type): New enum to replace #define's. + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Modify to + suit above. + From David Huggins-Daines <dhd@linuxcare.com> + * elf-hppa.h (elf_hppa_relocate_insn): Update the opcode constants + to the new OP_* ones. + + * elf32-hppa.c (elf32_hppa_size_stubs): Consolidate freeing on + error exit. Bail out earlier on plabel relocs that we aren't + interested in. Don't tell elf32_hppa_stub_hash_lookup to copy + string, and then don't free our copy. + (elf32_hppa_build_one_stub): Make insn unsigned int. + + * libhppa.h (bfd_hppa_insn2fmt): 22 bit branches are only + available with BL, not BE and BLE. + + * elf32-hppa.c (hppa_elf_relocate_insn): Add some more example + code for elf arg relocs. + (elf32_hppa_bfd_final_link_relocate): Replace boolean is_local + argument with elf_link_hash_entry h. Handle undefined weak + symbols. Move $global$ lookup from here... + (elf32_hppa_relocate_section): ...to here. Return correct error + message for non-handled relocs. + (elf32_hppa_size_of_stub): Correctly test branch range. Previous + wrong test was -0x3ffff to +0x40000. + + * elf-hppa.h (elf_hppa_final_link_relocate): R_PARISC_DIR17R, + R_PARISC_DIR17F, and R_PARISC_DIR21L are for absolute branches; + Handle them as such. + (elf_hppa_relocate_insn): Fix a typo. + + * libhppa.h (GET_FIELD, GET_BIT, MASK, CATENATE, ELEVEN): Delete. + (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, + assemble_17, assemble_21): Delete. + Supply defines for all 64 possible opcodes. + (bfd_hppa_insn2fmt): Add bfd argument, and use to select wide mode + formats. Handle COMICLR. + (hppa_rebuild_insn): Delete bfd argument. Handle formats 10, -11, + -10, -16, 16, 22. + + * elf32-hppa.c (hppa_elf_relocate_insn): Complete rewrite. + (elf32_hppa_bfd_final_link_relocate): Major rewrite. + (elf32_hppa_build_one_stub): Modify hppa_elf_relocate_insn calls + to suit. + (elf32_hppa_size_stubs): Don't free stub_name twice. Read in all + the local syms - did this code get deleted accidentally? Ignore + undefined and undefweak syms. + + * elf-hppa.h (elf_hppa_final_link): Move hppa_info to outermost + block. Use it instead of elf64_hppa_hash_table (info). + (elf_hppa_final_link_relocate): Use hppa_info instead of + elf64_hppa_hash_table (info). + + * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, + re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. + (hppa_rebuild_insn): Mask immediate bits here instead. + * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. + +2000-07-08 Alan Modra <alan@linuxcare.com.au> + + * section.c (struct sec): Add id field. Tidy comment formatting. + (bfd_make_section_anyway): Set id. + (STD_SECTION): Init id too. + Change CONST to const throughout. + * archures.c (bfd_arch_info): Tidy comment. + (bfd_arch_list): Change a CONST to const. + * libbfd-in.h: Tidy comments and replace CONST with const. + * elf-bfd.h: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + +2000-07-07 DJ Delorie <dj@redhat.com> + + * archive.c (_bfd_write_archive_contents): Add an informative + comment. + +2000-07-06 Kazu Hirata <kazu@hxi.com> + + * srec.c: Fix formatting. + +2000-06-05 DJ Delorie <dj@redhat.com> + + * MAINTAINERS: new + +2000-07-04 Alexandre Oliva <aoliva@redhat.com> + + * coff-arm.c (coff_arm_relocate_section): Do not ignore the symbol + value of PC-relative offsets. + +2000-07-03 Jim Wilson <wilson@cygnus.com> + + * elf64-alpha.c (alpha_elf_size_info): New. + (elf_backend_size_info): Define to alpha_elf_size_info. + * elfcode.h (elf_size_info): Change hash bucket size to 4. + +2000-07-03 Ulf Carlsson <ulfc@engr.sgi.com> + + * elf32-mips.c: Include elf32-target.h again for the traditional + MIPS targets. -2000-05-31 Mark Kettenis <kettenis@gnu.org> +2000-07-03 Marek Michalkiewicz <marekm@linux.org.pl> + + * elf32-avr.c (bfd_elf32_bfd_reloc_type_lookup): + Add ATTRIBUTE_UNUSED to unused arguments to avoid warnings. + (avr_info_to_howto_rela): Likewise. + (elf32_avr_gc_mark_hook): Likewise. + (elf32_avr_gc_sweep_hook): Likewise. + (elf32_avr_relocate_section): Likewise. + +2000-07-03 Mark Elbrecht <snowball3@bigfoot.com> + + * cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into + an external symbol for a non-shared, non-relocatable link. + +2000-07-03 Nick Clifton <nickc@redhat.com> + + * cofflink.c (IS_EXTERNAL): New macro: Return true if the symbol + is an external symbol. + (IS_WEAK_EXTERNAL): New macro: Return true if the symbol is a weak + external symbol. + +2000-07-03 Kazu Hirata <kazu@hxi.com> + + * reloc16.c: Fix formatting. + +2000-07-01 Koundinya K <kk@ddeorg.soft.net> + + * config.bfd: Change targ_defvec and targ_selvecs for mips*-*-sysv4* + to add a new target for traditional mips i.e + bfd_elf32_tradbigmips_vec and bfd_elf32_tradlittlemips_vec. + * configure.in: Likewise. + * configure: Rebuild. + * targets.c (bfd_elf32_tradbigmips_vec): Declare and put in + bfd_target_vector. + (bfd_elf32_tradlittlemips_vec): Likewise. + * elfxx-target.h: Add macro INCLUDED_TARGET_FILE which is more a test + to see that elfNN_bed does not get redefined even if the target file + is included twice for a chip. See elf32-mips.c. + +2000-07-01 Alan Modra <alan@linuxcare.com.au> + + * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed + (CLEANFILES): Add DEPA. + * Makefile.in: Regenerate. + +2000-06-30 DJ Delorie <dj@cygnus.com> + + * peicode.h (coff_swap_filehdr_in): can't use e_magic because we + can't assume the PE header is at 0x80. + +2000-06-29 Mark Elbrecht <snowball3@bigfoot.com> + + * syms.c (_bfd_stab_section_find_nearest_line): Use IS_ABSOLUTE_PATH. + +2000-06-28 Mark Elbrecht <snowball3@bigfoot.com> + + * go32stub.h: Update stub. + +2000-06-26 Marek Michalkiewicz <marekm@linux.org.pl> + + * archures.c (bfd_mach_avr5): Define. + * bfd-in2.h (bfd_mach_avr5): Define. + * cpu-avr.c (arch_info_struct): Rename bfd_mach_avr4 to + bfd_mach_avr5, add bfd_mach_avr4. Update comments. + (compatible): Update comment. Add missing test. + * elf32-avr.c (avr_final_link_relocate): Support 8K wrap + for avr2 and avr4. Simplify 8K wrap code. + (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr5. + (elf32_avr_object_p): Recognize E_AVR_MACH_AVR5. + +2000-06-26 Kazu Hirata <kazu@hxi.com> + + * coff-h8300.c: Fix formatting. + * cpu-h8300.c: Likewise. + +2000-06-24 Alexandre Oliva <aoliva@redhat.com> + + * elf32-arm.h (elf32_arm_final_link_relocate): Print `(local)' + for local symbols whose names are unknown. + +2000-06-22 Alan Modra <alan@linuxcare.com.au> + + * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we + find one. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2000-06-20 H.J. Lu <hjl@gnu.org> + + * Makefile.am: Rebuild dependency. + * Makefile.in: Rebuild. + +2000-06-20 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Map to the new function. + +2000-06-20 Alan Modra <alan@linuxcare.com.au> + + * archive.c (normalize): Correct pointer comparison when checking + for backslashes. + (bfd_bsd_truncate_arname): Likewise. + (bfd_gnu_truncate_arname): Likewise. + +2000-06-20 Ulf Carlsson <ulfc@engr.sgi.com> + + * elf-bfd.h (struct elf_obj_tdata): Define per BFD Irix 5 virtual + sections elf_{text,data}_{section,symbol}. + * elf32-mips.c: mips_elf_{text,data}_{section,symbol}{,_ptr}: Remove. + (_bfd_mips_elf_hide_symbol): New function. + (elf_backend_hide_symbol): Map to the new function. + (_bfd_mips_elf_add_symbol_hook): Change to use new per BFD + definitions of mips_elf_{text,data}_{section,symbol}. + (mips_elf_local_relocation_p): Try to find the direct symbol + based on new check_forced argument. + (mips_elf_calculate_relocation): Use new version of + mips_elf_local_relocation_p. + (mips_elf_relocate_section): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + (mips_elf_sort_hash_table): Only assert that have enough GOT + space. + (mips_elf_got16_entry): Match all 32 bits to the existing GOT + entry if the relocation based on the new external argument. + (mips_elf_create_dynamic_relocation): Assert that we have a + section contents allocated where we can swap out the dynamic + relocations. + (mips_elf_calculate_relocation): Find the real hash-table entry + correctly by using h->root.root.type. Only create a dynamic + relocation entry if the symbol is defined in a shared library. + Create an external GOT entry for the GOT16 relocation if the + symbol was forced local. + (_bfd_mips_elf_finish_dynamic_symbol): Don't assert there is a + dynamic index if the symbol was forced local. + +2000-06-20 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * elf32-mips.c: Fix typos in comments. + +2000-06-19 Mark Kettenis <kettenis@gnu.org> + + * rs6000-core.c: Wrap definition of `union VmInfo' within #ifdef + CORE_VERSION_1. + +2000-06-18 Stephane Carrez <stcarrez@worldnet.fr> + + * Makefile.in, bfd-in2.h, libbfd.h, configure: Rebuild. + * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES, BFD32_BACKENDS, + BFD32_BACKENDS_CFILES): Add 68hc12, 68hc11 files. + * configure.in (bfd_elf32_m68hc12_vec): Recognize. + (bfd_elf32_m68hc11_vec): Likewise. + * config.bfd (targ_cpu): Recognize 68hc12 and 68hc11. + Supports 68hc11 & 68hc12 at the same time. + * targets.c (bfd_elf32_m68hc12_vec): Declare and put in + bfd_target_vector. + (bfd_elf32_m68hc11_vec): Likewise. + * elf.c (prep_headers): Recognize bfd_arch_m68hc12 and 68hc11. + * archures.c (bfd_m68hc12_arch): Define and register in global list + (bfd_m68hc11_arch): Likewise. + * reloc.c (BFD_RELOC_M68HC11_HI8, BFD_RELOC_M68HC11_LO8, + BFD_RELOC_M68HC11_3B): Define. + * cpu-m68hc12.c, elf32-m68hc12.c: New files for 68hc12 support. + * cpu-m68hc11.c, elf32-m68hc11.c: New files for 68hc11 support. + +2000-06-18 Ulf Carlsson <ulfc@engr.sgi.com> + + * elf_bfd.h (struct elf_backend_data): Add info argument to + elf_backend_hide_symbol. + (_bfd_elf_link_hash_hide_symbol): Likewise. + * elf.c (_bfd_elf_link_hash_hide_symbol): Likewise. + * elf64-ia64.c (elf64_ia64_hash_hide_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. + (elf_link_assign_sym_version): Likewise. + +2000-06-18 H.J. Lu <hjl@gnu.org> + + * coff-i386.c (coff_i386_reloc): Don't return in case of + output_bfd == (bfd *) NULL if COFF_WITH_PE is defined. + Compensate PE relocations when linking with non-PE object + files to generate a non-PE executable. + +2000-06-17 Ulf Carlsson <ulfc@engr.sgi.com> + + * elf32-mips.c (mips_elf_calculate_relocation): Explicitly write + GOT entries if we're doing a static link or -Bsymbolic link. + +2000-06-15 Ulf Carlsson <ulfc@engr.sgi.com> + + * elflink.h (elf_link_adjust_relocs): Check for and call backend + specifific swap_reloc_{in,out} and swap_reloca_{in,out} if + available. + (elf_link_output_relocs): Likewise. + (elf_reloc_link_order): Likewise. + +2000-06-16 Nicholas Duffek <nsd@redhat.com> + + * archures.c (enum bfd_architecture): #define constants for + PowerPc and RS6000 machine numbers. + * bfd-in2.h: Regenerate. + * coffcode.h (coff_set_arch_mach_hook): #ifdef XCOFF64, set arch + to bfd_arch_powerpc instead of bfd_arch_rs6000. Refer to PowerPc + and RS6000 machine numbers using #defined constants from + archures.c. + * cpu-powerpc.c (arch_info_struct): Refer to PowerPc and RS6000 + machine numbers using #defined constants from archures.c. Add + entries for EC603e, 630, A35, RS64II, RS64III, 7400. Specify + 64-bit words in 620 entry. + * cpu-rs6000.c (arch_info_struct): Create with entries for RS1, + RSC, and RS2. + (bfd_rs6000_arch): Change default machine to 0 (bfd_mach_rs6k). + +2000-06-16 Nicholas Duffek <nsd@cygnus.com> + + * coffcode.h (coff_mkobject_hook): Set xcoff_tdata.xcoff64. + * libcoff-in.h (struct xcoff_tdata): Define xcoff64 field. + * libcoff.h (struct xcoff_tdata): Define xcoff64 field. + +2000-06-16 Nicholas Duffek <nsd@redhat.com> + + * bfd-in.h (bfd_family_coff): Define. + * bfd-in2.h: Regenerate. + * coffgen.c (coff_count_linenumbers, coff_symbol_from, + coff_find_nearest_line): Check COFFness using bfd_family_coff() + instead of bfd_target_coff_flavour. + * cofflink.c (_bfd_coff_final_link): Likewise. + * cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to + exclude XCOFF files. + * reloc.c (bfd_perform_relocation, bfd_install_relocation): + Likewise. + * targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour. + * xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour. + * xcofflink.c (XCOFF_XVECP): Delete. + (bfd_xcoff_link_record_set, bfd_xcoff_import_symbol, + bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc, + bfd_xcoff_record_link_assignment, + bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with + check for bfd_target_xcoff_flavour. + +2000-06-16 Nicholas Duffek <nsd@redhat.com> + + * rs6000-core.c: Support 64-bit core files, support pre-4.3 core + files on AIX 4.3. + (read_hdr): New function. + (rs6000coff_core_p): Store mstsave or __context64 struct instead + of trying to extract individual registers. Set abfd->arch_info + to match the architecture that created the core file. + (rs6000coff_get_section_contents): Delete. + * xcoff-target.h (rs6000coff_get_section_contents): Delete. + +2000-06-14 H.J. Lu <hjl@gnu.org> + + * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_rec) + is NULL. + +2000-06-13 H.J. Lu <hjl@gnu.org> - Add support for FreeBSD/Alpha. - * configure.in: Add alpha*-*-freebsd* entry to prevent including - OSF core file support. * configure: Regenerate. +2000-06-13 J"orn Rennecke <amylaar@cygnus.co.uk> + + * peicode.h (pe_ILF_object_p): Use TARGET_LITTLE_SYM instead of + armpei_little_vec. + +2000-06-08 David O'Brien <obrien@FreeBSD.org> + + * configure.in (VERSION): Update to show this is the CVS mainline. + +2000-06-07 Alan Modra <alan@linuxcare.com.au> + + * elf32-d10v.c: Include elf/d10v.h + (enum reloc_type): Delete. + * elf32-d30v.c: Include elf/d30v.h + (enum reloc_type): Delete. + + * Makefile.am: Run "make dep-am" to regenerate dependencies. + * Makefile.in: Regenerate. + + * elf32-i386.c (elf_howto_table): Remove EMPTY_HOWTOs. + (elf32_i386_vtinherit_howto, elf32_i386_vtentry_howto): Delete and + move HOWTOs into elf_howto_table. + (R_386_standard, R_386_ext_offset): Define. + (R_386_ext, R_386_vt_offset, R_386_vt): Define. + (elf_i386_reloc_type_lookup): Modify calculation of index into + elf_howto_table since we've removed the padding. + (elf_i386_info_to_howto_rel): Likewise. + (elf_i386_relocate_section): Likewise. + +2000-06-06 Michael Snyder <msnyder@seadog.cygnus.com> + + * elf.c (elf_grok_pr_status): Eliminate reference to prgregset_t. + +2000-06-05 H.J. Lu <hjl@gnu.org> + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag + an error when seeing an undefined symbol with hidden/internal + attribute. It is handled in *_relocate_section (). + +2000-06-05 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_fix_symbol_flags): Follow the link for the + indirect symbol for the ELF_LINK_NON_ELF bit. + (elf_link_output_extsym): Don't output the indirect symbol even + if the ELF_LINK_NON_ELF bit is set. + +2000-06-01 J.T. Conklin <jtc@redback.com> + + * config.bfd (i[3456]86-*-netbsdelf*): New target. + (i[3456]86-*-netbsdaout*): New target. + (i[3456]86-*-netbsd*): Add bfd_elf32_i386_vec to targ_selvecs. + (i[3456]86-*-openbsd*): Likewise. + +2000-05-30 Andrew Cagney <cagney@b1.cygnus.com> + + * trad-core.c: From hpux-core.c, include <dirent.h> or + <sys/ndir.h> when possible. + +2000-05-31 Nick Clifton <nickc@cygnus.com> + + * opintl.h (_(String)): Explain why dgettext is used instead + of gettext. + +2000-05-31 Ulrich Drepper <drepper@redhat.com> + + * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version + definitions. We must not assume they are sorted in the file + according to their index numbers. + +2000-05-31 Alan Modra <alan@linuxcare.com.au> + + * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field + selector for R_PARISC_PCREL17R. R_PARISC_DIR17R and + R_PARISC_DIR17F are for absolute branches; Handle them as such. + +2000-05-30 Nick Clifton <nickc@cygnus.com> + + * cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB, + 80960CA, 80960MC as valid machine names. + +2000-05-30 H.J. Lu <hjl@gnu.org> + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the + visibility bits if the symbol is undefined. Correctly handle + weak undefined symbols with hidden and internal attributes. + + * elflink.h (elf_link_add_object_symbols): Always turn the + symbol into local if it has the hidden or internal attribute. + 2000-05-29 Philip Blundell <philb@gnu.org> - * ppcboot.c: Add packed attribute if compiling with GCC. + * ppcboot.c: Add packed attribute if compiling with GCC. 2000-05-29 Anatoly Vorobey <mellon@pobox.com> * elf.c (_bfd_elf_link_hash_table_init): Initialize dynlocal. +2000-05-26 Michael Snyder <msnyder@seadog.cygnus.com> + + * elf.c (elfcore_grok_prstatus, elfcore_grok_pstatus, + elfcore_grok_psinfo): Add code to allow debugging a 32-bit + corefile on a 64-bit (Sparc Solaris) host. Also clean up + a few old comments. + 2000-05-26 Alan Modra <alan@linuxcare.com.au> + * Makefile.am: Update dependencies with "make dep-am" + * Makefile.in: Regenerate. + * sysdep.h (gettext, dgettext, dcgettext, textdomain, bindtextdomain): Replace defines with those from intl/libgettext.h to quieten gcc warnings. @@ -180,18 +2891,150 @@ * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777. -2000-05-23 Philip Blundell <pb@futuretv.com> +2000-05-26 Jakub Jelinek <jakub@redhat.com> + + * elf64-sparc.c (sparc64_elf_relax_section): New. + (sparc64_elf_relocate_section): Optimize tail call into branch always + if possible. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + (elf32_sparc_relax_section): New. - * configure.in: Set version to 2.10. +2000-05-26 Jakub Jelinek <jakub@redhat.com> + + * elf64-sparc.c: Add ATTRIBUTE_UNUSED to unused function parameters. + Remove unusued variables. + (sparc64_elf_relocate_section): Change r_symndx type to unsigned long. + (sparc64_elf_merge_private_bfd_data): Fix shared library case from + previous fix, so that shared libs really don't influence targets + extension mask and memory model. + +2000-05-23 H.J. Lu <hjl@gnu.org> + + * elf64-alpha.c (elf64_alpha_relocate_section): Check + h->root.other not h->other. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + + * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. + +2000-05-23 H.J. Lu <hjl@gnu.org> + + * elf32-i386.c (elf_i386_relocate_section): Don't allow the + undefined symbol with the non-default visibility attributes. + * elf-hppa.h (elf_hppa_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf_calculate_relocation): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ia64.c (elf64_ia64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2000-05-22 Richard Henderson <rth@cygnus.com> + + * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI, + PCREL22, PCREL64I. Zero size of special relocs. + (elf64_ia64_reloc_type_lookup): Likewise. + (USE_BRL, oor_brl, oor_ip): New. + (elf64_ia64_relax_section): New. + (elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I. + (elf64_ia64_install_value): Likewise, plus PCREL21BI. + (elf64_ia64_relocate_section): Likewise. + (bfd_elf64_bfd_relax_section): New. + * reloc.c (BFD_RELOC_IA64_PCREL21BI): New. + (BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New. + * bfd-in2.h, libbfd.h: Regenerate. + +2000-05-22 Nick Clifton <nickc@cygnus.com> + + * configure.in : Add peigen.lo to MIPS PE targets. * configure: Regenerate. -Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill <joel@OARcorp.com> +2000-05-22 Momchil Velikov <velco@fadata.bg> + + * libbfd.c (_bfd_generic_verify_endian_match): Compare endianess + only if it is known for both input and output bfds. Separate + error message strings as in some languages, it may be necessary + to change more than one place in the string to change between + 'big' and 'little'. + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline + endianess checks, call _bfd_generic_verify_endian_match() instead. - * config.bfd (sparc-rtemself): Added. - (sparc-rtemsaout): Added as alternate name for current sparc-rtems. - (sparc-rtems): Switched to ELF from a.out - (i386-rtemscoff): Added as alternate name for current i386-rtems. - (i386-rtems): Switched to ELF. + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise. + + * elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify + endianess before checking bfd flavours. + +2000-05-22 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_link_output_extsym): Clear the visibility + field for symbols not defined locally. + +2000-05-18 Alan Modra <alan@linuxcare.com.au> + + * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16, + re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn. + (hppa_rebuild_insn): Mask immediate bits here instead. + * elf-hppa.h (elf_hppa_relocate_insn): Mask here too. + +2000-05-18 Momchil Velikov <velco@fadata.bg> + + * elflink.h (elf_bfd_final_link, elf_link_input_bfd): When emiting + relocs for an executable, ensure that they are virtual addresses. + +2000-05-18 Jeffrey A Law (law@cygnus.com) + + * config.bfd (hppa*64*-*-hpux11*): New target triplet. + +2000-05-17 S. Bharadwaj Yadavalli <sby@scrugs.lkg.dec.com> + Rick Gorton <gorton@scrugs.lkg.dec.com> + + * elflink.h: Add emitrelocations support: when enabled, relocation + information and relocation sections are put into final output + executables. If the emitrelocations flag is set, do the following: + (elf_bfd_final_link): Emit relocation sections. + (elf_link_input_bfd): Compute relocation section contents. + (elf_gc_sections): Don't clean relocation sections. + +2000-05-16 Catherine Moore <clm@cygnus.com> + + * som.c (som_decode_symclass): Recognize weak symbols. + +2000-05-16 Szabolcs Szakacsits <szaka@F-Secure.com> + + * peigen.c (pe_print_idata): Undo part of 2000-05-12 change that + read idata section only from dataoff. + (pe_print_edata): Correctly check for valid eat_member. + +2000-05-16 J"orn Rennecke <amylaar@cygnus.co.uk> + + * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. + +2000-05-14 Philip Blundell <philb@gnu.org> + + * config.bfd (armeb-*-elf, arm*b-*-linux-gnu*): New targets. + +2000-05-12 Alan Modra <alan@linuxcare.com.au> + + * targets.c (bfd_target_vector): #ifdef BFD64 rs6000coff64_vec + + * peigen.c (pe_print_idata): Look for .idata section and print + info even if data directory has zero entries. Read idata section + starting from dataoff, and adjust all data offsets to suit. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + * peigen.c (pe_print_edata): Similarly, look for .edata section + and print info even if data directory has zero entries. Cast + all bfd_vma vars to unsigned long before passing to fprintf. + + From Szabolcs Szakacsits <szaka@F-Secure.com> + * peigen.c (pe_print_idata): Use bfd_section_size rather than data + directory size which may be bogus. + * peigen.c (pe_print_edata): Similarly. 2000-05-09 Alan Modra <alan@linuxcare.com.au> @@ -222,6 +3065,40 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill <joel@OARcorp.com> (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as Win32Version. +2000-05-05 Clinton Popetz <cpopetz@cygnus.com> + + * xcoff.h: Rename to xcoff-target.h + * Makefile.am: Change all instances of xcoff.h to xcoff-target.h + * coff-rs6000.c: Ditto. + * coff64-rs6000.c: Ditto. + * coff-pmac.c: Ditto. + * Makefile.in: Regenerate. + +2000-05-05 Clinton Popetz <cpopetz@cygnus.com> + + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): + Change U802TOC64MAGIC to U803XTOCMAGIC. + +2000-05-04 Michael Snyder <msnyder@seadog.cygnus.com> + + * elf.c (bfd_elf_get_arch_size): New function, return 32 | 64 | -1. + * bfd-in.h: Prototype bfd_elf_get_arch_size. + * bfd-in2.h: Prototype bfd_elf_get_arch_size. + +2000-05-04 Alan Modra <alan@linuxcare.com.au> + + * libhppa.h (HPPA_R_CONSTANT): Cast argument to bfd_signed_vma. + +2000-05-03 Martin v. Löwis <loewis@informatik.hu-berlin.de> + + * elflink.h (elf_link_add_object_symbols): Reset dynindx for + hidden and internal symbols. + (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with + visibility. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not + assign a PLT or GOT entry to symbols with hidden and + internal visibility. + 2000-05-03 Mark Elbrecht <snowball3@bigfoot.com> * bfd/coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for @@ -233,6 +3110,109 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill <joel@OARcorp.com> * elf.c (prep_headers): Use ELFOSABI_NONE instead of ELFOSABI_SYSV. +2000-05-02 Alan Modra <alan@linuxcare.com.au> + + * targets.c (bfd_target_vector): Restore bfd_elf32_hppa_vec. + * Makefile.am (BFD32_BACKENDS): Restore elf32-hppa.lo. Regenerate + dependencies. + * Makefile.in: Regenerate. + +2000-05-01 Jim Wilson <wilson@cygnus.com> + + * Makefile.am (BFD32_BACKENDS): Add efi-app-ia32.lo. + (BFD32_BACKENDS_CFILES): Add efi-app-ia32.c. + (BFD64_BACKENDS): Delete coff-ia64.lo. Add efi-app-ia64.lo. + (BFD64_BACKENDS_CFILES): Delete coff-ia64.c. Add efi-app-ia64.c. + * Makefile.in: Rebuild. + +2000-05-02 Alan Modra <alan@linuxcare.com.au> + + * config.bfd: Re-enable elf32-hppa. It now compiles, even if it + doesn't work very well. + + * elf-hppa.h (elf_hppa_internal_shdr): Define. + (elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr. + Set hdr->s_type to 1 if ARCH_SIZE == 32. + (_bfd_elf_hppa_gen_reloc_type): Add prototype. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_is_local_label_name): Likewise. + (elf_hppa_fake_sections): Likewise. + (elf_hppa_final_write_processing): Likewise. + (elf_hppa_howto_table): Fully initialise all entries. + (_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args. + (elf_hppa_info_to_howto): Likewise. + (elf_hppa_info_to_howto_rel): Likewise. + (elf_hppa_reloc_type_lookup): Likewise. + (elf_hppa_final_write_processing, elf_hppa_add_symbol_hook, + elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols, + elf_hppa_record_segment_addrs, elf_hppa_final_link, + elf_hppa_relocate_section, elf_hppa_final_link_relocate, + elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until + elf32-hppa.c mess is cleaned up. + (elf_hppa_final_link_relocate): Make insn and r_type unsigned + int. Delete r_field. In case R_PARISC_PCREL21L, don't set + r_field then call hppa_field_adjust inline func with variable + r_field arg, instead call hppa_field_adjust with fixed arg. + In case R_PARISC_PCREL22F, don't set r_field. + (elf_hppa_relocate_insn): Change args and return type to unsigned + int. Call re_assemble_* funcs to do the work. + + * elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when + sign extending. + + * libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign + extending. + (sign_extend): Mask first before sign extending. + (low_sign_extend): Rewrite without condition expression. + (ones, dis_assemble_3, dis_assemble_12, dis_assemble_16, + dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete. + (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a, + assemble_17, assemble_21, sign_unext, low_sign_unext): Return + result as function return value rather than through pointer arg. + Accept unsigned int args, and return unsigned int. + (re_assemble_3): New. Combines function of dis_assemble_3 with + re-assembly of opcode and immediate. + (re_assemble_12): Likewise. + (re_assemble_16): Likewise. + (re_assemble_17): Likewise. + (re_assemble_21): Likewise. + (re_assemble_22): Likewise. + (hppa_field_adjust): Rewrite and document, paying attention to + size of types and signed/unsigned issues. + (get_opcode): Shift before masking. + (FDLW): Rename to FLDW. + (bfd_hppa_insn2fmt): Change arg to unsigned int. Delete fmt. + (hppa_rebuild_insn): Change args and return value to unsigned + int. Make use of re_assemble_*. Correct case 11. + + * dep-in.sed: Handle ../opcodes/. + * Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h, + elf64-hppa.h, hppa_stubs.h, xcoff.h. + (BFD32_BACKENDS_CFILES): Restore elf32-hppa.c. + Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo, + elfarm-nabi.lo dependencies outside of auto-dependency area. + Regenerate dependencies. + * Makefile.in: Regenerate. + + * configure.in (TRAD_HEADER): Test non-null before + AC_DEFINE_UNQUOTED. + * configure: Regenerate. + + * reloc.c: Fix mis-spelling in comment. + +2000-05-01 Alan Modra <alan@linuxcare.com.au> + + * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change. + * vms.c (vms_openr_next_archived_file): Return NULL. + +2000-04-28 Clinton Popetz <cpopetz@cygnus.com> + + * coffcode.h Copy changes mistakenly done to libcoff.h in + 4/24/2000 patch. + 2000-04-29 Andreas Jaeger <aj@suse.de> * libbfd-in.h: Correctly check GCC version. @@ -241,12 +3221,286 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill <joel@OARcorp.com> * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. +2000-04-28 Clinton Popetz <cpopetz@cygnus.com> + + * Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add + coffdu-rs6000.{lo,c}. + (coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency + on xcoff.h + * Makefile.in: Regenerate. + * xcoff.h: New file. + * coff-pmac.c: Use xcoff.h instead of coff-rs6000.c. + * coff-rs6000.c: Move all declarations and defines that are + common to the xcoff backends into xcoff.h + * coff64-rs6000.c: Ditto, + +2000-04-28 Clinton Popetz <cpopetz@cygnus.com> + + * coff-mips.c (mips_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + * coff-sh.c: (bfd_coff_small_swap_table): Ditto. + +2000-04-28 Clinton Popetz <cpopetz@cygnus.com> + + * coff-alpha.c (alpha_ecoff_backend_data): Add initialization of + _bfd_coff_force_symnames in strings and + _bfd_coff_debug_string_prefix_length to their default values. + +2000-04-27 Alan Modra <alan@linuxcare.com.au> + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return if dynobj NULL. + Check local_got_refcounts before dereferencing. + + * elf32-ppc.c (ppc_elf_relocate_section): Check splt != NULL + before deciding we don't need R_PPC_PLT32 relocation. + (ppc_elf_gc_sweep_hook): Check local_got_refcounts before + dereferencing. + + * elflink.h (elf_gc_common_finalize_got_offsets): Fix comment. + + * elf32-i386.c (elf_i386_check_relocs): Reference count .got and + .plt entries. + (elf_i386_gc_sweep_hook): Garbage collect .got and .plt entries. + (elf_i386_adjust_dynamic_symbol): Recognize unused .plt entries. + (elf_i386_relocate_section): Allow for .plt to go missing. + (elf_i386_finish_dynamic_symbol): Use same test to decide if we + can use a relative reloc for got as elf_i386_relocate_section. + (bfd_elf32_bfd_final_link): Define to use gc form of final link. + +2000-04-26 Clinton Popetz <cpopetz@cygnus.com> + + * config.bfd: Remove extraneous bfd_powerpc_64_arch. + +2000-04-24 Clinton Popetz <cpopetz@cygnus.com> + + * Makefile.am (coff64-rs6000.lo): New rule. + * Makefile.in: Regenerate. + * coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data, + xcoff_is_local_label_name, xcoff_rtype2howto, + xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p, + xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap, + xcoff_write_archive_contents): No longer static, and prefix with _bfd_. + (NO_COFF_SYMBOLS): Define. + (xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in, + xcoff64_swap_aux_out): New functions; handle xcoff symbol tables + internally. + (MINUS_ONE): New macro. + (xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS + relocation. + (coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in, + coff_SWAP_aux_out): Map to the new functions. + * coff64-rs6000.c: New file. + * libcoff.h (bfd_coff_backend_data): Add new fields + _bfd_coff_force_symnames_in_strings and + _bfd_coff_debug_string_prefix_length. + (bfd_coff_force_symnames_in_strings, + bfd_coff_debug_string_prefix_length): New macros for above fields. + * coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic. + Set machine to 620 for XCOFF64. Use bfd_coff_swap_sym_in instead + of using coff_swap_sym_in directly. + (FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64. + (coff_set_flags) Set magic for XCOFF64. + (coff_compute_section_file_positions): Add symbol name length to + string section length if bfd_coff_debug_string_prefix_length is + true. + (coff_write_object_contents): Don't do reloc overflow for XCOFF64. + (coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of + using coff_swap_lineno_in directly. + (bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings + and _bfd_coff_debug_string_prefix_length fields. + * coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force + symbol names into strings table when + bfd_coff_force_symnames_in_strings is true. + * coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR, + SET_RELOC_VADDR): New macros. + (coff_swap_reloc_in, coff_swap_reloc_out): Use above macros. + (coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C + code. + (coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64 + changes within RS6000COFF_C specific code. + (coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC, + MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO. + * reloc.c (bfd_perform_relocation, bfd_install_relocation): + Extend existing hack on target name. + * xcofflink.c (XCOFF_XVECP): Extend existing hack on + target name. + * coff-tic54x.c (ticof): Keep up to date with new fields + in bfd_coff_backend_data. + * config.bfd: Add bfd_powerpc_64_arch to targ_arch and define + targ_selvecs to include rs6000coff64_vec for rs6000. + * configure.in: Add rs6000coff64_vec case. + * cpu-powerpc.c: New bfd_arch_info_type. + +2000-04-24 Jeffrey A Law (law@cygnus.com) + + * config.bfd: Only disable elf32-hppa vectors, not all of the + BSD and OSF configuration support. Provide (disabled) clauses + for PA64 support. + * configure.in: Add clause for PA64 support. + * configure: Rebuilt. + + * targets.c (bfd_target_vector): Add bfd_elf64_hppa_vec. + (bfd_elf64_hppa_vec): Declare. + + * Makefile.am (BFD64_BACKENDS): Add elf64-hppa.lo + (BFD64_BACKENDS_CFILES): Add elf64-hppa.c + (elf64-hppa.lo): Add dependencies. + * Makefile.in: Rebuilt. + + * elf64-hppa.c, elf64-hppa.h: New files with PA64 support. + +2000-04-24 Jason Eckhardt <jle@cygnus.com> + + * libhppa.h (dis_assemble_16): New function. + (pa_arch): Added pa20w element. + +2000-04-24 Ulrich Drepper <drepper@cygnus.com> + + * elf-bfd.h: Add prototypes for bfd_elf32_write_relocs, + bfd_elf32_slurp_reloc_table, bfd_elf64_write_relocs, and + bfd_elf64_slurp_reloc_table. + + * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): New + definitions to get external names. + (elf_write_relocs): Renamed from write_relocs and make global. + (elf_slurp_reloc_table): Make global. + (_bfd_elf,size_info): Use elf_write_relocs instead of write_relocs. + + * archive.c (hpux_uid_gid_encode): New function. + (bfd_ar_hdr_from_filesystem): Use it if HPUX_LARGE_AR_IDS is + defined and the ID is greater than 99999. + (bfd_generic_stat_arch_elt): If HPUX_LARGE_AR_IDS is defined decode + special uid/gid fields into 32 bit values. + +2000-04-21 Matthew Green <mrg@cygnus.com> + + * config.bfd: Add NetBSD/sparc64 support. + +Fri Apr 21 13:20:53 2000 Richard Henderson <rth@cygnus.com> + David Mosberger <davidm@hpl.hp.com> + Timothy Wall <twall@cygnus.com> + Jim Wilson <wilson@cygnus.com> + + * Makefile.am (ALL_MACHINES): Add cpu-ia64.lo. + (ALL_MACHINES_CFILES): Add cpu-ia64.c. + (BFD64_BACKENDS): Add elf64-ia64.lo. + (BFD64_BACKENDS_CFILES): Add elf64-ia64.c. + (cpu-ia64.lo, elf64-ia64.lo): New rules. + * Makefile.in: Rebuild. + * archures.c (enum bfd_architecture): Add bfd_arch_ia64. + (bfd_ia64_arch): Declare. + (bfd_archures_list): Add bfd_ia64_arch. + * bfd-in2.h: Rebuild. + * config.bfd: (ia64*-*-linux-gnu*, ia64*-*-elf*): New targets. + * configure: Rebuild. + * configure.host: (ia64-*-linux*): New host. + * configure.in (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec, + bfd_efi_app_ia64_vec, bfd_efi_app_ia64_vec): New vectors. + * elf.c (prep_headers): Add bfd_arch_ia64. + * libbfd.h: Rebuild. + * reloc.c: Add IA-64 relocations. + * targets.c (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec): + Declare. + (bfd_target_vect): Add bfd_elf64_ia64_little_vec. + * cpu-ia64-opc.c, cpu-ia64.c, elf64-ia64.c: New files. + +2000-04-21 Richard Henderson <rth@cygnus.com> + + * elf32-d30v.c (bfd_elf_d30v_reloc): Don't modify section + contents when performing a partial link. + (bfd_elf_d30v_reloc_21): Likewise. + +2000-04-20 H.J. Lu <hjl@gnu.org> + + * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10 + patch to symbols defined by a shared object. + * elf32-ppc.c (ppc_elf_relocate_section): Similarly. + 2000-04-19 Michael Sokolov <msokolov@ivan.Harhan.ORG> K&R compiler fixes. * dwarf2.c (concat_filename): Avoid string literal concatenation. * ieee.c (ieee_get_symtab): Don't initialise union in struct. +Mon Apr 17 19:14:36 2000 David Mosberger <davidm@hpl.hp.com> + + * Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo. + (BFD64_BACKENDS_CFILES): Mention coff-ia64.c + (coff-ia64.lo): Add dependency. + * Makefile.in: Regenerate. + * coff-ia64.c: New file. + * efi-app-ia32.c: Ditto. + * efi-app-ia64.c: Ditto. + * coffcode.h (coff_set_arch_mach_hook): Handle IA64MAGIC. + (coff_set_flags): Ditto. + (coff_write_object_contents) [IA64]: Set magic number to ZMAGIC. + * config.bfd (i[3456]86-*-linux-gnu*): Mention bfd_efi_app_ia32_vec. + * configure.in (elf): Handle bfd_efi_app_ia32 and bfd_efi_app_ia64_vec. + * configure: Regenerate. + * libpei.h (GET_OPTHDR_IMAGE_BASE): New macro. + (PUT_OPTHDR_IMAGE_BASE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto. + (GET_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (PUT_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto. + (GET_PDATA_ENTRY): Ditto. + * peigen.c (_bfd_pei_swap_aouthdr_in) [COFF_WITH_PEP64]: Don't read + data_start. Use above macros to read fields that are 64 bit wide for + COFF_WITH_PEP64. Don't truncate entry and text_start to 32 bits. + (_bfd_pei_swap_aouthdr_out) [PEI_FORCE_MINIMUM_ALIGNMENT]: Force + FileAlignment and SectionAlignment to minimum alignment if they + are zero. + (_bfd_pei_swap_aouthdr_out) [PEI_DEFAULT_TARGET_SUBSYSTEM]: Set + Subsystem to default PEI_DEFAULT_TARGET_SUBSYSTEM. + (_bfd_pei_swap_aouthdr_out) [COFF_WITH_PEP64]: Don't set data_start. + Use above macros to write fields that are 64 bit wide for + COFF_WITH_PEP64. + (pe_print_pdata): Set PDATA_ROW_SIZE to 3*8 for COFF_WITH_PEP64, + 5*4 otherwise. This should be right for IA-32 and IA-64, but may + be wrong for platforms. Use PDATA_ROW_SIZE instead of hardcoded + value of 20 bytes. Modify printing for COFF_WITH_PEP64 to print + begin address, end address, and unwind info address only. Use + GET_PDATA_ENTRY() to read .pdata entries. Use fprintf_vma() to + print addresses. + (tbl): Add SECTION, REL32, RESERVED1, MIPS_JMPADDR16, DIR64, and + HIGH3ADJ relocation names. + (_bfd_pe_print_private_bfd_data): Print Subsystem name in legible form. + * targets.c: Declare bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + (bfd_target_vector): Mention bfd_efi_app_ia32_vec and + bfd_efi_app_ia64_vec. + +2000-04-17 Timothy Wall <twall@cygnus.com> + + * bfd-in2.h: Add prototypes for tic54x load page access. + * bfd-in.h: Regenerate. + * coff-tic54x.c: Add load page functions; allow bfd_arch_unknown + in customized _set_arch_mach function. + * coffcode.h (coff_set_alignment_hook): Set section load page if + the appropriate macro is defined. + (write_object_contents): Read section load page. + +2000-04-13 Alan Modra <alan@linuxcare.com.au> + + * elf32-hppa.h: Update copyright date. + + * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix. + * elf32-mips.c (_bfd_mips_elf_relocate_section): And here. + + * elf32-d30v.c (MAX32): Don't use LL suffix. + (MIN32): Define in terms of MAX32. + (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma. + + * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise + expression. + + * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants. + 2000-04-12 Alan Modra <alan@linuxcare.com.au> * dep-in.sed: Match space before file name, not after. @@ -257,6 +3511,117 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill <joel@OARcorp.com> case, allow address wrap-around stupidly removed 2000-03-17. Sign extend without an if statement. +2000-04-11 Alan Modra <alan@linuxcare.com.au> + + * coff-mips.c (mips_gprel_reloc): Test for 16 bit range using + signed quantites. + * elf32-mips.c (gprel16_with_gp): Likewise. + * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Test range + here using -0x40000, not (int)0xfffc0000. + (elf32_hppa_size_of_stub): Likewise. + +2000-04-11 Timothy Wall <twall@cygnus.com> + + * coff-tic54x.c: Now builds with all targets. + * Makefile.am: Add coff/tic54x.h to coff-tic54x.o dependencies. + * Makefile.in: Regenerate. + * coffcode.h (coff_set_arch_mach_hook): Eliminate warning on + unitialized variable. + +Fri Apr 7 15:56:57 2000 Andrew Cagney <cagney@b1.cygnus.com> + + * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add + --enable-build-warnings option. + * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. + * Makefile.in, configure: Re-generate. + +2000-04-07 Nick Clifton <nickc@cygnus.com> + + * reloc.c: Add BFD_RELOC_ARM_PCREL_BLX and + BFD_RELOC_THUMB_PCREL_BLX. + + * elf32-arm.h (elf32_arm_final_link_relocate): Handle + R_ARM_XPC25 and R_ARM_THM_PC22. + + * elfarm-nabi.c (elf32_arm_howto_): Fix definitions of + R_ARM_XPC25 and R_ARM_THM_XPC22. + (elf32_arm_reloc_map): Make BFD_RELOC_{ARM|THUMB}_PCREL_BLX to + R_ARM_[XPC25|THM_XPC22]. + + * elfarm-oabi.c: Define OLD_ARM_ABI and change include from + elf/arm-oabi.h to elf/arm.h + + * Makefile.am: Fix dependency for elfarm-oabi.c + * Makefile.in: Regenerate. + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2000-04-06 Michael Snyder <msnyder@seadog.cygnus.com> + + * elfcore.h (elf_core_file_p): preserve value of tdata at entry, + and restore it on failure. Release newly allocated tdata on + failure. + +Fri Apr 7 11:33:47 2000 Jim Wilson <wilson@cygnus.com> + + * dwarf2.c (struct dwarf2_debug): New field dwarf_line_size. + (decode_line_info): Set it. Report error if unit->line_offset is + equal to or larger than it. + +2000-04-07 Timothy Wall <twall@cygnus.com> + + * targets.c: Added vecs for tic54x. + * reloc.c: Added relocs for tic54x. + * libbfd.h: Regenerated. + * configure: Add TI COFF vecs for tic54x. + * configure.in: Ditto. + * config.bfd (targ_cpu): Recognize new tic54x target. + * coffcode.h (coff_slurp_symbol_table): Additions for TI COFF handling. + * bfd-in2.h: Add tic54x target and relocations. + * Makefile.am, Makefile.in: Add tic54x target. + * archures.c (bfd_archures_list): Add tic54x target. + * coff-tic54x.c: New. + * cpu-tic54x.c: New. + +2000-04-06 Michael Snyder <msnyder@seadog.cygnus.com> + + * elfcore.h (elf_core_file_p): call backend_object_p which + thereby gets an opportunity to update the arch/machine type. + +2000-04-06 Timothy Wall <twall@cygnus.com> + + * coffcode.h (coff_slurp_symbol_table): Handle C_STATLAB storage + class. Handle SEC_CLINK and SEC_BLOCK flags. + * section.c: Add SEC_CLINK and SEC_BLOCK flags. + * bfd-in2.h: Add SEC_CLINK and SEC_BLOCK flags. + +2000-04-06 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.h (elf32_arm_set_private_flags): Only check for + EF_INTERWORK if this is an unknown EABI. + (elf32_arm_merge_private_bfd_data): Check EABI version + numbers. Only check EF_xxx flags if the EABI version number + is unknown. + (elf32_arm_check_private_bfd_data): Only check EF_xxx flags + if the EABI version number is unknown. + (elf32_arm_print_private_bfd_data): Only decode EF_xxx flags + if the EABI version number is unknown. + +Wed Apr 5 22:04:20 2000 J"orn Rennecke <amylaar@cygnus.co.uk> + + * reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and + BFD_RELOC_SH_LOOP_END. + * elf32-sh.c (sh_elf_howto_tab): Change special_func to + sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore. + Add entries for R_SH_LOOP_START and R_SH_LOOP_END. + (sh_elf_reloc_loop): New function. + (sh_elf_reloc): No need to test for always-to-be-ignored relocs + any more. + (sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}. + (sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}. + * bfd-in2.h, libbfd.h: Regenerate. + 2000-04-04 Alan Modra <alan@linuxcare.com.au> * po/bfd.pot: Regenerate. @@ -270,6 +3635,13 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill <joel@OARcorp.com> Update dependencies. * Makefile.in: Regenerate. +2000-04-03 Kevin Buettner <kevinb@redhat.com> + + * configure.in: Added corefile support for AIX 4.3. In particular, + AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when + compiling rs6000-core.c. + * configure: Regenerated. + 2000-04-03 H.J. Lu <hjl@gnu.org> * cache.c (bfd_open_file): Unlink the output file only if @@ -281,6 +3653,23 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill <joel@OARcorp.com> relative relocations for non-loaded sections in shared objects. (elf64_alpha_check_relocs): Similarly. +Mon Apr 3 13:37:15 2000 Hans-Peter Nilsson <hp@axis.com> + + * aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and + BFD_RELOC_16 to switch for extended relocs. + (MY_swap_ext_reloc_in): New. + (MY_swap_ext_reloc_out): New. + (NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather + than NAME(aout,swap_ext_reloc_in) for extended relocs. + (NAME(aout,squirt_out_relocs)): Similarly use + MY_swap_ext_reloc_out. + (aout_link_reloc_link_order): Use MY_put_ext_reloc if defined. + +2000-04-03 Kazu Hirata <kazu@hxi.com> + + * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to + the R_PCRWORD_B case. + 2000-03-31 Thomas de Lellis <tdel@wrs.com> * srec.c : Set CHUNK size to 16 bytes to prevent download failures @@ -352,7 +3741,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay <dlindsay@cygnus.com> 2000-03-11 Alan Modra <alan@linuxcare.com.au> - * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on + * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on a format mismatch rather than an "error" from bfd_read such as bfd_error_file_truncated. @@ -462,7 +3851,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay <dlindsay@cygnus.com> 'srelgot'. * elf32-mcore.c (mcore_elf_relocate_section): Initialise - 'oldinst'. + 'oldinst'. * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function parameters. @@ -473,13 +3862,13 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay <dlindsay@cygnus.com> * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED to unused function parameter. - + * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function parameters. Use EMPTY_HOWTO to initialise empty howto slots. Remove unused variables. - * peicode.h (pe_ILF_build_a_bfd): Initialise id6. + * peicode.h (pe_ILF_build_a_bfd): Initialise id6. 2000-03-01 H.J. Lu <hjl@gnu.org> @@ -538,7 +3927,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay <dlindsay@cygnus.com> * configure: regenerate. * config.bfd: Add support for arm-wince, mips-pe and sh-pe - targets. + targets. * targets.c: Add mips and sh pe vectors. @@ -613,7 +4002,7 @@ Fri Feb 25 18:39:26 2000 Rodney Brown (RodneyBrown@pmsc.com) 2000-02-24 Catherine Moore <clm@cygnus.com> * som.c (som_misc_symbol_info): Add field - secondary_def. + secondary_def. (som_bfd_derive_misc_symbol_info): Initialize secondary_def. (som_build_and_write_symbol_table): Keep track @@ -627,7 +4016,7 @@ Fri Feb 25 18:39:26 2000 Rodney Brown (RodneyBrown@pmsc.com) * dwarf2.c (read_address): Read 16-bits addresses. (parse_comp_unit): Accept addr_size == 2. - + 2000-02-23 Alan Modra <alan@spri.levels.unisa.edu.au> * bfd-in.h: Update copyright date. @@ -808,7 +4197,7 @@ Thu Feb 17 00:04:48 2000 J"orn Rennecke <amylaar@cygnus.co.uk> hide_symbol members. (elf_link_hash_copy_indirect): New. (elf_link_hash_hide_symbol): New. - * elflink.h (elf_link_add_object_symbols): Break out copy from + * elflink.h (elf_link_add_object_symbols): Break out copy from indirect new new symbol to elf.c. (elf_link_assign_sym_version): Break out privatization of non-exported symbol to elf.c. @@ -846,7 +4235,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg, sh_insns_uses_or_sets_freg): New functions. * (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros. - * (sh_insns_conflict): Use new functions and new macros to + * (sh_insns_conflict): Use new functions and new macros to detect conflicts when two instructions both set same integer registers, both set same fp register, and both set special register. @@ -857,7 +4246,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) the arch/mach info. 2000-02-08 Mark Elbrecht <snowball3@bigfoot.com> - + * coff-go32.c: Update comment. Update copyright. 2000-01-27 Thomas de Lellis <tdel@windriver.com> @@ -874,12 +4263,12 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) (bfd_is_undefined_symclass): New function. Return true if the given symbol class represents and undefined/unresolved symbol. - + (bfd_symbol_info): Use bfd_is_undefined_symclass to check for unresolved symbols. * bfd-in2.h: Add prototype for bfd_is_undefined_symbol(). - + * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the STT_ARM_16BIT flag set, but it is not attached to a data object return STT_ARM_16BIT so that it will be treated as code by the @@ -918,8 +4307,8 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx = scnhsz, filhsz, relsz, aoutsz, etc) - * coffswap.h: Ditto. - + * coffswap.h: Ditto. + 2000-01-13 Nick Clifton <nickc@cygnus.com> * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to @@ -940,27 +4329,27 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * coffgen.c: Indicate that the offset parameter is in bytes, not octets. - + * cofflink.c (bfd_coff_link_input_bfd): Use bfd_octets_per_byte where appropriate to get the octet offset when calling bfd_set_section_contents. (bfd_coff_reloc_link_order): Ditto. - + * linker.c (bfd_generic_reloc_link_order): Ditto. (_bfd_default_link_order): Ditto. - + * reloc.c (bfd_perform_relocation): Distinguish between octets and bytes. Use octets when indexing into octet data; use bytes when calculating target addresses. (bfd_install_relocation): Ditto. - + * srec.c (srec_write_section): Ditto. - + 2000-01-13 Nick Clifton <nickc@cygnus.com> * coff-mcore.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from 3 to 2. This allows 4 byte sized sections, which is necessary for - dlltool to build funcitoning DLLs. + dlltool to build functioning DLLs. 2000-01-10 Philip Blundell <pb@futuretv.com> @@ -969,14 +4358,14 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) 2000-01-10 Egor Duda <deo@logos-m.ru> - * config.bfd: Include elf32_i386 vector to target list for cygwin + * config.bfd: Include elf32_i386 vector to target list for cygwin and mingw. - + * config.in: Undefine HAVE_WIN32_PSTATUS_T. * configure.in: Test for structure win32_pstatus_t in <sys/procfs.h> * configure: Regenerate. - + * elf.c (elfcore_grok_win32pstatus): New function: process win32_pstatus_t notes in elf core file. (elfcore_grok_note): Detect win32_pstatus notes. @@ -988,5594 +4377,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * elflink.h (elf_link_add_object_symbols): Combine visibilities. * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility. -1999-12-29 Richard Henderson <rth@cygnus.com> - - * elflink.h (bfd_elf,size_dynamic_sections): Don't export all - if no dynamic sections created. - -1999-12-27 Nick Clifton <nickc@cygnus.com> - - * peicode.h (pe_bfd_object_p): Only define for PE format - targets. - -1999-12-17 Nick Clifton <nickc@cygnus.com> - - * coff-i386.c (i3coff_object_p): Delete. - (i386coff_vec): Replace reference to i3coff_object_p with a - reference to coff_object_p. - - * coff-mcore.c (pe_object_p): Delete. - - * peicode.h (pe_bfd_object_p): New function: Detect the - presence of a PE format COFF object file. Also detect and - warn about the presence of LINK6 format Image Library Format - object files. - -1999-12-16 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (NUM_ELEM): New macro. - (NUM_RELOCS): New macro: The number of known ARM relocs. - (RTYPE2HOWTO): Return NULL if the reloc type is out of range. - (coff_arm_rtype_to_howto): Return NULL if the reloc type is out - of range. - (bfd_arm_process_before_allocation): Produce a warning message if - an out of range symbol index is encountered. - -1999-12-14 Nick Clifton <nickc@cygnus.com> - - * elflink.h (is_global_symbol_definition): New Function: Return - true iff the symbol is being given a global definition in this - bfd. - (elf_link_is_defined_archive_symbol): Do not bother processing - symbols for an archive element that has already been included - in the link. - Use is_global_symbol_definition(). - -1999-12-09 Andrew Cagney <cagney@cygnus.com> - - * config.bfd: Add support for sparc-*-netbsdelf* and - sparc-*-netbsdaout*. - -1999-12-13 Nick Clifton <nickc@cygnus.com> - - * elflink.h (elf_link_is_defined_archive_symbol): Check to see - if the symbol is in the common section. - -1999-12-10 Nick Clifton <nickc@cygnus.com> - - * elflink.h (elf_link_is_defined_archive_symbol): New - function: Decide if a symbol, in an archive map is there - because it is defined in the archive element, or because it is - just another common declaration of it. - (elf_link_add_archive_symbols): Use - elf_link_is_defined_archive_symbol to decide if an archive - element contain a reference to a common symbol should be - linked in or not. - -1999-12-10 Nick Clifton <nickc@cygnus.com> - - * elflink.h: Revert previous patch. - * targets.c: Revert previous patch. - * libbfd-in2.h: Revert previous patch. - * libbfd.h: Revert previous patch. - * elfxx-target.h: Revert previous patch. - * archive.c: Revert previous patch. - * aout-target.h: Revert previous patch. - * aout-tic30.h: Revert previous patch. - * bfd.c: Revert previous patch. - * coff-alpha.c: Revert previous patch. - * coff-rs6000.c: Revert previous patch. - * elf64-mips.c: Revert previous patch. - * ieee.c: Revert previous patch. - * libecoff.h: Revert previous patch. - * oasys.c: Revert previous patch. - * som.c: Revert previous patch. - * vms.c: Revert previous patch. - -1999-12-09 Nick Clifton <nickc@cygnus.com> - - * elflink.h (elf_link_add_archive_symbols): Add an archive - element even if contains a symbol which is currently only - considered to be a common. - - * targets.c (struct bfd_target): Add new field - _bfd_allow_commons_in_armap. - * bfd-in2.h:Regenerate. - - * libbfd-in2.h (_bfd_noarchive_allow_commons_in_armap): - Define. - (_bfd_archive_bsd_allow_commons_in_armap): Define. - * libbfd.h: Regenerate. - - * elfxx-target.h: If using COFF archive map, override - definition of allow_commons_in_armap and replace with - bfd_false. - - * archive.c (bfd_compute_and_write_armap): Do not place common - symbols into the archive map unless _bfd_allow_commons_in_armap - returns true. - - * aout-target.h (MY_allow_commons_in_armap): Define. - * aout-tic30.h (MY_allow_commons_in_armap): Define. - * bfd.c (bfd_allow_commons_in_armap): Define. - * coff-alpha.h (alpha_ecoff_allow_commons_in_armap): Define. - * coff-rs6000.h (xcoff_allow_commons_in_armap): Define. - * elf64-mips.c (bfd_elf64_allow_commons_in_armap): Define. - * ieee.c (ieee_ecoff_allow_commons_in_armap): Define. - * libecoff.h (_bfd_ecoff_allow_commons_in_armap): Define. - * oasys.c (oasys_allow_commons_in_armap): Define. - * som.c (som_allow_commons_in_armap): Define. - * vms.c (vms_allow_commons_in_armap): Define. - -1999-12-07 Jim Blandy <jimb@cygnus.com> - - Add support for SSE registers in ELF core files. - * elf.c (elfcore_make_note_pseudosection): New function. - (elfcore_grok_prfpreg): Use it. - (elfcore_grok_prxfpreg): New function. - (elfcore_grok_note): Recognize Linux NT_PRXFPREG notes. - -1999-12-03 Ian Lance Taylor <ian@zembu.com> - - * elf32-mips.c (mips_elf_calculate_relocation): Divide R_MIPS_PC16 - value by 4 before storing it back in the field. From - Koundinya. K <kk@ddeorg.soft.net>. - -Tue Nov 30 22:41:14 1999 Jeffrey A Law (law@cygnus.com) - - * archures.c (bfd_mach_am33): Define. - * bfd-in2.h: Rebuilt. - * cpu-m10300.c (bfd_am33_arch): Add to the mn103 architecture list - * elf-m10300.c (mn10300_elf_relax_section): Handle am33 instructions. - (compute_function_info): Handle additional registers saved by - movm on the am33. - (elf_mn10300_mach): Handle E_MN10300_MACH_AM33. - (_bfd_mn10300_elf_final_write_processing): Handle bfd_mach_am33. - -1999-11-29 Jim Blandy <jimb@cygnus.com> - - * elf.c (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New - functions. - * bfd-in2.h (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New - declarations. - -1999-11-27 Michael Meissner <meissner@cygnus.com> - - * reloc.c (BFD_RELOC_ALPHA_USER_LITERAL): New relocation for - internal use within gas for alpha explicit relocations. - (BFD_RELOC_ALPHA_USER_LITUSE_BASE): Ditto. - (BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF): Ditto. - (BFD_RELOC_ALPHA_USER_LITUSE_JSR): Ditto. - (BFD_RELOC_ALPHA_USER_GPDISP): Ditto. - (BFD_RELOC_ALPHA_USER_GPRELHIGH): Ditto. - (BFD_RELOC_ALPHA_USER_GPRELLOW): Ditto. - - * elf64-alpha.c (elf64_alpha_reloc_map): Add mappings for - BFD_RELOC_ALPHA_USER_*. - - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - -1999-11-26 Fred Fish <fnf@cygnus.com> - - * elf.c (elfcore_read_notes): Add prototype for static function. - (_bfd_elf_make_section_from_phdr): Renamed from bfd_section_from_phdr. - (bfd_section_from_phdr): Replacement function that calls - _bfd_elf_make_section_from_phdr for generic segment types and - backend fucntion pointed to by elf_backend_section_from_phdr for - backend specific segment types. - (_bfd_elfcore_section_from_phdr): Remove call to elfcore_read_notes, - now called by _bfd_elf_make_section_from_phdr. Note that this func - is now just a stub between the caller and bfd_section_from_phdr. - - * elf-bfd.h (struct elf_backend_data): Add new function pointer - elf_backend_section_from_phdr. - (elf_backend_section_from_phdr): Add prototype. - - * elfxx-target.h (elf_backend_section_from_phdr): Define default. - (elfNN_bed): Add elf_backend_section_from_phdr. - -1999-11-25 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (bfd_arm_get_bfd_for_interworking): Add - SEC_CODE and SEC_READONLY flags to glue sections. - - * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Add - SEC_CODE and SEC_READONLY flags to glue sections. - -1999-11-20 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c (coff_mcore_relocate_section): Fix typo in previous - delta. - -1999-11-19 Catherine Moore <clm@cygnus.com> - - * elf32-m68k.c (elf_cpu32_plt0_entry): Fix encoding. - (elf_cpu32_plt_entry): Likewise. - -1999-11-18 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling - for RVA relocs. - (coff_mcore_relocate_section): Initialise addend to 0. - Special case processing of RVA reloc. - -1999-11-17 Richard Henderson <rth@cygnus.com> - - * elf-bfd.h (struct elf_backend_data): Reorder collect and - type_change_ok; add sign_extend_vma. - * elf32-mips.c (elf_backend_sign_extend_vma): Define. - * elfcode.h (elf_swap_symbol_in): Mind be->sign_extend_vma. - (elf_swap_shdr_in, elf_swap_phdr_in): Likewise. - * elfxx-target.h (elf_backend_sign_extend_vma): Default. - (elfNN_bed): Follow struture changes. - -1999-11-09 Ian Lance Taylor <ian@zembu.com> - - * libbfd.c (bfd_read): Check result of read against desired result - using !=, not <. - (_bfd_generic_get_section_contents): Set bfd_error if the seek is - invalid compared to the section size. - - * ieee.c (ieee_slurp_debug): Get the length of the debug - information right if there is no data part. - -Tue Nov 2 01:44:41 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (som_fixup_formats): Improve handling of R_AUX_UNWIND, - R_LINETAB, R_LINETAB_ESC, and R_COMMENT. - -1999-10-28 Ian Lance Taylor <ian@zembu.com> - - * elflink.h (elf_bfd_final_link): Make last_local signed. - -1999-10-27 Ian Lance Taylor <ian@zembu.com> - - * stabs.c (_bfd_link_section_stabs): Make sure .stabstr section - starts with a zero. - -Sat Oct 23 17:36:12 1999 Andrew Cagney <cagney@b1.cygnus.com> - - * archures.c: Add definitions bfd_mach_d10v, bfd_mach_d10v_ts2 and - bfd_mach_d10v_ts3. - * cpu-d10v.c (d10v_ts3_info, d10v_ts2_info): Add. - * bfd-in2.h: Regenerate. - -1999-10-15 Andrew Haley <aph@cygnus.com> - - * dwarf1.c (parse_die): Fail to parse a die if its length is zero. - -Sun Oct 17 17:19:00 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h (bfd_hppa_insn2fmt): Change to return an int. - -1999-10-08 Ian Lance Taylor <ian@zembu.com> - - * elflink.h (elf_merge_symbol): When overriding a weak symbol with - a defined symbol in a shared library, clear the DEF_DYNAMIC flag - too. - -Fri Oct 8 13:03:45 1999 Geoffrey Keating <geoffk@cygnus.com> - - * elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL - relocs also need the GP value. - (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs - properly. Handle sign-extension for R_MIPS_64 correctly. Correct - the GP value for R_MIPS_LITERAL relocs too. Handle - R_MIPS_64 relocs properly on big-endian MIPS. - (mips_elf_sign_extend): Behave properly with 'long long'. - (mips_elf_highest): Correct typo. - -Mon Oct 4 17:49:45 1999 Nick Clifton <nickc@cygnus.com> - - * cpu-m32r.c (arch_info_struct): New static global. - (bfd_m32r_arch): Refer to it. - * elf32-m32r.c (m32r_elf_object_p): Recognize E_M32RX_ARCH. - (m32r_elf_print_private_bfd_data): Ditto. - (m32r_elf_final_write_processing): Handle bfd_mach_m32rx. - * archures.c (bfd_mach_m32rx): Define it. - * bfd-in2.h: Rebuild. - -1999-09-28 Fred Fish <fnf@cygnus.com> - - * targets.c (cisco_core_vec): Replaced with two new vecs ... - (cisco_core_big_vec): Add new bigendian vec. - (cisco_core_little_vec): Add new little endian vec. - - * cisco-core.c (CRASH_INFO): Fixed offset replaced with ... - (crash_info_locs): Add array of possible offsets. - (MASK_ADDR): Mask to apply to crash info offset. - (crashinfo_external): Add textbase, database, bssbase and - turn into a typedef. - (cisco_core_file_validate): Renamed from cisco_core_file_p. - Many small changes to account for additional hardware versions. - Pick a reasonable size for ".reg" section. Add a ".crash" - section to allow access to crashinfo_external struct. - (cisco_core_file_p): New version of this function that - iterates over crash_info_locs, calling cisco_core_file_validate. - (cisco_core_vec): Old big endian only vec replaced with ... - (cisco_core_big_vec): Add big endian version. - (cisco_core_little_vec): Add little endian version. - - * configure.in (cisco_core_vec): Split to two new vectors ... - (cisco_core_big_vec): New target vector. - (cisco_core_little_vec): New target vector. - * configure: Regenerate. - * config.bfd (targ): For m68*-*-aout* targ, change cisco_core_vec - to cisco_core_big_vec in targ_selvecs. - -1999-09-28 Geoffrey Keating <geoffk@cygnus.com> - - * elf32-mips.c (mips_elf_relocate_hi16): Unused, delete. - (mips_elf_relocate_got_local): Unused, delete. - (mips_elf_relocate_global_got): Unused, delete. - -1999-09-24 Fred Fish <fnf@cygnus.com> - - * elf.c (bfd_section_from_phdr): Add typename variable. Use p_type - to initialize it to something meaningful. Then use it to generate - more useful segment names. - -Sun Sep 19 12:16:47 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (NO_PCREL_MODES): Define if the system does not define - R_SHORT_PCREL_MODE. - (hppa_som_gen_reloc_type): Handle both short and long pcrel branches. - (som_write_fixups): Eliminate redundant pcrel mode relocs. Handle - R_LONG_PCREL_MODE and R_SHORT_PCREL_MODE - * libhppa.h (dis_assemble_22): New function. - (bfd_hppa_insn2fmt): Handle long branch. - - * libhppa.h (bfd_hppa_insn2fmt): Decode and handle formats found - in PA2.0. - -1999-09-17 Alan Modra <alan@spri.levels.unisa.edu.au> - - * coff-i386.c (coff_i386_reloc_type_lookup): Support BFD_RELOC_16, - BFD_RELOC_16_PCREL, BFD_RELOC_8, BFD_RELOC_8_PCREL relocs. - (reloc_howto_type howto_table): Tidy comments and whitespace. - -1999-09-17 Nick Clifton <nickc@cygnus.com> - - * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Undo - previous delta. Set sec->gc_mark instead. - -Thu Sep 16 11:21:13 1999 Catherine Moore <clm@cygnus.com> - - * elf32-m68k.c (elf_cpu32_plt0_entry): Use a1 instead of a0. - (elf_cpu32_plt_entry): Likewise. - -Thu Sep 16 10:48:17 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_write_processing): Turn on TRAPNIL. - - * elf-hppa.h (elf_hppa_final_link): If unable to find __gp in the - symbol table, then just compute a suitable value (but do not - create a __gp symbol). - - * elf-hppa.h (elf_hppa_relocate_section): Allow undefined - symbols when building shared libraries. - (elf_hppa_final_link_relocate): Correct handling of PCREL - relocations against undefined symbols. - -1999-09-16 Nick Clifton <nickc@cygnus.com> - - * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Mark - interworking sections as linker created so that they will not - be removed by garbage collection. - -Wed Sep 15 02:31:57 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link): Revamp __gp handling. - (elf_hppa_final_link_relocate): Consistently create an absolute - address, then subtract out the value of __gp. - -1999-09-14 Michael Meissner <meissner@cygnus.com> - - * configure.in (Canonicalization of target names): Remove adding - ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 - generates $ac_config_sub with a ${CONFIG_SHELL} already. - * configure: Regenerate. - -1999-09-14 Nick Clifton <nickc@cygnus.com> - - * elf32-m32r.c (ELF_MAXPAGESIZE): Change to 0x1 (at request of - Mitsubishi). - -Mon Sep 13 20:01:47 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_record_segment_addrs): New function. - (elf_hppa_final_link): Initialize text_segment_base and - data_segment_base. - (elf_hppa_final_link_relocate): Handle SEGREL relocations. - - * elf-hppa.h (elf_hppa_final_link): Remove unused variables. - (elf_hppa_final_link_relocate): Likewise. - (elf_hppa_relocate_insn): Likewise. - (elf_hppa_relocate_section): Initialize HOWTO. - -1999-09-13 Donn Terry <donn@interix.com> - - * coffcode.h (styp_to_sec_flags): Further refinement of COMDAT - handling to support both GNU and MS objects. - - * coffcode.h (coff_write_object_contents): Don't check reloc_count - when determining whether to set F_RELFLG. - -1999-09-13 Philip Blundell <pb@nexus.co.uk> - - * elf32-arm.h (elf32_arm_final_link_relocate): Don't range-check - PC24 relocs if the target is an undefined weak symbol. - (arm_add_to_rel): Fix compiler warning. - (elf32_arm_plt0_entry): Correct comments. - -1999-09-13 Alan Modra <alan@spri.levels.unisa.edu.au> - - * elfcode.h (write_relocs): Check for the_bfd NULL when handling - an absolute symbol in REL relocs. - -Sun Sep 12 23:47:58 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle SECREL32. - Stub SEGREL32. Return an error for any relocation not handled. - -1999-09-12 Ian Lance Taylor <ian@zembu.com> - - * cofflink.c (coff_link_add_symbols): Look for special MSVC string - constant symbols, and avoid multiple definition errors on them. - -1999-09-12 Donn Terry <donn@interix.com> - - * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most - significant bit is set. - -1999-09-11 Ian Lance Taylor <ian@zembu.com> - - * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - - * elfcode.h (write_relocs): Handle an absolute symbol in REL - relocs as we do for RELA relocs. - -1999-09-11 Donn Terry <donn@interix.com> - - * libpei.h (_bfd_pei_final_link_postscript): Declare. - (coff_final_link_postscript): Define. - * peigen.c (_bfd_pei_swap_aouthdr_out): Don't set value for data - directory entries here. - (_bfd_pei_final_link_postscript): New function. - - * peigen.c (_bfd_pei_swap_scnhdr_out): Remove code which sets - section flags based on the section name. - - * peicode.h (coff_swap_scnhdr_in): If COFF_IMAGE_WITH_PE, the - get the overflow of the s_nlnno field from the s_nreloc field. - * peigen.c (_bfd_pei_swap_scnhdr_out): If doing a final link, swap - the s_nlnno overflow of the .text section into the s_nreloc - field. - - * peigen.c (add_data_entry): Declare. - (pei_swap_aouthdr_out): Get image size right. Set linker version - more intuitively. - (pei_swap_scnhdr_out): Test for UNINIT section, not .bss. - (pe_print_idata): Code cleanup, print more info, get rid of (now) - extraneous ImageBase. - (pe_print_edata): Likewise. - (pe_print_pdata): Likewise. Print exception entries. - (pe_print_reloc): Likewise. Print MIPS_JMPADDR. - (tbl): Make const, add "UNKNOWN". - (_bfd_pe_print_private_bfd_data_common): Print timestamp. - (_bfd_pe_bfd_copy_private_bfd_data_common): Don't copy deleted - section data directory. - (_bfd_pe_bfd_copy_private_section_data): Copy pe_flags. - - * libpei.h (_bfd_pe_bfd_get_symbol_info): Declare. - * peigen.c (_bfd_pe_bfd_get_symbol_info): New function. - * peicode.h (coff_get_symbol_info): Define. - - * config.bfd (i[3456]86-*-interix*): Set targ_cflags to - -DSTRICT_PE_FORMAT. - * coffcode.h (styp_to_sec_flags): Check STRICT_PE_FORMAT rather - than __INTERIX. - (coff_classify_symbol): Re-revert 1999-08-08 patch if - STRICT_PE_FORMAT. - - * libpei.h: New file, broken out of peicode.h. - * peigen.c: New file, broken out of peicode.h. - * peicode.h: A bunch of code moved out to libpei.h and peigen.c. - * configure.in: Add peigen.lo to list of files required for each - PE target. - * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Add peigen.lo. - (BFD32_BACKENDS_CFILES): Add peigen.c. - (SOURCE_HFILES): Add libpei.h. - * configure, Makefile.in: Rebuild. - - * peicode.h (coff_swap_scnhdr_in): Don't check for a special - section name of _BSS; check IMAGE_SCN_CNT_UNINITIALIZED_DATA - instead. Don't clear the s_paddr field for an uninitialized data - section. - - * coffcode.h (coff_mkobject_hook): Set timestamp field in - coff_data_type to f_timdat. - * peicode.h (pe_mkobject_hook): Likewise. - - * peicode.h (coff_swap_filehdr_in): Check the NT executable magic - number if COFF_IMAGE_WITH_PE. - - * coffcode.h (coff_mkobject_hook): If COFF_WITH_PE, set HAS_DEBUG - to the reverse of IMAGE_FILE_DEBUG_STRIPPED. - (coff_write_object_contents): Set IMAGE_FILE_DEBUG_STRIPPED if - there is no SEC_DEBUGGING section. - * peicode.h (pe_mkobject_hook): Set HAS_DEBUG to the reverse of - IMAGE_FILE_DEBUG_STRIPPED. - - * pe-i386.c (COFF_LONG_FILENAMES): Define. - (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - * pei-i386.c (COFF_LONG_FILENAMES): Define. - (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - - * coffswap.h (IMAGE_BASE): Don't define. - * pei-arm.c (IMAGE_BASE): Don't define. - * pei-i386.c (IMAGE_BASE): Don't define. - * pei-mcore.c (IMAGE_BASE): Don't define. - * pei-ppc.c (IMAGE_BASE): Don't define. - - * cofflink.c (_bfd_coff_link_input_bfd): When writing out a - symbol, switch on the class when determining whether to modify the - value. For PE, don't modify the value of a C_FCN symbol not named - .bf. - - * libbfd-in.h (_bfd_abort): Declare. - (abort): Define. - * bfd.c (_bfd_abort): New function. - * libbfd.h: Rebuild. - - * coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE - special handling. - - * cofflink.c (_bfd_coff_link_input_bfd): If a symbol is stripped, - don't write out the associated line numbers. - - * cofflink.c (_bfd_coff_write_global_sym): Handle section symbol - aux entries. - - * cofflink.c (coff_link_add_symbols): Don't warn about symbol type - changes when the base type is unknown. - - * coffgen.c (coff_print_symbol): Fix printing of aux record for - function symbols. - - * syms.c (BSF_DEBUGGING_RELOC): Define. - * coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING - for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such - symbols named .bf. - * coffgen.c (fixup_symbol_value): Relocate a symbol which has - BSF_DEBUGGING_RELOC set. - * bfd-in2.h: Rebuild. - -1999-09-10 Ian Lance Taylor <ian@zembu.com> - - * ecoff.c (bfd_debug_section): Update initialization for new - comdat_info field. - (_bfd_ecoff_styp_to_sec_flags): Add section parameter. - * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Update declaration. - -1999-09-10 H.J. Lu <hjl@gnu.org> - - * coff-alpha.c (alpha_ecoff_backend_data): Initialize the new - _bfd_filnmlen field. - * coff-mips.c (mips_ecoff_backend_data): Likewise. - -Fri Sep 10 00:35:14 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link_relocate): Create .opd entries - for FPTR relocs involving local symbols. - - * elf-hppa.h (elf_hppa_final_link_relocate): Get the right - value for the stub address in a call through a stub. - Install the value for a local symbol directly into the DLT - instead of generating a reloc. Correctly handle FPTR64 relocs. - - * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function. - (elf_hppa_remark_useless_dynamic_symbols): Similarly. - (elf_hppa_final_link): Call them. - -1999-09-10 Ian Lance Taylor <ian@zembu.com> - - * elflink.h (elf_fix_symbol_flags): Move weakdef handling here... - (elf_adjust_dynamic_symbol): ...from here. - -Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_howto_table); There is no DIR64WR, DIR64DR - relocation, remove them. SECREL64->LTOFF16WF. - (elf_hppa_final_link_relocate): Handle LTOFF* relocations. Handle - DIR* relocations. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and - GPREL* relocations. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos. - Handle LTOFF_TP* relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle PCREL* relocs. - Consistently deal with addends. Handle DLTIND14F and DLTREL14F. - (elf_hppa_relocate_insn): Handle PCREL* relocs. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle LT_OFF_FPTR*, - DIR32, DIR64 and FPTR64 relocations. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link): Set the value of __gp to the - address of the .PARISC.global section. - (elf_hppa_relocate_section): Lookup and pass the PA64 hash - table entry elf_hppa_final_link_relocate. Do not give a warning - for a reloc against an external symbol if it has a PA64 hash - table entry. - (elf_hppa_final_link_relocate): Significantly rework. Handle - DLTIND relocations. Compute the final value of the relocation - before passing the value of elf_hppa_relocate_insn. - (elf_hppa_relocate_insn): Revamp to handle just bit tiwiddling - relocation support. Handle DLTIND relocation requests just like - DLTREL relocation requests. Simplify branch handling. - -1999-09-08 Ulrich Drepper <drepper@cygnus.com> - - * elf-hppa.h (elf_hppa_relocate_section): Catch problems with - non-allocated section as done in i386 version. - (elf_hppa_final_link_relocate): Uncomment R_PARISC_14F in switch - statement since this is no know relocation. - -Tue Sep 7 17:25:12 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14F - relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14WR and - DLTREL14WD relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14R and - DLTREL21L relocs. Pass the output bfd to elf_hppa_relocate_insn. - Pass the relocate type rather than the insn format to - elf_hppa_relocate_insn. - (elf_hppa_relocate_insn): Make switch dependent on relocation type - rather than the opcode. Handle DLTREL21L and DLTREL14R relocs. - -1999-09-07 Ian Lance Taylor <ian@zembu.com> - - * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field. - (bfd_coff_filnmlen): Define. - (bfd_coff_std_swap_table): Initialize new field. - * coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather - than FILNMLEN. - (coff_write_symbols): Likewise. - (coff_get_normalized_symtab): Likewise. - * coff-sh.c (bfd_coff_small_swap_table): Initialize new field. - * libcoff.h: Rebuild. - -1999-09-06 Donn Terry <donn@interix.com> - - * coffcode.h (sort_by_secaddr): New static function if - COFF_IMAGE_WITH_PE. - (coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort - sections by VMA when assigning target_index values. Always set - virt_size. - - * libcoff-in.h (struct pei_section_tdata): Add pe_flags field. - * coffcode.h (coff_set_alignment_hook) [COFF_WITH_PE version]: Set - pe_flags field. - * libcoff.h: Rebuild. - - * coffcode.h (coff_set_custom_section_alignment): Add const to - declaration to match definition. - (coff_write_object_contents): Don't set F_AR32W(R)? if - COFF_WITH_PE. - - * coff-i386.c (in_reloc_p): Add declaration. - (i386coff_vec): Simplify initialization of - application_section_flags. - - * coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE - version. Move COFF_WITH_PE specific code to new version. - (stype_to_sec_flags): Likewise. Add section parameter. - * coffgen.c (make_a_section_from_file): Set target_index before - calling styp_to_sec_flags. Pass section to styp_to_sec_flags. - * libcoff.h: Rebuild. - - * syms.c (stt): Add some PE/PEI section names. - (bfd_decode_symclass): Return 'w', not 'U', for a weak undefined - symbol. - (bfd_symbol_info): Check for 'w'. - - * section.c (struct bfd_comdat_info): Define. - (asection): Add comdat field. - (STD_SECTION): Initialize comdat field. - (bfd_make_section_anyway): Likewise. - * bfd-in2.h: Rebuild. - -1999-09-06 Andreas Schwab <schwab@suse.de> - - * elflink.h (elf_link_add_object_symbols): Copy NON_GOT_REF flag - to version symbols. - -1999-09-06 Nick Clifton <nickc@cygnus.com> - - * elflink.h (elf_gc_record_vtentry): Use bfd_zmalloc and - bfd_realloc instead of calloc and realloc. - -1999-09-04 Steve Chamberlain <sac@pobox.com> - - * cpu-pj.c: New file. - * elf32-pj.c: New file. - * config.bfd (pj*): New cpu. - (pj-*-*, pjl-*-*): New targets. - * configure.in (bfd_elf32_pj_vec): New target vector. - (bfd_elf32_pjl_vec): New target vector. - * archures.c (bfd_arch_pj): Define. - * elf.c (prep_headers): Handle bfd_arch_pj. - * reloc.c: Define BFD_RELOC_PJ_* relocations. - * targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add - to target vector list. - * Makefile.am: Rebuild dependencies. - (ALL_MACHINES): Add cpu-pj.lo. - (ALL_MACHINES_CFILES): Add cpu-pj.c. - (BFD32_BACKENDS): Add elf32-pj.lo. - (BFD32_BACKENDS_CFILES): Add elf32-pj.c. - * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. - -1999-09-04 Ian Lance Taylor <ian@zembu.com> - - * elf-bfd.h (ELF_LINK_NON_GOT_REF): Define. - * elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK - and NON_GOT_REF from weak defined symbol to real symbol. - * elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF. - (elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't - create a COPY reloc. - * elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF. - (elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set, - don't create a COPY reloc. - -1999-09-03 Ian Lance Taylor <ian@zembu.com> - - * elflink.h (elf_bfd_final_link): When counting relocations, don't - count those in sections we are not including in the link. - -Thu Sep 2 17:41:20 1999 Jeffrey A Law (law@cygnus.com) - - * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK - field in hpux11 shared libraries. - -1999-09-02 Nick Clifton <nickc@cygnus.com> - - * elflink.h (elf_gc_record_vtentry): Fix memory leak. - -Wed Sep 1 13:34:29 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_add_symbol_hook): New function. - (elf_hppa_final_link, elf_hppa_relocate_section): Likewise. - (elf_hppa_final_link_relocate, elf_hppa_relocate_insn): Likewise. - -1999-08-31 Alexandre Petit-Bianco <apbianco@cygnus.com> - - * elflink.h (record_link_assignment): When possible, keep the - original type of the symbol. - -Mon Aug 30 15:26:48 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Allow both - R_PARISC_DIR32 and R_PARISC_DIR64 regardless of how the - tools were configured. - * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Declare. - -1999-08-26 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local - GOT entries for GOT16 relocations; they're not required. - -1999-08-24 Nick Clifton <nickc@cygnus.com> - - From a patch submitted by Roland McGrath <roland@baalperazim.frob.com> - - * config.bfd (arm-*-netbsd*): New target. - * configure.in (armnetbsd_vec): New target vector. - * configure: Regenerate - * targets.c (bfd_target_vector): Add &armnetbsd_vec. - - * Makefile.am (BFD32_BACKENDS): Add armnetbsd.lo. - (ALL_MACHINES_CFILES): Add armnetbsd.c. - (armnetbsd.lo): New rule with deps. - * Makefile.in: Regenerate. - - * armnetbsd.c: New file: Definitions specific to arm-netbsd - target. - -Tue Aug 24 00:25:58 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (som_slurp_symbol_table): Fix typo in comment. - -Fri Aug 20 17:01:23 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_fake_sections): Compute section indices - here instead of using elf_section_data... - -1999-08-19 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c (mcore_emit_base_file_entry): New function: Emit - relocations into the base file. - (coff_mcore_relocate_section): Call mcore_emit_base_file_entry if - we are building a base file. - -1999-08-19 Nick Clifton <nickc@cygnus.com> - - * elf32-arm.h (arm_add_to_rel): New function. Add a value to - a REL style reloc. - (elf32_arm_relocate_section): Use arm_add_to_rel to increment - REL relocs when performing a partial relocation. - -1999-08-18 Donn Terry <donn@interix.com> - - * cofflink.c: Move definitions of N_TMASK, et. al., out of - _bfd_coff_link_input_bfd into top level. - - * coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE. - (RTYPE2HOWTO): Return NULL if reloc type is out of range. - (coff_i386_rtype_to_howto): Likewise. - * coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG. - Completely ignore symbols which are all zero. - (dummy_reloc16_estimate): Add return 0. - * cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope - variable copy to name_copy to avoid shadowing outer scope - variable. - * libcoff-in.h (coff_data_type): Change raw_syment_count field - from unsigned int to unsigned long. Add timestamp field. - * libcoff.h: Rebuild. - -1999-08-17 H.J. Lu <hjl@gnu.org> - - * elf32-hppa.c (bfd_elf32_bfd_is_local_label_name): Fix typo in - macro definition. - -1999-08-17 Ian Lance Taylor <ian@zembu.com> - - * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC - for special section symbols. - * elflink.h (elf_merge_symbol): If we have no old BFD, check - BSF_DYNAMIC on the section symbol to see whether the old BFD is - dynamic. - -1999-08-15 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunate - coincidence of variable names between old and new code. - -1999-08-12 Nick Clifton <nickc@cygnus.com> - - * elf32-arm.h (elf32_arm_to_thumb_stub): Make 'offset' parameter - into a bfd_vma and 'addend' parameter a 'bfd_signed_vma'. - (elf32_thumb_to_arm_stub): Make 'offset' parameter into a bfd_vma - and 'addend' parameter a 'bfd_signed_vma'. - (elf32_arm_final_link_relocate): Do not involve stubs in - R_ARM_THM_PC22 relocs relative to section symbols, they are long - jumps, not function calls. - -1999-08-11 Robin Farine <advanc@dial.eunet.ch> - - * elf32-arm.h (elf32_arm_final_link_relocate): Check for overflow - in R_ARM_PC24 relocs. - -Tue Aug 10 12:48:09 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_fake_sections): New function. - * elf32-hppa.c (elf_backend_fake_sections): Define. - - * elf-hppa.h (elf_hppa_final_write_processing): Update for - recent changes to the arch_info structure. - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle - R_HPPA_SEGBASE and R_HPPA_SEGREL32. - * cpu-hppa.c (bfd_hppa20w_arch): New entry in architecture info - list. - -Tue Aug 10 00:34:29 1999 Mark P. Mitchell <mark@codesourcery.com> - Ralf Baechle <ralf@uni-koblenz.de> - - * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always - output DT_MIPS_GOTSYM. - (_bfd_mips_elf_finish_dynamic_sections): Use the same value as - DT_MIPS_SYMTABNO if there are no global GOT symbols. - -Tue Aug 10 00:21:08 1999 Mark P. Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_create_dynamic_relocation): Change - prototype. Handle local symbols. Add commentary. - (mips_elf_calculate_relocation): Adjust accordingly. - (_bfd_mips_elf_check_relocs): Handle local symbols in R_MIPS_32 - relocations. - - * elflink.h (elf_bfd_final_link): Tweak last change. - -1999-08-09 Mark Mitchell <mark@codesourcery.com> - - * elflink.h (elf_link_size_reloc_section): Use the counts in the - elf-section data to allocate just the right amount of relocation - space. Don't allocate the hash space twice. - (elf_bfd_final_link): Calculate the amount of space to allocate in - each relocation section. - -Mon Aug 9 17:37:30 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case 32): When in - 64bit mode, generate a section relative relocation for a 32bit - wide relocation. - (elf_hppa_is_local_label_name): New function. - * elf32-hppa.c (elf_hppa_is_local_label_name): Deleted. To be - shared between 32bit and 64bit port. - -1999-08-09 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (elf_mips_howto_table): Fix src_mask for - R_MIPS_GOT16 and R_MIPS_CALL16. - (mips_elf_got16_entry): Use mips_elf_high to calculate the value - to use when looking for a preexisting GOT entry. - -1999-08-09 Jakub Jelinek <jj@ultra.linux.cz> - - * elf64-sparc.c (sparc64_elf_relocate_section): Back out part of - the Sep. 4th, 1998 change. glibc 2.0.x dynamic linker had bug, - not binutils. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - -1999-08-09 Geoff Keating <geoffk@cygnus.com> - - * elflink.h (elf_link_output_extsym): Don't output a weak - reference to an undefined symbol just because it was defined weak - in a shared object. - -1999-08-09 Eli Zaretskii <eliz@is.elta.co.il> - - * coffgen.c (coff_find_nearest_line): When looking for file, use - last best match rather than first. If address is beyond last line - number record, don't return the last line as the correct value. - -1999-08-08 Ian Lance Taylor <ian@zembu.com> - - * section.c (SEC_SMALL_DATA): Rename from SEC_SHORT. - * bfd-in2.h: Rebuild. - -1999-08-08 Mark Elbrecht <snowball3@bigfoot.com> - - * libcoff-in.h (struct coff_section_alignment_entry): Define. - * coffcode.h (coff_set_custom_section_alignment): New static - function. - (coff_section_alignment_table): New static array. - (coff_new_section_hook): Use coff_set_customer_section_alignment. - * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - * libcoff.h: Rebuild. - -1999-08-08 Ian Lance Taylor <ian@zembu.com> - - * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to - MKDEP. - * Makefile.in: Rebuild. - -1999-08-08 Mumit Khan <khan@xraylith.wisc.edu> - - * section.c (SEC_SHARED): Define. - * coffcode.h (sec_to_styp_flags): Handle SEC_SHARED. - (styp_to_sec_flags): Likewise. - * peicode.h (coff_swap_scnhdr_out): Likewise. - * bfd-in2.h: Rebuild. - -1999-08-08 Ian Lance Taylor <ian@zembu.com> - - * coffcode.h (coff_classify_symbol): Comment out part of - 1999-08-05 change which breaks cygwin DLLs. - - * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*. - * aclocal.m4, configure: Rebuild. - -1999-08-06 Ian Lance Taylor <ian@zembu.com> - - * section.c (global_syms): Only initialize union field if - __STDC__. - -1999-08-04 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index by - the size of a GOT entry here. - (mips_elf_calculate_relocation): Don't create a local GOT entry - for the symbol in a GOT16 relocation; just for it's high-order bit - (_bfd_mips_elf_relocate_section): Fix thinko. - -1999-08-05 Ian Lance Taylor <ian@zembu.com> - - Based on patches from Donn Terry <donn@interix.com>: - * coffcode.h (enum coff_symbol_classification): Define. - (bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to - _bfd_coff_classify_symbol. Change return type. - (bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global. - (coff_slurp_symbol_table): Use coff_classify_symbol. - (coff_classify_symbol): New static function. - (coff_sym_is_global): Never define. - (bfd_coff_std_swap_table): Initialize with coff_classify_symbol. - * cofflink.c (coff_link_check_ar_symbols): Use - bfd_coff_classify_symbol rather than bfd_coff_sym_is_global. - (coff_link_add_symbols): Likewise. - (_bfd_coff_link_input_bfd): Likewise. - * coff-sh.c (bfd_coff_small_swap_table): Initialize with - coff_classify_symbol. - * libcoff.h: Rebuild. - -Wed Aug 4 18:08:07 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h (R_HPPA_LTPSEL, R_HPPA_RTPSEL): New field selectors - (e_ltpsel, e_rtpsel): Similarly. - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle 21bit e_ltpsel - and 14bit ertpsel. Handle 64bit psel. - -1999-08-04 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16 - handling for REL relocations. And only left-shift R_MIPS26 - relocation addends where necessary. - -1999-08-03 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ... - (mips_elf_next_lo16_relocation): Don't compute the addend here. - Just return the relocation found. - (mips_elf_relocate_section): Pull the LO16 addend out of the - section itself when using REL relocations. - - * elf32-mips.c (mips_elf_calculate_relocation): Restore - _DYNAMIC_LINK handling and handling of undefined symbols in shared - libraries. - -1999-08-03 Ian Lance Taylor <ian@zembu.com> - - * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation - value of a symbol in a SEC_DEBUGGING section. Warn when doing a - relocation against a symbol in an input section with no output - section. From Daniel Jacobowitz <drow@false.org>. - - * coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used. - - * acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to - look for generated file correctly. - * aclocal.m4, configure: Rebuild. - -1999-08-02 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26 - and R_MIPS16_26 relocations correctly when relocating. - (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16 - and R_MIPS_CALL_LO16 are for global symbols. - -1999-08-02 Jakub Jelinek <jj@ultra.linux.cz> - - * elflink.h (elf_bfd_final_link): Copy the whole isym, not just - some fields. - * elf64-sparc.c (sparc64_elf_output_arch_syms): Declare used - variables and initialize them. - -1999-08-01 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case where - there are no global symbols requiring GOT entries. - (_bfd_mips_elf_size_dynamic_sections): Likewise. - (_bfd_mips_elf_finish_dynamic_symbol): Likewise. - (_bfd_mips_elf_finish_dynamic_sections): Likewise. - - * elf32-mips.c (mips_elf_calculate_relocation): Undefined weak - symbols are considered to have the value zero. - (_bfd_mips_elf_relocate_section): Don't try to perform a - relocation for an undefined symbol. - (_bfd_mips_elf_check_relocs): Allocate locate GOT space for local - GOT16 relocations. - -1999-07-30 Jakub Jelinek <jj@ultra.linux.cz> - - * elf64-sparc.c (sparc64_elf_build_plt): Cosmetic change - ABI - wants ba,a,pt %xcc instead of %icc. - Emit correct .PLT0-(.PLTN+4) initial value into the pointer slots - of large PLT entries. - (sparc64_elf_plt_ptr_offset): Fix calculation. - (sparc64_elf_finish_dynamic_symbol): Negative value of R_SPARC_JMP_SLOT - addend should be relative to load address, not .plt section start. - (sparc64_elf_size_info): Sparc64 uses 32bit .hash entries. - -1999-07-30 Jakub Jelinek <jj@ultra.linux.cz> - - * elf-bfd.h (struct elf_backend_data): Add - print_symbol_all and output_arch_syms backend methods. - * elfxx-target.h: Likewise. - * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create, - sparc64_elf_add_symbol_hook, sparc64_elf_output_arch_syms, - sparc64_elf_get_symbol_type, sparc64_elf_symbol_processing): New - functions. - (sparc64_elf_size_dynamic_sections): Leave space for STT_REGISTER - symbols in .dynsym, add their names into .dynstr. Put those symbols - into dynlocal. - (sparc64_elf_finish_dynamic_sections): Fix up DT_SPARC_REGISTER - pointers to STT_REGISTER symbols in dynsym section. - (sparc64_elf_print_symbol_all): New function. - * elf.c (bfd_elf_print_symbol): Allow special backend symbol - printing using the print_symbol_all hook. - -1999-07-30 Catherine Moore <clm@cygnus.com> - - * elf32-arm.h (elf32_arm_check_relocs): Use r_offset for - R_ARM_GNU_VTENTRY. - -1999-07-29 Richard Henderson <rth@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms if - dynamic_sections_created. - -1999-07-29 Richard Henderson <rth@cygnus.com> - - * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ... - (mips_rtype_to_howto): ... new function. - (_bfd_mips_elf_relocate_section): Use it. - -1999-07-28 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo. - -1999-07-27 Nick Clifton <nickc@cygnus.com> - - Patch generated by Bernd Schmidt. <bernds@cygnus.co.uk> - - * coff-arm.c (coff_arm_is_local_label_name): Change to strip - out only symbols that start with LOCAL_LABEL_PREFIX followed by 'L'. - -1999-07-23 Donn Terry <donn@interix.com> - - * libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags - field, and define COFF_LINK_HASH_PE_SECTION_SYMBOL. - * cofflink.c (coff_link_add_symbols): If PE, handle section - symbols specially. - * libcoff.h: Rebuild. - - * config.bfd (i[3456]86-*-interix*): New target. - -1999-07-21 Mark Elbrecht <snowball3@bigfoot.com> - - * coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and - COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with - .gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD. - * coff-go32.c: (COFF_LONG_SECTION_NAMES): Define. - (COFF_SUPPORT_GNU_LINKONCE): Define. - * coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define. - (COFF_SUPPORT_GNU_LINKONCE): Define. - -1999-07-21 Ian Lance Taylor <ian@zembu.com> - - From Mark Elbrecht: - * makefile.dos: Remove; obsolete. - * configure.bat: Remove; obsolete. - -1999-07-21 H.J. Lu <hjl@gnu.org> - - * config.bfd (i[3456]86-*-vxworks*): Add targ_underscore=yes. - -1999-07-21 Philippe De Muyter <phdm@macqel.be> - - * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error - message and fail if a symbol index is out of range. - -1999-07-21 Ian Lance Taylor <ian@zembu.com> - - * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value - when looking at a R_MIPS_GOT16 relocation. - -1999-07-20 Nick Clifton <nickc@cygnus.com> - - * coff-m88k.c: Use CREATE_BIG_COFF_TARGET_VEC. - -Mon Jul 19 14:03:44 1999 Mark P. Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP - removed in previous change. - (_bfd_mips_elf_relocate_section): Adjust GP relative relocations - in relocateable output. - -1999-07-19 Ian Lance Taylor <ian@zembu.com> - - * coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target - structure. - - * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD - if they appear to be specially created by the linker. - -1999-07-19 Nick Clifton <nickc@cygnus.com> - - * targets.c (alternative_target): New field in bfd_target - structure. - (bfd_search_for_target): New function: Find a target that - satisifies a search function. - * bfd-in2.h: Regenerate. - - * elfxx-target.h: Initialise the alternative_target field of - the bfd_target structures to point to the other target (if - defined). - * nlm-target.h: Initialise the alternative_target field of - the bfd_target structures to point to the other target (if - defined). - - * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro. - (CREATE_LITTLE_COFF_TARGET_VEC): New macro. - - * aix386-core.c: Initialise new field of bfd_target structure. - * aout-adobe.c: Initialise new field of bfd_target structure. - * aout-arm.c: Initialise new field of bfd_target structure. - * aout-target.h: Initialise new field of bfd_target structure. - * aout-tic30.c: Initialise new field of bfd_target structure. - * binary.c: Initialise new field of bfd_target structure. - * bout.c: Initialise new field of bfd_target structure. - * cisco-core.c: Initialise new field of bfd_target structure. - * coff-a29k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-alpha.c: Initialise new field of bfd_target structure. - * coff-apollo.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-arm.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. - * coff-h8300.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-h8500.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-i386.c: Initialise new field of bfd_target structure. - * coff-i860.c: Initialise new field of bfd_target structure. - * coff-i960.c: Use CREATE_LITTLE_COFF_TARGET_VEC. - * coff-m68k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-mcore.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. - * coff-mips.c: Initialise new field of bfd_target structure. - * coff-ppc.c: Initialise new field of bfd_target structure. - * coff-rs6000.c: Initialise new field of bfd_target structure. - * coff-sh.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. - * coff-sparc.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-tic30.c: Initialise new field of bfd_target structure. - * coff-tic80.c: Use CREATE_LITTLE_COFF_TARGET_VEC. - * coff-w65.c: Use CREATE_LITTLE_COFF_TARGET_VEC. - * coff-we32k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-z8k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * hppabsd-core.c: Initialise new field of bfd_target structure. - * hpux-core.c: Initialise new field of bfd_target structure. - * i386msdos.c: Initialise new field of bfd_target structure. - * i386os9k.c: Initialise new field of bfd_target structure. - * ieee.c: Initialise new field of bfd_target structure. - * ihex.c: Initialise new field of bfd_target structure. - * irix-core.c: Initialise new field of bfd_target structure. - * mipsbsd.c: Initialise new field of bfd_target structure. - * netbsd-core.c: Initialise new field of bfd_target structure. - * oasys.c: Initialise new field of bfd_target structure. - * osf-core.c: Initialise new field of bfd_target structure. - * ppcboot.c: Initialise new field of bfd_target structure. - * ptrace-core.c: Initialise new field of bfd_target structure. - * sco5-core.c: Initialise new field of bfd_target structure. - * som.c: Initialise new field of bfd_target structure. - * srec.c: Initialise new field of bfd_target structure. - * tekhex.c: Initialise new field of bfd_target structure. - * trad-core.c: Initialise new field of bfd_target structure. - * versados.c: Initialise new field of bfd_target structure. - * vms.c: Initialise new field of bfd_target structure. - -1999-07-19 Andreas Schwab <schwab@suse.de> - - * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash - and rel_hdr. - -Sat Jul 17 02:28:28 1999 Mark P. Mitchell <mark@codesourcery.com> - - * elflink.h (elf_link_adjust_relocs): New function. - (elf_bfd_final_link): Use it. - (elf_link_input_bfd): Deal with the fact that there can be - two relocation sections for a single section. - (elf_reloc_link_order): Likewise. - - * elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for - a relocateable object. - (_bfd_mips_elf_relocate_section): Handle relocateable links. - -1999-07-16 Jakub Jelinek <jj@ultra.linux.cz> - - * elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID. - (sparc64_elf_get_reloc_upper_bound, - sparc64_elf_get_dynamic_reloc_upper_bound, - sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table, - sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs): - New functions. - (sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use - ELF64_R_TYPE_ID/DATA where appropriate. - -1999-07-16 Jakub Jelinek <jj@ultra.linux.cz> - - * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove - DT_SPARC_PLTFMT. - -1999-07-16 Ian Lance Taylor <ian@zembu.com> - - * elf32-mips.c (mips_elf_local_relocation_p): New static - function. - (mips_elf_next_lo16_addend): Call bfd_set_error on failure. - (mips_elf_calculate_relocation): Use mips_elf_local_relocation_p. - Always set *require_jalxp. - (mips_elf_stub_section_p): Mark abfd parameter as unused. - (_bfd_mips_elf_relocate_section): Only look for LO16 following - GOT16 if the GOT16 is against a local symbol. Don't return false - for an undefined symbol. If there is an overflow, assert that we - have a name. - -1999-07-16 Andreas Schwab <schwab@suse.de> - - * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused - variables `link' and `elfsec'. - (elf_bfd_final_link): Remove unused variable `os'. - -Thu Jul 15 17:55:31 1999 Mark P. Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require - a PT_PHDR program headers. - (_bfd_mips_elf_final_link): Don't assume there are going to be - section symbols when we're not building a shared object. - (_bfd_mips_elf_check_relocs): Make sure we have a GOT when - we need one. - -1999-07-15 J.T. Conklin <jtc@redback.com> - - * config.bfd (i[3456]86-*-vxworks*): New target. - -1999-07-15 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_stub_section_p): New function. - (mips_elf_calculate_relocation): Handle MIPS16 stub functions. - (mips_elf_relocate_section): Adjust calling sequence for - mips_elf_calculate_relocation and mips_elf_perform_relocation. - (mips_elf_perform_relocation): Turn `jal' into `jalx' where - required. - -1999-07-15 Ian Lance Taylor <ian@zembu.com> - - * configure.in: Bump version number to 2.9.5. - * configure: Rebuild. - -Thu Jul 15 02:56:15 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle - 64bit format. - (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type - to derive final type instead of hardwiring a selection. - -1999-07-14 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of - things relocated by R_MIPS16_GPREL. - (mips_elf_perform_relocation): Likewise. - -Wed Jul 14 15:23:19 1999 Jim Wilson <wilson@cygnus.com> - - * elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss. - -1999-07-14 Richard Henderson <rth@cygnus.com> - - * elf32-mips.c (struct mips_got_info): Add global_gotno. - (_bfd_mips_elf_size_dynamic_sections): Set it. - (_bfd_mips_elf_final_link): Re-sort; verify the got did not grow. - (mips_elf_sort_hash_table): Set max_non_got_dynindex based off - new argument max_local. - -1999-07-14 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit - subwords when handling an R_MIPS16_26 relocation. - (mips_elf_perform_relocation): Don't be paranoid abour right-shift - semantics. - - * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and - dst_mask to match reality. - (_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL. - (mips_elf_obtain_contents): Use bfd_get. - (mips_elf_perform_relocation): Handle R_MIPS16_GPREL. - (mips_elf_relocate_section): Likewise. - -1999-07-13 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26. - (mips_elf_relocate_section): Adjust calling sequence for - mips_elf_perform_relocation. - (mips_elf_perform_relocation): Take additional argument. Handle - R_MIPS16_26. Use bfd_put for convenience. - -1999-07-13 Richard Henderson <rth@cygnus.com> - - * elf.c (assign_file_positions_for_segments): Thinko last change. - Always overwrite p_flags. - -1999-07-13 Richard Henderson <rth@cygnus.com> - - * elf-bfd.h (struct elf_backend_data): Add want_dynbss. - * elflink.c (_bfd_elf_create_dynamic_sections): Only create - .dynbss and .rel[a].bss if want_dynbss. - * elfxx-target.h (elf_backend_want_dynbss): Provide default. - -1999-07-13 Richard Henderson <rth@cygnus.com> - - * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags. - -1999-07-13 Richard Henderson <rth@cygnus.com> - - * elf-bfd.h (struct elf_link_local_dynamic_entry): New. - (struct elf_link_hash_table): Add dynlocal. - (_bfd_elf_link_lookup_local_dynindx): Prototype. - (_bfd_elf_link_adjust_dynindx): Delete. - (_bfd_elf_link_renumber_dynsyms): Prototype. - (_bfd_elf,link_record_local_dynamic_symbol): Prototype. - * elfcode.h (elf_link_record_local_dynamic_symbol): New alias. - * elflink.c (_bfd_elf_link_adjust_dynindx): Delete. - (_bfd_elf_link_lookup_local_dynindx): New function. - (elf_link_renumber_hash_table_dynsyms): New function. - (_bfd_elf_link_renumber_dynsyms): New function. - * elflink.h (elf_link_record_local_dynamic_symbol): New function. - (struct elf_assign_sym_version_info): Delete removed_dynamic. - (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output - instead of elf_link_remove_section_and_adjust_dynindices. - Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms. - (elf_link_assign_sym_version): Remove removed_dynamic code. - (elf_link_renumber_dynsyms): Delete. - (elf_bfd_final_link): Install section and local symbols into .dynsym. - - * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete. - (elf_m68k_size_dynamic_sections): Don't set section dynindicies. - (elf_m68k_finish_dynamic_sections): Don't write section dynsyms. - * elf32-mips.c: Similarly. - * elf32-ppc.c: Similarly. - * elf32-sparc.c: Similarly. - * elf64-alpha.c: Similarly. - * elf64-sparc.c: Similarly. - -1999-07-13 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_calculate_relocation): Do not complain - when _gp_disp is undefined. Do not check R_MIPS_LO16 for overflow - when the relocation is against _gp_disp. - -1999-07-12 Mark Mitchell <mark@codesourcery.com> - - * dwarf2.c (read_attribute): Support DW_FORM_ref8. - * elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs - to possibly_dynamic_relocs. Adjust usage throughout code. - (elf_mips_howto_table): Handle R_MIPS_64 correctly. - (elf_mips_ctor64_howto): Likewise. - (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32. - Adjust indentation. - (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode. - (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32. - Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries. - * elf64-mips.c (elf_backend_may_use_rel_p): Define. - -1999-07-12 Ian Lance Taylor <ian@zembu.com> - - * Makefile.am: Rebuild dependencies. - * Makefile.in: Rebuild. - - * bfd-in.h: Remove tests of COFF_IMAGE_WITH_PE. - * bfd-in2.h: Rebuild. - - * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED - as appropriate. Use EMPTY_HOWTO as appropriate. Fill in - structure initializations. Add casts. - * reloc.c (EMPTY_HOWTO): Define. - * bfd-in2.h: Rebuild. - * coff-h8300.c (h8300_reloc16_extra_cases): Remove useless - comparisons against 0. - * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Change - previous_ibfd_e_flags to unsigned long. - * vms.h (struct vms_private_data_struct): Change section_count to - unsigned. - * vms-gsd.c (_bfd_vms_slurp_gsd): Change psect_idx to unsigned. - (_bfd_vms_write_gsd): Change symnum to unsigned. - * vms-hdr.c (_bfd_vms_write_hdr): Change symnum to unsigned. - * vms-tir.c (etir_sta): Change psect to unsigned. - (alloc_section): Change idx to unsigned. - (tir_sta, tir_ctl): Change psect to unsigned. - (_bfd_vms_write_tir): Change len and before to bfd_size_type. - * vms.c (priv_section_count): Change to unsigned. - -1999-07-12 Andreas Schwab <schwab@suse.de> - - * elf32-m68k.c: Add some ATTRIBUTE_UNUSED. - * m68klinux.c: Likewise. - -1999-07-12 Ian Lance Taylor <ian@zembu.com> - - * Many files: Changes to avoid gcc warnings: Remove unused local - variables. Add default case to enum switches. - * coff-arm.c (bfd_arm_allocate_interworking_sections): Only - compile if not COFF_IMAGE_WITH_PE. - (record_arm_to_thumb_glue, record_thumb_to_arm_glue): Likewise. - (bfd_arm_get_bfd_for_interworking): Likewise. - (bfd_arm_process_before_allocation): Likewise. - * epoc-pei-arm.c: Don't rename bfd_arm functions. - * pei-arm.c: Likewise. - * elf32-mips.c (mips_elf_link_hash_table_create): Don't declare. - (MIPS_ELF_ADD_DYNAMIC_ENTRY): Correct last change. - (mips_elf_got16_entry): Put parens around & in body of ==. - (mips_elf_calculate_relocation): Correct test for empty string. - * vms-gsd.c: Use _bfd_error_handler rather than fprintf to - stderr. - * vms-misc.c (_bfd_vms_length_hash_symbol): Correct sprintf - format. - -1999-07-11 Ian Lance Taylor <ian@zembu.com> - - * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED - as appropriate. Fill in structure initializations. Add variable - initializations. Add casts. - * dwarf1.c (parse_line_table): Change eachLine to unsigned long. - (dwarf1_unit_find_nearest_line): Change i to unsigned long. - - * elf.c (bfd_elf_hash): Change parameter from unsigned char * to - char *. - * elf-bfd.h (bfd_elf_hash): Update declaration. - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts - when calling bfd_elf_hash. - -1999-07-11 Mark Mitchell <mark@codesourcery.com> - - * libbfd.c (bfd_put_8): Make it of type `void'. - * bfd-in2.h: Regenerated. - * elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize - for 32-bit hosts. - (_bfd_mips_elf_final_link): Likewise. - - * elflink.h (elf_link_read_relocs_from_section): Be type-correct. - -Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca> - - * config.bfd (hppa*-*-linux-gnu*): New target - -1999-07-07 Mark Mitchell <mark@codesourcery.com> - - * elf-bfd.h (_bfd_mips_elf_section_from_shdr): Constify. - (_bfd_mips_elf_create_dynamic_sections): New function. - (_bfd_mips_elf_add_symbol_hook): Likewise. - (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. - (_bfd_mips_elf_finish_dynamic_symbol): Likewise. - (_bfd_mips_elf_finish_dynamic_sections): Likewise. - (_bfd_mips_elf_gc_mark_hook): Likewise. - (_bfd_mips_elf_gc_sweep_hook): Likewise. - (_bfd_mips_elf_always_size_sections): Likewise. - (_bfd_mips_elf_size_dynamic_sections): Likewise. - (_bfd_mips_elf_check_relocs): Likewise. - (_bfd_mips_elf_link_hash_table_create): Likewise. - (_bfd_mips_elf_print_private_data): Likewise. - (_bfd_mips_elf_link_output_symbol_hook): Likewise. - (_bfd_mips_elf_final_link): Likewise. - (_bfd_mips_elf_additional_program_headers): Likewise. - (_bfd_mips_elf_modify_segment_map): Likewise. - (_bfd_mips_elf_relocate_section): Likewise. - * elf32-mips.c (mips_elf32_object_p): Move contents into - _bfd_mips_elf_object_p. - (mips_elf_additional_program_headers): Rename to - _bfd_mips_elf_additional_program_headers. - (mips_elf_modify_segment_map): Rename to - _bfd_mips_elf_modify_segment_map. - (elf_mips_abi_name): Change prototype. - (mips_elf32_section_from_shdr): Merge into - _bfd_mips_elf_section_from_shdr. - (mips_elf32_section_processing): Merge into - _bfd_mips_elf_section_processing. - (mips_elf_final_link): Rename to _bfd_mips_elf_final_link. Invoke - the right back-end ELF linker. - (mips_elf_relocate_section): Rename to - _bfd_mips_elf_relocate_section. Clean up. Adjust for 64-bit code. - (mips_elf_link_output_symbol_hook): Rename to - _bfd_mips_elf_link_output_symbol_hook. - (mips_elf_create_dynamic_section): Rename to - _bfd_mips_elf_create_dynamic_section. - (mips_elf_check_relocs): Rename to _bfd_mips_elf_check_relocs. - Adjust for 64-bit code. Use mips_elf_got_section. - (mips_elf_adjust_dynamic_symbol): Rename to - _bfd_mips_elf_adjust_dynamic_symbol. Use - mips_elf_allocate_dynamic_relocations. - (mips_elf_finish_dynamic_symbol): Rename to - _bfd_mips_elf_finish_dynamic_symbol. Use mips_elf_got_section. - Adjust for 64-bit code. - (mips_elf_finish_dynamic_sections): Rename to - _bfd_mips_elf_finish_dynamic_sections. Adjust for 64-bit code. - (mips_elf_always_size_sections): Rename to - _bfd_mips_elf_always_size_sections. - (mips_elf_add_symbol_hook): Rename to - _bfd_mips_elf_add_symbol_hook. - (mips_elf_next_lo16_addend): Constify. - (mips_elf_calculate_relocation): Likewise. - (mips_elf_obtain_contents): Likewise. - (mips_elf_perform_relocation): Likewise. - (mips_elf_create_dynamic_relocation): Likewise. - (mips_elf_allocate_dynamic_relocations): New function. - (MIPS_ELF_REL_DYN_SECTION_NAME): New macro. - (MIPS_ELF_REL_SIZE): Likewise. - (MIPS_ELF_DYN_SIZE): Likewise. - (MIPS_ELF_GOT_SIZE): Likewise. - (MIPS_ELF_SYM_SIZE): Likewise. - (MIPS_ELF_LOG_FILE_ALIGN): Likewise. - (MIPS_ELF_GET_WORD): Likewise. - (MIPS_ELF_PUT_WORD): Likewise. - (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. - (STUB_LW): Conditionalize for 64-bit value. - (elf_mips_howto_table): Add R_MIPS_HIGHER and R_MIPS_HIGHEST - entries. - (_bfd_mips_elf_merge_private_bfd_data): Merge e_ident[EI_CLASS]. - Check it for inconsistency. - (_bfd_mips_elf_print_private_bfd_data): Print ABI=64 for 64-bit - ABI. - (_bfd_mips_elf_fake_sections): Remove duplicate handling of - .msym. - (mips_elf_global_got_index): Use MIPS_ELF_GOT_SIZE. - (mips_elf_got_offset_from_index): Use misp_elf_got_section. - (mips_elf_create_local_got_entry): Use MIPS_ELF_GOT_SIZE. - (mips_elf_local_got_index): Likewise. - (mips_elf_got_page): Likewise. - (mips_elf_got_info): Likewise. - (mips_elf_create_dynamic_relocation): Handle 32-bit/64-bit split. - (ELF_DYNAMIC_INTERPRETER): Handle 64-bit code. - (mips_elf_create_dynamic_sections): Use MIPS_ELF_LOG_FILE_ALIGN, - instead of constant `2'. - (mips_elf_create_got_section): Tidy. Use MIPS_ELF_GOT_SIZE. - (mips_elf_create_msym_section): Use MIPS_ELF_LOG_FILE_ALIGN. - (mips_elf_size_dynamic_sections): Use - MIPS_ELF_REL_DYN_SECTION_NAME, MIPS_ELF_GOT_SIZE, - MIPS_ELF_ADD_DYNAMIC_ENTRY. Remove #if 0'd code. - Adjust all releveant entries in elf backend table. - * elf64-mips.c (mips_elf64_section_from_shdr): Remove. - (mips_elf64_section_processing): Likewise. - Adjust elf backend entries to use _bfd_mips_elf variants now - publicly available. - - * elflink.h (elf_link_create_dynamic_sections): Handle non-standard - hash-entry sizes. - (size_dynamic_sections): Likewise. - (elf_link_output_extsym): Likewise. - * elf.c: (elf_fake_sections): Likewise. - * libbfd.c (bfd_get): New macro. - (bfd_put): Likewise. - * bfd-in2.h: Regenerated. - -1999-07-07 Mark Mitchell <mark@codesourcery.com> - - * elf-bfd.h (elf_size_info): Add hash_entry_size, - int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out, - wap_reloca_in, and swap_reloca_out. - * elflink.h (elf_link_read_relocs_from_section): Adjust to handle - multiple internal relocations per external relocation. - (link_read_relocs): Likewise. - (elf_bfd_final_link): Likewise. - (elf_link_input_bfd): Likewise. - (elf_gc_mark): Likewise. - (elf_gc_smash_unused_vtentry_relocs): Likewise. - * elfcode.h (elf_swap_dyn_out): Adjust type to match - elf_swap_dyn_in. - (size_info): Add entries for new fields. - * elf64-mips.c (mips_elf64_swap_reloc_out): Enable. - (mips_elf64_be_swap_reloc_in): New function. - (mips_elf64_be_swap_reloc_out): Likewise. - (mips_elf64_be_swap_reloca_in): Likewise. - (mips_elf64_be_swap_reloca_out): Likewise. - (mips_elf64_size_info): Add entries for new fields. - -1999-07-07 Ian Lance Taylor <ian@zembu.com> - - * elflink.h (elf_bfd_final_link): Assert that section reloc_count - field equals the new rel_count field. - (elf_link_input_bfd): When doing a relocateable link, use the new - rel_count field rather than the reloc_count field. - (elf_reloc_link_order): Likewise. - (elf_finish_pointer_linker_section): Likewise. - - Based on patch from H.J. Lu <hjl@gnu.org>: - * elflink.h (elf_merge_symbol): Permit a non-weak definition in a - shared library to override a weak definition in a regular object. - -Tue Jul 6 10:23:39 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h: Revert July 2, 1999 patch. - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): T mode selectors - need to generate DLTIND relocations, not DLTREL relocations. - -1999-07-05 Nick Clifton <nickc@cygnus.com> - - * coffcode.h (coff_set_arch_mach_hook): Recognise arm 5 - architectures. - (coff_set_flags): Recognise arm 5 architectures. - - * cpu-arm.c: Add support for strongarm and arm9 cpus. - Add support for armv5 architecture. - - * archures.c: Add bfd_mach_arm_5 and bfd_mach_arm_5T. - - * reloc.c: Add new, assembler only, ARM reloc: - BFD_RELOC_ARM_ADRL_IMMEDIATE. - - * bfd-in2.h: Regenerate. - -1999-07-02 Mark Mitchell <mark@codesourcery.com> - - * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter. - (_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter. - * elf.c (_bfd_elf_find_nearest_line): Pass it. - * elf32-arm.h (elf32_arm_find_nearest_line): Likewise. - * elf32-mips.c (ABI_64_P): New macro. - (IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P. - (_bfd_mips_elf_find_nearest_line): Adjust call to - _bfd_dwarf2_find_nearest_line. - * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. - * libbfd.h: Regenerated. - -1999-07-02 Ian Lance Taylor <ian@zembu.com> - - * config.bfd: Add * at the end of i[3456]86-*-unixware. - -Fri Jul 2 12:21:10 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h (HPPA_R_ARG_RELOC): Delete. - (HPPA_R_CONSTANT, HPPA_R_ADDEND): Likewise. - -1999-07-01 Mark Mitchell <mark@codesourcery.com> - - * elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2 - fields. - (_bfd_elf_init_reloc_shdr): New function. - * elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than - bfd_alloc followed by memset. - (_bfd_elf_init_reloc_shdr): New function, split out from ... - (elf_fake_sections): Here. - (assign_section_numbers): Assign section numbers for the second - relocation section, if required. - * elflink.h (elf_link_output_relocs): New function. - (elf_link_size_reloc_section): Likewise. - (elf_bfd_final_link): Use elf_link_size_reloc_section. - (elf_link_input_bfd): Use elf_link_output_relocs. - - * elf32-mips.c (_bfd_mips_elf_fake_sections): Use - _bfd_elf_init_reloc_shdr to initialize rel_hdr2. - -Thu Jul 1 13:58:48 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle R_PCREL_CALL - with 22bit format. - -1999-06-28 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_got_info): Move declaration before - prototypes. Change global_gotsym to be a pointer to a hash entry, - rather than a number index. - (mips_elf_link_hash_entry): Move declaration before prototypes. - (mips_elf_irix6_finish_dynamic_symbol): New function. - (mips_elf_sign_extend): Likewise. - (mips_elf_high): Likewise. - (mips_elf_higher): Likewise. - (mips_elf_highest): Likewise. - (mips_elf_global_got_index): Likewise. - (mips_elf_local_got_index): Likewise. - (mips_elf_got_offset_from_index): Likeiwse. - (mips_elf_record_global_got_symbol): Likewise. - (mips_elf_got_page): Likewise. - (mips_elf_next_lo16_addend): Likewise. - (mips_elf_calculate_relocation): Likewise. - (mips_elf_obtain_contents): Likewise. - (mips_elf_perform_relocation): Likewise. - (mips_elf_assign_gp): Likewise. - (mips_elf_sort_hash_table_f): Likewise. - (mips_elf_sort_hash_table): Likewise. - (mips_elf_got_section): Likewise. - (mips_elf_got_info): Likewise. - (mips_elf_create_local_got_entry): Likewise. - (mips_elf_got16_entry): Likewise. - (mips_elf_create_dynamic_relocation): Likewise. - (elf_mips_howto_table): Add description of R_MIPS_SCN_DISP. - (mips_elf_final_gp): Use mips_elf_assign_gp. - (_bfd_mips_elf_symbol_processing): Don't move SHN_COMMON symbols - into SHN_SCOMMON automatically on IRIX6. - (mips_elf_add_symbol_hook): Likewise. - (mips_elf_relocate_section): Rewrite, using - mips_elf_calculate_relocation and mips_elf_perform_relocation. - (mips_elf_create_dynamic_section): Use MIPS_ELF_STUB_SECTION_NAME. - Don't deal with .rld_map on IRIX6. - (mips_elf_create_got_section): Adjust use of global_gotsym. Set - section flags appropriately for .got. - (mips_elf_check_relocs): Handle IRIX6 relocations making use of - the got. Call mips_elf_record_global_got_symbol and allocate - local got space appropriately. - (mips_elf_size_dynamic_sections): Use bfd_byte *, not unsigned - char *. Rework calculation of GOT size. Sort dynamic symbol - table entries so entries that do not require GOT entries appear at - the beginning. Don't use DT_MIPS_HIPAGENO on IRIX6. Remove dead - code dealing with DT_INIT and DT_FINI. Remove fiddling with - global_gotsym. - (mips_elf_finish_dynamic_symbol): Adjust creation of global GOT - entries. - (mips_elf_finish_dynamic_symbol): Use - mips_elf_irix6_finish_dynamic_symbol. - (mips_elf_finish_dynamic_sections): Correct off-by-one error - setting DT_MIPS_UNREFEXTNO. Adjust setting of DT_MIPS_GOTSYM for - change to global_gotsym. Set DT_MIPS_OPTIONS on IRIX6. - -1999-06-30 Ian Lance Taylor <ian@zembu.com> - - * elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a - relocateable link. From Ralf Baechle <ralf@uni-koblenz.de>. - -1999-06-04 Philip Blundell <philb@gnu.org> - - * elf32-arm.h (elf_backend_got_header_size): Define. - (elf_backend_plt_header_size): Likewise. - -1999-06-28 Jim Pick <jim@jimpick.com> - - * elf32-arm.h (elf32_arm_relocate_section): Mind no_undefined - -Tue Jun 29 02:25:03 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.c (elf_hppa_howto_table): Use bfd_elf_generic_reloc as - relocation function. - * elf32-hppa.c (hppa_elf_reloc): Kill unused/unwanted function. - -1999-06-27 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro. - (MIPS_ELF_OPTIONS_SECTION_NAME): Likewise. - (MIPS_ELF_STUB_SECTION_NAME): Likewise. - (_bfd_mips_elf_section_from_shdr): Use them. - (_bfd_mips_elf_fake_sections): Likewise. Add .srdata to the list - of GP-relative sections. - (_bfd_mips_elf_set_section_contents): Use them. - (_bfd_mips_elf_section_processing): Share code between .sdata and - .lit4/.lit8 sections. Set appropriate flags for .srdata. - (mips_elf_additional_program_headers): Add handling for - PT_MIPS_OPTIONS segment on IRIX6. - (mips_elf_modify_segment_map): Likeiwse. - (mips_elf_final_link): Set EF_MIPS_CPIC when required by the ABI. - Include the options sections on IRIX6. Don't look for GP-relative - sections by name; use SHF_MIPS_GPREL instead. - (ELF_DYNAMIC_INTERPRETER): Adjust to use /usr/lib32/libc.so.1 for - the N32 ABI. - (mips_elf_create_dynamic_sections): Don't muck about with section - alignments and such on IRIX6. - (mips_elf_adjust_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. - (mips_elf_size_dynamic_sections): Likewise. Adjust to handle the - fact that ELF_DYNAMIC_INTERPRETER is no longer a constant. Use - bfd_zalloc rather than bfd_alloc and memset. - (mips_elf_finish_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. - Don't assert the existence of .rld_map on IRIX6. - (mips_elf_finish_dynamic_sections): Use MIPS_ELF_STUB_SECTION_NAME. - - * elf32-mips.c (mips_elf_adjust_dynindx): Remove. - (mips_elf_size_dynamic_sections): Use _bfd_elf_link_adjust_dynindx - instead. - -1999-06-26 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (mips_elf_swap_msym_in): New function. - (mips_elf_swap_msym_out): New function. - (mips_elf_create_msym_section): Likewise. - (MIPS_ELF_MSYM_SECTION_NAME): New macro. - (_bfd_mips_elf_final_write_processing): Set sh_link for .msym. - (_bfd_mips_elf_section_from_shdr): Reject an SHT_MIPS_MSYM - section not named .msym. - (_bfd_mips_elf_fake_sections): Use MIPS_ELF_MSYM_SECTION_NAME, not - .msym directly. Set appropriate attributes for the .msym - section. - (mips_elf_link_hash_entry): Add min_dyn_reloc_index field. - (mips_elf_link_hash_newfunc): Clear it. - (mips_elf_create_dynamic_sections): Create the .msym section - on IRIX6. - (mips_elf_size_dynamic_sections): Allocate space for the - .msym section. Add a DT_MIPS_MSYM entry. - (mips_elf_finish_dynamic_symbol): Write out a .msym entry for - the symbol. - (mips_elf_finish_dynamic_sections): Assign a value for - DT_MIPS_MSYM. Add .msym entries for the section symbols as well. - - * elf32-mips.c (irix_compat_t): New enumeration. - (ABI_N32_P): New macro. - (IRIX_COMPAT): Likewise. - (SGI_COMPAT): Implement in terms of IRIX_COMPAT. - (mips_elf_relocate_section): Fix typo. - -1999-06-26 Mumit Khan <khan@xraylith.wisc.edu> - - * peicode.h (coff_swap_scnhdr_out): Mark non readonly BFD sections - as writable PE sections. - -1999-06-26 David Mosberger <davidm@hpl.hp.com> - - * dwarf2.c (struct arange): New type. - (struct comp_unit): Replace LOW and HIGH by member ARANGE. - (arange_add): New function. - (decode_line_info): Keep track of address ranges that a compilation - unit covers. - (comp_unit_contains_address): Return true if address is contained - in _any_ of the address ranges associated with a compilation unit. - (_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line - on the first comp_unit that contains the address. - -1999-06-26 David Mosberger <davidm@hpl.hp.com> - - * dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer. - (decode_line_info): Add variable STASH and initialize it to point - to the per-bfd dwarf2_debug info. Remove static variable - dwarf_line_buffer and use stash->dwarf_line_buffer in its place. - -1999-06-26 Ian Lance Taylor <ian@zembu.com> - - * elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic - shared library to have an undefined symbol. - - From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>: - * elf32-ppc.c (ppc_elf_relocate_section): Fix last patch. - -Thu Jun 24 20:59:11 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.c (elf_hppa_final_write_processing): New function. - * elf32-hppa.c: Remove everything related to symbol extension - sections & records. Use the common elf_hppa_final_write_processing. - -1999-06-22 Mark Mitchell <mark@codesourcery.com> - - * elflink.h (size_dynamic_sections): Use user-specified init/fini - functions instead of _init/_fini if requested. - -1999-06-23 Ian Lance Taylor <ian@zembu.com> - - * elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link - field. - -1999-06-22 Ian Lance Taylor <ian@zembu.com> - - From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>: - * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set unused dynindx - field to 0, not -1. - (ppc_elf_finish_dynamic_sections): Check for positive section - dynindx field, rather than comparing against -1. - (ppc_elf_relocate_section): Only return false if undefined_symbol - or reloc_overflow fail, not always upon encountering an error. - -1999-06-22 Mark Mitchell <mark@codesourcery.com> - - * elflink.h (link_read_relocs): Explicitly cast external_relocs to - bfd_byte * before performing pointer arithmetic. - -Tue Jun 22 13:06:25 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h: New file. Common stuff for elf32 and elf64 PA - support. - * elf32-hppa.c: Include elf-hppa.h. - (ARCH_SIZE): Define. - (elf_hppa_reloc_type_lookup): Delete. Found in the common code - now. - (elf32_hppa_info_to_howto): Similarly. - (elf_hppa_howto_table): Similarly. - (elf_hppa_reloc_type_lookup): Similarly. - (hppa_elf_gen_reloc_type): Similarly. - * elf32-hppa.h (ELF_HOWTO_TALBE, N_PARISC_RELOCS): Delete. - -1999-06-22 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_final_link_relocate): Catch overflow - handling R_V850_22_PCREL relocation. - -1999-06-21 Ian Lance Taylor <ian@zembu.com> - - * coff-arm.c (arm_emit_base_file_entry): Explicitly declare return - type. - -Sun Jun 20 14:13:57 1999 Richard Henderson <rth@cygnus.com> - - * section.c (_bfd_strip_section_from_output): Ignore sections - DISCARDed by the link script. - -1999-06-19 Ian Lance Taylor <ian@zembu.com> - - * elflink.h (elf_link_remove_section_and_adjust_dynindices): - Remove unused local variable spp. - - * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't crash if - the entry symbol is not set. - -Fri Jun 18 04:24:57 1999 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_relocate_section): Don't adjust - GPDISP or LITUSE in a relocatable link. - -Thu Jun 17 21:24:43 1999 J"orn Rennecke <amylaar@cygnus.co.uk> - - * dwarf1.c (alloc_dwarf1_unit): Allocate using bfd_zalloc. - * (alloc_dwarf1_func): Likewise. - -Wed Jun 16 03:09:57 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h: Fix various formatting errors. - (assemble_3); Rewrite using CATENATE. - (assemble_17): Fix various bugs. - -1999-06-16 Nick Clifton <nickc@cygnus.com> - - * elf32-mcore.c (R_MCORE_RAW): Fix definition. - -1999-06-15 Richard Henderson <rth@cygnus.com> - - * section.c (SEC_SHORT): Define. - * bfd-in2.h: Rebuild. - -1999-06-13 Mark Mitchell <mark@codesourcery.com> - - * elflink.h (elf_link_remove_section_and_adjust_dynindices): - Remove abfd parameter. Use _bfd_strip_section_from_output. - (bfd_elf_size_dynamic_sections): Adjust callers accordingly. - - * elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function. - * elflink.c (_bfd_elf_link_adjust_dynindx): Define it. - * elflink.h (elf_link_remove_section_and_adjust_dynindices): New - function. - (bfd_elf_size_dynamic_sections): Use it. - -1999-06-13 Alan Modra <alan@spri.levels.unisa.edu.au> - - * elf32-i386.c (elf_howto_table): Change R_386_PC8 from - complain_overflow_bitfield to complain_overflow_signed. - -1999-06-13 Mark Mitchell <mark@codesourcery.com> - - * elflink.h (elf_link_read_relocs_from_section): New function, - split out from ... - (elf_link_read_relocs): Here. Use it for both relocation - sections. - -1999-06-12 Mark Mitchell <mark@codesourcery.com> - - * elfcode.h (elf_slurp_reloc_table_from_section): Don't assume - asect->reloc_count is valid. - -1999-06-12 Ian Lance Taylor <ian@zembu.com> - - * elf32-mips.c (mips_elf32_section_processing): Permit a - SHT_MIPS_REGINFO section to have a size of 0. - -1999-06-12 David O'Brien <obrien@freebsd.org> - - * config.bfd (alpha*-*-freebsd*): New target. - (i[3456]86-*-freebsd*): Now defaults to ELF. - -1999-06-11 Ian Lance Taylor <ian@zembu.com> - - * reloc.c (_bfd_relocate_contents): Permit bitfield relocations to - wrap if the relocation covers the high bit of an address. - - * dwarf2.c (decode_line_info): Remove unused variable first_time. - -1999-06-10 Jakub Jelinek <jj@ultra.linux.cz> - - * elf64_sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std - instead of R_SPARC_max. - (sparc64_elf_info_to_howto): Likewise. - * elf32_sparc.c (elf32_sparc_relocate_section): Likewise. - (elf32_sparc_info_to_howto): Likewise; handle vtable relocations. - -1999-06-07 Richard Henderson <rth@cygnus.com> - - * section.c (_bfd_strip_section_from_output): Remove output - sections with no initial link_order. - -1999-06-07 Nick Clifton <nickc@cygnus.com> - - * elf32-m88k.c (ELF_MAXPAGESIZE): Define. - -Mon Jun 7 11:49:43 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * Makefile.am (SOURCE_HFILES): Add missing headers. - * Makefile.in: Regenerated. - -1999-06-06 Mark Mitchell <mark@codesourcery.com> - - * elf32-mips.c (_bfd_mips_elf_print_private_data): Recognize - the N32 ABI. - -1999-06-04 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> - - * elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of - range undefweak symbols. - * hash.c: Add missing comma after @xref{} - * linker.c: Likewise. - -1999-06-04 Nick Clifton <nickc@cygnus.com> - - * elfxx-target.h (ELF_MAXPAGESIZE): Produce an error message - if not defined. - * elf32-gen.c (ELF_MAXPAGESIZE): Define. - * elf32-i860.c (ELF_MAXPAGESIZE): Define. - * elf32-i960.c (ELF_MAXPAGESIZE): Define. - * elf64-gen.c (ELF_MAXPAGESIZE): Define. - -1999-06-04 Ian Lance Taylor <ian@zembu.com> - - * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Add dwarf1.lo. - (BFD32_BACKENDS_CFILES): Add dwarf1.c. - * Makefile.in: Rebuild. - -1999-06-04 Nick Clifton <nickc@cygnus.com> - - * Makefile.am: Add epoc-arm-pe target. - * Makefile.in: Regenerate. - * pe-arm.c: Only redefine interworking function names if they have - not already been redefined. - * pei-arm.c: Only redefine interworking function names if they have - not already been redefined. - * epoc-pe-arm.c: Redefine interworking function names to avoid a - name space clash. - * epoc-pei-arm.c: Redefine interworking function names to avoid a - name space clash. - -1999-06-03 Nick Clifton <nickc@cygnus.com> - - * elfxx-target.h (ELF_MAXPAGESIZE): Default to 0x1000 not 1. - -Fri Jun 4 10:05:11 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * elf.c (elf_fake_sections): Undo change of 1999-05-10. - -Fri Jun 4 03:10:49 1999 J"orn Rennecke <amylaar@cygnus.co.uk> - - * elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of - start / stop for recalculating of r_addend of R_SH_SWITCH*. - -Fri Jun 4 02:53:13 1999 J"orn Rennecke <amylaar@cygnus.co.uk> - - * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32 - in other text sections. - -Fri Jun 4 02:29:34 1999 J"orn Rennecke <amylaar@cygnus.co.uk> - - * libbfd.c (_bfd_generic_verify_endian_match): New function. - * libbfd-in.h (_bfd_generic_verify_endian_match): Declare. - * libbfd.h: Regenerate. - * coff-sh.c (sh_merge_private_data): Delete. - (coff_bfd_merge_private_bfd_data): Change to - _bfd_generic_verify_endian_match. - (elf32-sh.c): bfd_elf32_bfd_merge_private_bfd_data: Define. - -1999-06-03 Ulrich Drepper <drepper@cygnus.com> - - * elf32-arm.h: Fix typo: change ELF_MAXPAGE_SIZE to ELF_MAXPAGESIZE. - -1999-06-03 Ian Lance Taylor <ian@zembu.com> - - * bfd-in.h (bfd_elf32_arm_allocate_interworking_sections): Correct - prototype. - (bfd_elf32_arm_process_before_allocation): Likewise. - * bfd-in2.h: Rebuild. - -1999-06-03 David Mosberger <davidm@hpl.hp.com> - - * dwarf2.c (struct line_info): Add member END_SEQUENCE to keep - track of end_sequence markers. - (add_line_info): Add END_SEQUENCE arg. - (decode_line_info): Don't try to infer lo_pc and hi_pc from the - debug-line info---it doesn't work right if a compilation unit - consists of multiple discontiguous code-sequences. It would be - worthwhile to optimize for the common case where a compilation - unit results in a contiguous set of code sequences, but this is - quite tricky to get right for arbitrary DWARF2 files. - (lookup_address_in_line_info_table): Don't use the last line entry - for a compilation unit for anything with an address higher than - this line entry. Also, check for end_sequence markers to - correctly handle discontinuities. - (_bfd_dwarf2_find_nearest_line): When checking previously loaded - compilation units, check all compilation units with each->high==0 - just like when reading compilation units. - - * dwarf2.c (decode_line_info): Initialize table->files and - table->last_line to NULL to avoid segfaults due to random - values in these members. - (concat_filename): Check for out-of-range file number before - indexing filename table. Segfaults suck. - - * dwarf2.c (decode_line_info): Don't truncate address to least - significant 32 bits (breaks 64 bit targets). - (lookup_address_in_function_table): Ditto. - (comp_unit_contains_address): Ditto. - -1999-06-02 Mark Mitchell <Mark Mitchell <mark@codesourcery.com>> - - * elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR. - * elf64-mips.c (mips_elf64_howto_table_rel): Likewise. - (mips_elf64_howto_table_rela): Likewise. - - * elfcode.h (elf_slurp_reloc_table_from_section): New function, - split out from ... - (elf_slurp_reloc_table): Here. Use it to handle the case where a - single section has two associated relocation sections. - -1999-06-02 Mark Salter <msalter@cygnus.com> - - * coffcode.h (coff_set_alignment_hook): Set lma from s_vaddr if - COFF_WITH_PE defined. - -1999-06-02 Nick Clifton <nickc@cygnus.com> - - * pe-arm.c: Rename global arm interworking functions to avoid name - collision when all targets BFD is built. - * pei-arm.c: Ditto. - -1999-05-31 Mark Mitchell <mark@codesourcery.com> - - * elf-bfd.h (elf_backend_data): Remove use_rela_p. Add - may_use_rel_p, may_use_rela_p, default_use_rela_p. - (bfd_elf_section_data): Add use_rela_p. - * elf.c (bfd_section_from_shdr): Set use_rela_p appropriately. - (_bfd_elf_new_section_hook): Likewise. - (elf_fake_sections): Use may_use_rela_p, etc., instead of - use_rela_p. - (_bfd_elf_copy_private_section_data): Copy use_rela_p. - * elfcode.h (write_relocs): Determine whether or not use rela - relocs based on the relocation section header. - * elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p - instead of use_rela_p. - * elfxx-target.h (elf_backend_may_use_relp): New macro. - (elf_backend_may_use_rela_p): Likewise. - (elf_backend_default_use_rela_p): Likewise. - (elfNN_bed): Use them. - -Wed Jun 2 12:38:49 1999 Miodrag Vallat <miodrag@multimania.com> - - * hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096. - -Tue Jun 1 17:57:58 1999 Mark P. Mitchell <mitchell@n02.acl.lanl.gov> - - * reloc.c (BFD_RELOC_MIPS_SUB): New relocation. - (BFD_RELOC_MIPS_GOT_PAGE): Likewise. - (BFD_RELOC_MIPS_GOT_OFST): Likewise. - (BFD_RELOC_MIPS_GOT_DISP): Likewise. - * bfd-in2.h: Regenerated. - * libbfd.h: Likewise. - * elf32-mips.c (mips_info_to_howto_rela): New function. - (USE_REL): Adjust for new conventions. - (MINUS_ONE): New macro. - (elf_mips_howto_table): Add R_MIPS_SUB. - (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST, - and MIPS_GOT_DISP. - (mips_elf_final_write_processing): Set sh_link, not sh_info, for a - .MIPS.content section. - (_bfd_mips_elf_fake_sections): Treat all sections that begin - with .MIPS.content as .MIPS.content sections. Set - SHF_MNIPS_NOSTRIP for such section. - (elf_info_to_howto): Define to mips_info_to_howto_rela. - * elf64-mips.c (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, - MIPS_GOT_OFST, and MIPS_GOT_DISP. - -Wed Jun 2 11:51:12 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized - variable. - - * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous - `else'. - -1999-05-30 Philip Blundell <philb@gnu.org> - - * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of - 1993-03-25 (!!). Take into account the bitmasks for the reloc so - the addend does not overflow into the rest of the word. - -1999-05-29 Nick Clifton <nickc@cygnus.com> - - * bfd-in.h: Amend prototype for - bfd_elf32_arm_process_before_allocation . - * bfd-in.h: Regenerate. - - * elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of - elements in a fixed sized array. - (ARM_ELF_ABI_VERSION): Define. - (ARM_ELF_OS_ABI_VERSION): Define. - (R_ARM_THM_ABS5): Fix rightshift and size. - (R_ARM_THM_PC22): Fix size. - (R_ARM_PLT32): Define Howto. - (find_howto): New function: Locate a howto based on a reloc - number. - (elf32_arm_info_to_howto): Use find_howto if necessary. - (elf32_arm_reloc_map): Change type of field bfd_reloc_val to - bfd_reloc_code_real_type. - (elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT - and BFD_RELOC_VTABLE_ENTRY. - (elf32_arm_reloc_type_lookup): Use find_howto if necessary. - - * elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of - elements in a fixed sized array. - (ARM_ELF_ABI_VERSION): Define. - (ARM_ELF_OS_ABI_VERSION): Define. - (R_ARM_THM_ABS5): Fix rightshift and size. - (R_ARM_THM_PC22): Fix size. - (elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto. - (elf32_arm_reloc_map): Change type of field bfd_reloc_val to - bfd_reloc_code_real_type. - - * elf32-arm.h (struct elf32_arm_link_hash_table): Add new field: - no_pipeline_knowledge. - (elf32_arm_link_hash_create): Initialise new field to zero. - (bfd_elf32_arm_process_before_allocation): Add new paraemter: - no_pipeline_knowledge. Use this parameter to initialise the field - in the globals data structure. - (elf32_arm_final_link_relocate): Only add in pipeline offset if - no_pipeline_knowledge is false and the binary is from an old - toolchain. - (elf32_arm_merge_private_data): Generate an error if an attempt is - made to linl together big endian and little endian code. - (elf32_arm_post_process_headers): New function: Initialise the - EI_OSABI and EI_ABIVERSION fields of the newly created ELF program - header. - (elf_backend_post_process_headers): Define. - -1999-05-28 Nick Clifton <nickc@cygnus.com> - - * elf-bfd.h (struct elf_backend_data): Add new field: - elf_backend_post_process_headers. - - * elfxx-target.h (elf_backend_post_process_headers): Define to - NULL if not already defined. - (elfNN_bed): Initialise elf_backend_post_process_headers field. - - * elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields - to zero. - (_bfd_elf_compute_section_file_positions): Call - elf_backend_post_process_headers if defined. - -1999-05-28 Ian Lance Taylor <ian@zembu.com> - - * configure.in: Check whether getuid and getgid exist. - * archive.c: Define getuid and getgid as macros if HAVE_GETUID or - HAVE_GETGID are not defined, respectively. - (bfd_write_armap): Don't special case on _WIN32 for getuid and - getgid. - * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*. - * configure, config.in: Rebuild. - -1999-05-28 Martin Dorey <mdorey@madge.com> - - * elf32-i960.c: New file. - * elf.c (prep_headers): Handle bfd_arch_i960. - * targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec. - * config.bfd (i960-*-elf*): New target. - * configure.in (bfd_elf32_i960_vec): New target vector. - * Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo. - (BFD32_BACKENDS_CFILES): Add elf32-i960.c. - * Makefile.in, aclocal.m4, configure: Rebuild. - -1999-05-27 Nick Clifton <nickc@cygnus.com> - - * elfarm-oabi.c (elf32_arm_howto_table): Add entry for - R_ARM_PLT32. - (find_howto): New function: Find entries in the - elf32_arm_howto_table. - (elf32_arm_info_to_howto): Use find_howto if the entry cannot be - computed simply. - (elf32_arm_reloc_type_lookup): Add lookup for - BFD_RELOC_ARM_PLT32. - -1999-05-25 Philip Blundell <pb@nexus.co.uk> - - * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function. - (elf32_arm_link_hash_table_create): Use above function as the - constructor for hash table entries. - (elf32_arm_relocate_section): Avoid crash when there is no output - section. - (elf32_arm_final_link_relocate): New parameter h. - (elf32_arm_relocate_section): Pass symbol hash entry to above - routine. - (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct - comments. - -1999-05-25 Catherine Moore <clm@cygnus.com> - - * coff-arm.c (coff_arm_relocate_section): Don't emit - base file entries for pc-relative values. - -1999-05-25 DJ Delorie <dj@cygnus.com> - - * peicode.h (coff_swap_sym_in): When we create the actual section - to reflect the not-there section C_SECTION symbols refer to, - change the symbol class to C_STAT as the section is now really - there. - -1999-05-24 Philip Blundell <pb@nexus.co.uk> - - * elf32-arm.h (elf32_arm_relocate_section): Undo change of - 1999-03-25. - -Mon May 17 13:35:35 1999 Stan Cox <scox@cygnus.com> - - * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed - F_PIC_INT to F_PIC. - * coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and - F_ARM_3M labels. Changed F_PIC_INT to F_PIC. - -1999-05-16 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c (in_reloc_p): Reinstate. - -1999-05-15 Nick Clifton <nickc@cygnus.com> - - * reloc.c (BFD_RELOC_MCORE_RVA): Define. - * bfd-in2.h: Regenerate. - * coff-mcore.c (in_reloc_p): Remove defintion. - (mcore_coff_howto): Add IMAGE_REL_MCORE_RVA. - (mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to - IMAGE_REL_MCORE_RVA. - (coff_mcore_rtype_to_howto): Add special processing for - IMAGE_REL_MCORE_RVA. - (coff_mcore_relocate_section): Add support for - IMAGE_REL_MCORE_RVA. - * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE. - (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to - R_MCORE_RELATIVE. - (mcore_elf_relocate_section): Delete redundant case labels. - -Fri May 14 10:59:55 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * elf32-arm.h (elf32_arm_relocate_section): Fix operator - precedence between bit-and and comparison. - -Thu May 13 09:45:23 1999 Joel Sherrill (joel@OARcorp.com) - - * config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to - list of target formats (targ_selvecs). - (i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets. - (powerpcle*-*rtems*, sh-*-rtemself*): New targets. - -1999-05-10 DJ Delorie <dj@cygnus.com> - - * ecoff.c (_bfd_ecoff_write_armap): give the symtab element a - reasonable mode until "ar x" is smart enough to skip it (fixes - gcc/libgcc.a builds on mips-ecoff targets - - * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed - to work. Hack to support MS import libraries, which use different - COMDAT types than GNU. - (coff_slurp_symbol_table): C_SECTION symbols are local; they refer - to implied zero-length sections (see peicode below) - * coffgen.c (coff_get_normalized_symtab): Properly read long MS - filename symbols, which use one *or more* auxents. - * coffswap.h (coff_swap_aux_in): ditto - * peicode.h (coff_swap_sym_in): Build the implied zero-length - sections - -Tue May 11 15:51:58 1999 Jeffrey A Law (law@cygnus.com) - - * elf32-v850.c (v850_elf_howto_table): Make partial_inplace false - for all relocations. - -1999-05-10 Catherine Moore <clm@cygnus.com> - - * bfd-in.h (bfd_arm_allocate_interworking_sections): Static - if COFF_IMAGE_WITH_PE. - (bfd_arm_process_before_allocation): Likewise. - (bfd_arm_get_bfd_for_interworking): Likewise. - * coff-arm.c: Likewise. - * bfd-in2.h: Regenerate. - * configure.in (armpe_little_vec): Remove coff-arm.lo. - (armpe_big_vec): Likewise. - * configure: Rebuild. - -1999-05-10 Nick Clifton <nickc@cygnus.com> - - * elf.c (elf_fake_sections): Check for .rel. as start of rel - section, not just .rel. Same for .rela. - -1999-05-07 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c (coff_mcore_relocate_section): Replace assert about - endianism with an error message. - -Thu May 6 17:09:09 1999 Fred Fish <fnf@be.com> - - * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer - assignment from "unsigned char *" to "char *". - (decode_line_info): Likewise for dwarf_line_buffer assignment. - -1999-05-05 Catherine Moore <clm@cygnus.com> - - * coff-arm.c (coff_arm_relocate_section): Add one to - address of ARM_RVA32 thumb functions. - -1999-05-05 Catherine Moore <clm@cygnus.com> - - * elf32-m68k.c (elf32_m68k_set_private_flags): New. - (elf32_m68k_copy_private_bfd_data): New. - (elf32_m68k_merge_private_bfd_data): New. - (elf32_m68k_print_private_bfd_data): New. - (CPU32_FLAG): Define. - (PLT_CPU32_ENTRY_SIZE): Define. - (elf_cpu32_plt0_entry): Declare. - (elf_cpu32_plt_entry): Declare. - (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries. - (elf_m68k_finish_dynamic_symbol): Likewise. - (elf_m68k_finish_dynamic_sections): Likewise. - (elf_backend_plt_header_size): Remove definition. - (bfd_elf32_bfd_copy_private_bfd_data): Define. - (bfd_elf32_bfd_merge_private_bfd_data): Define. - (bfd_elf32_bfd_set_private_flags): Define. - (bfd_elf32_bfd_print_private_bfd_data): Define. - -Mon May 3 09:24:49 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE - and R_LONG_PCREL_MODE. - -1999-04-29 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c (coff_mcore_relocate_section): Fix typos. - -Fri Apr 28 16:36:19 1999 Stan Cox <scox@cygnus.com> - - * elf32-sh.c (sh_elf_relocate_section): Include relocation addend - in relocation calculation. - -1999-04-26 Tom Tromey <tromey@cygnus.com> - - * aclocal.m4, configure: Updated for new version of libtool. - -1999-04-21 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c: Add support for mcore relocs. - -1999-04-20 Gavin Romig-Koch <gavin@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): Scrap the - incorrect use EF_MIPS_xxBITPTRS. - -1999-04-18 Ian Lance Taylor <ian@zembu.com> - - * elf64-alpha.c (elf64_alpha_relax_section): Remove unused local - variable insn. - - * bfd-in2.h: Rebuild. - * libbfd.h: Rebuild. - -Sat Apr 17 20:55:15 1999 Catherine Moore <clm@cygnus.com> - - * coff-arm.c (coff_arm_rtype_to_howto): Remove ARM26D transform. - (coff_arm_relocate_section): Add ARM26D transform. Only - change to ARM26D for relocateable links. - -1999-04-16 Gavin Romig-Koch <gavin@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): New. - (bfd_elf32_bfd_print_private_bfd_data): New. - -1999-04-15 Doug Evans <devans@casey.cygnus.com> - - * elf32-arm.h (elf32_arm_final_link_relocate): For R_ARM_THM_ABS5, - refetch addend if USE_REL, add many comments regarding current state. - For R_ARM_THM_PC22, refetch addend if USE_REL, simplify. - * elfarm-nabi.c (elf32_arm_howto_table): For R_ARM_THM_ABS5, fix - size and rightshift. For R_ARM_THM_PC22, fix bitsize. - * elfarm-oabi.c (elf32_arm_howto_table): Ditto. - -Wed Apr 14 14:33:08 1999 Richard Henderson <rth@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_read_ecoff_info): Zero `debug'. - * elf64-alpha.c (elf64_alpha_read_ecoff_info): Likewise. - -1999-04-13 David Mosberger <davidm@hpl.hp.com> - - * dwarf2.c (decode_line_info): Don't truncate address to least - significant 32 bits (breaks 64 bit targets). - (lookup_address_in_function_table): Ditto. - (comp_unit_contains_address): Ditto. - -Tue Apr 13 21:27:19 1999 Catherine Moore <clm@cygnus.com> - - * coff-arm.c (arm_emit_base_file_entry): New routine. - (A2T3_OFFSET): Define. - (T2A3_OFFSET): Define. - (coff_arm_relocate_section): Emit base file entries for interworking - stubs. - -1999-04-13 Philip Blundell <philb@gnu.org> - - * elfarm-nabi.c (elf32_arm_howto_table): Add dummy entries for - relocs 17 through 19. - -Sun Apr 11 01:25:17 1999 Richard Henderson <rth@cygnus.com> - - * elfcode.h: Remove fnmatch.h. - * elflink.h (elf_link_assign_sym_version): Call back to ld - instead of calling fnmatch. - - * config.bfd (i?86-*-beoself): Include pe vecs. - -Sun Apr 11 01:14:06 1999 Richard Henderson <rth@cygnus.com> - - * elf32-i386.c (elf_i386_finish_dynamic_sections): Allow .plt - to go missing. - -1999-04-10 Richard Henderson <rth@cygnus.com> - - * elf32-i386.c (elf_i386_relocate_section): Mind no_undefined - when trying to resolve dynamic symbol references. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-mips.c (mips_elf_relocate_section): Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - * elflink.h (elf_link_output_extsym): Likewise. - -Sat Apr 10 15:12:09 1999 Richard Henderson <rth@cygnus.com> - - * section.c (_bfd_strip_section_from_output): New function moved from - * elf64-alpha.c (elf64_alpha_strip_section_from_output): ... here. - * elf32-i386.c (elf_i386_size_dynamic_sections): Use it. - * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. - * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise. - * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. - * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. - * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. - * bfd-in2.h: Update. - -1999-04-09 Ian Lance Taylor <ian@zembu.com> - - * elf64-sparc.c: Fix incorrect calls to bfd_check_overflow. - -1999-04-08 Nick Clifton <nickc@cygnus.com> - - * coff-mcore.c: New File: Support for mcore-pe targets. - * cpu-mcore.c: New File: Support for mcore targets. - * elf32-mcore.c: New File: Support for mcore-elf target. - * pe-mcore.c: New File: Definitions for mcore-pe target. - * pei-mcore.c: New File: Definitions for mcore-pei target. - * Makefile.am: Add support for MCore targets. - * Makefile.in: Regenerate. - * config.bfd: Add support for MCore targets. - * configure.in: Add support for MCore targets. - * configure: Regenerate. - * archures.c: Add support for MCore architecture. - * bfd-in2.h: Regenerate. - * coffcode.h: Add support for mcore-pe targets. - * elf.c: Add support for mcore-elf target. - * reloc.c: Add support for MCore relocs. - * targets.c: Add support for MCore targets. - -1999-04-07 Nick Clifton <nickc@cygnus.com> - - * elfarm-nabi.c (elf32_arm_howto_table): Add entries for - R_ARM_XPC25 and R_ARM_THM_XPC22. - (elf32_arm_reloc_map): Remove redundant entries. - -1999-04-06 Ian Lance Taylor <ian@zembu.com> - - * sysdep.h (LC_MESSAGES): Never define. - -1999-04-06 Chris Torek <torek@bsdi.com> - - * reloc.c (bfd_check_overflow): Add addrsize parameter. Change - all callers. Rewrite completely. - (_bfd_relocate_contents): Rewrite overflow checking. - * bfd-in2.h: Rebuild. - -1999-04-05 Ian Lance Taylor <ian@zembu.com> - - From Gabriel Paubert <paubert@iram.es>: - * elf32-ppc.c (ppc_elf_howto_raw): Set R_PPC_GOT16_LO, - R_PPC_PLT16_LO and R_PPC_SECTOFF_LO to be complain_overflow_dont. - Set R_PPC_PLT16_HA, R_PPC_SECTOFF_HA and R_PPC_EMB_NADDR16_HA to - have a rightshift of 16 and use ppc_elf_addr16_ha_reloc. - * ppcboot.c (ppcboot_vec): Use little endian routines for - headers. - - * elf.c (elfcore_strndup): Only define if it will be used. - * elf32-ppc.c (ppc_elf_relax_section): Remove unused locals irel - and irelend. - (ppc_elf_check_relocs): Remove unused local i. - (ppc_elf_gc_mark_hook): Add default case to switch. - - From Bernd Nitzler <nitzler@kagcpd01.ag01.kodak.COM>: - * srec.c (srec_scan): Accept \r in symbol definitions. - (srec_object_p): Set HAS_SYMS if we saw any symbols. - (symbolsrec_object_p): Likewise. - -1999-04-04 Don Bowman <don@pixsci.com> - - * config.bfd: Add mips*el-*-vxworks* and mips*-*-vxworks*. - -1999-04-04 Ian Lance Taylor <ian@zembu.com> - - * dwarf1.c (parse_line_table): Remove unused locals last_pc and - last_line. - * elf-bfd.h (_bfd_elfcore_section_from_phdr): Declare. - * elf32-i386.c (elf_i386_gc_mark_hook): Add default case to - switch. - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove unused - local i. - * syms.c (_bfd_stab_section_find_nearest_line): Remove unused - local val. - -1999-03-31 Nick Clifton <nickc@cygnus.com> - - * config.bfd: Add support for arm-epoc-pe target. - * configure.in: Add support for arm-epoc-pe target. - * configure: Regenerate. - * targets.c: Add support for arm-epoc-pe target. - * coff-arm.c: Allow header files to override definition of - TARGET_UNDERSCORE and USER_LABEL_PREFIX. - * pe-arm.h: Allow previous header files to override definition of - TARGET_LITTLE_SYM and TARGET_BIG_SYM. - * pei-arm.h: Allow previous header files to override definition of - TARGET_LITTLE_SYM and TARGET_BIG_SYM. - * epoc-pe-arm.c: New file. Support arm-epoc-pe target. - * epoc-pei-arm.c: New file. Support arm-epoc-pei target. - -1999-03-30 Nick Clifton <nickc@cygnus.com> - - * elf.c (elf_map_symbols): Handle the case where section - symbols are generated for content-less sections which are - not mapped to the output file. - - * linker.c: Replace direct references to fields in BFD structure - with accessor macros. - - * elflink.h: Replace direct references to fields in BFD structure - with accessor macros. - -1999-03-25 Philip Blundell <pb@nexus.co.uk> - - * config.bfd: Eliminate redundancy in checks for Linux/ARM. - - * elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into - account when adjusting section symbols during a partial link. - -1999-03-24 Nick Clifton <nickc@cygnus.com> - - * coff-sparc.c (struct coff_reloc_map): Change type of field - 'bfd_reloc_val' to bfd_reloc_code_real_type. - * elf-m10200.c (struct mn10200_reloc_map): Ditto. - * elf-m10300.c (struct mn10300_reloc_map): Ditto. - * elf32-arc.c (struct arc_reloc_map): Ditto. - * elf32-d10v.c (struct d10v_reloc_map): Ditto. - * elf32-d30v.c (struct d30v_reloc_map): Ditto. - * elf32-fr30.c (struct fr30_reloc_map): Ditto. - * elf32-m32r.c (struct m32r_reloc_map): Ditto. - * elf32-sh.c (struct elf_reloc_map): Ditto. - * elf32-sparc.c (struct elf_reloc_map): Ditto. - * elf32-v850.c (struct v850_reloc_map): Ditto. - * elf64-sparc.c (struct elf_reloc_map): Ditto. - * elfarm-nabi.c (struct elf32_arm_reloc_map): Ditto. - * elfarm-oabi.c (struct elf32_arm_reloc_map): Ditto. - -1999-03-17 Martin Hunt <hunt@cygnus.com> - - * syms.c (_bfd_stab_section_find_nearest_line): Changed this - function so source-level assembly works. If multiple N_SOs - are seen without and N_FUNs, create an indextable entry with - a NULL function name. - -1999-03-16 Gavin Romig-Koch <gavin@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data) Allow merging - of certian similar cpus. - -1999-03-16 Gavin Romig-Koch <gavin@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_final_write_processing): - Add the 5000. Change the architecture for the 5400 to mips4. - (elf_mips_mach): Add r5000. - -1999-03-11 Doug Evans <devans@casey.cygnus.com> - - * cpu-i960.c (scan_i960_mach): Recognize i960:ka_sa and i960:kb_sb. - -1999-03-11 Nick Clifton <nickc@cygnus.com> - - * binary.c (binary_set_section_contents): Generate warning about - huge file offsets for any section that will occupy file space, not - just those that are loadable. - -1999-02-24 Jim Blandy <jimb@zwingli.cygnus.com> - - * libbfd.h: Regenerate after Nick Clifton's Feb 17 changes. - -1999-02-22 Jim Lemke <jlemke@cygnus.com> - - * elf32-ppc.c: Add ppc_elf_relax_section() for the ld option mpc860c0. - -Mon Feb 22 18:26:51 1999 Ian Lance Taylor <ian@cygnus.com> - - * elf-bfd.h (ELF_LINK_HASH_REF_REGULAR_NONWEAK): Define. - * elflink.h: Revert all changes since Feb 16. Instead: - (elf_link_add_object_symbols): Set REF_REGULAR_NONWEAK flag if - appropriate. Copy it to version symbols. - (elf_fix_symbol_flags): Set REF_REGULAR_NONWEAK for non ELF - symbols if appropriate. - (elf_adjust_dynamic_symbol): Set REF_REGULAR_NONWEAK for weakdef - symbol if appropriate. - (elf_link_output_extsym): If symbol is marked as undefined, and - has no nonweak references, mark it as weak undefined. - -Fri Feb 19 16:01:12 1999 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_merge_symbol): When overriding a dynamic - definition with a weak undefined symbol, set NEEDS_PLT if it is a - function. - (elf_link_add_object_symbols): Don't copy the other field if we - are overridding. - -Thu Feb 18 18:07:43 1999 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_merge_symbol): Do not merge any symbol from a - shared object with a weak undefined symbol. - -1999-02-18 Nick Clifton <nickc@cygnus.com> - - * elfarm-nabi.c: Set partial_inplace back to false. - -1999-02-17 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (TARGET_UNDERSCORE): Re-enable. - (USER_LABEL_PREFIX): Set to "_". - - The following patches are from: Scott Bambrough - <scottb@corelcomputer.com> - - * libaout.h (M_ARM6_NETBSD): Set to 143. - - * reloc.c: Add ARM PIC relocs: BFD_RELOC_ARM_GOT12, - BFD_RELOC_ARM_GOT32, BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_COPY, - BFD_RELOC_ARM_GLOB_DAT, BFD_RELOC_ARM_PLT32, - BFD_RELOC_ARM_RELATIVE, BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC. - * bfd-in2.h: Regenerate. - - * elfarm-nabi.c (elf32_arm_howto_table): Set partial_inplace to - 'true' as REL relocs are now being used. Add new PIC relocs: - R_ARM_COPY, R_ARM_GLOB_DAT, R_ARM_JUMP_SLOT, R_ARM_RELATIVE, - R_ARM_GOTOFF, R_ARM_GOTPC, R_ARM_GOT32, R_ARM_PLT32. - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Check byte order - of targets. - (elf32_arm_final_link_relocate): Change parameters so that entire - reloc is passed. Add support for PIC relocs. - (elf32_arm_relocate_section): Pass entire reloc to - elf32_arm_final_link_relocate. - (elf32_arm_check_relocs): Handle new PIC relocs. - (elf32_arm_adjust_dynamic_symbol): New function. - (elf32_arm_size_dynamic_sections): New function. - (elf32_arm_discard_copies): New function. - (elf32_arm_finish_dynamic_symbol): New function. - (elf32_arm_finish_dynamic_sections): New function. - (ELF_MAXPAGE_SIZE): Define. - (bfd_elf32_bfd_reloc_type_lookup): Define. - (elf_backend_relocate_section): Define. - (elf_backend_adjust_dynamic_symbol): Define. - (elf_backend_create_dynamic_sections): Define. - (elf_backend_finish_dynamic_symbol): Define. - (elf_backend_finish_dynamic_sections): Define. - (elf_backend_size_dynamic_sections): Define. - (elf_backend_plt_readonly): Define. - (elf_backend_want_got_plt): Define. - (elf_backend_want_plt_sym): Define. - -Wed Feb 17 12:02:26 1999 Stan Cox <scox@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Make reginfo - sections SEC_LINK_ONCE and SEC_LINK_DUPLICATES_SAME_SIZE. - (_bfd_mips_elf_fake_sections): Likewise. - -Wed Feb 17 12:07:23 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * elfarm-oabi.c (bfd_elf32_arm_allocate_interworking_sections, - bfd_elf32_arm_get_bfd_for_interworking, - bfd_elf32_arm_process_before_allocation): Define to avoid clash - with elfarm-nabi.c. - - * elf32-arm.h: Don't declare elf32_arm_info_to_howto. - (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub, - elf32_arm_find_nearest_line): Make them static. - -Tue Feb 16 22:44:37 1999 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_merge_symbol): Add pflags parameter. Change all - callers. Do not merge a definition from a shared object with a - weak undefined symbol. - (elf_link_add_object_symbols): Do not change the symbol type or - size if the old symbol overrides the new one. - -1999-02-08 Nick Clifton <nickc@cygnus.com> - - * config.bfd: Add support for strongarm target. - -Mon Feb 8 11:18:14 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * elf32-m68k.c (reloc_map): Use the correct types for the struct - fields instead of unsigned char. - -Fri Feb 5 00:22:36 1999 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am: Rebuild dependencies. - * Makefile.in: Rebuild. - -Thu Feb 4 22:30:13 1999 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Change AC_PREREQ to 2.13. Remove AM_CYGWIN32. - Change AM_EXEEXT to AC_EXEEXT and AM_PROG_INSTALL to - AC_PROG_INSTALL. Add comments to uses of AC_DEFINE. - * acinclude.m4: Add comments to uses of AC_DEFINE. - * acconfig.h: Remove. - * configure: Rebuild with current autoconf/automake. - * aclocal.m4: Likewise. - * config.in: Likewise. - * Makefile.in: Likewise. - -1999-02-04 DJ Delorie <dj@cygnus.com> - - * libbfd.c (real_read): don't call fread for zero bytes. This - covers up a bug (or misuse of bfd) that's exposed by Solaris. - -Thu Feb 4 12:38:10 1999 Stan Cox <scox@cygnus.com> - - * elf32-mips.c (mips_elf_relocate_section): Insure that the target - of a jump is in the current 256 MB region. - -Thu Feb 4 12:15:38 1999 Ian Lance Taylor <ian@cygnus.com> - - * format.c (bfd_check_format_matches): Change last patch to only - take effect for the binary target. - -Wed Feb 3 19:40:12 1999 Ian Lance Taylor <ian@cygnus.com> - - * elf32-i386.c (elf_i386_reloc_type_lookup): Add BFD_RELOC_CTOR. - -Wed Feb 3 15:02:44 1999 Catherine Moore <clm@cygnus.com> - - * elf32-fr30.c (fr30_elf_check_relocs): New routine. - -Tue Feb 2 21:38:28 1999 Ian Lance Taylor <ian@cygnus.com> - - * format.c (bfd_check_format_matches): If the target was - previously specified, don't check other targets when checking for - an archive file. - -Tue Feb 2 18:16:43 1999 Catherine Moore <clm@cygnus.com> - - * elf32-arm.h (elf32_arm_reloc_map): Removed. - (elf32_arm_reloc_type_lookup): Removed - * elfarm-nabi.c (elf32_arm_reloc_map): New. - (elf32_arm_reloc_type_lookup): New. - * elfarm-oabi.c (elf32_arm_reloc_map): New. - (elf32_arm_reloc_type_lookup): New. - -Mon Feb 1 19:49:21 1999 Catherine Moore <clm@cygnus.com> - - * elfarm-nabi.c: Renamed from elf32-arm-newabi.c. - * elfarm-oabi.c: Renamed from elf32-arm-oldabi.c - * Makefile.am: Use new files. - * Makefile.in: Regenerate. - * configure.in: Use new files. - * configure: Regenerate. - -1999-02-01 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_elf_gc_mark_hook): New function. - (fr30_elf_gc_sweep_hook): New function. - (elf_backend_can_gc_sections): Define. - -Mon Feb 1 12:21:47 1999 Catherine Moore <clm@cygnus.com> - - * targets.c (bfd_target_vector): Add bfd_elf32_littlearm_oabi_vec - and bfd_elf32_bigarm_oabi_vec. - -Mon Feb 1 11:46:31 1999 Catherine Moore <clm@cygnus.com> - - * Makefile.am (elf32-arm-oldabi.lo): New. - (elf32-arm-newabi.lo): New. - * Makefile.in: Regenerate. - * config.bfd (thumb-*-elf): Remove definition of targ_underscore. - (arm-*-elf): Likewise. - (arm-*-oabi): New. - (thumb-*-oabi): New. - * configure: Regenerate. - * configure.in (bfd_elf32_littlearm_oabi_vec): New. - (bfd_elf32_bigarm_oabi_vec): New. - * elf32-arm-newabi.c: New. - * elf32-arm-oldabi.c: New. - * elf32-arm.c: Removed. - * elf32-arm.h: New. - -Mon Feb 1 11:52:12 1999 Frank Ch. Eigler <fche@cygnus.com> - - * binary.c (binary_set_section_contents): Omit warnings for - unloadable sections. - -1999-01-31 Michael Meissner <meissner@cygnus.com> - - * config.bfd (powerpc{,le}-*-vxworks*): Add aliases to - powerpc{,le}-*-eabi. - -1999-01-29 Nick Clifton <nickc@cygnus.com> - - * dwarf2.c (read_unsigned_leb128): Remove unused variables. - * dwarf2.c (read_signed_leb128): Remove unused variables. - -Fri Jan 29 00:47:21 1999 H.J. Lu <hjl@gnu.org> - - * elf.c (assign_file_positions_for_segments): Only adjust - p_align when needed. - -Thu Jan 28 20:05:22 1999 Ian Lance Taylor <ian@cygnus.com> - - * binary.c (binary_set_section_contents): Don't return early for a - non-loadable section, in case the first section is non-loadable. - Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej - W. Rozycki <macro@ds2.pg.gda.pl>. - -1999-01-28 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_reloc_map): Add R_FR30_GNU_VTINHERIT and - R_FR30_GNU_VTENTRY relocs. - -Thu Jan 28 11:08:16 1999 Catherine Moore <clm@cygnus.com> - - * elflink.h (elf_link_output_sym): Zero syms which are - part of sections which have been excluded. - -Wed Jan 27 13:35:35 1999 Stan Cox <scox@cygnus.com> - - * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed F_PIC - to F_PIC_INT. - * coffcode.h (coff_set_arch_mach_hook): Removed F_ARM_2a and - F_ARM_3M labels. Changed F_PIC to F_PIC_INT. - -1999-01-27 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_elf_howto_table): Fix name of R_FR30_48 - relocation. - (fr30_final_link_relocate): Use computed value as result of - relocation. - -1999-01-26 Frank Ch. Eigler <fche@cygnus.com> - - * binary.c (binary_set_section_contents): Emit warning for - huge file offsets due to widely-dispersed section LMAs. - -Mon Jan 18 03:35:35 1999 Ian Lance Taylor <ian@cygnus.com> - - * elf.c (assign_file_positions_for_segments): If not D_PAGED, - align first section to largest section alignment, not first - section alignment. - -1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com) - - * configure.in: Require autoconf 2.12.1 or higher. - -Tue Dec 22 15:21:41 1998 Catherine Moore <clm@cygnus.com> - - * archures.c (bfd_mach_i386_i386_intel_syntax): Define. - * bfd-in2.h: Likewise. - * cpu-i386.c (bfd_i386_arch_intel_syntax): New. - -1998-12-16 Gavin Romig-Koch <gavin@cygnus.com> - - * archures.c,bfd-in2.h (bfd_mach_mips4111): New. - * cpu-mips.c: Add support for and independent 4111. - * elf32-mips.c (elf_mips_mach): E_MIPS_MACH_4111 -> bfd_mach_mips4111. - (_bfd_mips_elf_final_write_processing): - bfd_mach_mips4111 -> E_MIPS_ARCH_3 | E_MIPS_MACH_4111. - -1998-12-15 Gavin Romig-Koch <gavin@cygnus.com> - - * elf32-mips.c (elf_mips_abi_name): New. - (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags. - -1998-12-12 Gavin Romig-Koch <gavin@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_final_write_processing): - Handle bfd_mach_mips4300. - -1998-12-11 Ulrich Drepper <drepper@cygnus.com> - - * elf32-i386.c: Remove leaked development code from patch - 1998-12-10 by Richard Henderson. - -1998-12-10 Richard Henderson <rth@cygnus.com> - - * elf32-i386.c (elf_i386_relocate_section): Don't fail relocations - in debug sections for symbol defined externally. - -Thu Dec 10 10:58:38 1998 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * targets.c (bfd_target_vector): Remove duplicate entry for - tekhex_vec. - -1998-12-09 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_elf_howto_table): Set src_mask fields to 0 - since we are using RELAs. - -Tue Dec 8 22:15:48 1998 Ian Lance Taylor <ian@cygnus.com> - - SCO Open Server Release 5 core file support, from Jouke Numan - <jnuman@hiscom.nl>: - * sco5-core.c: New file. - * configure.in (i[3456]86-*-sco3.2v5*): Use sco5-core.lo. - (sco5-core.lo): Define SCO5_CORE in COREFLAG. - * Makefile.am: Rebuild dependencies. - (OPTIONAL_BACKENDS): Add sco5-core.lo. - (OPTIONAL_BACKENDS_CFILES): Add sco5-core.c. - * bfd.c (struct _bfd): Add sco5_core_data field to tdata. - * targets.c (sco5_core_vec): Add to target list if SCO5_CORE. - * bfd-in2.h, configure, Makefile.in: Rebuild. - -Tue Dec 8 19:38:42 1998 Mark Klein <mklein@dis.com> - - * config.bfd (hppa*-*-mpeix*): New target. - * configure.in: Add AC_HEADER_DIRENT. - (hppa*-*-mpeix*): New target. - * configure.host (hppa*-*-mpeix*): New host. - * hpux-core.c: Check HOST_HPPAMPEIX. Use HAVE_DIRENT_H and - friends rather than just including <sys/dir.h>. - * som.h (struct som_symbol): Add hppa_priv_level and apto - tc_data. Change all users. - (struct somdata): Add comp_unit field. - (obj_som_compilation_unit): Define. - (bfd_som_attach_compilation_unix): Declare. - * som.c: Check HOST_HPPAMPEIX. - (struct som_misc_symbol_info): Add new field priv_level. - (som_object_setup): Add current_offset parameter. Change all - callers. - (setup_sections): Likewise. - (som_object_p): For EXECLIBMAGIC, read the lst header. - (som_write_symbol_strings): Add compilation_unit parameter. - Change all callers. - (som_finish_writing): Write out compilation_unit. - (som_bfd_derive_misc_symbol_info): Set priv_level. - (som_build_and_write_symbol_table): Set xleast field to 3. - (som_slurp_symbol_table): Set symbol priv_level. - (bfd_som_attach_compilation_unit): New function. - (som_bfd_ar_write_symbol_stuff): Set xleast field to 3. Set - priv_level into symbol_value. - * configure, config.in: Rebuild. - -Tue Dec 8 16:21:35 1998 Ian Lance Taylor <ian@cygnus.com> - - * hpux-core.c (hpux_core_core_file_p): Change call to nonexistent - warning function to call _bfd_error_handler instead. - - * libbfd.c (COERCE32): Cast through unsigned long and long to - avoid bug in old version of gcc. - - * elf64-alpha.c (elf64_alpha_additional_program_headers): Remove. - (elf_backend_additional_program_headers): Don't define. - -1998-12-08 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_final_link_relocate): Fix PC relative - relocations to include offset of 2 included in the insns, and the - offset of the relocs within the section. - -Wed Dec 2 15:03:59 1998 David Taylor <taylor@texas.cygnus.com> - - The following changes were made by David Taylor - <taylor@texas.cygnus.com>, Edith Epstein - <eepstein@sophia.cygnus.com>, Jim Blandy - <jimb@zwingli.cygnus.com>, and Elena Zannoni - <ezannoni@kwikemart.cygnus.com> as part of the project to merge in - changes originally made by HP; HP did not create ChangeLog - entries. - - * aclocal.m4, configure, Makefile.in: Rebuilt using latest - automake macro library. - - * hpux-core.c (hpux_core_core_file_p): this function now - understands HPUX 10.30 thread info. Yes, the thread stacks can be - found in the corefile! Also, in hpux_core_core_file_p, if we - encounter a section with an unknown type, don't punt. Instead, - just skip it. Also, count the number of sections of known type - that we encounter. If we encounter at least one good one, then - we'll declare that the file is a core file. If we encounter any - unknown ones but some known ones, then we'll issue a warning (but - still declare it to be a core file). Also, correctly decide when a - file is not a core. - (PROC_INFO_HAS_THREAD_ID): define if CORE_ANON_SHMEM defined. - (CORE_ANON_SHMEM): define if not defined. - (hpux_core_struct): add members lwpid and user_tid. - (core_kernel_thread_id, core_user_thread_id): new macros. - (make_bfd_asection): use bfd_alloc to allocate room for a copy of - the name before storing it in the bfd. - (hpux_core_core_file_p): handle threads. - - * libhppa.h (GET_FIELD): protect against redefinition. - (HPPA_WIDE): define. - (GET_FIELD): define. - (GET_BIT): define. - (MASK): define. - (CATENATE): define. - (ELEVEN): define. - (sign_extend): redefine. - (assemble_6): define. - (assemble_12): rewrite. - (assemble_16): define. - (assemble_16a): define. - (assemble_17): rewrite. - (assemble_22): define. - -1998-12-07 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_final_link_relocate): Using signed - relocations for signed values. - -Sun Dec 6 16:30:33 1998 Ian Lance Taylor <ian@cygnus.com> - - * mipsbsd.c (MY(set_arch_mach)): Make static. - * aoutx.h (NAME(aout,machine_type)): For bfd_arch_mips, use - bfd_mach_mips* macros rather than simple numbers. - - COFF weak symbol support, based on patches from Mark Elbrecht - <snowball3@usa.net>: - * coffcode.h (coff_slurp_symbol_table): Handle C_WEAKEXT. - * coffgen.c (coff_renumber_symbols): Handle weak symbols. - (coff_write_alien_symbol): Likewise. - * cofflink.c (coff_link_check_ar_symbols): Likewise. - (coff_link_add_symbols): Likewise. - (_bfd_coff_link_input_bfd): Likewise. - (_bfd_coff_write_global_sym): Likewise. - - * elf.c (copy_private_bfd_data): Always initialize the - includes_phdrs field. - - * elflink.h (elf_fix_symbol_flags): Check for case where a non-ELF - file defines a symbol first mentioned in an ELF file. - - * bfd-in.h: Always define BFD_HOST_64_BIT and BFD_HOST_U_64_BIT if - possible, rather than only if BFD64. - * elflink.h (compute_bucket_count): Just check BFD_HOST_U_64_BIT, - not __GNUC__. - * bfd-in2.h: Rebuild. - - * srec.c (srec_set_section_contents): Correct test to avoid - switching to 4 byte addresses after seeing a second section which - requires 3 byte addresses. From Joel Schantz - <joel.schantz@argosys.boeing.com>. - - * config.bfd (m68*-*-gnu*): New target. From Aymeric Vincent - <aymeric.vincent@emi.u-bordeaux.fr>. - -1998-12-04 Jim Blandy <jimb@zwingli.cygnus.com> - - * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Fix logic to - decide whether the output file is -mrelocatable-lib, - -mrelocatable, or neither. (gdb.base/nodebug.exp) - -1998-12-03 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c: Add support for R_FR30_48 reloc. - * reloc.c: Add BFD_RELOC_FR30_48 relocation. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate - -Wed Dec 2 00:58:37 1998 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_adjust_dynamic_symbol): Warn on an attempt to - link against a dynamic symbol with no type or size. - -1998-12-01 Ulrich Drepper <drepper@cygnus.com> - - * elf32-i386.c (i386_check_relocs) [R_386_32]: Don't emit - relocation for section which does not get loaded. - (elf_i386_relocate_section) [R_386_32]: Likewise. - -Tue Dec 1 11:33:33 1998 Jim Wilson <wilson@cygnus.com> - - * coff-h8300.c (h8300_bfd_link_add_symbols): Make reloc_size, - reloc_count and i long instead of unsigned long. Handle error - return from bfd_canonicalize_reloc. - -1998-12-01 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_relocate_section): Detect the absence of - a hash table. - -Mon Nov 30 15:28:09 1998 J"orn Rennecke <amylaar@cygnus.co.uk> - - * elf32-sh.c (elf/sh.h): Include. - sh_reloc_type: Delete. Changed all references to elf_sh_reloc_type. - (sh_elf_howto_tab): Add HOWTO for R_SH_SWITCH8. - (sh_reloc_map): Map BFD_RELOC_8_PCREL to R_SH_SWITCH8. - (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. - * Makefile.in: Add dependency of elf32-sh.lo on $(INCDIR)/elf/sh.h. - -Fri Nov 27 17:51:38 1998 Geoff Keating <geoffk@ozemail.com.au> - - * elflink.h (compute_bucket_count): Don't allow minsize==0, it - causes division by zero later on. - -Thu Nov 26 11:19:35 1998 Dave Brolley <brolley@cygnus.com> - - * elf32-fr30.c (fr30_elf_pc9_reloc,fr30_elf_pc12_reloc): Not - needed. - -1998-11-25 DJ Delorie <dj@cygnus.com> - - * coff-i386.c (i3coff_object_p): Remove hack. Use new emulation - hook now. - -Tue Nov 24 10:25:27 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_elf_relocate_section): Call - fr30_final_link_relocate. - (fr30_final_link_relocate): New function: Handle I20 and I32 - relocs. - (fr30_elf_i32_reloc): New function: Handle I32 relocs. - (fr30_elf_pc9_reloc): New function: Handle 9_PCREL relocs. - (fr30_elf_pc12_reloc): New function: Handle 12_PCREL relocs. - - * elf32-v850.c (v850_elf_relocate_section): Reset hi16s reloc - chain to empty. - - The following changes are based on a patch submitted by Gianluca - Moro <glctr@abc.it>: - - (v850_elf_perform_relocation): Only update a hi16s reloc if it has - not already been updated. - (find_remembered_hi16s_reloc): New parameter 'already_found' - returns state of remembered hi16s reloc. - (remember_hi16s_reloc): Set 'found' field to false. - (hi16s_location): Add 'found' field. - -1998-11-23 DJ Delorie <dj@cygnus.com> - - * coff-i386.c (bfd_pe_dll_not_recognized_hack): the linker wants - to see .DLL files as unrecognized. - (i3coff_object_p): Sorry, had to hack it to not recognize these - files (pei-i386) on request. - -1998-11-23 DJ Delorie <dj@cygnus.com> - - * opncls.c (bfd_make_readable): need more cleanup for symbols and - relents. Call bfd_check_format to reinitialize. - -Fri Nov 20 14:21:36 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_elf_relocate_section): Remove spurious - warnings. - -Thu Nov 19 14:42:15 1998 Geoffrey Noer <noer@cygnus.com> - - * aclocal.m4: regenerate - * configure: regenerate - -Tue Nov 17 20:23:35 1998 Richard Henderson <rth@cygnus.com> - - * elf-bfd.h (struct elf_link_hash_entry): Add vtable_entries_size. - * elf.c (_bfd_elf_link_hash_newfunc): Clear it. - * elflink.h (elf_gc_propagate_vtable_entries_used): Copy it, and - respect it as an upper bound on what memory to reference. - (elf_gc_smash_unused_vtentry_relocs): Likewise. - (elf_gc_record_vtentry): Handle as-yet undefined vtables. Set and - update vtable_entries_size appropriately. - -Tue Nov 17 15:28:31 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-fr30.c (fr30_reloc_type_lookup): Used integers to hold - reloc number. - -Mon Nov 16 22:19:21 1998 DJ Delorie <dj@cygnus.com> - - * archive.c (bfd_ar_hdr_from_filesystem): support BFD_IN_MEMORY - bfds; they have no "file" so we fake it. - * bfd-in2.h: add bfd_make_writable and bfd_make_readable (regen) - * libbfd.c (bfd_write): Allow writing to BFD_IN_MEMORY bfds by - resizing the memory buffer. - * opncls.c (bfd_make_writable): New function; lets you write a - bfd_create'd bfd to an in-memory buffer. - (bfd_make_readable): New function; lets you read back that buffer - as if it were from bfd_openr. Used to build generated archive - members (winsup's ld's dlltool) - -Mon Nov 16 19:15:19 1998 Dave Brolley <brolley@cygnus.com> - - * po/bfd.pot: Regenerated. - -Mon Nov 16 10:57:06 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (hi16s_location): Replaced fixed size array with - linked list. - -Sun Nov 15 20:28:25 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_relax_section): Search for the proper - element of the gotentry list for local symbols too. - (elf64_alpha_relocate_section): Unify local and global handling. - Assert that gotent->use_count > 0. - -Sat Nov 14 15:16:01 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in (vms_alpha_vec): Rename from evax_alpha_vec, and - update for file name changes of July 2, 1998. - (vms_vax_vec): New. - * configure: Rebuild. - -Thu Nov 12 19:19:54 1998 Dave Brolley <brolley@cygnus.com> - - * po/bfd.pot: Regenerated. - -Tue Nov 10 16:17:06 1998 Geoffrey Noer <noer@cygnus.com> - - * acinclude.m4, config.bfd: detect cygwin* instead of cygwin32*. - * aclocal.m4, configure: regenerate - -Tue Nov 10 15:13:59 1998 Nick Clifton <nickc@cygnus.com> - - * elf.c (prep_headers): Add support for bfd_arch_fr30. - -Tue Nov 10 13:37:36 1998 Felix Lee <flee@cygnus.com> - - * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE, - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value - was cached. - * aclocal.m4, configure: regenerated. - -Tue Nov 10 14:31:01 1998 Catherine Moore <clm@cygnus.com> - - * elf32-d10v.c (reloc_type): Add R_D10V_GNU_VTINHERIT and - R_D10V_GNU_VTENTRY relocs. - (elf_d10v_howto_table): Likewise. - (d10v_reloc_map d10v_reloc_map): Likewise. - (elf32_d10v_gc_mark_hook): New. - (elf32_d10v_gc_sweep_hook): New. - (elf32_d10v_check_relocs): New. - (elf32_d10v_relocate_section): New. - (elf_backend_relocate_section): Define. - (elf_backend_can_gc_sections): Define. - -Sat Nov 7 18:07:51 1998 Peter Schauer <peter.schauer@regent.e-technik.tu-muenchen.de> - - * Makefile.am (BFD32_BACKENDS): Move vms files here... - (BFD64_BACKENDS): ...from here. - (BFD32_BACKENDS_CFILES): Move vms files here... - (BFD64_BACKENDS_CFILES): ...from here. - * Makefile.in: Rebuild. - -Wed Nov 4 15:58:48 1998 Nick Clifton <nickc@cygnus.com> - - * Makefile.am: Add FR30 target. - * Makefile.in: Add FR30 target. - * archures.c: Add support for FR30. - * config.bfd: Add support for FR30. - * configure.in: Add support for FR30. - * reloc.c: Add support for FR30 relocations. - * targets.c: Add support for FR30 relocations. - * bfd-in2.h: Regenerate. - * configure: Regenerate. - * libbfd.h: Regenerate. - * cpu-fr30.c: New file. - * elf32-fr30.c: New file. - -Mon Nov 2 14:59:33 1998 Geoffrey Noer <noer@cygnus.com> - - * configure.in: detect cygwin* instead of cygwin32* - * configure: regenerate - -Sun Nov 1 19:32:28 1998 Jeffrey A Law (law@cygnus.com) - - * elf-m10300.c (mn10300_elf_relax_section): Do not use alloca, - use bfd_malloc and free instead and check return value from bfd_malloc. - -Sun Nov 1 16:20:35 1998 Ian Lance Taylor <ian@cygnus.com> - - * libbfd-in.h (_bfd_dwarf1_find_nearest_line): Declare. - * libbfd.h: Rebuild. - - * elf32-mips.c (mips_elf_dynsym_sec_names): Comment out. - (SIZEOF_MIPS_DYNSYM_SECNAMES): Likewise. - (MIPS_TEXT_DYNSYM_SECN): Likewise. - (_bfd_mips_elf_fake_sections): Don't set sh_info field of a .hash - section. - (struct mips_elf_link_hash_table): Remove dynsym_sec_strindex - field. - (mips_elf_link_hash_table_create): Don't initialize - dynsym_sec_strindex. - (mips_elf_gc_mark_hook): Add default case to avoid warning. - (mips_elf_size_dynamic_sections): Generate a section symbol for - every output section. - (mips_elf_finish_dynamic_sections): Count all sections for - DT_MIPS_UNREFEXTNO. - (mips_elf_finish_dynamic_sections): Use dynamic symbols for all - output sections. - -Sun Nov 1 12:46:53 1998 Geoff Keating <geoffk@ozemail.com.au> - - * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Allocate two slots - for later PLT entries in large PLTs. - (ppc_elf_finish_dynamic_symbol): Allow for the extra slots. - -Sat Oct 31 20:10:09 1998 Jeffrey A Law (law@cygnus.com) - - * elf32-ppc.c (ppc_elf_reload_section): Fix typo. - -1998-10-26 15:58 Ulrich Drepper <drepper@cygnus.com> - - * elf-bfd.h (struct elf_link_hash_entry): Add new field elf_hash_value. - * elflink.h (elf_collect_hash_codes): New function. This function is - called for each exported symbol and we compute the ELF hash value for - it. - (compute_bucket_value): New function. It is called from - size_dynamic_sections to determine the hash table size. When we are - optimizing a better, but slower, algorithm is used. - (size_dynamic_sections): Call compute_bucket_value. - - * elf.c (bfd_elf_hash): Optimize the hash function a bit. - -Mon Oct 19 20:03:21 1998 Catherine Moore <clm@cygnus.com> - - * elf32-sh.c: Add HOWTO entries for R_SH_GNU_VTINHERIT and - R_SH_GNU_VTENTRY. - (sh_elf_gc_mark_hook): New. - (sh_elf_gc_sweep_hook): New. - (sh_elf_check_relocs): New. - (elf_backend_can_gc_sections): Define. - -Mon Oct 19 16:57:05 1998 Felix Lee <flee@cygnus.com> - - * acinclude.m4: undo previous gettext change - * aclocal.m4: rebuild with right version of aclocal. - -Mon Oct 19 01:47:21 1998 Felix Lee <flee@cygnus.com> - - * acinclude.m4, aclocal.m4: move gettext-related fragments from - aclocal.m4 to acinclude.m4, so they don't get lost. - - * elfcore.h: rewrite for better corefile support. - * elf.c (elfcore_*): new functions. - * elf-bfd.h (elf_obj_tdata): new structure members. - * acconfig.h, acinclude.m4, configure.in: add feature-tests for - flavor of procfs. - * aclocal.m4, config.in, configure, Makefile.in: regenerated. - -Fri Oct 16 14:07:45 1998 Catherine Moore <clm@cygnus.com> - - * elf32-m32r.c: Add HOWTO entries for R_M32R_GNU_VTINHERIT - and R_M32R_GNU_VTENTRY. - (elf_backend_can_gc_sections): Define. - (m32r_elf_check_relocs): New. - (m32r_elf_gc_mark_hook): New. - (m32r_elf_gc_sweep_hook): New. - (m32r_elf_relocate_section): Handle VT relocs. - -Mon Oct 12 14:18:40 1998 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (arm_relocate_section): Remove redundant test. - - * bfd-in2.h (struct reloc_howto_struct): Improve comment to make - cleat that the 'bitsize' field is the size of the bitfield AFTER - relocation not before. - - * elf32-m32r.c (R_M32R_18_PCREL): Fix size of bitfield. - - * coff-mips.c (mips_relocate_hi): Cope with missing refhi or reflo - relocs. - -Tue Oct 6 09:20:44 1998 Catherine Moore <clm@cygnus.com> - - * elf32-sparc.c: Add HOWTO entries for R_SPARC_GNU_VTINHERIT and - R_SPARC_GNU_VTENTRY. - (elf32_sparc_check_relocs): Handle them. - (elf32_sparc_reloc_type_lookup): Likewise. - (elf32_sparc_relocate_section): Likewise. - (elf32_sparc_gc_mark_hook): New. - (elf32_sparc_gc_sweep_hook): New. - -Mon Oct 5 14:55:30 1998 Jeffrey A Law (law@cygnus.com) - - * som.c (som_finish_writing): Perform some sanity checks when - writing an executable or shared library. - -Mon Oct 5 12:02:31 1998 Gavin Romig-Koch <gavin@cygnus.com> - - * dwarf1.c : New file. Adds _bfd_dwarf1_find_nearest_line. - * configure.in (elf): Add dwarf1.lo. - * elf_bfd.h (elf_ob_tdata): Add dwarf1_find_line_info. - * elf.c (_bfd_elf_find_nearest_line): Add call to - _bfd_dwarf1_find_nearest_line. - * elf32-mips.c (_bfd_mips_elf_find_nearest_line): - Add call to _bfd_dwarf1_find_nearest_line. - * configure: Rebuilt. - -Mon Oct 5 10:06:22 1998 Catherine Moore <clm@cygnus.com> - - * elflink.h (elf_gc_sections): Do not allow garbage - collection if dynamic sections have been created. - -Mon Oct 5 09:07:37 1998 Catherine Moore <clm@cygnus.com> - - * elf32-v850.c: Add HOWTO entries for R_V850_GNU_VTINHERIT and - R_V850_GNU_VTENTRY. - (v850_elf_check_relocs): Handle VTINHERIT and VTENTRY relocs. - (v850_elf_perform_relocation): Likewise. - (v850_elf_final_link_relocate): Likewise. - (v850_elf_relocate_section): Likewise. - (v850_elf_gc_sweep_hook): New routine. - (v850_elf_gc_mark_hook): New routine. - (elf_backend_can_gc_sections): Define. - -Mon Oct 5 09:04:25 1998 Catherine Moore <clm@cygnus.com> - - * elf32-m68k.c (elf_m68k_gc_sweep_hook): Don't assume - that dynobj exists. - -Sun Oct 4 23:29:34 1998 David Edelsohn <edelsohn@mhpcc.edu> - - * rs6000-core.c (rs6000coff_core_file_matches_executable_p): - Declare size as bfd_size_type. - (rs6000coff_get_section_contents): Declare count as bfd_size_type. - -Sun Oct 4 20:38:29 1998 Jeffrey A Law (law@cygnus.com) - - * cpu-hppa.c (bfd_hppa20_arch): Define. Link it into the bfd_hppa_arch - structure. - * som.c (CPU_PA_RISC2_0): Define. - (_PA_RISC2_0_ID): Likewise. - (som_finish_writing): Use CPU_PA_RISC2_0 for the system_id as needed. - -Sun Oct 4 21:19:09 1998 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_link_add_object_symbols): When a versioned symbol - has a base which is already defined, only add the referenced - symbol to the dynamic symbol table if it is defined or referenced - by a regular file. - - * elf32-i386.c (elf_i386_info_to_howto_rel): Handle vtable relocs - correctly. - -1998-09-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * elflink.h (elf_link_add_object_symbols): Undo last change. - -Wed Sep 23 16:09:31 1998 Richard Henderson <rth@cygnus.com> - - * elflink.h (elf_link_add_object_symbols): Don't record a dynamic - symbol for the indirect alias to a versioned symbol. - -Mon Sep 21 12:15:22 1998 Catherine Moore <clm@cygnus.com> - - * elf32-i386.c (elf32_i386_vtinherit_howto): New. - (elf32_i386_vtentry_howto): New. - (elf_i386_reloc_type_lookup): Return elf32_i386_vtentry_howto - or elf32_i386_vtinherit_howto on lookup. - -Sun Sep 20 00:48:07 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * elf32-m68k.c: Include "elf/m68k.h". Remove definition of enum - reloc_type. Rename R_68K__max to R_68K_max. - (howto_table): Use _bfd_elf_rel_vtable_reloc_fn for a VTENTRY - reloc. - -Sun Sep 20 00:09:25 1998 Chris Torek <torek@bsdi.com> - - * libbfd.c (bfd_getb32): Rewrite expression to get better code. - (bfd_getl32, bfd_getb_signed_32, bfd_getl_signed_32): Likewise. - - * libbfd.c (bfd_log2): Cast to bfd_vma before shifting, not - after. - -Sat Sep 19 22:42:23 1998 Doug Rabson <dfr@nlsystems.com> - - * elflink.h (elf_link_add_object_symbols): Ensure that the warning - message has a null byte terminator. - -Fri Sep 18 14:35:29 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_perform_relocation): Ignore contents of - word subject to R_V850_32 relocation. - -Thu Sep 17 17:20:36 1998 Nick Clifton <nickc@cygnus.com> - - * dwarf2.c: Add comment describing problem computing line numbers - for undefined symbols at link time. - -Thu Sep 17 16:03:28 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't - transform a defweak into a plt entry. - (elf64_alpha_calc_dynrel_sizes): Allow room for secondary - plt entry references to receive a RELATIVE reloc. - (elf64_alpha_finish_dynamic_symbol): Fill them in. - (elf64_alpha_relocate_section): Assert we don't overrun - the allocated relocation space. - -Wed Sep 16 18:03:13 1998 Nick Clifton <nickc@cygnus.com> - - * elf.c (swap_out_syms): Always treat section symbols as - special, even if they are attached to a common section. - -Wed Sep 16 10:34:13 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_symbol_processing): Move symbols in - sections with v850 common section attributes into named v850 - common sections. - (v850_elf_add_symbol_hook): Move symbols in sections with v850 - common section attributes into named v850 common sections. - -Wed Sep 16 11:26:49 CDT 1998 Catherine Moore <clm@cygnus.com> - - * elf32-arm.c (elf32_arm_gc_mark_hook): Remove print - statement. - -1998-09-15 Geoff Keating <geoffk@ozemail.com.au> - - * elf32-ppc.c (ppc_elf_relocate_section): Reverse output_offset - part of Vladimir's change of 1998-08-19. Make a R_PPC_SDAREL16 - reloc to the wrong section a warning, not an error. .dynsbss - is not an output section, so there is no need to check for it. - -Tue Sep 15 12:40:05 1998 Catherine Moore <clm@cygnus.com> - - * elf-bfd.h: Add argument to elf_backend_get_symbol_type. - -Tue Sep 15 08:34:40 1998 Catherine Moore <clm@cygnus.com> - - * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type. - * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and - R_ARM_GNU_VTENTRY. - (elf32_arm_gc_mark_hook): New. - (elf32_arm_gc_sweep_hook): New. - (elf32_arm_check_relocs): New. - (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY - relocations. - (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY - relocations. - -1998-09-10 Geoff Keating <geoffk@ozemail.com.au> - - * elf32-ppc.c (ppc_elf_relocate_section): If dynobj is NULL, - assume there is no PLT or GOT. - -Wed Sep 9 14:24:12 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-arm.c (elf32_arm_find_nearest_line): New function: just - like _elf_bfd_find_nearest_line() except that STT_ARM_TFUNC is - also accepted as a function symbol type. - -Mon Sep 7 13:24:03 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de> - - * rs6000-core.c (_LONG_LONG): Define for AIX 4.x only. - -Sat Sep 5 20:40:18 1998 Ian Lance Taylor <ian@cygnus.com> - - * libbfd-in.h (_bfd_nolink_bfd_gc_sections): Correct definition to - match definition of _bfd_gc_sections field. - * libbfd.h: Rebuild. - -Fri Sep 4 13:54:23 1998 David Miller <davem@dm.cobaltmicro.com> - - * elf32-sparc.c (elf32_sparc_relocate_section): Properly adjust - the addend of a dynamic relocation referencing a section. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - (sparc64_elf_finish_dynamic_symbol): Fix the PLT relocation offset. - -Thu Sep 3 17:28:50 1998 Richard Henderson <rth@cygnus.com> - - * elflink.h (bfd_elfNN_size_dynamic_sections): Verify that the - bed has a size_dynamic_sections routine before trying to use it. - -Mon Aug 31 14:49:22 1998 Richard Henderson <rth@cygnus.com> - - * elf32-mips.c (elf_mips_gnu_vtentry_howto): Use - _bfd_elf_rel_vtable_reloc_fn. - -Mon Aug 31 10:23:40 1998 Catherine Moore <clm@cygnus.com> - - * Makefile.am: Add elf32-arm.c. - * Makefile.in: Rebuild. - * elf-bfd.h: Add elf_backend_get_symbol_type. - * elf.c (swap_out_syms): If defined, call - elf_backend_get_symbol_type. - * elf32-arm.c: Define elf_backend_get_symbol_type. - (elf32_arm_get_symbol-type): New routine. - (record_thumb_to_arm_glue): Change to use STT_ARM_TFUNC. - (bfd_elf32_arm_process_before_allocation): Change to - check for STT_ARM_TFUNC. - (elf32_arm_final_link_relocate): Likewise. - * elfxx-target.h: Add elf_backend_get_symbol_type. - -Fri Aug 28 19:44:07 1998 Richard Henderson <rth@cygnus.com> - - * archures.c (bfd_mach_alpha_ev[456]): New. - * cpu-alpha.c: Rework to match these types. - * bfd-in2.h: Rebuild. - -Fri Aug 28 19:38:53 1998 Richard Henderson <rth@cygnus.com> - - * elf-bfd.h (_bfd_elf_rel_vtable_reloc_fn): Declare. - * elf.c (_bfd_elf_rel_vtable_reloc_fn): New. - - * elf32-i386.c (elf_howto_table): Add vtable relocs. - (elf_i386_reloc_type_lookup): Recognize them. - (elf_i386_check_relocs): Pass them off to generic code. - (elf_i386_relocate_section): Ignore them. - (elf_i386_gc_mark_hook, elf_i386_gc_sweep_hook): New. - (elf_backend_can_gc_sections): True. - -Thu Aug 20 15:03:45 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-arm.c (elf32_thumb_to_arm_stub): Check sym_sec is not NULL - before looking at owner field. - (elf32_arm_to_thumb_stub): Ditto. - (elf32_arm_relocate_section): Compute name before calling - elf32_arm_final_link_relocate(). - -Thu Aug 20 11:30:17 1998 Michael Snyder <msnyder@cleaver.cygnus.com> - - * elf.c: comment and formatting cleanups. - * elfcore.h: ditto. - -Wed Aug 19 15:43:26 1998 Michael Snyder <msnyder@cleaver.cygnus.com> - - * elfcode.h (elf_object_p): Reject files of header type ET_CORE - (core files are treated differently than object files). - * elf-bfd.h (_bfd_elf_write_corefile_contents, - bfd_elf_mkcorefile): declare. - * elfxx-target.h (_bfd_elf_write_corefile_contents, - bfd_elf_mkcorefile): add to bfd_target vector. - * elfcore.h (elf_core_file_p): save the program header table, - and set the bfd architecture from the elf file header. - * elf.c (bfd_elf_mkcorefile): new function. - (_bfd_elf_write_corefile_contents): new function. - (assign_file_positions_for_segments): add cases for handling - PT_NOTE segments. (assign_file_positions_except_relocs): - core files should be handled the same as exec files. - (prep_headers): identify core files as type ET_CORE. - (copy_private_bfd_data): identify the sections belonging to - the PT_NOTE segment. - - * elf32-sparc.c (elf32_sparc_final_write_processing): - add break statement to default case. - -1998-08-19 Vladimir N. Makarov <vmakarov@cygnus.com> - - * elf32-ppc.c (ppc_elf_relocate_section): Check that output - section (not input) will be in sections ".sbss", ".sbss2", - ".sdata", and ".sdata" for R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, - R_PPC_EMB_SDA21, R_PPC_EMB_RELSDA. In all these cases also ignore - output_offset for correct evaluation of addend. - -Tue Aug 18 11:48:12 1998 Catherine Moore <clm@cygnus.com> - - * elf32-arm.c: Add prefix bfd_ to elf32_arm_get_bfd_for_interworking, - elf32_arm_allocate_interworking_sections and - elf32_arm_process_before_allocation. - -Tue Aug 18 11:46:00 1998 Nick Clifton <nickc@cygnus.com> - - * bfd-in.h: Ammend prototype for - elf32_arm_process_before_allocation to remove surplus third - argument. - - * bfd-in2.h: Regenerate. - -Sat Aug 15 20:55:08 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_relax_section): Handle indirect symbols. - -Fri Aug 14 09:12:28 1998 Stan Cox <scox@cygnus.com> - - * aoutx.h (aout_link_input_section_ext): Use the relocation already - calculated for RELOC_SPARC_REV32 case. - -Thu Aug 13 14:02:02 1998 Catherine Moore <clm@cygnus.com> - - * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking, - elf32_arm_allocate_interworking_sections and - elf32_arm_process_before_allocation. - * bfd-in2.h: Regenerated. - * elf32-arm.c Define elf32_arm_link_hash_table. - (insert_thumb_branch): New routine. - (find_thumb_glue): New routine. - (find_arm_glue): New routine. - (record_arm_to_thumb_glue): New routine. - (record_thumb_to_arm_glue): New routine. - (elf32_arm_link_hash_table_create): New routine. - (elf32_arm_get_bfd_for_interworking): New routine. - (elf32_arm_allocate_interworking_sections) New routine. - (elf32_arm_process_before_allocation) New routine. - (elf32_thumb_to_arm_stub): New routine. - (elf32_arm_to_thumb_stub): New routine. - (elf32_print_private_bfd_data): Fix typo. - (elf32_arm_final_link_relocate): Add argument sym_sec. - Check for branches to thumb symbols in case R_ARM_PC24. - Check for branches to arm symbols in case R_ARM_THM_PC22. - (elf32_arm_relocate_section): Pass symbol section to - elf32_arm_final_link_relocate. - -Wed Aug 12 19:00:39 1998 Geoff Keating <geoffk@ozemail.com.au> - - * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Generate PLT - entries unless the symbol is defined in the executable; in - particular, undefined weak symbols get a PLT entry. - -Wed Aug 12 14:48:33 1998 Ian Lance Taylor <ian@cygnus.com> - - * libaout.h: Remove nested comment to avoid warning. - -Wed Aug 12 08:10:11 1998 Catherine Moore <clm@cygnus.com> - - * elf32-arm.c (elf32_arm_final_link_relocate): Rework - R_ARM_PC24 relocation. - -Tue Aug 11 14:42:26 1998 Catherine Moore <clm@cygnus.com> - - * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused - argument is_local. Add argument sym_flags. Check sym_flags - in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case. - (elf32_arm_relocate_section): Don't pass local sym and pass - sym_flags to elf32_arm_final_link_relocate. - -Mon Aug 10 20:38:39 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Correct last change - to not count too few relocs for dynamicly linked executables. - -Mon Aug 10 15:35:34 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Never consider - symbols without a dynamic index dynamic. Consider all weak - symbols dynamic. - (elf64_alpha_strip_section_from_output): Don't assume 1-1 - correspondance between input and output sections. - -Mon Aug 10 15:31:39 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * elflink.h (elf_gc_common_finalize_got_offsets): For backends - that use a .got.plt section start the got offset at zero. - -Mon Aug 10 17:31:21 1998 Ian Lance Taylor <ian@cygnus.com> - - * ieee.c (ieee_write_processor): Correct the processor ID written - out for bfd_arch_m68k, accommodating change of March 25. - -Sun Aug 9 20:55:44 1998 Catherine Moore <clm@cygnus.com> - - * elf32-arm.c (elf32_arm_final_link_relocate): Rework - R_ARM_THM_RPC22 relocations. - -Sat Aug 8 15:15:30 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Undef weak symbols - are always dynamic. - (elf64_alpha_calc_dynrel_sizes): Allow enough room for RELATIVE - .got relocs in -Bsymbolic shared objects. - -Wed Aug 5 15:48:08 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-arm.c: Add private flags to ELF header. - (elf32_arm_print_private_bfd_data): New Function. - (elf32_arm_set_private_flags): New Function. - (elf32_arm_copy_private_flags): New Function. - (elf32_arm_merge_private_bfd_data): New Function. - -Mon Aug 3 17:10:15 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf32-sparc.c (elf32_sparc_check_relocs): Permit WPLT30 against - a local symbol. - (elf32_sparc_relocate_section): Likewise. - -Sun Aug 2 03:19:23 1998 Richard Henderson <rth@cygnus.com> - - * elf32-ppc.c (ppc_elf_check_relocs): Init sgot to NULL. Create the - .got if any relocation referrs to _GLOBAL_OFFSET_TABLE_. - (ppc_elf_relocate_section): Pull sgot and splt search to the start - of the function. Recognize no .plt as static linking. - -1998-08-01 Ulrich Drepper <drepper@cygnus.com> - - * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Don't pass - ".liblist" string through gettext. - -Fri Jul 31 16:38:14 1998 Catherine Moore <clm@cygnus.com> - - * Makefile.am: Add support for elf32-arm.lo. - * Makefile.in: Rebuild. - * config.bfd (arm-*-elf): Define targ_defvec and targ_selvecs. - (thumb-*-elf): Define targ_defvec and targ_selvecs. - * configure.in: Handle bfd_elf32_littlearm_vec and bfd_elf32_bigarm_vec. - * configure: Regenerate. - * elf.c: (prep_headers): Support arch_type of EM_ARM. - * targets.c: Support new targets bfd_elf32_bigarm_vec and - bfd_target bfd_elf32_littlearm_vec. - * elf32-arm.c: New file. - -Tue Jun 28 19:05:28 1998 Stan Cox <scox@cygnus.com> - - * libaout.h (M_SPARCLITE_LE): New machine. - * sunos.c (MACHTYPE_OK): Add machine M_SPARCLITE_LE. - * aoutf1.h (sunos_set_arch_mach): Add machine M_SPARCLITE_LE. - (sunos_write_object_contents): Add machine bfd_mach_sparc_sparclite_le - * aoutx.h (howto_table_ext): Add relocation R_SPARC_REV32. - (NAME(aout,machine_type)) Add machine bfd_mach_sparc_sparclite_le - (aout_link_input_section_ext): Add RELOC_SPARC_REV32 support. - * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, - elf32_sparc_relocate_section): Rename R_SPARC_32LE to be R_SPARC_REV32 - * libbfd.h (bfd_reloc_code_real_names): Rename BFD_RELOC_SPARC_32LE to - be BFD_RELOC_SPARC_REV32. - * reloc.c: Ditto. - * config.bfd (sparc86x-*-aout): New - -Fri Jul 24 13:54:19 1998 Nick Clifton <nickc@cygnus.com> - - * linker.c (_bfd_generic_final_link): Allocate NULL symbol before - actually mapping the output sections. - -Fri Jul 24 11:24:29 1998 Jeffrey A Law (law@cygnus.com) - - - * elf-m10300.c (mn10300_elf_howto): Add R_MN10300_24 entry. - (mn10300_elf_reloc_map): Similarly. - (mn10300_elf_final_link_relocate): Handle R_MN10300_24. - -Fri Jul 24 12:36:04 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf32-mips.c (elf_mips_howto_table): Add reloc types used on - Irix 6. - (bfd_elf32_bfd_reloc_type_lookup): Add default case. - * elf64-mips.c: Replace all uses of mips_elf64_reloc_type with - elf_mips_reloc_type defined in elf/mips.h. - -1998-07-24 Ulrich Drepper <drepper@cygnus.com> - - * elf64-mips.c: Remove reloc_type definition completely. It's now - in elf/mips.h. - -Thu Jul 23 13:33:19 1998 Doug Evans <devans@canuck.cygnus.com> - - * elf64-mips.c (mips_elf64_reloc_type): #if 0 out more relocations - as they are defined in elf/mips.h now. - -Thu Jul 23 11:29:43 1998 Jeffrey A Law (law@cygnus.com) - - - * Re-add lost change: - * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field - "movm_stack_size". - (mn10300_elf_relax_section): Include stack space for register saves - in the imm8 field of a "call" instruction. - (compute_function_info): Determine how much stack is allocated by - the movm instruction. Fix typo. - (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size. - -Thu Jul 23 11:38:05 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf32-sparc.c (elf_backend_got_header_size): Define as 4. - * elf64-sparc.c (elf_backend_got_header_size): Define as 8. - -1998-07-22 Ulrich Drepper <drepper@cygnus.com> - - * elf32-ppc.c: Change use of pp_reloc_type to elf_ppc_reloc_type. - -Wed Jul 22 16:27:18 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-hppa.h: Let ELF header define the enum containing the - external reloc numbers. - * elf32-i386.h: Likewise. - -1998-07-22 14:57 Ulrich Drepper <drepper@cygnus.com> - - * elf-m10300.c: Let ELF header now define the macros to get the enum. - * elf32-mips.c: Likewise. - * elf32-ppc.c: Likewise. - -Wed Jul 22 13:53:52 1998 Nick Clifton <nickc@cygnus.com> - - * bfd-in2.h: Change type of 'class' parameter to 'unsigned int' in - bfd_coff_set_symbol_class(), in order to avoid K&R compatability - prblems. - * bfd-in.h: Regenerate. - * coffgen.c (bfd_coff_set_symbol_class): Change type of 'class' - parameter to 'unsigned int' to avoid K&R compatability problems. - -Wed Jul 22 16:43:24 1998 Ian Lance Taylor <ian@cygnus.com> - - * ieee.c (ieee_find_nearest_line): Change filename_ptr and - functionname_ptr to be const. Change line_ptr to be unsigned. - - * coffcode.h (coff_link_output_has_begun): Simplify handling when - macro is not defined. Change second parameter from bfd_link_info - to coff_final_link_info. Add prototype. - (coff_final_link_postscript): Simplify handling when macro is not - defined. Add prototype. - -1998-07-22 13:08 Ulrich Drepper <drepper@cygnus.com> - - * elf-mn10300.c: Before include system specific ELF header define - START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS. - * elf32-mips.c: Likewise. - * elf32-ppc.c: Likewise. - -Wed Jul 22 13:46:51 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf64-mips.c (mips_elf64_reloc_type): Copy Ulrich's elf32-mips.c - temporary patch over to elf64-mips.c as well. - -1998-07-21 Ulrich Drepper <drepper@cygnus.com> - - * elf32-mips.c (reloc_type): Temporarily disable definition of - standard relocation since they are now defined in elf/mips.h. - -Tue Jul 21 09:47:00 1998 Catherine Moore <clm@cygnus.com> - - * elf-m10200.c (mn10200_elf_final_link_relocate): - Modify range test for case R_MN10200_8. - - * elf-m10300.c (mn10300_elf_final_link_relocate): - Modify range test for case R_MN10300_8. - -Mon Jul 20 18:50:54 1998 Richard Henderson <rth@cygnus.com> - - * elf-bfd.h (struct elf_backend_data): Add got_ & plt_header_size. - * elf32-i386.c (elf_backend_got_header_size): Define. - (elf_backend_plt_header_size): Define. - * elf32-m68k.c, elf32-mips.c, elf32-ppc.c: Likewise. - * elf32-sparc.c, elf64-alpha.c, elf64-sparc.c: Likewise. - * elfxx-target.h: Provide a default of zero. - * elflink.c (_bfd_elf_create_got_section): Use got_header_size. - * elflink.h (elf_gc_common_finalize_got_offsets): Likewise. - - * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't remove a PLT - entry from an executable, even if the plt refcount goes to 0. - -Mon Jul 20 12:47:26 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * aoutx.h (NAME(aout,find_nearest_line)): Also remember the - directory name at the line number. - - * elf.c (_bfd_elf_find_nearest_line): Also consider symbols - with an unspecified type. - -Wed Jul 15 11:20:01 1998 Ian Lance Taylor <ian@cygnus.com> - - * sunos.c: Add undef of valid to avoid problem on SunOS. - -Tue Jul 14 15:30:59 1998 Richard Henderson <rth@cygnus.com> - - * config.bfd (i?86-pc-beos{pe,elf,}*): Recognize. - -Tue Jul 14 11:22:21 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * elf32-m68k.c (elf_m68k_check_relocs): Also reference count - R_68K_PCxx and R_68K_xx relocations. Make sure that - ELF_LINK_HASH_NEEDS_PLT is always set for a PLT reloc reference. - (elf_m68k_gc_sweep_hook): Also reference count R_68K_PCxx and - R_68K_xx relocations. - (elf_m68k_adjust_dynamic_symbol): Reset the plt offset of a symbol - that has no plt entry. - (elf_m68k_relocate_section): Ignore the plt offset in a static - link. - * elflink.h (elf_adjust_dynamic_symbol): Reset the plt offset for - an ignored symbol. - (elf_gc_common_finalize_got_offsets): Set the got offsets also in - a static link. - - * elf32-m68k.c (R_68K_GNU_VTINHERIT, R_68K_GNU_VTENTRY): New reloc - types. - (howto_table, reloc_map): Add entries for them. - (elf_m68k_check_relocs): Handle them. Implement reference - counting for got and plt entries. - (elf_m68k_gc_mark_hook, elf_m68k_gc_sweep_hook): New functions. - (elf_m68k_adjust_dynamic_symbol): Handle unreferenced plt - symbols. - (rtype_to_howto_rel, elf_info_to_howto_rel): Delete. - (elf_m68k_relocate_section): Handle the new reloc types. - (bfd_elf32_bfd_final_link, elf_backend_gc_mark_hook, - elf_backend_gc_sweep_hook, elf_backend_can_gc_sections): Define. - * elflink.h (elf_link_add_object_symbols): When creating an - indirect reference for symbol versioning also copy the plt - offset. - (elf_fix_symbol_flags): When clearing the ELF_LINK_HASH_NEEDS_PLT - flag also reset the plt offset. - (elf_link_assign_sym_version): Likewise. - (elf_gc_common_finalize_got_offsets): Increment the got offset by - the size of the entry in bytes. - (elf_gc_allocate_got_offsets): Likewise. - -Tue Jul 14 11:18:14 1998 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_gc_sections): Return true rather than falling off - the bottom. - - * coffgen.c (bfd_coff_set_symbol_class): Call bfd_alloc, not - xmalloc. - -Mon Jul 13 11:06:31 1998 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c: Supress definition of TARGET_UNDERSCORE and add a - comment describing when it should be enabled. - Changed definition of USER_LABEL_PREFIX to "", to fall into line - with GCC sources. - -Mon Jul 13 13:06:54 1998 Ian Lance Taylor <ian@cygnus.com> - - * ieee.c (ieee_slurp_external_symbols): Handle call optimization - information ATN records. - -Fri Jul 10 16:31:06 1998 Ian Lance Taylor <ian@cygnus.com> - - * ieee.c (ieee_slurp_external_symbols): Select an appropriate - section for an absolute symbol in a fully linked file. Based on - patch from Christian Holland <CHolland@de.lucent.com>. - -Wed Jul 8 11:29:56 1998 Manfred Hollstein <manfred@s-direktnet.de> - - * coff-m88k.c (m88k_special_reloc): Don't lose the information - that a symbol is undefined. - -Tue Jul 7 21:47:02 1998 Jeffrey A Law (law@cygnus.com) - - * som.c (som_bfd_gc_sections): Define. - -Mon Jul 6 11:35:50 1998 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (aoutarm_std_reloc_howto): Do not complain about - overflows in ARM_26D patches, since they have already been - implmented. Patch submitted by Dr. R.J. Black <rjb@dcs.gla.ac.uk> - -Sat Jul 4 12:25:36 1998 Ian Lance Taylor <ian@cygnus.com> - - * coffcode.h (coff_write_object_contents): If we have any long - section names, call coff_write_symbols even if there are no - symbols. - -Fri Jul 3 13:11:35 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf.c (copy_private_bfd_data): Only set phdr_included once for a - PT_LOAD segment, rather than only setting it once for the entire - file. - - * elf.c (_bfd_elf_make_section_from_shdr): When setting the LMA, - rather than ignoring every phdr with a p_paddr of 0, ignore all - the phdrs if they all have a p_paddr of 0. - - * stabs.c (_bfd_write_stab_strings): Check whether the .stabstr - section was discarded from the link. - -Fri Jul 3 14:39:05 1998 J"orn Rennecke <amylaar@cygnus.co.uk> - - * coff-sh.c (sh_insn_uses_freg): Ignore lowest bit of register number. - -Fri Jul 3 14:35:48 1998 J"orn Rennecke <amylaar@cygnus.co.uk> - - * coff-sh.c (sh_insns_conflict): Load of fpscr conflicts with - floating point operations. - -Thu Jul 2 18:37:25 1998 Ian Lance Taylor <ian@cygnus.com> - - * cofflink.c (_bfd_coff_link_input_bfd): Skip undefined global - function symbols. - -Thu Jul 2 14:59:42 1998 Klaus Kaempf <kkaempf@rmi.de> - - Merge of vax/vms (read-only) support - * configure.com: Support Vax target. - * makefile.vms: Support Vax target. - * vms.h: Renamed from evax.h, merged vax/vms (read-only) support. - * vms.c: Renamed from evax-alpha.c, merged vax/vms (read-only) - support. - * vms-hdr.c: Renamed from evax-emh.c, merged vax/vms (read-only) - support. - * vms-gsd.c: Renamed from evax-egsd.c, merged vax/vms (read-only) - support. - * vms-tir.c: Renamed from evax-etir.c, merged vax/vms (read-only) - support. - * vms-misc.c: Renamed from evax-misc.c, merged vax/vms (read-only) - support. - * libbfd.c (real_read): Use unbuffered read on VMS/Vax. - * targets.c (bfd_target_ovax_flavour): New flavour. - (vms_alpha_vec): Renamed from evax_alpha_vec. - (vms_vax_vec): New. - (target_vector): Update accordingly. - * config.bfd (alpha*-*-*vms*): Use vms_alpha_vec, not - evax_alpha_vec. - (vax*-*-*vms*): New target. - * Makefile.am: Update for renamed files. Rebuild dependencies. - * bfd-in2.h: Rebuild. - * configure.in, Makefile.in, aclocal.m4: Rebuild. - -Thu Jul 2 13:31:55 1998 Ian Lance Taylor <ian@cygnus.com> - - Based on patch from Matt Semersky <matts@scd.hp.com>: - * linker.c (_bfd_generic_final_link): Force a trailing NULL - pointer on abfd->outsymbols. - (generic_add_output_symbol): Handle NULL sym parameter. - -Wed Jul 1 17:05:53 1998 Nick Clifton <nickc@cygnus.com> - - * elf.c (copy_private_bfd_data): Add support for changing VMA or - LMA of sections. - -Wed Jul 1 16:58:50 1998 Ian Lance Taylor <ian@cygnus.com> - - * coff-sh.c (sh_relax_delete_bytes): Correct address comparisons - when handling 32 bit immediate relocs. - * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. - -Tue Jun 30 09:55:03 1998 Jeffrey A Law (law@cygnus.com) - - * section.c (STD_SECTION): Account for recently added gc_mark - field in struct asection. - - * elf-m10300.c (bfd_mn10300_elf_merge_private_bfd_data): New function. - (bfd_elf32_bfd_merge_private_bfd_data): Define. - -Thu Jun 25 18:31:41 1998 Richard Henderson <rth@cygnus.com> - - ELF Section-level Garbage Collection: - * bfd.c (bfd_gc_sections): New. - * aout-adobe.c: Hook to default implementation. - * aout-target.h, aout-tic30.c, binary.c, bout.c: Likewise. - * coff-alpha.c, coff-mips.c, coff-rs6000.c, coffcode.h: Likewise. - * evax-alpha.c, i386msdos.c, i386os9k.c, ieee.c: Likewise. - * ihex.c, nlm-target.h, oasys.c, ppcboot.c, srec.c: Likewise. - * tekhex.c, versados.c: Likewise. - * libbfd-in.h (_bfd_nolink_bfd_gc_sections): New. - * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_gc_sections. - - * reloc.c (BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY): New. - (bfd_generic_gc_sections): New. - * section.c (SEC_KEEP): New. - (asection): Add gc_mark member. - - * elfcode.h (elf_gc*): New name remappings. - * elflink.h (elf_link_input_bfd): Don't set contents on stabs - sections to be excluded. - (elf_gc_mark, elf_gc_sweep, elf_gc_sweep_symbol): New. - (elf_gc_propogate_vtable_entries_used): New. - (elf_gc_smash_unused_vtentry_relocs): New. - (elf_gc_sections, elf_gc_record_vtinherit, elf_gc_record_vtentry): New. - (elf_gc_common_finalize_got_offsets): New. - (elf_gc_allocate_got_offsets, elf_gc_common_final_link): New. - * elfxx-target.h: Add and default gc hooks. - - * elf-bfd.h (struct elf_link_hash_entry): Swap got_offset/plt_offset - for unions. - (struct elf_obj_tdata): Likewise for local_got_offsets. - * elf.c, elf-i386.c, elf32-m68k.c, elf32-mips.c: Update all uses. - * elf32-ppc.c, elf32-sparc.c, elf64-alpha.c: Likewise. - * elf64-sparc.c, elflink.h: Likewise. - - * elf-bfd.h (struct elf_link_hash_entry): Add vtable members. - (ELF_LINK_HASH_MARK): Define. - (struct elf_backend_data): Add GC hooks. - * elf.c (_bfd_elf_link_hash_newfunc): Zero vtable members. - - * elf-m10300.c (mn10300_elf_check_relocs): New. - (mn10300_elf_gc_mark_hook): New. - (R_MN10300_GNU_VTINHERIT, R_MN10300_GNU_VTENTRY): New. - (elf_mn10300_howto, mn10300_reloc_map): Handle them. - (mn10300_elf_final_link_relocate): Likewise. - (mn10300_elf_relocate_section): Likewise. - (elf_backend_can_gc_sections): Define. - * elf32-mips.c (R_MIPS_GNU_VTINHERIT, R_MIPS_GNU_VTENTRY): New. - (elf_mips_gnu_vtinherit_howto, elf_mips_gnu_vtentry_howto): New. - (bfd_elf32_bfd_reloc_type_lookup): Handle them. - (mips_info_to_howto_rel): Likewise. - (mips_elf_relocate_section): Likewise. - (mips_elf_check_relocs): Likewise. - (mips_elf_gc_mark_hook, mips_elf_gc_sweep_hook): New. - (elf_backend_can_gc_sections): Define. - * elf32-ppc.c (R_PPC_GNU_VTINHERIT, R_PPC_GNU_VTENTRY): New. - (ppc_elf_howto_raw): Handle them. - (ppc_elf_reloc_type_lookup): Likewise. - (ppc_elf_relocate_section): Likewise. - (ppc_elf_check_relocs): Reference count .got and .plt entries. - Handle new vtable relocs. - (ppc_elf_adjust_dynamic_symbol): Recognize unused .plt entries. - (ppc_elf_gc_mark_hook, ppc_elf_gc_sweep_hook): New. - (elf_backend_can_gc_sections): Define. - -Fri Jun 26 10:48:23 1998 Jeffrey A Law (law@cygnus.com) - - * archures.c (bfd_mach_mn10300): Define. - * elf-m10300.c: Include elf/mn10300.h - (elf_mn10300_mach): New function. - (_bfd_mn10300_elf_final_write_processing): Likewise. - (_bfd_mn10300_elf_object_p): Likewise. - (elf_backendfinal_write_processing): Define. - (elf_backend_object_p): Likewise. - -Thu Jun 25 18:31:08 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_perform_relocation): Fix HI16_S - relocation. - -Wed Jun 24 17:17:57 1998 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_bfd_final_link): Loop over input_bfds using the - link_next field, not the next field. - -Sun Jun 21 19:38:39 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf.c (map_sections_to_segments): Check the section address - against the phdr size both with and without a modulo of - maxpagesize. - -Fri Jun 19 17:08:18 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf32-mips.c (mips_elf_size_dynamic_sections): Only strip a - linker created empty input section if the output section has the - same name. - - * elflink.h (elf_link_output_extsym): Print an error message if - _bfd_elf_section_from_bfd_section fails. - - * elf.c (_bfd_elf_section_from_bfd_section): Call bfd_set_error on - failure. - -Tue Jun 16 11:55:55 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf.c (copy_private_bfd_data): Improve handling of Solaris - native linker output. Avoid putting an empty section in more than - one segment. - -Fri Jun 12 13:30:17 1998 Tom Tromey <tromey@cygnus.com> - - * po/Make-in (all-yes): If maintainer mode, depend on .pot file. - ($(PACKAGE).pot): Unconditionally depend on POTFILES. - -Fri Jun 12 13:34:02 1998 Doug Evans <devans@canuck.cygnus.com> - - * elf.c (swap_out_syms): New arg relocatable_p. - Don't add section VMA to symbols for relocatable output. - (_bfd_elf_compute_section_file_positions): Update call to - swap_out_syms. - -Mon Jun 8 15:20:57 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_perform_relocation): Make comparisons - against 'addend' be signed rather than unsigned. - -Sat Jun 6 00:31:21 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-m32r.c: Add prototyps for static functions. - - * coff-arm.c: Add prototypes for static functions. - -Fri Jun 5 17:21:51 1998 Nick Clifton <nickc@cygnus.com> - - * elf.c (elf_sort_sections): Sort by LMA first then VMA, since the - LMA is used to order sections in a segment. - - * elf32-v850.c: Add prototypes for static functions. - Change type of addend parameter to bfd_vma in various functions. - -Fri Jun 5 18:09:58 1998 Ian Lance Taylor <ian@cygnus.com> - - * aoutx.h (howto_table_ext): Change RELOC_BASE13 to use - complain_overflow_signed instead of complain_overflow_bitfield. - -Fri Jun 5 15:11:11 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * elf.c (elf_map_symbols): Don't add section VMA to symbol value - when comparing against 0. - -Wed Jun 3 17:52:49 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (config.status): New target. - * Makefile.in: Rebuild. - -Wed Jun 3 12:18:24 1998 Stan Cox <scox@equinox.cygnus.com> - - * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Give an - error if previous object endianness doesn't match current object. - -Tue Jun 2 17:50:59 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_print_private_bfd_data): Call - _bfd_elf_print_private)bfd_data (). - -Tue Jun 2 15:29:35 1998 Ian Lance Taylor <ian@cygnus.com> - - * elflink.h (elf_merge_symbol): Don't always set type_change_ok - and size_change_ok. - (elf_link_add_object_symbols): Set type_change_ok and - size_change_ok before calling elf_merge_symbol. - - * elf32-mips.c (mips_elf_relocate_section): If we issue an - undefined symbol error, don't also issue an overflow error. - -Tue Jun 2 13:51:00 1998 Geoff Keating <geoffk@ozemail.com.au> - - * elf32-ppc.c (ppc_elf_relocate_section): The target of an - R_PPC_LOCAL24PC relocation should be local; if not, print an error - message instead of crashing. - -Mon Jun 1 18:23:12 1998 Yuli Barcohen <yuli.barcohen@telrad.co.il> - - * archures.c (bfd_mach_cpu32): Define. - (bfd_default_scan): Add case for 68060. Fix 68332 case to use - bfd_mach_cpu32. - * cpu-m68k.c (arch_info_struct): Add m68k:cpu32. - * ieee.c: Include <ctype.h>. - (ieee_object_p): Parse out process ID string to make it more - likely to be acceptable for bfd_scan_arch. - * bfd-in2.h: Rebuild. - -Mon Jun 1 11:12:02 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-m32r.c (m32r_elf_print_private_bfd_data): Also call - _bfd_elf_print_private_bfd_data() so that the program header will - be displayed. - -Mon Jun 1 12:14:28 1998 Ian Lance Taylor <ian@cygnus.com> - - * peicode.h (coff_swap_sym_in): Check for C_SECTION rather than - 0x68. Reindent. Add some comments. - -Fri May 29 09:58:08 1998 Nick Clifton <nickc@cygnus.com> - - * elf.c (copy_private_bfd_data): Adjust physical address of - segment in output BFD to contain LMAs of its sections. - -Tue May 26 19:37:47 1998 Stan Cox <scox@equinox.cygnus.com> - - * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, - elf32_sparc_relocate_section): Added R_SPARC_32LE for little - endian data 32 bit relocations. - (elf32_sparc_merge_private_bfd_data): Check if linking little - endian objects with big endian objects. - (elf32_sparc_object_p): Set bfd_mach_sparc_sparclite_le. - (elf32_sparc_final_write_processing): Set EF_SPARC_LEDATA in e_flags. - * libbfd.h (bfd_reloc_code_real_names): Added BFD_RELOC_SPARC_32LE. - * reloc.c: Same. - * cpu-sparc.c (arch_info_struct): Added sparc:sparclite_le - * archures.c (bfd_mach_sparc_sparclite_le): New. - * bfd-in2.h (BFD_RELOC_SPARC_32LE, bfd_mach_sparc_sparclite_le): New. - -Thu May 21 16:59:28 1998 Nick Clifton <nickc@cygnus.com> - - * peicode.h (add_data_entry): Fix precedence of operators in if () - statement. - -Tue May 19 18:41:19 1998 Ian Lance Taylor <ian@cygnus.com> - - * bfd-in.h: Move over patch to bfd-in2.h. - - * reloc.c (bfd_check_overflow): Add casts before shifts which may - not fit in 32 bits. - (_bfd_relocate_contents): Likewise. - -Mon May 18 14:44:15 1998 Nick Clifton <nickc@cygnus.com> - - * peicode.h (add_data_entry): If the section has no private data - then do not create a Data Dictionary entry for it. - -Mon May 18 00:09:28 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_relax_section): Set again on changes. - (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots, - elf64_alpha_size_got_sections): Rewrite, handling multiple got - subsections during relaxation more correctly. - -Thu May 14 14:22:58 1998 Nick Clifton <nickc@cygnus.com> - - * bfd-in2.h: Add new prototype: bfd_coff_set_symbol_class (). - Add extra argument to bfd_arm_process_before_allocation (). - * bfd-in.h: Reflect changes made in bfd-in2.h. - * coffgen.c (bfd_coff_set_symbol_class): New function. Set the - coff class of a BFD symbol. - * coff-arm.c: Add support for interworking between Thumb code and - non-interworking aware ARM code. - -Sun May 10 22:33:59 1998 Jeffrey A Law (law@cygnus.com) - - * po/Make-in (install-info): New target. - -Thu May 7 17:40:56 1998 Ian Lance Taylor <ian@cygnus.com> - - * filemode.c: Remove; not used. - - If sysdep.h includes a header file, don't include it again: - * aix386-core.c: Don't include <stdio.h>, <stddef.h>, or - <errno.h>. - * aoutx.h: Don't include <string.h>. Use "sysdep.h" rather than - <sysdep.h>. - * archive.c: Don't include <string.h> or <errno.h>. - * evax-alpha.c; Don't include <stdio.h>. - * evax-egsd.c: Likewise. - * evax-etir.c: Likewise. - * evax-misc.c: Likewise. - * evax-emh.c: Likewise. Also, don't include <sys/types.h>. - * hppabsd-core.c: Don't include <stdio.h>, <sys/types.h>, or - <errno.h>. - * hpux-core.c: Likewise. - * netbsd-core.c: Likewise. - * som.c: Likewise. - * libbfd.c: Don't include <sys/types.h>. - * nlmcode.h: Don't include <string.h>. - * osf-core.c: Don't include <string.h> or <stdio.h>. - * ptrace-core.c: Don't include <stdio.h>, <sys/types.h>, - <errno.h>, or <unistd.h>. - * trad-core.c: Don't include <stdio.h> or <sys/types.h>. - -Thu May 7 13:12:50 1998 Klaus Kaempf <kkaempf@progis.de> - - * configure.com: If the version number can not be found in - configure.in, set it to "unknown" rather than "2.8.1". - -Wed May 6 09:46:05 1998 Gavin Koch <gavin@cygnus.com> - - * elf32-mips.c (elf_mips_mach): New. - (_bfd_mips_elf_object_p): Use elf_mips_mach. - (_bfd_mips_elf_final_write_processing): Use the names - of machines, rather than the numbers. Set both the ARCH - and MACH in e_flags. Handle a few more specific machines. - (_bfd_mips_elf_merge_private_bfd_data): Merge both - EF_MIPS_ARCH and EF_MIPS_MACH. - -Tue May 5 21:01:53 1998 Richard Henderson <rth@cygnus.com> - - * syms.c (bfd_is_local_label): Revert last change. - * srec.c (srec_write_symbols): Discard debugging symbols. - -Tue May 5 23:36:06 1998 Ian Lance Taylor <ian@cygnus.com> - - * som.c: Include <ctype.h>. - * som.h: Don't include sysdep.h. - -Tue May 5 18:29:24 1998 Tom Tromey <tromey@cygnus.com> - - * libbfd.h: Rebuilt. - * libbfd-in.h: Removed gettext includes and defines. - * sysdep.h: Moved gettext-related includes and defines here. - -Tue May 5 16:47:54 1998 Richard Henderson <rth@cygnus.com> - - * srec.c (srec_write_symbols): Use bfd_is_local_label rather than - an ad-hoc test. Kill bogus #if 0 code. - * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local. - -Mon May 4 16:10:33 1998 Ian Lance Taylor <ian@cygnus.com> - - * sunos.c (sunos_check_dynamic_reloc): Don't use the PLT address - when generating a normal executable for a symbol defined in a - regular file. When copying a reloc into the output file, adjust - the addend for a PC relative reloc against a global symbol. - -Mon May 4 10:08:18 1998 Tom Tromey <tromey@cygnus.com> - - * libbfd.h: Rebuilt. - * libbfd-in.h (_): Define as dgettext. - -Mon May 4 11:02:23 1998 Ian Lance Taylor <ian@cygnus.com> - - * coff-arm.c (coff_arm_relocate_section): Cast to bfd_signed_vma, - not signed. - * peicode.h (pe_saved_coff_bfd_print_private_bfd_data): Use PARAMS - when declaring parameter types. - (pe_saved_coff_bfd_copy_private_bfd_data): Likewise. - -Wed Apr 29 15:35:03 1998 Ian Lance Taylor <ian@cygnus.com> - - * config.bfd: If we include any ELF targets in targ_defvec and/or - targ_selvecs, then add the generic ELF targets to targ_selvecs. - * elf32-gen.c (dummy): New static const variable. - (elf_generic_info_to_howto): New static function. - (elf_generic_info_to_howto_rel): New static function. - (elf_info_to_howto): Define as elf_generic_info_to_howto. - (elf_info_to_howto_rel): Define as elf_generic_info_to_howto_rel. - * elf64-gen.c: Same changes as elf32-gen.c. - * elfcode.h (elf_object_p): For the generic target, ignore a - failure of bfd_default_set_arch_mach. Fix indentation a bit. - -Tue Apr 28 20:05:52 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in (WIN32LIBADD): Add -lintl on cygwin32. - * configure: Rebuild. - -Tue Apr 28 12:16:57 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * config.bfd: Update OSR5/Unixware patterns. - -Mon Apr 27 18:02:24 1998 Richard Henderson <rth@cygnus.com> - - * elf.c (assign_file_positions_for_segments): Allow for holes - between sections added by a link script. - -Mon Apr 27 11:49:55 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Change version number to 2.9.4 - * configure: Rebuild. - - Based on patch from H.J. Lu <hjl@gnu.org>: - * elf.c (bfd_elf_get_bfd_needed_list): New function. - * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare. - * bfd-in2.h: Rebuild. - -Sat Apr 25 20:07:53 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (struct alpha_relax_info): Replace elfsym with other. - Change all users. - -Sat Apr 25 18:29:07 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (struct alpha_relax_info): Add tsec & elfsym members. - (elf64_alpha_relax_section): Fill them in. - (elf64_alpha_relax_opt_call): Implement more than a stub. - (elf64_alpha_add_symbol_hook): Don't set SEC_LOAD or default - alignment on .scommon. - (elf64_alpha_merge_gots): Merge use counts as well. - -Sat Apr 25 14:07:29 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_relax_section): Use the proper section - for calculating a local symbol's address. - (elf64_alpha_calc_got_offsets): Skip entries with 0 use count. - Set the .got's cooked size as well as the raw size. - -Fri Apr 24 09:16:00 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_print_private_bfd_data): Add - internationalisation of printed information. - - * coff-arm.c (coff_arm_print_private_bfd_data): Add - internationalisation of printed information. - -Fri Apr 24 12:09:18 1998 Ian Lance Taylor <ian@cygnus.com> - - * syms.c (struct indexentry): Change directory_name, file_name, - and function_name fields to char *. - (struct stab_find_info): Change cached_file_name field to char *. - -Thu Apr 23 08:13:04 1998 Nick Clifton <nickc@cygnus.com> - - * peicode.h (dir_names): Add missing N_() macros to dir_names array. - -Wed Apr 22 13:06:15 1998 Tom Tromey <tromey@cygnus.com> - - * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). - -Wed Apr 22 17:48:48 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (install-data-local): Make $(includedir). - * Makefile.in: Rebuild. - -Wed Apr 22 13:06:15 1998 Tom Tromey <tromey@cygnus.com> - - * libbfd-in.h: Use `gettext' and not `dgettext' for now. - -Wed Apr 22 12:53:40 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (INCLUDES): Add -I$(srcdir)/../intl -I../intl. - * Makefile.in: Rebuild. - - * bfd-in2.h: Rebuild for Nick's changes. - -Tue Apr 21 23:11:51 1998 Richard Henderson <rth@cygnus.com> - - * archive.c (_bfd_generic_read_ar_hdr_mag): Fix lossage in last - change wrt length == max_namelen. - -Tue Apr 21 21:19:36 1998 Tom Tromey <tromey@scribbles.cygnus.com> - - * Many files: Added gettext invocations around user-visible - strings. - * libbfd-in.h: Added gettext includes and defines. - * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, - HAVE_LC_MESSAGES): Define. - * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and - po/Makefile. - * Makefile.am (SUBDIRS): Added po. - (POTFILES): New macro. - (po/POTFILES.in): New target. - (SOURCE_HFILES): New macro. - (HFILES): Use it. - * po/Make-in, po/POTFILES.in, po/bfd.pot: New files. - -Tue Apr 21 13:38:18 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * elfcore.h (bfd_prstatus): Copy core_prstatus from the first - NT_PRSTATUS note section encountered, it contains the status of - the currently executing thread when the core file was written. - -Tue Apr 21 10:00:12 1998 Nick Clifton <nickc@cygnus.com> - - * libcoff.h: Add extra parameter to - bfd_coff_link_output_has_begun overrideable function. - * cofflink.c: Pass extra parameter to - bfd_coff_link_output_has_begun function. - * bfd-in.h: Add prototypes for exported ARM interworking - functions. - * peicode.h: ARM specific code reorganised to conform to BFD - coding conventions. - * coffcode.h: ARM specific code reorganised to conform to BFD - coding conventions. - * coff-arm.c: Code reorganised to conform to the BFD coding - conventions. Global variables have been moved into an ARM - specific hash table structure and a new function: - bfd_arm_get_bfd_for_interworking() has been created which is - called from the linker scripts. - -Tue Apr 21 00:11:51 1998 Richard Henderson <rth@cygnus.com> - - * archive.c (_bfd_generic_read_ar_hdr_mag): Simplify end-of-name test. - - * elf64-alpha.c (elf64_alpha_find_reloc_at_ofs): Renamed from - elf64_alpha_relax_find_reloc_ofs. Changed all callers. - (elf64_alpha_add_symbol_hook): Put small commons in .scommon not .sbss. - (elf64_alpha_size_got_sections): Don't merge .got sections twice. - -Sat Apr 18 01:21:04 1998 Stan Cox <scox@cygnus.com> - - * config.bfd: Added sparc86x support. - -Fri Apr 17 22:29:04 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf32-mips.c (mips_elf_relocate_section): Do not complain about - an out of range pc-relative jump/call to an undefined weak symbol. - -Thu Apr 16 13:49:00 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c (elf64_alpha_do_reloc_gpdisp): Do all gpdisp - comparisons signed. - -Thu Apr 16 11:43:33 1998 Ian Lance Taylor <ian@cygnus.com> - - * archive.c (bfd_generic_archive_p): If a slurp subroutine returns - an error other than bfd_error_system_call, set the error to - bfd_error_wrong_format. - - * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add - bfd_elf32_powerpcle_vec. - - * elf.c (copy_private_bfd_data): If all the p_paddr fields in the - program segments are zero, don't set p_paddr_valid. - -Wed Apr 15 22:15:16 1998 Richard Henderson <rth@cygnus.com> - - * elf64-alpha.c: Initial implementation of relaxation -- - (struct alpha_elf_link_hash_entry): Add use_count member. - (elf64_alpha_check_relocs): Initialize and increment it. - (elf64_alpha_can_merge_gots): Check it when considering merging. - (elf64_alpha_merge_gots): Drop entries with zero use. - (elf64_alpha_calc_got_offsets_for_symbol): Likewise. - (elf64_alpha_always_size_sections): Split out got sizing ... - (elf64_alpha_size_got_sections): ... here. New function. - (elf64_alpha_relax_find_reloc_ofs): New function. - (elf64_alpha_relax_with_lituse): Likewise. - (elf64_alpha_relax_without_lituse): Likewise. - (elf64_alpha_relax_opt_call): Likewise. - (elf64_alpha_relax_section): Likewise. - (elf64_alpha_add_symbol_hook): Likewise. - (elf64_alpha_howto_table): Implement GPRELHIGH/LOW & IMMED_GP_16. - (elf64_alpha_relocate_section): Likewise. - (bfd_elf64_bfd_relax_section): Define. - (elf_backend_add_symbol_hook): Likewise. - -Wed Apr 15 16:08:46 1998 Richard Henderson <rth@cygnus.com> - - * elf.c (prep_headers): Use new EM_SPARCV9 symbol. - * elf64-sparc.c (ELF_MACHINE_CODE): Likewise. - (ELF_MACHINE_ALT1): New. Set to EM_OLD_SPARC64. - -Wed Apr 15 11:34:33 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Add -lkernel32 to WIN32LIBADD on cygwin32. - * configure: Rebuild. - -Mon Apr 13 16:46:27 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (libbfd_la_LIBADD): Add @WIN32LIBADD@. - (libbfd_la_LDFLAGS): Add @WIN32LDFLAGS@. - * configure.in: Define and substitute WIN32LDFLAGS and - WIN32LIBADD. - * aclocal.m4: Rebuild with new libtool. - * configure, Makefile.in: Rebuild. - -Fri Apr 10 13:44:27 1998 Ian Lance Taylor <ian@cygnus.com> - - * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol - before any other symbols in the same section. - -Wed Apr 8 14:50:23 1998 Michael Meissner <meissner@cygnus.com> - - * config.bfd (powerpc*-*-*): Remove PowerPC NT support from ELF - systems. - -Tue Apr 7 16:25:31 1998 Gavin Romig-Koch <gavin@cygnus.com> - - * dwarf2.c (comp_unit): Move it earlier in the source. Add - addr_size. - (read_address): Replace 'bdf*' argument with 'comp_unit*' argument. - Use addr_size for address size, rather than sizeof(bfd_vma). - (read_attribute): Replace bdf* argument with 'comp_unit*' argument. - Fix call to read_address. - (decode_line_info): Replace bdf* argument with 'comp_unit*' argument. - Scrap other unneeded arguments. Fix call to read_address. - (scan_unit_for_functions): Fix call to read_attribute. - (parse_comp_unit): We now handle more values for addr_size. - Set addr_size in unit. Fix call to read_attribute and - decode_line_info. - -Tue Apr 7 15:44:47 1998 Gavin Romig-Koch <gavin@cygnus.com> - - * dwarf2.c (parse_comp_unit): Drop use of unit->name when it is null. - -Tue Apr 7 12:35:18 1998 Ian Lance Taylor <ian@cygnus.com> - - * archures.c (bfd_default_scan): Add m68k cases back to default - switch, reverting patch of March 25, since IEEE support depends - upon them. - -Mon Apr 6 14:06:40 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (diststuff): New target. - * Makefile.in: Rebuild. - -Sun Apr 5 16:21:44 1998 Jeffrey A Law (law@cygnus.com) - - * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of - som_offset when we have an extended name table. - -Sun Apr 5 16:04:39 1998 H.J. Lu <hjl@gnu.org> - - * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before - trying to copy it. - * Makefile.in: Rebuild. - -Fri Apr 3 11:09:42 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section - symbols when creating a shared library. - (elf_m68k_adjust_dynindx): New function, used by above code. - (elf_m68k_finish_dynamic_sections): Initialize the section - symbols. - (elf_m68k_relocate_section): Change abort to BFD_ASSERT. - -Wed Apr 1 16:04:02 1998 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (in_reloc_p): Use ARM_RVA32 in place of constant - value 11. - -Wed Apr 1 13:36:58 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix - assertion. - -Tue Mar 31 00:12:12 1998 Jeffrey A Law (law@cygnus.com) - - * elf-m10300.c (mn10300_elf_relax_section): Correctly handle - absolute symbols. - -Mon Mar 30 12:46:15 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Set version to 2.9.1. - * configure: Rebuild. - - * Branched binutils 2.9. - -Mon Mar 30 12:20:50 1998 Brent Baccala <baccala@freesoft.org> - - * syms.c (ENABLE_CACHING): Define. - (struct indexentry): Define. - (struct stab_cache): Remove. - (cmpindexentry): New static function. - (struct stab_find_info): Add new fields: indextable, - indextablesize, cached_indexentry, cached_offset, cached_stab, and - cached_file_name. Remove fields: file_cache, function_cache, and - line_cache. - (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted - index table and search it. - -Mon Mar 30 10:39:34 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf.c (_bfd_elf_copy_private_section_data): Call - copy_private_bfd_data once we've seen the last SEC_ALLOC section. - - * cpu-mips.c: Remove trailing comma at end of enumeration list. - -Sat Mar 28 16:33:02 1998 Ian Lance Taylor <ian@cygnus.com> - - * coff-arm.c: Define all globally visible variables and functions - only when COFF_WITH_PE is not defined. - * configure.in (armpe_little_vec, armpe_big_vec): Add - coff-arm.lo. - * configure: Rebuild. - -Fri Mar 27 16:06:02 1998 Ian Lance Taylor <ian@cygnus.com> - - Fix some gcc -Wall warnings: - * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings. - * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise. - * archures.c (bfd_default_scan): Likewise. - * bfd.c (bfd_scan_vma): Likewise. - * binary.c (mangle_name): Likewise - * coff-arm.c (aoutarm_fix_pcrel_26): Likewise. - * coff-sh.c (sh_relocate_section): Likewise. - * coff-stgo32.c (create_go32_stub): Likewise. - * coffcode.h (coff_slurp_line_table): Likewise. - * ecoff.c (_bfd_ecoff_write_armap): Likewise. - * elf.c (_bfd_elf_make_section_from_shdr): Likewise. - (assign_file_positions_for_segments): Likewise. - * elf32-mips.c (mips_elf_relocate_section): Likewise. - * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. - * oasys.c (oasys_write_sections): Likewise. - * ppcboot.c (ppcboot_object_p): Likewise. - (mangle_name): Likewise. - * riscix.c (riscix_fix_pcrel_26): Likewise. - * srec.c (srec_scan): Likewise. - * stabs.c (_bfd_write_section_stabs): Likewise. - * sunos.c (sunos_add_dynamic_symbols): Likewise. - * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to - switch. Declare parameters for function pointers. - * archures.c (bfd_default_scan): Add braces to avoid ambiguous if - warning. - * elf.c (elf_sort_sections): Likewise. - * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation. - Add default cases to switches. - (coff_arm_relocate_section): Remove unused local variables. - Always set rstat. - (coff_arm_bfd_set_private_flags): Change flag variable to type - flagword. - * coff-mips.c (mips_relocate_section): Initialize use_lo. - * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int. - (dump_toc): Change cat to const, and initialize it. - * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff. - * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. - (sh_elf_relocate_section): Initialize r_symndx. - * coffcode.h (coff_compute_section_file_positions): Only declare - old_sofar if ALIGN_SECTIONS_IN_FILE. - (coff_write_object_contents): Initialize csym. - * coffgen.c (coff_pointerize_aux): Make type and class unsigned. - * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to - switch. - * dwarf2.c: Include libiberty.h. - (read_2_signed_bytes, read_4_signed_bytes): Comment out. - (decode_line_info): Remove unused local variables. - * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise. - (m32r_elf_relocate_section): Likewise. - * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise. - (v850_elf_reloc): Likewise. - * elf-bfd.h (elf_linker_section_t): Make alignment unsigned. - (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned. - * elf.c (assign_file_positions_for_segments): Always set adjust. - * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully - parenthesize expression. - * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h. - (m32r_elf_object_p): Return a value. - (m32r_elf_print_private_bfd_data): Change fprintf format string. - * elf32-mips.c (mips_elf_final_link): Initialize last. - (mips_elf_finish_dynamic_sections): Initialize last and dindx. - * elf32-v850.c (v850_elf_object_p): Return a value. - (v850_elf_print_private_bfd_data): Change fprintf format string. - * elfcode.h (elf_slurp_symbol_table): Change symcount and i to - unsigned long. - * elflink.h (elf_link_add_object_symbols): Change vernum to - unsigned int, and initialize it. Change fprintf format string. - (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type - when setting or comparing to soname_indx. - (elf_create_pointer_linker_section): Change num_symbols to - unsigned int. - * libcoff-in.h (coff_data_type): Change flags to flagword. - * peicode.h (pe_print_idata): Initialize idx. Change j to - bfd_size_type. Initialize hint_member. Remove useless test to - time_stamp. - (pe_print_edata): Change num_functions and num_names in struct - EDT_type to unsigned long. Remove cast. Change fprintf format - string. - * ppcboot.c (ppcboot_object_p): Change i to size_t. - * reloc.c (bfd_get_reloc_size): Change return type to unsigned - int. - * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to - int *. Update uses. Change j to long. - * bfd-in2.h, libcoff.h: Rebuild. - -Fri Mar 27 10:10:46 1998 Catherine Moore <clm@cygnus.com> - - * elf32-v850.c Remove definition of USE_REL. - (v850_elf_info_to_howto_rela): New function. - (v850_elf_perform_relocation): Renamed from - v850_elf_store_addend_in_insn. Removed replace argument. - (v850_elf_reloc): store the relocation in the addend field instead - of the insn. - (v850_elf_final_link_relocate): Now calls - v850_elf_perform_relocation. - (v850_elf_relocate_section): Remove code to generate REL - relocations. - -Thu Mar 26 13:32:17 1998 Ian Lance Taylor <ian@cygnus.com> - - * coffcode.h (coff_new_section_hook): Set the type and storage - class in the native symbol information allocated for a new section - symbol. - -Thu Mar 26 10:13:41 1998 Nick Clifton <nickc@cygnus.com> - - * peicode.h: Chain together calls to - coff_bfd_copy_private_bfd_data and - coff_bfd_print_private_bfd_data. - - * coff-arm.c: Add prototypes for - coff_arm_bfd_print_private_bfd_data and - coff_arm_bfd_copy_private_bfd_data. - -Wed Mar 25 15:45:55 1998 Nick Clifton <nickc@cygnus.com> - - * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE - build. - - * peicode.h: Call arm-coff private data functions after handling - pe private data. - - * coff-arm.c: Turn statics into globals so that they can be shared - both pe and pei backends. - -Wed Mar 25 15:19:38 1998 Ian Lance Taylor <ian@cygnus.com> - - * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than - plain numbers. - (sunos_write_object_contents): Likewise. - * aoutx.h (NAME(aout,machine_type)): Likewise. - * coffcode.h (coff_set_arch_mach_hook): Likewise. - -Wed Mar 25 13:59:24 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * archures.c (bfd_mach_m68*): Add definitions for various m68k - variants. - (bfd_default_scan): Remove m68k special cases. - * bfd-in2.h: Rebuild. - * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather - than plain numbers. - * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise. - * cpu-m68k.c (arch_info_struct): Likewise. Add entry for - m68k:68000. - (bfd_m68k_arch): Set mach field to zero to signal no explicit - selection, change printable_name to just "m68k" and make that the - default instead of m68k:68020. - - * aout-tic30.c (NAME): Define this to avoid multiple definitions - from aoutx.h. - (MY_get_section_contents): Define as aout_32_get_section_contents - rather than NAME(aout,get_section_contents). - - * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast. - - * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha - and call bfd_default_set_arch_mach to do the real work. - -Wed Mar 25 10:41:35 1998 Richard Henderson <rth@cygnus.com> - - * bout.c (BALX): Include return register g14 as part of the insn. - (BALX_MASK): New. - (calljx_callback): Use it. - -Wed Mar 25 11:19:28 1998 Ian Lance Taylor <ian@cygnus.com> - - * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma. - * libbfd.h: Rebuild. - - * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change - byte_count to unsigned int. - (mn10300_elf_relax_section): Initialize internal_relocs. Remove - unused local variables. - - * evax-alpha.c (evax_close_and_cleanup): Remove unused local - variables er and er1. - - * cpu-v850.c: Include <ctype.h>. - (scan): Case isdigit argument to unsigned char. - - From Yan Meroth <YAN.MEROTH@st.com>: - * ihex.c (ihex_scan): Add extbase variable so that getting an - extended linear address record does not ignore any previous - extended address. - (ihex_write_object_contents): When writing out an extended linear - address record, zero out any previous extended address. - -Tue Mar 24 16:09:43 1998 Manfred Hollstein <manfred@s-direktnet.de> - - * ieee.c (do_one): Check section before dereferencing it. - (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr. - (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive. - -Mon Mar 23 18:51:47 1998 Joel Sherrill <joel@OARcorp.com> - - * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF. - -Mon Mar 23 14:23:36 1998 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c: Add interworking functions to pe backends. - -Fri Mar 20 18:47:20 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Use AM_DISABLE_SHARED. - * aclocal.m4, configure: Rebuild with libtool 1.2. - -Fri Mar 20 11:25:41 1998 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (coff_arm_relocate_section): Better error messages - when interowrking conflucts occur. Courtesy of Jonathan Walton - and Tony Thompson. - (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted - relocations. Patch courtesy of Jonathan Walton and Tony - Thompson. - -Fri Mar 20 02:26:43 1998 Richard Henderson <rth@cygnus.com> - - * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert - part of Feb 22 change controling when to override the existing - symbol with the .plt entry. - -Wed Mar 18 09:26:25 1998 Nick Clifton <nickc@cygnus.com> - - * config.bfd (targ_cpu): Add thumb-pe target. - - * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external - functions in PE build. - -Sun Mar 8 23:37:26 1998 Stan Cox <scox@equinox.cygnus.com> - - * config.bfd (sparclite-*-elf*): Added. - -Mon Feb 23 19:31:19 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Add elf.lo to elf shell variable. - * Makefile.am (BFD_LIBS): Remove elf.lo. - (BFD_LIBS_CFILES): Remove elf.c. - (BFD32_BACKENDS): Add elf.lo. - (BFD32_BACKENDS_CFILES): Add elf.c. - * configure, Makefile.in: Rebuild. - -1998-02-23 15:53 Richard Henderson <rth@cygnus.com> - - * elf32-i386.c (elf_i386_relocate_section): A pc-relative - relocation against a non-local symbol should not have a dynamic - relocation. - -Mon Feb 23 16:17:08 1998 Ian Lance Taylor <ian@cygnus.com> - - * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in - COFF filehdr flags. - (pe_print_private_bfd_data): Print PE flags. From Mikey - <jeffdb@netzone.com>. - -Sun Feb 22 20:39:00 1998 Richard Henderson <rth@cygnus.com> - - * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create - a plt entry when we can determine that we authoritatively define - the symbol. - -Sun Feb 22 20:33:05 1998 Richard Henderson <rth@cygnus.com> - - * configure.in (COREFILE selection): Remove sparc-*-linux*. They - don't actually use trad-core, but a SunOS-style core file handled - by gdb directly. - * hosts/sparclinux.h: Remove. - -Wed Feb 18 15:31:06 1998 Ian Lance Taylor <ian@cygnus.com> - - * peicode.h (pe_print_idata): If there is no .idata section, look - for the import tables in some other section. Make the initial - label line up better with the data. Print the import address - table even if there is no import name table. If the import - address table holds actual addresses, print them. - -Tue Feb 17 12:58:34 1998 Ian Lance Taylor <ian@cygnus.com> - - * libbfd.c (bfd_seek): If fseek fails, save errno around call to - bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not - bfd_error_system_call. - -Fri Feb 13 13:11:33 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am (AUTOMAKE_OPTIONS): Define. - * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. - - From H.J. Lu <hjl@gnu.org>: - * Makefile.am (libbfd_la_LDFLAGS): Define. - * Makefile.in: Rebuild. - -Thu Feb 12 17:31:11 1998 Ian Lance Taylor <ian@cygnus.com> - - NetBSD patches from Gordon W. Ross <gwr@mc.com>: - * netbsd.h (MACHTYPE_OK): Define. - (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when - calling N_SET_MACHTYPE, rather than having a switch. - * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD, - and M_ALPHA_NETBSD. - * i386netbsd.c (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * m68k4knetbsd.c (SEGMENT_SIZE): Don't define. - (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * m68knetbsd.c: (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * ns32knetbsd.c (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * sparcnetbsd.c (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - - NetBSD patches from Gordon W. Ross <gwr@mc.com>: - * vaxnetbsd.c: New file. - * netbsd-core.c: Clean up. Remove unused macros. Use netbsd - rather than netbsd_core. - * targets.c (vaxnetbsd_vec): Declare. - (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is - defined, add netbsd_core_vec. - * configure.in: Set COREFILE for alpha*-*-netbsd* and - powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is - netbsd-core.lo, set COREFLAG to -DNETBSD_CORE. - * config.bfd (alpha*-*-netbsd*): New target. - * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Add vaxnetbsd.lo. - (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c. - * configure, Makefile.in: Rebuild. - - * configure.host: Remove the old shared library build stuff. We - now use libtool instead. - -Wed Feb 11 17:13:09 1998 Richard Henderson <rth@cygnus.com> - - * tekhex.c (tekhex_write_object_contents): Call tekhex_init. - -Tue Feb 10 19:23:28 1998 H.J. Lu <hjl@gnu.org> - - * configure.in: Take stab-syms.lo out of sparclinux_vec list. - * configure: Rebuild. - -Tue Feb 10 15:16:38 1998 Nick Clifton <nickc@cygnus.com> - * elf32-v850.c (remember_hi16s_reloc): New function. - (find_remembered_hi16s_reloc): New function. - (v850_elf_store_addend_in_insn): Use the above new functions to - match up HI6S relocs with LO16 relocs. - -Tue Feb 10 15:01:39 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Change -linux* to -linux-gnu*. - * config.bfd, configure.host: Likewise. - * configure: Rebuild. - -Mon Feb 9 19:40:59 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another - LO16/HI16S bug and improve comments about what is going on. - -Sat Feb 7 15:27:03 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure, aclocal.m4: Rebuild with new libtool. - -Fri Feb 6 14:48:20 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_merge_private_bfd_data): Do not complain - when merging v850 code into v850e/v850ea code. Do not initialise - output flags if the input is the default architecture. - -Fri Feb 6 11:50:22 1998 Jeffrey A Law (law@cygnus.com) - - * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR - get the size from bfd_arch_bits_per_address instead of directly - from the isa. - -Thu Feb 5 14:21:34 1998 Michael Meissner <meissner@cygnus.com> - - * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address - to wrap, just return all 1's bits instead. - * libbfd.h: Regenerate. - -Thu Feb 5 11:51:05 1998 Ian Lance Taylor <ian@cygnus.com> - - * coff-i386.c (coff_pe_i386_relocate_section): New static function - if COFF_WITH_PE. - (coff_relocate_section): If COFF_WITH_PE, define as - coff_pe_i386_relocate_section. - * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE, - skip empty sections, to match coff_write_object_contents. - - * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend, - rather than swapping out r_offset twice. From Luke Deller - <luked@cse.unsw.edu.au>. - -Wed Feb 4 19:11:28 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Set libtool_enable_shared rather than - libtool_shared. Remove diversion hack. - * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild - with new libtool. - -Wed Feb 4 16:10:21 1998 Brent Baccala <baccala@freesoft.org> - - * syms.c (struct stab_cache): Define. - (struct stab_find_info): Remove cached_offset, cached_stab, - cached_str, and cached_stroff fields. Add file_cache, - function_cache, and line_cache fields. - (_bfd_stab_section_find_nearest_line): Use extensive caching to - speed up searches. - -Wed Feb 4 13:34:22 1998 Ian Lance Taylor <ian@cygnus.com> - - * peicode.h (pe_print_idata): Check for import of ordinal rather - than name. - (pe_print_edata): If there is no .edata section, look for the - export data in some other section. - -Mon Feb 2 20:05:42 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * configure.in: Change version to 2.8.4. - * configure: Regenerated. - -Mon Feb 2 17:39:39 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU> - - Add tms320c30 support: - * cpu-tic30.c: New file. - * aout-tic30.c: New file. - * coff-tic30.c: New file. - * archures.c (bfd_arch_tic30): Define. - (bfd_tic30_arch): Declare. - (bfd_archures_list): Add bfd_tic30_arch. - * targets.c (bfd_target_vector): Add tic30_aout_vec and - tic30_coff_vec. - * reloc.c (BFD_RELOC_TIC30_LDP): Define. - * coffcode.h (coff_set_arch_mach_hook): Add tic30 case. - (coff_set_flags): Likewise. - * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets. - * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors. - * Makefile.am: Rebuild dependencies. - (ALL_MACHINES): Add cpu-tic30.lo. - (ALL_MACHINES_CFILES): Add cpu-tic30.c. - (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo. - (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c. - * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. - -Mon Feb 2 12:25:12 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc - to lag behind LO16 reloc by a couple of instructions. - -Mon Feb 2 14:09:46 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force - make to reexamine the file timestamp. - ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise. - - * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from - 0x100000. - -Fri Jan 30 19:07:07 1998 Geoff Keating <geoffk@ozemail.com.au> - - * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure - to create .dynsbss and .rela.sbss sections. - (ppc_elf_adjust_dynamic_symbol): Put space for small data to be - copied from dynamic objects into .sbss. - (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't - use it. Correct typo of .rela.sdata2. - (ppc_elf_finish_dynamic_symbol): Generate reloc to where we - put the data, which may now be in .sbss. - (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss. - (elf_backend_create_dynamic_sections): Define as - ppc_elf_create_dynamic_sections. - - * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs - against _GLOBAL_OFFSET_TABLE_. - (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in - shared libraries which refer to local symbols. Make sure that the - test for allocating space for a reloc in a shared object is the - same as the test for emitting a reloc. - -Thu Jan 29 15:55:35 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl> - - * config.bfd (i[3456]-*-mingw32*): New target. - * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32. - * aclocal.m4, configure: Rebuild. - -Wed Jan 28 13:41:26 1998 Ian Lance Taylor <ian@cygnus.com> - - * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we - have a bfd_object. - -Tue Jan 27 21:43:55 1998 Richard Henderson <rth@cygnus.com> - - Sparc v9 ABI compliant PLT: - * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries. - (plt_templates, sparc64_elf_build_plt_entry): Delete. - (LARGE_PLT_THRESHOLD): New define. - (GOT_RESERVED_ENTRIES): V9 ABI only uses 1. - (sparc64_elf_build_plt): New function. - (sparc64_elf_plt_entry_offset): Likewise. - (sparc64_elf_plt_ptr_offset): Likewise. - (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to - contain the index for convenience. Skip the initial entries - in .rela.plt. - (sparc64_elf_size_dynamic_sections): Zero the allocated contents - memory for the benefit of .rela.plt. - (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset. - (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use - sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc. - (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt. - Call sparc64_elf_build_plt. - (elf_backend_want_got_plt): No. - (elf_backend_plt_readonly): No. - (elf_backend_plt_alignment): 8. - - * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab. - * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it. - * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it - to be called. - -Tue Jan 27 21:45:15 1998 Jeffrey A Law (law@cygnus.com) - - * archures.c (bfd_mach_mips*): Add definitions for various MIPS - processors. - * cpu-mips.c (arch_info_struct): Add mips variants. - * bfd-in2.h: Rebuilt. - -Tue Jan 27 15:06:04 1998 Nick Clifton <nickc@cygnus.com> - - * coff-arm.c (coff_arm_relocate_section): Preserve the contents of - t2a3_b_insn. - -Tue Jan 27 12:47:27 1998 Robert Lipe <robertl@dgii.com> - - * config.bfd (i[3456]86-sco3.2v5*): ELF now the default. - (i[3456]86sco3.2v5*coff): New target. - -Mon Jan 26 15:41:30 1998 Ian Lance Taylor <ian@cygnus.com> - - * bfd-in2.h: Rebuild with changes to chew--tab expansion. - -Thu Jan 22 21:26:48 1998 Richard Henderson <rth@cygnus.com> - - * bfd.c (bfd_get_error_handler): Add orthogonal function. - * bfd-in2.h: Regenerate. - -Thu Jan 22 21:13:39 1998 Richard Henderson <rth@cygnus.com> - - * tekhex.c (tekhex_write_object_contents): Check for no symbols. - -Wed Jan 21 21:19:03 1998 Ian Lance Taylor <ian@cygnus.com> - - * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't - adjust addend for an output common symbol (from Jimmy Blair - <jimmyb@wrs.com>). If COFF_WITH_PE, adjust addend for PC relative - defined symbol to counteract adjustment made in generic relocation - code. - - * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h. - -Wed Jan 21 21:16:06 1998 Manfred Hollstein <manfred@s-direktnet.de> - - * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name. - (GET_SCNDHR_NLNNO): Likewise. - -Mon Jan 19 12:49:52 1998 Ian Lance Taylor <ian@cygnus.com> - - * cpu-sh.c (arch_info_struct): Correct next field of sh3e. - -Wed Jan 14 17:23:27 1998 Nick Clifton <nickc@cygnus.com> - - * elf32-m32r.c: Add macros to handle NOP insertion. - -Wed Jan 14 16:15:22 1998 Richard Henderson <rth@cygnus.com> - - * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section. - (xcoff_mark): Likewise. - (xcoff_build_ldsyms): Mark absolute symbols. - -Wed Jan 14 16:03:11 1998 Richard Henderson <rth@cygnus.com> - - * bout.c (b_out_write_object_contents): Sort symbols before output - to keep {CALL,BAL}NAME symbols adjacent. - (b_out_symbol_cmp): New function. - -For older changes see ChangeLog-9697 +For older changes see ChangeLog-9899 Local Variables: mode: change-log diff --git a/contrib/binutils/bfd/ChangeLog-9899 b/contrib/binutils/bfd/ChangeLog-9899 new file mode 100644 index 0000000..c6348c4 --- /dev/null +++ b/contrib/binutils/bfd/ChangeLog-9899 @@ -0,0 +1,5595 @@ +1999-12-29 Richard Henderson <rth@cygnus.com> + + * elflink.h (bfd_elf,size_dynamic_sections): Don't export all + if no dynamic sections created. + +1999-12-27 Nick Clifton <nickc@cygnus.com> + + * peicode.h (pe_bfd_object_p): Only define for PE format + targets. + +1999-12-17 Nick Clifton <nickc@cygnus.com> + + * coff-i386.c (i3coff_object_p): Delete. + (i386coff_vec): Replace reference to i3coff_object_p with a + reference to coff_object_p. + + * coff-mcore.c (pe_object_p): Delete. + + * peicode.h (pe_bfd_object_p): New function: Detect the + presence of a PE format COFF object file. Also detect and + warn about the presence of LINK6 format Image Library Format + object files. + +1999-12-16 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (NUM_ELEM): New macro. + (NUM_RELOCS): New macro: The number of known ARM relocs. + (RTYPE2HOWTO): Return NULL if the reloc type is out of range. + (coff_arm_rtype_to_howto): Return NULL if the reloc type is out + of range. + (bfd_arm_process_before_allocation): Produce a warning message if + an out of range symbol index is encountered. + +1999-12-14 Nick Clifton <nickc@cygnus.com> + + * elflink.h (is_global_symbol_definition): New Function: Return + true iff the symbol is being given a global definition in this + bfd. + (elf_link_is_defined_archive_symbol): Do not bother processing + symbols for an archive element that has already been included + in the link. + Use is_global_symbol_definition(). + +1999-12-09 Andrew Cagney <cagney@cygnus.com> + + * config.bfd: Add support for sparc-*-netbsdelf* and + sparc-*-netbsdaout*. + +1999-12-13 Nick Clifton <nickc@cygnus.com> + + * elflink.h (elf_link_is_defined_archive_symbol): Check to see + if the symbol is in the common section. + +1999-12-10 Nick Clifton <nickc@cygnus.com> + + * elflink.h (elf_link_is_defined_archive_symbol): New + function: Decide if a symbol, in an archive map is there + because it is defined in the archive element, or because it is + just another common declaration of it. + (elf_link_add_archive_symbols): Use + elf_link_is_defined_archive_symbol to decide if an archive + element contain a reference to a common symbol should be + linked in or not. + +1999-12-10 Nick Clifton <nickc@cygnus.com> + + * elflink.h: Revert previous patch. + * targets.c: Revert previous patch. + * libbfd-in2.h: Revert previous patch. + * libbfd.h: Revert previous patch. + * elfxx-target.h: Revert previous patch. + * archive.c: Revert previous patch. + * aout-target.h: Revert previous patch. + * aout-tic30.h: Revert previous patch. + * bfd.c: Revert previous patch. + * coff-alpha.c: Revert previous patch. + * coff-rs6000.c: Revert previous patch. + * elf64-mips.c: Revert previous patch. + * ieee.c: Revert previous patch. + * libecoff.h: Revert previous patch. + * oasys.c: Revert previous patch. + * som.c: Revert previous patch. + * vms.c: Revert previous patch. + +1999-12-09 Nick Clifton <nickc@cygnus.com> + + * elflink.h (elf_link_add_archive_symbols): Add an archive + element even if contains a symbol which is currently only + considered to be a common. + + * targets.c (struct bfd_target): Add new field + _bfd_allow_commons_in_armap. + * bfd-in2.h:Regenerate. + + * libbfd-in2.h (_bfd_noarchive_allow_commons_in_armap): + Define. + (_bfd_archive_bsd_allow_commons_in_armap): Define. + * libbfd.h: Regenerate. + + * elfxx-target.h: If using COFF archive map, override + definition of allow_commons_in_armap and replace with + bfd_false. + + * archive.c (bfd_compute_and_write_armap): Do not place common + symbols into the archive map unless _bfd_allow_commons_in_armap + returns true. + + * aout-target.h (MY_allow_commons_in_armap): Define. + * aout-tic30.h (MY_allow_commons_in_armap): Define. + * bfd.c (bfd_allow_commons_in_armap): Define. + * coff-alpha.h (alpha_ecoff_allow_commons_in_armap): Define. + * coff-rs6000.h (xcoff_allow_commons_in_armap): Define. + * elf64-mips.c (bfd_elf64_allow_commons_in_armap): Define. + * ieee.c (ieee_ecoff_allow_commons_in_armap): Define. + * libecoff.h (_bfd_ecoff_allow_commons_in_armap): Define. + * oasys.c (oasys_allow_commons_in_armap): Define. + * som.c (som_allow_commons_in_armap): Define. + * vms.c (vms_allow_commons_in_armap): Define. + +1999-12-07 Jim Blandy <jimb@cygnus.com> + + Add support for SSE registers in ELF core files. + * elf.c (elfcore_make_note_pseudosection): New function. + (elfcore_grok_prfpreg): Use it. + (elfcore_grok_prxfpreg): New function. + (elfcore_grok_note): Recognize Linux NT_PRXFPREG notes. + +1999-12-03 Ian Lance Taylor <ian@zembu.com> + + * elf32-mips.c (mips_elf_calculate_relocation): Divide R_MIPS_PC16 + value by 4 before storing it back in the field. From + Koundinya. K <kk@ddeorg.soft.net>. + +Tue Nov 30 22:41:14 1999 Jeffrey A Law (law@cygnus.com) + + * archures.c (bfd_mach_am33): Define. + * bfd-in2.h: Rebuilt. + * cpu-m10300.c (bfd_am33_arch): Add to the mn103 architecture list + * elf-m10300.c (mn10300_elf_relax_section): Handle am33 instructions. + (compute_function_info): Handle additional registers saved by + movm on the am33. + (elf_mn10300_mach): Handle E_MN10300_MACH_AM33. + (_bfd_mn10300_elf_final_write_processing): Handle bfd_mach_am33. + +1999-11-29 Jim Blandy <jimb@cygnus.com> + + * elf.c (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New + functions. + * bfd-in2.h (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New + declarations. + +1999-11-27 Michael Meissner <meissner@cygnus.com> + + * reloc.c (BFD_RELOC_ALPHA_USER_LITERAL): New relocation for + internal use within gas for alpha explicit relocations. + (BFD_RELOC_ALPHA_USER_LITUSE_BASE): Ditto. + (BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF): Ditto. + (BFD_RELOC_ALPHA_USER_LITUSE_JSR): Ditto. + (BFD_RELOC_ALPHA_USER_GPDISP): Ditto. + (BFD_RELOC_ALPHA_USER_GPRELHIGH): Ditto. + (BFD_RELOC_ALPHA_USER_GPRELLOW): Ditto. + + * elf64-alpha.c (elf64_alpha_reloc_map): Add mappings for + BFD_RELOC_ALPHA_USER_*. + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +1999-11-26 Fred Fish <fnf@cygnus.com> + + * elf.c (elfcore_read_notes): Add prototype for static function. + (_bfd_elf_make_section_from_phdr): Renamed from bfd_section_from_phdr. + (bfd_section_from_phdr): Replacement function that calls + _bfd_elf_make_section_from_phdr for generic segment types and + backend fucntion pointed to by elf_backend_section_from_phdr for + backend specific segment types. + (_bfd_elfcore_section_from_phdr): Remove call to elfcore_read_notes, + now called by _bfd_elf_make_section_from_phdr. Note that this func + is now just a stub between the caller and bfd_section_from_phdr. + + * elf-bfd.h (struct elf_backend_data): Add new function pointer + elf_backend_section_from_phdr. + (elf_backend_section_from_phdr): Add prototype. + + * elfxx-target.h (elf_backend_section_from_phdr): Define default. + (elfNN_bed): Add elf_backend_section_from_phdr. + +1999-11-25 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (bfd_arm_get_bfd_for_interworking): Add + SEC_CODE and SEC_READONLY flags to glue sections. + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Add + SEC_CODE and SEC_READONLY flags to glue sections. + +1999-11-20 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c (coff_mcore_relocate_section): Fix typo in previous + delta. + +1999-11-19 Catherine Moore <clm@cygnus.com> + + * elf32-m68k.c (elf_cpu32_plt0_entry): Fix encoding. + (elf_cpu32_plt_entry): Likewise. + +1999-11-18 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling + for RVA relocs. + (coff_mcore_relocate_section): Initialise addend to 0. + Special case processing of RVA reloc. + +1999-11-17 Richard Henderson <rth@cygnus.com> + + * elf-bfd.h (struct elf_backend_data): Reorder collect and + type_change_ok; add sign_extend_vma. + * elf32-mips.c (elf_backend_sign_extend_vma): Define. + * elfcode.h (elf_swap_symbol_in): Mind be->sign_extend_vma. + (elf_swap_shdr_in, elf_swap_phdr_in): Likewise. + * elfxx-target.h (elf_backend_sign_extend_vma): Default. + (elfNN_bed): Follow struture changes. + +1999-11-09 Ian Lance Taylor <ian@zembu.com> + + * libbfd.c (bfd_read): Check result of read against desired result + using !=, not <. + (_bfd_generic_get_section_contents): Set bfd_error if the seek is + invalid compared to the section size. + + * ieee.c (ieee_slurp_debug): Get the length of the debug + information right if there is no data part. + +Tue Nov 2 01:44:41 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (som_fixup_formats): Improve handling of R_AUX_UNWIND, + R_LINETAB, R_LINETAB_ESC, and R_COMMENT. + +1999-10-28 Ian Lance Taylor <ian@zembu.com> + + * elflink.h (elf_bfd_final_link): Make last_local signed. + +1999-10-27 Ian Lance Taylor <ian@zembu.com> + + * stabs.c (_bfd_link_section_stabs): Make sure .stabstr section + starts with a zero. + +Sat Oct 23 17:36:12 1999 Andrew Cagney <cagney@b1.cygnus.com> + + * archures.c: Add definitions bfd_mach_d10v, bfd_mach_d10v_ts2 and + bfd_mach_d10v_ts3. + * cpu-d10v.c (d10v_ts3_info, d10v_ts2_info): Add. + * bfd-in2.h: Regenerate. + +1999-10-15 Andrew Haley <aph@cygnus.com> + + * dwarf1.c (parse_die): Fail to parse a die if its length is zero. + +Sun Oct 17 17:19:00 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (bfd_hppa_insn2fmt): Change to return an int. + +1999-10-08 Ian Lance Taylor <ian@zembu.com> + + * elflink.h (elf_merge_symbol): When overriding a weak symbol with + a defined symbol in a shared library, clear the DEF_DYNAMIC flag + too. + +Fri Oct 8 13:03:45 1999 Geoffrey Keating <geoffk@cygnus.com> + + * elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL + relocs also need the GP value. + (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs + properly. Handle sign-extension for R_MIPS_64 correctly. Correct + the GP value for R_MIPS_LITERAL relocs too. Handle + R_MIPS_64 relocs properly on big-endian MIPS. + (mips_elf_sign_extend): Behave properly with 'long long'. + (mips_elf_highest): Correct typo. + +Mon Oct 4 17:49:45 1999 Nick Clifton <nickc@cygnus.com> + + * cpu-m32r.c (arch_info_struct): New static global. + (bfd_m32r_arch): Refer to it. + * elf32-m32r.c (m32r_elf_object_p): Recognize E_M32RX_ARCH. + (m32r_elf_print_private_bfd_data): Ditto. + (m32r_elf_final_write_processing): Handle bfd_mach_m32rx. + * archures.c (bfd_mach_m32rx): Define it. + * bfd-in2.h: Rebuild. + +1999-09-28 Fred Fish <fnf@cygnus.com> + + * targets.c (cisco_core_vec): Replaced with two new vecs ... + (cisco_core_big_vec): Add new bigendian vec. + (cisco_core_little_vec): Add new little endian vec. + + * cisco-core.c (CRASH_INFO): Fixed offset replaced with ... + (crash_info_locs): Add array of possible offsets. + (MASK_ADDR): Mask to apply to crash info offset. + (crashinfo_external): Add textbase, database, bssbase and + turn into a typedef. + (cisco_core_file_validate): Renamed from cisco_core_file_p. + Many small changes to account for additional hardware versions. + Pick a reasonable size for ".reg" section. Add a ".crash" + section to allow access to crashinfo_external struct. + (cisco_core_file_p): New version of this function that + iterates over crash_info_locs, calling cisco_core_file_validate. + (cisco_core_vec): Old big endian only vec replaced with ... + (cisco_core_big_vec): Add big endian version. + (cisco_core_little_vec): Add little endian version. + + * configure.in (cisco_core_vec): Split to two new vectors ... + (cisco_core_big_vec): New target vector. + (cisco_core_little_vec): New target vector. + * configure: Regenerate. + * config.bfd (targ): For m68*-*-aout* targ, change cisco_core_vec + to cisco_core_big_vec in targ_selvecs. + +1999-09-28 Geoffrey Keating <geoffk@cygnus.com> + + * elf32-mips.c (mips_elf_relocate_hi16): Unused, delete. + (mips_elf_relocate_got_local): Unused, delete. + (mips_elf_relocate_global_got): Unused, delete. + +1999-09-24 Fred Fish <fnf@cygnus.com> + + * elf.c (bfd_section_from_phdr): Add typename variable. Use p_type + to initialize it to something meaningful. Then use it to generate + more useful segment names. + +Sun Sep 19 12:16:47 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (NO_PCREL_MODES): Define if the system does not define + R_SHORT_PCREL_MODE. + (hppa_som_gen_reloc_type): Handle both short and long pcrel branches. + (som_write_fixups): Eliminate redundant pcrel mode relocs. Handle + R_LONG_PCREL_MODE and R_SHORT_PCREL_MODE + * libhppa.h (dis_assemble_22): New function. + (bfd_hppa_insn2fmt): Handle long branch. + + * libhppa.h (bfd_hppa_insn2fmt): Decode and handle formats found + in PA2.0. + +1999-09-17 Alan Modra <alan@spri.levels.unisa.edu.au> + + * coff-i386.c (coff_i386_reloc_type_lookup): Support BFD_RELOC_16, + BFD_RELOC_16_PCREL, BFD_RELOC_8, BFD_RELOC_8_PCREL relocs. + (reloc_howto_type howto_table): Tidy comments and whitespace. + +1999-09-17 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Undo + previous delta. Set sec->gc_mark instead. + +Thu Sep 16 11:21:13 1999 Catherine Moore <clm@cygnus.com> + + * elf32-m68k.c (elf_cpu32_plt0_entry): Use a1 instead of a0. + (elf_cpu32_plt_entry): Likewise. + +Thu Sep 16 10:48:17 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_write_processing): Turn on TRAPNIL. + + * elf-hppa.h (elf_hppa_final_link): If unable to find __gp in the + symbol table, then just compute a suitable value (but do not + create a __gp symbol). + + * elf-hppa.h (elf_hppa_relocate_section): Allow undefined + symbols when building shared libraries. + (elf_hppa_final_link_relocate): Correct handling of PCREL + relocations against undefined symbols. + +1999-09-16 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Mark + interworking sections as linker created so that they will not + be removed by garbage collection. + +Wed Sep 15 02:31:57 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link): Revamp __gp handling. + (elf_hppa_final_link_relocate): Consistently create an absolute + address, then subtract out the value of __gp. + +1999-09-14 Michael Meissner <meissner@cygnus.com> + + * configure.in (Canonicalization of target names): Remove adding + ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 + generates $ac_config_sub with a ${CONFIG_SHELL} already. + * configure: Regenerate. + +1999-09-14 Nick Clifton <nickc@cygnus.com> + + * elf32-m32r.c (ELF_MAXPAGESIZE): Change to 0x1 (at request of + Mitsubishi). + +Mon Sep 13 20:01:47 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_record_segment_addrs): New function. + (elf_hppa_final_link): Initialize text_segment_base and + data_segment_base. + (elf_hppa_final_link_relocate): Handle SEGREL relocations. + + * elf-hppa.h (elf_hppa_final_link): Remove unused variables. + (elf_hppa_final_link_relocate): Likewise. + (elf_hppa_relocate_insn): Likewise. + (elf_hppa_relocate_section): Initialize HOWTO. + +1999-09-13 Donn Terry <donn@interix.com> + + * coffcode.h (styp_to_sec_flags): Further refinement of COMDAT + handling to support both GNU and MS objects. + + * coffcode.h (coff_write_object_contents): Don't check reloc_count + when determining whether to set F_RELFLG. + +1999-09-13 Philip Blundell <pb@nexus.co.uk> + + * elf32-arm.h (elf32_arm_final_link_relocate): Don't range-check + PC24 relocs if the target is an undefined weak symbol. + (arm_add_to_rel): Fix compiler warning. + (elf32_arm_plt0_entry): Correct comments. + +1999-09-13 Alan Modra <alan@spri.levels.unisa.edu.au> + + * elfcode.h (write_relocs): Check for the_bfd NULL when handling + an absolute symbol in REL relocs. + +Sun Sep 12 23:47:58 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle SECREL32. + Stub SEGREL32. Return an error for any relocation not handled. + +1999-09-12 Ian Lance Taylor <ian@zembu.com> + + * cofflink.c (coff_link_add_symbols): Look for special MSVC string + constant symbols, and avoid multiple definition errors on them. + +1999-09-12 Donn Terry <donn@interix.com> + + * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most + significant bit is set. + +1999-09-11 Ian Lance Taylor <ian@zembu.com> + + * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + + * elfcode.h (write_relocs): Handle an absolute symbol in REL + relocs as we do for RELA relocs. + +1999-09-11 Donn Terry <donn@interix.com> + + * libpei.h (_bfd_pei_final_link_postscript): Declare. + (coff_final_link_postscript): Define. + * peigen.c (_bfd_pei_swap_aouthdr_out): Don't set value for data + directory entries here. + (_bfd_pei_final_link_postscript): New function. + + * peigen.c (_bfd_pei_swap_scnhdr_out): Remove code which sets + section flags based on the section name. + + * peicode.h (coff_swap_scnhdr_in): If COFF_IMAGE_WITH_PE, the + get the overflow of the s_nlnno field from the s_nreloc field. + * peigen.c (_bfd_pei_swap_scnhdr_out): If doing a final link, swap + the s_nlnno overflow of the .text section into the s_nreloc + field. + + * peigen.c (add_data_entry): Declare. + (pei_swap_aouthdr_out): Get image size right. Set linker version + more intuitively. + (pei_swap_scnhdr_out): Test for UNINIT section, not .bss. + (pe_print_idata): Code cleanup, print more info, get rid of (now) + extraneous ImageBase. + (pe_print_edata): Likewise. + (pe_print_pdata): Likewise. Print exception entries. + (pe_print_reloc): Likewise. Print MIPS_JMPADDR. + (tbl): Make const, add "UNKNOWN". + (_bfd_pe_print_private_bfd_data_common): Print timestamp. + (_bfd_pe_bfd_copy_private_bfd_data_common): Don't copy deleted + section data directory. + (_bfd_pe_bfd_copy_private_section_data): Copy pe_flags. + + * libpei.h (_bfd_pe_bfd_get_symbol_info): Declare. + * peigen.c (_bfd_pe_bfd_get_symbol_info): New function. + * peicode.h (coff_get_symbol_info): Define. + + * config.bfd (i[3456]86-*-interix*): Set targ_cflags to + -DSTRICT_PE_FORMAT. + * coffcode.h (styp_to_sec_flags): Check STRICT_PE_FORMAT rather + than __INTERIX. + (coff_classify_symbol): Re-revert 1999-08-08 patch if + STRICT_PE_FORMAT. + + * libpei.h: New file, broken out of peicode.h. + * peigen.c: New file, broken out of peicode.h. + * peicode.h: A bunch of code moved out to libpei.h and peigen.c. + * configure.in: Add peigen.lo to list of files required for each + PE target. + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Add peigen.lo. + (BFD32_BACKENDS_CFILES): Add peigen.c. + (SOURCE_HFILES): Add libpei.h. + * configure, Makefile.in: Rebuild. + + * peicode.h (coff_swap_scnhdr_in): Don't check for a special + section name of _BSS; check IMAGE_SCN_CNT_UNINITIALIZED_DATA + instead. Don't clear the s_paddr field for an uninitialized data + section. + + * coffcode.h (coff_mkobject_hook): Set timestamp field in + coff_data_type to f_timdat. + * peicode.h (pe_mkobject_hook): Likewise. + + * peicode.h (coff_swap_filehdr_in): Check the NT executable magic + number if COFF_IMAGE_WITH_PE. + + * coffcode.h (coff_mkobject_hook): If COFF_WITH_PE, set HAS_DEBUG + to the reverse of IMAGE_FILE_DEBUG_STRIPPED. + (coff_write_object_contents): Set IMAGE_FILE_DEBUG_STRIPPED if + there is no SEC_DEBUGGING section. + * peicode.h (pe_mkobject_hook): Set HAS_DEBUG to the reverse of + IMAGE_FILE_DEBUG_STRIPPED. + + * pe-i386.c (COFF_LONG_FILENAMES): Define. + (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + * pei-i386.c (COFF_LONG_FILENAMES): Define. + (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + + * coffswap.h (IMAGE_BASE): Don't define. + * pei-arm.c (IMAGE_BASE): Don't define. + * pei-i386.c (IMAGE_BASE): Don't define. + * pei-mcore.c (IMAGE_BASE): Don't define. + * pei-ppc.c (IMAGE_BASE): Don't define. + + * cofflink.c (_bfd_coff_link_input_bfd): When writing out a + symbol, switch on the class when determining whether to modify the + value. For PE, don't modify the value of a C_FCN symbol not named + .bf. + + * libbfd-in.h (_bfd_abort): Declare. + (abort): Define. + * bfd.c (_bfd_abort): New function. + * libbfd.h: Rebuild. + + * coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE + special handling. + + * cofflink.c (_bfd_coff_link_input_bfd): If a symbol is stripped, + don't write out the associated line numbers. + + * cofflink.c (_bfd_coff_write_global_sym): Handle section symbol + aux entries. + + * cofflink.c (coff_link_add_symbols): Don't warn about symbol type + changes when the base type is unknown. + + * coffgen.c (coff_print_symbol): Fix printing of aux record for + function symbols. + + * syms.c (BSF_DEBUGGING_RELOC): Define. + * coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING + for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such + symbols named .bf. + * coffgen.c (fixup_symbol_value): Relocate a symbol which has + BSF_DEBUGGING_RELOC set. + * bfd-in2.h: Rebuild. + +1999-09-10 Ian Lance Taylor <ian@zembu.com> + + * ecoff.c (bfd_debug_section): Update initialization for new + comdat_info field. + (_bfd_ecoff_styp_to_sec_flags): Add section parameter. + * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Update declaration. + +1999-09-10 H.J. Lu <hjl@gnu.org> + + * coff-alpha.c (alpha_ecoff_backend_data): Initialize the new + _bfd_filnmlen field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + +Fri Sep 10 00:35:14 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link_relocate): Create .opd entries + for FPTR relocs involving local symbols. + + * elf-hppa.h (elf_hppa_final_link_relocate): Get the right + value for the stub address in a call through a stub. + Install the value for a local symbol directly into the DLT + instead of generating a reloc. Correctly handle FPTR64 relocs. + + * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function. + (elf_hppa_remark_useless_dynamic_symbols): Similarly. + (elf_hppa_final_link): Call them. + +1999-09-10 Ian Lance Taylor <ian@zembu.com> + + * elflink.h (elf_fix_symbol_flags): Move weakdef handling here... + (elf_adjust_dynamic_symbol): ...from here. + +Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_howto_table); There is no DIR64WR, DIR64DR + relocation, remove them. SECREL64->LTOFF16WF. + (elf_hppa_final_link_relocate): Handle LTOFF* relocations. Handle + DIR* relocations. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and + GPREL* relocations. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos. + Handle LTOFF_TP* relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle PCREL* relocs. + Consistently deal with addends. Handle DLTIND14F and DLTREL14F. + (elf_hppa_relocate_insn): Handle PCREL* relocs. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle LT_OFF_FPTR*, + DIR32, DIR64 and FPTR64 relocations. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link): Set the value of __gp to the + address of the .PARISC.global section. + (elf_hppa_relocate_section): Lookup and pass the PA64 hash + table entry elf_hppa_final_link_relocate. Do not give a warning + for a reloc against an external symbol if it has a PA64 hash + table entry. + (elf_hppa_final_link_relocate): Significantly rework. Handle + DLTIND relocations. Compute the final value of the relocation + before passing the value of elf_hppa_relocate_insn. + (elf_hppa_relocate_insn): Revamp to handle just bit tiwiddling + relocation support. Handle DLTIND relocation requests just like + DLTREL relocation requests. Simplify branch handling. + +1999-09-08 Ulrich Drepper <drepper@cygnus.com> + + * elf-hppa.h (elf_hppa_relocate_section): Catch problems with + non-allocated section as done in i386 version. + (elf_hppa_final_link_relocate): Uncomment R_PARISC_14F in switch + statement since this is no know relocation. + +Tue Sep 7 17:25:12 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14F + relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14WR and + DLTREL14WD relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14R and + DLTREL21L relocs. Pass the output bfd to elf_hppa_relocate_insn. + Pass the relocate type rather than the insn format to + elf_hppa_relocate_insn. + (elf_hppa_relocate_insn): Make switch dependent on relocation type + rather than the opcode. Handle DLTREL21L and DLTREL14R relocs. + +1999-09-07 Ian Lance Taylor <ian@zembu.com> + + * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field. + (bfd_coff_filnmlen): Define. + (bfd_coff_std_swap_table): Initialize new field. + * coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather + than FILNMLEN. + (coff_write_symbols): Likewise. + (coff_get_normalized_symtab): Likewise. + * coff-sh.c (bfd_coff_small_swap_table): Initialize new field. + * libcoff.h: Rebuild. + +1999-09-06 Donn Terry <donn@interix.com> + + * coffcode.h (sort_by_secaddr): New static function if + COFF_IMAGE_WITH_PE. + (coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort + sections by VMA when assigning target_index values. Always set + virt_size. + + * libcoff-in.h (struct pei_section_tdata): Add pe_flags field. + * coffcode.h (coff_set_alignment_hook) [COFF_WITH_PE version]: Set + pe_flags field. + * libcoff.h: Rebuild. + + * coffcode.h (coff_set_custom_section_alignment): Add const to + declaration to match definition. + (coff_write_object_contents): Don't set F_AR32W(R)? if + COFF_WITH_PE. + + * coff-i386.c (in_reloc_p): Add declaration. + (i386coff_vec): Simplify initialization of + application_section_flags. + + * coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE + version. Move COFF_WITH_PE specific code to new version. + (stype_to_sec_flags): Likewise. Add section parameter. + * coffgen.c (make_a_section_from_file): Set target_index before + calling styp_to_sec_flags. Pass section to styp_to_sec_flags. + * libcoff.h: Rebuild. + + * syms.c (stt): Add some PE/PEI section names. + (bfd_decode_symclass): Return 'w', not 'U', for a weak undefined + symbol. + (bfd_symbol_info): Check for 'w'. + + * section.c (struct bfd_comdat_info): Define. + (asection): Add comdat field. + (STD_SECTION): Initialize comdat field. + (bfd_make_section_anyway): Likewise. + * bfd-in2.h: Rebuild. + +1999-09-06 Andreas Schwab <schwab@suse.de> + + * elflink.h (elf_link_add_object_symbols): Copy NON_GOT_REF flag + to version symbols. + +1999-09-06 Nick Clifton <nickc@cygnus.com> + + * elflink.h (elf_gc_record_vtentry): Use bfd_zmalloc and + bfd_realloc instead of calloc and realloc. + +1999-09-04 Steve Chamberlain <sac@pobox.com> + + * cpu-pj.c: New file. + * elf32-pj.c: New file. + * config.bfd (pj*): New cpu. + (pj-*-*, pjl-*-*): New targets. + * configure.in (bfd_elf32_pj_vec): New target vector. + (bfd_elf32_pjl_vec): New target vector. + * archures.c (bfd_arch_pj): Define. + * elf.c (prep_headers): Handle bfd_arch_pj. + * reloc.c: Define BFD_RELOC_PJ_* relocations. + * targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add + to target vector list. + * Makefile.am: Rebuild dependencies. + (ALL_MACHINES): Add cpu-pj.lo. + (ALL_MACHINES_CFILES): Add cpu-pj.c. + (BFD32_BACKENDS): Add elf32-pj.lo. + (BFD32_BACKENDS_CFILES): Add elf32-pj.c. + * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. + +1999-09-04 Ian Lance Taylor <ian@zembu.com> + + * elf-bfd.h (ELF_LINK_NON_GOT_REF): Define. + * elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK + and NON_GOT_REF from weak defined symbol to real symbol. + * elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF. + (elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't + create a COPY reloc. + * elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF. + (elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set, + don't create a COPY reloc. + +1999-09-03 Ian Lance Taylor <ian@zembu.com> + + * elflink.h (elf_bfd_final_link): When counting relocations, don't + count those in sections we are not including in the link. + +Thu Sep 2 17:41:20 1999 Jeffrey A Law (law@cygnus.com) + + * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK + field in hpux11 shared libraries. + +1999-09-02 Nick Clifton <nickc@cygnus.com> + + * elflink.h (elf_gc_record_vtentry): Fix memory leak. + +Wed Sep 1 13:34:29 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_add_symbol_hook): New function. + (elf_hppa_final_link, elf_hppa_relocate_section): Likewise. + (elf_hppa_final_link_relocate, elf_hppa_relocate_insn): Likewise. + +1999-08-31 Alexandre Petit-Bianco <apbianco@cygnus.com> + + * elflink.h (record_link_assignment): When possible, keep the + original type of the symbol. + +Mon Aug 30 15:26:48 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Allow both + R_PARISC_DIR32 and R_PARISC_DIR64 regardless of how the + tools were configured. + * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Declare. + +1999-08-26 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local + GOT entries for GOT16 relocations; they're not required. + +1999-08-24 Nick Clifton <nickc@cygnus.com> + + From a patch submitted by Roland McGrath <roland@baalperazim.frob.com> + + * config.bfd (arm-*-netbsd*): New target. + * configure.in (armnetbsd_vec): New target vector. + * configure: Regenerate + * targets.c (bfd_target_vector): Add &armnetbsd_vec. + + * Makefile.am (BFD32_BACKENDS): Add armnetbsd.lo. + (ALL_MACHINES_CFILES): Add armnetbsd.c. + (armnetbsd.lo): New rule with deps. + * Makefile.in: Regenerate. + + * armnetbsd.c: New file: Definitions specific to arm-netbsd + target. + +Tue Aug 24 00:25:58 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (som_slurp_symbol_table): Fix typo in comment. + +Fri Aug 20 17:01:23 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_fake_sections): Compute section indices + here instead of using elf_section_data... + +1999-08-19 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c (mcore_emit_base_file_entry): New function: Emit + relocations into the base file. + (coff_mcore_relocate_section): Call mcore_emit_base_file_entry if + we are building a base file. + +1999-08-19 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.h (arm_add_to_rel): New function. Add a value to + a REL style reloc. + (elf32_arm_relocate_section): Use arm_add_to_rel to increment + REL relocs when performing a partial relocation. + +1999-08-18 Donn Terry <donn@interix.com> + + * cofflink.c: Move definitions of N_TMASK, et. al., out of + _bfd_coff_link_input_bfd into top level. + + * coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE. + (RTYPE2HOWTO): Return NULL if reloc type is out of range. + (coff_i386_rtype_to_howto): Likewise. + * coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG. + Completely ignore symbols which are all zero. + (dummy_reloc16_estimate): Add return 0. + * cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope + variable copy to name_copy to avoid shadowing outer scope + variable. + * libcoff-in.h (coff_data_type): Change raw_syment_count field + from unsigned int to unsigned long. Add timestamp field. + * libcoff.h: Rebuild. + +1999-08-17 H.J. Lu <hjl@gnu.org> + + * elf32-hppa.c (bfd_elf32_bfd_is_local_label_name): Fix typo in + macro definition. + +1999-08-17 Ian Lance Taylor <ian@zembu.com> + + * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC + for special section symbols. + * elflink.h (elf_merge_symbol): If we have no old BFD, check + BSF_DYNAMIC on the section symbol to see whether the old BFD is + dynamic. + +1999-08-15 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunate + coincidence of variable names between old and new code. + +1999-08-12 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.h (elf32_arm_to_thumb_stub): Make 'offset' parameter + into a bfd_vma and 'addend' parameter a 'bfd_signed_vma'. + (elf32_thumb_to_arm_stub): Make 'offset' parameter into a bfd_vma + and 'addend' parameter a 'bfd_signed_vma'. + (elf32_arm_final_link_relocate): Do not involve stubs in + R_ARM_THM_PC22 relocs relative to section symbols, they are long + jumps, not function calls. + +1999-08-11 Robin Farine <advanc@dial.eunet.ch> + + * elf32-arm.h (elf32_arm_final_link_relocate): Check for overflow + in R_ARM_PC24 relocs. + +Tue Aug 10 12:48:09 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_fake_sections): New function. + * elf32-hppa.c (elf_backend_fake_sections): Define. + + * elf-hppa.h (elf_hppa_final_write_processing): Update for + recent changes to the arch_info structure. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle + R_HPPA_SEGBASE and R_HPPA_SEGREL32. + * cpu-hppa.c (bfd_hppa20w_arch): New entry in architecture info + list. + +Tue Aug 10 00:34:29 1999 Mark P. Mitchell <mark@codesourcery.com> + Ralf Baechle <ralf@uni-koblenz.de> + + * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always + output DT_MIPS_GOTSYM. + (_bfd_mips_elf_finish_dynamic_sections): Use the same value as + DT_MIPS_SYMTABNO if there are no global GOT symbols. + +Tue Aug 10 00:21:08 1999 Mark P. Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Change + prototype. Handle local symbols. Add commentary. + (mips_elf_calculate_relocation): Adjust accordingly. + (_bfd_mips_elf_check_relocs): Handle local symbols in R_MIPS_32 + relocations. + + * elflink.h (elf_bfd_final_link): Tweak last change. + +1999-08-09 Mark Mitchell <mark@codesourcery.com> + + * elflink.h (elf_link_size_reloc_section): Use the counts in the + elf-section data to allocate just the right amount of relocation + space. Don't allocate the hash space twice. + (elf_bfd_final_link): Calculate the amount of space to allocate in + each relocation section. + +Mon Aug 9 17:37:30 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case 32): When in + 64bit mode, generate a section relative relocation for a 32bit + wide relocation. + (elf_hppa_is_local_label_name): New function. + * elf32-hppa.c (elf_hppa_is_local_label_name): Deleted. To be + shared between 32bit and 64bit port. + +1999-08-09 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (elf_mips_howto_table): Fix src_mask for + R_MIPS_GOT16 and R_MIPS_CALL16. + (mips_elf_got16_entry): Use mips_elf_high to calculate the value + to use when looking for a preexisting GOT entry. + +1999-08-09 Jakub Jelinek <jj@ultra.linux.cz> + + * elf64-sparc.c (sparc64_elf_relocate_section): Back out part of + the Sep. 4th, 1998 change. glibc 2.0.x dynamic linker had bug, + not binutils. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +1999-08-09 Geoff Keating <geoffk@cygnus.com> + + * elflink.h (elf_link_output_extsym): Don't output a weak + reference to an undefined symbol just because it was defined weak + in a shared object. + +1999-08-09 Eli Zaretskii <eliz@is.elta.co.il> + + * coffgen.c (coff_find_nearest_line): When looking for file, use + last best match rather than first. If address is beyond last line + number record, don't return the last line as the correct value. + +1999-08-08 Ian Lance Taylor <ian@zembu.com> + + * section.c (SEC_SMALL_DATA): Rename from SEC_SHORT. + * bfd-in2.h: Rebuild. + +1999-08-08 Mark Elbrecht <snowball3@bigfoot.com> + + * libcoff-in.h (struct coff_section_alignment_entry): Define. + * coffcode.h (coff_set_custom_section_alignment): New static + function. + (coff_section_alignment_table): New static array. + (coff_new_section_hook): Use coff_set_customer_section_alignment. + * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + * libcoff.h: Rebuild. + +1999-08-08 Ian Lance Taylor <ian@zembu.com> + + * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to + MKDEP. + * Makefile.in: Rebuild. + +1999-08-08 Mumit Khan <khan@xraylith.wisc.edu> + + * section.c (SEC_SHARED): Define. + * coffcode.h (sec_to_styp_flags): Handle SEC_SHARED. + (styp_to_sec_flags): Likewise. + * peicode.h (coff_swap_scnhdr_out): Likewise. + * bfd-in2.h: Rebuild. + +1999-08-08 Ian Lance Taylor <ian@zembu.com> + + * coffcode.h (coff_classify_symbol): Comment out part of + 1999-08-05 change which breaks cygwin DLLs. + + * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*. + * aclocal.m4, configure: Rebuild. + +1999-08-06 Ian Lance Taylor <ian@zembu.com> + + * section.c (global_syms): Only initialize union field if + __STDC__. + +1999-08-04 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index by + the size of a GOT entry here. + (mips_elf_calculate_relocation): Don't create a local GOT entry + for the symbol in a GOT16 relocation; just for it's high-order bit + (_bfd_mips_elf_relocate_section): Fix thinko. + +1999-08-05 Ian Lance Taylor <ian@zembu.com> + + Based on patches from Donn Terry <donn@interix.com>: + * coffcode.h (enum coff_symbol_classification): Define. + (bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to + _bfd_coff_classify_symbol. Change return type. + (bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global. + (coff_slurp_symbol_table): Use coff_classify_symbol. + (coff_classify_symbol): New static function. + (coff_sym_is_global): Never define. + (bfd_coff_std_swap_table): Initialize with coff_classify_symbol. + * cofflink.c (coff_link_check_ar_symbols): Use + bfd_coff_classify_symbol rather than bfd_coff_sym_is_global. + (coff_link_add_symbols): Likewise. + (_bfd_coff_link_input_bfd): Likewise. + * coff-sh.c (bfd_coff_small_swap_table): Initialize with + coff_classify_symbol. + * libcoff.h: Rebuild. + +Wed Aug 4 18:08:07 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (R_HPPA_LTPSEL, R_HPPA_RTPSEL): New field selectors + (e_ltpsel, e_rtpsel): Similarly. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle 21bit e_ltpsel + and 14bit ertpsel. Handle 64bit psel. + +1999-08-04 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16 + handling for REL relocations. And only left-shift R_MIPS26 + relocation addends where necessary. + +1999-08-03 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ... + (mips_elf_next_lo16_relocation): Don't compute the addend here. + Just return the relocation found. + (mips_elf_relocate_section): Pull the LO16 addend out of the + section itself when using REL relocations. + + * elf32-mips.c (mips_elf_calculate_relocation): Restore + _DYNAMIC_LINK handling and handling of undefined symbols in shared + libraries. + +1999-08-03 Ian Lance Taylor <ian@zembu.com> + + * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation + value of a symbol in a SEC_DEBUGGING section. Warn when doing a + relocation against a symbol in an input section with no output + section. From Daniel Jacobowitz <drow@false.org>. + + * coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used. + + * acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to + look for generated file correctly. + * aclocal.m4, configure: Rebuild. + +1999-08-02 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26 + and R_MIPS16_26 relocations correctly when relocating. + (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16 + and R_MIPS_CALL_LO16 are for global symbols. + +1999-08-02 Jakub Jelinek <jj@ultra.linux.cz> + + * elflink.h (elf_bfd_final_link): Copy the whole isym, not just + some fields. + * elf64-sparc.c (sparc64_elf_output_arch_syms): Declare used + variables and initialize them. + +1999-08-01 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case where + there are no global symbols requiring GOT entries. + (_bfd_mips_elf_size_dynamic_sections): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + + * elf32-mips.c (mips_elf_calculate_relocation): Undefined weak + symbols are considered to have the value zero. + (_bfd_mips_elf_relocate_section): Don't try to perform a + relocation for an undefined symbol. + (_bfd_mips_elf_check_relocs): Allocate locate GOT space for local + GOT16 relocations. + +1999-07-30 Jakub Jelinek <jj@ultra.linux.cz> + + * elf64-sparc.c (sparc64_elf_build_plt): Cosmetic change - ABI + wants ba,a,pt %xcc instead of %icc. + Emit correct .PLT0-(.PLTN+4) initial value into the pointer slots + of large PLT entries. + (sparc64_elf_plt_ptr_offset): Fix calculation. + (sparc64_elf_finish_dynamic_symbol): Negative value of R_SPARC_JMP_SLOT + addend should be relative to load address, not .plt section start. + (sparc64_elf_size_info): Sparc64 uses 32bit .hash entries. + +1999-07-30 Jakub Jelinek <jj@ultra.linux.cz> + + * elf-bfd.h (struct elf_backend_data): Add + print_symbol_all and output_arch_syms backend methods. + * elfxx-target.h: Likewise. + * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create, + sparc64_elf_add_symbol_hook, sparc64_elf_output_arch_syms, + sparc64_elf_get_symbol_type, sparc64_elf_symbol_processing): New + functions. + (sparc64_elf_size_dynamic_sections): Leave space for STT_REGISTER + symbols in .dynsym, add their names into .dynstr. Put those symbols + into dynlocal. + (sparc64_elf_finish_dynamic_sections): Fix up DT_SPARC_REGISTER + pointers to STT_REGISTER symbols in dynsym section. + (sparc64_elf_print_symbol_all): New function. + * elf.c (bfd_elf_print_symbol): Allow special backend symbol + printing using the print_symbol_all hook. + +1999-07-30 Catherine Moore <clm@cygnus.com> + + * elf32-arm.h (elf32_arm_check_relocs): Use r_offset for + R_ARM_GNU_VTENTRY. + +1999-07-29 Richard Henderson <rth@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms if + dynamic_sections_created. + +1999-07-29 Richard Henderson <rth@cygnus.com> + + * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ... + (mips_rtype_to_howto): ... new function. + (_bfd_mips_elf_relocate_section): Use it. + +1999-07-28 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo. + +1999-07-27 Nick Clifton <nickc@cygnus.com> + + Patch generated by Bernd Schmidt. <bernds@cygnus.co.uk> + + * coff-arm.c (coff_arm_is_local_label_name): Change to strip + out only symbols that start with LOCAL_LABEL_PREFIX followed by 'L'. + +1999-07-23 Donn Terry <donn@interix.com> + + * libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags + field, and define COFF_LINK_HASH_PE_SECTION_SYMBOL. + * cofflink.c (coff_link_add_symbols): If PE, handle section + symbols specially. + * libcoff.h: Rebuild. + + * config.bfd (i[3456]86-*-interix*): New target. + +1999-07-21 Mark Elbrecht <snowball3@bigfoot.com> + + * coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and + COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with + .gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD. + * coff-go32.c: (COFF_LONG_SECTION_NAMES): Define. + (COFF_SUPPORT_GNU_LINKONCE): Define. + * coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define. + (COFF_SUPPORT_GNU_LINKONCE): Define. + +1999-07-21 Ian Lance Taylor <ian@zembu.com> + + From Mark Elbrecht: + * makefile.dos: Remove; obsolete. + * configure.bat: Remove; obsolete. + +1999-07-21 H.J. Lu <hjl@gnu.org> + + * config.bfd (i[3456]86-*-vxworks*): Add targ_underscore=yes. + +1999-07-21 Philippe De Muyter <phdm@macqel.be> + + * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error + message and fail if a symbol index is out of range. + +1999-07-21 Ian Lance Taylor <ian@zembu.com> + + * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value + when looking at a R_MIPS_GOT16 relocation. + +1999-07-20 Nick Clifton <nickc@cygnus.com> + + * coff-m88k.c: Use CREATE_BIG_COFF_TARGET_VEC. + +Mon Jul 19 14:03:44 1999 Mark P. Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP + removed in previous change. + (_bfd_mips_elf_relocate_section): Adjust GP relative relocations + in relocateable output. + +1999-07-19 Ian Lance Taylor <ian@zembu.com> + + * coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target + structure. + + * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD + if they appear to be specially created by the linker. + +1999-07-19 Nick Clifton <nickc@cygnus.com> + + * targets.c (alternative_target): New field in bfd_target + structure. + (bfd_search_for_target): New function: Find a target that + satisifies a search function. + * bfd-in2.h: Regenerate. + + * elfxx-target.h: Initialise the alternative_target field of + the bfd_target structures to point to the other target (if + defined). + * nlm-target.h: Initialise the alternative_target field of + the bfd_target structures to point to the other target (if + defined). + + * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro. + (CREATE_LITTLE_COFF_TARGET_VEC): New macro. + + * aix386-core.c: Initialise new field of bfd_target structure. + * aout-adobe.c: Initialise new field of bfd_target structure. + * aout-arm.c: Initialise new field of bfd_target structure. + * aout-target.h: Initialise new field of bfd_target structure. + * aout-tic30.c: Initialise new field of bfd_target structure. + * binary.c: Initialise new field of bfd_target structure. + * bout.c: Initialise new field of bfd_target structure. + * cisco-core.c: Initialise new field of bfd_target structure. + * coff-a29k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-alpha.c: Initialise new field of bfd_target structure. + * coff-apollo.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-arm.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. + * coff-h8300.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-h8500.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-i386.c: Initialise new field of bfd_target structure. + * coff-i860.c: Initialise new field of bfd_target structure. + * coff-i960.c: Use CREATE_LITTLE_COFF_TARGET_VEC. + * coff-m68k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-mcore.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. + * coff-mips.c: Initialise new field of bfd_target structure. + * coff-ppc.c: Initialise new field of bfd_target structure. + * coff-rs6000.c: Initialise new field of bfd_target structure. + * coff-sh.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. + * coff-sparc.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-tic30.c: Initialise new field of bfd_target structure. + * coff-tic80.c: Use CREATE_LITTLE_COFF_TARGET_VEC. + * coff-w65.c: Use CREATE_LITTLE_COFF_TARGET_VEC. + * coff-we32k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-z8k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * hppabsd-core.c: Initialise new field of bfd_target structure. + * hpux-core.c: Initialise new field of bfd_target structure. + * i386msdos.c: Initialise new field of bfd_target structure. + * i386os9k.c: Initialise new field of bfd_target structure. + * ieee.c: Initialise new field of bfd_target structure. + * ihex.c: Initialise new field of bfd_target structure. + * irix-core.c: Initialise new field of bfd_target structure. + * mipsbsd.c: Initialise new field of bfd_target structure. + * netbsd-core.c: Initialise new field of bfd_target structure. + * oasys.c: Initialise new field of bfd_target structure. + * osf-core.c: Initialise new field of bfd_target structure. + * ppcboot.c: Initialise new field of bfd_target structure. + * ptrace-core.c: Initialise new field of bfd_target structure. + * sco5-core.c: Initialise new field of bfd_target structure. + * som.c: Initialise new field of bfd_target structure. + * srec.c: Initialise new field of bfd_target structure. + * tekhex.c: Initialise new field of bfd_target structure. + * trad-core.c: Initialise new field of bfd_target structure. + * versados.c: Initialise new field of bfd_target structure. + * vms.c: Initialise new field of bfd_target structure. + +1999-07-19 Andreas Schwab <schwab@suse.de> + + * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash + and rel_hdr. + +Sat Jul 17 02:28:28 1999 Mark P. Mitchell <mark@codesourcery.com> + + * elflink.h (elf_link_adjust_relocs): New function. + (elf_bfd_final_link): Use it. + (elf_link_input_bfd): Deal with the fact that there can be + two relocation sections for a single section. + (elf_reloc_link_order): Likewise. + + * elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for + a relocateable object. + (_bfd_mips_elf_relocate_section): Handle relocateable links. + +1999-07-16 Jakub Jelinek <jj@ultra.linux.cz> + + * elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID. + (sparc64_elf_get_reloc_upper_bound, + sparc64_elf_get_dynamic_reloc_upper_bound, + sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table, + sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs): + New functions. + (sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use + ELF64_R_TYPE_ID/DATA where appropriate. + +1999-07-16 Jakub Jelinek <jj@ultra.linux.cz> + + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove + DT_SPARC_PLTFMT. + +1999-07-16 Ian Lance Taylor <ian@zembu.com> + + * elf32-mips.c (mips_elf_local_relocation_p): New static + function. + (mips_elf_next_lo16_addend): Call bfd_set_error on failure. + (mips_elf_calculate_relocation): Use mips_elf_local_relocation_p. + Always set *require_jalxp. + (mips_elf_stub_section_p): Mark abfd parameter as unused. + (_bfd_mips_elf_relocate_section): Only look for LO16 following + GOT16 if the GOT16 is against a local symbol. Don't return false + for an undefined symbol. If there is an overflow, assert that we + have a name. + +1999-07-16 Andreas Schwab <schwab@suse.de> + + * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused + variables `link' and `elfsec'. + (elf_bfd_final_link): Remove unused variable `os'. + +Thu Jul 15 17:55:31 1999 Mark P. Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require + a PT_PHDR program headers. + (_bfd_mips_elf_final_link): Don't assume there are going to be + section symbols when we're not building a shared object. + (_bfd_mips_elf_check_relocs): Make sure we have a GOT when + we need one. + +1999-07-15 J.T. Conklin <jtc@redback.com> + + * config.bfd (i[3456]86-*-vxworks*): New target. + +1999-07-15 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_stub_section_p): New function. + (mips_elf_calculate_relocation): Handle MIPS16 stub functions. + (mips_elf_relocate_section): Adjust calling sequence for + mips_elf_calculate_relocation and mips_elf_perform_relocation. + (mips_elf_perform_relocation): Turn `jal' into `jalx' where + required. + +1999-07-15 Ian Lance Taylor <ian@zembu.com> + + * configure.in: Bump version number to 2.9.5. + * configure: Rebuild. + +Thu Jul 15 02:56:15 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle + 64bit format. + (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type + to derive final type instead of hardwiring a selection. + +1999-07-14 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of + things relocated by R_MIPS16_GPREL. + (mips_elf_perform_relocation): Likewise. + +Wed Jul 14 15:23:19 1999 Jim Wilson <wilson@cygnus.com> + + * elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss. + +1999-07-14 Richard Henderson <rth@cygnus.com> + + * elf32-mips.c (struct mips_got_info): Add global_gotno. + (_bfd_mips_elf_size_dynamic_sections): Set it. + (_bfd_mips_elf_final_link): Re-sort; verify the got did not grow. + (mips_elf_sort_hash_table): Set max_non_got_dynindex based off + new argument max_local. + +1999-07-14 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit + subwords when handling an R_MIPS16_26 relocation. + (mips_elf_perform_relocation): Don't be paranoid abour right-shift + semantics. + + * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and + dst_mask to match reality. + (_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL. + (mips_elf_obtain_contents): Use bfd_get. + (mips_elf_perform_relocation): Handle R_MIPS16_GPREL. + (mips_elf_relocate_section): Likewise. + +1999-07-13 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26. + (mips_elf_relocate_section): Adjust calling sequence for + mips_elf_perform_relocation. + (mips_elf_perform_relocation): Take additional argument. Handle + R_MIPS16_26. Use bfd_put for convenience. + +1999-07-13 Richard Henderson <rth@cygnus.com> + + * elf.c (assign_file_positions_for_segments): Thinko last change. + Always overwrite p_flags. + +1999-07-13 Richard Henderson <rth@cygnus.com> + + * elf-bfd.h (struct elf_backend_data): Add want_dynbss. + * elflink.c (_bfd_elf_create_dynamic_sections): Only create + .dynbss and .rel[a].bss if want_dynbss. + * elfxx-target.h (elf_backend_want_dynbss): Provide default. + +1999-07-13 Richard Henderson <rth@cygnus.com> + + * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags. + +1999-07-13 Richard Henderson <rth@cygnus.com> + + * elf-bfd.h (struct elf_link_local_dynamic_entry): New. + (struct elf_link_hash_table): Add dynlocal. + (_bfd_elf_link_lookup_local_dynindx): Prototype. + (_bfd_elf_link_adjust_dynindx): Delete. + (_bfd_elf_link_renumber_dynsyms): Prototype. + (_bfd_elf,link_record_local_dynamic_symbol): Prototype. + * elfcode.h (elf_link_record_local_dynamic_symbol): New alias. + * elflink.c (_bfd_elf_link_adjust_dynindx): Delete. + (_bfd_elf_link_lookup_local_dynindx): New function. + (elf_link_renumber_hash_table_dynsyms): New function. + (_bfd_elf_link_renumber_dynsyms): New function. + * elflink.h (elf_link_record_local_dynamic_symbol): New function. + (struct elf_assign_sym_version_info): Delete removed_dynamic. + (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output + instead of elf_link_remove_section_and_adjust_dynindices. + Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms. + (elf_link_assign_sym_version): Remove removed_dynamic code. + (elf_link_renumber_dynsyms): Delete. + (elf_bfd_final_link): Install section and local symbols into .dynsym. + + * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete. + (elf_m68k_size_dynamic_sections): Don't set section dynindicies. + (elf_m68k_finish_dynamic_sections): Don't write section dynsyms. + * elf32-mips.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-sparc.c: Similarly. + * elf64-alpha.c: Similarly. + * elf64-sparc.c: Similarly. + +1999-07-13 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_calculate_relocation): Do not complain + when _gp_disp is undefined. Do not check R_MIPS_LO16 for overflow + when the relocation is against _gp_disp. + +1999-07-12 Mark Mitchell <mark@codesourcery.com> + + * dwarf2.c (read_attribute): Support DW_FORM_ref8. + * elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs + to possibly_dynamic_relocs. Adjust usage throughout code. + (elf_mips_howto_table): Handle R_MIPS_64 correctly. + (elf_mips_ctor64_howto): Likewise. + (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32. + Adjust indentation. + (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode. + (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32. + Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries. + * elf64-mips.c (elf_backend_may_use_rel_p): Define. + +1999-07-12 Ian Lance Taylor <ian@zembu.com> + + * Makefile.am: Rebuild dependencies. + * Makefile.in: Rebuild. + + * bfd-in.h: Remove tests of COFF_IMAGE_WITH_PE. + * bfd-in2.h: Rebuild. + + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Use EMPTY_HOWTO as appropriate. Fill in + structure initializations. Add casts. + * reloc.c (EMPTY_HOWTO): Define. + * bfd-in2.h: Rebuild. + * coff-h8300.c (h8300_reloc16_extra_cases): Remove useless + comparisons against 0. + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Change + previous_ibfd_e_flags to unsigned long. + * vms.h (struct vms_private_data_struct): Change section_count to + unsigned. + * vms-gsd.c (_bfd_vms_slurp_gsd): Change psect_idx to unsigned. + (_bfd_vms_write_gsd): Change symnum to unsigned. + * vms-hdr.c (_bfd_vms_write_hdr): Change symnum to unsigned. + * vms-tir.c (etir_sta): Change psect to unsigned. + (alloc_section): Change idx to unsigned. + (tir_sta, tir_ctl): Change psect to unsigned. + (_bfd_vms_write_tir): Change len and before to bfd_size_type. + * vms.c (priv_section_count): Change to unsigned. + +1999-07-12 Andreas Schwab <schwab@suse.de> + + * elf32-m68k.c: Add some ATTRIBUTE_UNUSED. + * m68klinux.c: Likewise. + +1999-07-12 Ian Lance Taylor <ian@zembu.com> + + * Many files: Changes to avoid gcc warnings: Remove unused local + variables. Add default case to enum switches. + * coff-arm.c (bfd_arm_allocate_interworking_sections): Only + compile if not COFF_IMAGE_WITH_PE. + (record_arm_to_thumb_glue, record_thumb_to_arm_glue): Likewise. + (bfd_arm_get_bfd_for_interworking): Likewise. + (bfd_arm_process_before_allocation): Likewise. + * epoc-pei-arm.c: Don't rename bfd_arm functions. + * pei-arm.c: Likewise. + * elf32-mips.c (mips_elf_link_hash_table_create): Don't declare. + (MIPS_ELF_ADD_DYNAMIC_ENTRY): Correct last change. + (mips_elf_got16_entry): Put parens around & in body of ==. + (mips_elf_calculate_relocation): Correct test for empty string. + * vms-gsd.c: Use _bfd_error_handler rather than fprintf to + stderr. + * vms-misc.c (_bfd_vms_length_hash_symbol): Correct sprintf + format. + +1999-07-11 Ian Lance Taylor <ian@zembu.com> + + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Fill in structure initializations. Add variable + initializations. Add casts. + * dwarf1.c (parse_line_table): Change eachLine to unsigned long. + (dwarf1_unit_find_nearest_line): Change i to unsigned long. + + * elf.c (bfd_elf_hash): Change parameter from unsigned char * to + char *. + * elf-bfd.h (bfd_elf_hash): Update declaration. + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts + when calling bfd_elf_hash. + +1999-07-11 Mark Mitchell <mark@codesourcery.com> + + * libbfd.c (bfd_put_8): Make it of type `void'. + * bfd-in2.h: Regenerated. + * elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize + for 32-bit hosts. + (_bfd_mips_elf_final_link): Likewise. + + * elflink.h (elf_link_read_relocs_from_section): Be type-correct. + +Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * config.bfd (hppa*-*-linux-gnu*): New target + +1999-07-07 Mark Mitchell <mark@codesourcery.com> + + * elf-bfd.h (_bfd_mips_elf_section_from_shdr): Constify. + (_bfd_mips_elf_create_dynamic_sections): New function. + (_bfd_mips_elf_add_symbol_hook): Likewise. + (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + (_bfd_mips_elf_gc_mark_hook): Likewise. + (_bfd_mips_elf_gc_sweep_hook): Likewise. + (_bfd_mips_elf_always_size_sections): Likewise. + (_bfd_mips_elf_size_dynamic_sections): Likewise. + (_bfd_mips_elf_check_relocs): Likewise. + (_bfd_mips_elf_link_hash_table_create): Likewise. + (_bfd_mips_elf_print_private_data): Likewise. + (_bfd_mips_elf_link_output_symbol_hook): Likewise. + (_bfd_mips_elf_final_link): Likewise. + (_bfd_mips_elf_additional_program_headers): Likewise. + (_bfd_mips_elf_modify_segment_map): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf32_object_p): Move contents into + _bfd_mips_elf_object_p. + (mips_elf_additional_program_headers): Rename to + _bfd_mips_elf_additional_program_headers. + (mips_elf_modify_segment_map): Rename to + _bfd_mips_elf_modify_segment_map. + (elf_mips_abi_name): Change prototype. + (mips_elf32_section_from_shdr): Merge into + _bfd_mips_elf_section_from_shdr. + (mips_elf32_section_processing): Merge into + _bfd_mips_elf_section_processing. + (mips_elf_final_link): Rename to _bfd_mips_elf_final_link. Invoke + the right back-end ELF linker. + (mips_elf_relocate_section): Rename to + _bfd_mips_elf_relocate_section. Clean up. Adjust for 64-bit code. + (mips_elf_link_output_symbol_hook): Rename to + _bfd_mips_elf_link_output_symbol_hook. + (mips_elf_create_dynamic_section): Rename to + _bfd_mips_elf_create_dynamic_section. + (mips_elf_check_relocs): Rename to _bfd_mips_elf_check_relocs. + Adjust for 64-bit code. Use mips_elf_got_section. + (mips_elf_adjust_dynamic_symbol): Rename to + _bfd_mips_elf_adjust_dynamic_symbol. Use + mips_elf_allocate_dynamic_relocations. + (mips_elf_finish_dynamic_symbol): Rename to + _bfd_mips_elf_finish_dynamic_symbol. Use mips_elf_got_section. + Adjust for 64-bit code. + (mips_elf_finish_dynamic_sections): Rename to + _bfd_mips_elf_finish_dynamic_sections. Adjust for 64-bit code. + (mips_elf_always_size_sections): Rename to + _bfd_mips_elf_always_size_sections. + (mips_elf_add_symbol_hook): Rename to + _bfd_mips_elf_add_symbol_hook. + (mips_elf_next_lo16_addend): Constify. + (mips_elf_calculate_relocation): Likewise. + (mips_elf_obtain_contents): Likewise. + (mips_elf_perform_relocation): Likewise. + (mips_elf_create_dynamic_relocation): Likewise. + (mips_elf_allocate_dynamic_relocations): New function. + (MIPS_ELF_REL_DYN_SECTION_NAME): New macro. + (MIPS_ELF_REL_SIZE): Likewise. + (MIPS_ELF_DYN_SIZE): Likewise. + (MIPS_ELF_GOT_SIZE): Likewise. + (MIPS_ELF_SYM_SIZE): Likewise. + (MIPS_ELF_LOG_FILE_ALIGN): Likewise. + (MIPS_ELF_GET_WORD): Likewise. + (MIPS_ELF_PUT_WORD): Likewise. + (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. + (STUB_LW): Conditionalize for 64-bit value. + (elf_mips_howto_table): Add R_MIPS_HIGHER and R_MIPS_HIGHEST + entries. + (_bfd_mips_elf_merge_private_bfd_data): Merge e_ident[EI_CLASS]. + Check it for inconsistency. + (_bfd_mips_elf_print_private_bfd_data): Print ABI=64 for 64-bit + ABI. + (_bfd_mips_elf_fake_sections): Remove duplicate handling of + .msym. + (mips_elf_global_got_index): Use MIPS_ELF_GOT_SIZE. + (mips_elf_got_offset_from_index): Use misp_elf_got_section. + (mips_elf_create_local_got_entry): Use MIPS_ELF_GOT_SIZE. + (mips_elf_local_got_index): Likewise. + (mips_elf_got_page): Likewise. + (mips_elf_got_info): Likewise. + (mips_elf_create_dynamic_relocation): Handle 32-bit/64-bit split. + (ELF_DYNAMIC_INTERPRETER): Handle 64-bit code. + (mips_elf_create_dynamic_sections): Use MIPS_ELF_LOG_FILE_ALIGN, + instead of constant `2'. + (mips_elf_create_got_section): Tidy. Use MIPS_ELF_GOT_SIZE. + (mips_elf_create_msym_section): Use MIPS_ELF_LOG_FILE_ALIGN. + (mips_elf_size_dynamic_sections): Use + MIPS_ELF_REL_DYN_SECTION_NAME, MIPS_ELF_GOT_SIZE, + MIPS_ELF_ADD_DYNAMIC_ENTRY. Remove #if 0'd code. + Adjust all releveant entries in elf backend table. + * elf64-mips.c (mips_elf64_section_from_shdr): Remove. + (mips_elf64_section_processing): Likewise. + Adjust elf backend entries to use _bfd_mips_elf variants now + publicly available. + + * elflink.h (elf_link_create_dynamic_sections): Handle non-standard + hash-entry sizes. + (size_dynamic_sections): Likewise. + (elf_link_output_extsym): Likewise. + * elf.c: (elf_fake_sections): Likewise. + * libbfd.c (bfd_get): New macro. + (bfd_put): Likewise. + * bfd-in2.h: Regenerated. + +1999-07-07 Mark Mitchell <mark@codesourcery.com> + + * elf-bfd.h (elf_size_info): Add hash_entry_size, + int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out, + wap_reloca_in, and swap_reloca_out. + * elflink.h (elf_link_read_relocs_from_section): Adjust to handle + multiple internal relocations per external relocation. + (link_read_relocs): Likewise. + (elf_bfd_final_link): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + * elfcode.h (elf_swap_dyn_out): Adjust type to match + elf_swap_dyn_in. + (size_info): Add entries for new fields. + * elf64-mips.c (mips_elf64_swap_reloc_out): Enable. + (mips_elf64_be_swap_reloc_in): New function. + (mips_elf64_be_swap_reloc_out): Likewise. + (mips_elf64_be_swap_reloca_in): Likewise. + (mips_elf64_be_swap_reloca_out): Likewise. + (mips_elf64_size_info): Add entries for new fields. + +1999-07-07 Ian Lance Taylor <ian@zembu.com> + + * elflink.h (elf_bfd_final_link): Assert that section reloc_count + field equals the new rel_count field. + (elf_link_input_bfd): When doing a relocateable link, use the new + rel_count field rather than the reloc_count field. + (elf_reloc_link_order): Likewise. + (elf_finish_pointer_linker_section): Likewise. + + Based on patch from H.J. Lu <hjl@gnu.org>: + * elflink.h (elf_merge_symbol): Permit a non-weak definition in a + shared library to override a weak definition in a regular object. + +Tue Jul 6 10:23:39 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h: Revert July 2, 1999 patch. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): T mode selectors + need to generate DLTIND relocations, not DLTREL relocations. + +1999-07-05 Nick Clifton <nickc@cygnus.com> + + * coffcode.h (coff_set_arch_mach_hook): Recognise arm 5 + architectures. + (coff_set_flags): Recognise arm 5 architectures. + + * cpu-arm.c: Add support for strongarm and arm9 cpus. + Add support for armv5 architecture. + + * archures.c: Add bfd_mach_arm_5 and bfd_mach_arm_5T. + + * reloc.c: Add new, assembler only, ARM reloc: + BFD_RELOC_ARM_ADRL_IMMEDIATE. + + * bfd-in2.h: Regenerate. + +1999-07-02 Mark Mitchell <mark@codesourcery.com> + + * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter. + (_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter. + * elf.c (_bfd_elf_find_nearest_line): Pass it. + * elf32-arm.h (elf32_arm_find_nearest_line): Likewise. + * elf32-mips.c (ABI_64_P): New macro. + (IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P. + (_bfd_mips_elf_find_nearest_line): Adjust call to + _bfd_dwarf2_find_nearest_line. + * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. + * libbfd.h: Regenerated. + +1999-07-02 Ian Lance Taylor <ian@zembu.com> + + * config.bfd: Add * at the end of i[3456]86-*-unixware. + +Fri Jul 2 12:21:10 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (HPPA_R_ARG_RELOC): Delete. + (HPPA_R_CONSTANT, HPPA_R_ADDEND): Likewise. + +1999-07-01 Mark Mitchell <mark@codesourcery.com> + + * elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2 + fields. + (_bfd_elf_init_reloc_shdr): New function. + * elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than + bfd_alloc followed by memset. + (_bfd_elf_init_reloc_shdr): New function, split out from ... + (elf_fake_sections): Here. + (assign_section_numbers): Assign section numbers for the second + relocation section, if required. + * elflink.h (elf_link_output_relocs): New function. + (elf_link_size_reloc_section): Likewise. + (elf_bfd_final_link): Use elf_link_size_reloc_section. + (elf_link_input_bfd): Use elf_link_output_relocs. + + * elf32-mips.c (_bfd_mips_elf_fake_sections): Use + _bfd_elf_init_reloc_shdr to initialize rel_hdr2. + +Thu Jul 1 13:58:48 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle R_PCREL_CALL + with 22bit format. + +1999-06-28 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_got_info): Move declaration before + prototypes. Change global_gotsym to be a pointer to a hash entry, + rather than a number index. + (mips_elf_link_hash_entry): Move declaration before prototypes. + (mips_elf_irix6_finish_dynamic_symbol): New function. + (mips_elf_sign_extend): Likewise. + (mips_elf_high): Likewise. + (mips_elf_higher): Likewise. + (mips_elf_highest): Likewise. + (mips_elf_global_got_index): Likewise. + (mips_elf_local_got_index): Likewise. + (mips_elf_got_offset_from_index): Likeiwse. + (mips_elf_record_global_got_symbol): Likewise. + (mips_elf_got_page): Likewise. + (mips_elf_next_lo16_addend): Likewise. + (mips_elf_calculate_relocation): Likewise. + (mips_elf_obtain_contents): Likewise. + (mips_elf_perform_relocation): Likewise. + (mips_elf_assign_gp): Likewise. + (mips_elf_sort_hash_table_f): Likewise. + (mips_elf_sort_hash_table): Likewise. + (mips_elf_got_section): Likewise. + (mips_elf_got_info): Likewise. + (mips_elf_create_local_got_entry): Likewise. + (mips_elf_got16_entry): Likewise. + (mips_elf_create_dynamic_relocation): Likewise. + (elf_mips_howto_table): Add description of R_MIPS_SCN_DISP. + (mips_elf_final_gp): Use mips_elf_assign_gp. + (_bfd_mips_elf_symbol_processing): Don't move SHN_COMMON symbols + into SHN_SCOMMON automatically on IRIX6. + (mips_elf_add_symbol_hook): Likewise. + (mips_elf_relocate_section): Rewrite, using + mips_elf_calculate_relocation and mips_elf_perform_relocation. + (mips_elf_create_dynamic_section): Use MIPS_ELF_STUB_SECTION_NAME. + Don't deal with .rld_map on IRIX6. + (mips_elf_create_got_section): Adjust use of global_gotsym. Set + section flags appropriately for .got. + (mips_elf_check_relocs): Handle IRIX6 relocations making use of + the got. Call mips_elf_record_global_got_symbol and allocate + local got space appropriately. + (mips_elf_size_dynamic_sections): Use bfd_byte *, not unsigned + char *. Rework calculation of GOT size. Sort dynamic symbol + table entries so entries that do not require GOT entries appear at + the beginning. Don't use DT_MIPS_HIPAGENO on IRIX6. Remove dead + code dealing with DT_INIT and DT_FINI. Remove fiddling with + global_gotsym. + (mips_elf_finish_dynamic_symbol): Adjust creation of global GOT + entries. + (mips_elf_finish_dynamic_symbol): Use + mips_elf_irix6_finish_dynamic_symbol. + (mips_elf_finish_dynamic_sections): Correct off-by-one error + setting DT_MIPS_UNREFEXTNO. Adjust setting of DT_MIPS_GOTSYM for + change to global_gotsym. Set DT_MIPS_OPTIONS on IRIX6. + +1999-06-30 Ian Lance Taylor <ian@zembu.com> + + * elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a + relocateable link. From Ralf Baechle <ralf@uni-koblenz.de>. + +1999-06-04 Philip Blundell <philb@gnu.org> + + * elf32-arm.h (elf_backend_got_header_size): Define. + (elf_backend_plt_header_size): Likewise. + +1999-06-28 Jim Pick <jim@jimpick.com> + + * elf32-arm.h (elf32_arm_relocate_section): Mind no_undefined + +Tue Jun 29 02:25:03 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.c (elf_hppa_howto_table): Use bfd_elf_generic_reloc as + relocation function. + * elf32-hppa.c (hppa_elf_reloc): Kill unused/unwanted function. + +1999-06-27 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro. + (MIPS_ELF_OPTIONS_SECTION_NAME): Likewise. + (MIPS_ELF_STUB_SECTION_NAME): Likewise. + (_bfd_mips_elf_section_from_shdr): Use them. + (_bfd_mips_elf_fake_sections): Likewise. Add .srdata to the list + of GP-relative sections. + (_bfd_mips_elf_set_section_contents): Use them. + (_bfd_mips_elf_section_processing): Share code between .sdata and + .lit4/.lit8 sections. Set appropriate flags for .srdata. + (mips_elf_additional_program_headers): Add handling for + PT_MIPS_OPTIONS segment on IRIX6. + (mips_elf_modify_segment_map): Likeiwse. + (mips_elf_final_link): Set EF_MIPS_CPIC when required by the ABI. + Include the options sections on IRIX6. Don't look for GP-relative + sections by name; use SHF_MIPS_GPREL instead. + (ELF_DYNAMIC_INTERPRETER): Adjust to use /usr/lib32/libc.so.1 for + the N32 ABI. + (mips_elf_create_dynamic_sections): Don't muck about with section + alignments and such on IRIX6. + (mips_elf_adjust_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. + (mips_elf_size_dynamic_sections): Likewise. Adjust to handle the + fact that ELF_DYNAMIC_INTERPRETER is no longer a constant. Use + bfd_zalloc rather than bfd_alloc and memset. + (mips_elf_finish_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. + Don't assert the existence of .rld_map on IRIX6. + (mips_elf_finish_dynamic_sections): Use MIPS_ELF_STUB_SECTION_NAME. + + * elf32-mips.c (mips_elf_adjust_dynindx): Remove. + (mips_elf_size_dynamic_sections): Use _bfd_elf_link_adjust_dynindx + instead. + +1999-06-26 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (mips_elf_swap_msym_in): New function. + (mips_elf_swap_msym_out): New function. + (mips_elf_create_msym_section): Likewise. + (MIPS_ELF_MSYM_SECTION_NAME): New macro. + (_bfd_mips_elf_final_write_processing): Set sh_link for .msym. + (_bfd_mips_elf_section_from_shdr): Reject an SHT_MIPS_MSYM + section not named .msym. + (_bfd_mips_elf_fake_sections): Use MIPS_ELF_MSYM_SECTION_NAME, not + .msym directly. Set appropriate attributes for the .msym + section. + (mips_elf_link_hash_entry): Add min_dyn_reloc_index field. + (mips_elf_link_hash_newfunc): Clear it. + (mips_elf_create_dynamic_sections): Create the .msym section + on IRIX6. + (mips_elf_size_dynamic_sections): Allocate space for the + .msym section. Add a DT_MIPS_MSYM entry. + (mips_elf_finish_dynamic_symbol): Write out a .msym entry for + the symbol. + (mips_elf_finish_dynamic_sections): Assign a value for + DT_MIPS_MSYM. Add .msym entries for the section symbols as well. + + * elf32-mips.c (irix_compat_t): New enumeration. + (ABI_N32_P): New macro. + (IRIX_COMPAT): Likewise. + (SGI_COMPAT): Implement in terms of IRIX_COMPAT. + (mips_elf_relocate_section): Fix typo. + +1999-06-26 Mumit Khan <khan@xraylith.wisc.edu> + + * peicode.h (coff_swap_scnhdr_out): Mark non readonly BFD sections + as writable PE sections. + +1999-06-26 David Mosberger <davidm@hpl.hp.com> + + * dwarf2.c (struct arange): New type. + (struct comp_unit): Replace LOW and HIGH by member ARANGE. + (arange_add): New function. + (decode_line_info): Keep track of address ranges that a compilation + unit covers. + (comp_unit_contains_address): Return true if address is contained + in _any_ of the address ranges associated with a compilation unit. + (_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line + on the first comp_unit that contains the address. + +1999-06-26 David Mosberger <davidm@hpl.hp.com> + + * dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer. + (decode_line_info): Add variable STASH and initialize it to point + to the per-bfd dwarf2_debug info. Remove static variable + dwarf_line_buffer and use stash->dwarf_line_buffer in its place. + +1999-06-26 Ian Lance Taylor <ian@zembu.com> + + * elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic + shared library to have an undefined symbol. + + From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>: + * elf32-ppc.c (ppc_elf_relocate_section): Fix last patch. + +Thu Jun 24 20:59:11 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.c (elf_hppa_final_write_processing): New function. + * elf32-hppa.c: Remove everything related to symbol extension + sections & records. Use the common elf_hppa_final_write_processing. + +1999-06-22 Mark Mitchell <mark@codesourcery.com> + + * elflink.h (size_dynamic_sections): Use user-specified init/fini + functions instead of _init/_fini if requested. + +1999-06-23 Ian Lance Taylor <ian@zembu.com> + + * elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link + field. + +1999-06-22 Ian Lance Taylor <ian@zembu.com> + + From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>: + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set unused dynindx + field to 0, not -1. + (ppc_elf_finish_dynamic_sections): Check for positive section + dynindx field, rather than comparing against -1. + (ppc_elf_relocate_section): Only return false if undefined_symbol + or reloc_overflow fail, not always upon encountering an error. + +1999-06-22 Mark Mitchell <mark@codesourcery.com> + + * elflink.h (link_read_relocs): Explicitly cast external_relocs to + bfd_byte * before performing pointer arithmetic. + +Tue Jun 22 13:06:25 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h: New file. Common stuff for elf32 and elf64 PA + support. + * elf32-hppa.c: Include elf-hppa.h. + (ARCH_SIZE): Define. + (elf_hppa_reloc_type_lookup): Delete. Found in the common code + now. + (elf32_hppa_info_to_howto): Similarly. + (elf_hppa_howto_table): Similarly. + (elf_hppa_reloc_type_lookup): Similarly. + (hppa_elf_gen_reloc_type): Similarly. + * elf32-hppa.h (ELF_HOWTO_TALBE, N_PARISC_RELOCS): Delete. + +1999-06-22 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_final_link_relocate): Catch overflow + handling R_V850_22_PCREL relocation. + +1999-06-21 Ian Lance Taylor <ian@zembu.com> + + * coff-arm.c (arm_emit_base_file_entry): Explicitly declare return + type. + +Sun Jun 20 14:13:57 1999 Richard Henderson <rth@cygnus.com> + + * section.c (_bfd_strip_section_from_output): Ignore sections + DISCARDed by the link script. + +1999-06-19 Ian Lance Taylor <ian@zembu.com> + + * elflink.h (elf_link_remove_section_and_adjust_dynindices): + Remove unused local variable spp. + + * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't crash if + the entry symbol is not set. + +Fri Jun 18 04:24:57 1999 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't adjust + GPDISP or LITUSE in a relocatable link. + +Thu Jun 17 21:24:43 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + * dwarf1.c (alloc_dwarf1_unit): Allocate using bfd_zalloc. + * (alloc_dwarf1_func): Likewise. + +Wed Jun 16 03:09:57 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h: Fix various formatting errors. + (assemble_3); Rewrite using CATENATE. + (assemble_17): Fix various bugs. + +1999-06-16 Nick Clifton <nickc@cygnus.com> + + * elf32-mcore.c (R_MCORE_RAW): Fix definition. + +1999-06-15 Richard Henderson <rth@cygnus.com> + + * section.c (SEC_SHORT): Define. + * bfd-in2.h: Rebuild. + +1999-06-13 Mark Mitchell <mark@codesourcery.com> + + * elflink.h (elf_link_remove_section_and_adjust_dynindices): + Remove abfd parameter. Use _bfd_strip_section_from_output. + (bfd_elf_size_dynamic_sections): Adjust callers accordingly. + + * elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function. + * elflink.c (_bfd_elf_link_adjust_dynindx): Define it. + * elflink.h (elf_link_remove_section_and_adjust_dynindices): New + function. + (bfd_elf_size_dynamic_sections): Use it. + +1999-06-13 Alan Modra <alan@spri.levels.unisa.edu.au> + + * elf32-i386.c (elf_howto_table): Change R_386_PC8 from + complain_overflow_bitfield to complain_overflow_signed. + +1999-06-13 Mark Mitchell <mark@codesourcery.com> + + * elflink.h (elf_link_read_relocs_from_section): New function, + split out from ... + (elf_link_read_relocs): Here. Use it for both relocation + sections. + +1999-06-12 Mark Mitchell <mark@codesourcery.com> + + * elfcode.h (elf_slurp_reloc_table_from_section): Don't assume + asect->reloc_count is valid. + +1999-06-12 Ian Lance Taylor <ian@zembu.com> + + * elf32-mips.c (mips_elf32_section_processing): Permit a + SHT_MIPS_REGINFO section to have a size of 0. + +1999-06-12 David O'Brien <obrien@freebsd.org> + + * config.bfd (alpha*-*-freebsd*): New target. + (i[3456]86-*-freebsd*): Now defaults to ELF. + +1999-06-11 Ian Lance Taylor <ian@zembu.com> + + * reloc.c (_bfd_relocate_contents): Permit bitfield relocations to + wrap if the relocation covers the high bit of an address. + + * dwarf2.c (decode_line_info): Remove unused variable first_time. + +1999-06-10 Jakub Jelinek <jj@ultra.linux.cz> + + * elf64_sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std + instead of R_SPARC_max. + (sparc64_elf_info_to_howto): Likewise. + * elf32_sparc.c (elf32_sparc_relocate_section): Likewise. + (elf32_sparc_info_to_howto): Likewise; handle vtable relocations. + +1999-06-07 Richard Henderson <rth@cygnus.com> + + * section.c (_bfd_strip_section_from_output): Remove output + sections with no initial link_order. + +1999-06-07 Nick Clifton <nickc@cygnus.com> + + * elf32-m88k.c (ELF_MAXPAGESIZE): Define. + +Mon Jun 7 11:49:43 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * Makefile.am (SOURCE_HFILES): Add missing headers. + * Makefile.in: Regenerated. + +1999-06-06 Mark Mitchell <mark@codesourcery.com> + + * elf32-mips.c (_bfd_mips_elf_print_private_data): Recognize + the N32 ABI. + +1999-06-04 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> + + * elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of + range undefweak symbols. + * hash.c: Add missing comma after @xref{} + * linker.c: Likewise. + +1999-06-04 Nick Clifton <nickc@cygnus.com> + + * elfxx-target.h (ELF_MAXPAGESIZE): Produce an error message + if not defined. + * elf32-gen.c (ELF_MAXPAGESIZE): Define. + * elf32-i860.c (ELF_MAXPAGESIZE): Define. + * elf32-i960.c (ELF_MAXPAGESIZE): Define. + * elf64-gen.c (ELF_MAXPAGESIZE): Define. + +1999-06-04 Ian Lance Taylor <ian@zembu.com> + + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Add dwarf1.lo. + (BFD32_BACKENDS_CFILES): Add dwarf1.c. + * Makefile.in: Rebuild. + +1999-06-04 Nick Clifton <nickc@cygnus.com> + + * Makefile.am: Add epoc-arm-pe target. + * Makefile.in: Regenerate. + * pe-arm.c: Only redefine interworking function names if they have + not already been redefined. + * pei-arm.c: Only redefine interworking function names if they have + not already been redefined. + * epoc-pe-arm.c: Redefine interworking function names to avoid a + name space clash. + * epoc-pei-arm.c: Redefine interworking function names to avoid a + name space clash. + +1999-06-03 Nick Clifton <nickc@cygnus.com> + + * elfxx-target.h (ELF_MAXPAGESIZE): Default to 0x1000 not 1. + +Fri Jun 4 10:05:11 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * elf.c (elf_fake_sections): Undo change of 1999-05-10. + +Fri Jun 4 03:10:49 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + * elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of + start / stop for recalculating of r_addend of R_SH_SWITCH*. + +Fri Jun 4 02:53:13 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32 + in other text sections. + +Fri Jun 4 02:29:34 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + * libbfd.c (_bfd_generic_verify_endian_match): New function. + * libbfd-in.h (_bfd_generic_verify_endian_match): Declare. + * libbfd.h: Regenerate. + * coff-sh.c (sh_merge_private_data): Delete. + (coff_bfd_merge_private_bfd_data): Change to + _bfd_generic_verify_endian_match. + (elf32-sh.c): bfd_elf32_bfd_merge_private_bfd_data: Define. + +1999-06-03 Ulrich Drepper <drepper@cygnus.com> + + * elf32-arm.h: Fix typo: change ELF_MAXPAGE_SIZE to ELF_MAXPAGESIZE. + +1999-06-03 Ian Lance Taylor <ian@zembu.com> + + * bfd-in.h (bfd_elf32_arm_allocate_interworking_sections): Correct + prototype. + (bfd_elf32_arm_process_before_allocation): Likewise. + * bfd-in2.h: Rebuild. + +1999-06-03 David Mosberger <davidm@hpl.hp.com> + + * dwarf2.c (struct line_info): Add member END_SEQUENCE to keep + track of end_sequence markers. + (add_line_info): Add END_SEQUENCE arg. + (decode_line_info): Don't try to infer lo_pc and hi_pc from the + debug-line info---it doesn't work right if a compilation unit + consists of multiple discontiguous code-sequences. It would be + worthwhile to optimize for the common case where a compilation + unit results in a contiguous set of code sequences, but this is + quite tricky to get right for arbitrary DWARF2 files. + (lookup_address_in_line_info_table): Don't use the last line entry + for a compilation unit for anything with an address higher than + this line entry. Also, check for end_sequence markers to + correctly handle discontinuities. + (_bfd_dwarf2_find_nearest_line): When checking previously loaded + compilation units, check all compilation units with each->high==0 + just like when reading compilation units. + + * dwarf2.c (decode_line_info): Initialize table->files and + table->last_line to NULL to avoid segfaults due to random + values in these members. + (concat_filename): Check for out-of-range file number before + indexing filename table. Segfaults suck. + + * dwarf2.c (decode_line_info): Don't truncate address to least + significant 32 bits (breaks 64 bit targets). + (lookup_address_in_function_table): Ditto. + (comp_unit_contains_address): Ditto. + +1999-06-02 Mark Mitchell <Mark Mitchell <mark@codesourcery.com>> + + * elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR. + * elf64-mips.c (mips_elf64_howto_table_rel): Likewise. + (mips_elf64_howto_table_rela): Likewise. + + * elfcode.h (elf_slurp_reloc_table_from_section): New function, + split out from ... + (elf_slurp_reloc_table): Here. Use it to handle the case where a + single section has two associated relocation sections. + +1999-06-02 Mark Salter <msalter@cygnus.com> + + * coffcode.h (coff_set_alignment_hook): Set lma from s_vaddr if + COFF_WITH_PE defined. + +1999-06-02 Nick Clifton <nickc@cygnus.com> + + * pe-arm.c: Rename global arm interworking functions to avoid name + collision when all targets BFD is built. + * pei-arm.c: Ditto. + +1999-05-31 Mark Mitchell <mark@codesourcery.com> + + * elf-bfd.h (elf_backend_data): Remove use_rela_p. Add + may_use_rel_p, may_use_rela_p, default_use_rela_p. + (bfd_elf_section_data): Add use_rela_p. + * elf.c (bfd_section_from_shdr): Set use_rela_p appropriately. + (_bfd_elf_new_section_hook): Likewise. + (elf_fake_sections): Use may_use_rela_p, etc., instead of + use_rela_p. + (_bfd_elf_copy_private_section_data): Copy use_rela_p. + * elfcode.h (write_relocs): Determine whether or not use rela + relocs based on the relocation section header. + * elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p + instead of use_rela_p. + * elfxx-target.h (elf_backend_may_use_relp): New macro. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elfNN_bed): Use them. + +Wed Jun 2 12:38:49 1999 Miodrag Vallat <miodrag@multimania.com> + + * hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096. + +Tue Jun 1 17:57:58 1999 Mark P. Mitchell <mitchell@n02.acl.lanl.gov> + + * reloc.c (BFD_RELOC_MIPS_SUB): New relocation. + (BFD_RELOC_MIPS_GOT_PAGE): Likewise. + (BFD_RELOC_MIPS_GOT_OFST): Likewise. + (BFD_RELOC_MIPS_GOT_DISP): Likewise. + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + * elf32-mips.c (mips_info_to_howto_rela): New function. + (USE_REL): Adjust for new conventions. + (MINUS_ONE): New macro. + (elf_mips_howto_table): Add R_MIPS_SUB. + (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST, + and MIPS_GOT_DISP. + (mips_elf_final_write_processing): Set sh_link, not sh_info, for a + .MIPS.content section. + (_bfd_mips_elf_fake_sections): Treat all sections that begin + with .MIPS.content as .MIPS.content sections. Set + SHF_MNIPS_NOSTRIP for such section. + (elf_info_to_howto): Define to mips_info_to_howto_rela. + * elf64-mips.c (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, + MIPS_GOT_OFST, and MIPS_GOT_DISP. + +Wed Jun 2 11:51:12 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized + variable. + + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous + `else'. + +1999-05-30 Philip Blundell <philb@gnu.org> + + * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of + 1993-03-25 (!!). Take into account the bitmasks for the reloc so + the addend does not overflow into the rest of the word. + +1999-05-29 Nick Clifton <nickc@cygnus.com> + + * bfd-in.h: Amend prototype for + bfd_elf32_arm_process_before_allocation . + * bfd-in.h: Regenerate. + + * elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of + elements in a fixed sized array. + (ARM_ELF_ABI_VERSION): Define. + (ARM_ELF_OS_ABI_VERSION): Define. + (R_ARM_THM_ABS5): Fix rightshift and size. + (R_ARM_THM_PC22): Fix size. + (R_ARM_PLT32): Define Howto. + (find_howto): New function: Locate a howto based on a reloc + number. + (elf32_arm_info_to_howto): Use find_howto if necessary. + (elf32_arm_reloc_map): Change type of field bfd_reloc_val to + bfd_reloc_code_real_type. + (elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT + and BFD_RELOC_VTABLE_ENTRY. + (elf32_arm_reloc_type_lookup): Use find_howto if necessary. + + * elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of + elements in a fixed sized array. + (ARM_ELF_ABI_VERSION): Define. + (ARM_ELF_OS_ABI_VERSION): Define. + (R_ARM_THM_ABS5): Fix rightshift and size. + (R_ARM_THM_PC22): Fix size. + (elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto. + (elf32_arm_reloc_map): Change type of field bfd_reloc_val to + bfd_reloc_code_real_type. + + * elf32-arm.h (struct elf32_arm_link_hash_table): Add new field: + no_pipeline_knowledge. + (elf32_arm_link_hash_create): Initialise new field to zero. + (bfd_elf32_arm_process_before_allocation): Add new paraemter: + no_pipeline_knowledge. Use this parameter to initialise the field + in the globals data structure. + (elf32_arm_final_link_relocate): Only add in pipeline offset if + no_pipeline_knowledge is false and the binary is from an old + toolchain. + (elf32_arm_merge_private_data): Generate an error if an attempt is + made to link together big endian and little endian code. + (elf32_arm_post_process_headers): New function: Initialise the + EI_OSABI and EI_ABIVERSION fields of the newly created ELF program + header. + (elf_backend_post_process_headers): Define. + +1999-05-28 Nick Clifton <nickc@cygnus.com> + + * elf-bfd.h (struct elf_backend_data): Add new field: + elf_backend_post_process_headers. + + * elfxx-target.h (elf_backend_post_process_headers): Define to + NULL if not already defined. + (elfNN_bed): Initialise elf_backend_post_process_headers field. + + * elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields + to zero. + (_bfd_elf_compute_section_file_positions): Call + elf_backend_post_process_headers if defined. + +1999-05-28 Ian Lance Taylor <ian@zembu.com> + + * configure.in: Check whether getuid and getgid exist. + * archive.c: Define getuid and getgid as macros if HAVE_GETUID or + HAVE_GETGID are not defined, respectively. + (bfd_write_armap): Don't special case on _WIN32 for getuid and + getgid. + * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*. + * configure, config.in: Rebuild. + +1999-05-28 Martin Dorey <mdorey@madge.com> + + * elf32-i960.c: New file. + * elf.c (prep_headers): Handle bfd_arch_i960. + * targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec. + * config.bfd (i960-*-elf*): New target. + * configure.in (bfd_elf32_i960_vec): New target vector. + * Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo. + (BFD32_BACKENDS_CFILES): Add elf32-i960.c. + * Makefile.in, aclocal.m4, configure: Rebuild. + +1999-05-27 Nick Clifton <nickc@cygnus.com> + + * elfarm-oabi.c (elf32_arm_howto_table): Add entry for + R_ARM_PLT32. + (find_howto): New function: Find entries in the + elf32_arm_howto_table. + (elf32_arm_info_to_howto): Use find_howto if the entry cannot be + computed simply. + (elf32_arm_reloc_type_lookup): Add lookup for + BFD_RELOC_ARM_PLT32. + +1999-05-25 Philip Blundell <pb@nexus.co.uk> + + * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function. + (elf32_arm_link_hash_table_create): Use above function as the + constructor for hash table entries. + (elf32_arm_relocate_section): Avoid crash when there is no output + section. + (elf32_arm_final_link_relocate): New parameter h. + (elf32_arm_relocate_section): Pass symbol hash entry to above + routine. + (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct + comments. + +1999-05-25 Catherine Moore <clm@cygnus.com> + + * coff-arm.c (coff_arm_relocate_section): Don't emit + base file entries for pc-relative values. + +1999-05-25 DJ Delorie <dj@cygnus.com> + + * peicode.h (coff_swap_sym_in): When we create the actual section + to reflect the not-there section C_SECTION symbols refer to, + change the symbol class to C_STAT as the section is now really + there. + +1999-05-24 Philip Blundell <pb@nexus.co.uk> + + * elf32-arm.h (elf32_arm_relocate_section): Undo change of + 1999-03-25. + +Mon May 17 13:35:35 1999 Stan Cox <scox@cygnus.com> + + * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed + F_PIC_INT to F_PIC. + * coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and + F_ARM_3M labels. Changed F_PIC_INT to F_PIC. + +1999-05-16 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c (in_reloc_p): Reinstate. + +1999-05-15 Nick Clifton <nickc@cygnus.com> + + * reloc.c (BFD_RELOC_MCORE_RVA): Define. + * bfd-in2.h: Regenerate. + * coff-mcore.c (in_reloc_p): Remove defintion. + (mcore_coff_howto): Add IMAGE_REL_MCORE_RVA. + (mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to + IMAGE_REL_MCORE_RVA. + (coff_mcore_rtype_to_howto): Add special processing for + IMAGE_REL_MCORE_RVA. + (coff_mcore_relocate_section): Add support for + IMAGE_REL_MCORE_RVA. + * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE. + (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to + R_MCORE_RELATIVE. + (mcore_elf_relocate_section): Delete redundant case labels. + +Fri May 14 10:59:55 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * elf32-arm.h (elf32_arm_relocate_section): Fix operator + precedence between bit-and and comparison. + +Thu May 13 09:45:23 1999 Joel Sherrill (joel@OARcorp.com) + + * config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to + list of target formats (targ_selvecs). + (i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets. + (powerpcle*-*rtems*, sh-*-rtemself*): New targets. + +1999-05-10 DJ Delorie <dj@cygnus.com> + + * ecoff.c (_bfd_ecoff_write_armap): give the symtab element a + reasonable mode until "ar x" is smart enough to skip it (fixes + gcc/libgcc.a builds on mips-ecoff targets + + * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed + to work. Hack to support MS import libraries, which use different + COMDAT types than GNU. + (coff_slurp_symbol_table): C_SECTION symbols are local; they refer + to implied zero-length sections (see peicode below) + * coffgen.c (coff_get_normalized_symtab): Properly read long MS + filename symbols, which use one *or more* auxents. + * coffswap.h (coff_swap_aux_in): ditto + * peicode.h (coff_swap_sym_in): Build the implied zero-length + sections + +Tue May 11 15:51:58 1999 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (v850_elf_howto_table): Make partial_inplace false + for all relocations. + +1999-05-10 Catherine Moore <clm@cygnus.com> + + * bfd-in.h (bfd_arm_allocate_interworking_sections): Static + if COFF_IMAGE_WITH_PE. + (bfd_arm_process_before_allocation): Likewise. + (bfd_arm_get_bfd_for_interworking): Likewise. + * coff-arm.c: Likewise. + * bfd-in2.h: Regenerate. + * configure.in (armpe_little_vec): Remove coff-arm.lo. + (armpe_big_vec): Likewise. + * configure: Rebuild. + +1999-05-10 Nick Clifton <nickc@cygnus.com> + + * elf.c (elf_fake_sections): Check for .rel. as start of rel + section, not just .rel. Same for .rela. + +1999-05-07 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c (coff_mcore_relocate_section): Replace assert about + endianism with an error message. + +Thu May 6 17:09:09 1999 Fred Fish <fnf@be.com> + + * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer + assignment from "unsigned char *" to "char *". + (decode_line_info): Likewise for dwarf_line_buffer assignment. + +1999-05-05 Catherine Moore <clm@cygnus.com> + + * coff-arm.c (coff_arm_relocate_section): Add one to + address of ARM_RVA32 thumb functions. + +1999-05-05 Catherine Moore <clm@cygnus.com> + + * elf32-m68k.c (elf32_m68k_set_private_flags): New. + (elf32_m68k_copy_private_bfd_data): New. + (elf32_m68k_merge_private_bfd_data): New. + (elf32_m68k_print_private_bfd_data): New. + (CPU32_FLAG): Define. + (PLT_CPU32_ENTRY_SIZE): Define. + (elf_cpu32_plt0_entry): Declare. + (elf_cpu32_plt_entry): Declare. + (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries. + (elf_m68k_finish_dynamic_symbol): Likewise. + (elf_m68k_finish_dynamic_sections): Likewise. + (elf_backend_plt_header_size): Remove definition. + (bfd_elf32_bfd_copy_private_bfd_data): Define. + (bfd_elf32_bfd_merge_private_bfd_data): Define. + (bfd_elf32_bfd_set_private_flags): Define. + (bfd_elf32_bfd_print_private_bfd_data): Define. + +Mon May 3 09:24:49 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE + and R_LONG_PCREL_MODE. + +1999-04-29 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c (coff_mcore_relocate_section): Fix typos. + +Fri Apr 28 16:36:19 1999 Stan Cox <scox@cygnus.com> + + * elf32-sh.c (sh_elf_relocate_section): Include relocation addend + in relocation calculation. + +1999-04-26 Tom Tromey <tromey@cygnus.com> + + * aclocal.m4, configure: Updated for new version of libtool. + +1999-04-21 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c: Add support for mcore relocs. + +1999-04-20 Gavin Romig-Koch <gavin@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): Scrap the + incorrect use EF_MIPS_xxBITPTRS. + +1999-04-18 Ian Lance Taylor <ian@zembu.com> + + * elf64-alpha.c (elf64_alpha_relax_section): Remove unused local + variable insn. + + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + +Sat Apr 17 20:55:15 1999 Catherine Moore <clm@cygnus.com> + + * coff-arm.c (coff_arm_rtype_to_howto): Remove ARM26D transform. + (coff_arm_relocate_section): Add ARM26D transform. Only + change to ARM26D for relocateable links. + +1999-04-16 Gavin Romig-Koch <gavin@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): New. + (bfd_elf32_bfd_print_private_bfd_data): New. + +1999-04-15 Doug Evans <devans@casey.cygnus.com> + + * elf32-arm.h (elf32_arm_final_link_relocate): For R_ARM_THM_ABS5, + refetch addend if USE_REL, add many comments regarding current state. + For R_ARM_THM_PC22, refetch addend if USE_REL, simplify. + * elfarm-nabi.c (elf32_arm_howto_table): For R_ARM_THM_ABS5, fix + size and rightshift. For R_ARM_THM_PC22, fix bitsize. + * elfarm-oabi.c (elf32_arm_howto_table): Ditto. + +Wed Apr 14 14:33:08 1999 Richard Henderson <rth@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_read_ecoff_info): Zero `debug'. + * elf64-alpha.c (elf64_alpha_read_ecoff_info): Likewise. + +1999-04-13 David Mosberger <davidm@hpl.hp.com> + + * dwarf2.c (decode_line_info): Don't truncate address to least + significant 32 bits (breaks 64 bit targets). + (lookup_address_in_function_table): Ditto. + (comp_unit_contains_address): Ditto. + +Tue Apr 13 21:27:19 1999 Catherine Moore <clm@cygnus.com> + + * coff-arm.c (arm_emit_base_file_entry): New routine. + (A2T3_OFFSET): Define. + (T2A3_OFFSET): Define. + (coff_arm_relocate_section): Emit base file entries for interworking + stubs. + +1999-04-13 Philip Blundell <philb@gnu.org> + + * elfarm-nabi.c (elf32_arm_howto_table): Add dummy entries for + relocs 17 through 19. + +Sun Apr 11 01:25:17 1999 Richard Henderson <rth@cygnus.com> + + * elfcode.h: Remove fnmatch.h. + * elflink.h (elf_link_assign_sym_version): Call back to ld + instead of calling fnmatch. + + * config.bfd (i?86-*-beoself): Include pe vecs. + +Sun Apr 11 01:14:06 1999 Richard Henderson <rth@cygnus.com> + + * elf32-i386.c (elf_i386_finish_dynamic_sections): Allow .plt + to go missing. + +1999-04-10 Richard Henderson <rth@cygnus.com> + + * elf32-i386.c (elf_i386_relocate_section): Mind no_undefined + when trying to resolve dynamic symbol references. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elflink.h (elf_link_output_extsym): Likewise. + +Sat Apr 10 15:12:09 1999 Richard Henderson <rth@cygnus.com> + + * section.c (_bfd_strip_section_from_output): New function moved from + * elf64-alpha.c (elf64_alpha_strip_section_from_output): ... here. + * elf32-i386.c (elf_i386_size_dynamic_sections): Use it. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + * bfd-in2.h: Update. + +1999-04-09 Ian Lance Taylor <ian@zembu.com> + + * elf64-sparc.c: Fix incorrect calls to bfd_check_overflow. + +1999-04-08 Nick Clifton <nickc@cygnus.com> + + * coff-mcore.c: New File: Support for mcore-pe targets. + * cpu-mcore.c: New File: Support for mcore targets. + * elf32-mcore.c: New File: Support for mcore-elf target. + * pe-mcore.c: New File: Definitions for mcore-pe target. + * pei-mcore.c: New File: Definitions for mcore-pei target. + * Makefile.am: Add support for MCore targets. + * Makefile.in: Regenerate. + * config.bfd: Add support for MCore targets. + * configure.in: Add support for MCore targets. + * configure: Regenerate. + * archures.c: Add support for MCore architecture. + * bfd-in2.h: Regenerate. + * coffcode.h: Add support for mcore-pe targets. + * elf.c: Add support for mcore-elf target. + * reloc.c: Add support for MCore relocs. + * targets.c: Add support for MCore targets. + +1999-04-07 Nick Clifton <nickc@cygnus.com> + + * elfarm-nabi.c (elf32_arm_howto_table): Add entries for + R_ARM_XPC25 and R_ARM_THM_XPC22. + (elf32_arm_reloc_map): Remove redundant entries. + +1999-04-06 Ian Lance Taylor <ian@zembu.com> + + * sysdep.h (LC_MESSAGES): Never define. + +1999-04-06 Chris Torek <torek@bsdi.com> + + * reloc.c (bfd_check_overflow): Add addrsize parameter. Change + all callers. Rewrite completely. + (_bfd_relocate_contents): Rewrite overflow checking. + * bfd-in2.h: Rebuild. + +1999-04-05 Ian Lance Taylor <ian@zembu.com> + + From Gabriel Paubert <paubert@iram.es>: + * elf32-ppc.c (ppc_elf_howto_raw): Set R_PPC_GOT16_LO, + R_PPC_PLT16_LO and R_PPC_SECTOFF_LO to be complain_overflow_dont. + Set R_PPC_PLT16_HA, R_PPC_SECTOFF_HA and R_PPC_EMB_NADDR16_HA to + have a rightshift of 16 and use ppc_elf_addr16_ha_reloc. + * ppcboot.c (ppcboot_vec): Use little endian routines for + headers. + + * elf.c (elfcore_strndup): Only define if it will be used. + * elf32-ppc.c (ppc_elf_relax_section): Remove unused locals irel + and irelend. + (ppc_elf_check_relocs): Remove unused local i. + (ppc_elf_gc_mark_hook): Add default case to switch. + + From Bernd Nitzler <nitzler@kagcpd01.ag01.kodak.COM>: + * srec.c (srec_scan): Accept \r in symbol definitions. + (srec_object_p): Set HAS_SYMS if we saw any symbols. + (symbolsrec_object_p): Likewise. + +1999-04-04 Don Bowman <don@pixsci.com> + + * config.bfd: Add mips*el-*-vxworks* and mips*-*-vxworks*. + +1999-04-04 Ian Lance Taylor <ian@zembu.com> + + * dwarf1.c (parse_line_table): Remove unused locals last_pc and + last_line. + * elf-bfd.h (_bfd_elfcore_section_from_phdr): Declare. + * elf32-i386.c (elf_i386_gc_mark_hook): Add default case to + switch. + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove unused + local i. + * syms.c (_bfd_stab_section_find_nearest_line): Remove unused + local val. + +1999-03-31 Nick Clifton <nickc@cygnus.com> + + * config.bfd: Add support for arm-epoc-pe target. + * configure.in: Add support for arm-epoc-pe target. + * configure: Regenerate. + * targets.c: Add support for arm-epoc-pe target. + * coff-arm.c: Allow header files to override definition of + TARGET_UNDERSCORE and USER_LABEL_PREFIX. + * pe-arm.h: Allow previous header files to override definition of + TARGET_LITTLE_SYM and TARGET_BIG_SYM. + * pei-arm.h: Allow previous header files to override definition of + TARGET_LITTLE_SYM and TARGET_BIG_SYM. + * epoc-pe-arm.c: New file. Support arm-epoc-pe target. + * epoc-pei-arm.c: New file. Support arm-epoc-pei target. + +1999-03-30 Nick Clifton <nickc@cygnus.com> + + * elf.c (elf_map_symbols): Handle the case where section + symbols are generated for content-less sections which are + not mapped to the output file. + + * linker.c: Replace direct references to fields in BFD structure + with accessor macros. + + * elflink.h: Replace direct references to fields in BFD structure + with accessor macros. + +1999-03-25 Philip Blundell <pb@nexus.co.uk> + + * config.bfd: Eliminate redundancy in checks for Linux/ARM. + + * elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into + account when adjusting section symbols during a partial link. + +1999-03-24 Nick Clifton <nickc@cygnus.com> + + * coff-sparc.c (struct coff_reloc_map): Change type of field + 'bfd_reloc_val' to bfd_reloc_code_real_type. + * elf-m10200.c (struct mn10200_reloc_map): Ditto. + * elf-m10300.c (struct mn10300_reloc_map): Ditto. + * elf32-arc.c (struct arc_reloc_map): Ditto. + * elf32-d10v.c (struct d10v_reloc_map): Ditto. + * elf32-d30v.c (struct d30v_reloc_map): Ditto. + * elf32-fr30.c (struct fr30_reloc_map): Ditto. + * elf32-m32r.c (struct m32r_reloc_map): Ditto. + * elf32-sh.c (struct elf_reloc_map): Ditto. + * elf32-sparc.c (struct elf_reloc_map): Ditto. + * elf32-v850.c (struct v850_reloc_map): Ditto. + * elf64-sparc.c (struct elf_reloc_map): Ditto. + * elfarm-nabi.c (struct elf32_arm_reloc_map): Ditto. + * elfarm-oabi.c (struct elf32_arm_reloc_map): Ditto. + +1999-03-17 Martin Hunt <hunt@cygnus.com> + + * syms.c (_bfd_stab_section_find_nearest_line): Changed this + function so source-level assembly works. If multiple N_SOs + are seen without and N_FUNs, create an indextable entry with + a NULL function name. + +1999-03-16 Gavin Romig-Koch <gavin@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data) Allow merging + of certian similar cpus. + +1999-03-16 Gavin Romig-Koch <gavin@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_final_write_processing): + Add the 5000. Change the architecture for the 5400 to mips4. + (elf_mips_mach): Add r5000. + +1999-03-11 Doug Evans <devans@casey.cygnus.com> + + * cpu-i960.c (scan_i960_mach): Recognize i960:ka_sa and i960:kb_sb. + +1999-03-11 Nick Clifton <nickc@cygnus.com> + + * binary.c (binary_set_section_contents): Generate warning about + huge file offsets for any section that will occupy file space, not + just those that are loadable. + +1999-02-24 Jim Blandy <jimb@zwingli.cygnus.com> + + * libbfd.h: Regenerate after Nick Clifton's Feb 17 changes. + +1999-02-22 Jim Lemke <jlemke@cygnus.com> + + * elf32-ppc.c: Add ppc_elf_relax_section() for the ld option mpc860c0. + +Mon Feb 22 18:26:51 1999 Ian Lance Taylor <ian@cygnus.com> + + * elf-bfd.h (ELF_LINK_HASH_REF_REGULAR_NONWEAK): Define. + * elflink.h: Revert all changes since Feb 16. Instead: + (elf_link_add_object_symbols): Set REF_REGULAR_NONWEAK flag if + appropriate. Copy it to version symbols. + (elf_fix_symbol_flags): Set REF_REGULAR_NONWEAK for non ELF + symbols if appropriate. + (elf_adjust_dynamic_symbol): Set REF_REGULAR_NONWEAK for weakdef + symbol if appropriate. + (elf_link_output_extsym): If symbol is marked as undefined, and + has no nonweak references, mark it as weak undefined. + +Fri Feb 19 16:01:12 1999 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_merge_symbol): When overriding a dynamic + definition with a weak undefined symbol, set NEEDS_PLT if it is a + function. + (elf_link_add_object_symbols): Don't copy the other field if we + are overridding. + +Thu Feb 18 18:07:43 1999 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_merge_symbol): Do not merge any symbol from a + shared object with a weak undefined symbol. + +1999-02-18 Nick Clifton <nickc@cygnus.com> + + * elfarm-nabi.c: Set partial_inplace back to false. + +1999-02-17 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (TARGET_UNDERSCORE): Re-enable. + (USER_LABEL_PREFIX): Set to "_". + + The following patches are from: Scott Bambrough + <scottb@corelcomputer.com> + + * libaout.h (M_ARM6_NETBSD): Set to 143. + + * reloc.c: Add ARM PIC relocs: BFD_RELOC_ARM_GOT12, + BFD_RELOC_ARM_GOT32, BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_COPY, + BFD_RELOC_ARM_GLOB_DAT, BFD_RELOC_ARM_PLT32, + BFD_RELOC_ARM_RELATIVE, BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC. + * bfd-in2.h: Regenerate. + + * elfarm-nabi.c (elf32_arm_howto_table): Set partial_inplace to + 'true' as REL relocs are now being used. Add new PIC relocs: + R_ARM_COPY, R_ARM_GLOB_DAT, R_ARM_JUMP_SLOT, R_ARM_RELATIVE, + R_ARM_GOTOFF, R_ARM_GOTPC, R_ARM_GOT32, R_ARM_PLT32. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Check byte order + of targets. + (elf32_arm_final_link_relocate): Change parameters so that entire + reloc is passed. Add support for PIC relocs. + (elf32_arm_relocate_section): Pass entire reloc to + elf32_arm_final_link_relocate. + (elf32_arm_check_relocs): Handle new PIC relocs. + (elf32_arm_adjust_dynamic_symbol): New function. + (elf32_arm_size_dynamic_sections): New function. + (elf32_arm_discard_copies): New function. + (elf32_arm_finish_dynamic_symbol): New function. + (elf32_arm_finish_dynamic_sections): New function. + (ELF_MAXPAGE_SIZE): Define. + (bfd_elf32_bfd_reloc_type_lookup): Define. + (elf_backend_relocate_section): Define. + (elf_backend_adjust_dynamic_symbol): Define. + (elf_backend_create_dynamic_sections): Define. + (elf_backend_finish_dynamic_symbol): Define. + (elf_backend_finish_dynamic_sections): Define. + (elf_backend_size_dynamic_sections): Define. + (elf_backend_plt_readonly): Define. + (elf_backend_want_got_plt): Define. + (elf_backend_want_plt_sym): Define. + +Wed Feb 17 12:02:26 1999 Stan Cox <scox@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Make reginfo + sections SEC_LINK_ONCE and SEC_LINK_DUPLICATES_SAME_SIZE. + (_bfd_mips_elf_fake_sections): Likewise. + +Wed Feb 17 12:07:23 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * elfarm-oabi.c (bfd_elf32_arm_allocate_interworking_sections, + bfd_elf32_arm_get_bfd_for_interworking, + bfd_elf32_arm_process_before_allocation): Define to avoid clash + with elfarm-nabi.c. + + * elf32-arm.h: Don't declare elf32_arm_info_to_howto. + (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub, + elf32_arm_find_nearest_line): Make them static. + +Tue Feb 16 22:44:37 1999 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_merge_symbol): Add pflags parameter. Change all + callers. Do not merge a definition from a shared object with a + weak undefined symbol. + (elf_link_add_object_symbols): Do not change the symbol type or + size if the old symbol overrides the new one. + +1999-02-08 Nick Clifton <nickc@cygnus.com> + + * config.bfd: Add support for strongarm target. + +Mon Feb 8 11:18:14 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * elf32-m68k.c (reloc_map): Use the correct types for the struct + fields instead of unsigned char. + +Fri Feb 5 00:22:36 1999 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am: Rebuild dependencies. + * Makefile.in: Rebuild. + +Thu Feb 4 22:30:13 1999 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Change AC_PREREQ to 2.13. Remove AM_CYGWIN32. + Change AM_EXEEXT to AC_EXEEXT and AM_PROG_INSTALL to + AC_PROG_INSTALL. Add comments to uses of AC_DEFINE. + * acinclude.m4: Add comments to uses of AC_DEFINE. + * acconfig.h: Remove. + * configure: Rebuild with current autoconf/automake. + * aclocal.m4: Likewise. + * config.in: Likewise. + * Makefile.in: Likewise. + +1999-02-04 DJ Delorie <dj@cygnus.com> + + * libbfd.c (real_read): don't call fread for zero bytes. This + covers up a bug (or misuse of bfd) that's exposed by Solaris. + +Thu Feb 4 12:38:10 1999 Stan Cox <scox@cygnus.com> + + * elf32-mips.c (mips_elf_relocate_section): Insure that the target + of a jump is in the current 256 MB region. + +Thu Feb 4 12:15:38 1999 Ian Lance Taylor <ian@cygnus.com> + + * format.c (bfd_check_format_matches): Change last patch to only + take effect for the binary target. + +Wed Feb 3 19:40:12 1999 Ian Lance Taylor <ian@cygnus.com> + + * elf32-i386.c (elf_i386_reloc_type_lookup): Add BFD_RELOC_CTOR. + +Wed Feb 3 15:02:44 1999 Catherine Moore <clm@cygnus.com> + + * elf32-fr30.c (fr30_elf_check_relocs): New routine. + +Tue Feb 2 21:38:28 1999 Ian Lance Taylor <ian@cygnus.com> + + * format.c (bfd_check_format_matches): If the target was + previously specified, don't check other targets when checking for + an archive file. + +Tue Feb 2 18:16:43 1999 Catherine Moore <clm@cygnus.com> + + * elf32-arm.h (elf32_arm_reloc_map): Removed. + (elf32_arm_reloc_type_lookup): Removed + * elfarm-nabi.c (elf32_arm_reloc_map): New. + (elf32_arm_reloc_type_lookup): New. + * elfarm-oabi.c (elf32_arm_reloc_map): New. + (elf32_arm_reloc_type_lookup): New. + +Mon Feb 1 19:49:21 1999 Catherine Moore <clm@cygnus.com> + + * elfarm-nabi.c: Renamed from elf32-arm-newabi.c. + * elfarm-oabi.c: Renamed from elf32-arm-oldabi.c + * Makefile.am: Use new files. + * Makefile.in: Regenerate. + * configure.in: Use new files. + * configure: Regenerate. + +1999-02-01 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_elf_gc_mark_hook): New function. + (fr30_elf_gc_sweep_hook): New function. + (elf_backend_can_gc_sections): Define. + +Mon Feb 1 12:21:47 1999 Catherine Moore <clm@cygnus.com> + + * targets.c (bfd_target_vector): Add bfd_elf32_littlearm_oabi_vec + and bfd_elf32_bigarm_oabi_vec. + +Mon Feb 1 11:46:31 1999 Catherine Moore <clm@cygnus.com> + + * Makefile.am (elf32-arm-oldabi.lo): New. + (elf32-arm-newabi.lo): New. + * Makefile.in: Regenerate. + * config.bfd (thumb-*-elf): Remove definition of targ_underscore. + (arm-*-elf): Likewise. + (arm-*-oabi): New. + (thumb-*-oabi): New. + * configure: Regenerate. + * configure.in (bfd_elf32_littlearm_oabi_vec): New. + (bfd_elf32_bigarm_oabi_vec): New. + * elf32-arm-newabi.c: New. + * elf32-arm-oldabi.c: New. + * elf32-arm.c: Removed. + * elf32-arm.h: New. + +Mon Feb 1 11:52:12 1999 Frank Ch. Eigler <fche@cygnus.com> + + * binary.c (binary_set_section_contents): Omit warnings for + unloadable sections. + +1999-01-31 Michael Meissner <meissner@cygnus.com> + + * config.bfd (powerpc{,le}-*-vxworks*): Add aliases to + powerpc{,le}-*-eabi. + +1999-01-29 Nick Clifton <nickc@cygnus.com> + + * dwarf2.c (read_unsigned_leb128): Remove unused variables. + * dwarf2.c (read_signed_leb128): Remove unused variables. + +Fri Jan 29 00:47:21 1999 H.J. Lu <hjl@gnu.org> + + * elf.c (assign_file_positions_for_segments): Only adjust + p_align when needed. + +Thu Jan 28 20:05:22 1999 Ian Lance Taylor <ian@cygnus.com> + + * binary.c (binary_set_section_contents): Don't return early for a + non-loadable section, in case the first section is non-loadable. + Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej + W. Rozycki <macro@ds2.pg.gda.pl>. + +1999-01-28 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_reloc_map): Add R_FR30_GNU_VTINHERIT and + R_FR30_GNU_VTENTRY relocs. + +Thu Jan 28 11:08:16 1999 Catherine Moore <clm@cygnus.com> + + * elflink.h (elf_link_output_sym): Zero syms which are + part of sections which have been excluded. + +Wed Jan 27 13:35:35 1999 Stan Cox <scox@cygnus.com> + + * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed F_PIC + to F_PIC_INT. + * coffcode.h (coff_set_arch_mach_hook): Removed F_ARM_2a and + F_ARM_3M labels. Changed F_PIC to F_PIC_INT. + +1999-01-27 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_elf_howto_table): Fix name of R_FR30_48 + relocation. + (fr30_final_link_relocate): Use computed value as result of + relocation. + +1999-01-26 Frank Ch. Eigler <fche@cygnus.com> + + * binary.c (binary_set_section_contents): Emit warning for + huge file offsets due to widely-dispersed section LMAs. + +Mon Jan 18 03:35:35 1999 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (assign_file_positions_for_segments): If not D_PAGED, + align first section to largest section alignment, not first + section alignment. + +1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in: Require autoconf 2.12.1 or higher. + +Tue Dec 22 15:21:41 1998 Catherine Moore <clm@cygnus.com> + + * archures.c (bfd_mach_i386_i386_intel_syntax): Define. + * bfd-in2.h: Likewise. + * cpu-i386.c (bfd_i386_arch_intel_syntax): New. + +1998-12-16 Gavin Romig-Koch <gavin@cygnus.com> + + * archures.c,bfd-in2.h (bfd_mach_mips4111): New. + * cpu-mips.c: Add support for and independent 4111. + * elf32-mips.c (elf_mips_mach): E_MIPS_MACH_4111 -> bfd_mach_mips4111. + (_bfd_mips_elf_final_write_processing): + bfd_mach_mips4111 -> E_MIPS_ARCH_3 | E_MIPS_MACH_4111. + +1998-12-15 Gavin Romig-Koch <gavin@cygnus.com> + + * elf32-mips.c (elf_mips_abi_name): New. + (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags. + +1998-12-12 Gavin Romig-Koch <gavin@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_final_write_processing): + Handle bfd_mach_mips4300. + +1998-12-11 Ulrich Drepper <drepper@cygnus.com> + + * elf32-i386.c: Remove leaked development code from patch + 1998-12-10 by Richard Henderson. + +1998-12-10 Richard Henderson <rth@cygnus.com> + + * elf32-i386.c (elf_i386_relocate_section): Don't fail relocations + in debug sections for symbol defined externally. + +Thu Dec 10 10:58:38 1998 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * targets.c (bfd_target_vector): Remove duplicate entry for + tekhex_vec. + +1998-12-09 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_elf_howto_table): Set src_mask fields to 0 + since we are using RELAs. + +Tue Dec 8 22:15:48 1998 Ian Lance Taylor <ian@cygnus.com> + + SCO Open Server Release 5 core file support, from Jouke Numan + <jnuman@hiscom.nl>: + * sco5-core.c: New file. + * configure.in (i[3456]86-*-sco3.2v5*): Use sco5-core.lo. + (sco5-core.lo): Define SCO5_CORE in COREFLAG. + * Makefile.am: Rebuild dependencies. + (OPTIONAL_BACKENDS): Add sco5-core.lo. + (OPTIONAL_BACKENDS_CFILES): Add sco5-core.c. + * bfd.c (struct _bfd): Add sco5_core_data field to tdata. + * targets.c (sco5_core_vec): Add to target list if SCO5_CORE. + * bfd-in2.h, configure, Makefile.in: Rebuild. + +Tue Dec 8 19:38:42 1998 Mark Klein <mklein@dis.com> + + * config.bfd (hppa*-*-mpeix*): New target. + * configure.in: Add AC_HEADER_DIRENT. + (hppa*-*-mpeix*): New target. + * configure.host (hppa*-*-mpeix*): New host. + * hpux-core.c: Check HOST_HPPAMPEIX. Use HAVE_DIRENT_H and + friends rather than just including <sys/dir.h>. + * som.h (struct som_symbol): Add hppa_priv_level and apto + tc_data. Change all users. + (struct somdata): Add comp_unit field. + (obj_som_compilation_unit): Define. + (bfd_som_attach_compilation_unix): Declare. + * som.c: Check HOST_HPPAMPEIX. + (struct som_misc_symbol_info): Add new field priv_level. + (som_object_setup): Add current_offset parameter. Change all + callers. + (setup_sections): Likewise. + (som_object_p): For EXECLIBMAGIC, read the lst header. + (som_write_symbol_strings): Add compilation_unit parameter. + Change all callers. + (som_finish_writing): Write out compilation_unit. + (som_bfd_derive_misc_symbol_info): Set priv_level. + (som_build_and_write_symbol_table): Set xleast field to 3. + (som_slurp_symbol_table): Set symbol priv_level. + (bfd_som_attach_compilation_unit): New function. + (som_bfd_ar_write_symbol_stuff): Set xleast field to 3. Set + priv_level into symbol_value. + * configure, config.in: Rebuild. + +Tue Dec 8 16:21:35 1998 Ian Lance Taylor <ian@cygnus.com> + + * hpux-core.c (hpux_core_core_file_p): Change call to nonexistent + warning function to call _bfd_error_handler instead. + + * libbfd.c (COERCE32): Cast through unsigned long and long to + avoid bug in old version of gcc. + + * elf64-alpha.c (elf64_alpha_additional_program_headers): Remove. + (elf_backend_additional_program_headers): Don't define. + +1998-12-08 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_final_link_relocate): Fix PC relative + relocations to include offset of 2 included in the insns, and the + offset of the relocs within the section. + +Wed Dec 2 15:03:59 1998 David Taylor <taylor@texas.cygnus.com> + + The following changes were made by David Taylor + <taylor@texas.cygnus.com>, Edith Epstein + <eepstein@sophia.cygnus.com>, Jim Blandy + <jimb@zwingli.cygnus.com>, and Elena Zannoni + <ezannoni@kwikemart.cygnus.com> as part of the project to merge in + changes originally made by HP; HP did not create ChangeLog + entries. + + * aclocal.m4, configure, Makefile.in: Rebuilt using latest + automake macro library. + + * hpux-core.c (hpux_core_core_file_p): this function now + understands HPUX 10.30 thread info. Yes, the thread stacks can be + found in the corefile! Also, in hpux_core_core_file_p, if we + encounter a section with an unknown type, don't punt. Instead, + just skip it. Also, count the number of sections of known type + that we encounter. If we encounter at least one good one, then + we'll declare that the file is a core file. If we encounter any + unknown ones but some known ones, then we'll issue a warning (but + still declare it to be a core file). Also, correctly decide when a + file is not a core. + (PROC_INFO_HAS_THREAD_ID): define if CORE_ANON_SHMEM defined. + (CORE_ANON_SHMEM): define if not defined. + (hpux_core_struct): add members lwpid and user_tid. + (core_kernel_thread_id, core_user_thread_id): new macros. + (make_bfd_asection): use bfd_alloc to allocate room for a copy of + the name before storing it in the bfd. + (hpux_core_core_file_p): handle threads. + + * libhppa.h (GET_FIELD): protect against redefinition. + (HPPA_WIDE): define. + (GET_FIELD): define. + (GET_BIT): define. + (MASK): define. + (CATENATE): define. + (ELEVEN): define. + (sign_extend): redefine. + (assemble_6): define. + (assemble_12): rewrite. + (assemble_16): define. + (assemble_16a): define. + (assemble_17): rewrite. + (assemble_22): define. + +1998-12-07 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_final_link_relocate): Using signed + relocations for signed values. + +Sun Dec 6 16:30:33 1998 Ian Lance Taylor <ian@cygnus.com> + + * mipsbsd.c (MY(set_arch_mach)): Make static. + * aoutx.h (NAME(aout,machine_type)): For bfd_arch_mips, use + bfd_mach_mips* macros rather than simple numbers. + + COFF weak symbol support, based on patches from Mark Elbrecht + <snowball3@usa.net>: + * coffcode.h (coff_slurp_symbol_table): Handle C_WEAKEXT. + * coffgen.c (coff_renumber_symbols): Handle weak symbols. + (coff_write_alien_symbol): Likewise. + * cofflink.c (coff_link_check_ar_symbols): Likewise. + (coff_link_add_symbols): Likewise. + (_bfd_coff_link_input_bfd): Likewise. + (_bfd_coff_write_global_sym): Likewise. + + * elf.c (copy_private_bfd_data): Always initialize the + includes_phdrs field. + + * elflink.h (elf_fix_symbol_flags): Check for case where a non-ELF + file defines a symbol first mentioned in an ELF file. + + * bfd-in.h: Always define BFD_HOST_64_BIT and BFD_HOST_U_64_BIT if + possible, rather than only if BFD64. + * elflink.h (compute_bucket_count): Just check BFD_HOST_U_64_BIT, + not __GNUC__. + * bfd-in2.h: Rebuild. + + * srec.c (srec_set_section_contents): Correct test to avoid + switching to 4 byte addresses after seeing a second section which + requires 3 byte addresses. From Joel Schantz + <joel.schantz@argosys.boeing.com>. + + * config.bfd (m68*-*-gnu*): New target. From Aymeric Vincent + <aymeric.vincent@emi.u-bordeaux.fr>. + +1998-12-04 Jim Blandy <jimb@zwingli.cygnus.com> + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Fix logic to + decide whether the output file is -mrelocatable-lib, + -mrelocatable, or neither. (gdb.base/nodebug.exp) + +1998-12-03 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c: Add support for R_FR30_48 reloc. + * reloc.c: Add BFD_RELOC_FR30_48 relocation. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate + +Wed Dec 2 00:58:37 1998 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_adjust_dynamic_symbol): Warn on an attempt to + link against a dynamic symbol with no type or size. + +1998-12-01 Ulrich Drepper <drepper@cygnus.com> + + * elf32-i386.c (i386_check_relocs) [R_386_32]: Don't emit + relocation for section which does not get loaded. + (elf_i386_relocate_section) [R_386_32]: Likewise. + +Tue Dec 1 11:33:33 1998 Jim Wilson <wilson@cygnus.com> + + * coff-h8300.c (h8300_bfd_link_add_symbols): Make reloc_size, + reloc_count and i long instead of unsigned long. Handle error + return from bfd_canonicalize_reloc. + +1998-12-01 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_relocate_section): Detect the absence of + a hash table. + +Mon Nov 30 15:28:09 1998 J"orn Rennecke <amylaar@cygnus.co.uk> + + * elf32-sh.c (elf/sh.h): Include. + sh_reloc_type: Delete. Changed all references to elf_sh_reloc_type. + (sh_elf_howto_tab): Add HOWTO for R_SH_SWITCH8. + (sh_reloc_map): Map BFD_RELOC_8_PCREL to R_SH_SWITCH8. + (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. + * Makefile.in: Add dependency of elf32-sh.lo on $(INCDIR)/elf/sh.h. + +Fri Nov 27 17:51:38 1998 Geoff Keating <geoffk@ozemail.com.au> + + * elflink.h (compute_bucket_count): Don't allow minsize==0, it + causes division by zero later on. + +Thu Nov 26 11:19:35 1998 Dave Brolley <brolley@cygnus.com> + + * elf32-fr30.c (fr30_elf_pc9_reloc,fr30_elf_pc12_reloc): Not + needed. + +1998-11-25 DJ Delorie <dj@cygnus.com> + + * coff-i386.c (i3coff_object_p): Remove hack. Use new emulation + hook now. + +Tue Nov 24 10:25:27 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_elf_relocate_section): Call + fr30_final_link_relocate. + (fr30_final_link_relocate): New function: Handle I20 and I32 + relocs. + (fr30_elf_i32_reloc): New function: Handle I32 relocs. + (fr30_elf_pc9_reloc): New function: Handle 9_PCREL relocs. + (fr30_elf_pc12_reloc): New function: Handle 12_PCREL relocs. + + * elf32-v850.c (v850_elf_relocate_section): Reset hi16s reloc + chain to empty. + + The following changes are based on a patch submitted by Gianluca + Moro <glctr@abc.it>: + + (v850_elf_perform_relocation): Only update a hi16s reloc if it has + not already been updated. + (find_remembered_hi16s_reloc): New parameter 'already_found' + returns state of remembered hi16s reloc. + (remember_hi16s_reloc): Set 'found' field to false. + (hi16s_location): Add 'found' field. + +1998-11-23 DJ Delorie <dj@cygnus.com> + + * coff-i386.c (bfd_pe_dll_not_recognized_hack): the linker wants + to see .DLL files as unrecognized. + (i3coff_object_p): Sorry, had to hack it to not recognize these + files (pei-i386) on request. + +1998-11-23 DJ Delorie <dj@cygnus.com> + + * opncls.c (bfd_make_readable): need more cleanup for symbols and + relents. Call bfd_check_format to reinitialize. + +Fri Nov 20 14:21:36 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_elf_relocate_section): Remove spurious + warnings. + +Thu Nov 19 14:42:15 1998 Geoffrey Noer <noer@cygnus.com> + + * aclocal.m4: regenerate + * configure: regenerate + +Tue Nov 17 20:23:35 1998 Richard Henderson <rth@cygnus.com> + + * elf-bfd.h (struct elf_link_hash_entry): Add vtable_entries_size. + * elf.c (_bfd_elf_link_hash_newfunc): Clear it. + * elflink.h (elf_gc_propagate_vtable_entries_used): Copy it, and + respect it as an upper bound on what memory to reference. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + (elf_gc_record_vtentry): Handle as-yet undefined vtables. Set and + update vtable_entries_size appropriately. + +Tue Nov 17 15:28:31 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-fr30.c (fr30_reloc_type_lookup): Used integers to hold + reloc number. + +Mon Nov 16 22:19:21 1998 DJ Delorie <dj@cygnus.com> + + * archive.c (bfd_ar_hdr_from_filesystem): support BFD_IN_MEMORY + bfds; they have no "file" so we fake it. + * bfd-in2.h: add bfd_make_writable and bfd_make_readable (regen) + * libbfd.c (bfd_write): Allow writing to BFD_IN_MEMORY bfds by + resizing the memory buffer. + * opncls.c (bfd_make_writable): New function; lets you write a + bfd_create'd bfd to an in-memory buffer. + (bfd_make_readable): New function; lets you read back that buffer + as if it were from bfd_openr. Used to build generated archive + members (winsup's ld's dlltool) + +Mon Nov 16 19:15:19 1998 Dave Brolley <brolley@cygnus.com> + + * po/bfd.pot: Regenerated. + +Mon Nov 16 10:57:06 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (hi16s_location): Replaced fixed size array with + linked list. + +Sun Nov 15 20:28:25 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_relax_section): Search for the proper + element of the gotentry list for local symbols too. + (elf64_alpha_relocate_section): Unify local and global handling. + Assert that gotent->use_count > 0. + +Sat Nov 14 15:16:01 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in (vms_alpha_vec): Rename from evax_alpha_vec, and + update for file name changes of July 2, 1998. + (vms_vax_vec): New. + * configure: Rebuild. + +Thu Nov 12 19:19:54 1998 Dave Brolley <brolley@cygnus.com> + + * po/bfd.pot: Regenerated. + +Tue Nov 10 16:17:06 1998 Geoffrey Noer <noer@cygnus.com> + + * acinclude.m4, config.bfd: detect cygwin* instead of cygwin32*. + * aclocal.m4, configure: regenerate + +Tue Nov 10 15:13:59 1998 Nick Clifton <nickc@cygnus.com> + + * elf.c (prep_headers): Add support for bfd_arch_fr30. + +Tue Nov 10 13:37:36 1998 Felix Lee <flee@cygnus.com> + + * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE, + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value + was cached. + * aclocal.m4, configure: regenerated. + +Tue Nov 10 14:31:01 1998 Catherine Moore <clm@cygnus.com> + + * elf32-d10v.c (reloc_type): Add R_D10V_GNU_VTINHERIT and + R_D10V_GNU_VTENTRY relocs. + (elf_d10v_howto_table): Likewise. + (d10v_reloc_map d10v_reloc_map): Likewise. + (elf32_d10v_gc_mark_hook): New. + (elf32_d10v_gc_sweep_hook): New. + (elf32_d10v_check_relocs): New. + (elf32_d10v_relocate_section): New. + (elf_backend_relocate_section): Define. + (elf_backend_can_gc_sections): Define. + +Sat Nov 7 18:07:51 1998 Peter Schauer <peter.schauer@regent.e-technik.tu-muenchen.de> + + * Makefile.am (BFD32_BACKENDS): Move vms files here... + (BFD64_BACKENDS): ...from here. + (BFD32_BACKENDS_CFILES): Move vms files here... + (BFD64_BACKENDS_CFILES): ...from here. + * Makefile.in: Rebuild. + +Wed Nov 4 15:58:48 1998 Nick Clifton <nickc@cygnus.com> + + * Makefile.am: Add FR30 target. + * Makefile.in: Add FR30 target. + * archures.c: Add support for FR30. + * config.bfd: Add support for FR30. + * configure.in: Add support for FR30. + * reloc.c: Add support for FR30 relocations. + * targets.c: Add support for FR30 relocations. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + * cpu-fr30.c: New file. + * elf32-fr30.c: New file. + +Mon Nov 2 14:59:33 1998 Geoffrey Noer <noer@cygnus.com> + + * configure.in: detect cygwin* instead of cygwin32* + * configure: regenerate + +Sun Nov 1 19:32:28 1998 Jeffrey A Law (law@cygnus.com) + + * elf-m10300.c (mn10300_elf_relax_section): Do not use alloca, + use bfd_malloc and free instead and check return value from bfd_malloc. + +Sun Nov 1 16:20:35 1998 Ian Lance Taylor <ian@cygnus.com> + + * libbfd-in.h (_bfd_dwarf1_find_nearest_line): Declare. + * libbfd.h: Rebuild. + + * elf32-mips.c (mips_elf_dynsym_sec_names): Comment out. + (SIZEOF_MIPS_DYNSYM_SECNAMES): Likewise. + (MIPS_TEXT_DYNSYM_SECN): Likewise. + (_bfd_mips_elf_fake_sections): Don't set sh_info field of a .hash + section. + (struct mips_elf_link_hash_table): Remove dynsym_sec_strindex + field. + (mips_elf_link_hash_table_create): Don't initialize + dynsym_sec_strindex. + (mips_elf_gc_mark_hook): Add default case to avoid warning. + (mips_elf_size_dynamic_sections): Generate a section symbol for + every output section. + (mips_elf_finish_dynamic_sections): Count all sections for + DT_MIPS_UNREFEXTNO. + (mips_elf_finish_dynamic_sections): Use dynamic symbols for all + output sections. + +Sun Nov 1 12:46:53 1998 Geoff Keating <geoffk@ozemail.com.au> + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Allocate two slots + for later PLT entries in large PLTs. + (ppc_elf_finish_dynamic_symbol): Allow for the extra slots. + +Sat Oct 31 20:10:09 1998 Jeffrey A Law (law@cygnus.com) + + * elf32-ppc.c (ppc_elf_reload_section): Fix typo. + +1998-10-26 15:58 Ulrich Drepper <drepper@cygnus.com> + + * elf-bfd.h (struct elf_link_hash_entry): Add new field elf_hash_value. + * elflink.h (elf_collect_hash_codes): New function. This function is + called for each exported symbol and we compute the ELF hash value for + it. + (compute_bucket_value): New function. It is called from + size_dynamic_sections to determine the hash table size. When we are + optimizing a better, but slower, algorithm is used. + (size_dynamic_sections): Call compute_bucket_value. + + * elf.c (bfd_elf_hash): Optimize the hash function a bit. + +Mon Oct 19 20:03:21 1998 Catherine Moore <clm@cygnus.com> + + * elf32-sh.c: Add HOWTO entries for R_SH_GNU_VTINHERIT and + R_SH_GNU_VTENTRY. + (sh_elf_gc_mark_hook): New. + (sh_elf_gc_sweep_hook): New. + (sh_elf_check_relocs): New. + (elf_backend_can_gc_sections): Define. + +Mon Oct 19 16:57:05 1998 Felix Lee <flee@cygnus.com> + + * acinclude.m4: undo previous gettext change + * aclocal.m4: rebuild with right version of aclocal. + +Mon Oct 19 01:47:21 1998 Felix Lee <flee@cygnus.com> + + * acinclude.m4, aclocal.m4: move gettext-related fragments from + aclocal.m4 to acinclude.m4, so they don't get lost. + + * elfcore.h: rewrite for better corefile support. + * elf.c (elfcore_*): new functions. + * elf-bfd.h (elf_obj_tdata): new structure members. + * acconfig.h, acinclude.m4, configure.in: add feature-tests for + flavor of procfs. + * aclocal.m4, config.in, configure, Makefile.in: regenerated. + +Fri Oct 16 14:07:45 1998 Catherine Moore <clm@cygnus.com> + + * elf32-m32r.c: Add HOWTO entries for R_M32R_GNU_VTINHERIT + and R_M32R_GNU_VTENTRY. + (elf_backend_can_gc_sections): Define. + (m32r_elf_check_relocs): New. + (m32r_elf_gc_mark_hook): New. + (m32r_elf_gc_sweep_hook): New. + (m32r_elf_relocate_section): Handle VT relocs. + +Mon Oct 12 14:18:40 1998 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (arm_relocate_section): Remove redundant test. + + * bfd-in2.h (struct reloc_howto_struct): Improve comment to make + cleat that the 'bitsize' field is the size of the bitfield AFTER + relocation not before. + + * elf32-m32r.c (R_M32R_18_PCREL): Fix size of bitfield. + + * coff-mips.c (mips_relocate_hi): Cope with missing refhi or reflo + relocs. + +Tue Oct 6 09:20:44 1998 Catherine Moore <clm@cygnus.com> + + * elf32-sparc.c: Add HOWTO entries for R_SPARC_GNU_VTINHERIT and + R_SPARC_GNU_VTENTRY. + (elf32_sparc_check_relocs): Handle them. + (elf32_sparc_reloc_type_lookup): Likewise. + (elf32_sparc_relocate_section): Likewise. + (elf32_sparc_gc_mark_hook): New. + (elf32_sparc_gc_sweep_hook): New. + +Mon Oct 5 14:55:30 1998 Jeffrey A Law (law@cygnus.com) + + * som.c (som_finish_writing): Perform some sanity checks when + writing an executable or shared library. + +Mon Oct 5 12:02:31 1998 Gavin Romig-Koch <gavin@cygnus.com> + + * dwarf1.c : New file. Adds _bfd_dwarf1_find_nearest_line. + * configure.in (elf): Add dwarf1.lo. + * elf_bfd.h (elf_ob_tdata): Add dwarf1_find_line_info. + * elf.c (_bfd_elf_find_nearest_line): Add call to + _bfd_dwarf1_find_nearest_line. + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): + Add call to _bfd_dwarf1_find_nearest_line. + * configure: Rebuilt. + +Mon Oct 5 10:06:22 1998 Catherine Moore <clm@cygnus.com> + + * elflink.h (elf_gc_sections): Do not allow garbage + collection if dynamic sections have been created. + +Mon Oct 5 09:07:37 1998 Catherine Moore <clm@cygnus.com> + + * elf32-v850.c: Add HOWTO entries for R_V850_GNU_VTINHERIT and + R_V850_GNU_VTENTRY. + (v850_elf_check_relocs): Handle VTINHERIT and VTENTRY relocs. + (v850_elf_perform_relocation): Likewise. + (v850_elf_final_link_relocate): Likewise. + (v850_elf_relocate_section): Likewise. + (v850_elf_gc_sweep_hook): New routine. + (v850_elf_gc_mark_hook): New routine. + (elf_backend_can_gc_sections): Define. + +Mon Oct 5 09:04:25 1998 Catherine Moore <clm@cygnus.com> + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Don't assume + that dynobj exists. + +Sun Oct 4 23:29:34 1998 David Edelsohn <edelsohn@mhpcc.edu> + + * rs6000-core.c (rs6000coff_core_file_matches_executable_p): + Declare size as bfd_size_type. + (rs6000coff_get_section_contents): Declare count as bfd_size_type. + +Sun Oct 4 20:38:29 1998 Jeffrey A Law (law@cygnus.com) + + * cpu-hppa.c (bfd_hppa20_arch): Define. Link it into the bfd_hppa_arch + structure. + * som.c (CPU_PA_RISC2_0): Define. + (_PA_RISC2_0_ID): Likewise. + (som_finish_writing): Use CPU_PA_RISC2_0 for the system_id as needed. + +Sun Oct 4 21:19:09 1998 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_link_add_object_symbols): When a versioned symbol + has a base which is already defined, only add the referenced + symbol to the dynamic symbol table if it is defined or referenced + by a regular file. + + * elf32-i386.c (elf_i386_info_to_howto_rel): Handle vtable relocs + correctly. + +1998-09-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elflink.h (elf_link_add_object_symbols): Undo last change. + +Wed Sep 23 16:09:31 1998 Richard Henderson <rth@cygnus.com> + + * elflink.h (elf_link_add_object_symbols): Don't record a dynamic + symbol for the indirect alias to a versioned symbol. + +Mon Sep 21 12:15:22 1998 Catherine Moore <clm@cygnus.com> + + * elf32-i386.c (elf32_i386_vtinherit_howto): New. + (elf32_i386_vtentry_howto): New. + (elf_i386_reloc_type_lookup): Return elf32_i386_vtentry_howto + or elf32_i386_vtinherit_howto on lookup. + +Sun Sep 20 00:48:07 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf32-m68k.c: Include "elf/m68k.h". Remove definition of enum + reloc_type. Rename R_68K__max to R_68K_max. + (howto_table): Use _bfd_elf_rel_vtable_reloc_fn for a VTENTRY + reloc. + +Sun Sep 20 00:09:25 1998 Chris Torek <torek@bsdi.com> + + * libbfd.c (bfd_getb32): Rewrite expression to get better code. + (bfd_getl32, bfd_getb_signed_32, bfd_getl_signed_32): Likewise. + + * libbfd.c (bfd_log2): Cast to bfd_vma before shifting, not + after. + +Sat Sep 19 22:42:23 1998 Doug Rabson <dfr@nlsystems.com> + + * elflink.h (elf_link_add_object_symbols): Ensure that the warning + message has a null byte terminator. + +Fri Sep 18 14:35:29 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_perform_relocation): Ignore contents of + word subject to R_V850_32 relocation. + +Thu Sep 17 17:20:36 1998 Nick Clifton <nickc@cygnus.com> + + * dwarf2.c: Add comment describing problem computing line numbers + for undefined symbols at link time. + +Thu Sep 17 16:03:28 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't + transform a defweak into a plt entry. + (elf64_alpha_calc_dynrel_sizes): Allow room for secondary + plt entry references to receive a RELATIVE reloc. + (elf64_alpha_finish_dynamic_symbol): Fill them in. + (elf64_alpha_relocate_section): Assert we don't overrun + the allocated relocation space. + +Wed Sep 16 18:03:13 1998 Nick Clifton <nickc@cygnus.com> + + * elf.c (swap_out_syms): Always treat section symbols as + special, even if they are attached to a common section. + +Wed Sep 16 10:34:13 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_symbol_processing): Move symbols in + sections with v850 common section attributes into named v850 + common sections. + (v850_elf_add_symbol_hook): Move symbols in sections with v850 + common section attributes into named v850 common sections. + +Wed Sep 16 11:26:49 CDT 1998 Catherine Moore <clm@cygnus.com> + + * elf32-arm.c (elf32_arm_gc_mark_hook): Remove print + statement. + +1998-09-15 Geoff Keating <geoffk@ozemail.com.au> + + * elf32-ppc.c (ppc_elf_relocate_section): Reverse output_offset + part of Vladimir's change of 1998-08-19. Make a R_PPC_SDAREL16 + reloc to the wrong section a warning, not an error. .dynsbss + is not an output section, so there is no need to check for it. + +Tue Sep 15 12:40:05 1998 Catherine Moore <clm@cygnus.com> + + * elf-bfd.h: Add argument to elf_backend_get_symbol_type. + +Tue Sep 15 08:34:40 1998 Catherine Moore <clm@cygnus.com> + + * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type. + * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and + R_ARM_GNU_VTENTRY. + (elf32_arm_gc_mark_hook): New. + (elf32_arm_gc_sweep_hook): New. + (elf32_arm_check_relocs): New. + (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY + relocations. + (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY + relocations. + +1998-09-10 Geoff Keating <geoffk@ozemail.com.au> + + * elf32-ppc.c (ppc_elf_relocate_section): If dynobj is NULL, + assume there is no PLT or GOT. + +Wed Sep 9 14:24:12 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.c (elf32_arm_find_nearest_line): New function: just + like _elf_bfd_find_nearest_line() except that STT_ARM_TFUNC is + also accepted as a function symbol type. + +Mon Sep 7 13:24:03 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de> + + * rs6000-core.c (_LONG_LONG): Define for AIX 4.x only. + +Sat Sep 5 20:40:18 1998 Ian Lance Taylor <ian@cygnus.com> + + * libbfd-in.h (_bfd_nolink_bfd_gc_sections): Correct definition to + match definition of _bfd_gc_sections field. + * libbfd.h: Rebuild. + +Fri Sep 4 13:54:23 1998 David Miller <davem@dm.cobaltmicro.com> + + * elf32-sparc.c (elf32_sparc_relocate_section): Properly adjust + the addend of a dynamic relocation referencing a section. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + (sparc64_elf_finish_dynamic_symbol): Fix the PLT relocation offset. + +Thu Sep 3 17:28:50 1998 Richard Henderson <rth@cygnus.com> + + * elflink.h (bfd_elfNN_size_dynamic_sections): Verify that the + bed has a size_dynamic_sections routine before trying to use it. + +Mon Aug 31 14:49:22 1998 Richard Henderson <rth@cygnus.com> + + * elf32-mips.c (elf_mips_gnu_vtentry_howto): Use + _bfd_elf_rel_vtable_reloc_fn. + +Mon Aug 31 10:23:40 1998 Catherine Moore <clm@cygnus.com> + + * Makefile.am: Add elf32-arm.c. + * Makefile.in: Rebuild. + * elf-bfd.h: Add elf_backend_get_symbol_type. + * elf.c (swap_out_syms): If defined, call + elf_backend_get_symbol_type. + * elf32-arm.c: Define elf_backend_get_symbol_type. + (elf32_arm_get_symbol-type): New routine. + (record_thumb_to_arm_glue): Change to use STT_ARM_TFUNC. + (bfd_elf32_arm_process_before_allocation): Change to + check for STT_ARM_TFUNC. + (elf32_arm_final_link_relocate): Likewise. + * elfxx-target.h: Add elf_backend_get_symbol_type. + +Fri Aug 28 19:44:07 1998 Richard Henderson <rth@cygnus.com> + + * archures.c (bfd_mach_alpha_ev[456]): New. + * cpu-alpha.c: Rework to match these types. + * bfd-in2.h: Rebuild. + +Fri Aug 28 19:38:53 1998 Richard Henderson <rth@cygnus.com> + + * elf-bfd.h (_bfd_elf_rel_vtable_reloc_fn): Declare. + * elf.c (_bfd_elf_rel_vtable_reloc_fn): New. + + * elf32-i386.c (elf_howto_table): Add vtable relocs. + (elf_i386_reloc_type_lookup): Recognize them. + (elf_i386_check_relocs): Pass them off to generic code. + (elf_i386_relocate_section): Ignore them. + (elf_i386_gc_mark_hook, elf_i386_gc_sweep_hook): New. + (elf_backend_can_gc_sections): True. + +Thu Aug 20 15:03:45 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.c (elf32_thumb_to_arm_stub): Check sym_sec is not NULL + before looking at owner field. + (elf32_arm_to_thumb_stub): Ditto. + (elf32_arm_relocate_section): Compute name before calling + elf32_arm_final_link_relocate(). + +Thu Aug 20 11:30:17 1998 Michael Snyder <msnyder@cleaver.cygnus.com> + + * elf.c: comment and formatting cleanups. + * elfcore.h: ditto. + +Wed Aug 19 15:43:26 1998 Michael Snyder <msnyder@cleaver.cygnus.com> + + * elfcode.h (elf_object_p): Reject files of header type ET_CORE + (core files are treated differently than object files). + * elf-bfd.h (_bfd_elf_write_corefile_contents, + bfd_elf_mkcorefile): declare. + * elfxx-target.h (_bfd_elf_write_corefile_contents, + bfd_elf_mkcorefile): add to bfd_target vector. + * elfcore.h (elf_core_file_p): save the program header table, + and set the bfd architecture from the elf file header. + * elf.c (bfd_elf_mkcorefile): new function. + (_bfd_elf_write_corefile_contents): new function. + (assign_file_positions_for_segments): add cases for handling + PT_NOTE segments. (assign_file_positions_except_relocs): + core files should be handled the same as exec files. + (prep_headers): identify core files as type ET_CORE. + (copy_private_bfd_data): identify the sections belonging to + the PT_NOTE segment. + + * elf32-sparc.c (elf32_sparc_final_write_processing): + add break statement to default case. + +1998-08-19 Vladimir N. Makarov <vmakarov@cygnus.com> + + * elf32-ppc.c (ppc_elf_relocate_section): Check that output + section (not input) will be in sections ".sbss", ".sbss2", + ".sdata", and ".sdata" for R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, + R_PPC_EMB_SDA21, R_PPC_EMB_RELSDA. In all these cases also ignore + output_offset for correct evaluation of addend. + +Tue Aug 18 11:48:12 1998 Catherine Moore <clm@cygnus.com> + + * elf32-arm.c: Add prefix bfd_ to elf32_arm_get_bfd_for_interworking, + elf32_arm_allocate_interworking_sections and + elf32_arm_process_before_allocation. + +Tue Aug 18 11:46:00 1998 Nick Clifton <nickc@cygnus.com> + + * bfd-in.h: Ammend prototype for + elf32_arm_process_before_allocation to remove surplus third + argument. + + * bfd-in2.h: Regenerate. + +Sat Aug 15 20:55:08 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_relax_section): Handle indirect symbols. + +Fri Aug 14 09:12:28 1998 Stan Cox <scox@cygnus.com> + + * aoutx.h (aout_link_input_section_ext): Use the relocation already + calculated for RELOC_SPARC_REV32 case. + +Thu Aug 13 14:02:02 1998 Catherine Moore <clm@cygnus.com> + + * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking, + elf32_arm_allocate_interworking_sections and + elf32_arm_process_before_allocation. + * bfd-in2.h: Regenerated. + * elf32-arm.c Define elf32_arm_link_hash_table. + (insert_thumb_branch): New routine. + (find_thumb_glue): New routine. + (find_arm_glue): New routine. + (record_arm_to_thumb_glue): New routine. + (record_thumb_to_arm_glue): New routine. + (elf32_arm_link_hash_table_create): New routine. + (elf32_arm_get_bfd_for_interworking): New routine. + (elf32_arm_allocate_interworking_sections) New routine. + (elf32_arm_process_before_allocation) New routine. + (elf32_thumb_to_arm_stub): New routine. + (elf32_arm_to_thumb_stub): New routine. + (elf32_print_private_bfd_data): Fix typo. + (elf32_arm_final_link_relocate): Add argument sym_sec. + Check for branches to thumb symbols in case R_ARM_PC24. + Check for branches to arm symbols in case R_ARM_THM_PC22. + (elf32_arm_relocate_section): Pass symbol section to + elf32_arm_final_link_relocate. + +Wed Aug 12 19:00:39 1998 Geoff Keating <geoffk@ozemail.com.au> + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Generate PLT + entries unless the symbol is defined in the executable; in + particular, undefined weak symbols get a PLT entry. + +Wed Aug 12 14:48:33 1998 Ian Lance Taylor <ian@cygnus.com> + + * libaout.h: Remove nested comment to avoid warning. + +Wed Aug 12 08:10:11 1998 Catherine Moore <clm@cygnus.com> + + * elf32-arm.c (elf32_arm_final_link_relocate): Rework + R_ARM_PC24 relocation. + +Tue Aug 11 14:42:26 1998 Catherine Moore <clm@cygnus.com> + + * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused + argument is_local. Add argument sym_flags. Check sym_flags + in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case. + (elf32_arm_relocate_section): Don't pass local sym and pass + sym_flags to elf32_arm_final_link_relocate. + +Mon Aug 10 20:38:39 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Correct last change + to not count too few relocs for dynamicly linked executables. + +Mon Aug 10 15:35:34 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Never consider + symbols without a dynamic index dynamic. Consider all weak + symbols dynamic. + (elf64_alpha_strip_section_from_output): Don't assume 1-1 + correspondance between input and output sections. + +Mon Aug 10 15:31:39 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elflink.h (elf_gc_common_finalize_got_offsets): For backends + that use a .got.plt section start the got offset at zero. + +Mon Aug 10 17:31:21 1998 Ian Lance Taylor <ian@cygnus.com> + + * ieee.c (ieee_write_processor): Correct the processor ID written + out for bfd_arch_m68k, accommodating change of March 25. + +Sun Aug 9 20:55:44 1998 Catherine Moore <clm@cygnus.com> + + * elf32-arm.c (elf32_arm_final_link_relocate): Rework + R_ARM_THM_RPC22 relocations. + +Sat Aug 8 15:15:30 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Undef weak symbols + are always dynamic. + (elf64_alpha_calc_dynrel_sizes): Allow enough room for RELATIVE + .got relocs in -Bsymbolic shared objects. + +Wed Aug 5 15:48:08 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-arm.c: Add private flags to ELF header. + (elf32_arm_print_private_bfd_data): New Function. + (elf32_arm_set_private_flags): New Function. + (elf32_arm_copy_private_flags): New Function. + (elf32_arm_merge_private_bfd_data): New Function. + +Mon Aug 3 17:10:15 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf32-sparc.c (elf32_sparc_check_relocs): Permit WPLT30 against + a local symbol. + (elf32_sparc_relocate_section): Likewise. + +Sun Aug 2 03:19:23 1998 Richard Henderson <rth@cygnus.com> + + * elf32-ppc.c (ppc_elf_check_relocs): Init sgot to NULL. Create the + .got if any relocation referrs to _GLOBAL_OFFSET_TABLE_. + (ppc_elf_relocate_section): Pull sgot and splt search to the start + of the function. Recognize no .plt as static linking. + +1998-08-01 Ulrich Drepper <drepper@cygnus.com> + + * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Don't pass + ".liblist" string through gettext. + +Fri Jul 31 16:38:14 1998 Catherine Moore <clm@cygnus.com> + + * Makefile.am: Add support for elf32-arm.lo. + * Makefile.in: Rebuild. + * config.bfd (arm-*-elf): Define targ_defvec and targ_selvecs. + (thumb-*-elf): Define targ_defvec and targ_selvecs. + * configure.in: Handle bfd_elf32_littlearm_vec and bfd_elf32_bigarm_vec. + * configure: Regenerate. + * elf.c: (prep_headers): Support arch_type of EM_ARM. + * targets.c: Support new targets bfd_elf32_bigarm_vec and + bfd_target bfd_elf32_littlearm_vec. + * elf32-arm.c: New file. + +Tue Jun 28 19:05:28 1998 Stan Cox <scox@cygnus.com> + + * libaout.h (M_SPARCLITE_LE): New machine. + * sunos.c (MACHTYPE_OK): Add machine M_SPARCLITE_LE. + * aoutf1.h (sunos_set_arch_mach): Add machine M_SPARCLITE_LE. + (sunos_write_object_contents): Add machine bfd_mach_sparc_sparclite_le + * aoutx.h (howto_table_ext): Add relocation R_SPARC_REV32. + (NAME(aout,machine_type)) Add machine bfd_mach_sparc_sparclite_le + (aout_link_input_section_ext): Add RELOC_SPARC_REV32 support. + * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, + elf32_sparc_relocate_section): Rename R_SPARC_32LE to be R_SPARC_REV32 + * libbfd.h (bfd_reloc_code_real_names): Rename BFD_RELOC_SPARC_32LE to + be BFD_RELOC_SPARC_REV32. + * reloc.c: Ditto. + * config.bfd (sparc86x-*-aout): New + +Fri Jul 24 13:54:19 1998 Nick Clifton <nickc@cygnus.com> + + * linker.c (_bfd_generic_final_link): Allocate NULL symbol before + actually mapping the output sections. + +Fri Jul 24 11:24:29 1998 Jeffrey A Law (law@cygnus.com) + + + * elf-m10300.c (mn10300_elf_howto): Add R_MN10300_24 entry. + (mn10300_elf_reloc_map): Similarly. + (mn10300_elf_final_link_relocate): Handle R_MN10300_24. + +Fri Jul 24 12:36:04 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf32-mips.c (elf_mips_howto_table): Add reloc types used on + Irix 6. + (bfd_elf32_bfd_reloc_type_lookup): Add default case. + * elf64-mips.c: Replace all uses of mips_elf64_reloc_type with + elf_mips_reloc_type defined in elf/mips.h. + +1998-07-24 Ulrich Drepper <drepper@cygnus.com> + + * elf64-mips.c: Remove reloc_type definition completely. It's now + in elf/mips.h. + +Thu Jul 23 13:33:19 1998 Doug Evans <devans@canuck.cygnus.com> + + * elf64-mips.c (mips_elf64_reloc_type): #if 0 out more relocations + as they are defined in elf/mips.h now. + +Thu Jul 23 11:29:43 1998 Jeffrey A Law (law@cygnus.com) + + + * Re-add lost change: + * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field + "movm_stack_size". + (mn10300_elf_relax_section): Include stack space for register saves + in the imm8 field of a "call" instruction. + (compute_function_info): Determine how much stack is allocated by + the movm instruction. Fix typo. + (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size. + +Thu Jul 23 11:38:05 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf32-sparc.c (elf_backend_got_header_size): Define as 4. + * elf64-sparc.c (elf_backend_got_header_size): Define as 8. + +1998-07-22 Ulrich Drepper <drepper@cygnus.com> + + * elf32-ppc.c: Change use of pp_reloc_type to elf_ppc_reloc_type. + +Wed Jul 22 16:27:18 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-hppa.h: Let ELF header define the enum containing the + external reloc numbers. + * elf32-i386.h: Likewise. + +1998-07-22 14:57 Ulrich Drepper <drepper@cygnus.com> + + * elf-m10300.c: Let ELF header now define the macros to get the enum. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + +Wed Jul 22 13:53:52 1998 Nick Clifton <nickc@cygnus.com> + + * bfd-in2.h: Change type of 'class' parameter to 'unsigned int' in + bfd_coff_set_symbol_class(), in order to avoid K&R compatability + prblems. + * bfd-in.h: Regenerate. + * coffgen.c (bfd_coff_set_symbol_class): Change type of 'class' + parameter to 'unsigned int' to avoid K&R compatability problems. + +Wed Jul 22 16:43:24 1998 Ian Lance Taylor <ian@cygnus.com> + + * ieee.c (ieee_find_nearest_line): Change filename_ptr and + functionname_ptr to be const. Change line_ptr to be unsigned. + + * coffcode.h (coff_link_output_has_begun): Simplify handling when + macro is not defined. Change second parameter from bfd_link_info + to coff_final_link_info. Add prototype. + (coff_final_link_postscript): Simplify handling when macro is not + defined. Add prototype. + +1998-07-22 13:08 Ulrich Drepper <drepper@cygnus.com> + + * elf-mn10300.c: Before include system specific ELF header define + START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + +Wed Jul 22 13:46:51 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf64-mips.c (mips_elf64_reloc_type): Copy Ulrich's elf32-mips.c + temporary patch over to elf64-mips.c as well. + +1998-07-21 Ulrich Drepper <drepper@cygnus.com> + + * elf32-mips.c (reloc_type): Temporarily disable definition of + standard relocation since they are now defined in elf/mips.h. + +Tue Jul 21 09:47:00 1998 Catherine Moore <clm@cygnus.com> + + * elf-m10200.c (mn10200_elf_final_link_relocate): + Modify range test for case R_MN10200_8. + + * elf-m10300.c (mn10300_elf_final_link_relocate): + Modify range test for case R_MN10300_8. + +Mon Jul 20 18:50:54 1998 Richard Henderson <rth@cygnus.com> + + * elf-bfd.h (struct elf_backend_data): Add got_ & plt_header_size. + * elf32-i386.c (elf_backend_got_header_size): Define. + (elf_backend_plt_header_size): Define. + * elf32-m68k.c, elf32-mips.c, elf32-ppc.c: Likewise. + * elf32-sparc.c, elf64-alpha.c, elf64-sparc.c: Likewise. + * elfxx-target.h: Provide a default of zero. + * elflink.c (_bfd_elf_create_got_section): Use got_header_size. + * elflink.h (elf_gc_common_finalize_got_offsets): Likewise. + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't remove a PLT + entry from an executable, even if the plt refcount goes to 0. + +Mon Jul 20 12:47:26 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * aoutx.h (NAME(aout,find_nearest_line)): Also remember the + directory name at the line number. + + * elf.c (_bfd_elf_find_nearest_line): Also consider symbols + with an unspecified type. + +Wed Jul 15 11:20:01 1998 Ian Lance Taylor <ian@cygnus.com> + + * sunos.c: Add undef of valid to avoid problem on SunOS. + +Tue Jul 14 15:30:59 1998 Richard Henderson <rth@cygnus.com> + + * config.bfd (i?86-pc-beos{pe,elf,}*): Recognize. + +Tue Jul 14 11:22:21 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf32-m68k.c (elf_m68k_check_relocs): Also reference count + R_68K_PCxx and R_68K_xx relocations. Make sure that + ELF_LINK_HASH_NEEDS_PLT is always set for a PLT reloc reference. + (elf_m68k_gc_sweep_hook): Also reference count R_68K_PCxx and + R_68K_xx relocations. + (elf_m68k_adjust_dynamic_symbol): Reset the plt offset of a symbol + that has no plt entry. + (elf_m68k_relocate_section): Ignore the plt offset in a static + link. + * elflink.h (elf_adjust_dynamic_symbol): Reset the plt offset for + an ignored symbol. + (elf_gc_common_finalize_got_offsets): Set the got offsets also in + a static link. + + * elf32-m68k.c (R_68K_GNU_VTINHERIT, R_68K_GNU_VTENTRY): New reloc + types. + (howto_table, reloc_map): Add entries for them. + (elf_m68k_check_relocs): Handle them. Implement reference + counting for got and plt entries. + (elf_m68k_gc_mark_hook, elf_m68k_gc_sweep_hook): New functions. + (elf_m68k_adjust_dynamic_symbol): Handle unreferenced plt + symbols. + (rtype_to_howto_rel, elf_info_to_howto_rel): Delete. + (elf_m68k_relocate_section): Handle the new reloc types. + (bfd_elf32_bfd_final_link, elf_backend_gc_mark_hook, + elf_backend_gc_sweep_hook, elf_backend_can_gc_sections): Define. + * elflink.h (elf_link_add_object_symbols): When creating an + indirect reference for symbol versioning also copy the plt + offset. + (elf_fix_symbol_flags): When clearing the ELF_LINK_HASH_NEEDS_PLT + flag also reset the plt offset. + (elf_link_assign_sym_version): Likewise. + (elf_gc_common_finalize_got_offsets): Increment the got offset by + the size of the entry in bytes. + (elf_gc_allocate_got_offsets): Likewise. + +Tue Jul 14 11:18:14 1998 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_gc_sections): Return true rather than falling off + the bottom. + + * coffgen.c (bfd_coff_set_symbol_class): Call bfd_alloc, not + xmalloc. + +Mon Jul 13 11:06:31 1998 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c: Supress definition of TARGET_UNDERSCORE and add a + comment describing when it should be enabled. + Changed definition of USER_LABEL_PREFIX to "", to fall into line + with GCC sources. + +Mon Jul 13 13:06:54 1998 Ian Lance Taylor <ian@cygnus.com> + + * ieee.c (ieee_slurp_external_symbols): Handle call optimization + information ATN records. + +Fri Jul 10 16:31:06 1998 Ian Lance Taylor <ian@cygnus.com> + + * ieee.c (ieee_slurp_external_symbols): Select an appropriate + section for an absolute symbol in a fully linked file. Based on + patch from Christian Holland <CHolland@de.lucent.com>. + +Wed Jul 8 11:29:56 1998 Manfred Hollstein <manfred@s-direktnet.de> + + * coff-m88k.c (m88k_special_reloc): Don't lose the information + that a symbol is undefined. + +Tue Jul 7 21:47:02 1998 Jeffrey A Law (law@cygnus.com) + + * som.c (som_bfd_gc_sections): Define. + +Mon Jul 6 11:35:50 1998 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (aoutarm_std_reloc_howto): Do not complain about + overflows in ARM_26D patches, since they have already been + implmented. Patch submitted by Dr. R.J. Black <rjb@dcs.gla.ac.uk> + +Sat Jul 4 12:25:36 1998 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_write_object_contents): If we have any long + section names, call coff_write_symbols even if there are no + symbols. + +Fri Jul 3 13:11:35 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (copy_private_bfd_data): Only set phdr_included once for a + PT_LOAD segment, rather than only setting it once for the entire + file. + + * elf.c (_bfd_elf_make_section_from_shdr): When setting the LMA, + rather than ignoring every phdr with a p_paddr of 0, ignore all + the phdrs if they all have a p_paddr of 0. + + * stabs.c (_bfd_write_stab_strings): Check whether the .stabstr + section was discarded from the link. + +Fri Jul 3 14:39:05 1998 J"orn Rennecke <amylaar@cygnus.co.uk> + + * coff-sh.c (sh_insn_uses_freg): Ignore lowest bit of register number. + +Fri Jul 3 14:35:48 1998 J"orn Rennecke <amylaar@cygnus.co.uk> + + * coff-sh.c (sh_insns_conflict): Load of fpscr conflicts with + floating point operations. + +Thu Jul 2 18:37:25 1998 Ian Lance Taylor <ian@cygnus.com> + + * cofflink.c (_bfd_coff_link_input_bfd): Skip undefined global + function symbols. + +Thu Jul 2 14:59:42 1998 Klaus Kaempf <kkaempf@rmi.de> + + Merge of vax/vms (read-only) support + * configure.com: Support Vax target. + * makefile.vms: Support Vax target. + * vms.h: Renamed from evax.h, merged vax/vms (read-only) support. + * vms.c: Renamed from evax-alpha.c, merged vax/vms (read-only) + support. + * vms-hdr.c: Renamed from evax-emh.c, merged vax/vms (read-only) + support. + * vms-gsd.c: Renamed from evax-egsd.c, merged vax/vms (read-only) + support. + * vms-tir.c: Renamed from evax-etir.c, merged vax/vms (read-only) + support. + * vms-misc.c: Renamed from evax-misc.c, merged vax/vms (read-only) + support. + * libbfd.c (real_read): Use unbuffered read on VMS/Vax. + * targets.c (bfd_target_ovax_flavour): New flavour. + (vms_alpha_vec): Renamed from evax_alpha_vec. + (vms_vax_vec): New. + (target_vector): Update accordingly. + * config.bfd (alpha*-*-*vms*): Use vms_alpha_vec, not + evax_alpha_vec. + (vax*-*-*vms*): New target. + * Makefile.am: Update for renamed files. Rebuild dependencies. + * bfd-in2.h: Rebuild. + * configure.in, Makefile.in, aclocal.m4: Rebuild. + +Thu Jul 2 13:31:55 1998 Ian Lance Taylor <ian@cygnus.com> + + Based on patch from Matt Semersky <matts@scd.hp.com>: + * linker.c (_bfd_generic_final_link): Force a trailing NULL + pointer on abfd->outsymbols. + (generic_add_output_symbol): Handle NULL sym parameter. + +Wed Jul 1 17:05:53 1998 Nick Clifton <nickc@cygnus.com> + + * elf.c (copy_private_bfd_data): Add support for changing VMA or + LMA of sections. + +Wed Jul 1 16:58:50 1998 Ian Lance Taylor <ian@cygnus.com> + + * coff-sh.c (sh_relax_delete_bytes): Correct address comparisons + when handling 32 bit immediate relocs. + * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. + +Tue Jun 30 09:55:03 1998 Jeffrey A Law (law@cygnus.com) + + * section.c (STD_SECTION): Account for recently added gc_mark + field in struct asection. + + * elf-m10300.c (bfd_mn10300_elf_merge_private_bfd_data): New function. + (bfd_elf32_bfd_merge_private_bfd_data): Define. + +Thu Jun 25 18:31:41 1998 Richard Henderson <rth@cygnus.com> + + ELF Section-level Garbage Collection: + * bfd.c (bfd_gc_sections): New. + * aout-adobe.c: Hook to default implementation. + * aout-target.h, aout-tic30.c, binary.c, bout.c: Likewise. + * coff-alpha.c, coff-mips.c, coff-rs6000.c, coffcode.h: Likewise. + * evax-alpha.c, i386msdos.c, i386os9k.c, ieee.c: Likewise. + * ihex.c, nlm-target.h, oasys.c, ppcboot.c, srec.c: Likewise. + * tekhex.c, versados.c: Likewise. + * libbfd-in.h (_bfd_nolink_bfd_gc_sections): New. + * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_gc_sections. + + * reloc.c (BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY): New. + (bfd_generic_gc_sections): New. + * section.c (SEC_KEEP): New. + (asection): Add gc_mark member. + + * elfcode.h (elf_gc*): New name remappings. + * elflink.h (elf_link_input_bfd): Don't set contents on stabs + sections to be excluded. + (elf_gc_mark, elf_gc_sweep, elf_gc_sweep_symbol): New. + (elf_gc_propogate_vtable_entries_used): New. + (elf_gc_smash_unused_vtentry_relocs): New. + (elf_gc_sections, elf_gc_record_vtinherit, elf_gc_record_vtentry): New. + (elf_gc_common_finalize_got_offsets): New. + (elf_gc_allocate_got_offsets, elf_gc_common_final_link): New. + * elfxx-target.h: Add and default gc hooks. + + * elf-bfd.h (struct elf_link_hash_entry): Swap got_offset/plt_offset + for unions. + (struct elf_obj_tdata): Likewise for local_got_offsets. + * elf.c, elf-i386.c, elf32-m68k.c, elf32-mips.c: Update all uses. + * elf32-ppc.c, elf32-sparc.c, elf64-alpha.c: Likewise. + * elf64-sparc.c, elflink.h: Likewise. + + * elf-bfd.h (struct elf_link_hash_entry): Add vtable members. + (ELF_LINK_HASH_MARK): Define. + (struct elf_backend_data): Add GC hooks. + * elf.c (_bfd_elf_link_hash_newfunc): Zero vtable members. + + * elf-m10300.c (mn10300_elf_check_relocs): New. + (mn10300_elf_gc_mark_hook): New. + (R_MN10300_GNU_VTINHERIT, R_MN10300_GNU_VTENTRY): New. + (elf_mn10300_howto, mn10300_reloc_map): Handle them. + (mn10300_elf_final_link_relocate): Likewise. + (mn10300_elf_relocate_section): Likewise. + (elf_backend_can_gc_sections): Define. + * elf32-mips.c (R_MIPS_GNU_VTINHERIT, R_MIPS_GNU_VTENTRY): New. + (elf_mips_gnu_vtinherit_howto, elf_mips_gnu_vtentry_howto): New. + (bfd_elf32_bfd_reloc_type_lookup): Handle them. + (mips_info_to_howto_rel): Likewise. + (mips_elf_relocate_section): Likewise. + (mips_elf_check_relocs): Likewise. + (mips_elf_gc_mark_hook, mips_elf_gc_sweep_hook): New. + (elf_backend_can_gc_sections): Define. + * elf32-ppc.c (R_PPC_GNU_VTINHERIT, R_PPC_GNU_VTENTRY): New. + (ppc_elf_howto_raw): Handle them. + (ppc_elf_reloc_type_lookup): Likewise. + (ppc_elf_relocate_section): Likewise. + (ppc_elf_check_relocs): Reference count .got and .plt entries. + Handle new vtable relocs. + (ppc_elf_adjust_dynamic_symbol): Recognize unused .plt entries. + (ppc_elf_gc_mark_hook, ppc_elf_gc_sweep_hook): New. + (elf_backend_can_gc_sections): Define. + +Fri Jun 26 10:48:23 1998 Jeffrey A Law (law@cygnus.com) + + * archures.c (bfd_mach_mn10300): Define. + * elf-m10300.c: Include elf/mn10300.h + (elf_mn10300_mach): New function. + (_bfd_mn10300_elf_final_write_processing): Likewise. + (_bfd_mn10300_elf_object_p): Likewise. + (elf_backendfinal_write_processing): Define. + (elf_backend_object_p): Likewise. + +Thu Jun 25 18:31:08 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_perform_relocation): Fix HI16_S + relocation. + +Wed Jun 24 17:17:57 1998 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_bfd_final_link): Loop over input_bfds using the + link_next field, not the next field. + +Sun Jun 21 19:38:39 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (map_sections_to_segments): Check the section address + against the phdr size both with and without a modulo of + maxpagesize. + +Fri Jun 19 17:08:18 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf32-mips.c (mips_elf_size_dynamic_sections): Only strip a + linker created empty input section if the output section has the + same name. + + * elflink.h (elf_link_output_extsym): Print an error message if + _bfd_elf_section_from_bfd_section fails. + + * elf.c (_bfd_elf_section_from_bfd_section): Call bfd_set_error on + failure. + +Tue Jun 16 11:55:55 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (copy_private_bfd_data): Improve handling of Solaris + native linker output. Avoid putting an empty section in more than + one segment. + +Fri Jun 12 13:30:17 1998 Tom Tromey <tromey@cygnus.com> + + * po/Make-in (all-yes): If maintainer mode, depend on .pot file. + ($(PACKAGE).pot): Unconditionally depend on POTFILES. + +Fri Jun 12 13:34:02 1998 Doug Evans <devans@canuck.cygnus.com> + + * elf.c (swap_out_syms): New arg relocatable_p. + Don't add section VMA to symbols for relocatable output. + (_bfd_elf_compute_section_file_positions): Update call to + swap_out_syms. + +Mon Jun 8 15:20:57 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_perform_relocation): Make comparisons + against 'addend' be signed rather than unsigned. + +Sat Jun 6 00:31:21 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-m32r.c: Add prototyps for static functions. + + * coff-arm.c: Add prototypes for static functions. + +Fri Jun 5 17:21:51 1998 Nick Clifton <nickc@cygnus.com> + + * elf.c (elf_sort_sections): Sort by LMA first then VMA, since the + LMA is used to order sections in a segment. + + * elf32-v850.c: Add prototypes for static functions. + Change type of addend parameter to bfd_vma in various functions. + +Fri Jun 5 18:09:58 1998 Ian Lance Taylor <ian@cygnus.com> + + * aoutx.h (howto_table_ext): Change RELOC_BASE13 to use + complain_overflow_signed instead of complain_overflow_bitfield. + +Fri Jun 5 15:11:11 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf.c (elf_map_symbols): Don't add section VMA to symbol value + when comparing against 0. + +Wed Jun 3 17:52:49 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am (config.status): New target. + * Makefile.in: Rebuild. + +Wed Jun 3 12:18:24 1998 Stan Cox <scox@equinox.cygnus.com> + + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Give an + error if previous object endianness doesn't match current object. + +Tue Jun 2 17:50:59 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_print_private_bfd_data): Call + _bfd_elf_print_private)bfd_data (). + +Tue Jun 2 15:29:35 1998 Ian Lance Taylor <ian@cygnus.com> + + * elflink.h (elf_merge_symbol): Don't always set type_change_ok + and size_change_ok. + (elf_link_add_object_symbols): Set type_change_ok and + size_change_ok before calling elf_merge_symbol. + + * elf32-mips.c (mips_elf_relocate_section): If we issue an + undefined symbol error, don't also issue an overflow error. + +Tue Jun 2 13:51:00 1998 Geoff Keating <geoffk@ozemail.com.au> + + * elf32-ppc.c (ppc_elf_relocate_section): The target of an + R_PPC_LOCAL24PC relocation should be local; if not, print an error + message instead of crashing. + +Mon Jun 1 18:23:12 1998 Yuli Barcohen <yuli.barcohen@telrad.co.il> + + * archures.c (bfd_mach_cpu32): Define. + (bfd_default_scan): Add case for 68060. Fix 68332 case to use + bfd_mach_cpu32. + * cpu-m68k.c (arch_info_struct): Add m68k:cpu32. + * ieee.c: Include <ctype.h>. + (ieee_object_p): Parse out process ID string to make it more + likely to be acceptable for bfd_scan_arch. + * bfd-in2.h: Rebuild. + +Mon Jun 1 11:12:02 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-m32r.c (m32r_elf_print_private_bfd_data): Also call + _bfd_elf_print_private_bfd_data() so that the program header will + be displayed. + +Mon Jun 1 12:14:28 1998 Ian Lance Taylor <ian@cygnus.com> + + * peicode.h (coff_swap_sym_in): Check for C_SECTION rather than + 0x68. Reindent. Add some comments. + +Fri May 29 09:58:08 1998 Nick Clifton <nickc@cygnus.com> + + * elf.c (copy_private_bfd_data): Adjust physical address of + segment in output BFD to contain LMAs of its sections. + +Tue May 26 19:37:47 1998 Stan Cox <scox@equinox.cygnus.com> + + * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, + elf32_sparc_relocate_section): Added R_SPARC_32LE for little + endian data 32 bit relocations. + (elf32_sparc_merge_private_bfd_data): Check if linking little + endian objects with big endian objects. + (elf32_sparc_object_p): Set bfd_mach_sparc_sparclite_le. + (elf32_sparc_final_write_processing): Set EF_SPARC_LEDATA in e_flags. + * libbfd.h (bfd_reloc_code_real_names): Added BFD_RELOC_SPARC_32LE. + * reloc.c: Same. + * cpu-sparc.c (arch_info_struct): Added sparc:sparclite_le + * archures.c (bfd_mach_sparc_sparclite_le): New. + * bfd-in2.h (BFD_RELOC_SPARC_32LE, bfd_mach_sparc_sparclite_le): New. + +Thu May 21 16:59:28 1998 Nick Clifton <nickc@cygnus.com> + + * peicode.h (add_data_entry): Fix precedence of operators in if () + statement. + +Tue May 19 18:41:19 1998 Ian Lance Taylor <ian@cygnus.com> + + * bfd-in.h: Move over patch to bfd-in2.h. + + * reloc.c (bfd_check_overflow): Add casts before shifts which may + not fit in 32 bits. + (_bfd_relocate_contents): Likewise. + +Mon May 18 14:44:15 1998 Nick Clifton <nickc@cygnus.com> + + * peicode.h (add_data_entry): If the section has no private data + then do not create a Data Dictionary entry for it. + +Mon May 18 00:09:28 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_relax_section): Set again on changes. + (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots, + elf64_alpha_size_got_sections): Rewrite, handling multiple got + subsections during relaxation more correctly. + +Thu May 14 14:22:58 1998 Nick Clifton <nickc@cygnus.com> + + * bfd-in2.h: Add new prototype: bfd_coff_set_symbol_class (). + Add extra argument to bfd_arm_process_before_allocation (). + * bfd-in.h: Reflect changes made in bfd-in2.h. + * coffgen.c (bfd_coff_set_symbol_class): New function. Set the + coff class of a BFD symbol. + * coff-arm.c: Add support for interworking between Thumb code and + non-interworking aware ARM code. + +Sun May 10 22:33:59 1998 Jeffrey A Law (law@cygnus.com) + + * po/Make-in (install-info): New target. + +Thu May 7 17:40:56 1998 Ian Lance Taylor <ian@cygnus.com> + + * filemode.c: Remove; not used. + + If sysdep.h includes a header file, don't include it again: + * aix386-core.c: Don't include <stdio.h>, <stddef.h>, or + <errno.h>. + * aoutx.h: Don't include <string.h>. Use "sysdep.h" rather than + <sysdep.h>. + * archive.c: Don't include <string.h> or <errno.h>. + * evax-alpha.c; Don't include <stdio.h>. + * evax-egsd.c: Likewise. + * evax-etir.c: Likewise. + * evax-misc.c: Likewise. + * evax-emh.c: Likewise. Also, don't include <sys/types.h>. + * hppabsd-core.c: Don't include <stdio.h>, <sys/types.h>, or + <errno.h>. + * hpux-core.c: Likewise. + * netbsd-core.c: Likewise. + * som.c: Likewise. + * libbfd.c: Don't include <sys/types.h>. + * nlmcode.h: Don't include <string.h>. + * osf-core.c: Don't include <string.h> or <stdio.h>. + * ptrace-core.c: Don't include <stdio.h>, <sys/types.h>, + <errno.h>, or <unistd.h>. + * trad-core.c: Don't include <stdio.h> or <sys/types.h>. + +Thu May 7 13:12:50 1998 Klaus Kaempf <kkaempf@progis.de> + + * configure.com: If the version number can not be found in + configure.in, set it to "unknown" rather than "2.8.1". + +Wed May 6 09:46:05 1998 Gavin Koch <gavin@cygnus.com> + + * elf32-mips.c (elf_mips_mach): New. + (_bfd_mips_elf_object_p): Use elf_mips_mach. + (_bfd_mips_elf_final_write_processing): Use the names + of machines, rather than the numbers. Set both the ARCH + and MACH in e_flags. Handle a few more specific machines. + (_bfd_mips_elf_merge_private_bfd_data): Merge both + EF_MIPS_ARCH and EF_MIPS_MACH. + +Tue May 5 21:01:53 1998 Richard Henderson <rth@cygnus.com> + + * syms.c (bfd_is_local_label): Revert last change. + * srec.c (srec_write_symbols): Discard debugging symbols. + +Tue May 5 23:36:06 1998 Ian Lance Taylor <ian@cygnus.com> + + * som.c: Include <ctype.h>. + * som.h: Don't include sysdep.h. + +Tue May 5 18:29:24 1998 Tom Tromey <tromey@cygnus.com> + + * libbfd.h: Rebuilt. + * libbfd-in.h: Removed gettext includes and defines. + * sysdep.h: Moved gettext-related includes and defines here. + +Tue May 5 16:47:54 1998 Richard Henderson <rth@cygnus.com> + + * srec.c (srec_write_symbols): Use bfd_is_local_label rather than + an ad-hoc test. Kill bogus #if 0 code. + * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local. + +Mon May 4 16:10:33 1998 Ian Lance Taylor <ian@cygnus.com> + + * sunos.c (sunos_check_dynamic_reloc): Don't use the PLT address + when generating a normal executable for a symbol defined in a + regular file. When copying a reloc into the output file, adjust + the addend for a PC relative reloc against a global symbol. + +Mon May 4 10:08:18 1998 Tom Tromey <tromey@cygnus.com> + + * libbfd.h: Rebuilt. + * libbfd-in.h (_): Define as dgettext. + +Mon May 4 11:02:23 1998 Ian Lance Taylor <ian@cygnus.com> + + * coff-arm.c (coff_arm_relocate_section): Cast to bfd_signed_vma, + not signed. + * peicode.h (pe_saved_coff_bfd_print_private_bfd_data): Use PARAMS + when declaring parameter types. + (pe_saved_coff_bfd_copy_private_bfd_data): Likewise. + +Wed Apr 29 15:35:03 1998 Ian Lance Taylor <ian@cygnus.com> + + * config.bfd: If we include any ELF targets in targ_defvec and/or + targ_selvecs, then add the generic ELF targets to targ_selvecs. + * elf32-gen.c (dummy): New static const variable. + (elf_generic_info_to_howto): New static function. + (elf_generic_info_to_howto_rel): New static function. + (elf_info_to_howto): Define as elf_generic_info_to_howto. + (elf_info_to_howto_rel): Define as elf_generic_info_to_howto_rel. + * elf64-gen.c: Same changes as elf32-gen.c. + * elfcode.h (elf_object_p): For the generic target, ignore a + failure of bfd_default_set_arch_mach. Fix indentation a bit. + +Tue Apr 28 20:05:52 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in (WIN32LIBADD): Add -lintl on cygwin32. + * configure: Rebuild. + +Tue Apr 28 12:16:57 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * config.bfd: Update OSR5/Unixware patterns. + +Mon Apr 27 18:02:24 1998 Richard Henderson <rth@cygnus.com> + + * elf.c (assign_file_positions_for_segments): Allow for holes + between sections added by a link script. + +Mon Apr 27 11:49:55 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Change version number to 2.9.4 + * configure: Rebuild. + + Based on patch from H.J. Lu <hjl@gnu.org>: + * elf.c (bfd_elf_get_bfd_needed_list): New function. + * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare. + * bfd-in2.h: Rebuild. + +Sat Apr 25 20:07:53 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (struct alpha_relax_info): Replace elfsym with other. + Change all users. + +Sat Apr 25 18:29:07 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (struct alpha_relax_info): Add tsec & elfsym members. + (elf64_alpha_relax_section): Fill them in. + (elf64_alpha_relax_opt_call): Implement more than a stub. + (elf64_alpha_add_symbol_hook): Don't set SEC_LOAD or default + alignment on .scommon. + (elf64_alpha_merge_gots): Merge use counts as well. + +Sat Apr 25 14:07:29 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_relax_section): Use the proper section + for calculating a local symbol's address. + (elf64_alpha_calc_got_offsets): Skip entries with 0 use count. + Set the .got's cooked size as well as the raw size. + +Fri Apr 24 09:16:00 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_print_private_bfd_data): Add + internationalisation of printed information. + + * coff-arm.c (coff_arm_print_private_bfd_data): Add + internationalisation of printed information. + +Fri Apr 24 12:09:18 1998 Ian Lance Taylor <ian@cygnus.com> + + * syms.c (struct indexentry): Change directory_name, file_name, + and function_name fields to char *. + (struct stab_find_info): Change cached_file_name field to char *. + +Thu Apr 23 08:13:04 1998 Nick Clifton <nickc@cygnus.com> + + * peicode.h (dir_names): Add missing N_() macros to dir_names array. + +Wed Apr 22 13:06:15 1998 Tom Tromey <tromey@cygnus.com> + + * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). + +Wed Apr 22 17:48:48 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am (install-data-local): Make $(includedir). + * Makefile.in: Rebuild. + +Wed Apr 22 13:06:15 1998 Tom Tromey <tromey@cygnus.com> + + * libbfd-in.h: Use `gettext' and not `dgettext' for now. + +Wed Apr 22 12:53:40 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am (INCLUDES): Add -I$(srcdir)/../intl -I../intl. + * Makefile.in: Rebuild. + + * bfd-in2.h: Rebuild for Nick's changes. + +Tue Apr 21 23:11:51 1998 Richard Henderson <rth@cygnus.com> + + * archive.c (_bfd_generic_read_ar_hdr_mag): Fix lossage in last + change wrt length == max_namelen. + +Tue Apr 21 21:19:36 1998 Tom Tromey <tromey@scribbles.cygnus.com> + + * Many files: Added gettext invocations around user-visible + strings. + * libbfd-in.h: Added gettext includes and defines. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, + HAVE_LC_MESSAGES): Define. + * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and + po/Makefile. + * Makefile.am (SUBDIRS): Added po. + (POTFILES): New macro. + (po/POTFILES.in): New target. + (SOURCE_HFILES): New macro. + (HFILES): Use it. + * po/Make-in, po/POTFILES.in, po/bfd.pot: New files. + +Tue Apr 21 13:38:18 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elfcore.h (bfd_prstatus): Copy core_prstatus from the first + NT_PRSTATUS note section encountered, it contains the status of + the currently executing thread when the core file was written. + +Tue Apr 21 10:00:12 1998 Nick Clifton <nickc@cygnus.com> + + * libcoff.h: Add extra parameter to + bfd_coff_link_output_has_begun overrideable function. + * cofflink.c: Pass extra parameter to + bfd_coff_link_output_has_begun function. + * bfd-in.h: Add prototypes for exported ARM interworking + functions. + * peicode.h: ARM specific code reorganised to conform to BFD + coding conventions. + * coffcode.h: ARM specific code reorganised to conform to BFD + coding conventions. + * coff-arm.c: Code reorganised to conform to the BFD coding + conventions. Global variables have been moved into an ARM + specific hash table structure and a new function: + bfd_arm_get_bfd_for_interworking() has been created which is + called from the linker scripts. + +Tue Apr 21 00:11:51 1998 Richard Henderson <rth@cygnus.com> + + * archive.c (_bfd_generic_read_ar_hdr_mag): Simplify end-of-name test. + + * elf64-alpha.c (elf64_alpha_find_reloc_at_ofs): Renamed from + elf64_alpha_relax_find_reloc_ofs. Changed all callers. + (elf64_alpha_add_symbol_hook): Put small commons in .scommon not .sbss. + (elf64_alpha_size_got_sections): Don't merge .got sections twice. + +Sat Apr 18 01:21:04 1998 Stan Cox <scox@cygnus.com> + + * config.bfd: Added sparc86x support. + +Fri Apr 17 22:29:04 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf32-mips.c (mips_elf_relocate_section): Do not complain about + an out of range pc-relative jump/call to an undefined weak symbol. + +Thu Apr 16 13:49:00 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c (elf64_alpha_do_reloc_gpdisp): Do all gpdisp + comparisons signed. + +Thu Apr 16 11:43:33 1998 Ian Lance Taylor <ian@cygnus.com> + + * archive.c (bfd_generic_archive_p): If a slurp subroutine returns + an error other than bfd_error_system_call, set the error to + bfd_error_wrong_format. + + * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add + bfd_elf32_powerpcle_vec. + + * elf.c (copy_private_bfd_data): If all the p_paddr fields in the + program segments are zero, don't set p_paddr_valid. + +Wed Apr 15 22:15:16 1998 Richard Henderson <rth@cygnus.com> + + * elf64-alpha.c: Initial implementation of relaxation -- + (struct alpha_elf_link_hash_entry): Add use_count member. + (elf64_alpha_check_relocs): Initialize and increment it. + (elf64_alpha_can_merge_gots): Check it when considering merging. + (elf64_alpha_merge_gots): Drop entries with zero use. + (elf64_alpha_calc_got_offsets_for_symbol): Likewise. + (elf64_alpha_always_size_sections): Split out got sizing ... + (elf64_alpha_size_got_sections): ... here. New function. + (elf64_alpha_relax_find_reloc_ofs): New function. + (elf64_alpha_relax_with_lituse): Likewise. + (elf64_alpha_relax_without_lituse): Likewise. + (elf64_alpha_relax_opt_call): Likewise. + (elf64_alpha_relax_section): Likewise. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_howto_table): Implement GPRELHIGH/LOW & IMMED_GP_16. + (elf64_alpha_relocate_section): Likewise. + (bfd_elf64_bfd_relax_section): Define. + (elf_backend_add_symbol_hook): Likewise. + +Wed Apr 15 16:08:46 1998 Richard Henderson <rth@cygnus.com> + + * elf.c (prep_headers): Use new EM_SPARCV9 symbol. + * elf64-sparc.c (ELF_MACHINE_CODE): Likewise. + (ELF_MACHINE_ALT1): New. Set to EM_OLD_SPARC64. + +Wed Apr 15 11:34:33 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Add -lkernel32 to WIN32LIBADD on cygwin32. + * configure: Rebuild. + +Mon Apr 13 16:46:27 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am (libbfd_la_LIBADD): Add @WIN32LIBADD@. + (libbfd_la_LDFLAGS): Add @WIN32LDFLAGS@. + * configure.in: Define and substitute WIN32LDFLAGS and + WIN32LIBADD. + * aclocal.m4: Rebuild with new libtool. + * configure, Makefile.in: Rebuild. + +Fri Apr 10 13:44:27 1998 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol + before any other symbols in the same section. + +Wed Apr 8 14:50:23 1998 Michael Meissner <meissner@cygnus.com> + + * config.bfd (powerpc*-*-*): Remove PowerPC NT support from ELF + systems. + +Tue Apr 7 16:25:31 1998 Gavin Romig-Koch <gavin@cygnus.com> + + * dwarf2.c (comp_unit): Move it earlier in the source. Add + addr_size. + (read_address): Replace 'bdf*' argument with 'comp_unit*' argument. + Use addr_size for address size, rather than sizeof(bfd_vma). + (read_attribute): Replace bdf* argument with 'comp_unit*' argument. + Fix call to read_address. + (decode_line_info): Replace bdf* argument with 'comp_unit*' argument. + Scrap other unneeded arguments. Fix call to read_address. + (scan_unit_for_functions): Fix call to read_attribute. + (parse_comp_unit): We now handle more values for addr_size. + Set addr_size in unit. Fix call to read_attribute and + decode_line_info. + +Tue Apr 7 15:44:47 1998 Gavin Romig-Koch <gavin@cygnus.com> + + * dwarf2.c (parse_comp_unit): Drop use of unit->name when it is null. + +Tue Apr 7 12:35:18 1998 Ian Lance Taylor <ian@cygnus.com> + + * archures.c (bfd_default_scan): Add m68k cases back to default + switch, reverting patch of March 25, since IEEE support depends + upon them. + +Mon Apr 6 14:06:40 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am (diststuff): New target. + * Makefile.in: Rebuild. + +Sun Apr 5 16:21:44 1998 Jeffrey A Law (law@cygnus.com) + + * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of + som_offset when we have an extended name table. + +Sun Apr 5 16:04:39 1998 H.J. Lu <hjl@gnu.org> + + * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before + trying to copy it. + * Makefile.in: Rebuild. + +Fri Apr 3 11:09:42 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section + symbols when creating a shared library. + (elf_m68k_adjust_dynindx): New function, used by above code. + (elf_m68k_finish_dynamic_sections): Initialize the section + symbols. + (elf_m68k_relocate_section): Change abort to BFD_ASSERT. + +Wed Apr 1 16:04:02 1998 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (in_reloc_p): Use ARM_RVA32 in place of constant + value 11. + +Wed Apr 1 13:36:58 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix + assertion. + +Tue Mar 31 00:12:12 1998 Jeffrey A Law (law@cygnus.com) + + * elf-m10300.c (mn10300_elf_relax_section): Correctly handle + absolute symbols. + +Mon Mar 30 12:46:15 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Set version to 2.9.1. + * configure: Rebuild. + + * Branched binutils 2.9. + +Mon Mar 30 12:20:50 1998 Brent Baccala <baccala@freesoft.org> + + * syms.c (ENABLE_CACHING): Define. + (struct indexentry): Define. + (struct stab_cache): Remove. + (cmpindexentry): New static function. + (struct stab_find_info): Add new fields: indextable, + indextablesize, cached_indexentry, cached_offset, cached_stab, and + cached_file_name. Remove fields: file_cache, function_cache, and + line_cache. + (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted + index table and search it. + +Mon Mar 30 10:39:34 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (_bfd_elf_copy_private_section_data): Call + copy_private_bfd_data once we've seen the last SEC_ALLOC section. + + * cpu-mips.c: Remove trailing comma at end of enumeration list. + +Sat Mar 28 16:33:02 1998 Ian Lance Taylor <ian@cygnus.com> + + * coff-arm.c: Define all globally visible variables and functions + only when COFF_WITH_PE is not defined. + * configure.in (armpe_little_vec, armpe_big_vec): Add + coff-arm.lo. + * configure: Rebuild. + +Fri Mar 27 16:06:02 1998 Ian Lance Taylor <ian@cygnus.com> + + Fix some gcc -Wall warnings: + * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings. + * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise. + * archures.c (bfd_default_scan): Likewise. + * bfd.c (bfd_scan_vma): Likewise. + * binary.c (mangle_name): Likewise + * coff-arm.c (aoutarm_fix_pcrel_26): Likewise. + * coff-sh.c (sh_relocate_section): Likewise. + * coff-stgo32.c (create_go32_stub): Likewise. + * coffcode.h (coff_slurp_line_table): Likewise. + * ecoff.c (_bfd_ecoff_write_armap): Likewise. + * elf.c (_bfd_elf_make_section_from_shdr): Likewise. + (assign_file_positions_for_segments): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. + * oasys.c (oasys_write_sections): Likewise. + * ppcboot.c (ppcboot_object_p): Likewise. + (mangle_name): Likewise. + * riscix.c (riscix_fix_pcrel_26): Likewise. + * srec.c (srec_scan): Likewise. + * stabs.c (_bfd_write_section_stabs): Likewise. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to + switch. Declare parameters for function pointers. + * archures.c (bfd_default_scan): Add braces to avoid ambiguous if + warning. + * elf.c (elf_sort_sections): Likewise. + * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation. + Add default cases to switches. + (coff_arm_relocate_section): Remove unused local variables. + Always set rstat. + (coff_arm_bfd_set_private_flags): Change flag variable to type + flagword. + * coff-mips.c (mips_relocate_section): Initialize use_lo. + * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int. + (dump_toc): Change cat to const, and initialize it. + * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff. + * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_relocate_section): Initialize r_symndx. + * coffcode.h (coff_compute_section_file_positions): Only declare + old_sofar if ALIGN_SECTIONS_IN_FILE. + (coff_write_object_contents): Initialize csym. + * coffgen.c (coff_pointerize_aux): Make type and class unsigned. + * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to + switch. + * dwarf2.c: Include libiberty.h. + (read_2_signed_bytes, read_4_signed_bytes): Comment out. + (decode_line_info): Remove unused local variables. + * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise. + (m32r_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise. + (v850_elf_reloc): Likewise. + * elf-bfd.h (elf_linker_section_t): Make alignment unsigned. + (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned. + * elf.c (assign_file_positions_for_segments): Always set adjust. + * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully + parenthesize expression. + * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h. + (m32r_elf_object_p): Return a value. + (m32r_elf_print_private_bfd_data): Change fprintf format string. + * elf32-mips.c (mips_elf_final_link): Initialize last. + (mips_elf_finish_dynamic_sections): Initialize last and dindx. + * elf32-v850.c (v850_elf_object_p): Return a value. + (v850_elf_print_private_bfd_data): Change fprintf format string. + * elfcode.h (elf_slurp_symbol_table): Change symcount and i to + unsigned long. + * elflink.h (elf_link_add_object_symbols): Change vernum to + unsigned int, and initialize it. Change fprintf format string. + (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type + when setting or comparing to soname_indx. + (elf_create_pointer_linker_section): Change num_symbols to + unsigned int. + * libcoff-in.h (coff_data_type): Change flags to flagword. + * peicode.h (pe_print_idata): Initialize idx. Change j to + bfd_size_type. Initialize hint_member. Remove useless test to + time_stamp. + (pe_print_edata): Change num_functions and num_names in struct + EDT_type to unsigned long. Remove cast. Change fprintf format + string. + * ppcboot.c (ppcboot_object_p): Change i to size_t. + * reloc.c (bfd_get_reloc_size): Change return type to unsigned + int. + * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to + int *. Update uses. Change j to long. + * bfd-in2.h, libcoff.h: Rebuild. + +Fri Mar 27 10:10:46 1998 Catherine Moore <clm@cygnus.com> + + * elf32-v850.c Remove definition of USE_REL. + (v850_elf_info_to_howto_rela): New function. + (v850_elf_perform_relocation): Renamed from + v850_elf_store_addend_in_insn. Removed replace argument. + (v850_elf_reloc): store the relocation in the addend field instead + of the insn. + (v850_elf_final_link_relocate): Now calls + v850_elf_perform_relocation. + (v850_elf_relocate_section): Remove code to generate REL + relocations. + +Thu Mar 26 13:32:17 1998 Ian Lance Taylor <ian@cygnus.com> + + * coffcode.h (coff_new_section_hook): Set the type and storage + class in the native symbol information allocated for a new section + symbol. + +Thu Mar 26 10:13:41 1998 Nick Clifton <nickc@cygnus.com> + + * peicode.h: Chain together calls to + coff_bfd_copy_private_bfd_data and + coff_bfd_print_private_bfd_data. + + * coff-arm.c: Add prototypes for + coff_arm_bfd_print_private_bfd_data and + coff_arm_bfd_copy_private_bfd_data. + +Wed Mar 25 15:45:55 1998 Nick Clifton <nickc@cygnus.com> + + * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE + build. + + * peicode.h: Call arm-coff private data functions after handling + pe private data. + + * coff-arm.c: Turn statics into globals so that they can be shared + both pe and pei backends. + +Wed Mar 25 15:19:38 1998 Ian Lance Taylor <ian@cygnus.com> + + * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than + plain numbers. + (sunos_write_object_contents): Likewise. + * aoutx.h (NAME(aout,machine_type)): Likewise. + * coffcode.h (coff_set_arch_mach_hook): Likewise. + +Wed Mar 25 13:59:24 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * archures.c (bfd_mach_m68*): Add definitions for various m68k + variants. + (bfd_default_scan): Remove m68k special cases. + * bfd-in2.h: Rebuild. + * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather + than plain numbers. + * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise. + * cpu-m68k.c (arch_info_struct): Likewise. Add entry for + m68k:68000. + (bfd_m68k_arch): Set mach field to zero to signal no explicit + selection, change printable_name to just "m68k" and make that the + default instead of m68k:68020. + + * aout-tic30.c (NAME): Define this to avoid multiple definitions + from aoutx.h. + (MY_get_section_contents): Define as aout_32_get_section_contents + rather than NAME(aout,get_section_contents). + + * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast. + + * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha + and call bfd_default_set_arch_mach to do the real work. + +Wed Mar 25 10:41:35 1998 Richard Henderson <rth@cygnus.com> + + * bout.c (BALX): Include return register g14 as part of the insn. + (BALX_MASK): New. + (calljx_callback): Use it. + +Wed Mar 25 11:19:28 1998 Ian Lance Taylor <ian@cygnus.com> + + * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma. + * libbfd.h: Rebuild. + + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change + byte_count to unsigned int. + (mn10300_elf_relax_section): Initialize internal_relocs. Remove + unused local variables. + + * evax-alpha.c (evax_close_and_cleanup): Remove unused local + variables er and er1. + + * cpu-v850.c: Include <ctype.h>. + (scan): Case isdigit argument to unsigned char. + + From Yan Meroth <YAN.MEROTH@st.com>: + * ihex.c (ihex_scan): Add extbase variable so that getting an + extended linear address record does not ignore any previous + extended address. + (ihex_write_object_contents): When writing out an extended linear + address record, zero out any previous extended address. + +Tue Mar 24 16:09:43 1998 Manfred Hollstein <manfred@s-direktnet.de> + + * ieee.c (do_one): Check section before dereferencing it. + (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr. + (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive. + +Mon Mar 23 18:51:47 1998 Joel Sherrill <joel@OARcorp.com> + + * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF. + +Mon Mar 23 14:23:36 1998 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c: Add interworking functions to pe backends. + +Fri Mar 20 18:47:20 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Use AM_DISABLE_SHARED. + * aclocal.m4, configure: Rebuild with libtool 1.2. + +Fri Mar 20 11:25:41 1998 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (coff_arm_relocate_section): Better error messages + when interowrking conflucts occur. Courtesy of Jonathan Walton + and Tony Thompson. + (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted + relocations. Patch courtesy of Jonathan Walton and Tony + Thompson. + +Fri Mar 20 02:26:43 1998 Richard Henderson <rth@cygnus.com> + + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert + part of Feb 22 change controling when to override the existing + symbol with the .plt entry. + +Wed Mar 18 09:26:25 1998 Nick Clifton <nickc@cygnus.com> + + * config.bfd (targ_cpu): Add thumb-pe target. + + * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external + functions in PE build. + +Sun Mar 8 23:37:26 1998 Stan Cox <scox@equinox.cygnus.com> + + * config.bfd (sparclite-*-elf*): Added. + +Mon Feb 23 19:31:19 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Add elf.lo to elf shell variable. + * Makefile.am (BFD_LIBS): Remove elf.lo. + (BFD_LIBS_CFILES): Remove elf.c. + (BFD32_BACKENDS): Add elf.lo. + (BFD32_BACKENDS_CFILES): Add elf.c. + * configure, Makefile.in: Rebuild. + +1998-02-23 15:53 Richard Henderson <rth@cygnus.com> + + * elf32-i386.c (elf_i386_relocate_section): A pc-relative + relocation against a non-local symbol should not have a dynamic + relocation. + +Mon Feb 23 16:17:08 1998 Ian Lance Taylor <ian@cygnus.com> + + * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in + COFF filehdr flags. + (pe_print_private_bfd_data): Print PE flags. From Mikey + <jeffdb@netzone.com>. + +Sun Feb 22 20:39:00 1998 Richard Henderson <rth@cygnus.com> + + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create + a plt entry when we can determine that we authoritatively define + the symbol. + +Sun Feb 22 20:33:05 1998 Richard Henderson <rth@cygnus.com> + + * configure.in (COREFILE selection): Remove sparc-*-linux*. They + don't actually use trad-core, but a SunOS-style core file handled + by gdb directly. + * hosts/sparclinux.h: Remove. + +Wed Feb 18 15:31:06 1998 Ian Lance Taylor <ian@cygnus.com> + + * peicode.h (pe_print_idata): If there is no .idata section, look + for the import tables in some other section. Make the initial + label line up better with the data. Print the import address + table even if there is no import name table. If the import + address table holds actual addresses, print them. + +Tue Feb 17 12:58:34 1998 Ian Lance Taylor <ian@cygnus.com> + + * libbfd.c (bfd_seek): If fseek fails, save errno around call to + bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not + bfd_error_system_call. + +Fri Feb 13 13:11:33 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am (AUTOMAKE_OPTIONS): Define. + * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. + + From H.J. Lu <hjl@gnu.org>: + * Makefile.am (libbfd_la_LDFLAGS): Define. + * Makefile.in: Rebuild. + +Thu Feb 12 17:31:11 1998 Ian Lance Taylor <ian@cygnus.com> + + NetBSD patches from Gordon W. Ross <gwr@mc.com>: + * netbsd.h (MACHTYPE_OK): Define. + (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when + calling N_SET_MACHTYPE, rather than having a switch. + * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD, + and M_ALPHA_NETBSD. + * i386netbsd.c (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * m68k4knetbsd.c (SEGMENT_SIZE): Don't define. + (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * m68knetbsd.c: (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * ns32knetbsd.c (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * sparcnetbsd.c (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + + NetBSD patches from Gordon W. Ross <gwr@mc.com>: + * vaxnetbsd.c: New file. + * netbsd-core.c: Clean up. Remove unused macros. Use netbsd + rather than netbsd_core. + * targets.c (vaxnetbsd_vec): Declare. + (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is + defined, add netbsd_core_vec. + * configure.in: Set COREFILE for alpha*-*-netbsd* and + powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is + netbsd-core.lo, set COREFLAG to -DNETBSD_CORE. + * config.bfd (alpha*-*-netbsd*): New target. + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Add vaxnetbsd.lo. + (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c. + * configure, Makefile.in: Rebuild. + + * configure.host: Remove the old shared library build stuff. We + now use libtool instead. + +Wed Feb 11 17:13:09 1998 Richard Henderson <rth@cygnus.com> + + * tekhex.c (tekhex_write_object_contents): Call tekhex_init. + +Tue Feb 10 19:23:28 1998 H.J. Lu <hjl@gnu.org> + + * configure.in: Take stab-syms.lo out of sparclinux_vec list. + * configure: Rebuild. + +Tue Feb 10 15:16:38 1998 Nick Clifton <nickc@cygnus.com> + * elf32-v850.c (remember_hi16s_reloc): New function. + (find_remembered_hi16s_reloc): New function. + (v850_elf_store_addend_in_insn): Use the above new functions to + match up HI6S relocs with LO16 relocs. + +Tue Feb 10 15:01:39 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Change -linux* to -linux-gnu*. + * config.bfd, configure.host: Likewise. + * configure: Rebuild. + +Mon Feb 9 19:40:59 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another + LO16/HI16S bug and improve comments about what is going on. + +Sat Feb 7 15:27:03 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure, aclocal.m4: Rebuild with new libtool. + +Fri Feb 6 14:48:20 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_merge_private_bfd_data): Do not complain + when merging v850 code into v850e/v850ea code. Do not initialise + output flags if the input is the default architecture. + +Fri Feb 6 11:50:22 1998 Jeffrey A Law (law@cygnus.com) + + * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR + get the size from bfd_arch_bits_per_address instead of directly + from the isa. + +Thu Feb 5 14:21:34 1998 Michael Meissner <meissner@cygnus.com> + + * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address + to wrap, just return all 1's bits instead. + * libbfd.h: Regenerate. + +Thu Feb 5 11:51:05 1998 Ian Lance Taylor <ian@cygnus.com> + + * coff-i386.c (coff_pe_i386_relocate_section): New static function + if COFF_WITH_PE. + (coff_relocate_section): If COFF_WITH_PE, define as + coff_pe_i386_relocate_section. + * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE, + skip empty sections, to match coff_write_object_contents. + + * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend, + rather than swapping out r_offset twice. From Luke Deller + <luked@cse.unsw.edu.au>. + +Wed Feb 4 19:11:28 1998 Ian Lance Taylor <ian@cygnus.com> + + * configure.in: Set libtool_enable_shared rather than + libtool_shared. Remove diversion hack. + * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild + with new libtool. + +Wed Feb 4 16:10:21 1998 Brent Baccala <baccala@freesoft.org> + + * syms.c (struct stab_cache): Define. + (struct stab_find_info): Remove cached_offset, cached_stab, + cached_str, and cached_stroff fields. Add file_cache, + function_cache, and line_cache fields. + (_bfd_stab_section_find_nearest_line): Use extensive caching to + speed up searches. + +Wed Feb 4 13:34:22 1998 Ian Lance Taylor <ian@cygnus.com> + + * peicode.h (pe_print_idata): Check for import of ordinal rather + than name. + (pe_print_edata): If there is no .edata section, look for the + export data in some other section. + +Mon Feb 2 20:05:42 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in: Change version to 2.8.4. + * configure: Regenerated. + +Mon Feb 2 17:39:39 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU> + + Add tms320c30 support: + * cpu-tic30.c: New file. + * aout-tic30.c: New file. + * coff-tic30.c: New file. + * archures.c (bfd_arch_tic30): Define. + (bfd_tic30_arch): Declare. + (bfd_archures_list): Add bfd_tic30_arch. + * targets.c (bfd_target_vector): Add tic30_aout_vec and + tic30_coff_vec. + * reloc.c (BFD_RELOC_TIC30_LDP): Define. + * coffcode.h (coff_set_arch_mach_hook): Add tic30 case. + (coff_set_flags): Likewise. + * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets. + * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors. + * Makefile.am: Rebuild dependencies. + (ALL_MACHINES): Add cpu-tic30.lo. + (ALL_MACHINES_CFILES): Add cpu-tic30.c. + (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo. + (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c. + * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. + +Mon Feb 2 12:25:12 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc + to lag behind LO16 reloc by a couple of instructions. + +Mon Feb 2 14:09:46 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force + make to reexamine the file timestamp. + ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise. + + * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from + 0x100000. + +Fri Jan 30 19:07:07 1998 Geoff Keating <geoffk@ozemail.com.au> + + * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure + to create .dynsbss and .rela.sbss sections. + (ppc_elf_adjust_dynamic_symbol): Put space for small data to be + copied from dynamic objects into .sbss. + (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't + use it. Correct typo of .rela.sdata2. + (ppc_elf_finish_dynamic_symbol): Generate reloc to where we + put the data, which may now be in .sbss. + (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss. + (elf_backend_create_dynamic_sections): Define as + ppc_elf_create_dynamic_sections. + + * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs + against _GLOBAL_OFFSET_TABLE_. + (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in + shared libraries which refer to local symbols. Make sure that the + test for allocating space for a reloc in a shared object is the + same as the test for emitting a reloc. + +Thu Jan 29 15:55:35 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl> + + * config.bfd (i[3456]-*-mingw32*): New target. + * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32. + * aclocal.m4, configure: Rebuild. + +Wed Jan 28 13:41:26 1998 Ian Lance Taylor <ian@cygnus.com> + + * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we + have a bfd_object. + +Tue Jan 27 21:43:55 1998 Richard Henderson <rth@cygnus.com> + + Sparc v9 ABI compliant PLT: + * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries. + (plt_templates, sparc64_elf_build_plt_entry): Delete. + (LARGE_PLT_THRESHOLD): New define. + (GOT_RESERVED_ENTRIES): V9 ABI only uses 1. + (sparc64_elf_build_plt): New function. + (sparc64_elf_plt_entry_offset): Likewise. + (sparc64_elf_plt_ptr_offset): Likewise. + (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to + contain the index for convenience. Skip the initial entries + in .rela.plt. + (sparc64_elf_size_dynamic_sections): Zero the allocated contents + memory for the benefit of .rela.plt. + (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset. + (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use + sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc. + (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt. + Call sparc64_elf_build_plt. + (elf_backend_want_got_plt): No. + (elf_backend_plt_readonly): No. + (elf_backend_plt_alignment): 8. + + * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab. + * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it. + * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it + to be called. + +Tue Jan 27 21:45:15 1998 Jeffrey A Law (law@cygnus.com) + + * archures.c (bfd_mach_mips*): Add definitions for various MIPS + processors. + * cpu-mips.c (arch_info_struct): Add mips variants. + * bfd-in2.h: Rebuilt. + +Tue Jan 27 15:06:04 1998 Nick Clifton <nickc@cygnus.com> + + * coff-arm.c (coff_arm_relocate_section): Preserve the contents of + t2a3_b_insn. + +Tue Jan 27 12:47:27 1998 Robert Lipe <robertl@dgii.com> + + * config.bfd (i[3456]86-sco3.2v5*): ELF now the default. + (i[3456]86sco3.2v5*coff): New target. + +Mon Jan 26 15:41:30 1998 Ian Lance Taylor <ian@cygnus.com> + + * bfd-in2.h: Rebuild with changes to chew--tab expansion. + +Thu Jan 22 21:26:48 1998 Richard Henderson <rth@cygnus.com> + + * bfd.c (bfd_get_error_handler): Add orthogonal function. + * bfd-in2.h: Regenerate. + +Thu Jan 22 21:13:39 1998 Richard Henderson <rth@cygnus.com> + + * tekhex.c (tekhex_write_object_contents): Check for no symbols. + +Wed Jan 21 21:19:03 1998 Ian Lance Taylor <ian@cygnus.com> + + * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't + adjust addend for an output common symbol (from Jimmy Blair + <jimmyb@wrs.com>). If COFF_WITH_PE, adjust addend for PC relative + defined symbol to counteract adjustment made in generic relocation + code. + + * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h. + +Wed Jan 21 21:16:06 1998 Manfred Hollstein <manfred@s-direktnet.de> + + * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name. + (GET_SCNDHR_NLNNO): Likewise. + +Mon Jan 19 12:49:52 1998 Ian Lance Taylor <ian@cygnus.com> + + * cpu-sh.c (arch_info_struct): Correct next field of sh3e. + +Wed Jan 14 17:23:27 1998 Nick Clifton <nickc@cygnus.com> + + * elf32-m32r.c: Add macros to handle NOP insertion. + +Wed Jan 14 16:15:22 1998 Richard Henderson <rth@cygnus.com> + + * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section. + (xcoff_mark): Likewise. + (xcoff_build_ldsyms): Mark absolute symbols. + +Wed Jan 14 16:03:11 1998 Richard Henderson <rth@cygnus.com> + + * bout.c (b_out_write_object_contents): Sort symbols before output + to keep {CALL,BAL}NAME symbols adjacent. + (b_out_symbol_cmp): New function. + +For older changes see ChangeLog-9697 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/bfd/MAINTAINERS b/contrib/binutils/bfd/MAINTAINERS new file mode 100644 index 0000000..d59a3bd --- /dev/null +++ b/contrib/binutils/bfd/MAINTAINERS @@ -0,0 +1 @@ +See ../binutils/MAINTAINERS diff --git a/contrib/binutils/bfd/Makefile.am b/contrib/binutils/bfd/Makefile.am index 2d38959..b6741bc 100644 --- a/contrib/binutils/bfd/Makefile.am +++ b/contrib/binutils/bfd/Makefile.am @@ -12,6 +12,9 @@ docdir = doc lib_LTLIBRARIES = libbfd.la +WARN_CFLAGS = @WARN_CFLAGS@ +AM_CFLAGS = $(WARN_CFLAGS) + # bfd.h goes here, for now BFD_H = bfd.h @@ -26,13 +29,15 @@ 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 + 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 + 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. @@ -42,17 +47,21 @@ ALL_MACHINES = \ 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 \ @@ -66,6 +75,7 @@ ALL_MACHINES = \ cpu-sh.lo \ cpu-sparc.lo \ cpu-tic30.lo \ + cpu-tic54x.lo \ cpu-tic80.lo \ cpu-v850.lo \ cpu-vax.lo \ @@ -79,17 +89,21 @@ ALL_MACHINES_CFILES = \ 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 \ @@ -103,6 +117,7 @@ ALL_MACHINES_CFILES = \ cpu-sh.c \ cpu-sparc.c \ cpu-tic30.c \ + cpu-tic54x.c \ cpu-tic80.c \ cpu-v850.c \ cpu-vax.c \ @@ -115,6 +130,7 @@ ALL_MACHINES_CFILES = \ BFD32_BACKENDS = \ aout-adobe.lo \ aout-arm.lo \ + aout-cris.lo \ aout-ns32k.lo \ aout-sparcle.lo \ aout-tic30.lo \ @@ -145,6 +161,7 @@ BFD32_BACKENDS = \ coff-stgo32.lo \ coff-svm68k.lo \ coff-tic30.lo \ + coff-tic54x.lo \ coff-tic80.lo \ coff-u68k.lo \ coff-we32k.lo \ @@ -152,23 +169,28 @@ BFD32_BACKENDS = \ coff-z8k.lo \ cofflink.lo \ dwarf1.lo \ - dwarf2.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 \ @@ -178,6 +200,7 @@ BFD32_BACKENDS = \ elf32-pj.lo \ elf32-ppc.lo \ elf32-sh.lo \ + elf32-sh-lin.lo \ elf32-sparc.lo \ elf32-v850.lo \ elf32.lo \ @@ -245,6 +268,7 @@ BFD32_BACKENDS = \ BFD32_BACKENDS_CFILES = \ aout-adobe.c \ aout-arm.c \ + aout-cris.c \ aout-ns32k.c \ aout-sparcle.c \ aout-tic30.c \ @@ -275,6 +299,7 @@ BFD32_BACKENDS_CFILES = \ coff-stgo32.c \ coff-svm68k.c \ coff-tic30.c \ + coff-tic54x.c \ coff-tic80.c \ coff-u68k.c \ coff-we32k.c \ @@ -282,24 +307,28 @@ BFD32_BACKENDS_CFILES = \ coff-z8k.c \ cofflink.c \ dwarf1.c \ - dwarf2.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 \ @@ -308,6 +337,7 @@ BFD32_BACKENDS_CFILES = \ elf32-pj.c \ elf32-ppc.c \ elf32-sh.c \ + elf32-sh-lin.c \ elf32-sparc.c \ elf32-v850.c \ elf32.c \ @@ -378,8 +408,13 @@ BFD32_BACKENDS_CFILES = \ 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 \ @@ -390,8 +425,13 @@ BFD64_BACKENDS = \ 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 \ @@ -438,12 +478,12 @@ 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 elf32-arm.h elfcode.h elfcore.h \ - elflink.h freebsd.h genlink.h go32stub.h libaout.h \ - libbfd.h libcoff.h libecoff.h elf-bfd.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 + 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 HFILES = \ elf32-target.h elf64-target.h targmatch.h \ @@ -528,6 +568,16 @@ elf64-target.h : elfxx-target.h sed -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new mv -f elf64-target.new elf64-target.h +elf32-ia64.c : elfxx-ia64.c + rm -f elf32-ia64.c + sed -e s/NN/32/g < $(srcdir)/elfxx-ia64.c > elf32-ia64.new + mv -f elf32-ia64.new elf32-ia64.c + +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 + 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) @@ -538,17 +588,23 @@ $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) # Install BFD include file, and others that it needs. install-data-local: $(BFD_H) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(includedir) - $(INSTALL_DATA) $(BFD_H) $(includedir)/bfd.h - $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h - $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(includedir)/bfdlink.h + $(mkinstalldirs) $(DESTDIR)$(includedir) + $(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h + $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h + $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h + # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). DEP: dep.sed $(CFILES) $(HFILES) bfd.h rm -f DEP1 $(MAKE) MKDEP="$(MKDEP)" DEP1 - sed -f dep.sed < DEP1 > $@ - echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@ + sed -f dep.sed < DEP1 > DEPA + echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA + if grep ' /' DEPA > /dev/null 2> /dev/null; then \ + echo 'make DEP failed!'; exit 1; \ + else \ + mv -f DEPA $@; \ + fi DEP1: $(CFILES) echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2 @@ -637,7 +693,7 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \ targmatch.h -CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEP1 DEP2 libbfd.a stamp-lib \ +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 # We want to rerun configure if config.bfd or configure.host change. @@ -645,481 +701,599 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host $(SHELL) ./config.status --recheck -elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - -elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - # What appears below is generated by a hacked mkdep using gcc -MM. # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -archive.lo: archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h -archures.lo: archures.c -bfd.lo: bfd.c $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -cache.lo: cache.c -coffgen.lo: coffgen.c $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h -corefile.lo: corefile.c -format.lo: format.c -init.lo: init.c -libbfd.lo: libbfd.c -opncls.lo: opncls.c $(INCDIR)/objalloc.h -reloc.lo: reloc.c $(INCDIR)/bfdlink.h -section.lo: section.c $(INCDIR)/bfdlink.h -syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \ +archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/aout/ranlib.h +archures.lo: archures.c $(INCDIR)/filenames.h +bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ + libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +cache.lo: cache.c $(INCDIR)/filenames.h +coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h +corefile.lo: corefile.c $(INCDIR)/filenames.h +format.lo: format.c $(INCDIR)/filenames.h +init.lo: init.c $(INCDIR)/filenames.h +libbfd.lo: libbfd.c $(INCDIR)/filenames.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \ + targmatch.h +hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h +srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +binary.lo: binary.c $(INCDIR)/filenames.h +tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h -hash.lo: hash.c $(INCDIR)/objalloc.h -linker.lo: linker.c $(INCDIR)/bfdlink.h genlink.h -srec.lo: srec.c $(INCDIR)/libiberty.h -binary.lo: binary.c -tekhex.lo: tekhex.c $(INCDIR)/libiberty.h -ihex.lo: ihex.c $(INCDIR)/libiberty.h -stabs.lo: stabs.c $(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 -cpu-a29k.lo: cpu-a29k.c -cpu-alpha.lo: cpu-alpha.c -cpu-arc.lo: cpu-arc.c -cpu-arm.lo: cpu-arm.c -cpu-avr.lo: cpu-avr.c -cpu-d10v.lo: cpu-d10v.c -cpu-d30v.lo: cpu-d30v.c -cpu-fr30.lo: cpu-fr30.c -cpu-h8300.lo: cpu-h8300.c -cpu-h8500.lo: cpu-h8500.c -cpu-hppa.lo: cpu-hppa.c -cpu-i370.lo: cpu-i370.c -cpu-i386.lo: cpu-i386.c -cpu-i860.lo: cpu-i860.c -cpu-i960.lo: cpu-i960.c -cpu-m32r.lo: cpu-m32r.c -cpu-m68k.lo: cpu-m68k.c -cpu-m88k.lo: cpu-m88k.c -cpu-m10200.lo: cpu-m10200.c -cpu-m10300.lo: cpu-m10300.c -cpu-mcore.lo: cpu-mcore.c -cpu-mips.lo: cpu-mips.c -cpu-ns32k.lo: cpu-ns32k.c ns32k.h -cpu-pj.lo: cpu-pj.c -cpu-powerpc.lo: cpu-powerpc.c -cpu-rs6000.lo: cpu-rs6000.c -cpu-sh.lo: cpu-sh.c -cpu-sparc.lo: cpu-sparc.c -cpu-tic30.lo: cpu-tic30.c -cpu-tic80.lo: cpu-tic80.c -cpu-v850.lo: cpu-v850.c -cpu-vax.lo: cpu-vax.c -cpu-we32k.lo: cpu-we32k.c -cpu-w65.lo: cpu-w65.c -cpu-z8k.lo: cpu-z8k.c -aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.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 +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h +cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h +cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h +cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h +cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h +cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h +cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h +cpu-hppa.lo: cpu-hppa.c $(INCDIR)/filenames.h +cpu-ia64.lo: cpu-ia64.c $(INCDIR)/filenames.h cpu-ia64-opc.c \ + $(srcdir)/../opcodes/ia64-opc.h $(INCDIR)/opcode/ia64.h +cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h +cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h +cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h +cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h +cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h +cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h +cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h +cpu-m88k.lo: cpu-m88k.c $(INCDIR)/filenames.h +cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h +cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h +cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h +cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h +cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h +cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h +cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h +cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h +cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h +cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h +cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h +cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h +cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h +cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h +cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h +cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h +aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ $(INCDIR)/bfdlink.h -aout-arm.lo: aout-arm.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aoutx.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h +aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +aout-cris.lo: aout-cris.c aout32.c aoutx.h $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \ ns32k.h libaout.h $(INCDIR)/bfdlink.h aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \ - libaout.h aoutf1.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -aout-tic30.lo: aout-tic30.c libaout.h $(INCDIR)/bfdlink.h \ + libaout.h aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h aoutx.h -aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \ + $(INCDIR)/aout/ar.h aout-target.h +aout-tic30.lo: aout-tic30.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h +aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ + libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h -cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h -cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \ +armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +bout.lo: bout.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def libaout.h +cf-i386lynx.lo: cf-i386lynx.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-a29k.lo: coff-a29k.c $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h \ +coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h coff-m68k.c \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-apollo.lo: coff-apollo.c $(INCDIR)/coff/apollo.h \ +coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h +coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-arm.lo: coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-aux.lo: coff-aux.c $(INCDIR)/coff/aux-coff.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h \ +coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8300.lo: coff-h8300.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h \ +coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8500.lo: coff-h8500.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/h8500.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-i386.lo: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-i860.lo: coff-i860.c $(INCDIR)/coff/i860.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/coff/i386.h \ +coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-i960.lo: coff-i960.c $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m68k.lo: coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m88k.lo: coff-m88k.c $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \ - ecoffswap.h -coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \ +coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h libcoff.h \ + libecoff.h coffswap.h ecoffswap.h +coff-pmac.lo: coff-pmac.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ + xcoff-target.h coffcode.h coffswap.h +coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ +coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \ go32stub.h -coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic80.h \ +coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-we32k.lo: coff-we32k.c $(INCDIR)/coff/we32k.h \ +coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-w65.lo: coff-w65.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/w65.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -dwarf1.lo: dwarf1.c $(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)/libiberty.h elf-bfd.h \ +coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.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 \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/objalloc.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h -ecoff.lo: ecoff.c $(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 $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -ecofflink.lo: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm-oabi.h \ - $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-arm.h elf32-target.h elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-arm.h \ - elf32-target.h -elf32-avr.lo: elf32-avr.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf32-arm.h elf32-target.h +elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-cris.lo: elf32-cris.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-d30v.lo: elf32-d30v.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i370.h elf32-target.h -elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i960.lo: elf32-i960.c 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-m32r.lo: elf32-m32r.c 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 elf32-target.h -elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-hppa.lo: elf32-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 elf32-hppa.h elf-hppa.h elf32-target.h +elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h +elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ +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-mcore.lo: elf32-mcore.c $(INCDIR)/bfdlink.h elf-bfd.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)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \ +elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-pj.lo: elf32-pj.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf-m10200.lo: elf-m10200.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf-m10300.lo: elf-m10300.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ + elf32-target.h +elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sh-lin.lo: elf32-sh-lin.c elf32-sh.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elf32-target.h +elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \ - aoutx.h $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -som.lo: som.c -i386aout.lo: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386bsd.lo: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +som.lo: som.c $(INCDIR)/alloca-conf.h $(INCDIR)/filenames.h +i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386bsd.lo: i386bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \ - $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +i386freebsd.lo: i386freebsd.c freebsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386linux.lo: i386linux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -i386freebsd.lo: i386freebsd.c freebsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386linux.lo: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386lynx.lo: i386lynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386msdos.lo: i386msdos.c libaout.h $(INCDIR)/bfdlink.h -i386netbsd.lo: i386netbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386mach3.lo: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386os9k.lo: i386os9k.c $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/os9k.h -ieee.lo: ieee.c $(INCDIR)/ieee.h libieee.h -m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h libaout.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386lynx.lo: i386lynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386msdos.lo: i386msdos.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +i386netbsd.lo: i386netbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/os9k.h +ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \ + libieee.h +m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68klinux.lo: m68klinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +m68klynx.lo: m68klynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68klinux.lo: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -m68klynx.lo: m68klynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68knetbsd.lo: m68knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m88kmach3.lo: m88kmach3.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -mipsbsd.lo: mipsbsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -newsos3.lo: newsos3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -nlm.lo: nlm.c libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h -nlm32-i386.lo: nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \ +mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +newsos3.lo: newsos3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +nlm.lo: nlm.c $(INCDIR)/filenames.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +nlm32-i386.lo: nlm32-i386.c $(INCDIR)/filenames.h $(INCDIR)/nlm/i386-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \ +nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/sparc32-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/nlm/ppc-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/nlm/ppc-ext.h libnlm.h \ - $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ - nlmswap.h nlm-target.h -nlm32.lo: nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -ns32knetbsd.lo: ns32knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -oasys.lo: oasys.c $(INCDIR)/oasys.h liboasys.h -pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-sh.lo: pe-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pei-sh.lo: pei-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pe-mips.lo: pe-mips.c $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h \ +nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/oasys.h \ + liboasys.h +pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pei-mips.lo: pei-mips.c pe-mips.c $(INCDIR)/coff/mipspe.h \ +pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h coffcode.h peicode.h libpei.h +pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ + libpei.h +pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(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)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h -ppcboot.lo: ppcboot.c -reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/internal.h libcoff.h -riscix.lo: riscix.c libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -sparclinux.lo: sparclinux.c $(INCDIR)/aout/aout64.h \ +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 +riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sparclinux.lo: sparclinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h -sparclynx.lo: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -sparcnetbsd.lo: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ - $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -versados.lo: versados.c $(INCDIR)/libiberty.h -vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h -vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h -vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h -vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h -xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ - libecoff.h coffswap.h ecoffswap.h -demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \ +sparclynx.lo: sparclynx.c $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ aout-target.h -elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ +sparcnetbsd.lo: sparcnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ + $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +vaxnetbsd.lo: vaxnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +versados.lo: versados.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.h +aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +coff-alpha.lo: coff-alpha.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \ - libcoff.h libecoff.h ecoffswap.h elf64-target.h -elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf64-target.h -elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \ - genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \ - elf64-target.h -elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + libcoff.h libecoff.h coffswap.h ecoffswap.h +coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \ + $(INCDIR)/aout/sun4.h libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +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-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 \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ + libecoff.h ecoffswap.h elf64-target.h +elf64-hppa.lo: elf64-hppa.c $(INCDIR)/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-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 +elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ + ecoffswap.h elf64-target.h +elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \ - libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h -hpux-core.lo: hpux-core.c -irix-core.lo: irix-core.c -lynx-core.lo: lynx-core.c -osf-core.lo: osf-core.c -sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h -trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h -cisco-core.lo: cisco-core.c +elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h +hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h +irix-core.lo: irix-core.c $(INCDIR)/filenames.h +lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h +osf-core.lo: osf-core.c $(INCDIR)/filenames.h +sco5-core.lo: sco5-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +trad-core.lo: trad-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +cisco-core.lo: cisco-core.c $(INCDIR)/filenames.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 bb8e06c..0c60c1c 100644 --- a/contrib/binutils/bfd/Makefile.in +++ b/contrib/binutils/bfd/Makefile.in @@ -75,10 +75,14 @@ CC = @CC@ CC_FOR_BUILD = @CC_FOR_BUILD@ COREFILE = @COREFILE@ COREFLAG = @COREFLAG@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ @@ -96,10 +100,12 @@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +STRIP = @STRIP@ TDEFINES = @TDEFINES@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ @@ -125,6 +131,9 @@ docdir = doc lib_LTLIBRARIES = libbfd.la +WARN_CFLAGS = @WARN_CFLAGS@ +AM_CFLAGS = $(WARN_CFLAGS) + # bfd.h goes here, for now BFD_H = bfd.h @@ -135,411 +144,41 @@ 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 +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 +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-d10v.lo \ - cpu-d30v.lo \ - cpu-fr30.lo \ - cpu-h8300.lo \ - cpu-h8500.lo \ - cpu-hppa.lo \ - cpu-i370.lo \ - cpu-i386.lo \ - cpu-i860.lo \ - cpu-i960.lo \ - cpu-m32r.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-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-d10v.c \ - cpu-d30v.c \ - cpu-fr30.c \ - cpu-h8300.c \ - cpu-h8500.c \ - cpu-hppa.c \ - cpu-i370.c \ - cpu-i386.c \ - cpu-i860.c \ - cpu-i960.c \ - cpu-m32r.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-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-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-tic80.lo \ - coff-u68k.lo \ - coff-we32k.lo \ - coff-w65.lo \ - coff-z8k.lo \ - cofflink.lo \ - dwarf1.lo \ - dwarf2.lo \ - ecoff.lo \ - ecofflink.lo \ - elf.lo \ - elf32-arc.lo \ - elfarm-oabi.lo \ - elfarm-nabi.lo \ - elf32-avr.lo \ - elf32-d10v.lo \ - elf32-d30v.lo \ - elf32-fr30.lo \ - elf32-gen.lo \ - elf32-i370.lo \ - elf32-i386.lo \ - elf32-i860.lo \ - elf32-i960.lo \ - elf32-m32r.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-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-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-tic80.c \ - coff-u68k.c \ - coff-we32k.c \ - coff-w65.c \ - coff-z8k.c \ - cofflink.c \ - dwarf1.c \ - dwarf2.c \ - ecoff.c \ - ecofflink.c \ - elf.c \ - elf32-arc.c \ - elfarm-oabi.c \ - elfarm-nabi.c \ - elf32-avr.c \ - elf32-d10v.c \ - elf32-d30v.c \ - elf32-fr30.c \ - elf32-gen.c \ - elf32-i370.c \ - elf32-i386.c \ - elf32-i860.c \ - elf32-i960.c \ - elf32-m32r.c \ - elf32-m68k.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-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 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 # 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 \ - demo64.lo \ - elf64-alpha.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 \ - demo64.c \ - elf64-alpha.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 + + +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 # These are defined by configure.in: @@ -552,26 +191,13 @@ 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) +CFILES = $(BFD_LIBS_CFILES) $(ALL_MACHINES_CFILES) $(BFD32_BACKENDS_CFILES) $(BFD64_BACKENDS_CFILES) $(OPTIONAL_BACKENDS_CFILES) -SOURCE_HFILES = \ - aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \ - ecoffswap.h elf32-arm.h elfcode.h elfcore.h \ - elflink.h freebsd.h genlink.h go32stub.h libaout.h \ - libbfd.h libcoff.h libecoff.h elf-bfd.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 +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 -HFILES = \ - elf32-target.h elf64-target.h targmatch.h \ - $(SOURCE_HFILES) +HFILES = elf32-target.h elf64-target.h targmatch.h $(SOURCE_HFILES) POTFILES = $(CFILES) $(SOURCE_HFILES) @@ -598,18 +224,15 @@ 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 = elf32-target.h elf64-target.h ofiles stamp-ofiles targmatch.h -CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP 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 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -629,7 +252,7 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libbfd_la_OBJECTS = archive.lo archures.lo bfd.lo cache.lo coffgen.lo \ corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo \ syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo \ -ihex.lo stabs.lo stab-syms.lo +ihex.lo stabs.lo stab-syms.lo dwarf2.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -649,7 +272,7 @@ OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS) all: all-redirect .SUFFIXES: -.SUFFIXES: .S .c .lo .o .s +.SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile @@ -704,6 +327,11 @@ maintainer-clean-noinstLIBRARIES: .c.o: $(COMPILE) -c $< +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + .s.o: $(COMPILE) -c $< @@ -712,6 +340,7 @@ maintainer-clean-noinstLIBRARIES: mostlyclean-compile: -rm -f *.o core *.core + -rm -f *.$(OBJEXT) clean-compile: @@ -897,7 +526,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 $$d/$$file $(distdir)/$$file; \ + cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ @@ -1070,6 +699,16 @@ elf64-target.h : elfxx-target.h rm -f elf64-target.h sed -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new mv -f elf64-target.new elf64-target.h + +elf32-ia64.c : elfxx-ia64.c + rm -f elf32-ia64.c + sed -e s/NN/32/g < $(srcdir)/elfxx-ia64.c > elf32-ia64.new + mv -f elf32-ia64.new elf32-ia64.c + +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 $(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) @@ -1078,17 +717,22 @@ $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS) # Install BFD include file, and others that it needs. install-data-local: $(BFD_H) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(includedir) - $(INSTALL_DATA) $(BFD_H) $(includedir)/bfd.h - $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h - $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(includedir)/bfdlink.h + $(mkinstalldirs) $(DESTDIR)$(includedir) + $(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h + $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h + $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h # Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES). DEP: dep.sed $(CFILES) $(HFILES) bfd.h rm -f DEP1 $(MAKE) MKDEP="$(MKDEP)" DEP1 - sed -f dep.sed < DEP1 > $@ - echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@ + sed -f dep.sed < DEP1 > DEPA + echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA + if grep ' /' DEPA > /dev/null 2> /dev/null; then \ + echo 'make DEP failed!'; exit 1; \ + else \ + mv -f DEPA $@; \ + fi DEP1: $(CFILES) echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2 @@ -1173,483 +817,601 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host $(SHELL) ./config.status --recheck -elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - -elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h - # What appears below is generated by a hacked mkdep using gcc -MM. # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -archive.lo: archive.c $(INCDIR)/aout/ar.h $(INCDIR)/aout/ranlib.h -archures.lo: archures.c -bfd.lo: bfd.c $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h libcoff.h \ - libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -cache.lo: cache.c -coffgen.lo: coffgen.c $(INCDIR)/coff/internal.h libcoff.h \ - $(INCDIR)/bfdlink.h -corefile.lo: corefile.c -format.lo: format.c -init.lo: init.c -libbfd.lo: libbfd.c -opncls.lo: opncls.c $(INCDIR)/objalloc.h -reloc.lo: reloc.c $(INCDIR)/bfdlink.h -section.lo: section.c $(INCDIR)/bfdlink.h -syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \ +archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/aout/ranlib.h +archures.lo: archures.c $(INCDIR)/filenames.h +bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ + libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h +cache.lo: cache.c $(INCDIR)/filenames.h +coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h +corefile.lo: corefile.c $(INCDIR)/filenames.h +format.lo: format.c $(INCDIR)/filenames.h +init.lo: init.c $(INCDIR)/filenames.h +libbfd.lo: libbfd.c $(INCDIR)/filenames.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h +syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def +targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \ + targmatch.h +hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h +srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +binary.lo: binary.c $(INCDIR)/filenames.h +tekhex.lo: tekhex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +ihex.lo: ihex.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +stabs.lo: stabs.c $(INCDIR)/filenames.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h -hash.lo: hash.c $(INCDIR)/objalloc.h -linker.lo: linker.c $(INCDIR)/bfdlink.h genlink.h -srec.lo: srec.c $(INCDIR)/libiberty.h -binary.lo: binary.c -tekhex.lo: tekhex.c $(INCDIR)/libiberty.h -ihex.lo: ihex.c $(INCDIR)/libiberty.h -stabs.lo: stabs.c $(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 -cpu-a29k.lo: cpu-a29k.c -cpu-alpha.lo: cpu-alpha.c -cpu-arc.lo: cpu-arc.c -cpu-arm.lo: cpu-arm.c -cpu-avr.lo: cpu-avr.c -cpu-d10v.lo: cpu-d10v.c -cpu-d30v.lo: cpu-d30v.c -cpu-fr30.lo: cpu-fr30.c -cpu-h8300.lo: cpu-h8300.c -cpu-h8500.lo: cpu-h8500.c -cpu-hppa.lo: cpu-hppa.c -cpu-i370.lo: cpu-i370.c -cpu-i386.lo: cpu-i386.c -cpu-i860.lo: cpu-i860.c -cpu-i960.lo: cpu-i960.c -cpu-m32r.lo: cpu-m32r.c -cpu-m68k.lo: cpu-m68k.c -cpu-m88k.lo: cpu-m88k.c -cpu-m10200.lo: cpu-m10200.c -cpu-m10300.lo: cpu-m10300.c -cpu-mcore.lo: cpu-mcore.c -cpu-mips.lo: cpu-mips.c -cpu-ns32k.lo: cpu-ns32k.c ns32k.h -cpu-pj.lo: cpu-pj.c -cpu-powerpc.lo: cpu-powerpc.c -cpu-rs6000.lo: cpu-rs6000.c -cpu-sh.lo: cpu-sh.c -cpu-sparc.lo: cpu-sparc.c -cpu-tic30.lo: cpu-tic30.c -cpu-tic80.lo: cpu-tic80.c -cpu-v850.lo: cpu-v850.c -cpu-vax.lo: cpu-vax.c -cpu-we32k.lo: cpu-we32k.c -cpu-w65.lo: cpu-w65.c -cpu-z8k.lo: cpu-z8k.c -aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.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 +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h +cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h +cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h +cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h +cpu-fr30.lo: cpu-fr30.c $(INCDIR)/filenames.h +cpu-h8300.lo: cpu-h8300.c $(INCDIR)/filenames.h +cpu-h8500.lo: cpu-h8500.c $(INCDIR)/filenames.h +cpu-hppa.lo: cpu-hppa.c $(INCDIR)/filenames.h +cpu-ia64.lo: cpu-ia64.c $(INCDIR)/filenames.h cpu-ia64-opc.c \ + $(srcdir)/../opcodes/ia64-opc.h $(INCDIR)/opcode/ia64.h +cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h +cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h +cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h +cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h +cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h +cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h +cpu-m68k.lo: cpu-m68k.c $(INCDIR)/filenames.h +cpu-m88k.lo: cpu-m88k.c $(INCDIR)/filenames.h +cpu-m10200.lo: cpu-m10200.c $(INCDIR)/filenames.h +cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h +cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h +cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h +cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h +cpu-pj.lo: cpu-pj.c $(INCDIR)/filenames.h +cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h +cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h +cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h +cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h +cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h +cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h +cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h +cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h +cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h +cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h +cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h +aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ $(INCDIR)/bfdlink.h -aout-arm.lo: aout-arm.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aoutx.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h +aout-arm.lo: aout-arm.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aoutx.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +aout-cris.lo: aout-cris.c aout32.c aoutx.h $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h aout-ns32k.lo: aout-ns32k.c $(INCDIR)/aout/aout64.h \ ns32k.h libaout.h $(INCDIR)/bfdlink.h aout-sparcle.lo: aout-sparcle.c $(INCDIR)/bfdlink.h \ - libaout.h aoutf1.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -aout-tic30.lo: aout-tic30.c libaout.h $(INCDIR)/bfdlink.h \ + libaout.h aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h aoutx.h -aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \ + $(INCDIR)/aout/ar.h aout-target.h +aout-tic30.lo: aout-tic30.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aoutx.h +aout0.lo: aout0.c aoutf1.h $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ + libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +aout32.lo: aout32.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h -cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ - coffcode.h coffswap.h -cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/coff/m68k.h \ +armnetbsd.lo: armnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +bout.lo: bout.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/bout.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def libaout.h +cf-i386lynx.lo: cf-i386lynx.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-m68klynx.lo: cf-m68klynx.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/sparc.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-a29k.lo: coff-a29k.c $(INCDIR)/filenames.h $(INCDIR)/coff/a29k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -cf-sparclynx.lo: cf-sparclynx.c coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-apollo.lo: coff-apollo.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/apollo.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-arm.lo: coff-arm.c $(INCDIR)/filenames.h $(INCDIR)/coff/arm.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-a29k.lo: coff-a29k.c $(INCDIR)/coff/a29k.h $(INCDIR)/coff/internal.h \ +coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h coff-m68k.c \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-apollo.lo: coff-apollo.c $(INCDIR)/coff/apollo.h \ +coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h +coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/h8500.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-i386.lo: coff-i386.c $(INCDIR)/filenames.h $(INCDIR)/coff/i386.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-arm.lo: coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-aux.lo: coff-aux.c $(INCDIR)/coff/aux-coff.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h coff-m68k.c libcoff.h $(INCDIR)/bfdlink.h \ +coff-i860.lo: coff-i860.c $(INCDIR)/filenames.h $(INCDIR)/coff/i860.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8300.lo: coff-h8300.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/h8300.h $(INCDIR)/coff/internal.h libcoff.h \ +coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-i960.lo: coff-i960.c $(INCDIR)/filenames.h $(INCDIR)/coff/i960.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-h8500.lo: coff-h8500.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/h8500.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-i386.lo: coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-i860.lo: coff-i860.c $(INCDIR)/coff/i860.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-go32.lo: coff-go32.c coff-i386.c $(INCDIR)/coff/i386.h \ +coff-m68k.lo: coff-m68k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m68k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-i960.lo: coff-i960.c $(INCDIR)/coff/i960.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m68k.lo: coff-m68k.c $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-m88k.lo: coff-m88k.c $(INCDIR)/coff/m88k.h $(INCDIR)/coff/internal.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h -coff-mips.lo: coff-mips.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/mips.h libcoff.h libecoff.h coffswap.h \ - ecoffswap.h -coff-pmac.lo: coff-pmac.c coff-rs6000.c $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-m88k.lo: coff-m88k.c $(INCDIR)/filenames.h $(INCDIR)/coff/m88k.h \ + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-rs6000.lo: coff-rs6000.c $(INCDIR)/coff/internal.h \ +coff-mips.lo: coff-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h libcoff.h \ + libecoff.h coffswap.h ecoffswap.h +coff-pmac.lo: coff-pmac.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/rs6000.h libcoff.h $(INCDIR)/bfdlink.h \ + xcoff-target.h coffcode.h coffswap.h +coff-rs6000.lo: coff-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +coff-sh.lo: coff-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-sh.lo: coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-sparc.lo: coff-sparc.c $(INCDIR)/coff/sparc.h \ +coff-sparc.lo: coff-sparc.c $(INCDIR)/filenames.h $(INCDIR)/coff/sparc.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ +coff-stgo32.lo: coff-stgo32.c coff-i386.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/go32exe.h \ libcoff.h $(INCDIR)/bfdlink.h coffcode.h coffswap.h \ go32stub.h -coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/tic30.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \ +coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic80.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ +coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \ + $(INCDIR)/coff/tic80.h $(INCDIR)/coff/internal.h libcoff.h \ coffcode.h coffswap.h -coff-we32k.lo: coff-we32k.c $(INCDIR)/coff/we32k.h \ +coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/m68k.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h coffcode.h coffswap.h +coff-we32k.lo: coff-we32k.c $(INCDIR)/filenames.h $(INCDIR)/coff/we32k.h \ $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \ coffcode.h coffswap.h -coff-w65.lo: coff-w65.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/w65.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h -cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -dwarf1.lo: dwarf1.c $(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)/libiberty.h elf-bfd.h \ +coff-w65.lo: coff-w65.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/w65.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/z8k.h $(INCDIR)/coff/internal.h libcoff.h \ + coffcode.h coffswap.h +cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.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 \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/objalloc.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/ecoff.h libcoff.h libecoff.h +efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ + coff-i386.c $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h -ecoff.lo: ecoff.c $(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 $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -ecofflink.lo: ecofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/objalloc.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - libcoff.h libecoff.h -elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm-oabi.h \ - $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ elf32-arm.h elf32-target.h elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-arm.h \ - elf32-target.h -elf32-avr.lo: elf32-avr.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + elf32-arm.h elf32-target.h +elf32-avr.lo: elf32-avr.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-cris.lo: elf32-cris.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-d30v.lo: elf32-d30v.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i370.h elf32-target.h -elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/d30v.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i960.lo: elf32-i960.c 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-m32r.lo: elf32-m32r.c 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 elf32-target.h -elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf32-hppa.lo: elf32-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 elf32-hppa.h elf-hppa.h elf32-target.h +elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h +elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ +elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ +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-mcore.lo: elf32-mcore.c $(INCDIR)/bfdlink.h elf-bfd.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)/elf/mcore.h $(INCDIR)/elf/reloc-macros.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 \ elf32-target.h -elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \ +elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-pj.lo: elf32-pj.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \ +elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf-m10200.lo: elf-m10200.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \ + $(INCDIR)/bfdlink.h elf32-target.h +elf-m10300.lo: elf-m10300.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h -epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \ - $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ - libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ - libpei.h -hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \ + elf32-target.h +elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-sh-lin.lo: elf32-sh-lin.c elf32-sh.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h +elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/sparc.h \ + elf32-target.h +elf32-v850.lo: elf32-v850.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h +epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c $(INCDIR)/filenames.h \ + coff-arm.c $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +hp300bsd.lo: hp300bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h hp300hpux.lo: hp300hpux.c $(INCDIR)/aout/hp300hpux.h \ - aoutx.h $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ - $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -som.lo: som.c -i386aout.lo: i386aout.c $(INCDIR)/aout/aout64.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386bsd.lo: i386bsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +som.lo: som.c $(INCDIR)/alloca-conf.h $(INCDIR)/filenames.h +i386aout.lo: i386aout.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386bsd.lo: i386bsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h i386dynix.lo: i386dynix.c $(INCDIR)/aout/dynix3.h aoutx.h \ - $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h libaout.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +i386freebsd.lo: i386freebsd.c freebsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386linux.lo: i386linux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ - aout-target.h -i386freebsd.lo: i386freebsd.c freebsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386linux.lo: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386lynx.lo: i386lynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386msdos.lo: i386msdos.c libaout.h $(INCDIR)/bfdlink.h -i386netbsd.lo: i386netbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -i386mach3.lo: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -i386os9k.lo: i386os9k.c $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/os9k.h -ieee.lo: ieee.c $(INCDIR)/ieee.h libieee.h -m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h libaout.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386lynx.lo: i386lynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386msdos.lo: i386msdos.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +i386netbsd.lo: i386netbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +i386mach3.lo: i386mach3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +i386os9k.lo: i386os9k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/os9k.h +ieee.lo: ieee.c $(INCDIR)/filenames.h $(INCDIR)/ieee.h \ + libieee.h +m68k4knetbsd.lo: m68k4knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68klinux.lo: m68klinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +m68klynx.lo: m68klynx.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68klinux.lo: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -m68klynx.lo: m68klynx.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m68knetbsd.lo: m68knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -m88kmach3.lo: m88kmach3.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -mipsbsd.lo: mipsbsd.c libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -newsos3.lo: newsos3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \ - $(INCDIR)/bfdlink.h aout-target.h -nlm.lo: nlm.c libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h -nlm32-i386.lo: nlm32-i386.c $(INCDIR)/nlm/i386-ext.h \ +mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +newsos3.lo: newsos3.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h +nlm.lo: nlm.c $(INCDIR)/filenames.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +nlm32-i386.lo: nlm32-i386.c $(INCDIR)/filenames.h $(INCDIR)/nlm/i386-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/nlm/sparc32-ext.h \ +nlm32-sparc.lo: nlm32-sparc.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/sparc32-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/nlm/ppc-ext.h \ libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm32-ppc.lo: nlm32-ppc.c $(INCDIR)/nlm/ppc-ext.h libnlm.h \ - $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \ - nlmswap.h nlm-target.h -nlm32.lo: nlm32.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -ns32knetbsd.lo: ns32knetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -oasys.lo: oasys.c $(INCDIR)/oasys.h liboasys.h -pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/aout/aout64.h aout-target.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h -pe-sh.lo: pe-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pei-sh.lo: pei-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \ - coffcode.h peicode.h libpei.h -pe-mips.lo: pe-mips.c $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h \ +nlm32.lo: nlm32.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +ns32knetbsd.lo: ns32knetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +oasys.lo: oasys.c $(INCDIR)/filenames.h $(INCDIR)/oasys.h \ + liboasys.h +pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-arm.lo: pei-arm.c $(INCDIR)/filenames.h coff-arm.c \ + $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-i386.lo: pe-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-i386.lo: pei-i386.c $(INCDIR)/filenames.h coff-i386.c \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-mcore.lo: pe-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pei-mcore.lo: pei-mcore.c $(INCDIR)/filenames.h coff-mcore.c \ + $(INCDIR)/coff/mcore.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \ + libpei.h +pe-ppc.lo: pe-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ + peicode.h libpei.h +pei-ppc.lo: pei-ppc.c $(INCDIR)/filenames.h coff-ppc.c \ + $(INCDIR)/coff/powerpc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ peicode.h libpei.h -pei-mips.lo: pei-mips.c pe-mips.c $(INCDIR)/coff/mipspe.h \ +pe-sh.lo: pe-sh.c $(INCDIR)/filenames.h coff-sh.c $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \ + libcoff.h coffcode.h peicode.h libpei.h +pei-sh.lo: pei-sh.c $(INCDIR)/filenames.h coff-sh.c \ + $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/pe.h libcoff.h coffcode.h peicode.h \ + libpei.h +pe-mips.lo: pe-mips.c $(INCDIR)/filenames.h $(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)/coff/internal.h $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h -ppcboot.lo: ppcboot.c -reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \ - $(INCDIR)/coff/internal.h libcoff.h -riscix.lo: riscix.c libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ - aout-target.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -sparclinux.lo: sparclinux.c $(INCDIR)/aout/aout64.h \ +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 +riscix.lo: riscix.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h aout-target.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sparclinux.lo: sparclinux.c $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ libaout.h $(INCDIR)/bfdlink.h aout-target.h -sparclynx.lo: sparclynx.c $(INCDIR)/aout/sun4.h libaout.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -sparcnetbsd.lo: sparcnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ - $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \ - aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h -versados.lo: versados.c $(INCDIR)/libiberty.h -vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h -vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h -vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h -vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h -xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - libcoff.h -aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \ - $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ - $(INCDIR)/aout/ar.h -coff-alpha.lo: coff-alpha.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ - libecoff.h coffswap.h ecoffswap.h -demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \ +sparclynx.lo: sparclynx.c $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h \ libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ aout-target.h -elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ +sparcnetbsd.lo: sparcnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +sunos.lo: sunos.c $(INCDIR)/bfdlink.h libaout.h aoutf1.h \ + $(INCDIR)/filenames.h $(INCDIR)/aout/sun4.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h \ + aout-target.h +vaxnetbsd.lo: vaxnetbsd.c netbsd.h $(INCDIR)/filenames.h \ + libaout.h $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ + $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +versados.lo: versados.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h +vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + vms.h +xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/internal.h libcoff.h +aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + libaout.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ + $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +coff-alpha.lo: coff-alpha.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \ - libcoff.h libecoff.h ecoffswap.h elf64-target.h -elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - elf64-target.h -elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \ - genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \ - elf64-target.h -elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + libcoff.h libecoff.h coffswap.h ecoffswap.h +coff64-rs6000.lo: coff64-rs6000.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6k64.h libcoff.h \ + $(INCDIR)/bfdlink.h xcoff-target.h coffcode.h coffswap.h +demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \ + $(INCDIR)/aout/sun4.h libaout.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ar.h aout-target.h +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-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 \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ + $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ + libecoff.h ecoffswap.h elf64-target.h +elf64-hppa.lo: elf64-hppa.c $(INCDIR)/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-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 +elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ + $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \ + ecoffswap.h elf64-target.h +elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - elfcore.h elflink.h -nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \ - libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \ - $(INCDIR)/nlm/external.h nlmswap.h nlm-target.h -nlm64.lo: nlm64.c nlmcode.h libnlm.h $(INCDIR)/nlm/common.h \ - $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h -aix386-core.lo: aix386-core.c $(INCDIR)/coff/i386.h \ - $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h -hpux-core.lo: hpux-core.c -irix-core.lo: irix-core.c -lynx-core.lo: lynx-core.c -osf-core.lo: osf-core.c -sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h -trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h -cisco-core.lo: cisco-core.c +elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h elfcore.h elflink.h +nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ + $(INCDIR)/nlm/alpha-ext.h libnlm.h $(INCDIR)/nlm/common.h \ + $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmswap.h \ + nlm-target.h +nlm64.lo: nlm64.c nlmcode.h $(INCDIR)/filenames.h libnlm.h \ + $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h +aix386-core.lo: aix386-core.c $(INCDIR)/filenames.h \ + $(INCDIR)/coff/i386.h $(INCDIR)/coff/internal.h libcoff.h \ + $(INCDIR)/bfdlink.h +hpux-core.lo: hpux-core.c $(INCDIR)/filenames.h +irix-core.lo: irix-core.c $(INCDIR)/filenames.h +lynx-core.lo: lynx-core.c $(INCDIR)/filenames.h +osf-core.lo: osf-core.c $(INCDIR)/filenames.h +sco5-core.lo: sco5-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +trad-core.lo: trad-core.c $(INCDIR)/filenames.h libaout.h \ + $(INCDIR)/bfdlink.h +cisco-core.lo: cisco-core.c $(INCDIR)/filenames.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/README b/contrib/binutils/bfd/README index 51ce133..992c285 100644 --- a/contrib/binutils/bfd/README +++ b/contrib/binutils/bfd/README @@ -34,7 +34,7 @@ BFD supports the following configure options: Use mmap when accessing files. This is faster on some hosts, but slower on others. It may not work on all hosts. -Report bugs with BFD to bug-gnu-utils@gnu.org. +Report bugs with BFD to bug-binutils@gnu.org. Patches are encouraged. When sending patches, always send the output of diff -u or diff -c from the original file to the new file. Do not diff --git a/contrib/binutils/bfd/acinclude.m4 b/contrib/binutils/bfd/acinclude.m4 index cac26e8..5391294 100644 --- a/contrib/binutils/bfd/acinclude.m4 +++ b/contrib/binutils/bfd/acinclude.m4 @@ -74,7 +74,9 @@ dnl Check for existence of a type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, [AC_MSG_CHECKING([for $1 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([#include <sys/procfs.h>], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include <sys/procfs.h>], [$1 avar], bfd_cv_have_sys_procfs_type_$1=yes, bfd_cv_have_sys_procfs_type_$1=no @@ -92,7 +94,9 @@ dnl Check for existence of member $2 in type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([#include <sys/procfs.h>], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include <sys/procfs.h>], [$1 avar; void* aref = (void*) &avar.$2], bfd_cv_have_sys_procfs_type_member_$1_$2=yes, bfd_cv_have_sys_procfs_type_member_$1_$2=no @@ -104,4 +108,18 @@ AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) ]) +sinclude(../libtool.m4) +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_DEFUN([AM_DISABLE_SHARED],) +AC_SUBST(LIBTOOL) +]) +sinclude(../gettext.m4) +ifelse(yes,no,[ +AC_DEFUN([CY_WITH_NLS],) +AC_SUBST(INTLLIBS) +]) diff --git a/contrib/binutils/bfd/aclocal.m4 b/contrib/binutils/bfd/aclocal.m4 index ca9d432..45cc339 100644 --- a/contrib/binutils/bfd/aclocal.m4 +++ b/contrib/binutils/bfd/aclocal.m4 @@ -86,7 +86,9 @@ dnl Check for existence of a type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, [AC_MSG_CHECKING([for $1 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([#include <sys/procfs.h>], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include <sys/procfs.h>], [$1 avar], bfd_cv_have_sys_procfs_type_$1=yes, bfd_cv_have_sys_procfs_type_$1=no @@ -104,7 +106,9 @@ dnl Check for existence of member $2 in type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([#include <sys/procfs.h>], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include <sys/procfs.h>], [$1 avar; void* aref = (void*) &avar.$2], bfd_cv_have_sys_procfs_type_member_$1_$2=yes, bfd_cv_have_sys_procfs_type_member_$1_$2=no @@ -116,7 +120,39 @@ AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) ]) +sinclude(../libtool.m4) +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_DEFUN([AM_DISABLE_SHARED],) +AC_SUBST(LIBTOOL) +]) + +sinclude(../gettext.m4) +ifelse(yes,no,[ +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. @@ -210,415 +246,6 @@ else fi AC_SUBST($1)]) - -# serial 40 AC_PROG_LIBTOOL -AC_DEFUN(AC_PROG_LIBTOOL, -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ -DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -AC_DEFUN(AC_LIBTOOL_SETUP, -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -dnl - -case "$target" in -NONE) lt_target="$host" ;; -*) lt_target="$target" ;; -esac - -# Check for any special flags to pass to ltconfig. -libtool_flags="--cache-file=$cache_file" -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], -[libtool_flags="$libtool_flags --enable-dlopen"]) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[libtool_flags="$libtool_flags --enable-win32-dll"]) -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case "$lt_target" in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -]) -esac -]) - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_SHARED, [dnl -define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_STATIC, [dnl -define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl -define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN(AC_PROG_LD, -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. -changequote(,)dnl - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -changequote([,])dnl - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(ac_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - ac_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$ac_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) - -AC_DEFUN(AC_PROG_LD_GNU, -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - ac_cv_prog_gnu_ld=yes -else - ac_cv_prog_gnu_ld=no -fi]) -]) - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN(AC_PROG_NM, -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - ac_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" - break - else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm -fi]) -NM="$ac_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case "$lt_target" in -*-*-beos* | *-*-cygwin*) - # These system don't have libm - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, main, LIBM="-lm") - ;; -esac -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library, adds --enable-ltdl-convenience to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case "$enable_ltdl_convenience" in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library, and adds --enable-ltdl-install to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= - fi -]) - -dnl old names -AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl -AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl -AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl -AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl -AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl -AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl -AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl - -dnl This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL])dnl - # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, @@ -675,348 +302,3 @@ else $1_FALSE= fi]) -# This file is derived from `gettext.m4'. The difference is that the -# included macros assume Cygnus-style source and build trees. - -# Macro to add for using GNU gettext. -# Ulrich Drepper <drepper@cygnus.com>, 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 3 - -AC_DEFUN(CY_WITH_NLS, - [AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) - - USE_INCLUDED_LIBINTL=no - - dnl If we use NLS figure out what method - if test "$USE_NLS" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested]) - AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, - [ --with-included-gettext use the GNU gettext library included here], - nls_cv_force_use_gnu_gettext=$withval, - nls_cv_force_use_gnu_gettext=no) - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - dnl User does not insist on using GNU NLS library. Figure out what - dnl to use. If gettext or catgets are available (in this order) we - dnl use this. Else we have to fall back to GNU NLS library. - dnl catgets is only used if permitted by option --with-catgets. - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT=NONE - - AC_CHECK_HEADER(libintl.h, - [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, - [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], - gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) - - if test "$gt_cv_func_gettext_libc" != "yes"; then - AC_CHECK_LIB(intl, bindtextdomain, - [AC_CACHE_CHECK([for gettext in libintl], - gt_cv_func_gettext_libintl, - [AC_TRY_LINK([], [return (int) gettext ("")], - gt_cv_func_gettext_libintl=yes, - gt_cv_func_gettext_libintl=no)])]) - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - AC_DEFINE(HAVE_GETTEXT, 1, - [Define as 1 if you have gettext and don't want to use GNU gettext.]) - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl - if test "$MSGFMT" != "no"; then - AC_CHECK_FUNCS(dcgettext) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr], - [CATOBJEXT=.gmo - DATADIRNAME=share], - [CATOBJEXT=.mo - DATADIRNAME=lib]) - INSTOBJEXT=.mo - fi - fi - ]) - - dnl In the standard gettext, we would now check for catgets. - dnl However, we never want to use catgets for our releases. - - if test "$CATOBJEXT" = "NONE"; then - dnl Neither gettext nor catgets in included in the C library. - dnl Fall back on GNU gettext library. - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - dnl Mark actions used to generate GNU NLS library. - INTLOBJS="\$(GETTOBJS)" - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_SUBST(MSGFMT) - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - AC_MSG_RESULT( - [found xgettext programs is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - dnl These rules are solely for the distribution goal. While doing this - dnl we only have to keep exactly one list of the available catalogs - dnl in configure.in. - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - - dnl Make all variables we use known to autoconf. - AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATALOGS) - AC_SUBST(CATOBJEXT) - AC_SUBST(DATADIRNAME) - AC_SUBST(GMOFILES) - AC_SUBST(INSTOBJEXT) - AC_SUBST(INTLDEPS) - AC_SUBST(INTLLIBS) - AC_SUBST(INTLOBJS) - AC_SUBST(POFILES) - AC_SUBST(POSUB) - ]) - -AC_DEFUN(CY_GNU_GETTEXT, - [AC_REQUIRE([AC_PROG_MAKE_SET])dnl - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_PROG_RANLIB])dnl - AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_HEADER_STDC])dnl - AC_REQUIRE([AC_C_CONST])dnl - AC_REQUIRE([AC_C_INLINE])dnl - AC_REQUIRE([AC_TYPE_OFF_T])dnl - AC_REQUIRE([AC_TYPE_SIZE_T])dnl - AC_REQUIRE([AC_FUNC_ALLOCA])dnl - AC_REQUIRE([AC_FUNC_MMAP])dnl - - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h]) - AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next]) - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - AC_CHECK_FUNCS(stpcpy) - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function]) - fi - - AM_LC_MESSAGES - CY_WITH_NLS - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - AC_MSG_CHECKING(for catalogs to be installed) - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - AC_MSG_RESULT($LINGUAS) - fi - - dnl Construct list of names of catalog files to be constructed. - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - dnl The reference to <locale.h> in the installed <libintl.h> file - dnl must be resolved because we cannot expect the users of this - dnl to define HAVE_LOCALE_H. - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include <locale.h>" - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header <locale.h>. Take care yourself. */" - fi - AC_SUBST(INCLUDE_LOCALE_H) - - dnl Determine which catalog format we have (if any is needed) - dnl For now we know about two different formats: - dnl Linux libc-5 and the normal X/Open format - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) - - dnl Transform the SED scripts while copying because some dumb SEDs - dnl cannot handle comments. - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - dnl po2tbl.sed is always needed. - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi - - dnl In the intl/Makefile.in we have a special dependency which makes - dnl only sense for gettext. We comment this out for non-gettext - dnl packages. - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi - AC_SUBST(GT_NO) - AC_SUBST(GT_YES) - - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - AC_SUBST(MKINSTALLDIRS) - - dnl *** For now the libtool support in intl/Makefile is not for real. - l= - AC_SUBST(l) - - dnl Generate list of files to be processed by xgettext which will - dnl be included in po/Makefile. But only do this if the po directory - dnl exists in srcdir. - if test -d $srcdir/po; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi - ]) - -# Search path for a program which passes the given test. -# Ulrich Drepper <drepper@cygnus.com>, 1996. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN(AM_PATH_PROG_WITH_TEST, -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, -[case "[$]$1" in - /*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$5], , $PATH, [$5]); do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test -n "[$]$1"; then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) - -# Check whether LC_MESSAGES is available in <locale.h>. -# Ulrich Drepper <drepper@cygnus.com>, 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -AC_DEFUN(AM_LC_MESSAGES, - [if test $ac_cv_header_locale_h = yes; then - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your locale.h file contains LC_MESSAGES.]) - fi - fi]) - diff --git a/contrib/binutils/bfd/aout-arm.c b/contrib/binutils/bfd/aout-arm.c index 7365f9d..182c1c6 100644 --- a/contrib/binutils/bfd/aout-arm.c +++ b/contrib/binutils/bfd/aout-arm.c @@ -1,7 +1,7 @@ /* BFD back-end for raw ARM a.out binaries. Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) - + This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #define N_TXTADDR(x) \ ((N_MAGIC(x) == NMAGIC) ? 0x8000 : \ (N_MAGIC(x) != ZMAGIC) ? 0 : \ @@ -44,7 +43,7 @@ reloc_howto_type *MYARM(bfd_reloc_type_lookup) PARAMS((bfd *, bfd_reloc_code_real_type)); static boolean MYARM(write_object_contents) PARAMS((bfd *)); -/* Avoid multiple defininitions from aoutx if supporting standarad a.out +/* Avoid multiple defininitions from aoutx if supporting standarad a.out as well as our own. */ #define NAME(x,y) CAT3(aoutarm,_32_,y) @@ -63,7 +62,7 @@ MY(fix_pcrel_26) PARAMS ((bfd *, arelent *, asymbol *, PTR, static void MY(swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **, bfd_size_type)); -void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *, +void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *, struct reloc_std_external *)); reloc_howto_type MY(howto_table)[] = @@ -98,7 +97,7 @@ reloc_howto_type MY(howto_table)[] = #define RELOC_ARM_BITS_NEG_LITTLE ((unsigned int) 0x10) reloc_howto_type * -MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel) +MY(reloc_howto) (abfd, rel, r_index, r_extern, r_pcrel) bfd *abfd; struct reloc_std_external *rel; int *r_index; @@ -139,12 +138,12 @@ MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel) return MY(howto_table) + index; } - + #define MY_reloc_howto(BFD, REL, IN, EX, PC) \ MY(reloc_howto) (BFD, REL, &IN, &EX, &PC) void -MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) +MY(put_reloc) (abfd, r_extern, r_index, value, howto, reloc) bfd *abfd; int r_extern; int r_index; @@ -159,7 +158,7 @@ MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) PUT_WORD (abfd, value, reloc->r_address); r_length = howto->size ; /* Size as a power of two */ - /* Special case for branch relocations. */ + /* Special case for branch relocations. */ if (howto->type == 3 || howto->type == 7) r_length = 3; @@ -188,12 +187,12 @@ MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE)); } } - + #define MY_put_reloc(BFD, EXT, IDX, VAL, HOWTO, RELOC) \ - MY(put_reloc)(BFD, EXT, IDX, VAL, HOWTO, RELOC) + MY(put_reloc) (BFD, EXT, IDX, VAL, HOWTO, RELOC) void -MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr) +MY(relocatable_reloc) (howto, abfd, reloc, amount, r_addr) reloc_howto_type *howto; bfd *abfd; struct reloc_std_external *reloc; @@ -202,11 +201,11 @@ MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr) { if (howto->type == 3) { - if (reloc->r_type[0] + if (reloc->r_type[0] & (bfd_header_big_endian (abfd) ? RELOC_STD_BITS_EXTERN_BIG : RELOC_STD_BITS_EXTERN_LITTLE)) { - /* The reloc is still external, so don't modify anything. */ + /* The reloc is still external, so don't modify anything. */ *amount = 0; } else @@ -225,7 +224,7 @@ MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr) } #define MY_relocatable_reloc(HOW, BFD, REL, AMOUNT, ADDR) \ - MY(relocatable_reloc)(HOW, BFD, REL, &(AMOUNT), ADDR) + MY(relocatable_reloc) (HOW, BFD, REL, &(AMOUNT), ADDR) static bfd_reloc_status_type MY(fix_pcrel_26_done) (abfd, reloc_entry, symbol, data, input_section, @@ -257,7 +256,7 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section, bfd_size_type addr = reloc_entry->address; long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); bfd_reloc_status_type flag = bfd_reloc_ok; - + /* If this is an undefined symbol, return error */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) @@ -297,12 +296,12 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section, /* Now the ARM magic... Change the reloc type so that it is marked as done. Strictly this is only necessary if we are doing a partial relocation. */ reloc_entry->howto = &MY(howto_table)[7]; - + return flag; } reloc_howto_type * -MY(bfd_reloc_type_lookup)(abfd,code) +MY(bfd_reloc_type_lookup) (abfd,code) bfd *abfd; bfd_reloc_code_real_type code; { @@ -392,11 +391,10 @@ MY_swap_std_reloc_out (abfd, g, natptr) r_pcrel = 0; } else if (g->howto->type == 7) - { + { r_length = 3; r_pcrel = 1; } - #if 0 /* For a standard reloc, the addend is in the object file. */ @@ -506,7 +504,7 @@ const bfd_target aout_arm_little_vec = BFD_JUMP_TABLE_DYNAMIC (MY), & aout_arm_big_vec, - + (PTR) MY_backend_data, }; @@ -547,6 +545,6 @@ const bfd_target aout_arm_big_vec = BFD_JUMP_TABLE_DYNAMIC (MY), & aout_arm_little_vec, - + (PTR) MY_backend_data, }; diff --git a/contrib/binutils/bfd/aout-encap.c b/contrib/binutils/bfd/aout-encap.c index c25f903..5f8a511 100644 --- a/contrib/binutils/bfd/aout-encap.c +++ b/contrib/binutils/bfd/aout-encap.c @@ -53,12 +53,12 @@ encap_object_p (abfd) bfd_set_error (bfd_error_wrong_format); return 0; } - + coff_magic = bfd_h_get_16 (abfd, magicbuf); if (coff_magic != COFF_MAGIC) return 0; /* Not an encap coff file */ - __header_offset_temp==COFF_MAGIC ? sizeof(struct coffheader) : 0) + __header_offset_temp==COFF_MAGIC ? sizeof (struct coffheader) : 0) (fseek ((f), HEADER_OFFSET((f)), 1)) magic = bfd_h_get_32 (abfd, magicbuf); @@ -72,7 +72,7 @@ encap_object_p (abfd) bfd_set_error (bfd_error_wrong_format); return 0; } - NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec); + NAME(aout,swap_exec_header_in) (abfd, &exec_bytes, &exec); return aout_32_some_aout_object_p (abfd, &exec, encap_realcallback); } @@ -83,9 +83,9 @@ encap_real_callback (abfd) bfd *abfd; { struct internal_exec *execp = exec_hdr (abfd); - - MY(callback)(abfd, execp); - + + MY(callback) (abfd, execp); + /* If we have a coff header, it can give us better values for text_start and exec_data_start. This is particularly useful for remote debugging of embedded systems. */ diff --git a/contrib/binutils/bfd/aout-target.h b/contrib/binutils/bfd/aout-target.h index 046417b..1902cdf 100644 --- a/contrib/binutils/bfd/aout-target.h +++ b/contrib/binutils/bfd/aout-target.h @@ -61,7 +61,7 @@ MY(callback) (abfd) bfd_vma adjust; adjust = execp->a_entry - obj_textsec (abfd)->vma; - /* Adjust only by whole pages. */ + /* Adjust only by whole pages. */ adjust &= ~(TARGET_PAGE_SIZE - 1); obj_textsec (abfd)->vma += adjust; obj_datasec (abfd)->vma += adjust; @@ -84,7 +84,7 @@ MY(callback) (abfd) /* The file offsets of the string table and symbol table. */ obj_sym_filepos (abfd) = N_SYMOFF (*execp); obj_str_filepos (abfd) = N_STROFF (*execp); - + /* Determine the architecture and machine type of the object file. */ #ifdef SET_ARCH_MACH SET_ARCH_MACH(abfd, *execp); @@ -164,7 +164,7 @@ MY(object_p) (abfd) if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) return 0; #endif - NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec); + NAME(aout,swap_exec_header_in) (abfd, &exec_bytes, &exec); #ifdef SWAP_MAGIC /* swap_exec_header_in read in a_info with the wrong byte order */ @@ -178,7 +178,7 @@ MY(object_p) (abfd) * means that it isn't obvious if EXEC_P should be set. * All of the following must be true for an executable: * There must be no relocations, the bfd can be neither an - * archive nor an archive element, and the file must be executable. */ + * archive nor an archive element, and the file must be executable. */ if (exec.a_trsize + exec.a_drsize == 0 && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL) @@ -197,7 +197,6 @@ MY(object_p) (abfd) #define MY_object_p MY(object_p) #endif - #ifndef MY_mkobject static boolean MY(mkobject) PARAMS ((bfd *)); @@ -206,7 +205,7 @@ static boolean MY(mkobject) (abfd) bfd *abfd; { - if (NAME(aout,mkobject)(abfd) == false) + if (NAME(aout,mkobject) (abfd) == false) return false; #if 0 /* Sizes get set in set_sizes callback, later, after we know the architecture and machine. */ @@ -230,7 +229,6 @@ MY(mkobject) (abfd) static boolean MY_bfd_copy_private_section_data PARAMS ((bfd *, asection *, bfd *, asection *)); -/*ARGSUSED*/ static boolean MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; @@ -530,7 +528,6 @@ MY_bfd_final_link (abfd, info) #define MY_bfd_link_split_section _bfd_generic_link_split_section #endif - #ifndef MY_bfd_copy_private_bfd_data #define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data #endif @@ -581,7 +578,7 @@ MY_bfd_final_link (abfd, info) #endif /* Aout symbols normally have leading underscores */ -#ifndef MY_symbol_leading_char +#ifndef MY_symbol_leading_char #define MY_symbol_leading_char '_' #endif @@ -643,7 +640,7 @@ const bfd_target MY(vec) = /* Alternative_target */ NULL, - + (PTR) MY_backend_data }; #endif /* MY_BFD_TARGET */ diff --git a/contrib/binutils/bfd/aout-tic30.c b/contrib/binutils/bfd/aout-tic30.c index 686c159..f0f4d3d 100644 --- a/contrib/binutils/bfd/aout-tic30.c +++ b/contrib/binutils/bfd/aout-tic30.c @@ -128,7 +128,7 @@ static CONST struct aout_backend_data tic30_aout_backend_data = /* This table lists the relocation types for the TMS320C30. There are only a few relocations required, and all must be divided by 4 (>> 2) to get the 32-bit addresses in the format the TMS320C30 likes - it. */ + it. */ reloc_howto_type tic30_aout_howto_table[] = { EMPTY_HOWTO (-1), @@ -210,7 +210,7 @@ tic30_aout_reloc_howto (abfd, relocs, r_index, r_extern, r_pcrel) requires that any relocations for the data section should point to the end of the aligned text section, plus an offset. By default, this does not happen, therefore this function takes care of - that. */ + that. */ static bfd_reloc_status_type tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -224,11 +224,11 @@ tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, e { bfd_vma relocation; - /* Make sure that the symbol's section is defined. */ + /* Make sure that the symbol's section is defined. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; /* Get the size of the input section and turn it into the TMS320C30 - 32-bit address format. */ + 32-bit address format. */ relocation = (symbol->section->vma >> 2); relocation += bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address); @@ -236,7 +236,7 @@ tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, e } /* This function does the same thing as tic30_aout_fix_16 except for 32 - bit relocations. */ + bit relocations. */ static bfd_reloc_status_type tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section, @@ -251,11 +251,11 @@ tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section, { bfd_vma relocation; - /* Make sure that the symbol's section is defined. */ + /* Make sure that the symbol's section is defined. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; /* Get the size of the input section and turn it into the TMS320C30 - 32-bit address format. */ + 32-bit address format. */ relocation = (symbol->section->vma >> 2); relocation += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); bfd_put_32 (abfd, relocation, (bfd_byte *) data + reloc_entry->address); @@ -267,7 +267,7 @@ tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section, useless for a relocation, so we just get the offset value and place a version of this within the object code. tic30_aout_final_link_relocate will then calculate the required - relocation to add on to the value in the object code. */ + relocation to add on to the value in the object code. */ static bfd_reloc_status_type tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section, @@ -285,7 +285,7 @@ tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section, /* The byte before the location of the fix contains bits 23-16 of the pcrel instruction. Bit 21 is set for a delayed instruction - which requires on offset of 3 instead of 1. */ + which requires on offset of 3 instead of 1. */ if (offset_data & 0x20) relocation -= 3; else @@ -295,14 +295,16 @@ tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section, } /* These macros will get 24-bit values from the bfd definition. - Big-endian only. */ -#define bfd_getb_24(BFD,ADDR) (bfd_get_8(BFD,ADDR) << 16) | \ - (bfd_get_8(BFD,ADDR+1) << 8) | \ - (bfd_get_8(BFD,ADDR+2)) + Big-endian only. */ +#define bfd_getb_24(BFD,ADDR) \ + (bfd_get_8 (BFD, ADDR ) << 16) | \ + (bfd_get_8 (BFD, ADDR + 1) << 8) | \ + (bfd_get_8 (BFD, ADDR + 2) ) -#define bfd_putb_24(BFD,DATA,ADDR) bfd_put_8(BFD,(bfd_byte)((DATA >> 16) & 0xFF),ADDR); \ - bfd_put_8(BFD,(bfd_byte)((DATA >> 8) & 0xFF),ADDR+1); \ - bfd_put_8(BFD,(bfd_byte)(DATA & 0xFF),ADDR+2) +#define bfd_putb_24(BFD,DATA,ADDR) \ + bfd_put_8 (BFD, (bfd_byte) ((DATA >> 16) & 0xFF), ADDR ); \ + bfd_put_8 (BFD, (bfd_byte) ((DATA >> 8) & 0xFF), ADDR + 1); \ + bfd_put_8 (BFD, (bfd_byte) ( DATA & 0xFF), ADDR + 2) /* Set parameters about this a.out file that are machine-dependent. This routine is called from some_aout_object_p just before it returns. */ @@ -563,7 +565,7 @@ tic30_aout_object_p (abfd) * means that it isn't obvious if EXEC_P should be set. * All of the following must be true for an executable: * There must be no relocations, the bfd can be neither an - * archive nor an archive element, and the file must be executable. */ + * archive nor an archive element, and the file must be executable. */ if (exec.a_trsize + exec.a_drsize == 0 && bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL) @@ -586,7 +588,6 @@ tic30_aout_object_p (abfd) section contents, and copy_private_bfd_data is not called until after the section contents have been set. */ -/*ARGSUSED */ static boolean MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; @@ -720,7 +721,7 @@ MY_bfd_final_link (abfd, info) int pad; /* Set the executable header size to 0, as we don't want one for an - output. */ + output. */ adata (abfd).exec_bytes_size = 0; pos = adata (abfd).exec_bytes_size; /* Text. */ @@ -765,7 +766,7 @@ MY_bfd_final_link (abfd, info) obj_bsssec (abfd)->vma = vma; obj_bsssec (abfd)->user_set_vma = 1; - /* We are fully resized, so don't readjust in final_link. */ + /* We are fully resized, so don't readjust in final_link. */ adata (abfd).magic = z_magic; return NAME (aout, final_link) (abfd, info, MY_final_link_callback); @@ -961,7 +962,6 @@ tic30_aout_set_arch_mach (abfd, arch, machine) #define MY_bfd_link_split_section _bfd_generic_link_split_section #endif - #ifndef MY_bfd_copy_private_bfd_data #define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data #endif @@ -1058,7 +1058,7 @@ const bfd_target tic30_aout_vec = BFD_JUMP_TABLE_DYNAMIC (MY), NULL, - + (PTR) MY_backend_data }; #endif /* MY_BFD_TARGET */ diff --git a/contrib/binutils/bfd/aoutf1.h b/contrib/binutils/bfd/aoutf1.h index fdf95b5..4ad49a1 100644 --- a/contrib/binutils/bfd/aoutf1.h +++ b/contrib/binutils/bfd/aoutf1.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This is needed to reject a NewsOS file, e.g. in gdb/testsuite/gdb.t10/crossload.exp. <kingdon@cygnus.com> I needed to add M_UNKNOWN to recognize a 68000 object, so this will - probably no longer reject a NewsOS object. <ian@cygnus.com>. */ + probably no longer reject a NewsOS object. <ian@cygnus.com>. */ #ifndef MACHTYPE_OK #define MACHTYPE_OK(mtype) \ (((mtype) == M_SPARC && bfd_lookup_arch (bfd_arch_sparc, 0) != NULL) \ @@ -123,7 +123,7 @@ sunos_set_arch_mach (abfd, machtype) case M_UNKNOWN: /* Some Sun3s make magic numbers without cpu types in them, so - we'll default to the 68000. */ + we'll default to the 68000. */ arch = bfd_arch_m68k; machine = bfd_mach_m68000; break; @@ -180,7 +180,7 @@ sunos_set_arch_mach (abfd, machtype) } #define SET_ARCH_MACH(ABFD, EXEC) \ - NAME(sunos,set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \ + NAME(sunos,set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \ choose_reloc_size(ABFD); /* Determine the size of a relocation entry, based on the architecture */ @@ -275,11 +275,11 @@ sunos_write_object_contents (abfd) Unfortunately, they don't document the FPA structure, or at least I can't find it easily. Fortunately the core header contains its own length. So this shouldn't cause problems, except for c_ucode, which - so far we don't use but is easy to find with a little arithmetic. */ + so far we don't use but is easy to find with a little arithmetic. */ /* But the reg structure can be gotten from the SPARC processor handbook. This really should be in a GNU include file though so that gdb can use - the same info. */ + the same info. */ struct regs { int r_psr; @@ -439,7 +439,7 @@ swapcore_sun3 (abfd, ext, intcore) intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize); memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname)); intcore->fp_stuff_pos = (long) (((struct external_sun3_core *) 0)->fp_stuff); - /* FP stuff takes up whole rest of struct, except c_ucode. */ + /* FP stuff takes up whole rest of struct, except c_ucode. */ intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) - (file_ptr) (((struct external_sun3_core *) 0)->fp_stuff); /* Ucode is the last thing in the struct -- just before the end */ @@ -449,7 +449,6 @@ swapcore_sun3 (abfd, ext, intcore) intcore->c_stacktop = 0x0E000000; /* By experimentation */ } - /* byte-swap in the Sparc core structure */ static void swapcore_sparc (abfd, ext, intcore) @@ -476,7 +475,7 @@ swapcore_sparc (abfd, ext, intcore) intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize); memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname)); intcore->fp_stuff_pos = (long) (((struct external_sparc_core *) 0)->fp_stuff); - /* FP stuff takes up whole rest of struct, except c_ucode. */ + /* FP stuff takes up whole rest of struct, except c_ucode. */ intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) - (file_ptr) (((struct external_sparc_core *) 0)->fp_stuff); /* Ucode is the last thing in the struct -- just before the end */ @@ -544,7 +543,7 @@ swapcore_solaris_bcp (abfd, ext, intcore) memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname)); intcore->fp_stuff_pos = (long) (((struct external_solaris_bcp_core *) 0)->fp_stuff); - /* FP stuff takes up whole rest of struct, except c_ucode. */ + /* FP stuff takes up whole rest of struct, except c_ucode. */ intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) - (file_ptr) (((struct external_solaris_bcp_core *) 0)->fp_stuff); /* Ucode is the last thing in the struct -- just before the end */ @@ -764,7 +763,7 @@ sunos4_core_file_matches_executable_p (core_bfd, exec_bfd) return false; } - /* Solaris core files do not include an aouthdr. */ + /* Solaris core files do not include an aouthdr. */ if ((core_hdr (core_bfd)->hdr)->c_len == SOLARIS_BCP_CORE_LEN) return true; diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h index 920661b..94a46b0 100644 --- a/contrib/binutils/bfd/aoutx.h +++ b/contrib/binutils/bfd/aoutx.h @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ SECTION a.out backends - DESCRIPTION BFD supports a number of different flavours of a.out format, @@ -165,10 +164,18 @@ DESCRIPTION #define MY_swap_std_reloc_in NAME(aout,swap_std_reloc_in) #endif +#ifndef MY_swap_ext_reloc_in +#define MY_swap_ext_reloc_in NAME(aout,swap_ext_reloc_in) +#endif + #ifndef MY_swap_std_reloc_out #define MY_swap_std_reloc_out NAME(aout,swap_std_reloc_out) #endif +#ifndef MY_swap_ext_reloc_out +#define MY_swap_ext_reloc_out NAME(aout,swap_ext_reloc_out) +#endif + #ifndef MY_final_link_relocate #define MY_final_link_relocate _bfd_final_link_relocate #endif @@ -260,7 +267,7 @@ EMPTY_HOWTO (-1), HOWTO(40, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASEREL", false, 0,0x00000000, false), }; -#define TABLE_SIZE(TABLE) (sizeof(TABLE)/sizeof(TABLE[0])) +#define TABLE_SIZE(TABLE) (sizeof (TABLE)/sizeof (TABLE[0])) reloc_howto_type * NAME(aout,reloc_type_lookup) (abfd,code) @@ -283,6 +290,8 @@ NAME(aout,reloc_type_lookup) (abfd,code) if (ext) switch (code) { + EXT (BFD_RELOC_8, 0); + EXT (BFD_RELOC_16, 1); EXT (BFD_RELOC_32, 2); EXT (BFD_RELOC_HI22, 8); EXT (BFD_RELOC_LO10, 11); @@ -353,7 +362,7 @@ NAME(aout,swap_exec_header_in) (abfd, raw_bytes, execp) /* The internal_exec structure has some fields that are unused in this configuration (IE for i960), so ensure that all such uninitialized fields are zero'd out. There are places where two of these structs - are memcmp'd, and thus the contents do matter. */ + are memcmp'd, and thus the contents do matter. */ memset ((PTR) execp, 0, sizeof (struct internal_exec)); /* Now fill in fields in the execp, from the bytes in the raw data. */ execp->a_info = bfd_h_get_32 (abfd, bytes->e_info); @@ -390,7 +399,7 @@ NAME(aout,swap_exec_header_out) (abfd, execp, raw_bytes) { struct external_exec *bytes = (struct external_exec *)raw_bytes; - /* Now fill in fields in the raw data, from the fields in the exec struct. */ + /* Now fill in fields in the raw data, from the fields in the exec struct. */ bfd_h_put_32 (abfd, execp->a_info , bytes->e_info); PUT_WORD (abfd, execp->a_text , bytes->e_text); PUT_WORD (abfd, execp->a_data , bytes->e_data); @@ -426,7 +435,7 @@ FUNCTION SYNOPSIS const bfd_target *aout_@var{size}_some_aout_object_p (bfd *abfd, - const bfd_target *(*callback_to_real_object_p)()); + const bfd_target *(*callback_to_real_object_p) ()); DESCRIPTION Some a.out variant thinks that the file open in @var{abfd} @@ -507,7 +516,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) /* The default relocation entry size is that of traditional V7 Unix. */ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - /* The default symbol entry size is that of traditional Unix. */ + /* The default symbol entry size is that of traditional Unix. */ obj_symbol_entry_size (abfd) = EXTERNAL_NLIST_SIZE; #ifdef USE_MMAP @@ -591,7 +600,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) header, should cope with them in this callback as well. */ #endif /* DOCUMENTATION */ - result = (*callback_to_real_object_p)(abfd); + result = (*callback_to_real_object_p) (abfd); /* Now that the segment addresses have been worked out, take a better guess at whether the file is executable. If the entry point @@ -606,7 +615,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) To fix this, we now accept any non-zero entry point as an indication of executability. This will work most of the time, since only the linker - sets the entry point, and that is likely to be non-zero for most systems. */ + sets the entry point, and that is likely to be non-zero for most systems. */ if (execp->a_entry != 0 || (execp->a_entry >= obj_textsec(abfd)->vma @@ -683,7 +692,6 @@ NAME(aout,mkobject) (abfd) return true; } - /* FUNCTION aout_@var{size}_machine_type @@ -747,7 +755,7 @@ NAME(aout,machine_type) (arch, machine, unknown) case bfd_arch_arm: if (machine == 0) arch_flags = M_ARM; break; - + case bfd_arch_mips: switch (machine) { case 0: @@ -768,7 +776,12 @@ NAME(aout,machine_type) (arch, machine, unknown) case bfd_mach_mips8000: case bfd_mach_mips10000: case bfd_mach_mips16: - /* FIXME: These should be MIPS3 or MIPS4. */ + case bfd_mach_mips32: + case bfd_mach_mips32_4k: + case bfd_mach_mips5: + case bfd_mach_mips64: + case bfd_mach_mips_sb1: + /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ arch_flags = M_MIPS2; break; default: @@ -790,6 +803,10 @@ NAME(aout,machine_type) (arch, machine, unknown) *unknown = false; break; + case bfd_arch_cris: + if (machine == 0 || machine == 255) arch_flags = M_CRIS; + break; + default: arch_flags = M_UNKNOWN; } @@ -800,7 +817,6 @@ NAME(aout,machine_type) (arch, machine, unknown) return arch_flags; } - /* FUNCTION aout_@var{size}_set_arch_mach @@ -927,7 +943,7 @@ adjust_z_magic (abfd, execp) file_ptr text_end; CONST struct aout_backend_data *abdp; int ztih; /* Nonzero if text includes exec header. */ - + abdp = aout_backend_info (abfd); /* Text. */ @@ -995,7 +1011,7 @@ adjust_z_magic (abfd, execp) } obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos + obj_textsec(abfd)->_raw_size); - + /* Fix up exec header while we're at it. */ execp->a_text = obj_textsec(abfd)->_raw_size; if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted))) @@ -1040,7 +1056,7 @@ adjust_n_magic (abfd, execp) file_ptr pos = adata(abfd).exec_bytes_size; bfd_vma vma = 0; int pad; - + /* Text. */ obj_textsec(abfd)->filepos = pos; if (!obj_textsec(abfd)->user_set_vma) @@ -1055,7 +1071,7 @@ adjust_n_magic (abfd, execp) if (!obj_datasec(abfd)->user_set_vma) obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size); vma = obj_datasec(abfd)->vma; - + /* Since BSS follows data immediately, see if it needs alignment. */ vma += obj_datasec(abfd)->_raw_size; pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma; @@ -1100,7 +1116,7 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) (TARGET_PAGE_SIZE). However, newer versions of SUNOS start the text segment right after the exec header; the latter is counted in the text segment size, and is paged in by the kernel with the rest of - the text. */ + the text. */ /* This perhaps isn't the right way to do this, but made it simpler for me to understand enough to implement it. Better would probably be to go @@ -1187,7 +1203,6 @@ NAME(aout,new_section_hook) (abfd, newsect) /* align to double at least */ newsect->alignment_power = bfd_get_arch_info(abfd)->section_align_power; - if (bfd_get_format (abfd) == bfd_object) { if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) { @@ -1297,7 +1312,7 @@ aout_get_external_symbols (abfd) obj_aout_external_syms (abfd) = syms; obj_aout_external_sym_count (abfd) = count; } - + if (obj_aout_external_strings (abfd) == NULL && exec_hdr (abfd)->a_syms != 0) { @@ -1626,7 +1641,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) file. */ (*_bfd_error_handler) (_("%s: can not represent section for symbol `%s' in a.out object file format"), - bfd_get_filename (abfd), + bfd_get_filename (abfd), cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*")); bfd_set_error (bfd_error_nonrepresentable_section); return false; @@ -1671,6 +1686,8 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) sym_pointer->e_type[0] = ((aout_symbol_type *) cache_ptr)->type; else if ((cache_ptr->flags & BSF_GLOBAL) != 0) sym_pointer->e_type[0] |= N_EXT; + else if ((cache_ptr->flags & BSF_LOCAL) != 0) + sym_pointer->e_type[0] &= ~N_EXT; if ((cache_ptr->flags & BSF_CONSTRUCTOR) != 0) { @@ -1706,7 +1723,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) return true; } -/* Native-level interface to symbols. */ +/* Native-level interface to symbols. */ asymbol * NAME(aout,make_empty_symbol) (abfd) @@ -1773,7 +1790,7 @@ NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic) /* We read the symbols into a buffer, which is discarded when this function exits. We read the strings into a buffer large enough to - hold them all plus all the cached symbol entries. */ + hold them all plus all the cached symbol entries. */ boolean NAME(aout,slurp_symbol_table) (abfd) @@ -1960,7 +1977,6 @@ error_return: _bfd_stringtab_free (strtab); return false; } - long NAME(aout,get_symtab) (abfd, location) @@ -1970,18 +1986,17 @@ NAME(aout,get_symtab) (abfd, location) unsigned int counter = 0; aout_symbol_type *symbase; - if (!NAME(aout,slurp_symbol_table)(abfd)) + if (!NAME(aout,slurp_symbol_table) (abfd)) return -1; for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);) - *(location++) = (asymbol *)( symbase++); + *(location++) = (asymbol *) ( symbase++); *location++ =0; return bfd_get_symcount (abfd); } - /* Standard reloc stuff */ -/* Output standard relocation information to a file in target byte order. */ +/* Output standard relocation information to a file in target byte order. */ extern void NAME(aout,swap_std_reloc_out) PARAMS ((bfd *, arelent *, struct reloc_std_external *)); @@ -2024,7 +2039,6 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) check for that here */ - if (bfd_is_com_section (output_section) || bfd_is_abs_section (output_section) || bfd_is_und_section (output_section)) @@ -2077,9 +2091,8 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) } } - /* Extended stuff */ -/* Output extended relocation information to a file in target byte order. */ +/* Output extended relocation information to a file in target byte order. */ extern void NAME(aout,swap_ext_reloc_out) PARAMS ((bfd *, arelent *, struct reloc_ext_external *)); @@ -2161,7 +2174,6 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) contain 60. This macro subs the base of each section from the value to give the true offset from the section */ - #define MOVE_ADDRESS(ad) \ if (r_extern) { \ /* undefined symbol */ \ @@ -2381,8 +2393,8 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) (struct reloc_ext_external *) relocs; for (; counter < count; counter++, rptr++, cache_ptr++) - NAME(aout,swap_ext_reloc_in) (abfd, rptr, cache_ptr, symbols, - bfd_get_symcount (abfd)); + MY_swap_ext_reloc_in (abfd, rptr, cache_ptr, symbols, + bfd_get_symcount (abfd)); } else { @@ -2432,7 +2444,8 @@ NAME(aout,squirt_out_relocs) (abfd, section) for (natptr = native; count != 0; --count, natptr += each_size, ++generic) - NAME(aout,swap_ext_reloc_out) (abfd, *generic, (struct reloc_ext_external *)natptr); + MY_swap_ext_reloc_out (abfd, *generic, + (struct reloc_ext_external *) natptr); } else { @@ -2468,7 +2481,7 @@ NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols) return 0; } - if (!(tblptr || NAME(aout,slurp_reloc_table)(abfd, section, symbols))) + if (!(tblptr || NAME(aout,slurp_reloc_table) (abfd, section, symbols))) return -1; if (section->flags & SEC_CONSTRUCTOR) { @@ -2523,19 +2536,17 @@ NAME(aout,get_reloc_upper_bound) (abfd, asect) bfd_set_error (bfd_error_invalid_operation); return -1; } - long NAME(aout,get_symtab_upper_bound) (abfd) bfd *abfd; { - if (!NAME(aout,slurp_symbol_table)(abfd)) + if (!NAME(aout,slurp_symbol_table) (abfd)) return -1; return (bfd_get_symcount (abfd)+1) * (sizeof (aout_symbol_type *)); } -/*ARGSUSED*/ alent * NAME(aout,get_lineno) (ignore_abfd, ignore_symbol) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -2544,7 +2555,6 @@ NAME(aout,get_lineno) (ignore_abfd, ignore_symbol) return (alent *)NULL; } -/*ARGSUSED*/ void NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -2561,18 +2571,17 @@ NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret) if (stab_name == NULL) { - sprintf(buf, "(%d)", type_code); + sprintf (buf, "(%d)", type_code); stab_name = buf; } ret->type = '-'; ret->stab_type = type_code; - ret->stab_other = (unsigned)(aout_symbol(symbol)->other & 0xff); - ret->stab_desc = (unsigned)(aout_symbol(symbol)->desc & 0xffff); + ret->stab_other = (unsigned) (aout_symbol(symbol)->other & 0xff); + ret->stab_desc = (unsigned) (aout_symbol(symbol)->desc & 0xffff); ret->stab_name = stab_name; } } -/*ARGSUSED*/ void NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -2585,27 +2594,26 @@ NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how) switch (how) { case bfd_print_symbol_name: if (symbol->name) - fprintf(file,"%s", symbol->name); + fprintf (file,"%s", symbol->name); break; case bfd_print_symbol_more: - fprintf(file,"%4x %2x %2x",(unsigned)(aout_symbol(symbol)->desc & 0xffff), - (unsigned)(aout_symbol(symbol)->other & 0xff), - (unsigned)(aout_symbol(symbol)->type)); + fprintf (file,"%4x %2x %2x",(unsigned) (aout_symbol(symbol)->desc & 0xffff), + (unsigned) (aout_symbol(symbol)->other & 0xff), + (unsigned) (aout_symbol(symbol)->type)); break; case bfd_print_symbol_all: { CONST char *section_name = symbol->section->name; - bfd_print_symbol_vandf((PTR)file,symbol); - fprintf(file," %-5s %04x %02x %02x", + fprintf (file," %-5s %04x %02x %02x", section_name, - (unsigned)(aout_symbol(symbol)->desc & 0xffff), - (unsigned)(aout_symbol(symbol)->other & 0xff), - (unsigned)(aout_symbol(symbol)->type & 0xff)); + (unsigned) (aout_symbol(symbol)->desc & 0xffff), + (unsigned) (aout_symbol(symbol)->other & 0xff), + (unsigned) (aout_symbol(symbol)->type & 0xff)); if (symbol->name) - fprintf(file," %s", symbol->name); + fprintf (file," %s", symbol->name); } break; } @@ -2705,8 +2713,8 @@ NAME(aout,find_nearest_line) CONST char *directory_name = NULL; CONST char *main_file_name = NULL; CONST char *current_file_name = NULL; - CONST char *line_file_name = NULL; /* Value of current_file_name at line number. */ - CONST char *line_directory_name = NULL; /* Value of directory_name at line number. */ + CONST char *line_file_name = NULL; /* Value of current_file_name at line number. */ + CONST char *line_directory_name = NULL; /* Value of directory_name at line number. */ bfd_vma low_line_vma = 0; bfd_vma low_func_vma = 0; asymbol *func = 0; @@ -2718,7 +2726,7 @@ NAME(aout,find_nearest_line) *line_ptr = 0; if (symbols != (asymbol **)NULL) { for (p = symbols; *p; p++) { - aout_symbol_type *q = (aout_symbol_type *)(*p); + aout_symbol_type *q = (aout_symbol_type *) (*p); next: switch (q->type){ case N_TEXT: @@ -2765,15 +2773,15 @@ NAME(aout,find_nearest_line) } main_file_name = current_file_name = q->symbol.name; - /* Look ahead to next symbol to check if that too is an N_SO. */ + /* Look ahead to next symbol to check if that too is an N_SO. */ p++; if (*p == NULL) break; - q = (aout_symbol_type *)(*p); + q = (aout_symbol_type *) (*p); if (q->type != (int)N_SO) goto next; - /* Found a second N_SO First is directory; second is filename. */ + /* Found a second N_SO First is directory; second is filename. */ directory_name = current_file_name; main_file_name = current_file_name = q->symbol.name; if (obj_textsec(abfd) != section) @@ -2881,7 +2889,6 @@ NAME(aout,find_nearest_line) return true; } -/*ARGSUSED*/ int NAME(aout,sizeof_headers) (abfd, execable) bfd *abfd; @@ -4125,7 +4132,7 @@ aout_link_write_symbols (finfo, input_bfd) /* We have saved the hash table entry for this symbol, if there is one. Note that we could just look it up again in the hash table, provided we first check that it is an - external symbol. */ + external symbol. */ h = *sym_hash; /* Use the name from the hash table, in case the symbol was @@ -4789,7 +4796,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, #ifdef MY_reloc_howto howto = MY_reloc_howto(input_bfd, rel, r_index, r_extern, r_pcrel); -#else +#else { int r_jmptable; int r_relative; @@ -5671,6 +5678,10 @@ aout_link_reloc_link_order (finfo, o, p) } else { +#ifdef MY_put_ext_reloc + MY_put_ext_reloc (finfo->output_bfd, r_extern, r_index, p->offset, + howto, &erel, pr->addend); +#else PUT_WORD (finfo->output_bfd, p->offset, erel.r_address); if (bfd_header_big_endian (finfo->output_bfd)) @@ -5693,6 +5704,7 @@ aout_link_reloc_link_order (finfo, o, p) } PUT_WORD (finfo->output_bfd, pr->addend, erel.r_addend); +#endif /* MY_put_ext_reloc */ rel_ptr = (PTR) &erel; } diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c index 27dfd39..14dc770 100644 --- a/contrib/binutils/bfd/archive.c +++ b/contrib/binutils/bfd/archive.c @@ -152,10 +152,8 @@ extern int errno; the cache when we actually read one. We also don't sort the cache; it's generally short enough to search linearly. Note that the pointers here point to the front of the ar_hdr, not - to the front of the contents! -*/ -struct ar_cache -{ + to the front of the contents! */ +struct ar_cache { file_ptr ptr; bfd *arelt; struct ar_cache *next; @@ -164,7 +162,7 @@ struct ar_cache #define ar_padchar(abfd) ((abfd)->xvec->ar_pad_char) #define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen) -#define arch_eltdata(bfd) ((struct areltdata *)((bfd)->arelt_data)) +#define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data)) #define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header) static char *get_extended_arelt_filename PARAMS ((bfd *arch, @@ -316,7 +314,7 @@ _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt) } /* The name begins with space. Hence the rest of the name is an index into - the string table. */ + the string table. */ static char * get_extended_arelt_filename (arch, name) @@ -326,9 +324,9 @@ get_extended_arelt_filename (arch, name) unsigned long index = 0; /* Should extract string so that I can guarantee not to overflow into - the next region, but I'm too lazy. */ + the next region, but I'm too lazy. */ errno = 0; - /* Skip first char, which is '/' in SVR4 or ' ' in some other variants. */ + /* Skip first char, which is '/' in SVR4 or ' ' in some other variants. */ index = strtol (name + 1, NULL, 10); if (errno != 0) { @@ -411,7 +409,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) } } /* BSD4.4-style long filename. - Only implemented for reading, so far! */ + Only implemented for reading, so far! */ else if (hdr.ar_name[0] == '#' && hdr.ar_name[1] == '1' && hdr.ar_name[2] == '/' @@ -440,15 +438,15 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) { /* We judge the end of the name by looking for '/' or ' '. Note: The SYSV format (terminated by '/') allows embedded - spaces, so only look for ' ' if we don't find '/'. */ + spaces, so only look for ' ' if we don't find '/'. */ char *e; e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd)); if (e == NULL) { - e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd)); + e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd)); if (e == NULL) - e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd)); + e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd)); } if (e != NULL) @@ -526,7 +524,7 @@ _bfd_get_elt_at_filepos (archive, filepos) if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd)) return n_nfd; - /* huh? */ + /* Huh? */ bfd_release (archive, (PTR) n_nfd); bfd_release (archive, (PTR) new_areldata); return NULL; @@ -560,7 +558,6 @@ DESCRIPTION the archive and the previous return value to return a created BFD to the next contained element. NULL is returned when there are no more. - */ bfd * @@ -595,7 +592,7 @@ bfd_generic_openr_next_archived_file (archive, last_file) unsigned int size = arelt_size (last_file); /* Pad to an even boundary... Note that last_file->origin can be odd in the case of - BSD-4.4-style element with a long odd size. */ + BSD-4.4-style element with a long odd size. */ filestart = last_file->origin + size; filestart += filestart % 2; } @@ -603,7 +600,6 @@ bfd_generic_openr_next_archived_file (archive, last_file) return _bfd_get_elt_at_filepos (archive, filestart); } - const bfd_target * bfd_generic_archive_p (abfd) bfd *abfd; @@ -630,7 +626,7 @@ bfd_generic_archive_p (abfd) #endif /* We are setting bfd_ardata(abfd) here, but since bfd_ardata - involves a cast, we can't do it as the left operand of assignment. */ + involves a cast, we can't do it as the left operand of assignment. */ abfd->tdata.aout_ar_data = ((struct artdata *) bfd_zalloc (abfd, sizeof (struct artdata))); @@ -737,7 +733,7 @@ do_slurp_bsd_armap (abfd) if (mapdata == NULL) return false; parsed_size = mapdata->parsed_size; - bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ + bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size); if (raw_armap == (bfd_byte *) NULL) @@ -782,16 +778,17 @@ do_slurp_bsd_armap (abfd) } ardata->first_file_filepos = bfd_tell (abfd); - /* Pad to an even boundary if you have to */ + /* Pad to an even boundary if you have to. */ ardata->first_file_filepos += (ardata->first_file_filepos) % 2; /* FIXME, we should provide some way to free raw_ardata when we are done using the strings from it. For now, it seems - to be allocated on an objalloc anyway... */ + to be allocated on an objalloc anyway... */ bfd_has_map (abfd) = true; return true; } -/* Returns false on error, true otherwise */ +/* Returns false on error, true otherwise. */ + static boolean do_slurp_coff_armap (abfd) bfd *abfd; @@ -803,7 +800,7 @@ do_slurp_coff_armap (abfd) unsigned int stringsize; unsigned int parsed_size; carsym *carsyms; - unsigned int nsymz; /* Number of symbols in armap. */ + unsigned int nsymz; /* Number of symbols in armap. */ bfd_vma (*swap) PARAMS ((const bfd_byte *)); char int_buf[sizeof (long)]; unsigned int carsym_size, ptrsize, i; @@ -812,7 +809,7 @@ do_slurp_coff_armap (abfd) if (mapdata == NULL) return false; parsed_size = mapdata->parsed_size; - bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ + bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ if (bfd_read ((PTR) int_buf, 1, 4, abfd) != 4) { @@ -821,7 +818,7 @@ do_slurp_coff_armap (abfd) return false; } /* It seems that all numeric information in a coff archive is always - in big endian format, nomatter the host or target. */ + in big endian format, nomatter the host or target. */ swap = bfd_getb32; nsymz = bfd_getb32 ((PTR) int_buf); stringsize = parsed_size - (4 * nsymz) - 4; @@ -836,7 +833,7 @@ do_slurp_coff_armap (abfd) && bfd_get_arch (abfd) == bfd_arch_i960 && bfd_get_flavour (abfd) == bfd_target_coff_flavour) { - /* This looks dangerous, let's do it the other way around */ + /* This looks dangerous, let's do it the other way around. */ nsymz = bfd_getl32 ((PTR) int_buf); stringsize = parsed_size - (4 * nsymz) - 4; swap = bfd_getl32; @@ -844,7 +841,7 @@ do_slurp_coff_armap (abfd) #endif /* The coff armap must be read sequentially. So we construct a - bsd-style one in core all at once, for simplicity. */ + bsd-style one in core all at once, for simplicity. */ carsym_size = (nsymz * sizeof (carsym)); ptrsize = (4 * nsymz); @@ -855,7 +852,7 @@ do_slurp_coff_armap (abfd) carsyms = ardata->symdefs; stringbase = ((char *) ardata->symdefs) + carsym_size; - /* Allocate and read in the raw offsets. */ + /* Allocate and read in the raw offsets. */ raw_armap = (int *) bfd_alloc (abfd, ptrsize); if (raw_armap == NULL) goto release_symdefs; @@ -867,7 +864,7 @@ do_slurp_coff_armap (abfd) goto release_raw_armap; } - /* OK, build the carsyms */ + /* OK, build the carsyms. */ for (i = 0; i < nsymz; i++) { rawptr = raw_armap + i; @@ -880,27 +877,25 @@ do_slurp_coff_armap (abfd) ardata->symdef_count = nsymz; ardata->first_file_filepos = bfd_tell (abfd); - /* Pad to an even boundary if you have to */ + /* Pad to an even boundary if you have to. */ ardata->first_file_filepos += (ardata->first_file_filepos) % 2; - bfd_has_map (abfd) = true; bfd_release (abfd, (PTR) raw_armap); - - /* Check for a second archive header (as used by PE) */ + /* Check for a second archive header (as used by PE). */ { struct areltdata *tmp; bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET); tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd); - if (tmp != NULL) + if (tmp != NULL) { if (tmp->arch_header[0] == '/' - && tmp->arch_header[1] == ' ') + && tmp->arch_header[1] == ' ') { ardata->first_file_filepos += - (tmp->parsed_size + sizeof(struct ar_hdr) + 1) & ~1; + (tmp->parsed_size + sizeof (struct ar_hdr) + 1) & ~1; } bfd_release (abfd, tmp); } @@ -952,7 +947,7 @@ bfd_slurp_armap (abfd) /* Returns false on error, true otherwise */ /* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the header is in a slightly different order and the map name is '/'. - This flavour is used by hp300hpux. */ + This flavour is used by hp300hpux. */ #define HPUX_SYMDEF_COUNT_SIZE 2 @@ -975,7 +970,7 @@ bfd_slurp_bsd_armap_f2 (abfd) if (i != 16) return false; - /* The archive has at least 16 bytes in it */ + /* The archive has at least 16 bytes in it. */ if (bfd_seek (abfd, -16L, SEEK_CUR) != 0) return false; @@ -1024,7 +1019,7 @@ bfd_slurp_bsd_armap_f2 (abfd) ardata->cache = 0; stringsize = bfd_h_get_32 (abfd, raw_armap + HPUX_SYMDEF_COUNT_SIZE); - /* skip sym count and string sz */ + /* Skip sym count and string sz. */ stringbase = ((char *) raw_armap + HPUX_SYMDEF_COUNT_SIZE + BSD_STRING_COUNT_SIZE); @@ -1044,11 +1039,11 @@ bfd_slurp_bsd_armap_f2 (abfd) } ardata->first_file_filepos = bfd_tell (abfd); - /* Pad to an even boundary if you have to */ + /* Pad to an even boundary if you have to. */ ardata->first_file_filepos += (ardata->first_file_filepos) % 2; /* FIXME, we should provide some way to free raw_ardata when we are done using the strings from it. For now, it seems - to be allocated on an objalloc anyway... */ + to be allocated on an objalloc anyway... */ bfd_has_map (abfd) = true; return true; } @@ -1061,9 +1056,10 @@ bfd_slurp_bsd_armap_f2 (abfd) element (the first in the archive, or second if there is an armap); the name in the ar_hdr is replaced by <space><index into filename element>. Index is the P.R. of an int (decimal). Data General have - extended the format by using the prefix // for the special element */ + extended the format by using the prefix // for the special element. */ + +/* Returns false on error, true otherwise. */ -/* Returns false on error, true otherwise */ boolean _bfd_slurp_extended_name_table (abfd) bfd *abfd; @@ -1117,22 +1113,25 @@ _bfd_slurp_extended_name_table (abfd) { char *temp = bfd_ardata (abfd)->extended_names; char *limit = temp + namedata->parsed_size; - for (; temp < limit; ++temp) { - if (*temp == '\012') - temp[temp[-1] == '/' ? -1 : 0] = '\0'; - if (*temp == '\\') - *temp = '/'; - } + for (; temp < limit; ++temp) + { + if (*temp == '\012') + temp[temp[-1] == '/' ? -1 : 0] = '\0'; + if (*temp == '\\') + *temp = '/'; + } } - /* Pad to an even boundary if you have to */ + /* Pad to an even boundary if you have to. */ bfd_ardata (abfd)->first_file_filepos = bfd_tell (abfd); bfd_ardata (abfd)->first_file_filepos += (bfd_ardata (abfd)->first_file_filepos) % 2; /* FIXME, we can't release namedata here because it was allocated - below extended_names on the objalloc... */ - /* bfd_release (abfd, namedata); */ + below extended_names on the objalloc... */ +#if 0 + bfd_release (abfd, namedata); +#endif } return true; } @@ -1140,7 +1139,8 @@ _bfd_slurp_extended_name_table (abfd) #ifdef VMS /* Return a copy of the stuff in the filename between any :]> and a - semicolon */ + semicolon. */ + static const char * normalize (abfd, file) bfd *abfd; @@ -1183,12 +1183,11 @@ normalize (abfd, file) { const char *filename = strrchr (file, '/'); - #ifdef HAVE_DOS_BASED_FILE_SYSTEM { /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ char *bslash = strrchr (file, '\\'); - if (bslash > filename) + if (filename == NULL || (bslash != NULL && bslash > filename)) filename = bslash; if (filename == NULL && file[0] != '\0' && file[1] == ':') filename = file + 1; @@ -1250,7 +1249,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) *tablen = 0; - /* Figure out how long the table should be */ + /* Figure out how long the table should be. */ for (current = abfd->archive_head; current != NULL; current = current->next) { const char *normal; @@ -1318,7 +1317,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) { /* Works for now; may need to be re-engineered if we encounter an oddball archive format and want to - generalise this hack. */ + generalise this hack. */ struct ar_hdr *hdr = arch_hdr (current); strcpy (strptr, normal); if (! trailing_slash) @@ -1330,10 +1329,10 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) } hdr->ar_name[0] = ar_padchar (current); /* We know there will always be enough room (one of the few - cases where you may safely use sprintf). */ + cases where you may safely use sprintf). */ sprintf ((hdr->ar_name) + 1, "%-d", (unsigned) (strptr - *tabloc)); /* Kinda Kludgy. We should just use the returned value of - sprintf but not all implementations get this right */ + sprintf but not all implementations get this right. */ { char *temp = hdr->ar_name + 2; for (; temp < hdr->ar_name + maxname; temp++) @@ -1351,6 +1350,24 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) /** A couple of functions for creating ar_hdrs */ +#ifdef HPUX_LARGE_AR_IDS +/* Function to encode large UID/GID values according to HP. */ + +static void +hpux_uid_gid_encode (str, id) + char str[6]; + long int id; +{ + int cnt; + + str[5] = '@' + (id & 3); + id >>= 2; + + for (cnt = 4; cnt >= 0; ++cnt, id >>= 6) + str[cnt] = ' ' + (id & 0x3f); +} +#endif /* HPUX_LARGE_AR_IDS */ + #ifndef HAVE_GETUID #define getuid() 0 #endif @@ -1362,7 +1379,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) /* Takes a filename, returns an arelt_data for it, or NULL if it can't make one. The filename must refer to a filename in the filesystem. The filename field of the ar_hdr will NOT be initialized. If member - is set, and it's an in-memory bfd, we fake it. */ + is set, and it's an in-memory bfd, we fake it. */ static struct areltdata * bfd_ar_hdr_from_filesystem (abfd, filename, member) @@ -1377,11 +1394,11 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) if (member && (member->flags & BFD_IN_MEMORY) != 0) { - /* Assume we just "made" the member, and fake it */ + /* Assume we just "made" the member, and fake it. */ struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream; - time(&status.st_mtime); - status.st_uid = getuid(); - status.st_gid = getgid(); + time (&status.st_mtime); + status.st_uid = getuid (); + status.st_gid = getgid (); status.st_mode = 0644; status.st_size = bim->size; } @@ -1397,20 +1414,34 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) return NULL; hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata)); - /* ar headers are space padded, not null padded! */ + /* ar headers are space padded, not null padded! */ memset ((PTR) hdr, ' ', sizeof (struct ar_hdr)); strncpy (hdr->ar_fmag, ARFMAG, 2); - /* Goddamned sprintf doesn't permit MAXIMUM field lengths */ + /* Goddamned sprintf doesn't permit MAXIMUM field lengths. */ sprintf ((hdr->ar_date), "%-12ld", (long) status.st_mtime); - sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid); +#ifdef HPUX_LARGE_AR_IDS + /* HP has a very "special" way to handle UID/GID's with numeric values + > 99999. */ + if (status.st_uid > 99999) + hpux_uid_gid_encode (hdr->ar_gid, (long) status.st_uid); + else +#endif + sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid); +#ifdef HPUX_LARGE_AR_IDS + /* HP has a very "special" way to handle UID/GID's with numeric values + > 99999. */ + if (status.st_gid > 99999) + hpux_uid_gid_encode (hdr->ar_uid, (long) status.st_gid); + else +#endif sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid); sprintf ((hdr->ar_mode), "%-8o", (unsigned int) status.st_mode); sprintf ((hdr->ar_size), "%-10ld", (long) status.st_size); /* Correct for a lossage in sprintf whereby it null-terminates. I cannot understand how these C losers could design such a ramshackle bunch of - IO operations */ + IO operations. */ temp = (char *) hdr; temp1 = temp + sizeof (struct ar_hdr) - 2; for (; temp < temp1; temp++) @@ -1426,9 +1457,9 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) } /* This is magic required by the "ar" program. Since it's - undocumented, it's undocumented. You may think that it would take - a strong stomach to write this, and it does, but it takes even a - stronger stomach to try to code around such a thing! */ + undocumented, it's undocumented. You may think that it would take + a strong stomach to write this, and it does, but it takes even a + stronger stomach to try to code around such a thing! */ struct ar_hdr *bfd_special_undocumented_glue PARAMS ((bfd *, const char *)); @@ -1443,8 +1474,8 @@ bfd_special_undocumented_glue (abfd, filename) return (struct ar_hdr *) ar_elt->arch_header; } +/* Analogous to stat call. */ -/* Analogous to stat call */ int bfd_generic_stat_arch_elt (abfd, buf) bfd *abfd; @@ -1461,13 +1492,40 @@ bfd_generic_stat_arch_elt (abfd, buf) hdr = arch_hdr (abfd); -#define foo(arelt, stelt, size) \ - buf->stelt = strtol (hdr->arelt, &aloser, size); \ - if (aloser == hdr->arelt) return -1; +#define foo(arelt, stelt, size) \ + buf->stelt = strtol (hdr->arelt, &aloser, size); \ + if (aloser == hdr->arelt) \ + return -1; + + /* Some platforms support special notations for large IDs. */ +#ifdef HPUX_LARGE_AR_IDS +# define foo2(arelt, stelt, size) \ + if (hdr->arelt[5] == ' ') \ + { \ + foo (arelt, stelt, size); \ + } \ + else \ + { \ + int cnt; \ + for (buf->stelt = cnt = 0; cnt < 5; ++cnt) \ + { \ + if (hdr->arelt[cnt] < ' ' || hdr->arelt[cnt] > ' ' + 0x3f) \ + return -1; \ + buf->stelt <<= 6; \ + buf->stelt += hdr->arelt[cnt] - ' '; \ + } \ + if (hdr->arelt[5] < '@' || hdr->arelt[5] > '@' + 3) \ + return -1; \ + buf->stelt <<= 2; \ + buf->stelt += hdr->arelt[5] - '@'; \ + } +#else +# define foo2(arelt, stelt, size) foo (arelt, stelt, size) +#endif foo (ar_date, st_mtime, 10); - foo (ar_uid, st_uid, 10); - foo (ar_gid, st_gid, 10); + foo2 (ar_uid, st_uid, 10); + foo2 (ar_gid, st_gid, 10); foo (ar_mode, st_mode, 8); buf->st_size = arch_eltdata (abfd)->parsed_size; @@ -1484,7 +1542,7 @@ bfd_dont_truncate_arname (abfd, pathname, arhdr) /* FIXME: This interacts unpleasantly with ar's quick-append option. Fortunately ic960 users will never use that option. Fixing this is very hard; fortunately I know how to do it and will do so once - intel's release is out the door. */ + intel's release is out the door. */ struct ar_hdr *hdr = (struct ar_hdr *) arhdr; size_t length; @@ -1530,7 +1588,7 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr) { /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ char *bslash = strrchr (pathname, '\\'); - if (bslash > filename) + if (filename == NULL || (bslash != NULL && bslash > filename)) filename = bslash; if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':') filename = pathname + 1; @@ -1564,7 +1622,7 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr) 4> truncate it before the .o, append .o, stuff THAT in. */ /* This is what gnu ar does. It's better but incompatible with the - bsd ar. */ + bsd ar. */ void bfd_gnu_truncate_arname (abfd, pathname, arhdr) @@ -1581,7 +1639,7 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr) { /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ char *bslash = strrchr (pathname, '\\'); - if (bslash > filename) + if (filename == NULL || (bslash != NULL && bslash > filename)) filename = bslash; if (filename == NULL && pathname[0] != '\0' && pathname[1] == ':') filename = pathname + 1; @@ -1612,7 +1670,7 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr) (hdr->ar_name)[length] = ar_padchar (abfd); } -/* The BFD is open for write and has its format set to bfd_archive */ +/* The BFD is open for write and has its format set to bfd_archive. */ boolean _bfd_write_archive_contents (arch) @@ -1623,7 +1681,7 @@ _bfd_write_archive_contents (arch) bfd_size_type elength = 0; const char *ename = NULL; boolean makemap = bfd_has_map (arch); - boolean hasobjects = false; /* if no .o's, don't bother to make a map */ + boolean hasobjects = false; /* If no .o's, don't bother to make a map. */ bfd_size_type wrote; unsigned int i; int tries; @@ -1633,6 +1691,11 @@ _bfd_write_archive_contents (arch) then construct a fresh ar_hdr for them. */ for (current = arch->archive_head; current; current = current->next) { + /* This check is checking the bfds for the objects we're reading + from (which are usually either an object file or archive on + disk), not the archive entries we're writing to. We don't + actually create bfds for the archive members, we just copy + them byte-wise when we write out the archive. */ if (bfd_write_p (current)) { bfd_set_error (bfd_error_invalid_operation); @@ -1645,14 +1708,14 @@ _bfd_write_archive_contents (arch) if (!current->arelt_data) return false; - /* Put in the file name */ + /* Put in the file name. */ BFD_SEND (arch, _bfd_truncate_arname, (arch, current->filename, (char *) arch_hdr (current))); } if (makemap && ! hasobjects) - { /* don't bother if we won't make a map! */ + { /* Don't bother if we won't make a map! */ if ((bfd_check_format (current, bfd_object)) #if 0 /* FIXME -- these are not set correctly */ && ((bfd_get_file_flags (current) & HAS_SYMS)) @@ -1712,7 +1775,7 @@ _bfd_write_archive_contents (arch) unsigned int remaining = arelt_size (current); struct ar_hdr *hdr = arch_hdr (current); - /* write ar header */ + /* Write ar header. */ if (bfd_write ((char *) hdr, 1, sizeof (*hdr), arch) != sizeof (*hdr)) return false; if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) @@ -1762,7 +1825,7 @@ _bfd_write_archive_contents (arch) return true; } -/* Note that the namidx for the first symbol is 0 */ +/* Note that the namidx for the first symbol is 0. */ boolean _bfd_compute_and_write_armap (arch, elength) @@ -1780,7 +1843,7 @@ _bfd_compute_and_write_armap (arch, elength) long syms_max = 0; boolean ret; - /* Dunno if this is the best place for this info... */ + /* Dunno if this is the best place for this info... */ if (elength != 0) elength += sizeof (struct ar_hdr); elength += elength % 2; @@ -1795,13 +1858,12 @@ _bfd_compute_and_write_armap (arch, elength) if (first_name == NULL) goto error_return; - /* Drop all the files called __.SYMDEF, we're going to make our - own */ + /* Drop all the files called __.SYMDEF, we're going to make our own. */ while (arch->archive_head && strcmp (arch->archive_head->filename, "__.SYMDEF") == 0) arch->archive_head = arch->archive_head->next; - /* Map over each element */ + /* Map over each element. */ for (current = arch->archive_head; current != (bfd *) NULL; current = current->next, elt_no++) @@ -1832,7 +1894,8 @@ _bfd_compute_and_write_armap (arch, elength) if (symcount < 0) goto error_return; - /* Now map over all the symbols, picking out the ones we want */ + /* Now map over all the symbols, picking out the ones we + want. */ for (src_count = 0; src_count < symcount; src_count++) { flagword flags = (syms[src_count])->flags; @@ -1847,7 +1910,7 @@ _bfd_compute_and_write_armap (arch, elength) size_t namelen; struct orl *new_map; - /* This symbol will go into the archive header */ + /* This symbol will go into the archive header. */ if (orl_count == orl_max) { orl_max *= 2; @@ -1886,7 +1949,7 @@ _bfd_compute_and_write_armap (arch, elength) } } - /* OK, now we have collected all the data, let's write them out */ + /* OK, now we have collected all the data, let's write them out. */ ret = BFD_SEND (arch, write_armap, (arch, elength, map, orl_count, stridx)); @@ -1921,7 +1984,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) int padit = stridx & 1; unsigned int ranlibsize = orl_count * BSD_SYMDEF_SIZE; unsigned int stringsize = stridx + padit; - /* Include 8 bytes to store ranlibsize and stringsize in output. */ + /* Include 8 bytes to store ranlibsize and stringsize in output. */ unsigned int mapsize = ranlibsize + stringsize + 8; file_ptr firstreal; bfd *current = arch->archive_head; @@ -1978,7 +2041,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) return false; } - /* now write the strings themselves */ + /* Now write the strings themselves. */ bfd_h_put_32 (arch, stringsize, temp); if (bfd_write (temp, 1, sizeof (temp), arch) != sizeof (temp)) return false; @@ -1991,7 +2054,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) } /* The spec sez this should be a newline. But in order to be - bug-compatible for sun's ar we use a null. */ + bug-compatible for sun's ar we use a null. */ if (padit) { if (bfd_write ("", 1, 1, arch) != 1) @@ -2021,10 +2084,13 @@ _bfd_archive_bsd_update_armap_timestamp (arch) if (bfd_stat (arch, &archstat) == -1) { perror (_("Reading archive file mod timestamp")); - return true; /* Can't read mod time for some reason */ + + /* Can't read mod time for some reason. */ + return true; } if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp) - return true; /* OK by the linker's rules */ + /* OK by the linker's rules. */ + return true; /* Update the timestamp. */ bfd_ardata (arch)->armap_timestamp = archstat.st_mtime + ARMAP_TIME_OFFSET; @@ -2045,10 +2111,13 @@ _bfd_archive_bsd_update_armap_timestamp (arch) { /* FIXME: bfd can't call perror. */ perror (_("Writing updated armap timestamp")); - return true; /* Some error while writing */ + + /* Some error while writing. */ + return true; } - return false; /* We updated the timestamp successfully. */ + /* We updated the timestamp successfully. */ + return false; } /* A coff armap looks like : @@ -2074,7 +2143,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) int stridx; { /* The size of the ranlib is the number of exported symbols in the - archive * the number of bytes in a int, + an int for the count */ + archive * the number of bytes in a int, + an int for the count. */ unsigned int ranlibsize = (symbol_count * 4) + 4; unsigned int stringsize = stridx; unsigned int mapsize = stringsize + ranlibsize; @@ -2088,7 +2157,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) if (padit) mapsize++; - /* work out where the first object file will go in the archive */ + /* Work out where the first object file will go in the archive. */ archive_member_file_ptr = (mapsize + elength + sizeof (struct ar_hdr) @@ -2098,7 +2167,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) hdr.ar_name[0] = '/'; sprintf (hdr.ar_size, "%-10d", (int) mapsize); sprintf (hdr.ar_date, "%ld", (long) time (NULL)); - /* This, at least, is what Intel coff sets the values to.: */ + /* This, at least, is what Intel coff sets the values to. */ sprintf ((hdr.ar_uid), "%d", 0); sprintf ((hdr.ar_gid), "%d", 0); sprintf ((hdr.ar_mode), "%-7o", (unsigned) 0); @@ -2108,7 +2177,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; - /* Write the ar header for this item and the number of symbols */ + /* Write the ar header for this item and the number of symbols. */ if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) @@ -2126,23 +2195,23 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) count = 0; while (current != (bfd *) NULL && count < symbol_count) { - /* For each symbol which is used defined in this object, write out - the object file's address in the archive */ + /* For each symbol which is used defined in this object, write + out the object file's address in the archive. */ - while (((bfd *) (map[count]).pos) == current) + while (count < symbol_count && ((bfd *) (map[count]).pos) == current) { bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr); count++; } - /* Add size of this archive entry */ + /* Add size of this archive entry. */ archive_member_file_ptr += (arelt_size (current) + sizeof (struct ar_hdr)); - /* remember aboout the even alignment */ + /* Remember aboout the even alignment. */ archive_member_file_ptr += archive_member_file_ptr % 2; current = current->next; } - /* now write the strings themselves */ + /* Now write the strings themselves. */ for (count = 0; count < symbol_count; count++) { size_t len = strlen (*map[count].name) + 1; @@ -2152,7 +2221,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) } /* The spec sez this should be a newline. But in order to be - bug-compatible for arc960 we use a null. */ + bug-compatible for arc960 we use a null. */ if (padit) { if (bfd_write ("", 1, 1, arch) != 1) diff --git a/contrib/binutils/bfd/archures.c b/contrib/binutils/bfd/archures.c index 7462592..84b7744 100644 --- a/contrib/binutils/bfd/archures.c +++ b/contrib/binutils/bfd/archures.c @@ -31,7 +31,7 @@ SECTION BFD keeps one atom in a BFD describing the architecture of the data attached to the BFD: a pointer to a - <<bfd_arch_info_type>>. + <<bfd_arch_info_type>>. Pointers to structures can be requested independently of a BFD so that an architecture's information can be interrogated @@ -41,13 +41,13 @@ SECTION The set of default architectures is selected by the macro <<SELECT_ARCHITECTURES>>. This is normally set up in the @file{config/@var{target}.mt} file of your choice. If the name is not - defined, then all the architectures supported are included. + defined, then all the architectures supported are included. When BFD starts up, all the architectures are called with an initialize method. It is up to the architecture back end to insert as many items into the list of architectures as it wants to; generally this would be one for each machine and one for the - default case (an item with a machine field of 0). + default case (an item with a machine field of 0). BFD's idea of an architecture is implemented in @file{archures.c}. */ @@ -64,9 +64,9 @@ DESCRIPTION the family is in use. The machine gives a number which distinguishes different versions of the architecture, containing, for example, 2 and 3 for Intel i960 KA and i960 KB, - and 68020 and 68030 for Motorola 68020 and 68030. + and 68020 and 68030 for Motorola 68020 and 68030. -.enum bfd_architecture +.enum bfd_architecture .{ . bfd_arch_unknown, {* File arch not known *} . bfd_arch_obscure, {* Arch known, not one of these *} @@ -79,14 +79,14 @@ DESCRIPTION .#define bfd_mach_m68040 6 .#define bfd_mach_m68060 7 .#define bfd_mach_cpu32 8 -. bfd_arch_vax, {* DEC Vax *} +. bfd_arch_vax, {* DEC Vax *} . bfd_arch_i960, {* Intel 960 *} . {* The order of the following is important. -. lower number indicates a machine type that +. lower number indicates a machine type that . only accepts a subset of the instructions . available to machines with higher numbers. . The exception is the "ca", which is -. incompatible with all other machines except +. incompatible with all other machines except . "core". *} . .#define bfd_mach_i960_core 1 @@ -109,9 +109,12 @@ DESCRIPTION .#define bfd_mach_sparc_sparclite_le 6 .#define bfd_mach_sparc_v9 7 .#define bfd_mach_sparc_v9a 8 {* with ultrasparc add'ns *} +.#define bfd_mach_sparc_v8plusb 9 {* with cheetah add'ns *} +.#define bfd_mach_sparc_v9b 10 {* with cheetah add'ns *} .{* Nonzero if MACH has the v9 instruction set. *} .#define bfd_mach_sparc_v9_p(mach) \ -. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a) +. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ +. && (mach) != bfd_mach_sparc_sparclite_le) . bfd_arch_mips, {* MIPS Rxxxx *} .#define bfd_mach_mips3000 3000 .#define bfd_mach_mips3900 3900 @@ -128,10 +131,17 @@ DESCRIPTION .#define bfd_mach_mips8000 8000 .#define bfd_mach_mips10000 10000 .#define bfd_mach_mips16 16 +.#define bfd_mach_mips32 32 +.#define bfd_mach_mips32_4k 3204113 {* 32, 04, octal 'K' *} +.#define bfd_mach_mips5 5 +.#define bfd_mach_mips64 64 +.#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} . bfd_arch_i386, {* Intel 386 *} .#define bfd_mach_i386_i386 0 .#define bfd_mach_i386_i8086 1 .#define bfd_mach_i386_i386_intel_syntax 2 +.#define bfd_mach_x86_64 3 +.#define bfd_mach_x86_64_intel_syntax 4 . bfd_arch_we32k, {* AT&T WE32xxx *} . bfd_arch_tahoe, {* CCI/Harris Tahoe *} . bfd_arch_i860, {* Intel 860 *} @@ -146,13 +156,36 @@ DESCRIPTION .#define bfd_mach_h8300h 2 .#define bfd_mach_h8300s 3 . bfd_arch_powerpc, {* PowerPC *} +.#define bfd_mach_ppc 0 +.#define bfd_mach_ppc_403 403 +.#define bfd_mach_ppc_403gc 4030 +.#define bfd_mach_ppc_505 505 +.#define bfd_mach_ppc_601 601 +.#define bfd_mach_ppc_602 602 +.#define bfd_mach_ppc_603 603 +.#define bfd_mach_ppc_ec603e 6031 +.#define bfd_mach_ppc_604 604 +.#define bfd_mach_ppc_620 620 +.#define bfd_mach_ppc_630 630 +.#define bfd_mach_ppc_750 750 +.#define bfd_mach_ppc_860 860 +.#define bfd_mach_ppc_a35 35 +.#define bfd_mach_ppc_rs64ii 642 +.#define bfd_mach_ppc_rs64iii 643 +.#define bfd_mach_ppc_7400 7400 . bfd_arch_rs6000, {* IBM RS/6000 *} +.#define bfd_mach_rs6k 0 +.#define bfd_mach_rs6k_rs1 6001 +.#define bfd_mach_rs6k_rsc 6003 +.#define bfd_mach_rs6k_rs2 6002 . bfd_arch_hppa, {* HP PA RISC *} . bfd_arch_d10v, {* Mitsubishi D10V *} .#define bfd_mach_d10v 0 .#define bfd_mach_d10v_ts2 2 .#define bfd_mach_d10v_ts3 3 . bfd_arch_d30v, {* Mitsubishi D30V *} +. bfd_arch_m68hc11, {* Motorola 68HC11 *} +. bfd_arch_m68hc12, {* Motorola 68HC12 *} . bfd_arch_z8k, {* Zilog Z8000 *} .#define bfd_mach_z8001 1 .#define bfd_mach_z8002 2 @@ -178,16 +211,22 @@ DESCRIPTION .#define bfd_mach_arm_4T 6 .#define bfd_mach_arm_5 7 .#define bfd_mach_arm_5T 8 +.#define bfd_mach_arm_5TE 9 +.#define bfd_mach_arm_XScale 10 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} +. bfd_arch_tic54x, {* Texas Instruments TMS320C54X *} . bfd_arch_tic80, {* TI TMS320c80 (MVP) *} . bfd_arch_v850, {* NEC V850 *} .#define bfd_mach_v850 0 .#define bfd_mach_v850e 'E' .#define bfd_mach_v850ea 'A' -. bfd_arch_arc, {* Argonaut RISC Core *} -.#define bfd_mach_arc_base 0 +. bfd_arch_arc, {* ARC Cores *} +.#define bfd_mach_arc_5 0 +.#define bfd_mach_arc_6 1 +.#define bfd_mach_arc_7 2 +.#define bfd_mach_arc_8 3 . bfd_arch_m32r, {* Mitsubishi M32R/D *} .#define bfd_mach_m32r 0 {* backwards compatibility *} .#define bfd_mach_m32rx 'x' @@ -198,20 +237,22 @@ DESCRIPTION . bfd_arch_fr30, .#define bfd_mach_fr30 0x46523330 . bfd_arch_mcore, +. bfd_arch_ia64, {* HP/Intel ia64 *} +.#define bfd_mach_ia64_elf64 0 +.#define bfd_mach_ia64_elf32 1 . bfd_arch_pj, . bfd_arch_avr, {* Atmel AVR microcontrollers *} .#define bfd_mach_avr1 1 .#define bfd_mach_avr2 2 .#define bfd_mach_avr3 3 .#define bfd_mach_avr4 4 +.#define bfd_mach_avr5 5 +. bfd_arch_cris, {* Axis CRIS *} . bfd_arch_last . }; - - */ /* - SUBSECTION bfd_arch_info @@ -220,7 +261,7 @@ DESCRIPTION within BFD. . -.typedef struct bfd_arch_info +.typedef struct bfd_arch_info .{ . int bits_per_word; . int bits_per_address; @@ -230,8 +271,8 @@ DESCRIPTION . const char *arch_name; . const char *printable_name; . unsigned int section_align_power; -. {* true if this is the default machine for the architecture *} -. boolean the_default; +. {* True if this is the default machine for the architecture. *} +. boolean the_default; . const struct bfd_arch_info * (*compatible) . PARAMS ((const struct bfd_arch_info *a, . const struct bfd_arch_info *b)); @@ -246,6 +287,7 @@ extern const bfd_arch_info_type bfd_a29k_arch; extern const bfd_arch_info_type bfd_alpha_arch; extern const bfd_arch_info_type bfd_arc_arch; extern const bfd_arch_info_type bfd_arm_arch; +extern const bfd_arch_info_type bfd_cris_arch; extern const bfd_arch_info_type bfd_d10v_arch; extern const bfd_arch_info_type bfd_d30v_arch; extern const bfd_arch_info_type bfd_h8300_arch; @@ -256,6 +298,8 @@ extern const bfd_arch_info_type bfd_i386_arch; extern const bfd_arch_info_type bfd_i860_arch; extern const bfd_arch_info_type bfd_i960_arch; extern const bfd_arch_info_type bfd_m32r_arch; +extern const bfd_arch_info_type bfd_m68hc11_arch; +extern const bfd_arch_info_type bfd_m68hc12_arch; extern const bfd_arch_info_type bfd_m68k_arch; extern const bfd_arch_info_type bfd_m88k_arch; extern const bfd_arch_info_type bfd_mips_arch; @@ -267,6 +311,7 @@ extern const bfd_arch_info_type bfd_pj_arch; extern const bfd_arch_info_type bfd_sh_arch; extern const bfd_arch_info_type bfd_sparc_arch; extern const bfd_arch_info_type bfd_tic30_arch; +extern const bfd_arch_info_type bfd_tic54x_arch; extern const bfd_arch_info_type bfd_tic80_arch; extern const bfd_arch_info_type bfd_vax_arch; extern const bfd_arch_info_type bfd_we32k_arch; @@ -277,9 +322,9 @@ extern const bfd_arch_info_type bfd_v850_arch; extern const bfd_arch_info_type bfd_fr30_arch; extern const bfd_arch_info_type bfd_mcore_arch; extern const bfd_arch_info_type bfd_avr_arch; +extern const bfd_arch_info_type bfd_ia64_arch; -static const bfd_arch_info_type * const bfd_archures_list[] = -{ +static const bfd_arch_info_type * const bfd_archures_list[] = { #ifdef SELECT_ARCHITECTURES SELECT_ARCHITECTURES, #else @@ -287,6 +332,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_alpha_arch, &bfd_arc_arch, &bfd_arm_arch, + &bfd_cris_arch, &bfd_d10v_arch, &bfd_d30v_arch, &bfd_h8300_arch, @@ -297,6 +343,8 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_i860_arch, &bfd_i960_arch, &bfd_m32r_arch, + &bfd_m68hc11_arch, + &bfd_m68hc12_arch, &bfd_m68k_arch, &bfd_m88k_arch, &bfd_mips_arch, @@ -307,6 +355,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_sh_arch, &bfd_sparc_arch, &bfd_tic30_arch, + &bfd_tic54x_arch, &bfd_tic80_arch, &bfd_vax_arch, &bfd_we32k_arch, @@ -317,6 +366,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_fr30_arch, &bfd_mcore_arch, &bfd_avr_arch, + &bfd_ia64_arch, #endif 0 }; @@ -341,8 +391,6 @@ bfd_printable_name (abfd) return abfd->arch_info->printable_name; } - - /* FUNCTION bfd_scan_arch @@ -354,7 +402,6 @@ DESCRIPTION Figure out if BFD supports any cpu which could be described with the name @var{string}. Return a pointer to an <<arch_info>> structure if a machine is found, otherwise NULL. - */ const bfd_arch_info_type * @@ -363,7 +410,7 @@ bfd_scan_arch (string) { const bfd_arch_info_type * const *app, *ap; - /* Look through all the installed architectures */ + /* Look through all the installed architectures. */ for (app = bfd_archures_list; *app != NULL; app++) { for (ap = *app; ap != NULL; ap = ap->next) @@ -376,8 +423,6 @@ bfd_scan_arch (string) return NULL; } - - /* FUNCTION bfd_arch_list @@ -388,7 +433,6 @@ SYNOPSIS DESCRIPTION Return a freshly malloced NULL-terminated vector of the names of all the valid BFD architectures. Do not modify the names. - */ const char ** @@ -399,7 +443,7 @@ bfd_arch_list () const char **name_list; const bfd_arch_info_type * const *app; - /* Determine the number of architectures */ + /* Determine the number of architectures. */ vec_length = 0; for (app = bfd_archures_list; *app != NULL; app++) { @@ -410,12 +454,12 @@ bfd_arch_list () } } - name_list = (CONST char **) + name_list = (const char **) bfd_malloc ((vec_length + 1) * sizeof (char **)); if (name_list == NULL) return NULL; - /* Point the list at each of the names */ + /* Point the list at each of the names. */ name_ptr = name_list; for (app = bfd_archures_list; *app != NULL; app++) { @@ -431,8 +475,6 @@ bfd_arch_list () return name_list; } - - /* FUNCTION bfd_arch_get_compatible @@ -458,15 +500,14 @@ bfd_arch_get_compatible (abfd, bbfd) /* If either architecture is unknown, then all we can do is assume the user knows what he's doing. */ if (abfd->arch_info->arch == bfd_arch_unknown) - return bbfd->arch_info; + return bbfd->arch_info; if (bbfd->arch_info->arch == bfd_arch_unknown) - return abfd->arch_info; + return abfd->arch_info; /* Otherwise architecture-specific code has to decide. */ return abfd->arch_info->compatible (abfd->arch_info, bbfd->arch_info); } - /* INTERNAL_DEFINITION bfd_default_arch_struct @@ -479,15 +520,13 @@ DESCRIPTION architecture of the file. .extern const bfd_arch_info_type bfd_default_arch_struct; - */ -const bfd_arch_info_type bfd_default_arch_struct = -{ - 32,32,8,bfd_arch_unknown,0,"unknown","unknown",2,true, - bfd_default_compatible, - bfd_default_scan, - 0, +const bfd_arch_info_type bfd_default_arch_struct = { + 32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, true, + bfd_default_compatible, + bfd_default_scan, + 0, }; /* @@ -522,7 +561,7 @@ DESCRIPTION Set the architecture and machine type in BFD @var{abfd} to @var{arch} and @var{mach}. Find the correct pointer to a structure and insert it into the <<arch_info>> - pointer. + pointer. */ boolean @@ -552,7 +591,6 @@ bfd_default_set_arch_mach (abfd, arch, mach) return false; } - /* FUNCTION bfd_get_arch @@ -563,14 +601,13 @@ SYNOPSIS DESCRIPTION Return the enumerated type which describes the BFD @var{abfd}'s architecture. - */ enum bfd_architecture bfd_get_arch (abfd) bfd *abfd; { - return abfd->arch_info->arch; + return abfd->arch_info->arch; } /* @@ -585,11 +622,11 @@ DESCRIPTION machine. */ -unsigned long +unsigned long bfd_get_mach (abfd) bfd *abfd; { - return abfd->arch_info->mach; + return abfd->arch_info->mach; } /* @@ -602,7 +639,6 @@ SYNOPSIS DESCRIPTION Return the number of bits in one of the BFD @var{abfd}'s architecture's bytes. - */ unsigned int @@ -631,9 +667,8 @@ bfd_arch_bits_per_address (abfd) return abfd->arch_info->bits_per_address; } - /* -INTERNAL_FUNCTION +INTERNAL_FUNCTION bfd_default_compatible SYNOPSIS @@ -646,7 +681,7 @@ DESCRIPTION */ const bfd_arch_info_type * -bfd_default_compatible (a,b) +bfd_default_compatible (a, b) const bfd_arch_info_type *a; const bfd_arch_info_type *b; { @@ -662,7 +697,6 @@ bfd_default_compatible (a,b) return a; } - /* INTERNAL_FUNCTION bfd_default_scan @@ -675,7 +709,7 @@ DESCRIPTION architecture hit and a machine hit. */ -boolean +boolean bfd_default_scan (info, string) const struct bfd_arch_info *info; const char *string; @@ -687,17 +721,17 @@ bfd_default_scan (info, string) const char *printable_name_colon; /* Exact match of the architecture name (ARCH_NAME) and also the - default architecture? */ + default architecture? */ if (strcasecmp (string, info->arch_name) == 0 && info->the_default) return true; - /* Exact match of the machine name (PRINTABLE_NAME)? */ + /* Exact match of the machine name (PRINTABLE_NAME)? */ if (strcasecmp (string, info->printable_name) == 0) return true; - + /* Given that printable_name contains no colon, attempt to match: - ARCH_NAME [ ":" ] PRINTABLE_NAME? */ + ARCH_NAME [ ":" ] PRINTABLE_NAME? */ printable_name_colon = strchr (info->printable_name, ':'); if (printable_name_colon == NULL) { @@ -720,7 +754,7 @@ bfd_default_scan (info, string) } /* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>; - Attempt to match: <arch> <mach>? */ + Attempt to match: <arch> <mach>? */ if (printable_name_colon != NULL) { int colon_index = printable_name_colon - info->printable_name; @@ -732,48 +766,61 @@ bfd_default_scan (info, string) /* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>; Do not attempt to match just <mach>, it could be ambigious. This test - is left until later. */ + is left until later. */ - /* NOTE: The below is retained for compatibility only. Please do not - add to this code */ + /* NOTE: The below is retained for compatibility only. Please do + not add to this code. */ /* See how much of the supplied string matches with the architecture, eg the string m68k:68020 would match the 68k entry - up to the :, then we get left with the machine number */ + up to the :, then we get left with the machine number. */ - for (ptr_src = string, ptr_tst = info->arch_name; + for (ptr_src = string, ptr_tst = info->arch_name; *ptr_src && *ptr_tst; - ptr_src++, ptr_tst++) + ptr_src++, ptr_tst++) { - if (*ptr_src != *ptr_tst) break; + if (*ptr_src != *ptr_tst) + break; } /* Chewed up as much of the architecture as will match, skip any - colons */ + colons. */ if (*ptr_src == ':') ptr_src++; - + if (*ptr_src == 0) { - /* nothing more, then only keep this one if it is the default - machine for this architecture */ + /* Nothing more, then only keep this one if it is the default + machine for this architecture. */ return info->the_default; } number = 0; while (isdigit ((unsigned char) *ptr_src)) { - number = number * 10 + *ptr_src - '0'; + number = number * 10 + *ptr_src - '0'; ptr_src++; } /* NOTE: The below is retained for compatibility only. - PLEASE DO NOT ADD TO THIS CODE. */ + PLEASE DO NOT ADD TO THIS CODE. */ - switch (number) + switch (number) { /* FIXME: These are needed to parse IEEE objects. */ - case 68000: + /* The following seven case's are here only for compatibility with + older binutils (at least IEEE objects from binutils 2.9.1 require + them). */ + case bfd_mach_m68000: + case bfd_mach_m68010: + case bfd_mach_m68020: + case bfd_mach_m68030: + case bfd_mach_m68040: + case bfd_mach_m68060: + case bfd_mach_cpu32: + arch = bfd_arch_m68k; + break; + case 68000: arch = bfd_arch_m68k; number = bfd_mach_m68000; break; @@ -840,11 +887,11 @@ bfd_default_scan (info, string) number = bfd_mach_sh4; break; - default: + default: return false; } - if (arch != info->arch) + if (arch != info->arch) return false; if (number != info->mach) @@ -853,7 +900,6 @@ bfd_default_scan (info, string) return true; } - /* FUNCTION bfd_get_arch_info @@ -872,7 +918,6 @@ bfd_get_arch_info (abfd) return abfd->arch_info; } - /* FUNCTION bfd_lookup_arch @@ -890,7 +935,7 @@ DESCRIPTION default. */ -const bfd_arch_info_type * +const bfd_arch_info_type * bfd_lookup_arch (arch, machine) enum bfd_architecture arch; unsigned long machine; @@ -911,7 +956,6 @@ bfd_lookup_arch (arch, machine) return NULL; } - /* FUNCTION bfd_printable_arch_mach @@ -922,7 +966,7 @@ SYNOPSIS DESCRIPTION Return a printable string representing the architecture and - machine type. + machine type. This routine is depreciated. */ @@ -932,11 +976,11 @@ bfd_printable_arch_mach (arch, machine) enum bfd_architecture arch; unsigned long machine; { - const bfd_arch_info_type * ap = bfd_lookup_arch (arch, machine); + const bfd_arch_info_type *ap = bfd_lookup_arch (arch, machine); - if (ap) - return ap->printable_name; - return "UNKNOWN!"; + if (ap) + return ap->printable_name; + return "UNKNOWN!"; } /* @@ -950,15 +994,14 @@ DESCRIPTION Return the number of octets (8-bit quantities) per target byte (minimum addressable unit). In most cases, this will be one, but some DSP targets have 16, 32, or even 48 bits per byte. - */ unsigned int bfd_octets_per_byte (abfd) - bfd * abfd; + bfd *abfd; { - return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd), - bfd_get_mach (abfd)); + return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd), + bfd_get_mach (abfd)); } /* @@ -971,19 +1014,19 @@ SYNOPSIS DESCRIPTION See bfd_octets_per_byte. - + This routine is provided for those cases where a bfd * is not available */ unsigned int bfd_arch_mach_octets_per_byte (arch, mach) - enum bfd_architecture arch; - unsigned long mach; + enum bfd_architecture arch; + unsigned long mach; { - const bfd_arch_info_type * ap = bfd_lookup_arch (arch, mach); - - if (ap) - return ap->bits_per_byte / 8; - return 1; + const bfd_arch_info_type *ap = bfd_lookup_arch (arch, mach); + + if (ap) + return ap->bits_per_byte / 8; + return 1; } diff --git a/contrib/binutils/bfd/armnetbsd.c b/contrib/binutils/bfd/armnetbsd.c index 3e6ee47..05d8ad0 100644 --- a/contrib/binutils/bfd/armnetbsd.c +++ b/contrib/binutils/bfd/armnetbsd.c @@ -15,7 +15,7 @@ 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. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define BYTES_IN_WORD 4 #undef TARGET_IS_BIG_ENDIAN_P diff --git a/contrib/binutils/bfd/bfd-in.h b/contrib/binutils/bfd/bfd-in.h index 09753c2..683aa0f 100644 --- a/contrib/binutils/bfd/bfd-in.h +++ b/contrib/binutils/bfd/bfd-in.h @@ -23,7 +23,7 @@ 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. */ -/* bfd.h -- The only header file required by users of the bfd library +/* bfd.h -- The only header file required by users of the bfd library The bfd.h file is generated from bfd-in.h and various .c files; if you change it, your changes will probably be lost. @@ -84,7 +84,7 @@ typedef struct _bfd bfd; /* General rules: functions which are boolean return true on success and false on failure (unless they're a predicate). -- bfd.doc */ /* I'm sure this is going to break something and someone is going to - force me to change it. */ + force me to change it. */ /* typedef enum boolean {false, true} boolean; */ /* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */ /* It gets worse if the host also defines a true/false enum... -sts */ @@ -93,7 +93,7 @@ typedef struct _bfd bfd; #define TRUE_FALSE_ALREADY_DEFINED #endif #ifdef MPW -/* Pre-emptive strike - get the file with the enum. */ +/* Pre-emptive strike - get the file with the enum. */ #include <Types.h> #define TRUE_FALSE_ALREADY_DEFINED #endif /* MPW */ @@ -109,7 +109,7 @@ typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean; /* FIXME: This should be using off_t from <sys/types.h>. For now, try to avoid breaking stuff by not including <sys/types.h> here. This will break on systems with 64-bit file offsets (e.g. 4.4BSD). - Probably the best long-term answer is to avoid using file_ptr AND off_t + Probably the best long-term answer is to avoid using file_ptr AND off_t in this header file, and to handle this in the BFD implementation rather than in its interface. */ /* typedef off_t file_ptr; */ @@ -177,8 +177,8 @@ typedef unsigned long symvalue; typedef unsigned long bfd_size_type; /* Print a bfd_vma x on stream s. */ -#define fprintf_vma(s,x) fprintf(s, "%08lx", x) -#define sprintf_vma(s,x) sprintf(s, "%08lx", x) +#define fprintf_vma(s,x) fprintf (s, "%08lx", x) +#define sprintf_vma(s,x) sprintf (s, "%08lx", x) #endif /* not BFD64 */ @@ -284,19 +284,17 @@ typedef struct carsym { file_ptr file_offset; /* look here to find the file */ } carsym; /* to make these you call a carsymogen */ - /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ struct orl { /* output ranlib */ - char **name; /* symbol name */ + char **name; /* symbol name */ file_ptr pos; /* bfd* or file position */ int namidx; /* index into string table */ }; - /* Linenumber stuff */ typedef struct lineno_cache_entry { - unsigned int line_number; /* Linenumber from start of function*/ + unsigned int line_number; /* Linenumber from start of function*/ union { struct symbol_cache_entry *sym; /* Function name */ unsigned long offset; /* Offset into section */ @@ -327,15 +325,15 @@ typedef struct sec *sec_ptr; #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true) #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true) -typedef struct stat stat_type; +typedef struct stat stat_type; typedef enum bfd_print_symbol -{ +{ bfd_print_symbol_name, bfd_print_symbol_more, bfd_print_symbol_all } bfd_print_symbol_type; - + /* Information about a symbol that nm needs. */ typedef struct _symbol_info @@ -344,7 +342,7 @@ typedef struct _symbol_info char type; CONST char *name; /* Symbol name. */ unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ + char stab_other; /* Stab other. */ short stab_desc; /* Stab desc. */ CONST char *stab_name; /* String for stab type. */ } symbol_info; @@ -481,7 +479,6 @@ extern long bfd_tell PARAMS ((bfd *abfd)); extern int bfd_flush PARAMS ((bfd *abfd)); extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); - /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ #define bfd_get_filename(abfd) ((char *) (abfd)->filename) @@ -489,6 +486,9 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); #define bfd_get_format(abfd) ((abfd)->format) #define bfd_get_target(abfd) ((abfd)->xvec->name) #define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) +#define bfd_family_coff(abfd) \ + (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ + bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) #define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) #define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) #define bfd_header_big_endian(abfd) \ @@ -511,7 +511,7 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean)(bool)), true) +#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) extern boolean bfd_record_phdr PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, @@ -537,6 +537,11 @@ void bfd_putb32 PARAMS ((bfd_vma, unsigned char *)); void bfd_putl32 PARAMS ((bfd_vma, unsigned char *)); void bfd_putb16 PARAMS ((bfd_vma, unsigned char *)); void bfd_putl16 PARAMS ((bfd_vma, unsigned char *)); + +/* Byte swapping routines which take size and endiannes as arguments. */ + +bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean)); +void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); /* Externally visible ECOFF routines. */ @@ -624,7 +629,10 @@ extern boolean bfd_elf64_size_dynamic_sections const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); +extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); +extern struct bfd_link_needed_list *bfd_elf_get_runpath_list + PARAMS ((bfd *, struct bfd_link_info *)); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error @@ -640,6 +648,16 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); error occurs; bfd_get_error will return an appropriate code. */ extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +/* Return the arch_size field of an elf bfd, or -1 if not elf. */ +extern int bfd_get_arch_size PARAMS ((bfd *)); + +/* Return true if address "naturally" sign extends, or -1 if not elf. */ +extern int bfd_get_sign_extend_vma PARAMS ((bfd *)); + +extern boolean bfd_m68k_elf32_create_embedded_relocs + PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, + char **)); + /* SunOS shared library support routines for the linker. */ extern struct bfd_link_needed_list *bfd_sunos_get_needed_list @@ -718,6 +736,10 @@ extern boolean bfd_coff_get_auxent extern boolean bfd_coff_set_symbol_class PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); +extern boolean bfd_m68k_coff_create_embedded_relocs + PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, + char **)); + /* ARM Interworking support. Called from linker. */ extern boolean bfd_arm_allocate_interworking_sections PARAMS ((struct bfd_link_info *)); @@ -748,4 +770,11 @@ extern boolean bfd_elf32_arm_process_before_allocation extern boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); +/* TI COFF load page support. */ +extern void bfd_ticoff_set_section_load_page + PARAMS ((struct sec *, int)); + +extern int bfd_ticoff_get_section_load_page + PARAMS ((struct sec *)); + /* And more from the source. */ diff --git a/contrib/binutils/bfd/bfd-in2.h b/contrib/binutils/bfd/bfd-in2.h index 4c3eea0..b8e864b 100644 --- a/contrib/binutils/bfd/bfd-in2.h +++ b/contrib/binutils/bfd/bfd-in2.h @@ -23,7 +23,7 @@ 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. */ -/* bfd.h -- The only header file required by users of the bfd library +/* bfd.h -- The only header file required by users of the bfd library The bfd.h file is generated from bfd-in.h and various .c files; if you change it, your changes will probably be lost. @@ -84,7 +84,7 @@ typedef struct _bfd bfd; /* General rules: functions which are boolean return true on success and false on failure (unless they're a predicate). -- bfd.doc */ /* I'm sure this is going to break something and someone is going to - force me to change it. */ + force me to change it. */ /* typedef enum boolean {false, true} boolean; */ /* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */ /* It gets worse if the host also defines a true/false enum... -sts */ @@ -93,7 +93,7 @@ typedef struct _bfd bfd; #define TRUE_FALSE_ALREADY_DEFINED #endif #ifdef MPW -/* Pre-emptive strike - get the file with the enum. */ +/* Pre-emptive strike - get the file with the enum. */ #include <Types.h> #define TRUE_FALSE_ALREADY_DEFINED #endif /* MPW */ @@ -109,7 +109,7 @@ typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean; /* FIXME: This should be using off_t from <sys/types.h>. For now, try to avoid breaking stuff by not including <sys/types.h> here. This will break on systems with 64-bit file offsets (e.g. 4.4BSD). - Probably the best long-term answer is to avoid using file_ptr AND off_t + Probably the best long-term answer is to avoid using file_ptr AND off_t in this header file, and to handle this in the BFD implementation rather than in its interface. */ /* typedef off_t file_ptr; */ @@ -177,8 +177,8 @@ typedef unsigned long symvalue; typedef unsigned long bfd_size_type; /* Print a bfd_vma x on stream s. */ -#define fprintf_vma(s,x) fprintf(s, "%08lx", x) -#define sprintf_vma(s,x) sprintf(s, "%08lx", x) +#define fprintf_vma(s,x) fprintf (s, "%08lx", x) +#define sprintf_vma(s,x) sprintf (s, "%08lx", x) #endif /* not BFD64 */ @@ -284,19 +284,17 @@ typedef struct carsym { file_ptr file_offset; /* look here to find the file */ } carsym; /* to make these you call a carsymogen */ - /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ struct orl { /* output ranlib */ - char **name; /* symbol name */ + char **name; /* symbol name */ file_ptr pos; /* bfd* or file position */ int namidx; /* index into string table */ }; - /* Linenumber stuff */ typedef struct lineno_cache_entry { - unsigned int line_number; /* Linenumber from start of function*/ + unsigned int line_number; /* Linenumber from start of function*/ union { struct symbol_cache_entry *sym; /* Function name */ unsigned long offset; /* Offset into section */ @@ -327,15 +325,15 @@ typedef struct sec *sec_ptr; #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true) #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true) -typedef struct stat stat_type; +typedef struct stat stat_type; typedef enum bfd_print_symbol -{ +{ bfd_print_symbol_name, bfd_print_symbol_more, bfd_print_symbol_all } bfd_print_symbol_type; - + /* Information about a symbol that nm needs. */ typedef struct _symbol_info @@ -344,7 +342,7 @@ typedef struct _symbol_info char type; CONST char *name; /* Symbol name. */ unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ + char stab_other; /* Stab other. */ short stab_desc; /* Stab desc. */ CONST char *stab_name; /* String for stab type. */ } symbol_info; @@ -481,7 +479,6 @@ extern long bfd_tell PARAMS ((bfd *abfd)); extern int bfd_flush PARAMS ((bfd *abfd)); extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); - /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ #define bfd_get_filename(abfd) ((char *) (abfd)->filename) @@ -489,6 +486,9 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); #define bfd_get_format(abfd) ((abfd)->format) #define bfd_get_target(abfd) ((abfd)->xvec->name) #define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) +#define bfd_family_coff(abfd) \ + (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ + bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) #define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) #define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) #define bfd_header_big_endian(abfd) \ @@ -511,7 +511,7 @@ extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean)(bool)), true) +#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) extern boolean bfd_record_phdr PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, @@ -537,6 +537,11 @@ void bfd_putb32 PARAMS ((bfd_vma, unsigned char *)); void bfd_putl32 PARAMS ((bfd_vma, unsigned char *)); void bfd_putb16 PARAMS ((bfd_vma, unsigned char *)); void bfd_putl16 PARAMS ((bfd_vma, unsigned char *)); + +/* Byte swapping routines which take size and endiannes as arguments. */ + +bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean)); +void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); /* Externally visible ECOFF routines. */ @@ -624,7 +629,10 @@ extern boolean bfd_elf64_size_dynamic_sections const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); +extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); +extern struct bfd_link_needed_list *bfd_elf_get_runpath_list + PARAMS ((bfd *, struct bfd_link_info *)); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error @@ -640,6 +648,16 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); error occurs; bfd_get_error will return an appropriate code. */ extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +/* Return the arch_size field of an elf bfd, or -1 if not elf. */ +extern int bfd_get_arch_size PARAMS ((bfd *)); + +/* Return true if address "naturally" sign extends, or -1 if not elf. */ +extern int bfd_get_sign_extend_vma PARAMS ((bfd *)); + +extern boolean bfd_m68k_elf32_create_embedded_relocs + PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, + char **)); + /* SunOS shared library support routines for the linker. */ extern struct bfd_link_needed_list *bfd_sunos_get_needed_list @@ -718,6 +736,10 @@ extern boolean bfd_coff_get_auxent extern boolean bfd_coff_set_symbol_class PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); +extern boolean bfd_m68k_coff_create_embedded_relocs + PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, + char **)); + /* ARM Interworking support. Called from linker. */ extern boolean bfd_arm_allocate_interworking_sections PARAMS ((struct bfd_link_info *)); @@ -748,8 +770,15 @@ extern boolean bfd_elf32_arm_process_before_allocation extern boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); +/* TI COFF load page support. */ +extern void bfd_ticoff_set_section_load_page + PARAMS ((struct sec *, int)); + +extern int bfd_ticoff_get_section_load_page + PARAMS ((struct sec *)); + /* And more from the source. */ -void +void bfd_init PARAMS ((void)); bfd * @@ -764,32 +793,32 @@ bfd_openstreamr PARAMS ((const char *, const char *, PTR)); bfd * bfd_openw PARAMS ((CONST char *filename, CONST char *target)); -boolean +boolean bfd_close PARAMS ((bfd *abfd)); -boolean +boolean bfd_close_all_done PARAMS ((bfd *)); bfd * bfd_create PARAMS ((CONST char *filename, bfd *templ)); -boolean +boolean bfd_make_writable PARAMS ((bfd *abfd)); -boolean +boolean bfd_make_readable PARAMS ((bfd *abfd)); - /* Byte swapping macros for user section data. */ +/* Byte swapping macros for user section data. */ #define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val))) + ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val))) #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *)(ptr)) + (*(unsigned char *) (ptr)) #define bfd_get_signed_8(abfd, ptr) \ - ((*(unsigned char *)(ptr) ^ 0x80) - 0x80) + ((*(unsigned char *) (ptr) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) @@ -833,7 +862,7 @@ bfd_make_readable PARAMS ((bfd *abfd)); : (abort (), (void) 0)) - /* Byte swapping macros for file header data. */ +/* Byte swapping macros for file header data. */ #define bfd_h_put_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr) @@ -871,355 +900,377 @@ bfd_make_readable PARAMS ((bfd *abfd)); #define bfd_h_get_signed_64(abfd, ptr) \ BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr)) - /* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ +/* This structure is used for a comdat section, as in PE. A comdat + section is associated with a particular symbol. When the linker + sees a comdat section, it keeps only one of the sections with a + given name and associated with a given symbol. */ struct bfd_comdat_info { - /* The name of the symbol associated with a comdat section. */ + /* The name of the symbol associated with a comdat section. */ const char *name; - /* The local symbol table index of the symbol associated with a + /* The local symbol table index of the symbol associated with a comdat section. This is only meaningful to the object file format specific code; it is not an index into the list returned by bfd_canonicalize_symtab. */ long symbol; - - /* If this section is being discarded, the linker uses this field - to point to the input section which is being kept. */ - struct sec *sec; }; typedef struct sec { - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ + /* The name of the section; the name isn't a copy, the pointer is + the same as that passed to bfd_make_section. */ - CONST char *name; + const char *name; - /* Which section is it; 0..nth. */ + /* A unique sequence number. */ - int index; + int id; - /* The next section in the list belonging to the BFD, or NULL. */ + /* Which section is it; 0..nth. */ - struct sec *next; + int index; - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ + /* The next section in the list belonging to the BFD, or NULL. */ - flagword flags; + struct sec *next; + + /* The field flags contains attributes of the section. Some + flags are read in from the object file, and some are + synthesized from other information. */ + + flagword flags; #define SEC_NO_FLAGS 0x000 - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information - only. */ + /* Tells the OS to allocate space for this section when loading. + This is clear for a section containing debug information only. */ #define SEC_ALLOC 0x001 - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ + /* Tells the OS to load the section from the file when loading. + This is clear for a .bss section. */ #define SEC_LOAD 0x002 - /* The section contains data still to be relocated, so there is - some relocation information too. */ + /* The section contains data still to be relocated, so there is + some relocation information too. */ #define SEC_RELOC 0x004 -#if 0 /* Obsolete ? */ +#if 0 /* Obsolete ? */ #define SEC_BALIGN 0x008 #endif - /* A signal to the OS that the section contains read only - data. */ + /* A signal to the OS that the section contains read only data. */ #define SEC_READONLY 0x010 - /* The section contains code only. */ + /* The section contains code only. */ #define SEC_CODE 0x020 - /* The section contains data only. */ + /* The section contains data only. */ #define SEC_DATA 0x040 - /* The section will reside in ROM. */ + /* The section will reside in ROM. */ #define SEC_ROM 0x080 - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by <<g++>>. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., <<__CTOR_LIST__>>), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called <<__CTOR_LIST__>> and relocate the data - contained within - exactly the operations it would peform on - standard data. */ + /* The section contains constructor information. This section + type is used by the linker to create lists of constructors and + destructors used by <<g++>>. When a back end sees a symbol + which should be used in a constructor list, it creates a new + section for the type of name (e.g., <<__CTOR_LIST__>>), attaches + the symbol to it, and builds a relocation. To build the lists + of constructors, all the linker has to do is catenate all the + sections called <<__CTOR_LIST__>> and relocate the data + contained within - exactly the operations it would peform on + standard data. */ #define SEC_CONSTRUCTOR 0x100 - /* The section is a constructor, and should be placed at the - end of the text, data, or bss section(?). */ + /* The section is a constructor, and should be placed at the + end of the text, data, or bss section(?). */ #define SEC_CONSTRUCTOR_TEXT 0x1100 #define SEC_CONSTRUCTOR_DATA 0x2100 #define SEC_CONSTRUCTOR_BSS 0x3100 - /* The section has contents - a data section could be - <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be - <<SEC_HAS_CONTENTS>> */ + /* The section has contents - a data section could be + <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be + <<SEC_HAS_CONTENTS>> */ #define SEC_HAS_CONTENTS 0x200 - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ + /* An instruction to the linker to not output the section + even if it has information which would normally be written. */ #define SEC_NEVER_LOAD 0x400 - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ + /* The section is a COFF shared library section. This flag is + only for the linker. If this type of section appears in + the input file, the linker must copy it to the output file + without changing the vma or size. FIXME: Although this + was originally intended to be general, it really is COFF + specific (and the flag was renamed to indicate this). It + might be cleaner to have some more general mechanism to + allow the back end to control what the linker does with + sections. */ #define SEC_COFF_SHARED_LIBRARY 0x800 - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ + /* The section has GOT references. This flag is only for the + linker, and is currently only used by the elf32-hppa back end. + It will be set if global offset table references were detected + in this section, which indicate to the linker that the section + contains PIC code, and must be handled specially when doing a + static link. */ +#define SEC_HAS_GOT_REF 0x4000 + + /* The section contains common symbols (symbols may be defined + multiple times, the value of a symbol is the amount of + space it requires, and the largest symbol value is the one + used). Most targets have exactly one of these (which we + translate to bfd_com_section_ptr), but ECOFF has two. */ #define SEC_IS_COMMON 0x8000 - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ + /* The section contains only debugging information. For + example, this is set for ELF .debug and .stab sections. + strip tests this flag to see if a section can be + discarded. */ #define SEC_DEBUGGING 0x10000 - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by - bfd_get_section_contents, and the data is retrieved from - memory if appropriate. */ + /* The contents of this section are held in memory pointed to + by the contents field. This is checked by bfd_get_section_contents, + and the data is retrieved from memory if appropriate. */ #define SEC_IN_MEMORY 0x20000 - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ + /* The contents of this section are to be excluded by the + linker for executable and shared objects unless those + objects are to be further relocated. */ #define SEC_EXCLUDE 0x40000 - /* The contents of this section are to be sorted by the - based on the address specified in the associated symbol - table. */ + /* The contents of this section are to be sorted by the + based on the address specified in the associated symbol + table. */ #define SEC_SORT_ENTRIES 0x80000 - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ + /* When linking, duplicate sections of the same name should be + discarded, rather than being combined into a single section as + is usually done. This is similar to how common symbols are + handled. See SEC_LINK_DUPLICATES below. */ #define SEC_LINK_ONCE 0x100000 - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker + should handle duplicate sections. */ #define SEC_LINK_DUPLICATES 0x600000 - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ + /* This value for SEC_LINK_DUPLICATES means that duplicate + sections with the same name should simply be discarded. */ #define SEC_LINK_DUPLICATES_DISCARD 0x0 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if there are any duplicate sections, although + it should still only link one copy. */ #define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections are a different size. */ #define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections contain different + contents. */ #define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ + /* This section was created by the linker as part of dynamic + relocation or other arcane processing. It is skipped when + going through the first-pass output, trusting that someone + else up the line will take care of it later. */ #define SEC_LINKER_CREATED 0x800000 - /* This section should not be subject to garbage collection. */ + /* This section should not be subject to garbage collection. */ #define SEC_KEEP 0x1000000 - /* This section contains "short" data, and should be placed - "near" the GP. */ + /* This section contains "short" data, and should be placed + "near" the GP. */ #define SEC_SMALL_DATA 0x2000000 - /* This section contains data which may be shared with other - executables or shared objects. */ + /* This section contains data which may be shared with other + executables or shared objects. */ #define SEC_SHARED 0x4000000 - /* End of section flags. */ + /* When a section with this flag is being linked, then if the size of + the input section is less than a page, it should not cross a page + boundary. If the size of the input section is one page or more, it + should be aligned on a page boundary. */ +#define SEC_BLOCK 0x8000000 + + /* Conditionally link this section; do not link if there are no + references found to any symbol in the section. */ +#define SEC_CLINK 0x10000000 - /* Some internal packed boolean fields. */ + /* End of section flags. */ - /* See the vma field. */ - unsigned int user_set_vma : 1; + /* Some internal packed boolean fields. */ - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; + /* See the vma field. */ + unsigned int user_set_vma : 1; - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; + /* Whether relocations have been processed. */ + unsigned int reloc_done : 1; - /* A mark flag used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; + /* A mark flag used by some of the linker backends. */ + unsigned int linker_mark : 1; - /* End of internal packed boolean fields. */ + /* A mark flag used by some linker backends for garbage collection. */ + unsigned int gc_mark : 1; - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in <<a.out>>, where - the default address for <<.data>> is dependent on the specific - target and various flags). */ + /* Used by the ELF code to mark sections which have been allocated to segments. */ + unsigned int segment_mark : 1; - bfd_vma vma; + /* End of internal packed boolean fields. */ - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ + /* The virtual memory address of the section - where it will be + at run time. The symbols are relocated against this. The + user_set_vma flag is maintained by bfd; if it's not set, the + backend can assign addresses (for example, in <<a.out>>, where + the default address for <<.data>> is dependent on the specific + target and various flags). */ - bfd_vma lma; + bfd_vma vma; - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of <<.bss>>). This will be filled in after relocation. */ + /* The load address of the section - where it would be in a + rom image; really only used for writing section header + information. */ - bfd_size_type _cooked_size; + bfd_vma lma; - /* The original size on disk of the section, in octets. Normally this - value is the same as the size, but if some relaxing has - been done, then this value will be bigger. */ + /* The size of the section in octets, as it will be output. + Contains a value even if the section has no contents (e.g., the + size of <<.bss>>). This will be filled in after relocation. */ - bfd_size_type _raw_size; + bfd_size_type _cooked_size; - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ + /* The original size on disk of the section, in octets. Normally this + value is the same as the size, but if some relaxing has + been done, then this value will be bigger. */ - bfd_vma output_offset; + bfd_size_type _raw_size; - /* The output section through which to map on output. */ + /* If this section is going to be output, then this value is the + offset in *bytes* into the output section of the first byte in the + input section (byte ==> smallest addressable unit on the + target). In most cases, if this was going to start at the + 100th octet (8-bit quantity) in the output section, this value + would be 100. However, if the target byte size is 16 bits + (bfd_octets_per_byte is "2"), this value would be 50. */ - struct sec *output_section; + bfd_vma output_offset; - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ + /* The output section through which to map on output. */ - unsigned int alignment_power; + struct sec *output_section; - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ + /* The alignment requirement of the section, as an exponent of 2 - + e.g., 3 aligns to 2^3 (or 8). */ - struct reloc_cache_entry *relocation; + unsigned int alignment_power; - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ + /* If an input section, a pointer to a vector of relocation + records for the data in this section. */ - struct reloc_cache_entry **orelocation; + struct reloc_cache_entry *relocation; - /* The number of relocation records in one of the above */ + /* If an output section, a pointer to a vector of pointers to + relocation records for the data in this section. */ - unsigned reloc_count; + struct reloc_cache_entry **orelocation; - /* Information below is back end specific - and not always used - or updated. */ + /* The number of relocation records in one of the above */ - /* File position of section data */ + unsigned reloc_count; - file_ptr filepos; + /* Information below is back end specific - and not always used + or updated. */ - /* File position of relocation info */ + /* File position of section data. */ - file_ptr rel_filepos; + file_ptr filepos; - /* File position of line data */ + /* File position of relocation info. */ - file_ptr line_filepos; + file_ptr rel_filepos; - /* Pointer to data for applications */ + /* File position of line data. */ - PTR userdata; + file_ptr line_filepos; - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; + /* Pointer to data for applications. */ - /* Attached line number information */ + PTR userdata; - alent *lineno; + /* If the SEC_IN_MEMORY flag is set, this points to the actual + contents. */ + unsigned char *contents; - /* Number of line number records */ + /* Attached line number information. */ - unsigned int lineno_count; + alent *lineno; - /* Optional information about a COMDAT entry; NULL if not COMDAT */ + /* Number of line number records. */ - struct bfd_comdat_info *comdat; + unsigned int lineno_count; - /* When a section is being output, this value changes as more - linenumbers are written out */ + /* Optional information about a COMDAT entry; NULL if not COMDAT. */ - file_ptr moving_line_filepos; + struct bfd_comdat_info *comdat; - /* What the section number is in the target world */ + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct sec *kept_section; - int target_index; + /* When a section is being output, this value changes as more + linenumbers are written out. */ - PTR used_by_bfd; + file_ptr moving_line_filepos; - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ + /* What the section number is in the target world. */ - struct relent_chain *constructor_chain; + int target_index; - /* The BFD which owns the section. */ + PTR used_by_bfd; - bfd *owner; + /* If this is a constructor section then here is a list of the + relocations created to relocate items within it. */ - /* A symbol which points at this section only */ - struct symbol_cache_entry *symbol; - struct symbol_cache_entry **symbol_ptr_ptr; + struct relent_chain *constructor_chain; - struct bfd_link_order *link_order_head; - struct bfd_link_order *link_order_tail; + /* The BFD which owns the section. */ + + bfd *owner; + + /* A symbol which points at this section only */ + struct symbol_cache_entry *symbol; + struct symbol_cache_entry **symbol_ptr_ptr; + + struct bfd_link_order *link_order_head; + struct bfd_link_order *link_order_tail; } asection ; - /* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ +/* These sections are global, and are managed by BFD. The application + and target back end are not permitted to change the values in + these sections. New code should use the section_ptr macros rather + than referring directly to the const sections. The const sections + may eventually vanish. */ #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" #define BFD_COM_SECTION_NAME "*COM*" #define BFD_IND_SECTION_NAME "*IND*" - /* the absolute section */ +/* the absolute section */ extern const asection bfd_abs_section; #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) - /* Pointer to the undefined section */ +/* Pointer to the undefined section */ extern const asection bfd_und_section; #define bfd_und_section_ptr ((asection *) &bfd_und_section) #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) - /* Pointer to the common section */ +/* Pointer to the common section */ extern const asection bfd_com_section; #define bfd_com_section_ptr ((asection *) &bfd_com_section) - /* Pointer to the indirect section */ +/* Pointer to the indirect section */ extern const asection bfd_ind_section; #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) @@ -1235,58 +1286,60 @@ extern const struct symbol_cache_entry * const bfd_ind_symbol; ((section)->reloc_done ? (section)->_cooked_size \ : (abort (), (bfd_size_type) 1)) asection * -bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name)); +bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name)); + +char * +bfd_get_unique_section_name PARAMS ((bfd *abfd, + const char *templat, + int *count)); asection * -bfd_make_section_old_way PARAMS ((bfd *abfd, CONST char *name)); +bfd_make_section_old_way PARAMS ((bfd *abfd, const char *name)); asection * -bfd_make_section_anyway PARAMS ((bfd *abfd, CONST char *name)); +bfd_make_section_anyway PARAMS ((bfd *abfd, const char *name)); asection * -bfd_make_section PARAMS ((bfd *, CONST char *name)); +bfd_make_section PARAMS ((bfd *, const char *name)); -boolean +boolean bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags)); -void +void bfd_map_over_sections PARAMS ((bfd *abfd, - void (*func)(bfd *abfd, + void (*func) (bfd *abfd, asection *sect, PTR obj), PTR obj)); -boolean +boolean bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val)); -boolean -bfd_set_section_contents - PARAMS ((bfd *abfd, +boolean +bfd_set_section_contents PARAMS ((bfd *abfd, asection *section, PTR data, file_ptr offset, bfd_size_type count)); -boolean -bfd_get_section_contents - PARAMS ((bfd *abfd, asection *section, PTR location, +boolean +bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, PTR location, file_ptr offset, bfd_size_type count)); -boolean +boolean bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec)); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ BFD_SEND (obfd, _bfd_copy_private_section_data, \ (ibfd, isection, obfd, osection)) -void -_bfd_strip_section_from_output - PARAMS ((struct bfd_link_info *info, asection *section)); +void +_bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section)); -enum bfd_architecture +enum bfd_architecture { - bfd_arch_unknown, /* File arch not known */ - bfd_arch_obscure, /* Arch known, not one of these */ - bfd_arch_m68k, /* Motorola 68xxx */ + bfd_arch_unknown, /* File arch not known */ + bfd_arch_obscure, /* Arch known, not one of these */ + bfd_arch_m68k, /* Motorola 68xxx */ #define bfd_mach_m68000 1 #define bfd_mach_m68008 2 #define bfd_mach_m68010 3 @@ -1295,14 +1348,14 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that + bfd_arch_vax, /* DEC Vax */ + bfd_arch_i960, /* Intel 960 */ + /* The order of the following is important. + lower number indicates a machine type that only accepts a subset of the instructions available to machines with higher numbers. The exception is the "ca", which is - incompatible with all other machines except + incompatible with all other machines except "core". */ #define bfd_mach_i960_core 1 @@ -1314,21 +1367,24 @@ enum bfd_architecture #define bfd_mach_i960_jx 7 #define bfd_mach_i960_hx 8 - bfd_arch_a29k, /* AMD 29000 */ - bfd_arch_sparc, /* SPARC */ + bfd_arch_a29k, /* AMD 29000 */ + bfd_arch_sparc, /* SPARC */ #define bfd_mach_sparc 1 - /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ +/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 #define bfd_mach_sparc_sparclite 3 #define bfd_mach_sparc_v8plus 4 -#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ +#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ #define bfd_mach_sparc_sparclite_le 6 #define bfd_mach_sparc_v9 7 -#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ - /* Nonzero if MACH has the v9 instruction set. */ +#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ +#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */ +#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */ +/* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a) - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + && (mach) != bfd_mach_sparc_sparclite_le) + bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1344,36 +1400,66 @@ enum bfd_architecture #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 #define bfd_mach_mips16 16 - bfd_arch_i386, /* Intel 386 */ +#define bfd_mach_mips32 32 +#define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */ +#define bfd_mach_mips5 5 +#define bfd_mach_mips64 64 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ + bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_i386 0 #define bfd_mach_i386_i8086 1 #define bfd_mach_i386_i386_intel_syntax 2 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_alliant, /* Alliant */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Hitachi H8/300 */ +#define bfd_mach_x86_64 3 +#define bfd_mach_x86_64_intel_syntax 4 + bfd_arch_we32k, /* AT&T WE32xxx */ + bfd_arch_tahoe, /* CCI/Harris Tahoe */ + bfd_arch_i860, /* Intel 860 */ + bfd_arch_i370, /* IBM 360/370 Mainframes */ + bfd_arch_romp, /* IBM ROMP PC/RT */ + bfd_arch_alliant, /* Alliant */ + bfd_arch_convex, /* Convex */ + bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_pyramid, /* Pyramid Technology */ + bfd_arch_h8300, /* Hitachi H8/300 */ #define bfd_mach_h8300 1 #define bfd_mach_h8300h 2 #define bfd_mach_h8300s 3 - bfd_arch_powerpc, /* PowerPC */ - bfd_arch_rs6000, /* IBM RS/6000 */ - bfd_arch_hppa, /* HP PA RISC */ - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_powerpc, /* PowerPC */ +#define bfd_mach_ppc 0 +#define bfd_mach_ppc_403 403 +#define bfd_mach_ppc_403gc 4030 +#define bfd_mach_ppc_505 505 +#define bfd_mach_ppc_601 601 +#define bfd_mach_ppc_602 602 +#define bfd_mach_ppc_603 603 +#define bfd_mach_ppc_ec603e 6031 +#define bfd_mach_ppc_604 604 +#define bfd_mach_ppc_620 620 +#define bfd_mach_ppc_630 630 +#define bfd_mach_ppc_750 750 +#define bfd_mach_ppc_860 860 +#define bfd_mach_ppc_a35 35 +#define bfd_mach_ppc_rs64ii 642 +#define bfd_mach_ppc_rs64iii 643 +#define bfd_mach_ppc_7400 7400 + bfd_arch_rs6000, /* IBM RS/6000 */ +#define bfd_mach_rs6k 0 +#define bfd_mach_rs6k_rs1 6001 +#define bfd_mach_rs6k_rsc 6003 +#define bfd_mach_rs6k_rs2 6002 + bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_d10v, /* Mitsubishi D10V */ #define bfd_mach_d10v 0 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_d30v, /* Mitsubishi D30V */ + bfd_arch_m68hc11, /* Motorola 68HC11 */ + bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_z8k, /* Zilog Z8000 */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Hitachi H8/500 */ - bfd_arch_sh, /* Hitachi SH */ + bfd_arch_h8500, /* Hitachi H8/500 */ + bfd_arch_sh, /* Hitachi SH */ #define bfd_mach_sh 0 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d @@ -1381,11 +1467,11 @@ enum bfd_architecture #define bfd_mach_sh3_dsp 0x3d #define bfd_mach_sh3e 0x3e #define bfd_mach_sh4 0x40 - bfd_arch_alpha, /* Dec Alpha */ + bfd_arch_alpha, /* Dec Alpha */ #define bfd_mach_alpha_ev4 0x10 #define bfd_mach_alpha_ev5 0x20 #define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM */ + bfd_arch_arm, /* Advanced Risc Machines ARM */ #define bfd_mach_arm_2 1 #define bfd_mach_arm_2a 2 #define bfd_mach_arm_3 3 @@ -1394,36 +1480,47 @@ enum bfd_architecture #define bfd_mach_arm_4T 6 #define bfd_mach_arm_5 7 #define bfd_mach_arm_5T 8 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ +#define bfd_mach_arm_5TE 9 +#define bfd_mach_arm_XScale 10 + bfd_arch_ns32k, /* National Semiconductors ns32000 */ + bfd_arch_w65, /* WDC 65816 */ + bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ + bfd_arch_tic80, /* TI TMS320c80 (MVP) */ + bfd_arch_v850, /* NEC V850 */ #define bfd_mach_v850 0 #define bfd_mach_v850e 'E' #define bfd_mach_v850ea 'A' - bfd_arch_arc, /* Argonaut RISC Core */ -#define bfd_mach_arc_base 0 - bfd_arch_m32r, /* Mitsubishi M32R/D */ -#define bfd_mach_m32r 0 /* backwards compatibility */ + bfd_arch_arc, /* ARC Cores */ +#define bfd_mach_arc_5 0 +#define bfd_mach_arc_6 1 +#define bfd_mach_arc_7 2 +#define bfd_mach_arc_8 3 + bfd_arch_m32r, /* Mitsubishi M32R/D */ +#define bfd_mach_m32r 0 /* backwards compatibility */ #define bfd_mach_m32rx 'x' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ + bfd_arch_mn10200, /* Matsushita MN10200 */ + bfd_arch_mn10300, /* Matsushita MN10300 */ #define bfd_mach_mn10300 300 #define bfd_mach_am33 330 bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 bfd_arch_mcore, + bfd_arch_ia64, /* HP/Intel ia64 */ +#define bfd_mach_ia64_elf64 0 +#define bfd_mach_ia64_elf32 1 bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers */ + bfd_arch_avr, /* Atmel AVR microcontrollers */ #define bfd_mach_avr1 1 #define bfd_mach_avr2 2 #define bfd_mach_avr3 3 #define bfd_mach_avr4 4 +#define bfd_mach_avr5 5 + bfd_arch_cris, /* Axis CRIS */ bfd_arch_last }; -typedef struct bfd_arch_info +typedef struct bfd_arch_info { int bits_per_word; int bits_per_address; @@ -1433,8 +1530,8 @@ typedef struct bfd_arch_info const char *arch_name; const char *printable_name; unsigned int section_align_power; - /* true if this is the default machine for the architecture */ - boolean the_default; + /* True if this is the default machine for the architecture. */ + boolean the_default; const struct bfd_arch_info * (*compatible) PARAMS ((const struct bfd_arch_info *a, const struct bfd_arch_info *b)); @@ -1457,65 +1554,63 @@ bfd_arch_get_compatible PARAMS (( const bfd *abfd, const bfd *bbfd)); -void +void bfd_set_arch_info PARAMS ((bfd *abfd, const bfd_arch_info_type *arg)); -enum bfd_architecture +enum bfd_architecture bfd_get_arch PARAMS ((bfd *abfd)); -unsigned long +unsigned long bfd_get_mach PARAMS ((bfd *abfd)); -unsigned int +unsigned int bfd_arch_bits_per_byte PARAMS ((bfd *abfd)); -unsigned int +unsigned int bfd_arch_bits_per_address PARAMS ((bfd *abfd)); -const bfd_arch_info_type * +const bfd_arch_info_type * bfd_get_arch_info PARAMS ((bfd *abfd)); const bfd_arch_info_type * -bfd_lookup_arch - PARAMS ((enum bfd_architecture +bfd_lookup_arch PARAMS ((enum bfd_architecture arch, unsigned long machine)); const char * -bfd_printable_arch_mach - PARAMS ((enum bfd_architecture arch, unsigned long machine)); +bfd_printable_arch_mach PARAMS ((enum bfd_architecture arch, unsigned long machine)); -unsigned int +unsigned int bfd_octets_per_byte PARAMS ((bfd *abfd)); -unsigned int +unsigned int bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch, unsigned long machine)); typedef enum bfd_reloc_status { - /* No errors detected */ + /* No errors detected */ bfd_reloc_ok, - /* The relocation was performed, but there was an overflow. */ + /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, - /* The address to relocate was not within the section supplied. */ + /* The address to relocate was not within the section supplied. */ bfd_reloc_outofrange, - /* Used by special functions */ + /* Used by special functions */ bfd_reloc_continue, - /* Unsupported relocation size requested. */ + /* Unsupported relocation size requested. */ bfd_reloc_notsupported, - /* Unused */ + /* Unused */ bfd_reloc_other, - /* The symbol to relocate against was undefined. */ + /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently + /* The relocation was performed, but may not be ok - presently generated only when linking i960 coff files with i960 b.out symbols. If this type is returned, the error_message argument to bfd_perform_relocation will be set. */ @@ -1526,40 +1621,40 @@ typedef enum bfd_reloc_status typedef struct reloc_cache_entry { - /* A pointer into the canonical table of pointers */ + /* A pointer into the canonical table of pointers */ struct symbol_cache_entry **sym_ptr_ptr; - /* offset in section */ + /* offset in section */ bfd_size_type address; - /* addend for relocation value */ + /* addend for relocation value */ bfd_vma addend; - /* Pointer to how to perform the required relocation */ + /* Pointer to how to perform the required relocation */ reloc_howto_type *howto; } arelent; enum complain_overflow { - /* Do not complain on overflow. */ + /* Do not complain on overflow. */ complain_overflow_dont, - /* Complain if the bitfield overflows, whether it is considered + /* Complain if the bitfield overflows, whether it is considered as signed or unsigned. */ complain_overflow_bitfield, - /* Complain if the value overflows when considered as signed + /* Complain if the value overflows when considered as signed number. */ complain_overflow_signed, - /* Complain if the value overflows when considered as an + /* Complain if the value overflows when considered as an unsigned number. */ complain_overflow_unsigned }; struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can + /* The type field has mainly a documentary use - the back end can do what it wants with it, though normally the back end's external idea of what a reloc number is stored in this field. For example, a PC relative word relocation @@ -1567,34 +1662,34 @@ struct reloc_howto_struct what the outside world calls a R_PCRWORD reloc. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops + /* The value the final relocation is shifted right by. This drops unwanted data from the relocation. */ unsigned int rightshift; - /* The size of the item to be relocated. This is *not* a + /* The size of the item to be relocated. This is *not* a power-of-two measure. To get the number of bytes operated on by a type of relocation, use bfd_get_reloc_size. */ int size; - /* The number of bits in the item to be relocated. This is used + /* The number of bits in the item to be relocated. This is used when doing overflow checking. */ unsigned int bitsize; - /* Notes that the relocation is relative to the location in the + /* Notes that the relocation is relative to the location in the data section of the addend. The relocation function will subtract from the relocation value the address of the location being relocated. */ boolean pc_relative; - /* The bit position of the reloc value in the destination. + /* The bit position of the reloc value in the destination. The relocated value is left shifted by this amount. */ unsigned int bitpos; - /* What type of overflow error should be checked for when + /* What type of overflow error should be checked for when relocating. */ enum complain_overflow complain_on_overflow; - /* If this field is non null, then the supplied function is + /* If this field is non null, then the supplied function is called rather than the normal function. This allows really strange relocation methods to be accomodated (e.g., i960 callj instructions). */ @@ -1607,10 +1702,10 @@ struct reloc_howto_struct bfd *output_bfd, char **error_message)); - /* The textual name of the relocation type. */ + /* The textual name of the relocation type. */ char *name; - /* Some formats record a relocation addend in the section contents + /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the distinction between USE_REL and USE_RELA (though the code checks for USE_REL == 1/0). The value of this field is TRUE if the @@ -1627,7 +1722,7 @@ struct reloc_howto_struct links (e.g. GOT stuff) it doesn't matter what this is set to. */ boolean partial_inplace; - /* The src_mask selects which parts of the read in data + /* The src_mask selects which parts of the read in data are to be used in the relocation sum. E.g., if this was an 8 bit byte of data which we read and relocated, this would be 0x000000ff. When we have relocs which have an addend, such as @@ -1636,13 +1731,13 @@ struct reloc_howto_struct the mask would be 0x00000000. */ bfd_vma src_mask; - /* The dst_mask selects which parts of the instruction are replaced + /* The dst_mask selects which parts of the instruction are replaced into the instruction. In most cases src_mask == dst_mask, except in the above special case, where dst_mask would be 0x000000ff, and src_mask would be 0x00000000. */ bfd_vma dst_mask; - /* When some formats create PC relative instructions, they leave + /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). @@ -1669,26 +1764,22 @@ struct reloc_howto_struct } \ } \ } -unsigned int -bfd_get_reloc_size PARAMS ((reloc_howto_type *)); +unsigned int +bfd_get_reloc_size PARAMS ((reloc_howto_type *)); typedef struct relent_chain { arelent relent; struct relent_chain *next; } arelent_chain; bfd_reloc_status_type - -bfd_check_overflow - PARAMS ((enum complain_overflow how, +bfd_check_overflow PARAMS ((enum complain_overflow how, unsigned int bitsize, unsigned int rightshift, unsigned int addrsize, bfd_vma relocation)); bfd_reloc_status_type - -bfd_perform_relocation - PARAMS ((bfd *abfd, +bfd_perform_relocation PARAMS ((bfd *abfd, arelent *reloc_entry, PTR data, asection *input_section, @@ -1696,9 +1787,7 @@ bfd_perform_relocation char **error_message)); bfd_reloc_status_type - -bfd_install_relocation - PARAMS ((bfd *abfd, +bfd_install_relocation PARAMS ((bfd *abfd, arelent *reloc_entry, PTR data, bfd_vma data_start, asection *input_section, @@ -1972,6 +2061,16 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_386_GOTOFF, BFD_RELOC_386_GOTPC, +/* x86-64/elf relocations */ + BFD_RELOC_X86_64_GOT32, + BFD_RELOC_X86_64_PLT32, + BFD_RELOC_X86_64_COPY, + BFD_RELOC_X86_64_GLOB_DAT, + BFD_RELOC_X86_64_JUMP_SLOT, + BFD_RELOC_X86_64_RELATIVE, + BFD_RELOC_X86_64_GOTPCREL, + BFD_RELOC_X86_64_32S, + /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, BFD_RELOC_NS32K_IMM_16, @@ -2038,6 +2137,16 @@ It generally does map to one of the other relocation types. */ not stored in the instruction. */ BFD_RELOC_ARM_PCREL_BRANCH, +/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. */ + BFD_RELOC_ARM_PCREL_BLX, + +/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. */ + BFD_RELOC_THUMB_PCREL_BLX, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -2086,6 +2195,13 @@ not stored in the instruction. */ BFD_RELOC_SH_CODE, BFD_RELOC_SH_DATA, BFD_RELOC_SH_LABEL, + BFD_RELOC_SH_LOOP_START, + BFD_RELOC_SH_LOOP_END, + BFD_RELOC_SH_COPY, + BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, + BFD_RELOC_SH_RELATIVE, + BFD_RELOC_SH_GOTPC, /* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. */ @@ -2093,7 +2209,7 @@ be zero and is not stored in the instruction. */ BFD_RELOC_THUMB_PCREL_BRANCH12, BFD_RELOC_THUMB_PCREL_BRANCH23, -/* Argonaut RISC Core (ARC) relocs. +/* ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. The high 20 bits are installed in bits 26 through 7 of the instruction. */ @@ -2269,6 +2385,29 @@ significant 8 bits of a 24 bit word are placed into the least significant 8 bits of the opcode. */ BFD_RELOC_TIC30_LDP, +/* This is a 7bit reloc for the tms320c54x, where the least +significant 7 bits of a 16 bit word are placed into the least +significant 7 bits of the opcode. */ + BFD_RELOC_TIC54X_PARTLS7, + +/* This is a 9bit DP reloc for the tms320c54x, where the most +significant 9 bits of a 16 bit word are placed into the least +significant 9 bits of the opcode. */ + BFD_RELOC_TIC54X_PARTMS9, + +/* This is an extended address 23-bit reloc for the tms320c54x. */ + BFD_RELOC_TIC54X_23, + +/* This is a 16-bit reloc for the tms320c54x, where the least +significant 16 bits of a 23-bit extended address are placed into +the opcode. */ + BFD_RELOC_TIC54X_16_OF_23, + +/* This is a reloc for the tms320c54x, where the most +significant 7 bits of a 23-bit extended address are placed into +the opcode. */ + BFD_RELOC_TIC54X_MS7_OF_23, + /* This is a 48 bit reloc for the FR30 that stores 32 bits. */ BFD_RELOC_FR30_48, @@ -2395,19 +2534,138 @@ is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. */ BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY, + +/* Intel IA64 Relocations. */ + BFD_RELOC_IA64_IMM14, + BFD_RELOC_IA64_IMM22, + BFD_RELOC_IA64_IMM64, + BFD_RELOC_IA64_DIR32MSB, + BFD_RELOC_IA64_DIR32LSB, + BFD_RELOC_IA64_DIR64MSB, + BFD_RELOC_IA64_DIR64LSB, + BFD_RELOC_IA64_GPREL22, + BFD_RELOC_IA64_GPREL64I, + BFD_RELOC_IA64_GPREL32MSB, + BFD_RELOC_IA64_GPREL32LSB, + BFD_RELOC_IA64_GPREL64MSB, + BFD_RELOC_IA64_GPREL64LSB, + BFD_RELOC_IA64_LTOFF22, + BFD_RELOC_IA64_LTOFF64I, + BFD_RELOC_IA64_PLTOFF22, + BFD_RELOC_IA64_PLTOFF64I, + BFD_RELOC_IA64_PLTOFF64MSB, + BFD_RELOC_IA64_PLTOFF64LSB, + BFD_RELOC_IA64_FPTR64I, + BFD_RELOC_IA64_FPTR32MSB, + BFD_RELOC_IA64_FPTR32LSB, + BFD_RELOC_IA64_FPTR64MSB, + BFD_RELOC_IA64_FPTR64LSB, + BFD_RELOC_IA64_PCREL21B, + BFD_RELOC_IA64_PCREL21BI, + BFD_RELOC_IA64_PCREL21M, + BFD_RELOC_IA64_PCREL21F, + BFD_RELOC_IA64_PCREL22, + BFD_RELOC_IA64_PCREL60B, + BFD_RELOC_IA64_PCREL64I, + BFD_RELOC_IA64_PCREL32MSB, + BFD_RELOC_IA64_PCREL32LSB, + BFD_RELOC_IA64_PCREL64MSB, + BFD_RELOC_IA64_PCREL64LSB, + BFD_RELOC_IA64_LTOFF_FPTR22, + BFD_RELOC_IA64_LTOFF_FPTR64I, + BFD_RELOC_IA64_LTOFF_FPTR64MSB, + BFD_RELOC_IA64_LTOFF_FPTR64LSB, + BFD_RELOC_IA64_SEGREL32MSB, + BFD_RELOC_IA64_SEGREL32LSB, + BFD_RELOC_IA64_SEGREL64MSB, + BFD_RELOC_IA64_SEGREL64LSB, + BFD_RELOC_IA64_SECREL32MSB, + BFD_RELOC_IA64_SECREL32LSB, + BFD_RELOC_IA64_SECREL64MSB, + BFD_RELOC_IA64_SECREL64LSB, + BFD_RELOC_IA64_REL32MSB, + BFD_RELOC_IA64_REL32LSB, + BFD_RELOC_IA64_REL64MSB, + BFD_RELOC_IA64_REL64LSB, + BFD_RELOC_IA64_LTV32MSB, + BFD_RELOC_IA64_LTV32LSB, + BFD_RELOC_IA64_LTV64MSB, + BFD_RELOC_IA64_LTV64LSB, + BFD_RELOC_IA64_IPLTMSB, + BFD_RELOC_IA64_IPLTLSB, + BFD_RELOC_IA64_COPY, + BFD_RELOC_IA64_TPREL22, + BFD_RELOC_IA64_TPREL64MSB, + BFD_RELOC_IA64_TPREL64LSB, + BFD_RELOC_IA64_LTOFF_TP22, + BFD_RELOC_IA64_LTOFF22X, + BFD_RELOC_IA64_LDXMOV, + +/* Motorola 68HC11 reloc. +This is the 8 bits high part of an absolute address. */ + BFD_RELOC_M68HC11_HI8, + +/* Motorola 68HC11 reloc. +This is the 8 bits low part of an absolute address. */ + BFD_RELOC_M68HC11_LO8, + +/* Motorola 68HC11 reloc. +This is the 3 bits of a value. */ + BFD_RELOC_M68HC11_3B, + +/* These relocs are only used within the CRIS assembler. They are not +(at present) written to any object files. */ + BFD_RELOC_CRIS_BDISP8, + BFD_RELOC_CRIS_UNSIGNED_5, + BFD_RELOC_CRIS_SIGNED_6, + BFD_RELOC_CRIS_UNSIGNED_6, + BFD_RELOC_CRIS_UNSIGNED_4, + +/* Intel i860 Relocations. */ + BFD_RELOC_860_COPY, + BFD_RELOC_860_GLOB_DAT, + BFD_RELOC_860_JUMP_SLOT, + BFD_RELOC_860_RELATIVE, + BFD_RELOC_860_PC26, + BFD_RELOC_860_PLT26, + BFD_RELOC_860_PC16, + BFD_RELOC_860_LOW0, + BFD_RELOC_860_SPLIT0, + BFD_RELOC_860_LOW1, + BFD_RELOC_860_SPLIT1, + BFD_RELOC_860_LOW2, + BFD_RELOC_860_SPLIT2, + BFD_RELOC_860_LOW3, + BFD_RELOC_860_LOGOT0, + BFD_RELOC_860_SPGOT0, + BFD_RELOC_860_LOGOT1, + BFD_RELOC_860_SPGOT1, + BFD_RELOC_860_LOGOTOFF0, + BFD_RELOC_860_SPGOTOFF0, + BFD_RELOC_860_LOGOTOFF1, + BFD_RELOC_860_SPGOTOFF1, + BFD_RELOC_860_LOGOTOFF2, + BFD_RELOC_860_LOGOTOFF3, + BFD_RELOC_860_LOPC, + BFD_RELOC_860_HIGHADJ, + BFD_RELOC_860_HAGOT, + BFD_RELOC_860_HAGOTOFF, + BFD_RELOC_860_HAPC, + BFD_RELOC_860_HIGH, + BFD_RELOC_860_HIGOT, + BFD_RELOC_860_HIGOTOFF, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type * - -bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); const char * -bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); +bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); typedef struct symbol_cache_entry { - /* A pointer to the BFD which owns the symbol. This information + /* A pointer to the BFD which owns the symbol. This information is necessary so that a back end can work out what additional information (invisible to the application writer) is carried with the symbol. @@ -2417,65 +2675,65 @@ typedef struct symbol_cache_entry bfd_{abs,com,und}_section. This could be fixed by making these globals be per-bfd (or per-target-flavor). FIXME. */ - struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ + struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ - /* The text of the symbol. The name is left alone, and not copied; the + /* The text of the symbol. The name is left alone, and not copied; the application may not alter it. */ CONST char *name; - /* The value of the symbol. This really should be a union of a + /* The value of the symbol. This really should be a union of a numeric value with a pointer, since some flags indicate that a pointer to another symbol is stored here. */ symvalue value; - /* Attributes of a symbol: */ + /* Attributes of a symbol: */ #define BSF_NO_FLAGS 0x00 - /* The symbol has local scope; <<static>> in <<C>>. The value + /* The symbol has local scope; <<static>> in <<C>>. The value is the offset into the section of the data. */ #define BSF_LOCAL 0x01 - /* The symbol has global scope; initialized data in <<C>>. The + /* The symbol has global scope; initialized data in <<C>>. The value is the offset into the section of the data. */ #define BSF_GLOBAL 0x02 - /* The symbol has global scope and is exported. The value is + /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* no real difference */ +#define BSF_EXPORT BSF_GLOBAL /* no real difference */ - /* A normal C symbol would be one of: + /* A normal C symbol would be one of: <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>> */ - /* The symbol is a debugging record. The value has an arbitary + /* The symbol is a debugging record. The value has an arbitary meaning, unless BSF_DEBUGGING_RELOC is also set. */ #define BSF_DEBUGGING 0x08 - /* The symbol denotes a function entry point. Used in ELF, + /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ #define BSF_FUNCTION 0x10 - /* Used by the linker. */ + /* Used by the linker. */ #define BSF_KEEP 0x20 #define BSF_KEEP_G 0x40 - /* A weak global symbol, overridable without warnings by + /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ #define BSF_WEAK 0x80 - /* This symbol was created to point to a section, e.g. ELF's + /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ #define BSF_SECTION_SYM 0x100 - /* The symbol used to be a common symbol, but now it is + /* The symbol used to be a common symbol, but now it is allocated. */ #define BSF_OLD_COMMON 0x200 - /* The default value for common data. */ + /* The default value for common data. */ #define BFD_FORT_COMM_DEFAULT_VALUE 0 - /* In some files the type of a symbol sometimes alters its + /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <<ISFCN>> symbol which is also <<C_EXT>> symbol appears where it was declared and not at the end of a section. This bit is set @@ -2483,43 +2741,43 @@ typedef struct symbol_cache_entry #define BSF_NOT_AT_END 0x400 - /* Signal that the symbol is the label of constructor section. */ + /* Signal that the symbol is the label of constructor section. */ #define BSF_CONSTRUCTOR 0x800 - /* Signal that the symbol is a warning symbol. The name is a + /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ #define BSF_WARNING 0x1000 - /* Signal that the symbol is indirect. This symbol is an indirect + /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ #define BSF_INDIRECT 0x2000 - /* BSF_FILE marks symbols that contain a file name. This is used + /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ #define BSF_FILE 0x4000 - /* Symbol is from dynamic linking information. */ + /* Symbol is from dynamic linking information. */ #define BSF_DYNAMIC 0x8000 - /* The symbol denotes a data object. Used in ELF, and perhaps + /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ #define BSF_OBJECT 0x10000 - /* This symbol is a debugging symbol. The value is the offset + /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ #define BSF_DEBUGGING_RELOC 0x20000 flagword flags; - /* A pointer to the section to which this symbol is + /* A pointer to the section to which this symbol is relative. This will always be non NULL, there are special sections for undefined and absolute symbols. */ struct sec *section; - /* Back end special data. */ + /* Back end special data. */ union { PTR p; @@ -2529,10 +2787,10 @@ typedef struct symbol_cache_entry } asymbol; #define bfd_get_symtab_upper_bound(abfd) \ BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) -boolean +boolean bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym)); -boolean +boolean bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name)); #define bfd_is_local_label_name(abfd, name) \ @@ -2540,40 +2798,40 @@ bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name)); #define bfd_canonicalize_symtab(abfd, location) \ BFD_SEND (abfd, _bfd_canonicalize_symtab,\ (abfd, location)) -boolean -bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); +boolean +bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); -void +void bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol)); #define bfd_make_empty_symbol(abfd) \ BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) #define bfd_make_debug_symbol(abfd,ptr,size) \ BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) -int +int bfd_decode_symclass PARAMS ((asymbol *symbol)); -boolean -bfd_is_undefined_symclass PARAMS ((int symclass)); +boolean +bfd_is_undefined_symclass PARAMS ((int symclass)); -void +void bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret)); -boolean +boolean bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym)); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ (ibfd, isymbol, obfd, osymbol)) -struct _bfd +struct _bfd { - /* The filename the application opened the BFD with. */ - CONST char *filename; + /* The filename the application opened the BFD with. */ + CONST char *filename; - /* A pointer to the target jump table. */ + /* A pointer to the target jump table. */ const struct bfd_target *xvec; - /* To avoid dragging too many header files into every file that + /* To avoid dragging too many header files into every file that includes `<<bfd.h>>', IOSTREAM has been declared as a "char *", and MTIME as a "long". Their correct types, to which they are cast when used, are "FILE *" and "time_t". The iostream @@ -2582,105 +2840,105 @@ struct _bfd to a bfd_in_memory struct. */ PTR iostream; - /* Is the file descriptor being cached? That is, can it be closed as + /* Is the file descriptor being cached? That is, can it be closed as needed, and re-opened when accessed later? */ boolean cacheable; - /* Marks whether there was a default target specified when the + /* Marks whether there was a default target specified when the BFD was opened. This is used to select which matching algorithm to use to choose the back end. */ boolean target_defaulted; - /* The caching routines use these to maintain a + /* The caching routines use these to maintain a least-recently-used list of BFDs */ struct _bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains + /* When a file is closed by the caching routines, BFD retains state information on the file here: */ - file_ptr where; + file_ptr where; - /* and here: (``once'' means at least once) */ + /* and here: (``once'' means at least once) */ boolean opened_once; - /* Set if we have a locally maintained mtime value, rather than + /* Set if we have a locally maintained mtime value, rather than getting it from the file each time: */ boolean mtime_set; - /* File modified time, if mtime_set is true: */ + /* File modified time, if mtime_set is true: */ - long mtime; + long mtime; - /* Reserved for an unimplemented file locking extension.*/ + /* Reserved for an unimplemented file locking extension.*/ int ifd; - /* The format which belongs to the BFD. (object, core, etc.) */ + /* The format which belongs to the BFD. (object, core, etc.) */ bfd_format format; - /* The direction the BFD was opened with*/ + /* The direction the BFD was opened with*/ enum bfd_direction {no_direction = 0, read_direction = 1, write_direction = 2, both_direction = 3} direction; - /* Format_specific flags*/ + /* Format_specific flags*/ - flagword flags; + flagword flags; - /* Currently my_archive is tested before adding origin to + /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of origin, with origin set to 0 for non archive files. */ - file_ptr origin; + file_ptr origin; - /* Remember when output has begun, to stop strange things + /* Remember when output has begun, to stop strange things from happening. */ boolean output_has_begun; - /* Pointer to linked list of sections*/ + /* Pointer to linked list of sections*/ struct sec *sections; - /* The number of sections */ + /* The number of sections */ unsigned int section_count; - /* Stuff only useful for object files: + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output*/ + /* Used for input and output*/ unsigned int symcount; - /* Symbol table for output BFD (with symcount entries) */ - struct symbol_cache_entry **outsymbols; + /* Symbol table for output BFD (with symcount entries) */ + struct symbol_cache_entry **outsymbols; - /* Pointer to structure which contains architecture information*/ + /* Pointer to structure which contains architecture information*/ const struct bfd_arch_info *arch_info; - /* Stuff only useful for archives:*/ - PTR arelt_data; - struct _bfd *my_archive; /* The containing archive BFD. */ - struct _bfd *next; /* The next BFD in the archive. */ - struct _bfd *archive_head; /* The first BFD in the archive. */ - boolean has_armap; + /* Stuff only useful for archives:*/ + PTR arelt_data; + struct _bfd *my_archive; /* The containing archive BFD. */ + struct _bfd *next; /* The next BFD in the archive. */ + struct _bfd *archive_head; /* The first BFD in the archive. */ + boolean has_armap; - /* A chain of BFD structures involved in a link. */ + /* A chain of BFD structures involved in a link. */ struct _bfd *link_next; - /* A field used by _bfd_generic_link_add_archive_symbols. This will + /* A field used by _bfd_generic_link_add_archive_symbols. This will be used only for archive elements. */ int archive_pass; - /* Used by the back end to hold private data. */ + /* Used by the back end to hold private data. */ - union + union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; @@ -2712,11 +2970,11 @@ struct _bfd struct netbsd_core_struct *netbsd_core_data; PTR any; } tdata; - - /* Used by the application to hold private data*/ + + /* Used by the application to hold private data*/ PTR usrdata; - /* Where all the allocated stuff under this BFD goes. This is a + /* Where all the allocated stuff under this BFD goes. This is a struct objalloc *, but we use PTR to avoid requiring the inclusion of objalloc.h. */ PTR memory; @@ -2745,79 +3003,83 @@ typedef enum bfd_error bfd_error_invalid_error_code } bfd_error_type; -bfd_error_type -bfd_get_error PARAMS ((void)); +bfd_error_type +bfd_get_error PARAMS ((void)); -void -bfd_set_error PARAMS ((bfd_error_type error_tag)); +void +bfd_set_error PARAMS ((bfd_error_type error_tag)); CONST char * -bfd_errmsg PARAMS ((bfd_error_type error_tag)); +bfd_errmsg PARAMS ((bfd_error_type error_tag)); -void -bfd_perror PARAMS ((CONST char *message)); +void +bfd_perror PARAMS ((CONST char *message)); typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); -bfd_error_handler_type -bfd_set_error_handler PARAMS ((bfd_error_handler_type)); +bfd_error_handler_type +bfd_set_error_handler PARAMS ((bfd_error_handler_type)); -void -bfd_set_error_program_name PARAMS ((const char *)); +void +bfd_set_error_program_name PARAMS ((const char *)); -bfd_error_handler_type -bfd_get_error_handler PARAMS ((void)); +bfd_error_handler_type +bfd_get_error_handler PARAMS ((void)); -long +long bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect)); -long -bfd_canonicalize_reloc - PARAMS ((bfd *abfd, +long +bfd_canonicalize_reloc PARAMS ((bfd *abfd, asection *sec, arelent **loc, asymbol **syms)); -void -bfd_set_reloc - PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count) +void +bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count) ); -boolean +boolean bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags)); -boolean +int +bfd_get_arch_size PARAMS ((bfd *abfd)); + +int +bfd_get_sign_extend_vma PARAMS ((bfd *abfd)); + +boolean bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma)); -long +long bfd_get_mtime PARAMS ((bfd *abfd)); -long +long bfd_get_size PARAMS ((bfd *abfd)); -int +int bfd_get_gp_size PARAMS ((bfd *abfd)); -void +void bfd_set_gp_size PARAMS ((bfd *abfd, int i)); -bfd_vma +bfd_vma bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base)); -boolean +boolean bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); #define bfd_copy_private_bfd_data(ibfd, obfd) \ BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ (ibfd, obfd)) -boolean +boolean bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); #define bfd_merge_private_bfd_data(ibfd, obfd) \ BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ (ibfd, obfd)) -boolean +boolean bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_set_private_flags(abfd, flags) \ @@ -2829,7 +3091,7 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ + /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) @@ -2887,10 +3149,10 @@ extern bfd_byte *bfd_get_relocated_section_contents struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); -symindex +symindex bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); -boolean +boolean bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); bfd * @@ -2899,12 +3161,11 @@ bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); CONST char * bfd_core_file_failing_command PARAMS ((bfd *abfd)); -int +int bfd_core_file_failing_signal PARAMS ((bfd *abfd)); -boolean -core_file_matches_executable_p - PARAMS ((bfd *core_bfd, bfd *exec_bfd)); +boolean +core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); #define BFD_SEND(bfd, message, arglist) \ ((*((bfd)->xvec->message)) arglist) @@ -2917,13 +3178,13 @@ core_file_matches_executable_p (bfd_assert (__FILE__,__LINE__), NULL)) #endif #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) #ifdef DEBUG_BFD_SEND #undef BFD_SEND_FMT #define BFD_SEND_FMT(bfd, message, arglist) \ (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ (bfd_assert (__FILE__,__LINE__), NULL)) #endif enum bfd_flavour { @@ -2931,6 +3192,7 @@ enum bfd_flavour { bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, + bfd_target_xcoff_flavour, bfd_target_elf_flavour, bfd_target_ieee_flavour, bfd_target_nlm_flavour, @@ -2948,7 +3210,7 @@ enum bfd_flavour { enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; - /* Forward declaration. */ +/* Forward declaration. */ typedef struct bfd_link_info _bfd_link_info; typedef struct bfd_target @@ -2957,10 +3219,10 @@ typedef struct bfd_target enum bfd_flavour flavour; enum bfd_endian byteorder; enum bfd_endian header_byteorder; - flagword object_flags; + flagword object_flags; flagword section_flags; char symbol_leading_char; - char ar_pad_char; + char ar_pad_char; unsigned short ar_max_namelen; bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); @@ -2984,7 +3246,7 @@ typedef struct bfd_target boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); - /* Generic entry points. */ + /* Generic entry points. */ #define BFD_JUMP_TABLE_GENERIC(NAME)\ CAT(NAME,_close_and_cleanup),\ CAT(NAME,_bfd_free_cached_info),\ @@ -2992,20 +3254,20 @@ CAT(NAME,_new_section_hook),\ CAT(NAME,_get_section_contents),\ CAT(NAME,_get_section_contents_in_window) - /* Called when the BFD is being closed to do any necessary cleanup. */ + /* Called when the BFD is being closed to do any necessary cleanup. */ boolean (*_close_and_cleanup) PARAMS ((bfd *)); - /* Ask the BFD to free all cached information. */ + /* Ask the BFD to free all cached information. */ boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); - /* Called when a new section is created. */ + /* Called when a new section is created. */ boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); - /* Read the contents of a section. */ - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, + /* Read the contents of a section. */ + boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); boolean (*_bfd_get_section_contents_in_window) PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); - /* Entry points to copy private data. */ + /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME)\ CAT(NAME,_bfd_copy_private_bfd_data),\ CAT(NAME,_bfd_merge_private_bfd_data),\ @@ -3013,27 +3275,27 @@ CAT(NAME,_bfd_copy_private_section_data),\ CAT(NAME,_bfd_copy_private_symbol_data),\ CAT(NAME,_bfd_set_private_flags),\ CAT(NAME,_bfd_print_private_bfd_data)\ - /* Called to copy BFD general private data from one object file + /* Called to copy BFD general private data from one object file to another. */ boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to merge BFD general private data from one object file + /* Called to merge BFD general private data from one object file to a common output file when linking. */ boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to copy BFD private section data from one object file + /* Called to copy BFD private section data from one object file to another. */ boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); - /* Called to copy BFD private symbol data from one symbol + /* Called to copy BFD private symbol data from one symbol to another. */ boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); - /* Called to set private backend flags */ + /* Called to set private backend flags */ boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); - /* Called to print private BFD data */ + /* Called to print private BFD data */ boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); - /* Core file entry points. */ + /* Core file entry points. */ #define BFD_JUMP_TABLE_CORE(NAME)\ CAT(NAME,_core_file_failing_command),\ CAT(NAME,_core_file_failing_signal),\ @@ -3042,7 +3304,7 @@ CAT(NAME,_core_file_matches_executable_p) int (*_core_file_failing_signal) PARAMS ((bfd *)); boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); - /* Archive entry points. */ + /* Archive entry points. */ #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ CAT(NAME,_slurp_armap),\ CAT(NAME,_slurp_extended_name_table),\ @@ -3059,10 +3321,10 @@ CAT(NAME,_update_armap_timestamp) boolean (*_bfd_construct_extended_name_table) PARAMS ((bfd *, char **, bfd_size_type *, const char **)); void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); - boolean (*write_armap) PARAMS ((bfd *arch, + boolean (*write_armap) PARAMS ((bfd *arch, unsigned int elength, struct orl *map, - unsigned int orl_count, + unsigned int orl_count, int stridx)); PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); @@ -3071,7 +3333,7 @@ CAT(NAME,_update_armap_timestamp) int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); - /* Entry points used for symbols. */ + /* Entry points used for symbols. */ #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ CAT(NAME,_get_symtab_upper_bound),\ CAT(NAME,_get_symtab),\ @@ -3104,7 +3366,7 @@ CAT(NAME,_minisymbol_to_symbol) struct sec *section, struct symbol_cache_entry **symbols, bfd_vma offset, CONST char **file, CONST char **func, unsigned int *line)); - /* Back-door to allow format-aware applications to create debug symbols + /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ asymbol * (*_bfd_make_debug_symbol) PARAMS (( @@ -3120,7 +3382,7 @@ CAT(NAME,_minisymbol_to_symbol) asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, asymbol *)); - /* Routines for relocs. */ + /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME)\ CAT(NAME,_get_reloc_upper_bound),\ CAT(NAME,_canonicalize_reloc),\ @@ -3128,12 +3390,12 @@ CAT(NAME,_bfd_reloc_type_lookup) long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); - /* See documentation on reloc types. */ + /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); - /* Routines used when writing an object file. */ + /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME)\ CAT(NAME,_set_arch_mach),\ CAT(NAME,_set_section_contents) @@ -3142,7 +3404,7 @@ CAT(NAME,_set_section_contents) boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); - /* Routines used by the linker. */ + /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME)\ CAT(NAME,_sizeof_headers),\ CAT(NAME,_bfd_get_relocated_section_contents),\ @@ -3161,48 +3423,48 @@ CAT(NAME,_bfd_gc_sections) boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *again)); - /* Create a hash table for the linker. Different backends store + /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); - /* Add symbols from this object file into the hash table. */ + /* Add symbols from this object file into the hash table. */ boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); - /* Do a link based on the link_order structures attached to each + /* Do a link based on the link_order structures attached to each section of the BFD. */ boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); - /* Should this section be split up into smaller pieces during linking. */ + /* Should this section be split up into smaller pieces during linking. */ boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); - /* Remove sections that are not referenced from the output. */ + /* Remove sections that are not referenced from the output. */ boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); - /* Routines to handle dynamic symbols and relocs. */ + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME)\ CAT(NAME,_get_dynamic_symtab_upper_bound),\ CAT(NAME,_canonicalize_dynamic_symtab),\ CAT(NAME,_get_dynamic_reloc_upper_bound),\ CAT(NAME,_canonicalize_dynamic_reloc) - /* Get the amount of memory required to hold the dynamic symbols. */ + /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic symbols. */ + /* Read in the dynamic symbols. */ long (*_bfd_canonicalize_dynamic_symtab) PARAMS ((bfd *, struct symbol_cache_entry **)); - /* Get the amount of memory required to hold the dynamic relocs. */ + /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic relocs. */ + /* Read in the dynamic relocs. */ long (*_bfd_canonicalize_dynamic_reloc) PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); - /* Opposite endian version of this target. */ + /* Opposite endian version of this target. */ const struct bfd_target * alternative_target; - + PTR backend_data; - + } bfd_target; -boolean -bfd_set_default_target PARAMS ((const char *name)); +boolean +bfd_set_default_target PARAMS ((const char *name)); const bfd_target * bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd)); @@ -3210,16 +3472,16 @@ bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd)); const char ** bfd_target_list PARAMS ((void)); -const bfd_target * -bfd_search_for_target PARAMS ((int (* search_func)(const bfd_target *, void *), void *)); +const bfd_target * +bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); -boolean +boolean bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); -boolean +boolean bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching)); -boolean +boolean bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); CONST char * diff --git a/contrib/binutils/bfd/bfd.c b/contrib/binutils/bfd/bfd.c index e04172f..2e172c9 100644 --- a/contrib/binutils/bfd/bfd.c +++ b/contrib/binutils/bfd/bfd.c @@ -33,10 +33,10 @@ SECTION CODE_FRAGMENT . -.struct _bfd +.struct _bfd .{ . {* The filename the application opened the BFD with. *} -. CONST char *filename; +. CONST char *filename; . . {* A pointer to the target jump table. *} . const struct bfd_target *xvec; @@ -69,7 +69,7 @@ CODE_FRAGMENT . {* When a file is closed by the caching routines, BFD retains . state information on the file here: *} . -. file_ptr where; +. file_ptr where; . . {* and here: (``once'' means at least once) *} . @@ -82,7 +82,7 @@ CODE_FRAGMENT . . {* File modified time, if mtime_set is true: *} . -. long mtime; +. long mtime; . . {* Reserved for an unimplemented file locking extension.*} . @@ -101,13 +101,13 @@ CODE_FRAGMENT . . {* Format_specific flags*} . -. flagword flags; +. flagword flags; . . {* Currently my_archive is tested before adding origin to . anything. I believe that this can become always an add of . origin, with origin set to 0 for non archive files. *} . -. file_ptr origin; +. file_ptr origin; . . {* Remember when output has begun, to stop strange things . from happening. *} @@ -119,7 +119,7 @@ CODE_FRAGMENT . {* The number of sections *} . unsigned int section_count; . -. {* Stuff only useful for object files: +. {* Stuff only useful for object files: . The start address. *} . bfd_vma start_address; . @@ -127,17 +127,17 @@ CODE_FRAGMENT . unsigned int symcount; . . {* Symbol table for output BFD (with symcount entries) *} -. struct symbol_cache_entry **outsymbols; +. struct symbol_cache_entry **outsymbols; . . {* Pointer to structure which contains architecture information*} . const struct bfd_arch_info *arch_info; . . {* Stuff only useful for archives:*} -. PTR arelt_data; +. PTR arelt_data; . struct _bfd *my_archive; {* The containing archive BFD. *} . struct _bfd *next; {* The next BFD in the archive. *} . struct _bfd *archive_head; {* The first BFD in the archive. *} -. boolean has_armap; +. boolean has_armap; . . {* A chain of BFD structures involved in a link. *} . struct _bfd *link_next; @@ -148,7 +148,7 @@ CODE_FRAGMENT . . {* Used by the back end to hold private data. *} . -. union +. union . { . struct aout_data_struct *aout_data; . struct artdata *aout_ar_data; @@ -180,7 +180,7 @@ CODE_FRAGMENT . struct netbsd_core_struct *netbsd_core_data; . PTR any; . } tdata; -. +. . {* Used by the application to hold private data*} . PTR usrdata; . @@ -218,8 +218,6 @@ CODE_FRAGMENT struct which ultimately gets passed in to the bfd. When it arrives, copy it to the following struct so that the data will be available in coffcode.h where it is needed. The typedef's used are defined in bfd.h */ - - /* SECTION @@ -376,7 +374,7 @@ bfd_perror (message) CONST char *message; { if (bfd_get_error () == bfd_error_system_call) - perror((char *)message); /* must be system error then... */ + perror((char *)message); /* must be system error then... */ else { if (message == NULL || *message == '\0') fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); @@ -510,7 +508,6 @@ bfd_set_error_program_name (name) _bfd_error_program_name = name; } - /* FUNCTION bfd_get_error_handler @@ -547,7 +544,6 @@ DESCRIPTION */ - long bfd_get_reloc_upper_bound (abfd, asect) bfd *abfd; @@ -584,7 +580,6 @@ DESCRIPTION The @var{syms} table is also needed for horrible internal magic reasons. - */ long bfd_canonicalize_reloc (abfd, asect, location, symbols) @@ -615,7 +610,7 @@ DESCRIPTION The argument @var{abfd} is ignored. */ -/*ARGSUSED*/ + void bfd_set_reloc (ignore_abfd, asect, location, count) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -706,6 +701,65 @@ _bfd_abort (file, line, fn) /* FUNCTION + bfd_get_arch_size + +SYNOPSIS + int bfd_get_arch_size (bfd *abfd); + +DESCRIPTION + Returns the architecture address size, in bits, as determined + by the object file's format. For ELF, this information is + included in the header. + +RETURNS + Returns the arch size in bits if known, <<-1>> otherwise. +*/ + +int +bfd_get_arch_size (abfd) + bfd *abfd; +{ + if (abfd->xvec->flavour == bfd_target_elf_flavour) + return (get_elf_backend_data (abfd))->s->arch_size; + + bfd_set_error (bfd_error_wrong_format); + return -1; +} + +/* +FUNCTION + bfd_get_sign_extend_vma + +SYNOPSIS + int bfd_get_sign_extend_vma (bfd *abfd); + +DESCRIPTION + Indicates if the target architecture "naturally" sign extends + an address. Some architectures implicitly sign extend address + values when they are converted to types larger than the size + of an address. For instance, bfd_get_start_address() will + return an address sign extended to fill a bfd_vma when this is + the case. + +RETURNS + Returns <<1>> if the target architecture is known to sign + extend addresses, <<0>> if the target architecture is known to + not sign extend addresses, and <<-1>> otherwise. +*/ + +int +bfd_get_sign_extend_vma (abfd) + bfd *abfd; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + return (get_elf_backend_data (abfd)->sign_extend_vma); + + bfd_set_error (bfd_error_wrong_format); + return -1; +} + +/* +FUNCTION bfd_set_start_address SYNOPSIS @@ -727,7 +781,6 @@ bfd_vma vma; return true; } - /* FUNCTION bfd_get_mtime @@ -779,7 +832,7 @@ DESCRIPTION Instead, we want to ask questions like "is this NNN byte sized object I'm about to try read from file offset YYY reasonable?" As as example of where we might do this, some object formats - use string tables for which the first <<sizeof(long)>> bytes of the + use string tables for which the first <<sizeof (long)>> bytes of the table contain the size of the table itself, including the size bytes. If an application tries to read what it thinks is one of these string tables, without some way to validate the size, and for @@ -926,7 +979,7 @@ bfd_scan_vma (string, end, base) int digit; /* Let the host do it if possible. */ - if (sizeof(bfd_vma) <= sizeof(unsigned long)) + if (sizeof (bfd_vma) <= sizeof (unsigned long)) return (bfd_vma) strtoul (string, (char **) end, base); /* A negative base makes no sense, and we only need to go as high as hex. */ @@ -950,7 +1003,7 @@ bfd_scan_vma (string, end, base) (string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X'))) string += 2; /* XXX should we also skip over "0b" or "0B" if base is 2? */ - + /* Speed could be improved with a table like hex_value[] in gas. */ #define HEX_VALUE(c) \ (isxdigit ((unsigned char) c) \ @@ -978,7 +1031,7 @@ SYNOPSIS boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); DESCRIPTION - Copy private BFD information from the BFD @var{ibfd} to the + Copy private BFD information from the BFD @var{ibfd} to the the BFD @var{obfd}. Return <<true>> on success, <<false>> on error. Possible error returns are: @@ -999,7 +1052,7 @@ SYNOPSIS boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); DESCRIPTION - Merge private BFD information from the BFD @var{ibfd} to the + Merge private BFD information from the BFD @var{ibfd} to the the output file BFD @var{obfd} when linking. Return <<true>> on success, <<false>> on error. Possible error returns are: diff --git a/contrib/binutils/bfd/binary.c b/contrib/binutils/bfd/binary.c index c2980b0..771e431 100644 --- a/contrib/binutils/bfd/binary.c +++ b/contrib/binutils/bfd/binary.c @@ -255,6 +255,9 @@ binary_set_section_contents (abfd, sec, data, offset, size) file_ptr offset; bfd_size_type size; { + if (size == 0) + return true; + if (! abfd->output_has_begun) { boolean found_low; @@ -270,6 +273,7 @@ binary_set_section_contents (abfd, sec, data, offset, size) if (((s->flags & (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_NEVER_LOAD)) == (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC)) + && (s->_raw_size > 0) && (! found_low || s->lma < low)) { low = s->lma; @@ -281,17 +285,18 @@ binary_set_section_contents (abfd, sec, data, offset, size) s->filepos = s->lma - low; /* Skip following warning check for sections that will not - occupy file space. */ + occupy file space. */ if ((s->flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD)) - != (SEC_HAS_CONTENTS | SEC_ALLOC)) + != (SEC_HAS_CONTENTS | SEC_ALLOC) + || (s->_raw_size == 0)) continue; /* If attempting to generate a binary file from a bfd with LMA's all over the place, huge (sparse?) binary files may result. This condition attempts to detect this situation and print a warning. Better heuristics would be nice to - have. */ + have. */ if (s->filepos < 0) (*_bfd_error_handler) @@ -383,6 +388,6 @@ const bfd_target binary_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + NULL }; diff --git a/contrib/binutils/bfd/cache.c b/contrib/binutils/bfd/cache.c index 91b6c61..063373c 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 + Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000, 2001 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). @@ -32,7 +32,7 @@ SECTION <<bfd_cache_lookup>>, which runs around and makes sure that the required BFD is open. If not, then it chooses a file to close, closes it and opens the one wanted, returning its file - handle. + handle. */ @@ -79,19 +79,18 @@ bfd *bfd_last_cache; /* INTERNAL_FUNCTION bfd_cache_lookup - + DESCRIPTION Check to see if the required BFD is the same as the last one looked up. If so, then it can use the stream in the BFD with impunity, since it can't have changed since the last lookup; otherwise, it has to perform the complicated lookup function. - + .#define bfd_cache_lookup(x) \ . ((x)==bfd_last_cache? \ - . (FILE*)(bfd_last_cache->iostream): \ + . (FILE*) (bfd_last_cache->iostream): \ . bfd_cache_lookup_worker(x)) - - + */ /* Insert a BFD into the cache. */ @@ -262,7 +261,7 @@ FILE * bfd_open_file (abfd) bfd *abfd; { - abfd->cacheable = true; /* Allow it to be closed later. */ + abfd->cacheable = true; /* Allow it to be closed later. */ if (open_files >= BFD_CACHE_MAX_OPEN) { @@ -312,7 +311,7 @@ bfd_open_file (abfd) if (stat (abfd->filename, &s) == 0 && s.st_size != 0) unlink (abfd->filename); #endif - abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB); + abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB); abfd->opened_once = true; } break; @@ -339,7 +338,7 @@ DESCRIPTION quick answer. Find a file descriptor for @var{abfd}. If necessary, it open it. If there are already more than <<BFD_CACHE_MAX_OPEN>> files open, it tries to close one first, to - avoid running out of file descriptors. + avoid running out of file descriptors. */ FILE * @@ -349,7 +348,7 @@ bfd_cache_lookup_worker (abfd) if ((abfd->flags & BFD_IN_MEMORY) != 0) abort (); - if (abfd->my_archive) + if (abfd->my_archive) abfd = abfd->my_archive; if (abfd->iostream != NULL) diff --git a/contrib/binutils/bfd/coff-alpha.c b/contrib/binutils/bfd/coff-alpha.c index 6bbc279..41e4710 100644 --- a/contrib/binutils/bfd/coff-alpha.c +++ b/contrib/binutils/bfd/coff-alpha.c @@ -924,7 +924,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, does not cause anything to happen, itself. */ rel->address += input_section->output_offset; break; - + case ALPHA_R_GPDISP: /* This marks the ldah of an ldah/lda pair which loads the gp register with the difference of the gp value and the @@ -980,7 +980,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, rel->address += input_section->output_offset; } break; - + case ALPHA_R_OP_PUSH: /* Push a value on the reloc evaluation stack. */ { @@ -1106,7 +1106,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, stack[tos - 1] >>= relocation; } break; - + case ALPHA_R_GPVALUE: /* I really don't know if this does the right thing. */ gp = rel->addend; @@ -1126,7 +1126,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, os->reloc_count++; } - if (r != bfd_reloc_ok) + if (r != bfd_reloc_ok) { switch (r) { @@ -1136,7 +1136,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, input_bfd, input_section, rel->address, true))) goto error_return; break; - case bfd_reloc_dangerous: + case bfd_reloc_dangerous: if (! ((*link_info->callbacks->reloc_dangerous) (link_info, err, input_bfd, input_section, rel->address))) @@ -1332,7 +1332,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) r_symndx = RELOC_SECTION_XDATA; break; } - + if (r_symndx == -1) abort (); @@ -1437,7 +1437,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, pointer. To support large programs, we need to allow multiple global pointers. This works as long as each input .lita section is <64KB big. This implies that when producing relocatable - output, the .lita section is limited to 64KB. . */ + output, the .lita section is limited to 64KB. . */ lita_sec = symndx_to_section[RELOC_SECTION_LITA]; gp = _bfd_get_gp_value (output_bfd); @@ -1619,7 +1619,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* See ALPHA_R_LITERAL above for the uses of this reloc. It does not cause anything to happen, itself. */ break; - + case ALPHA_R_GPDISP: /* This marks the ldah of an ldah/lda pair which loads the gp register with the difference of the gp value and the @@ -1679,7 +1679,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, gp_usedp = true; } break; - + case ALPHA_R_OP_PUSH: case ALPHA_R_OP_PSUB: case ALPHA_R_OP_PRSHIFT: @@ -2008,7 +2008,6 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* Do final adjustments to the filehdr and the aouthdr. This routine sets the dynamic bits in the file header. */ -/*ARGSUSED*/ static boolean alpha_adjust_headers (abfd, fhdr, ahdr) bfd *abfd; @@ -2136,7 +2135,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) left = size; - /* I don't know what the next eight bytes are for. */ + /* I don't know what the next eight bytes are for. */ if (bfd_read (ab, 1, 8, nbfd) != 8) goto error_return; @@ -2201,7 +2200,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) error_return: if (nbfd != NULL) bfd_close (nbfd); - return NULL; + return NULL; } /* Open the next archived file. */ @@ -2229,7 +2228,7 @@ alpha_ecoff_openr_next_archived_file (archive, last_file) /* Pad to an even boundary... Note that last_file->origin can be odd in the case of - BSD-4.4-style element with a long odd size. */ + BSD-4.4-style element with a long odd size. */ filestart = last_file->origin + size; filestart += filestart % 2; } @@ -2266,7 +2265,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out, alpha_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, + FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in, alpha_ecoff_swap_scnhdr_in, NULL, alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, @@ -2400,6 +2399,6 @@ const bfd_target ecoffalpha_little_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) &alpha_ecoff_backend_data }; diff --git a/contrib/binutils/bfd/coff-arm.c b/contrib/binutils/bfd/coff-arm.c index 2b89b84..7ec7b8e 100644 --- a/contrib/binutils/bfd/coff-arm.c +++ b/contrib/binutils/bfd/coff-arm.c @@ -51,13 +51,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef NUM_ELEM #define NUM_ELEM(a) ((sizeof (a)) / sizeof ((a)[0])) #endif - + typedef enum {bunknown, b9, b12, b23} thumb_pcrel_branchtype; /* some typedefs for holding instructions */ typedef unsigned long int insn32; typedef unsigned short int insn16; - /* Forward declarations for stupid compilers. */ static boolean coff_arm_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, @@ -77,7 +76,7 @@ static bfd_reloc_status_type coff_arm_reloc static boolean coff_arm_adjust_symndx PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, struct internal_reloc *, boolean *)); -static reloc_howto_type * coff_arm_rtype_to_howto +static reloc_howto_type * coff_arm_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); static bfd_reloc_status_type coff_thumb_pcrel_common @@ -119,14 +118,14 @@ static boolean coff_arm_final_link_postscript Given a function name, and its type, the stub can be found. The name can be changed. The only requirement is the %s be present. */ - + #define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t" #define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb" #define ARM2THUMB_GLUE_SECTION_NAME ".glue_7" #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm" -/* Used by the assembler. */ +/* Used by the assembler. */ static bfd_reloc_status_type coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -232,14 +231,14 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #define ARM_SECREL 15 #endif -static reloc_howto_type aoutarm_std_reloc_howto[] = +static reloc_howto_type aoutarm_std_reloc_howto[] = { /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ #ifdef ARM_WINCE EMPTY_HOWTO (-1), - HOWTO (ARM_32, + HOWTO (ARM_32, 0, - 2, + 2, 32, false, 0, @@ -250,9 +249,9 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0xffffffff, 0xffffffff, PCRELOFFSET), - HOWTO (ARM_RVA32, + HOWTO (ARM_RVA32, 0, - 2, + 2, 32, false, 0, @@ -274,7 +273,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_26", false, 0x00ffffff, - 0x00ffffff, + 0x00ffffff, PCRELOFFSET), HOWTO (ARM_THUMB12, 1, @@ -287,16 +286,16 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB12", false, 0x000007ff, - 0x000007ff, + 0x000007ff, PCRELOFFSET), - HOWTO (ARM_26D, - 2, + HOWTO (ARM_26D, + 2, 2, 24, false, 0, complain_overflow_dont, - aoutarm_fix_pcrel_26_done, + aoutarm_fix_pcrel_26_done, "ARM_26D", true, 0x00ffffff, @@ -310,22 +309,22 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO (ARM_SECTION, - 0, - 1, - 16, + HOWTO (ARM_SECTION, + 0, + 1, + 16, false, 0, complain_overflow_bitfield, coff_arm_reloc, - "ARM_16", + "ARM_16", true, 0x0000ffff, - 0x0000ffff, + 0x0000ffff, PCRELOFFSET), - HOWTO (ARM_SECREL, + HOWTO (ARM_SECREL, 0, - 2, + 2, 32, false, 0, @@ -350,22 +349,22 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ PCRELOFFSET /* pcrel_offset */), - HOWTO(ARM_16, - 0, - 1, - 16, + HOWTO(ARM_16, + 0, + 1, + 16, false, 0, complain_overflow_bitfield, coff_arm_reloc, - "ARM_16", + "ARM_16", true, 0x0000ffff, - 0x0000ffff, + 0x0000ffff, PCRELOFFSET), - HOWTO(ARM_32, + HOWTO(ARM_32, 0, - 2, + 2, 32, false, 0, @@ -387,28 +386,28 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_26", false, 0x00ffffff, - 0x00ffffff, + 0x00ffffff, PCRELOFFSET), - HOWTO(ARM_DISP8, + HOWTO(ARM_DISP8, 0, 0, - 8, + 8, true, 0, - complain_overflow_signed, + complain_overflow_signed, coff_arm_reloc, - "ARM_DISP8", + "ARM_DISP8", true, 0x000000ff, 0x000000ff, true), - HOWTO( ARM_DISP16, + HOWTO( ARM_DISP16, 0, 1, 16, true, 0, - complain_overflow_signed, + complain_overflow_signed, coff_arm_reloc, "ARM_DISP16", true, @@ -421,21 +420,21 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 32, true, 0, - complain_overflow_signed, + complain_overflow_signed, coff_arm_reloc, "ARM_DISP32", true, 0xffffffff, 0xffffffff, true), - HOWTO( ARM_26D, - 2, + HOWTO( ARM_26D, + 2, 2, 24, false, 0, complain_overflow_dont, - aoutarm_fix_pcrel_26_done, + aoutarm_fix_pcrel_26_done, "ARM_26D", true, 0x00ffffff, @@ -448,16 +447,16 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = -1, 16, false, - 0, + 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_NEG16", - true, + true, + 0x0000ffff, 0x0000ffff, - 0x0000ffff, false), - HOWTO( ARM_NEG32, - 0, + HOWTO( ARM_NEG32, + 0, -2, 32, false, @@ -469,9 +468,9 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0xffffffff, 0xffffffff, false), - HOWTO( ARM_RVA32, + HOWTO( ARM_RVA32, 0, - 2, + 2, 32, false, 0, @@ -493,7 +492,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB9", false, 0x000000ff, - 0x000000ff, + 0x000000ff, PCRELOFFSET), HOWTO( ARM_THUMB12, 1, @@ -506,7 +505,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB12", false, 0x000007ff, - 0x000007ff, + 0x000007ff, PCRELOFFSET), HOWTO( ARM_THUMB23, 1, @@ -519,7 +518,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB23", false, 0x07ff07ff, - 0x07ff07ff, + 0x07ff07ff, PCRELOFFSET) #endif /* not ARM_WINCE */ }; @@ -528,7 +527,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = #ifdef COFF_WITH_PE /* Return true if this relocation should - appear in the output .reloc section. */ + appear in the output .reloc section. */ static boolean in_reloc_p (abfd, howto) @@ -536,7 +535,7 @@ in_reloc_p (abfd, howto) reloc_howto_type * howto; { return !howto->pc_relative && howto->type != ARM_RVA32; -} +} #endif #define RTYPE2HOWTO(cache_ptr, dst) \ @@ -560,7 +559,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp) if (rel->r_type >= NUM_RELOCS) return NULL; - + howto = aoutarm_std_reloc_howto + rel->r_type; if (rel->r_type == ARM_RVA32) @@ -568,7 +567,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp) return howto; } -/* Used by the assembler. */ +/* Used by the assembler. */ static bfd_reloc_status_type aoutarm_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section, @@ -585,7 +584,7 @@ aoutarm_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_ok; } -/* Used by the assembler. */ +/* Used by the assembler. */ static bfd_reloc_status_type aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, @@ -602,7 +601,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, bfd_size_type addr = reloc_entry->address; long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); bfd_reloc_status_type flag = bfd_reloc_ok; - + /* If this is an undefined symbol, return error */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) @@ -623,7 +622,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, relocation -= input_section->output_section->vma; relocation -= input_section->output_offset; relocation -= addr; - + if (relocation & 3) return bfd_reloc_overflow; @@ -693,7 +692,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, default: abort (); } - + /* If this is an undefined symbol, return error */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) @@ -768,7 +767,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, /* Now the ARM magic... Change the reloc type so that it is marked as done. Strictly this is only necessary if we are doing a partial relocation. */ reloc_entry->howto = & aoutarm_std_reloc_howto [ARM_26D]; - + /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations */ return flag; } @@ -818,14 +817,13 @@ coff_thumb_pcrel_9 (abfd, reloc_entry, symbol, data, input_section, input_section, output_bfd, error_message, b9); } - static CONST struct reloc_howto_struct * coff_arm_reloc_type_lookup (abfd, code) bfd * abfd; bfd_reloc_code_real_type code; { #define ASTD(i,j) case i: return aoutarm_std_reloc_howto + j - + if (code == BFD_RELOC_CTOR) switch (bfd_get_arch_info (abfd)->bits_per_address) { @@ -847,6 +845,7 @@ coff_arm_reloc_type_lookup (abfd, code) ASTD (BFD_RELOC_16, ARM_16); ASTD (BFD_RELOC_32, ARM_32); ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26); + ASTD (BFD_RELOC_ARM_PCREL_BLX, ARM_26); ASTD (BFD_RELOC_8_PCREL, ARM_DISP8); ASTD (BFD_RELOC_16_PCREL, ARM_DISP16); ASTD (BFD_RELOC_32_PCREL, ARM_DISP32); @@ -854,7 +853,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); -#endif +#endif default: return (CONST struct reloc_howto_struct *) 0; } } @@ -874,17 +873,17 @@ struct coff_arm_link_hash_table { /* The original coff_link_hash_table structure. MUST be first field. */ struct coff_link_hash_table root; - + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ long int thumb_glue_size; - + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ long int arm_glue_size; /* An arbitary input BFD chosen to hold the glue sections. */ bfd * bfd_of_glue_owner; - /* Support interworking with old, non-interworking aware ARM code. */ + /* Support interworking with old, non-interworking aware ARM code. */ int support_old_code; }; @@ -939,16 +938,16 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) /* The thumb form of a long branch is a bit finicky, because the offset encoding is split over two fields, each in it's own instruction. They - can occur in any order. So given a thumb form of long branch, and an + can occur in any order. So given a thumb form of long branch, and an offset, insert the offset into the thumb branch and return finished - instruction. + instruction. - It takes two thumb instructions to encode the target address. Each has + It takes two thumb instructions to encode the target address. Each has 11 bits to invest. The upper 11 bits are stored in one (identifed by - H-0.. see below), the lower 11 bits are stored in the other (identified - by H-1). + H-0.. see below), the lower 11 bits are stored in the other (identified + by H-1). - Combine together and shifted left by 1 (it's a half word address) and + Combine together and shifted left by 1 (it's a half word address) and there you have it. Op: 1111 = F, @@ -956,7 +955,7 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) Op: 1111 = F, H-1, lower address-0 = 800 - They can be ordered either way, but the arm tools I've seen always put + They can be ordered either way, but the arm tools I've seen always put the lower one first. It probably doesn't matter. krk@cygnus.com XXX: Actually the order does matter. The second instruction (H-1) @@ -976,7 +975,6 @@ insert_thumb_branch (br_insn, rel_off) unsigned int low_bits; unsigned int high_bits; - BFD_ASSERT((rel_off & 1) != 1); rel_off >>= 1; /* half word aligned address */ @@ -988,13 +986,12 @@ insert_thumb_branch (br_insn, rel_off) else if ((br_insn & HI_LOW_ORDER) == HI_LOW_ORDER) br_insn = HI_LOW_ORDER | (high_bits << 16) | low_bits; else - abort(); /* error - not a valid branch instruction form */ + abort (); /* error - not a valid branch instruction form */ /* FIXME: abort is probably not the right call. krk@cygnus.com */ return br_insn; } - static struct coff_link_hash_entry * find_thumb_glue (info, name, input_bfd) @@ -1011,15 +1008,15 @@ find_thumb_glue (info, name, input_bfd) BFD_ASSERT (tmp_name); sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); - + myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); - + if (myh == NULL) /* xgettext:c-format */ _bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"), bfd_get_filename (input_bfd), tmp_name, name); - + free (tmp_name); return myh; @@ -1040,7 +1037,7 @@ find_arm_glue (info, name, input_bfd) BFD_ASSERT (tmp_name); sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); - + myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); @@ -1048,7 +1045,7 @@ find_arm_glue (info, name, input_bfd) /* xgettext:c-format */ _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"), bfd_get_filename (input_bfd), tmp_name, name); - + free (tmp_name); return myh; @@ -1085,7 +1082,7 @@ static const insn32 a2t3_func_addr_insn = 0x00000001; ldmia r13! {r6, lr} bx lr __func_addr: - .word func + .word func */ #define THUMB2ARM_GLUE_SIZE (globals->support_old_code ? 20 : 8) @@ -1128,10 +1125,10 @@ static const insn32 t2a6_bx_insn = 0xe12fff1e; instruction we should generate a trampoline stub (needed to address the complete 32bit address space). */ -/* The standard COFF backend linker does not cope with the special +/* The standard COFF backend linker does not cope with the special Thumb BRANCH23 relocation. The alternative would be to split the BRANCH23 into seperate HI23 and LO23 relocations. However, it is a - bit simpler simply providing our own relocation driver. */ + bit simpler simply providing our own relocation driver. */ /* The reloc processing routine for the ARM/Thumb COFF linker. NOTE: This code is a very slightly modified copy of @@ -1179,7 +1176,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, sym = NULL; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -1194,7 +1191,6 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, else addend = 0; - howto = coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, &addend); if (howto == NULL) @@ -1212,7 +1208,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_defweak) && h->root.u.def.section->output_section == input_section->output_section) { - static reloc_howto_type fake_arm26_reloc = + static reloc_howto_type fake_arm26_reloc = HOWTO (ARM_26, 2, 2, @@ -1224,7 +1220,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, "ARM_26", false, 0x00ffffff, - 0x00ffffff, + 0x00ffffff, false); addend -= rel->r_vaddr - input_section->vma; @@ -1233,11 +1229,11 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, #ifdef ARM_WINCE /* MS ARM-CE makes the reloc relative to the opcode's pc, not - the next opcode's pc, so is off by one. */ + the next opcode's pc, so is off by one. */ if (howto->pc_relative && !info->relocateable) addend -= 8; #endif - + /* If we are doing a relocateable link, then we can just ignore a PC relative reloc that is pcrel_offset. It will already have the correct value. If this is not a relocateable link, @@ -1246,8 +1242,15 @@ 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. */ if (sym != NULL && sym->n_scnum != 0) addend += sym->n_value; +#endif } val = 0; @@ -1277,14 +1280,14 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, relocatable output file, since we may as well leave the stub generation to the final linker pass. If we fail to verify that the name is defined, we'll try to build stubs - for an undefined name... */ + for an undefined name... */ if (! info->relocateable && ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak)) { asection * h_sec = h->root.u.def.section; const char * name = h->root.root.string; - + /* h locates the symbol referenced in the reloc. */ h_val = (h->root.u.def.value + h_sec->output_section->vma @@ -1300,9 +1303,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, long int my_offset; asection * s; long int ret_offset; - struct coff_link_hash_entry * myh; + struct coff_link_hash_entry * myh; struct coff_arm_link_hash_table * globals; - + myh = find_arm_glue (info, name, input_bfd); if (myh == NULL) return false; @@ -1311,10 +1314,10 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + my_offset = myh->root.u.def.value; - - s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME); BFD_ASSERT (s != NULL); BFD_ASSERT (s->contents != NULL); @@ -1341,16 +1344,16 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (output_bfd, a2t1_ldr_insn, s->contents + my_offset); - + bfd_put_32 (output_bfd, a2t2_bx_r12_insn, s->contents + my_offset + 4); - + /* It's a thumb address. Add the low order bit. */ bfd_put_32 (output_bfd, h_val | a2t3_func_addr_insn, s->contents + my_offset + 8); if (info->base_file) - arm_emit_base_file_entry (info, output_bfd, s, + arm_emit_base_file_entry (info, output_bfd, s, my_offset + 8); } @@ -1359,32 +1362,32 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, tmp = bfd_get_32 (input_bfd, contents + rel->r_vaddr - input_section->vma); - + tmp = tmp & 0xFF000000; - /* Somehow these are both 4 too far, so subtract 8. */ + /* Somehow these are both 4 too far, so subtract 8. */ ret_offset = s->output_offset - + my_offset + + my_offset + s->output_section->vma - (input_section->output_offset - + input_section->output_section->vma + + input_section->output_section->vma + rel->r_vaddr) - 8; tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF); - + bfd_put_32 (output_bfd, tmp, contents + rel->r_vaddr - input_section->vma); done = 1; } } - + #ifndef ARM_WINCE /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12 */ else if (howto->type == ARM_THUMB23) { - if ( h->class == C_EXT + if ( h->class == C_EXT || h->class == C_STAT || h->class == C_LABEL) { @@ -1401,19 +1404,19 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, return false; globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + my_offset = myh->root.u.def.value; - - s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME); - + BFD_ASSERT (s != NULL); BFD_ASSERT (s->contents != NULL); BFD_ASSERT (s->output_section != NULL); - + if ((my_offset & 0x01) == 0x01) { if (h_sec->owner != NULL @@ -1432,7 +1435,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, _bfd_error_handler (_(" consider relinking with --support-old-code enabled")); } - + -- my_offset; myh->root.u.def.value = my_offset; @@ -1440,7 +1443,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { bfd_put_16 (output_bfd, t2a1_push_insn, s->contents + my_offset); - + bfd_put_16 (output_bfd, t2a2_ldr_insn, s->contents + my_offset + 2); @@ -1449,13 +1452,13 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_16 (output_bfd, t2a4_bx_insn, s->contents + my_offset + 6); - + bfd_put_32 (output_bfd, t2a5_pop_insn, s->contents + my_offset + 8); - + bfd_put_32 (output_bfd, t2a6_bx_insn, s->contents + my_offset + 12); - + /* Store the address of the function in the last word of the stub. */ bfd_put_32 (output_bfd, h_val, s->contents + my_offset + 16); @@ -1467,10 +1470,10 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { bfd_put_16 (output_bfd, t2a1_bx_pc_insn, s->contents + my_offset); - + bfd_put_16 (output_bfd, t2a2_noop_insn, s->contents + my_offset + 2); - + ret_offset = ((bfd_signed_vma) h_val) /* Address of destination of the stub */ - ((bfd_signed_vma) @@ -1479,7 +1482,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, + s->output_section->vma) /* Address of the start of the current section. */ + 4 /* The branch instruction is 4 bytes into the stub. */ + 8); /* ARM branches work from the pc of the instruction + 8. */ - + bfd_put_32 (output_bfd, t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), s->contents + my_offset + 4); @@ -1497,7 +1500,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, - (input_section->output_offset + rel->r_vaddr) -4; - + tmp = bfd_get_32 (input_bfd, contents + rel->r_vaddr - input_section->vma); @@ -1505,20 +1508,20 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, insert_thumb_branch (tmp, ret_offset), contents + rel->r_vaddr - input_section->vma); - + done = 1; } } #endif } - + /* If the relocation type and destination symbol does not fall into one of the above categories, then we can just - perform a direct link. */ + perform a direct link. */ if (done) rstat = bfd_reloc_ok; - else + else #endif /* THUMBEXTENSION */ if ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) @@ -1542,11 +1545,11 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if (info->base_file) { - /* Emit a reloc if the backend thinks it needs it. */ + /* Emit a reloc if the backend thinks it needs it. */ if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto)) arm_emit_base_file_entry (info, output_bfd, input_section, rel->r_vaddr); } - + #if 1 /* THUMBEXTENSION */ if (done) rstat = bfd_reloc_ok; @@ -1562,9 +1565,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, instruction. Again, it would probably be simpler adding a ThumbBRANCH23 specific macro expansion into the default code. */ - + bfd_vma address = rel->r_vaddr - input_section->vma; - + if (address > input_section->_raw_size) rstat = bfd_reloc_outofrange; else @@ -1583,21 +1586,21 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_signed_vma signed_add; BFD_ASSERT (size == 4); - + /* 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 */ relocation -= address; - - /* No need to negate the relocation with BRANCH23. */ + + /* 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. */ - + check = relocation >> howto->rightshift; - + /* If this is a signed value, the rightshift just dropped leading 1 bits (assuming twos complement). */ if ((bfd_signed_vma) relocation >= 0) @@ -1606,7 +1609,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, signed_check = (check | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->rightshift))); - + /* Get the value from the object file. */ if (bfd_big_endian (input_bfd)) { @@ -1625,16 +1628,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; - + /* 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; @@ -1644,9 +1647,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if ( signed_check > reloc_signed_max || signed_check < reloc_signed_min) overflow = true; - + /* Put RELOCATION into the correct bits: */ - + if (bfd_big_endian (input_bfd)) { relocation = (((relocation & 0xffe) >> 1) | ((relocation << 4) & 0x07ff0000)); @@ -1655,7 +1658,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { relocation = (((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff)); } - + /* Add RELOCATION to the correct bits of X: */ x = ((x & ~howto->dst_mask) | relocation); @@ -1673,7 +1676,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, rel->r_vaddr - input_section->vma, val, addend); #if 1 /* THUMBEXTENSION */ - /* FIXME: + /* FIXME: Is this the best way to fix up thumb addresses? krk@cygnus.com Probably not, but it works, and if it works it don't need fixing! nickc@cygnus.com */ /* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */ @@ -1682,9 +1685,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { /* Determine if we need to set the bottom bit of a relocated address because the address is the address of a Thumb code symbol. */ - + int patchit = false; - + if (h != NULL && ( h->class == C_THUMBSTATFUNC || h->class == C_THUMBEXTFUNC)) @@ -1709,8 +1712,8 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (input_bfd, x | 1, location); } } -#endif /* THUMBEXTENSION */ - +#endif /* THUMBEXTENSION */ + switch (rstat) { default: @@ -1754,7 +1757,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, #ifndef COFF_IMAGE_WITH_PE boolean -bfd_arm_allocate_interworking_sections (info) +bfd_arm_allocate_interworking_sections (info) struct bfd_link_info * info; { asection * s; @@ -1765,24 +1768,24 @@ bfd_arm_allocate_interworking_sections (info) #endif globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); if (globals->arm_glue_size != 0) { BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME); BFD_ASSERT (s != NULL); - + foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner, globals->arm_glue_size); #if 0 memset (foo, test_char, globals->arm_glue_size); #endif - + s->_raw_size = s->_cooked_size = globals->arm_glue_size; s->contents = foo; } @@ -1790,18 +1793,18 @@ bfd_arm_allocate_interworking_sections (info) if (globals->thumb_glue_size != 0) { BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME); BFD_ASSERT (s != NULL); - + foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner, globals->thumb_glue_size); #if 0 memset (foo, test_char, globals->thumb_glue_size); #endif - + s->_raw_size = s->_cooked_size = globals->thumb_glue_size; s->contents = foo; } @@ -1836,10 +1839,10 @@ record_arm_to_thumb_glue (info, h) BFD_ASSERT (tmp_name); sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); - + myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); - + if (myh != NULL) { free (tmp_name); @@ -1851,13 +1854,13 @@ record_arm_to_thumb_glue (info, h) it. */ bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, + BSF_GLOBAL, s, globals->arm_glue_size + 1, - NULL, true, false, + NULL, true, false, (struct bfd_link_hash_entry **) & myh); - + free (tmp_name); - + globals->arm_glue_size += ARM2THUMB_GLUE_SIZE; return; @@ -1874,9 +1877,8 @@ record_thumb_to_arm_glue (info, h) struct coff_link_hash_entry * myh; struct coff_arm_link_hash_table * globals; - globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); @@ -1893,7 +1895,7 @@ record_thumb_to_arm_glue (info, h) myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); - + if (myh != NULL) { free (tmp_name); @@ -1902,35 +1904,35 @@ record_thumb_to_arm_glue (info, h) bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, BSF_GLOBAL, s, globals->thumb_glue_size + 1, - NULL, true, false, + NULL, true, false, (struct bfd_link_hash_entry **) & myh); - + /* If we mark it 'thumb', the disassembler will do a better job. */ myh->class = C_THUMBEXTFUNC; free (tmp_name); /* Allocate another symbol to mark where we switch to arm mode. */ - + #define CHANGE_TO_ARM "__%s_change_to_arm" #define BACK_FROM_ARM "__%s_back_from_arm" - + tmp_name = (char *) bfd_malloc (strlen (name) + strlen (CHANGE_TO_ARM) + 1); - + BFD_ASSERT (tmp_name); - + sprintf (tmp_name, globals->support_old_code ? BACK_FROM_ARM : CHANGE_TO_ARM, name); myh = NULL; - + bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, BSF_LOCAL, s, globals->thumb_glue_size + (globals->support_old_code ? 8 : 4), - NULL, true, false, + NULL, true, false, (struct bfd_link_hash_entry **) & myh); - free (tmp_name); - + free (tmp_name); + globals->thumb_glue_size += THUMB2ARM_GLUE_SIZE; return; @@ -1948,27 +1950,27 @@ bfd_arm_get_bfd_for_interworking (abfd, info) struct coff_arm_link_hash_table * globals; flagword flags; asection * sec; - + /* If we are only performing a partial link do not bother getting a bfd to hold the glue. */ if (info->relocateable) return true; - + globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); if (globals->bfd_of_glue_owner != NULL) return true; - + sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME); - - if (sec == NULL) + + if (sec == NULL) { flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - + sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME); - + if (sec == NULL || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) @@ -1977,21 +1979,21 @@ bfd_arm_get_bfd_for_interworking (abfd, info) sec = bfd_get_section_by_name (abfd, THUMB2ARM_GLUE_SECTION_NAME); - if (sec == NULL) + if (sec == NULL) { flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - + sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME); - + if (sec == NULL || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) return false; } - + /* Save the bfd for later use. */ globals->bfd_of_glue_owner = abfd; - + return true; } @@ -2008,19 +2010,19 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) to construct any glue. */ if (info->relocateable) return true; - + /* Here we have a bfd that is to be included on the link. We have a hook to do reloc rummaging, before section sizes are nailed down. */ _bfd_coff_get_external_symbols (abfd); globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); globals->support_old_code = support_old_code; - + /* Rummage around all the relocs and map the glue vectors. */ sec = abfd->sections; @@ -2032,17 +2034,17 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) struct internal_reloc * i; struct internal_reloc * rel; - if (sec->reloc_count == 0) + if (sec->reloc_count == 0) continue; /* Load the relocs. */ - /* FIXME: there may be a storage leak here. */ - + /* FIXME: there may be a storage leak here. */ + i = _bfd_coff_read_internal_relocs (abfd, sec, 1, 0, 0, 0); - + BFD_ASSERT (i != 0); - for (rel = i; rel < i + sec->reloc_count; ++rel) + for (rel = i; rel < i + sec->reloc_count; ++rel) { unsigned short r_type = rel->r_type; long symndx; @@ -2050,7 +2052,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) symndx = rel->r_symndx; - /* If the relocation is not against a symbol it cannot concern us. */ + /* If the relocation is not against a symbol it cannot concern us. */ if (symndx == -1) continue; @@ -2061,7 +2063,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) bfd_get_filename (abfd), symndx); continue; } - + h = obj_coff_sym_hashes (abfd)[symndx]; /* If the relocation is against a static symbol it must be within @@ -2075,11 +2077,11 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) /* This one is a call from arm code. We need to look up the target of the call. If it is a thumb target, we insert glue. */ - + if (h->class == C_THUMBEXTFUNC) record_arm_to_thumb_glue (info, h); break; - + #ifndef ARM_WINCE case ARM_THUMB23: /* This one is a call from thumb code. We used to look @@ -2102,7 +2104,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) } break; #endif - + default: break; } @@ -2126,7 +2128,6 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) #define coff_bfd_copy_private_bfd_data coff_arm_copy_private_bfd_data #define coff_bfd_link_hash_table_create coff_arm_link_hash_table_create - /* When doing a relocateable link, we want to convert ARM26 relocs into ARM26D relocs. */ @@ -2194,7 +2195,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) bfd_set_error (bfd_error_wrong_format); return false; } - + if (APCS_FLOAT_FLAG (obfd) != APCS_FLOAT_FLAG (ibfd)) { const char *msg; @@ -2205,14 +2206,14 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) else /* xgettext: c-format */ msg = _("%s: ERROR: passes floats in integer registers whereas target %s uses float registers"); - + _bfd_error_handler (msg, bfd_get_filename (ibfd), bfd_get_filename (obfd)); bfd_set_error (bfd_error_wrong_format); return false; } - + if (PIC_FLAG (obfd) != PIC_FLAG (ibfd)) { const char * msg; @@ -2233,7 +2234,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) else { SET_APCS_FLAGS (obfd, APCS_26_FLAG (ibfd) | APCS_FLOAT_FLAG (ibfd) | PIC_FLAG (ibfd)); - + /* Set up the arch and fields as well as these are probably wrong. */ bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); } @@ -2255,7 +2256,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) else /* xgettext: c-format */ msg = _("Warning: input file %s does not support interworking, whereas %s does."); - + _bfd_error_handler (msg, bfd_get_filename (ibfd), bfd_get_filename (obfd)); } @@ -2269,7 +2270,6 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) return true; } - /* Display the flags field. */ static boolean @@ -2278,12 +2278,12 @@ coff_arm_print_private_bfd_data (abfd, ptr) PTR ptr; { FILE * file = (FILE *) ptr; - + BFD_ASSERT (abfd != NULL && ptr != NULL); - + /* xgettext:c-format */ fprintf (file, _("private flags = %x:"), coff_data (abfd)->flags); - + if (APCS_SET (abfd)) { /* xgettext: APCS is ARM Prodecure Call Standard, it should not be translated. */ @@ -2299,20 +2299,19 @@ coff_arm_print_private_bfd_data (abfd, ptr) else fprintf (file, _(" [absolute position]")); } - + if (! INTERWORK_SET (abfd)) fprintf (file, _(" [interworking flag not initialised]")); else if (INTERWORK_FLAG (abfd)) fprintf (file, _(" [interworking supported]")); else fprintf (file, _(" [interworking not supported]")); - + fputc ('\n', file); - + return true; } - /* Copies the given flags into the coff_tdata.flags field. Typically these flags come from the f_flags[] field of the COFF filehdr structure, which contains important, @@ -2330,7 +2329,7 @@ _bfd_coff_arm_set_private_flags (abfd, flags) BFD_ASSERT (abfd != NULL); flag = (flags & F_APCS26) ? F_APCS_26 : 0; - + /* Make sure that the APCS field has not been initialised to the opposite value. */ if (APCS_SET (abfd) @@ -2341,11 +2340,11 @@ _bfd_coff_arm_set_private_flags (abfd, flags) return false; flag |= (flags & (F_APCS_FLOAT | F_PIC)); - + SET_APCS_FLAGS (abfd, flag); flag = (flags & F_INTERWORK); - + /* If the BFD has already had its interworking flag set, but it is different from the value that we have been asked to set, then assume that that merged code will not support interworking @@ -2368,7 +2367,6 @@ _bfd_coff_arm_set_private_flags (abfd, flags) return true; } - /* Copy the important parts of the target specific data from one instance of a BFD to another. */ @@ -2378,7 +2376,7 @@ coff_arm_copy_private_bfd_data (src, dest) bfd * dest; { BFD_ASSERT (src != NULL && dest != NULL); - + if (src == dest) return true; @@ -2395,10 +2393,10 @@ coff_arm_copy_private_bfd_data (src, dest) /* If the src and dest have different APCS flag bits set, fail. */ if (APCS_26_FLAG (dest) != APCS_26_FLAG (src)) return false; - + if (APCS_FLOAT_FLAG (dest) != APCS_FLOAT_FLAG (src)) return false; - + if (PIC_FLAG (dest) != PIC_FLAG (src)) return false; } @@ -2422,7 +2420,7 @@ coff_arm_copy_private_bfd_data (src, dest) bfd_get_filename (dest), bfd_get_filename (src)); } - + SET_INTERWORK_FLAG (dest, 0); } } @@ -2436,8 +2434,8 @@ coff_arm_copy_private_bfd_data (src, dest) } /* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX - *must* match the definitions in gcc/config/arm/coff.h and semi.h */ -#define LOCAL_LABEL_PREFIX "." + *must* match the definitions in gcc/config/arm/{coff|semi|aout}.h. */ +#define LOCAL_LABEL_PREFIX "" #ifndef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" #endif @@ -2462,28 +2460,28 @@ coff_arm_is_local_label_name (abfd, name) #ifdef LOCAL_LABEL_PREFIX /* If there is a prefix for local labels then look for this. - If the prefix exists, but it is empty, then ignore the test. */ - + If the prefix exists, but it is empty, then ignore the test. */ + if (LOCAL_LABEL_PREFIX[0] != 0) { int len = strlen (LOCAL_LABEL_PREFIX); - + if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0) return false; - + /* Perform the checks below for the rest of the name. */ name += len; } #endif - + return name[0] == 'L'; } /* This piece of machinery exists only to guarantee that the bfd that holds - the glue section is written last. + the glue section is written last. This does depend on bfd_make_section attaching a new section to the - end of the section list for the bfd. + end of the section list for the bfd. krk@cygnus.com */ @@ -2504,17 +2502,17 @@ coff_arm_final_link_postscript (abfd, pfinfo) struct coff_arm_link_hash_table * globals; globals = coff_arm_hash_table (pfinfo->info); - + BFD_ASSERT (globals != NULL); - + if (globals->bfd_of_glue_owner != NULL) { if (! _bfd_coff_link_input_bfd (pfinfo, globals->bfd_of_glue_owner)) return false; - + globals->bfd_of_glue_owner->output_has_begun = true; } - + return true; } @@ -2537,11 +2535,13 @@ coff_arm_final_link_postscript (abfd, pfinfo) #define TARGET_UNDERSCORE 0 #endif +#ifndef EXTRA_S_FLAGS #ifdef COFF_WITH_PE #define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES) #else #define EXTRA_S_FLAGS 0 #endif +#endif /* Forward declaration for use initialising alternative_target field. */ extern const bfd_target TARGET_BIG_SYM ; @@ -2549,4 +2549,3 @@ extern const bfd_target TARGET_BIG_SYM ; /* Target vectors. */ CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM) CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM) - diff --git a/contrib/binutils/bfd/coff-aux.c b/contrib/binutils/bfd/coff-aux.c index 6966392..5bc9b8b 100644 --- a/contrib/binutils/bfd/coff-aux.c +++ b/contrib/binutils/bfd/coff-aux.c @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 4k pages */ #define COFF_PAGE_SIZE 0x1000 -/* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library. */ +/* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library. */ #define BSS_NOLOAD_IS_SHARED_LIBRARY #define STATIC_RELOCS @@ -41,8 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" static boolean coff_m68k_aux_link_add_one_symbol - PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, boolean, boolean, + PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, + asection *, bfd_vma, const char *, boolean, boolean, struct bfd_link_hash_entry **)); #define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol @@ -54,7 +54,7 @@ static boolean coff_m68k_aux_link_add_one_symbol mirrors Apple's "solution" to let a static library symbol override a shared library symbol. On the whole not a good thing, given how shared libraries work here, but can work if you are careful with - what you include in the shared object. */ + what you include in the shared object. */ static boolean coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, diff --git a/contrib/binutils/bfd/coff-i386.c b/contrib/binutils/bfd/coff-i386.c index 84d4d14..83d67c4 100644 --- a/contrib/binutils/bfd/coff-i386.c +++ b/contrib/binutils/bfd/coff-i386.c @@ -73,8 +73,10 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { symvalue diff; +#ifndef COFF_WITH_PE if (output_bfd == (bfd *) NULL) return bfd_reloc_continue; +#endif if (bfd_is_com_section (symbol->section)) { @@ -102,7 +104,26 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, ignores the addend for a COFF target when producing relocateable output. This seems to be always wrong for 386 COFF, so we handle the addend here instead. */ - diff = reloc_entry->addend; +#ifdef COFF_WITH_PE + if (output_bfd == (bfd *) NULL) + { + reloc_howto_type *howto = reloc_entry->howto; + + /* Although PC relative relocations are very similar between + PE and non-PE formats, but they are off by 1 << howto->size + bytes. For the external relocation, PE is very different + from others. See md_apply_fix3 () in gas/config/tc-i386.c. + When we link PE and non-PE object files together to + generate a non-PE executable, we have to compensate it + here. */ + if (howto->pc_relative == true && howto->pcrel_offset == true) + diff = -(1 << howto->size); + else + diff = -reloc_entry->addend; + } + else +#endif + diff = reloc_entry->addend; } #ifdef COFF_WITH_PE @@ -155,19 +176,17 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, } #ifdef COFF_WITH_PE - /* Return true if this relocation should appear in the output .reloc section. */ static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); static boolean in_reloc_p (abfd, howto) - bfd *abfd ATTRIBUTE_UNUSED; + bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { return ! howto->pc_relative && howto->type != R_IMAGEBASE; } - #endif /* COFF_WITH_PE */ #ifndef PCRELOFFSET @@ -575,7 +594,7 @@ const bfd_target bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ -/* Note that we allow an object file to be treated as a core file as well. */ +/* Note that we allow an object file to be treated as a core file as well. */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, coff_object_p}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ diff --git a/contrib/binutils/bfd/coff-ppc.c b/contrib/binutils/bfd/coff-ppc.c index c5e695d..798399d 100644 --- a/contrib/binutils/bfd/coff-ppc.c +++ b/contrib/binutils/bfd/coff-ppc.c @@ -5,7 +5,7 @@ Original version pieced together by Kim Knuttila (krk@cygnus.com) There is nothing new under the sun. This file draws a lot on other - coff files, in particular, those for the rs/6000, alpha, mips, and + coff files, in particular, those for the rs/6000, alpha, mips, and intel backends, and the PE work for the arm. This file is part of BFD, the Binary File Descriptor library. @@ -29,11 +29,10 @@ Boston, MA 02111-1307, USA. */ - objdump works - relocs generated by gas - ld will link files, but they do not run. - - dlltool will not produce correct output in some .reloc cases, and will + - dlltool will not produce correct output in some .reloc cases, and will not produce the right glue code for dll function calls. */ - #include "bfd.h" #include "sysdep.h" @@ -75,7 +74,6 @@ extern void dump_toc PARAMS ((PTR)); #define MARK_AS_WRITTEN(x) ((x) |= 1) #define MAKE_ADDR_AGAIN(x) ((x) &= ~1) - /* Turn on this check if you suspect something amiss in the hash tables */ #ifdef DEBUG_HASH @@ -87,13 +85,12 @@ extern void dump_toc PARAMS ((PTR)); #define HASH_CHECK(addr) \ if (strcmp(addr->eye_catcher, EYE) != 0) \ { \ - fprintf(stderr,\ + fprintf (stderr,\ _("File %s, line %d, Hash check failure, bad eye %8s\n"), \ __FILE__, __LINE__, addr->eye_catcher); \ - abort(); \ + abort (); \ } - #else #define HASH_CHECK_DCL @@ -105,7 +102,7 @@ extern void dump_toc PARAMS ((PTR)); /* In order not to add an int to every hash table item for every coff linker, we define our own hash table, derived from the coff one */ -/* PE linker hash table entries. */ +/* PE linker hash table entries. */ struct ppc_coff_link_hash_entry { @@ -120,7 +117,6 @@ struct ppc_coff_link_hash_entry HASH_CHECK_DCL }; - /* PE linker hash table. */ struct ppc_coff_link_hash_table @@ -154,14 +150,14 @@ ppc_coff_link_hash_newfunc (entry, table, string) struct bfd_hash_table *table; const char *string; { - struct ppc_coff_link_hash_entry *ret = + struct ppc_coff_link_hash_entry *ret = (struct ppc_coff_link_hash_entry *) entry; /* Allocate the structure if it has not already been allocated by a subclass. */ if (ret == (struct ppc_coff_link_hash_entry *) NULL) ret = (struct ppc_coff_link_hash_entry *) - bfd_hash_allocate (table, + bfd_hash_allocate (table, sizeof (struct ppc_coff_link_hash_entry)); if (ret == (struct ppc_coff_link_hash_entry *) NULL) @@ -169,7 +165,7 @@ ppc_coff_link_hash_newfunc (entry, table, string) /* Call the allocation method of the superclass. */ ret = ((struct ppc_coff_link_hash_entry *) - _bfd_coff_link_hash_newfunc ((struct bfd_hash_entry *) ret, + _bfd_coff_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); if (ret) @@ -222,7 +218,6 @@ ppc_coff_link_hash_table_create (abfd) /* Now, tailor coffcode.h to use our hash stuff */ #define coff_bfd_link_hash_table_create ppc_coff_link_hash_table_create - /* The nt loader points the toc register to &toc + 32768, in order to */ /* use the complete range of a 16-bit displacement. We have to adjust */ @@ -238,7 +233,7 @@ ppc_coff_link_hash_table_create (abfd) from smaller values. Start with zero, widen, *then* decrement. */ #define MINUS_ONE (((bfd_vma)0) - 1) -/* these should definitely go in a header file somewhere... */ +/* these should definitely go in a header file somewhere... */ /* NOP */ #define IMAGE_REL_PPC_ABSOLUTE 0x0000 @@ -320,7 +315,6 @@ ppc_coff_link_hash_table_create (abfd) #define EXTRACT_FLAGS(x) ((x) & IMAGE_REL_PPC_FLAGMASK) #define EXTRACT_JUNK(x) \ ((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK)) - /* static helper functions to make relocation work */ /* (Work In Progress) */ @@ -348,7 +342,6 @@ static bfd_reloc_status_type ppc_pair_reloc PARAMS ((bfd *abfd, asection *section, bfd *output_bfd, char **error)); - static bfd_reloc_status_type ppc_toc16_reloc PARAMS ((bfd *abfd, arelent *reloc, @@ -391,10 +384,7 @@ static bfd_reloc_status_type ppc_imglue_reloc PARAMS ((bfd *abfd, bfd *output_bfd, char **error)); - - static boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto)); - /* FIXME: It'll take a while to get through all of these. I only need a few to get us started, so those I'll make sure work. Those marked FIXME are either @@ -418,7 +408,7 @@ static boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto)); /* the address of the SYM will be inserted at link time. */ /* TOCREL16 : 16 bit displacement field referring to a slot in */ /* toc. */ -/* TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. */ +/* TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. */ /* ADDR32NB : 32 bit address relative to the virtual origin. */ /* (On the alpha, this is always a linker generated thunk)*/ /* (i.e. 32bit addr relative to the image base) */ @@ -438,32 +428,32 @@ static reloc_howto_type ppc_coff_howto_table[] = { /* IMAGE_REL_PPC_ABSOLUTE 0x0000 NOP */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ABSOLUTE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ABSOLUTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* dont complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ABSOLUTE", /* name */ - false, /* partial_inplace */ - 0x00, /* src_mask */ - 0x00, /* dst_mask */ + false, /* partial_inplace */ + 0x00, /* src_mask */ + 0x00, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR64 0x0001 64-bit address */ /* Unused: */ - HOWTO(IMAGE_REL_PPC_ADDR64, /* type */ - 0, /* rightshift */ - 3, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO(IMAGE_REL_PPC_ADDR64, /* type */ + 0, /* rightshift */ + 3, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR64", /* name */ - true, /* partial_inplace */ + true, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ false), /* pcrel_offset */ @@ -471,314 +461,311 @@ static reloc_howto_type ppc_coff_howto_table[] = /* IMAGE_REL_PPC_ADDR32 0x0002 32-bit address */ /* Used: */ HOWTO (IMAGE_REL_PPC_ADDR32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR24 0x0003 26-bit address, shifted left 2 (branch absolute) */ /* the LI field is in bit 6 through bit 29 is 24 bits, + 2 for the shift */ /* Of course, That's the IBM approved bit numbering, which is not what */ - /* anyone else uses.... The li field is in bit 2 thru 25 */ + /* anyone else uses.... The li field is in bit 2 thru 25 */ /* Used: */ HOWTO (IMAGE_REL_PPC_ADDR24, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR24", /* name */ - true, /* partial_inplace */ - 0x07fffffc, /* src_mask */ - 0x07fffffc, /* dst_mask */ + true, /* partial_inplace */ + 0x07fffffc, /* src_mask */ + 0x07fffffc, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR16 0x0004 16-bit address */ /* Used: */ - HOWTO (IMAGE_REL_PPC_ADDR16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR14 0x0005 */ /* 16-bit address, shifted left 2 (load doubleword) */ /* FIXME: the mask is likely wrong, and the bit position may be as well */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_REL24 0x0006 */ /* 26-bit PC-relative offset, shifted left 2 (branch relative) */ /* Used: */ HOWTO (IMAGE_REL_PPC_REL24, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "REL24", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_REL14 0x0007 */ /* 16-bit PC-relative offset, shifted left 2 (br cond relative) */ /* FIXME: the mask is likely wrong, and the bit position may be as well */ /* FIXME: how does it know how far to shift? */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ true), /* pcrel_offset */ - + /* IMAGE_REL_PPC_TOCREL16 0x0008 */ /* 16-bit offset from TOC base */ /* Used: */ - HOWTO (IMAGE_REL_PPC_TOCREL16,/* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_TOCREL16,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - ppc_toc16_reloc, /* special_function */ + ppc_toc16_reloc, /* special_function */ "TOCREL16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_TOCREL14 0x0009 */ /* 16-bit offset from TOC base, shifted left 2 (load doubleword) */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_TOCREL14,/* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_TOCREL14,/* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "TOCREL14", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR32NB 0x000A */ /* 32-bit addr w/ image base */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ADDR32NB,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR32NB,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR32NB", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_SECREL 0x000B */ /* va of containing section (as in an image sectionhdr) */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_SECREL,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_SECREL,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_secrel_reloc, /* special_function */ + ppc_secrel_reloc, /* special_function */ "SECREL", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ /* IMAGE_REL_PPC_SECTION 0x000C */ /* sectionheader number */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_SECTION,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_SECTION,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_section_reloc, /* special_function */ + ppc_section_reloc, /* special_function */ "SECTION", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ /* IMAGE_REL_PPC_IFGLUE 0x000D */ /* substitute TOC restore instruction iff symbol is glue code */ /* Used: */ - HOWTO (IMAGE_REL_PPC_IFGLUE,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_IFGLUE,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "IFGLUE", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_IMGLUE 0x000E */ /* symbol is glue code; virtual address is TOC restore instruction */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_IMGLUE,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_IMGLUE,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - ppc_imglue_reloc, /* special_function */ + ppc_imglue_reloc, /* special_function */ "IMGLUE", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_SECREL16 0x000F */ /* va of containing section (limited to 16 bits) */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_SECREL16,/* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_SECREL16,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "SECREL16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ true), /* pcrel_offset */ /* IMAGE_REL_PPC_REFHI 0x0010 */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_REFHI, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_REFHI, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_refhi_reloc, /* special_function */ + ppc_refhi_reloc, /* special_function */ "REFHI", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_REFLO 0x0011 */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_REFLO, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_REFLO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_refhi_reloc, /* special_function */ + ppc_refhi_reloc, /* special_function */ "REFLO", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_PAIR 0x0012 */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_PAIR, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_PAIR, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_pair_reloc, /* special_function */ + ppc_pair_reloc, /* special_function */ "PAIR", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 */ /* 16-bit offset from TOC base, without causing a definition */ /* Used: */ - HOWTO ( (IMAGE_REL_PPC_TOCREL16 | IMAGE_REL_PPC_TOCDEFN), /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO ( (IMAGE_REL_PPC_TOCREL16 | IMAGE_REL_PPC_TOCDEFN), /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "TOCREL16, TOCDEFN", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ }; - - - /* Some really cheezy macros that can be turned on to test stderr :-) */ #ifdef DEBUG_RELOC @@ -788,19 +775,19 @@ static reloc_howto_type ppc_coff_howto_table[] = if (i == 0) \ { \ i = 1; \ - fprintf(stderr,_("Unimplemented Relocation -- %s\n"),x); \ + fprintf (stderr,_("Unimplemented Relocation -- %s\n"),x); \ } \ } #define DUMP_RELOC(n,r) \ { \ - fprintf(stderr,"%s sym %d, addr %d, addend %d\n", \ + fprintf (stderr,"%s sym %d, addr %d, addend %d\n", \ n, (*(r->sym_ptr_ptr))->name, \ r->address, r->addend); \ } -/* Given a reloc name, n, and a pointer to an internal_reloc, - dump out interesting information on the contents +/* Given a reloc name, n, and a pointer to an internal_reloc, + dump out interesting information on the contents #define n_name _n._n_name #define n_zeroes _n._n_n._n_zeroes @@ -810,7 +797,7 @@ static reloc_howto_type ppc_coff_howto_table[] = #define DUMP_RELOC2(n,r) \ { \ - fprintf(stderr,"%s sym %d, r_vaddr %d %s\n", \ + fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \ n, r->r_symndx, r->r_vaddr,\ (((r->r_type) & IMAGE_REL_PPC_TOCDEFN) == 0) \ ?" ":" TOCDEFN" ); \ @@ -821,8 +808,6 @@ static reloc_howto_type ppc_coff_howto_table[] = #define DUMP_RELOC(n,r) #define DUMP_RELOC2(n,r) #endif - - /* toc construction and management routines */ @@ -924,16 +909,16 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) HASH_CHECK(h); } - if (h == 0) - { + if (h == 0) + { local_syms = obj_coff_local_toc_table(abfd); if (local_syms == 0) { unsigned int i; /* allocate a table */ - local_syms = - (int *) bfd_zalloc (abfd, - obj_raw_syment_count(abfd) * sizeof(int)); + local_syms = + (int *) bfd_zalloc (abfd, + obj_raw_syment_count(abfd) * sizeof (int)); if (local_syms == 0) return false; obj_coff_local_toc_table(abfd) = local_syms; @@ -943,7 +928,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) } } - if (IS_UNALLOCATED(local_syms[sym])) + if (IS_UNALLOCATED(local_syms[sym])) { local_syms[sym] = global_toc_size; global_toc_size += 4; @@ -1002,20 +987,19 @@ ppc_mark_symbol_as_glue(abfd, sym, rel) #endif /* COFF_IMAGE_WITH_PE */ - /* Return true if this relocation should - appear in the output .reloc section. */ + appear in the output .reloc section. */ static boolean in_reloc_p(abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { - return - (! howto->pc_relative) + return + (! howto->pc_relative) && (howto->type != IMAGE_REL_PPC_ADDR32NB) && (howto->type != IMAGE_REL_PPC_TOCREL16) && (howto->type != IMAGE_REL_PPC_IMGLUE) - && (howto->type != IMAGE_REL_PPC_IFGLUE) + && (howto->type != IMAGE_REL_PPC_IFGLUE) && (howto->type != IMAGE_REL_PPC_SECREL) && (howto->type != IMAGE_REL_PPC_SECTION) && (howto->type != IMAGE_REL_PPC_SECREL16) @@ -1023,7 +1007,7 @@ static boolean in_reloc_p(abfd, howto) && (howto->type != IMAGE_REL_PPC_REFLO) && (howto->type != IMAGE_REL_PPC_PAIR) && (howto->type != IMAGE_REL_PPC_TOCREL16_DEFN) ; -} +} #if 0 @@ -1050,39 +1034,38 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, unsigned long sym_value; unsigned short r_type; unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/ - + r_type = reloc_entry->howto->type; - if (output_bfd) + if (output_bfd) { /* Partial linking - do nothing */ reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; + return bfd_reloc_ok; } if (symbol_in != NULL && bfd_is_und_section (symbol_in->section)) { /* Keep the state machine happy in case we're called again */ - if (r_type == IMAGE_REL_PPC_REFHI) + if (r_type == IMAGE_REL_PPC_REFHI) { part1_consth_active = true; part1_consth_value = 0; } return(bfd_reloc_undefined); } - - if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR)) + + if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR)) { part1_consth_active = false; *error_message = (char *) _("Missing PAIR"); return(bfd_reloc_dangerous); } - sym_value = get_symbol_value(symbol_in); - - return(bfd_reloc_ok); + + return(bfd_reloc_ok); } #endif /* 0 */ @@ -1108,13 +1091,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, asection *toc_section = 0; bfd_vma relocation; reloc_howto_type *howto = 0; - + /* If we are performing a relocateable link, we don't need to do a thing. The caller will take care of adjusting the reloc addresses and symbol indices. */ if (info->relocateable) return true; - + hihalf = false; hihalf_val = 0; @@ -1133,7 +1116,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, unsigned short r_type = EXTRACT_TYPE (rel->r_type); unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); - + symndx = rel->r_symndx; loc = contents + rel->r_vaddr - input_section->vma; @@ -1147,9 +1130,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } else { - h = (struct ppc_coff_link_hash_entry *) + h = (struct ppc_coff_link_hash_entry *) (obj_coff_sym_hashes (input_bfd)[symndx]); - if (h != 0) + if (h != 0) { HASH_CHECK(h); } @@ -1159,8 +1142,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (r_type == IMAGE_REL_PPC_IMGLUE && h == 0) { - /* An IMGLUE reloc must have a name. Something is very wrong. */ - abort(); + /* An IMGLUE reloc must have a name. Something is very wrong. */ + abort (); } sec = NULL; @@ -1203,7 +1186,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } rstat = bfd_reloc_ok; - + /* Each case must do its own relocation, setting rstat appropriately */ switch (r_type) { @@ -1220,19 +1203,19 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, DUMP_RELOC2(howto->name, rel); - if (toc_section == 0) + if (toc_section == 0) { - toc_section = bfd_get_section_by_name (bfd_of_toc_owner, + toc_section = bfd_get_section_by_name (bfd_of_toc_owner, TOC_SECTION_NAME); - if ( toc_section == NULL ) + if ( toc_section == NULL ) { - /* There is no toc section. Something is very wrong. */ - abort(); + /* There is no toc section. Something is very wrong. */ + abort (); } } - /* + /* * Amazing bit tricks present. As we may have seen earlier, we * use the 1 bit to tell us whether or not a toc offset has been * allocated. Now that they've all been allocated, we will use @@ -1253,7 +1236,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (IS_WRITTEN(our_toc_offset)) { - /* if it has been written out, it is marked with the + /* if it has been written out, it is marked with the 1 bit. Fix up our offset, but do not write it out again. */ @@ -1262,12 +1245,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, else { /* write out the toc entry */ - record_toc(toc_section, - our_toc_offset, - priv, + record_toc(toc_section, + our_toc_offset, + priv, strdup(name)); - bfd_put_32(output_bfd, + bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); @@ -1280,33 +1263,33 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, const char *name = h->root.root.root.string; our_toc_offset = h->toc_offset; - if ((r_flags & IMAGE_REL_PPC_TOCDEFN) + if ((r_flags & IMAGE_REL_PPC_TOCDEFN) == IMAGE_REL_PPC_TOCDEFN ) { - /* This is unbelievable cheese. Some knowledgable asm - hacker has decided to use r2 as a base for loading - a value. He/She does this by setting the tocdefn bit, - and not supplying a toc definition. The behaviour is - then to use the difference between the value of the - symbol and the actual location of the toc as the toc - index. + /* This is unbelievable cheese. Some knowledgable asm + hacker has decided to use r2 as a base for loading + a value. He/She does this by setting the tocdefn bit, + and not supplying a toc definition. The behaviour is + then to use the difference between the value of the + symbol and the actual location of the toc as the toc + index. In fact, what is usually happening is, because the Import Address Table is mapped immediately following the toc, some trippy library code trying for speed on - dll linkage, takes advantage of that and considers + dll linkage, takes advantage of that and considers the IAT to be part of the toc, thus saving a load. */ - our_toc_offset = val - - (toc_section->output_section->vma + + our_toc_offset = val - + (toc_section->output_section->vma + toc_section->output_offset); /* The size must still fit in a 16bit displacment */ if (our_toc_offset >= 65535) { (*_bfd_error_handler) - (_("%s: Relocation for %s of %x exceeds Toc size limit"), + (_("%s: Relocation for %s of %x exceeds Toc size limit"), bfd_get_filename (input_bfd), name, our_toc_offset); bfd_set_error (bfd_error_bad_value); return false; @@ -1316,7 +1299,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } else if (IS_WRITTEN(our_toc_offset)) { - /* if it has been written out, it is marked with the + /* if it has been written out, it is marked with the 1 bit. Fix up our offset, but do not write it out again. */ @@ -1327,7 +1310,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, record_toc(toc_section, our_toc_offset, pub, strdup(name)); /* write out the toc entry */ - bfd_put_32(output_bfd, + bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); @@ -1338,31 +1321,30 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } } - if (fixit && info->base_file) + if (fixit && info->base_file) { /* So if this is non pcrelative, and is referenced to a section or a common symbol, then it needs a reloc */ /* relocation to a symbol in a section which - isn't absolute - we output the address here + isn't absolute - we output the address here to a file */ bfd_vma addr = toc_section->output_section->vma + toc_section->output_offset + our_toc_offset; - + if (coff_data(output_bfd)->pe) addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; fwrite (&addr, 1,4, (FILE *) info->base_file); } - /* FIXME: this test is conservative */ if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN && our_toc_offset > toc_section->_raw_size) { (*_bfd_error_handler) - (_("%s: Relocation exceeds allocated TOC (%x)"), + (_("%s: Relocation exceeds allocated TOC (%x)"), bfd_get_filename (input_bfd), toc_section->_raw_size); bfd_set_error (bfd_error_bad_value); @@ -1372,18 +1354,18 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, /* Now we know the relocation for this toc reference */ relocation = our_toc_offset + TOC_LOAD_ADJUSTMENT; rstat = _bfd_relocate_contents (howto, - input_bfd, - relocation, + input_bfd, + relocation, loc); } break; case IMAGE_REL_PPC_IFGLUE: { /* To solve this, we need to know whether or not the symbol */ - /* appearing on the call instruction is a glue function or not. */ + /* appearing on the call instruction is a glue function or not. */ /* A glue function must announce itself via a IMGLUE reloc, and */ /* the reloc contains the required toc restore instruction */ - + bfd_vma x; const char *my_name; DUMP_RELOC2(howto->name, rel); @@ -1391,18 +1373,18 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (h != 0) { my_name = h->root.root.root.string; - if (h->symbol_is_glue == 1) + if (h->symbol_is_glue == 1) { - x = bfd_get_32(input_bfd, loc); - bfd_put_32(input_bfd, h->glue_insn, loc); + x = bfd_get_32 (input_bfd, loc); + bfd_put_32 (input_bfd, h->glue_insn, loc); } } } break; case IMAGE_REL_PPC_SECREL: /* Unimplemented: codeview debugging information */ - /* For fast access to the header of the section - containing the item. */ + /* For fast access to the header of the section + containing the item. */ break; case IMAGE_REL_PPC_SECTION: /* Unimplemented: codeview debugging information */ @@ -1420,15 +1402,15 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, my_name = h->root.root.root.string; } - fprintf(stderr, - _("Warning: unsupported reloc %s <file %s, section %s>\n"), + fprintf (stderr, + _("Warning: unsupported reloc %s <file %s, section %s>\n"), howto->name, bfd_get_filename(input_bfd), input_section->name); - fprintf(stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n", + fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n", rel->r_symndx, my_name, (long) rel->r_vaddr, - (unsigned long) rel->r_vaddr); + (unsigned long) rel->r_vaddr); } break; case IMAGE_REL_PPC_IMGLUE: @@ -1436,12 +1418,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, /* There is nothing to do now. This reloc was noted in the first pass over the relocs, and the glue instruction extracted */ const char *my_name; - if (h->symbol_is_glue == 1) + if (h->symbol_is_glue == 1) break; my_name = h->root.root.root.string; (*_bfd_error_handler) - (_("%s: Out of order IMGLUE reloc for %s"), + (_("%s: Out of order IMGLUE reloc for %s"), bfd_get_filename (input_bfd), my_name); bfd_set_error (bfd_error_bad_value); return false; @@ -1461,16 +1443,16 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", false, false, true); - first_thunk_address = myh->root.u.def.value + - sec->output_section->vma + - sec->output_offset - + first_thunk_address = myh->root.u.def.value + + sec->output_section->vma + + sec->output_offset - pe_data(output_bfd)->pe_opthdr.ImageBase; - + idata5offset = myh->root.u.def.value; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata6_magic__", false, false, true); - + thunk_size = myh->root.u.def.value - idata5offset; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata4_magic__", @@ -1502,13 +1484,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, myh = coff_link_hash_lookup (coff_hash_table (info), target, false, false, true); - if (myh == 0) + if (myh == 0) { - /* Missing magic cookies. Something is very wrong. */ - abort(); + /* Missing magic cookies. Something is very wrong. */ + abort (); } - - val = myh->root.u.def.value + + + val = myh->root.u.def.value + sec->output_section->vma + sec->output_offset; if (first_thunk_address == 0) { @@ -1516,16 +1498,16 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", false, false, true); - first_thunk_address = myh->root.u.def.value + - sec->output_section->vma + - sec->output_offset - + first_thunk_address = myh->root.u.def.value + + sec->output_section->vma + + sec->output_offset - pe_data(output_bfd)->pe_opthdr.ImageBase; - + idata5offset = myh->root.u.def.value; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata6_magic__", false, false, true); - + thunk_size = myh->root.u.def.value - idata5offset; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata4_magic__", @@ -1536,8 +1518,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } rstat = _bfd_relocate_contents (howto, - input_bfd, - val - + input_bfd, + val - pe_data(output_bfd)->pe_opthdr.ImageBase, loc); } @@ -1549,8 +1531,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, + input_section->output_offset); rstat = _bfd_relocate_contents (howto, - input_bfd, - val, + input_bfd, + val, loc); break; case IMAGE_REL_PPC_ADDR16: @@ -1558,8 +1540,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, case IMAGE_REL_PPC_ADDR32: DUMP_RELOC2(howto->name, rel); rstat = _bfd_relocate_contents (howto, - input_bfd, - val, + input_bfd, + val, loc); break; } @@ -1571,11 +1553,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto)) { /* relocation to a symbol in a section which - isn't absolute - we output the address here + isn't absolute - we output the address here to a file */ - bfd_vma addr = rel->r_vaddr - - input_section->vma - + input_section->output_offset + bfd_vma addr = rel->r_vaddr + - input_section->vma + + input_section->output_offset + input_section->output_section->vma; if (coff_data(output_bfd)->pe) @@ -1614,7 +1596,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, + (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) { @@ -1623,7 +1605,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } } - } + } return true; } @@ -1659,11 +1641,11 @@ dump_toc (vfile) FILE *file = (FILE *) vfile; struct list_ele *t; - fprintf(file, _(h1)); - fprintf(file, _(h2)); - fprintf(file, _(h3)); + fprintf (file, _(h1)); + fprintf (file, _(h2)); + fprintf (file, _(h3)); - for(t = head; t != 0; t=t->next) + for (t = head; t != 0; t=t->next) { const char *cat = ""; @@ -1680,26 +1662,26 @@ dump_toc (vfile) cat = _("IAT reference "); else { - fprintf(file, + fprintf (file, _("**** global_toc_size %ld(%lx), thunk_size %ld(%lx)\n"), global_toc_size, global_toc_size, thunk_size, thunk_size); cat = _("Out of bounds!"); } } - fprintf(file, + fprintf (file, " %04lx (%d)", (unsigned long) t->offset, t->offset - 32768); - fprintf(file, + fprintf (file, " %s %s\n", cat, t->name); } - fprintf(file, "\n"); + fprintf (file, "\n"); } boolean -ppc_allocate_toc_section (info) +ppc_allocate_toc_section (info) struct bfd_link_info *info ATTRIBUTE_UNUSED; { asection *s; @@ -1711,15 +1693,15 @@ ppc_allocate_toc_section (info) if (bfd_of_toc_owner == 0) { - /* No toc owner? Something is very wrong. */ - abort(); + /* No toc owner? Something is very wrong. */ + abort (); } s = bfd_get_section_by_name ( bfd_of_toc_owner , TOC_SECTION_NAME); - if (s == NULL) + if (s == NULL) { - /* No toc section? Something is very wrong. */ - abort(); + /* No toc section? Something is very wrong. */ + abort (); } foo = (bfd_byte *) bfd_alloc(bfd_of_toc_owner, global_toc_size); @@ -1740,7 +1722,7 @@ ppc_process_before_allocation (abfd, info) struct internal_reloc *i, *rel; /* here we have a bfd that is to be included on the link. We have a hook - to do reloc rummaging, before section sizes are nailed down. */ + to do reloc rummaging, before section sizes are nailed down. */ _bfd_coff_get_external_symbols(abfd); @@ -1754,17 +1736,17 @@ ppc_process_before_allocation (abfd, info) for (; sec != 0; sec = sec->next) { - if (sec->reloc_count == 0) + if (sec->reloc_count == 0) continue; /* load the relocs */ /* FIXME: there may be a storage leak here */ i=_bfd_coff_read_internal_relocs(abfd,sec,1,0,0,0); - + if (i == 0) - abort(); + abort (); - for (rel=i;rel<i+sec->reloc_count;++rel) + for (rel=i;rel<i+sec->reloc_count;++rel) { unsigned short r_type = EXTRACT_TYPE (rel->r_type); unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); @@ -1772,13 +1754,13 @@ ppc_process_before_allocation (abfd, info) DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel); - switch(r_type) + switch(r_type) { case IMAGE_REL_PPC_TOCREL16: /* if TOCDEFN is on, ignore as someone else has allocated the toc entry */ if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN ) - ok = ppc_record_toc_entry(abfd, info, sec, + ok = ppc_record_toc_entry(abfd, info, sec, rel->r_symndx, default_toc); if (!ok) return false; @@ -1797,7 +1779,6 @@ ppc_process_before_allocation (abfd, info) #endif - static bfd_reloc_status_type ppc_refhi_reloc (abfd, reloc_entry, @@ -1876,7 +1857,6 @@ ppc_pair_reloc (abfd, return bfd_reloc_undefined; } - static bfd_reloc_status_type ppc_toc16_reloc (abfd, @@ -2011,15 +1991,12 @@ ppc_imglue_reloc (abfd, return bfd_reloc_ok; } - - #define MAX_RELOC_INDEX \ - (sizeof(ppc_coff_howto_table) / sizeof(ppc_coff_howto_table[0]) - 1) - + (sizeof (ppc_coff_howto_table) / sizeof (ppc_coff_howto_table[0]) - 1) /* FIXME: There is a possiblity that when we read in a reloc from a file, - that there are some bits encoded in the upper portion of the + that there are some bits encoded in the upper portion of the type field. Not yet implemented. */ static void ppc_coff_rtype2howto PARAMS ((arelent *relent, @@ -2029,7 +2006,7 @@ static void ppc_coff_rtype2howto (relent, internal) arelent *relent; struct internal_reloc *internal; -{ +{ /* We can encode one of three things in the type field, aside from the type: @@ -2046,15 +2023,15 @@ ppc_coff_rtype2howto (relent, internal) unsigned short r_flags = EXTRACT_FLAGS(internal->r_type); unsigned short junk = EXTRACT_JUNK (internal->r_type); - /* the masking process only slices off the bottom byte for r_type. */ - if ( r_type > MAX_RELOC_INDEX ) - abort(); + /* the masking process only slices off the bottom byte for r_type. */ + if ( r_type > MAX_RELOC_INDEX ) + abort (); /* check for absolute crap */ if ( junk != 0 ) - abort(); + abort (); - switch(r_type) + switch(r_type) { case IMAGE_REL_PPC_ADDR16: case IMAGE_REL_PPC_REL24: @@ -2079,16 +2056,16 @@ ppc_coff_rtype2howto (relent, internal) howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16; break; default: - fprintf(stderr, + fprintf (stderr, _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"), ppc_coff_howto_table[r_type].name, r_type); - howto = ppc_coff_howto_table + r_type; + howto = ppc_coff_howto_table + r_type; break; } - + relent->howto = howto; - + } static reloc_howto_type * @@ -2117,15 +2094,15 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); unsigned short junk = EXTRACT_JUNK (rel->r_type); - /* the masking process only slices off the bottom byte for r_type. */ - if ( r_type > MAX_RELOC_INDEX ) - abort(); - + /* the masking process only slices off the bottom byte for r_type. */ + if ( r_type > MAX_RELOC_INDEX ) + abort (); + /* check for absolute crap */ if ( junk != 0 ) - abort(); - - switch(r_type) + abort (); + + switch(r_type) { case IMAGE_REL_PPC_ADDR32NB: DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel); @@ -2154,18 +2131,17 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) howto = ppc_coff_howto_table + r_type; break; default: - fprintf(stderr, + fprintf (stderr, _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"), ppc_coff_howto_table[r_type].name, r_type); howto = ppc_coff_howto_table + r_type; break; } - + return howto; } - /* a cheesy little macro to make the code a little more readable */ #define HOW2MAP(bfd_rtype,ppc_rtype) \ case bfd_rtype: return &ppc_coff_howto_table[ppc_rtype] @@ -2189,16 +2165,15 @@ ppc_coff_reloc_type_lookup (abfd, code) HOW2MAP(BFD_RELOC_16_GOTOFF, IMAGE_REL_PPC_TOCREL16_DEFN); HOW2MAP(BFD_RELOC_32, IMAGE_REL_PPC_ADDR32); HOW2MAP(BFD_RELOC_RVA, IMAGE_REL_PPC_ADDR32NB); - default: + default: return NULL; } /*NOTREACHED*/ } #undef HOW2MAP - -/* Tailor coffcode.h -- macro heaven. */ +/* Tailor coffcode.h -- macro heaven. */ #define RTYPE2HOWTO(cache_ptr, dst) ppc_coff_rtype2howto (cache_ptr, dst) @@ -2211,7 +2186,7 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); #define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup #define coff_rtype_to_howto coff_ppc_rtype_to_howto #define coff_relocate_section coff_ppc_relocate_section -#define coff_bfd_final_link ppc_bfd_coff_final_link +#define coff_bfd_final_link ppc_bfd_coff_final_link #ifndef COFF_IMAGE_WITH_PE /* FIXME: This no longer works. */ @@ -2242,12 +2217,10 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 1 } #include "coffcode.h" - - #ifndef COFF_IMAGE_WITH_PE /* FIXME: - What we're trying to do here is allocate a toc section (early), and attach + What we're trying to do here is allocate a toc section (early), and attach it to the last bfd to be processed. This avoids the problem of having a toc written out before all files have been processed. This code allocates a toc section for every file, and records the last one seen. There are @@ -2277,7 +2250,7 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) register asection *s; s = bfd_get_section_by_name ( abfd , TOC_SECTION_NAME); - if (s != NULL) + if (s != NULL) { return; } @@ -2291,7 +2264,7 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) || !bfd_set_section_alignment (abfd, s, 2)) { /* FIXME: set appropriate bfd error */ - abort(); + abort (); } /* save the bfd for later allocation */ @@ -2324,18 +2297,17 @@ ppc_get_last() } /* this piece of machinery exists only to guarantee that the bfd that holds - the toc section is written last. + the toc section is written last. This does depend on bfd_make_section attaching a new section to the - end of the section list for the bfd. + end of the section list for the bfd. - This is otherwise intended to be functionally the same as - cofflink.c:_bfd_coff_final_link(). It is specifically different only - where the POWERPC_LE_PE macro modifies the code. It is left in as a + This is otherwise intended to be functionally the same as + cofflink.c:_bfd_coff_final_link(). It is specifically different only + where the POWERPC_LE_PE macro modifies the code. It is left in as a precise form of comment. krk@cygnus.com */ - /* Do the final link step. */ boolean @@ -2840,13 +2812,12 @@ ppc_bfd_coff_final_link (abfd, info) } #endif - /* Forward declaration for use by alternative_target field. */ #ifdef TARGET_BIG_SYM extern const bfd_target TARGET_BIG_SYM; #endif -/* The transfer vectors that lead the outside world to all of the above. */ +/* The transfer vectors that lead the outside world to all of the above. */ #ifdef TARGET_LITTLE_SYM const bfd_target TARGET_LITTLE_SYM = @@ -2859,7 +2830,7 @@ const bfd_target TARGET_LITTLE_SYM = (HAS_RELOC | EXEC_P | /* FIXME: object flags */ HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - + #ifndef COFF_WITH_PE (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ #else @@ -2878,14 +2849,14 @@ const bfd_target TARGET_LITTLE_SYM = bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p }, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ bfd_false}, {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - + BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), BFD_JUMP_TABLE_CORE (_bfd_nocore), @@ -2902,7 +2873,7 @@ const bfd_target TARGET_LITTLE_SYM = #else NULL, #endif - + COFF_SWAP_TABLE }; #endif @@ -2911,7 +2882,7 @@ const bfd_target TARGET_LITTLE_SYM = const bfd_target TARGET_BIG_SYM = { TARGET_BIG_NAME, - bfd_target_coff_flavour, + bfd_target_coff_flavour, BFD_ENDIAN_BIG, /* data byte order is big */ BFD_ENDIAN_BIG, /* header byte order is big */ @@ -2955,14 +2926,13 @@ const bfd_target TARGET_BIG_SYM = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - /* Alternative_target. */ #ifdef TARGET_LITTLE_SYM & TARGET_LITTLE_SYM, #else NULL, #endif - + COFF_SWAP_TABLE }; diff --git a/contrib/binutils/bfd/coff-sparc.c b/contrib/binutils/bfd/coff-sparc.c index 5e919da..9367770 100644 --- a/contrib/binutils/bfd/coff-sparc.c +++ b/contrib/binutils/bfd/coff-sparc.c @@ -36,8 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ enum reloc_type { R_SPARC_NONE = 0, - R_SPARC_8, R_SPARC_16, R_SPARC_32, - R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32, + R_SPARC_8, R_SPARC_16, R_SPARC_32, + R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32, R_SPARC_WDISP30, R_SPARC_WDISP22, R_SPARC_HI22, R_SPARC_22, R_SPARC_13, R_SPARC_LO10, @@ -96,7 +96,7 @@ bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } -static reloc_howto_type coff_sparc_howto_table[] = +static reloc_howto_type coff_sparc_howto_table[] = { HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", false,0,0x000000ff,true), @@ -197,7 +197,7 @@ rtype2howto (cache_ptr, dst) #define __A_MAGIC_SET__ -/* Enable Sparc-specific hacks in coffcode.h. */ +/* Enable Sparc-specific hacks in coffcode.h. */ #define COFF_SPARC diff --git a/contrib/binutils/bfd/coff-tic30.c b/contrib/binutils/bfd/coff-tic30.c index a971f76..267ca97 100644 --- a/contrib/binutils/bfd/coff-tic30.c +++ b/contrib/binutils/bfd/coff-tic30.c @@ -49,7 +49,7 @@ reloc_howto_type tic30_coff_howto_table[] = /* For the case statement use the code values used in tc_gen_reloc to map to the howto table entries that match those in both the aout - and coff implementations. */ + and coff implementations. */ reloc_howto_type * tic30_coff_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; @@ -86,7 +86,6 @@ coff_tic30_select_reloc (howto) #define SELECT_RELOC(x,howto) x.r_type = coff_tic30_select_reloc(howto) - #define BADMAG(x) TIC30BADMAG(x) #define TIC30 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ @@ -97,7 +96,7 @@ coff_tic30_select_reloc (howto) #define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) dst->r_stuff[0] = 'S'; \ dst->r_stuff[1] = 'C'; -/* Code to turn a r_type into a howto ptr, uses the above howto table. */ +/* Code to turn a r_type into a howto ptr, uses the above howto table. */ static void rtype2howto (internal, dst) @@ -134,7 +133,6 @@ rtype2howto (internal, dst) #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) @@ -203,6 +201,6 @@ const bfd_target tic30_coff_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + COFF_SWAP_TABLE }; diff --git a/contrib/binutils/bfd/coff-z8k.c b/contrib/binutils/bfd/coff-z8k.c index 21f29a8..7ad0630 100644 --- a/contrib/binutils/bfd/coff-z8k.c +++ b/contrib/binutils/bfd/coff-z8k.c @@ -54,7 +54,7 @@ HOWTO (R_JR, 0, 1, 8, true, 0, complain_overflow_signed, 0, /* Turn a howto into a reloc number */ -static int +static int coff_z8k_select_reloc (howto) reloc_howto_type *howto; { @@ -63,13 +63,10 @@ coff_z8k_select_reloc (howto) #define SELECT_RELOC(x,howto) x.r_type = coff_z8k_select_reloc(howto) - #define BADMAG(x) Z8KBADMAG(x) #define Z8K 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ - - /* Code to swap in the reloc */ #define SWAP_IN_RELOC_OFFSET bfd_h_get_32 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32 @@ -110,18 +107,15 @@ rtype2howto (internal, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) - /* Perform any necessary magic to the addend in a reloc entry */ - #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) -static void +static void reloc_processing (relent, reloc, symbols, abfd, section) arelent * relent; struct internal_reloc *reloc; @@ -141,7 +135,6 @@ reloc_processing (relent, reloc, symbols, abfd, section) relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; } - relent->addend = reloc->r_offset; relent->address -= section->vma; } @@ -178,7 +171,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) case R_IMM4L: bfd_put_8 (in_abfd, - ((bfd_get_8 (in_abfd, data + *dst_ptr) & 0xf0) + ((bfd_get_8 (in_abfd, data + *dst_ptr) & 0xf0) | (0x0f & bfd_coff_reloc16_get_value (reloc, link_info, input_section))), @@ -230,7 +223,6 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) #include "coffcode.h" - #undef coff_bfd_get_relocated_section_contents #undef coff_bfd_relax_section #define coff_bfd_get_relocated_section_contents \ diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h index 73081a7..fce0491 100644 --- a/contrib/binutils/bfd/coffcode.h +++ b/contrib/binutils/bfd/coffcode.h @@ -175,7 +175,6 @@ SUBSUBSECTION the file in the string table. This pass moves all strings into memory and replaces them with pointers to the strings. - The symbol table is massaged once again, this time to create the canonical table used by the BFD application. Each symbol is inspected in turn, and a decision made (using the @@ -301,7 +300,6 @@ CODE_FRAGMENT .boolean done_lineno; .} coff_symbol_type; - */ #ifdef COFF_WITH_PE @@ -351,6 +349,19 @@ static PTR coff_mkobject_hook PARAMS ((bfd *, PTR, PTR)); #ifndef COFF_WITH_PE +/* Macros for setting debugging flags. */ +#ifdef STYP_DEBUG +#define STYP_XCOFF_DEBUG STYP_DEBUG +#else +#define STYP_XCOFF_DEBUG STYP_INFO +#endif + +#ifdef COFF_ALIGN_IN_S_FLAGS +#define STYP_DEBUG_INFO STYP_DSECT +#else +#define STYP_DEBUG_INFO STYP_INFO +#endif + static long sec_to_styp_flags (sec_name, sec_flags) CONST char *sec_name; @@ -388,18 +399,24 @@ sec_to_styp_flags (sec_name, sec_flags) styp_flags = STYP_LIT; #endif /* _LIT */ } - else if (!strcmp (sec_name, ".debug")) + else if (!strncmp (sec_name, ".debug", 6)) { -#ifdef STYP_DEBUG - styp_flags = STYP_DEBUG; -#else - styp_flags = STYP_INFO; -#endif + /* Handle the XCOFF debug section and DWARF2 debug sections. */ + if (!sec_name[6]) + styp_flags = STYP_XCOFF_DEBUG; + else + styp_flags = STYP_DEBUG_INFO; } else if (!strncmp (sec_name, ".stab", 5)) { - styp_flags = STYP_INFO; + styp_flags = STYP_DEBUG_INFO; + } +#ifdef COFF_LONG_SECTION_NAMES + else if (!strncmp (sec_name, ".gnu.linkonce.wi.", 17)) + { + styp_flags = STYP_DEBUG_INFO; } +#endif #ifdef RS6000COFF_C else if (!strcmp (sec_name, _PAD)) { @@ -436,6 +453,16 @@ sec_to_styp_flags (sec_name, sec_flags) styp_flags = STYP_BSS; } +#ifdef STYP_CLINK + if (sec_flags & SEC_CLINK) + styp_flags |= STYP_CLINK; +#endif + +#ifdef STYP_BLOCK + if (sec_flags & SEC_BLOCK) + styp_flags |= STYP_BLOCK; +#endif + #ifdef STYP_NOLOAD if ((sec_flags & (SEC_NEVER_LOAD | SEC_COFF_SHARED_LIBRARY)) != 0) styp_flags |= STYP_NOLOAD; @@ -493,8 +520,8 @@ sec_to_styp_flags (sec_name, sec_flags) styp_flags |= IMAGE_SCN_LNK_REMOVE; /* skip IN_MEMORY */ /* skip SORT */ - if (sec_flags & SEC_LINK_ONCE) - styp_flags |= IMAGE_SCN_LNK_COMDAT; + if (sec_flags & SEC_LINK_ONCE) + styp_flags |= IMAGE_SCN_LNK_COMDAT; /* skip LINK_DUPLICATES */ /* skip LINKER_CREATED */ @@ -502,7 +529,7 @@ sec_to_styp_flags (sec_name, sec_flags) though the semantics don't quite match. The bits from the input are retained in pei_section_data(abfd, section)->pe_flags */ - styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */ + styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */ if ((sec_flags & SEC_READONLY) == 0) styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write */ if (sec_flags & SEC_CODE) @@ -510,7 +537,7 @@ sec_to_styp_flags (sec_name, sec_flags) if (sec_flags & SEC_SHARED) styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful */ - return styp_flags; + return styp_flags; } #endif /* COFF_WITH_PE */ @@ -533,6 +560,16 @@ styp_to_sec_flags (abfd, hdr, name, section) long styp_flags = internal_s->s_flags; flagword sec_flags = 0; +#ifdef STYP_BLOCK + if (styp_flags & STYP_BLOCK) + sec_flags |= SEC_BLOCK; +#endif + +#ifdef STYP_CLINK + if (styp_flags & STYP_CLINK) + sec_flags |= SEC_CLINK; +#endif + #ifdef STYP_NOLOAD if (styp_flags & STYP_NOLOAD) { @@ -604,10 +641,13 @@ styp_to_sec_flags (abfd, hdr, name, section) #endif sec_flags |= SEC_ALLOC; } - else if (strcmp (name, ".debug") == 0 + else if (strncmp (name, ".debug", 6) == 0 #ifdef _COMMENT || strcmp (name, _COMMENT) == 0 #endif +#ifdef COFF_LONG_SECTION_NAMES + || strncmp (name, ".gnu.linkonce.wi.", 17) == 0 +#endif || strncmp (name, ".stab", 5) == 0) { #ifdef COFF_PAGE_SIZE @@ -730,7 +770,7 @@ styp_to_sec_flags (abfd, hdr, name, section) 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. */ + /* 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; @@ -849,7 +889,7 @@ styp_to_sec_flags (abfd, hdr, name, section) if (strcmp (name, symname) != 0) abort (); - + /* This is the section symbol. */ bfd_coff_swap_aux_in (abfd, (PTR) (esym + bfd_coff_symesz (abfd)), @@ -884,7 +924,7 @@ styp_to_sec_flags (abfd, hdr, name, section) switch (aux.x_scn.x_comdat) { case IMAGE_COMDAT_SELECT_NODUPLICATES: -#ifdef STRICT_PE_FORMAT +#ifdef STRICT_PE_FORMAT sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY; #else sec_flags &= ~SEC_LINK_ONCE; @@ -936,7 +976,7 @@ styp_to_sec_flags (abfd, hdr, name, section) #define TARGET_UNDERSCORE 0 #endif /* Is this the name we're looking for? */ - if (strcmp (target_name, + if (strcmp (target_name, symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0) { /* Not the name we're looking for */ @@ -944,7 +984,7 @@ styp_to_sec_flags (abfd, hdr, name, section) continue; } /* Fall through. */ - case 1: + case 1: /* MSVC mode: the lexically second symbol (or drop through from the above). */ { @@ -955,7 +995,7 @@ styp_to_sec_flags (abfd, hdr, name, section) Intel puts the two adjacent, but Alpha (at least) spreads them out. */ - section->comdat = + section->comdat = bfd_alloc (abfd, sizeof (struct bfd_comdat_info)); if (section->comdat == NULL) abort (); @@ -977,7 +1017,9 @@ styp_to_sec_flags (abfd, hdr, name, section) esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd); } - breakloop: + breakloop: + /* SunOS requires a statement after any label. */ + ; } } @@ -1100,6 +1142,8 @@ dependent COFF routines: . boolean _bfd_coff_long_filenames; . boolean _bfd_coff_long_section_names; . unsigned int _bfd_coff_default_section_alignment_power; +. boolean _bfd_coff_force_symnames_in_strings; +. unsigned int _bfd_coff_debug_string_prefix_length; . void (*_bfd_coff_swap_filehdr_in) PARAMS (( . bfd *abfd, . PTR ext, @@ -1202,12 +1246,12 @@ dependent COFF routines: . struct bfd_link_info *info, . bfd *abfd, . const char *name, -. flagword flags, +. flagword flags, . asection *section, . bfd_vma value, . const char *string, . boolean copy, -. boolean collect, +. boolean collect, . struct bfd_link_hash_entry **hashp)); . . boolean (*_bfd_coff_link_output_has_begun) PARAMS (( @@ -1297,6 +1341,12 @@ dependent COFF routines: .#define bfd_coff_symname_in_debug(abfd, sym)\ . ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) . +.#define bfd_coff_force_symnames_in_strings(abfd)\ +. (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) +. +.#define bfd_coff_debug_string_prefix_length(abfd)\ +. (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) +. .#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ . ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ . (abfd, file, base, symbol, aux, indaux)) @@ -1434,8 +1484,8 @@ static const unsigned int coff_section_alignment_table_size = static boolean coff_new_section_hook (abfd, section) - bfd *abfd; - asection *section; + bfd * abfd; + asection * section; { combined_entry_type *native; @@ -1500,10 +1550,17 @@ coff_set_alignment_hook (abfd, section, scnhdr) break; #endif #ifdef TIC80COFF - /* TI tools hijack bits 8-11 for the alignment */ + /* TI tools puts the alignment power in bits 8-11 */ i = (hdr->s_flags >> 8) & 0xF ; #endif +#ifdef COFF_DECODE_ALIGNMENT + i = COFF_DECODE_ALIGNMENT(hdr->s_flags); +#endif section->alignment_power = i; + +#ifdef coff_set_section_load_page + coff_set_section_load_page (section, hdr->s_page); +#endif } #else /* ! COFF_ALIGN_IN_SECTION_HEADER */ @@ -1568,6 +1625,23 @@ coff_set_alignment_hook (abfd, section, scnhdr) pei_section_data (abfd, section)->pe_flags = hdr->s_flags; section->lma = hdr->s_vaddr; + + /* check for extended relocs */ + if (hdr->s_flags & IMAGE_SCN_LNK_NRELOC_OVFL) + { + struct external_reloc dst; + struct internal_reloc n; + int oldpos = bfd_tell (abfd); + bfd_seek (abfd, hdr->s_relptr, 0); + if (bfd_read ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd) + != bfd_coff_relsz (abfd)) + return; + + coff_swap_reloc_in (abfd, &dst, &n); + bfd_seek (abfd, oldpos, 0); + section->reloc_count = + hdr->s_nreloc = n.r_vaddr; + } } #undef ALIGN_SET #undef ELIFALIGN_SET @@ -1692,6 +1766,11 @@ coff_mkobject_hook (abfd, filehdr, aouthdr) struct xcoff_tdata *xcoff; xcoff = xcoff_data (abfd); +# ifdef U803XTOCMAGIC + xcoff->xcoff64 = internal_f->f_magic == U803XTOCMAGIC; +# else + xcoff->xcoff64 = 0; +# endif xcoff->full_aouthdr = true; xcoff->toc = internal_a->o_toc; xcoff->sntoc = internal_a->o_sntoc; @@ -1705,12 +1784,12 @@ coff_mkobject_hook (abfd, filehdr, aouthdr) } #endif -#ifdef ARM +#ifdef ARM /* Set the flags field from the COFF header read in */ if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags)) coff->flags = 0; #endif - + #ifdef COFF_WITH_PE /* FIXME: I'm not sure this is ever executed, since peicode.h defines coff_mkobject_hook. */ @@ -1745,7 +1824,7 @@ coff_set_arch_mach_hook (abfd, filehdr) case PPCMAGIC: arch = bfd_arch_powerpc; machine = 0; /* what does this mean? (krk) */ - break; + break; #endif #ifdef I386MAGIC case I386MAGIC: @@ -1756,6 +1835,12 @@ coff_set_arch_mach_hook (abfd, filehdr) machine = 0; break; #endif +#ifdef IA64MAGIC + case IA64MAGIC: + arch = bfd_arch_ia64; + machine = 0; + break; +#endif #ifdef A29K_MAGIC_BIG case A29K_MAGIC_BIG: case A29K_MAGIC_LITTLE: @@ -1864,9 +1949,13 @@ coff_set_arch_mach_hook (abfd, filehdr) #endif #ifdef RS6000COFF_C +#ifdef XCOFF64 + case U803XTOCMAGIC: +#else case U802ROMAGIC: case U802WRMAGIC: case U802TOCMAGIC: +#endif { int cputype; @@ -1887,13 +1976,13 @@ coff_set_arch_mach_hook (abfd, filehdr) buf = (bfd_byte *) bfd_malloc (bfd_coff_symesz (abfd)); if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 - || (bfd_read (buf, 1, bfd_coff_symesz (abfd), abfd) + || (bfd_read (buf, 1, bfd_coff_symesz (abfd), abfd) != bfd_coff_symesz (abfd))) { free (buf); return false; } - coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym); + bfd_coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym); if (sym.n_sclass == C_FILE) cputype = sym.n_type & 0xff; else @@ -1912,28 +2001,33 @@ coff_set_arch_mach_hook (abfd, filehdr) (because that's how they were bootstrapped originally), but they are always PowerPC architecture. */ arch = bfd_arch_powerpc; - machine = 0; + machine = bfd_mach_ppc; +#else +#ifdef XCOFF64 + arch = bfd_arch_powerpc; + machine = bfd_mach_ppc_620; #else arch = bfd_arch_rs6000; - machine = 6000; + machine = bfd_mach_rs6k; +#endif #endif /* POWERMAC */ break; case 1: arch = bfd_arch_powerpc; - machine = 601; + machine = bfd_mach_ppc_601; break; case 2: /* 64 bit PowerPC */ arch = bfd_arch_powerpc; - machine = 620; + machine = bfd_mach_ppc_620; break; case 3: arch = bfd_arch_powerpc; - machine = 0; + machine = bfd_mach_ppc; break; case 4: arch = bfd_arch_rs6000; - machine = 6000; + machine = bfd_mach_rs6k; break; } } @@ -2015,6 +2109,37 @@ coff_set_arch_mach_hook (abfd, filehdr) break; #endif +#ifdef TICOFF0MAGIC +#ifdef TICOFF_TARGET_ARCH + /* this TI COFF section should be used by all new TI COFF v0 targets */ + case TICOFF0MAGIC: + arch = TICOFF_TARGET_ARCH; + break; +#endif +#endif + +#ifdef TICOFF1MAGIC + /* this TI COFF section should be used by all new TI COFF v1/2 targets */ + /* TI COFF1 and COFF2 use the target_id field to specify which arch */ + case TICOFF1MAGIC: + case TICOFF2MAGIC: + switch (internal_f->f_target_id) + { +#ifdef TI_TARGET_ID + case TI_TARGET_ID: + arch = TICOFF_TARGET_ARCH; + break; +#endif + default: + arch = bfd_arch_obscure; + (*_bfd_error_handler) + (_("Unrecognized TI COFF target id '0x%x'"), + internal_f->f_target_id); + break; + } + break; +#endif + #ifdef TIC80_ARCH_MAGIC case TIC80_ARCH_MAGIC: arch = bfd_arch_tic80; @@ -2057,6 +2182,10 @@ symname_in_debug_hook (abfd, sym) #ifdef RS6000COFF_C +#ifdef XCOFF64 +#define FORCE_SYMNAMES_IN_STRINGS +#endif + /* Handle the csect auxent of a C_EXT or C_HIDEXT symbol. */ static boolean coff_pointerize_aux_hook @@ -2242,6 +2371,22 @@ coff_write_relocs (abfd, first_undef) if (bfd_seek (abfd, s->rel_filepos, SEEK_SET) != 0) return false; + +#ifdef COFF_WITH_PE + if (s->reloc_count > 0xffff) + { + /* encode real count here as first reloc */ + struct internal_reloc n; + memset ((PTR) & n, 0, sizeof (n)); + /* add one to count *this* reloc (grr) */ + n.r_vaddr = s->reloc_count + 1; + coff_swap_reloc_out (abfd, &n, &dst); + if (bfd_write ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd) + != bfd_coff_relsz (abfd)) + return false; + } +#endif + for (i = 0; i < s->reloc_count; i++) { struct internal_reloc n; @@ -2256,7 +2401,7 @@ coff_write_relocs (abfd, first_undef) place). This is a bad thing,'cause the symbols attached to the output bfd are indexed, so that the relocation entries know which symbol index they point to. So we - have to look up the output symbol here. */ + have to look up the output symbol here. */ if (q->sym_ptr_ptr[0]->the_bfd != abfd) { @@ -2407,6 +2552,33 @@ coff_set_flags (abfd, magicp, flagsp) *magicp = TIC30MAGIC; return true; #endif + +#ifdef TICOFF_DEFAULT_MAGIC + case TICOFF_TARGET_ARCH: + /* if there's no indication of which version we want, use the default */ + if (!abfd->xvec ) + *magicp = TICOFF_DEFAULT_MAGIC; + else + { + /* we may want to output in a different COFF version */ + switch (abfd->xvec->name[4]) + { + case '0': + *magicp = TICOFF0MAGIC; + break; + case '1': + *magicp = TICOFF1MAGIC; + break; + case '2': + *magicp = TICOFF2MAGIC; + break; + default: + return false; + } + } + return true; +#endif + #ifdef TIC80_ARCH_MAGIC case bfd_arch_tic80: *magicp = TIC80_ARCH_MAGIC; @@ -2424,10 +2596,10 @@ coff_set_flags (abfd, magicp, flagsp) { if (APCS_26_FLAG (abfd)) * flagsp |= F_APCS26; - + if (APCS_FLOAT_FLAG (abfd)) * flagsp |= F_APCS_FLOAT; - + if (PIC_FLAG (abfd)) * flagsp |= F_PIC; } @@ -2442,7 +2614,10 @@ coff_set_flags (abfd, magicp, flagsp) case bfd_mach_arm_4: * flagsp |= F_ARM_4; break; case bfd_mach_arm_4T: * flagsp |= F_ARM_4T; break; case bfd_mach_arm_5: * flagsp |= F_ARM_5; break; - case bfd_mach_arm_5T: * flagsp |= F_ARM_5; break; /* XXX - we do not have an F_ARM_5T */ + /* FIXME: we do not have F_ARM vaues greater than F_ARM_5. */ + case bfd_mach_arm_5T: * flagsp |= F_ARM_5; break; + case bfd_mach_arm_5TE: * flagsp |= F_ARM_5; break; + case bfd_mach_arm_XScale: * flagsp |= F_ARM_5; break; } return true; #endif @@ -2456,7 +2631,7 @@ coff_set_flags (abfd, magicp, flagsp) case bfd_arch_i386: *magicp = I386MAGIC; #ifdef LYNXOS - /* Just overwrite the usual value if we're doing Lynx. */ + /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; #endif return true; @@ -2468,6 +2643,12 @@ coff_set_flags (abfd, magicp, flagsp) return true; break; #endif +#ifdef IA64MAGIC + case bfd_arch_ia64: + *magicp = IA64MAGIC; + return true; + break; +#endif #ifdef MC68MAGIC case bfd_arch_m68k: #ifdef APOLLOM68KMAGIC @@ -2481,7 +2662,7 @@ coff_set_flags (abfd, magicp, flagsp) #endif #endif #ifdef LYNXOS - /* Just overwrite the usual value if we're doing Lynx. */ + /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; #endif return true; @@ -2536,7 +2717,7 @@ coff_set_flags (abfd, magicp, flagsp) case bfd_arch_sparc: *magicp = SPARCMAGIC; #ifdef LYNXOS - /* Just overwrite the usual value if we're doing Lynx. */ + /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; #endif return true; @@ -2566,12 +2747,19 @@ coff_set_flags (abfd, magicp, flagsp) break; #endif -#ifdef U802TOCMAGIC +#ifdef RS6000COFF_C case bfd_arch_rs6000: #ifndef PPCMAGIC case bfd_arch_powerpc: #endif - *magicp = U802TOCMAGIC; +#ifdef XCOFF64 + if (bfd_get_mach (abfd) == bfd_mach_ppc_620 + && !strncmp (abfd->xvec->name,"aix", 3)) + *magicp = U803XTOCMAGIC; + else +#else + *magicp = U802TOCMAGIC; +#endif return true; break; #endif @@ -2581,23 +2769,22 @@ coff_set_flags (abfd, magicp, flagsp) * magicp = MCOREMAGIC; return true; #endif - + #ifdef W65MAGIC case bfd_arch_w65: *magicp = W65MAGIC; return true; #endif - default: /* Unknown architecture */ - /* return false; -- fall through to "return false" below, to avoid - "statement never reached" errors on the one below. */ + default: /* Unknown architecture. */ + /* Fall through to "return false" below, to avoid + "statement never reached" errors on the one below. */ break; } return false; } - static boolean coff_set_arch_mach (abfd, arch, machine) bfd * abfd; @@ -2614,7 +2801,7 @@ coff_set_arch_mach (abfd, arch, machine) coff_set_flags (abfd, &dummy1, &dummy2) != true) return false; /* We can't represent this type */ - return true; /* We're easy ... */ + return true; /* We're easy ... */ } #ifdef COFF_IMAGE_WITH_PE @@ -2642,12 +2829,12 @@ sort_by_secaddr (arg1, arg2) #endif /* COFF_IMAGE_WITH_PE */ -/* Calculate the file position for each section. */ +/* Calculate the file position for each section. */ #ifndef I960 #define ALIGN_SECTIONS_IN_FILE #endif -#ifdef TIC80COFF +#if defined(TIC80COFF) || defined(TICOFF) #undef ALIGN_SECTIONS_IN_FILE #endif @@ -2685,8 +2872,8 @@ coff_compute_section_file_positions (abfd) size_t len; len = strlen (bfd_asymbol_name (*symp)); - if (len > SYMNMLEN) - sz += len + 3; + if (len > SYMNMLEN || bfd_coff_force_symnames_in_strings (abfd)) + sz += len + 1 + bfd_coff_debug_string_prefix_length (abfd); } } if (sz > 0) @@ -2704,7 +2891,7 @@ coff_compute_section_file_positions (abfd) #ifdef COFF_IMAGE_WITH_PE int page_size; - if (coff_data (abfd)->link_info) + if (coff_data (abfd)->link_info) { page_size = pe_data (abfd)->pe_opthdr.FileAlignment; } @@ -2853,7 +3040,7 @@ coff_compute_section_file_positions (abfd) /* Align the sections in the file to the same boundary on which they are aligned in virtual memory. I960 doesn't do this (FIXME) so we can stay in sync with Intel. 960 - doesn't yet page from files... */ + doesn't yet page from files... */ #ifdef ALIGN_SECTIONS_IN_FILE if ((abfd->flags & EXEC_P) != 0) { @@ -3042,7 +3229,7 @@ coff_write_object_contents (abfd) file_ptr reloc_base; file_ptr lineno_base; file_ptr sym_base; - unsigned long reloc_size = 0; + unsigned long reloc_size = 0, reloc_count = 0; unsigned long lnno_size = 0; boolean long_section_names; asection *text_sec = NULL; @@ -3073,7 +3260,16 @@ coff_write_object_contents (abfd) for (current = abfd->sections; current != NULL; current = current->next) - reloc_size += current->reloc_count * bfd_coff_relsz (abfd); + { +#ifdef COFF_WITH_PE + /* we store the actual reloc count in the first reloc's addr */ + if (current->reloc_count > 0xffff) + reloc_count ++; +#endif + reloc_count += current->reloc_count; + } + + reloc_size = reloc_count * bfd_coff_relsz (abfd); lineno_base = reloc_base + reloc_size; sym_base = lineno_base + lnno_size; @@ -3096,6 +3292,11 @@ coff_write_object_contents (abfd) { current->rel_filepos = reloc_base; reloc_base += current->reloc_count * bfd_coff_relsz (abfd); +#ifdef COFF_WITH_PE + /* extra reloc to hold real count */ + if (current->reloc_count > 0xffff) + reloc_base += bfd_coff_relsz (abfd); +#endif } else { @@ -3170,6 +3371,9 @@ coff_write_object_contents (abfd) section.s_vaddr = current->vma; section.s_paddr = current->lma; section.s_size = current->_raw_size; +#ifdef coff_get_section_load_page + section.s_page = coff_get_section_load_page (current); +#endif #ifdef COFF_WITH_PE section.s_paddr = 0; @@ -3212,6 +3416,7 @@ coff_write_object_contents (abfd) hasdebug = true; #ifdef RS6000COFF_C +#ifndef XCOFF64 /* Indicate the use of an XCOFF overflow section header. */ if (current->reloc_count >= 0xffff || current->lineno_count >= 0xffff) { @@ -3219,6 +3424,7 @@ coff_write_object_contents (abfd) section.s_nlnno = 0xffff; } #endif +#endif section.s_flags = sec_to_styp_flags (current->name, current->flags); @@ -3239,10 +3445,13 @@ coff_write_object_contents (abfd) section.s_align = (current->alignment_power ? 1 << current->alignment_power : 0); -#else +#endif #ifdef TIC80COFF + /* TI COFF puts the alignment power in bits 8-11 of the flags */ section.s_flags |= (current->alignment_power & 0xF) << 8; #endif +#ifdef COFF_ENCODE_ALIGNMENT + COFF_ENCODE_ALIGNMENT(section, current->alignment_power); #endif #ifdef COFF_IMAGE_WITH_PE @@ -3259,7 +3468,7 @@ coff_write_object_contents (abfd) SCNHDR buff; if (coff_swap_scnhdr_out (abfd, §ion, &buff) == 0 || bfd_write ((PTR) (&buff), 1, bfd_coff_scnhsz (abfd), abfd) - != bfd_coff_scnhsz (abfd)) + != bfd_coff_scnhsz (abfd)) return false; } @@ -3381,13 +3590,13 @@ coff_write_object_contents (abfd) scnhdr.s_flags = STYP_OVRFLO; if (coff_swap_scnhdr_out (abfd, &scnhdr, &buff) == 0 || bfd_write ((PTR) &buff, 1, bfd_coff_scnhsz (abfd), abfd) - != bfd_coff_scnhsz (abfd)) + != bfd_coff_scnhsz (abfd)) return false; } } #endif - /* OK, now set up the filehdr... */ + /* OK, now set up the filehdr... */ /* Don't include the internal abs section in the section count */ @@ -3432,6 +3641,11 @@ coff_write_object_contents (abfd) internal_f.f_flags |= F_AR32W; #endif +#ifdef TI_TARGET_ID + /* target id is used in TI COFF v1 and later; COFF0 won't use this field, + but it doesn't hurt to set it internally */ + internal_f.f_target_id = TI_TARGET_ID; +#endif #ifdef TIC80_TARGET_ID internal_f.f_target_id = TIC80_TARGET_ID; #endif @@ -3458,7 +3672,7 @@ coff_write_object_contents (abfd) coff_set_flags (abfd, &magic, &flags); internal_f.f_magic = magic; internal_f.f_flags |= flags; - /* ...and the "opt"hdr... */ + /* ...and the "opt"hdr... */ #ifdef A29K #ifdef ULTRA3 /* NYU's machine */ @@ -3473,6 +3687,10 @@ coff_write_object_contents (abfd) internal_a.magic = NMAGIC; /* Assume separate i/d */ #define __A_MAGIC_SET__ #endif /* A29K */ +#ifdef TICOFF_AOUT_MAGIC + internal_a.magic = TICOFF_AOUT_MAGIC; +#define __A_MAGIC_SET__ +#endif #ifdef TIC80COFF internal_a.magic = TIC80_ARCH_MAGIC; #define __A_MAGIC_SET__ @@ -3516,7 +3734,7 @@ coff_write_object_contents (abfd) #if defined(ARM) #define __A_MAGIC_SET__ internal_a.magic = ZMAGIC; -#endif +#endif #if defined(PPC_PE) #define __A_MAGIC_SET__ @@ -3526,7 +3744,7 @@ coff_write_object_contents (abfd) #if defined MCORE_PE #define __A_MAGIC_SET__ internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC; -#endif +#endif #if defined(I386) #define __A_MAGIC_SET__ @@ -3537,6 +3755,11 @@ coff_write_object_contents (abfd) #endif /* LYNXOS */ #endif /* I386 */ +#if defined(IA64) +#define __A_MAGIC_SET__ + internal_a.magic = ZMAGIC; +#endif /* IA64 */ + #if defined(SPARC) #define __A_MAGIC_SET__ #if defined(LYNXOS) @@ -3592,7 +3815,7 @@ coff_write_object_contents (abfd) return false; } #ifdef COFF_LONG_SECTION_NAMES - else if (long_section_names) + else if (long_section_names && ! obj_coff_strings_written (abfd)) { /* If we have long section names we have to write out the string table even if there are no symbols. */ @@ -3733,40 +3956,40 @@ coff_write_object_contents (abfd) /* now write them */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false; - + { char * buff; bfd_size_type amount; - + buff = bfd_malloc (bfd_coff_filhsz (abfd)); - if (buff == NULL) + if (buff == NULL) return false; - + coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff); amount = bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd); - + free (buff); - + if (amount != bfd_coff_filhsz (abfd)) return false; } - + if (abfd->flags & EXEC_P) { - /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR. - include/coff/pe.h sets AOUTSZ == sizeof(PEAOUTHDR)) */ + /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR. + include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)) */ char * buff; bfd_size_type amount; buff = bfd_malloc (bfd_coff_aoutsz (abfd)); - if (buff == NULL) + if (buff == NULL) return false; - + coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff); amount = bfd_write ((PTR) buff, 1, bfd_coff_aoutsz (abfd), abfd); - + free (buff); - + if (amount != bfd_coff_aoutsz (abfd)) return false; } @@ -3824,7 +4047,7 @@ coff_set_section_contents (abfd, section, location, offset, count) to write a section which doesn't follow these assumptions. The code has been tested on ISC 4.1 by me, and on SCO by Robert Lipe <robertl@arnet.com> (Thanks!). - + Gvran Uddeborg <gvran@uddeborg.pp.se> */ if (strcmp (section->name, _LIB) == 0) @@ -3845,7 +4068,7 @@ coff_set_section_contents (abfd, section, location, offset, count) #endif /* Don't write out bss sections - one way to do this is to - see if the filepos has not been set. */ + see if the filepos has not been set. */ if (section->filepos == 0) return true; @@ -3953,7 +4176,7 @@ coff_slurp_line_table (abfd, asect) while (counter < asect->lineno_count) { struct internal_lineno dst; - coff_swap_lineno_in (abfd, src, &dst); + bfd_coff_swap_lineno_in (abfd, src, &dst); cache_ptr->line_number = dst.l_lnno; if (cache_ptr->line_number == 0) @@ -4002,7 +4225,7 @@ coff_slurp_line_table (abfd, asect) } asect->lineno = lineno_cache; - /* FIXME, free native_lineno here, or use alloca or something. */ + /* FIXME, free native_lineno here, or use alloca or something. */ return true; } @@ -4122,7 +4345,7 @@ coff_slurp_symbol_table (abfd) case COFF_SYMBOL_UNDEFINED: dst->symbol.section = bfd_und_section_ptr; dst->symbol.value = 0; - break; + break; case COFF_SYMBOL_PE_SECTION: dst->symbol.flags |= BSF_EXPORT | BSF_SECTION_SYM; @@ -4169,7 +4392,7 @@ coff_slurp_symbol_table (abfd) #ifdef I960 case C_LEAFSTAT: /* static leaf procedure */ #endif -#if defined ARM +#if defined ARM case C_THUMBSTAT: /* Thumb static */ case C_THUMBLABEL: /* Thumb label */ case C_THUMBSTATFUNC:/* Thumb static function */ @@ -4206,7 +4429,8 @@ coff_slurp_symbol_table (abfd) #endif case C_REGPARM: /* register parameter */ case C_REG: /* register variable */ -#ifndef TIC80COFF + /* C_AUTOARG conflictes with TI COFF C_UEXT */ +#if !defined (TIC80COFF) && !defined (TICOFF) #ifdef C_AUTOARG case C_AUTOARG: /* 960-specific storage class */ #endif @@ -4287,7 +4511,7 @@ coff_slurp_symbol_table (abfd) #endif case C_BLOCK: /* ".bb" or ".eb" */ - case C_FCN: /* ".bf" or ".ef" (or PE ".lf") */ + case C_FCN: /* ".bf" or ".ef" (or PE ".lf") */ case C_EFCN: /* physical end of function */ #if defined COFF_WITH_PE /* PE sets the symbol to a value relative to the start @@ -4310,6 +4534,11 @@ coff_slurp_symbol_table (abfd) #endif break; + case C_STATLAB: /* Static load time label */ + dst->symbol.value = src->u.syment.n_value; + dst->symbol.flags = BSF_GLOBAL; + break; + case C_NULL: /* PE DLLs sometimes have zeroed out symbols for some reason. Just ignore them without a warning. */ @@ -4328,11 +4557,10 @@ coff_slurp_symbol_table (abfd) /* NT uses 0x67 for a weak symbol, not C_ALIAS. */ case C_ALIAS: /* duplicate tag */ #endif - /* New storage classes for TIc80 */ -#ifdef TIC80COFF + /* New storage classes for TI COFF */ +#if defined(TIC80COFF) || defined(TICOFF) case C_UEXT: /* Tentative external definition */ #endif - case C_STATLAB: /* Static load time label */ case C_EXTLAB: /* External load time label */ case C_HIDDEN: /* ext symbol in dmert public lib */ default: @@ -4502,7 +4730,6 @@ SUBSUBSECTION into a howto table vector; the 88k subtracts a number from the @code{r_type} field and creates an addend field. - */ #ifndef CALC_ADDEND @@ -4557,7 +4784,6 @@ coff_slurp_reloc_table (abfd, asect, symbols) if (reloc_cache == NULL) return false; - for (idx = 0; idx < asect->reloc_count; idx++) { struct internal_reloc dst; @@ -4678,7 +4904,6 @@ coff_canonicalize_reloc (abfd, section, relptr, symbols) arelent *tblptr = section->relocation; unsigned int count = 0; - if (section->flags & SEC_CONSTRUCTOR) { /* this section has relocs made up by us, they are not in the @@ -4701,8 +4926,6 @@ coff_canonicalize_reloc (abfd, section, relptr, symbols) for (; count++ < section->reloc_count;) *relptr++ = tblptr++; - - } *relptr = 0; return section->reloc_count; @@ -4890,6 +5113,16 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = false, #endif COFF_DEFAULT_SECTION_ALIGNMENT_POWER, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, coff_SWAP_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook, coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, @@ -4921,7 +5154,7 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data #endif -#ifndef coff_bfd_copy_private_bfd_data +#ifndef coff_bfd_copy_private_bfd_data #define coff_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data #endif @@ -4933,7 +5166,7 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags #endif -#ifndef coff_bfd_print_private_bfd_data +#ifndef coff_bfd_print_private_bfd_data #define coff_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data #endif diff --git a/contrib/binutils/bfd/coffgen.c b/contrib/binutils/bfd/coffgen.c index f2410d9..35e8f71 100644 --- a/contrib/binutils/bfd/coffgen.c +++ b/contrib/binutils/bfd/coffgen.c @@ -60,7 +60,7 @@ static void coff_pointerize_aux static boolean make_a_section_from_file PARAMS ((bfd *, struct internal_scnhdr *, unsigned int)); static const bfd_target *coff_real_object_p - PARAMS ((bfd *, unsigned, struct internal_filehdr *, + PARAMS ((bfd *, unsigned, struct internal_filehdr *, struct internal_aouthdr *)); static void fixup_symbol_value PARAMS ((bfd *, coff_symbol_type *, struct internal_syment *)); @@ -212,7 +212,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) goto fail; /* Set the arch/mach *before* swapping in sections; section header swapping - may depend on arch/mach info. */ + may depend on arch/mach info. */ if (bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f) == false) goto fail; @@ -340,7 +340,6 @@ coff_get_symtab_upper_bound (abfd) return (bfd_get_symcount (abfd) + 1) * (sizeof (coff_symbol_type *)); } - /* Canonicalize a COFF symbol table. */ long @@ -525,7 +524,7 @@ coff_count_linenumbers (abfd) { asymbol *q_maybe = *p; - if (bfd_asymbol_flavour (q_maybe) == bfd_target_coff_flavour) + if (bfd_family_coff (bfd_asymbol_bfd (q_maybe))) { coff_symbol_type *q = coffsymbol (q_maybe); @@ -558,13 +557,12 @@ coff_count_linenumbers (abfd) /* Takes a bfd and a symbol, returns a pointer to the coff specific area of the symbol if there is one. */ -/*ARGSUSED*/ coff_symbol_type * coff_symbol_from (ignore_abfd, symbol) bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; { - if (bfd_asymbol_flavour (symbol) != bfd_target_coff_flavour) + if (!bfd_family_coff (bfd_asymbol_bfd (symbol))) return (coff_symbol_type *) NULL; if (bfd_asymbol_bfd (symbol)->tdata.coff_obj_data == (coff_data_type *) NULL) @@ -608,8 +606,11 @@ fixup_symbol_value (abfd, coff_symbol_ptr, syment) syment->n_value = (coff_symbol_ptr->symbol.value + coff_symbol_ptr->symbol.section->output_offset); if (! obj_pe (abfd)) - syment->n_value += - coff_symbol_ptr->symbol.section->output_section->vma; + { + syment->n_value += (syment->n_sclass == C_STATLAB) + ? coff_symbol_ptr->symbol.section->output_section->lma + : coff_symbol_ptr->symbol.section->output_section->vma; + } } else { @@ -689,7 +690,7 @@ coff_renumber_symbols (bfd_ptr, first_undef) for (symbol_index = 0; symbol_index < symbol_count; symbol_index++) { coff_symbol_type *coff_symbol_ptr = coff_symbol_from (bfd_ptr, symbol_ptr_ptr[symbol_index]); - symbol_ptr_ptr[symbol_index]->udata.i = symbol_index; + symbol_ptr_ptr[symbol_index]->udata.i = symbol_index; if (coff_symbol_ptr && coff_symbol_ptr->native) { combined_entry_type *s = coff_symbol_ptr->native; @@ -816,7 +817,16 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, { unsigned int filnmlen; - strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); + if (bfd_coff_force_symnames_in_strings (abfd)) + { + native->u.syment._n._n_n._n_offset = + (*string_size_p + STRING_SIZE_SIZE); + native->u.syment._n._n_n._n_zeroes = 0; + *string_size_p += 6; /* strlen(".file") + 1 */ + } + else + strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); + auxent = &(native + 1)->u.auxent; filnmlen = bfd_coff_filnmlen (abfd); @@ -843,7 +853,7 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, } else { - if (name_length <= SYMNMLEN) + if (name_length <= SYMNMLEN && !bfd_coff_force_symnames_in_strings (abfd)) { /* This name will fit into the symbol neatly */ strncpy (native->u.syment._n._n_name, symbol->name, SYMNMLEN); @@ -858,7 +868,8 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, else { long filepos; - bfd_byte buf[2]; + bfd_byte buf[4]; + int prefix_len = bfd_coff_debug_string_prefix_length (abfd); /* This name should be written into the .debug section. For some reason each name is preceded by a two byte length @@ -868,24 +879,29 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, if (*debug_string_section_p == (asection *) NULL) *debug_string_section_p = bfd_get_section_by_name (abfd, ".debug"); filepos = bfd_tell (abfd); - bfd_put_16 (abfd, name_length + 1, buf); + if (prefix_len == 4) + bfd_put_32 (abfd, name_length + 1, buf); + else + bfd_put_16 (abfd, name_length + 1, buf); + if (!bfd_set_section_contents (abfd, *debug_string_section_p, (PTR) buf, (file_ptr) *debug_string_size_p, - (bfd_size_type) 2) + (bfd_size_type) prefix_len) || !bfd_set_section_contents (abfd, *debug_string_section_p, (PTR) symbol->name, ((file_ptr) *debug_string_size_p - + 2), + + prefix_len), (bfd_size_type) name_length + 1)) abort (); if (bfd_seek (abfd, filepos, SEEK_SET) != 0) abort (); - native->u.syment._n._n_n._n_offset = *debug_string_size_p + 2; + native->u.syment._n._n_n._n_offset = + *debug_string_size_p + prefix_len; native->u.syment._n._n_n._n_zeroes = 0; - *debug_string_size_p += name_length + 3; + *debug_string_size_p += name_length + 1 + prefix_len; } } } @@ -1085,7 +1101,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p, while (lineno[count].line_number != 0) { #if 0 - /* 13 april 92. sac + /* 13 april 92. sac I've been told this, but still need proof: > The second bug is also in `bfd/coffcode.h'. This bug > causes the linker to screw up the pc-relocations for @@ -1241,7 +1257,7 @@ coff_write_symbols (abfd) { /* This is not a COFF symbol, so it certainly is not a file name, nor does it go in the .debug section. */ - maxlen = SYMNMLEN; + maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; } else if (bfd_coff_symname_in_debug (abfd, &c_symbol->native->u.syment)) @@ -1252,9 +1268,13 @@ coff_write_symbols (abfd) } else if (c_symbol->native->u.syment.n_sclass == C_FILE && c_symbol->native->u.syment.n_numaux > 0) - maxlen = bfd_coff_filnmlen (abfd); + { + if (bfd_coff_force_symnames_in_strings (abfd)) + bfd_write (".file", 1, 6, abfd); + maxlen = bfd_coff_filnmlen (abfd); + } else - maxlen = SYMNMLEN; + maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; if (name_length > maxlen) { @@ -1354,7 +1374,6 @@ coff_write_linenumbers (abfd) return true; } -/*ARGSUSED */ alent * coff_get_lineno (ignore_abfd, symbol) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -1465,7 +1484,7 @@ coff_pointerize_aux (abfd, table_base, symbol, indaux, auxent) /* Allocate space for the ".debug" section, and read it. We did not read the debug section until now, because - we didn't want to go to the trouble until someone needed it. */ + we didn't want to go to the trouble until someone needed it. */ static char * build_debug_section (abfd) @@ -1487,7 +1506,7 @@ build_debug_section (abfd) if (debug_section == NULL) return NULL; - /* Seek to the beginning of the `.debug' section and read it. + /* Seek to the beginning of the `.debug' section and read it. Save the current position first; it is needed by our caller. Then read debug section and reset the file pointer. */ @@ -1501,7 +1520,6 @@ build_debug_section (abfd) return debug_section; } - /* Return a pointer to a malloc'd copy of 'name'. 'name' may not be \0-terminated, but will not exceed 'maxlen' characters. The copy *will* be \0-terminated. */ @@ -1589,7 +1607,7 @@ _bfd_coff_read_string_table (abfd) + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd)), SEEK_SET) != 0) return NULL; - + if (bfd_read (extstrsize, sizeof extstrsize, 1, abfd) != sizeof extstrsize) { if (bfd_get_error () != bfd_error_file_truncated) @@ -1790,7 +1808,7 @@ coff_get_normalized_symtab (abfd) { break; } /* if end of string */ - } /* possible lengths of this string. */ + } /* possible lengths of this string. */ if ((newstring = (PTR) bfd_alloc (abfd, ++i)) == NULL) return (NULL); @@ -1888,7 +1906,6 @@ coff_bfd_make_debug_symbol (abfd, ptr, sz) return &new->symbol; } -/*ARGSUSED */ void coff_get_symbol_info (abfd, symbol, ret) bfd *abfd; @@ -2141,7 +2158,7 @@ _bfd_coff_is_local_label_name (abfd, name) /* Provided a BFD, a section and an offset (in bytes, not octets) into the section, calculate and return the name of the source file and the line nearest to the wanted location. */ -/*ARGSUSED*/ + boolean coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) @@ -2168,17 +2185,25 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, &found, filename_ptr, functionname_ptr, line_ptr, - &coff_data (abfd)->line_info)) + &coff_data(abfd)->line_info)) return false; + if (found) return true; + /* Also try examining DWARF2 debugging information. */ + if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, + filename_ptr, functionname_ptr, + line_ptr, 0, + &coff_data(abfd)->dwarf2_find_line_info)) + return true; + *filename_ptr = 0; *functionname_ptr = 0; *line_ptr = 0; /* Don't try and find line numbers in a non coff file */ - if (abfd->xvec->flavour != bfd_target_coff_flavour) + if (!bfd_family_coff (abfd)) return false; if (cof == NULL) @@ -2385,7 +2410,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class) We cheat here by creating a fake native entry for it and then filling in the class. This code is based on that in coff_write_alien_symbol(). */ - + combined_entry_type * native; native = (combined_entry_type *) bfd_alloc (abfd, sizeof (* native)); @@ -2393,10 +2418,10 @@ bfd_coff_set_symbol_class (abfd, symbol, class) return false; memset (native, 0, sizeof (* native)); - + native->u.syment.n_type = T_NULL; native->u.syment.n_sclass = class; - + if (bfd_is_und_section (symbol->section)) { native->u.syment.n_scnum = N_UNDEF; @@ -2415,19 +2440,18 @@ bfd_coff_set_symbol_class (abfd, symbol, class) + symbol->section->output_offset); if (! obj_pe (abfd)) native->u.syment.n_value += symbol->section->output_section->vma; - + /* Copy the any flags from the the file header into the symbol. FIXME: Why? */ native->u.syment.n_flags = bfd_asymbol_bfd (& csym->symbol)->flags; } - + csym->native = native; } else { csym->native->u.syment.n_sclass = class; } - + return true; } - diff --git a/contrib/binutils/bfd/cofflink.c b/contrib/binutils/bfd/cofflink.c index 609f665..223ccbf 100644 --- a/contrib/binutils/bfd/cofflink.c +++ b/contrib/binutils/bfd/cofflink.c @@ -40,6 +40,15 @@ static int process_embedded_commands PARAMS ((bfd *, struct bfd_link_info *, bfd *)); static void mark_relocs PARAMS ((struct coff_final_link_info *, bfd *)); +/* Return true if SYM is a weak, external symbol. */ +#define IS_WEAK_EXTERNAL(abfd, sym) \ + ((sym).n_sclass == C_WEAKEXT \ + || (obj_pe (abfd) && (sym).n_sclass == C_NT_WEAK)) + +/* Return true if SYM is an external symbol. */ +#define IS_EXTERNAL(abfd, sym) \ + ((sym).n_sclass == C_EXT || IS_WEAK_EXTERNAL (abfd, sym)) + /* Define macros so that the ISFCN, et. al., macros work correctly. These macros are defined in include/coff/internal.h in terms of N_TMASK, etc. These definitions require a user to define local @@ -395,8 +404,7 @@ coff_link_add_symbols (abfd, info) break; } - if (sym.n_sclass == C_WEAKEXT - || (obj_pe (abfd) && sym.n_sclass == C_NT_WEAK)) + if (IS_WEAK_EXTERNAL (abfd, sym)) flags = BSF_WEAK; addit = true; @@ -894,8 +902,7 @@ _bfd_coff_final_link (abfd, info) for (p = o->link_order_head; p != NULL; p = p->next) { if (p->type == bfd_indirect_link_order - && (bfd_get_flavour (p->u.indirect.section->owner) - == bfd_target_coff_flavour)) + && bfd_family_coff (p->u.indirect.section->owner)) { sub = p->u.indirect.section->owner; if (! bfd_coff_link_output_has_begun (sub, & finfo)) @@ -921,7 +928,7 @@ _bfd_coff_final_link (abfd, info) if (! bfd_coff_final_link_postscript (abfd, & finfo)) goto error_return; - + /* Free up the buffers used by _bfd_coff_link_input_bfd. */ coff_debug_merge_hash_table_free (&finfo.debug_merge); @@ -982,7 +989,7 @@ _bfd_coff_final_link (abfd, info) /* If doing task linking (ld --task-link) then make a pass through the global symbols, writing out any that are defined, and making them - static. */ + static. */ if (info->task_link) { finfo.failed = false; @@ -1095,6 +1102,8 @@ _bfd_coff_final_link (abfd, info) if (! _bfd_stringtab_emit (abfd, finfo.strtab)) return false; + + obj_coff_strings_written (abfd) = true; } _bfd_stringtab_free (finfo.strtab); @@ -1152,7 +1161,7 @@ dores_com (ptr, output_bfd, heap) bfd *output_bfd; int heap; { - if (coff_data(output_bfd)->pe) + if (coff_data(output_bfd)->pe) { int val = strtoul (ptr, &ptr, 0); if (heap) @@ -1160,7 +1169,7 @@ dores_com (ptr, output_bfd, heap) else pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve =val; - if (ptr[0] == ',') + if (ptr[0] == ',') { int val = strtoul (ptr+1, &ptr, 0); if (heap) @@ -1186,7 +1195,7 @@ char **dst; } /* Process any magic embedded commands in a section called .drectve */ - + static int process_embedded_commands (output_bfd, info, abfd) bfd *output_bfd; @@ -1197,19 +1206,19 @@ process_embedded_commands (output_bfd, info, abfd) char *s; char *e; char *copy; - if (!sec) + if (!sec) return 1; - + copy = bfd_malloc ((size_t) sec->_raw_size); - if (!copy) + if (!copy) return 0; - if (! bfd_get_section_contents(abfd, sec, copy, 0, sec->_raw_size)) + if (! bfd_get_section_contents(abfd, sec, copy, 0, sec->_raw_size)) { free (copy); return 0; } e = copy + sec->_raw_size; - for (s = copy; s < e ; ) + for (s = copy; s < e ; ) { if (s[0]!= '-') { s++; @@ -1230,7 +1239,7 @@ process_embedded_commands (output_bfd, info, abfd) s = get_name(s, &name); s = get_name(s, &attribs); while (loop) { - switch (*attribs++) + switch (*attribs++) { case 'W': had_write = 1; @@ -1264,7 +1273,7 @@ process_embedded_commands (output_bfd, info, abfd) { s = dores_com (s+6, output_bfd, 0); } - else + else s++; } free (copy); @@ -1274,7 +1283,7 @@ process_embedded_commands (output_bfd, info, abfd) /* Place a marker against all symbols which are used by relocations. This marker can be picked up by the 'do we skip this symbol ?' loop in _bfd_coff_link_input_bfd() and used to prevent skipping - that symbol. + that symbol. */ static void @@ -1286,14 +1295,13 @@ mark_relocs (finfo, input_bfd) if ((bfd_get_file_flags (input_bfd) & HAS_SYMS) == 0) return; - + for (a = input_bfd->sections; a != (asection *) NULL; a = a->next) { struct internal_reloc * internal_relocs; struct internal_reloc * irel; struct internal_reloc * irelend; - if ((a->flags & SEC_RELOC) == 0 || a->reloc_count < 1) continue; @@ -1306,7 +1314,7 @@ mark_relocs (finfo, input_bfd) ? (finfo->section_info[ a->output_section->target_index ].relocs + a->output_section->reloc_count) : finfo->internal_relocs) ); - + if (internal_relocs == NULL) continue; @@ -1317,7 +1325,7 @@ mark_relocs (finfo, input_bfd) been initialised to 0) for all of the symbols that are used in the relocation table. This will then be picked up in the skip/don't pass */ - + for (; irel < irelend; irel++) { finfo->sym_indices[ irel->r_symndx ] = -1; @@ -1400,8 +1408,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) && finfo->info->relocateable) { /* mark the symbol array as 'not-used' */ - memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp); - + memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp); + mark_relocs (finfo, input_bfd); } @@ -1448,7 +1456,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) dont_skip_symbol = *indexp; else dont_skip_symbol = false; - + *indexp = -1; skip = false; @@ -1834,12 +1842,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) } /* If doing task linking, convert normal global function symbols to - static functions. */ - - if (finfo->info->task_link - && (isym.n_sclass == C_EXT - || isym.n_sclass == C_WEAKEXT - || (obj_pe (input_bfd) && isym.n_sclass == C_NT_WEAK))) + static functions. */ + if (finfo->info->task_link && IS_EXTERNAL (input_bfd, isym)) isym.n_sclass = C_STAT; /* Output the symbol. */ @@ -2202,7 +2206,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) is.n_numaux, auxptr); } - skipping = false; + skipping = false; } iline.l_addr.l_symndx = indx; @@ -2400,8 +2404,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* This reloc is against a symbol we are stripping. This should have been handled by the 'dont_skip_symbol' code in the while - loop at the top of this function. */ - + loop at the top of this function. */ + is = finfo->internal_syms + irel->r_symndx; name = (_bfd_coff_internal_syment_name @@ -2425,9 +2429,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (secdata == NULL || secdata->stab_info == NULL) { if (! bfd_set_section_contents (output_bfd, o->output_section, - contents, - (file_ptr) - (o->output_offset * + contents, + (file_ptr) + (o->output_offset * bfd_octets_per_byte (output_bfd)), (o->_cooked_size != 0 ? o->_cooked_size @@ -2549,20 +2553,25 @@ _bfd_coff_write_global_sym (h, data) /* If doing task linking and this is the pass where we convert defined globals to statics, then do that conversion now. If the symbol is not being converted, just ignore it and it will be - output during a later pass. */ + output during a later pass. */ if (finfo->global_to_static) { - if (isym.n_sclass != C_EXT - && isym.n_sclass != C_WEAKEXT - && (! obj_pe (output_bfd) || isym.n_sclass != C_NT_WEAK)) - { - return true; - } + if (! IS_EXTERNAL (output_bfd, isym)) + return true; + isym.n_sclass = C_STAT; } + /* When a weak symbol is not overriden by a strong one, + turn it into an external symbol when not building a + shared or relocateable object. */ + if (! finfo->info->shared + && ! finfo->info->relocateable + && IS_WEAK_EXTERNAL (finfo->output_bfd, isym)) + isym.n_sclass = C_EXT; + isym.n_numaux = h->numaux; - + bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) finfo->outsyms); symesz = bfd_coff_symesz (output_bfd); @@ -2654,7 +2663,7 @@ _bfd_coff_write_global_sym (h, data) /* Write out task global symbols, converting them to statics. Called via coff_link_hash_traverse. Calls bfd_coff_write_global_sym to do - the dirty work, if the symbol we are processing needs conversion. */ + the dirty work, if the symbol we are processing needs conversion. */ boolean _bfd_coff_write_task_globals (h, data) @@ -2740,7 +2749,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) break; } ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf, - (file_ptr) + (file_ptr) (link_order->offset * bfd_octets_per_byte (output_bfd)), size); free (buf); @@ -2862,7 +2871,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, return false; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -2877,7 +2886,6 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, else addend = 0; - howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, &addend); if (howto == NULL) @@ -2929,6 +2937,9 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, + sec->output_offset); } + else if (h->root.type == bfd_link_hash_undefweak) + val = 0; + else if (! info->relocateable) { if (! ((*info->callbacks->undefined_symbol) @@ -2940,7 +2951,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, if (info->base_file) { - /* Emit a reloc if the backend thinks it needs it. */ + /* Emit a reloc if the backend thinks it needs it. */ if (sym && pe_data (output_bfd)->in_reloc_p (output_bfd, howto)) { /* Relocation to a symbol in a section which isn't @@ -2949,9 +2960,9 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, reloc section. Note that the base file is not portable between systems. We write out a long here, and dlltool reads in a long. */ - long addr = (rel->r_vaddr - - input_section->vma - + input_section->output_offset + long addr = (rel->r_vaddr + - input_section->vma + + input_section->output_offset + input_section->output_section->vma); if (coff_data (output_bfd)->pe) addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; @@ -2963,7 +2974,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, } } } - + rstat = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_vaddr - input_section->vma, @@ -3007,4 +3018,3 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, } return true; } - diff --git a/contrib/binutils/bfd/coffswap.h b/contrib/binutils/bfd/coffswap.h index d7d090f..2f89afb 100644 --- a/contrib/binutils/bfd/coffswap.h +++ b/contrib/binutils/bfd/coffswap.h @@ -168,12 +168,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef GET_SCNHDR_NRELOC #define GET_SCNHDR_NRELOC bfd_h_get_16 #endif +#ifndef MAX_SCNHDR_NRELOC +#define MAX_SCNHDR_NRELOC 0xffff +#endif #ifndef PUT_SCNHDR_NRELOC #define PUT_SCNHDR_NRELOC bfd_h_put_16 #endif #ifndef GET_SCNHDR_NLNNO #define GET_SCNHDR_NLNNO bfd_h_get_16 #endif +#ifndef MAX_SCNHDR_NLNNO +#define MAX_SCNHDR_NLNNO 0xffff +#endif #ifndef PUT_SCNHDR_NLNNO #define PUT_SCNHDR_NLNNO bfd_h_put_16 #endif @@ -184,6 +190,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PUT_SCNHDR_FLAGS bfd_h_put_32 #endif +#ifndef GET_RELOC_VADDR +#define GET_RELOC_VADDR bfd_h_get_32 +#endif +#ifndef PUT_RELOC_VADDR +#define PUT_RELOC_VADDR bfd_h_put_32 +#endif static void coff_swap_aouthdr_in PARAMS ((bfd *, PTR, PTR)); static unsigned int coff_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR)); @@ -217,7 +229,7 @@ coff_swap_reloc_in (abfd, src, dst) RELOC *reloc_src = (RELOC *) src; struct internal_reloc *reloc_dst = (struct internal_reloc *) dst; - reloc_dst->r_vaddr = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr); + reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, (bfd_byte *)reloc_src->r_vaddr); reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx); #ifdef RS6000COFF_C @@ -241,7 +253,7 @@ coff_swap_reloc_out (abfd, src, dst) { struct internal_reloc *reloc_src = (struct internal_reloc *)src; struct external_reloc *reloc_dst = (struct external_reloc *)dst; - bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr); + PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr); bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx); #ifdef RS6000COFF_C @@ -324,7 +336,6 @@ coff_swap_filehdr_out (abfd, in, out) return bfd_coff_filhsz (abfd); } - #ifndef NO_COFF_SYMBOLS static void @@ -347,9 +358,9 @@ coff_swap_sym_in (abfd, ext1, in1) memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); #endif } - in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); + 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){ + if (sizeof (ext->e_type) == 2){ in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); } else { @@ -383,7 +394,7 @@ coff_swap_sym_out (abfd, inp, extp) } 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) + if (sizeof (ext->e_type) == 2) { bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); } @@ -419,7 +430,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) 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 = + in->x_file.x_n.x_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); } else { #if FILNMLEN != E_FILNMLEN @@ -439,28 +450,6 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) } goto end; - /* RS/6000 "csect" auxents */ -#ifdef RS6000COFF_C - case C_EXT: - case C_HIDEXT: - if (indx + 1 == numaux) - { - in->x_csect.x_scnlen.l = bfd_h_get_32 (abfd, ext->x_csect.x_scnlen); - in->x_csect.x_parmhash = bfd_h_get_32 (abfd, - ext->x_csect.x_parmhash); - in->x_csect.x_snhash = bfd_h_get_16 (abfd, ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's - defined by shifts-and-ands, which are equivalent on all - byte orders. */ - in->x_csect.x_smtyp = bfd_h_get_8 (abfd, ext->x_csect.x_smtyp); - in->x_csect.x_smclas = bfd_h_get_8 (abfd, ext->x_csect.x_smclas); - in->x_csect.x_stab = bfd_h_get_32 (abfd, ext->x_csect.x_stab); - in->x_csect.x_snstab = bfd_h_get_16 (abfd, ext->x_csect.x_snstab); - goto end; - } - break; -#endif - case C_STAT: #ifdef C_LEAFSTAT case C_LEAFSTAT: @@ -517,7 +506,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) end: ; /* the semicolon is because MSVC doesn't like labels at - end of block. */ + end of block. */ #ifdef COFF_ADJUST_AUX_IN_POST COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1); @@ -558,27 +547,6 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) } goto end; -#ifdef RS6000COFF_C - /* RS/6000 "csect" auxents */ - case C_EXT: - case C_HIDEXT: - if (indx + 1 == numaux) - { - PUTWORD (abfd, in->x_csect.x_scnlen.l, ext->x_csect.x_scnlen); - PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); - PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); - /* We don't have to hack bitfields in x_smtyp because it's - defined by shifts-and-ands, which are equivalent on all - byte orders. */ - PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); - PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); - PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); - PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); - goto end; - } - break; -#endif - case C_STAT: #ifdef C_LEAFSTAT case C_LEAFSTAT: @@ -703,9 +671,12 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4); #endif - #ifdef RS6000COFF_C +#ifdef XCOFF64 + aouthdr_int->o_toc = bfd_h_get_64(abfd, aouthdr_ext->o_toc); +#else aouthdr_int->o_toc = bfd_h_get_32(abfd, aouthdr_ext->o_toc); +#endif aouthdr_int->o_snentry = bfd_h_get_16(abfd, aouthdr_ext->o_snentry); aouthdr_int->o_sntext = bfd_h_get_16(abfd, aouthdr_ext->o_sntext); aouthdr_int->o_sndata = bfd_h_get_16(abfd, aouthdr_ext->o_sndata); @@ -716,9 +687,14 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) aouthdr_int->o_algndata = bfd_h_get_16(abfd, aouthdr_ext->o_algndata); aouthdr_int->o_modtype = bfd_h_get_16(abfd, aouthdr_ext->o_modtype); aouthdr_int->o_cputype = bfd_h_get_16(abfd, aouthdr_ext->o_cputype); +#ifdef XCOFF64 + aouthdr_int->o_maxstack = bfd_h_get_64(abfd, aouthdr_ext->o_maxstack); + aouthdr_int->o_maxdata = bfd_h_get_64(abfd, aouthdr_ext->o_maxdata); +#else aouthdr_int->o_maxstack = bfd_h_get_32(abfd, aouthdr_ext->o_maxstack); aouthdr_int->o_maxdata = bfd_h_get_32(abfd, aouthdr_ext->o_maxdata); #endif +#endif #ifdef MIPSECOFF aouthdr_int->bss_start = bfd_h_get_32(abfd, aouthdr_ext->bss_start); @@ -763,7 +739,11 @@ coff_swap_aouthdr_out (abfd, in, out) #endif #ifdef RS6000COFF_C +#ifdef XCOFF64 + bfd_h_put_64 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); +#else bfd_h_put_32 (abfd, aouthdr_in->o_toc, aouthdr_out->o_toc); +#endif bfd_h_put_16 (abfd, aouthdr_in->o_snentry, aouthdr_out->o_snentry); bfd_h_put_16 (abfd, aouthdr_in->o_sntext, aouthdr_out->o_sntext); bfd_h_put_16 (abfd, aouthdr_in->o_sndata, aouthdr_out->o_sndata); @@ -774,9 +754,18 @@ coff_swap_aouthdr_out (abfd, in, out) bfd_h_put_16 (abfd, aouthdr_in->o_algndata, aouthdr_out->o_algndata); bfd_h_put_16 (abfd, aouthdr_in->o_modtype, aouthdr_out->o_modtype); bfd_h_put_16 (abfd, aouthdr_in->o_cputype, aouthdr_out->o_cputype); +#ifdef XCOFF64 + bfd_h_put_64 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); + bfd_h_put_64 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); +#else bfd_h_put_32 (abfd, aouthdr_in->o_maxstack, aouthdr_out->o_maxstack); bfd_h_put_32 (abfd, aouthdr_in->o_maxdata, aouthdr_out->o_maxdata); +#endif memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2); +#ifdef XCOFF64 + memset (aouthdr_out->o_debugger, 0, sizeof aouthdr_out->o_debugger); + memset (aouthdr_out->o_resv3, 0, sizeof aouthdr_out->o_resv3); +#endif #endif #ifdef MIPSECOFF @@ -814,7 +803,7 @@ coff_swap_scnhdr_in (abfd, ext, in) #ifdef COFF_ADJUST_SCNHDR_IN_PRE COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in); #endif - memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name)); + memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name)); scnhdr_int->s_vaddr = GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr); scnhdr_int->s_paddr = @@ -856,12 +845,11 @@ coff_swap_scnhdr_out (abfd, in, out) #ifdef COFF_ADJUST_SCNHDR_OUT_PRE COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out); #endif - memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name)); + memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name)); PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr, (bfd_byte *) scnhdr_ext->s_vaddr); - PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr, (bfd_byte *) scnhdr_ext->s_paddr); PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size, @@ -879,8 +867,9 @@ coff_swap_scnhdr_out (abfd, in, out) PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); #else - if (scnhdr_int->s_nlnno <= 0xffff) - PUTHALF(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); + if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO) + PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno, + (bfd_byte *) scnhdr_ext->s_nlnno); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -891,10 +880,11 @@ coff_swap_scnhdr_out (abfd, in, out) (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"), bfd_get_filename (abfd), buf, scnhdr_int->s_nlnno); - PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); + PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); } - if (scnhdr_int->s_nreloc <= 0xffff) - PUTHALF(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); + if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC) + PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc, + (bfd_byte *) scnhdr_ext->s_nreloc); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -905,7 +895,7 @@ coff_swap_scnhdr_out (abfd, in, out) bfd_get_filename (abfd), buf, scnhdr_int->s_nreloc); bfd_set_error (bfd_error_file_truncated); - PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + PUT_SCNHDR_NRELOC(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); ret = 0; } #endif diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd index 3adc5ae..cd4abc3 100755 --- a/contrib/binutils/bfd/config.bfd +++ b/contrib/binutils/bfd/config.bfd @@ -32,10 +32,15 @@ alpha*) targ_archs=bfd_alpha_arch ;; arm*) targ_archs=bfd_arm_arch ;; strongarm*) targ_archs=bfd_arm_arch ;; thumb*) targ_archs=bfd_arm_arch ;; +xscale*) targ_archs=bfd_arm_arch ;; c30*) targ_archs=bfd_tic30_arch ;; +c54x*) targ_archs=bfd_tic54x_arch ;; hppa*) targ_archs=bfd_hppa_arch ;; +x86_64) targ_archs=bfd_i386_arch ;; i[3456]86) targ_archs=bfd_i386_arch ;; i370) targ_archs=bfd_i370_arch ;; +m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;; +m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;; m68*) targ_archs=bfd_m68k_arch ;; m88*) targ_archs=bfd_m88k_arch ;; mips*) targ_archs=bfd_mips_arch ;; @@ -79,7 +84,15 @@ case "${targ}" in alpha*-*-*) targ_defvec=ecoffalpha_little_vec ;; - sparc64-*-netbsd*) + ia64*-*-freebsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) + targ_defvec=bfd_elf64_ia64_little_vec + targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + ;; + ia64*-*-hpux*) + targ_defvec=bfd_elf64_ia64_big_vec + targ_selvecs="bfd_elf32_ia64_big_vec" + ;; + sparc64-*-freebsd* | sparc64-*-netbsd*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" ;; @@ -113,7 +126,7 @@ case "${targ}" in targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec" targ_underscore=yes ;; - arm-*-aout | armel-*-aout) + arm-*-aout | armel-*-aout) targ_defvec=aout_arm_little_vec targ_selvecs=aout_arm_big_vec ;; @@ -126,11 +139,15 @@ case "${targ}" in targ_selvecs=armcoff_big_vec targ_underscore=yes ;; + arm-*-rtems*) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; armeb-*-elf | arm*b-*-linux-gnu*) targ_defvec=bfd_elf32_bigarm_vec targ_selvecs=bfd_elf32_littlearm_vec ;; - arm-*-elf | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) + arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; @@ -171,9 +188,18 @@ case "${targ}" in targ_selvecs=armcoff_big_vec targ_underscore=yes ;; + xscale-*-elf) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; + xscale-*-coff) + targ_defvec=armcoff_little_vec + targ_selvecs=armcoff_big_vec + targ_underscore=yes + ;; a29k-*-ebmon* | a29k-*-udi* | a29k-*-coff* | a29k-*-sym1* | \ - a29k-*-vxworks* | a29k-*-sysv*) + a29k-*-vxworks* | a29k-*-sysv* | a29k-*rtems*) targ_defvec=a29kcoff_big_vec targ_selvecs=sunos_big_vec targ_underscore=yes @@ -194,6 +220,18 @@ case "${targ}" in targ_defvec=tic30_coff_vec ;; + c54x*-*-*coff* | tic54x-*-*coff*) + targ_defvec=tic54x_coff1_vec + targ_selvecs="tic54x_coff1_beh_vec tic54x_coff2_vec tic54x_coff2_beh_vec tic54x_coff0_vec tic54x_coff0_beh_vec" + targ_underscore=yes + ;; + + cris-*-*) + targ_defvec=cris_aout_vec + targ_selvecs="bfd_elf32_us_cris_vec bfd_elf32_cris_vec ieee_vec" + targ_underscore=yes # Note: not true for bfd_elf32_cris_vec. + ;; + d10v-*-*) targ_defvec=bfd_elf32_d10v_vec ;; @@ -217,27 +255,39 @@ case "${targ}" in targ_underscore=yes ;; -#if 0 /* HPPA ELF does not work currently. */ - hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*) - targ_defvec=bfd_elf32_hppa_vec +#ifdef BFD64 + hppa*64*-*-linux-gnu*) + targ_defvec=bfd_elf64_hppa_linux_vec + targ_selvecs=bfd_elf64_hppa_vec + ;; + hppa*64*-*-hpux11*) + targ_defvec=bfd_elf64_hppa_vec + targ_selvecs=bfd_elf64_hppa_linux_vec + targ_cflags=-DHPUX_LARGE_AR_IDS ;; #endif + + hppa*-*-linux-gnu*) + targ_defvec=bfd_elf32_hppa_linux_vec + targ_selvecs=bfd_elf32_hppa_vec + ;; + hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*) + targ_defvec=bfd_elf32_hppa_vec + targ_selvecs=bfd_elf32_hppa_linux_vec + ;; + #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX) -#if 0 /* HPPA ELF does not work currently. */ hppa*-*-bsd*) targ_defvec=som_vec targ_selvecs=bfd_elf32_hppa_vec ;; -#endif hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*) targ_defvec=som_vec ;; -#if 0 /* HPPA ELF does not work currently. */ hppa*-*-osf*) targ_defvec=som_vec targ_selvecs=bfd_elf32_hppa_vec ;; -#endif #endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */ i370-*-*) @@ -254,6 +304,13 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; + i[3456]86-*-rtemself*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs="i386coff_vec i386aout_vec" + ;; + i[3456]86-*-chorus*) + targ_defvec=bfd_elf32_i386_vec + ;; i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* ) targ_defvec=go32coff_vec targ_selvecs="go32stubbedcoff_vec i386aout_vec" @@ -262,14 +319,10 @@ case "${targ}" in i[3456]86-*-aix*) targ_defvec=i386coff_vec ;; - i[3456]86-*-rtemscoff*) + i[3456]86*-*-rtems*) targ_defvec=i386coff_vec targ_selvecs="bfd_elf32_i386_vec i386aout_vec" ;; - i[3456]86-*-rtemself* | i[3456]86*-*-rtems*) - targ_defvec=bfd_elf32_i386_vec - targ_selvecs="i386coff_vec i386aout_vec" - ;; i[3456]86-sequent-bsd*) targ_defvec=i386dynix_vec targ_underscore=yes @@ -288,9 +341,13 @@ case "${targ}" in targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; - i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3456]86-*-netbsdelf*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs=i386netbsd_vec + ;; + i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) targ_defvec=i386netbsd_vec - targ_selvecs=i386bsd_vec + targ_selvecs="bfd_elf32_i386_vec i386bsd_vec" targ_underscore=yes ;; i[3456]86-*-netware*) @@ -304,8 +361,18 @@ case "${targ}" in ;; i[3456]86-*-linux-gnu*) targ_defvec=bfd_elf32_i386_vec - targ_selvecs=i386linux_vec + targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" ;; +#ifdef BFD64 + x86_64-*-freebsd*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec" + ;; + x86_64-*-linux-gnu*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + ;; +#endif i[3456]86-*-lynxos*) targ_defvec=i386lynx_coff_vec targ_selvecs=i386lynx_aout_vec @@ -357,10 +424,18 @@ case "${targ}" in targ_defvec=i386aout_vec targ_underscore=yes ;; + i[3456]86-*-chaos) + targ_defvec=bfd_elf32_i386_vec + targ_selfvecs=i386chaos_vec + ;; i860-*-mach3* | i860-*-osf1* | i860-*-coff*) targ_defvec=i860coff_vec ;; + i860-stardent-sysv4* | i860-stardent-elf*) + targ_defvec=bfd_elf32_i860_little_vec + targ_selvecs="bfd_elf32_i860_vec bfd_elf32_i860_little_vec" + ;; i860-*-sysv4* | i860-*-elf*) targ_defvec=bfd_elf32_i860_vec ;; @@ -370,12 +445,7 @@ case "${targ}" in targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec" targ_underscore=yes ;; - i960-*-rtemself*) - targ_defvec=bfd_elf32_i960_vec - targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec" - targ_underscore=yes - ;; - i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtemscoff* | i960-*-rtems*) + i960-*-vxworks5.* | i960-*-coff* | i960-*-sysv* | i960-*-rtems*) targ_defvec=icoff_little_vec targ_selvecs="icoff_big_vec b_out_vec_little_host b_out_vec_big_host ieee_vec" targ_underscore=yes @@ -394,6 +464,15 @@ case "${targ}" in targ_defvec=bfd_elf32_m32r_vec ;; + m68hc11-*-* | m6811-*-*) + targ_defvec=bfd_elf32_m68hc11_vec + targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec" + ;; + m68hc12-*-* | m6812-*-*) + targ_defvec=bfd_elf32_m68hc12_vec + targ_selvecs="bfd_elf32_m68hc11_vec bfd_elf32_m68hc12_vec" + ;; + m68*-apollo-*) targ_defvec=apollocoff_vec ;; @@ -420,16 +499,10 @@ case "${targ}" in targ_defvec=bfd_elf32_m68k_vec targ_selvecs="m68kcoff_vec ieee_vec" ;; - m68*-*-rtemscoff*) - # same as m68k-coff with some extra targets + m68*-*-rtems*) targ_defvec=m68kcoff_vec targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec" ;; - m68*-*-rtems* | m68*-*-rtemself*) - # same as m68k-elf with some extra targets - targ_defvec=bfd_elf32_m68k_vec - targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec" - ;; m68*-*-coff* | m68*-*-sysv*) targ_defvec=m68kcoff_vec targ_selvecs="m68kcoff_vec versados_vec ieee_vec" @@ -565,14 +638,14 @@ case "${targ}" in targ_underscore=yes ;; mips*-*-sysv4*) - targ_defvec=bfd_elf32_bigmips_vec - targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec" + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" ;; mips*-*-sysv* | mips*-*-riscos*) targ_defvec=ecoff_big_vec targ_selvecs=ecoff_little_vec ;; - mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*) + mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks* | mips*-*-chorus*) targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" ;; @@ -622,10 +695,11 @@ case "${targ}" in powerpc-*-aix* | powerpc-*-beos*) targ_defvec=rs6000coff_vec + targ_selvecs="rs6000coff64_vec" ;; powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ - powerpc-*-vxworks*) + powerpc-*-chorus* | powerpc-*-vxworks*) targ_defvec=bfd_elf32_powerpc_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" ;; @@ -652,6 +726,11 @@ case "${targ}" in targ_defvec=rs6000coff_vec ;; + sh-*-linux*) + targ_defvec=bfd_elf32_shblin_vec + targ_selvecs=bfd_elf32_shlin_vec + ;; + sh-*-elf* | sh-*-rtemself*) targ_defvec=bfd_elf32_sh_vec targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" @@ -662,7 +741,7 @@ case "${targ}" in targ_selvecs="shlpe_vec shlpei_vec" targ_underscore=yes ;; - sh-*-* | sh-*-rtemscoff* | sh-*-rtems*) + sh-*-* | sh-*-rtems*) targ_defvec=shcoff_vec targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" targ_underscore=yes @@ -680,6 +759,9 @@ case "${targ}" in sparclite-*-elf* | sparc86x-*-elf*) targ_defvec=bfd_elf32_sparc_vec ;; + sparc*-*-chorus*) + targ_defvec=bfd_elf32_sparc_vec + ;; sparc-*-linux*aout*) targ_defvec=sparclinux_vec targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" @@ -735,7 +817,7 @@ case "${targ}" in sparc64-*-elf*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs=bfd_elf32_sparc_vec - ;; + ;; #endif /* BFD64 */ sparc*-*-coff*) targ_defvec=sparccoff_vec @@ -749,7 +831,7 @@ case "${targ}" in targ_defvec=bfd_elf32_sparc_vec targ_selvecs="sunos_big_vec sparccoff_vec" ;; - sparc*-*-*) + sparc*-*-* | sparc*-*-rtems*) targ_defvec=sunos_big_vec targ_underscore=yes ;; diff --git a/contrib/binutils/bfd/config.in b/contrib/binutils/bfd/config.in index 7383656..74af3d3 100644 --- a/contrib/binutils/bfd/config.in +++ b/contrib/binutils/bfd/config.in @@ -25,9 +25,6 @@ /* Define to `long' if <sys/types.h> 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 <sys/types.h> doesn't define. */ #undef size_t @@ -211,21 +208,42 @@ /* Define if <sys/procfs.h> has prstatus_t. */ #undef HAVE_PRSTATUS_T +/* Define if <sys/procfs.h> has prstatus32_t. */ +#undef HAVE_PRSTATUS32_T + /* Define if <sys/procfs.h> has prstatus_t.pr_who. */ #undef HAVE_PRSTATUS_T_PR_WHO +/* Define if <sys/procfs.h> has prstatus32_t.pr_who. */ +#undef HAVE_PRSTATUS32_T_PR_WHO + /* Define if <sys/procfs.h> has pstatus_t. */ #undef HAVE_PSTATUS_T +/* Define if <sys/procfs.h> has pxstatus_t. */ +#undef HAVE_PXSTATUS_T + +/* Define if <sys/procfs.h> has pstatus32_t. */ +#undef HAVE_PSTATUS32_T + /* Define if <sys/procfs.h> has prpsinfo_t. */ #undef HAVE_PRPSINFO_T +/* Define if <sys/procfs.h> has prpsinfo32_t. */ +#undef HAVE_PRPSINFO32_T + /* Define if <sys/procfs.h> has psinfo_t. */ #undef HAVE_PSINFO_T +/* Define if <sys/procfs.h> has psinfo32_t. */ +#undef HAVE_PSINFO32_T + /* Define if <sys/procfs.h> has lwpstatus_t. */ #undef HAVE_LWPSTATUS_T +/* Define if <sys/procfs.h> has lwpxstatus_t. */ +#undef HAVE_LWPXSTATUS_T + /* Define if <sys/procfs.h> has lwpstatus_t.pr_context. */ #undef HAVE_LWPSTATUS_T_PR_CONTEXT diff --git a/contrib/binutils/bfd/configure b/contrib/binutils/bfd/configure index 89f979e..d348425 100755 --- a/contrib/binutils/bfd/configure +++ b/contrib/binutils/bfd/configure @@ -22,6 +22,8 @@ ac_help="$ac_help ac_help="$ac_help --disable-libtool-lock avoid locking (might break parallel builds)" ac_help="$ac_help + --with-pic try to use only PIC/non-PIC objects [default=use both]" +ac_help="$ac_help --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)" ac_help="$ac_help --enable-targets alternative target configurations" @@ -30,6 +32,8 @@ ac_help="$ac_help ac_help="$ac_help --with-mmap try using mmap for BFD input files if available" ac_help="$ac_help + --enable-build-warnings Enable build-time compiler warnings if gcc is used" +ac_help="$ac_help --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" ac_help="$ac_help @@ -53,6 +57,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -167,6 +172,7 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -337,6 +343,11 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -502,12 +513,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -545,6 +560,68 @@ else ac_n= ac_c='\c' ac_t= fi +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:565: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 570 "configure" +#include "confdefs.h" + +int main() { + +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ +#endif +return __CYGWIN__; +; return 0; } +EOF +if { (eval echo configure:581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:598: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 603 "configure" +#include "confdefs.h" + +int main() { +return __MINGW32__; +; return 0; } +EOF +if { (eval echo configure:610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes ac_aux_dir= @@ -594,7 +671,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:598: checking host system type" >&5 +echo "configure:675: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -615,7 +692,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:619: checking target system type" >&5 +echo "configure:696: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -633,7 +710,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:637: checking build system type" >&5 +echo "configure:714: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -655,249 +732,49 @@ 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:662: 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:692: 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:743: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + 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 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:775: 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 786 "configure" + ac_save_LIBS="$LIBS" +LIBS="-lcposix $LIBS" +cat > conftest.$ac_ext <<EOF +#line 746 "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(); -main(){return(0);} +int main() { +strerror() +; return 0; } EOF -if { (eval echo configure:791: \"$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 +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" 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:817: 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:822: 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 <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:831: \"$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 -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:850: 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 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" 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 - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:882: 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 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - 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 + LIBS="$LIBS -lcposix" 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 @@ -911,7 +788,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:915: checking for a BSD compatible install" >&5 +echo "configure:792: 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 @@ -964,7 +841,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:968: checking whether build environment is sane" >&5 +echo "configure:845: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1021,7 +898,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:1025: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:902: 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 @@ -1050,7 +927,7 @@ fi PACKAGE=bfd -VERSION=2.10.1 +VERSION=2.11 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; } @@ -1067,7 +944,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1071: checking for working aclocal" >&5 +echo "configure:948: 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. @@ -1080,7 +957,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1084: checking for working autoconf" >&5 +echo "configure:961: 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. @@ -1093,7 +970,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1097: checking for working automake" >&5 +echo "configure:974: 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. @@ -1106,7 +983,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1110: checking for working autoheader" >&5 +echo "configure:987: 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. @@ -1119,7 +996,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1123: checking for working makeinfo" >&5 +echo "configure:1000: 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. @@ -1142,7 +1019,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:1146: checking for $ac_word" >&5 +echo "configure:1023: 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 @@ -1174,7 +1051,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:1178: checking for $ac_word" >&5 +echo "configure:1055: 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 @@ -1206,7 +1083,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:1210: checking for $ac_word" >&5 +echo "configure:1087: 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 @@ -1309,36 +1186,228 @@ else enable_fast_install=yes fi -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 +# 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:1316: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then +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 "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + 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_RANLIB="ranlib" + ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +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 <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1362: \"$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 +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" @@ -1351,8 +1420,14 @@ 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:1355: checking for ld used by GCC" >&5 - ac_prog=`($CC -print-prog-name=ld) 2>&5` +echo "configure:1424: checking for ld used by GCC" >&5 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) @@ -1375,10 +1450,10 @@ echo "configure:1355: 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:1379: checking for GNU ld" >&5 +echo "configure:1454: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1382: checking for non-GNU ld" >&5 +echo "configure:1457: 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 @@ -1413,7 +1488,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:1417: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1492: 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 @@ -1426,10 +1501,23 @@ fi fi echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 +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 +if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 +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:1433: checking for BSD-compatible nm" >&5 +echo "configure:1521: 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 @@ -1440,18 +1528,20 @@ else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + tmp_nm=$ac_dir/${ac_tool_prefix}nm + if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" + # Tru64's nm complains that /dev/null is an invalid object file + if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + ac_cv_path_NM="$tmp_nm -B" break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" + elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$tmp_nm -p" break else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi @@ -1465,7 +1555,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:1469: checking whether ln -s works" >&5 +echo "configure:1559: 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 @@ -1485,11 +1575,477 @@ else echo "$ac_t""no" 1>&6 fi +echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 +echo "configure:1580: 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 + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [regex]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case "$host_os" in +aix4*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* |pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +freebsd* ) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case "$host_cpu" in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20*) + # TODO: Does this work for hpux-11 too? + lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + +irix5* | irix6*) + case "$host_os" in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case "$LD" in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case "$host_cpu" in + alpha* | i*86 | powerpc* | sparc* | ia64* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + else + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case "$host_vendor" in + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + esac + ;; +esac + +fi + +echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 +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 +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 + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1749: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +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 + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# Only perform the check for file, if the check method requires it +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 +if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MAGIC_CMD" in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <<EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$ac_t""$MAGIC_CMD" 1>&6 +else + echo "$ac_t""no" 1>&6 +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 +if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MAGIC_CMD" in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <<EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org -case "$target" in -NONE) lt_target="$host" ;; -*) lt_target="$target" ;; +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$ac_t""$MAGIC_CMD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +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 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +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 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +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 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_STRIP"; then +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 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # 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_STRIP="strip" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + STRIP=":" +fi +fi + # Check for any special flags to pass to ltconfig. libtool_flags="--cache-file=$cache_file" @@ -1509,13 +2065,24 @@ fi test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi + +test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" +test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" + # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$lt_target" in +case "$host" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1518 "configure"' > conftest.$ac_ext - if { (eval echo configure:1519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2085 "configure"' > conftest.$ac_ext + if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1536,19 +2103,27 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1540: checking whether the C compiler needs -belf" >&5 +echo "configure:2107: 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 - cat > conftest.$ac_ext <<EOF -#line 1545 "configure" + + 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 2120 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2127: \"$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 @@ -1558,6 +2133,13 @@ else lt_cv_cc_needs_belf=no fi rm -f 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 + fi echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 @@ -1621,12 +2203,14 @@ rm -f confcache # Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ -DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ +AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ +objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ +deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } # Reload cache, that may have been modified by ltconfig @@ -1640,7 +2224,7 @@ fi # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -1650,6 +2234,12 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' exec 5>>./config.log + + + + + + # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. if test "${enable_64_bit_bfd+set}" = set; then enableval="$enable_64_bit_bfd" @@ -1692,6 +2282,29 @@ else want_mmap=false fi +build_warnings="-W -Wall" +# Check whether --enable-build-warnings or --disable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then + enableval="$enable_build_warnings" + case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting warning flags = $build_warnings" 6>&1 +fi +fi +WARN_CFLAGS="" +if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then + WARN_CFLAGS="${build_warnings}" +fi + + @@ -1720,7 +2333,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:1724: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:2337: 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" @@ -1742,72 +2355,10 @@ fi MAINT=$MAINTAINER_MODE_TRUE -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1747: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1752 "configure" -#include "confdefs.h" - -int main() { - -#ifndef __CYGWIN__ -#define __CYGWIN__ __CYGWIN32__ -#endif -return __CYGWIN__; -; return 0; } -EOF -if { (eval echo configure:1763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1780: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1785 "configure" -#include "confdefs.h" - -int main() { -return __MINGW32__; -; return 0; } -EOF -if { (eval echo configure:1792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1811: checking for executable suffix" >&5 +echo "configure:2362: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1817,10 +2368,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1846,7 +2397,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:1850: checking for $ac_word" >&5 +echo "configure:2401: 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 @@ -1876,7 +2427,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:1880: checking for $ac_word" >&5 +echo "configure:2431: 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 @@ -1927,7 +2478,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:1931: checking for $ac_word" >&5 +echo "configure:2482: 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 @@ -1959,7 +2510,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1963: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2514: 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. @@ -1970,12 +2521,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1974 "configure" +#line 2525 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2530: \"$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 @@ -2001,12 +2552,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:2005: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2556: 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:2010: checking whether we are using GNU C" >&5 +echo "configure:2561: 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 @@ -2015,7 +2566,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2019: \"$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:2570: \"$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 @@ -2034,7 +2585,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:2038: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2589: 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 @@ -2068,7 +2619,7 @@ fi ALL_LINGUAS= echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2072: checking how to run the C preprocessor" >&5 +echo "configure:2623: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2083,13 +2634,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 2087 "configure" +#line 2638 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2644: \"$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 : @@ -2100,13 +2651,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 2104 "configure" +#line 2655 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2661: \"$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 : @@ -2117,13 +2668,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 2121 "configure" +#line 2672 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2678: \"$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 : @@ -2147,13 +2698,43 @@ else fi 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 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2152: checking for ANSI C header files" >&5 +echo "configure:2733: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2157 "configure" +#line 2738 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2161,7 +2742,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2746: \"$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* @@ -2178,7 +2759,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2182 "configure" +#line 2763 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2196,7 +2777,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2200 "configure" +#line 2781 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2217,7 +2798,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 2221 "configure" +#line 2802 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2228,7 +2809,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2252,18 +2833,18 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2256: checking for working const" >&5 +echo "configure:2837: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2261 "configure" +#line 2842 "configure" #include "confdefs.h" int main() { /* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x = {0,0}; +typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; @@ -2306,7 +2887,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:2310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2891: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2327,21 +2908,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2331: checking for inline" >&5 +echo "configure:2912: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 2338 "configure" +#line 2919 "configure" #include "confdefs.h" int main() { -} int $ac_kw foo() { +} $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:2345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2367,12 +2948,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2371: checking for off_t" >&5 +echo "configure:2952: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2376 "configure" +#line 2957 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2400,12 +2981,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2404: checking for size_t" >&5 +echo "configure:2985: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2409 "configure" +#line 2990 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2435,19 +3016,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:2439: checking for working alloca.h" >&5 +echo "configure:3020: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2444 "configure" +#line 3025 "configure" #include "confdefs.h" #include <alloca.h> int main() { -void *p = alloca(2 * sizeof(int)); +char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3032: \"$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 @@ -2468,12 +3049,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2472: checking for alloca" >&5 +echo "configure:3053: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2477 "configure" +#line 3058 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -2501,7 +3082,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:2505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3086: \"$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 @@ -2533,12 +3114,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2537: checking whether alloca needs Cray hooks" >&5 +echo "configure:3118: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2542 "configure" +#line 3123 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2563,12 +3144,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2567: checking for $ac_func" >&5 +echo "configure:3148: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2572 "configure" +#line 3153 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2591,7 +3172,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3176: \"$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 @@ -2618,7 +3199,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2622: checking stack direction for C alloca" >&5 +echo "configure:3203: 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 @@ -2626,7 +3207,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 2630 "configure" +#line 3211 "configure" #include "confdefs.h" find_stack_direction () { @@ -2645,7 +3226,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:2649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3230: \"$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 @@ -2670,17 +3251,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:2674: checking for $ac_hdr" >&5 +echo "configure:3255: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2679 "configure" +#line 3260 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3265: \"$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* @@ -2709,12 +3290,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2713: checking for $ac_func" >&5 +echo "configure:3294: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2718 "configure" +#line 3299 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2737,7 +3318,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3322: \"$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 @@ -2762,7 +3343,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2766: checking for working mmap" >&5 +echo "configure:3347: 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 @@ -2770,7 +3351,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 2774 "configure" +#line 3355 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -2797,15 +3378,12 @@ else #include <sys/types.h> #include <fcntl.h> #include <sys/mman.h> -#include <stdlib.h> -#include <sys/stat.h> - -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2860,7 +3438,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = (char*)malloc(pagesize); + data = malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2881,7 +3459,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = (char*)malloc(2 * pagesize); + data2 = malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2899,7 +3477,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = (char*)malloc(pagesize); + data3 = malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2913,7 +3491,7 @@ main() } EOF -if { (eval echo configure:2917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3495: \"$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 @@ -2941,17 +3519,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:2945: checking for $ac_hdr" >&5 +echo "configure:3523: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2950 "configure" +#line 3528 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3533: \"$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* @@ -2981,12 +3559,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2985: checking for $ac_func" >&5 +echo "configure:3563: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2990 "configure" +#line 3568 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3009,7 +3587,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3591: \"$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 @@ -3038,12 +3616,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3042: checking for $ac_func" >&5 +echo "configure:3620: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3047 "configure" +#line 3625 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3066,7 +3644,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3648: \"$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 @@ -3100,19 +3678,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3104: checking for LC_MESSAGES" >&5 +echo "configure:3682: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3109 "configure" +#line 3687 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3694: \"$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 @@ -3133,7 +3711,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3137: checking whether NLS is requested" >&5 +echo "configure:3715: 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" @@ -3153,7 +3731,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3157: checking whether included gettext is requested" >&5 +echo "configure:3735: 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" @@ -3172,17 +3750,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3176: checking for libintl.h" >&5 +echo "configure:3754: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3181 "configure" +#line 3759 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3764: \"$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* @@ -3199,19 +3777,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:3203: checking for gettext in libc" >&5 +echo "configure:3781: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3208 "configure" +#line 3786 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3793: \"$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 @@ -3227,7 +3805,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:3231: checking for bindtextdomain in -lintl" >&5 +echo "configure:3809: 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 @@ -3235,7 +3813,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3239 "configure" +#line 3817 "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 @@ -3246,7 +3824,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:3250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3828: \"$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 @@ -3262,19 +3840,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:3266: checking for gettext in libintl" >&5 +echo "configure:3844: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3271 "configure" +#line 3849 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3856: \"$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 @@ -3302,7 +3880,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:3306: checking for $ac_word" >&5 +echo "configure:3884: 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 @@ -3336,12 +3914,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3340: checking for $ac_func" >&5 +echo "configure:3918: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3345 "configure" +#line 3923 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3364,7 +3942,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3946: \"$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 @@ -3391,7 +3969,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:3395: checking for $ac_word" >&5 +echo "configure:3973: 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 @@ -3427,7 +4005,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:3431: checking for $ac_word" >&5 +echo "configure:4009: 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 @@ -3459,7 +4037,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 3463 "configure" +#line 4041 "configure" #include "confdefs.h" int main() { @@ -3467,7 +4045,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:3471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3499,7 +4077,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:3503: checking for $ac_word" >&5 +echo "configure:4081: 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 @@ -3533,7 +4111,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:3537: checking for $ac_word" >&5 +echo "configure:4115: 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 @@ -3569,7 +4147,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:3573: checking for $ac_word" >&5 +echo "configure:4151: 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 @@ -3659,7 +4237,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3663: checking for catalogs to be installed" >&5 +echo "configure:4241: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3687,17 +4265,17 @@ echo "configure:3663: 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:3691: checking for linux/version.h" >&5 +echo "configure:4269: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3696 "configure" +#line 4274 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4279: \"$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* @@ -3775,7 +4353,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:3779: checking for a BSD compatible install" >&5 +echo "configure:4357: 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 @@ -3858,7 +4436,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:3862: checking for build system executable suffix" >&5 +echo "configure:4440: 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 @@ -3886,17 +4464,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:3890: checking for $ac_hdr" >&5 +echo "configure:4468: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3895 "configure" +#line 4473 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4478: \"$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* @@ -3926,17 +4504,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:3930: checking for $ac_hdr" >&5 +echo "configure:4508: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3935 "configure" +#line 4513 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4518: \"$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* @@ -3963,12 +4541,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3967: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4545: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3972 "configure" +#line 4550 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -3977,7 +4555,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4002,12 +4580,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:4006: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4584: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4011 "configure" +#line 4589 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -4015,7 +4593,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4040,7 +4618,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:4044: checking for opendir in -ldir" >&5 +echo "configure:4622: 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 @@ -4048,7 +4626,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 4052 "configure" +#line 4630 "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 @@ -4059,7 +4637,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4641: \"$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 @@ -4081,7 +4659,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4085: checking for opendir in -lx" >&5 +echo "configure:4663: 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 @@ -4089,7 +4667,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 4093 "configure" +#line 4671 "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 @@ -4100,7 +4678,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4682: \"$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 @@ -4125,12 +4703,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:4129: checking for $ac_func" >&5 +echo "configure:4707: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4134 "configure" +#line 4712 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4153,7 +4731,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4735: \"$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 @@ -4188,12 +4766,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4192: checking whether strstr must be declared" >&5 +echo "configure:4770: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4197 "configure" +#line 4775 "configure" #include "confdefs.h" #include <stdio.h> @@ -4214,7 +4792,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4235,12 +4813,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4239: checking whether malloc must be declared" >&5 +echo "configure:4817: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4244 "configure" +#line 4822 "configure" #include "confdefs.h" #include <stdio.h> @@ -4261,7 +4839,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4282,12 +4860,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4286: checking whether realloc must be declared" >&5 +echo "configure:4864: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4291 "configure" +#line 4869 "configure" #include "confdefs.h" #include <stdio.h> @@ -4308,7 +4886,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4329,12 +4907,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4333: checking whether free must be declared" >&5 +echo "configure:4911: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4338 "configure" +#line 4916 "configure" #include "confdefs.h" #include <stdio.h> @@ -4355,7 +4933,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4376,12 +4954,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4380: checking whether getenv must be declared" >&5 +echo "configure:4958: checking whether getenv must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4385 "configure" +#line 4963 "configure" #include "confdefs.h" #include <stdio.h> @@ -4402,7 +4980,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4429,13 +5007,16 @@ COREFLAG= TRAD_HEADER= if test "${target}" = "${host}"; then case "${host}" in + alpha*-*-freebsd*) + COREFILE='' + ;; alpha*-*-linux-gnu*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/alphalinux.h"' ;; alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;; - alpha*-*-freebsd*) ;; alpha*-*-*) COREFILE=osf-core.lo ;; + arm-*-freebsd*) COREFILE='' ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; @@ -4456,10 +5037,14 @@ if test "${target}" = "${host}"; then COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; - i[3456]86-*-bsd* | i[3456]86-*-freebsd*) + i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' ;; + i[3456]86-*-freebsd*) + COREFILE='' + TRAD_HEADER='"hosts/i386bsd.h"' + ;; i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -4561,12 +5146,17 @@ if test "${target}" = "${host}"; then COREFILE=netbsd-core.lo ;; rs6000-*-lynx*) COREFILE=lynx-core.lo ;; + rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*) + COREFILE=rs6000-core.lo + COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE" + ;; 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 ;; sparc-*-netbsd* | sparc-*-openbsd*) COREFILE=netbsd-core.lo @@ -4609,17 +5199,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:4613: checking for $ac_hdr" >&5 +echo "configure:5203: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4618 "configure" +#line 5208 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5213: \"$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* @@ -4647,19 +5237,21 @@ 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:4651: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5241: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4656 "configure" +#line 5246 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { prstatus_t avar ; return 0; } EOF -if { (eval echo configure:4663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -4680,20 +5272,58 @@ EOF fi 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 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5282 "configure" +#include "confdefs.h" + +#define _SYSCALL32 +#include <sys/procfs.h> +int main() { +prstatus32_t avar +; return 0; } +EOF +if { (eval echo configure:5291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prstatus32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prstatus32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_prstatus32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PRSTATUS32_T 1 +EOF + + fi + 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:4685: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5313: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4690 "configure" +#line 5318 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { prstatus_t avar; void* aref = (void*) &avar.pr_who ; return 0; } EOF -if { (eval echo configure:4697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5327: \"$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 @@ -4714,20 +5344,58 @@ EOF fi 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 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5354 "configure" +#include "confdefs.h" + +#define _SYSCALL32 +#include <sys/procfs.h> +int main() { +prstatus32_t avar; void* aref = (void*) &avar.pr_who +; return 0; } +EOF +if { (eval echo configure:5363: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PRSTATUS32_T_PR_WHO 1 +EOF + + fi + 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:4719: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5385: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4724 "configure" +#line 5390 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4748,20 +5416,94 @@ EOF fi 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 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5426 "configure" +#include "confdefs.h" + +#define _SYSCALL32 +#include <sys/procfs.h> +int main() { +pxstatus_t avar +; return 0; } +EOF +if { (eval echo configure:5435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_pxstatus_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_pxstatus_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_pxstatus_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PXSTATUS_T 1 +EOF + + fi + 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 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5462 "configure" +#include "confdefs.h" + +#define _SYSCALL32 +#include <sys/procfs.h> +int main() { +pstatus32_t avar +; return 0; } +EOF +if { (eval echo configure:5471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_pstatus32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_pstatus32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_pstatus32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PSTATUS32_T 1 +EOF + + fi + 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:4753: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5493: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4758 "configure" +#line 5498 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { prpsinfo_t avar ; return 0; } EOF -if { (eval echo configure:4765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -4782,20 +5524,58 @@ EOF fi 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 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5534 "configure" +#include "confdefs.h" + +#define _SYSCALL32 +#include <sys/procfs.h> +int main() { +prpsinfo32_t avar +; return 0; } +EOF +if { (eval echo configure:5543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prpsinfo32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_prpsinfo32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PRPSINFO32_T 1 +EOF + + fi + 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:4787: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5565: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4792 "configure" +#line 5570 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { psinfo_t avar ; return 0; } EOF -if { (eval echo configure:4799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -4816,20 +5596,58 @@ EOF fi 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 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5606 "configure" +#include "confdefs.h" + +#define _SYSCALL32 +#include <sys/procfs.h> +int main() { +psinfo32_t avar +; return 0; } +EOF +if { (eval echo configure:5615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_psinfo32_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_psinfo32_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_psinfo32_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_PSINFO32_T 1 +EOF + + fi + 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:4821: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5637: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4826 "configure" +#line 5642 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { lwpstatus_t avar ; return 0; } EOF -if { (eval echo configure:4833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -4850,20 +5668,58 @@ EOF fi 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 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5678 "configure" +#include "confdefs.h" + +#define _SYSCALL32 +#include <sys/procfs.h> +int main() { +lwpxstatus_t avar +; return 0; } +EOF +if { (eval echo configure:5687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_have_sys_procfs_type_lwpxstatus_t=no + +fi +rm -f conftest* +fi + + if test $bfd_cv_have_sys_procfs_type_lwpxstatus_t = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LWPXSTATUS_T 1 +EOF + + fi + 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:4855: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:5709: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4860 "configure" +#line 5714 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_context ; return 0; } EOF -if { (eval echo configure:4867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5723: \"$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 @@ -4885,19 +5741,21 @@ 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:4889: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:5745: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4894 "configure" +#line 5750 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { lwpstatus_t avar; void* aref = (void*) &avar.pr_reg ; return 0; } EOF -if { (eval echo configure:4901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5759: \"$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 @@ -4919,19 +5777,21 @@ 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:4923: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:5781: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4928 "configure" +#line 5786 "configure" #include "confdefs.h" + +#define _SYSCALL32 #include <sys/procfs.h> int main() { win32_pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -4956,10 +5816,12 @@ EOF fi -cat >> confdefs.h <<EOF +if test -n "$TRAD_HEADER"; then + cat >> confdefs.h <<EOF #define TRAD_HEADER $TRAD_HEADER EOF +fi # Horrible hacks to build DLLs on Windows. WIN32LDFLAGS= @@ -5043,7 +5905,7 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo dwarf2.lo dwarf1.lo" +elf="elf.lo elflink.lo dwarf1.lo" for vec in $selvecs do @@ -5071,8 +5933,19 @@ do apollocoff_vec) tb="$tb coff-apollo.lo" ;; 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" + target64=true ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" target64=true ;; + bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec) + tb="$tb elf64-hppa.lo elf64.lo $elf" + target64=true ;; + bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" + target64=true ;; + bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" + target64=true ;; + bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; @@ -5084,19 +5957,27 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" target64=true ;; + bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; + bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; - bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec) + tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; + bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" + target64=true ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; + bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" target64=true ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; + bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; @@ -5109,7 +5990,11 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; + bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" target64=true ;; @@ -5119,6 +6004,7 @@ do 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" ;; demo_64_vec) tb="$tb demo64.lo aout64.lo" target64=true ;; ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; @@ -5161,14 +6047,16 @@ do m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;; m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; m88kbcs_vec) tb="$tb coff-m88k.lo" ;; - mipslpe_vec) tb="$tb pe-mips.lo cofflink.lo" ;; - mipslpei_vec) tb="$tb pei-mips.lo cofflink.lo" ;; + mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; + mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; + rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" + target64=true ;; nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo" target64=true ;; @@ -5187,8 +6075,8 @@ do shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo cofflink.lo" ;; - shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo cofflink.lo" ;; + shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; + shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; som_vec) tb="$tb som.lo" ;; sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;; sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;; @@ -5202,6 +6090,12 @@ do tekhex_vec) tb="$tb tekhex.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; + tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; versados_vec) tb="$tb versados.lo" ;; vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" @@ -5291,17 +6185,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:5295: checking for $ac_hdr" >&5 +echo "configure:6189: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5300 "configure" +#line 6194 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6199: \"$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* @@ -5330,12 +6224,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5334: checking for $ac_func" >&5 +echo "configure:6228: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5339 "configure" +#line 6233 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5358,7 +6252,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6256: \"$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 @@ -5383,7 +6277,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5387: checking for working mmap" >&5 +echo "configure:6281: 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 @@ -5391,7 +6285,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 5395 "configure" +#line 6289 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -5418,15 +6312,12 @@ else #include <sys/types.h> #include <fcntl.h> #include <sys/mman.h> -#include <stdlib.h> -#include <sys/stat.h> - -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -5481,7 +6372,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = (char*)malloc(pagesize); + data = malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -5502,7 +6393,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = (char*)malloc(2 * pagesize); + data2 = malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -5520,7 +6411,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = (char*)malloc(pagesize); + data3 = malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -5534,7 +6425,7 @@ main() } EOF -if { (eval echo configure:5538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6429: \"$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 @@ -5559,12 +6450,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5563: checking for $ac_func" >&5 +echo "configure:6454: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5568 "configure" +#line 6459 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5587,7 +6478,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6482: \"$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 @@ -5767,7 +6658,6 @@ 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 @@ -5781,12 +6671,16 @@ 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 +s%@STRIP@%$STRIP%g s%@LIBTOOL@%$LIBTOOL%g +s%@WARN_CFLAGS@%$WARN_CFLAGS%g s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g s%@MAINT@%$MAINT%g -s%@EXEEXT@%$EXEEXT%g s%@CPP@%$CPP%g s%@ALLOCA@%$ALLOCA%g s%@USE_NLS@%$USE_NLS%g diff --git a/contrib/binutils/bfd/configure.host b/contrib/binutils/bfd/configure.host index e24cd60..c72a4b3 100644 --- a/contrib/binutils/bfd/configure.host +++ b/contrib/binutils/bfd/configure.host @@ -27,6 +27,8 @@ hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;; hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;; hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;; +ia64-*-linux*) host64=true; HOST_64BIT_TYPE=long ;; + i[3456]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;; i[3456]86-sequent-sysv4*) ;; i[3456]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;; @@ -46,6 +48,10 @@ mips*-*-riscos*) HDEFINES="-G 4" ;; m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;; +*-*-aix*) HOST_64BIT_TYPE="long long" + HOST_U_64BIT_TYPE="unsigned long long" + ;; + *-*-solaris*) HOST_64BIT_TYPE="long long" HOST_U_64BIT_TYPE="unsigned long long" ;; diff --git a/contrib/binutils/bfd/configure.in b/contrib/binutils/bfd/configure.in index eac0a9e..eeb3eb7 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.10.1) +AM_INIT_AUTOMAKE(bfd, 2.11) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. @@ -50,6 +50,27 @@ AC_ARG_WITH(mmap, *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;; esac],[want_mmap=false])dnl +build_warnings="-W -Wall" +AC_ARG_ENABLE(build-warnings, +[ --enable-build-warnings Enable build-time compiler warnings if gcc is used], +[case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting warning flags = $build_warnings" 6>&1 +fi])dnl +WARN_CFLAGS="" +if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then + WARN_CFLAGS="${build_warnings}" +fi +AC_SUBST(WARN_CFLAGS) + AM_CONFIG_HEADER(config.h:config.in) if test -z "$target" ; then @@ -114,13 +135,16 @@ COREFLAG= TRAD_HEADER= if test "${target}" = "${host}"; then case "${host}" in + alpha*-*-freebsd*) + COREFILE='' + ;; alpha*-*-linux-gnu*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/alphalinux.h"' ;; alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;; - alpha*-*-freebsd*) ;; alpha*-*-*) COREFILE=osf-core.lo ;; + arm-*-freebsd*) COREFILE='' ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; hppa*-*-hiux*) COREFILE=hpux-core.lo ;; @@ -146,12 +170,18 @@ changequote([,])dnl TRAD_HEADER='"hosts/symmetry.h"' ;; changequote(,)dnl - i[3456]86-*-bsd* | i[3456]86-*-freebsd*) + i[3456]86-*-bsd* | i[34567]86-*-freebsd[1234] | i[34567]86-*-freebsd[1234]\.* | i[34567]86-*-freebsd*aout*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' ;; changequote(,)dnl + i[3456]86-*-freebsd*) +changequote([,])dnl + COREFILE='' + TRAD_HEADER='"hosts/i386bsd.h"' + ;; +changequote(,)dnl i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) changequote([,])dnl COREFILE=netbsd-core.lo @@ -266,12 +296,19 @@ changequote([,])dnl COREFILE=netbsd-core.lo ;; rs6000-*-lynx*) COREFILE=lynx-core.lo ;; +changequote(,)dnl + rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*) +changequote([,])dnl + COREFILE=rs6000-core.lo + COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE" + ;; 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 ;; sparc-*-netbsd* | sparc-*-openbsd*) COREFILE=netbsd-core.lo @@ -313,11 +350,18 @@ changequote([,])dnl AC_CHECK_HEADERS(sys/procfs.h) if test "$ac_cv_header_sys_procfs_h" = yes; then BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t) BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who) BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t) BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t) + BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t) BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t) + BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t) BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t) BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context) BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg) BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t) @@ -325,8 +369,10 @@ changequote([,])dnl fi AC_SUBST(COREFILE) AC_SUBST(COREFLAG) -AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, - [Name of host specific header file to include in trad-core.c.]) +if test -n "$TRAD_HEADER"; then + AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, + [Name of host specific header file to include in trad-core.c.]) +fi # Horrible hacks to build DLLs on Windows. WIN32LDFLAGS= @@ -410,7 +456,7 @@ selarchs="$f" # Target backend .o files. tb= -elf="elf.lo elflink.lo dwarf2.lo dwarf1.lo" +elf="elf.lo elflink.lo dwarf1.lo" for vec in $selvecs do @@ -438,8 +484,19 @@ do apollocoff_vec) tb="$tb coff-apollo.lo" ;; 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" + target64=true ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" target64=true ;; + bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec) + tb="$tb elf64-hppa.lo elf64.lo $elf" + target64=true ;; + bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" + target64=true ;; + bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" + target64=true ;; + bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; @@ -451,19 +508,27 @@ do bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" target64=true ;; + bfd_elf32_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; + bfd_elf32_us_cris_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; - bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec) + tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; + bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" + target64=true ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; + bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo" target64=true ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; + bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; @@ -476,7 +541,11 @@ do bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; + bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; + bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf" target64=true ;; @@ -486,6 +555,7 @@ do 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" ;; demo_64_vec) tb="$tb demo64.lo aout64.lo" target64=true ;; ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; @@ -528,14 +598,16 @@ do m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;; m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; m88kbcs_vec) tb="$tb coff-m88k.lo" ;; - mipslpe_vec) tb="$tb pe-mips.lo cofflink.lo" ;; - mipslpei_vec) tb="$tb pei-mips.lo cofflink.lo" ;; + mipslpe_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; + mipslpei_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; + rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo" + target64=true ;; nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; nlm32_alpha_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo" target64=true ;; @@ -554,8 +626,8 @@ do shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo cofflink.lo" ;; - shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo cofflink.lo" ;; + shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; + shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; som_vec) tb="$tb som.lo" ;; sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;; sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;; @@ -569,6 +641,12 @@ do tekhex_vec) tb="$tb tekhex.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; + tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; + tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; versados_vec) tb="$tb versados.lo" ;; vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" diff --git a/contrib/binutils/bfd/corefile.c b/contrib/binutils/bfd/corefile.c index 212f519..061383f 100644 --- a/contrib/binutils/bfd/corefile.c +++ b/contrib/binutils/bfd/corefile.c @@ -30,7 +30,6 @@ DESCRIPTION #include "sysdep.h" #include "libbfd.h" - /* FUNCTION bfd_core_file_failing_command @@ -78,7 +77,6 @@ bfd_core_file_failing_signal (abfd) return BFD_SEND (abfd, _core_file_failing_signal, (abfd)); } - /* FUNCTION core_file_matches_executable_p diff --git a/contrib/binutils/bfd/cpu-alpha.c b/contrib/binutils/bfd/cpu-alpha.c index b89900b..48a16e3 100644 --- a/contrib/binutils/bfd/cpu-alpha.c +++ b/contrib/binutils/bfd/cpu-alpha.c @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NN(index) (&arch_info_struct[index]) /* These exist only so that we can resonably disassemble PALcode. */ -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { N (64, 64, bfd_mach_alpha_ev4, "alpha:ev4", false, NN(1)), N (64, 64, bfd_mach_alpha_ev5, "alpha:ev5", false, NN(2)), diff --git a/contrib/binutils/bfd/cpu-arm.c b/contrib/binutils/bfd/cpu-arm.c index bda9c44..91507f8 100644 --- a/contrib/binutils/bfd/cpu-arm.c +++ b/contrib/binutils/bfd/cpu-arm.c @@ -47,7 +47,7 @@ compatible (a,b) it can be polymorphed into the other */ if (a->the_default) return b; - + if (b->the_default) return a; @@ -93,9 +93,10 @@ processors[] = { bfd_mach_arm_4, "strongarm"}, { bfd_mach_arm_4, "strongarm110" }, { bfd_mach_arm_4, "strongarm1100" }, + { bfd_mach_arm_XScale, "xscale" } }; -static boolean +static boolean scan (info, string) const struct bfd_arch_info * info; const char * string; @@ -119,16 +120,15 @@ scan (info, string) /* Finally check for the default architecture */ if (strcasecmp (string, "arm") == 0) return info->the_default; - + return false; } - #define N(number, print, default, next) \ { 32, 32, 8, bfd_arch_arm, number, "arm", print, 4, default, compatible, scan, next } static const bfd_arch_info_type arch_info_struct[] = -{ +{ N( bfd_mach_arm_2, "armv2", false, & arch_info_struct[1] ), N( bfd_mach_arm_2a, "armv2a", false, & arch_info_struct[2] ), N( bfd_mach_arm_3, "armv3", false, & arch_info_struct[3] ), @@ -136,7 +136,9 @@ static const bfd_arch_info_type arch_info_struct[] = N( bfd_mach_arm_4, "armv4", false, & arch_info_struct[5] ), N( bfd_mach_arm_4T, "armv4t", false, & arch_info_struct[6] ), N( bfd_mach_arm_5, "armv5", false, & arch_info_struct[7] ), - N( bfd_mach_arm_5T, "armv5t", false, NULL ) + N( bfd_mach_arm_5T, "armv5t", false, & arch_info_struct[8] ), + N( bfd_mach_arm_5TE, "armv5te", false, & arch_info_struct[9] ), + N( bfd_mach_arm_XScale, "xscale", false, NULL ) }; const bfd_arch_info_type bfd_arm_arch = diff --git a/contrib/binutils/bfd/cpu-i386.c b/contrib/binutils/bfd/cpu-i386.c index f5b9b18..c3e9baf 100644 --- a/contrib/binutils/bfd/cpu-i386.c +++ b/contrib/binutils/bfd/cpu-i386.c @@ -32,10 +32,25 @@ const bfd_arch_info_type bfd_i386_arch_intel_syntax = "i386:intel", 3, true, - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , 0, }; +const bfd_arch_info_type bfd_x86_64_arch_intel_syntax = +{ + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_i386, + bfd_mach_x86_64_intel_syntax, + "x86_64:intel", + "x86_64:intel", + 3, + true, + bfd_default_compatible, + bfd_default_scan , + &bfd_i386_arch_intel_syntax, +}; static const bfd_arch_info_type i8086_arch = { 32, /* 32 bits in a word */ @@ -47,9 +62,25 @@ static const bfd_arch_info_type i8086_arch = "i8086", 3, false, - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , - &bfd_i386_arch_intel_syntax, + &bfd_x86_64_arch_intel_syntax, +}; + +const bfd_arch_info_type bfd_x86_64_arch = +{ + 64, /* 32 bits in a word */ + 64, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_i386, + bfd_mach_x86_64, + "x86_64", + "x86_64", + 3, + true, + bfd_default_compatible, + bfd_default_scan , + &i8086_arch, }; const bfd_arch_info_type bfd_i386_arch = @@ -63,8 +94,7 @@ const bfd_arch_info_type bfd_i386_arch = "i386", 3, true, - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , - &i8086_arch, + &bfd_x86_64_arch }; - diff --git a/contrib/binutils/bfd/cpu-powerpc.c b/contrib/binutils/bfd/cpu-powerpc.c index 11f0f80..2e41899 100644 --- a/contrib/binutils/bfd/cpu-powerpc.c +++ b/contrib/binutils/bfd/cpu-powerpc.c @@ -54,12 +54,12 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 603, /* for the mpc603 */ + bfd_mach_ppc_603, "powerpc", "powerpc:603", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[1] }, @@ -68,12 +68,12 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 604, /* for the mpc604 */ + bfd_mach_ppc_ec603e, "powerpc", - "powerpc:604", + "powerpc:EC603e", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[2] }, @@ -82,12 +82,12 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 403, /* for the 403 */ + bfd_mach_ppc_604, "powerpc", - "powerpc:403", + "powerpc:604", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[3] }, @@ -96,12 +96,124 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 601, /* for the mpc601 */ + bfd_mach_ppc_403, + "powerpc", + "powerpc:403", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[4] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_601, "powerpc", "powerpc:601", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[5] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_620, + "powerpc", + "powerpc:620", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[6] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_630, + "powerpc", + "powerpc:630", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[7] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_a35, + "powerpc", + "powerpc:a35", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[8] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_rs64ii, + "powerpc", + "powerpc:rs64ii", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[9] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_rs64iii, + "powerpc", + "powerpc:rs64iii", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[10] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_7400, + "powerpc", + "powerpc:7400", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[11] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_860, + "powerpc", + "powerpc:MPC8XX", + 3, + false, /* not the default */ + powerpc_compatible, bfd_default_scan, 0 } @@ -113,12 +225,12 @@ const bfd_arch_info_type bfd_powerpc_arch = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 0, /* for the POWER/PowerPC common architecture */ + bfd_mach_ppc, /* for the POWER/PowerPC common architecture */ "powerpc", "powerpc:common", 3, true, /* the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[0] }; diff --git a/contrib/binutils/bfd/cpu-sparc.c b/contrib/binutils/bfd/cpu-sparc.c index 234bd92..5c777d2 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, 1997 Free Software Foundation, Inc. + Copyright (C) 1992, 94, 95, 96, 97, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -49,7 +49,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:sparclet", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[1], }, @@ -63,7 +63,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:sparclite", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[2], }, @@ -77,7 +77,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v8plus", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[3], }, @@ -91,7 +91,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v8plusa", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[4], }, @@ -105,7 +105,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:sparclite_le", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[5], }, @@ -119,7 +119,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v9", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[6], }, @@ -133,7 +133,35 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v9a", 3, false, - sparc_compatible, + sparc_compatible, + bfd_default_scan, + &arch_info_struct[7], + }, + { + 32, /* bits in a word */ + 32, /* bits in an address */ + 8, /* bits in a byte */ + bfd_arch_sparc, + bfd_mach_sparc_v8plusb, + "sparc", + "sparc:v8plusb", + 3, + false, + sparc_compatible, + bfd_default_scan, + &arch_info_struct[8], + }, + { + 64, /* bits in a word */ + 64, /* bits in an address */ + 8, /* bits in a byte */ + bfd_arch_sparc, + bfd_mach_sparc_v9b, + "sparc", + "sparc:v9b", + 3, + false, + sparc_compatible, bfd_default_scan, 0, } @@ -150,7 +178,7 @@ const bfd_arch_info_type bfd_sparc_arch = "sparc", 3, true, /* the default */ - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[0], }; diff --git a/contrib/binutils/bfd/cpu-v850.c b/contrib/binutils/bfd/cpu-v850.c index 539413d..55606f8 100644 --- a/contrib/binutils/bfd/cpu-v850.c +++ b/contrib/binutils/bfd/cpu-v850.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <ctype.h> -static boolean +static boolean scan (info, string) const struct bfd_arch_info * info; const char * string; @@ -41,9 +41,9 @@ scan (info, string) architecture, eg the string m68k:68020 would match the m68k entry up to the :, then we get left with the machine number */ - for (ptr_src = string, ptr_tst = info->arch_name; + for (ptr_src = string, ptr_tst = info->arch_name; *ptr_src && *ptr_tst; - ptr_src++, ptr_tst++) + ptr_src++, ptr_tst++) { if (*ptr_src != *ptr_tst) break; } @@ -52,7 +52,7 @@ scan (info, string) colons */ if (*ptr_src == ':') ptr_src++; - + if (*ptr_src == 0) { /* nothing more, then only keep this one if it is the default @@ -67,15 +67,15 @@ scan (info, string) ptr_src++; } - switch (number) + switch (number) { case bfd_mach_v850e: arch = bfd_arch_v850; break; case bfd_mach_v850ea: arch = bfd_arch_v850; break; - default: + default: return false; } - if (arch != info->arch) + if (arch != info->arch) return false; if (number != info->mach) @@ -90,7 +90,7 @@ scan (info, string) #define NEXT NULL -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { N (bfd_mach_v850e, "v850e", false, &arch_info_struct[1]), N (bfd_mach_v850ea, "v850ea", false, NULL) diff --git a/contrib/binutils/bfd/cpu-z8k.c b/contrib/binutils/bfd/cpu-z8k.c index 5cce8eb..29682c1 100644 --- a/contrib/binutils/bfd/cpu-z8k.c +++ b/contrib/binutils/bfd/cpu-z8k.c @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" - #if 0 /* not used currently */ /* Relocations for the Z8K @@ -50,7 +49,6 @@ howto16_callback (abfd, reloc_entry, symbol_in, data, return bfd_reloc_ok; } - static bfd_reloc_status_type howto8_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) @@ -73,7 +71,6 @@ howto8_callback (abfd, reloc_entry, symbol_in, data, return bfd_reloc_ok; } - static bfd_reloc_status_type howto8_FFnn_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) @@ -119,8 +116,6 @@ howto8_pcrel_callback (abfd, reloc_entry, symbol_in, data, return bfd_reloc_ok; } - - static reloc_howto_type howto_16 = NEWHOWTO (howto16_callback, "abs16", 1, false, false); static reloc_howto_type howto_8 @@ -132,7 +127,6 @@ static reloc_howto_type howto_8_FFnn static reloc_howto_type howto_8_pcrel = NEWHOWTO (howto8_pcrel_callback, "pcrel8", 0, false, true); - static reloc_howto_type * local_bfd_reloc_type_lookup (arch, code) const struct bfd_arch_info *arch; @@ -172,7 +166,6 @@ scan_mach (info, string) return false; } - /* This routine is provided two arch_infos and returns whether they'd be compatible */ @@ -186,7 +179,6 @@ compatible (a, b) return a; } - static const bfd_arch_info_type arch_info_struct[] = { {32, 32, 8, bfd_arch_z8k, bfd_mach_z8001, "z8k", "z8001", 1, false, compatible, scan_mach, 0,}, diff --git a/contrib/binutils/bfd/dep-in.sed b/contrib/binutils/bfd/dep-in.sed index 9da181a..c3781f2 100644 --- a/contrib/binutils/bfd/dep-in.sed +++ b/contrib/binutils/bfd/dep-in.sed @@ -6,6 +6,7 @@ t loop s!\.o:!.lo:! s! @BFD_H@!!g s!@INCDIR@!$(INCDIR)!g +s!@SRCDIR@/../opcodes!$(srcdir)/../opcodes!g s!@SRCDIR@/!!g s! hosts/[^ ]*\.h! !g s/ sysdep.h//g diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog index def932c..57326a9 100644 --- a/contrib/binutils/bfd/doc/ChangeLog +++ b/contrib/binutils/bfd/doc/ChangeLog @@ -1,3 +1,30 @@ +2001-01-25 Kazu Hirata <kazu@hxi.com> + + * chew.c: Do not output trailing whitespaces in type and + functionname. Update copyright. + +2001-01-24 Kazu Hirata <kazu@hxi.com> + + * chew.c: Do not output a trailing whitespace. + +2000-11-06 Nick Clifton <nickc@redhat.com> + + * bfd.texinfo: Add GNU Free Documentation License. + +2000-07-09 Alan Modra <alan@linuxcare.com.au> + + * Makefile.in: Regenerate. + +2000-07-08 Alan Modra <alan@linuxcare.com.au> + + * chew.c (outputdots): Don't add a space before `/*'. + (courierize): Likewise. + +Wed May 24 12:03:25 2000 Hans-Peter Nilsson <hp@axis.com> + + * bfdint.texi (BFD ELF processor required): Add paragraph about + target necessities for readelf. + 2000-04-30 Ben Elliston <bje@redhat.com> * bfdint.texi (BFD generated files): Fix another typo. @@ -6,6 +33,10 @@ * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo. +Fri Apr 7 17:54:38 2000 Andrew Cagney <cagney@b1.cygnus.com> + + * Makefile.in: Rebuild with current autoconf/automake. + Thu Feb 4 23:21:36 1999 Ian Lance Taylor <ian@cygnus.com> * Makefile.in: Rebuild with current autoconf/automake. diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in index acdc9bf..dfc33e1 100644 --- a/contrib/binutils/bfd/doc/Makefile.in +++ b/contrib/binutils/bfd/doc/Makefile.in @@ -75,10 +75,14 @@ CC = @CC@ CC_FOR_BUILD = @CC_FOR_BUILD@ COREFILE = @COREFILE@ COREFLAG = @COREFLAG@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ @@ -96,14 +100,17 @@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +STRIP = @STRIP@ TDEFINES = @TDEFINES@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ WIN32LDFLAGS = @WIN32LDFLAGS@ WIN32LIBADD = @WIN32LIBADD@ all_backends = @all_backends@ @@ -187,7 +194,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: diff --git a/contrib/binutils/bfd/doc/aoutx.texi b/contrib/binutils/bfd/doc/aoutx.texi index d97e96a..d99fd05 100644 --- a/contrib/binutils/bfd/doc/aoutx.texi +++ b/contrib/binutils/bfd/doc/aoutx.texi @@ -148,7 +148,7 @@ Swap the information in an internal exec header structure @example const bfd_target *aout_@var{size}_some_aout_object_p (bfd *abfd, - const bfd_target *(*callback_to_real_object_p)()); + const bfd_target *(*callback_to_real_object_p) ()); @end example @strong{Description}@* Some a.out variant thinks that the file open in @var{abfd} diff --git a/contrib/binutils/bfd/doc/archures.texi b/contrib/binutils/bfd/doc/archures.texi index 6ee20e9..b363780 100644 --- a/contrib/binutils/bfd/doc/archures.texi +++ b/contrib/binutils/bfd/doc/archures.texi @@ -1,7 +1,7 @@ @section Architectures BFD keeps one atom in a BFD describing the architecture of the data attached to the BFD: a pointer to a -@code{bfd_arch_info_type}. +@code{bfd_arch_info_type}. Pointers to structures can be requested independently of a BFD so that an architecture's information can be interrogated @@ -11,13 +11,13 @@ The architecture information is provided by each architecture package. The set of default architectures is selected by the macro @code{SELECT_ARCHITECTURES}. This is normally set up in the @file{config/@var{target}.mt} file of your choice. If the name is not -defined, then all the architectures supported are included. +defined, then all the architectures supported are included. When BFD starts up, all the architectures are called with an initialize method. It is up to the architecture back end to insert as many items into the list of architectures as it wants to; generally this would be one for each machine and one for the -default case (an item with a machine field of 0). +default case (an item with a machine field of 0). BFD's idea of an architecture is implemented in @file{archures.c}. @@ -31,13 +31,13 @@ Another field indicates which processor within the family is in use. The machine gives a number which distinguishes different versions of the architecture, containing, for example, 2 and 3 for Intel i960 KA and i960 KB, -and 68020 and 68030 for Motorola 68020 and 68030. +and 68020 and 68030 for Motorola 68020 and 68030. @example -enum bfd_architecture +enum bfd_architecture @{ - bfd_arch_unknown, /* File arch not known */ - bfd_arch_obscure, /* Arch known, not one of these */ - bfd_arch_m68k, /* Motorola 68xxx */ + bfd_arch_unknown, /* File arch not known */ + bfd_arch_obscure, /* Arch known, not one of these */ + bfd_arch_m68k, /* Motorola 68xxx */ #define bfd_mach_m68000 1 #define bfd_mach_m68008 2 #define bfd_mach_m68010 3 @@ -46,14 +46,14 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that + bfd_arch_vax, /* DEC Vax */ + bfd_arch_i960, /* Intel 960 */ + /* The order of the following is important. + lower number indicates a machine type that only accepts a subset of the instructions available to machines with higher numbers. The exception is the "ca", which is - incompatible with all other machines except + incompatible with all other machines except "core". */ #define bfd_mach_i960_core 1 @@ -65,21 +65,24 @@ enum bfd_architecture #define bfd_mach_i960_jx 7 #define bfd_mach_i960_hx 8 - bfd_arch_a29k, /* AMD 29000 */ - bfd_arch_sparc, /* SPARC */ + bfd_arch_a29k, /* AMD 29000 */ + bfd_arch_sparc, /* SPARC */ #define bfd_mach_sparc 1 - /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ +/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 #define bfd_mach_sparc_sparclite 3 #define bfd_mach_sparc_v8plus 4 -#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ +#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ #define bfd_mach_sparc_sparclite_le 6 #define bfd_mach_sparc_v9 7 -#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ - /* Nonzero if MACH has the v9 instruction set. */ +#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ +#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */ +#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */ +/* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a) - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + && (mach) != bfd_mach_sparc_sparclite_le) + bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -95,36 +98,66 @@ enum bfd_architecture #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 #define bfd_mach_mips16 16 - bfd_arch_i386, /* Intel 386 */ +#define bfd_mach_mips32 32 +#define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */ +#define bfd_mach_mips5 5 +#define bfd_mach_mips64 64 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ + bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_i386 0 #define bfd_mach_i386_i8086 1 #define bfd_mach_i386_i386_intel_syntax 2 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_alliant, /* Alliant */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Hitachi H8/300 */ +#define bfd_mach_x86_64 3 +#define bfd_mach_x86_64_intel_syntax 4 + bfd_arch_we32k, /* AT&T WE32xxx */ + bfd_arch_tahoe, /* CCI/Harris Tahoe */ + bfd_arch_i860, /* Intel 860 */ + bfd_arch_i370, /* IBM 360/370 Mainframes */ + bfd_arch_romp, /* IBM ROMP PC/RT */ + bfd_arch_alliant, /* Alliant */ + bfd_arch_convex, /* Convex */ + bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_pyramid, /* Pyramid Technology */ + bfd_arch_h8300, /* Hitachi H8/300 */ #define bfd_mach_h8300 1 #define bfd_mach_h8300h 2 #define bfd_mach_h8300s 3 - bfd_arch_powerpc, /* PowerPC */ - bfd_arch_rs6000, /* IBM RS/6000 */ - bfd_arch_hppa, /* HP PA RISC */ - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_powerpc, /* PowerPC */ +#define bfd_mach_ppc 0 +#define bfd_mach_ppc_403 403 +#define bfd_mach_ppc_403gc 4030 +#define bfd_mach_ppc_505 505 +#define bfd_mach_ppc_601 601 +#define bfd_mach_ppc_602 602 +#define bfd_mach_ppc_603 603 +#define bfd_mach_ppc_ec603e 6031 +#define bfd_mach_ppc_604 604 +#define bfd_mach_ppc_620 620 +#define bfd_mach_ppc_630 630 +#define bfd_mach_ppc_750 750 +#define bfd_mach_ppc_860 860 +#define bfd_mach_ppc_a35 35 +#define bfd_mach_ppc_rs64ii 642 +#define bfd_mach_ppc_rs64iii 643 +#define bfd_mach_ppc_7400 7400 + bfd_arch_rs6000, /* IBM RS/6000 */ +#define bfd_mach_rs6k 0 +#define bfd_mach_rs6k_rs1 6001 +#define bfd_mach_rs6k_rsc 6003 +#define bfd_mach_rs6k_rs2 6002 + bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_d10v, /* Mitsubishi D10V */ #define bfd_mach_d10v 0 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_d30v, /* Mitsubishi D30V */ + bfd_arch_m68hc11, /* Motorola 68HC11 */ + bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_z8k, /* Zilog Z8000 */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Hitachi H8/500 */ - bfd_arch_sh, /* Hitachi SH */ + bfd_arch_h8500, /* Hitachi H8/500 */ + bfd_arch_sh, /* Hitachi SH */ #define bfd_mach_sh 0 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d @@ -132,11 +165,11 @@ enum bfd_architecture #define bfd_mach_sh3_dsp 0x3d #define bfd_mach_sh3e 0x3e #define bfd_mach_sh4 0x40 - bfd_arch_alpha, /* Dec Alpha */ + bfd_arch_alpha, /* Dec Alpha */ #define bfd_mach_alpha_ev4 0x10 #define bfd_mach_alpha_ev5 0x20 #define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM */ + bfd_arch_arm, /* Advanced Risc Machines ARM */ #define bfd_mach_arm_2 1 #define bfd_mach_arm_2a 2 #define bfd_mach_arm_3 3 @@ -145,32 +178,43 @@ enum bfd_architecture #define bfd_mach_arm_4T 6 #define bfd_mach_arm_5 7 #define bfd_mach_arm_5T 8 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ +#define bfd_mach_arm_5TE 9 +#define bfd_mach_arm_XScale 10 + bfd_arch_ns32k, /* National Semiconductors ns32000 */ + bfd_arch_w65, /* WDC 65816 */ + bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ + bfd_arch_tic80, /* TI TMS320c80 (MVP) */ + bfd_arch_v850, /* NEC V850 */ #define bfd_mach_v850 0 #define bfd_mach_v850e 'E' #define bfd_mach_v850ea 'A' - bfd_arch_arc, /* Argonaut RISC Core */ -#define bfd_mach_arc_base 0 - bfd_arch_m32r, /* Mitsubishi M32R/D */ -#define bfd_mach_m32r 0 /* backwards compatibility */ + bfd_arch_arc, /* ARC Cores */ +#define bfd_mach_arc_5 0 +#define bfd_mach_arc_6 1 +#define bfd_mach_arc_7 2 +#define bfd_mach_arc_8 3 + bfd_arch_m32r, /* Mitsubishi M32R/D */ +#define bfd_mach_m32r 0 /* backwards compatibility */ #define bfd_mach_m32rx 'x' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ + bfd_arch_mn10200, /* Matsushita MN10200 */ + bfd_arch_mn10300, /* Matsushita MN10300 */ #define bfd_mach_mn10300 300 #define bfd_mach_am33 330 bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 bfd_arch_mcore, + bfd_arch_ia64, /* HP/Intel ia64 */ +#define bfd_mach_ia64_elf64 0 +#define bfd_mach_ia64_elf32 1 bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers */ + bfd_arch_avr, /* Atmel AVR microcontrollers */ #define bfd_mach_avr1 1 #define bfd_mach_avr2 2 #define bfd_mach_avr3 3 #define bfd_mach_avr4 4 +#define bfd_mach_avr5 5 + bfd_arch_cris, /* Axis CRIS */ bfd_arch_last @}; @end example @@ -183,7 +227,7 @@ This structure contains information on architectures for use within BFD. @example -typedef struct bfd_arch_info +typedef struct bfd_arch_info @{ int bits_per_word; int bits_per_address; @@ -193,8 +237,8 @@ typedef struct bfd_arch_info const char *arch_name; const char *printable_name; unsigned int section_align_power; - /* true if this is the default machine for the architecture */ - boolean the_default; + /* True if this is the default machine for the architecture. */ + boolean the_default; const struct bfd_arch_info * (*compatible) PARAMS ((const struct bfd_arch_info *a, const struct bfd_arch_info *b)); @@ -380,7 +424,7 @@ const char *bfd_printable_arch_mach @end example @strong{Description}@* Return a printable string representing the architecture and -machine type. +machine type. This routine is depreciated. @@ -404,6 +448,7 @@ unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, @end example @strong{Description}@* See bfd_octets_per_byte. + This routine is provided for those cases where a bfd * is not available diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo index a302bcf..9803371 100644 --- a/contrib/binutils/bfd/doc/bfd.texinfo +++ b/contrib/binutils/bfd/doc/bfd.texinfo @@ -1,6 +1,6 @@ \input texinfo.tex @setfilename bfd.info -@c $Id: bfd.texinfo,v 1.1.1.1 1999/05/03 07:28:58 rth Exp $ +@c $Id: bfd.texinfo,v 1.2 2000/11/15 18:24:49 nickc Exp $ @tex % NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE \global\long\def\example{% @@ -28,11 +28,14 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the BFD library. -Copyright (C) 1991 Free Software Foundation, Inc. +Copyright (C) 1991, 2000 Free Software Foundation, Inc. -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with no Invariant Sections, with no Front-Cover Texts, and with no + Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". @ignore Permission is granted to process this file through Tex and print the @@ -41,14 +44,6 @@ notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, subject to the terms -of the GNU General Public License, which includes the provision that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. @end ifinfo @iftex @c@finalout @@ -67,7 +62,7 @@ into another language, under the above conditions for modified versions. @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.1.1.1 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.2 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Support\par \hfill sac\@cygnus.com\par @@ -80,18 +75,13 @@ into another language, under the above conditions for modified versions. @vskip 0pt plus 1filll Copyright @copyright{} 1991 Free Software Foundation, Inc. -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with no Invariant Sections, with no Front-Cover Texts, and with no + Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, subject to the terms -of the GNU General Public License, which includes the provision that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. @end titlepage @end iftex @@ -104,6 +94,7 @@ This file documents the binary file descriptor library libbfd. * Overview:: Overview of BFD * BFD front end:: BFD front end * BFD back ends:: BFD back ends +* GNU Free Documentation License:: GNU Free Documentation License * Index:: Index @end menu @@ -298,7 +289,7 @@ structures. @node Hash Tables, , Linker Functions, BFD front end @include hash.texi -@node BFD back ends, Index, BFD front end, Top +@node BFD back ends, GNU Free Documentation License, BFD front end, Top @chapter BFD back ends @menu * What to Put Where:: @@ -325,7 +316,371 @@ All of BFD lives in one directory. @c Leave this out until the file has some actual contents... @c @include elfcode.texi -@node Index, , BFD back ends , Top +@node GNU Free Documentation License, Index, BFD back ends, Top +@chapter GNU Free Documentation License +@cindex GNU Free Documentation License + + GNU Free Documentation License + + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML produced by some word processors for output +purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than five). +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section entitled "History", and its title, and add to + it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section as "Endorsements" + or to conflict in title with any Invariant Section. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". +@end smallexample + +If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of +"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@node Index, , GNU Free Documentation License , Top @unnumbered Index @printindex cp diff --git a/contrib/binutils/bfd/doc/bfdint.texi b/contrib/binutils/bfd/doc/bfdint.texi index 39eaacf..b0a0182 100644 --- a/contrib/binutils/bfd/doc/bfdint.texi +++ b/contrib/binutils/bfd/doc/bfdint.texi @@ -18,8 +18,7 @@ This document describes some BFD internal information which may be helpful when working on BFD. It is very incomplete. -This document is not updated regularly, and may be out of date. It was -last modified on $Date: 2000/04/30 15:07:52 $. +This document is not updated regularly, and may be out of date. The initial version of this document was written by Ian Lance Taylor @email{ian@@cygnus.com}. @@ -1607,6 +1606,10 @@ it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER}, macros to create a table mapping the number used to indentify a relocation to a name describing that relocation. +While not a BFD component, you probably also want to make the binutils +program @samp{readelf} parse your ELF objects. For this, you need to add +code for @code{EM_@var{cpu}} as appropriate in @file{binutils/readelf.c}. + @node BFD ELF processor linker @subsubsection Processor specific linker support diff --git a/contrib/binutils/bfd/doc/bfdt.texi b/contrib/binutils/bfd/doc/bfdt.texi index 98269fb..b9e6fb7 100644 --- a/contrib/binutils/bfd/doc/bfdt.texi +++ b/contrib/binutils/bfd/doc/bfdt.texi @@ -10,10 +10,10 @@ to the rest of the data. @example -struct _bfd +struct _bfd @{ /* The filename the application opened the BFD with. */ - CONST char *filename; + CONST char *filename; /* A pointer to the target jump table. */ const struct bfd_target *xvec; @@ -46,7 +46,7 @@ struct _bfd /* When a file is closed by the caching routines, BFD retains state information on the file here: */ - file_ptr where; + file_ptr where; /* and here: (``once'' means at least once) */ @@ -59,7 +59,7 @@ struct _bfd /* File modified time, if mtime_set is true: */ - long mtime; + long mtime; /* Reserved for an unimplemented file locking extension.*/ @@ -78,13 +78,13 @@ struct _bfd /* Format_specific flags*/ - flagword flags; + flagword flags; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of origin, with origin set to 0 for non archive files. */ - file_ptr origin; + file_ptr origin; /* Remember when output has begun, to stop strange things from happening. */ @@ -96,7 +96,7 @@ struct _bfd /* The number of sections */ unsigned int section_count; - /* Stuff only useful for object files: + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; @@ -104,17 +104,17 @@ struct _bfd unsigned int symcount; /* Symbol table for output BFD (with symcount entries) */ - struct symbol_cache_entry **outsymbols; + struct symbol_cache_entry **outsymbols; /* Pointer to structure which contains architecture information*/ const struct bfd_arch_info *arch_info; /* Stuff only useful for archives:*/ - PTR arelt_data; + PTR arelt_data; struct _bfd *my_archive; /* The containing archive BFD. */ struct _bfd *next; /* The next BFD in the archive. */ struct _bfd *archive_head; /* The first BFD in the archive. */ - boolean has_armap; + boolean has_armap; /* A chain of BFD structures involved in a link. */ struct _bfd *link_next; @@ -125,7 +125,7 @@ struct _bfd /* Used by the back end to hold private data. */ - union + union @{ struct aout_data_struct *aout_data; struct artdata *aout_ar_data; @@ -157,7 +157,7 @@ struct _bfd struct netbsd_core_struct *netbsd_core_data; PTR any; @} tdata; - + /* Used by the application to hold private data*/ PTR usrdata; @@ -366,6 +366,39 @@ type of file. E.g., an attempt was made to set the @code{D_PAGED} bit on a BFD format which does not support demand paging. @end itemize +@findex bfd_get_arch_size +@subsubsection @code{bfd_get_arch_size} +@strong{Synopsis} +@example +int bfd_get_arch_size (bfd *abfd); +@end example +@strong{Description}@* +Returns the architecture address size, in bits, as determined +by the object file's format. For ELF, this information is +included in the header. + +@strong{Returns}@* +Returns the arch size in bits if known, @code{-1} otherwise. + +@findex bfd_get_sign_extend_vma +@subsubsection @code{bfd_get_sign_extend_vma} +@strong{Synopsis} +@example +int bfd_get_sign_extend_vma (bfd *abfd); +@end example +@strong{Description}@* +Indicates if the target architecture "naturally" sign extends +an address. Some architectures implicitly sign extend address +values when they are converted to types larger than the size +of an address. For instance, bfd_get_start_address() will +return an address sign extended to fill a bfd_vma when this is +the case. + +@strong{Returns}@* +Returns @code{1} if the target architecture is known to sign +extend addresses, @code{0} if the target architecture is known to +not sign extend addresses, and @code{-1} otherwise. + @findex bfd_set_start_address @subsubsection @code{bfd_set_start_address} @strong{Synopsis} @@ -407,7 +440,7 @@ it so that such results were guaranteed. Instead, we want to ask questions like "is this NNN byte sized object I'm about to try read from file offset YYY reasonable?" As as example of where we might do this, some object formats -use string tables for which the first @code{sizeof(long)} bytes of the +use string tables for which the first @code{sizeof (long)} bytes of the table contain the size of the table itself, including the size bytes. If an application tries to read what it thinks is one of these string tables, without some way to validate the size, and for @@ -466,7 +499,7 @@ Overflow is not detected. boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); @end example @strong{Description}@* -Copy private BFD information from the BFD @var{ibfd} to the +Copy private BFD information from the BFD @var{ibfd} to the the BFD @var{obfd}. Return @code{true} on success, @code{false} on error. Possible error returns are: @@ -489,7 +522,7 @@ Not enough memory exists to create private data for @var{obfd}. boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); @end example @strong{Description}@* -Merge private BFD information from the BFD @var{ibfd} to the +Merge private BFD information from the BFD @var{ibfd} to the the output file BFD @var{obfd} when linking. Return @code{true} on success, @code{false} on error. Possible error returns are: @@ -539,7 +572,7 @@ Stuff which should be documented: #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ + /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) diff --git a/contrib/binutils/bfd/doc/cache.texi b/contrib/binutils/bfd/doc/cache.texi index 4aafb69..56d1f18 100644 --- a/contrib/binutils/bfd/doc/cache.texi +++ b/contrib/binutils/bfd/doc/cache.texi @@ -40,7 +40,7 @@ otherwise, it has to perform the complicated lookup function. @example #define bfd_cache_lookup(x) \ ((x)==bfd_last_cache? \ - (FILE*)(bfd_last_cache->iostream): \ + (FILE*) (bfd_last_cache->iostream): \ bfd_cache_lookup_worker(x)) @end example diff --git a/contrib/binutils/bfd/doc/chew.c b/contrib/binutils/bfd/doc/chew.c index eba69c2..7b98ccf 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 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998, 2000, 2001 Free Software Foundation, Inc. Contributed by steve chamberlain @cygnus @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Yet another way of extracting documentation from source. No, I haven't finished it yet, but I hope you people like it better than the old way - + sac Basically, this is a sort of string forth, maybe we should call it @@ -81,7 +81,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foo. */ - #include <ansidecl.h> #include "sysdep.h" #include <assert.h> @@ -96,16 +95,15 @@ int internal_mode; int warning; -/* Here is a string type ... */ +/* Here is a string type ... */ -typedef struct buffer +typedef struct buffer { char *ptr; unsigned long write_idx; unsigned long size; } string_type; - #ifdef __STDC__ static void init_string_with_size (string_type *, unsigned int); static void init_string (string_type *); @@ -121,100 +119,104 @@ static void cattext (string_type *, char *); static void catstr (string_type *, string_type *); #endif - -static void DEFUN(init_string_with_size,(buffer, size), - string_type *buffer AND - unsigned int size ) +static void +init_string_with_size (buffer, size) + string_type *buffer; + unsigned int size; { - buffer->write_idx = 0; - buffer->size = size; - buffer->ptr = malloc(size); + buffer->write_idx = 0; + buffer->size = size; + buffer->ptr = malloc (size); } -static void DEFUN(init_string,(buffer), - string_type *buffer) +static void +init_string (buffer) + string_type *buffer; { - init_string_with_size(buffer, DEF_SIZE); - + init_string_with_size (buffer, DEF_SIZE); } -static int DEFUN(find, (str, what), - string_type *str AND - char *what) +static int +find (str, what) + string_type *str; + char *what; { - unsigned int i; - char *p; - p = what; - for (i = 0; i < str->write_idx && *p; i++) + unsigned int i; + char *p; + p = what; + for (i = 0; i < str->write_idx && *p; i++) { - if (*p == str->ptr[i]) - p++; - else - p = what; + if (*p == str->ptr[i]) + p++; + else + p = what; } - return (*p == 0); - + return (*p == 0); } -static void DEFUN(write_buffer,(buffer, f), - string_type *buffer AND - FILE *f) +static void +write_buffer (buffer, f) + string_type *buffer; + FILE *f; { - fwrite(buffer->ptr, buffer->write_idx, 1, f); + fwrite (buffer->ptr, buffer->write_idx, 1, f); } - -static void DEFUN(delete_string,(buffer), - string_type *buffer) +static void +delete_string (buffer) + string_type *buffer; { - free(buffer->ptr); + free (buffer->ptr); } - -static char *DEFUN(addr, (buffer, idx), - string_type *buffer AND - unsigned int idx) +static char * +addr (buffer, idx) + string_type *buffer; + unsigned int idx; { - return buffer->ptr + idx; + return buffer->ptr + idx; } -static char DEFUN(at,(buffer, pos), - string_type *buffer AND - unsigned int pos) +static char +at (buffer, pos) + string_type *buffer; + unsigned int pos; { - if (pos >= buffer->write_idx) + if (pos >= buffer->write_idx) return 0; return buffer->ptr[pos]; } -static void DEFUN(catchar,(buffer, ch), - string_type *buffer AND - int ch) +static void +catchar (buffer, ch) + string_type *buffer; + int ch; { - if (buffer->write_idx == buffer->size) + if (buffer->write_idx == buffer->size) { - buffer->size *=2; - buffer->ptr = realloc(buffer->ptr, buffer->size); + buffer->size *= 2; + buffer->ptr = realloc (buffer->ptr, buffer->size); } - buffer->ptr[buffer->write_idx ++ ] = ch; + buffer->ptr[buffer->write_idx++] = ch; } - -static void DEFUN(overwrite_string,(dst, src), - string_type *dst AND - string_type *src) -{ - free(dst->ptr); - dst->size = src->size; - dst->write_idx = src->write_idx; - dst->ptr = src->ptr; +static void +overwrite_string (dst, src) + string_type *dst; + string_type *src; +{ + free (dst->ptr); + dst->size = src->size; + dst->write_idx = src->write_idx; + dst->ptr = src->ptr; } -static void DEFUN(catbuf,(buffer, buf, len), - string_type *buffer AND - char *buf AND - unsigned int len) +static void +catbuf (buffer, buf, len) + string_type *buffer; + char *buf; + unsigned int len; { if (buffer->write_idx + len >= buffer->size) { @@ -226,41 +228,41 @@ static void DEFUN(catbuf,(buffer, buf, len), buffer->write_idx += len; } -static void DEFUN(cattext,(buffer, string), - string_type *buffer AND - char *string) +static void +cattext (buffer, string) + string_type *buffer; + char *string; { catbuf (buffer, string, (unsigned int) strlen (string)); } -static void DEFUN(catstr,(dst, src), - string_type *dst AND - string_type *src) +static void +catstr (dst, src) + string_type *dst; + string_type *src; { catbuf (dst, src->ptr, src->write_idx); } - -static unsigned int -DEFUN(skip_white_and_stars,(src, idx), - string_type *src AND - unsigned int idx) +static unsigned int +skip_white_and_stars (src, idx) + string_type *src; + unsigned int idx; { char c; - while ((c = at(src,idx)), + while ((c = at (src, idx)), isspace ((unsigned char) c) || (c == '*' /* Don't skip past end-of-comment or star as first character on its line. */ - && at(src,idx +1) != '/' - && at(src,idx -1) != '\n')) + && at (src, idx +1) != '/' + && at (src, idx -1) != '\n')) idx++; return idx; } /***********************************************************************/ - string_type stack[STACK]; string_type *tos; @@ -275,19 +277,18 @@ long *isp = &istack[0]; typedef int *word_type; - - struct dict_struct { - char *word; - struct dict_struct *next; - stinst_type *code; - int code_length; - int code_end; - int var; - + char *word; + struct dict_struct *next; + stinst_type *code; + int code_length; + int code_end; + int var; }; + typedef struct dict_struct dict_type; + #define WORD(x) static void x() static void @@ -352,27 +353,28 @@ static void usage (void); static void chew_exit (void); #endif -static void DEFUN(exec,(word), - dict_type *word) +static void +exec (word) + dict_type *word; { pc = word->code; - while (*pc) - (*pc)(); + while (*pc) + (*pc) (); } -WORD(call) -{ - stinst_type *oldpc = pc; - dict_type *e; - e = (dict_type *)(pc [1]); - exec(e); - pc = oldpc + 2; - + +WORD (call) +{ + stinst_type *oldpc = pc; + dict_type *e; + e = (dict_type *) (pc[1]); + exec (e); + pc = oldpc + 2; } -WORD(remchar) +WORD (remchar) { if (tos->write_idx) - tos->write_idx--; + tos->write_idx--; pc++; } @@ -386,81 +388,80 @@ strip_trailing_newlines () pc++; } -WORD(push_number) +WORD (push_number) { - isp++; - icheck_range (); - pc++; - *isp = (long)(*pc); - pc++; + isp++; + icheck_range (); + pc++; + *isp = (long) (*pc); + pc++; } -WORD(push_text) +WORD (push_text) { - tos++; - check_range (); - init_string(tos); - pc++; - cattext(tos,*((char **)pc)); - pc++; - + tos++; + check_range (); + init_string (tos); + pc++; + cattext (tos, *((char **) pc)); + pc++; } - /* This function removes everything not inside comments starting on the first char of the line from the string, also when copying comments, removes blank space and leading *'s. Blank lines are turned into one blank line. */ -static void -DEFUN(remove_noncomments,(src,dst), - string_type *src AND - string_type *dst) +static void +remove_noncomments (src, dst) + string_type *src; + string_type *dst; { - unsigned int idx = 0; - - while (at(src,idx)) + unsigned int idx = 0; + + while (at (src, idx)) { - /* Now see if we have a comment at the start of the line */ - if (at(src,idx) == '\n' - && at(src,idx+1) == '/' - && at(src,idx+2) == '*') + /* Now see if we have a comment at the start of the line. */ + if (at (src, idx) == '\n' + && at (src, idx + 1) == '/' + && at (src, idx + 2) == '*') { - idx+=3; - - idx = skip_white_and_stars(src,idx); - - /* Remove leading dot */ - if (at(src, idx) == '.') - idx++; - - /* Copy to the end of the line, or till the end of the - comment */ - while (at(src, idx)) + idx += 3; + + idx = skip_white_and_stars (src, idx); + + /* Remove leading dot */ + if (at (src, idx) == '.') + idx++; + + /* Copy to the end of the line, or till the end of the + comment. */ + while (at (src, idx)) { - if (at(src, idx) == '\n') + if (at (src, idx) == '\n') { - /* end of line, echo and scrape of leading blanks */ - if (at(src,idx +1) == '\n') - catchar(dst,'\n'); - catchar(dst,'\n'); - idx++; - idx = skip_white_and_stars(src, idx); + /* end of line, echo and scrape of leading blanks */ + if (at (src, idx + 1) == '\n') + catchar (dst, '\n'); + catchar (dst, '\n'); + idx++; + idx = skip_white_and_stars (src, idx); } - else if (at(src, idx) == '*' && at(src,idx+1) == '/') + else if (at (src, idx) == '*' && at (src, idx + 1) == '/') { - idx +=2 ; - cattext(dst,"\nENDDD\n"); - break; + idx += 2; + cattext (dst, "\nENDDD\n"); + break; } - else + else { - catchar(dst, at(src, idx)); - idx++; + catchar (dst, at (src, idx)); + idx++; } } } - else idx++; + else + idx++; } } @@ -481,98 +482,103 @@ print_stack_level () */ static void -DEFUN_VOID(paramstuff) -{ - unsigned int openp; - unsigned int fname; - unsigned int idx; - string_type out; - init_string(&out); - - - /* make sure that it's not already param'd or proto'd */ - if(find(tos,"PARAMS") || find(tos,"PROTO") || !find(tos,"(")) { - catstr(&out,tos); - } - else - { - /* Find the open paren */ - for (openp = 0; at(tos, openp) != '(' && at(tos,openp); openp++) - ; +paramstuff (void) +{ + unsigned int openp; + unsigned int fname; + unsigned int idx; + unsigned int len; + string_type out; + init_string (&out); - fname = openp; - /* Step back to the fname */ + /* Make sure that it's not already param'd or proto'd. */ + if (find (tos, "PARAMS") || find (tos, "PROTO") || !find (tos, "(")) + { + catstr (&out, tos); + } + else + { + /* Find the open paren. */ + for (openp = 0; at (tos, openp) != '(' && at (tos, openp); openp++) + ; + + fname = openp; + /* Step back to the fname. */ + fname--; + while (fname && isspace ((unsigned char) at (tos, fname))) fname--; - while (fname && isspace((unsigned char) at(tos, fname))) - fname --; - while (fname - && !isspace((unsigned char) at(tos,fname)) - && at(tos,fname) != '*') - fname--; - - fname++; - - for (idx = 0; idx < fname; idx++) /* Output type */ - { - catchar(&out, at(tos,idx)); - } - - cattext(&out, "\n"); /* Insert a newline between type and fnname */ + while (fname + && !isspace ((unsigned char) at (tos,fname)) + && at (tos,fname) != '*') + fname--; + + fname++; - for (idx = fname; idx < openp; idx++) /* Output fnname */ + /* Output type, omitting trailing whitespace character(s), if + any. */ + for (len = fname; 0 < len; len--) { - catchar(&out, at(tos,idx)); + if (!isspace ((unsigned char) at (tos, len - 1))) + break; } + for (idx = 0; idx < len; idx++) + catchar (&out, at (tos, idx)); - cattext(&out," PARAMS ("); + cattext (&out, "\n"); /* Insert a newline between type and fnname */ - while (at(tos,idx) && at(tos,idx) !=';') + /* Output function name, omitting trailing whitespace + character(s), if any. */ + for (len = openp; 0 < len; len--) { - catchar(&out, at(tos, idx)); - idx++; + if (!isspace ((unsigned char) at (tos, len - 1))) + break; } - cattext(&out,");\n\n"); - } - overwrite_string(tos, &out); - pc++; - -} + for (idx = fname; idx < len; idx++) + catchar (&out, at (tos, idx)); + + cattext (&out, " PARAMS ("); + for (idx = openp; at (tos, idx) && at (tos, idx) != ';'; idx++) + catchar (&out, at (tos, idx)); + cattext (&out, ");\n\n"); + } + overwrite_string (tos, &out); + pc++; + +} /* turn {* and *} into comments */ -WORD(translatecomments) +WORD (translatecomments) { - unsigned int idx = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + + while (at (tos, idx)) { - if (at(tos,idx) == '{' && at(tos,idx+1) =='*') + if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') { - cattext(&out,"/*"); - idx+=2; + cattext (&out, "/*"); + idx += 2; } - else if (at(tos,idx) == '*' && at(tos,idx+1) =='}') + else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } - else + else { - catchar(&out, at(tos, idx)); - idx++; + catchar (&out, at (tos, idx)); + idx++; } } + overwrite_string (tos, &out); - overwrite_string(tos, &out); - - pc++; - + pc++; } #if 0 @@ -581,843 +587,822 @@ WORD(translatecomments) /* turn everything not starting with a . into a comment */ -WORD(manglecomments) +WORD (manglecomments) { - unsigned int idx = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + + while (at (tos, idx)) { - if (at(tos,idx) == '\n' && at(tos,idx+1) =='*') + if (at (tos, idx) == '\n' && at (tos, idx + 1) == '*') { - cattext(&out," /*"); - idx+=2; + cattext (&out, " /*"); + idx += 2; } - else if (at(tos,idx) == '*' && at(tos,idx+1) =='}') + else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } - else + else { - catchar(&out, at(tos, idx)); - idx++; + catchar (&out, at (tos, idx)); + idx++; } } + overwrite_string (tos, &out); - overwrite_string(tos, &out); - - pc++; - + pc++; } #endif /* Mod tos so that only lines with leading dots remain */ static void -DEFUN_VOID(outputdots) +outputdots (void) { - unsigned int idx = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + + while (at (tos, idx)) { - if (at(tos, idx) == '\n' && at(tos, idx+1) == '.') + if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.') { char c; idx += 2; - - while ((c = at(tos, idx)) && c != '\n') + + while ((c = at (tos, idx)) && c != '\n') { - if (c == '{' && at(tos,idx+1) =='*') + if (c == '{' && at (tos, idx + 1) == '*') { - cattext(&out," /*"); - idx+=2; + cattext (&out, "/*"); + idx += 2; } - else if (c == '*' && at(tos,idx+1) =='}') + else if (c == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } else { - catchar(&out, c); - idx++; + catchar (&out, c); + idx++; } } - catchar(&out,'\n'); + catchar (&out, '\n'); } - else + else { - idx++; + idx++; } - } + } - overwrite_string(tos, &out); - pc++; - + overwrite_string (tos, &out); + pc++; } /* Find lines starting with . and | and put example around them on tos */ -WORD(courierize) -{ - string_type out; - unsigned int idx = 0; - int command = 0; - - init_string(&out); - - while (at(tos, idx)) +WORD (courierize) +{ + string_type out; + unsigned int idx = 0; + int command = 0; + + init_string (&out); + + while (at (tos, idx)) { - if (at(tos, idx) == '\n' - && (at(tos, idx +1 ) == '.' - || at(tos,idx+1) == '|')) + if (at (tos, idx) == '\n' + && (at (tos, idx +1 ) == '.' + || at (tos, idx + 1) == '|')) { - cattext(&out,"\n@example\n"); - do + cattext (&out, "\n@example\n"); + do { - idx += 2; - - while (at(tos, idx) && at(tos, idx)!='\n') + idx += 2; + + while (at (tos, idx) && at (tos, idx) != '\n') { - if (at(tos,idx)=='{' && at(tos,idx+1) =='*') + if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') { - cattext(&out," /*"); - idx+=2; + cattext (&out, "/*"); + idx += 2; } - else if (at(tos,idx)=='*' && at(tos,idx+1) =='}') + else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } - else if (at(tos,idx) == '{' && !command) + else if (at (tos, idx) == '{' && !command) { - cattext(&out,"@{"); - idx++; + cattext (&out, "@{"); + idx++; } - else if (at(tos,idx) == '}' && !command) + else if (at (tos, idx) == '}' && !command) { - cattext(&out,"@}"); - idx++; + cattext (&out, "@}"); + idx++; } - else + else { - if (at(tos,idx) == '@') - command = 1; - else if (isspace((unsigned char) at(tos,idx)) - || at(tos,idx) == '}') - command = 0; - catchar(&out, at(tos, idx)); - idx++; + if (at (tos, idx) == '@') + command = 1; + else if (isspace ((unsigned char) at (tos, idx)) + || at (tos, idx) == '}') + command = 0; + catchar (&out, at (tos, idx)); + idx++; } - + } - catchar(&out,'\n'); - } - while (at(tos, idx) == '\n' - && ((at(tos, idx+1) == '.') - || (at(tos,idx+1) == '|'))) - ; - cattext(&out,"@end example"); + catchar (&out, '\n'); + } + while (at (tos, idx) == '\n' + && ((at (tos, idx + 1) == '.') + || (at (tos, idx + 1) == '|'))) + ; + cattext (&out, "@end example"); } - else - { - catchar(&out, at(tos, idx)); - idx++; + else + { + catchar (&out, at (tos, idx)); + idx++; } - } - - overwrite_string(tos, &out); - pc++; + } - + overwrite_string (tos, &out); + pc++; } /* Finds any lines starting with "o ", if there are any, then turns on @itemize @bullet, and @items each of them. Then ends with @end itemize, inplace at TOS*/ - -WORD(bulletize) +WORD (bulletize) { - unsigned int idx = 0; - int on = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) { - if (at(tos, idx) == '@' && - at(tos, idx+1) == '*') + unsigned int idx = 0; + int on = 0; + string_type out; + init_string (&out); + + while (at (tos, idx)) + { + if (at (tos, idx) == '@' + && at (tos, idx + 1) == '*') { - cattext(&out,"*"); - idx+=2; + cattext (&out, "*"); + idx += 2; } - - else - if (at(tos, idx) == '\n' && - at(tos, idx+1) == 'o' && - isspace((unsigned char) at(tos, idx +2))) + else if (at (tos, idx) == '\n' + && at (tos, idx + 1) == 'o' + && isspace ((unsigned char) at (tos, idx + 2))) + { + if (!on) { - if (!on) - { - cattext(&out,"\n@itemize @bullet\n"); - on = 1; - - } - cattext(&out,"\n@item\n"); - idx+=3; + cattext (&out, "\n@itemize @bullet\n"); + on = 1; + } - else + cattext (&out, "\n@item\n"); + idx += 3; + } + else + { + catchar (&out, at (tos, idx)); + if (on && at (tos, idx) == '\n' + && at (tos, idx + 1) == '\n' + && at (tos, idx + 2) != 'o') { - catchar(&out, at(tos, idx)); - if (on && at(tos, idx) == '\n' && - at(tos, idx+1) == '\n' && - at(tos, idx+2) != 'o') - { - cattext(&out, "@end itemize"); - on = 0; - } - idx++; - + cattext (&out, "@end itemize"); + on = 0; } + idx++; + } - if (on) + } + if (on) { - cattext(&out,"@end itemize\n"); - } + cattext (&out, "@end itemize\n"); + } - delete_string(tos); - *tos = out; - pc++; - + delete_string (tos); + *tos = out; + pc++; } /* Turn <<foo>> into @code{foo} in place at TOS*/ - -WORD(do_fancy_stuff) +WORD (do_fancy_stuff) { - unsigned int idx = 0; - string_type out; - init_string(&out); - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + while (at (tos, idx)) { - if (at(tos, idx) == '<' - && at(tos, idx+1) == '<' - && !isspace((unsigned char) at(tos,idx + 2))) + if (at (tos, idx) == '<' + && at (tos, idx + 1) == '<' + && !isspace ((unsigned char) at (tos, idx + 2))) { - /* This qualifies as a << startup */ - idx +=2; - cattext(&out,"@code{"); - while(at(tos,idx) && - at(tos,idx) != '>' ) + /* This qualifies as a << startup. */ + idx += 2; + cattext (&out, "@code{"); + while (at (tos, idx) + && at (tos, idx) != '>' ) { - catchar(&out, at(tos, idx)); - idx++; - + catchar (&out, at (tos, idx)); + idx++; + } - cattext(&out,"}"); - idx+=2; + cattext (&out, "}"); + idx += 2; } - else + else { - catchar(&out, at(tos, idx)); - idx++; + catchar (&out, at (tos, idx)); + idx++; } } - delete_string(tos); - *tos = out; - pc++; - -} -/* A command is all upper case,and alone on a line */ -static int -DEFUN( iscommand,(ptr, idx), - string_type *ptr AND - unsigned int idx) -{ - unsigned int len = 0; - while (at(ptr,idx)) { - if (isupper((unsigned char) at(ptr,idx)) || at(ptr,idx) == ' ' || - at(ptr,idx) == '_') - { - len++; - idx++; - } - else if(at(ptr,idx) == '\n') - { - if (len > 3) return 1; - return 0; - } - else return 0; - } - return 0; + delete_string (tos); + *tos = out; + pc++; } +/* A command is all upper case,and alone on a line. */ static int -DEFUN(copy_past_newline,(ptr, idx, dst), - string_type *ptr AND - unsigned int idx AND - string_type *dst) +iscommand (ptr, idx) + string_type *ptr; + unsigned int idx; { - int column = 0; + unsigned int len = 0; + while (at (ptr, idx)) + { + if (isupper ((unsigned char) at (ptr, idx)) + || at (ptr, idx) == ' ' || at (ptr, idx) == '_') + { + len++; + idx++; + } + else if (at (ptr, idx) == '\n') + { + if (len > 3) + return 1; + return 0; + } + else + return 0; + } + return 0; +} - while (at(ptr, idx) && at(ptr, idx) != '\n') +static int +copy_past_newline (ptr, idx, dst) + string_type *ptr; + unsigned int idx; + string_type *dst; +{ + int column = 0; + + while (at (ptr, idx) && at (ptr, idx) != '\n') { - if (at (ptr, idx) == '\t') - { - /* Expand tabs. Neither makeinfo nor TeX can cope well with - them. */ - do - catchar (dst, ' '); - while (++column & 7); - } - else - { - catchar(dst, at(ptr, idx)); - column++; - } - idx++; - - } - catchar(dst, at(ptr, idx)); - idx++; - return idx; + if (at (ptr, idx) == '\t') + { + /* Expand tabs. Neither makeinfo nor TeX can cope well with + them. */ + do + catchar (dst, ' '); + while (++column & 7); + } + else + { + catchar (dst, at (ptr, idx)); + column++; + } + idx++; + + } + catchar (dst, at (ptr, idx)); + idx++; + return idx; } -WORD(icopy_past_newline) +WORD (icopy_past_newline) { - tos++; - check_range (); - init_string(tos); - idx = copy_past_newline(ptr, idx, tos); - pc++; + tos++; + check_range (); + init_string (tos); + idx = copy_past_newline (ptr, idx, tos); + pc++; } /* indent - Take the string at the top of the stack, do some prettying */ + Take the string at the top of the stack, do some prettying. */ - -WORD(kill_bogus_lines) +WORD (kill_bogus_lines) { - int sl ; - - int idx = 0; - int c; - int dot = 0 ; - - string_type out; - init_string(&out); - /* Drop leading nl */ - while (at(tos,idx) == '\n') + int sl; + + int idx = 0; + int c; + int dot = 0; + + string_type out; + init_string (&out); + /* Drop leading nl. */ + while (at (tos, idx) == '\n') { - idx++; + idx++; } - c = idx; - - /* If the first char is a '.' prepend a newline so that it is - recognized properly later. */ - if (at (tos, idx) == '.') - catchar (&out, '\n'); - - /* Find the last char */ - while (at(tos,idx)) + c = idx; + + /* If the first char is a '.' prepend a newline so that it is + recognized properly later. */ + if (at (tos, idx) == '.') + catchar (&out, '\n'); + + /* Find the last char. */ + while (at (tos, idx)) { - idx++; + idx++; } - - /* find the last non white before the nl */ + + /* Find the last non white before the nl. */ + idx--; + + while (idx && isspace ((unsigned char) at (tos, idx))) idx--; - - while (idx && isspace((unsigned char) at(tos,idx))) - idx--; - idx++; - - /* Copy buffer upto last char, but blank lines before and after - dots don't count */ - sl = 1; + idx++; + + /* Copy buffer upto last char, but blank lines before and after + dots don't count. */ + sl = 1; - while (c < idx) + while (c < idx) { - if (at(tos,c) == '\n' - && at(tos,c+1) == '\n' - && at(tos,c+2) == '.') + if (at (tos, c) == '\n' + && at (tos, c + 1) == '\n' + && at (tos, c + 2) == '.') { - /* Ignore two newlines before a dot*/ - c++; + /* Ignore two newlines before a dot. */ + c++; } - else if (at(tos,c) == '.' && sl) + else if (at (tos, c) == '.' && sl) { - /* remember that this line started with a dot */ - dot=2; + /* remember that this line started with a dot. */ + dot = 2; } - else if (at(tos,c) == '\n' - && at(tos,c+1) == '\n' - && dot) + else if (at (tos, c) == '\n' + && at (tos, c + 1) == '\n' + && dot) { - c++; - /* Ignore two newlines when last line was dot */ + c++; + /* Ignore two newlines when last line was dot. */ } - catchar(&out, at(tos,c)); - if (at(tos,c) == '\n') + catchar (&out, at (tos, c)); + if (at (tos, c) == '\n') { - sl = 1; - - if (dot == 2)dot=1;else dot = 0; + sl = 1; + + if (dot == 2) + dot = 1; + else + dot = 0; } - else - sl = 0; - - c++; + else + sl = 0; + + c++; } - - /* Append nl*/ - catchar(&out, '\n'); - pc++; - delete_string(tos); - *tos = out; - - + + /* Append nl. */ + catchar (&out, '\n'); + pc++; + delete_string (tos); + *tos = out; + } -WORD(indent) +WORD (indent) { - string_type out; - int tab = 0; - int idx = 0; - int ol =0; - init_string(&out); - while (at(tos,idx)) { - switch (at(tos,idx)) + string_type out; + int tab = 0; + int idx = 0; + int ol = 0; + init_string (&out); + while (at (tos, idx)) + { + switch (at (tos, idx)) + { + case '\n': + cattext (&out, "\n"); + idx++; + if (tab && at (tos, idx)) { - case '\n': - cattext(&out,"\n"); - idx++; - if (tab && at(tos,idx)) - { - cattext(&out," "); - } - ol = 0; - break; - case '(': - tab++; - if (ol == 0) - cattext(&out," "); - idx++; - cattext(&out,"("); - ol = 1; - break; - case ')': - tab--; - cattext(&out,")"); - idx++; - ol=1; - - break; - default: - catchar(&out,at(tos,idx)); - ol=1; - - idx++; - break; + cattext (&out, " "); } - } + ol = 0; + break; + case '(': + tab++; + if (ol == 0) + cattext (&out, " "); + idx++; + cattext (&out, "("); + ol = 1; + break; + case ')': + tab--; + cattext (&out, ")"); + idx++; + ol = 1; + + break; + default: + catchar (&out, at (tos, idx)); + ol = 1; + + idx++; + break; + } + } - pc++; - delete_string(tos); - *tos = out; + pc++; + delete_string (tos); + *tos = out; } - -WORD(get_stuff_in_command) +WORD (get_stuff_in_command) { - tos++; - check_range (); - init_string(tos); + tos++; + check_range (); + init_string (tos); - while (at(ptr, idx)) { - if (iscommand(ptr, idx)) break; - idx = copy_past_newline(ptr, idx, tos); - } - pc++; + while (at (ptr, idx)) + { + if (iscommand (ptr, idx)) + break; + idx = copy_past_newline (ptr, idx, tos); + } + pc++; } -WORD(swap) +WORD (swap) { - string_type t; - - t = tos[0]; - tos[0] = tos[-1]; - tos[-1] =t; - pc++; - + string_type t; + + t = tos[0]; + tos[0] = tos[-1]; + tos[-1] = t; + pc++; } -WORD(other_dup) +WORD (other_dup) { - tos++; - check_range (); - init_string(tos); - catstr(tos, tos-1); - pc++; + tos++; + check_range (); + init_string (tos); + catstr (tos, tos - 1); + pc++; } -WORD(drop) +WORD (drop) { tos--; check_range (); pc++; } -WORD(idrop) +WORD (idrop) { isp--; icheck_range (); pc++; } -WORD(icatstr) +WORD (icatstr) { - tos--; - check_range (); - catstr(tos, tos+1); - delete_string(tos+1); - pc++; + tos--; + check_range (); + catstr (tos, tos + 1); + delete_string (tos + 1); + pc++; } -WORD(skip_past_newline) +WORD (skip_past_newline) { - while (at(ptr,idx) - && at(ptr,idx) != '\n') - idx++; + while (at (ptr, idx) + && at (ptr, idx) != '\n') idx++; - pc++; + idx++; + pc++; } - -WORD(internalmode) +WORD (internalmode) { - internal_mode = *(isp); - isp--; - icheck_range (); - pc++; + internal_mode = *(isp); + isp--; + icheck_range (); + pc++; } -WORD(maybecatstr) +WORD (maybecatstr) { - if (internal_wanted == internal_mode) + if (internal_wanted == internal_mode) { - catstr(tos-1, tos); + catstr (tos - 1, tos); } - delete_string(tos); - tos--; - check_range (); - pc++; + delete_string (tos); + tos--; + check_range (); + pc++; } char * -DEFUN(nextword,(string, word), - char *string AND - char **word) -{ - char *word_start; - int idx; - char *dst; - char *src; - - int length = 0; - - while (isspace((unsigned char) *string) || *string == '-') { - if (*string == '-') - { - while (*string && *string != '\n') - string++; - - } - else { - string++; - } - } - if (!*string) return 0; - - word_start = string; - if (*string == '"') - { - do - { - string++; - length++; - if (*string == '\\') - { - string += 2; - length += 2; - } - } - while (*string != '"'); - } - else - { - while (!isspace((unsigned char) *string)) +nextword (string, word) + char *string; + char **word; +{ + char *word_start; + int idx; + char *dst; + char *src; + + int length = 0; + + while (isspace ((unsigned char) *string) || *string == '-') + { + if (*string == '-') { + while (*string && *string != '\n') string++; - length++; - + + } + else + { + string++; } } - - *word = malloc(length + 1); - - dst = *word; - src = word_start; - + if (!*string) + return 0; - for (idx= 0; idx < length; idx++) - { - if (src[idx] == '\\') - switch (src[idx+1]) + word_start = string; + if (*string == '"') + { + do + { + string++; + length++; + if (*string == '\\') { - case 'n': - *dst++ = '\n'; - idx++; - break; - case '"': - case '\\': - *dst++ = src[idx+1]; - idx++; - break; - default: - *dst++ = '\\'; - break; + string += 2; + length += 2; } - else - *dst++ = src[idx]; + } + while (*string != '"'); } - *dst++ = 0; + else + { + while (!isspace ((unsigned char) *string)) + { + string++; + length++; + } + } + *word = malloc (length + 1); + dst = *word; + src = word_start; + for (idx = 0; idx < length; idx++) + { + if (src[idx] == '\\') + switch (src[idx + 1]) + { + case 'n': + *dst++ = '\n'; + idx++; + break; + case '"': + case '\\': + *dst++ = src[idx + 1]; + idx++; + break; + default: + *dst++ = '\\'; + break; + } + else + *dst++ = src[idx]; + } + *dst++ = 0; - if(*string) - return string + 1; - else - return 0; - + if (*string) + return string + 1; + else + return 0; } + dict_type *root; + dict_type * -DEFUN(lookup_word,(word), - char *word) +lookup_word (word) + char *word; { dict_type *ptr = root; - while (ptr) { - if (strcmp(ptr->word, word) == 0) return ptr; + while (ptr) + { + if (strcmp (ptr->word, word) == 0) + return ptr; ptr = ptr->next; - } if (warning) - fprintf(stderr,"Can't find %s\n",word); + fprintf (stderr, "Can't find %s\n", word); return 0; - - } -static void DEFUN_VOID(perform) +static void +perform (void) { tos = stack; - - while (at(ptr, idx)) { - /* It's worth looking through the command list */ - if (iscommand(ptr, idx)) - { - char *next; - dict_type *word ; - - (void) nextword(addr(ptr, idx), &next); + while (at (ptr, idx)) + { + /* It's worth looking through the command list. */ + if (iscommand (ptr, idx)) + { + char *next; + dict_type *word; - word = lookup_word(next); + (void) nextword (addr (ptr, idx), &next); + word = lookup_word (next); - + if (word) + { + exec (word); + } + else + { + if (warning) + fprintf (stderr, "warning, %s is not recognised\n", next); + skip_past_newline (); + } - if (word) - { - exec(word); } - else - { - if (warning) - fprintf(stderr,"warning, %s is not recognised\n", next); - skip_past_newline(); - } - - } - else skip_past_newline(); - + else + skip_past_newline (); } } dict_type * -DEFUN(newentry,(word), - char *word) -{ - dict_type *new = (dict_type *)malloc(sizeof(dict_type)); - new->word = word; - new->next = root; - root = new; - new->code = (stinst_type *)malloc(sizeof(stinst_type )); - new->code_length = 1; - new->code_end = 0; - return new; - +newentry (word) + char *word; +{ + dict_type *new = (dict_type *) malloc (sizeof (dict_type)); + new->word = word; + new->next = root; + root = new; + new->code = (stinst_type *) malloc (sizeof (stinst_type)); + new->code_length = 1; + new->code_end = 0; + return new; } - unsigned int -DEFUN(add_to_definition,(entry, word), - dict_type *entry AND - stinst_type word) +add_to_definition (entry, word) + dict_type *entry; + stinst_type word; { - if (entry->code_end == entry->code_length) + if (entry->code_end == entry->code_length) { - entry->code_length += 2; - entry->code = - (stinst_type *) realloc((char *)(entry->code), - entry->code_length *sizeof(word_type)); + entry->code_length += 2; + entry->code = + (stinst_type *) realloc ((char *) (entry->code), + entry->code_length * sizeof (word_type)); } - entry->code[entry->code_end] = word; - -return entry->code_end++; -} - - - - - + entry->code[entry->code_end] = word; + return entry->code_end++; +} void -DEFUN(add_intrinsic,(name, func), - char *name AND - void (*func)()) +add_intrinsic (name, func) + char *name; + void (*func) (); { - dict_type *new = newentry(name); - add_to_definition(new, func); - add_to_definition(new, 0); + dict_type *new = newentry (name); + add_to_definition (new, func); + add_to_definition (new, 0); } void -DEFUN(add_var,(name), - char *name) +add_var (name) + char *name; { - dict_type *new = newentry(name); - add_to_definition(new, push_number); - add_to_definition(new, (stinst_type)(&(new->var))); - add_to_definition(new,0); + dict_type *new = newentry (name); + add_to_definition (new, push_number); + add_to_definition (new, (stinst_type) (&(new->var))); + add_to_definition (new, 0); } - -void -DEFUN(compile, (string), - char *string) +void +compile (string) + char *string; { - /* add words to the dictionary */ - char *word; - string = nextword(string, &word); - while (string && *string && word[0]) + /* Add words to the dictionary. */ + char *word; + string = nextword (string, &word); + while (string && *string && word[0]) { - if (strcmp(word,"var")==0) + if (strcmp (word, "var") == 0) { - string=nextword(string, &word); - - add_var(word); - string=nextword(string, &word); + string = nextword (string, &word); + + add_var (word); + string = nextword (string, &word); } -else - - if (word[0] == ':') + else if (word[0] == ':') { - dict_type *ptr; - /* Compile a word and add to dictionary */ - string = nextword(string, &word); - - ptr = newentry(word); - string = nextword(string, &word); - while (word[0] != ';' ) + dict_type *ptr; + /* Compile a word and add to dictionary. */ + string = nextword (string, &word); + + ptr = newentry (word); + string = nextword (string, &word); + while (word[0] != ';') { - switch (word[0]) - { - case '"': - /* got a string, embed magic push string - function */ - add_to_definition(ptr, push_text); - add_to_definition(ptr, (stinst_type)(word+1)); - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - /* Got a number, embedd the magic push number - function */ - add_to_definition(ptr, push_number); - add_to_definition(ptr, (stinst_type)atol(word)); - break; - default: - add_to_definition(ptr, call); - add_to_definition(ptr, (stinst_type)lookup_word(word)); - } - - string = nextword(string, &word); + switch (word[0]) + { + case '"': + /* got a string, embed magic push string + function */ + add_to_definition (ptr, push_text); + add_to_definition (ptr, (stinst_type) (word + 1)); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* Got a number, embedd the magic push number + function */ + add_to_definition (ptr, push_number); + add_to_definition (ptr, (stinst_type) atol (word)); + break; + default: + add_to_definition (ptr, call); + add_to_definition (ptr, (stinst_type) lookup_word (word)); + } + + string = nextword (string, &word); } - add_to_definition(ptr,0); - string = nextword(string, &word); + add_to_definition (ptr, 0); + string = nextword (string, &word); } - else + else { - fprintf(stderr,"syntax error at %s\n",string-1); - } + fprintf (stderr, "syntax error at %s\n", string - 1); + } } - } - -static void DEFUN_VOID(bang) +static void +bang (void) { - *(long *)((isp[0])) = isp[-1]; - isp-=2; + *(long *) ((isp[0])) = isp[-1]; + isp -= 2; icheck_range (); pc++; } -WORD(atsign) +WORD (atsign) { - isp[0] = *(long *)(isp[0]); - pc++; + isp[0] = *(long *) (isp[0]); + pc++; } -WORD(hello) +WORD (hello) { - printf("hello\n"); - pc++; + printf ("hello\n"); + pc++; } -WORD(stdout_) +WORD (stdout_) { isp++; icheck_range (); @@ -1425,7 +1410,7 @@ WORD(stdout_) pc++; } -WORD(stderr_) +WORD (stderr_) { isp++; icheck_range (); @@ -1433,7 +1418,7 @@ WORD(stderr_) pc++; } -WORD(print) +WORD (print) { if (*isp == 1) write_buffer (tos, stdout); @@ -1448,29 +1433,29 @@ WORD(print) pc++; } - -static void DEFUN(read_in, (str, file), - string_type *str AND - FILE *file) +static void +read_in (str, file) + string_type *str; + FILE *file; { - char buff[10000]; - unsigned int r; - do + char buff[10000]; + unsigned int r; + do { - r = fread(buff, 1, sizeof(buff), file); - catbuf(str, buff, r); + r = fread (buff, 1, sizeof (buff), file); + catbuf (str, buff, r); } - while (r); - buff[0] = 0; - - catbuf(str, buff,1); -} + while (r); + buff[0] = 0; + catbuf (str, buff, 1); +} -static void DEFUN_VOID(usage) +static void +usage (void) { - fprintf(stderr,"usage: -[d|i|g] <file >file\n"); - exit(33); + fprintf (stderr, "usage: -[d|i|g] <file >file\n"); + exit (33); } /* There is no reliable way to declare exit. Sometimes it returns @@ -1484,95 +1469,98 @@ chew_exit () exit (0); } -int DEFUN(main,(ac,av), -int ac AND -char *av[]) +int +main (ac, av) + int ac; + char *av[]; { unsigned int i; string_type buffer; string_type pptr; - init_string(&buffer); - init_string(&pptr); - init_string(stack+0); - tos=stack+1; + init_string (&buffer); + init_string (&pptr); + init_string (stack + 0); + tos = stack + 1; ptr = &pptr; - - add_intrinsic("push_text", push_text); - add_intrinsic("!", bang); - add_intrinsic("@", atsign); - add_intrinsic("hello",hello); - add_intrinsic("stdout",stdout_); - add_intrinsic("stderr",stderr_); - add_intrinsic("print",print); - add_intrinsic("skip_past_newline", skip_past_newline ); - add_intrinsic("catstr", icatstr ); - add_intrinsic("copy_past_newline", icopy_past_newline ); - add_intrinsic("dup", other_dup ); - add_intrinsic("drop", drop); - add_intrinsic("idrop", idrop); - add_intrinsic("remchar", remchar ); - add_intrinsic("get_stuff_in_command", get_stuff_in_command ); - add_intrinsic("do_fancy_stuff", do_fancy_stuff ); - add_intrinsic("bulletize", bulletize ); - add_intrinsic("courierize", courierize ); + + add_intrinsic ("push_text", push_text); + add_intrinsic ("!", bang); + add_intrinsic ("@", atsign); + add_intrinsic ("hello", hello); + add_intrinsic ("stdout", stdout_); + add_intrinsic ("stderr", stderr_); + add_intrinsic ("print", print); + add_intrinsic ("skip_past_newline", skip_past_newline); + add_intrinsic ("catstr", icatstr); + add_intrinsic ("copy_past_newline", icopy_past_newline); + add_intrinsic ("dup", other_dup); + add_intrinsic ("drop", drop); + add_intrinsic ("idrop", idrop); + add_intrinsic ("remchar", remchar); + add_intrinsic ("get_stuff_in_command", get_stuff_in_command); + add_intrinsic ("do_fancy_stuff", do_fancy_stuff); + add_intrinsic ("bulletize", bulletize); + add_intrinsic ("courierize", courierize); /* If the following line gives an error, exit() is not declared in the ../hosts/foo.h file for this host. Fix it there, not here! */ /* No, don't fix it anywhere; see comment on chew_exit--Ian Taylor. */ - add_intrinsic("exit", chew_exit ); - add_intrinsic("swap", swap ); - add_intrinsic("outputdots", outputdots ); - add_intrinsic("paramstuff", paramstuff ); - add_intrinsic("maybecatstr", maybecatstr ); - add_intrinsic("translatecomments", translatecomments ); - add_intrinsic("kill_bogus_lines", kill_bogus_lines); - add_intrinsic("indent", indent); - add_intrinsic("internalmode", internalmode); - add_intrinsic("print_stack_level", print_stack_level); - add_intrinsic("strip_trailing_newlines", strip_trailing_newlines); - - /* Put a nl at the start */ - catchar(&buffer,'\n'); - - read_in(&buffer, stdin); - remove_noncomments(&buffer, ptr); - for (i= 1; i < (unsigned int) ac; i++) - { - if (av[i][0] == '-') + add_intrinsic ("exit", chew_exit); + add_intrinsic ("swap", swap); + add_intrinsic ("outputdots", outputdots); + add_intrinsic ("paramstuff", paramstuff); + add_intrinsic ("maybecatstr", maybecatstr); + add_intrinsic ("translatecomments", translatecomments); + add_intrinsic ("kill_bogus_lines", kill_bogus_lines); + add_intrinsic ("indent", indent); + add_intrinsic ("internalmode", internalmode); + add_intrinsic ("print_stack_level", print_stack_level); + add_intrinsic ("strip_trailing_newlines", strip_trailing_newlines); + + /* Put a nl at the start. */ + catchar (&buffer, '\n'); + + read_in (&buffer, stdin); + remove_noncomments (&buffer, ptr); + for (i = 1; i < (unsigned int) ac; i++) { - if (av[i][1] == 'f') - { - string_type b; - FILE *f; - init_string(&b); - - f = fopen(av[i+1],"r"); - if (!f) + if (av[i][0] == '-') { - fprintf(stderr,"Can't open the input file %s\n",av[i+1]); - return 33; - } + if (av[i][1] == 'f') + { + string_type b; + FILE *f; + init_string (&b); - read_in(&b, f); - compile(b.ptr); - perform(); - } - else if (av[i][1] == 'i') - { - internal_wanted = 1; - } - else if (av[i][1] == 'w') - { - warning = 1; - } - else - usage (); + f = fopen (av[i + 1], "r"); + if (!f) + { + fprintf (stderr, "Can't open the input file %s\n", + av[i + 1]); + return 33; + } + + read_in (&b, f); + compile (b.ptr); + perform (); + } + else if (av[i][1] == 'i') + { + internal_wanted = 1; + } + else if (av[i][1] == 'w') + { + warning = 1; + } + else + usage (); + } } - } - write_buffer(stack+0, stdout); + write_buffer (stack + 0, stdout); if (tos != stack) { - fprintf (stderr, "finishing with current stack level %d\n", tos - stack); + fprintf (stderr, "finishing with current stack level %d\n", + tos - stack); return 1; } return 0; diff --git a/contrib/binutils/bfd/doc/coffcode.texi b/contrib/binutils/bfd/doc/coffcode.texi index fcb7e75..8406a04 100644 --- a/contrib/binutils/bfd/doc/coffcode.texi +++ b/contrib/binutils/bfd/doc/coffcode.texi @@ -365,6 +365,8 @@ dependent COFF routines: boolean _bfd_coff_long_filenames; boolean _bfd_coff_long_section_names; unsigned int _bfd_coff_default_section_alignment_power; + boolean _bfd_coff_force_symnames_in_strings; + unsigned int _bfd_coff_debug_string_prefix_length; void (*_bfd_coff_swap_filehdr_in) PARAMS (( bfd *abfd, PTR ext, @@ -467,12 +469,12 @@ dependent COFF routines: struct bfd_link_info *info, bfd *abfd, const char *name, - flagword flags, + flagword flags, asection *section, bfd_vma value, const char *string, boolean copy, - boolean collect, + boolean collect, struct bfd_link_hash_entry **hashp)); boolean (*_bfd_coff_link_output_has_begun) PARAMS (( @@ -562,6 +564,12 @@ dependent COFF routines: #define bfd_coff_symname_in_debug(abfd, sym)\ ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) +#define bfd_coff_force_symnames_in_strings(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) + +#define bfd_coff_debug_string_prefix_length(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) + #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ (abfd, file, base, symbol, aux, indaux)) diff --git a/contrib/binutils/bfd/doc/format.texi b/contrib/binutils/bfd/doc/format.texi index 3281c36..a181d1c 100644 --- a/contrib/binutils/bfd/doc/format.texi +++ b/contrib/binutils/bfd/doc/format.texi @@ -1,6 +1,6 @@ @section File formats A format is a BFD concept of high level file contents type. The -formats supported by BFD are: +formats supported by BFD are: @itemize @bullet @@ -43,7 +43,7 @@ matches, it is used. If not, exactly one target must recognize the file, or an error results. The function returns @code{true} on success, otherwise @code{false} -with one of the following error codes: +with one of the following error codes: @itemize @bullet diff --git a/contrib/binutils/bfd/doc/hash.texi b/contrib/binutils/bfd/doc/hash.texi index 7ddc900..eb87273 100644 --- a/contrib/binutils/bfd/doc/hash.texi +++ b/contrib/binutils/bfd/doc/hash.texi @@ -219,7 +219,7 @@ in a linker hash table entry: @code{type}, @code{written} and @node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type @subsubsection Write other derived routines You will want to write other routines for your new hash table, -as well. +as well. You will want an initialization routine which calls the initialization routine of the hash table you are deriving from diff --git a/contrib/binutils/bfd/doc/libbfd.texi b/contrib/binutils/bfd/doc/libbfd.texi index d202dc2..b4b0a14 100644 --- a/contrib/binutils/bfd/doc/libbfd.texi +++ b/contrib/binutils/bfd/doc/libbfd.texi @@ -40,16 +40,16 @@ To detect calling these with less than a @code{bfd_vma}, use @code{gcc -Wconversion} on a host with 64 bit @code{bfd_vma}'s. @example - /* Byte swapping macros for user section data. */ +/* Byte swapping macros for user section data. */ #define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val))) + ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val))) #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *)(ptr)) + (*(unsigned char *) (ptr)) #define bfd_get_signed_8(abfd, ptr) \ - ((*(unsigned char *)(ptr) ^ 0x80) - 0x80) + ((*(unsigned char *) (ptr) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) @@ -104,7 +104,7 @@ some object files keep their header records in big endian order and their data in little endian order. @example - /* Byte swapping macros for file header data. */ +/* Byte swapping macros for file header data. */ #define bfd_h_put_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr) diff --git a/contrib/binutils/bfd/doc/linker.texi b/contrib/binutils/bfd/doc/linker.texi index b618156..5105cc7 100644 --- a/contrib/binutils/bfd/doc/linker.texi +++ b/contrib/binutils/bfd/doc/linker.texi @@ -30,7 +30,7 @@ ends which have implemented versions of these routines are a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out routines are used as examples throughout this section. -@menu +@menu * Creating a Linker Hash Table:: * Adding Symbols to the Hash Table:: * Performing the Final Link:: diff --git a/contrib/binutils/bfd/doc/reloc.texi b/contrib/binutils/bfd/doc/reloc.texi index 89811d8..eb31eca 100644 --- a/contrib/binutils/bfd/doc/reloc.texi +++ b/contrib/binutils/bfd/doc/reloc.texi @@ -764,6 +764,16 @@ MIPS ELF relocations. @deffnx {} BFD_RELOC_386_GOTPC i386/elf relocations @end deffn +@deffn {} BFD_RELOC_X86_64_GOT32 +@deffnx {} BFD_RELOC_X86_64_PLT32 +@deffnx {} BFD_RELOC_X86_64_COPY +@deffnx {} BFD_RELOC_X86_64_GLOB_DAT +@deffnx {} BFD_RELOC_X86_64_JUMP_SLOT +@deffnx {} BFD_RELOC_X86_64_RELATIVE +@deffnx {} BFD_RELOC_X86_64_GOTPCREL +@deffnx {} BFD_RELOC_X86_64_32S +x86-64/elf relocations +@end deffn @deffn {} BFD_RELOC_NS32K_IMM_8 @deffnx {} BFD_RELOC_NS32K_IMM_16 @deffnx {} BFD_RELOC_NS32K_IMM_32 @@ -830,6 +840,16 @@ It generally does map to one of the other relocation types. ARM 26 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. @end deffn +@deffn {} BFD_RELOC_ARM_PCREL_BLX +ARM 26 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. +@end deffn +@deffn {} BFD_RELOC_THUMB_PCREL_BLX +Thumb 22 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. +@end deffn @deffn {} BFD_RELOC_ARM_IMMEDIATE @deffnx {} BFD_RELOC_ARM_ADRL_IMMEDIATE @deffnx {} BFD_RELOC_ARM_OFFSET_IMM @@ -877,6 +897,13 @@ These relocs are only used within the ARM assembler. They are not @deffnx {} BFD_RELOC_SH_CODE @deffnx {} BFD_RELOC_SH_DATA @deffnx {} BFD_RELOC_SH_LABEL +@deffnx {} BFD_RELOC_SH_LOOP_START +@deffnx {} BFD_RELOC_SH_LOOP_END +@deffnx {} BFD_RELOC_SH_COPY +@deffnx {} BFD_RELOC_SH_GLOB_DAT +@deffnx {} BFD_RELOC_SH_JMP_SLOT +@deffnx {} BFD_RELOC_SH_RELATIVE +@deffnx {} BFD_RELOC_SH_GOTPC Hitachi SH relocs. Not all of these appear in object files. @end deffn @deffn {} BFD_RELOC_THUMB_PCREL_BRANCH9 @@ -886,7 +913,7 @@ Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. @end deffn @deffn {} BFD_RELOC_ARC_B22_PCREL -Argonaut RISC Core (ARC) relocs. +ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. The high 20 bits are installed in bits 26 through 7 of the instruction. @@ -1060,6 +1087,29 @@ This is a 8bit DP reloc for the tms320c30, where the most significant 8 bits of a 24 bit word are placed into the least significant 8 bits of the opcode. @end deffn +@deffn {} BFD_RELOC_TIC54X_PARTLS7 +This is a 7bit reloc for the tms320c54x, where the least +significant 7 bits of a 16 bit word are placed into the least +significant 7 bits of the opcode. +@end deffn +@deffn {} BFD_RELOC_TIC54X_PARTMS9 +This is a 9bit DP reloc for the tms320c54x, where the most +significant 9 bits of a 16 bit word are placed into the least +significant 9 bits of the opcode. +@end deffn +@deffn {} BFD_RELOC_TIC54X_23 +This is an extended address 23-bit reloc for the tms320c54x. +@end deffn +@deffn {} BFD_RELOC_TIC54X_16_OF_23 +This is a 16-bit reloc for the tms320c54x, where the least +significant 16 bits of a 23-bit extended address are placed into +the opcode. +@end deffn +@deffn {} BFD_RELOC_TIC54X_MS7_OF_23 +This is a reloc for the tms320c54x, where the most +significant 7 bits of a 23-bit extended address are placed into +the opcode. +@end deffn @deffn {} BFD_RELOC_FR30_48 This is a 48 bit reloc for the FR30 that stores 32 bits. @end deffn @@ -1187,6 +1237,126 @@ describes the entry that is being used. For Rela hosts, this offset is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. @end deffn +@deffn {} BFD_RELOC_IA64_IMM14 +@deffnx {} BFD_RELOC_IA64_IMM22 +@deffnx {} BFD_RELOC_IA64_IMM64 +@deffnx {} BFD_RELOC_IA64_DIR32MSB +@deffnx {} BFD_RELOC_IA64_DIR32LSB +@deffnx {} BFD_RELOC_IA64_DIR64MSB +@deffnx {} BFD_RELOC_IA64_DIR64LSB +@deffnx {} BFD_RELOC_IA64_GPREL22 +@deffnx {} BFD_RELOC_IA64_GPREL64I +@deffnx {} BFD_RELOC_IA64_GPREL32MSB +@deffnx {} BFD_RELOC_IA64_GPREL32LSB +@deffnx {} BFD_RELOC_IA64_GPREL64MSB +@deffnx {} BFD_RELOC_IA64_GPREL64LSB +@deffnx {} BFD_RELOC_IA64_LTOFF22 +@deffnx {} BFD_RELOC_IA64_LTOFF64I +@deffnx {} BFD_RELOC_IA64_PLTOFF22 +@deffnx {} BFD_RELOC_IA64_PLTOFF64I +@deffnx {} BFD_RELOC_IA64_PLTOFF64MSB +@deffnx {} BFD_RELOC_IA64_PLTOFF64LSB +@deffnx {} BFD_RELOC_IA64_FPTR64I +@deffnx {} BFD_RELOC_IA64_FPTR32MSB +@deffnx {} BFD_RELOC_IA64_FPTR32LSB +@deffnx {} BFD_RELOC_IA64_FPTR64MSB +@deffnx {} BFD_RELOC_IA64_FPTR64LSB +@deffnx {} BFD_RELOC_IA64_PCREL21B +@deffnx {} BFD_RELOC_IA64_PCREL21BI +@deffnx {} BFD_RELOC_IA64_PCREL21M +@deffnx {} BFD_RELOC_IA64_PCREL21F +@deffnx {} BFD_RELOC_IA64_PCREL22 +@deffnx {} BFD_RELOC_IA64_PCREL60B +@deffnx {} BFD_RELOC_IA64_PCREL64I +@deffnx {} BFD_RELOC_IA64_PCREL32MSB +@deffnx {} BFD_RELOC_IA64_PCREL32LSB +@deffnx {} BFD_RELOC_IA64_PCREL64MSB +@deffnx {} BFD_RELOC_IA64_PCREL64LSB +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR22 +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64I +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64MSB +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64LSB +@deffnx {} BFD_RELOC_IA64_SEGREL32MSB +@deffnx {} BFD_RELOC_IA64_SEGREL32LSB +@deffnx {} BFD_RELOC_IA64_SEGREL64MSB +@deffnx {} BFD_RELOC_IA64_SEGREL64LSB +@deffnx {} BFD_RELOC_IA64_SECREL32MSB +@deffnx {} BFD_RELOC_IA64_SECREL32LSB +@deffnx {} BFD_RELOC_IA64_SECREL64MSB +@deffnx {} BFD_RELOC_IA64_SECREL64LSB +@deffnx {} BFD_RELOC_IA64_REL32MSB +@deffnx {} BFD_RELOC_IA64_REL32LSB +@deffnx {} BFD_RELOC_IA64_REL64MSB +@deffnx {} BFD_RELOC_IA64_REL64LSB +@deffnx {} BFD_RELOC_IA64_LTV32MSB +@deffnx {} BFD_RELOC_IA64_LTV32LSB +@deffnx {} BFD_RELOC_IA64_LTV64MSB +@deffnx {} BFD_RELOC_IA64_LTV64LSB +@deffnx {} BFD_RELOC_IA64_IPLTMSB +@deffnx {} BFD_RELOC_IA64_IPLTLSB +@deffnx {} BFD_RELOC_IA64_COPY +@deffnx {} BFD_RELOC_IA64_TPREL22 +@deffnx {} BFD_RELOC_IA64_TPREL64MSB +@deffnx {} BFD_RELOC_IA64_TPREL64LSB +@deffnx {} BFD_RELOC_IA64_LTOFF_TP22 +@deffnx {} BFD_RELOC_IA64_LTOFF22X +@deffnx {} BFD_RELOC_IA64_LDXMOV +Intel IA64 Relocations. +@end deffn +@deffn {} BFD_RELOC_M68HC11_HI8 +Motorola 68HC11 reloc. +This is the 8 bits high part of an absolute address. +@end deffn +@deffn {} BFD_RELOC_M68HC11_LO8 +Motorola 68HC11 reloc. +This is the 8 bits low part of an absolute address. +@end deffn +@deffn {} BFD_RELOC_M68HC11_3B +Motorola 68HC11 reloc. +This is the 3 bits of a value. +@end deffn +@deffn {} BFD_RELOC_CRIS_BDISP8 +@deffnx {} BFD_RELOC_CRIS_UNSIGNED_5 +@deffnx {} BFD_RELOC_CRIS_SIGNED_6 +@deffnx {} BFD_RELOC_CRIS_UNSIGNED_6 +@deffnx {} BFD_RELOC_CRIS_UNSIGNED_4 +These relocs are only used within the CRIS assembler. They are not +(at present) written to any object files. +@end deffn +@deffn {} BFD_RELOC_860_COPY +@deffnx {} BFD_RELOC_860_GLOB_DAT +@deffnx {} BFD_RELOC_860_JUMP_SLOT +@deffnx {} BFD_RELOC_860_RELATIVE +@deffnx {} BFD_RELOC_860_PC26 +@deffnx {} BFD_RELOC_860_PLT26 +@deffnx {} BFD_RELOC_860_PC16 +@deffnx {} BFD_RELOC_860_LOW0 +@deffnx {} BFD_RELOC_860_SPLIT0 +@deffnx {} BFD_RELOC_860_LOW1 +@deffnx {} BFD_RELOC_860_SPLIT1 +@deffnx {} BFD_RELOC_860_LOW2 +@deffnx {} BFD_RELOC_860_SPLIT2 +@deffnx {} BFD_RELOC_860_LOW3 +@deffnx {} BFD_RELOC_860_LOGOT0 +@deffnx {} BFD_RELOC_860_SPGOT0 +@deffnx {} BFD_RELOC_860_LOGOT1 +@deffnx {} BFD_RELOC_860_SPGOT1 +@deffnx {} BFD_RELOC_860_LOGOTOFF0 +@deffnx {} BFD_RELOC_860_SPGOTOFF0 +@deffnx {} BFD_RELOC_860_LOGOTOFF1 +@deffnx {} BFD_RELOC_860_SPGOTOFF1 +@deffnx {} BFD_RELOC_860_LOGOTOFF2 +@deffnx {} BFD_RELOC_860_LOGOTOFF3 +@deffnx {} BFD_RELOC_860_LOPC +@deffnx {} BFD_RELOC_860_HIGHADJ +@deffnx {} BFD_RELOC_860_HAGOT +@deffnx {} BFD_RELOC_860_HAGOTOFF +@deffnx {} BFD_RELOC_860_HAPC +@deffnx {} BFD_RELOC_860_HIGH +@deffnx {} BFD_RELOC_860_HIGOT +@deffnx {} BFD_RELOC_860_HIGOTOFF +Intel i860 Relocations. +@end deffn @example diff --git a/contrib/binutils/bfd/doc/section.texi b/contrib/binutils/bfd/doc/section.texi index 2569590..4b0ec017 100644 --- a/contrib/binutils/bfd/doc/section.texi +++ b/contrib/binutils/bfd/doc/section.texi @@ -107,10 +107,10 @@ Here is the section structure: @example - /* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ +/* This structure is used for a comdat section, as in PE. A comdat + section is associated with a particular symbol. When the linker + sees a comdat section, it keeps only one of the sections with a + given name and associated with a given symbol. */ struct bfd_comdat_info @{ @@ -122,340 +122,362 @@ struct bfd_comdat_info specific code; it is not an index into the list returned by bfd_canonicalize_symtab. */ long symbol; - - /* If this section is being discarded, the linker uses this field - to point to the input section which is being kept. */ - struct sec *sec; @}; typedef struct sec @{ - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ + /* The name of the section; the name isn't a copy, the pointer is + the same as that passed to bfd_make_section. */ + + const char *name; + + /* A unique sequence number. */ - CONST char *name; + int id; - /* Which section is it; 0..nth. */ + /* Which section is it; 0..nth. */ - int index; + int index; - /* The next section in the list belonging to the BFD, or NULL. */ + /* The next section in the list belonging to the BFD, or NULL. */ - struct sec *next; + struct sec *next; - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ + /* The field flags contains attributes of the section. Some + flags are read in from the object file, and some are + synthesized from other information. */ - flagword flags; + flagword flags; #define SEC_NO_FLAGS 0x000 - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information - only. */ + /* Tells the OS to allocate space for this section when loading. + This is clear for a section containing debug information only. */ #define SEC_ALLOC 0x001 - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ + /* Tells the OS to load the section from the file when loading. + This is clear for a .bss section. */ #define SEC_LOAD 0x002 - /* The section contains data still to be relocated, so there is - some relocation information too. */ + /* The section contains data still to be relocated, so there is + some relocation information too. */ #define SEC_RELOC 0x004 #if 0 /* Obsolete ? */ #define SEC_BALIGN 0x008 #endif - /* A signal to the OS that the section contains read only - data. */ + /* A signal to the OS that the section contains read only data. */ #define SEC_READONLY 0x010 - /* The section contains code only. */ + /* The section contains code only. */ #define SEC_CODE 0x020 - /* The section contains data only. */ + /* The section contains data only. */ #define SEC_DATA 0x040 - /* The section will reside in ROM. */ + /* The section will reside in ROM. */ #define SEC_ROM 0x080 - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by @code{g++}. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., @code{__CTOR_LIST__}), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called @code{__CTOR_LIST__} and relocate the data - contained within - exactly the operations it would peform on - standard data. */ + /* The section contains constructor information. This section + type is used by the linker to create lists of constructors and + destructors used by @code{g++}. When a back end sees a symbol + which should be used in a constructor list, it creates a new + section for the type of name (e.g., @code{__CTOR_LIST__}), attaches + the symbol to it, and builds a relocation. To build the lists + of constructors, all the linker has to do is catenate all the + sections called @code{__CTOR_LIST__} and relocate the data + contained within - exactly the operations it would peform on + standard data. */ #define SEC_CONSTRUCTOR 0x100 - /* The section is a constructor, and should be placed at the - end of the text, data, or bss section(?). */ + /* The section is a constructor, and should be placed at the + end of the text, data, or bss section(?). */ #define SEC_CONSTRUCTOR_TEXT 0x1100 #define SEC_CONSTRUCTOR_DATA 0x2100 #define SEC_CONSTRUCTOR_BSS 0x3100 - /* The section has contents - a data section could be - @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be - @code{SEC_HAS_CONTENTS} */ + /* The section has contents - a data section could be + @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be + @code{SEC_HAS_CONTENTS} */ #define SEC_HAS_CONTENTS 0x200 - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ + /* An instruction to the linker to not output the section + even if it has information which would normally be written. */ #define SEC_NEVER_LOAD 0x400 - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ + /* The section is a COFF shared library section. This flag is + only for the linker. If this type of section appears in + the input file, the linker must copy it to the output file + without changing the vma or size. FIXME: Although this + was originally intended to be general, it really is COFF + specific (and the flag was renamed to indicate this). It + might be cleaner to have some more general mechanism to + allow the back end to control what the linker does with + sections. */ #define SEC_COFF_SHARED_LIBRARY 0x800 - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ + /* The section has GOT references. This flag is only for the + linker, and is currently only used by the elf32-hppa back end. + It will be set if global offset table references were detected + in this section, which indicate to the linker that the section + contains PIC code, and must be handled specially when doing a + static link. */ +#define SEC_HAS_GOT_REF 0x4000 + + /* The section contains common symbols (symbols may be defined + multiple times, the value of a symbol is the amount of + space it requires, and the largest symbol value is the one + used). Most targets have exactly one of these (which we + translate to bfd_com_section_ptr), but ECOFF has two. */ #define SEC_IS_COMMON 0x8000 - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ + /* The section contains only debugging information. For + example, this is set for ELF .debug and .stab sections. + strip tests this flag to see if a section can be + discarded. */ #define SEC_DEBUGGING 0x10000 - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by - bfd_get_section_contents, and the data is retrieved from - memory if appropriate. */ + /* The contents of this section are held in memory pointed to + by the contents field. This is checked by bfd_get_section_contents, + and the data is retrieved from memory if appropriate. */ #define SEC_IN_MEMORY 0x20000 - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ + /* The contents of this section are to be excluded by the + linker for executable and shared objects unless those + objects are to be further relocated. */ #define SEC_EXCLUDE 0x40000 - /* The contents of this section are to be sorted by the - based on the address specified in the associated symbol - table. */ + /* The contents of this section are to be sorted by the + based on the address specified in the associated symbol + table. */ #define SEC_SORT_ENTRIES 0x80000 - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ + /* When linking, duplicate sections of the same name should be + discarded, rather than being combined into a single section as + is usually done. This is similar to how common symbols are + handled. See SEC_LINK_DUPLICATES below. */ #define SEC_LINK_ONCE 0x100000 - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker + should handle duplicate sections. */ #define SEC_LINK_DUPLICATES 0x600000 - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ + /* This value for SEC_LINK_DUPLICATES means that duplicate + sections with the same name should simply be discarded. */ #define SEC_LINK_DUPLICATES_DISCARD 0x0 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if there are any duplicate sections, although + it should still only link one copy. */ #define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections are a different size. */ #define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections contain different + contents. */ #define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ + /* This section was created by the linker as part of dynamic + relocation or other arcane processing. It is skipped when + going through the first-pass output, trusting that someone + else up the line will take care of it later. */ #define SEC_LINKER_CREATED 0x800000 - /* This section should not be subject to garbage collection. */ + /* This section should not be subject to garbage collection. */ #define SEC_KEEP 0x1000000 - /* This section contains "short" data, and should be placed - "near" the GP. */ + /* This section contains "short" data, and should be placed + "near" the GP. */ #define SEC_SMALL_DATA 0x2000000 - /* This section contains data which may be shared with other - executables or shared objects. */ + /* This section contains data which may be shared with other + executables or shared objects. */ #define SEC_SHARED 0x4000000 - /* End of section flags. */ + /* When a section with this flag is being linked, then if the size of + the input section is less than a page, it should not cross a page + boundary. If the size of the input section is one page or more, it + should be aligned on a page boundary. */ +#define SEC_BLOCK 0x8000000 + + /* Conditionally link this section; do not link if there are no + references found to any symbol in the section. */ +#define SEC_CLINK 0x10000000 + + /* End of section flags. */ + + /* Some internal packed boolean fields. */ - /* Some internal packed boolean fields. */ + /* See the vma field. */ + unsigned int user_set_vma : 1; - /* See the vma field. */ - unsigned int user_set_vma : 1; + /* Whether relocations have been processed. */ + unsigned int reloc_done : 1; - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; + /* A mark flag used by some of the linker backends. */ + unsigned int linker_mark : 1; - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; + /* A mark flag used by some linker backends for garbage collection. */ + unsigned int gc_mark : 1; - /* A mark flag used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; + /* Used by the ELF code to mark sections which have been allocated to segments. */ + unsigned int segment_mark : 1; - /* End of internal packed boolean fields. */ + /* End of internal packed boolean fields. */ - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in @code{a.out}, where - the default address for @code{.data} is dependent on the specific - target and various flags). */ + /* The virtual memory address of the section - where it will be + at run time. The symbols are relocated against this. The + user_set_vma flag is maintained by bfd; if it's not set, the + backend can assign addresses (for example, in @code{a.out}, where + the default address for @code{.data} is dependent on the specific + target and various flags). */ - bfd_vma vma; + bfd_vma vma; - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ + /* The load address of the section - where it would be in a + rom image; really only used for writing section header + information. */ - bfd_vma lma; + bfd_vma lma; - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of @code{.bss}). This will be filled in after relocation. */ + /* The size of the section in octets, as it will be output. + Contains a value even if the section has no contents (e.g., the + size of @code{.bss}). This will be filled in after relocation. */ - bfd_size_type _cooked_size; + bfd_size_type _cooked_size; - /* The original size on disk of the section, in octets. Normally this - value is the same as the size, but if some relaxing has - been done, then this value will be bigger. */ + /* The original size on disk of the section, in octets. Normally this + value is the same as the size, but if some relaxing has + been done, then this value will be bigger. */ - bfd_size_type _raw_size; + bfd_size_type _raw_size; - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ + /* If this section is going to be output, then this value is the + offset in *bytes* into the output section of the first byte in the + input section (byte ==> smallest addressable unit on the + target). In most cases, if this was going to start at the + 100th octet (8-bit quantity) in the output section, this value + would be 100. However, if the target byte size is 16 bits + (bfd_octets_per_byte is "2"), this value would be 50. */ - bfd_vma output_offset; + bfd_vma output_offset; - /* The output section through which to map on output. */ + /* The output section through which to map on output. */ - struct sec *output_section; + struct sec *output_section; - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ + /* The alignment requirement of the section, as an exponent of 2 - + e.g., 3 aligns to 2^3 (or 8). */ - unsigned int alignment_power; + unsigned int alignment_power; - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ + /* If an input section, a pointer to a vector of relocation + records for the data in this section. */ - struct reloc_cache_entry *relocation; + struct reloc_cache_entry *relocation; - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ + /* If an output section, a pointer to a vector of pointers to + relocation records for the data in this section. */ - struct reloc_cache_entry **orelocation; + struct reloc_cache_entry **orelocation; - /* The number of relocation records in one of the above */ + /* The number of relocation records in one of the above */ - unsigned reloc_count; + unsigned reloc_count; - /* Information below is back end specific - and not always used - or updated. */ + /* Information below is back end specific - and not always used + or updated. */ - /* File position of section data */ + /* File position of section data. */ - file_ptr filepos; + file_ptr filepos; - /* File position of relocation info */ + /* File position of relocation info. */ - file_ptr rel_filepos; + file_ptr rel_filepos; - /* File position of line data */ + /* File position of line data. */ - file_ptr line_filepos; + file_ptr line_filepos; - /* Pointer to data for applications */ + /* Pointer to data for applications. */ - PTR userdata; + PTR userdata; - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; + /* If the SEC_IN_MEMORY flag is set, this points to the actual + contents. */ + unsigned char *contents; - /* Attached line number information */ + /* Attached line number information. */ - alent *lineno; + alent *lineno; - /* Number of line number records */ + /* Number of line number records. */ - unsigned int lineno_count; + unsigned int lineno_count; - /* Optional information about a COMDAT entry; NULL if not COMDAT */ + /* Optional information about a COMDAT entry; NULL if not COMDAT. */ - struct bfd_comdat_info *comdat; + struct bfd_comdat_info *comdat; - /* When a section is being output, this value changes as more - linenumbers are written out */ + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct sec *kept_section; - file_ptr moving_line_filepos; + /* When a section is being output, this value changes as more + linenumbers are written out. */ - /* What the section number is in the target world */ + file_ptr moving_line_filepos; - int target_index; + /* What the section number is in the target world. */ - PTR used_by_bfd; + int target_index; - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ + PTR used_by_bfd; - struct relent_chain *constructor_chain; + /* If this is a constructor section then here is a list of the + relocations created to relocate items within it. */ - /* The BFD which owns the section. */ + struct relent_chain *constructor_chain; - bfd *owner; + /* The BFD which owns the section. */ - /* A symbol which points at this section only */ - struct symbol_cache_entry *symbol; - struct symbol_cache_entry **symbol_ptr_ptr; + bfd *owner; - struct bfd_link_order *link_order_head; - struct bfd_link_order *link_order_tail; + /* A symbol which points at this section only */ + struct symbol_cache_entry *symbol; + struct symbol_cache_entry **symbol_ptr_ptr; + + struct bfd_link_order *link_order_head; + struct bfd_link_order *link_order_tail; @} asection ; - /* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ +/* These sections are global, and are managed by BFD. The application + and target back end are not permitted to change the values in + these sections. New code should use the section_ptr macros rather + than referring directly to the const sections. The const sections + may eventually vanish. */ #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" #define BFD_COM_SECTION_NAME "*COM*" #define BFD_IND_SECTION_NAME "*IND*" - /* the absolute section */ +/* the absolute section */ extern const asection bfd_abs_section; #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) - /* Pointer to the undefined section */ +/* Pointer to the undefined section */ extern const asection bfd_und_section; #define bfd_und_section_ptr ((asection *) &bfd_und_section) #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) - /* Pointer to the common section */ +/* Pointer to the common section */ extern const asection bfd_com_section; #define bfd_com_section_ptr ((asection *) &bfd_com_section) - /* Pointer to the indirect section */ +/* Pointer to the indirect section */ extern const asection bfd_ind_section; #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) @@ -480,7 +502,7 @@ These are the functions exported by the section handling part of BFD. @subsubsection @code{bfd_get_section_by_name} @strong{Synopsis} @example -asection *bfd_get_section_by_name(bfd *abfd, CONST char *name); +asection *bfd_get_section_by_name(bfd *abfd, const char *name); @end example @strong{Description}@* Run through @var{abfd} and return the one of the @@ -492,11 +514,26 @@ all sections of a given name is to use @code{bfd_map_over_sections} and @code{strcmp} on the name (or better yet, base it on the section flags or something else) for each section. +@findex bfd_get_unique_section_name +@subsubsection @code{bfd_get_unique_section_name} +@strong{Synopsis} +@example +char *bfd_get_unique_section_name(bfd *abfd, + const char *templat, + int *count); +@end example +@strong{Description}@* +Invent a section name that is unique in @var{abfd} by tacking +a dot and a digit suffix onto the original @var{templat}. If +@var{count} is non-NULL, then it specifies the first number +tried as a suffix to generate a unique name. The value +pointed to by @var{count} will be incremented in this case. + @findex bfd_make_section_old_way @subsubsection @code{bfd_make_section_old_way} @strong{Synopsis} @example -asection *bfd_make_section_old_way(bfd *abfd, CONST char *name); +asection *bfd_make_section_old_way(bfd *abfd, const char *name); @end example @strong{Description}@* Create a new empty section called @var{name} @@ -523,7 +560,7 @@ If memory allocation fails. @subsubsection @code{bfd_make_section_anyway} @strong{Synopsis} @example -asection *bfd_make_section_anyway(bfd *abfd, CONST char *name); +asection *bfd_make_section_anyway(bfd *abfd, const char *name); @end example @strong{Description}@* Create a new empty section called @var{name} and attach it to the end of @@ -543,7 +580,7 @@ Return @code{NULL} and set @code{bfd_error} on error; possible errors are: @subsubsection @code{bfd_make_section} @strong{Synopsis} @example -asection *bfd_make_section(bfd *, CONST char *name); +asection *bfd_make_section(bfd *, const char *name); @end example @strong{Description}@* Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling @@ -576,7 +613,7 @@ have the @code{SEC_HAS_CONTENTS} field set. @strong{Synopsis} @example void bfd_map_over_sections(bfd *abfd, - void (*func)(bfd *abfd, + void (*func) (bfd *abfd, asection *sect, PTR obj), PTR obj); diff --git a/contrib/binutils/bfd/doc/syms.texi b/contrib/binutils/bfd/doc/syms.texi index 74c151b..400a106 100644 --- a/contrib/binutils/bfd/doc/syms.texi +++ b/contrib/binutils/bfd/doc/syms.texi @@ -376,8 +376,8 @@ class of @var{symbol}, or '?' for an unknown class. @example int bfd_decode_symclass(asymbol *symbol); @end example -@findex bfd_is_undefined_symclass -@subsubsection @code{bfd_is_undefined_symclass } +@findex bfd_is_undefined_symclass +@subsubsection @code{bfd_is_undefined_symclass} @strong{Description}@* Returns non-zero if the class symbol returned by bfd_decode_symclass represents an undefined symbol. diff --git a/contrib/binutils/bfd/doc/targets.texi b/contrib/binutils/bfd/doc/targets.texi index 50086c4..0526faf 100644 --- a/contrib/binutils/bfd/doc/targets.texi +++ b/contrib/binutils/bfd/doc/targets.texi @@ -7,7 +7,7 @@ of a target back end. All the back end provides to the root part of BFD is a structure containing pointers to functions which perform certain low level operations on files. BFD translates the applications's requests through a pointer into -calls to the back end routines. +calls to the back end routines. When a file is opened with @code{bfd_openr}, its format and target are unknown. BFD uses various mechanisms to determine @@ -18,12 +18,12 @@ how to interpret the file. The operations performed are: @item Create a BFD by calling the internal routine @code{_bfd_new_bfd}, then call @code{bfd_find_target} with the -target string supplied to @code{bfd_openr} and the new BFD pointer. +target string supplied to @code{bfd_openr} and the new BFD pointer. @item If a null target string was provided to @code{bfd_find_target}, look up the environment variable @code{GNUTARGET} and use -that as the target string. +that as the target string. @item If the target string is still @code{NULL}, or the target string is @@ -35,7 +35,7 @@ cause @code{bfd_check_format} to loop through all the targets. @item Otherwise, inspect the elements in the target vector one by one, until a match on target name is found. When found, -use it. +use it. @item Otherwise return the error @code{bfd_error_invalid_target} to @@ -47,7 +47,7 @@ Otherwise return the error @code{bfd_error_invalid_target} to @end itemize Once the BFD has been opened and the target selected, the file format may be determined. This is done by calling -@code{bfd_check_format} on the BFD with a suggested format. +@code{bfd_check_format} on the BFD with a suggested format. If @code{target_defaulted} has been set, each possible target type is tried to see if it recognizes the specified format. @code{bfd_check_format} returns @code{true} when the caller guesses right. @@ -63,17 +63,17 @@ type is tried to see if it recognizes the specified format. @strong{Description}@* This structure contains everything that BFD knows about a target. It includes things like its byte order, name, and which -routines to call to do various operations. +routines to call to do various operations. Every BFD points to a target structure with its @code{xvec} -member. +member. The macros below are used to dispatch to functions through the @code{bfd_target} vector. They are used in a number of macros further down in @file{bfd.h}, and are also used when calling various routines by hand inside the BFD implementation. The @var{arglist} argument must be parenthesized; it contains all the arguments -to the called function. +to the called function. They make the documentation (more) unpleasant to read, so if someone wants to fix this and not break the above, please do. @@ -92,13 +92,13 @@ someone wants to fix this and not break the above, please do. For operations which index on the BFD format: @example #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) #ifdef DEBUG_BFD_SEND #undef BFD_SEND_FMT #define BFD_SEND_FMT(bfd, message, arglist) \ (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ (bfd_assert (__FILE__,__LINE__), NULL)) #endif @end example @@ -109,13 +109,14 @@ defines one of these. FIXME, these names should be rationalised with the names of the entry points which call them. Too bad we can't have one -macro to define them both! +macro to define them both! @example enum bfd_flavour @{ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, + bfd_target_xcoff_flavour, bfd_target_elf_flavour, bfd_target_ieee_flavour, bfd_target_nlm_flavour, @@ -133,7 +134,7 @@ enum bfd_flavour @{ enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @}; - /* Forward declaration. */ +/* Forward declaration. */ typedef struct bfd_link_info _bfd_link_info; typedef struct bfd_target @@ -159,21 +160,21 @@ The order of bytes within the header parts of a file. A mask of all the flags which an executable may have set - from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. @example - flagword object_flags; + flagword object_flags; @end example A mask of all the flags which a section may have set - from the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. @example flagword section_flags; @end example -The character normally found at the front of a symbol +The character normally found at the front of a symbol (if any), perhaps `_'. @example char symbol_leading_char; @end example The pad character for file names within an archive header. @example - char ar_pad_char; + char ar_pad_char; @end example The maximum number of characters in an archive header. @example @@ -208,15 +209,15 @@ Byte swapping for the headers Format dependent routines: these are vectors of entry points within the target vector structure, one for each format to check. -Check the format of a file being read. Return a @code{bfd_target *} or zero. +Check the format of a file being read. Return a @code{bfd_target *} or zero. @example const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); @end example -Set the format of a file being written. +Set the format of a file being written. @example boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); @end example -Write cached information into a file being written, at @code{bfd_close}. +Write cached information into a file being written, at @code{bfd_close}. @example boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); @end example @@ -224,7 +225,7 @@ The general target vector. These vectors are initialized using the BFD_JUMP_TABLE macros. @example - /* Generic entry points. */ + /* Generic entry points. */ #define BFD_JUMP_TABLE_GENERIC(NAME)\ CAT(NAME,_close_and_cleanup),\ CAT(NAME,_bfd_free_cached_info),\ @@ -232,20 +233,20 @@ CAT(NAME,_new_section_hook),\ CAT(NAME,_get_section_contents),\ CAT(NAME,_get_section_contents_in_window) - /* Called when the BFD is being closed to do any necessary cleanup. */ + /* Called when the BFD is being closed to do any necessary cleanup. */ boolean (*_close_and_cleanup) PARAMS ((bfd *)); - /* Ask the BFD to free all cached information. */ + /* Ask the BFD to free all cached information. */ boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); - /* Called when a new section is created. */ + /* Called when a new section is created. */ boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); - /* Read the contents of a section. */ - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, + /* Read the contents of a section. */ + boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); boolean (*_bfd_get_section_contents_in_window) PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); - /* Entry points to copy private data. */ + /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME)\ CAT(NAME,_bfd_copy_private_bfd_data),\ CAT(NAME,_bfd_merge_private_bfd_data),\ @@ -253,27 +254,27 @@ CAT(NAME,_bfd_copy_private_section_data),\ CAT(NAME,_bfd_copy_private_symbol_data),\ CAT(NAME,_bfd_set_private_flags),\ CAT(NAME,_bfd_print_private_bfd_data)\ - /* Called to copy BFD general private data from one object file + /* Called to copy BFD general private data from one object file to another. */ boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to merge BFD general private data from one object file + /* Called to merge BFD general private data from one object file to a common output file when linking. */ boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to copy BFD private section data from one object file + /* Called to copy BFD private section data from one object file to another. */ boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); - /* Called to copy BFD private symbol data from one symbol + /* Called to copy BFD private symbol data from one symbol to another. */ boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); - /* Called to set private backend flags */ + /* Called to set private backend flags */ boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); - /* Called to print private BFD data */ + /* Called to print private BFD data */ boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); - /* Core file entry points. */ + /* Core file entry points. */ #define BFD_JUMP_TABLE_CORE(NAME)\ CAT(NAME,_core_file_failing_command),\ CAT(NAME,_core_file_failing_signal),\ @@ -282,7 +283,7 @@ CAT(NAME,_core_file_matches_executable_p) int (*_core_file_failing_signal) PARAMS ((bfd *)); boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); - /* Archive entry points. */ + /* Archive entry points. */ #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ CAT(NAME,_slurp_armap),\ CAT(NAME,_slurp_extended_name_table),\ @@ -299,10 +300,10 @@ CAT(NAME,_update_armap_timestamp) boolean (*_bfd_construct_extended_name_table) PARAMS ((bfd *, char **, bfd_size_type *, const char **)); void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); - boolean (*write_armap) PARAMS ((bfd *arch, + boolean (*write_armap) PARAMS ((bfd *arch, unsigned int elength, struct orl *map, - unsigned int orl_count, + unsigned int orl_count, int stridx)); PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); @@ -311,7 +312,7 @@ CAT(NAME,_update_armap_timestamp) int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); - /* Entry points used for symbols. */ + /* Entry points used for symbols. */ #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ CAT(NAME,_get_symtab_upper_bound),\ CAT(NAME,_get_symtab),\ @@ -344,7 +345,7 @@ CAT(NAME,_minisymbol_to_symbol) struct sec *section, struct symbol_cache_entry **symbols, bfd_vma offset, CONST char **file, CONST char **func, unsigned int *line)); - /* Back-door to allow format-aware applications to create debug symbols + /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ asymbol * (*_bfd_make_debug_symbol) PARAMS (( @@ -360,7 +361,7 @@ CAT(NAME,_minisymbol_to_symbol) asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, asymbol *)); - /* Routines for relocs. */ + /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME)\ CAT(NAME,_get_reloc_upper_bound),\ CAT(NAME,_canonicalize_reloc),\ @@ -368,12 +369,12 @@ CAT(NAME,_bfd_reloc_type_lookup) long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); - /* See documentation on reloc types. */ + /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); - /* Routines used when writing an object file. */ + /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME)\ CAT(NAME,_set_arch_mach),\ CAT(NAME,_set_section_contents) @@ -382,7 +383,7 @@ CAT(NAME,_set_section_contents) boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); - /* Routines used by the linker. */ + /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME)\ CAT(NAME,_sizeof_headers),\ CAT(NAME,_bfd_get_relocated_section_contents),\ @@ -401,37 +402,37 @@ CAT(NAME,_bfd_gc_sections) boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *again)); - /* Create a hash table for the linker. Different backends store + /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); - /* Add symbols from this object file into the hash table. */ + /* Add symbols from this object file into the hash table. */ boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); - /* Do a link based on the link_order structures attached to each + /* Do a link based on the link_order structures attached to each section of the BFD. */ boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); - /* Should this section be split up into smaller pieces during linking. */ + /* Should this section be split up into smaller pieces during linking. */ boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); - /* Remove sections that are not referenced from the output. */ + /* Remove sections that are not referenced from the output. */ boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); - /* Routines to handle dynamic symbols and relocs. */ + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME)\ CAT(NAME,_get_dynamic_symtab_upper_bound),\ CAT(NAME,_canonicalize_dynamic_symtab),\ CAT(NAME,_get_dynamic_reloc_upper_bound),\ CAT(NAME,_canonicalize_dynamic_reloc) - /* Get the amount of memory required to hold the dynamic symbols. */ + /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic symbols. */ + /* Read in the dynamic symbols. */ long (*_bfd_canonicalize_dynamic_symtab) PARAMS ((bfd *, struct symbol_cache_entry **)); - /* Get the amount of memory required to hold the dynamic relocs. */ + /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic relocs. */ + /* Read in the dynamic relocs. */ long (*_bfd_canonicalize_dynamic_reloc) PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); @@ -442,15 +443,15 @@ and little endian code, and target chosen by the linker has the wrong endianness. The function open_output() in ld/ldlang.c uses this field to find an alternative output format that is suitable. @example - /* Opposite endian version of this target. */ + /* Opposite endian version of this target. */ const struct bfd_target * alternative_target; - + @end example Data for use by back-end routines, which isn't generic enough to belong in this structure. @example PTR backend_data; - + @} bfd_target; @end example @@ -497,7 +498,7 @@ modify the names. @subsubsection @code{bfd_seach_for_target} @strong{Synopsis} @example -const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *); +const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); @end example @strong{Description}@* Return a pointer to the first transfer vector in the list of diff --git a/contrib/binutils/bfd/dwarf1.c b/contrib/binutils/bfd/dwarf1.c index da184cc..b96adc5 100644 --- a/contrib/binutils/bfd/dwarf1.c +++ b/contrib/binutils/bfd/dwarf1.c @@ -1,7 +1,7 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998, 1999 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. -Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). +Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). This file is part of BFD. @@ -26,121 +26,115 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "elf/dwarf.h" -/* dwarf1_debug is the starting point for all dwarf1 info. */ +/* dwarf1_debug is the starting point for all dwarf1 info. */ struct dwarf1_debug { - /* The bfd we are working with. */ + /* The bfd we are working with. */ bfd* abfd; - /* List of already parsed compilation units. */ + /* List of already parsed compilation units. */ struct dwarf1_unit* lastUnit; - /* The buffer for the .debug section. - Zero indicates that the .debug section failed to load. */ + /* The buffer for the .debug section. + Zero indicates that the .debug section failed to load. */ char* debug_section; - /* Pointer to the end of the .debug_info section memory buffer. */ + /* Pointer to the end of the .debug_info section memory buffer. */ char* debug_section_end; - /* The buffer for the .line section. */ + /* The buffer for the .line section. */ char* line_section; - /* End of that buffer. */ + /* End of that buffer. */ char* line_section_end; - /* The current or next unread die within the .debug section. */ + /* The current or next unread die within the .debug section. */ char* currentDie; }; -/* One dwarf1_unit for each parsed compilation unit die. */ +/* One dwarf1_unit for each parsed compilation unit die. */ struct dwarf1_unit { - /* Linked starting from stash->lastUnit. */ + /* Linked starting from stash->lastUnit. */ struct dwarf1_unit* prev; - /* Name of the compilation unit. */ + /* Name of the compilation unit. */ char* name; - /* The highest and lowest address used in the compilation unit. */ + /* The highest and lowest address used in the compilation unit. */ unsigned long low_pc; unsigned long high_pc; /* Does this unit have a statement list? */ int has_stmt_list; - /* If any, the offset of the line number table in the .line section. */ + /* If any, the offset of the line number table in the .line section. */ unsigned long stmt_list_offset; - /* If non-zero, a pointer to the first child of this unit. */ + /* If non-zero, a pointer to the first child of this unit. */ char* first_child; /* How many line entries? */ unsigned long line_count; - /* The decoded line number table (line_count entries). */ + /* The decoded line number table (line_count entries). */ struct linenumber* linenumber_table; - /* The list of functions in this unit. */ + /* The list of functions in this unit. */ struct dwarf1_func* func_list; }; - - /* One dwarf1_func for each parsed function die. */ struct dwarf1_func { - /* Linked starting from aUnit->func_list. */ + /* Linked starting from aUnit->func_list. */ struct dwarf1_func* prev; - - /* Name of function. */ + + /* Name of function. */ char* name; - - /* The highest and lowest address used in the compilation unit. */ + + /* The highest and lowest address used in the compilation unit. */ unsigned long low_pc; unsigned long high_pc; }; - -/* Used to return info about a parsed die. */ +/* Used to return info about a parsed die. */ struct die_info { unsigned long length; unsigned long sibling; unsigned long low_pc; unsigned long high_pc; unsigned long stmt_list_offset; - - char* name; - + + char* name; + int has_stmt_list; unsigned short tag; }; - -/* Parsed line number information. */ +/* Parsed line number information. */ struct linenumber { - /* First address in the line. */ + /* First address in the line. */ unsigned long addr; - /* The line number. */ + /* The line number. */ unsigned long linenumber; }; - -/* Find the form of an attr, from the attr field. */ +/* Find the form of an attr, from the attr field. */ #define FORM_FROM_ATTR(attr) ((attr) & 0xF) /* Implicitly specified */ - /* Return a newly allocated dwarf1_unit. It should be cleared and - then attached into the 'stash' at 'stash->lastUnit'. */ + then attached into the 'stash' at 'stash->lastUnit'. */ static struct dwarf1_unit* alloc_dwarf1_unit (stash) struct dwarf1_debug* stash; { - struct dwarf1_unit* x = - (struct dwarf1_unit*) bfd_zalloc (stash->abfd, + struct dwarf1_unit* x = + (struct dwarf1_unit*) bfd_zalloc (stash->abfd, sizeof (struct dwarf1_unit)); x->prev = stash->lastUnit; stash->lastUnit = x; @@ -149,28 +143,28 @@ alloc_dwarf1_unit (stash) } /* Return a newly allocated dwarf1_func. It must be cleared and - attached into 'aUnit' at 'aUnit->func_list'. */ + attached into 'aUnit' at 'aUnit->func_list'. */ static struct dwarf1_func* alloc_dwarf1_func (stash, aUnit) struct dwarf1_debug* stash; struct dwarf1_unit* aUnit; { - struct dwarf1_func* x = - (struct dwarf1_func*) bfd_zalloc (stash->abfd, + struct dwarf1_func* x = + (struct dwarf1_func*) bfd_zalloc (stash->abfd, sizeof (struct dwarf1_func)); x->prev = aUnit->func_list; aUnit->func_list = x; - + return x; } /* parse_die - parse a Dwarf1 die. Parse the die starting at 'aDiePtr' into 'aDieInfo'. 'abfd' must be the bfd from which the section that 'aDiePtr' - points to was pulled from. + points to was pulled from. - Return false if the die is invalidly formatted; true otherwise. */ + Return false if the die is invalidly formatted; true otherwise. */ static boolean parse_die (abfd, aDieInfo, aDiePtr) @@ -181,36 +175,36 @@ parse_die (abfd, aDieInfo, aDiePtr) char* this_die = aDiePtr; char* xptr = this_die; - memset (aDieInfo,0,sizeof(*aDieInfo)); + memset (aDieInfo,0,sizeof (*aDieInfo)); - /* First comes the length. */ - aDieInfo->length = bfd_get_32 (abfd, xptr); + /* First comes the length. */ + aDieInfo->length = bfd_get_32 (abfd, (bfd_byte *) xptr); xptr += 4; if (aDieInfo->length == 0) return false; if (aDieInfo->length < 6) { - /* Just padding bytes. */ + /* Just padding bytes. */ aDieInfo->tag = TAG_padding; return true; } - /* Then the tag. */ - aDieInfo->tag = bfd_get_16 (abfd, xptr); + /* Then the tag. */ + aDieInfo->tag = bfd_get_16 (abfd, (bfd_byte *) xptr); xptr += 2; - - /* Then the attributes. */ + + /* Then the attributes. */ while (xptr < (this_die + aDieInfo->length)) { unsigned short attr; - - /* Parse the attribute based on its form. This section + + /* Parse the attribute based on its form. This section must handle all dwarf1 forms, but need only handle the - actual attributes that we care about. */ + actual attributes that we care about. */ - attr = bfd_get_16 (abfd, xptr); + attr = bfd_get_16 (abfd, (bfd_byte *) xptr); xptr += 2; - + switch (FORM_FROM_ATTR (attr)) { case FORM_DATA2: @@ -219,10 +213,10 @@ parse_die (abfd, aDieInfo, aDiePtr) case FORM_DATA4: case FORM_REF: if (attr == AT_sibling) - aDieInfo->sibling = bfd_get_32 (abfd, xptr); + aDieInfo->sibling = bfd_get_32 (abfd, (bfd_byte *) xptr); else if (attr == AT_stmt_list) { - aDieInfo->stmt_list_offset = bfd_get_32 (abfd, xptr); + aDieInfo->stmt_list_offset = bfd_get_32 (abfd, (bfd_byte *) xptr); aDieInfo->has_stmt_list = 1; } xptr += 4; @@ -232,16 +226,16 @@ parse_die (abfd, aDieInfo, aDiePtr) break; case FORM_ADDR: if (attr == AT_low_pc) - aDieInfo->low_pc = bfd_get_32 (abfd, xptr); + aDieInfo->low_pc = bfd_get_32 (abfd, (bfd_byte *) xptr); else if (attr == AT_high_pc) - aDieInfo->high_pc = bfd_get_32 (abfd, xptr); + aDieInfo->high_pc = bfd_get_32 (abfd, (bfd_byte *) xptr); xptr += 4; break; case FORM_BLOCK2: - xptr += 2 + bfd_get_16 (abfd, xptr); + xptr += 2 + bfd_get_16 (abfd, (bfd_byte *) xptr); break; case FORM_BLOCK4: - xptr += 4 + bfd_get_32 (abfd, xptr); + xptr += 4 + bfd_get_32 (abfd, (bfd_byte *) xptr); break; case FORM_STRING: if (attr == AT_name) @@ -255,9 +249,9 @@ parse_die (abfd, aDieInfo, aDiePtr) } /* Parse a dwarf1 line number table for 'aUnit->stmt_list_offset' - into 'aUnit->linenumber_table'. Return false if an error - occurs; true otherwise. */ - + into 'aUnit->linenumber_table'. Return false if an error + occurs; true otherwise. */ + static boolean parse_line_table (stash, aUnit) struct dwarf1_debug* stash; @@ -265,19 +259,19 @@ parse_line_table (stash, aUnit) { char* xptr; - /* Load the ".line" section from the bfd if we haven't already. */ + /* Load the ".line" section from the bfd if we haven't already. */ if (stash->line_section == 0) { asection *msec; unsigned long size; - + msec = bfd_get_section_by_name (stash->abfd, ".line"); if (! msec) return false; - + size = bfd_get_section_size_before_reloc (msec); - stash->line_section = (unsigned char*) bfd_alloc (stash->abfd, size); - + stash->line_section = (char *) bfd_alloc (stash->abfd, size); + if (! stash->line_section) return false; @@ -298,36 +292,36 @@ parse_line_table (stash, aUnit) char* tblend; unsigned long base; - /* First comes the length. */ - tblend = bfd_get_32 (stash->abfd, xptr) + xptr; + /* First comes the length. */ + tblend = bfd_get_32 (stash->abfd, (bfd_byte *) xptr) + xptr; xptr += 4; - /* Then the base address for each address in the table. */ - base = bfd_get_32 (stash->abfd, xptr); + /* Then the base address for each address in the table. */ + base = bfd_get_32 (stash->abfd, (bfd_byte *) xptr); xptr += 4; /* How many line entrys? 10 = 4 (line number) + 2 (pos in line) + 4 (address in line) */ aUnit->line_count = (tblend - xptr) / 10; - /* Allocate an array for the entries. */ - aUnit->linenumber_table = (struct linenumber*) - bfd_alloc (stash->abfd, + /* Allocate an array for the entries. */ + aUnit->linenumber_table = (struct linenumber *) + bfd_alloc (stash->abfd, sizeof (struct linenumber) * aUnit->line_count); - + for (eachLine = 0; eachLine < aUnit->line_count; eachLine++) { - /* A line number. */ + /* A line number. */ aUnit->linenumber_table[eachLine].linenumber - = bfd_get_32 (stash->abfd, xptr); + = bfd_get_32 (stash->abfd, (bfd_byte *) xptr); xptr += 4; - /* Skip the position within the line. */ + /* Skip the position within the line. */ xptr += 2; - /* And finally the address. */ - aUnit->linenumber_table[eachLine].addr - = base + bfd_get_32 (stash->abfd, xptr); + /* And finally the address. */ + aUnit->linenumber_table[eachLine].addr + = base + bfd_get_32 (stash->abfd, (bfd_byte *) xptr); xptr += 4; } } @@ -338,7 +332,7 @@ parse_line_table (stash, aUnit) /* Parse each function die in a compilation unit 'aUnit'. The first child die of 'aUnit' should be in 'aUnit->first_child', the result is placed in 'aUnit->func_list'. - Return false if error; true otherwise. */ + Return false if error; true otherwise. */ static boolean parse_functions_in_unit (stash, aUnit) @@ -353,37 +347,37 @@ parse_functions_in_unit (stash, aUnit) ) { struct die_info eachDieInfo; - + if (! parse_die (stash->abfd, &eachDieInfo, eachDie)) return false; - + if (eachDieInfo.tag == TAG_global_subroutine || eachDieInfo.tag == TAG_subroutine || eachDieInfo.tag == TAG_inlined_subroutine || eachDieInfo.tag == TAG_entry_point) { struct dwarf1_func* aFunc = alloc_dwarf1_func (stash,aUnit); - + aFunc->name = eachDieInfo.name; aFunc->low_pc = eachDieInfo.low_pc; aFunc->high_pc = eachDieInfo.high_pc; } - + /* Move to next sibling, if none, end loop */ if (eachDieInfo.sibling) eachDie = stash->debug_section + eachDieInfo.sibling; else break; } - + return true; } /* Find the nearest line to 'addr' in 'aUnit'. - Return whether we found the line (or a function) without error. */ + Return whether we found the line (or a function) without error. */ static boolean -dwarf1_unit_find_nearest_line (stash, aUnit, addr, +dwarf1_unit_find_nearest_line (stash, aUnit, addr, filename_ptr, functionname_ptr, linenumber_ptr) struct dwarf1_debug* stash; @@ -427,8 +421,8 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, } } - for (eachFunc = aUnit->func_list; - eachFunc; + for (eachFunc = aUnit->func_list; + eachFunc; eachFunc = eachFunc->prev) { if (eachFunc->low_pc <= addr @@ -445,11 +439,8 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, return line_p || func_p; } - - - /* The DWARF 1 version of find_nearest line. - Return true if the line is found without error. */ + Return true if the line is found without error. */ boolean _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, @@ -472,31 +463,30 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, *filename_ptr = NULL; *functionname_ptr = NULL; *linenumber_ptr = 0; - if (! stash) { asection *msec; unsigned long size; - + stash = elf_tdata (abfd)->dwarf1_find_line_info = (struct dwarf1_debug*) bfd_zalloc (abfd, sizeof (struct dwarf1_debug)); - + if (! stash) return false; - + msec = bfd_get_section_by_name (abfd, ".debug"); if (! msec) { /* No dwarf1 info. Note that at this point the stash has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ + future calls to this function fail quicker. */ return false; } size = bfd_get_section_size_before_reloc (msec); - stash->debug_section = (unsigned char*) bfd_alloc (abfd, size); - + stash->debug_section = (char *) bfd_alloc (abfd, size); + if (! stash->debug_section) return false; @@ -512,20 +502,19 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, } /* A null debug_section indicates that there was no dwarf1 info - or that an error occured while setting up the stash. */ + or that an error occured while setting up the stash. */ if (! stash->debug_section) return false; - /* Look at the previously parsed units to see if any contain - the addr. */ + the addr. */ for (eachUnit = stash->lastUnit; eachUnit; eachUnit = eachUnit->prev) { if (eachUnit->low_pc <= addr && addr < eachUnit->high_pc) return dwarf1_unit_find_nearest_line (stash, eachUnit, addr, - filename_ptr, - functionname_ptr, + filename_ptr, + functionname_ptr, linenumber_ptr); } @@ -535,36 +524,36 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie)) return false; - + if (aDieInfo.tag == TAG_compile_unit) { struct dwarf1_unit* aUnit = alloc_dwarf1_unit (stash); - + aUnit->name = aDieInfo.name; aUnit->low_pc = aDieInfo.low_pc; aUnit->high_pc = aDieInfo.high_pc; aUnit->has_stmt_list = aDieInfo.has_stmt_list; aUnit->stmt_list_offset = aDieInfo.stmt_list_offset; - + /* A die has a child if it's followed by a die that is - not it's sibling. */ - if (aDieInfo.sibling - && stash->currentDie + aDieInfo.length + not it's sibling. */ + if (aDieInfo.sibling + && stash->currentDie + aDieInfo.length < stash->debug_section_end - && stash->currentDie + aDieInfo.length + && stash->currentDie + aDieInfo.length != stash->debug_section + aDieInfo.sibling) aUnit->first_child = stash->currentDie + aDieInfo.length; else aUnit->first_child = 0; if (aUnit->low_pc <= addr && addr < aUnit->high_pc) - return dwarf1_unit_find_nearest_line (stash, aUnit, addr, - filename_ptr, - functionname_ptr, + return dwarf1_unit_find_nearest_line (stash, aUnit, addr, + filename_ptr, + functionname_ptr, linenumber_ptr); } - + if (aDieInfo.sibling != 0) stash->currentDie = stash->debug_section + aDieInfo.sibling; else @@ -574,5 +563,4 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, return false; } - /* EOF */ diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c index b6de261..141c686 100644 --- a/contrib/binutils/bfd/dwarf2.c +++ b/contrib/binutils/bfd/dwarf2.c @@ -36,36 +36,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/dwarf2.h" /* The data in the .debug_line statement prologue looks like this. */ + struct line_head - { - unsigned int total_length; - unsigned short version; - unsigned int prologue_length; - unsigned char minimum_instruction_length; - unsigned char default_is_stmt; - int line_base; - unsigned char line_range; - unsigned char opcode_base; - unsigned char *standard_opcode_lengths; - }; - -/* Attributes have a name and a value */ +{ + unsigned int total_length; + unsigned short version; + unsigned int prologue_length; + unsigned char minimum_instruction_length; + unsigned char default_is_stmt; + int line_base; + unsigned char line_range; + unsigned char opcode_base; + unsigned char *standard_opcode_lengths; +}; + +/* Attributes have a name and a value. */ + struct attribute +{ + enum dwarf_attribute name; + enum dwarf_form form; + union { - enum dwarf_attribute name; - enum dwarf_form form; - union - { - char *str; - struct dwarf_block *blk; - unsigned int unsnd; - int snd; - bfd_vma addr; - } - u; - }; - -/* Get at parts of an attribute structure */ + char *str; + struct dwarf_block *blk; + unsigned int unsnd; + int snd; + bfd_vma addr; + } + u; +}; + +/* Get at parts of an attribute structure. */ #define DW_STRING(attr) ((attr)->u.str) #define DW_UNSND(attr) ((attr)->u.unsnd) @@ -73,100 +75,100 @@ struct attribute #define DW_SND(attr) ((attr)->u.snd) #define DW_ADDR(attr) ((attr)->u.addr) -/* Blocks are a bunch of untyped bytes. */ +/* Blocks are a bunch of untyped bytes. */ struct dwarf_block - { - unsigned int size; - char *data; - }; - - -struct dwarf2_debug { +{ + unsigned int size; + char *data; +}; - /* A list of all previously read comp_units. */ +struct dwarf2_debug +{ + /* A list of all previously read comp_units. */ struct comp_unit* all_comp_units; /* The next unread compilation unit within the .debug_info section. Zero indicates that the .debug_info section has not been loaded - into a buffer yet.*/ + into a buffer yet. */ char* info_ptr; - /* Pointer to the end of the .debug_info section memory buffer. */ + /* Pointer to the end of the .debug_info section memory buffer. */ char* info_ptr_end; - /* Pointer to the .debug_abbrev section loaded into memory. */ + /* Pointer to the .debug_abbrev section loaded into memory. */ char* dwarf_abbrev_buffer; - /* Length of the loaded .debug_abbrev section. */ + /* Length of the loaded .debug_abbrev section. */ unsigned long dwarf_abbrev_size; /* Buffer for decode_line_info. */ char *dwarf_line_buffer; + + /* Length of the loaded .debug_line section. */ + unsigned long dwarf_line_size; }; -struct arange { +struct arange +{ struct arange *next; bfd_vma low; bfd_vma high; }; - /* A minimal decoding of DWARF2 compilation units. We only decode - what's needed to get to the line number information. */ - -struct comp_unit { + what's needed to get to the line number information. */ - /* Chain the previously read compilation units. */ +struct comp_unit +{ + /* Chain the previously read compilation units. */ struct comp_unit* next_unit; - /* Keep the bdf convenient (for memory allocation). */ + /* Keep the bdf convenient (for memory allocation). */ bfd* abfd; /* The lowest and higest addresses contained in this compilation - unit as specified in the compilation unit header. */ + unit as specified in the compilation unit header. */ struct arange arange; - /* The DW_AT_name attribute (for error messages). */ + /* The DW_AT_name attribute (for error messages). */ char* name; - /* The abbrev hash table. */ + /* The abbrev hash table. */ struct abbrev_info** abbrevs; - /* Note that an error was found by comp_unit_find_nearest_line. */ + /* Note that an error was found by comp_unit_find_nearest_line. */ int error; - /* The DW_AT_comp_dir attribute */ + /* The DW_AT_comp_dir attribute. */ char* comp_dir; - /* True if there is a line number table associated with this comp. unit. */ + /* True if there is a line number table associated with this comp. unit. */ int stmtlist; - - /* The offset into .debug_line of the line number table. */ + + /* The offset into .debug_line of the line number table. */ unsigned long line_offset; - /* Pointer to the first child die for the comp unit. */ + /* Pointer to the first child die for the comp unit. */ char *first_child_die_ptr; - /* The end of the comp unit. */ + /* The end of the comp unit. */ char *end_ptr; - /* The decoded line number, NULL if not yet decoded. */ + /* The decoded line number, NULL if not yet decoded. */ struct line_info_table* line_table; - /* A list of the functions found in this comp. unit. */ - struct funcinfo* function_table; + /* A list of the functions found in this comp. unit. */ + struct funcinfo* function_table; - /* Address size for this unit - from unit header */ + /* Address size for this unit - from unit header. */ unsigned char addr_size; }; +/* VERBATIM + The following function up to the END VERBATIM mark are + copied directly from dwarf2read.c. */ - -/* VERBATIM - The following function up to the END VERBATIM mark are - copied directly from dwarf2read.c. */ - -/* read dwarf information from a buffer */ +/* Read dwarf information from a buffer. */ static unsigned int read_1_byte (abfd, buf) @@ -192,9 +194,7 @@ read_2_bytes (abfd, buf) return bfd_get_16 (abfd, (bfd_byte *) buf); } -#if 0 - -/* This is not used. */ +#if 0 /* This is not used. */ static int read_2_signed_bytes (abfd, buf) @@ -214,9 +214,7 @@ read_4_bytes (abfd, buf) return bfd_get_32 (abfd, (bfd_byte *) buf); } -#if 0 - -/* This is not used. */ +#if 0 /* This is not used. */ static int read_4_signed_bytes (abfd, buf) @@ -262,6 +260,7 @@ read_string (abfd, buf, bytes_read_ptr) *bytes_read_ptr = 1; return NULL; } + *bytes_read_ptr = strlen (buf) + 1; return buf; } @@ -280,7 +279,7 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr) result = 0; shift = 0; num_read = 0; - + do { byte = bfd_get_8 (abfd, (bfd_byte *) buf); @@ -290,9 +289,9 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr) shift += 7; } while (byte & 0x80); - + * bytes_read_ptr = num_read; - + return result; } @@ -320,12 +319,12 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr) shift += 7; } while (byte & 0x80); - + if ((shift < 32) && (byte & 0x40)) result |= -(1 << shift); * bytes_read_ptr = num_read; - + return result; } @@ -349,26 +348,22 @@ read_address (unit, buf) } } - - - - -/* This data structure holds the information of an abbrev. */ +/* This data structure holds the information of an abbrev. */ struct abbrev_info - { - unsigned int number; /* number identifying abbrev */ - enum dwarf_tag tag; /* dwarf tag */ - int has_children; /* boolean */ - unsigned int num_attrs; /* number of attributes */ - struct attr_abbrev *attrs; /* an array of attribute descriptions */ - struct abbrev_info *next; /* next in chain */ - }; +{ + unsigned int number; /* Number identifying abbrev. */ + enum dwarf_tag tag; /* DWARF tag. */ + int has_children; /* Boolean. */ + unsigned int num_attrs; /* Number of attributes. */ + struct attr_abbrev *attrs; /* An array of attribute descriptions. */ + struct abbrev_info *next; /* Next in chain. */ +}; struct attr_abbrev - { - enum dwarf_attribute name; - enum dwarf_form form; - }; +{ + enum dwarf_attribute name; + enum dwarf_form form; +}; #ifndef ABBREV_HASH_SIZE #define ABBREV_HASH_SIZE 121 @@ -397,6 +392,7 @@ lookup_abbrev (number,abbrevs) else abbrev = abbrev->next; } + return NULL; } @@ -406,18 +402,16 @@ lookup_abbrev (number,abbrevs) in a hash table. */ static struct abbrev_info** -read_abbrevs (abfd, offset) +read_abbrevs (abfd, offset, stash) bfd * abfd; unsigned int offset; + struct dwarf2_debug *stash; { struct abbrev_info **abbrevs; char *abbrev_ptr; struct abbrev_info *cur_abbrev; unsigned int abbrev_number, bytes_read, abbrev_name; unsigned int abbrev_form, hash_number; - struct dwarf2_debug *stash; - - stash = elf_tdata(abfd)->dwarf2_find_line_info; if (! stash->dwarf_abbrev_buffer) { @@ -430,13 +424,13 @@ read_abbrevs (abfd, offset) bfd_set_error (bfd_error_bad_value); return 0; } - + stash->dwarf_abbrev_size = msec->_raw_size; stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, stash->dwarf_abbrev_size); if (! stash->dwarf_abbrev_buffer) return 0; - - if (! bfd_get_section_contents (abfd, msec, + + if (! bfd_get_section_contents (abfd, msec, stash->dwarf_abbrev_buffer, 0, stash->dwarf_abbrev_size)) return 0; @@ -444,35 +438,36 @@ read_abbrevs (abfd, offset) 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) bigger than abbrev size (%u)."), offset, stash->dwarf_abbrev_size ); bfd_set_error (bfd_error_bad_value); return 0; } - abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, sizeof(struct abbrev_info*) * ABBREV_HASH_SIZE); + abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE); abbrev_ptr = stash->dwarf_abbrev_buffer + offset; abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; - /* loop until we reach an abbrev number of 0 */ + /* Loop until we reach an abbrev number of 0. */ while (abbrev_number) { cur_abbrev = (struct abbrev_info*)bfd_zalloc (abfd, sizeof (struct abbrev_info)); - /* read in abbrev header */ + /* Read in abbrev header. */ cur_abbrev->number = abbrev_number; cur_abbrev->tag = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr); abbrev_ptr += 1; - /* now read in declarations */ + /* Now read in declarations. */ abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; + while (abbrev_name) { if ((cur_abbrev->num_attrs % ATTR_ALLOC_CHUNK) == 0) @@ -484,6 +479,7 @@ read_abbrevs (abfd, offset) if (! cur_abbrev->attrs) return 0; } + cur_abbrev->attrs[cur_abbrev->num_attrs].name = abbrev_name; cur_abbrev->attrs[cur_abbrev->num_attrs++].form = abbrev_form; abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); @@ -530,6 +526,7 @@ read_attribute (attr, abbrev, unit, info_ptr) attr->name = abbrev->name; attr->form = abbrev->form; + switch (abbrev->form) { case DW_FORM_addr: @@ -631,42 +628,41 @@ read_attribute (attr, abbrev, unit, info_ptr) return info_ptr; } - -/* Source line information table routines. */ +/* Source line information table routines. */ #define FILE_ALLOC_CHUNK 5 #define DIR_ALLOC_CHUNK 5 -struct line_info { +struct line_info +{ struct line_info* prev_line; - bfd_vma address; char* filename; unsigned int line; unsigned int column; - int end_sequence; /* end of (sequential) code sequence */ + int end_sequence; /* End of (sequential) code sequence. */ }; -struct fileinfo { +struct fileinfo +{ char *name; unsigned int dir; unsigned int time; unsigned int size; }; -struct line_info_table { +struct line_info_table +{ bfd* abfd; - unsigned int num_files; unsigned int num_dirs; - char* comp_dir; char** dirs; struct fileinfo* files; struct line_info* last_line; }; -static void +static void add_line_info (table, address, filename, line, column, end_sequence) struct line_info_table* table; bfd_vma address; @@ -688,7 +684,7 @@ add_line_info (table, address, filename, line, column, end_sequence) info->end_sequence = end_sequence; } -static char* +static char * concat_filename (table, file) struct line_info_table* table; unsigned int file; @@ -703,7 +699,7 @@ concat_filename (table, file) } filename = table->files[file - 1].name; - if (*filename == '/') + if (IS_ABSOLUTE_PATH(filename)) return filename; else @@ -723,8 +719,9 @@ arange_add (unit, low_pc, high_pc) { struct arange *arange; - /* first see if we can cheaply extend an existing range: */ + /* First see if we can cheaply extend an existing range. */ arange = &unit->arange; + do { if (low_pc == arange->high) @@ -743,14 +740,14 @@ arange_add (unit, low_pc, high_pc) if (unit->arange.high == 0) { - /* this is the first address range: store it in unit->arange: */ + /* This is the first address range: store it in unit->arange. */ unit->arange.next = 0; unit->arange.low = low_pc; unit->arange.high = high_pc; return; } - /* need to allocate a new arange and insert it into the arange list: */ + /* Need to allocate a new arange and insert it into the arange list. */ arange = bfd_zalloc (unit->abfd, sizeof (*arange)); arange->low = low_pc; arange->high = high_pc; @@ -759,18 +756,15 @@ arange_add (unit, low_pc, high_pc) unit->arange.next = arange; } -/* Decode the line number information for UNIT. */ +/* Decode the line number information for UNIT. */ static struct line_info_table* -decode_line_info (unit) +decode_line_info (unit, stash) struct comp_unit *unit; + struct dwarf2_debug *stash; { bfd *abfd = unit->abfd; - - struct dwarf2_debug *stash; - struct line_info_table* table; - char *line_ptr; char *line_end; struct line_head lh; @@ -778,12 +772,9 @@ decode_line_info (unit) char *cur_file, *cur_dir; unsigned char op_code, extended_op, adj_opcode; - stash = elf_tdata (abfd)->dwarf2_find_line_info; - if (! stash->dwarf_line_buffer) { asection *msec; - unsigned long size; msec = bfd_get_section_by_name (abfd, ".debug_line"); if (! msec) @@ -792,22 +783,33 @@ decode_line_info (unit) bfd_set_error (bfd_error_bad_value); return 0; } - - size = msec->_raw_size; - stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, size); + + stash->dwarf_line_size = msec->_raw_size; + stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, stash->dwarf_line_size); if (! stash->dwarf_line_buffer) return 0; - if (! bfd_get_section_contents (abfd, msec, + if (! bfd_get_section_contents (abfd, msec, stash->dwarf_line_buffer, 0, - size)) + stash->dwarf_line_size)) return 0; /* FIXME: We ought to apply the relocs against this section before - we process it.... */ + we process it... */ + } + + /* Since we are using un-relocated data, it is possible to get a bad value + for the line_offset. Validate it here so that we won't get a segfault + below. */ + if (unit->line_offset >= stash->dwarf_line_size) + { + (*_bfd_error_handler) (_("Dwarf Error: Line offset (%u) bigger than line size (%u)."), + unit->line_offset, stash->dwarf_line_size); + bfd_set_error (bfd_error_bad_value); + return 0; } - table = (struct line_info_table*) bfd_alloc (abfd, + table = (struct line_info_table*) bfd_alloc (abfd, sizeof (struct line_info_table)); table->abfd = abfd; table->comp_dir = unit->comp_dir; @@ -823,7 +825,7 @@ decode_line_info (unit) line_ptr = stash->dwarf_line_buffer + unit->line_offset; - /* read in the prologue */ + /* Read in the prologue. */ lh.total_length = read_4_bytes (abfd, line_ptr); line_ptr += 4; line_end = line_ptr + lh.total_length; @@ -845,16 +847,18 @@ decode_line_info (unit) bfd_alloc (abfd, lh.opcode_base * sizeof (unsigned char)); lh.standard_opcode_lengths[0] = 1; + for (i = 1; i < lh.opcode_base; ++i) { lh.standard_opcode_lengths[i] = read_1_byte (abfd, line_ptr); line_ptr += 1; } - /* Read directory table */ + /* Read directory table. */ while ((cur_dir = read_string (abfd, line_ptr, &bytes_read)) != NULL) { line_ptr += bytes_read; + if ((table->num_dirs % DIR_ALLOC_CHUNK) == 0) { table->dirs = (char **) @@ -863,14 +867,17 @@ decode_line_info (unit) if (! table->dirs) return 0; } + table->dirs[table->num_dirs++] = cur_dir; } + line_ptr += bytes_read; - /* Read file name table */ + /* Read file name table. */ while ((cur_file = read_string (abfd, line_ptr, &bytes_read)) != NULL) { line_ptr += bytes_read; + if ((table->num_files % FILE_ALLOC_CHUNK) == 0) { table->files = (struct fileinfo *) @@ -880,6 +887,7 @@ decode_line_info (unit) if (! table->files) return 0; } + table->files[table->num_files].name = cur_file; table->files[table->num_files].dir = read_unsigned_leb128 (abfd, line_ptr, &bytes_read); @@ -892,12 +900,13 @@ decode_line_info (unit) line_ptr += bytes_read; table->num_files++; } + line_ptr += bytes_read; /* Read the statement sequences until there's nothing left. */ while (line_ptr < line_end) { - /* state machine registers */ + /* State machine registers. */ bfd_vma address = 0; char* filename = concat_filename (table, 1); unsigned int line = 1; @@ -907,15 +916,16 @@ decode_line_info (unit) int end_sequence = 0, need_low_pc = 1; bfd_vma low_pc = 0; - /* Decode the table. */ + /* Decode the table. */ while (! end_sequence) { op_code = read_1_byte (abfd, line_ptr); line_ptr += 1; + switch (op_code) { case DW_LNS_extended_op: - line_ptr += 1; /* ignore length */ + line_ptr += 1; /* Ignore length. */ extended_op = read_1_byte (abfd, line_ptr); line_ptr += 1; switch (extended_op) @@ -1012,12 +1022,12 @@ decode_line_info (unit) address += read_2_bytes (abfd, line_ptr); line_ptr += 2; break; - default: /* special operand */ + default: /* Special operand. */ adj_opcode = op_code - lh.opcode_base; address += (adj_opcode / lh.line_range) * lh.minimum_instruction_length; line += lh.line_base + (adj_opcode % lh.line_range); - /* append row to matrix using current values */ + /* Append row to matrix using current values. */ add_line_info (table, address, filename, line, column, 0); basic_block = 1; if (need_low_pc) @@ -1032,15 +1042,14 @@ decode_line_info (unit) return table; } - /* If ADDR is within TABLE set the output parameters and return true, otherwise return false. The output parameters, FILENAME_PTR and - LINENUMBER_PTR, are pointers to the objects to be filled in. */ + LINENUMBER_PTR, are pointers to the objects to be filled in. */ static boolean -lookup_address_in_line_info_table (table, +lookup_address_in_line_info_table (table, addr, - filename_ptr, + filename_ptr, linenumber_ptr) struct line_info_table* table; bfd_vma addr; @@ -1049,7 +1058,7 @@ lookup_address_in_line_info_table (table, { struct line_info* next_line = table->last_line; struct line_info* each_line; - + if (!next_line) return false; @@ -1067,28 +1076,24 @@ lookup_address_in_line_info_table (table, next_line = each_line; each_line = each_line->prev_line; } - + return false; } - - - -/* Function table functions. */ +/* Function table functions. */ -struct funcinfo { +struct funcinfo +{ struct funcinfo *prev_func; - char* name; bfd_vma low; bfd_vma high; }; - -/* If ADDR is within TABLE, set FUNCTIONNAME_PTR, and return true. */ +/* If ADDR is within TABLE, set FUNCTIONNAME_PTR, and return true. */ static boolean -lookup_address_in_function_table (table, +lookup_address_in_function_table (table, addr, functionname_ptr) struct funcinfo* table; @@ -1107,18 +1112,14 @@ lookup_address_in_function_table (table, return true; } } - + return false; } - - - -/* DWARF2 Compilation unit functions. */ - +/* DWARF2 Compilation unit functions. */ /* Scan over each die in a comp. unit looking for functions to add - to the function table. */ + to the function table. */ static boolean scan_unit_for_functions (unit) @@ -1144,16 +1145,16 @@ scan_unit_for_functions (unit) nesting_level--; continue; } - + abbrev = lookup_abbrev (abbrev_number,unit->abbrevs); if (! abbrev) { - (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."), + (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."), abbrev_number); bfd_set_error (bfd_error_bad_value); return false; } - + if (abbrev->tag == DW_TAG_subprogram) { func = (struct funcinfo*) bfd_zalloc (abfd, sizeof (struct funcinfo)); @@ -1162,24 +1163,24 @@ scan_unit_for_functions (unit) } else func = NULL; - + for (i = 0; i < abbrev->num_attrs; ++i) { info_ptr = read_attribute (&attr, &abbrev->attrs[i], unit, info_ptr); - + if (func) { switch (attr.name) { case DW_AT_name: - + name = DW_STRING (&attr); /* Prefer DW_AT_MIPS_linkage_name over DW_AT_name. */ if (func->name == NULL) func->name = DW_STRING (&attr); break; - + case DW_AT_MIPS_linkage_name: func->name = DW_STRING (&attr); break; @@ -1203,7 +1204,7 @@ scan_unit_for_functions (unit) case DW_AT_name: name = DW_STRING (&attr); break; - + default: break; } @@ -1217,11 +1218,6 @@ scan_unit_for_functions (unit) return true; } - - - - - /* Parse a DWARF2 compilation unit starting at INFO_PTR. This includes the compilation unit header that proceeds the DIE's, but does not include the length field that preceeds each compilation @@ -1233,10 +1229,10 @@ scan_unit_for_functions (unit) to get to the line number information for the compilation unit. */ static struct comp_unit * -parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) +parse_comp_unit (abfd, stash, unit_length, abbrev_length) bfd* abfd; - char* info_ptr; - char* end_ptr; + struct dwarf2_debug *stash; + bfd_vma unit_length; unsigned int abbrev_length; { struct comp_unit* unit; @@ -1250,6 +1246,9 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) struct abbrev_info *abbrev; struct attribute attr; + char *info_ptr = stash->info_ptr; + char *end_ptr = info_ptr + unit_length; + version = read_2_bytes (abfd, info_ptr); info_ptr += 2; BFD_ASSERT (abbrev_length == 0 @@ -1286,8 +1285,8 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) return 0; } - /* Read the abbrevs for this compilation unit into a table */ - abbrevs = read_abbrevs (abfd, abbrev_offset); + /* Read the abbrevs for this compilation unit into a table. */ + abbrevs = read_abbrevs (abfd, abbrev_offset, stash); if (! abbrevs) return 0; @@ -1309,10 +1308,10 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) bfd_set_error (bfd_error_bad_value); return 0; } - + unit = (struct comp_unit*) bfd_zalloc (abfd, sizeof (struct comp_unit)); unit->abfd = abfd; - unit->addr_size = addr_size; + unit->addr_size = addr_size; unit->abbrevs = abbrevs; unit->end_ptr = end_ptr; @@ -1366,11 +1365,7 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) return unit; } - - - - -/* Return true if UNIT contains the address given by ADDR. */ +/* Return true if UNIT contains the address given by ADDR. */ static boolean comp_unit_contains_address (unit, addr) @@ -1390,30 +1385,32 @@ comp_unit_contains_address (unit, addr) arange = arange->next; } while (arange); + return 0; } - /* If UNIT contains ADDR, set the output parameters to the values for the line containing ADDR. The output parameters, FILENAME_PTR, FUNCTIONNAME_PTR, and LINENUMBER_PTR, are pointers to the objects - to be filled in. + to be filled in. Return true of UNIT contains ADDR, and no errors were encountered; false otherwise. */ static boolean comp_unit_find_nearest_line (unit, addr, - filename_ptr, functionname_ptr, linenumber_ptr) + filename_ptr, functionname_ptr, linenumber_ptr, + stash) struct comp_unit* unit; bfd_vma addr; const char **filename_ptr; const char **functionname_ptr; unsigned int *linenumber_ptr; + struct dwarf2_debug *stash; { boolean line_p; boolean func_p; - + if (unit->error) return false; @@ -1424,15 +1421,15 @@ comp_unit_find_nearest_line (unit, addr, unit->error = 1; return false; } - - unit->line_table = decode_line_info (unit); + + unit->line_table = decode_line_info (unit, stash); if (! unit->line_table) { unit->error = 1; return false; } - + if (! scan_unit_for_functions (unit)) { unit->error = 1; @@ -1442,14 +1439,51 @@ comp_unit_find_nearest_line (unit, addr, line_p = lookup_address_in_line_info_table (unit->line_table, addr, - filename_ptr, + filename_ptr, linenumber_ptr); - func_p = lookup_address_in_function_table (unit->function_table, + func_p = lookup_address_in_function_table (unit->function_table, addr, functionname_ptr); return line_p || func_p; } +/* Locate a section in a BFD containing debugging info. The search starts from the + section after AFTER_SEC, or from the first section in the BFD if AFTER_SEC is + NULL. The search works by examining the names of the sections. There are two + permissiable names. The first is .debug_info. This is the standard DWARF2 name. + The second is a prefix .gnu.linkonce.wi. This is a variation on the .debug_info + section which has a checksum describing the contents appended onto the name. This + allows the linker to identify and discard duplicate debugging sections for + different compilation units. */ +#define DWARF2_DEBUG_INFO ".debug_info" +#define GNU_LINKONCE_INFO ".gnu.linkonce.wi." + +static asection * +find_debug_info (abfd, after_sec) + bfd * abfd; + asection * after_sec; +{ + asection * msec; + + if (after_sec) + msec = after_sec->next; + else + msec = abfd->sections; + + while (msec) + { + if (strcmp (msec->name, DWARF2_DEBUG_INFO) == 0) + return msec; + + if (strncmp (msec->name, GNU_LINKONCE_INFO, strlen (GNU_LINKONCE_INFO)) == 0) + return msec; + + msec = msec->next; + } + + return NULL; +} + /* The DWARF2 version of find_nearest line. Return true if the line is found without error. ADDR_SIZE is the number of bytes in the initial .debug_info length field and in the abbreviation offset. @@ -1460,7 +1494,7 @@ boolean _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, linenumber_ptr, - addr_size) + addr_size, pinfo) bfd *abfd; asection *section; asymbol **symbols ATTRIBUTE_UNUSED; @@ -1469,24 +1503,23 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, const char **functionname_ptr; unsigned int *linenumber_ptr; unsigned int addr_size; + PTR *pinfo; { /* Read each compilation unit from the section .debug_info, and check to see if it contains the address we are searching for. If yes, lookup the address, and return the line number info. If no, go - on to the next compilation unit. + on to the next compilation unit. We keep a list of all the previously read compilation units, and - a pointer to the next un-read compilation unit. Check the - previously read units before reading more. - */ + a pointer to the next un-read compilation unit. Check the + previously read units before reading more. */ + struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo; - struct dwarf2_debug *stash = elf_tdata (abfd)->dwarf2_find_line_info; - - /* What address are we looking for? */ + /* What address are we looking for? */ bfd_vma addr = offset + section->vma; struct comp_unit* each; - + *filename_ptr = NULL; *functionname_ptr = NULL; *linenumber_ptr = 0; @@ -1497,74 +1530,90 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, if (addr_size == 0) addr_size = 4; BFD_ASSERT (addr_size == 4 || addr_size == 8); - + if (! stash) { + unsigned long total_size; asection *msec; - unsigned long size; - - stash = elf_tdata (abfd)->dwarf2_find_line_info = + + stash = (struct dwarf2_debug*) bfd_zalloc (abfd, sizeof (struct dwarf2_debug)); - if (! stash) return false; - - msec = bfd_get_section_by_name (abfd, ".debug_info"); - if (! msec) - { - /* No dwarf2 info. Note that at this point the stash - has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ - return false; - } - size = msec->_raw_size; - if (size == 0) - return false; - - stash->info_ptr = (char *) bfd_alloc (abfd, size); - - if (! stash->info_ptr) + *pinfo = (PTR) stash; + + msec = find_debug_info (abfd, NULL); + if (! msec) + /* No dwarf2 info. Note that at this point the stash + has been allocated, but contains zeros, this lets + future calls to this function fail quicker. */ + return false; + + /* There can be more than one DWARF2 info section in a BFD these days. + Read them all in and produce one large stash. We do this in two + passes - in the first pass we just accumulate the section sizes. + In the second pass we read in the section's contents. The allows + us to avoid reallocing the data as we add sections to the stash. */ + for (total_size = 0; msec; msec = find_debug_info (abfd, msec)) + total_size += msec->_raw_size; + + stash->info_ptr = (char *) bfd_alloc (abfd, total_size); + if (stash->info_ptr == NULL) return false; - if (! bfd_get_section_contents (abfd, msec, stash->info_ptr, 0, size)) + stash->info_ptr_end = stash->info_ptr; + + for (msec = find_debug_info (abfd, NULL); + msec; + msec = find_debug_info (abfd, msec)) { - stash->info_ptr = 0; - return false; + unsigned long size; + unsigned long start; + + size = msec->_raw_size; + if (size == 0) + continue; + + start = stash->info_ptr_end - stash->info_ptr; + + if (! bfd_get_section_contents (abfd, msec, stash->info_ptr + start, 0, size)) + continue; + + stash->info_ptr_end = stash->info_ptr + start + size; } - stash->info_ptr_end = stash->info_ptr + size; - - /* FIXME: There is a problem with the contents of the - .debug_info section. The 'low' and 'high' addresses of the - comp_units are computed by relocs against symbols in the - .text segment. We need these addresses in order to determine - the nearest line number, and so we have to resolve the - relocs. There is a similar problem when the .debug_line - section is processed as well (e.g., there may be relocs - against the operand of the DW_LNE_set_address operator). - - Unfortunately getting hold of the reloc information is hard... - - For now, this means that disassembling object files (as - opposed to fully executables) does not always work as well as - we would like. */ + BFD_ASSERT (stash->info_ptr_end = stash->info_ptr + total_size); } - - /* A null info_ptr indicates that there is no dwarf2 info - (or that an error occured while setting up the stash). */ + /* FIXME: There is a problem with the contents of the + .debug_info section. The 'low' and 'high' addresses of the + comp_units are computed by relocs against symbols in the + .text segment. We need these addresses in order to determine + the nearest line number, and so we have to resolve the + relocs. There is a similar problem when the .debug_line + section is processed as well (e.g., there may be relocs + against the operand of the DW_LNE_set_address operator). + + Unfortunately getting hold of the reloc information is hard... + + For now, this means that disassembling object files (as + opposed to fully executables) does not always work as well as + we would like. */ + + /* A null info_ptr indicates that there is no dwarf2 info + (or that an error occured while setting up the stash). */ if (! stash->info_ptr) return false; - /* Check the previously read comp. units first. */ - + /* Check the previously read comp. units first. */ for (each = stash->all_comp_units; each; each = each->next_unit) if (comp_unit_contains_address (each, addr)) - return comp_unit_find_nearest_line (each, addr, filename_ptr, - functionname_ptr, linenumber_ptr); + return comp_unit_find_nearest_line (each, addr, filename_ptr, + functionname_ptr, linenumber_ptr, + stash); - /* Read each remaining comp. units checking each as they are read. */ + /* Read each remaining comp. units checking each as they are read. */ while (stash->info_ptr < stash->info_ptr_end) { struct comp_unit* each; @@ -1579,9 +1628,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, if (length > 0) { - each = parse_comp_unit (abfd, stash->info_ptr, - stash->info_ptr + length, - addr_size); + each = parse_comp_unit (abfd, stash, length, addr_size); stash->info_ptr += length; if (each) @@ -1593,21 +1640,23 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, compilation units. If we don't have them (i.e., unit->high == 0), we need to consult the line info table to see if a compilation unit contains the given - address. */ + address. */ if (each->arange.high > 0) { if (comp_unit_contains_address (each, addr)) return comp_unit_find_nearest_line (each, addr, filename_ptr, functionname_ptr, - linenumber_ptr); + linenumber_ptr, + stash); } else { found = comp_unit_find_nearest_line (each, addr, filename_ptr, functionname_ptr, - linenumber_ptr); + linenumber_ptr, + stash); if (found) return true; } @@ -1617,5 +1666,3 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, return false; } - -/* end of file */ diff --git a/contrib/binutils/bfd/ecoff.c b/contrib/binutils/bfd/ecoff.c index 4b136ee..f22112b 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, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -344,9 +344,9 @@ ecoff_sec_to_styp_flags (name, flags) } else if (strcmp (name, _RCONST) == 0) styp = STYP_RCONST; - else if (flags & SEC_CODE) + else if (flags & SEC_CODE) styp = STYP_TEXT; - else if (flags & SEC_DATA) + else if (flags & SEC_DATA) styp = STYP_DATA; else if (flags & SEC_READONLY) styp = STYP_RDATA; @@ -363,7 +363,6 @@ ecoff_sec_to_styp_flags (name, flags) /* Get the BFD flags to use for a section. */ -/*ARGSUSED*/ flagword _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section) bfd *abfd ATTRIBUTE_UNUSED; @@ -452,7 +451,7 @@ ecoff_slurp_symbolic_header (abfd) HDRR *internal_symhdr; /* See if we've already read it in. */ - if (ecoff_data (abfd)->debug_info.symbolic_header.magic == + if (ecoff_data (abfd)->debug_info.symbolic_header.magic == backend->debug_swap.sym_magic) return true; @@ -509,7 +508,6 @@ ecoff_slurp_symbolic_header (abfd) object file. This is called by gdb via the read_debug_info entry point in the backend structure. */ -/*ARGSUSED*/ boolean _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) bfd *abfd; @@ -1090,7 +1088,7 @@ ecoff_emit_aggregate (abfd, fdr, string, rndx, isym, which) unsigned int ifd = rndx->rfd; unsigned int indx = rndx->index; const char *name; - + if (ifd == 0xfff) ifd = isym; @@ -1340,7 +1338,6 @@ ecoff_type_to_string (abfd, fdr, indx) p1 += strlen (buffer1); } - /* * Deal with any qualifiers. */ @@ -1406,7 +1403,7 @@ ecoff_type_to_string (abfd, fdr, indx) int j; /* Print array bounds reversed (ie, in the order the C - programmer writes them). C is such a fun language.... */ + programmer writes them). C is such a fun language.... */ while (i < 5 && qualifiers[i+1].type == tqArray) i++; @@ -1447,7 +1444,6 @@ ecoff_type_to_string (abfd, fdr, indx) /* Return information about ECOFF symbol SYMBOL in RET. */ -/*ARGSUSED*/ void _bfd_ecoff_get_symbol_info (abfd, symbol, ret) bfd *abfd ATTRIBUTE_UNUSED; @@ -1459,7 +1455,6 @@ _bfd_ecoff_get_symbol_info (abfd, symbol, ret) /* Return whether this is a local label. */ -/*ARGSUSED*/ boolean _bfd_ecoff_bfd_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; @@ -1490,7 +1485,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) if (ecoffsymbol (symbol)->local) { SYMR ecoff_sym; - + (*debug_swap->swap_sym_in) (abfd, ecoffsymbol (symbol)->native, &ecoff_sym); fprintf (file, "ecoff local "); @@ -1604,7 +1599,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) fprintf (file, _("\n First symbol: %ld"), (long) (indx + sym_base)); else - fprintf (file, _("\n First symbol: %ld"), + fprintf (file, _("\n First symbol: %ld"), ((long) (AUX_GET_ISYM (bigendian, &aux_base[ecoff_ext.asym.index]) @@ -1680,7 +1675,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols) if (_bfd_ecoff_slurp_symbol_table (abfd) == false) return false; - + internal_relocs = (arelent *) bfd_alloc (abfd, (sizeof (arelent) * section->reloc_count)); @@ -1778,7 +1773,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) { unsigned int count; - if (section->flags & SEC_CONSTRUCTOR) + if (section->flags & SEC_CONSTRUCTOR) { arelent_chain *chain; @@ -1791,7 +1786,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) *relptr++ = &chain->relent; } else - { + { arelent *tblptr; if (ecoff_slurp_reloc_table (abfd, section, symbols) == false) @@ -1812,7 +1807,6 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) and return the name of the source file and the line nearest to the wanted location. */ -/*ARGSUSED*/ boolean _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, filename_ptr, functionname_ptr, retline_ptr) @@ -1984,7 +1978,6 @@ _bfd_ecoff_set_arch_mach (abfd, arch, machine) /* Get the size of the section headers. */ -/*ARGSUSED*/ int _bfd_ecoff_sizeof_headers (abfd, reloc) bfd *abfd; @@ -1996,8 +1989,8 @@ _bfd_ecoff_sizeof_headers (abfd, reloc) c = 0; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) ++c; ret = (bfd_coff_filhsz (abfd) @@ -2218,13 +2211,13 @@ ecoff_compute_reloc_file_positions (abfd) abort (); abfd->output_has_begun = true; } - + reloc_base = ecoff_data (abfd)->reloc_filepos; reloc_size = 0; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) { if (current->reloc_count == 0) current->rel_filepos = 0; @@ -2312,7 +2305,7 @@ bfd_ecoff_get_gp_value (abfd) bfd_set_error (bfd_error_invalid_operation); return 0; } - + return ecoff_data (abfd)->gp; } @@ -2491,8 +2484,8 @@ _bfd_ecoff_write_object_contents (abfd) count = 1; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) { current->target_index = count; ++count; @@ -2630,7 +2623,7 @@ _bfd_ecoff_write_object_contents (abfd) /* Do nothing */ ; else abort (); - } + } /* Set up the file header. */ @@ -2782,7 +2775,7 @@ _bfd_ecoff_write_object_contents (abfd) arelent *reloc; asymbol *sym; struct internal_reloc in; - + memset ((PTR) &in, 0, sizeof in); reloc = *reloc_ptr_ptr; @@ -2982,7 +2975,7 @@ _bfd_ecoff_slurp_armap (abfd) char *raw_ptr; struct symdef *symdef_ptr; char *stringbase; - + /* Get the name of the first element. */ i = bfd_read ((PTR) nextname, 1, 16, abfd); if (i == 0) @@ -3034,11 +3027,11 @@ _bfd_ecoff_slurp_armap (abfd) return false; parsed_size = mapdata->parsed_size; bfd_release (abfd, (PTR) mapdata); - + raw_armap = (char *) bfd_alloc (abfd, parsed_size); if (raw_armap == (char *) NULL) return false; - + if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size) { if (bfd_get_error () != bfd_error_system_call) @@ -3046,7 +3039,7 @@ _bfd_ecoff_slurp_armap (abfd) bfd_release (abfd, (PTR) raw_armap); return false; } - + ardata->tdata = (PTR) raw_armap; count = bfd_h_get_32 (abfd, (PTR) raw_armap); @@ -3075,7 +3068,7 @@ _bfd_ecoff_slurp_armap (abfd) { unsigned int name_offset, file_offset; unsigned int hash, rehash, srch; - + name_offset = bfd_h_get_32 (abfd, (PTR) raw_ptr); file_offset = bfd_h_get_32 (abfd, (PTR) (raw_ptr + 4)); if (file_offset == 0) @@ -3167,7 +3160,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) padit = stridx % 2; stringsize = stridx + padit; - /* Include 8 bytes to store symdefsize and stringsize in output. */ + /* Include 8 bytes to store symdefsize and stringsize in output. */ mapsize = symdefsize + stringsize + 8; firstreal = SARMAG + sizeof (struct ar_hdr) + mapsize + elength; @@ -3201,7 +3194,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) #if 0 hdr.ar_mode[0] = '0'; #else - /* Building gcc ends up extracting the armap as a file - twice. */ + /* Building gcc ends up extracting the armap as a file - twice. */ hdr.ar_mode[0] = '6'; hdr.ar_mode[1] = '4'; hdr.ar_mode[2] = '4'; @@ -3214,8 +3207,8 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) /* Turn all null bytes in the header into spaces. */ for (i = 0; i < sizeof (struct ar_hdr); i++) - if (((char *)(&hdr))[i] == '\0') - (((char *)(&hdr))[i]) = ' '; + if (((char *) (&hdr))[i] == '\0') + (((char *) (&hdr))[i]) = ' '; if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), abfd) != sizeof (struct ar_hdr)) @@ -3224,7 +3217,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) bfd_h_put_32 (abfd, (bfd_vma) hashsize, temp); if (bfd_write ((PTR) temp, 1, 4, abfd) != 4) return false; - + hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize); if (!hashtable) return false; @@ -3266,7 +3259,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) hash = srch; } - + bfd_h_put_32 (abfd, (bfd_vma) map[i].namidx, (PTR) (hashtable + hash * 8)); bfd_h_put_32 (abfd, (bfd_vma) firstreal, @@ -3345,7 +3338,7 @@ _bfd_ecoff_archive_p (abfd) bfd_ardata (abfd)->symdefs = NULL; bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->tdata = NULL; - + if (_bfd_ecoff_slurp_armap (abfd) == false || _bfd_ecoff_slurp_extended_name_table (abfd) == false) { @@ -3353,7 +3346,7 @@ _bfd_ecoff_archive_p (abfd) abfd->tdata.aout_ar_data = tdata_hold; return (const bfd_target *) NULL; } - + if (bfd_has_map (abfd)) { bfd *first; @@ -4391,7 +4384,7 @@ ecoff_link_write_external (h, data) bfd *output_bfd = einfo->abfd; boolean strip; - /* We need to check if this symbol is being stripped. */ + /* We need to check if this symbol is being stripped. */ if (h->root.type == bfd_link_hash_undefined || h->root.type == bfd_link_hash_undefweak) strip = false; @@ -4427,7 +4420,7 @@ ecoff_link_write_external (h, data) output_section = h->root.u.def.section->output_section; name = bfd_section_name (output_section->owner, output_section); - + if (strcmp (name, _TEXT) == 0) h->esym.asym.sc = scText; else if (strcmp (name, _DATA) == 0) diff --git a/contrib/binutils/bfd/ecofflink.c b/contrib/binutils/bfd/ecofflink.c index 25fc966..9b2e0f5 100644 --- a/contrib/binutils/bfd/ecofflink.c +++ b/contrib/binutils/bfd/ecofflink.c @@ -1,5 +1,5 @@ /* Routines to link ECOFF debugging information. - Copyright 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc. + Copyright 1993, 94, 95, 96, 97, 99, 2000 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>. This file is part of BFD, the Binary File Descriptor library. @@ -69,8 +69,8 @@ _bfd_ecoff_swap_tir_in (bigend, ext_copy, intern) struct tir_ext ext[1]; *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG); intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG); @@ -109,7 +109,7 @@ _bfd_ecoff_swap_tir_in (bigend, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -126,8 +126,8 @@ _bfd_ecoff_swap_tir_out (bigend, intern_copy, ext) TIR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { ext->t_bits1[0] = ((intern->fBitfield ? TIR_BITS1_FBITFIELD_BIG : 0) | (intern->continued ? TIR_BITS1_CONTINUED_BIG : 0) @@ -166,7 +166,7 @@ _bfd_ecoff_swap_tir_out (bigend, intern_copy, ext) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -182,8 +182,8 @@ _bfd_ecoff_swap_rndx_in (bigend, ext_copy, intern) struct rndx_ext ext[1]; *ext = *ext_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_BIG) | ((ext->r_bits[1] & RNDX_BITS1_RFD_BIG) @@ -205,7 +205,7 @@ _bfd_ecoff_swap_rndx_in (bigend, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -221,8 +221,8 @@ _bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext) RNDXR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bigend) { ext->r_bits[0] = intern->rfd >> RNDX_BITS0_RFD_SH_LEFT_BIG; ext->r_bits[1] = (((intern->rfd << RNDX_BITS1_RFD_SH_BIG) @@ -243,7 +243,7 @@ _bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -465,7 +465,7 @@ add_memory_shuffle (ainfo, head, tail, data, size) unsigned long size; { struct shuffle *n; - + n = (struct shuffle *) objalloc_alloc (ainfo->memory, sizeof (struct shuffle)); if (!n) @@ -488,7 +488,6 @@ add_memory_shuffle (ainfo, head, tail, data, size) /* Initialize the FDR hash table. This returns a handle which is then passed in to bfd_ecoff_debug_accumulate, et. al. */ -/*ARGSUSED*/ PTR bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info) bfd *output_bfd ATTRIBUTE_UNUSED; @@ -547,7 +546,6 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info) /* Free the accumulated debugging information. */ -/*ARGSUSED*/ void bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) PTR handle; @@ -557,7 +555,7 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) struct bfd_link_info *info; { struct accumulate *ainfo = (struct accumulate *) handle; - + bfd_hash_table_free (&ainfo->fdr_hash.table); if (! info->relocateable) @@ -576,7 +574,6 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) linker information structure. HANDLE is returned by bfd_ecoff_debug_init. */ -/*ARGSUSED*/ boolean bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, input_bfd, input_debug, input_swap, @@ -1409,7 +1406,6 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) /* Align the ECOFF debugging information. */ -/*ARGSUSED*/ static void ecoff_align_debug (abfd, debug, swap) bfd *abfd ATTRIBUTE_UNUSED; @@ -1967,9 +1963,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info) boolean stabs; FDR *fdr_ptr; int i; - + offset = line_info->cache.start; - + /* Build FDR table (sorted by object file's base-address) if we don't have it already. */ if (line_info->fdrtab == NULL @@ -1981,7 +1977,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) /* find first FDR for address OFFSET */ i = fdrtab_lookup (line_info, offset); if (i < 0) - return false; /* no FDR, no fun... */ + return false; /* no FDR, no fun... */ fdr_ptr = tab[i].fdr; /* Check whether this file has stabs debugging information. In a @@ -2046,9 +2042,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info) malloc.c. I'm not sure why this happens, but it could be due to optimizations that reorder a function's position within an object-file. - + Strategy: - + On the first call to this function, we build a table of FDRs that is sorted by the base-address of the object-file the FDR is referring to. Notice that each object-file may contain @@ -2079,9 +2075,9 @@ lookup_line (abfd, debug_info, debug_swap, line_info) bfd_vma dist, min_dist = 0; char *pdr_hold; char *pdr_end; - + fdr_ptr = tab[i].fdr; - + pdr_ptr = ((char *) debug_info->external_pdr + fdr_ptr->ipdFirst * external_pdr_size); pdr_end = pdr_ptr + fdr_ptr->cpd * external_pdr_size; @@ -2106,7 +2102,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) } } } - + if (!best_pdr || min_dist < best_dist) { best_dist = min_dist; @@ -2119,7 +2115,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) && tab[i].base_addr == tab[i - 1].base_addr); if (!best_fdr || !best_pdr) - return false; /* shouldn't happen... */ + return false; /* shouldn't happen... */ /* phew, finally we got something that we can hold onto: */ fdr_ptr = best_fdr; diff --git a/contrib/binutils/bfd/ecoffswap.h b/contrib/binutils/bfd/ecoffswap.h index 0d28d16..70d548d 100644 --- a/contrib/binutils/bfd/ecoffswap.h +++ b/contrib/binutils/bfd/ecoffswap.h @@ -1,5 +1,5 @@ /* Generic ECOFF swapping routines, for BFD. - Copyright 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 1996, 2000 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -27,10 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ on them in gdb by naming the including source file; e.g., 'coff-mips.c':ecoff_swap_hdr_in. - Before including this header file, one of ECOFF_32 or ECOFF_64 must - be defined. These are checked when swapping information that - depends upon the target size. This code works for 32 bit and 64 - bit ECOFF, but may need to be generalized in the future. + Before including this header file, one of ECOFF_32, ECOFF_64, + ECOFF_SIGNED_32 or ECOFF_SIGNED_64 must be defined. These are + checked when swapping information that depends upon the target + size. This code works for 32 bit and 64 bit ECOFF, but may need to + be generalized in the future. Some header file which defines the external forms of these structures must also be included before including this header file. @@ -50,6 +51,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ecoff_get_off bfd_h_get_64 #define ecoff_put_off bfd_h_put_64 #endif +#ifdef ECOFF_SIGNED_32 +#define ecoff_get_off bfd_h_get_signed_32 +#define ecoff_put_off bfd_h_put_signed_32 +#endif +#ifdef ECOFF_SIGNED_64 +#define ecoff_get_off bfd_h_get_signed_64 +#define ecoff_put_off bfd_h_put_signed_64 +#endif /* ECOFF auxiliary information swapping routines. These are the same for all ECOFF targets, so they are defined in ecofflink.c. */ @@ -122,7 +131,7 @@ ecoff_swap_hdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -167,7 +176,7 @@ ecoff_swap_hdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -182,10 +191,10 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) struct fdr_ext ext[1]; *ext = *(struct fdr_ext *) ext_copy; - + intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->f_adr); intern->rss = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rss); -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) if (intern->rss == 0xffffffff) intern->rss = -1; #endif @@ -197,11 +206,11 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) intern->cline = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cline); intern->ioptBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ioptBase); intern->copt = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_copt); -#ifdef ECOFF_32 +#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) intern->ipdFirst = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_ipdFirst); intern->cpd = bfd_h_get_16 (abfd, (bfd_byte *)ext->f_cpd); #endif -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) intern->ipdFirst = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_ipdFirst); intern->cpd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_cpd); #endif @@ -210,7 +219,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase); intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_BIG) >> FDR_BITS1_LANG_SH_BIG; @@ -235,7 +244,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -251,7 +260,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) FDR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->f_adr); bfd_h_put_32 (abfd, intern->rss, (bfd_byte *)ext->f_rss); bfd_h_put_32 (abfd, intern->issBase, (bfd_byte *)ext->f_issBase); @@ -262,11 +271,11 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) bfd_h_put_32 (abfd, intern->cline, (bfd_byte *)ext->f_cline); bfd_h_put_32 (abfd, intern->ioptBase, (bfd_byte *)ext->f_ioptBase); bfd_h_put_32 (abfd, intern->copt, (bfd_byte *)ext->f_copt); -#ifdef ECOFF_32 +#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) bfd_h_put_16 (abfd, intern->ipdFirst, (bfd_byte *)ext->f_ipdFirst); bfd_h_put_16 (abfd, intern->cpd, (bfd_byte *)ext->f_cpd); #endif -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) bfd_h_put_32 (abfd, intern->ipdFirst, (bfd_byte *)ext->f_ipdFirst); bfd_h_put_32 (abfd, intern->cpd, (bfd_byte *)ext->f_cpd); #endif @@ -275,7 +284,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) bfd_h_put_32 (abfd, intern->rfdBase, (bfd_byte *)ext->f_rfdBase); bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->f_crfd); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG) & FDR_BITS1_LANG_BIG) @@ -303,7 +312,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -341,7 +350,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh); intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->p_cbLineOffset); -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) intern->gp_prologue = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_gp_prologue); if (bfd_header_big_endian (abfd)) { @@ -364,11 +373,11 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) << PDR_BITS2_RESERVED_SH_LEFT_LITTLE)); } intern->localoff = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_localoff); -#endif +#endif #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -384,7 +393,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) PDR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr); bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym); bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline); @@ -400,7 +409,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) bfd_h_put_32 (abfd, intern->lnHigh, (bfd_byte *)ext->p_lnHigh); ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->p_cbLineOffset); -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) bfd_h_put_8 (abfd, intern->gp_prologue, (bfd_byte *) ext->p_gp_prologue); if (bfd_header_big_endian (abfd)) { @@ -425,17 +434,17 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) & PDR_BITS2_RESERVED_LITTLE); } bfd_h_put_8 (abfd, intern->localoff, (bfd_byte *) ext->p_localoff); -#endif +#endif #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } #else /* MPW_C */ /* Same routines, but with ECOFF_64 code removed, so ^&%$#&! MPW C doesn't - corrupt itself and then freak out. */ + corrupt itself and then freak out. */ /* Swap in the procedure descriptor record. */ static void @@ -447,7 +456,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) struct pdr_ext ext[1]; *ext = *(struct pdr_ext *) ext_copy; - + intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->p_adr); intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym); intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline); @@ -468,7 +477,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -484,7 +493,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) PDR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr); bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym); bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline); @@ -502,7 +511,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } #endif /* MPW_C */ @@ -518,11 +527,11 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) struct sym_ext ext[1]; *ext = *(struct sym_ext *) ext_copy; - + intern->iss = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_iss); intern->value = ecoff_get_off (abfd, (bfd_byte *)ext->s_value); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG) >> SYM_BITS1_ST_SH_BIG; @@ -552,7 +561,7 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -568,11 +577,11 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) SYMR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + bfd_h_put_32 (abfd, intern->iss, (bfd_byte *)ext->s_iss); ecoff_put_off (abfd, intern->value, (bfd_byte *)ext->s_value); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_BIG) & SYM_BITS1_ST_BIG) @@ -601,7 +610,7 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -616,8 +625,8 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) struct ext_ext ext[1]; *ext = *(struct ext_ext *) ext_copy; - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_BIG); intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_BIG); @@ -629,10 +638,10 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) } intern->reserved = 0; -#ifdef ECOFF_32 +#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) intern->ifd = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->es_ifd); #endif -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) intern->ifd = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->es_ifd); #endif @@ -640,7 +649,7 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -656,14 +665,14 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) EXTR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->es_bits1[0] = ((intern->jmptbl ? EXT_BITS1_JMPTBL_BIG : 0) | (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_BIG : 0) | (intern->weakext ? EXT_BITS1_WEAKEXT_BIG : 0)); ext->es_bits2[0] = 0; -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) ext->es_bits2[1] = 0; ext->es_bits2[2] = 0; #endif @@ -672,16 +681,16 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) | (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_LITTLE : 0) | (intern->weakext ? EXT_BITS1_WEAKEXT_LITTLE : 0)); ext->es_bits2[0] = 0; -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) ext->es_bits2[1] = 0; ext->es_bits2[2] = 0; #endif } -#ifdef ECOFF_32 +#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) bfd_h_put_signed_16 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd); #endif -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) bfd_h_put_signed_32 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd); #endif @@ -689,7 +698,7 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -707,7 +716,7 @@ ecoff_swap_rfd_in (abfd, ext_ptr, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -725,7 +734,7 @@ ecoff_swap_rfd_out (abfd, intern, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -766,7 +775,7 @@ ecoff_swap_opt_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -805,7 +814,7 @@ ecoff_swap_opt_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -826,7 +835,7 @@ ecoff_swap_dnr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -848,6 +857,6 @@ ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h index 0dcecdf..4a36629 100644 --- a/contrib/binutils/bfd/elf-bfd.h +++ b/contrib/binutils/bfd/elf-bfd.h @@ -208,7 +208,7 @@ struct elf_link_local_dynamic_entry /* The index in the outgoing dynamic symbol table. */ long dynindx; - + /* A copy of the input symbol. */ Elf_Internal_Sym isym; }; @@ -243,6 +243,9 @@ struct elf_link_hash_table PTR stab_info; /* A linked list of local symbols to be added to .dynsym. */ struct elf_link_local_dynamic_entry *dynlocal; + /* A linked list of DT_RPATH/DT_RUNPATH names found in dynamic + objects included in the link. */ + struct bfd_link_needed_list *runpath; }; /* Look up an entry in an ELF linker hash table. */ @@ -372,9 +375,9 @@ struct elf_backend_data unsigned int)); /* A function to set the type of the info field. Processor-specific - types should be handled here. */ - int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int)); - + types should be handled here. */ + int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int)); + /* A function to do additional processing on the ELF section header just before writing it out. This is used to set the flags and type fields for some sections, or to actually write out data for @@ -388,8 +391,13 @@ struct elf_backend_data Elf32_Internal_Shdr *, char *)); + /* A function to convert machine dependent section header flags to + BFD internal section header flags. */ + boolean (*elf_backend_section_flags) PARAMS ((flagword *, + Elf32_Internal_Shdr *)); + /* A function to handle unusual program segment types when creating BFD - sections from ELF program segments. */ + sections from ELF program segments. */ boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *, Elf32_Internal_Phdr *, int)); @@ -601,7 +609,7 @@ struct elf_backend_data /* Modify any information related to dynamic linking such that the symbol is not exported. */ void (*elf_backend_hide_symbol) - PARAMS ((struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ @@ -638,7 +646,7 @@ struct elf_backend_data both REL and RELA relocations, and this flag is set for those backends.) */ unsigned may_use_rel_p : 1; - + /* Whether the backend may use RELA relocations. (Some backends use both REL and RELA relocations, and this flag is set for those backends.) */ @@ -647,8 +655,8 @@ struct elf_backend_data /* Whether the default relocation type is RELA. If a backend with this flag set wants REL relocations for a particular section, it must note that explicitly. Similarly, if this flag is clear, - and the backend wants RELA relocations for a particular - section. */ + and the backend wants RELA relocations for a particular + section. */ unsigned default_use_rela_p : 1; /* True if addresses "naturally" sign extend. This is used when @@ -788,14 +796,14 @@ struct elf_obj_tdata file_ptr next_file_pos; #if 0 /* we don't need these inside bfd anymore, and I think - these weren't used outside bfd. */ + these weren't used outside bfd. */ void *prstatus; /* The raw /proc prstatus structure */ void *prpsinfo; /* The raw /proc prpsinfo structure */ #endif bfd_vma gp; /* The gp value (MIPS only, for now) */ unsigned int gp_size; /* The gp size (MIPS only, for now) */ - /* Information grabbed from an elf core file. */ + /* Information grabbed from an elf core file. */ int core_signal; int core_pid; int core_lwpid; @@ -817,7 +825,7 @@ struct elf_obj_tdata document the intent of any particular piece of code. The field should be used as a count until size_dynamic_sections, at which point the contents of the .got is fixed. Afterward, if an entry - is -1, then the symbol does not require a global offset table entry. */ + is -1, then the symbol does not require a global offset table entry. */ union { bfd_signed_vma *refcounts; @@ -838,6 +846,14 @@ struct elf_obj_tdata one. */ const char *dt_name; + /* When a reference in a regular object is resolved by a shared + object is loaded into via the DT_NEEDED entries by the linker + ELF emulation code, we need to add the shared object to the + DT_NEEDED list of the resulting binary to indicate the dependency + as if the -l option is passed to the linker. This field holds the + name of the loaded shared object. */ + const char *dt_soname; + /* Irix 5 often screws up the symbol table, sorting local symbols after global symbols. This flag is set if the symbol table in this BFD appears to be screwed up. If it is, we ignore the @@ -857,11 +873,11 @@ struct elf_obj_tdata find_nearest_line. */ struct mips_elf_find_line *find_line_info; - /* A place to stash dwarf1 info for this bfd. */ + /* A place to stash dwarf1 info for this bfd. */ struct dwarf1_debug *dwarf1_find_line_info; - /* A place to stash dwarf2 info for this bfd. */ - struct dwarf2_debug *dwarf2_find_line_info; + /* A place to stash dwarf2 info for this bfd. */ + PTR dwarf2_find_line_info; /* An array of stub sections indexed by symbol number, used by the MIPS ELF linker. FIXME: We should figure out some way to only @@ -885,6 +901,13 @@ struct elf_obj_tdata /* Linker sections that we are interested in. */ struct elf_linker_section *linker_section[ (int)LINKER_SECTION_MAX ]; + + /* The Irix 5 support uses two virtual sections, which represent + text/data symbols defined in dynamic objects. */ + asymbol *elf_data_symbol; + asymbol *elf_text_symbol; + asection *elf_data_section; + asection *elf_text_section; }; #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data) @@ -908,6 +931,7 @@ struct elf_obj_tdata #define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets) #define elf_local_ptr_offsets(bfd) (elf_tdata(bfd) -> linker_section_pointers) #define elf_dt_name(bfd) (elf_tdata(bfd) -> dt_name) +#define elf_dt_soname(bfd) (elf_tdata(bfd) -> dt_soname) #define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab) #define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init) #define elf_linker_section(bfd,n) (elf_tdata(bfd) -> linker_section[(int)n]) @@ -970,7 +994,7 @@ extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create extern void _bfd_elf_link_hash_copy_indirect PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); extern void _bfd_elf_link_hash_hide_symbol - PARAMS ((struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); extern boolean _bfd_elf_link_hash_table_init PARAMS ((struct elf_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, @@ -1006,14 +1030,14 @@ extern boolean _bfd_elf_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); extern boolean _bfd_elf_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, - bfd_vma, CONST char **, - CONST char **, + bfd_vma, const char **, + const char **, unsigned int *)); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers PARAMS ((bfd *, boolean)); extern boolean _bfd_elf_new_section_hook PARAMS ((bfd *, asection *)); -extern boolean _bfd_elf_init_reloc_shdr +extern boolean _bfd_elf_init_reloc_shdr PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean)); /* If the target doesn't have reloc handling written yet: */ @@ -1142,6 +1166,10 @@ extern long bfd_elf32_slurp_symbol_table extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *)); extern int bfd_elf32_write_out_phdrs PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); +extern void bfd_elf32_write_relocs + PARAMS ((bfd *, asection *, PTR)); +extern boolean bfd_elf32_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, boolean)); extern boolean bfd_elf32_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); extern boolean bfd_elf32_link_create_dynamic_sections @@ -1185,6 +1213,10 @@ extern long bfd_elf64_slurp_symbol_table extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *)); extern int bfd_elf64_write_out_phdrs PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); +extern void bfd_elf64_write_relocs + PARAMS ((bfd *, asection *, PTR)); +extern boolean bfd_elf64_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, boolean)); extern boolean bfd_elf64_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); extern boolean bfd_elf64_link_create_dynamic_sections @@ -1274,11 +1306,11 @@ extern boolean _bfd_mips_elf_finish_dynamic_symbol Elf_Internal_Sym *)); extern boolean _bfd_mips_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -extern asection * _bfd_mips_elf_gc_mark_hook +extern asection * _bfd_mips_elf_gc_mark_hook PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -extern boolean _bfd_mips_elf_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, +extern boolean _bfd_mips_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); extern boolean _bfd_mips_elf_always_size_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -1289,7 +1321,7 @@ extern boolean _bfd_mips_elf_check_relocs const Elf_Internal_Rela *)); extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create PARAMS ((bfd *)); -extern boolean _bfd_mips_elf_print_private_bfd_data +extern boolean _bfd_mips_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); extern boolean _bfd_mips_elf_link_output_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c index e8e7e37..5ae24ee 100644 --- a/contrib/binutils/bfd/elf.c +++ b/contrib/binutils/bfd/elf.c @@ -31,6 +31,8 @@ SECTION haven't bothered yet. */ +/* For sparc64-cross-sparc32. */ +#define _SYSCALL32 #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" @@ -227,11 +229,11 @@ bfd_elf_hash (namearg) /* Read a specified number of bytes at a specified offset in an ELF file, into a newly allocated buffer, and return a pointer to the - buffer. */ + buffer. */ static char * elf_read (abfd, offset, size) - bfd * abfd; + bfd *abfd; long offset; unsigned int size; { @@ -252,31 +254,31 @@ elf_read (abfd, offset, size) boolean bfd_elf_mkobject (abfd) - bfd * abfd; + bfd *abfd; { - /* this just does initialization */ - /* coff_mkobject zalloc's space for tdata.coff_obj_data ... */ + /* This just does initialization. */ + /* coff_mkobject zalloc's space for tdata.coff_obj_data ... */ elf_tdata (abfd) = (struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); if (elf_tdata (abfd) == 0) return false; - /* since everything is done at close time, do we need any - initialization? */ + /* Since everything is done at close time, do we need any + initialization? */ return true; } boolean bfd_elf_mkcorefile (abfd) - bfd * abfd; + bfd *abfd; { - /* I think this can be done just like an object file. */ + /* I think this can be done just like an object file. */ return bfd_elf_mkobject (abfd); } char * bfd_elf_get_str_section (abfd, shindex) - bfd * abfd; + bfd *abfd; unsigned int shindex; { Elf_Internal_Shdr **i_shdrp; @@ -291,7 +293,7 @@ bfd_elf_get_str_section (abfd, shindex) shstrtab = (char *) i_shdrp[shindex]->contents; if (shstrtab == NULL) { - /* No cached one, attempt to read, and cache what we read. */ + /* No cached one, attempt to read, and cache what we read. */ offset = i_shdrp[shindex]->sh_offset; shstrtabsize = i_shdrp[shindex]->sh_size; shstrtab = elf_read (abfd, offset, shstrtabsize); @@ -302,7 +304,7 @@ bfd_elf_get_str_section (abfd, shindex) char * bfd_elf_string_from_elf_section (abfd, shindex, strindex) - bfd * abfd; + bfd *abfd; unsigned int shindex; unsigned int strindex; { @@ -343,6 +345,7 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) { asection *newsect; flagword flags; + struct elf_backend_data *bed; if (hdr->bfd_section != NULL) { @@ -381,10 +384,23 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) /* The debugging sections appear to be recognized only by name, not any sort of flag. */ - if (strncmp (name, ".debug", sizeof ".debug" - 1) == 0 - || strncmp (name, ".line", sizeof ".line" - 1) == 0 - || strncmp (name, ".stab", sizeof ".stab" - 1) == 0) - flags |= SEC_DEBUGGING; + { + static const char *debug_sec_names [] = + { + ".debug", + ".gnu.linkonce.wi.", + ".line", + ".stab" + }; + int i; + + for (i = sizeof (debug_sec_names) / sizeof (debug_sec_names[0]); i--;) + if (strncmp (name, debug_sec_names[i], strlen (debug_sec_names[i])) == 0) + break; + + if (i >= 0) + flags |= SEC_DEBUGGING; + } /* As a GNU extension, if the name begins with .gnu.linkonce, we only link a single copy of the section. This is used to support @@ -395,6 +411,11 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; + bed = get_elf_backend_data (abfd); + if (bed->elf_backend_section_flags) + if (! bed->elf_backend_section_flags (&flags, hdr)) + return false; + if (! bfd_set_section_flags (abfd, newsect, flags)) return false; @@ -457,7 +478,7 @@ DESCRIPTION struct elf_internal_shdr * bfd_elf_find_section (abfd, name) - bfd * abfd; + bfd *abfd; char *name; { Elf_Internal_Shdr **i_shdrp; @@ -497,7 +518,6 @@ const char *const bfd_elf_section_type_names[] = { function. It just short circuits the reloc if producing relocateable output against an external symbol. */ -/*ARGSUSED*/ bfd_reloc_status_type bfd_elf_generic_reloc (abfd, reloc_entry, @@ -653,13 +673,40 @@ _bfd_elf_print_private_bfd_data (abfd, farg) case DT_DEBUG: name = "DEBUG"; break; case DT_TEXTREL: name = "TEXTREL"; break; case DT_JMPREL: name = "JMPREL"; break; - case DT_AUXILIARY: name = "AUXILIARY"; stringp = true; break; - case DT_FILTER: name = "FILTER"; stringp = true; break; + case DT_BIND_NOW: name = "BIND_NOW"; break; + case DT_INIT_ARRAY: name = "INIT_ARRAY"; break; + case DT_FINI_ARRAY: name = "FINI_ARRAY"; break; + case DT_INIT_ARRAYSZ: name = "INIT_ARRAYSZ"; break; + case DT_FINI_ARRAYSZ: name = "FINI_ARRAYSZ"; break; + case DT_RUNPATH: name = "RUNPATH"; stringp = true; break; + case DT_FLAGS: name = "FLAGS"; break; + case DT_PREINIT_ARRAY: name = "PREINIT_ARRAY"; break; + case DT_PREINIT_ARRAYSZ: name = "PREINIT_ARRAYSZ"; break; + case DT_CHECKSUM: name = "CHECKSUM"; break; + case DT_PLTPADSZ: name = "PLTPADSZ"; break; + case DT_MOVEENT: name = "MOVEENT"; break; + case DT_MOVESZ: name = "MOVESZ"; break; + case DT_FEATURE: name = "FEATURE"; break; + case DT_POSFLAG_1: name = "POSFLAG_1"; break; + case DT_SYMINSZ: name = "SYMINSZ"; break; + case DT_SYMINENT: name = "SYMINENT"; break; + case DT_CONFIG: name = "CONFIG"; stringp = true; break; + case DT_DEPAUDIT: name = "DEPAUDIT"; stringp = true; break; + case DT_AUDIT: name = "AUDIT"; stringp = true; break; + case DT_PLTPAD: name = "PLTPAD"; break; + case DT_MOVETAB: name = "MOVETAB"; break; + case DT_SYMINFO: name = "SYMINFO"; break; + case DT_RELACOUNT: name = "RELACOUNT"; break; + case DT_RELCOUNT: name = "RELCOUNT"; break; + case DT_FLAGS_1: name = "FLAGS_1"; break; case DT_VERSYM: name = "VERSYM"; break; case DT_VERDEF: name = "VERDEF"; break; case DT_VERDEFNUM: name = "VERDEFNUM"; break; case DT_VERNEED: name = "VERNEED"; break; case DT_VERNEEDNUM: name = "VERNEEDNUM"; break; + case DT_AUXILIARY: name = "AUXILIARY"; stringp = true; break; + case DT_USED: name = "USED"; break; + case DT_FILTER: name = "FILTER"; stringp = true; break; } fprintf (f, " %-11s ", name); @@ -762,16 +809,16 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) CONST char *name = NULL; struct elf_backend_data *bed; unsigned char st_other; - + section_name = symbol->section ? symbol->section->name : "(*none*)"; bed = get_elf_backend_data (abfd); if (bed->elf_backend_print_symbol_all) - name = (*bed->elf_backend_print_symbol_all) (abfd, filep, symbol); + name = (*bed->elf_backend_print_symbol_all) (abfd, filep, symbol); if (name == NULL) { - name = symbol->name; + name = symbol->name; bfd_print_symbol_vandf ((PTR) file, symbol); } @@ -838,7 +885,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) /* If the st_other field is not zero, print it. */ st_other = ((elf_symbol_type *) symbol)->internal_elf_sym.st_other; - + switch (st_other) { case 0: break; @@ -950,7 +997,8 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) } void -_bfd_elf_link_hash_hide_symbol(h) +_bfd_elf_link_hash_hide_symbol (info, h) + struct bfd_link_info *info ATTRIBUTE_UNUSED; struct elf_link_hash_entry *h; { h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; @@ -975,6 +1023,7 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc) table->dynstr = NULL; table->bucketcount = 0; table->needed = NULL; + table->runpath = NULL; table->hgot = NULL; table->stab_info = NULL; table->dynlocal = NULL; @@ -1018,6 +1067,16 @@ bfd_elf_set_dt_needed_name (abfd, name) elf_dt_name (abfd) = name; } +void +bfd_elf_set_dt_needed_soname (abfd, name) + bfd *abfd; + const char *name; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour + && bfd_get_format (abfd) == bfd_object) + elf_dt_soname (abfd) = name; +} + /* Get the list of DT_NEEDED entries for a link. This is a hook for the linker ELF emulation code. */ @@ -1031,6 +1090,19 @@ bfd_elf_get_needed_list (abfd, info) return elf_hash_table (info)->needed; } +/* Get the list of DT_RPATH/DT_RUNPATH entries for a link. This is a + hook for the linker ELF emulation code. */ + +struct bfd_link_needed_list * +bfd_elf_get_runpath_list (abfd, info) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; +{ + if (info->hash->creator->flavour != bfd_target_elf_flavour) + return NULL; + return elf_hash_table (info)->runpath; +} + /* Get the name actually used for a dynamic object for a link. This is the SONAME entry if there is one. Otherwise, it is the string passed to bfd_elf_set_dt_needed_name, or it is the filename. */ @@ -1155,7 +1227,7 @@ _bfd_elf_stringtab_init () /* ELF .o/exec file reading */ -/* Create a new bfd section from an ELF section header. */ +/* Create a new bfd section from an ELF section header. */ boolean bfd_section_from_shdr (abfd, shindex) @@ -1328,8 +1400,10 @@ bfd_section_from_shdr (abfd, shindex) /* If this reloc section does not use the main symbol table we don't treat it as a reloc section. BFD can't adequately represent such a section, so at least for now, we don't - try. We just present it as a normal section. */ - if (hdr->sh_link != elf_onesymtab (abfd)) + try. We just present it as a normal section. We also + can't use it as a reloc section if it points to the null + section. */ + if (hdr->sh_link != elf_onesymtab (abfd) || hdr->sh_info == SHN_UNDEF) return _bfd_elf_make_section_from_shdr (abfd, hdr, name); if (! bfd_section_from_shdr (abfd, hdr->sh_info)) @@ -1423,7 +1497,7 @@ _bfd_elf_new_section_hook (abfd, sec) sec->used_by_bfd = (PTR) sdata; /* Indicate whether or not this section should use RELA relocations. */ - sdata->use_rela_p + sdata->use_rela_p = get_elf_backend_data (abfd)->default_use_rela_p; return true; @@ -1486,7 +1560,7 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) if (hdr->p_flags & PF_X) { /* FIXME: all we known is that it has execute PERMISSION, - may be data. */ + may be data. */ newsect->flags |= SEC_CODE; } } @@ -1558,7 +1632,7 @@ bfd_section_from_phdr (abfd, hdr, index) default: /* Check for any processor-specific program segment types. - If no handler for them, default to making "segment" sections. */ + If no handler for them, default to making "segment" sections. */ bed = get_elf_backend_data (abfd); if (bed->elf_backend_section_from_phdr) return (*bed->elf_backend_section_from_phdr) (abfd, hdr, index); @@ -1606,7 +1680,6 @@ _bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p) /* Set up an ELF internal section header for a section. */ -/*ARGSUSED*/ static void elf_fake_sections (abfd, asect, failedptrarg) bfd *abfd; @@ -1720,16 +1793,10 @@ elf_fake_sections (abfd, asect, failedptrarg) || this_hdr->sh_info == elf_tdata (abfd)->cverrefs); } else if ((asect->flags & SEC_ALLOC) != 0 - && (asect->flags & SEC_LOAD) != 0) - this_hdr->sh_type = SHT_PROGBITS; - else if ((asect->flags & SEC_ALLOC) != 0 - && ((asect->flags & SEC_LOAD) == 0)) + && ((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)) this_hdr->sh_type = SHT_NOBITS; else - { - /* Who knows? */ - this_hdr->sh_type = SHT_PROGBITS; - } + this_hdr->sh_type = SHT_PROGBITS; if ((asect->flags & SEC_ALLOC) != 0) this_hdr->sh_flags |= SHF_ALLOC; @@ -1745,11 +1812,11 @@ elf_fake_sections (abfd, asect, failedptrarg) /* If the section has relocs, set up a section header for the SHT_REL[A] section. If two relocation sections are required for this section, it is up to the processor-specific back-end to - create the other. */ + create the other. */ if ((asect->flags & SEC_RELOC) != 0 - && !_bfd_elf_init_reloc_shdr (abfd, + && !_bfd_elf_init_reloc_shdr (abfd, &elf_section_data (asect)->rel_hdr, - asect, + asect, elf_section_data (asect)->use_rela_p)) *failedptr = true; } @@ -1766,7 +1833,6 @@ assign_section_numbers (abfd) asection *sec; unsigned int section_number; Elf_Internal_Shdr **i_shdrp; - struct elf_backend_data *bed = get_elf_backend_data (abfd); section_number = 1; @@ -1901,7 +1967,7 @@ assign_section_numbers (abfd) /* This is a .stab section. */ elf_section_data (s)->this_hdr.sh_entsize = - 4 + 2 * (bed->s->arch_size / 8); + 4 + 2 * bfd_get_arch_size (abfd) / 8; } } break; @@ -1990,7 +2056,7 @@ elf_map_symbols (abfd) for (idx = 0; idx < symcount; idx++) { sym = syms[idx]; - + if ((sym->flags & BSF_SECTION_SYM) != 0 && sym->value == 0) { @@ -2004,7 +2070,7 @@ elf_map_symbols (abfd) { if (sec->output_offset != 0) continue; - + sec = sec->output_section; /* Empty sections in the input files may have had a section @@ -2903,18 +2969,21 @@ assign_file_positions_for_segments (abfd) if (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core) { - if (i == 0) /* the actual "note" segment */ - { /* this one actually contains everything. */ + /* The actual "note" segment has i == 0. + This is the one that actually contains everything. */ + if (i == 0) + { sec->filepos = off; p->p_filesz = sec->_raw_size; off += sec->_raw_size; voff = off; } - else /* fake sections -- don't need to be written */ + else { + /* Fake sections -- don't need to be written. */ sec->filepos = 0; sec->_raw_size = 0; - flags = sec->flags = 0; /* no contents */ + flags = sec->flags = 0; } p->p_memsz = 0; p->p_align = 1; @@ -3228,7 +3297,7 @@ prep_headers (abfd) i_ehdrp->e_machine = EM_NONE; break; case bfd_arch_sparc: - if (bed->s->arch_size == 64) + if (bfd_get_arch_size (abfd) == 64) i_ehdrp->e_machine = EM_SPARCV9; else i_ehdrp->e_machine = EM_SPARC; @@ -3237,7 +3306,19 @@ prep_headers (abfd) i_ehdrp->e_machine = EM_S370; break; case bfd_arch_i386: - i_ehdrp->e_machine = EM_386; + if (bfd_get_arch_size (abfd) == 64) + i_ehdrp->e_machine = EM_X86_64; + else + i_ehdrp->e_machine = EM_386; + break; + case bfd_arch_ia64: + i_ehdrp->e_machine = EM_IA_64; + break; + case bfd_arch_m68hc11: + i_ehdrp->e_machine = EM_68HC11; + break; + case bfd_arch_m68hc12: + i_ehdrp->e_machine = EM_68HC12; break; case bfd_arch_m68k: i_ehdrp->e_machine = EM_68K; @@ -3288,10 +3369,10 @@ prep_headers (abfd) case 0: i_ehdrp->e_machine = EM_CYGNUS_V850; break; } break; - case bfd_arch_arc: + case bfd_arch_arc: i_ehdrp->e_machine = EM_CYGNUS_ARC; break; - case bfd_arch_arm: + case bfd_arch_arm: i_ehdrp->e_machine = EM_ARM; break; case bfd_arch_m32r: @@ -3306,6 +3387,9 @@ prep_headers (abfd) case bfd_arch_pj: i_ehdrp->e_machine = EM_PJ; break; + case bfd_arch_cris: + i_ehdrp->e_machine = EM_CRIS; + break; /* also note that EM_M32, AT&T WE32100 is unknown to bfd */ default: i_ehdrp->e_machine = EM_NONE; @@ -3313,24 +3397,24 @@ prep_headers (abfd) i_ehdrp->e_version = bed->s->ev_current; i_ehdrp->e_ehsize = bed->s->sizeof_ehdr; - /* no program header, for now. */ + /* No program header, for now. */ i_ehdrp->e_phoff = 0; i_ehdrp->e_phentsize = 0; i_ehdrp->e_phnum = 0; - /* each bfd section is section header entry */ + /* Each bfd section is section header entry. */ i_ehdrp->e_entry = bfd_get_start_address (abfd); i_ehdrp->e_shentsize = bed->s->sizeof_shdr; - /* if we're building an executable, we'll need a program header table */ + /* If we're building an executable, we'll need a program header table. */ if (abfd->flags & EXEC_P) { - /* it all happens later */ + /* It all happens later. */ #if 0 i_ehdrp->e_phentsize = sizeof (Elf_External_Phdr); /* elf_build_phdrs() returns a (NULL-terminated) array of - Elf_Internal_Phdrs */ + Elf_Internal_Phdrs. */ i_phdrp = elf_build_phdrs (abfd, i_ehdrp, i_shdrp, &i_ehdrp->e_phnum); i_ehdrp->e_phoff = outbase; outbase += i_ehdrp->e_phentsize * i_ehdrp->e_phnum; @@ -3410,7 +3494,7 @@ _bfd_elf_write_object_contents (abfd) _bfd_elf_assign_file_positions_for_relocs (abfd); - /* After writing the headers, we need to write the sections too... */ + /* After writing the headers, we need to write the sections too... */ for (count = 1; count < i_ehdrp->e_shnum; count++) { if (bed->elf_backend_section_processing) @@ -3441,10 +3525,12 @@ boolean _bfd_elf_write_corefile_contents (abfd) bfd *abfd; { - /* Hopefully this can be done just like an object file. */ + /* Hopefully this can be done just like an object file. */ return _bfd_elf_write_object_contents (abfd); } -/* given a section, search the header to find them... */ + +/* Given a section, search the header to find them. */ + int _bfd_elf_section_from_bfd_section (abfd, asect) bfd *abfd; @@ -3553,14 +3639,18 @@ copy_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; { - Elf_Internal_Ehdr *iehdr; - struct elf_segment_map *mfirst; - struct elf_segment_map **pm; - struct elf_segment_map *m; - Elf_Internal_Phdr *p; - unsigned int i; - unsigned int num_segments; - boolean phdr_included = false; + Elf_Internal_Ehdr * iehdr; + struct elf_segment_map * map; + struct elf_segment_map * map_first; + struct elf_segment_map ** pointer_to_map; + Elf_Internal_Phdr * segment; + asection * section; + unsigned int i; + unsigned int num_segments; + boolean phdr_included = false; + bfd_vma maxpagesize; + struct elf_segment_map * phdr_adjust_seg = NULL; + unsigned int phdr_adjust_num = 0; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -3571,119 +3661,214 @@ copy_private_bfd_data (ibfd, obfd) iehdr = elf_elfheader (ibfd); - mfirst = NULL; - pm = &mfirst; + map_first = NULL; + pointer_to_map = &map_first; num_segments = elf_elfheader (ibfd)->e_phnum; - -#define IS_CONTAINED_BY(addr, len, bottom, phdr) \ - ((addr) >= (bottom) \ - && ( ((addr) + (len)) <= ((bottom) + (phdr)->p_memsz) \ - || ((addr) + (len)) <= ((bottom) + (phdr)->p_filesz))) - - /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */ - -#define IS_COREFILE_NOTE(p, s) \ - (p->p_type == PT_NOTE \ - && bfd_get_format (ibfd) == bfd_core \ - && s->vma == 0 && s->lma == 0 \ - && (bfd_vma) s->filepos >= p->p_offset \ - && (bfd_vma) s->filepos + s->_raw_size \ + maxpagesize = get_elf_backend_data (obfd)->maxpagesize; + + /* Returns the end address of the segment + 1. */ +#define SEGMENT_END(segment, start) \ + (start + (segment->p_memsz > segment->p_filesz \ + ? segment->p_memsz : segment->p_filesz)) + + /* Returns true if the given section is contained within + the given segment. VMA addresses are compared. */ +#define IS_CONTAINED_BY_VMA(section, segment) \ + (section->vma >= segment->p_vaddr \ + && (section->vma + section->_raw_size) \ + <= (SEGMENT_END (segment, segment->p_vaddr))) + + /* Returns true if the given section is contained within + the given segment. LMA addresses are compared. */ +#define IS_CONTAINED_BY_LMA(section, segment, base) \ + (section->lma >= base \ + && (section->lma + section->_raw_size) \ + <= SEGMENT_END (segment, base)) + + /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */ +#define IS_COREFILE_NOTE(p, s) \ + (p->p_type == PT_NOTE \ + && bfd_get_format (ibfd) == bfd_core \ + && s->vma == 0 && s->lma == 0 \ + && (bfd_vma) s->filepos >= p->p_offset \ + && (bfd_vma) s->filepos + s->_raw_size \ <= p->p_offset + p->p_filesz) /* The complicated case when p_vaddr is 0 is to handle the Solaris linker, which generates a PT_INTERP section with p_vaddr and p_memsz set to 0. */ - -#define IS_SOLARIS_PT_INTERP(p, s) \ - (p->p_vaddr == 0 \ - && p->p_filesz > 0 \ - && (s->flags & SEC_HAS_CONTENTS) != 0 \ - && s->_raw_size > 0 \ - && (bfd_vma) s->filepos >= p->p_offset \ - && ((bfd_vma) s->filepos + s->_raw_size \ +#define IS_SOLARIS_PT_INTERP(p, s) \ + ( p->p_vaddr == 0 \ + && p->p_filesz > 0 \ + && (s->flags & SEC_HAS_CONTENTS) != 0 \ + && s->_raw_size > 0 \ + && (bfd_vma) s->filepos >= p->p_offset \ + && ((bfd_vma) s->filepos + s->_raw_size \ <= p->p_offset + p->p_filesz)) + /* Decide if the given section should be included in the given segment. + A section will be included if: + 1. It is within the address space of the segment, + 2. It is an allocated segment, + 3. There is an output section associated with it, + 4. The section has not already been allocated to a previous segment. */ +#define INCLUDE_SECTION_IN_SEGMENT(section, segment) \ + ((((IS_CONTAINED_BY_VMA (section, segment) \ + || IS_SOLARIS_PT_INTERP (segment, section)) \ + && (section->flags & SEC_ALLOC) != 0) \ + || IS_COREFILE_NOTE (segment, section)) \ + && section->output_section != NULL \ + && section->segment_mark == false) + + /* Returns true iff seg1 starts after the end of seg2. */ +#define SEGMENT_AFTER_SEGMENT(seg1, seg2) \ + (seg1->p_vaddr >= SEGMENT_END (seg2, seg2->p_vaddr)) + + /* Returns true iff seg1 and seg2 overlap. */ +#define SEGMENT_OVERLAPS(seg1, seg2) \ + (!(SEGMENT_AFTER_SEGMENT (seg1, seg2) || SEGMENT_AFTER_SEGMENT (seg2, seg1))) + + /* Initialise the segment mark field. */ + for (section = ibfd->sections; section != NULL; section = section->next) + section->segment_mark = false; + /* Scan through the segments specified in the program header - of the input BFD. */ - for (i = 0, p = elf_tdata (ibfd)->phdr; i < num_segments; i++, p++) + of the input BFD. For this first scan we look for overlaps + in the loadable segments. These can be created by wierd + parameters to objcopy. */ + for (i = 0, segment = elf_tdata (ibfd)->phdr; + i < num_segments; + i++, segment++) { - unsigned int csecs; - asection *s; - asection **sections; - asection *os; - unsigned int isec; - bfd_vma matching_lma; - bfd_vma suggested_lma; unsigned int j; + Elf_Internal_Phdr *segment2; - /* For each section in the input BFD, decide if it should be - included in the current segment. A section will be included - if it is within the address space of the segment, and it is - an allocated segment, and there is an output section - associated with it. */ - csecs = 0; - for (s = ibfd->sections; s != NULL; s = s->next) - if (s->output_section != NULL) - { - if ((IS_CONTAINED_BY (s->vma, s->_raw_size, p->p_vaddr, p) - || IS_SOLARIS_PT_INTERP (p, s)) - && (s->flags & SEC_ALLOC) != 0) - ++csecs; - else if (IS_COREFILE_NOTE (p, s)) - ++csecs; - } + if (segment->p_type != PT_LOAD) + continue; + + /* Determine if this segment overlaps any previous segments. */ + for (j = 0, segment2 = elf_tdata (ibfd)->phdr; j < i; j++, segment2 ++) + { + bfd_signed_vma extra_length; + + if (segment2->p_type != PT_LOAD + || ! SEGMENT_OVERLAPS (segment, segment2)) + continue; + + /* Merge the two segments together. */ + if (segment2->p_vaddr < segment->p_vaddr) + { + /* Extend SEGMENT2 to include SEGMENT and then delete + SEGMENT. */ + extra_length = + SEGMENT_END (segment, segment->p_vaddr) + - SEGMENT_END (segment2, segment2->p_vaddr); + + if (extra_length > 0) + { + segment2->p_memsz += extra_length; + segment2->p_filesz += extra_length; + } + + segment->p_type = PT_NULL; + + /* Since we have deleted P we must restart the outer loop. */ + i = 0; + segment = elf_tdata (ibfd)->phdr; + break; + } + else + { + /* Extend SEGMENT to include SEGMENT2 and then delete + SEGMENT2. */ + extra_length = + SEGMENT_END (segment2, segment2->p_vaddr) + - SEGMENT_END (segment, segment->p_vaddr); + + if (extra_length > 0) + { + segment->p_memsz += extra_length; + segment->p_filesz += extra_length; + } + + segment2->p_type = PT_NULL; + } + } + } + + /* The second scan attempts to assign sections to segments. */ + for (i = 0, segment = elf_tdata (ibfd)->phdr; + i < num_segments; + i ++, segment ++) + { + unsigned int section_count; + asection ** sections; + asection * output_section; + unsigned int isec; + bfd_vma matching_lma; + bfd_vma suggested_lma; + unsigned int j; + + if (segment->p_type == PT_NULL) + continue; + + /* Compute how many sections might be placed into this segment. */ + section_count = 0; + for (section = ibfd->sections; section != NULL; section = section->next) + if (INCLUDE_SECTION_IN_SEGMENT (section, segment)) + ++section_count; /* Allocate a segment map big enough to contain all of the sections we have selected. */ - m = ((struct elf_segment_map *) + map = ((struct elf_segment_map *) bfd_alloc (obfd, (sizeof (struct elf_segment_map) - + ((size_t) csecs - 1) * sizeof (asection *)))); - if (m == NULL) + + ((size_t) section_count - 1) * sizeof (asection *)))); + if (map == NULL) return false; /* Initialise the fields of the segment map. Default to using the physical address of the segment in the input BFD. */ - m->next = NULL; - m->p_type = p->p_type; - m->p_flags = p->p_flags; - m->p_flags_valid = 1; - m->p_paddr = p->p_paddr; - m->p_paddr_valid = 1; + map->next = NULL; + map->p_type = segment->p_type; + map->p_flags = segment->p_flags; + map->p_flags_valid = 1; + map->p_paddr = segment->p_paddr; + map->p_paddr_valid = 1; /* Determine if this segment contains the ELF file header and if it contains the program headers themselves. */ - m->includes_filehdr = (p->p_offset == 0 - && p->p_filesz >= iehdr->e_ehsize); + map->includes_filehdr = (segment->p_offset == 0 + && segment->p_filesz >= iehdr->e_ehsize); - m->includes_phdrs = 0; + map->includes_phdrs = 0; - if (! phdr_included || p->p_type != PT_LOAD) + if (! phdr_included || segment->p_type != PT_LOAD) { - m->includes_phdrs = - (p->p_offset <= (bfd_vma) iehdr->e_phoff - && (p->p_offset + p->p_filesz + map->includes_phdrs = + (segment->p_offset <= (bfd_vma) iehdr->e_phoff + && (segment->p_offset + segment->p_filesz >= ((bfd_vma) iehdr->e_phoff + iehdr->e_phnum * iehdr->e_phentsize))); - if (p->p_type == PT_LOAD && m->includes_phdrs) + + if (segment->p_type == PT_LOAD && map->includes_phdrs) phdr_included = true; } - if (csecs == 0) + if (section_count == 0) { /* Special segments, such as the PT_PHDR segment, may contain no sections, but ordinary, loadable segments should contain something. */ - - if (p->p_type == PT_LOAD) + if (segment->p_type == PT_LOAD) _bfd_error_handler (_("%s: warning: Empty loadable segment detected\n"), bfd_get_filename (ibfd)); - m->count = 0; - *pm = m; - pm = &m->next; + map->count = 0; + *pointer_to_map = map; + pointer_to_map = &map->next; continue; } @@ -3716,7 +3901,8 @@ copy_private_bfd_data (ibfd, obfd) pointers that we are interested in. As these sections get assigned to a segment, they are removed from this array. */ - sections = (asection **) bfd_malloc (sizeof (asection *) * csecs); + sections = (asection **) bfd_malloc + (sizeof (asection *) * section_count); if (sections == NULL) return false; @@ -3726,70 +3912,67 @@ copy_private_bfd_data (ibfd, obfd) case, where the sections have not been moved, this means that we have completely filled the segment, and there is nothing more to do. */ - isec = 0; matching_lma = 0; suggested_lma = 0; - for (j = 0, s = ibfd->sections; s != NULL; s = s->next) + for (j = 0, section = ibfd->sections; + section != NULL; + section = section->next) { - os = s->output_section; - - if ((((IS_CONTAINED_BY (s->vma, s->_raw_size, p->p_vaddr, p) - || IS_SOLARIS_PT_INTERP (p, s)) - && (s->flags & SEC_ALLOC) != 0) - || IS_COREFILE_NOTE (p, s)) - && os != NULL) + if (INCLUDE_SECTION_IN_SEGMENT (section, segment)) { - sections[j++] = s; + output_section = section->output_section; + + sections[j ++] = section; /* The Solaris native linker always sets p_paddr to 0. We try to catch that case here, and set it to the correct value. */ - if (p->p_paddr == 0 - && p->p_vaddr != 0 + if (segment->p_paddr == 0 + && segment->p_vaddr != 0 && isec == 0 - && os->lma != 0 - && (os->vma == (p->p_vaddr - + (m->includes_filehdr - ? iehdr->e_ehsize - : 0) - + (m->includes_phdrs - ? iehdr->e_phnum * iehdr->e_phentsize - : 0)))) - m->p_paddr = p->p_vaddr; + && output_section->lma != 0 + && (output_section->vma == (segment->p_vaddr + + (map->includes_filehdr + ? iehdr->e_ehsize + : 0) + + (map->includes_phdrs + ? iehdr->e_phnum * iehdr->e_phentsize + : 0)))) + map->p_paddr = segment->p_vaddr; /* Match up the physical address of the segment with the LMA address of the output section. */ - if (IS_CONTAINED_BY (os->lma, os->_raw_size, m->p_paddr, p) - || IS_COREFILE_NOTE (p, s)) + if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr) + || IS_COREFILE_NOTE (segment, section)) { if (matching_lma == 0) - matching_lma = os->lma; + matching_lma = output_section->lma; /* We assume that if the section fits within the segment - that it does not overlap any other section within that + then it does not overlap any other section within that segment. */ - m->sections[isec++] = os; + map->sections[isec ++] = output_section; } else if (suggested_lma == 0) - suggested_lma = os->lma; + suggested_lma = output_section->lma; } } - BFD_ASSERT (j == csecs); + BFD_ASSERT (j == section_count); /* Step Two: Adjust the physical address of the current segment, if necessary. */ - if (isec == csecs) + if (isec == section_count) { /* All of the sections fitted within the segment as currently specified. This is the default case. Add the segment to the list of built segments and carry on to process the next program header in the input BFD. */ - m->count = csecs; - *pm = m; - pm = &m->next; + map->count = section_count; + *pointer_to_map = map; + pointer_to_map = &map->next; free (sections); continue; @@ -3801,25 +3984,33 @@ copy_private_bfd_data (ibfd, obfd) /* At least one section fits inside the current segment. Keep it, but modify its physical address to match the LMA of the first section that fitted. */ - - m->p_paddr = matching_lma; + map->p_paddr = matching_lma; } else { /* None of the sections fitted inside the current segment. Change the current segment's physical address to match the LMA of the first section. */ - - m->p_paddr = suggested_lma; + map->p_paddr = suggested_lma; } - /* Offset the segment physical address from the lma to allow - for space taken up by elf headers. */ - if (m->includes_filehdr) - m->p_paddr -= iehdr->e_ehsize; + /* Offset the segment physical address from the lma + to allow for space taken up by elf headers. */ + if (map->includes_filehdr) + map->p_paddr -= iehdr->e_ehsize; - if (m->includes_phdrs) - m->p_paddr -= iehdr->e_phnum * iehdr->e_phentsize; + if (map->includes_phdrs) + { + map->p_paddr -= iehdr->e_phnum * iehdr->e_phentsize; + + /* iehdr->e_phnum is just an estimate of the number + of program headers that we will need. Make a note + here of the number we used and the segment we chose + to hold these headers, so that we can adjust the + offset when we know the correct value. */ + phdr_adjust_num = iehdr->e_phnum; + phdr_adjust_seg = map; + } } /* Step Three: Loop over the sections again, this time assigning @@ -3832,97 +4023,99 @@ copy_private_bfd_data (ibfd, obfd) isec = 0; do { - m->count = 0; + map->count = 0; suggested_lma = 0; /* Fill the current segment with sections that fit. */ - for (j = 0; j < csecs; j++) + for (j = 0; j < section_count; j++) { - s = sections[j]; + section = sections[j]; - if (s == NULL) + if (section == NULL) continue; - os = s->output_section; + output_section = section->output_section; + + BFD_ASSERT (output_section != NULL); - if (IS_CONTAINED_BY (os->lma, os->_raw_size, m->p_paddr, p) - || IS_COREFILE_NOTE (p, s)) + if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr) + || IS_COREFILE_NOTE (segment, section)) { - if (m->count == 0) + if (map->count == 0) { /* If the first section in a segment does not start at - the beginning of the segment, then something is wrong. */ - if (os->lma != (m->p_paddr - + (m->includes_filehdr - ? iehdr->e_ehsize : 0) - + (m->includes_phdrs - ? iehdr->e_phnum * iehdr->e_phentsize - : 0))) + the beginning of the segment, then something is + wrong. */ + if (output_section->lma != + (map->p_paddr + + (map->includes_filehdr ? iehdr->e_ehsize : 0) + + (map->includes_phdrs + ? iehdr->e_phnum * iehdr->e_phentsize + : 0))) abort (); } else { asection * prev_sec; - bfd_vma maxpagesize; - prev_sec = m->sections[m->count - 1]; - maxpagesize = get_elf_backend_data (obfd)->maxpagesize; + prev_sec = map->sections[map->count - 1]; /* If the gap between the end of the previous section - and the start of this section is more than maxpagesize - then we need to start a new segment. */ - if (BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size, maxpagesize) - < BFD_ALIGN (os->lma, maxpagesize)) + and the start of this section is more than + maxpagesize then we need to start a new segment. */ + if ((BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size, maxpagesize) + < BFD_ALIGN (output_section->lma, maxpagesize)) + || ((prev_sec->lma + prev_sec->_raw_size) > output_section->lma)) { if (suggested_lma == 0) - suggested_lma = os->lma; + suggested_lma = output_section->lma; continue; } } - m->sections[m->count++] = os; + map->sections[map->count++] = output_section; ++isec; sections[j] = NULL; + section->segment_mark = true; } else if (suggested_lma == 0) - suggested_lma = os->lma; + suggested_lma = output_section->lma; } - BFD_ASSERT (m->count > 0); + BFD_ASSERT (map->count > 0); /* Add the current segment to the list of built segments. */ - *pm = m; - pm = &m->next; + *pointer_to_map = map; + pointer_to_map = &map->next; - if (isec < csecs) + if (isec < section_count) { /* We still have not allocated all of the sections to segments. Create a new segment here, initialise it and carry on looping. */ - - m = ((struct elf_segment_map *) - bfd_alloc (obfd, - (sizeof (struct elf_segment_map) - + ((size_t) csecs - 1) * sizeof (asection *)))); - if (m == NULL) + map = ((struct elf_segment_map *) + bfd_alloc (obfd, + (sizeof (struct elf_segment_map) + + ((size_t) section_count - 1) + * sizeof (asection *)))); + if (map == NULL) return false; /* Initialise the fields of the segment map. Set the physical physical address to the LMA of the first section that has not yet been assigned. */ - - m->next = NULL; - m->p_type = p->p_type; - m->p_flags = p->p_flags; - m->p_flags_valid = 1; - m->p_paddr = suggested_lma; - m->p_paddr_valid = 1; - m->includes_filehdr = 0; - m->includes_phdrs = 0; + map->next = NULL; + map->p_type = segment->p_type; + map->p_flags = segment->p_flags; + map->p_flags_valid = 1; + map->p_paddr = suggested_lma; + map->p_paddr_valid = 1; + map->includes_filehdr = 0; + map->includes_phdrs = 0; } } - while (isec < csecs); + while (isec < section_count); free (sections); } @@ -3931,44 +4124,65 @@ copy_private_bfd_data (ibfd, obfd) p_paddr fields are zero. When we try to objcopy or strip such a file, we get confused. Check for this case, and if we find it reset the p_paddr_valid fields. */ - for (m = mfirst; m != NULL; m = m->next) - if (m->p_paddr != 0) + for (map = map_first; map != NULL; map = map->next) + if (map->p_paddr != 0) break; - if (m == NULL) + if (map == NULL) { - for (m = mfirst; m != NULL; m = m->next) - m->p_paddr_valid = 0; + for (map = map_first; map != NULL; map = map->next) + map->p_paddr_valid = 0; } - elf_tdata (obfd)->segment_map = mfirst; + elf_tdata (obfd)->segment_map = map_first; + + /* If we had to estimate the number of program headers that were + going to be needed, then check our estimate know and adjust + the offset if necessary. */ + if (phdr_adjust_seg != NULL) + { + unsigned int count; + + for (count = 0, map = map_first; map != NULL; map = map->next) + count++; + + if (count > phdr_adjust_num) + phdr_adjust_seg->p_paddr + -= (count - phdr_adjust_num) * iehdr->e_phentsize; + } #if 0 - /* Final Step: Sort the segments into ascending order of physical address. */ - if (mfirst != NULL) + /* Final Step: Sort the segments into ascending order of physical + address. */ + if (map_first != NULL) { - struct elf_segment_map* prev; + struct elf_segment_map *prev; - prev = mfirst; - for (m = mfirst->next; m != NULL; prev = m, m = m->next) + prev = map_first; + for (map = map_first->next; map != NULL; prev = map, map = map->next) { - /* Yes I know - its a bubble sort....*/ - if (m->next != NULL && (m->next->p_paddr < m->p_paddr)) + /* Yes I know - its a bubble sort.... */ + if (map->next != NULL && (map->next->p_paddr < map->p_paddr)) { - /* swap m and m->next */ - prev->next = m->next; - m->next = m->next->next; - prev->next->next = m; + /* Swap map and map->next. */ + prev->next = map->next; + map->next = map->next->next; + prev->next->next = map; - /* restart loop. */ - m = mfirst; + /* Restart loop. */ + map = map_first; } } } #endif -#undef IS_CONTAINED_BY -#undef IS_SOLARIS_PT_INTERP +#undef SEGMENT_END +#undef IS_CONTAINED_BY_VMA +#undef IS_CONTAINED_BY_LMA #undef IS_COREFILE_NOTE +#undef IS_SOLARIS_PT_INTERP +#undef INCLUDE_SECTION_IN_SEGMENT +#undef SEGMENT_AFTER_SEGMENT +#undef SEGMENT_OVERLAPS return true; } @@ -4090,7 +4304,7 @@ swap_out_syms (abfd, sttp, relocatable_p) if (!elf_map_symbols (abfd)) return false; - /* Dump out the symtabs. */ + /* Dump out the symtabs. */ { int symcount = bfd_get_symcount (abfd); asymbol **syms = bfd_get_outsymbols (abfd); @@ -4141,9 +4355,11 @@ swap_out_syms (abfd, sttp, relocatable_p) flagword flags = syms[idx]->flags; int type; - if (flags & BSF_SECTION_SYM) - /* Section symbols have no names. */ - sym.st_name = 0; + if ((flags & BSF_SECTION_SYM) != 0) + { + /* Section symbols have no name. */ + sym.st_name = 0; + } else { sym.st_name = (unsigned long) _bfd_stringtab_add (stt, @@ -4781,13 +4997,14 @@ _bfd_elf_find_nearest_line (abfd, asymbol **p; if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, + 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)) + line_ptr, 0, + &elf_tdata (abfd)->dwarf2_find_line_info)) return true; if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, @@ -4908,7 +5125,7 @@ _bfd_elf_validate_reloc (abfd, areloc) bfd *abfd; arelent *areloc; { - /* Check whether we really have an ELF howto. */ + /* Check whether we really have an ELF howto. */ if ((*areloc->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec) { @@ -4916,7 +5133,7 @@ _bfd_elf_validate_reloc (abfd, areloc) reloc_howto_type *howto; /* Alien reloc: Try to determine its type to replace it with an - equivalent ELF reloc. */ + equivalent ELF reloc. */ if (areloc->howto->pc_relative) { @@ -5029,48 +5246,44 @@ _bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg) { return bfd_reloc_ok; } - /* Elf core file support. Much of this only works on native toolchains, since we rely on knowing the machine-dependent procfs structure in order to pick - out details about the corefile. */ + out details about the corefile. */ #ifdef HAVE_SYS_PROCFS_H # include <sys/procfs.h> #endif - -/* Define offsetof for those systems which lack it. */ +/* Define offsetof for those systems which lack it. */ #ifndef offsetof # define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif - -/* FIXME: this is kinda wrong, but it's what gdb wants. */ +/* FIXME: this is kinda wrong, but it's what gdb wants. */ static int elfcore_make_pid (abfd) - bfd* abfd; + bfd *abfd; { return ((elf_tdata (abfd)->core_lwpid << 16) + (elf_tdata (abfd)->core_pid)); } - /* If there isn't a section called NAME, make one, using data from SECT. Note, this function will generate a reference to NAME, so you shouldn't deallocate or - overwrite it. */ + overwrite it. */ static boolean elfcore_maybe_make_sect (abfd, name, sect) - bfd* abfd; - char* name; - asection* sect; + bfd *abfd; + char *name; + asection *sect; { - asection* sect2; + asection *sect2; if (bfd_get_section_by_name (abfd, name) != NULL) return true; @@ -5086,9 +5299,8 @@ elfcore_maybe_make_sect (abfd, name, sect) return true; } - /* prstatus_t exists on: - solaris 2.[567] + solaris 2.5+ linux 2.[01] + glibc unixware 4.2 */ @@ -5096,33 +5308,68 @@ elfcore_maybe_make_sect (abfd, name, sect) #if defined (HAVE_PRSTATUS_T) static boolean elfcore_grok_prstatus (abfd, note) - bfd* abfd; - Elf_Internal_Note* note; + bfd *abfd; + Elf_Internal_Note *note; { - prstatus_t prstat; char buf[100]; - char* name; - asection* sect; + char *name; + asection *sect; + int raw_size; + int offset; - if (note->descsz != sizeof (prstat)) - return true; + if (note->descsz == sizeof (prstatus_t)) + { + prstatus_t prstat; - memcpy (&prstat, note->descdata, sizeof (prstat)); + raw_size = sizeof (prstat.pr_reg); + offset = offsetof (prstatus_t, pr_reg); + memcpy (&prstat, note->descdata, sizeof (prstat)); - elf_tdata (abfd)->core_signal = prstat.pr_cursig; - elf_tdata (abfd)->core_pid = prstat.pr_pid; + elf_tdata (abfd)->core_signal = prstat.pr_cursig; + elf_tdata (abfd)->core_pid = prstat.pr_pid; - /* pr_who exists on: - solaris 2.[567] - unixware 4.2 - pr_who doesn't exist on: - linux 2.[01] - */ + /* pr_who exists on: + solaris 2.5+ + unixware 4.2 + pr_who doesn't exist on: + linux 2.[01] + */ #if defined (HAVE_PRSTATUS_T_PR_WHO) - elf_tdata (abfd)->core_lwpid = prstat.pr_who; + elf_tdata (abfd)->core_lwpid = prstat.pr_who; #endif + } +#if defined (HAVE_PRSTATUS32_T) + else if (note->descsz == sizeof (prstatus32_t)) + { + /* 64-bit host, 32-bit corefile */ + prstatus32_t prstat; + + raw_size = sizeof (prstat.pr_reg); + offset = offsetof (prstatus32_t, pr_reg); + memcpy (&prstat, note->descdata, sizeof (prstat)); + + elf_tdata (abfd)->core_signal = prstat.pr_cursig; + elf_tdata (abfd)->core_pid = prstat.pr_pid; + + /* pr_who exists on: + solaris 2.5+ + unixware 4.2 + pr_who doesn't exist on: + linux 2.[01] + */ +#if defined (HAVE_PRSTATUS32_T_PR_WHO) + elf_tdata (abfd)->core_lwpid = prstat.pr_who; +#endif + } +#endif /* HAVE_PRSTATUS32_T */ + else + { + /* Fail - we don't know how to handle any other + note size (ie. data object type). */ + return true; + } - /* Make a ".reg/999" section. */ + /* Make a ".reg/999" section. */ sprintf (buf, ".reg/%d", elfcore_make_pid (abfd)); name = bfd_alloc (abfd, strlen (buf) + 1); @@ -5133,8 +5380,10 @@ elfcore_grok_prstatus (abfd, note) sect = bfd_make_section (abfd, name); if (sect == NULL) return false; - sect->_raw_size = sizeof (prstat.pr_reg); - sect->filepos = note->descpos + offsetof (prstatus_t, pr_reg); + + sect->_raw_size = raw_size; + sect->filepos = note->descpos + offset; + sect->flags = SEC_HAS_CONTENTS; sect->alignment_power = 2; @@ -5145,7 +5394,6 @@ elfcore_grok_prstatus (abfd, note) } #endif /* defined (HAVE_PRSTATUS_T) */ - /* Create a pseudosection containing the exact contents of NOTE. This actually creates up to two pseudosections: - For the single-threaded case, a section named NAME, unless @@ -5156,13 +5404,13 @@ elfcore_grok_prstatus (abfd, note) static boolean elfcore_make_note_pseudosection (abfd, name, note) - bfd* abfd; + bfd *abfd; char *name; - Elf_Internal_Note* note; + Elf_Internal_Note *note; { char buf[100]; char *threaded_name; - asection* sect; + asection *sect; /* Build the section name. */ @@ -5186,54 +5434,58 @@ elfcore_make_note_pseudosection (abfd, name, note) return true; } - /* There isn't a consistent prfpregset_t across platforms, but it doesn't matter, because we don't have to pick this - data structure apart. */ + data structure apart. */ + static boolean elfcore_grok_prfpreg (abfd, note) - bfd* abfd; - Elf_Internal_Note* note; + bfd *abfd; + Elf_Internal_Note *note; { return elfcore_make_note_pseudosection (abfd, ".reg2", note); } - /* Linux dumps the Intel SSE regs in a note named "LINUX" with a note type of 5 (NT_PRXFPREG). Just include the whole note's contents literally. */ + static boolean elfcore_grok_prxfpreg (abfd, note) - bfd* abfd; - Elf_Internal_Note* note; + bfd *abfd; + Elf_Internal_Note *note; { return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note); } - #if defined (HAVE_PRPSINFO_T) -# define elfcore_psinfo_t prpsinfo_t +typedef prpsinfo_t elfcore_psinfo_t; +#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */ +typedef prpsinfo32_t elfcore_psinfo32_t; +#endif #endif #if defined (HAVE_PSINFO_T) -# define elfcore_psinfo_t psinfo_t +typedef psinfo_t elfcore_psinfo_t; +#if defined (HAVE_PSINFO32_T) /* Sparc64 cross Sparc32 */ +typedef psinfo32_t elfcore_psinfo32_t; +#endif #endif - #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) /* return a malloc'ed copy of a string at START which is at most MAX bytes long, possibly without a terminating '\0'. - the copy will always have a terminating '\0'. */ + the copy will always have a terminating '\0'. */ static char* elfcore_strndup (abfd, start, max) - bfd* abfd; - char* start; + bfd *abfd; + char *start; int max; { - char* dup; - char* end = memchr (start, '\0', max); + char *dup; + char *end = memchr (start, '\0', max); int len; if (end == NULL) @@ -5253,28 +5505,50 @@ elfcore_strndup (abfd, start, max) static boolean elfcore_grok_psinfo (abfd, note) - bfd* abfd; - Elf_Internal_Note* note; + bfd *abfd; + Elf_Internal_Note *note; { - elfcore_psinfo_t psinfo; + if (note->descsz == sizeof (elfcore_psinfo_t)) + { + elfcore_psinfo_t psinfo; - if (note->descsz != sizeof (elfcore_psinfo_t)) - return true; + memcpy (&psinfo, note->descdata, sizeof (psinfo)); + + elf_tdata (abfd)->core_program + = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); - memcpy (&psinfo, note->descdata, note->descsz); + elf_tdata (abfd)->core_command + = elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs)); + } +#if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T) + else if (note->descsz == sizeof (elfcore_psinfo32_t)) + { + /* 64-bit host, 32-bit corefile */ + elfcore_psinfo32_t psinfo; - elf_tdata (abfd)->core_program - = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); + memcpy (&psinfo, note->descdata, sizeof (psinfo)); - elf_tdata (abfd)->core_command - = elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs)); + elf_tdata (abfd)->core_program + = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname)); + + elf_tdata (abfd)->core_command + = elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs)); + } +#endif + + else + { + /* Fail - we don't know how to handle any other + note size (ie. data object type). */ + return true; + } /* Note that for some reason, a spurious space is tacked onto the end of the args in some (at least one anyway) - implementations, so strip it off if it exists. */ + implementations, so strip it off if it exists. */ { - char* command = elf_tdata (abfd)->core_command; + char *command = elf_tdata (abfd)->core_command; int n = strlen (command); if (0 < n && command[n - 1] == ' ') @@ -5285,43 +5559,59 @@ elfcore_grok_psinfo (abfd, note) } #endif /* defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) */ - #if defined (HAVE_PSTATUS_T) static boolean elfcore_grok_pstatus (abfd, note) - bfd* abfd; - Elf_Internal_Note* note; + bfd *abfd; + Elf_Internal_Note *note; { - pstatus_t pstat; + if (note->descsz == sizeof (pstatus_t) +#if defined (HAVE_PXSTATUS_T) + || note->descsz == sizeof (pxstatus_t) +#endif + ) + { + pstatus_t pstat; - if (note->descsz != sizeof (pstat)) - return true; + memcpy (&pstat, note->descdata, sizeof (pstat)); - memcpy (&pstat, note->descdata, sizeof (pstat)); + elf_tdata (abfd)->core_pid = pstat.pr_pid; + } +#if defined (HAVE_PSTATUS32_T) + else if (note->descsz == sizeof (pstatus32_t)) + { + /* 64-bit host, 32-bit corefile */ + pstatus32_t pstat; - elf_tdata (abfd)->core_pid = pstat.pr_pid; + memcpy (&pstat, note->descdata, sizeof (pstat)); + elf_tdata (abfd)->core_pid = pstat.pr_pid; + } +#endif /* Could grab some more details from the "representative" lwpstatus_t in pstat.pr_lwp, but we'll catch it all in an - NT_LWPSTATUS note, presumably. */ + NT_LWPSTATUS note, presumably. */ return true; } #endif /* defined (HAVE_PSTATUS_T) */ - #if defined (HAVE_LWPSTATUS_T) static boolean elfcore_grok_lwpstatus (abfd, note) - bfd* abfd; - Elf_Internal_Note* note; + bfd *abfd; + Elf_Internal_Note *note; { lwpstatus_t lwpstat; char buf[100]; - char* name; - asection* sect; + char *name; + asection *sect; - if (note->descsz != sizeof (lwpstat)) + if (note->descsz != sizeof (lwpstat) +#if defined (HAVE_LWPXSTATUS_T) + && note->descsz != sizeof (lwpxstatus_t) +#endif + ) return true; memcpy (&lwpstat, note->descdata, sizeof (lwpstat)); @@ -5329,7 +5619,7 @@ elfcore_grok_lwpstatus (abfd, note) elf_tdata (abfd)->core_lwpid = lwpstat.pr_lwpid; elf_tdata (abfd)->core_signal = lwpstat.pr_cursig; - /* Make a ".reg/999" section. */ + /* Make a ".reg/999" section. */ sprintf (buf, ".reg/%d", elfcore_make_pid (abfd)); name = bfd_alloc (abfd, strlen (buf) + 1); @@ -5394,41 +5684,41 @@ elfcore_grok_lwpstatus (abfd, note) #if defined (HAVE_WIN32_PSTATUS_T) static boolean elfcore_grok_win32pstatus (abfd, note) - bfd * abfd; - Elf_Internal_Note * note; + bfd *abfd; + Elf_Internal_Note *note; { char buf[30]; - char * name; - asection * sect; + char *name; + asection *sect; win32_pstatus_t pstatus; if (note->descsz < sizeof (pstatus)) return true; - memcpy (& pstatus, note->descdata, note->descsz); - - switch (pstatus.data_type) + memcpy (&pstatus, note->descdata, note->descsz); + + switch (pstatus.data_type) { case NOTE_INFO_PROCESS: /* FIXME: need to add ->core_command. */ elf_tdata (abfd)->core_signal = pstatus.data.process_info.signal; elf_tdata (abfd)->core_pid = pstatus.data.process_info.pid; - break ; + break; case NOTE_INFO_THREAD: /* Make a ".reg/999" section. */ sprintf (buf, ".reg/%d", pstatus.data.thread_info.tid); - + name = bfd_alloc (abfd, strlen (buf) + 1); if (name == NULL) - return false; - + return false; + strcpy (name, buf); sect = bfd_make_section (abfd, name); if (sect == NULL) - return false; - + return false; + sect->_raw_size = sizeof (pstatus.data.thread_info.thread_context); sect->filepos = note->descpos + offsetof (struct win32_pstatus, data.thread_info.thread_context); @@ -5442,19 +5732,19 @@ elfcore_grok_win32pstatus (abfd, note) case NOTE_INFO_MODULE: /* Make a ".module/xxxxxxxx" section. */ - sprintf (buf, ".module/%08x" , pstatus.data.module_info.base_address); - + sprintf (buf, ".module/%08x", pstatus.data.module_info.base_address); + name = bfd_alloc (abfd, strlen (buf) + 1); if (name == NULL) return false; - + strcpy (name, buf); sect = bfd_make_section (abfd, name); - + if (sect == NULL) return false; - + sect->_raw_size = note->descsz; sect->filepos = note->descpos; sect->flags = SEC_HAS_CONTENTS; @@ -5471,8 +5761,8 @@ elfcore_grok_win32pstatus (abfd, note) static boolean elfcore_grok_note (abfd, note) - bfd* abfd; - Elf_Internal_Note* note; + bfd *abfd; + Elf_Internal_Note *note; { switch (note->type) { @@ -5498,11 +5788,11 @@ elfcore_grok_note (abfd, note) return elfcore_grok_prfpreg (abfd, note); #if defined (HAVE_WIN32_PSTATUS_T) - case NT_WIN32PSTATUS: + case NT_WIN32PSTATUS: return elfcore_grok_win32pstatus (abfd, note); #endif - case NT_PRXFPREG: /* Linux SSE extension */ + case NT_PRXFPREG: /* Linux SSE extension */ if (note->namesz == 5 && ! strcmp (note->namedata, "LINUX")) return elfcore_grok_prxfpreg (abfd, note); @@ -5517,15 +5807,14 @@ elfcore_grok_note (abfd, note) } } - static boolean elfcore_read_notes (abfd, offset, size) - bfd* abfd; + bfd *abfd; bfd_vma offset; bfd_vma size; { - char* buf; - char* p; + char *buf; + char *p; if (size <= 0) return true; @@ -5547,8 +5836,8 @@ elfcore_read_notes (abfd, offset, size) p = buf; while (p < buf + size) { - /* FIXME: bad alignment assumption. */ - Elf_External_Note* xnp = (Elf_External_Note*) p; + /* FIXME: bad alignment assumption. */ + Elf_External_Note *xnp = (Elf_External_Note *) p; Elf_Internal_Note in; in.type = bfd_h_get_32 (abfd, (bfd_byte *) xnp->type); @@ -5570,13 +5859,12 @@ elfcore_read_notes (abfd, offset, size) return true; } - /* FIXME: This function is now unnecessary. Callers can just call bfd_section_from_phdr directly. */ boolean _bfd_elfcore_section_from_phdr (abfd, phdr, sec_num) - bfd* abfd; + bfd *abfd; Elf_Internal_Phdr* phdr; int sec_num; { @@ -5585,14 +5873,13 @@ _bfd_elfcore_section_from_phdr (abfd, phdr, sec_num) return true; } - - /* Providing external access to the ELF program header table. */ /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error occurs; bfd_get_error will return an appropriate code. */ + long bfd_get_elf_phdr_upper_bound (abfd) bfd *abfd; @@ -5607,7 +5894,6 @@ bfd_get_elf_phdr_upper_bound (abfd) * sizeof (Elf_Internal_Phdr)); } - /* Copy ABFD's program header table entries to *PHDRS. The entries will be stored as an array of Elf_Internal_Phdr structures, as defined in include/elf/internal.h. To find out how large the @@ -5615,6 +5901,7 @@ bfd_get_elf_phdr_upper_bound (abfd) Return the number of program header table entries read, or -1 if an error occurs; bfd_get_error will return an appropriate code. */ + int bfd_get_elf_phdrs (abfd, phdrs) bfd *abfd; @@ -5629,7 +5916,7 @@ bfd_get_elf_phdrs (abfd, phdrs) } num_phdrs = elf_elfheader (abfd)->e_phnum; - memcpy (phdrs, elf_tdata (abfd)->phdr, + memcpy (phdrs, elf_tdata (abfd)->phdr, num_phdrs * sizeof (Elf_Internal_Phdr)); return num_phdrs; diff --git a/contrib/binutils/bfd/elf32-arm.h b/contrib/binutils/bfd/elf32-arm.h index 2e8a657..0f2ac8a 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 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - typedef unsigned long int insn32; typedef unsigned short int insn16; @@ -37,7 +36,6 @@ static bfd_reloc_status_type elf32_arm_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *, const char *, unsigned char, struct elf_link_hash_entry *)); - static insn32 insert_thumb_branch PARAMS ((insn32, int)); static struct elf_link_hash_entry *find_thumb_glue @@ -57,14 +55,12 @@ static int elf32_thumb_to_arm_stub PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *, bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma)); +#define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_INTERWORK) + /* The linker script knows the section names for placement. The entry_names are used to do simple name mangling on the stubs. Given a function name, and its type, the stub can be found. The - name can be changed. The only requirement is the %s be present. - */ - -#define INTERWORK_FLAG( abfd ) (elf_elfheader (abfd)->e_flags & EF_INTERWORK) - + name can be changed. The only requirement is the %s be present. */ #define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t" #define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb" @@ -76,14 +72,12 @@ static int elf32_thumb_to_arm_stub #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" /* The size in bytes of an entry in the procedure linkage table. */ - #define PLT_ENTRY_SIZE 16 /* The first entry in a procedure linkage table looks like 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 */ - + linker first. */ static const bfd_byte elf32_arm_plt0_entry [PLT_ENTRY_SIZE] = { 0x04, 0xe0, 0x2d, 0xe5, /* str lr, [sp, #-4]! */ @@ -94,7 +88,6 @@ static const bfd_byte elf32_arm_plt0_entry [PLT_ENTRY_SIZE] = /* Subsequent entries in a procedure linkage table look like this. */ - static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] = { 0x04, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc, #4] */ @@ -103,7 +96,6 @@ static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] = 0x00, 0x00, 0x00, 0x00 /* offset to symbol in got */ }; - /* The ARM linker needs to keep track of the number of relocs that it decides to copy in check_relocs for each symbol. This is so that it can discard PC relative relocs if it doesn't need them when @@ -112,7 +104,6 @@ static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] = /* This structure keeps track of the number of PC relative relocs we have copied for a given symbol. */ - struct elf32_arm_pcrel_relocs_copied { /* Next section. */ @@ -124,7 +115,6 @@ struct elf32_arm_pcrel_relocs_copied }; /* Arm ELF linker hash entry. */ - struct elf32_arm_link_hash_entry { struct elf_link_hash_entry root; @@ -134,12 +124,10 @@ struct elf32_arm_link_hash_entry }; /* Declare this now that the above structures are defined. */ - static boolean elf32_arm_discard_copies PARAMS ((struct elf32_arm_link_hash_entry *, PTR)); /* Traverse an arm ELF linker hash table. */ - #define elf32_arm_link_hash_traverse(table, func, info) \ (elf_link_hash_traverse \ (&(table)->root, \ @@ -150,26 +138,25 @@ static boolean elf32_arm_discard_copies #define elf32_arm_hash_table(info) \ ((struct elf32_arm_link_hash_table *) ((info)->hash)) -/* ARM ELF linker hash table */ +/* ARM ELF linker hash table. */ struct elf32_arm_link_hash_table - { - /* The main hash table. */ - struct elf_link_hash_table root; - - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ - long int thumb_glue_size; +{ + /* The main hash table. */ + struct elf_link_hash_table root; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ - long int arm_glue_size; + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + long int thumb_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ - bfd * bfd_of_glue_owner; + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + long int arm_glue_size; - /* A boolean indicating whether knowledge of the ARM's pipeline - length should be applied by the linker. */ - int no_pipeline_knowledge; - }; + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; + /* A boolean indicating whether knowledge of the ARM's pipeline + length should be applied by the linker. */ + int no_pipeline_knowledge; +}; /* Create an entry in an ARM ELF linker hash table. */ @@ -201,7 +188,7 @@ elf32_arm_link_hash_newfunc (entry, table, string) return (struct bfd_hash_entry *) ret; } -/* Create an ARM elf linker hash table */ +/* Create an ARM elf linker hash table. */ static struct bfd_link_hash_table * elf32_arm_link_hash_table_create (abfd) @@ -229,6 +216,8 @@ elf32_arm_link_hash_table_create (abfd) return &ret->root.root; } +/* Locate the Thumb encoded calling stub for NAME. */ + static struct elf_link_hash_entry * find_thumb_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; @@ -242,7 +231,6 @@ find_thumb_glue (link_info, name, input_bfd) /* We need a pointer to the armelf specific hash table. */ hash_table = elf32_arm_hash_table (link_info); - tmp_name = ((char *) bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1)); @@ -255,7 +243,7 @@ find_thumb_glue (link_info, name, input_bfd) if (hash == NULL) /* xgettext:c-format */ - _bfd_error_handler (_ ("%s: unable to find THUMB glue '%s' for `%s'"), + _bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"), bfd_get_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -263,6 +251,8 @@ find_thumb_glue (link_info, name, input_bfd) return hash; } +/* Locate the ARM encoded calling stub for NAME. */ + static struct elf_link_hash_entry * find_arm_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; @@ -288,7 +278,7 @@ find_arm_glue (link_info, name, input_bfd) if (myh == NULL) /* xgettext:c-format */ - _bfd_error_handler (_ ("%s: unable to find ARM glue '%s' for `%s'"), + _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"), bfd_get_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -296,24 +286,21 @@ find_arm_glue (link_info, name, input_bfd) return myh; } -/* - ARM->Thumb glue: +/* ARM->Thumb glue: .arm __func_from_arm: ldr r12, __func_addr bx r12 __func_addr: - .word func @ behave as if you saw a ARM_32 reloc - */ + .word func @ behave as if you saw a ARM_32 reloc. */ #define ARM2THUMB_GLUE_SIZE 12 static const insn32 a2t1_ldr_insn = 0xe59fc000; static const insn32 a2t2_bx_r12_insn = 0xe12fff1c; static const insn32 a2t3_func_addr_insn = 0x00000001; -/* - Thumb->ARM: Thumb->(non-interworking aware) ARM +/* Thumb->ARM: Thumb->(non-interworking aware) ARM .thumb .thumb .align 2 .align 2 @@ -327,8 +314,7 @@ static const insn32 a2t3_func_addr_insn = 0x00000001; ldmia r13! {r6, lr} bx lr __func_addr: - .word func - */ + .word func */ #define THUMB2ARM_GLUE_SIZE 8 static const insn16 t2a1_bx_pc_insn = 0x4778; @@ -408,7 +394,6 @@ record_arm_to_thumb_glue (link_info, h) s = bfd_get_section_by_name (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME); - BFD_ASSERT (s != NULL); tmp_name = ((char *) @@ -423,14 +408,14 @@ record_arm_to_thumb_glue (link_info, h) if (myh != NULL) { + /* We've already seen this guy. */ free (tmp_name); - return; /* we've already seen this guy */ + return; } /* The only trick here is using hash_table->arm_glue_size as the value. Even though the section isn't allocated yet, this is where we will be putting it. */ - _bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner, tmp_name, BSF_GLOBAL, s, globals->arm_glue_size + 1, @@ -477,8 +462,9 @@ record_thumb_to_arm_glue (link_info, h) if (myh != NULL) { + /* We've already seen this guy. */ free (tmp_name); - return; /* we've already seen this guy */ + return; } _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name, @@ -486,17 +472,16 @@ record_thumb_to_arm_glue (link_info, h) NULL, true, false, (struct bfd_link_hash_entry **) &myh); - /* If we mark it 'thumb', the disassembler will do a better job. */ + /* If we mark it 'Thumb', the disassembler will do a better job. */ bind = ELF_ST_BIND (myh->type); myh->type = ELF_ST_INFO (bind, STT_ARM_TFUNC); free (tmp_name); - /* Allocate another symbol to mark where we switch to arm mode. */ - #define CHANGE_TO_ARM "__%s_change_to_arm" #define BACK_FROM_ARM "__%s_back_from_arm" + /* Allocate another symbol to mark where we switch to Arm mode. */ tmp_name = (char *) bfd_malloc (strlen (name) + strlen (CHANGE_TO_ARM) + 1); BFD_ASSERT (tmp_name); @@ -520,6 +505,7 @@ record_thumb_to_arm_glue (link_info, h) /* Select a BFD to be used to hold the sections used by the glue code. This function is called from the linker scripts in ld/emultempl/ {armelf/pe}.em */ + boolean bfd_elf32_arm_get_bfd_for_interworking (abfd, info) bfd *abfd; @@ -556,7 +542,7 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info) || !bfd_set_section_flags (abfd, sec, flags) || !bfd_set_section_alignment (abfd, sec, 2)) return false; - + /* Set the gc mark to prevent the section from being removed by garbage collection, despite the fact that no relocs refer to this section. */ sec->gc_mark = 1; @@ -574,7 +560,7 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info) || !bfd_set_section_flags (abfd, sec, flags) || !bfd_set_section_alignment (abfd, sec, 2)) return false; - + sec->gc_mark = 1; } @@ -608,7 +594,6 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* Here we have a bfd that is to be included on the link. We have a hook to do reloc rummaging, before section sizes are nailed down. */ - globals = elf32_arm_hash_table (link_info); BFD_ASSERT (globals != NULL); @@ -628,8 +613,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) continue; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - /* Load the relocs. */ + /* Load the relocs. */ irel = (_bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, false)); @@ -646,7 +631,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) r_type = ELF32_R_TYPE (irel->r_info); r_index = ELF32_R_SYM (irel->r_info); - /* These are the only relocation types we care about */ + /* These are the only relocation types we care about. */ if ( r_type != R_ARM_PC24 && r_type != R_ARM_THM_PC22) continue; @@ -663,6 +648,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; + free_contents = contents; if (!bfd_get_section_contents (abfd, sec, contents, @@ -684,7 +670,9 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) bfd_malloc (symtab_hdr->sh_size)); if (extsyms == NULL) goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) != symtab_hdr->sh_size)) @@ -692,15 +680,14 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) } } - /* If the relocation is not against a symbol it cannot concern us. */ - + /* If the relocation is not against a symbol it cannot concern us. */ h = NULL; - /* We don't care about local symbols */ + /* We don't care about local symbols. */ if (r_index < symtab_hdr->sh_info) continue; - /* This is an external symbol */ + /* This is an external symbol. */ r_index -= symtab_hdr->sh_info; h = (struct elf_link_hash_entry *) elf_sym_hashes (abfd)[r_index]; @@ -716,7 +703,6 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* This one is a call from arm code. We need to look up the target of the call. If it is a thumb target, we insert glue. */ - if (ELF_ST_TYPE(h->type) == STT_ARM_TFUNC) record_arm_to_thumb_glue (link_info, h); break; @@ -725,7 +711,6 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* This one is a call from thumb code. We look up the target of the call. If it is not a thumb target, we insert glue. */ - if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC) record_thumb_to_arm_glue (link_info, h); break; @@ -737,7 +722,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) } return true; - + error_return: if (free_relocs != NULL) free (free_relocs); @@ -745,7 +730,7 @@ error_return: free (free_contents); if (free_extsyms != NULL) free (free_extsyms); - + return false; } @@ -775,10 +760,10 @@ error_return: moves the computed address into the PC, so it must be the second one in the sequence. The problem, however is that whilst little endian code stores the instructions in HI then LOW order, big endian code does the - reverse. nickc@cygnus.com */ + reverse. nickc@cygnus.com. */ -#define LOW_HI_ORDER 0xF800F000 -#define HI_LOW_ORDER 0xF000F800 +#define LOW_HI_ORDER 0xF800F000 +#define HI_LOW_ORDER 0xF000F800 static insn32 insert_thumb_branch (br_insn, rel_off) @@ -788,26 +773,25 @@ insert_thumb_branch (br_insn, rel_off) unsigned int low_bits; unsigned int high_bits; - BFD_ASSERT ((rel_off & 1) != 1); - rel_off >>= 1; /* half word aligned address */ - low_bits = rel_off & 0x000007FF; /* the bottom 11 bits */ - high_bits = (rel_off >> 11) & 0x000007FF; /* the top 11 bits */ + rel_off >>= 1; /* Half word aligned address. */ + low_bits = rel_off & 0x000007FF; /* The bottom 11 bits. */ + high_bits = (rel_off >> 11) & 0x000007FF; /* The top 11 bits. */ if ((br_insn & LOW_HI_ORDER) == LOW_HI_ORDER) br_insn = LOW_HI_ORDER | (low_bits << 16) | high_bits; else if ((br_insn & HI_LOW_ORDER) == HI_LOW_ORDER) br_insn = HI_LOW_ORDER | (high_bits << 16) | low_bits; else - abort (); /* error - not a valid branch instruction form */ - - /* FIXME: abort is probably not the right call. krk@cygnus.com */ + /* FIXME: abort is probably not the right call. krk@cygnus.com */ + abort (); /* error - not a valid branch instruction form. */ return br_insn; } -/* Thumb code calling an ARM function */ +/* Thumb code calling an ARM function. */ + static int elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, hit_data, sym_sec, offset, addend, val) @@ -854,10 +838,10 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_ ("%s(%s): warning: interworking not enabled."), + (_("%s(%s): warning: interworking not enabled."), bfd_get_filename (sym_sec->owner), name); _bfd_error_handler - (_ (" first occurrence: %s: thumb call to arm"), + (_(" first occurrence: %s: thumb call to arm"), bfd_get_filename (input_bfd)); return false; @@ -873,13 +857,19 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, s->contents + my_offset + 2); ret_offset = - ((bfd_signed_vma) val) /* Address of destination of the stub */ + /* Address of destination of the stub. */ + ((bfd_signed_vma) val) - ((bfd_signed_vma) - (s->output_offset /* Offset from the start of the current section to the start of the stubs. */ - + my_offset /* Offset of the start of this stub from the start of the stubs. */ - + s->output_section->vma) /* Address of the start of the current section. */ - + 4 /* The branch instruction is 4 bytes into the stub. */ - + 8); /* ARM branches work from the pc of the instruction + 8. */ + /* Offset from the start of the current section to the start of the stubs. */ + (s->output_offset + /* Offset of the start of this stub from the start of the stubs. */ + + my_offset + /* Address of the start of the current section. */ + + s->output_section->vma) + /* The branch instruction is 4 bytes into the stub. */ + + 4 + /* ARM branches work from the pc of the instruction + 8. */ + + 8); bfd_put_32 (output_bfd, t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), @@ -907,7 +897,8 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, return true; } -/* Arm code calling a Thumb function */ +/* Arm code calling a Thumb function. */ + static int elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, hit_data, sym_sec, offset, addend, val) @@ -952,12 +943,13 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_ ("%s(%s): warning: interworking not enabled."), + (_("%s(%s): warning: interworking not enabled."), bfd_get_filename (sym_sec->owner), name); _bfd_error_handler - (_ (" first occurrence: %s: arm call to thumb"), + (_(" first occurrence: %s: arm call to thumb"), bfd_get_filename (input_bfd)); } + --my_offset; myh->root.u.def.value = my_offset; @@ -977,7 +969,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, tmp = bfd_get_32 (input_bfd, hit_data); tmp = tmp & 0xFF000000; - /* Somehow these are both 4 too far, so subtract 8. */ + /* Somehow these are both 4 too far, so subtract 8. */ ret_offset = s->output_offset + my_offset + s->output_section->vma @@ -985,7 +977,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, + input_section->output_section->vma + offset + addend) - 8; - + tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF); bfd_put_32 (output_bfd, tmp, hit_data @@ -995,6 +987,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, } /* Perform a relocation as part of a final link. */ + static bfd_reloc_status_type elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, rel, value, @@ -1062,9 +1055,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_PC24: case R_ARM_ABS32: case R_ARM_REL32: +#ifndef OLD_ARM_ABI + case R_ARM_XPC25: +#endif /* When generating a shared object, these relocations are copied - into the output file to be resolved at run time. */ - + into the output file to be resolved at run time. */ if (info->shared && (r_type != R_ARM_PC24 || (h != NULL @@ -1157,30 +1152,46 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, sreloc->contents) + sreloc->reloc_count)); ++sreloc->reloc_count; - + /* If this reloc is against an external symbol, we do not want to fiddle with the addend. Otherwise, we need to include the symbol - value so that it becomes an addend for the dynamic reloc. */ + value so that it becomes an addend for the dynamic reloc. */ if (! relocate) return bfd_reloc_ok; - return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, (bfd_vma) 0); } else switch (r_type) { - case R_ARM_PC24: - /* Arm B/BL instruction */ - - /* Check for arm calling thumb function. */ - if (sym_flags == STT_ARM_TFUNC) +#ifndef OLD_ARM_ABI + case R_ARM_XPC25: /* Arm BLX instruction. */ +#endif + case R_ARM_PC24: /* Arm B/BL instruction */ +#ifndef OLD_ARM_ABI + if (r_type == R_ARM_XPC25) + { + /* Check for Arm calling Arm function. */ + /* FIXME: Should we translate the instruction into a BL + instruction instead ? */ + if (sym_flags != STT_ARM_TFUNC) + _bfd_error_handler (_("\ +%s: Warning: Arm BLX instruction targets Arm function '%s'."), + bfd_get_filename (input_bfd), + h ? h->root.root.string : "(local)"); + } + else +#endif { - elf32_arm_to_thumb_stub (info, sym_name, input_bfd, output_bfd, - input_section, hit_data, sym_sec, rel->r_offset, - signed_addend, value); - return bfd_reloc_ok; + /* Check for Arm calling Thumb function. */ + if (sym_flags == STT_ARM_TFUNC) + { + elf32_arm_to_thumb_stub (info, sym_name, input_bfd, output_bfd, + input_section, hit_data, sym_sec, rel->r_offset, + signed_addend, value); + return bfd_reloc_ok; + } } if ( strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0 @@ -1188,7 +1199,6 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, { /* The old way of doing things. Trearing the addend as a byte sized field and adding in the pipeline offset. */ - value -= (input_section->output_section->vma + input_section->output_offset); value -= rel->r_offset; @@ -1217,7 +1227,6 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, Note: None of these operations have knowledge of the pipeline size of the processor, thus it is up to the assembler to encode this information into the addend. */ - value -= (input_section->output_section->vma + input_section->output_offset); value -= rel->r_offset; @@ -1239,22 +1248,31 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, } } + signed_addend = value; + signed_addend >>= howto->rightshift; + /* It is not an error for an undefined weak reference to be out of range. Any program that branches to such a symbol - is going to crash anyway, so there is no point worrying - about getting the destination exactly right. */ + is going to crash anyway, so there is no point worrying + about getting the destination exactly right. */ if (! h || h->root.type != bfd_link_hash_undefweak) { /* Perform a signed range check. */ - signed_addend = value; - signed_addend >>= howto->rightshift; - if (signed_addend > ((bfd_signed_vma)(howto->dst_mask >> 1)) + if ( signed_addend > ((bfd_signed_vma) (howto->dst_mask >> 1)) || signed_addend < - ((bfd_signed_vma) ((howto->dst_mask + 1) >> 1))) return bfd_reloc_overflow; } - - value = (signed_addend & howto->dst_mask) - | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); + +#ifndef OLD_ARM_ABI + /* If necessary set the H bit in the BLX instruction. */ + if (r_type == R_ARM_XPC25 && ((value & 2) == 2)) + value = (signed_addend & howto->dst_mask) + | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)) + | (1 << 24); + else +#endif + value = (signed_addend & howto->dst_mask) + | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); break; case R_ARM_ABS32: @@ -1303,7 +1321,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_ARM_THM_ABS5: - /* Support ldr and str instructions for the thumb. */ + /* Support ldr and str instructions for the thumb. */ #ifdef USE_REL /* Need to refetch addend. */ addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask; @@ -1321,8 +1339,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, bfd_put_16 (input_bfd, value, hit_data); return bfd_reloc_ok; +#ifndef OLD_ARM_ABI + case R_ARM_THM_XPC22: +#endif case R_ARM_THM_PC22: - /* Thumb BL (branch long instruction). */ + /* Thumb BL (branch long instruction). */ { bfd_vma relocation; boolean overflow = false; @@ -1339,23 +1360,38 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, { bfd_vma upper = upper_insn & 0x7ff; bfd_vma lower = lower_insn & 0x7ff; - upper = (upper ^ 0x400) - 0x400; /* sign extend */ + upper = (upper ^ 0x400) - 0x400; /* Sign extend. */ addend = (upper << 12) | (lower << 1); signed_addend = addend; } #endif - - /* If it is not a call to thumb, assume call to arm. - If it is a call relative to a section name, then it is not a - function call at all, but rather a long jump. */ - if (sym_flags != STT_ARM_TFUNC && sym_flags != STT_SECTION) +#ifndef OLD_ARM_ABI + if (r_type == R_ARM_THM_XPC22) { - if (elf32_thumb_to_arm_stub - (info, sym_name, input_bfd, output_bfd, input_section, - hit_data, sym_sec, rel->r_offset, signed_addend, value)) - return bfd_reloc_ok; - else - return bfd_reloc_dangerous; + /* Check for Thumb to Thumb call. */ + /* FIXME: Should we translate the instruction into a BL + instruction instead ? */ + if (sym_flags == STT_ARM_TFUNC) + _bfd_error_handler (_("\ +%s: Warning: Thumb BLX instruction targets thumb function '%s'."), + bfd_get_filename (input_bfd), + h ? h->root.root.string : "(local)"); + } + else +#endif + { + /* If it is not a call to Thumb, assume call to Arm. + If it is a call relative to a section name, then it is not a + function call at all, but rather a long jump. */ + if (sym_flags != STT_ARM_TFUNC && sym_flags != STT_SECTION) + { + if (elf32_thumb_to_arm_stub + (info, sym_name, input_bfd, output_bfd, input_section, + hit_data, sym_sec, rel->r_offset, signed_addend, value)) + return bfd_reloc_ok; + else + return bfd_reloc_dangerous; + } } relocation = value + signed_addend; @@ -1363,11 +1399,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, relocation -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); - + if (! globals->no_pipeline_knowledge) { - Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */ - + Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form. */ + i_ehdrp = elf_elfheader (input_bfd); /* Previous versions of this code also used to add in the pipline @@ -1429,21 +1465,19 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, BFD_ASSERT (sgot != NULL); if (sgot == NULL) return bfd_reloc_notsupported; - + /* Note that sgot->output_offset is not involved in this calculation. We always want the start of .got. If we define _GLOBAL_OFFSET_TABLE in a different way, as is permitted by the ABI, we might have to change this - calculation. */ - + calculation. */ value -= sgot->output_section->vma; return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, (bfd_vma) 0); case R_ARM_GOTPC: - /* Use global offset table as symbol value. */ - + /* Use global offset table as symbol value. */ BFD_ASSERT (sgot != NULL); if (sgot == NULL) @@ -1456,7 +1490,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_GOT32: /* Relocation is to the entry for this symbol in the - global offset table. */ + global offset table. */ if (sgot == NULL) return bfd_reloc_notsupported; @@ -1479,8 +1513,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, When doing a dynamic link, we create a .rel.got relocation entry to initialize the value. This is done in the - finish_dynamic_symbol routine. */ - + finish_dynamic_symbol routine. */ if ((off & 1) != 0) off &= ~1; else @@ -1503,7 +1536,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, /* The offset must always be a multiple of 4. We use the least significant bit to record whether we have already - generated the necessary reloc. */ + generated the necessary reloc. */ if ((off & 1) != 0) off &= ~1; else @@ -1534,7 +1567,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, value = sgot->output_offset + off; } - + return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, (bfd_vma) 0); @@ -1544,7 +1577,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, procedure linkage table. */ /* Resolve a PLT32 reloc against a local symbol directly, - without using the procedure linkage table. */ + without using the procedure linkage table. */ if (h == NULL) return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, @@ -1607,44 +1640,67 @@ arm_add_to_rel (abfd, address, howto, increment) reloc_howto_type * howto; bfd_signed_vma increment; { - bfd_vma contents; bfd_signed_vma addend; - contents = bfd_get_32 (abfd, address); - - /* Get the (signed) value from the instruction. */ - addend = contents & howto->src_mask; - if (addend & ((howto->src_mask + 1) >> 1)) + if (howto->type == R_ARM_THM_PC22) { - bfd_signed_vma mask; - - mask = -1; - mask &= ~ howto->src_mask; - addend |= mask; - } + int upper_insn, lower_insn; + int upper, lower; - /* Add in the increment, (which is a byte value). */ - switch (howto->type) - { - case R_ARM_THM_PC22: - default: + upper_insn = bfd_get_16 (abfd, address); + lower_insn = bfd_get_16 (abfd, address + 2); + upper = upper_insn & 0x7ff; + lower = lower_insn & 0x7ff; + + addend = (upper << 12) | (lower << 1); addend += increment; - break; - - case R_ARM_PC24: - addend <<= howto->size; - addend += increment; - - /* Should we check for overflow here ? */ + addend >>= 1; - /* Drop any undesired bits. */ - addend >>= howto->rightshift; - break; + upper_insn = (upper_insn & 0xf800) | ((addend >> 11) & 0x7ff); + lower_insn = (lower_insn & 0xf800) | (addend & 0x7ff); + + bfd_put_16 (abfd, upper_insn, address); + bfd_put_16 (abfd, lower_insn, address + 2); + } + else + { + bfd_vma contents; + + contents = bfd_get_32 (abfd, address); + + /* Get the (signed) value from the instruction. */ + addend = contents & howto->src_mask; + if (addend & ((howto->src_mask + 1) >> 1)) + { + bfd_signed_vma mask; + + mask = -1; + mask &= ~ howto->src_mask; + addend |= mask; + } + + /* Add in the increment, (which is a byte value). */ + switch (howto->type) + { + default: + addend += increment; + break; + + case R_ARM_PC24: + addend <<= howto->size; + addend += increment; + + /* Should we check for overflow here ? */ + + /* Drop any undesired bits. */ + addend >>= howto->rightshift; + break; + } + + contents = (contents & ~ howto->dst_mask) | (addend & howto->dst_mask); + + bfd_put_32 (abfd, contents, address); } - - contents = (contents & ~ howto->dst_mask) | (addend & howto->dst_mask); - - bfd_put_32 (abfd, contents, address); } #endif /* USE_REL */ @@ -1723,6 +1779,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sec = NULL; + if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -1734,10 +1791,12 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - while (h->root.type == bfd_link_hash_indirect + + while ( h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (h->root.type == bfd_link_hash_defined + + if ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { int relocation_needed = 1; @@ -1746,7 +1805,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, /* In these cases, we don't need the relocation value. We check specially because in some obscure cases - sec->output_section will be NULL. */ + sec->output_section will be NULL. */ switch (r_type) { case R_ARM_PC24: @@ -1865,19 +1924,19 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, break; case bfd_reloc_outofrange: - msg = _ ("internal error: out of range error"); + msg = _("internal error: out of range error"); goto common_error; case bfd_reloc_notsupported: - msg = _ ("internal error: unsupported relocation error"); + msg = _("internal error: unsupported relocation error"); goto common_error; case bfd_reloc_dangerous: - msg = _ ("internal error: dangerous error"); + msg = _("internal error: dangerous error"); goto common_error; default: - msg = _ ("internal error: unknown error"); + msg = _("internal error: unknown error"); /* fall through */ common_error: @@ -1893,7 +1952,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, return true; } -/* Function to keep ARM specific flags in the ELF header. */ +/* Function to keep ARM specific flags in the ELF header. */ static boolean elf32_arm_set_private_flags (abfd, flags) bfd *abfd; @@ -1902,14 +1961,17 @@ elf32_arm_set_private_flags (abfd, flags) if (elf_flags_init (abfd) && elf_elfheader (abfd)->e_flags != flags) { - if (flags & EF_INTERWORK) - _bfd_error_handler (_ ("\ + if (EF_ARM_EABI_VERSION (flags) == EF_ARM_EABI_UNKNOWN) + { + if (flags & EF_INTERWORK) + _bfd_error_handler (_("\ Warning: Not setting interwork flag of %s since it has already been specified as non-interworking"), - bfd_get_filename (abfd)); - else - _bfd_error_handler (_ ("\ + bfd_get_filename (abfd)); + else + _bfd_error_handler (_("\ Warning: Clearing the interwork flag of %s due to outside request"), - bfd_get_filename (abfd)); + bfd_get_filename (abfd)); + } } else { @@ -1920,7 +1982,8 @@ Warning: Clearing the interwork flag of %s due to outside request"), return true; } -/* Copy backend specific data from one object module to another */ +/* Copy backend specific data from one object module to another. */ + static boolean elf32_arm_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; @@ -1929,14 +1992,16 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) flagword in_flags; flagword out_flags; - if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return true; - in_flags = elf_elfheader (ibfd)->e_flags; + in_flags = elf_elfheader (ibfd)->e_flags; out_flags = elf_elfheader (obfd)->e_flags; - if (elf_flags_init (obfd) && in_flags != out_flags) + if (elf_flags_init (obfd) + && EF_ARM_EABI_VERSION (out_flags) == EF_ARM_EABI_UNKNOWN + && in_flags != out_flags) { /* Cannot mix APCS26 and APCS32 code. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) @@ -1951,7 +2016,7 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) { if (out_flags & EF_INTERWORK) - _bfd_error_handler (_ ("\ + _bfd_error_handler (_("\ Warning: Clearing the interwork flag in %s because non-interworking code in %s has been linked with it"), bfd_get_filename (obfd), bfd_get_filename (ibfd)); @@ -1971,10 +2036,11 @@ Warning: Clearing the interwork flag in %s because non-interworking code in %s h /* Merge backend specific data from an object file to the output object file when linking. */ + static boolean elf32_arm_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; + bfd * ibfd; + bfd * obfd; { flagword out_flags; flagword in_flags; @@ -1982,29 +2048,18 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) boolean null_input_bfd = true; asection *sec; + /* Check if we have the same endianess. */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return true; - /* Check if we have the same endianess */ - if ( ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN - && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - (*_bfd_error_handler) - (_("%s: compiled for a %s endian system and target is %s endian"), - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); - - bfd_set_error (bfd_error_wrong_format); - return false; - } - /* The input BFD must have had its flags initialised. */ /* The following seems bogus to me -- The flags are initialized in the assembler but I don't think an elf_flags_init field is - written into the object */ + written into the object. */ /* BFD_ASSERT (elf_flags_init (ibfd)); */ in_flags = elf_elfheader (ibfd)->e_flags; @@ -2052,96 +2107,152 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) if (null_input_bfd) return true; - /* If any of the input BFDs is non-PIC, the output is also position - dependent. */ - if (!(in_flags & EF_PIC)) - elf_elfheader (obfd)->e_flags &= ~EF_PIC; - /* Complain about various flag mismatches. */ - if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) + if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags)) { - _bfd_error_handler (_ ("\ + _bfd_error_handler (_("\ +Error: %s compiled for EABI version %d, whereas %s is compiled for version %d"), + bfd_get_filename (ibfd), + (in_flags & EF_ARM_EABIMASK) >> 24, + bfd_get_filename (obfd), + (out_flags & EF_ARM_EABIMASK) >> 24); + return false; + } + + /* Not sure what needs to be checked for EABI versions >= 1. */ + if (EF_ARM_EABI_VERSION (in_flags) == EF_ARM_EABI_UNKNOWN) + { + if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) + { + _bfd_error_handler (_("\ Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"), bfd_get_filename (ibfd), in_flags & EF_APCS_26 ? 26 : 32, bfd_get_filename (obfd), out_flags & EF_APCS_26 ? 26 : 32); - flags_compatible = false; - } + flags_compatible = false; + } - if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) - { - _bfd_error_handler (_ ("\ + if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) + { + _bfd_error_handler (_("\ Error: %s passes floats in %s registers, whereas %s passes them in %s registers"), bfd_get_filename (ibfd), - in_flags & EF_APCS_FLOAT ? _ ("float") : _ ("integer"), + in_flags & EF_APCS_FLOAT ? _("float") : _("integer"), bfd_get_filename (obfd), - out_flags & EF_APCS_26 ? _ ("float") : _ ("integer")); - flags_compatible = false; - } + out_flags & EF_APCS_26 ? _("float") : _("integer")); + flags_compatible = false; + } #ifdef EF_SOFT_FLOAT - if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) - { - _bfd_error_handler (_ ("\ + if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) + { + _bfd_error_handler (_ ("\ Error: %s uses %s floating point, whereas %s uses %s floating point"), - bfd_get_filename (ibfd), - in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), - bfd_get_filename (obfd), - out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); - flags_compatible = false; - } + bfd_get_filename (ibfd), + in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), + bfd_get_filename (obfd), + out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); + flags_compatible = false; + } #endif - /* Interworking mismatch is only a warning. */ - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) - _bfd_error_handler (_ ("\ + /* Interworking mismatch is only a warning. */ + if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) + _bfd_error_handler (_("\ Warning: %s %s interworking, whereas %s %s"), bfd_get_filename (ibfd), - in_flags & EF_INTERWORK ? _ ("supports") : _ ("does not support"), + in_flags & EF_INTERWORK ? _("supports") : _("does not support"), bfd_get_filename (obfd), - out_flags & EF_INTERWORK ? _ ("does not") : _ ("does")); + out_flags & EF_INTERWORK ? _("does not") : _("does")); + } return flags_compatible; } -/* Display the flags field */ +/* Display the flags field. */ + static boolean elf32_arm_print_private_bfd_data (abfd, ptr) bfd *abfd; PTR ptr; { - FILE *file = (FILE *) ptr; + FILE * file = (FILE *) ptr; + unsigned long flags; BFD_ASSERT (abfd != NULL && ptr != NULL); /* Print normal ELF private data. */ _bfd_elf_print_private_bfd_data (abfd, ptr); - /* Ignore init flag - it may not be set, despite the flags field containing valid data. */ + flags = elf_elfheader (abfd)->e_flags; + /* Ignore init flag - it may not be set, despite the flags field + containing valid data. */ /* xgettext:c-format */ - fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); - if (elf_elfheader (abfd)->e_flags & EF_INTERWORK) - fprintf (file, _ (" [interworking enabled]")); - else - fprintf (file, _ (" [interworking not enabled]")); + switch (EF_ARM_EABI_VERSION (flags)) + { + case EF_ARM_EABI_UNKNOWN: + /* The following flag bits are GNU extenstions and not part of the + official ARM ELF extended ABI. Hence they are only decoded if + the EABI version is not set. */ + if (flags & EF_INTERWORK) + fprintf (file, _(" [interworking enabled]")); - if (elf_elfheader (abfd)->e_flags & EF_APCS_26) - fprintf (file, _ (" [APCS-26]")); - else - fprintf (file, _ (" [APCS-32]")); + if (flags & EF_APCS_26) + fprintf (file, _(" [APCS-26]")); + else + fprintf (file, _(" [APCS-32]")); - if (elf_elfheader (abfd)->e_flags & EF_APCS_FLOAT) - fprintf (file, _ (" [floats passed in float registers]")); - else - fprintf (file, _ (" [floats passed in integer registers]")); + if (flags & EF_APCS_FLOAT) + fprintf (file, _(" [floats passed in float registers]")); - if (elf_elfheader (abfd)->e_flags & EF_PIC) - fprintf (file, _ (" [position independent]")); - else - fprintf (file, _ (" [absolute position]")); + if (flags & EF_PIC) + fprintf (file, _(" [position independent]")); + + if (flags & EF_NEW_ABI) + fprintf (file, _(" [new ABI]")); + + if (flags & EF_OLD_ABI) + fprintf (file, _(" [old ABI]")); + + if (flags & EF_SOFT_FLOAT) + fprintf (file, _(" [software FP]")); + + flags &= ~(EF_INTERWORK | EF_APCS_26 | EF_APCS_FLOAT | EF_PIC + | EF_NEW_ABI | EF_OLD_ABI | EF_SOFT_FLOAT); + break; + + case EF_ARM_EABI_VER1: + fprintf (file, _(" [Version1 EABI]")); + + if (flags & EF_ARM_SYMSARESORTED) + fprintf (file, _(" [sorted symbol table]")); + else + fprintf (file, _(" [unsorted symbol table]")); + + flags &= ~ EF_ARM_SYMSARESORTED; + break; + + default: + fprintf (file, _(" <EABI version unrecognised>")); + break; + } + + flags &= ~ EF_ARM_EABIMASK; + + if (flags & EF_ARM_RELEXEC) + fprintf (file, _(" [relocatable executable]")); + + if (flags & EF_ARM_HASENTRY) + fprintf (file, _(" [has entry point]")); + + flags &= ~ (EF_ARM_RELEXEC | EF_ARM_HASENTRY); + + if (flags) + fprintf (file, _("<Unrecognised flag bits set>")); fputc ('\n', file); @@ -2157,7 +2268,7 @@ elf32_arm_get_symbol_type (elf_sym, type) { case STT_ARM_TFUNC: return ELF_ST_TYPE (elf_sym->st_info); - break; + case STT_ARM_16BIT: /* If the symbol is not an object, return the STT_ARM_16BIT flag. This allows us to distinguish between data used by Thumb instructions @@ -2166,6 +2277,9 @@ elf32_arm_get_symbol_type (elf_sym, type) if (type != STT_OBJECT) return ELF_ST_TYPE (elf_sym->st_info); break; + + default: + break; } return type; @@ -2245,33 +2359,35 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) bfd * dynobj; asection * sgot, *srelgot, *sreloc; bfd_vma * local_got_offsets; - + if (info->relocateable) return true; - + sgot = srelgot = sreloc = NULL; - + dynobj = elf_hash_table (info)->dynobj; local_got_offsets = elf_local_got_offsets (abfd); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - + rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { struct elf_link_hash_entry *h; unsigned long r_symndx; - + r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h = NULL; else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + /* Some relocs require a global offset table. */ if (dynobj == NULL) { @@ -2305,7 +2421,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) && (h != NULL || info->shared)) { srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); - + /* If no got relocation section, make one and initialize. */ if (srelgot == NULL) { @@ -2490,7 +2606,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return false; break; - + /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_ARM_GNU_VTENTRY: @@ -2503,10 +2619,9 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) return true; } - /* Find the nearest line to a particular section and offset, for error reporting. This code is a duplicate of the code in elf.c, except - that it also accepts STT_ARM_TFUNC as a symbol that names a function. */ + that it also accepts STT_ARM_TFUNC as a symbol that names a function. */ static boolean elf32_arm_find_nearest_line @@ -2527,7 +2642,8 @@ elf32_arm_find_nearest_line if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, - line_ptr, 0)) + line_ptr, 0, + &elf_tdata (abfd)->dwarf2_find_line_info)) return true; if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, @@ -2667,7 +2783,6 @@ elf32_arm_adjust_dynamic_symbol (info, h) /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); BFD_ASSERT (s != NULL); s->_raw_size += 4; @@ -2712,7 +2827,6 @@ elf32_arm_adjust_dynamic_symbol (info, h) determine the address it must put in the global offset table, so both the dynamic object and the regular object will refer to the same memory location for the variable. */ - s = bfd_get_section_by_name (dynobj, ".dynbss"); BFD_ASSERT (s != NULL); @@ -2872,7 +2986,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) outname = bfd_get_section_name (output_bfd, s->output_section); target = bfd_get_section_by_name (output_bfd, outname + 4); - + if (target != NULL && (target->flags & SEC_READONLY) != 0 && (target->flags & SEC_ALLOC) != 0) @@ -2925,7 +3039,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if (plt) { - if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0) + if ( ! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0) || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0) || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_REL) || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0)) @@ -2934,7 +3048,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if (relocs) { - if (! bfd_elf32_add_dynamic_entry (info, DT_REL, 0) + if ( ! bfd_elf32_add_dynamic_entry (info, DT_REL, 0) || ! bfd_elf32_add_dynamic_entry (info, DT_RELSZ, 0) || ! bfd_elf32_add_dynamic_entry (info, DT_RELENT, sizeof (Elf32_External_Rel))) @@ -2945,6 +3059,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } @@ -3052,6 +3167,13 @@ elf32_arm_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; } } @@ -3063,7 +3185,6 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the global offset table. Set it up. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); srel = bfd_get_section_by_name (dynobj, ".rel.got"); BFD_ASSERT (sgot != NULL && srel != NULL); @@ -3098,7 +3219,6 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) Elf_Internal_Rel rel; /* This symbol needs a copy reloc. Set it up. */ - BFD_ASSERT (h->dynindx != -1 && (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak)); @@ -3152,6 +3272,7 @@ elf32_arm_finish_dynamic_sections (output_bfd, info) dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; @@ -3242,7 +3363,7 @@ elf32_arm_post_process_headers (abfd, link_info) bfd * abfd; struct bfd_link_info * link_info ATTRIBUTE_UNUSED; { - Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */ + Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ i_ehdrp = elf_elfheader (abfd); @@ -3250,12 +3371,10 @@ elf32_arm_post_process_headers (abfd, link_info) i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION; } - #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM #define ELF_MAXPAGESIZE 0x8000 - #define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data #define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags diff --git a/contrib/binutils/bfd/elf32-gen.c b/contrib/binutils/bfd/elf32-gen.c index 47da53b..7a39f47 100644 --- a/contrib/binutils/bfd/elf32-gen.c +++ b/contrib/binutils/bfd/elf32-gen.c @@ -58,6 +58,37 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) bfd_reloc->howto = &dummy; } +static boolean +elf32_generic_link_add_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *o; + + /* Check if there are any relocations. */ + for (o = abfd->sections; o != NULL; o = o->next) + if ((o->flags & SEC_RELOC) != 0) + { + Elf_Internal_Ehdr *ehdrp; + + ehdrp = elf_elfheader (abfd); + if (abfd->my_archive) + (*_bfd_error_handler) (_("%s(%s): Relocations in generic ELF (EM: %d)"), + bfd_get_filename (abfd->my_archive), + bfd_get_filename (abfd), + ehdrp->e_machine); + else + (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), + bfd_get_filename (abfd), + ehdrp->e_machine); + + bfd_set_error (bfd_error_wrong_format); + return false; + } + + return bfd_elf32_bfd_link_add_symbols (abfd, info); +} + #define TARGET_LITTLE_SYM bfd_elf32_little_generic_vec #define TARGET_LITTLE_NAME "elf32-little" #define TARGET_BIG_SYM bfd_elf32_big_generic_vec @@ -66,6 +97,7 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf32_bfd_link_add_symbols elf32_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/contrib/binutils/bfd/elf32-i386.c b/contrib/binutils/bfd/elf32-i386.c index fc1b5a8..4ad2c2b 100644 --- a/contrib/binutils/bfd/elf32-i386.c +++ b/contrib/binutils/bfd/elf32-i386.c @@ -1,5 +1,6 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright 1993, 94-98, 1999 Free Software Foundation, Inc. + Copyright 1993, 94, 95, 96, 97, 98, 99, 2000 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -56,35 +57,66 @@ static boolean elf_i386_finish_dynamic_sections static reloc_howto_type elf_howto_table[]= { - HOWTO(R_386_NONE, 0,0, 0,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_NONE", true,0x00000000,0x00000000,false), - HOWTO(R_386_32, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_32", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_PC32, 0,2,32,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC32", true,0xffffffff,0xffffffff,true), - HOWTO(R_386_GOT32, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOT32", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_PLT32, 0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PLT32", true,0xffffffff,0xffffffff,true), - HOWTO(R_386_COPY, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_COPY", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_GLOB_DAT, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GLOB_DAT", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_JUMP_SLOT, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_JUMP_SLOT",true,0xffffffff,0xffffffff,false), - HOWTO(R_386_RELATIVE, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_RELATIVE", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_GOTOFF, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTOFF", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_GOTPC, 0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTPC", true,0xffffffff,0xffffffff,true), - EMPTY_HOWTO (11), - EMPTY_HOWTO (12), - EMPTY_HOWTO (13), - EMPTY_HOWTO (14), - EMPTY_HOWTO (15), - EMPTY_HOWTO (16), - EMPTY_HOWTO (17), - EMPTY_HOWTO (18), - EMPTY_HOWTO (19), + HOWTO(R_386_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_NONE", + true, 0x00000000, 0x00000000, false), + HOWTO(R_386_32, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_32", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_PC32, 0, 2, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_PC32", + true, 0xffffffff, 0xffffffff, true), + HOWTO(R_386_GOT32, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GOT32", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_PLT32, 0, 2, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_PLT32", + true, 0xffffffff, 0xffffffff, true), + HOWTO(R_386_COPY, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_COPY", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_GLOB_DAT, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GLOB_DAT", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_JUMP_SLOT, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_JUMP_SLOT", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_RELATIVE, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_RELATIVE", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_GOTOFF, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GOTOFF", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_GOTPC, 0, 2, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GOTPC", + true, 0xffffffff, 0xffffffff, true), + + /* We have a gap in the reloc numbers here. + R_386_standard counts the number up to this point, and + R_386_ext_offset is the value to subtract from a reloc type of + R_386_16 thru R_386_PC8 to form an index into this table. */ +#define R_386_standard ((unsigned int) R_386_GOTPC + 1) +#define R_386_ext_offset ((unsigned int) R_386_16 - R_386_standard) + /* The remaining relocs are a GNU extension. */ - HOWTO(R_386_16, 0,1,16,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_16", true,0xffff,0xffff,false), - HOWTO(R_386_PC16, 0,1,16,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC16", true,0xffff,0xffff,true), - HOWTO(R_386_8, 0,0,8,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_8", true,0xff,0xff,false), - HOWTO(R_386_PC8, 0,0,8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc,"R_386_PC8", true,0xff,0xff,true), -}; + HOWTO(R_386_16, 0, 1, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_16", + true, 0xffff, 0xffff, false), + HOWTO(R_386_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_PC16", + true, 0xffff, 0xffff, true), + HOWTO(R_386_8, 0, 0, 8, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_8", + true, 0xff, 0xff, false), + HOWTO(R_386_PC8, 0, 0, 8, true, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_386_PC8", + true, 0xff, 0xff, true), + + /* Another gap. */ +#define R_386_ext ((unsigned int) R_386_PC8 + 1 - R_386_ext_offset) +#define R_386_vt_offset ((unsigned int) R_386_GNU_VTINHERIT - R_386_ext) /* GNU extension to record C++ vtable hierarchy. */ -static reloc_howto_type elf32_i386_vtinherit_howto = HOWTO (R_386_GNU_VTINHERIT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -97,10 +129,9 @@ static reloc_howto_type elf32_i386_vtinherit_howto = false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); + false), /* GNU extension to record C++ vtable member usage. */ -static reloc_howto_type elf32_i386_vtentry_howto = HOWTO (R_386_GNU_VTENTRY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -113,7 +144,11 @@ static reloc_howto_type elf32_i386_vtentry_howto = false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); + false) + +#define R_386_vt ((unsigned int) R_386_GNU_VTENTRY + 1 - R_386_vt_offset) + +}; #ifdef DEBUG_GEN_RELOC #define TRACE(str) fprintf (stderr, "i386 bfd reloc lookup %d (%s)\n", code, str) @@ -130,76 +165,78 @@ elf_i386_reloc_type_lookup (abfd, code) { case BFD_RELOC_NONE: TRACE ("BFD_RELOC_NONE"); - return &elf_howto_table[ (int)R_386_NONE ]; + return &elf_howto_table[(unsigned int) R_386_NONE ]; case BFD_RELOC_32: TRACE ("BFD_RELOC_32"); - return &elf_howto_table[ (int)R_386_32 ]; + return &elf_howto_table[(unsigned int) R_386_32 ]; case BFD_RELOC_CTOR: TRACE ("BFD_RELOC_CTOR"); - return &elf_howto_table[ (int)R_386_32 ]; + return &elf_howto_table[(unsigned int) R_386_32 ]; case BFD_RELOC_32_PCREL: TRACE ("BFD_RELOC_PC32"); - return &elf_howto_table[ (int)R_386_PC32 ]; + return &elf_howto_table[(unsigned int) R_386_PC32 ]; case BFD_RELOC_386_GOT32: TRACE ("BFD_RELOC_386_GOT32"); - return &elf_howto_table[ (int)R_386_GOT32 ]; + return &elf_howto_table[(unsigned int) R_386_GOT32 ]; case BFD_RELOC_386_PLT32: TRACE ("BFD_RELOC_386_PLT32"); - return &elf_howto_table[ (int)R_386_PLT32 ]; + return &elf_howto_table[(unsigned int) R_386_PLT32 ]; case BFD_RELOC_386_COPY: TRACE ("BFD_RELOC_386_COPY"); - return &elf_howto_table[ (int)R_386_COPY ]; + return &elf_howto_table[(unsigned int) R_386_COPY ]; case BFD_RELOC_386_GLOB_DAT: TRACE ("BFD_RELOC_386_GLOB_DAT"); - return &elf_howto_table[ (int)R_386_GLOB_DAT ]; + return &elf_howto_table[(unsigned int) R_386_GLOB_DAT ]; case BFD_RELOC_386_JUMP_SLOT: TRACE ("BFD_RELOC_386_JUMP_SLOT"); - return &elf_howto_table[ (int)R_386_JUMP_SLOT ]; + return &elf_howto_table[(unsigned int) R_386_JUMP_SLOT ]; case BFD_RELOC_386_RELATIVE: TRACE ("BFD_RELOC_386_RELATIVE"); - return &elf_howto_table[ (int)R_386_RELATIVE ]; + return &elf_howto_table[(unsigned int) R_386_RELATIVE ]; case BFD_RELOC_386_GOTOFF: TRACE ("BFD_RELOC_386_GOTOFF"); - return &elf_howto_table[ (int)R_386_GOTOFF ]; + return &elf_howto_table[(unsigned int) R_386_GOTOFF ]; case BFD_RELOC_386_GOTPC: TRACE ("BFD_RELOC_386_GOTPC"); - return &elf_howto_table[ (int)R_386_GOTPC ]; + return &elf_howto_table[(unsigned int) R_386_GOTPC ]; /* The remaining relocs are a GNU extension. */ case BFD_RELOC_16: TRACE ("BFD_RELOC_16"); - return &elf_howto_table[(int) R_386_16]; + return &elf_howto_table[(unsigned int) R_386_16 - R_386_ext_offset]; case BFD_RELOC_16_PCREL: TRACE ("BFD_RELOC_16_PCREL"); - return &elf_howto_table[(int) R_386_PC16]; + return &elf_howto_table[(unsigned int) R_386_PC16 - R_386_ext_offset]; case BFD_RELOC_8: TRACE ("BFD_RELOC_8"); - return &elf_howto_table[(int) R_386_8]; + return &elf_howto_table[(unsigned int) R_386_8 - R_386_ext_offset]; case BFD_RELOC_8_PCREL: TRACE ("BFD_RELOC_8_PCREL"); - return &elf_howto_table[(int) R_386_PC8]; + return &elf_howto_table[(unsigned int) R_386_PC8 - R_386_ext_offset]; case BFD_RELOC_VTABLE_INHERIT: TRACE ("BFD_RELOC_VTABLE_INHERIT"); - return &elf32_i386_vtinherit_howto; + return &elf_howto_table[(unsigned int) R_386_GNU_VTINHERIT + - R_386_vt_offset]; case BFD_RELOC_VTABLE_ENTRY: TRACE ("BFD_RELOC_VTABLE_ENTRY"); - return &elf32_i386_vtentry_howto; + return &elf_howto_table[(unsigned int) R_386_GNU_VTENTRY + - R_386_vt_offset]; default: break; @@ -224,22 +261,20 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) arelent *cache_ptr; Elf32_Internal_Rel *dst; { - enum elf_i386_reloc_type type; - - type = (enum elf_i386_reloc_type) ELF32_R_TYPE (dst->r_info); - if (type == R_386_GNU_VTINHERIT) - cache_ptr->howto = &elf32_i386_vtinherit_howto; - else if (type == R_386_GNU_VTENTRY) - cache_ptr->howto = &elf32_i386_vtentry_howto; - else if (type < R_386_max - && (type < FIRST_INVALID_RELOC || type > LAST_INVALID_RELOC)) - cache_ptr->howto = &elf_howto_table[(int) type]; - else + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + unsigned int indx; + + if ((indx = r_type) >= R_386_standard + && ((indx = r_type - R_386_ext_offset) - R_386_standard + >= R_386_ext - R_386_standard) + && ((indx = r_type - R_386_vt_offset) - R_386_ext + >= R_386_vt - R_386_ext)) { (*_bfd_error_handler) (_("%s: invalid relocation type %d"), - bfd_get_filename (abfd), (int) type); - cache_ptr->howto = &elf_howto_table[(int) R_386_NONE]; + bfd_get_filename (abfd), (int) r_type); + indx = (unsigned int) R_386_NONE; } + cache_ptr->howto = &elf_howto_table[indx]; } /* Return whether a symbol name implies a local label. The UnixWare @@ -439,7 +474,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) bfd *dynobj; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; - bfd_vma *local_got_offsets; + bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sgot; @@ -452,7 +487,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - local_got_offsets = elf_local_got_offsets (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); sgot = NULL; srelgot = NULL; @@ -522,57 +557,54 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (h != NULL) { - if (h->got.offset != (bfd_vma) -1) + if (h->got.refcount == -1) { - /* We have already allocated space in the .got. */ - break; - } - h->got.offset = sgot->_raw_size; + h->got.refcount = 1; - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->dynindx == -1) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + return false; + } - srelgot->_raw_size += sizeof (Elf32_External_Rel); + sgot->_raw_size += 4; + srelgot->_raw_size += sizeof (Elf32_External_Rel); + } + else + h->got.refcount += 1; } else { - /* This is a global offset table entry for a local - symbol. */ - if (local_got_offsets == NULL) + /* This is a global offset table entry for a local symbol. */ + if (local_got_refcounts == NULL) { size_t size; - register unsigned int i; - size = symtab_hdr->sh_info * sizeof (bfd_vma); - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); - if (local_got_offsets == NULL) + size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); + local_got_refcounts = ((bfd_signed_vma *) + bfd_alloc (abfd, size)); + if (local_got_refcounts == NULL) return false; - elf_local_got_offsets (abfd) = local_got_offsets; - for (i = 0; i < symtab_hdr->sh_info; i++) - local_got_offsets[i] = (bfd_vma) -1; + elf_local_got_refcounts (abfd) = local_got_refcounts; + memset (local_got_refcounts, -1, size); } - if (local_got_offsets[r_symndx] != (bfd_vma) -1) + if (local_got_refcounts[r_symndx] == -1) { - /* We have already allocated space in the .got. */ - break; - } - local_got_offsets[r_symndx] = sgot->_raw_size; + local_got_refcounts[r_symndx] = 1; - if (info->shared) - { - /* If we are generating a shared object, we need to - output a R_386_RELATIVE reloc so that the dynamic - linker can adjust this GOT entry. */ - srelgot->_raw_size += sizeof (Elf32_External_Rel); + sgot->_raw_size += 4; + if (info->shared) + { + /* If we are generating a shared object, we need to + output a R_386_RELATIVE reloc so that the dynamic + linker can adjust this GOT entry. */ + srelgot->_raw_size += sizeof (Elf32_External_Rel); + } } + else + local_got_refcounts[r_symndx] += 1; } - - sgot->_raw_size += 4; - break; case R_386_PLT32: @@ -588,8 +620,13 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (h == NULL) continue; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - + if (h->plt.refcount == -1) + { + h->plt.refcount = 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + else + h->plt.refcount += 1; break; case R_386_32: @@ -598,28 +635,33 @@ elf_i386_check_relocs (abfd, info, sec, relocs) h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; /* If we are creating a shared library, and this is a reloc - against a global symbol, or a non PC relative reloc - against a local symbol, then we need to copy the reloc - into the shared library. However, if we are linking with - -Bsymbolic, we do not need to copy a reloc against a - global symbol which is defined in an object we are - including in the link (i.e., DEF_REGULAR is set). At - this point we have not seen all the input files, so it is - possible that DEF_REGULAR is not set now but will be set - later (it is never cleared). We account for that - possibility below by storing information in the - pcrel_relocs_copied field of the hash table entry. */ + against a global symbol, or a non PC relative reloc + against a local symbol, then we need to copy the reloc + into the shared library. However, if we are linking with + -Bsymbolic, we do not need to copy a reloc against a + global symbol which is defined in an object we are + including in the link (i.e., DEF_REGULAR is set). At + this point we have not seen all the input files, so it is + possible that DEF_REGULAR is not set now but will be set + later (it is never cleared). In case of a weak definition, + DEF_REGULAR may be cleared later by a strong definition in + a shared library. We account for that possibility below by + storing information in the relocs_copied field of the hash + table entry. A similar situation occurs when creating + shared libraries and symbol visibility changes render the + symbol local. */ if (info->shared && (sec->flags & SEC_ALLOC) != 0 && (ELF32_R_TYPE (rel->r_info) != R_386_PC32 || (h != NULL && (! info->symbolic + || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) { /* When creating a shared object, we must copy these - reloc types into the output file. We create a reloc - section in dynobj and make room for this reloc. */ + reloc types into the output file. We create a reloc + section in dynobj and make room for this reloc. */ if (sreloc == NULL) { const char *name; @@ -631,9 +673,20 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (name == NULL) return false; - BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (abfd, sec), - name + 4) == 0); + if (strncmp (name, ".rel", 4) != 0 + || strcmp (bfd_get_section_name (abfd, sec), + name + 4) != 0) + { + if (abfd->my_archive) + (*_bfd_error_handler) (_("%s(%s): bad relocation section name `%s\'"), + bfd_get_filename (abfd->my_archive), + bfd_get_filename (abfd), + name); + else + (*_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) @@ -654,15 +707,13 @@ elf_i386_check_relocs (abfd, info, sec, relocs) sreloc->_raw_size += sizeof (Elf32_External_Rel); - /* If we are linking with -Bsymbolic, and this is a - global symbol, we count the number of PC relative - relocations we have entered for this symbol, so that - we can discard them again if the symbol is later - defined by a regular object. Note that this function - is only called if we are using an elf_i386 linker - hash table, which means that h is really a pointer to - an elf_i386_link_hash_entry. */ - if (h != NULL && info->symbolic + /* If this is a global symbol, we count the number of PC + relative relocations we have entered for this symbol, + so that we can discard them later as necessary. Note + that this function is only called if we are using an + elf_i386 linker hash table, which means that h is + really a pointer to an elf_i386_link_hash_entry. */ + if (h != NULL && ELF32_R_TYPE (rel->r_info) == R_386_PC32) { struct elf_i386_link_hash_entry *eh; @@ -766,14 +817,81 @@ elf_i386_gc_mark_hook (abfd, info, rel, h, sym) static boolean elf_i386_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; + bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; + asection *sec; + const Elf_Internal_Rela *relocs; { - /* ??? It would seem that the existing i386 code does no sort - of reference counting or whatnot on its GOT and PLT entries, - so it is not possible to garbage collect them at this time. */ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_signed_vma *local_got_refcounts; + const Elf_Internal_Rela *rel, *relend; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + bfd *dynobj; + asection *sgot; + asection *srelgot; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + + dynobj = elf_hash_table (info)->dynobj; + if (dynobj == NULL) + return true; + + sgot = bfd_get_section_by_name (dynobj, ".got"); + srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_386_GOT32: + case R_386_GOTOFF: + case R_386_GOTPC: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->got.refcount > 0) + { + h->got.refcount -= 1; + if (h->got.refcount == 0) + { + sgot->_raw_size -= 4; + srelgot->_raw_size -= sizeof (Elf32_External_Rel); + } + } + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + { + local_got_refcounts[r_symndx] -= 1; + if (local_got_refcounts[r_symndx] == 0) + { + sgot->_raw_size -= 4; + if (info->shared) + srelgot->_raw_size -= sizeof (Elf32_External_Rel); + } + } + } + break; + + case R_386_PLT32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + default: + break; + } return true; } @@ -812,16 +930,18 @@ elf_i386_adjust_dynamic_symbol (info, h) if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) + if ((! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) + || (info->shared && h->plt.refcount <= 0)) { /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object. In such a case, we don't actually need to build - a procedure linkage table, and we can just do a PC32 - reloc instead. */ - BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); + file, but the symbol was never referred to by a dynamic + object, or if all references were garbage collected. In + such a case, we don't actually need to build a procedure + linkage table, and we can just do a PC32 reloc instead. */ + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; return true; } @@ -859,13 +979,11 @@ elf_i386_adjust_dynamic_symbol (info, h) /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); BFD_ASSERT (s != NULL); s->_raw_size += 4; /* We also need to make an entry in the .rel.plt section. */ - s = bfd_get_section_by_name (dynobj, ".rel.plt"); BFD_ASSERT (s != NULL); s->_raw_size += sizeof (Elf32_External_Rel); @@ -995,10 +1113,10 @@ elf_i386_size_dynamic_sections (output_bfd, info) PC relative relocs against symbols defined in a regular object. We allocated space for them in the check_relocs routine, but we will not fill them in in the relocate_section routine. */ - if (info->shared && info->symbolic) + if (info->shared) elf_i386_link_hash_traverse (elf_i386_hash_table (info), elf_i386_discard_copies, - (PTR) NULL); + (PTR) info); /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate @@ -1092,8 +1210,12 @@ elf_i386_size_dynamic_sections (output_bfd, info) continue; } - /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + /* Allocate memory for the section contents. We use bfd_zalloc + here in case unused entries are not reclaimed before the + section's contents are written out. This should not happen, + but this way if it does, we get a R_386_NONE reloc instead + of garbage. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -1133,6 +1255,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } @@ -1140,26 +1263,32 @@ elf_i386_size_dynamic_sections (output_bfd, info) } /* This function is called via elf_i386_link_hash_traverse if we are - creating a shared object with -Bsymbolic. It discards the space - allocated to copy PC relative relocs against symbols which are - defined in regular objects. We allocated space for them in the + creating a shared object. In the -Bsymbolic case, it discards the + space allocated to copy PC relative relocs against symbols which + are defined in regular objects. For the normal non-symbolic case, + we also discard space for relocs that have become local due to + symbol visibility changes. We allocated space for them in the check_relocs routine, but we won't fill them in in the relocate_section routine. */ -/*ARGSUSED*/ static boolean -elf_i386_discard_copies (h, ignore) +elf_i386_discard_copies (h, inf) struct elf_i386_link_hash_entry *h; - PTR ignore ATTRIBUTE_UNUSED; + PTR inf; { struct elf_i386_pcrel_relocs_copied *s; - - /* We only discard relocs for symbols defined in a regular object. */ - if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - return true; - - for (s = h->pcrel_relocs_copied; s != NULL; s = s->next) - s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel); + struct bfd_link_info *info = (struct bfd_link_info *) inf; + + /* If a symbol has been forced local or we have found a regular + definition for the symbolic link case, then we won't be needing + any relocs. */ + if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 + || info->symbolic)) + { + for (s = h->pcrel_relocs_copied; s != NULL; s = s->next) + s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel); + } return true; } @@ -1193,9 +1322,14 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sym_hashes = elf_sym_hashes (input_bfd); local_got_offsets = elf_local_got_offsets (input_bfd); - sgot = NULL; - splt = NULL; sreloc = NULL; + splt = NULL; + sgot = NULL; + if (dynobj != NULL) + { + splt = bfd_get_section_by_name (dynobj, ".plt"); + sgot = bfd_get_section_by_name (dynobj, ".got"); + } rel = relocs; relend = relocs + input_section->reloc_count; @@ -1209,20 +1343,21 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma relocation; bfd_reloc_status_type r; + unsigned int indx; r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == R_386_GNU_VTINHERIT - || r_type == R_386_GNU_VTENTRY) + if (r_type == (int) R_386_GNU_VTINHERIT + || r_type == (int) R_386_GNU_VTENTRY) continue; - if (r_type < 0 - || r_type >= (int) R_386_max - || (r_type >= (int) FIRST_INVALID_RELOC - && r_type <= (int) LAST_INVALID_RELOC)) + + if ((indx = (unsigned) r_type) >= R_386_standard + && ((indx = (unsigned) r_type - R_386_ext_offset) - R_386_standard + >= R_386_ext - R_386_standard)) { bfd_set_error (bfd_error_bad_value); return false; } - howto = elf_howto_table + r_type; + howto = elf_howto_table + indx; r_symndx = ELF32_R_SYM (rel->r_info); @@ -1273,6 +1408,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sec = h->root.u.def.section; if (r_type == R_386_GOTPC || (r_type == R_386_PLT32 + && splt != NULL && h->plt.offset != (bfd_vma) -1) || (r_type == R_386_GOT32 && elf_hash_table (info)->dynamic_sections_created @@ -1336,11 +1472,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, case R_386_GOT32: /* Relocation is to the entry for this symbol in the global offset table. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } + BFD_ASSERT (sgot != NULL); if (h != NULL) { @@ -1459,12 +1591,13 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocation is to the entry for this symbol in the procedure linkage table. */ - /* Resolve a PLT32 reloc again a local symbol directly, + /* Resolve a PLT32 reloc against a local symbol directly, without using the procedure linkage table. */ if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1) + if (h->plt.offset == (bfd_vma) -1 + || splt == NULL) { /* We didn't make a PLT entry for this symbol. This happens when statically linking PIC code, or when @@ -1472,12 +1605,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if (splt == NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL); - } - relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); @@ -1513,10 +1640,22 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (name == NULL) return false; - BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (input_bfd, - input_section), - name + 4) == 0); + if (strncmp (name, ".rel", 4) != 0 + || strcmp (bfd_get_section_name (input_bfd, + input_section), + name + 4) != 0) + { + if (input_bfd->my_archive) + (*_bfd_error_handler) (_("%s(%s): bad relocation section name `%s\'"), + bfd_get_filename (input_bfd->my_archive), + bfd_get_filename (input_bfd), + name); + else + (*_bfd_error_handler) (_("%s: bad relocation section name `%s\'"), + bfd_get_filename (input_bfd), + name); + return false; + } sreloc = bfd_get_section_by_name (dynobj, name); BFD_ASSERT (sreloc != NULL); @@ -1744,17 +1883,21 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) + sgot->output_offset + (h->got.offset &~ 1)); - /* If this is a -Bsymbolic link, and the symbol is defined - locally, we just want to emit a RELATIVE reloc. Likewise if - the symbol was forced to be local because of a version file. + /* If this is a static link, or it is a -Bsymbolic link and the + symbol is defined locally or was forced to be local because + of a version file, we just want to emit a RELATIVE reloc. The entry in the global offset table will already have been initialized in the relocate_section function. */ - if (info->shared - && (info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); + if (! elf_hash_table (info)->dynamic_sections_created + || (info->shared + && (info->symbolic || h->dynindx == -1) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + { + rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); + } else { + BFD_ASSERT((h->got.offset & 1) == 0); bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT); } @@ -1928,27 +2071,6 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define ELF_ARCH bfd_arch_i386 #define ELF_MACHINE_CODE EM_386 #define ELF_MAXPAGESIZE 0x1000 -#define elf_info_to_howto elf_i386_info_to_howto -#define elf_info_to_howto_rel elf_i386_info_to_howto_rel -#define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup -#define bfd_elf32_bfd_is_local_label_name \ - elf_i386_is_local_label_name -#define elf_backend_create_dynamic_sections \ - _bfd_elf_create_dynamic_sections -#define bfd_elf32_bfd_link_hash_table_create \ - elf_i386_link_hash_table_create -#define elf_backend_check_relocs elf_i386_check_relocs -#define elf_backend_adjust_dynamic_symbol \ - elf_i386_adjust_dynamic_symbol -#define elf_backend_size_dynamic_sections \ - elf_i386_size_dynamic_sections -#define elf_backend_relocate_section elf_i386_relocate_section -#define elf_backend_finish_dynamic_symbol \ - elf_i386_finish_dynamic_symbol -#define elf_backend_finish_dynamic_sections \ - elf_i386_finish_dynamic_sections -#define elf_backend_gc_mark_hook elf_i386_gc_mark_hook -#define elf_backend_gc_sweep_hook elf_i386_gc_sweep_hook #define elf_backend_can_gc_sections 1 #define elf_backend_want_got_plt 1 @@ -1957,4 +2079,22 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define elf_backend_got_header_size 12 #define elf_backend_plt_header_size PLT_ENTRY_SIZE +#define elf_info_to_howto elf_i386_info_to_howto +#define elf_info_to_howto_rel elf_i386_info_to_howto_rel + +#define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link +#define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name +#define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create +#define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup + +#define elf_backend_adjust_dynamic_symbol elf_i386_adjust_dynamic_symbol +#define elf_backend_check_relocs elf_i386_check_relocs +#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections +#define elf_backend_finish_dynamic_sections elf_i386_finish_dynamic_sections +#define elf_backend_finish_dynamic_symbol elf_i386_finish_dynamic_symbol +#define elf_backend_gc_mark_hook elf_i386_gc_mark_hook +#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 + #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c index b405fea..d3152ce 100644 --- a/contrib/binutils/bfd/elf32-ppc.c +++ b/contrib/binutils/bfd/elf32-ppc.c @@ -32,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define USE_RELA /* we want RELA relocations, not REL */ - static reloc_howto_type *ppc_elf_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void ppc_elf_info_to_howto @@ -124,11 +123,27 @@ static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_i /* The number of single-slot PLT entries (the rest use two slots). */ #define PLT_NUM_SINGLE_ENTRIES 8192 +/* Will references to this symbol always reference the symbol + in this object? */ +#define SYMBOL_REFERENCES_LOCAL(INFO, H) \ + ((! INFO->shared \ + || INFO->symbolic \ + || H->dynindx == -1 \ + || 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) + +/* Will _calls_ to this symbol always call the version in this object? */ +#define SYMBOL_CALLS_LOCAL(INFO, H) \ + ((! INFO->shared \ + || INFO->symbolic \ + || H->dynindx == -1 \ + || ELF_ST_VISIBILITY (H->other) != STV_DEFAULT) \ + && (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) -static reloc_howto_type *ppc_elf_howto_table[ (int)R_PPC_max ]; +static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max]; -static reloc_howto_type ppc_elf_howto_raw[] = -{ +static reloc_howto_type ppc_elf_howto_raw[] = { /* This reloc does nothing. */ HOWTO (R_PPC_NONE, /* type */ 0, /* rightshift */ @@ -221,7 +236,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = false), /* pcrel_offset */ /* The high order 16 bits of an address, plus 1 if the contents of - the low 16 bits, treated as a signed number, is negative. */ + the low 16 bits, treated as a signed number, is negative. */ HOWTO (R_PPC_ADDR16_HA, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -254,7 +269,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = /* An absolute 16 bit branch, for which bit 10 should be set to indicate that the branch is expected to be taken. The lower two - bits must be zero. */ + bits must be zero. */ HOWTO (R_PPC_ADDR14_BRTAKEN, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -286,7 +301,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xfffc, /* dst_mask */ false), /* pcrel_offset */ - /* A relative 26 bit branch; the lower two bits must be zero. */ + /* A relative 26 bit branch; the lower two bits must be zero. */ HOWTO (R_PPC_REL24, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -301,7 +316,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0x3fffffc, /* dst_mask */ true), /* pcrel_offset */ - /* A relative 16 bit branch; the lower two bits must be zero. */ + /* A relative 16 bit branch; the lower two bits must be zero. */ HOWTO (R_PPC_REL14, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -316,7 +331,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xfffc, /* dst_mask */ true), /* pcrel_offset */ - /* A relative 16 bit branch. Bit 10 should be set to indicate that + /* A relative 16 bit branch. Bit 10 should be set to indicate that the branch is expected to be taken. The lower two bits must be zero. */ HOWTO (R_PPC_REL14_BRTAKEN, /* type */ @@ -333,7 +348,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xfffc, /* dst_mask */ true), /* pcrel_offset */ - /* A relative 16 bit branch. Bit 10 should be set to indicate that + /* A relative 16 bit branch. Bit 10 should be set to indicate that the branch is not expected to be taken. The lower two bits must be zero. */ HOWTO (R_PPC_REL14_BRNTAKEN, /* type */ @@ -560,7 +575,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = true), /* pcrel_offset */ /* 32-bit relocation to the symbol's procedure linkage table. - FIXME: not supported. */ + FIXME: not supported. */ HOWTO (R_PPC_PLT32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -576,7 +591,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = false), /* pcrel_offset */ /* 32-bit PC relative relocation to the symbol's procedure linkage table. - FIXME: not supported. */ + FIXME: not supported. */ HOWTO (R_PPC_PLTREL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -655,7 +670,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* 32-bit section relative relocation. */ + /* 32-bit section relative relocation. */ HOWTO (R_PPC_SECTOFF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -670,7 +685,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0, /* dst_mask */ true), /* pcrel_offset */ - /* 16-bit lower half section relative relocation. */ + /* 16-bit lower half section relative relocation. */ HOWTO (R_PPC_SECTOFF_LO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -685,7 +700,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* 16-bit upper half section relative relocation. */ + /* 16-bit upper half section relative relocation. */ HOWTO (R_PPC_SECTOFF_HI, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -700,7 +715,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* 16-bit upper half adjusted section relative relocation. */ + /* 16-bit upper half adjusted section relative relocation. */ HOWTO (R_PPC_SECTOFF_HA, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -931,7 +946,6 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ }; - /* Initialize the ppc_elf_howto_table, so that linear accesses can be done. */ @@ -943,11 +957,10 @@ ppc_elf_howto_init () for (i = 0; i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); i++) { type = ppc_elf_howto_raw[i].type; - BFD_ASSERT (type < sizeof(ppc_elf_howto_table) / sizeof(ppc_elf_howto_table[0])); + BFD_ASSERT (type < sizeof (ppc_elf_howto_table) / sizeof (ppc_elf_howto_table[0])); ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i]; } } - /* This function handles relaxing for the PPC with option --mpc860c0[=<n>]. @@ -959,7 +972,7 @@ ppc_elf_howto_init () 3/ The branch is taken. 4/ The branch is located in the last 5 words of a page. (The EOP limit is 5 by default but may be specified as any value from 1-10.) - + Our software solution is to detect these problematic branches in a linker pass and modify them as follows: 1/ Unconditional branches - Since these are always predicted taken, @@ -975,22 +988,22 @@ ppc_elf_howto_init () static int ppc_elf_sort_rela (arg1, arg2) - const void *arg1; - const void *arg2; + const void *arg1; + const void *arg2; { const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1; const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2; - /* Sort by offset. */ + /* Sort by offset. */ return ((*rela1)->r_offset - (*rela2)->r_offset); } static boolean ppc_elf_relax_section (abfd, isec, link_info, again) - bfd *abfd; - asection *isec; - struct bfd_link_info *link_info; - boolean *again; + bfd *abfd; + asection *isec; + struct bfd_link_info *link_info; + boolean *again; { #define PAGESIZE 0x1000 @@ -1001,7 +1014,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) Elf_Internal_Rela **rela_comb = NULL; int comb_curr, comb_count; - /* We never have to do this more than once per input section. */ + /* We never have to do this more than once per input section. */ *again = false; /* If needed, initialize this section's cooked size. */ @@ -1009,13 +1022,13 @@ ppc_elf_relax_section (abfd, isec, link_info, again) isec->_cooked_size = isec->_raw_size; /* We're only interested in text sections which overlap the - troublesome area at the end of a page. */ + troublesome area at the end of a page. */ if (link_info->mpc860c0 && (isec->flags & SEC_CODE) && isec->_cooked_size) { bfd_vma dot, end_page, end_section; boolean section_modified; - /* Get the section contents. */ + /* Get the section contents. */ /* Get cached copy if it exists. */ if (elf_section_data (isec)->this_hdr.contents != NULL) contents = elf_section_data (isec)->this_hdr.contents; @@ -1024,42 +1037,42 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* Go get them off disk. */ contents = (bfd_byte *) bfd_malloc (isec->_raw_size); if (contents == NULL) - goto error_return; + goto error_return; free_contents = contents; if (! bfd_get_section_contents (abfd, isec, contents, (file_ptr) 0, isec->_raw_size)) - goto error_return; + goto error_return; } comb_curr = 0; comb_count = 0; if (isec->reloc_count) - { + { unsigned n; /* Get a copy of the native relocations. */ internal_relocs = _bfd_elf32_link_read_relocs ( - abfd, isec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + abfd, isec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory); if (internal_relocs == NULL) goto error_return; if (! link_info->keep_memory) free_relocs = internal_relocs; - - /* Setup a faster access method for the reloc info we need. */ + + /* Setup a faster access method for the reloc info we need. */ rela_comb = (Elf_Internal_Rela**) - bfd_malloc (isec->reloc_count*sizeof(Elf_Internal_Rela*)); + bfd_malloc (isec->reloc_count*sizeof (Elf_Internal_Rela*)); if (rela_comb == NULL) goto error_return; - for (n=0; n<isec->reloc_count; ++n) + for (n = 0; n < isec->reloc_count; ++n) { long r_type; - + r_type = ELF32_R_TYPE (internal_relocs[n].r_info); - if (r_type < 0 || r_type >= (int)R_PPC_max) + if (r_type < 0 || r_type >= (int) R_PPC_max) goto error_return; - + /* Prologue constants are sometimes present in the ".text" sections and they can be identified by their associated relocation. We don't want to process those words and some others which @@ -1067,37 +1080,37 @@ ppc_elf_relax_section (abfd, isec, link_info, again) conditional branches will have a relocation so we will only ignore words that 1) have a reloc, and 2) the reloc is not applicable to a conditional branch. - The array rela_comb is built here for use in the EOP scan loop. */ + The array rela_comb is built here for use in the EOP scan loop. */ switch (r_type) { case R_PPC_ADDR14_BRNTAKEN: /* absolute, predicted not taken */ - case R_PPC_REL14: /* relative cond. br. */ + case R_PPC_REL14: /* relative cond. br. */ case R_PPC_REL14_BRNTAKEN: /* rel. cond. br., predicted not taken */ - /* We should check the instruction. */ + /* We should check the instruction. */ break; default: - /* The word is not a conditional branch - ignore it. */ + /* The word is not a conditional branch - ignore it. */ rela_comb[comb_count++] = &internal_relocs[n]; break; } } if (comb_count > 1) - qsort (rela_comb, (size_t) comb_count, sizeof (int), ppc_elf_sort_rela); - } + qsort (rela_comb, (size_t) comb_count, sizeof (int), ppc_elf_sort_rela); + } - /* Enumerate each EOP region that overlaps this section. */ + /* Enumerate each EOP region that overlaps this section. */ end_section = isec->vma + isec->_cooked_size; dot = end_page = (isec->vma | (PAGESIZE - 1)) + 1; dot -= link_info->mpc860c0; section_modified = false; if (dot < isec->vma) /* Increment the start position if this section */ - dot = isec->vma; /* begins in the middle of its first EOP region. */ + dot = isec->vma; /* begins in the middle of its first EOP region. */ for (; dot < end_section; dot += PAGESIZE, end_page += PAGESIZE) { - /* Check each word in this EOP region. */ + /* Check each word in this EOP region. */ for (; dot < end_page; dot += 4) { bfd_vma isec_offset; @@ -1105,7 +1118,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) boolean skip, modified; /* Don't process this word if there is a relocation for it and - the relocation indicates the word is not a conditional branch. */ + the relocation indicates the word is not a conditional branch. */ skip = false; isec_offset = dot - isec->vma; for (; comb_curr<comb_count; ++comb_curr) @@ -1121,7 +1134,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) } if (skip) continue; - /* Check the current word for a problematic conditional branch. */ + /* Check the current word for a problematic conditional branch. */ #define BO0(insn) ((insn) & 0x02000000) #define BO2(insn) ((insn) & 0x00800000) #define BO4(insn) ((insn) & 0x00200000) @@ -1134,7 +1147,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) { bfd_vma target; /* This branch is predicted as "normal". - If this is a forward branch, it is problematic. */ + If this is a forward branch, it is problematic. */ target = insn & 0x0000Fffc; /*extract*/ target = (target ^ 0x8000) - 0x8000; /*sign extend*/ @@ -1155,7 +1168,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* This branch is predicted as not-taken. If this is a forward branch, it is problematic. Since we can't tell statically if it will branch forward, - always set the prediction bit. */ + always set the prediction bit. */ insn |= 0x00200000; /* set the prediction bit */ modified = true; } @@ -1168,7 +1181,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* This branch is predicted as not-taken. If this is a forward branch, it is problematic. Since we can't tell statically if it will branch forward, - always set the prediction bit. */ + always set the prediction bit. */ insn |= 0x00200000; /* set the prediction bit */ modified = true; } @@ -1225,7 +1238,6 @@ error_return: free (free_contents); return false; } - static reloc_howto_type * ppc_elf_reloc_type_lookup (abfd, code) @@ -1235,13 +1247,13 @@ ppc_elf_reloc_type_lookup (abfd, code) enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE; if (!ppc_elf_howto_table[R_PPC_ADDR32]) - /* Initialize howto table if needed */ + /* Initialize howto table if needed. */ ppc_elf_howto_init (); - switch ((int)code) + switch ((int) code) { default: - return (reloc_howto_type *)NULL; + return (reloc_howto_type *) NULL; case BFD_RELOC_NONE: ppc_reloc = R_PPC_NONE; break; case BFD_RELOC_32: ppc_reloc = R_PPC_ADDR32; break; @@ -1298,7 +1310,7 @@ ppc_elf_reloc_type_lookup (abfd, code) case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC_GNU_VTENTRY; break; } - return ppc_elf_howto_table[ (int)ppc_reloc ]; + return ppc_elf_howto_table[(int) ppc_reloc]; }; /* Set the howto pointer for a PowerPC ELF reloc. */ @@ -1309,7 +1321,8 @@ ppc_elf_info_to_howto (abfd, cache_ptr, dst) arelent *cache_ptr; Elf32_Internal_Rela *dst; { - if (!ppc_elf_howto_table[ R_PPC_ADDR32 ]) /* Initialize howto table if needed */ + if (!ppc_elf_howto_table[R_PPC_ADDR32]) + /* Initialize howto table if needed. */ ppc_elf_howto_init (); BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max); @@ -1354,7 +1367,7 @@ ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } -/* Function to set whether a module needs the -mrelocatable bit set. */ +/* Function to set whether a module needs the -mrelocatable bit set. */ static boolean ppc_elf_set_private_flags (abfd, flags) @@ -1399,21 +1412,8 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) boolean error; /* Check if we have the same endianess */ - if (ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - const char *msg; - - if (bfd_big_endian (ibfd)) - msg = _("%s: compiled for a big endian system and target is little endian"); - else - msg = _("%s: compiled for a little endian system and target is big endian"); - - (*_bfd_error_handler) (msg, bfd_get_filename (ibfd)); - - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -1475,7 +1475,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) error = true; (*_bfd_error_handler) (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), - bfd_get_filename (ibfd), (long)new_flags, (long)old_flags); + bfd_get_filename (ibfd), (long) new_flags, (long) old_flags); } if (error) @@ -1487,7 +1487,6 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) return true; } - /* Handle a PowerPC specific section when reading an object file. This is called when elfcode.h finds a section with an unknown type. */ @@ -1515,7 +1514,6 @@ ppc_elf_section_from_shdr (abfd, hdr, name) bfd_set_section_flags (abfd, newsect, flags); return true; } - /* Set up any other section flags and such that may be necessary. */ @@ -1533,7 +1531,6 @@ ppc_elf_fake_sections (abfd, shdr, asect) return true; } - /* Create a special linker section */ static elf_linker_section_t * @@ -1577,10 +1574,10 @@ ppc_elf_create_linker_section (abfd, info, which) default: (*_bfd_error_handler) (_("%s: Unknown special linker type %d"), bfd_get_filename (abfd), - (int)which); + (int) which); bfd_set_error (bfd_error_bad_value); - return (elf_linker_section_t *)0; + return (elf_linker_section_t *) 0; case LINKER_SECTION_SDATA: /* .sdata/.sbss section */ defaults.name = ".sdata"; @@ -1605,10 +1602,9 @@ ppc_elf_create_linker_section (abfd, info, which) return lsect; } - -/* If we have a non-zero sized .sbss2 or .PPC.EMB.sbss0 sections, we need to bump up - the number of section headers. */ +/* If we have a non-zero sized .sbss2 or .PPC.EMB.sbss0 sections, we + need to bump up the number of section headers. */ static int ppc_elf_additional_program_headers (abfd) @@ -1634,7 +1630,7 @@ ppc_elf_additional_program_headers (abfd) return ret; } -/* Modify the segment map if needed */ +/* Modify the segment map if needed. */ static boolean ppc_elf_modify_segment_map (abfd) @@ -1655,7 +1651,7 @@ ppc_elf_create_dynamic_sections (abfd, info) register asection *s; flagword flags; - if (!_bfd_elf_create_dynamic_sections(abfd, info)) + if (!_bfd_elf_create_dynamic_sections (abfd, info)) return false; flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -1708,7 +1704,6 @@ ppc_elf_adjust_dynamic_symbol (info, h) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))); - /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, when we know the address of the .got section. */ @@ -1716,9 +1711,7 @@ ppc_elf_adjust_dynamic_symbol (info, h) || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { if (! elf_hash_table (info)->dynamic_sections_created - || ((!info->shared || info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0) + || SYMBOL_CALLS_LOCAL (info, h) || (info->shared && h->plt.refcount <= 0)) { /* A PLT entry is not required/allowed when: @@ -1726,9 +1719,8 @@ ppc_elf_adjust_dynamic_symbol (info, h) 1. We are not using ld.so; because then the PLT entry can't be set up, so we can't use one. - 2. We know for certain that a symbol is defined in - this object, because this object is the application, - is linked with -Bsymbolic, or because the symbol is local. + 2. We know for certain that a call to this symbol + will go to this object. 3. GC has rendered the entry unused. Note, however, that in an executable all references to the @@ -1877,7 +1869,6 @@ ppc_elf_adjust_dynamic_symbol (info, h) return true; } - /* Set the sizes of the dynamic sections. */ @@ -1919,10 +1910,10 @@ ppc_elf_size_dynamic_sections (output_bfd, info) stripped from the output file below. */ static char *rela_sections[] = { ".rela.got", ".rela.sdata", ".rela.sdata2", ".rela.sbss", - (char *)0 }; + (char *) 0 }; char **p; - for (p = rela_sections; *p != (char *)0; p++) + for (p = rela_sections; *p != (char *) 0; p++) { s = bfd_get_section_by_name (dynobj, *p); if (s != NULL) @@ -1984,7 +1975,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info) asection *target; const char *outname; - /* Remember whether there are any relocation sections. */ + /* Remember whether there are any relocation sections. */ relocs = true; /* If this relocation section applies to a read only @@ -2057,12 +2048,12 @@ ppc_elf_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } return true; } - /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage @@ -2106,7 +2097,6 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) return false; } - if ((sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2)) == NULL) { sdata2 = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA2); @@ -2119,7 +2109,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) local_got_refcounts = elf_local_got_refcounts (abfd); sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; @@ -2250,7 +2240,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) ((*_bfd_error_handler) (_("%s: relocation %s cannot be used when making a shared object"), bfd_get_filename (abfd), "R_PPC_EMB_SDAI16")); - return false; + return false; } if (srelgot == NULL && (h != NULL || info->shared)) @@ -2319,7 +2309,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) ((*_bfd_error_handler) (_("%s: relocation %s cannot be used when making a shared object"), bfd_get_filename (abfd), - ppc_elf_howto_table[(int)ELF32_R_TYPE (rel->r_info)]->name)); + ppc_elf_howto_table[(int) ELF32_R_TYPE (rel->r_info)]->name)); return false; } break; @@ -2397,7 +2387,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) case R_PPC_REL14_BRNTAKEN: case R_PPC_REL32: if (h == NULL - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || SYMBOL_REFERENCES_LOCAL (info, h)) break; /* fall through */ @@ -2540,7 +2531,7 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) if (h->got.refcount > 0) h->got.refcount--; } - else + else if (local_got_refcounts != NULL) { if (local_got_refcounts[r_symndx] > 0) local_got_refcounts[r_symndx]--; @@ -2571,7 +2562,6 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) /* Hook called by the linker routine which adds symbols from an object file. We use it to put .comm items in .sbss, and not .bss. */ -/*ARGSUSED*/ static boolean ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd *abfd; @@ -2623,7 +2613,6 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) return true; } - /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ @@ -2691,7 +2680,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) 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) + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) == 0) sym->st_value = 0; } @@ -2719,8 +2708,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + && SYMBOL_REFERENCES_LOCAL (info, h)) { rela.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); rela.r_addend = (h->root.u.def.value @@ -2729,7 +2717,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } else { - BFD_ASSERT((h->got.offset & 1) == 0); + BFD_ASSERT ((h->got.offset & 1) == 0); bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_GLOB_DAT); rela.r_addend = 0; @@ -2785,7 +2773,6 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) return true; } - /* Finish up the dynamic sections. */ @@ -2873,7 +2860,6 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) return true; } - /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -2934,11 +2920,12 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n", bfd_get_filename (input_bfd), bfd_section_name(input_bfd, input_section), - (long)input_section->reloc_count, + (long) input_section->reloc_count, (info->relocateable) ? " (relocatable)" : ""); #endif - if (!ppc_elf_howto_table[ R_PPC_ADDR32 ]) /* Initialize howto table if needed */ + if (!ppc_elf_howto_table[R_PPC_ADDR32]) + /* Initialize howto table if needed. */ ppc_elf_howto_init (); local_got_offsets = elf_local_got_offsets (input_bfd); @@ -2956,27 +2943,29 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma offset = rel->r_offset; bfd_vma addend = rel->r_addend; bfd_reloc_status_type r = bfd_reloc_other; - Elf_Internal_Sym *sym = (Elf_Internal_Sym *)0; - asection *sec = (asection *)0; - struct elf_link_hash_entry *h = (struct elf_link_hash_entry *)0; - const char *sym_name = (const char *)0; + Elf_Internal_Sym *sym = (Elf_Internal_Sym *) 0; + asection *sec = (asection *) 0; + struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) 0; + const char *sym_name = (const char *) 0; reloc_howto_type *howto; unsigned long r_symndx; bfd_vma relocation; + int will_become_local; /* Unknown relocation handling */ - if ((unsigned)r_type >= (unsigned)R_PPC_max || !ppc_elf_howto_table[(int)r_type]) + if ((unsigned) r_type >= (unsigned) R_PPC_max + || !ppc_elf_howto_table[(int) r_type]) { (*_bfd_error_handler) (_("%s: unknown relocation type %d"), bfd_get_filename (input_bfd), - (int)r_type); + (int) r_type); bfd_set_error (bfd_error_bad_value); ret = false; continue; } - howto = ppc_elf_howto_table[(int)r_type]; + howto = ppc_elf_howto_table[(int) r_type]; r_symndx = ELF32_R_SYM (rel->r_info); if (info->relocateable) @@ -2988,7 +2977,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; - if ((unsigned)ELF_ST_TYPE (sym->st_info) == STT_SECTION) + if ((unsigned) ELF_ST_TYPE (sym->st_info) == STT_SECTION) { sec = local_sections[r_symndx]; addend = rel->r_addend += sec->output_offset + sym->st_value; @@ -2998,10 +2987,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, #ifdef DEBUG fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n", howto->name, - (int)r_type, + (int) r_type, r_symndx, - (long)offset, - (long)addend); + (long) offset, + (long) addend); #endif continue; } @@ -3016,6 +3005,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); + /* Relocs to local symbols are always resolved. */ + will_become_local = 1; } else { @@ -3024,11 +3015,17 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; sym_name = h->root.root.string; + + /* Can this relocation be resolved immediately? */ + will_become_local = SYMBOL_REFERENCES_LOCAL (info, h); + if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; - if ((r_type == R_PPC_PLT32 + if (((r_type == R_PPC_PLT32 + || r_type == R_PPC_PLTREL24) + && splt != NULL && h->plt.offset != (bfd_vma) -1) || (r_type == R_PPC_LOCAL24PC && sec->output_section == NULL) @@ -3037,20 +3034,17 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_PPC_GOT16_HI || r_type == R_PPC_GOT16_HA) && elf_hash_table (info)->dynamic_sections_created - && (! info->shared - || (! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + && (! info->shared || ! will_become_local)) || (info->shared - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) + && ! will_become_local && ((input_section->flags & SEC_ALLOC) != 0 /* Testing SEC_DEBUGGING here may be wrong. It's here to avoid a crash when generating a shared library with DWARF debugging information. */ - || (input_section->flags & SEC_DEBUGGING) != 0) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (r_type == R_PPC_ADDR32 || r_type == R_PPC_ADDR24 || r_type == R_PPC_ADDR16 @@ -3060,7 +3054,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_PPC_ADDR14 || r_type == R_PPC_ADDR14_BRTAKEN || r_type == R_PPC_ADDR14_BRNTAKEN - || r_type == R_PPC_PLTREL24 || r_type == R_PPC_COPY || r_type == R_PPC_GLOB_DAT || r_type == R_PPC_JMP_SLOT @@ -3094,13 +3087,13 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = 0; } else if (sec->output_section == NULL) - { + { (*_bfd_error_handler) (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"), bfd_get_filename (input_bfd), h->root.root.string, bfd_get_section_name (input_bfd, input_section)); relocation = 0; - } + } else relocation = (h->root.u.def.value + sec->output_section->vma @@ -3108,13 +3101,12 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else if (h->root.type == bfd_link_hash_undefweak) relocation = 0; - else if (info->shared && !info->symbolic - && !info->no_undefined + else if (info->shared && !info->symbolic && !info->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { - if (! (*info->callbacks->undefined_symbol)(info, + if (! (*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, @@ -3127,19 +3119,19 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } - switch ((int)r_type) + switch ((int) r_type) { default: (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"), bfd_get_filename (input_bfd), - (int)r_type, sym_name); + (int) r_type, sym_name); bfd_set_error (bfd_error_bad_value); ret = false; continue; /* Relocations that need no special processing. */ - case (int)R_PPC_LOCAL24PC: + case (int) R_PPC_LOCAL24PC: /* It makes no sense to point a local relocation at a symbol not in this object. */ if (h != NULL @@ -3160,28 +3152,29 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocations that may need to be propagated if this is a shared object. */ - case (int)R_PPC_REL24: - case (int)R_PPC_REL32: - case (int)R_PPC_REL14: + case (int) R_PPC_REL24: + case (int) R_PPC_REL32: + case (int) R_PPC_REL14: /* If these relocations are not to a named symbol, they can be handled right here, no need to bother the dynamic linker. */ if (h == NULL - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || SYMBOL_REFERENCES_LOCAL (info, h)) break; /* fall through */ /* Relocations that always need to be propagated if this is a shared object. */ - case (int)R_PPC_NONE: - case (int)R_PPC_ADDR32: - case (int)R_PPC_ADDR24: - case (int)R_PPC_ADDR16: - case (int)R_PPC_ADDR16_LO: - case (int)R_PPC_ADDR16_HI: - case (int)R_PPC_ADDR16_HA: - case (int)R_PPC_ADDR14: - case (int)R_PPC_UADDR32: - case (int)R_PPC_UADDR16: + case (int) R_PPC_NONE: + case (int) R_PPC_ADDR32: + case (int) R_PPC_ADDR24: + case (int) R_PPC_ADDR16: + case (int) R_PPC_ADDR16_LO: + case (int) R_PPC_ADDR16_HI: + case (int) R_PPC_ADDR16_HA: + case (int) R_PPC_ADDR14: + case (int) R_PPC_UADDR32: + case (int) R_PPC_UADDR16: if (info->shared) { Elf_Internal_Rela outrel; @@ -3241,12 +3234,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, memset (&outrel, 0, sizeof outrel); /* h->dynindx may be -1 if this symbol was marked to become local. */ - else if (h != NULL - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + else if (! will_become_local) { - BFD_ASSERT (h->dynindx != -1); outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; } @@ -3283,11 +3272,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT(indx > 0); + BFD_ASSERT (indx > 0); #ifdef DEBUG if (indx <= 0) { - printf("indx=%d section=%s flags=%08x name=%s\n", + printf ("indx=%d section=%s flags=%08x name=%s\n", indx, osec->name, osec->flags, h->root.root.string); } @@ -3328,8 +3317,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* branch taken prediction relocations */ - case (int)R_PPC_ADDR14_BRTAKEN: - case (int)R_PPC_REL14_BRTAKEN: + case (int) R_PPC_ADDR14_BRTAKEN: + case (int) R_PPC_REL14_BRTAKEN: insn = bfd_get_32 (output_bfd, contents + offset); if ((relocation - offset) & 0x8000) insn &= ~BRANCH_PREDICT_BIT; @@ -3339,8 +3328,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* branch not taken predicition relocations */ - case (int)R_PPC_ADDR14_BRNTAKEN: - case (int)R_PPC_REL14_BRNTAKEN: + case (int) R_PPC_ADDR14_BRNTAKEN: + case (int) R_PPC_REL14_BRNTAKEN: insn = bfd_get_32 (output_bfd, contents + offset); if ((relocation - offset) & 0x8000) insn |= BRANCH_PREDICT_BIT; @@ -3350,10 +3339,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* GOT16 relocations */ - case (int)R_PPC_GOT16: - case (int)R_PPC_GOT16_LO: - case (int)R_PPC_GOT16_HI: - case (int)R_PPC_GOT16_HA: + case (int) R_PPC_GOT16: + case (int) R_PPC_GOT16_LO: + case (int) R_PPC_GOT16_HI: + case (int) R_PPC_GOT16_HA: /* Relocation is to the entry for this symbol in the global offset table. */ BFD_ASSERT (sgot != NULL); @@ -3367,8 +3356,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (! elf_hash_table (info)->dynamic_sections_created || (info->shared - && (info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && SYMBOL_REFERENCES_LOCAL (info, h))) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -3441,7 +3429,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* Indirect .sdata relocation */ - case (int)R_PPC_EMB_SDAI16: + case (int) R_PPC_EMB_SDAI16: BFD_ASSERT (sdata != NULL); relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info, sdata, h, relocation, rel, @@ -3449,7 +3437,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* Indirect .sdata2 relocation */ - case (int)R_PPC_EMB_SDA2I16: + case (int) R_PPC_EMB_SDA2I16: BFD_ASSERT (sdata2 != NULL); relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info, sdata2, h, relocation, rel, @@ -3460,8 +3448,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, section, not the actual VMA. This is appropriate when generating an embedded ELF object, for which the .got section acts like the AIX .toc section. */ - case (int)R_PPC_TOC16: /* phony GOT16 relocations */ - BFD_ASSERT (sec != (asection *)0); + case (int) R_PPC_TOC16: /* phony GOT16 relocations */ + BFD_ASSERT (sec != (asection *) 0); BFD_ASSERT (bfd_is_und_section (sec) || strcmp (bfd_get_section_name (abfd, sec), ".got") == 0 || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0) @@ -3469,7 +3457,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, addend -= sec->output_section->vma + sec->output_offset + 0x8000; break; - case (int)R_PPC_PLTREL24: + case (int) R_PPC_PLTREL24: /* Relocation is to the entry for this symbol in the procedure linkage table. */ BFD_ASSERT (h != NULL); @@ -3486,14 +3474,14 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); - break; + break; /* relocate against _SDA_BASE_ */ - case (int)R_PPC_SDAREL16: + case (int) R_PPC_SDAREL16: { const char *name; - BFD_ASSERT (sec != (asection *)0); + BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_section); if (strcmp (name, ".sdata") != 0 && strcmp (name, ".sbss") != 0) @@ -3501,7 +3489,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_get_filename (input_bfd), sym_name, - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, name); } addend -= (sdata->sym_hash->root.u.def.value @@ -3510,22 +3498,21 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; - /* relocate against _SDA2_BASE_ */ - case (int)R_PPC_EMB_SDA2REL: + case (int) R_PPC_EMB_SDA2REL: { const char *name; - BFD_ASSERT (sec != (asection *)0); + BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_section); if (strcmp (name, ".sdata2") != 0 && strcmp (name, ".sbss2") != 0) { (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_get_filename (input_bfd), sym_name, - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, name); - + bfd_set_error (bfd_error_bad_value); ret = false; continue; @@ -3536,15 +3523,14 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; - /* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */ - case (int)R_PPC_EMB_SDA21: - case (int)R_PPC_EMB_RELSDA: + case (int) R_PPC_EMB_SDA21: + case (int) R_PPC_EMB_RELSDA: { const char *name; int reg; - BFD_ASSERT (sec != (asection *)0); + BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_section); if (strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0) { @@ -3554,7 +3540,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, + sdata->sym_hash->root.u.def.section->output_offset); } - else if (strcmp (name, ".sdata2") == 0 || strcmp (name, ".sbss2") == 0) + else if (strcmp (name, ".sdata2") == 0 + || strcmp (name, ".sbss2") == 0) { reg = 2; addend -= (sdata2->sym_hash->root.u.def.value @@ -3562,7 +3549,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, + sdata2->sym_hash->root.u.def.section->output_offset); } - else if (strcmp (name, ".PPC.EMB.sdata0") == 0 || strcmp (name, ".PPC.EMB.sbss0") == 0) + else if (strcmp (name, ".PPC.EMB.sdata0") == 0 + || strcmp (name, ".PPC.EMB.sbss0") == 0) { reg = 0; } @@ -3572,7 +3560,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_get_filename (input_bfd), sym_name, - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, name); bfd_set_error (bfd_error_bad_value); @@ -3590,75 +3578,74 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* Relocate against the beginning of the section */ - case (int)R_PPC_SECTOFF: - case (int)R_PPC_SECTOFF_LO: - case (int)R_PPC_SECTOFF_HI: - BFD_ASSERT (sec != (asection *)0); + case (int) R_PPC_SECTOFF: + case (int) R_PPC_SECTOFF_LO: + case (int) R_PPC_SECTOFF_HI: + BFD_ASSERT (sec != (asection *) 0); addend -= sec->output_section->vma; break; - case (int)R_PPC_SECTOFF_HA: - BFD_ASSERT (sec != (asection *)0); + case (int) R_PPC_SECTOFF_HA: + BFD_ASSERT (sec != (asection *) 0); addend -= sec->output_section->vma; addend += ((relocation + addend) & 0x8000) << 1; break; /* Negative relocations */ - case (int)R_PPC_EMB_NADDR32: - case (int)R_PPC_EMB_NADDR16: - case (int)R_PPC_EMB_NADDR16_LO: - case (int)R_PPC_EMB_NADDR16_HI: - addend -= 2*relocation; + case (int) R_PPC_EMB_NADDR32: + case (int) R_PPC_EMB_NADDR16: + case (int) R_PPC_EMB_NADDR16_LO: + case (int) R_PPC_EMB_NADDR16_HI: + addend -= 2 * relocation; break; - case (int)R_PPC_EMB_NADDR16_HA: - addend -= 2*relocation; + case (int) R_PPC_EMB_NADDR16_HA: + addend -= 2 * relocation; addend += ((relocation + addend) & 0x8000) << 1; break; /* NOP relocation that prevents garbage collecting linkers from omitting a reference. */ - case (int)R_PPC_EMB_MRKREF: + case (int) R_PPC_EMB_MRKREF: continue; - case (int)R_PPC_COPY: - case (int)R_PPC_GLOB_DAT: - case (int)R_PPC_JMP_SLOT: - case (int)R_PPC_RELATIVE: - case (int)R_PPC_PLT32: - case (int)R_PPC_PLTREL32: - case (int)R_PPC_PLT16_LO: - case (int)R_PPC_PLT16_HI: - case (int)R_PPC_PLT16_HA: - case (int)R_PPC_EMB_RELSEC16: - case (int)R_PPC_EMB_RELST_LO: - case (int)R_PPC_EMB_RELST_HI: - case (int)R_PPC_EMB_RELST_HA: - case (int)R_PPC_EMB_BIT_FLD: + case (int) R_PPC_COPY: + case (int) R_PPC_GLOB_DAT: + case (int) R_PPC_JMP_SLOT: + case (int) R_PPC_RELATIVE: + case (int) R_PPC_PLT32: + case (int) R_PPC_PLTREL32: + case (int) R_PPC_PLT16_LO: + case (int) R_PPC_PLT16_HI: + case (int) R_PPC_PLT16_HA: + case (int) R_PPC_EMB_RELSEC16: + case (int) R_PPC_EMB_RELST_LO: + case (int) R_PPC_EMB_RELST_HI: + case (int) R_PPC_EMB_RELST_HA: + case (int) R_PPC_EMB_BIT_FLD: (*_bfd_error_handler) (_("%s: Relocation %s is not yet supported for symbol %s."), bfd_get_filename (input_bfd), - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, sym_name); bfd_set_error (bfd_error_invalid_operation); ret = false; continue; - case (int)R_PPC_GNU_VTINHERIT: - case (int)R_PPC_GNU_VTENTRY: + case (int) R_PPC_GNU_VTINHERIT: + case (int) R_PPC_GNU_VTENTRY: /* These are no-ops in the end. */ continue; } - #ifdef DEBUG fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n", howto->name, - (int)r_type, + (int) r_type, sym_name, r_symndx, - (long)offset, - (long)addend); + (long) offset, + (long) addend); #endif r = _bfd_final_link_relocate (howto, @@ -3702,7 +3689,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, name = bfd_section_name (input_bfd, sec); } - if (! (*info->callbacks->reloc_overflow)(info, + if (! (*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, @@ -3721,7 +3708,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, return ret; } - #define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec #define TARGET_LITTLE_NAME "elf32-powerpcle" diff --git a/contrib/binutils/bfd/elf32-sparc.c b/contrib/binutils/bfd/elf32-sparc.c index 1c8d0ba..4e9c6c2 100644 --- a/contrib/binutils/bfd/elf32-sparc.c +++ b/contrib/binutils/bfd/elf32-sparc.c @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" #include "elf/sparc.h" +#include "opcode/sparc.h" static reloc_howto_type *elf32_sparc_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); @@ -36,6 +37,8 @@ static boolean elf32_sparc_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean elf32_sparc_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf32_sparc_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean elf32_sparc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); @@ -126,7 +129,6 @@ static reloc_howto_type elf32_sparc_vtinherit_howto = static reloc_howto_type elf32_sparc_vtentry_howto = HOWTO (R_SPARC_GNU_VTENTRY, 0,2,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_SPARC_GNU_VTENTRY", false,0,0, false); - struct elf_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; unsigned char elf_reloc_val; @@ -185,7 +187,7 @@ elf32_sparc_reloc_type_lookup (abfd, code) bfd_reloc_code_real_type code; { unsigned int i; - + switch (code) { case BFD_RELOC_VTABLE_INHERIT: @@ -1016,7 +1018,12 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + /* FIXME: This should be a call to bfd_alloc not bfd_zalloc. + Unused entries should be reclaimed before the section's contents + are written out, but at the moment this does not happen. Thus in + order to prevent writing out garbage, we initialise the section's + contents to zero. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -1053,12 +1060,28 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } return true; } +#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) +#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) + +static boolean +elf32_sparc_relax_section (abfd, section, link_info, again) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; + boolean *again; +{ + *again = false; + SET_SEC_DO_RELAX (section); + return true; +} + /* Relocate a SPARC ELF section. */ static boolean @@ -1113,7 +1136,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == R_SPARC_GNU_VTINHERIT + if (r_type == R_SPARC_GNU_VTINHERIT || r_type == R_SPARC_GNU_VTENTRY) continue; @@ -1518,6 +1541,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; } + r = bfd_reloc_continue; if (r_type == R_SPARC_WDISP16) { bfd_vma x; @@ -1549,12 +1573,101 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_putl32 (/*input_bfd,*/ x, contents + rel->r_offset); r = bfd_reloc_ok; } - else + else if ((r_type == R_SPARC_WDISP30 || r_type == R_SPARC_WPLT30) + && SEC_DO_RELAX (input_section) + && rel->r_offset + 4 < input_section->_raw_size) + { +#define G0 0 +#define O7 15 +#define XCC (2 << 20) +#define COND(x) (((x)&0xf)<<25) +#define CONDA COND(0x8) +#define INSN_BPA (F2(0,1) | CONDA | BPRED | XCC) +#define INSN_BA (F2(0,2) | CONDA) +#define INSN_OR F3(2, 0x2, 0) +#define INSN_NOP F2(0,4) + + bfd_vma x, y; + + /* If the instruction is a call with either: + restore + arithmetic instruction with rd == %o7 + where rs1 != %o7 and rs2 if it is register != %o7 + then we can optimize if the call destination is near + by changing the call into a branch always. */ + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + y = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); + if ((x & OP(~0)) == OP(1) && (y & OP(~0)) == OP(2)) + { + if (((y & OP3(~0)) == OP3(0x3d) /* restore */ + || ((y & OP3(0x28)) == 0 /* arithmetic */ + && (y & RD(~0)) == RD(O7))) + && (y & RS1(~0)) != RS1(O7) + && ((y & F3I(~0)) + || (y & RS2(~0)) != RS2(O7))) + { + bfd_vma reloc; + + reloc = relocation + rel->r_addend - rel->r_offset; + reloc -= (input_section->output_section->vma + + input_section->output_offset); + + /* Ensure the reloc fits into simm22. */ + if ((reloc & 3) == 0 + && ((reloc & ~(bfd_vma)0x7fffff) == 0 + || ((reloc | 0x7fffff) == ~(bfd_vma)0))) + { + reloc >>= 2; + + /* Check whether it fits into simm19 on v9. */ + if (((reloc & 0x3c0000) == 0 + || (reloc & 0x3c0000) == 0x3c0000) + && (elf_elfheader (output_bfd)->e_flags & EF_SPARC_32PLUS)) + x = INSN_BPA | (reloc & 0x7ffff); /* ba,pt %xcc */ + else + x = INSN_BA | (reloc & 0x3fffff); /* ba */ + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + if (rel->r_offset >= 4 + && (y & (0xffffffff ^ RS1(~0))) + == (INSN_OR | RD(O7) | RS2(G0))) + { + bfd_vma z; + unsigned int reg; + + z = bfd_get_32 (input_bfd, + contents + rel->r_offset - 4); + if ((z & (0xffffffff ^ RD(~0))) + != (INSN_OR | RS1(O7) | RS2(G0))) + break; + + /* The sequence was + or %o7, %g0, %rN + call foo + or %rN, %g0, %o7 + + If call foo was replaced with ba, replace + or %rN, %g0, %o7 with nop. */ + + reg = (y & RS1(~0)) >> 14; + if (reg != ((z & RD(~0)) >> 25) + || reg == G0 || reg == O7) + break; + + bfd_put_32 (input_bfd, INSN_NOP, + contents + rel->r_offset + 4); + } + + } + } + } + } + + if (r == bfd_reloc_continue) r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, rel->r_addend); - if (r != bfd_reloc_ok) { switch (r) @@ -1842,33 +1955,6 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd) error = false; -#if 0 - /* ??? The native linker doesn't do this so we can't (otherwise gcc would - have to know which linker is being used). Instead, the native linker - bumps up the architecture level when it has to. However, I still think - warnings like these are good, so it would be nice to have them turned on - by some option. */ - - /* If the output machine is normal sparc, we can't allow v9 input files. */ - if (bfd_get_mach (obfd) == bfd_mach_sparc - && (bfd_get_mach (ibfd) == bfd_mach_sparc_v8plus - || bfd_get_mach (ibfd) == bfd_mach_sparc_v8plusa)) - { - error = true; - (*_bfd_error_handler) - (_("%s: compiled for a v8plus system and target is v8"), - bfd_get_filename (ibfd)); - } - /* If the output machine is v9, we can't allow v9+vis input files. */ - if (bfd_get_mach (obfd) == bfd_mach_sparc_v8plus - && bfd_get_mach (ibfd) == bfd_mach_sparc_v8plusa) - { - error = true; - (*_bfd_error_handler) - (_("%s: compiled for a v8plusa system and target is v8plus"), - bfd_get_filename (ibfd)); - } -#else if (bfd_get_mach (ibfd) >= bfd_mach_sparc_v9) { error = true; @@ -1881,7 +1967,6 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd) if (bfd_get_mach (obfd) < bfd_get_mach (ibfd)) bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd)); } -#endif if (((elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA) != previous_ibfd_e_flags) @@ -1911,7 +1996,10 @@ elf32_sparc_object_p (abfd) { if (elf_elfheader (abfd)->e_machine == EM_SPARC32PLUS) { - if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) + if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3) + return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, + bfd_mach_sparc_v8plusb); + else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc_v8plusa); else if (elf_elfheader (abfd)->e_flags & EF_SPARC_32PLUS) @@ -1949,6 +2037,12 @@ elf32_sparc_final_write_processing (abfd, linker) elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK; elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1; break; + case bfd_mach_sparc_v8plusb : + elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS; + elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK; + elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1 + | EF_SPARC_SUN_US3; + break; case bfd_mach_sparc_sparclite_le : elf_elfheader (abfd)->e_machine = EM_SPARC; elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA; @@ -1967,6 +2061,7 @@ elf32_sparc_final_write_processing (abfd, linker) #define ELF_MAXPAGESIZE 0x10000 #define bfd_elf32_bfd_reloc_type_lookup elf32_sparc_reloc_type_lookup +#define bfd_elf32_bfd_relax_section elf32_sparc_relax_section #define elf_info_to_howto elf32_sparc_info_to_howto #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections diff --git a/contrib/binutils/bfd/elf32-v850.c b/contrib/binutils/bfd/elf32-v850.c index 4fe28fc..e71866c 100644 --- a/contrib/binutils/bfd/elf32-v850.c +++ b/contrib/binutils/bfd/elf32-v850.c @@ -17,12 +17,9 @@ 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. */ - - /* XXX FIXME: This code is littered with 32bit int, 16bit short, 8bit char dependencies. As is the gas & simulator code or the v850. */ - #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" @@ -32,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* sign-extend a 24-bit number */ #define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000) - + static reloc_howto_type *v850_elf_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void v850_elf_info_to_howto_rel @@ -103,7 +100,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0, /* dst_mask */ false), /* pcrel_offset */ - /* A PC relative 9 bit branch. */ + /* A PC relative 9 bit branch. */ HOWTO (R_V850_9_PCREL, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -118,7 +115,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - /* A PC relative 22 bit branch. */ + /* A PC relative 22 bit branch. */ HOWTO (R_V850_22_PCREL, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -312,7 +309,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0x7f, /* src_mask */ 0x7f, /* dst_mask */ false), /* pcrel_offset */ - + /* 7 bit offset from the tiny data area pointer. */ HOWTO (R_V850_TDA_7_7_OFFSET, /* type */ 0, /* rightshift */ @@ -462,7 +459,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ - + }; /* Map BFD reloc types to V850 ELF reloc types. */ @@ -504,7 +501,6 @@ static const struct v850_elf_reloc_map v850_elf_reloc_map[] = { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY }, }; - /* Map a bfd relocation into the appropriate howto structure */ static reloc_howto_type * @@ -521,14 +517,13 @@ v850_elf_reloc_type_lookup (abfd, code) if (v850_elf_reloc_map[i].bfd_reloc_val == code) { BFD_ASSERT (v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val].type == v850_elf_reloc_map[i].elf_reloc_val); - + return & v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val]; } } return NULL; } - /* Set the howto pointer for an V850 ELF reloc. */ static void @@ -544,7 +539,7 @@ v850_elf_info_to_howto_rel (abfd, cache_ptr, dst) cache_ptr->howto = &v850_elf_howto_table[r_type]; } -/* Set the howto pointer for a V850 ELF reloc (type RELA). */ +/* Set the howto pointer for a V850 ELF reloc (type RELA). */ static void v850_elf_info_to_howto_rela (abfd, cache_ptr, dst) bfd * abfd ATTRIBUTE_UNUSED; @@ -557,7 +552,6 @@ v850_elf_info_to_howto_rela (abfd, cache_ptr, dst) BFD_ASSERT (r_type < (unsigned int) R_V850_max); cache_ptr->howto = &v850_elf_howto_table[r_type]; } - /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage @@ -644,14 +638,14 @@ v850_elf_check_relocs (abfd, info, sec, relocs) other = V850_OTHER_SDA; common = ".scommon"; goto small_data_common; - + case R_V850_ZDA_16_16_SPLIT_OFFSET: case R_V850_ZDA_16_16_OFFSET: case R_V850_ZDA_15_16_OFFSET: other = V850_OTHER_ZDA; common = ".zcommon"; goto small_data_common; - + case R_V850_TDA_4_5_OFFSET: case R_V850_TDA_4_4_OFFSET: case R_V850_TDA_6_8_OFFSET: @@ -760,21 +754,21 @@ remember_hi16s_reloc (abfd, addend, address) bfd_byte * address; { hi16s_location * entry = NULL; - + /* Find a free structure. */ if (free_hi16s == NULL) free_hi16s = (hi16s_location *) bfd_zalloc (abfd, sizeof (* free_hi16s)); entry = free_hi16s; free_hi16s = free_hi16s->next; - + entry->addend = addend; entry->address = address; entry->counter = hi16s_counter ++; entry->found = false; entry->next = previous_hi16s; previous_hi16s = entry; - + /* Cope with wrap around of our counter. */ if (hi16s_counter == 0) { @@ -784,7 +778,7 @@ remember_hi16s_reloc (abfd, addend, address) hi16s_counter = 0x10000; } - + return; } @@ -798,7 +792,7 @@ find_remembered_hi16s_reloc (addend, already_found) hi16s_location * previous = NULL; hi16s_location * prev; bfd_byte * addr; - + /* Search the table. Record the most recent entry that matches. */ for (entry = previous_hi16s; entry; entry = entry->next) { @@ -808,7 +802,7 @@ find_remembered_hi16s_reloc (addend, already_found) previous = prev; match = entry; } - + prev = entry; } @@ -824,9 +818,9 @@ find_remembered_hi16s_reloc (addend, already_found) /* Note that this entry has now been used. */ match->found = true; - + return addr; -} +} /* FIXME: The code here probably ought to be removed and the code in reloc.c allowed to do its stuff instead. At least for most of the relocs, anwyay. */ @@ -839,62 +833,62 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) { unsigned long insn; bfd_signed_vma saddend = (bfd_signed_vma) addend; - + switch (r_type) { default: /* fprintf (stderr, "reloc type %d not SUPPORTED\n", r_type ); */ return bfd_reloc_notsupported; - + case R_V850_32: bfd_put_32 (abfd, addend, address); return bfd_reloc_ok; - + case R_V850_22_PCREL: if (saddend > 0x1fffff || saddend < -0x200000) return bfd_reloc_overflow; - + if ((addend % 2) != 0) return bfd_reloc_dangerous; - + insn = bfd_get_32 (abfd, address); insn &= ~0xfffe003f; insn |= (((addend & 0xfffe) << 16) | ((addend & 0x3f0000) >> 16)); bfd_put_32 (abfd, insn, address); return bfd_reloc_ok; - + case R_V850_9_PCREL: if (saddend > 0xff || saddend < -0x100) return bfd_reloc_overflow; - + if ((addend % 2) != 0) return bfd_reloc_dangerous; - + insn = bfd_get_16 (abfd, address); insn &= ~ 0xf870; insn |= ((addend & 0x1f0) << 7) | ((addend & 0x0e) << 3); break; - + case R_V850_HI16: addend += (bfd_get_16 (abfd, address) << 16); addend = (addend >> 16); insn = addend; break; - + case R_V850_HI16_S: /* Remember where this relocation took place. */ remember_hi16s_reloc (abfd, addend, address); addend += (bfd_get_16 (abfd, address) << 16); addend = (addend >> 16) + ((addend & 0x8000) != 0); - - /* This relocation cannot overflow. */ + + /* This relocation cannot overflow. */ if (addend > 0x7fff) addend = 0; - + insn = addend; break; - + case R_V850_LO16: /* Calculate the sum of the value stored in the instruction and the addend and check for overflow from the low 16 bits into the high @@ -972,7 +966,6 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) ------------ 0x00116fff = fred + 0x10ffff = 0x7000 + 0x10ffff - Overflow can also occur if the computation carries into the 16th bit and it also results in the 15th bit having the same value as the 15th bit of the original value. What happens is that the HI16S reloc @@ -1007,7 +1000,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) + 0x00006fff ------------ 0x00006fff but 'fred + 0x7000' = 0x00016fff - + Note - there is no need to change anything if a carry occurs, and the 15th bit changes its value from being set to being clear, as the HI16S reloc will have already added in 1 to the high part for us: @@ -1046,7 +1039,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) #define BIT15_SET(x) ((x) & 0x8000) #define OVERFLOWS(a,i) ((((a) & 0xffff) + (i)) > 0xffff) - + if ((BIT15_SET (result) && ! BIT15_SET (addend)) || (OVERFLOWS (addend, insn) && ((! BIT15_SET (insn)) || (BIT15_SET (addend))))) @@ -1054,7 +1047,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) boolean already_updated; bfd_byte * hi16s_address = find_remembered_hi16s_reloc (addend, & already_updated); - + /* Amend the matching HI16_S relocation. */ if (hi16s_address != NULL) { @@ -1071,7 +1064,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) return bfd_reloc_overflow; } } - + /* Do not complain if value has top bit set, as this has been anticipated. */ insn = result & 0xffff; break; @@ -1081,7 +1074,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) addend += (char) bfd_get_8 (abfd, address); saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7f || saddend < -0x80) return bfd_reloc_overflow; @@ -1090,150 +1083,150 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) case R_V850_CALLT_16_16_OFFSET: addend += bfd_get_16 (abfd, address); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xffff || saddend < 0) return bfd_reloc_overflow; insn = addend; break; - + case R_V850_16: - /* drop through */ + /* drop through */ case R_V850_SDA_16_16_OFFSET: case R_V850_ZDA_16_16_OFFSET: case R_V850_TDA_16_16_OFFSET: addend += bfd_get_16 (abfd, address); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7fff || saddend < -0x8000) return bfd_reloc_overflow; insn = addend; break; - + case R_V850_SDA_15_16_OFFSET: case R_V850_ZDA_15_16_OFFSET: insn = bfd_get_16 (abfd, address); addend += (insn & 0xfffe); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7ffe || saddend < -0x8000) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn = (addend & ~1) | (insn & 1); break; - + case R_V850_TDA_6_8_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0x7e) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xfc || saddend < 0) return bfd_reloc_overflow; - + if (addend & 3) return bfd_reloc_dangerous; - + insn &= 0xff81; insn |= (addend >> 1); break; - + case R_V850_TDA_7_8_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0x7f) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xfe || saddend < 0) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn &= 0xff80; insn |= (addend >> 1); break; - + case R_V850_TDA_7_7_OFFSET: insn = bfd_get_16 (abfd, address); addend += insn & 0x7f; - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7f || saddend < 0) return bfd_reloc_overflow; - + insn &= 0xff80; insn |= addend; break; - + case R_V850_TDA_4_5_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0xf) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x1e || saddend < 0) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn &= 0xfff0; insn |= (addend >> 1); break; - + case R_V850_TDA_4_4_OFFSET: insn = bfd_get_16 (abfd, address); addend += insn & 0xf; - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xf || saddend < 0) return bfd_reloc_overflow; - + insn &= 0xfff0; insn |= addend; break; - + case R_V850_ZDA_16_16_SPLIT_OFFSET: case R_V850_SDA_16_16_SPLIT_OFFSET: insn = bfd_get_32 (abfd, address); addend += ((insn & 0xfffe0000) >> 16) + ((insn & 0x20) >> 5); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7fff || saddend < -0x8000) return bfd_reloc_overflow; - + insn &= 0x0001ffdf; insn |= (addend & 1) << 5; insn |= (addend & ~1) << 16; - + bfd_put_32 (abfd, insn, address); return bfd_reloc_ok; - + case R_V850_CALLT_6_7_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0x3f) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7e || saddend < 0) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn &= 0xff80; insn |= (addend >> 1); break; @@ -1247,7 +1240,6 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) bfd_put_16 (abfd, insn, address); return bfd_reloc_ok; } - /* Insert the addend into the instruction. */ static bfd_reloc_status_type @@ -1261,7 +1253,7 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) char ** err ATTRIBUTE_UNUSED; { long relocation; - + /* If there is an output BFD, and the symbol is not a section name (which is only defined at final link time), and either we are not putting the addend into the instruction @@ -1275,13 +1267,13 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) reloc->address += isection->output_offset; return bfd_reloc_ok; } -#if 0 +#if 0 else if (obfd != NULL) { return bfd_reloc_continue; } #endif - + /* Catch relocs involving undefined symbols. */ if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0 @@ -1293,37 +1285,51 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) /* Is the address of the relocation really within the section? */ if (reloc->address > isection->_cooked_size) return bfd_reloc_outofrange; - + /* Work out which section the relocation is targetted at and the initial relocation command value. */ - + /* Get symbol value. (Common symbols are special.) */ if (bfd_is_com_section (symbol->section)) relocation = 0; else relocation = symbol->value; - + /* Convert input-section-relative symbol value to absolute + addend. */ relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; relocation += reloc->addend; - + +#if 0 /* Since this reloc is going to be processed later on, we should + not make it pc-relative here. To test this, try assembling and + linking this program: + + .text + .globl _start + nop + _start: + jr foo + + .section ".foo","ax" + nop + foo: + nop + */ if (reloc->howto->pc_relative == true) { /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ relocation -= isection->output_section->vma + isection->output_offset; - + /* Deal with pcrel_offset */ relocation -= reloc->address; } +#endif - reloc->addend = relocation; + reloc->addend = relocation; return bfd_reloc_ok; } - -/*ARGSUSED*/ static boolean v850_elf_is_local_label_name (abfd, name) bfd * abfd ATTRIBUTE_UNUSED; @@ -1332,7 +1338,6 @@ v850_elf_is_local_label_name (abfd, name) return ( (name[0] == '.' && (name[1] == 'L' || name[1] == '.')) || (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_')); } - /* Perform a relocation as part of a final link. */ static bfd_reloc_status_type @@ -1362,7 +1367,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, + input_section->output_offset); value -= offset; break; - + case R_V850_22_PCREL: value -= (input_section->output_section->vma + input_section->output_offset @@ -1371,10 +1376,10 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, /* If the sign extension will corrupt the value then we have overflowed. */ if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000)) return bfd_reloc_overflow; - + value = SEXT24 (value); /* Only the bottom 24 bits of the PC are valid */ break; - + case R_V850_HI16_S: case R_V850_HI16: case R_V850_LO16: @@ -1383,12 +1388,12 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, case R_V850_8: break; - case R_V850_ZDA_15_16_OFFSET: + case R_V850_ZDA_15_16_OFFSET: case R_V850_ZDA_16_16_OFFSET: case R_V850_ZDA_16_16_SPLIT_OFFSET: if (sym_sec == NULL) return bfd_reloc_undefined; - + value -= sym_sec->output_section->vma; break; @@ -1401,7 +1406,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, if (sym_sec == NULL) return bfd_reloc_undefined; - + /* Get the value of __gp. */ h = bfd_link_hash_lookup (info->hash, "__gp", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL @@ -1426,12 +1431,12 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, { unsigned long ep; struct bfd_link_hash_entry * h; - + /* Get the value of __ep. */ h = bfd_link_hash_lookup (info->hash, "__ep", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL || h->type != bfd_link_hash_defined) - return bfd_reloc_continue; /* Actually this indicates that __ep could not be found. */ + return bfd_reloc_continue; /* Actually this indicates that __ep could not be found. */ ep = (h->u.def.value + h->u.def.section->output_section->vma @@ -1440,17 +1445,17 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, value -= ep; } break; - + case R_V850_CALLT_6_7_OFFSET: { unsigned long ctbp; struct bfd_link_hash_entry * h; - + /* Get the value of __ctbp. */ h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL || h->type != bfd_link_hash_defined) - return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */ + return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */ ctbp = (h->u.def.value + h->u.def.section->output_section->vma @@ -1458,7 +1463,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, value -= ctbp; } break; - + case R_V850_CALLT_16_16_OFFSET: { unsigned long ctbp; @@ -1466,7 +1471,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, if (sym_sec == NULL) return bfd_reloc_undefined; - + /* Get the value of __ctbp. */ h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL @@ -1481,7 +1486,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, value -= (ctbp - sym_sec->output_section->vma); } break; - + case R_V850_NONE: case R_V850_GNU_VTINHERIT: case R_V850_GNU_VTENTRY: @@ -1492,9 +1497,8 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, } /* Perform the relocation. */ - return v850_elf_perform_relocation (input_bfd, r_type, value + addend, hit_data); + return v850_elf_perform_relocation (input_bfd, r_type, value + addend, hit_data); } - /* Relocate an V850 ELF section. */ static boolean @@ -1524,12 +1528,12 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section, return false; } - + /* Reset the list of remembered HI16S relocs to empty. */ free_hi16s = previous_hi16s; previous_hi16s = NULL; hi16s_counter = 0; - + rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) @@ -1596,11 +1600,11 @@ fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n" else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - + if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -1696,7 +1700,7 @@ fprintf (stderr, "unknown: name: %s\n", h->root.root.string); case (bfd_reloc_dangerous + 1): msg = _("could not locate special linker symbol __ctbp"); goto common_error; - + default: msg = _("internal error: unknown error"); /* fall through */ @@ -1803,7 +1807,7 @@ v850_elf_final_write_processing (abfd, linker) elf_elfheader (abfd)->e_flags |= val; } -/* Function to keep V850 specific file flags. */ +/* Function to keep V850 specific file flags. */ static boolean v850_elf_set_private_flags (abfd, flags) bfd * abfd; @@ -1864,7 +1868,7 @@ v850_elf_merge_private_bfd_data (ibfd, obfd) to the default values. */ if (bfd_get_arch_info (ibfd)->the_default) return true; - + elf_flags_init (obfd) = true; elf_elfheader (obfd)->e_flags = in_flags; @@ -1896,14 +1900,14 @@ v850_elf_print_private_bfd_data (abfd, ptr) PTR ptr; { FILE * file = (FILE *) ptr; - + BFD_ASSERT (abfd != NULL && ptr != NULL); - + _bfd_elf_print_private_bfd_data (abfd, ptr); - + /* xgettext:c-format */ fprintf (file, _("private flags = %lx: "), elf_elfheader (abfd)->e_flags); - + switch (elf_elfheader (abfd)->e_flags & EF_V850_ARCH) { default: @@ -1911,9 +1915,9 @@ v850_elf_print_private_bfd_data (abfd, ptr) case E_V850E_ARCH: fprintf (file, _("v850e architecture")); break; case E_V850EA_ARCH: fprintf (file, _("v850ea architecture")); break; } - + fputc ('\n', file); - + return true; } @@ -1934,7 +1938,6 @@ static asection v850_elf_zcom_section; static asymbol v850_elf_zcom_symbol; static asymbol * v850_elf_zcom_symbol_ptr; - /* Given a BFD section, try to locate the corresponding ELF section index. */ @@ -1953,7 +1956,7 @@ v850_elf_section_from_bfd_section (abfd, hdr, sec, retval) *retval = SHN_V850_ZCOMMON; else return false; - + return true; } @@ -1966,34 +1969,34 @@ v850_elf_symbol_processing (abfd, asym) { elf_symbol_type * elfsym = (elf_symbol_type *) asym; unsigned short index; - + index = elfsym->internal_elf_sym.st_shndx; /* If the section index is an "ordinary" index, then it may refer to a v850 specific section created by the assembler. Check the section's type and change the index it matches. - + FIXME: Should we alter the st_shndx field as well ? */ - + if (index < elf_elfheader(abfd)[0].e_shnum) switch (elf_elfsections(abfd)[index]->sh_type) { case SHT_V850_SCOMMON: index = SHN_V850_SCOMMON; break; - + case SHT_V850_TCOMMON: index = SHN_V850_TCOMMON; break; - + case SHT_V850_ZCOMMON: index = SHN_V850_ZCOMMON; break; - + default: break; } - + switch (index) { case SHN_V850_SCOMMON: @@ -2013,7 +2016,7 @@ v850_elf_symbol_processing (abfd, asym) asym->section = & v850_elf_scom_section; asym->value = elfsym->internal_elf_sym.st_size; break; - + case SHN_V850_TCOMMON: if (v850_elf_tcom_section.name == NULL) { @@ -2055,7 +2058,6 @@ v850_elf_symbol_processing (abfd, asym) /* Hook called by the linker routine which adds symbols from an object file. We must handle the special v850 section numbers here. */ -/*ARGSUSED*/ static boolean v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd * abfd; @@ -2067,32 +2069,32 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_vma * valp; { int index = sym->st_shndx; - + /* If the section index is an "ordinary" index, then it may refer to a v850 specific section created by the assembler. Check the section's type and change the index it matches. - + FIXME: Should we alter the st_shndx field as well ? */ - + if (index < elf_elfheader(abfd)[0].e_shnum) switch (elf_elfsections(abfd)[index]->sh_type) { case SHT_V850_SCOMMON: index = SHN_V850_SCOMMON; break; - + case SHT_V850_TCOMMON: index = SHN_V850_TCOMMON; break; - + case SHT_V850_ZCOMMON: index = SHN_V850_ZCOMMON; break; - + default: break; } - + switch (index) { case SHN_V850_SCOMMON: @@ -2100,13 +2102,13 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (*secp)->flags |= SEC_IS_COMMON; *valp = sym->st_size; break; - + case SHN_V850_TCOMMON: *secp = bfd_make_section_old_way (abfd, ".tcommon"); (*secp)->flags |= SEC_IS_COMMON; *valp = sym->st_size; break; - + case SHN_V850_ZCOMMON: *secp = bfd_make_section_old_way (abfd, ".zcommon"); (*secp)->flags |= SEC_IS_COMMON; @@ -2129,7 +2131,7 @@ v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec) /* If we see a common symbol, which implies a relocatable link, then if a symbol was in a special common section in an input file, mark it as a special common in the output file. */ - + if (sym->st_shndx == SHN_COMMON) { if (strcmp (input_sec->name, ".scommon") == 0) @@ -2193,18 +2195,16 @@ v850_elf_fake_sections (abfd, hdr, sec) } else if (strcmp (name, ".zcommon") == 0) hdr->sh_type = SHT_V850_ZCOMMON; - + return true; } - - #define TARGET_LITTLE_SYM bfd_elf32_v850_vec #define TARGET_LITTLE_NAME "elf32-v850" #define ELF_ARCH bfd_arch_v850 #define ELF_MACHINE_CODE EM_CYGNUS_V850 #define ELF_MAXPAGESIZE 0x1000 - + #define elf_info_to_howto v850_elf_info_to_howto_rela #define elf_info_to_howto_rel v850_elf_info_to_howto_rel @@ -2223,7 +2223,6 @@ v850_elf_fake_sections (abfd, hdr, sec) #define elf_backend_can_gc_sections 1 - #define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name #define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup #define bfd_elf32_bfd_copy_private_bfd_data v850_elf_copy_private_bfd_data diff --git a/contrib/binutils/bfd/elf32.c b/contrib/binutils/bfd/elf32.c index f222969..2d3bebf 100644 --- a/contrib/binutils/bfd/elf32.c +++ b/contrib/binutils/bfd/elf32.c @@ -19,5 +19,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ARCH_SIZE 32 - #include "elfcode.h" diff --git a/contrib/binutils/bfd/elf64-alpha.c b/contrib/binutils/bfd/elf64-alpha.c index 4c083fa..197dcff 100644 --- a/contrib/binutils/bfd/elf64-alpha.c +++ b/contrib/binutils/bfd/elf64-alpha.c @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NO_COFF_SYMBOLS #define NO_COFF_LINENOS -/* Get the ECOFF swapping routines. Needed for the debug information. */ +/* Get the ECOFF swapping routines. Needed for the debug information. */ #include "coff/internal.h" #include "coff/sym.h" #include "coff/symconst.h" @@ -46,7 +46,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ECOFF_64 #include "ecoffswap.h" -static boolean elf64_alpha_mkobject PARAMS ((bfd *)); +static int alpha_elf_dynamic_symbol_p + PARAMS((struct elf_link_hash_entry *, struct bfd_link_info *)); static struct bfd_hash_entry * elf64_alpha_link_hash_newfunc PARAMS((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table * elf64_alpha_bfd_link_hash_table_create @@ -66,6 +67,8 @@ static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup static void elf64_alpha_info_to_howto PARAMS((bfd *, arelent *, Elf64_Internal_Rela *)); +static boolean elf64_alpha_mkobject + PARAMS((bfd *)); static boolean elf64_alpha_object_p PARAMS((bfd *)); static boolean elf64_alpha_section_from_shdr @@ -129,7 +132,6 @@ static boolean elf64_alpha_merge_ind_symbols PARAMS((struct alpha_elf_link_hash_entry *, PTR)); static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int)); - struct alpha_elf_link_hash_entry { @@ -224,14 +226,35 @@ struct alpha_elf_link_hash_table /* Should we do dynamic things to this symbol? */ -#define alpha_elf_dynamic_symbol_p(h, info) \ - ((((info)->shared && !(info)->symbolic) \ - || (((h)->elf_link_hash_flags \ - & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) \ - == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) \ - || (h)->root.type == bfd_link_hash_undefweak \ - || (h)->root.type == bfd_link_hash_defweak) \ - && (h)->dynindx != -1) +static int +alpha_elf_dynamic_symbol_p (h, info) + struct elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + if (h == NULL) + return false; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + 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; + + if ((info->shared && !info->symbolic) + || ((h->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) + == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))) + return true; + + return false; +} /* Create an entry in a Alpha ELF linker hash table. */ @@ -711,7 +734,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = false), /* pcrel_offset */ /* The high bits of a 32-bit displacement to the starting address of the - current section (the relocation target is ignored); the low bits are + current section (the relocation target is ignored); the low bits are supplied in the subsequent R_ALPHA_IMMED_LO32 relocs. */ /* XXX: Not implemented. */ HOWTO (R_ALPHA_IMMED_SCN_HI32, @@ -762,7 +785,7 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, /* dst_mask */ false), /* pcrel_offset */ - /* Misc ELF relocations. */ + /* Misc ELF relocations. */ /* A dynamic relocation to copy the target into our .dynbss section. */ /* Not generated, as all Alpha objects use PIC, so it is not needed. It @@ -979,7 +1002,7 @@ static const struct elf_reloc_map elf64_alpha_reloc_map[] = /* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to process the explicit !<reloc>!sequence relocations, and are mapped into the normal - relocations at the end of processing. */ + relocations at the end of processing. */ {BFD_RELOC_ALPHA_USER_LITERAL, R_ALPHA_LITERAL}, {BFD_RELOC_ALPHA_USER_LITUSE_BASE, R_ALPHA_LITUSE}, {BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, R_ALPHA_LITUSE}, @@ -1022,7 +1045,7 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst) cache_ptr->howto = &elf64_alpha_howto_table[r_type]; } -/* These functions do relaxation for Alpha ELF. +/* These functions do relaxation for Alpha ELF. Currently I'm only handling what I can do with existing compiler and assembler support, which means no instructions are removed, @@ -1062,11 +1085,11 @@ struct alpha_relax_info }; static Elf_Internal_Rela * elf64_alpha_relax_with_lituse - PARAMS((struct alpha_relax_info *info, bfd_vma symval, + PARAMS((struct alpha_relax_info *info, bfd_vma symval, Elf_Internal_Rela *irel, Elf_Internal_Rela *irelend)); static boolean elf64_alpha_relax_without_lituse - PARAMS((struct alpha_relax_info *info, bfd_vma symval, + PARAMS((struct alpha_relax_info *info, bfd_vma symval, Elf_Internal_Rela *irel)); static bfd_vma elf64_alpha_relax_opt_call @@ -1125,14 +1148,15 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) flags |= 1 << urel->r_addend; } - /* A little preparation for the loop... */ + /* A little preparation for the loop... */ disp = symval - info->gp; - fits16 = (disp >= -(bfd_signed_vma)0x8000 && disp < 0x8000); - fits32 = (disp >= -(bfd_signed_vma)0x80000000 && disp < 0x7fff8000); for (urel = irel+1, i = 0; i < count; ++i, ++urel) { unsigned int insn; + int insn_disp; + bfd_signed_vma xdisp; + insn = bfd_get_32 (info->abfd, info->contents + urel->r_offset); switch (urel->r_addend) @@ -1145,14 +1169,23 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) case 1: /* MEM FORMAT */ /* We can always optimize 16-bit displacements. */ + + /* Extract the displacement from the instruction, sign-extending + it if necessary, then test whether it is within 16 or 32 bits + displacement from GP. */ + insn_disp = insn & 0x0000ffff; + if (insn_disp & 0x00008000) + insn_disp |= 0xffff0000; /* Negative: sign-extend. */ + + xdisp = disp + insn_disp; + fits16 = (xdisp >= - (bfd_signed_vma) 0x00008000 && xdisp < 0x00008000); + fits32 = (xdisp >= - (bfd_signed_vma) 0x80000000 && xdisp < 0x7fff8000); + if (fits16) { - /* FIXME: sanity check the insn for mem format with - zero addend. */ - - /* Take the op code and dest from this insn, take the base + /* Take the op code and dest from this insn, take the base register from the literal insn. Leave the offset alone. */ - insn = (insn & 0xffe00000) | (lit_insn & 0x001f0000); + insn = (insn & 0xffe0ffff) | (lit_insn & 0x001f0000); urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPRELLOW); urel->r_addend = irel->r_addend; @@ -1165,8 +1198,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) /* If all mem+byte, we can optimize 32-bit mem displacements. */ else if (fits32 && !(flags & ~6)) { - /* FIXME: sanity check that lit insn Ra is mem insn Rb, and - that mem_insn disp is zero. */ + /* FIXME: sanity check that lit insn Ra is mem insn Rb. */ irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPRELHIGH); @@ -1215,12 +1247,12 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) { Elf_Internal_Rela *xrel; - /* Preserve branch prediction call stack when possible. */ + /* Preserve branch prediction call stack when possible. */ if ((insn & INSN_JSR_MASK) == INSN_JSR) insn = (OP_BSR << 26) | (insn & 0x03e00000); else insn = (OP_BR << 26) | (insn & 0x03e00000); - + urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_BRADDR); urel->r_addend = irel->r_addend; @@ -1234,7 +1266,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) /* Kill any HINT reloc that might exist for this insn. */ xrel = (elf64_alpha_find_reloc_at_ofs - (info->relocs, info->relend, urel->r_offset, + (info->relocs, info->relend, urel->r_offset, R_ALPHA_HINT)); if (xrel) xrel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); @@ -1249,7 +1281,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel, irelend) This does depend on every place a gp could be reloaded will be, which currently happens for all code produced by gcc, but not necessarily by hand-coded assembly, or if sibling calls - are enabled in gcc. + are enabled in gcc. Perhaps conditionalize this on a flag being set in the target object file's header, and have gcc set it? */ @@ -1295,22 +1327,22 @@ elf64_alpha_relax_opt_call (info, symval) /* If the symbol is marked NOPV, we are being told the function never needs its procedure value. */ - if (info->other == STO_ALPHA_NOPV) + if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_NOPV) return symval; /* If the symbol is marked STD_GP, we are being told the function does - a normal ldgp in the first two words. */ - else if (info->other == STO_ALPHA_STD_GPLOAD) + a normal ldgp in the first two words. */ + else if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_STD_GPLOAD) ; /* Otherwise, we may be able to identify a GP load in the first two words, which we can then skip. */ - else + else { Elf_Internal_Rela *tsec_relocs, *tsec_relend, *tsec_free, *gpdisp; bfd_vma ofs; - /* Load the relocations from the section that the target symbol is in. */ + /* Load the relocations from the section that the target symbol is in. */ if (info->sec == info->tsec) { tsec_relocs = info->relocs; @@ -1332,7 +1364,7 @@ elf64_alpha_relax_opt_call (info, symval) /* Recover the symbol's offset within the section. */ ofs = (symval - info->tsec->output_section->vma - info->tsec->output_offset); - + /* Look for a GPDISP reloc. */ gpdisp = (elf64_alpha_find_reloc_at_ofs (tsec_relocs, tsec_relend, ofs, R_ALPHA_GPDISP)); @@ -1347,7 +1379,7 @@ elf64_alpha_relax_opt_call (info, symval) free (tsec_free); } - /* We've now determined that we can skip an initial gp load. Verify + /* We've now determined that we can skip an initial gp load. Verify that the call and the target use the same gp. */ if (info->link_info->hash->creator != info->tsec->owner->xvec || info->gotobj != alpha_elf_tdata (info->tsec->owner)->gotobj) @@ -1408,7 +1440,7 @@ elf64_alpha_relax_without_lituse (info, symval, irel) Any such memory load insn may be substituted by a load directly off the GP. This allows the memory load insn to be issued before - the calculated GP register would otherwise be ready. + the calculated GP register would otherwise be ready. Any such jsr insn can be replaced by a bsr if it is in range. @@ -1460,7 +1492,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) if (! link_info->keep_memory) free_relocs = internal_relocs; - memset(&info, 0, sizeof(info)); + memset(&info, 0, sizeof (info)); info.abfd = abfd; info.sec = sec; info.link_info = link_info; @@ -1543,8 +1575,8 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) info.tsec = bfd_abs_section_ptr; else if (isym.st_shndx == SHN_COMMON) info.tsec = bfd_com_section_ptr; - else - continue; /* who knows. */ + else + continue; /* who knows. */ info.h = NULL; info.other = isym.st_other; @@ -1962,7 +1994,7 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) char *ext_hdr = NULL; swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap; - memset (debug, 0, sizeof(*debug)); + memset (debug, 0, sizeof (*debug)); ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size); if (ext_hdr == NULL && swap->external_hdr_size != 0) @@ -2073,6 +2105,12 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, { asection *msec; + 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; + msec = bfd_get_section_by_name (abfd, ".mdebug"); if (msec != NULL) { @@ -2539,7 +2577,8 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) sreloc = bfd_make_section (dynobj, rel_sec_name); if (sreloc == NULL || !bfd_set_section_flags (dynobj, sreloc, - (SEC_ALLOC|SEC_LOAD + ((sec->flags & (SEC_ALLOC + | SEC_LOAD)) | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED @@ -2555,7 +2594,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) don't know whether we'll actually need a dynamic relocation entry for this reloc. So make a record of it. Once we find out if this thing needs dynamic relocation we'll - expand the relocation sections by the appropriate amount. */ + expand the relocation sections by the appropriate amount. */ struct alpha_elf_reloc_entry *rent; @@ -3127,7 +3166,7 @@ elf64_alpha_calc_dynrel_sizes (h, info) || relent->rtype == R_ALPHA_REFQUAD) { relent->srel->_raw_size += - sizeof(Elf64_External_Rela) * relent->count; + sizeof (Elf64_External_Rela) * relent->count; } dynobj = elf_hash_table(info)->dynobj; @@ -3202,7 +3241,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) i = alpha_elf_tdata(i)->got_link_next) count += alpha_elf_tdata(i)->n_local_got_entries; - srel->_raw_size += count * sizeof(Elf64_External_Rela); + srel->_raw_size += count * sizeof (Elf64_External_Rela); } } /* else we're not dynamic and by definition we don't need such things. */ @@ -3305,13 +3344,14 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0) || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0) || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT, - sizeof(Elf64_External_Rela))) + sizeof (Elf64_External_Rela))) return false; if (reltext) { if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } @@ -3394,7 +3434,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, in which case we have to adjust according to where the section symbol winds up in the output section. */ - /* The symbol associated with GPDISP and LITUSE is + /* The symbol associated with GPDISP and LITUSE is immaterial. Only the addend is significant. */ if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE) continue; @@ -3517,7 +3557,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, case R_ALPHA_OP_PSUB: case R_ALPHA_OP_PRSHIFT: /* We hate these silly beasts. */ - abort(); + abort (); case R_ALPHA_LITERAL: { @@ -3571,7 +3611,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, ((Elf64_External_Rela *) srelgot->contents) + srelgot->reloc_count++); - BFD_ASSERT (sizeof(Elf64_External_Rela) + BFD_ASSERT (sizeof (Elf64_External_Rela) * srelgot->reloc_count <= srelgot->_cooked_size); } @@ -3676,7 +3716,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, ((Elf64_External_Rela *) srel->contents) + srel->reloc_count++); - BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count + BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count <= srel->_cooked_size); } goto default_reloc; @@ -3829,7 +3869,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) ((Elf64_External_Rela *) srel->contents) + srel->reloc_count++); - BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count + BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count <= srel->_cooked_size); } @@ -3862,7 +3902,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_elf64_swap_reloca_out (output_bfd, &outrel, ((Elf64_External_Rela *)srel->contents + srel->reloc_count++)); - BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count + BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count <= srel->_cooked_size); } } @@ -4280,7 +4320,6 @@ elf64_alpha_final_link (abfd, info) } #endif - /* Build the external symbol information. */ einfo.abfd = abfd; einfo.info = info; @@ -4600,7 +4639,7 @@ elf64_alpha_final_link (abfd, info) /* ECOFF swapping routines. These are used when dealing with the .mdebug section, which is in the ECOFF debugging format. Copied - from elf32-mips.c. */ + from elf32-mips.c. */ static const struct ecoff_debug_swap elf64_alpha_ecoff_debug_swap = { @@ -4643,6 +4682,36 @@ elf64_alpha_ecoff_debug_swap = elf64_alpha_read_ecoff_info }; +/* Use a non-standard hash bucket size of 8. */ + +const struct elf_size_info alpha_elf_size_info = +{ + sizeof (Elf64_External_Ehdr), + sizeof (Elf64_External_Phdr), + sizeof (Elf64_External_Shdr), + sizeof (Elf64_External_Rel), + sizeof (Elf64_External_Rela), + sizeof (Elf64_External_Sym), + sizeof (Elf64_External_Dyn), + sizeof (Elf_External_Note), + 8, + 1, + 64, 8, + ELFCLASS64, EV_CURRENT, + bfd_elf64_write_out_phdrs, + bfd_elf64_write_shdrs_and_ehdr, + bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_out, + bfd_elf64_slurp_reloc_table, + bfd_elf64_slurp_symbol_table, + bfd_elf64_swap_dyn_in, + bfd_elf64_swap_dyn_out, + NULL, + NULL, + NULL, + NULL +}; + #define TARGET_LITTLE_SYM bfd_elf64_alpha_vec #define TARGET_LITTLE_NAME "elf64-alpha" #define ELF_ARCH bfd_arch_alpha @@ -4698,9 +4767,10 @@ elf64_alpha_ecoff_debug_swap = #define elf_backend_ecoff_debug_swap \ &elf64_alpha_ecoff_debug_swap -/* - * A few constants that determine how the .plt section is set up. - */ +#define elf_backend_size_info \ + alpha_elf_size_info + +/* A few constants that determine how the .plt section is set up. */ #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 1 diff --git a/contrib/binutils/bfd/elf64-gen.c b/contrib/binutils/bfd/elf64-gen.c index 78dc09d..c071934 100644 --- a/contrib/binutils/bfd/elf64-gen.c +++ b/contrib/binutils/bfd/elf64-gen.c @@ -58,6 +58,37 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) bfd_reloc->howto = &dummy; } +static boolean +elf64_generic_link_add_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *o; + + /* Check if there are any relocations. */ + for (o = abfd->sections; o != NULL; o = o->next) + if ((o->flags & SEC_RELOC) != 0) + { + Elf_Internal_Ehdr *ehdrp; + + ehdrp = elf_elfheader (abfd); + if (abfd->my_archive) + (*_bfd_error_handler) (_("%s(%s): Relocations in generic ELF (EM: %d)"), + bfd_get_filename (abfd->my_archive), + bfd_get_filename (abfd), + ehdrp->e_machine); + else + (*_bfd_error_handler) (_("%s: Relocations in generic ELF (EM: %d)"), + bfd_get_filename (abfd), + ehdrp->e_machine); + + bfd_set_error (bfd_error_wrong_format); + return false; + } + + return bfd_elf64_bfd_link_add_symbols (abfd, info); +} + #define TARGET_LITTLE_SYM bfd_elf64_little_generic_vec #define TARGET_LITTLE_NAME "elf64-little" #define TARGET_BIG_SYM bfd_elf64_big_generic_vec @@ -66,6 +97,7 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf64_bfd_link_add_symbols elf64_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/contrib/binutils/bfd/elf64-sparc.c b/contrib/binutils/bfd/elf64-sparc.c index c9e8626..0627913 100644 --- a/contrib/binutils/bfd/elf64-sparc.c +++ b/contrib/binutils/bfd/elf64-sparc.c @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" +#include "opcode/sparc.h" /* This is defined if one wants to build upward compatible binaries with the original sparc64-elf toolchain. The support is kept in for @@ -65,6 +66,8 @@ static void sparc64_elf_symbol_processing static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static boolean sparc64_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean sparc64_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); @@ -212,7 +215,7 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = static reloc_howto_type * sparc64_elf_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { unsigned int i; @@ -226,7 +229,7 @@ sparc64_elf_reloc_type_lookup (abfd, code) static void sparc64_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf64_Internal_Rela *dst; { @@ -237,10 +240,10 @@ sparc64_elf_info_to_howto (abfd, cache_ptr, dst) /* Due to the way how we handle R_SPARC_OLO10, each entry in a SHT_RELA section can represent up to two relocs, we must tell the user to allocate more space. */ - + static long sparc64_elf_get_reloc_upper_bound (abfd, sec) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asection *sec; { return (sec->reloc_count * 2 + 1) * sizeof (arelent *); @@ -253,7 +256,7 @@ sparc64_elf_get_dynamic_reloc_upper_bound (abfd) return _bfd_elf_get_dynamic_reloc_upper_bound (abfd) * 2; } -/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of +/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of them. We cannot use generic elf routines for this, because R_SPARC_OLO10 has secondary addend in ELF64_R_TYPE_DATA. We handle it as two relocations for the same location, R_SPARC_LO10 and R_SPARC_13. */ @@ -266,7 +269,6 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) asymbol **symbols; boolean dynamic; { - struct elf_backend_data * const ebd = get_elf_backend_data (abfd); PTR allocated = NULL; bfd_byte *native_relocs; arelent *relent; @@ -290,7 +292,7 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) entsize = rel_hdr->sh_entsize; BFD_ASSERT (entsize == sizeof (Elf64_External_Rela)); - + count = rel_hdr->sh_size / entsize; for (i = 0, relent = relents; i < count; @@ -396,20 +398,20 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) rel_hdr2 = NULL; } - asect->relocation = ((arelent *) - bfd_alloc (abfd, + asect->relocation = ((arelent *) + bfd_alloc (abfd, asect->reloc_count * 2 * sizeof (arelent))); if (asect->relocation == NULL) return false; /* The sparc64_elf_slurp_one_reloc_table routine increments reloc_count. */ asect->reloc_count = 0; - + if (!sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)) return false; - - if (rel_hdr2 + + if (rel_hdr2 && !sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr2, symbols, dynamic)) return false; @@ -501,7 +503,6 @@ sparc64_elf_write_relocs (abfd, sec, data) for (idx = 0; idx < sec->reloc_count; idx++) { bfd_vma addr; - unsigned int i; ++count; @@ -533,7 +534,7 @@ sparc64_elf_write_relocs (abfd, sec, data) if (rela_hdr->sh_type != SHT_RELA) abort (); - /* orelocation has the data, reloc_count has the count... */ + /* orelocation has the data, reloc_count has the count... */ outbound_relocas = (Elf64_External_Rela *) rela_hdr->contents; src_rela = outbound_relocas; @@ -627,7 +628,7 @@ struct sparc64_elf_link_hash_table #define sparc64_elf_hash_table(p) \ ((struct sparc64_elf_link_hash_table *) ((p)->hash)) - + /* Create a Sparc64 ELF linker hash table. */ static struct bfd_link_hash_table * @@ -650,7 +651,6 @@ sparc64_elf_bfd_link_hash_table_create (abfd) return &ret->root.root; } - /* Utility for performing the standard initial work of an instruction relocation. @@ -723,13 +723,13 @@ sparc_elf_notsup_reloc (abfd, input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry ATTRIBUTE_UNUSED; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section ATTRIBUTE_UNUSED; + bfd *output_bfd ATTRIBUTE_UNUSED; + char **error_message ATTRIBUTE_UNUSED; { return bfd_reloc_notsupported; } @@ -745,7 +745,7 @@ sparc_elf_wdisp16_reloc (abfd, reloc_entry, symbol, data, input_section, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -783,7 +783,7 @@ sparc_elf_hix22_reloc (abfd, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -820,7 +820,7 @@ sparc_elf_lox10_reloc (abfd, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -847,7 +847,6 @@ sparc_elf_lox10_reloc (abfd, #define ELF_DYNAMIC_INTERPRETER "/usr/lib/sparcv9/ld.so.1" - /* Fill in the .plt section. */ static void @@ -858,7 +857,7 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) { const unsigned int nop = 0x01000000; int i, j; - + /* The first four entries are reserved, and are initially undefined. We fill them with `illtrap 0' to force ld.so to do something. */ @@ -892,7 +891,7 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) /* Now the tricky bit. Entries 32768 and higher are grouped in blocks of 160: 160 entries and 160 pointers. This is to separate code from data, which is much friendlier on the cache. */ - + for (; i < nentries; i += 160) { int block = (i + 160 <= nentries ? 160 : nentries - i); @@ -935,7 +934,7 @@ sparc64_elf_plt_entry_offset (index) block = (index - LARGE_PLT_THRESHOLD) / 160; ofs = (index - LARGE_PLT_THRESHOLD) % 160; - return ((bfd_vma)(LARGE_PLT_THRESHOLD + block*160) * PLT_ENTRY_SIZE + return ((bfd_vma) (LARGE_PLT_THRESHOLD + block*160) * PLT_ENTRY_SIZE + ofs * 6*4); } @@ -961,8 +960,6 @@ sparc64_elf_plt_ptr_offset (index, max) + last * 6*4 + ofs * 8); } - - /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage @@ -1197,7 +1194,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) case R_SPARC_UA16: /* When creating a shared object, we must copy these relocs into the output file. We create a reloc section in - dynobj and make room for the reloc. + dynobj and make room for the reloc. But don't do this for debugging sections -- this shows up with DWARF2 -- first because they are not loaded, and @@ -1246,7 +1243,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) break; default: - (*_bfd_error_handler)(_("%s: check_relocs: unhandled reloc type %d"), + (*_bfd_error_handler) (_("%s: check_relocs: unhandled reloc type %d"), bfd_get_filename(abfd), ELF64_R_TYPE_ID (rel->r_info)); return false; @@ -1265,9 +1262,9 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) struct bfd_link_info *info; const Elf_Internal_Sym *sym; const char **namep; - flagword *flagsp; - asection **secp; - bfd_vma *valp; + flagword *flagsp ATTRIBUTE_UNUSED; + asection **secp ATTRIBUTE_UNUSED; + bfd_vma *valp ATTRIBUTE_UNUSED; { static char *stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" }; @@ -1275,7 +1272,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { int reg; struct sparc64_elf_app_reg *p; - + reg = (int)sym->st_value; switch (reg & ~1) { @@ -1316,7 +1313,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) if (**namep) { struct elf_link_hash_entry *h; - + h = (struct elf_link_hash_entry *) bfd_link_hash_lookup (info->hash, *namep, false, false, false); @@ -1387,7 +1384,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) static boolean sparc64_elf_output_arch_syms (output_bfd, info, finfo, func) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; PTR finfo; boolean (*func) PARAMS ((PTR, const char *, @@ -1460,7 +1457,7 @@ sparc64_elf_get_symbol_type (elf_sym, type) static void sparc64_elf_symbol_processing (abfd, asym) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asymbol *asym; { elf_symbol_type *elfsym; @@ -1556,12 +1553,6 @@ sparc64_elf_adjust_dynamic_symbol (info, h) s = bfd_get_section_by_name (dynobj, ".rela.plt"); BFD_ASSERT (s != NULL); - /* The first plt entries are reserved, and the relocations must - pair up exactly. */ - if (s->_raw_size == 0) - s->_raw_size += (PLT_HEADER_SIZE/PLT_ENTRY_SIZE - * sizeof (Elf64_External_Rela)); - s->_raw_size += sizeof (Elf64_External_Rela); /* The procedure linkage table size is bounded by the magnitude @@ -1802,6 +1793,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) { if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } /* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER @@ -1813,7 +1805,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) if (app_regs [reg].name != NULL) { struct elf_link_local_dynamic_entry *entry, *e; - + if (! bfd_elf64_add_dynamic_entry (info, DT_SPARC_REGISTER, 0)) return false; @@ -1855,6 +1847,21 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) return true; } +#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) +#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) + +static boolean +sparc64_elf_relax_section (abfd, section, link_info, again) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; + boolean *again; +{ + *again = false; + SET_SEC_DO_RELAX (section); + return true; +} + /* Relocate a SPARC64 ELF section. */ static boolean @@ -1898,7 +1905,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { int r_type; reloc_howto_type *howto; - long r_symndx; + unsigned long r_symndx; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; asection *sec; @@ -2061,7 +2068,15 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->other))))) return false; - relocation = 0; + + /* To avoid generating warning messages about truncated + relocations, set the relocation's address to be the same as + the start of this section. */ + + if (input_section->output_section != NULL) + relocation = input_section->output_section->vma; + else + relocation = 0; } } @@ -2338,7 +2353,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, off &= ~1; else { - bfd_put_64 (output_bfd, relocation, sgot->contents + off); local_got_offsets[r_symndx] |= 1; if (info->shared) @@ -2346,6 +2360,13 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, asection *srelgot; Elf_Internal_Rela outrel; + /* The Solaris 2.7 64-bit linker adds the contents + of the location to the value of the reloc. + Note this is different behaviour to the + 32-bit linker, which both adds the contents + and ignores the addend. So clear the location. */ + bfd_put_64 (output_bfd, 0, sgot->contents + off); + /* We need to generate a R_SPARC_RELATIVE reloc for the dynamic linker. */ srelgot = bfd_get_section_by_name(dynobj, ".rela.got"); @@ -2362,6 +2383,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, + srelgot->reloc_count)); ++srelgot->reloc_count; } + else + bfd_put_64 (output_bfd, relocation, sgot->contents + off); } relocation = sgot->output_offset + off - got_base; } @@ -2396,6 +2419,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (splt->output_section->vma + splt->output_offset + sparc64_elf_plt_entry_offset (h->plt.offset)); + if (r_type == R_SPARC_WPLT30) + goto do_wplt30; goto do_default; case R_SPARC_OLO10: @@ -2471,6 +2496,97 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; + case R_SPARC_WDISP30: + do_wplt30: + if (SEC_DO_RELAX (input_section) + && rel->r_offset + 4 < input_section->_raw_size) + { +#define G0 0 +#define O7 15 +#define XCC (2 << 20) +#define COND(x) (((x)&0xf)<<25) +#define CONDA COND(0x8) +#define INSN_BPA (F2(0,1) | CONDA | BPRED | XCC) +#define INSN_BA (F2(0,2) | CONDA) +#define INSN_OR F3(2, 0x2, 0) +#define INSN_NOP F2(0,4) + + bfd_vma x, y; + + /* If the instruction is a call with either: + restore + arithmetic instruction with rd == %o7 + where rs1 != %o7 and rs2 if it is register != %o7 + then we can optimize if the call destination is near + by changing the call into a branch always. */ + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + y = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); + if ((x & OP(~0)) == OP(1) && (y & OP(~0)) == OP(2)) + { + if (((y & OP3(~0)) == OP3(0x3d) /* restore */ + || ((y & OP3(0x28)) == 0 /* arithmetic */ + && (y & RD(~0)) == RD(O7))) + && (y & RS1(~0)) != RS1(O7) + && ((y & F3I(~0)) + || (y & RS2(~0)) != RS2(O7))) + { + bfd_vma reloc; + + reloc = relocation + rel->r_addend - rel->r_offset; + reloc -= (input_section->output_section->vma + + input_section->output_offset); + if (reloc & 3) + goto do_default; + + /* Ensure the branch fits into simm22. */ + if ((reloc & ~(bfd_vma)0x7fffff) + && ((reloc | 0x7fffff) != MINUS_ONE)) + goto do_default; + reloc >>= 2; + + /* Check whether it fits into simm19. */ + if ((reloc & 0x3c0000) == 0 + || (reloc & 0x3c0000) == 0x3c0000) + x = INSN_BPA | (reloc & 0x7ffff); /* ba,pt %xcc */ + else + x = INSN_BA | (reloc & 0x3fffff); /* ba */ + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + if (rel->r_offset >= 4 + && (y & (0xffffffff ^ RS1(~0))) + == (INSN_OR | RD(O7) | RS2(G0))) + { + bfd_vma z; + unsigned int reg; + + z = bfd_get_32 (input_bfd, + contents + rel->r_offset - 4); + if ((z & (0xffffffff ^ RD(~0))) + != (INSN_OR | RS1(O7) | RS2(G0))) + break; + + /* The sequence was + or %o7, %g0, %rN + call foo + or %rN, %g0, %o7 + + If call foo was replaced with ba, replace + or %rN, %g0, %o7 with nop. */ + + reg = (y & RS1(~0)) >> 14; + if (reg != ((z & RD(~0)) >> 25) + || reg == G0 || reg == O7) + break; + + bfd_put_32 (input_bfd, INSN_NOP, + contents + rel->r_offset + 4); + } + break; + } + } + } + /* FALLTHROUGH */ + default: do_default: r = _bfd_final_link_relocate (howto, input_bfd, input_section, @@ -2499,12 +2615,12 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { /* Assume this is a call protected by other code that detect the symbol is undefined. If this is the case, - we can safely ignore the overflow. If not, the + we can safely ignore the overflow. If not, the program is hosed anyway, and a little warning isn't going to help. */ break; } - + name = h->root.root.string; } else @@ -2550,7 +2666,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) asection *srela; Elf_Internal_Rela rela; - /* This symbol has an entry in the PLT. Set it up. */ + /* This symbol has an entry in the PLT. Set it up. */ BFD_ASSERT (h->dynindx != -1); @@ -2575,9 +2691,14 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) rela.r_offset += (splt->output_section->vma + splt->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_JMP_SLOT); + /* Adjust for the first 4 reserved elements in the .plt section + when setting the offset in the .rela.plt section. + Sun forgot to read their own ABI and copied elf32-sparc behaviour, + thus .plt[4] has corresponding .rela.plt[0] and so on. */ + bfd_elf64_swap_reloca_out (output_bfd, &rela, ((Elf64_External_Rela *) srela->contents - + h->plt.offset)); + + (h->plt.offset - 4))); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -2770,7 +2891,7 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) return true; } -/* Functions for dealing with the e_flags field. */ +/* Functions for dealing with the e_flags field. */ /* Merge backend specific data from an object file to the output object file when linking. */ @@ -2796,32 +2917,33 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) elf_flags_init (obfd) = true; elf_elfheader (obfd)->e_flags = new_flags; } - + else if (new_flags == old_flags) /* Compatible flags are ok */ ; - + else /* Incompatible flags */ { error = false; - + +#define EF_SPARC_ISA_EXTENSIONS \ + (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3 | EF_SPARC_HAL_R1) + if ((ibfd->flags & DYNAMIC) != 0) { /* We don't want dynamic objects memory ordering and architecture to have any role. That's what dynamic linker should do. */ - old_flags &= ~(EF_SPARCV9_MM | EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1); - old_flags |= (new_flags - & (EF_SPARCV9_MM - | EF_SPARC_SUN_US1 - | EF_SPARC_HAL_R1)); + new_flags &= ~(EF_SPARCV9_MM | EF_SPARC_ISA_EXTENSIONS); + new_flags |= (old_flags + & (EF_SPARCV9_MM | EF_SPARC_ISA_EXTENSIONS)); } else { /* Choose the highest architecture requirements. */ - old_flags |= (new_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)); - new_flags |= (old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)); - if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)) - == (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)) + old_flags |= (new_flags & EF_SPARC_ISA_EXTENSIONS); + new_flags |= (old_flags & EF_SPARC_ISA_EXTENSIONS); + if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3)) + && (old_flags & EF_SPARC_HAL_R1)) { error = true; (*_bfd_error_handler) @@ -2863,13 +2985,13 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) static const char * sparc64_elf_print_symbol_all (abfd, filep, symbol) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; PTR filep; asymbol *symbol; { FILE *file = (FILE *) filep; int reg, type; - + if (ELF_ST_TYPE (((elf_symbol_type *) symbol)->internal_elf_sym.st_info) != STT_REGISTER) return NULL; @@ -2894,8 +3016,10 @@ sparc64_elf_object_p (abfd) bfd *abfd; { unsigned long mach = bfd_mach_sparc_v9; - - if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) + + if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3) + mach = bfd_mach_sparc_v9b; + else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) mach = bfd_mach_sparc_v9a; return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, mach); } @@ -2919,7 +3043,7 @@ const struct elf_size_info sparc64_elf_size_info = /* internal relocations per external relocations. For link purposes we use just 1 internal per 1 external, for assembly and slurp symbol table - we use 2. */ + we use 2. */ 1, 64, /* arch_size */ 8, /* file_align */ @@ -2952,7 +3076,7 @@ const struct elf_size_info sparc64_elf_size_info = #define bfd_elf64_bfd_link_hash_table_create \ sparc64_elf_bfd_link_hash_table_create - + #define elf_info_to_howto \ sparc64_elf_info_to_howto #define bfd_elf64_get_reloc_upper_bound \ @@ -2963,6 +3087,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_canonicalize_dynamic_reloc #define bfd_elf64_bfd_reloc_type_lookup \ sparc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_relax_section \ + sparc64_elf_relax_section #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections diff --git a/contrib/binutils/bfd/elfarm-nabi.c b/contrib/binutils/bfd/elfarm-nabi.c index 38778b7..55e1f03 100644 --- a/contrib/binutils/bfd/elfarm-nabi.c +++ b/contrib/binutils/bfd/elfarm-nabi.c @@ -43,6 +43,10 @@ static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); +/* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. + R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO + in that slot. */ + static reloc_howto_type elf32_arm_howto_table[] = { /* No relocation */ @@ -262,36 +266,36 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00000000, /* dst_mask */ false), /* pcrel_offset */ - /* These next two relocs are defined, but I do not know what they do. */ - + /* BLX instruction for the ARM. */ HOWTO (R_ARM_XPC25, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 25, /* bitsize */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_XPC25", /* name */ false, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + /* BLX instruction for the Thumb. */ HOWTO (R_ARM_THM_XPC22, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 22, /* bitsize */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_XPC22", /* name */ false, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ - + 0x07ff07ff, /* src_mask */ + 0x07ff07ff, /* dst_mask */ + true), /* pcrel_offset */ + /* These next three relocs are not defined, but we need to fill the space. */ HOWTO (R_ARM_NONE, /* type */ @@ -337,7 +341,7 @@ static reloc_howto_type elf32_arm_howto_table[] = false), /* pcrel_offset */ /* Relocs used in ARM Linux */ - + HOWTO (R_ARM_COPY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -365,7 +369,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_JUMP_SLOT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -379,7 +383,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_RELATIVE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -393,7 +397,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_GOTOFF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -407,7 +411,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_GOTPC, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -421,7 +425,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ - + HOWTO (R_ARM_GOT32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -435,7 +439,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_PLT32, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -449,8 +453,8 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - - /* End of relocs used in ARM Linux */ + + /* End of relocs used in ARM Linux */ HOWTO (R_ARM_RREL32, /* type */ 0, /* rightshift */ @@ -574,7 +578,6 @@ static reloc_howto_type elf32_arm_thm_pc9_howto = 0x000000ff, /* dst_mask */ true); /* pcrel_offset */ - static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd * abfd ATTRIBUTE_UNUSED; @@ -582,7 +585,7 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) Elf32_Internal_Rel * elf_reloc; { unsigned int r_type; - + r_type = ELF32_R_TYPE (elf_reloc->r_info); switch (r_type) @@ -590,19 +593,19 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) case R_ARM_GNU_VTINHERIT: bfd_reloc->howto = & elf32_arm_vtinherit_howto; break; - + case R_ARM_GNU_VTENTRY: bfd_reloc->howto = & elf32_arm_vtentry_howto; break; - + case R_ARM_THM_PC11: bfd_reloc->howto = & elf32_arm_thm_pc11_howto; break; - + case R_ARM_THM_PC9: bfd_reloc->howto = & elf32_arm_thm_pc9_howto; break; - + default: if (r_type >= NUM_ELEM (elf32_arm_howto_table)) bfd_reloc->howto = NULL; @@ -611,7 +614,7 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) break; } } - + struct elf32_arm_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; @@ -622,6 +625,8 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = { {BFD_RELOC_NONE, R_ARM_NONE}, {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24}, + {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25}, + {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22}, {BFD_RELOC_32, R_ARM_ABS32}, {BFD_RELOC_32_PCREL, R_ARM_REL32}, {BFD_RELOC_8, R_ARM_ABS8}, @@ -664,7 +669,7 @@ elf32_arm_reloc_type_lookup (abfd, code) for (i = 0; i < NUM_ELEM (elf32_arm_reloc_map); i ++) if (elf32_arm_reloc_map[i].bfd_reloc_val == code) return & elf32_arm_howto_table[elf32_arm_reloc_map[i].elf_reloc_val]; - + return NULL; } } diff --git a/contrib/binutils/bfd/elfarm-oabi.c b/contrib/binutils/bfd/elfarm-oabi.c index 72f62f2..e49ea9c 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 Free Software Foundation, Inc. + Copyright 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "elf/arm-oabi.h" +#define OLD_ARM_ABI + +#include "elf/arm.h" #include "bfd.h" #include "sysdep.h" #include "libbfd.h" @@ -263,7 +265,7 @@ static reloc_howto_type elf32_arm_howto_table[] = false), /* pcrel_offset */ /* XXX - gap in index numbering here. */ - + HOWTO (R_ARM_PLT32, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -277,7 +279,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - + /* XXX - gap in index numbering here. */ HOWTO (R_ARM_RREL32, /* type */ @@ -344,7 +346,7 @@ find_howto (r_type) unsigned int r_type; { int i; - + for (i = NUM_ELEM (elf32_arm_howto_table); i--;) if (elf32_arm_howto_table [i].type == r_type) return elf32_arm_howto_table + i; @@ -388,7 +390,7 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = {BFD_RELOC_NONE, R_ARM_SBREL32 }, {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 }, {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 }, - {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, + {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } }; @@ -406,7 +408,7 @@ elf32_arm_reloc_type_lookup (abfd, code) if (code == BFD_RELOC_ARM_PLT32) return find_howto (R_ARM_PLT32); - + return NULL; } diff --git a/contrib/binutils/bfd/elfcode.h b/contrib/binutils/bfd/elfcode.h index c5edf9b..1a5f63a 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 Free Software - Foundation, Inc. + Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999, 2000 Free + Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -118,6 +118,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_add_dynamic_entry NAME(bfd_elf,add_dynamic_entry) #define elf_write_shdrs_and_ehdr NAME(bfd_elf,write_shdrs_and_ehdr) #define elf_write_out_phdrs NAME(bfd_elf,write_out_phdrs) +#define elf_write_relocs NAME(bfd_elf,write_relocs) +#define elf_slurp_reloc_table NAME(bfd_elf,slurp_reloc_table) #define elf_link_create_dynamic_sections \ NAME(bfd_elf,link_create_dynamic_sections) #define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol @@ -165,13 +167,9 @@ static void elf_swap_shdr_out #define section_from_elf_index bfd_section_from_elf_index -static boolean elf_slurp_reloc_table_from_section +static boolean elf_slurp_reloc_table_from_section PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type, arelent *, asymbol **, boolean)); -static boolean elf_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, boolean)); - -static void write_relocs PARAMS ((bfd *, asection *, PTR)); static boolean elf_file_p PARAMS ((Elf_External_Ehdr *)); @@ -199,7 +197,7 @@ static char *elf_symbol_flags PARAMS ((flagword)); #endif /* Translate an ELF symbol in external format into an ELF symbol in internal - format. */ + format. */ void elf_swap_symbol_in (abfd, src, dst) @@ -221,7 +219,7 @@ elf_swap_symbol_in (abfd, src, dst) } /* Translate an ELF symbol in internal format into an ELF symbol in external - format. */ + format. */ void elf_swap_symbol_out (abfd, src, cdst) @@ -238,9 +236,8 @@ elf_swap_symbol_out (abfd, src, cdst) bfd_h_put_16 (abfd, src->st_shndx, dst->st_shndx); } - /* Translate an ELF file header in external format into an ELF file header in - internal format. */ + internal format. */ static void elf_swap_ehdr_in (abfd, src, dst) @@ -248,11 +245,15 @@ elf_swap_ehdr_in (abfd, src, dst) const Elf_External_Ehdr *src; Elf_Internal_Ehdr *dst; { + int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; memcpy (dst->e_ident, src->e_ident, EI_NIDENT); dst->e_type = bfd_h_get_16 (abfd, (bfd_byte *) src->e_type); dst->e_machine = bfd_h_get_16 (abfd, (bfd_byte *) src->e_machine); dst->e_version = bfd_h_get_32 (abfd, (bfd_byte *) src->e_version); - dst->e_entry = get_word (abfd, (bfd_byte *) src->e_entry); + if (signed_vma) + dst->e_entry = get_signed_word (abfd, (bfd_byte *) src->e_entry); + else + dst->e_entry = get_word (abfd, (bfd_byte *) src->e_entry); dst->e_phoff = get_word (abfd, (bfd_byte *) src->e_phoff); dst->e_shoff = get_word (abfd, (bfd_byte *) src->e_shoff); dst->e_flags = bfd_h_get_32 (abfd, (bfd_byte *) src->e_flags); @@ -265,7 +266,7 @@ elf_swap_ehdr_in (abfd, src, dst) } /* Translate an ELF file header in internal format into an ELF file header in - external format. */ + external format. */ static void elf_swap_ehdr_out (abfd, src, dst) @@ -273,12 +274,16 @@ elf_swap_ehdr_out (abfd, src, dst) const Elf_Internal_Ehdr *src; Elf_External_Ehdr *dst; { + int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; memcpy (dst->e_ident, src->e_ident, EI_NIDENT); - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* note that all elements of dst are *arrays of unsigned char* already... */ bfd_h_put_16 (abfd, src->e_type, dst->e_type); bfd_h_put_16 (abfd, src->e_machine, dst->e_machine); bfd_h_put_32 (abfd, src->e_version, dst->e_version); - put_word (abfd, src->e_entry, dst->e_entry); + if (signed_vma) + put_signed_word (abfd, src->e_entry, dst->e_entry); + else + put_word (abfd, src->e_entry, dst->e_entry); put_word (abfd, src->e_phoff, dst->e_phoff); put_word (abfd, src->e_shoff, dst->e_shoff); bfd_h_put_32 (abfd, src->e_flags, dst->e_flags); @@ -290,9 +295,8 @@ elf_swap_ehdr_out (abfd, src, dst) bfd_h_put_16 (abfd, src->e_shstrndx, dst->e_shstrndx); } - /* Translate an ELF section header table entry in external format into an - ELF section header table entry in internal format. */ + ELF section header table entry in internal format. */ static void elf_swap_shdr_in (abfd, src, dst) @@ -320,7 +324,7 @@ elf_swap_shdr_in (abfd, src, dst) } /* Translate an ELF section header table entry in internal format into an - ELF section header table entry in external format. */ + ELF section header table entry in external format. */ static void elf_swap_shdr_out (abfd, src, dst) @@ -328,7 +332,7 @@ elf_swap_shdr_out (abfd, src, dst) const Elf_Internal_Shdr *src; Elf_External_Shdr *dst; { - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* note that all elements of dst are *arrays of unsigned char* already... */ bfd_h_put_32 (abfd, src->sh_name, dst->sh_name); bfd_h_put_32 (abfd, src->sh_type, dst->sh_type); put_word (abfd, src->sh_flags, dst->sh_flags); @@ -341,9 +345,8 @@ elf_swap_shdr_out (abfd, src, dst) put_word (abfd, src->sh_entsize, dst->sh_entsize); } - /* Translate an ELF program header table entry in external format into an - ELF program header table entry in internal format. */ + ELF program header table entry in internal format. */ void elf_swap_phdr_in (abfd, src, dst) @@ -377,7 +380,7 @@ elf_swap_phdr_out (abfd, src, dst) const Elf_Internal_Phdr *src; Elf_External_Phdr *dst; { - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* note that all elements of dst are *arrays of unsigned char* already... */ bfd_h_put_32 (abfd, src->p_type, dst->p_type); put_word (abfd, src->p_offset, dst->p_offset); put_word (abfd, src->p_vaddr, dst->p_vaddr); @@ -388,7 +391,7 @@ elf_swap_phdr_out (abfd, src, dst) put_word (abfd, src->p_align, dst->p_align); } -/* Translate an ELF reloc from external format to internal format. */ +/* Translate an ELF reloc from external format to internal format. */ INLINE void elf_swap_reloc_in (abfd, src, dst) bfd *abfd; @@ -410,7 +413,7 @@ elf_swap_reloca_in (abfd, src, dst) dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend); } -/* Translate an ELF reloc from internal format to external format. */ +/* Translate an ELF reloc from internal format to external format. */ INLINE void elf_swap_reloc_out (abfd, src, dst) bfd *abfd; @@ -458,7 +461,6 @@ elf_swap_dyn_out (abfd, src, p) /* ELF .o/exec file reading */ - /* Begin processing a given object. First we validate the file by reading in the ELF header and checking @@ -494,9 +496,18 @@ elf_object_p (abfd) char *shstrtab; /* Internal copy of section header stringtab */ struct elf_backend_data *ebd; struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd); + struct sec *preserved_sections = abfd->sections; + unsigned int preserved_section_count = abfd->section_count; + enum bfd_architecture previous_arch = bfd_get_arch (abfd); + unsigned long previous_mach = bfd_get_mach (abfd); struct elf_obj_tdata *new_tdata = NULL; asection *s; + /* Clear section information, since there might be a recognized bfd that + we now check if we can replace, and we don't want to append to it. */ + abfd->sections = NULL; + abfd->section_count = 0; + /* Read in the ELF header in external format. */ if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr)) @@ -511,7 +522,7 @@ elf_object_p (abfd) make use of. The magic number must match, the address size ('class') and byte-swapping must match our XVEC entry, and it must have a section header table (FIXME: See comments re sections at top of this - file). */ + file). */ if ((elf_file_p (&x_ehdr) == false) || (x_ehdr.e_ident[EI_VERSION] != EV_CURRENT) || @@ -554,13 +565,13 @@ elf_object_p (abfd) if (i_ehdrp->e_type == ET_CORE) goto got_wrong_format_error; - /* If there is no section header table, we're hosed. */ + /* If there is no section header table, we're hosed. */ if (i_ehdrp->e_shoff == 0) goto got_wrong_format_error; /* As a simple sanity check, verify that the what BFD thinks is the size of each section header table entry actually matches the size - recorded in the file. */ + recorded in the file. */ if (i_ehdrp->e_shentsize != sizeof (x_shdr)) goto got_wrong_format_error; @@ -614,8 +625,8 @@ elf_object_p (abfd) goto got_no_match; } - /* Remember the entry point specified in the ELF file header. */ - bfd_get_start_address (abfd) = i_ehdrp->e_entry; + /* Remember the entry point specified in the ELF file header. */ + bfd_set_start_address (abfd, i_ehdrp->e_entry); /* Allocate space for a copy of the section header table in internal form, seek to the section header table in the file, @@ -680,7 +691,7 @@ elf_object_p (abfd) } /* Read in the string table containing the names of the sections. We - will need the base pointer to this table later. */ + will need the base pointer to this table later. */ /* We read this inline now, so that we don't have to go through bfd_section_from_shdr with it (since this particular strtab is used to find all of the ELF section names.) */ @@ -729,6 +740,16 @@ elf_object_p (abfd) return (abfd->xvec); got_wrong_format_error: + /* There is way too much undoing of half-known state here. The caller, + bfd_check_format_matches, really shouldn't iterate on live bfd's to + check match/no-match like it does. We have to rely on that a call to + bfd_default_set_arch_mach with the previously known mach, undoes what + was done by the first bfd_default_set_arch_mach (with mach 0) here. + For this to work, only elf-data and the mach may be changed by the + target-specific elf_backend_object_p function. Note that saving the + whole bfd here and restoring it would be even worse; the first thing + you notice is that the cached bfd file position gets out of sync. */ + bfd_default_set_arch_mach (abfd, previous_arch, previous_mach); bfd_set_error (bfd_error_wrong_format); got_no_match: if (new_tdata != NULL @@ -739,6 +760,8 @@ elf_object_p (abfd) if (new_tdata != NULL) bfd_release (abfd, new_tdata); elf_tdata (abfd) = preserved_tdata; + abfd->sections = preserved_sections; + abfd->section_count = preserved_section_count; return (NULL); } @@ -746,8 +769,8 @@ elf_object_p (abfd) /* Write out the relocs. */ -static void -write_relocs (abfd, sec, data) +void +elf_write_relocs (abfd, sec, data) bfd *abfd; asection *sec; PTR data; @@ -795,7 +818,7 @@ write_relocs (abfd, sec, data) SHT_REL section. */ abort (); - /* orelocation has the data, reloc_count has the count... */ + /* orelocation has the data, reloc_count has the count... */ if (use_rela_p) { outbound_relocas = (Elf_External_Rela *) rela_hdr->contents; @@ -941,7 +964,7 @@ elf_write_shdrs_and_ehdr (abfd) i_ehdrp = elf_elfheader (abfd); i_shdrp = elf_elfsections (abfd); - /* swap the header before spitting it out... */ + /* swap the header before spitting it out... */ #if DEBUG & 1 elf_debug_file (i_ehdrp); @@ -952,7 +975,7 @@ elf_write_shdrs_and_ehdr (abfd) != sizeof (x_ehdr))) return false; - /* at this point we've concocted all the ELF sections... */ + /* at this point we've concocted all the ELF sections... */ x_shdrp = (Elf_External_Shdr *) bfd_alloc (abfd, sizeof (*x_shdrp) * (i_ehdrp->e_shnum)); if (!x_shdrp) @@ -970,7 +993,7 @@ elf_write_shdrs_and_ehdr (abfd) != sizeof (*x_shdrp) * i_ehdrp->e_shnum)) return false; - /* need to dump the string table too... */ + /* need to dump the string table too... */ return true; } @@ -998,7 +1021,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) based on a one-to-one mapping of the ELF symbols to canonical symbols. We actually use all the ELF symbols, so there will be no space left over at the end. When we have all the symbols, we - build the caller's pointer vector. */ + build the caller's pointer vector. */ if (! dynamic) { @@ -1226,7 +1249,7 @@ error_return: return -1; } -/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of +/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of them. */ static boolean @@ -1325,7 +1348,7 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, /* Read in and swap the external relocs. */ -static boolean +boolean elf_slurp_reloc_table (abfd, asect, symbols, dynamic) bfd *abfd; asection *asect; @@ -1351,7 +1374,7 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) rel_hdr = &d->rel_hdr; reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize; rel_hdr2 = d->rel_hdr2; - reloc_count2 = (rel_hdr2 + reloc_count2 = (rel_hdr2 ? (rel_hdr2->sh_size / rel_hdr2->sh_entsize) : 0); @@ -1375,8 +1398,8 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) reloc_count2 = 0; } - relents = ((arelent *) - bfd_alloc (abfd, + relents = ((arelent *) + bfd_alloc (abfd, (reloc_count + reloc_count2) * sizeof (arelent))); if (relents == NULL) return false; @@ -1386,15 +1409,14 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) relents, symbols, dynamic)) return false; - - if (rel_hdr2 + + if (rel_hdr2 && !elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr2, reloc_count2, relents + reloc_count, symbols, dynamic)) return false; - asect->relocation = relents; return true; } @@ -1527,13 +1549,13 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = { sizeof (Elf_External_Sym), sizeof (Elf_External_Dyn), sizeof (Elf_External_Note), - ARCH_SIZE / 8, + 4, 1, ARCH_SIZE, FILE_ALIGN, ELFCLASS, EV_CURRENT, elf_write_out_phdrs, elf_write_shdrs_and_ehdr, - write_relocs, + elf_write_relocs, elf_swap_symbol_out, elf_slurp_reloc_table, elf_slurp_symbol_table, diff --git a/contrib/binutils/bfd/elfcore.h b/contrib/binutils/bfd/elfcore.h index e4454aa..2c99e8b 100644 --- a/contrib/binutils/bfd/elfcore.h +++ b/contrib/binutils/bfd/elfcore.h @@ -17,7 +17,6 @@ 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. */ - char* elf_core_file_failing_command (abfd) bfd *abfd; @@ -32,7 +31,6 @@ elf_core_file_failing_signal (abfd) return elf_tdata (abfd)->core_signal; } - boolean elf_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd; @@ -40,7 +38,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) { char* corename; - /* xvecs must match if both are ELF files for the same target. */ + /* xvecs must match if both are ELF files for the same target. */ if (core_bfd->xvec != exec_bfd->xvec) { @@ -48,7 +46,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) return false; } - /* See if the name in the corefile matches the executable name. */ + /* See if the name in the corefile matches the executable name. */ corename = elf_tdata (core_bfd)->core_program; if (corename != NULL) @@ -63,7 +61,6 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) return true; } - /* Core files are simply standard ELF formatted files that partition the file using the execution view of the file (program header table) rather than the linking view. In fact, there is no section header @@ -83,9 +80,11 @@ elf_core_file_p (abfd) { Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ - Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form */ + Elf_Internal_Phdr *i_phdrp = NULL; /* Elf program header, internal form */ unsigned int phindex; struct elf_backend_data *ebd; + struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd); + struct elf_obj_tdata *new_tdata = NULL; /* Read in the ELF header in external format. */ if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr)) @@ -95,21 +94,17 @@ elf_core_file_p (abfd) return NULL; } - /* Check the magic number. */ + /* Check the magic number. */ if (elf_file_p (&x_ehdr) == false) - { - wrong: - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + goto wrong; /* FIXME: Check EI_VERSION here ! */ - /* Check the address size ("class"). */ + /* Check the address size ("class"). */ if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS) goto wrong; - /* Check the byteorder. */ + /* Check the byteorder. */ switch (x_ehdr.e_ident[EI_DATA]) { case ELFDATA2MSB: /* Big-endian */ @@ -124,15 +119,14 @@ elf_core_file_p (abfd) goto wrong; } - /* Give abfd an elf_obj_tdata. */ - elf_tdata (abfd) = + /* Give abfd an elf_obj_tdata. */ + new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); - if (elf_tdata (abfd) == NULL) + if (new_tdata == NULL) return NULL; + elf_tdata (abfd) = new_tdata; - /* FIXME: from here on down, "goto wrong" will leak memory. */ - - /* Swap in the rest of the header, now that we have the byte order. */ + /* Swap in the rest of the header, now that we have the byte order. */ i_ehdrp = elf_elfheader (abfd); elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp); @@ -176,7 +170,7 @@ elf_core_file_p (abfd) } /* If there is no program header, or the type is not a core file, then - we are hosed. */ + we are hosed. */ if (i_ehdrp->e_phoff == 0 || i_ehdrp->e_type != ET_CORE) goto wrong; @@ -185,42 +179,64 @@ elf_core_file_p (abfd) if (i_ehdrp->e_phentsize != sizeof (Elf_External_Phdr)) goto wrong; - /* Allocate space for the program headers. */ + /* Move to the start of the program headers. */ + if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0) + goto wrong; + + /* Allocate space for the program headers. */ i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum); if (!i_phdrp) - return NULL; + goto fail; elf_tdata (abfd)->phdr = i_phdrp; - /* Read and convert to internal form. */ + /* Read and convert to internal form. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { Elf_External_Phdr x_phdr; if (bfd_read ((PTR) &x_phdr, sizeof (x_phdr), 1, abfd) != sizeof (x_phdr)) - return NULL; + goto fail; elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex); } - /* Process each program header. */ + /* Process each program header. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex)) - return NULL; + goto fail; } - /* Set the machine architecture. */ + /* Set the machine architecture. */ if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0)) { /* It's OK if this fails for the generic target. */ if (ebd->elf_machine_code != EM_NONE) - return NULL; + goto fail; } - /* Save the entry point from the ELF header. */ + /* Save the entry point from the ELF header. */ bfd_get_start_address (abfd) = i_ehdrp->e_entry; + /* Let the backend double check the format and override global + information. */ + if (ebd->elf_backend_object_p) + { + if ((*ebd->elf_backend_object_p) (abfd) == false) + goto wrong; + } + return abfd->xvec; + +wrong: + bfd_set_error (bfd_error_wrong_format); +fail: + if (i_phdrp != NULL) + bfd_release (abfd, i_phdrp); + if (new_tdata != NULL) + bfd_release (abfd, new_tdata); + elf_tdata (abfd) = preserved_tdata; + return NULL; } diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c index 8039b4f..bfaf44b 100644 --- a/contrib/binutils/bfd/elflink.c +++ b/contrib/binutils/bfd/elflink.c @@ -41,9 +41,17 @@ _bfd_elf_create_got_section (abfd, info) switch (bed->s->arch_size) { - case 32: ptralign = 2; break; - case 64: ptralign = 3; break; - default: abort(); + case 32: + ptralign = 2; + break; + + case 64: + ptralign = 3; + break; + + default: + bfd_set_error (bfd_error_bad_value); + return false; } flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -89,7 +97,6 @@ _bfd_elf_create_got_section (abfd, info) return true; } - /* Create dynamic sections when linking against a dynamic object. */ boolean @@ -104,9 +111,17 @@ _bfd_elf_create_dynamic_sections (abfd, info) switch (bed->s->arch_size) { - case 32: ptralign = 2; break; - case 64: ptralign = 3; break; - default: abort(); + case 32: + ptralign = 2; + break; + + case 64: + ptralign = 3; + break; + + default: + bfd_set_error (bfd_error_bad_value); + return false; } /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and @@ -147,7 +162,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) return false; } - s = bfd_make_section (abfd, + s = bfd_make_section (abfd, bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) @@ -183,9 +198,9 @@ _bfd_elf_create_dynamic_sections (abfd, info) copy relocs. */ if (! info->shared) { - s = bfd_make_section (abfd, - (bed->default_use_rela_p - ? ".rela.bss" : ".rel.bss")); + s = bfd_make_section (abfd, + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, ptralign)) @@ -196,7 +211,6 @@ _bfd_elf_create_dynamic_sections (abfd, info) return true; } - /* Record a new dynamic symbol. We record the dynamic symbols as we read the input files, since we need to have a list of all of them before we can determine the final sizes of the output sections. @@ -482,7 +496,6 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults) return lsect; } - /* Find a linker generated pointer with a given addend and type. */ @@ -500,7 +513,6 @@ _bfd_elf_find_pointer_linker_section (linker_pointers, addend, which) return (elf_linker_section_pointers_t *)0; } - /* Make the .rela section corresponding to the generated linker section. */ diff --git a/contrib/binutils/bfd/elflink.h b/contrib/binutils/bfd/elflink.h index 0230892..d3b44e8 100644 --- a/contrib/binutils/bfd/elflink.h +++ b/contrib/binutils/bfd/elflink.h @@ -35,7 +35,7 @@ static boolean elf_link_add_archive_symbols static boolean elf_merge_symbol PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection **, bfd_vma *, struct elf_link_hash_entry **, - boolean *, boolean *, boolean *)); + boolean *, boolean *, boolean *, boolean)); static boolean elf_export_symbol PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_fix_symbol_flags @@ -50,14 +50,14 @@ static boolean elf_link_assign_sym_version PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_collect_hash_codes PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean elf_link_read_relocs_from_section +static boolean elf_link_read_relocs_from_section PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *)); static void elf_link_output_relocs PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); static boolean elf_link_size_reloc_section PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); -static void elf_link_adjust_relocs - PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, +static void elf_link_adjust_relocs + PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, struct elf_link_hash_entry **)); /* Given an ELF BFD, add symbols to the global hash table as @@ -94,7 +94,7 @@ is_global_symbol_definition (abfd, sym) /* If the section is undefined, then so is the symbol. */ if (sym->st_shndx == SHN_UNDEF) return false; - + /* If the symbol is defined in the common section, then it is a common definition and so does not count. */ if (sym->st_shndx == SHN_COMMON) @@ -104,18 +104,17 @@ is_global_symbol_definition (abfd, sym) must rely upon the backend to tell us what it is. */ if (sym->st_shndx >= SHN_LORESERVE && sym->st_shndx < SHN_ABS) /* FIXME - this function is not coded yet: - + return _bfd_is_global_symbol_definition (abfd, sym); - + Instead for now assume that the definition is not global, Even if this is wrong, at least the linker will behave in the same way that it used to do. */ return false; - + return true; } - /* Search the symbol table of the archive element of the archive ABFD whoes archove map contains a mention of SYMDEF, and determine if the symbol is defined in this element. */ @@ -132,7 +131,7 @@ elf_link_is_defined_archive_symbol (abfd, symdef) size_t extsymcount; size_t extsymoff; boolean result = false; - + abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); if (abfd == (bfd *) NULL) return false; @@ -146,7 +145,7 @@ elf_link_is_defined_archive_symbol (abfd, symdef) (re)include this element. */ if (abfd->archive_pass) return false; - + /* Select the appropriate symbol table. */ if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0) hdr = &elf_tdata (abfd)->symtab_hdr; @@ -208,11 +207,10 @@ elf_link_is_defined_archive_symbol (abfd, symdef) } free (buf); - + return result; } - /* Add symbols from an ELF archive file to the linker hash table. We don't use _bfd_generic_link_add_archive_symbols because of a problem which arises on UnixWare. The UnixWare libc.so is an @@ -357,7 +355,6 @@ elf_link_add_archive_symbols (abfd, info) } /* We need to include this archive member. */ - element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); if (element == (bfd *) NULL) goto error_return; @@ -434,11 +431,12 @@ elf_link_add_archive_symbols (abfd, info) TYPE_CHANGE_OK if it is OK for the type to change. We set SIZE_CHANGE_OK if it is OK for the size to change. By OK to change, we mean that we shouldn't warn if the type or size does - change. */ + change. DT_NEEDED indicates if it comes from a DT_NEEDED entry of + a shared object. */ static boolean elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, - override, type_change_ok, size_change_ok) + override, type_change_ok, size_change_ok, dt_needed) bfd *abfd; struct bfd_link_info *info; const char *name; @@ -449,6 +447,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, boolean *override; boolean *type_change_ok; boolean *size_change_ok; + boolean dt_needed; { asection *sec; struct elf_link_hash_entry *h; @@ -625,9 +624,11 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, olddyncommon = false; /* It's OK to change the type if either the existing symbol or the - new symbol is weak. */ + new symbol is weak unless it comes from a DT_NEEDED entry of + a shared object, in which case, the DT_NEEDED entry may not be + required at the run time. */ - if (h->root.type == bfd_link_hash_defweak + if ((! dt_needed && h->root.type == bfd_link_hash_defweak) || h->root.type == bfd_link_hash_undefweak || bind == STB_WEAK) *type_change_ok = true; @@ -679,7 +680,9 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, object to override a weak symbol in a shared object. We prefer a non-weak definition in a shared library to a weak - definition in the executable. */ + definition in the executable unless it comes from a DT_NEEDED + entry of a shared object, in which case, the DT_NEEDED entry + may not be required at the run time. */ if (newdyn && newdef @@ -688,6 +691,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, && (bind == STB_WEAK || ELF_ST_TYPE (sym->st_info) == STT_FUNC))) && (h->root.type != bfd_link_hash_defweak + || dt_needed || bind == STB_WEAK)) { *override = true; @@ -822,8 +826,11 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, /* Handle the special case of a weak definition in a regular object followed by a non-weak definition in a shared object. In this - case, we prefer the definition in the shared object. */ + case, we prefer the definition in the shared object unless it + comes from a DT_NEEDED entry of a shared object, in which case, + the DT_NEEDED entry may not be required at the run time. */ if (olddef + && ! dt_needed && h->root.type == bfd_link_hash_defweak && newdef && newdyn @@ -891,6 +898,7 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Sym *esym; Elf_External_Sym *esymend; struct elf_backend_data *bed; + boolean dt_needed; bed = get_elf_backend_data (abfd); add_symbol_hook = bed->elf_add_symbol_hook; @@ -1050,6 +1058,8 @@ elf_link_add_object_symbols (abfd, info) goto error_return; elf_sym_hashes (abfd) = sym_hash; + dt_needed = false; + if (! dynamic) { /* If we are creating a shared library, create all the dynamic @@ -1086,7 +1096,12 @@ elf_link_add_object_symbols (abfd, info) { name = elf_dt_name (abfd); if (*name == '\0') - add_needed = false; + { + if (elf_dt_soname (abfd) != NULL) + dt_needed = true; + + add_needed = false; + } } s = bfd_get_section_by_name (abfd, ".dynamic"); if (s != NULL) @@ -1095,6 +1110,8 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Dyn *extdynend; int elfsec; unsigned long link; + int rpath; + int runpath; dynbuf = (Elf_External_Dyn *) bfd_malloc ((size_t) s->_raw_size); if (dynbuf == NULL) @@ -1128,6 +1145,8 @@ elf_link_add_object_symbols (abfd, info) extdyn = dynbuf; extdynend = extdyn + s->_raw_size / sizeof (Elf_External_Dyn); + rpath = 0; + runpath = 0; for (; extdyn < extdynend; extdyn++) { Elf_Internal_Dyn dyn; @@ -1164,6 +1183,65 @@ elf_link_add_object_symbols (abfd, info) ; *pn = n; } + if (dyn.d_tag == DT_RUNPATH) + { + struct bfd_link_needed_list *n, **pn; + char *fnm, *anm; + + /* When we see DT_RPATH before DT_RUNPATH, we have + to clear runpath. Do _NOT_ bfd_release, as that + frees all more recently bfd_alloc'd blocks as + well. */ + if (rpath && elf_hash_table (info)->runpath) + elf_hash_table (info)->runpath = NULL; + + n = ((struct bfd_link_needed_list *) + bfd_alloc (abfd, sizeof (struct bfd_link_needed_list))); + fnm = bfd_elf_string_from_elf_section (abfd, link, + dyn.d_un.d_val); + if (n == NULL || fnm == NULL) + goto error_return; + anm = bfd_alloc (abfd, strlen (fnm) + 1); + if (anm == NULL) + goto error_return; + strcpy (anm, fnm); + n->name = anm; + n->by = abfd; + n->next = NULL; + for (pn = &elf_hash_table (info)->runpath; + *pn != NULL; + pn = &(*pn)->next) + ; + *pn = n; + runpath = 1; + rpath = 0; + } + /* Ignore DT_RPATH if we have seen DT_RUNPATH. */ + if (!runpath && dyn.d_tag == DT_RPATH) + { + struct bfd_link_needed_list *n, **pn; + char *fnm, *anm; + + n = ((struct bfd_link_needed_list *) + bfd_alloc (abfd, sizeof (struct bfd_link_needed_list))); + fnm = bfd_elf_string_from_elf_section (abfd, link, + dyn.d_un.d_val); + if (n == NULL || fnm == NULL) + goto error_return; + anm = bfd_alloc (abfd, strlen (fnm) + 1); + if (anm == NULL) + goto error_return; + strcpy (anm, fnm); + n->name = anm; + n->by = abfd; + n->next = NULL; + for (pn = &elf_hash_table (info)->runpath; + *pn != NULL; + pn = &(*pn)->next) + ; + *pn = n; + rpath = 1; + } } free (dynbuf); @@ -1291,8 +1369,6 @@ elf_link_add_object_symbols (abfd, info) if (sym.st_shndx != SHN_UNDEF && sym.st_shndx != SHN_COMMON) flags = BSF_GLOBAL; - else - flags = 0; } else if (bind == STB_WEAK) flags = BSF_WEAK; @@ -1458,7 +1534,7 @@ elf_link_add_object_symbols (abfd, info) if (! elf_merge_symbol (abfd, info, name, &sym, &sec, &value, sym_hash, &override, &type_change_ok, - &size_change_ok)) + &size_change_ok, dt_needed)) goto error_return; if (override) @@ -1527,7 +1603,10 @@ elf_link_add_object_symbols (abfd, info) unsigned int align; align = bfd_log2 (sym.st_value); - if (align > old_alignment) + if (align > old_alignment + /* Permit an alignment power of zero if an alignment of one + is specified and no other alignments have been specified. */ + || (sym.st_value == 1 && old_alignment == 0)) h->root.u.c.p->alignment_power = align; } @@ -1579,10 +1658,10 @@ elf_link_add_object_symbols (abfd, info) /* Combine visibilities, using the most constraining one. */ unsigned char hvis = ELF_ST_VISIBILITY (h->other); unsigned char symvis = ELF_ST_VISIBILITY (sym.st_other); - + if (symvis && (hvis > symvis || hvis == 0)) h->other = sym.st_other; - + /* If neither has visibility, use the st_other of the definition. This is an arbitrary choice, since the other bits have no general meaning. */ @@ -1634,7 +1713,7 @@ elf_link_add_object_symbols (abfd, info) name to the fully decorated name. This will cause external references which do not specify a version to be bound to this version of the symbol. */ - if (definition) + if (definition || h->root.type == bfd_link_hash_common) { char *p; @@ -1661,7 +1740,8 @@ elf_link_add_object_symbols (abfd, info) size_change_ok = false; if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec, &value, &hi, &override, - &type_change_ok, &size_change_ok)) + &type_change_ok, + &size_change_ok, dt_needed)) goto error_return; if (! override) @@ -1778,7 +1858,8 @@ elf_link_add_object_symbols (abfd, info) size_change_ok = false; if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec, &value, &hi, &override, - &type_change_ok, &size_change_ok)) + &type_change_ok, + &size_change_ok, dt_needed)) goto error_return; if (override) @@ -1859,11 +1940,58 @@ elf_link_add_object_symbols (abfd, info) switch (ELF_ST_VISIBILITY (h->other)) { case STV_INTERNAL: - case STV_HIDDEN: + case STV_HIDDEN: h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (h); + (*bed->elf_backend_hide_symbol) (info, h); break; } + + if (dt_needed && definition + && (h->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0) + { + bfd_size_type oldsize; + bfd_size_type strindex; + + /* The symbol from a DT_NEEDED object is referenced from + the regular object to create a dynamic executable. We + have to make sure there is a DT_NEEDED entry for it. */ + + dt_needed = false; + oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); + strindex = _bfd_stringtab_add (elf_hash_table (info)->dynstr, + elf_dt_soname (abfd), + true, false); + if (strindex == (bfd_size_type) -1) + goto error_return; + + if (oldsize + == _bfd_stringtab_size (elf_hash_table (info)->dynstr)) + { + asection *sdyn; + Elf_External_Dyn *dyncon, *dynconend; + + sdyn = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + ".dynamic"); + BFD_ASSERT (sdyn != NULL); + + dyncon = (Elf_External_Dyn *) sdyn->contents; + dynconend = (Elf_External_Dyn *) (sdyn->contents + + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + + elf_swap_dyn_in (elf_hash_table (info)->dynobj, + dyncon, &dyn); + BFD_ASSERT (dyn.d_tag != DT_NEEDED || + dyn.d_un.d_val != strindex); + } + } + + if (! elf_add_dynamic_entry (info, DT_NEEDED, strindex)) + goto error_return; + } } } @@ -2280,7 +2408,6 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) return true; } - /* Read and swap the relocs from the section indicated by SHDR. This may be either a REL or a RELA section. The relocations are translated into RELA relocations and stored in INTERNAL_RELOCS, @@ -2404,7 +2531,7 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, { size_t size; - size = (o->reloc_count * bed->s->int_rels_per_ext_rel + size = (o->reloc_count * bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela)); if (keep_memory) internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size); @@ -2430,8 +2557,8 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, external_relocs, internal_relocs)) goto error_return; - if (!elf_link_read_relocs_from_section - (abfd, + if (!elf_link_read_relocs_from_section + (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 @@ -2458,7 +2585,6 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, return NULL; } - /* Record an assignment to a symbol made by a linker script. We need this in case some dynamic object refers to this symbol. */ @@ -2765,7 +2891,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, { struct elf_info_failed eif; struct elf_link_hash_entry *h; - bfd_size_type strsize; + asection *dynstr; *sinterpptr = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (*sinterpptr != NULL || info->shared); @@ -2783,6 +2909,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, { if (! elf_add_dynamic_entry (info, DT_SYMBOLIC, 0)) return false; + info->flags |= DF_SYMBOLIC; } if (rpath != NULL) @@ -2792,7 +2919,9 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, rpath, true, true); if (indx == (bfd_size_type) -1 - || ! elf_add_dynamic_entry (info, DT_RPATH, indx)) + || ! elf_add_dynamic_entry (info, DT_RPATH, indx) + || (info->new_dtags + && ! elf_add_dynamic_entry (info, DT_RUNPATH, indx))) return false; } @@ -2867,7 +2996,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, /* If there are initialization and/or finalization functions to call then add the corresponding DT_INIT/DT_FINI entries. */ h = (info->init_function - ? elf_link_hash_lookup (elf_hash_table (info), + ? elf_link_hash_lookup (elf_hash_table (info), info->init_function, false, false, false) : NULL); @@ -2879,7 +3008,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, return false; } h = (info->fini_function - ? elf_link_hash_lookup (elf_hash_table (info), + ? elf_link_hash_lookup (elf_hash_table (info), info->fini_function, false, false, false) : NULL); @@ -2891,14 +3020,24 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, return false; } - strsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); - if (! elf_add_dynamic_entry (info, DT_HASH, 0) - || ! elf_add_dynamic_entry (info, DT_STRTAB, 0) - || ! elf_add_dynamic_entry (info, DT_SYMTAB, 0) - || ! elf_add_dynamic_entry (info, DT_STRSZ, strsize) - || ! elf_add_dynamic_entry (info, DT_SYMENT, - sizeof (Elf_External_Sym))) - return false; + dynstr = bfd_get_section_by_name (dynobj, ".dynstr"); + /* If .dynstr is excluded from the link, we don't want any of + these tags. Strictly, we should be checking each section + individually; This quick check covers for the case where + someone does a /DISCARD/ : { *(*) }. */ + if (dynstr != NULL && dynstr->output_section != bfd_abs_section_ptr) + { + bfd_size_type strsize; + + strsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); + if (! elf_add_dynamic_entry (info, DT_HASH, 0) + || ! elf_add_dynamic_entry (info, DT_STRTAB, 0) + || ! elf_add_dynamic_entry (info, DT_SYMTAB, 0) + || ! elf_add_dynamic_entry (info, DT_STRSZ, strsize) + || ! elf_add_dynamic_entry (info, DT_SYMENT, + sizeof (Elf_External_Sym))) + return false; + } } /* The backend must work out the sizes of all the other dynamic @@ -2912,7 +3051,6 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, size_t dynsymcount; asection *s; size_t bucketcount = 0; - Elf_Internal_Sym isym; size_t hash_entry_size; /* Set up the version definition section. */ @@ -3081,6 +3219,22 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, elf_tdata (output_bfd)->cverdefs = cdefs; } + if (info->new_dtags && info->flags) + { + if (! elf_add_dynamic_entry (info, DT_FLAGS, info->flags)) + return false; + } + + if (info->flags_1) + { + if (! info->shared) + info->flags_1 &= ~ (DF_1_INITFIRST + | DF_1_NODELETE + | DF_1_NOOPEN); + if (! elf_add_dynamic_entry (info, DT_FLAGS_1, info->flags_1)) + return false; + } + /* Work out the size of the version reference section. */ s = bfd_get_section_by_name (dynobj, ".gnu.version_r"); @@ -3191,7 +3345,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } } - /* Assign dynsym indicies. In a shared library we generate a + /* Assign dynsym indicies. 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. */ @@ -3233,15 +3387,20 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, if (s->contents == NULL && s->_raw_size != 0) return false; - /* The first entry in .dynsym is a dummy symbol. */ - isym.st_value = 0; - isym.st_size = 0; - isym.st_name = 0; - isym.st_info = 0; - isym.st_other = 0; - isym.st_shndx = 0; - elf_swap_symbol_out (output_bfd, &isym, - (PTR) (Elf_External_Sym *) s->contents); + if (dynsymcount != 0) + { + Elf_Internal_Sym isym; + + /* The first entry in .dynsym is a dummy symbol. */ + isym.st_value = 0; + isym.st_size = 0; + isym.st_name = 0; + isym.st_info = 0; + isym.st_other = 0; + isym.st_shndx = 0; + elf_swap_symbol_out (output_bfd, &isym, + (PTR) (Elf_External_Sym *) s->contents); + } /* Compute the size of the hashing table. As a side effect this computes the hash values for all the names we export. */ @@ -3257,7 +3416,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, memset (s->contents, 0, (size_t) s->_raw_size); bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); - bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, + bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, s->contents + hash_entry_size); elf_hash_table (info)->bucketcount = bucketcount; @@ -3290,6 +3449,9 @@ elf_fix_symbol_flags (h, eif) an ELF dynamic object. */ if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0) { + while (h->root.type == bfd_link_hash_indirect) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR @@ -3705,7 +3867,7 @@ elf_link_assign_sym_version (h, data) && ! sinfo->export_dynamic) { h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (h); + (*bed->elf_backend_hide_symbol) (info, h); /* FIXME: The name of the symbol has already been recorded in the dynamic string table section. */ @@ -3729,7 +3891,7 @@ elf_link_assign_sym_version (h, data) int version_index; /* If we aren't going to export this symbol, we don't need - to worry about it. */ + to worry about it. */ if (h->dynindx == -1) return true; @@ -3817,7 +3979,7 @@ elf_link_assign_sym_version (h, data) && ! sinfo->export_dynamic) { h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (h); + (*bed->elf_backend_hide_symbol) (info, h); /* FIXME: The name of the symbol has already been recorded in the dynamic string table section. */ @@ -3839,7 +4001,7 @@ elf_link_assign_sym_version (h, data) && ! sinfo->export_dynamic) { h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - (*bed->elf_backend_hide_symbol) (h); + (*bed->elf_backend_hide_symbol) (info, h); /* FIXME: The name of the symbol has already been recorded in the dynamic string table section. */ } @@ -3937,11 +4099,13 @@ elf_link_size_reloc_section (abfd, rel_hdr, o) rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count; /* The contents field must last into write_object_contents, so we - allocate it with bfd_alloc rather than malloc. */ - rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size); + allocate it with bfd_alloc rather than malloc. Also since we + cannot be sure that the contents will actually be filled in, + we zero the allocated space. */ + rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size); if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0) return false; - + /* We only allocate one set of hash entries, so we only do it the first time we are called. */ if (elf_section_data (o)->rel_hashes == NULL) @@ -3974,6 +4138,7 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) struct elf_link_hash_entry **rel_hash; { unsigned int i; + struct elf_backend_data *bed = get_elf_backend_data (abfd); for (i = 0; i < count; i++, rel_hash++) { @@ -3986,26 +4151,38 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) { Elf_External_Rel *erel; Elf_Internal_Rel irel; - + erel = (Elf_External_Rel *) rel_hdr->contents + i; - elf_swap_reloc_in (abfd, erel, &irel); + if (bed->s->swap_reloc_in) + (*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_out (abfd, &irel, erel); + if (bed->s->swap_reloc_out) + (*bed->s->swap_reloc_out) (abfd, &irel, (bfd_byte *) erel); + else + elf_swap_reloc_out (abfd, &irel, erel); } else { Elf_External_Rela *erela; Elf_Internal_Rela irela; - + BFD_ASSERT (rel_hdr->sh_entsize == sizeof (Elf_External_Rela)); - + erela = (Elf_External_Rela *) rel_hdr->contents + i; - elf_swap_reloca_in (abfd, erela, &irela); + if (bed->s->swap_reloca_in) + (*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_out (abfd, &irela, erela); + if (bed->s->swap_reloca_out) + (*bed->s->swap_reloca_out) (abfd, &irela, (bfd_byte *) erela); + else + elf_swap_reloca_out (abfd, &irela, erela); } } } @@ -4100,7 +4277,7 @@ elf_bfd_final_link (abfd, info) the linker has decided to not include. */ sec->linker_mark = true; - if (info->relocateable) + if (info->relocateable || info->emitrelocations) o->reloc_count += sec->reloc_count; if (sec->_raw_size > max_contents_size) @@ -4168,7 +4345,7 @@ elf_bfd_final_link (abfd, info) /* Figure out how many relocations we will have in each section. Just using RELOC_COUNT isn't good enough since that doesn't maintain a separate value for REL vs. RELA relocations. */ - if (info->relocateable) + if (info->relocateable || info->emitrelocations) for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) for (o = sub->sections; o != NULL; o = o->next) { @@ -4185,9 +4362,9 @@ elf_bfd_final_link (abfd, info) if (output_section != NULL && (o->flags & SEC_RELOC) != 0) { - struct bfd_elf_section_data *esdi + struct bfd_elf_section_data *esdi = elf_section_data (o); - struct bfd_elf_section_data *esdo + struct bfd_elf_section_data *esdo = elf_section_data (output_section); unsigned int *rel_count; unsigned int *rel_count2; @@ -4204,11 +4381,11 @@ elf_bfd_final_link (abfd, info) rel_count = &esdo->rel_count2; rel_count2 = &esdo->rel_count; } - - *rel_count += (esdi->rel_hdr.sh_size + + *rel_count += (esdi->rel_hdr.sh_size / esdi->rel_hdr.sh_entsize); if (esdi->rel_hdr2) - *rel_count2 += (esdi->rel_hdr2->sh_size + *rel_count2 += (esdi->rel_hdr2->sh_size / esdi->rel_hdr2->sh_entsize); } } @@ -4232,7 +4409,7 @@ elf_bfd_final_link (abfd, info) } /* Now, reset REL_COUNT and REL_COUNT2 so that we can use them - to count upwards while actually outputting the relocations. */ + to count upwards while actually outputting the relocations. */ elf_section_data (o)->rel_count = 0; elf_section_data (o)->rel_count2 = 0; } @@ -4276,7 +4453,7 @@ elf_bfd_final_link (abfd, info) /* Start writing out the symbol table. The first symbol is always a dummy symbol. */ - if (info->strip != strip_all || info->relocateable) + if (info->strip != strip_all || info->relocateable || info->emitrelocations) { elfsym.st_value = 0; elfsym.st_size = 0; @@ -4309,7 +4486,7 @@ elf_bfd_final_link (abfd, info) symbols have no names. We store the index of each one in the index field of the section, so that we can find it again when outputting relocs. */ - if (info->strip != strip_all || info->relocateable) + if (info->strip != strip_all || info->relocateable || info->emitrelocations) { elfsym.st_size = 0; elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); @@ -4411,7 +4588,7 @@ elf_bfd_final_link (abfd, info) /* That wrote out all the local symbols. Finish up the symbol table with the global symbols. Even if we want to strip everything we can, we still need to deal with those global symbols that got - converted to local in a version script. */ + converted to local in a version script. */ if (info->shared) { @@ -4433,7 +4610,8 @@ elf_bfd_final_link (abfd, info) /* The sh_info field records the index of the first non local symbol. */ symtab_hdr->sh_info = bfd_get_symcount (abfd); - if (dynamic) + if (dynamic + && finfo.dynsym_sec->output_section != bfd_abs_section_ptr) { Elf_Internal_Sym sym; Elf_External_Sym *dynsym = @@ -4523,7 +4701,7 @@ elf_bfd_final_link (abfd, info) Elf_Internal_Sym *, asection *))) elf_link_output_sym)) return false; - } + } /* Flush all symbols to the file. */ if (! elf_link_flush_output_syms (&finfo)) @@ -4562,13 +4740,13 @@ elf_bfd_final_link (abfd, info) if ((o->flags & SEC_RELOC) == 0) continue; - elf_link_adjust_relocs (abfd, &elf_section_data (o)->rel_hdr, + elf_link_adjust_relocs (abfd, &elf_section_data (o)->rel_hdr, elf_section_data (o)->rel_count, elf_section_data (o)->rel_hashes); if (elf_section_data (o)->rel_hdr2 != NULL) elf_link_adjust_relocs (abfd, elf_section_data (o)->rel_hdr2, elf_section_data (o)->rel_count2, - (elf_section_data (o)->rel_hashes + (elf_section_data (o)->rel_hashes + elf_section_data (o)->rel_count)); /* Set the reloc_count field to 0 to prevent write_relocs from @@ -4698,7 +4876,8 @@ elf_bfd_final_link (abfd, info) for (o = dynobj->sections; o != NULL; o = o->next) { if ((o->flags & SEC_HAS_CONTENTS) == 0 - || o->_raw_size == 0) + || o->_raw_size == 0 + || o->output_section == bfd_abs_section_ptr) continue; if ((o->flags & SEC_LINKER_CREATED) == 0) { @@ -4912,6 +5091,7 @@ elf_link_output_extsym (h, data) referenced by regular files, because we will already have issued warnings for them. */ if (! finfo->info->relocateable + && ! finfo->info->allow_shlib_undefined && ! (finfo->info->shared && !finfo->info->no_undefined) && h->root.type == bfd_link_hash_undefined @@ -5031,12 +5211,9 @@ elf_link_output_extsym (h, data) symbol foo@@GNU_1.2 is the default, which should be used when foo is used with no version, then we add an indirect symbol foo which points to foo@@GNU_1.2. We ignore these symbols, - since the indirected symbol is already in the hash table. If - the indirect symbol is non-ELF, fall through and output it. */ - if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) == 0) - return true; + since the indirected symbol is already in the hash table. */ + return true; - /* Fall through. */ case bfd_link_hash_warning: /* We can't represent these symbols in ELF, although a warning symbol may have come from a .gnu.warning.SYMBOL section. We @@ -5087,7 +5264,7 @@ elf_link_output_extsym (h, data) } /* If a symbol is not defined locally, we clear the visibility - field. */ + field. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other); @@ -5112,7 +5289,7 @@ elf_link_output_extsym (h, data) bucketcount = elf_hash_table (finfo->info)->bucketcount; bucket = h->elf_hash_value % bucketcount; - hash_entry_size + hash_entry_size = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; bucketpos = ((bfd_byte *) finfo->hash_sec->contents + (bucket + 2) * hash_entry_size); @@ -5172,7 +5349,7 @@ elf_link_output_extsym (h, data) OUTPUT_BFD. */ static void -elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, +elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, internal_relocs) bfd *output_bfd; asection *input_section; @@ -5184,11 +5361,12 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, Elf_Internal_Shdr *output_rel_hdr; asection *output_section; unsigned int *rel_countp = NULL; + struct elf_backend_data *bed; output_section = input_section->output_section; output_rel_hdr = NULL; - if (elf_section_data (output_section)->rel_hdr.sh_entsize + if (elf_section_data (output_section)->rel_hdr.sh_entsize == input_rel_hdr->sh_entsize) { output_rel_hdr = &elf_section_data (output_section)->rel_hdr; @@ -5203,7 +5381,8 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, } BFD_ASSERT (output_rel_hdr != NULL); - + + bed = get_elf_backend_data (output_bfd); irela = internal_relocs; irelaend = irela + input_rel_hdr->sh_size / input_rel_hdr->sh_entsize; if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel)) @@ -5218,7 +5397,10 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, irel.r_offset = irela->r_offset; irel.r_info = irela->r_info; BFD_ASSERT (irela->r_addend == 0); - elf_swap_reloc_out (output_bfd, &irel, erel); + if (bed->s->swap_reloc_out) + (*bed->s->swap_reloc_out) (output_bfd, &irel, (PTR) erel); + else + elf_swap_reloc_out (output_bfd, &irel, erel); } } else @@ -5229,7 +5411,10 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, == sizeof (Elf_External_Rela)); erela = ((Elf_External_Rela *) output_rel_hdr->contents + *rel_countp); for (; irela < irelaend; irela++, erela++) - elf_swap_reloca_out (output_bfd, irela, erela); + if (bed->s->swap_reloca_out) + (*bed->s->swap_reloca_out) (output_bfd, irela, (PTR) erela); + else + elf_swap_reloca_out (output_bfd, irela, erela); } /* Bump the counter, so that we know where to add the next set of @@ -5346,16 +5531,43 @@ elf_link_input_bfd (finfo, input_bfd) if (esym == external_syms) continue; + if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) + { + asection *ksec; + + /* Save away all section symbol values. */ + if (isec != NULL) + 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 + linker will keep the first of any matching link-once + sections, so we should have already seen it's section + symbol. I trust no-one will have the bright idea of + re-ordering the bfd list... */ + if (isec != NULL + && (bfd_get_section_flags (input_bfd, isec) & SEC_LINK_ONCE) != 0 + && (ksec = isec->kept_section) != NULL) + { + isym->st_value = ksec->symbol->value; + + /* That put the value right, but the section info is all + wrong. I hope this works. */ + isec->output_offset = ksec->output_offset; + isec->output_section = ksec->output_section; + } + + /* We never output section symbols. Instead, we use the + section symbol of the corresponding section in the output + file. */ + continue; + } + /* If we are stripping all symbols, we don't want to output this one. */ if (finfo->info->strip == strip_all) continue; - /* We never output section symbols. Instead, we use the section - symbol of the corresponding section in the output file. */ - if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) - continue; - /* If we are discarding all local symbols, we don't want to output this one. If we are generating a relocateable output file, then some of the local symbols may be required by @@ -5493,7 +5705,7 @@ elf_link_input_bfd (finfo, input_bfd) finfo->sections)) return false; - if (finfo->info->relocateable) + if (finfo->info->relocateable || finfo->info->emitrelocations) { Elf_Internal_Rela *irela; Elf_Internal_Rela *irelaend; @@ -5503,7 +5715,7 @@ elf_link_input_bfd (finfo, input_bfd) /* Adjust the reloc addresses and symbol indices. */ irela = internal_relocs; - irelaend = + 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 @@ -5516,6 +5728,10 @@ elf_link_input_bfd (finfo, input_bfd) irela->r_offset += o->output_offset; + /* Relocs in an executable have to be virtual addresses. */ + if (finfo->info->emitrelocations) + irela->r_offset += o->output_section->vma; + r_symndx = ELF_R_SYM (irela->r_info); if (r_symndx == 0) @@ -5552,7 +5768,7 @@ elf_link_input_bfd (finfo, input_bfd) continue; } - /* This is a reloc against a local symbol. */ + /* This is a reloc against a local symbol. */ *rel_hash = NULL; isym = finfo->internal_syms + r_symndx; @@ -5631,14 +5847,14 @@ elf_link_input_bfd (finfo, input_bfd) /* Swap out the relocs. */ input_rel_hdr = &elf_section_data (o)->rel_hdr; - elf_link_output_relocs (output_bfd, o, + elf_link_output_relocs (output_bfd, o, input_rel_hdr, internal_relocs); - internal_relocs + internal_relocs += input_rel_hdr->sh_size / input_rel_hdr->sh_entsize; input_rel_hdr = elf_section_data (o)->rel_hdr2; if (input_rel_hdr) - elf_link_output_relocs (output_bfd, o, + elf_link_output_relocs (output_bfd, o, input_rel_hdr, internal_relocs); } @@ -5685,6 +5901,7 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) bfd_vma addend; struct elf_link_hash_entry **rel_hash_ptr; Elf_Internal_Shdr *rel_hdr; + struct elf_backend_data *bed = get_elf_backend_data (output_bfd); howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc); if (howto == NULL) @@ -5808,7 +6025,10 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) irel.r_info = ELF_R_INFO (indx, howto->type); erel = ((Elf_External_Rel *) rel_hdr->contents + elf_section_data (output_section)->rel_count); - elf_swap_reloc_out (output_bfd, &irel, erel); + if (bed->s->swap_reloc_out) + (*bed->s->swap_reloc_out) (output_bfd, &irel, (bfd_byte *) erel); + else + elf_swap_reloc_out (output_bfd, &irel, erel); } else { @@ -5820,14 +6040,16 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order) irela.r_addend = addend; erela = ((Elf_External_Rela *) rel_hdr->contents + elf_section_data (output_section)->rel_count); - elf_swap_reloca_out (output_bfd, &irela, erela); + if (bed->s->swap_reloca_out) + (*bed->s->swap_reloca_out) (output_bfd, &irela, (bfd_byte *) erela); + else + elf_swap_reloca_out (output_bfd, &irela, erela); } ++elf_section_data (output_section)->rel_count; return true; } - /* Allocate a pointer to live in a linker created section. */ @@ -5950,7 +6172,6 @@ elf_create_pointer_linker_section (abfd, info, lsect, h, rel) return true; } - #if ARCH_SIZE==64 #define bfd_put_ptr(BFD,VAL,ADDR) bfd_put_64 (BFD, VAL, ADDR) @@ -6177,22 +6398,22 @@ elf_gc_mark (info, sec, gc_mark_hook) { elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s); if (ELF_ST_BIND (s.st_info) == STB_LOCAL) - rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s); + rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); else { h = sym_hashes[r_symndx - extsymoff]; - rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL); + rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL); } } else if (r_symndx >= nlocsyms) { h = sym_hashes[r_symndx - extsymoff]; - rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL); + rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL); } else { elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s); - rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s); + rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); } if (rsec && !rsec->gc_mark) @@ -6263,7 +6484,7 @@ elf_gc_sweep (info, gc_sweep_hook) if (internal_relocs == NULL) return false; - r = (*gc_sweep_hook)(o->owner, info, o, internal_relocs); + r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs); if (!info->keep_memory) free (internal_relocs); @@ -6316,7 +6537,7 @@ elf_gc_propagate_vtable_entries_used (h, okp) struct elf_link_hash_entry *h; PTR okp; { - /* Those that are not vtables. */ + /* Those that are not vtables. */ if (h->vtable_parent == NULL) return true; @@ -6422,7 +6643,7 @@ elf_gc_sections (abfd, info) struct elf_link_hash_entry *h, Elf_Internal_Sym *)); if (!get_elf_backend_data (abfd)->can_gc_sections - || info->relocateable + || info->relocateable || info->emitrelocations || elf_hash_table (info)->dynamic_sections_created) return true; @@ -6558,7 +6779,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend) if (ptr) { ptr = bfd_realloc (ptr - 1, bytes); - + if (ptr != NULL) { size_t oldbytes; @@ -6572,12 +6793,12 @@ elf_gc_record_vtentry (abfd, sec, h, addend) if (ptr == NULL) return false; - + /* And arrange for that done flag to be at index -1. */ h->vtable_entries_used = ptr + 1; h->vtable_entries_size = size; } - + h->vtable_entries_used[addend / FILE_ALIGN] = true; return true; @@ -6634,7 +6855,8 @@ elf_gc_common_finalize_got_offsets (abfd, info) } } - /* Then the global .got and .plt entries. */ + /* Then the global .got entries. .plt refcounts are handled by + adjust_dynamic_symbol */ elf_link_hash_traverse (elf_hash_table (info), elf_gc_allocate_got_offsets, (PTR) &gotoff); diff --git a/contrib/binutils/bfd/elfxx-target.h b/contrib/binutils/bfd/elfxx-target.h index b1f4867..e69036f 100644 --- a/contrib/binutils/bfd/elfxx-target.h +++ b/contrib/binutils/bfd/elfxx-target.h @@ -237,6 +237,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_section_from_shdr #define elf_backend_section_from_shdr 0 #endif +#ifndef elf_backend_section_flags +#define elf_backend_section_flags 0 +#endif #ifndef elf_backend_section_from_phdr #define elf_backend_section_from_phdr 0 #endif @@ -313,7 +316,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol #endif - /* Previously, backends could only use SHT_REL or SHT_RELA relocation sections, but not both. They defined USE_REL to indicate SHT_REL sections, and left it undefined to indicated SHT_RELA sections. @@ -323,16 +325,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #else #undef USE_REL #define USE_REL 1 -#endif +#endif /* Use these in new code. */ -#ifndef elf_backend_may_use_rel_p +#ifndef elf_backend_may_use_rel_p #define elf_backend_may_use_rel_p USE_REL -#endif +#endif #ifndef elf_backend_may_use_rela_p #define elf_backend_may_use_rela_p !USE_REL #endif -#ifndef elf_backend_default_use_rela_p +#ifndef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p !USE_REL #endif @@ -354,6 +356,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern const struct elf_size_info _bfd_elfNN_size_info; +#ifndef INCLUDED_TARGET_FILE static CONST struct elf_backend_data elfNN_bed = { ELF_ARCH, /* arch */ @@ -368,6 +371,7 @@ static CONST struct elf_backend_data elfNN_bed = elf_backend_get_symbol_type, elf_backend_section_processing, elf_backend_section_from_shdr, + elf_backend_section_flags, elf_backend_section_from_phdr, elf_backend_fake_sections, elf_backend_section_from_bfd_section, @@ -413,6 +417,7 @@ static CONST struct elf_backend_data elfNN_bed = elf_backend_can_gc_sections, elf_backend_want_dynbss }; +#endif /* Forward declaration for use when initialising alternative_target field. */ #ifdef TARGET_LITTLE_SYM @@ -603,7 +608,7 @@ const bfd_target TARGET_LITTLE_SYM = #else NULL, #endif - + /* backend_data: */ (PTR) &elfNN_bed }; diff --git a/contrib/binutils/bfd/format.c b/contrib/binutils/bfd/format.c index c9f1f9c..ad4a6a8 100644 --- a/contrib/binutils/bfd/format.c +++ b/contrib/binutils/bfd/format.c @@ -23,7 +23,7 @@ SECTION File formats A format is a BFD concept of high level file contents type. The - formats supported by BFD are: + formats supported by BFD are: o <<bfd_object>> @@ -37,7 +37,6 @@ SECTION The BFD contains the result of an executable core dump. - */ #include "bfd.h" @@ -68,7 +67,7 @@ DESCRIPTION the file, or an error results. The function returns <<true>> on success, otherwise <<false>> - with one of the following error codes: + with one of the following error codes: o <<bfd_error_invalid_operation>> - if <<format>> is not one of <<bfd_object>>, <<bfd_archive>> or @@ -109,7 +108,7 @@ DESCRIPTION Then the user may choose a format and try again. When done with the list that @var{matching} points to, the caller - should free it. + should free it. */ boolean @@ -125,20 +124,20 @@ bfd_check_format_matches (abfd, format, matching) if (!bfd_read_p (abfd) || ((int)(abfd->format) < (int)bfd_unknown) || - ((int)(abfd->format) >= (int)bfd_type_end)) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + ((int)(abfd->format) >= (int)bfd_type_end)) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } if (abfd->format != bfd_unknown) return (abfd->format == format)? true: false; - - /* Since the target type was defaulted, check them + /* Since the target type was defaulted, check them all in the hope that one will be uniquely recognized. */ - save_targ = abfd->xvec; match_count = 0; + if (matching) { matching_vector = @@ -149,119 +148,147 @@ bfd_check_format_matches (abfd, format, matching) matching_vector[0] = NULL; *matching = matching_vector; } - right_targ = 0; + right_targ = 0; - /* presume the answer is yes */ + /* Presume the answer is yes. */ abfd->format = format; /* If the target type was explicitly specified, just check that target. */ + if (!abfd->target_defaulted) + { + if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) /* rewind! */ + return false; - if (!abfd->target_defaulted) { - if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) /* rewind! */ - return false; - right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - if (right_targ) { - abfd->xvec = right_targ; /* Set the target as returned */ - if (matching) - free (matching_vector); - return true; /* File position has moved, BTW */ - } + right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - /* For a long time the code has dropped through to check all - targets if the specified target was wrong. I don't know why, - and I'm reluctant to change it. However, in the case of an - archive, it can cause problems. If the specified target does - not permit archives (e.g., the binary target), then we should - not allow some other target to recognize it as an archive, but - should instead allow the specified target to recognize it as an - object. When I first made this change, it broke the PE target, - because the specified pei-i386 target did not recognize the - actual pe-i386 archive. Since there may be other problems of - this sort, I changed this test to check only for the binary - target. */ - - if (format == bfd_archive && save_targ == &binary_vec) - { - abfd->xvec = save_targ; - abfd->format = bfd_unknown; - if (matching) - free (matching_vector); - bfd_set_error (bfd_error_file_not_recognized); - return false; - } - } + if (right_targ) + { + abfd->xvec = right_targ; /* Set the target as returned. */ - for (target = bfd_target_vector; *target != NULL; target++) { - const bfd_target *temp; + if (matching) + free (matching_vector); - if (*target == &binary_vec) - continue; + return true; /* File position has moved, BTW. */ + } - abfd->xvec = *target; /* Change BFD's target temporarily */ - if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) - return false; - /* If _bfd_check_format neglects to set bfd_error, assume bfd_error_wrong_format. - We didn't used to even pay any attention to bfd_error, so I suspect - that some _bfd_check_format might have this problem. */ - bfd_set_error (bfd_error_wrong_format); - temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - if (temp) { /* This format checks out as ok! */ - right_targ = temp; - if (matching) + /* For a long time the code has dropped through to check all + targets if the specified target was wrong. I don't know why, + and I'm reluctant to change it. However, in the case of an + archive, it can cause problems. If the specified target does + not permit archives (e.g., the binary target), then we should + not allow some other target to recognize it as an archive, but + should instead allow the specified target to recognize it as an + object. When I first made this change, it broke the PE target, + because the specified pei-i386 target did not recognize the + actual pe-i386 archive. Since there may be other problems of + this sort, I changed this test to check only for the binary + target. */ + if (format == bfd_archive && save_targ == &binary_vec) { - matching_vector[match_count] = temp->name; - matching_vector[match_count + 1] = NULL; + abfd->xvec = save_targ; + abfd->format = bfd_unknown; + + if (matching) + free (matching_vector); + + bfd_set_error (bfd_error_file_not_recognized); + + return false; } - match_count++; - /* If this is the default target, accept it, even if other targets - might match. People who want those other targets have to set - the GNUTARGET variable. */ - if (temp == bfd_default_vector[0]) - { + } + + for (target = bfd_target_vector; *target != NULL; target++) + { + const bfd_target *temp; + + if (*target == &binary_vec) + continue; + + abfd->xvec = *target; /* Change BFD's target temporarily */ + + if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) + return false; + + /* If _bfd_check_format neglects to set bfd_error, assume + bfd_error_wrong_format. We didn't used to even pay any + attention to bfd_error, so I suspect that some + _bfd_check_format might have this problem. */ + bfd_set_error (bfd_error_wrong_format); + + temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); + + if (temp) + { /* This format checks out as ok! */ + right_targ = temp; + if (matching) { - matching_vector[0] = temp->name; - matching_vector[1] = NULL; + matching_vector[match_count] = temp->name; + matching_vector[match_count + 1] = NULL; + } + + match_count++; + + /* If this is the default target, accept it, even if other + targets might match. People who want those other targets + have to set the GNUTARGET variable. */ + if (temp == bfd_default_vector[0]) + { + if (matching) + { + matching_vector[0] = temp->name; + matching_vector[1] = NULL; + } + match_count = 1; + break; } - match_count = 1; - break; - } #ifdef GNU960 - /* Big- and little-endian b.out archives look the same, but it doesn't - * matter: there is no difference in their headers, and member file byte - * orders will (I hope) be handled appropriately by bfd. Ditto for big - * and little coff archives. And the 4 coff/b.out object formats are - * unambiguous. So accept the first match we find. - */ - break; + /* Big- and little-endian b.out archives look the same, but it + doesn't matter: there is no difference in their headers, and + member file byte orders will (I hope) be handled appropriately + by bfd. Ditto for big and little coff archives. And the 4 + coff/b.out object formats are unambiguous. So accept the + first match we find. */ + break; #endif - } else if (bfd_get_error () != bfd_error_wrong_format) { - abfd->xvec = save_targ; - abfd->format = bfd_unknown; - if (matching && bfd_get_error () != bfd_error_file_ambiguously_recognized) + } + else if (bfd_get_error () != bfd_error_wrong_format) + { + abfd->xvec = save_targ; + abfd->format = bfd_unknown; + + if (matching && bfd_get_error () + != bfd_error_file_ambiguously_recognized) + free (matching_vector); + + return false; + } + } + + if (match_count == 1) + { + abfd->xvec = right_targ; /* Change BFD's target permanently. */ + + if (matching) free (matching_vector); - return false; + + return true; /* File position has moved, BTW. */ } - } - if (match_count == 1) { - abfd->xvec = right_targ; /* Change BFD's target permanently */ - if (matching) - free (matching_vector); - return true; /* File position has moved, BTW */ - } + abfd->xvec = save_targ; /* Restore original target type. */ + abfd->format = bfd_unknown; /* Restore original format. */ - abfd->xvec = save_targ; /* Restore original target type */ - abfd->format = bfd_unknown; /* Restore original format */ if (match_count == 0) { bfd_set_error (bfd_error_file_not_recognized); + if (matching) free (matching_vector); } else bfd_set_error (bfd_error_file_ambiguously_recognized); + return false; } @@ -277,7 +304,6 @@ DESCRIPTION format @var{format}. If the target set in the BFD does not support the format requested, the format is invalid, or the BFD is not open for writing, then an error occurs. - */ boolean @@ -285,29 +311,29 @@ bfd_set_format (abfd, format) bfd *abfd; bfd_format format; { - if (bfd_read_p (abfd) || ((int)abfd->format < (int)bfd_unknown) || - ((int)abfd->format >= (int)bfd_type_end)) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + ((int)abfd->format >= (int)bfd_type_end)) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } if (abfd->format != bfd_unknown) - return (abfd->format == format) ? true:false; + return (abfd->format == format) ? true : false; - /* presume the answer is yes */ + /* Presume the answer is yes. */ abfd->format = format; - if (!BFD_SEND_FMT (abfd, _bfd_set_format, (abfd))) { - abfd->format = bfd_unknown; - return false; - } + if (!BFD_SEND_FMT (abfd, _bfd_set_format, (abfd))) + { + abfd->format = bfd_unknown; + return false; + } return true; } - /* FUNCTION bfd_format_string @@ -325,18 +351,19 @@ CONST char * bfd_format_string (format) bfd_format format; { - if (((int)format <(int) bfd_unknown) - || ((int)format >=(int) bfd_type_end)) + if (((int)format <(int) bfd_unknown) + || ((int)format >=(int) bfd_type_end)) return "invalid"; - - switch (format) { - case bfd_object: - return "object"; /* linker/assember/compiler output */ - case bfd_archive: - return "archive"; /* object archive file */ - case bfd_core: - return "core"; /* core dump */ - default: - return "unknown"; - } + + switch (format) + { + case bfd_object: + return "object"; /* Linker/assember/compiler output. */ + case bfd_archive: + return "archive"; /* Object archive file. */ + case bfd_core: + return "core"; /* Core dump. */ + default: + return "unknown"; + } } diff --git a/contrib/binutils/bfd/freebsd.h b/contrib/binutils/bfd/freebsd.h index e80c213..0203d99 100644 --- a/contrib/binutils/bfd/freebsd.h +++ b/contrib/binutils/bfd/freebsd.h @@ -59,7 +59,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. format. I think. */ #define SWAP_MAGIC(ext) bfd_getl32 (ext) - #define MY_write_object_contents MY(write_object_contents) static boolean MY(write_object_contents) PARAMS ((bfd *abfd)); diff --git a/contrib/binutils/bfd/hash.c b/contrib/binutils/bfd/hash.c index 173eaf76..a1bca28 100644 --- a/contrib/binutils/bfd/hash.c +++ b/contrib/binutils/bfd/hash.c @@ -268,7 +268,7 @@ SUBSUBSECTION Write other derived routines You will want to write other routines for your new hash table, - as well. + as well. You will want an initialization routine which calls the initialization routine of the hash table you are deriving from @@ -366,7 +366,7 @@ bfd_hash_lookup (table, string, create, copy) struct bfd_hash_entry *hashp; unsigned int len; unsigned int index; - + hash = 0; len = 0; s = (const unsigned char *) string; diff --git a/contrib/binutils/bfd/ieee.c b/contrib/binutils/bfd/ieee.c index 71b967a..70f0d13 100644 --- a/contrib/binutils/bfd/ieee.c +++ b/contrib/binutils/bfd/ieee.c @@ -1343,27 +1343,21 @@ ieee_archive_p (abfd) ieee->h.abfd = abfd; if (this_byte (&(ieee->h)) != Module_Beginning) - { - abfd->tdata.ieee_ar_data = save; - goto got_wrong_format_error; - } + goto got_wrong_format_error; next_byte (&(ieee->h)); library = read_id (&(ieee->h)); if (strcmp (library, "LIBRARY") != 0) - { - bfd_release (abfd, ieee); - abfd->tdata.ieee_ar_data = save; - goto got_wrong_format_error; - } - /* Throw away the filename */ + goto got_wrong_format_error; + + /* Throw away the filename. */ read_id (&(ieee->h)); ieee->element_count = 0; ieee->element_index = 0; - next_byte (&(ieee->h)); /* Drop the ad part */ - must_parse_int (&(ieee->h)); /* And the two dummy numbers */ + next_byte (&(ieee->h)); /* Drop the ad part. */ + must_parse_int (&(ieee->h)); /* And the two dummy numbers. */ must_parse_int (&(ieee->h)); alc_elts = 10; @@ -1371,7 +1365,7 @@ ieee_archive_p (abfd) if (elts == NULL) goto error_return; - /* Read the index of the BB table */ + /* Read the index of the BB table. */ while (1) { int rec; @@ -1400,14 +1394,14 @@ ieee_archive_p (abfd) t->file_offset = must_parse_int (&(ieee->h)); t->abfd = (bfd *) NULL; - /* Make sure that we don't go over the end of the buffer */ - + /* Make sure that we don't go over the end of the buffer. */ if ((size_t) ieee_pos (abfd) > sizeof (buffer) / 2) { - /* Past half way, reseek and reprime */ + /* Past half way, reseek and reprime. */ buffer_offset += ieee_pos (abfd); if (bfd_seek (abfd, buffer_offset, SEEK_SET) != 0) goto error_return; + /* FIXME: Check return value. I'm not sure whether it needs to read the entire buffer or not. */ bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); @@ -1421,36 +1415,33 @@ ieee_archive_p (abfd) ieee->element_count * sizeof *ieee->elements)); if (ieee->elements == NULL) goto error_return; + memcpy (ieee->elements, elts, ieee->element_count * sizeof *ieee->elements); free (elts); elts = NULL; - /* Now scan the area again, and replace BB offsets with file */ - /* offsets */ - + /* Now scan the area again, and replace BB offsets with file offsets. */ for (i = 2; i < ieee->element_count; i++) { if (bfd_seek (abfd, ieee->elements[i].file_offset, SEEK_SET) != 0) goto error_return; + /* FIXME: Check return value. I'm not sure whether it needs to read the entire buffer or not. */ bfd_read ((PTR) buffer, 1, sizeof (buffer), abfd); ieee->h.first_byte = buffer; ieee->h.input_p = buffer; - next_byte (&(ieee->h)); /* Drop F8 */ - next_byte (&(ieee->h)); /* Drop 14 */ - must_parse_int (&(ieee->h)); /* Drop size of block */ + next_byte (&(ieee->h)); /* Drop F8. */ + next_byte (&(ieee->h)); /* Drop 14. */ + must_parse_int (&(ieee->h)); /* Drop size of block. */ + if (must_parse_int (&(ieee->h)) != 0) - { - /* This object has been deleted */ - ieee->elements[i].file_offset = 0; - } + /* This object has been deleted. */ + ieee->elements[i].file_offset = 0; else - { - ieee->elements[i].file_offset = must_parse_int (&(ieee->h)); - } + ieee->elements[i].file_offset = must_parse_int (&(ieee->h)); } /* abfd->has_armap = ;*/ @@ -1458,10 +1449,14 @@ ieee_archive_p (abfd) return abfd->xvec; got_wrong_format_error: + bfd_release (abfd, ieee); + abfd->tdata.ieee_ar_data = save; bfd_set_error (bfd_error_wrong_format); + error_return: if (elts != NULL) free (elts); + return NULL; } @@ -3197,11 +3192,8 @@ relocate_debug (output, input) block (); } -/* - During linking, we we told about the bfds which made up our - contents, we have a list of them. They will still be open, so go to - the debug info in each, and copy it out, relocating it as we go. -*/ +/* Gather together all the debug information from each input BFD into + one place, relocating it and emitting it as we go. */ static boolean ieee_write_debug_part (abfd) @@ -3728,7 +3720,7 @@ ieee_make_empty_symbol (abfd) bfd *abfd; { ieee_symbol_type *new = - (ieee_symbol_type *) bfd_zmalloc (sizeof (ieee_symbol_type)); + (ieee_symbol_type *) bfd_zalloc (abfd, sizeof (ieee_symbol_type)); if (!new) return NULL; new->symbol.the_bfd = abfd; diff --git a/contrib/binutils/bfd/libaout.h b/contrib/binutils/bfd/libaout.h index 7001d3d..1682428 100644 --- a/contrib/binutils/bfd/libaout.h +++ b/contrib/binutils/bfd/libaout.h @@ -245,7 +245,8 @@ enum machine_type { M_SPARCLET_5 = 211, /* 0xd3, reserved */ M_SPARCLET_6 = 227, /* 0xe3, reserved */ /* M_SPARCLET_7 = 243 / * 0xf3, reserved */ - M_SPARCLITE_LE = 243 + M_SPARCLITE_LE = 243, + M_CRIS = 255 /* Axis CRIS binary. */ }; #define N_DYNAMIC(exec) ((exec).a_info & 0x80000000) diff --git a/contrib/binutils/bfd/libbfd-in.h b/contrib/binutils/bfd/libbfd-in.h index aece1e1..fb5f210 100644 --- a/contrib/binutils/bfd/libbfd-in.h +++ b/contrib/binutils/bfd/libbfd-in.h @@ -59,9 +59,9 @@ struct artdata { file_ptr first_file_filepos; /* Speed up searching the armap */ struct ar_cache *cache; - bfd *archive_head; /* Only interesting in output routines */ + bfd *archive_head; /* Only interesting in output routines */ carsym *symdefs; /* the symdef entries */ - symindex symdef_count; /* how many there are */ + symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ /* when more compilers are standard C, this can be a time_t */ long armap_timestamp; /* Timestamp value written into armap. @@ -79,9 +79,9 @@ struct artdata { /* Goes in bfd's arelt_data slot */ struct areltdata { - char * arch_header; /* it's actually a string */ - unsigned int parsed_size; /* octets of filesize not including ar_hdr */ - char *filename; /* null-terminated */ + char * arch_header; /* it's actually a string */ + unsigned int parsed_size; /* octets of filesize not including ar_hdr */ + char *filename; /* null-terminated */ }; #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size) @@ -128,11 +128,11 @@ void bfd_void PARAMS ((bfd *ignore)); bfd *_bfd_new_bfd_contained_in PARAMS ((bfd *)); const bfd_target *_bfd_dummy_target PARAMS ((bfd *abfd)); -void bfd_dont_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, +void bfd_dont_truncate_arname PARAMS ((bfd *abfd, const char *filename, char *hdr)); -void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, +void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, const char *filename, char *hdr)); -void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, +void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, const char *filename, char *hdr)); boolean bsd_write_armap PARAMS ((bfd *arch, unsigned int elength, @@ -365,7 +365,8 @@ extern boolean _bfd_dwarf1_find_nearest_line /* Find the nearest line using DWARF 2 debugging information. */ extern boolean _bfd_dwarf2_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *, unsigned int)); + const char **, unsigned int *, unsigned int, + PTR *)); /* A routine to create entries for a bfd_link_hash_table. */ extern struct bfd_hash_entry *_bfd_link_hash_newfunc diff --git a/contrib/binutils/bfd/libbfd.c b/contrib/binutils/bfd/libbfd.c index 881af73..8b846f0 100644 --- a/contrib/binutils/bfd/libbfd.c +++ b/contrib/binutils/bfd/libbfd.c @@ -42,7 +42,6 @@ DESCRIPTION /* A routine which is used in target vectors for unsupported operations. */ -/*ARGSUSED*/ boolean bfd_false (ignore) bfd *ignore ATTRIBUTE_UNUSED; @@ -54,7 +53,6 @@ bfd_false (ignore) /* A routine which is used in target vectors for supported operations which do not actually do anything. */ -/*ARGSUSED*/ boolean bfd_true (ignore) bfd *ignore ATTRIBUTE_UNUSED; @@ -65,7 +63,6 @@ bfd_true (ignore) /* A routine which is used in target vectors for unsupported operations which return a pointer value. */ -/*ARGSUSED*/ PTR bfd_nullvoidptr (ignore) bfd *ignore ATTRIBUTE_UNUSED; @@ -74,23 +71,20 @@ bfd_nullvoidptr (ignore) return NULL; } -/*ARGSUSED*/ -int +int bfd_0 (ignore) bfd *ignore ATTRIBUTE_UNUSED; { return 0; } -/*ARGSUSED*/ -unsigned int +unsigned int bfd_0u (ignore) bfd *ignore ATTRIBUTE_UNUSED; { return 0; } -/*ARGUSED*/ long bfd_0l (ignore) bfd *ignore ATTRIBUTE_UNUSED; @@ -101,7 +95,6 @@ bfd_0l (ignore) /* A routine which is used in target vectors for unsupported operations which return -1 on error. */ -/*ARGSUSED*/ long _bfd_n1 (ignore_abfd) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -110,14 +103,12 @@ _bfd_n1 (ignore_abfd) return -1; } -/*ARGSUSED*/ -void +void bfd_void (ignore) bfd *ignore ATTRIBUTE_UNUSED; { } -/*ARGSUSED*/ boolean _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) bfd *ignore_core_bfd ATTRIBUTE_UNUSED; @@ -130,7 +121,6 @@ _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) /* Routine to handle core_file_failing_command entry point for targets without core file support. */ -/*ARGSUSED*/ char * _bfd_nocore_core_file_failing_command (ignore_abfd) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -142,7 +132,6 @@ _bfd_nocore_core_file_failing_command (ignore_abfd) /* Routine to handle core_file_failing_signal entry point for targets without core file support. */ -/*ARGSUSED*/ int _bfd_nocore_core_file_failing_signal (ignore_abfd) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -151,7 +140,6 @@ _bfd_nocore_core_file_failing_signal (ignore_abfd) return 0; } -/*ARGSUSED*/ const bfd_target * _bfd_dummy_target (ignore_abfd) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -217,13 +205,12 @@ bfd_zmalloc (size) /* Some IO code */ - /* Note that archive entries don't have streams; they share their parent's. This allows someone to play with the iostream behind BFD's back. Also, note that the origin pointer points to the beginning of a file's contents (0 for non-archive elements). For archive entries this is the - first octet in the file, NOT the beginning of the archive header. */ + first octet in the file, NOT the beginning of the archive header. */ static int real_read (where, a,b, file) @@ -285,7 +272,7 @@ bfd_read (ptr, size, nitems, abfd) return get; } - nread = real_read (ptr, 1, (size_t)(size*nitems), bfd_cache_lookup(abfd)); + nread = real_read (ptr, 1, (size_t) (size*nitems), bfd_cache_lookup(abfd)); if (nread > 0) abfd->where += nread; @@ -317,7 +304,7 @@ struct _bfd_window_internal { struct _bfd_window_internal *next; PTR data; bfd_size_type size; - int refcount : 31; /* should be enough... */ + int refcount : 31; /* should be enough... */ unsigned mapped : 1; /* 1 = mmap, 0 = malloc */ }; @@ -671,7 +658,7 @@ bfd_seek (abfd, position, direction) file_ptr file_position; /* For the time being, a BFD may not seek to it's end. The problem is that we don't easily have a way to recognize the end of an - element in an archive. */ + element in an archive. */ BFD_ASSERT (direction == SEEK_SET || direction == SEEK_CUR); @@ -683,19 +670,39 @@ bfd_seek (abfd, position, direction) struct bfd_in_memory *bim; bim = (struct bfd_in_memory *) abfd->iostream; - + if (direction == SEEK_SET) abfd->where = position; else abfd->where += position; - + if ((bfd_size_type) abfd->where > bim->size) { - abfd->where = bim->size; - bfd_set_error (bfd_error_file_truncated); - return -1; + if ((abfd->direction == write_direction) || + (abfd->direction == both_direction)) + { + long newsize, oldsize = (bim->size + 127) & ~127; + bim->size = abfd->where; + /* Round up to cut down on memory fragmentation */ + newsize = (bim->size + 127) & ~127; + if (newsize > oldsize) + { + bim->buffer = bfd_realloc (bim->buffer, newsize); + if (bim->buffer == 0) + { + bim->size = 0; + bfd_set_error (bfd_error_no_memory); + return -1; + } + } + } + else + { + abfd->where = bim->size; + bfd_set_error (bfd_error_file_truncated); + return -1; + } } - return 0; } @@ -776,7 +783,7 @@ bfd_seek (abfd, position, direction) /* FIXME: Should these take a count argument? Answer (gnu@cygnus.com): No, but perhaps they should be inline - functions in swap.h #ifdef __GNUC__. + functions in swap.h #ifdef __GNUC__. Gprof them later and find out. */ /* @@ -807,13 +814,13 @@ DESCRIPTION .{* Byte swapping macros for user section data. *} . .#define bfd_put_8(abfd, val, ptr) \ -. ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val))) +. ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val))) .#define bfd_put_signed_8 \ . bfd_put_8 .#define bfd_get_8(abfd, ptr) \ -. (*(unsigned char *)(ptr)) +. (*(unsigned char *) (ptr)) .#define bfd_get_signed_8(abfd, ptr) \ -. ((*(unsigned char *)(ptr) ^ 0x80) - 0x80) +. ((*(unsigned char *) (ptr) ^ 0x80) - 0x80) . .#define bfd_put_16(abfd, val, ptr) \ . BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) @@ -856,7 +863,7 @@ DESCRIPTION . : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ . : (abort (), (void) 0)) . -*/ +*/ /* FUNCTION @@ -908,7 +915,7 @@ DESCRIPTION .#define bfd_h_get_signed_64(abfd, ptr) \ . BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr)) . -*/ +*/ /* Sign extension to bfd_signed_vma. */ #define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000) @@ -951,17 +958,17 @@ bfd_putb16 (data, addr) bfd_vma data; register bfd_byte *addr; { - addr[0] = (bfd_byte)(data >> 8); + addr[0] = (bfd_byte) (data >> 8); addr[1] = (bfd_byte )data; } void bfd_putl16 (data, addr) - bfd_vma data; + bfd_vma data; register bfd_byte *addr; { addr[0] = (bfd_byte )data; - addr[1] = (bfd_byte)(data >> 8); + addr[1] = (bfd_byte) (data >> 8); } bfd_vma @@ -1116,9 +1123,9 @@ bfd_putb32 (data, addr) bfd_vma data; register bfd_byte *addr; { - addr[0] = (bfd_byte)(data >> 24); - addr[1] = (bfd_byte)(data >> 16); - addr[2] = (bfd_byte)(data >> 8); + addr[0] = (bfd_byte) (data >> 24); + addr[1] = (bfd_byte) (data >> 16); + addr[2] = (bfd_byte) (data >> 8); addr[3] = (bfd_byte)data; } @@ -1128,9 +1135,9 @@ bfd_putl32 (data, addr) register bfd_byte *addr; { addr[0] = (bfd_byte)data; - addr[1] = (bfd_byte)(data >> 8); - addr[2] = (bfd_byte)(data >> 16); - addr[3] = (bfd_byte)(data >> 24); + addr[1] = (bfd_byte) (data >> 8); + addr[2] = (bfd_byte) (data >> 16); + addr[3] = (bfd_byte) (data >> 24); } void @@ -1139,14 +1146,14 @@ bfd_putb64 (data, addr) register bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 - addr[0] = (bfd_byte)(data >> (7*8)); - addr[1] = (bfd_byte)(data >> (6*8)); - addr[2] = (bfd_byte)(data >> (5*8)); - addr[3] = (bfd_byte)(data >> (4*8)); - addr[4] = (bfd_byte)(data >> (3*8)); - addr[5] = (bfd_byte)(data >> (2*8)); - addr[6] = (bfd_byte)(data >> (1*8)); - addr[7] = (bfd_byte)(data >> (0*8)); + addr[0] = (bfd_byte) (data >> (7*8)); + addr[1] = (bfd_byte) (data >> (6*8)); + addr[2] = (bfd_byte) (data >> (5*8)); + addr[3] = (bfd_byte) (data >> (4*8)); + addr[4] = (bfd_byte) (data >> (3*8)); + addr[5] = (bfd_byte) (data >> (2*8)); + addr[6] = (bfd_byte) (data >> (1*8)); + addr[7] = (bfd_byte) (data >> (0*8)); #else BFD_FAIL(); #endif @@ -1158,18 +1165,66 @@ bfd_putl64 (data, addr) register bfd_byte *addr ATTRIBUTE_UNUSED; { #ifdef BFD64 - addr[7] = (bfd_byte)(data >> (7*8)); - addr[6] = (bfd_byte)(data >> (6*8)); - addr[5] = (bfd_byte)(data >> (5*8)); - addr[4] = (bfd_byte)(data >> (4*8)); - addr[3] = (bfd_byte)(data >> (3*8)); - addr[2] = (bfd_byte)(data >> (2*8)); - addr[1] = (bfd_byte)(data >> (1*8)); - addr[0] = (bfd_byte)(data >> (0*8)); + addr[7] = (bfd_byte) (data >> (7*8)); + addr[6] = (bfd_byte) (data >> (6*8)); + addr[5] = (bfd_byte) (data >> (5*8)); + addr[4] = (bfd_byte) (data >> (4*8)); + addr[3] = (bfd_byte) (data >> (3*8)); + addr[2] = (bfd_byte) (data >> (2*8)); + addr[1] = (bfd_byte) (data >> (1*8)); + addr[0] = (bfd_byte) (data >> (0*8)); #else BFD_FAIL(); #endif } + +void +bfd_put_bits (data, addr, bits, big_p) + bfd_vma data; + bfd_byte *addr; + int bits; + boolean big_p; +{ + int i; + int bytes; + + if (bits % 8 != 0) + abort (); + + bytes = bits / 8; + for (i = 0; i < bytes; i++) + { + int index = big_p ? bytes - i - 1 : i; + + addr[index] = (bfd_byte) data; + data >>= 8; + } +} + +bfd_vma +bfd_get_bits (addr, bits, big_p) + bfd_byte *addr; + int bits; + boolean big_p; +{ + bfd_vma data; + int i; + int bytes; + + if (bits % 8 != 0) + abort (); + + data = 0; + bytes = bits / 8; + for (i = 0; i < bytes; i++) + { + int index = big_p ? i : bytes - i - 1; + + data = (data << 8) | addr[index]; + } + + return data; +} /* Default implementation */ @@ -1306,13 +1361,17 @@ _bfd_generic_verify_endian_match (ibfd, obfd) bfd *obfd; { if (ibfd->xvec->byteorder != obfd->xvec->byteorder + && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) { - (*_bfd_error_handler) - ("%s: compiled for a %s endian system and target is %s endian", - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); + const char *msg; + + if (bfd_big_endian (ibfd)) + msg = _("%s: compiled for a big endian system and target is little endian"); + else + msg = _("%s: compiled for a little endian system and target is big endian"); + + (*_bfd_error_handler) (msg, bfd_get_filename (ibfd)); bfd_set_error (bfd_error_wrong_format); return false; diff --git a/contrib/binutils/bfd/libbfd.h b/contrib/binutils/bfd/libbfd.h index d8b5c24..d6e3939 100644 --- a/contrib/binutils/bfd/libbfd.h +++ b/contrib/binutils/bfd/libbfd.h @@ -59,9 +59,9 @@ struct artdata { file_ptr first_file_filepos; /* Speed up searching the armap */ struct ar_cache *cache; - bfd *archive_head; /* Only interesting in output routines */ + bfd *archive_head; /* Only interesting in output routines */ carsym *symdefs; /* the symdef entries */ - symindex symdef_count; /* how many there are */ + symindex symdef_count; /* how many there are */ char *extended_names; /* clever intel extension */ /* when more compilers are standard C, this can be a time_t */ long armap_timestamp; /* Timestamp value written into armap. @@ -79,9 +79,9 @@ struct artdata { /* Goes in bfd's arelt_data slot */ struct areltdata { - char * arch_header; /* it's actually a string */ - unsigned int parsed_size; /* octets of filesize not including ar_hdr */ - char *filename; /* null-terminated */ + char * arch_header; /* it's actually a string */ + unsigned int parsed_size; /* octets of filesize not including ar_hdr */ + char *filename; /* null-terminated */ }; #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size) @@ -128,11 +128,11 @@ void bfd_void PARAMS ((bfd *ignore)); bfd *_bfd_new_bfd_contained_in PARAMS ((bfd *)); const bfd_target *_bfd_dummy_target PARAMS ((bfd *abfd)); -void bfd_dont_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, +void bfd_dont_truncate_arname PARAMS ((bfd *abfd, const char *filename, char *hdr)); -void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, +void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, const char *filename, char *hdr)); -void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, CONST char *filename, +void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, const char *filename, char *hdr)); boolean bsd_write_armap PARAMS ((bfd *arch, unsigned int elength, @@ -365,7 +365,8 @@ extern boolean _bfd_dwarf1_find_nearest_line /* Find the nearest line using DWARF 2 debugging information. */ extern boolean _bfd_dwarf2_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *, unsigned int)); + const char **, unsigned int *, unsigned int, + PTR *)); /* A routine to create entries for a bfd_link_hash_table. */ extern struct bfd_hash_entry *_bfd_link_hash_newfunc @@ -551,10 +552,10 @@ extern boolean _bfd_sh_align_load_span /* And more follows */ -void +void bfd_write_bigendian_4byte_int PARAMS ((bfd *abfd, int i)); -unsigned int +unsigned int bfd_log2 PARAMS ((bfd_vma x)); #define BFD_CACHE_MAX_OPEN 10 @@ -562,15 +563,15 @@ extern bfd *bfd_last_cache; #define bfd_cache_lookup(x) \ ((x)==bfd_last_cache? \ - (FILE*)(bfd_last_cache->iostream): \ + (FILE*) (bfd_last_cache->iostream): \ bfd_cache_lookup_worker(x)) -boolean -bfd_cache_init PARAMS ((bfd *abfd)); +boolean +bfd_cache_init PARAMS ((bfd *abfd)); -boolean -bfd_cache_close PARAMS ((bfd *abfd)); +boolean +bfd_cache_close PARAMS ((bfd *abfd)); -FILE* +FILE* bfd_open_file PARAMS ((bfd *abfd)); FILE * @@ -714,6 +715,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_386_RELATIVE", "BFD_RELOC_386_GOTOFF", "BFD_RELOC_386_GOTPC", + "BFD_RELOC_X86_64_GOT32", + "BFD_RELOC_X86_64_PLT32", + "BFD_RELOC_X86_64_COPY", + "BFD_RELOC_X86_64_GLOB_DAT", + "BFD_RELOC_X86_64_JUMP_SLOT", + "BFD_RELOC_X86_64_RELATIVE", + "BFD_RELOC_X86_64_GOTPCREL", + "BFD_RELOC_X86_64_32S", "BFD_RELOC_NS32K_IMM_8", "BFD_RELOC_NS32K_IMM_16", "BFD_RELOC_NS32K_IMM_32", @@ -765,6 +774,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_I370_D12", "BFD_RELOC_CTOR", "BFD_RELOC_ARM_PCREL_BRANCH", + "BFD_RELOC_ARM_PCREL_BLX", + "BFD_RELOC_THUMB_PCREL_BLX", "BFD_RELOC_ARM_IMMEDIATE", "BFD_RELOC_ARM_ADRL_IMMEDIATE", "BFD_RELOC_ARM_OFFSET_IMM", @@ -809,6 +820,13 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SH_CODE", "BFD_RELOC_SH_DATA", "BFD_RELOC_SH_LABEL", + "BFD_RELOC_SH_LOOP_START", + "BFD_RELOC_SH_LOOP_END", + "BFD_RELOC_SH_COPY", + "BFD_RELOC_SH_GLOB_DAT", + "BFD_RELOC_SH_JMP_SLOT", + "BFD_RELOC_SH_RELATIVE", + "BFD_RELOC_SH_GOTPC", "BFD_RELOC_THUMB_PCREL_BRANCH9", "BFD_RELOC_THUMB_PCREL_BRANCH12", "BFD_RELOC_THUMB_PCREL_BRANCH23", @@ -857,6 +875,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MN10300_32_PCREL", "BFD_RELOC_MN10300_16_PCREL", "BFD_RELOC_TIC30_LDP", + "BFD_RELOC_TIC54X_PARTLS7", + "BFD_RELOC_TIC54X_PARTMS9", + "BFD_RELOC_TIC54X_23", + "BFD_RELOC_TIC54X_16_OF_23", + "BFD_RELOC_TIC54X_MS7_OF_23", "BFD_RELOC_FR30_48", "BFD_RELOC_FR30_20", "BFD_RELOC_FR30_6_IN_4", @@ -889,28 +912,128 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AVR_CALL", "BFD_RELOC_VTABLE_INHERIT", "BFD_RELOC_VTABLE_ENTRY", + "BFD_RELOC_IA64_IMM14", + "BFD_RELOC_IA64_IMM22", + "BFD_RELOC_IA64_IMM64", + "BFD_RELOC_IA64_DIR32MSB", + "BFD_RELOC_IA64_DIR32LSB", + "BFD_RELOC_IA64_DIR64MSB", + "BFD_RELOC_IA64_DIR64LSB", + "BFD_RELOC_IA64_GPREL22", + "BFD_RELOC_IA64_GPREL64I", + "BFD_RELOC_IA64_GPREL32MSB", + "BFD_RELOC_IA64_GPREL32LSB", + "BFD_RELOC_IA64_GPREL64MSB", + "BFD_RELOC_IA64_GPREL64LSB", + "BFD_RELOC_IA64_LTOFF22", + "BFD_RELOC_IA64_LTOFF64I", + "BFD_RELOC_IA64_PLTOFF22", + "BFD_RELOC_IA64_PLTOFF64I", + "BFD_RELOC_IA64_PLTOFF64MSB", + "BFD_RELOC_IA64_PLTOFF64LSB", + "BFD_RELOC_IA64_FPTR64I", + "BFD_RELOC_IA64_FPTR32MSB", + "BFD_RELOC_IA64_FPTR32LSB", + "BFD_RELOC_IA64_FPTR64MSB", + "BFD_RELOC_IA64_FPTR64LSB", + "BFD_RELOC_IA64_PCREL21B", + "BFD_RELOC_IA64_PCREL21BI", + "BFD_RELOC_IA64_PCREL21M", + "BFD_RELOC_IA64_PCREL21F", + "BFD_RELOC_IA64_PCREL22", + "BFD_RELOC_IA64_PCREL60B", + "BFD_RELOC_IA64_PCREL64I", + "BFD_RELOC_IA64_PCREL32MSB", + "BFD_RELOC_IA64_PCREL32LSB", + "BFD_RELOC_IA64_PCREL64MSB", + "BFD_RELOC_IA64_PCREL64LSB", + "BFD_RELOC_IA64_LTOFF_FPTR22", + "BFD_RELOC_IA64_LTOFF_FPTR64I", + "BFD_RELOC_IA64_LTOFF_FPTR64MSB", + "BFD_RELOC_IA64_LTOFF_FPTR64LSB", + "BFD_RELOC_IA64_SEGREL32MSB", + "BFD_RELOC_IA64_SEGREL32LSB", + "BFD_RELOC_IA64_SEGREL64MSB", + "BFD_RELOC_IA64_SEGREL64LSB", + "BFD_RELOC_IA64_SECREL32MSB", + "BFD_RELOC_IA64_SECREL32LSB", + "BFD_RELOC_IA64_SECREL64MSB", + "BFD_RELOC_IA64_SECREL64LSB", + "BFD_RELOC_IA64_REL32MSB", + "BFD_RELOC_IA64_REL32LSB", + "BFD_RELOC_IA64_REL64MSB", + "BFD_RELOC_IA64_REL64LSB", + "BFD_RELOC_IA64_LTV32MSB", + "BFD_RELOC_IA64_LTV32LSB", + "BFD_RELOC_IA64_LTV64MSB", + "BFD_RELOC_IA64_LTV64LSB", + "BFD_RELOC_IA64_IPLTMSB", + "BFD_RELOC_IA64_IPLTLSB", + "BFD_RELOC_IA64_COPY", + "BFD_RELOC_IA64_TPREL22", + "BFD_RELOC_IA64_TPREL64MSB", + "BFD_RELOC_IA64_TPREL64LSB", + "BFD_RELOC_IA64_LTOFF_TP22", + "BFD_RELOC_IA64_LTOFF22X", + "BFD_RELOC_IA64_LDXMOV", + "BFD_RELOC_M68HC11_HI8", + "BFD_RELOC_M68HC11_LO8", + "BFD_RELOC_M68HC11_3B", + "BFD_RELOC_CRIS_BDISP8", + "BFD_RELOC_CRIS_UNSIGNED_5", + "BFD_RELOC_CRIS_SIGNED_6", + "BFD_RELOC_CRIS_UNSIGNED_6", + "BFD_RELOC_CRIS_UNSIGNED_4", + "BFD_RELOC_860_COPY", + "BFD_RELOC_860_GLOB_DAT", + "BFD_RELOC_860_JUMP_SLOT", + "BFD_RELOC_860_RELATIVE", + "BFD_RELOC_860_PC26", + "BFD_RELOC_860_PLT26", + "BFD_RELOC_860_PC16", + "BFD_RELOC_860_LOW0", + "BFD_RELOC_860_SPLIT0", + "BFD_RELOC_860_LOW1", + "BFD_RELOC_860_SPLIT1", + "BFD_RELOC_860_LOW2", + "BFD_RELOC_860_SPLIT2", + "BFD_RELOC_860_LOW3", + "BFD_RELOC_860_LOGOT0", + "BFD_RELOC_860_SPGOT0", + "BFD_RELOC_860_LOGOT1", + "BFD_RELOC_860_SPGOT1", + "BFD_RELOC_860_LOGOTOFF0", + "BFD_RELOC_860_SPGOTOFF0", + "BFD_RELOC_860_LOGOTOFF1", + "BFD_RELOC_860_SPGOTOFF1", + "BFD_RELOC_860_LOGOTOFF2", + "BFD_RELOC_860_LOGOTOFF3", + "BFD_RELOC_860_LOPC", + "BFD_RELOC_860_HIGHADJ", + "BFD_RELOC_860_HAGOT", + "BFD_RELOC_860_HAGOTOFF", + "BFD_RELOC_860_HAPC", + "BFD_RELOC_860_HIGH", + "BFD_RELOC_860_HIGOT", + "BFD_RELOC_860_HIGOTOFF", "@@overflow: BFD_RELOC_UNUSED@@", }; #endif reloc_howto_type * -bfd_default_reloc_type_lookup - PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +bfd_default_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -boolean -bfd_generic_relax_section - PARAMS ((bfd *abfd, +boolean +bfd_generic_relax_section PARAMS ((bfd *abfd, asection *section, struct bfd_link_info *, boolean *)); -boolean -bfd_generic_gc_sections - PARAMS ((bfd *, struct bfd_link_info *)); +boolean +bfd_generic_gc_sections PARAMS ((bfd *, struct bfd_link_info *)); bfd_byte * - -bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, +bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, struct bfd_link_info *link_info, struct bfd_link_order *link_order, bfd_byte *data, @@ -918,19 +1041,18 @@ bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, asymbol **symbols)); extern const bfd_arch_info_type bfd_default_arch_struct; -boolean +boolean bfd_default_set_arch_mach PARAMS ((bfd *abfd, enum bfd_architecture arch, unsigned long mach)); const bfd_arch_info_type * -bfd_default_compatible - PARAMS ((const bfd_arch_info_type *a, +bfd_default_compatible PARAMS ((const bfd_arch_info_type *a, const bfd_arch_info_type *b)); -boolean +boolean bfd_default_scan PARAMS ((const struct bfd_arch_info *info, const char *string)); struct elf_internal_shdr * -bfd_elf_find_section PARAMS ((bfd *abfd, char *name)); +bfd_elf_find_section PARAMS ((bfd *abfd, char *name)); diff --git a/contrib/binutils/bfd/libcoff-in.h b/contrib/binutils/bfd/libcoff-in.h index 9b1a026..e5f5f9e 100644 --- a/contrib/binutils/bfd/libcoff-in.h +++ b/contrib/binutils/bfd/libcoff-in.h @@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define obj_coff_strings(bfd) (coff_data (bfd)->strings) #define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings) #define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes) +#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written) #define obj_coff_local_toc_table(bfd) (coff_data(bfd)->local_toc_sym_map) @@ -83,6 +84,8 @@ typedef struct coff_tdata char *strings; /* If this is true, the strings may not be freed. */ boolean keep_strings; + /* If this is true, the strings have been written out already. */ + boolean strings_written; /* is this a PE format coff file */ int pe; @@ -97,6 +100,9 @@ typedef struct coff_tdata /* Used by coff_find_nearest_line. */ PTR line_info; + /* A place to stash dwarf2 info for this bfd. */ + PTR dwarf2_find_line_info; + /* The timestamp from the COFF file header. */ long timestamp; @@ -126,6 +132,9 @@ struct xcoff_tdata /* Basic COFF information. */ coff_data_type coff; + /* True if this is an XCOFF64 file. */ + boolean xcoff64; + /* True if a large a.out header should be generated. */ boolean full_aouthdr; diff --git a/contrib/binutils/bfd/libcoff.h b/contrib/binutils/bfd/libcoff.h index bee4ce9..5115538 100644 --- a/contrib/binutils/bfd/libcoff.h +++ b/contrib/binutils/bfd/libcoff.h @@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define obj_coff_strings(bfd) (coff_data (bfd)->strings) #define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings) #define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes) +#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written) #define obj_coff_local_toc_table(bfd) (coff_data(bfd)->local_toc_sym_map) @@ -83,6 +84,8 @@ typedef struct coff_tdata char *strings; /* If this is true, the strings may not be freed. */ boolean keep_strings; + /* If this is true, the strings have been written out already. */ + boolean strings_written; /* is this a PE format coff file */ int pe; @@ -97,6 +100,9 @@ typedef struct coff_tdata /* Used by coff_find_nearest_line. */ PTR line_info; + /* A place to stash dwarf2 info for this bfd. */ + PTR dwarf2_find_line_info; + /* The timestamp from the COFF file header. */ long timestamp; @@ -126,6 +132,9 @@ struct xcoff_tdata /* Basic COFF information. */ coff_data_type coff; + /* True if this is an XCOFF64 file. */ + boolean xcoff64; + /* True if a large a.out header should be generated. */ boolean full_aouthdr; @@ -575,32 +584,32 @@ extern boolean ppc_process_before_allocation typedef struct coff_ptr_struct { - /* Remembers the offset from the first symbol in the file for + /* Remembers the offset from the first symbol in the file for this symbol. Generated by coff_renumber_symbols. */ unsigned int offset; - /* Should the value of this symbol be renumbered. Used for + /* Should the value of this symbol be renumbered. Used for XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ unsigned int fix_value : 1; - /* Should the tag field of this symbol be renumbered. + /* Should the tag field of this symbol be renumbered. Created by coff_pointerize_aux. */ unsigned int fix_tag : 1; - /* Should the endidx field of this symbol be renumbered. + /* Should the endidx field of this symbol be renumbered. Created by coff_pointerize_aux. */ unsigned int fix_end : 1; - /* Should the x_csect.x_scnlen field be renumbered. + /* Should the x_csect.x_scnlen field be renumbered. Created by coff_pointerize_aux. */ unsigned int fix_scnlen : 1; - /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the + /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the index into the line number entries. Set by coff_slurp_symbol_table. */ unsigned int fix_line : 1; - /* The container for the symbol structure as read and translated + /* The container for the symbol structure as read and translated from the file. */ union { @@ -610,35 +619,35 @@ union { } combined_entry_type; - /* Each canonical asymbol really looks like this: */ +/* Each canonical asymbol really looks like this: */ typedef struct coff_symbol_struct { - /* The actual symbol which the rest of BFD works with */ + /* The actual symbol which the rest of BFD works with */ asymbol symbol; - /* A pointer to the hidden information for this symbol */ + /* A pointer to the hidden information for this symbol */ combined_entry_type *native; - /* A pointer to the linenumber information for this symbol */ + /* A pointer to the linenumber information for this symbol */ struct lineno_cache_entry *lineno; - /* Have the line numbers been relocated yet ? */ + /* Have the line numbers been relocated yet ? */ boolean done_lineno; } coff_symbol_type; - /* COFF symbol classifications. */ +/* COFF symbol classifications. */ enum coff_symbol_classification { - /* Global symbol. */ + /* Global symbol. */ COFF_SYMBOL_GLOBAL, - /* Common symbol. */ + /* Common symbol. */ COFF_SYMBOL_COMMON, - /* Undefined symbol. */ + /* Undefined symbol. */ COFF_SYMBOL_UNDEFINED, - /* Local symbol. */ + /* Local symbol. */ COFF_SYMBOL_LOCAL, - /* PE section symbol. */ + /* PE section symbol. */ COFF_SYMBOL_PE_SECTION }; @@ -713,6 +722,8 @@ typedef struct boolean _bfd_coff_long_filenames; boolean _bfd_coff_long_section_names; unsigned int _bfd_coff_default_section_alignment_power; + boolean _bfd_coff_force_symnames_in_strings; + unsigned int _bfd_coff_debug_string_prefix_length; void (*_bfd_coff_swap_filehdr_in) PARAMS (( bfd *abfd, PTR ext, @@ -815,12 +826,12 @@ typedef struct struct bfd_link_info *info, bfd *abfd, const char *name, - flagword flags, + flagword flags, asection *section, bfd_vma value, const char *string, boolean copy, - boolean collect, + boolean collect, struct bfd_link_hash_entry **hashp)); boolean (*_bfd_coff_link_output_has_begun) PARAMS (( @@ -910,6 +921,12 @@ typedef struct #define bfd_coff_symname_in_debug(abfd, sym)\ ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) +#define bfd_coff_force_symnames_in_strings(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) + +#define bfd_coff_debug_string_prefix_length(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) + #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ (abfd, file, base, symbol, aux, indaux)) diff --git a/contrib/binutils/bfd/linker.c b/contrib/binutils/bfd/linker.c index 6e9ee65..1fb3cc5 100644 --- a/contrib/binutils/bfd/linker.c +++ b/contrib/binutils/bfd/linker.c @@ -60,7 +60,7 @@ SECTION a.out (in <<aoutx.h>>) and ECOFF (in <<ecoff.c>>). The a.out routines are used as examples throughout this section. -@menu +@menu @* Creating a Linker Hash Table:: @* Adding Symbols to the Hash Table:: @* Performing the Final Link:: @@ -601,7 +601,7 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) struct bfd_link_hash_entry * with no explicit cast required on the call. */ -void +void bfd_link_hash_traverse (table, func, info) struct bfd_link_hash_table *table; boolean (*func) PARAMS ((struct bfd_link_hash_entry *, PTR)); @@ -1361,7 +1361,7 @@ enum link_row enum link_action { - FAIL, /* Abort. */ + FAIL, /* Abort. */ UND, /* Mark symbol undefined. */ WEAK, /* Mark symbol weak undefined. */ DEF, /* Mark symbol defined. */ @@ -1464,7 +1464,7 @@ hash_entry_bfd (h) or destructor names as collect2 does. HASHP, if not NULL, is a place to store the created hash table entry; if *HASHP is not NULL, the caller has already looked up - the hash table entry, and stored it in *HASHP. */ + the hash table entry, and stored it in *HASHP. */ boolean _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, @@ -2054,7 +2054,7 @@ _bfd_generic_final_link (abfd, info) } } } - + return true; } @@ -2452,7 +2452,7 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) r = (arelent *) bfd_alloc (abfd, sizeof (arelent)); if (r == (arelent *) NULL) return false; - + r->address = link_order->offset; r->howto = bfd_reloc_type_lookup (abfd, link_order->u.reloc.p->reloc); if (r->howto == 0) @@ -2524,7 +2524,7 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) break; } ok = bfd_set_section_contents (abfd, sec, (PTR) buf, - (file_ptr) + (file_ptr) (link_order->offset * bfd_octets_per_byte (abfd)), size); free (buf); @@ -2594,7 +2594,7 @@ _bfd_default_link_order (abfd, info, sec, link_order) case bfd_data_link_order: return bfd_set_section_contents (abfd, sec, (PTR) link_order->u.data.contents, - (file_ptr) + (file_ptr) (link_order->offset * bfd_octets_per_byte (abfd)), link_order->size); @@ -2603,7 +2603,6 @@ _bfd_default_link_order (abfd, info, sec, link_order) /* Default routine to handle a bfd_fill_link_order. */ -/*ARGSUSED*/ static boolean default_fill_link_order (abfd, info, sec, link_order) bfd *abfd; @@ -2630,8 +2629,8 @@ default_fill_link_order (abfd, info, sec, link_order) for (i = 1; i < size; i += 2) space[i] = fill; result = bfd_set_section_contents (abfd, sec, space, - (file_ptr) - (link_order->offset * + (file_ptr) + (link_order->offset * bfd_octets_per_byte (abfd)), link_order->size); free (space); @@ -2732,7 +2731,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, if (h != NULL) set_symbol_from_hash (sym, h); } - } + } } /* Get and relocate the section contents. */ @@ -2750,8 +2749,8 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, if (! bfd_set_section_contents (output_bfd, output_section, (PTR) new_contents, (file_ptr) - (link_order->offset * - bfd_octets_per_byte (output_bfd)), + (link_order->offset * + bfd_octets_per_byte (output_bfd)), link_order->size)) goto error_return; @@ -2803,8 +2802,6 @@ DESCRIPTION */ - - boolean _bfd_generic_link_split_section (abfd, sec) bfd *abfd ATTRIBUTE_UNUSED; diff --git a/contrib/binutils/bfd/netbsd-core.c b/contrib/binutils/bfd/netbsd-core.c index 828c2a1..b94c4a1 100644 --- a/contrib/binutils/bfd/netbsd-core.c +++ b/contrib/binutils/bfd/netbsd-core.c @@ -16,7 +16,7 @@ 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. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <sys/core.h> /* - * FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof(struct trapframe)) + * FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof (struct trapframe)) */ struct netbsd_core_struct { @@ -98,7 +98,7 @@ netbsd_core_file_p (abfd) offset += core.c_seghdrsize; - asect = (asection *) bfd_zalloc (abfd, sizeof(asection)); + asect = (asection *) bfd_zalloc (abfd, sizeof (asection)); if (asect == NULL) { bfd_set_error(bfd_error_no_memory); goto punt; @@ -118,7 +118,7 @@ netbsd_core_file_p (abfd) asect->name = ".reg"; asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS; #ifdef CORE_FPU_OFFSET - /* Hackish... */ + /* Hackish... */ asect->_raw_size = CORE_FPU_OFFSET; asect2 = (asection *)bfd_zalloc (abfd, sizeof (asection)); @@ -193,9 +193,9 @@ netbsd_core_file_matches_executable_p (core_bfd, exec_bfd) /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -236,7 +236,7 @@ const bfd_target netbsd_core_vec = bfd_false, bfd_false, bfd_false, bfd_false }, - + BFD_JUMP_TABLE_GENERIC (_bfd_generic), BFD_JUMP_TABLE_COPY (_bfd_generic), BFD_JUMP_TABLE_CORE (netbsd), @@ -248,6 +248,6 @@ const bfd_target netbsd_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/contrib/binutils/bfd/netbsd.h b/contrib/binutils/bfd/netbsd.h index 760ed95..d717824 100644 --- a/contrib/binutils/bfd/netbsd.h +++ b/contrib/binutils/bfd/netbsd.h @@ -19,33 +19,33 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Check for our machine type (part of magic number). */ +/* Check for our machine type (part of magic number). */ #ifndef MACHTYPE_OK #define MACHTYPE_OK(m) ((m) == DEFAULT_MID || (m) == M_UNKNOWN) #endif -/* This is the normal load address for executables. */ +/* This is the normal load address for executables. */ #define TEXT_START_ADDR TARGET_PAGE_SIZE /* NetBSD ZMAGIC has its header in the text segment. */ #define N_HEADER_IN_TEXT(x) 1 -/* Determine if this is a shared library using the flags. */ +/* Determine if this is a shared library using the flags. */ #define N_SHARED_LIB(x) (N_DYNAMIC(x)) /* We have 6 bits of flags and 10 bits of machine ID. */ #define N_MACHTYPE(exec) \ - ((enum machine_type)(((exec).a_info >> 16) & 0x03ff)) + ((enum machine_type) (((exec).a_info >> 16) & 0x03ff)) #define N_FLAGS(exec) \ (((exec).a_info >> 26) & 0x3f) #define N_SET_INFO(exec, magic, type, flags) \ ((exec).a_info = ((magic) & 0xffff) \ - | (((int)(type) & 0x3ff) << 16) \ + | (((int) (type) & 0x3ff) << 16) \ | (((flags) & 0x3f) << 24)) #define N_SET_MACHTYPE(exec, machtype) \ ((exec).a_info = \ - ((exec).a_info & 0xfb00ffff) | ((((int)(machtype))&0x3ff) << 16)) + ((exec).a_info & 0xfb00ffff) | ((((int) (machtype))&0x3ff) << 16)) #define N_SET_FLAGS(exec, flags) \ ((exec).a_info = \ ((exec).a_info & 0x03ffffff) | ((flags & 0x03f) << 26)) diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c index 57ca0d0a2..39947da 100644 --- a/contrib/binutils/bfd/opncls.c +++ b/contrib/binutils/bfd/opncls.c @@ -1,5 +1,5 @@ /* opncls.c -- open and close a BFD. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -248,7 +248,7 @@ bfd_fdopenr (filename, target, fd) be written through, although doing so requires that we end the previous clause with a preposition. */ /* (O_ACCMODE) parens are to avoid Ultrix header file bug */ - switch (fdflags & O_ACCMODE) + switch (fdflags & (O_ACCMODE)) { case O_RDONLY: nbfd->direction = read_direction; break; case O_WRONLY: nbfd->direction = write_direction; break; diff --git a/contrib/binutils/bfd/pe-arm.c b/contrib/binutils/bfd/pe-arm.c index 6c6b659..a4e128b 100644 --- a/contrib/binutils/bfd/pe-arm.c +++ b/contrib/binutils/bfd/pe-arm.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PCRELOFFSET true #define COFF_LONG_SECTION_NAMES -#ifndef bfd_arm_allocate_interworking_sections +#ifndef bfd_arm_allocate_interworking_sections #define bfd_arm_allocate_interworking_sections \ bfd_arm_pe_allocate_interworking_sections #define bfd_arm_get_bfd_for_interworking \ @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_arm_process_before_allocation \ bfd_arm_pe_process_before_allocation #endif - + #ifdef ARM_WINCE #define TARGET_UNDERSCORE 0 #endif diff --git a/contrib/binutils/bfd/pe-i386.c b/contrib/binutils/bfd/pe-i386.c index a2eb784..1e7e66e 100644 --- a/contrib/binutils/bfd/pe-i386.c +++ b/contrib/binutils/bfd/pe-i386.c @@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" - #define TARGET_SYM i386pe_vec #define TARGET_NAME "pe-i386" #define COFF_WITH_PE diff --git a/contrib/binutils/bfd/pe-ppc.c b/contrib/binutils/bfd/pe-ppc.c index 7d4a547..f96e68b 100644 --- a/contrib/binutils/bfd/pe-ppc.c +++ b/contrib/binutils/bfd/pe-ppc.c @@ -21,7 +21,6 @@ Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" - #define E_FILENMLEN 18 #define PPC_PE diff --git a/contrib/binutils/bfd/po/POTFILES.in b/contrib/binutils/bfd/po/POTFILES.in index 409bf1d..f75b4ca 100644 --- a/contrib/binutils/bfd/po/POTFILES.in +++ b/contrib/binutils/bfd/po/POTFILES.in @@ -4,6 +4,7 @@ aout32.c aout64.c aout-adobe.c aout-arm.c +aout-cris.c aoutf1.h aout-ns32k.c aout-sparcle.c @@ -21,6 +22,7 @@ cf-i386lynx.c cf-m68klynx.c cf-sparclynx.c cisco-core.c +coff64-rs6000.c coff-a29k.c coff-alpha.c coff-apollo.c @@ -46,6 +48,7 @@ coff-stgo32.c coff-svm68k.c coffswap.h coff-tic30.c +coff-tic54x.c coff-tic80.c coff-u68k.c coff-w65.c @@ -57,6 +60,7 @@ cpu-alpha.c cpu-arc.c cpu-arm.c cpu-avr.c +cpu-cris.c cpu-d10v.c cpu-d30v.c cpu-fr30.c @@ -67,9 +71,12 @@ cpu-i370.c cpu-i386.c cpu-i860.c cpu-i960.c +cpu-ia64.c cpu-m10200.c cpu-m10300.c cpu-m32r.c +cpu-m68hc11.c +cpu-m68hc12.c cpu-m68k.c cpu-m88k.c cpu-mcore.c @@ -81,6 +88,7 @@ cpu-rs6000.c cpu-sh.c cpu-sparc.c cpu-tic30.c +cpu-tic54x.c cpu-tic80.c cpu-v850.c cpu-vax.c @@ -93,19 +101,26 @@ dwarf2.c ecoff.c ecofflink.c ecoffswap.h +efi-app-ia32.c +efi-app-ia64.c elf32-arc.c elf32-arm.h elf32-avr.c elf32.c +elf32-cris.c elf32-d10v.c elf32-d30v.c elf32-fr30.c elf32-gen.c +elf32-hppa.c +elf32-hppa.h elf32-i370.c elf32-i386.c elf32-i860.c elf32-i960.c elf32-m32r.c +elf32-m68hc11.c +elf32-m68hc12.c elf32-m68k.c elf32-m88k.c elf32-mcore.c @@ -113,19 +128,24 @@ elf32-mips.c elf32-pj.c elf32-ppc.c elf32-sh.c +elf32-sh-lin.c elf32-sparc.c elf32-v850.c elf64-alpha.c elf64.c elf64-gen.c +elf64-hppa.c +elf64-hppa.h elf64-mips.c elf64-sparc.c +elf64-x86-64.c elfarm-nabi.c elfarm-oabi.c elf-bfd.h elf.c elfcode.h elfcore.h +elf-hppa.h elflink.c elflink.h elf-m10200.c @@ -232,3 +252,4 @@ vms-hdr.c vms-misc.c vms-tir.c xcofflink.c +xcoff-target.h diff --git a/contrib/binutils/bfd/po/bfd.pot b/contrib/binutils/bfd/po/bfd.pot index b08ec36..e77b05d 100644 --- a/contrib/binutils/bfd/po/bfd.pot +++ b/contrib/binutils/bfd/po/bfd.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-04-04 22:10+0930\n" +"POT-Creation-Date: 2001-01-11 11:54-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -14,140 +14,155 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: aout-adobe.c:183 +#: aout-adobe.c:189 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "" -#: aoutx.h:1244 aoutx.h:1658 +#: aout-cris.c:205 +#, c-format +msgid "%s: Invalid relocation type exported: %d" +msgstr "" + +#: aout-cris.c:249 +#, c-format +msgid "%s: Invalid relocation type imported: %d" +msgstr "" + +#: aout-cris.c:260 +#, c-format +msgid "%s: Bad relocation record imported: %d" +msgstr "" + +#: aoutx.h:1259 aoutx.h:1673 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1628 +#: aoutx.h:1643 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1630 +#: aoutx.h:1645 msgid "*unknown*" msgstr "" -#: aoutx.h:3674 +#: aoutx.h:3684 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "" -#: archive.c:1724 +#: archive.c:1820 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:1990 +#: archive.c:2086 msgid "Reading archive file mod timestamp" msgstr "" #. FIXME: bfd can't call perror. -#: archive.c:2014 +#: archive.c:2113 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:274 +#: bfd.c:273 msgid "No error" msgstr "" -#: bfd.c:275 +#: bfd.c:274 msgid "System call error" msgstr "" -#: bfd.c:276 +#: bfd.c:275 msgid "Invalid bfd target" msgstr "" -#: bfd.c:277 +#: bfd.c:276 msgid "File in wrong format" msgstr "" -#: bfd.c:278 +#: bfd.c:277 msgid "Invalid operation" msgstr "" -#: bfd.c:279 +#: bfd.c:278 msgid "Memory exhausted" msgstr "" -#: bfd.c:280 +#: bfd.c:279 msgid "No symbols" msgstr "" -#: bfd.c:281 +#: bfd.c:280 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:282 +#: bfd.c:281 msgid "No more archived files" msgstr "" -#: bfd.c:283 +#: bfd.c:282 msgid "Malformed archive" msgstr "" -#: bfd.c:284 +#: bfd.c:283 msgid "File format not recognized" msgstr "" -#: bfd.c:285 +#: bfd.c:284 msgid "File format is ambiguous" msgstr "" -#: bfd.c:286 +#: bfd.c:285 msgid "Section has no contents" msgstr "" -#: bfd.c:287 +#: bfd.c:286 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:288 +#: bfd.c:287 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:289 +#: bfd.c:288 msgid "Bad value" msgstr "" -#: bfd.c:290 +#: bfd.c:289 msgid "File truncated" msgstr "" -#: bfd.c:291 +#: bfd.c:290 msgid "File too big" msgstr "" -#: bfd.c:292 +#: bfd.c:291 msgid "#<Invalid error code>" msgstr "" -#: bfd.c:679 +#: bfd.c:675 #, c-format msgid "bfd assertion fail %s:%d" msgstr "" -#: bfd.c:697 +#: bfd.c:693 #, c-format msgid "BFD internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:701 +#: bfd.c:697 #, c-format msgid "BFD internal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:703 +#: bfd.c:699 msgid "Please report this bug.\n" msgstr "" -#: binary.c:298 +#: binary.c:303 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" @@ -156,19 +171,19 @@ msgstr "" msgid "Missing IHCONST" msgstr "" -#: coff-a29k.c:182 +#: coff-a29k.c:181 msgid "Missing IHIHALF" msgstr "" -#: coff-a29k.c:214 +#: coff-a29k.c:213 msgid "Unrecognized reloc" msgstr "" -#: coff-a29k.c:427 +#: coff-a29k.c:425 msgid "missing IHCONST reloc" msgstr "" -#: coff-a29k.c:518 +#: coff-a29k.c:516 msgid "missing IHIHALF reloc" msgstr "" @@ -176,126 +191,126 @@ msgstr "" msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1486 elf64-alpha.c:3990 +#: coff-alpha.c:1486 elf64-alpha.c:4004 msgid "using multiple gp values" msgstr "" -#: coff-alpha.c:1992 coff-mips.c:1435 +#: coff-alpha.c:1992 coff-mips.c:1434 msgid "GP relative relocation when GP not defined" msgstr "" -#: coff-arm.c:1020 elf32-arm.h:258 +#: coff-arm.c:1018 elf32-arm.h:246 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1049 elf32-arm.h:291 +#: coff-arm.c:1047 elf32-arm.h:281 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1331 coff-arm.c:1426 elf32-arm.h:857 elf32-arm.h:955 +#: coff-arm.c:1335 coff-arm.c:1430 elf32-arm.h:841 elf32-arm.h:946 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "" -#: coff-arm.c:1335 elf32-arm.h:958 +#: coff-arm.c:1339 elf32-arm.h:949 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr "" -#: coff-arm.c:1430 elf32-arm.h:860 +#: coff-arm.c:1434 elf32-arm.h:844 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr "" -#: coff-arm.c:1433 +#: coff-arm.c:1437 msgid " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1722 coff-tic80.c:682 cofflink.c:2980 +#: coff-arm.c:1726 coff-tic80.c:682 cofflink.c:2991 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "" -#: coff-arm.c:2060 +#: coff-arm.c:2063 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2189 +#: coff-arm.c:2191 #, c-format msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" msgstr "" -#: coff-arm.c:2204 +#: coff-arm.c:2206 #, c-format msgid "" "%s: ERROR: passes floats in float registers whereas target %s uses integer " "registers" msgstr "" -#: coff-arm.c:2207 +#: coff-arm.c:2209 #, c-format msgid "" "%s: ERROR: passes floats in integer registers whereas target %s uses float " "registers" msgstr "" -#: coff-arm.c:2222 +#: coff-arm.c:2224 #, c-format msgid "" "%s: ERROR: compiled as position independent code, whereas target %s is " "absolute position" msgstr "" -#: coff-arm.c:2225 +#: coff-arm.c:2227 #, c-format msgid "" "%s: ERROR: compiled as absolute position code, whereas target %s is position " "independent" msgstr "" -#: coff-arm.c:2254 +#: coff-arm.c:2256 #, c-format msgid "Warning: input file %s supports interworking, whereas %s does not." msgstr "" -#: coff-arm.c:2257 +#: coff-arm.c:2259 #, c-format msgid "Warning: input file %s does not support interworking, whereas %s does." msgstr "" -#: coff-arm.c:2285 +#: coff-arm.c:2286 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2293 elf32-arm.h:2089 +#: coff-arm.c:2294 elf32-arm.h:2210 msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2295 elf32-arm.h:2091 +#: coff-arm.c:2296 msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2298 elf32-arm.h:2094 +#: coff-arm.c:2299 elf32-arm.h:2213 msgid " [position independent]" msgstr "" -#: coff-arm.c:2300 elf32-arm.h:2096 +#: coff-arm.c:2301 msgid " [absolute position]" msgstr "" -#: coff-arm.c:2304 +#: coff-arm.c:2305 msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2306 +#: coff-arm.c:2307 msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2308 +#: coff-arm.c:2309 msgid " [interworking not supported]" msgstr "" @@ -311,42 +326,47 @@ msgstr "" msgid "Warning: Clearing the interworking flag of %s due to outside request" msgstr "" -#: coffcode.h:3965 +#: coffcode.h:2136 +#, c-format +msgid "Unrecognized TI COFF target id '0x%x'" +msgstr "" + +#: coffcode.h:4194 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "" -#: coffcode.h:3979 +#: coffcode.h:4208 #, c-format msgid "%s: warning: duplicate line number information for `%s'" msgstr "" -#: coffcode.h:4334 +#: coffcode.h:4568 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: coffcode.h:4465 +#: coffcode.h:4699 #, c-format msgid "warning: %s: local symbol `%s' has no section" msgstr "" -#: coffcode.h:4578 +#: coff-tic54x.c:376 coffcode.h:4810 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" -#: coffcode.h:4616 +#: coffcode.h:4848 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "" -#: coffgen.c:1613 +#: coffgen.c:1631 #, c-format msgid "%s: bad string table size %lu" msgstr "" -#: coffgen.c:2076 +#: coffgen.c:2093 #, c-format msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" msgstr "" @@ -355,296 +375,426 @@ msgstr "" msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: cofflink.c:518 elflink.h:1568 +#: cofflink.c:526 elflink.h:1648 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "" -#: cofflink.c:2285 +#: cofflink.c:2289 #, c-format msgid "%s: relocs in section `%s', but it has no contents" msgstr "" -#: cofflink.c:2619 coffswap.h:904 +#: cofflink.c:2628 coffswap.h:894 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: cofflink.c:2628 coffswap.h:891 +#: cofflink.c:2637 coffswap.h:880 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coff-mips.c:875 elf32-mips.c:1406 -msgid "GP relative relocation when _gp not defined" +#: coff-m68k.c:475 coff-mips.c:2432 elf32-m68k.c:2265 +msgid "unsupported reloc type" msgstr "" -#: coff-mips.c:2433 -msgid "unsupported reloc type" +#: coff-mips.c:875 elf32-mips.c:1417 +msgid "GP relative relocation when _gp not defined" msgstr "" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2470 +#: coff-mips.c:2469 msgid "reloc against unsupported section" msgstr "" -#: coff-mips.c:2478 +#: coff-mips.c:2477 msgid "reloc not properly aligned" msgstr "" -#: coff-tic80.c:445 +#: coff-tic54x.c:263 coff-tic80.c:445 #, c-format msgid "Unrecognized reloc type 0x%x" msgstr "" -#: coff-w65.c:383 +#: coff-w65.c:369 #, c-format msgid "ignoring reloc %s\n" msgstr "" -#: dwarf2.c:429 +#: dwarf2.c:423 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:447 +#: dwarf2.c:441 #, c-format msgid "Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)." msgstr "" -#: dwarf2.c:627 +#: dwarf2.c:624 #, c-format msgid "Dwarf Error: Invalid or unhandled FORM value: %d." msgstr "" -#: dwarf2.c:700 +#: dwarf2.c:697 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:791 +#: dwarf2.c:782 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:963 +#: dwarf2.c:806 +#, c-format +msgid "Dwarf Error: Line offset (%u) bigger than line size (%u)." +msgstr "" + +#: dwarf2.c:973 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1151 dwarf2.c:1307 +#: dwarf2.c:1152 dwarf2.c:1306 #, c-format msgid "Dwarf Error: Could not find abbrev number %d." msgstr "" -#: dwarf2.c:1268 +#: dwarf2.c:1267 #, c-format msgid "" "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1275 +#: dwarf2.c:1274 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1298 +#: dwarf2.c:1297 #, c-format msgid "Dwarf Error: Bad abbrev number: %d." msgstr "" -#: ecoff.c:1325 +#: ecoff.c:1323 #, c-format msgid "Unknown basic type %d" msgstr "" -#: ecoff.c:1597 +#: ecoff.c:1592 #, c-format msgid "" "\n" " End+1 symbol: %ld" msgstr "" -#: ecoff.c:1604 ecoff.c:1607 +#: ecoff.c:1599 ecoff.c:1602 #, c-format msgid "" "\n" " First symbol: %ld" msgstr "" -#: ecoff.c:1619 +#: ecoff.c:1614 #, c-format msgid "" "\n" " End+1 symbol: %-7ld Type: %s" msgstr "" -#: ecoff.c:1626 +#: ecoff.c:1621 #, c-format msgid "" "\n" " Local symbol: %ld" msgstr "" -#: ecoff.c:1634 +#: ecoff.c:1629 #, c-format msgid "" "\n" " struct; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1639 +#: ecoff.c:1634 #, c-format msgid "" "\n" " union; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1644 +#: ecoff.c:1639 #, c-format msgid "" "\n" " enum; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1650 +#: ecoff.c:1645 #, c-format msgid "" "\n" " Type: %s" msgstr "" -#: elf32-arm.h:1787 elf32-i386.c:1304 elf32-ppc.c:3092 +#: elf32-arm.h:1179 +#, c-format +msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." +msgstr "" + +#: elf32-arm.h:1375 +#, c-format +msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." +msgstr "" + +#: elf-hppa.h:1369 elf-hppa.h:1402 elf32-arm.h:1853 elf32-i386.c:1428 +#: elf32-ppc.c:3096 elf32-sh.c:2997 elf64-x86-64.c:271 #, c-format msgid "" "%s: warning: unresolvable relocation against symbol `%s' from %s section" msgstr "" -#: elf-m10200.c:455 elf-m10300.c:670 elf32-arm.h:1853 elf32-avr.c:844 -#: elf32-d10v.c:493 elf32-fr30.c:651 elf32-m32r.c:1265 elf32-v850.c:1677 +#: elf-m10200.c:455 elf-m10300.c:669 elf32-arm.h:1927 elf32-avr.c:842 +#: elf32-cris.c:431 elf32-d10v.c:478 elf32-fr30.c:651 elf32-i860.c:1051 +#: elf32-m32r.c:1265 elf32-v850.c:1672 msgid "internal error: out of range error" msgstr "" -#: elf-m10200.c:459 elf-m10300.c:674 elf32-arm.h:1857 elf32-avr.c:848 -#: elf32-d10v.c:497 elf32-fr30.c:655 elf32-m32r.c:1269 elf32-v850.c:1681 +#: elf-m10200.c:459 elf-m10300.c:673 elf32-arm.h:1931 elf32-avr.c:846 +#: elf32-cris.c:435 elf32-d10v.c:482 elf32-fr30.c:655 elf32-i860.c:1055 +#: elf32-m32r.c:1269 elf32-v850.c:1676 msgid "internal error: unsupported relocation error" msgstr "" -#: elf-m10200.c:463 elf-m10300.c:678 elf32-arm.h:1861 elf32-d10v.c:501 +#: elf-m10200.c:463 elf-m10300.c:677 elf32-arm.h:1935 elf32-d10v.c:486 #: elf32-m32r.c:1273 msgid "internal error: dangerous error" msgstr "" -#: elf-m10200.c:467 elf-m10300.c:682 elf32-arm.h:1865 elf32-avr.c:856 -#: elf32-d10v.c:505 elf32-fr30.c:663 elf32-m32r.c:1277 elf32-v850.c:1701 +#: elf-m10200.c:467 elf-m10300.c:681 elf32-arm.h:1939 elf32-avr.c:854 +#: elf32-cris.c:443 elf32-d10v.c:490 elf32-fr30.c:663 elf32-i860.c:1063 +#: elf32-m32r.c:1277 elf32-v850.c:1696 msgid "internal error: unknown error" msgstr "" -#: elf32-arm.h:1891 +#: elf32-arm.h:1967 #, c-format msgid "" "Warning: Not setting interwork flag of %s since it has already been " "specified as non-interworking" msgstr "" -#: elf32-arm.h:1895 +#: elf32-arm.h:1971 #, c-format msgid "Warning: Clearing the interwork flag of %s due to outside request" msgstr "" -#: elf32-arm.h:1943 +#: elf32-arm.h:2019 #, c-format msgid "" "Warning: Clearing the interwork flag in %s because non-interworking code in " "%s has been linked with it" msgstr "" -#: elf32-arm.h:1977 +#: elf32-arm.h:2113 #, c-format -msgid "%s: compiled for a %s endian system and target is %s endian" +msgid "" +"Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" msgstr "" -#: elf32-arm.h:2023 +#: elf32-arm.h:2127 #, c-format msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" msgstr "" -#: elf32-arm.h:2031 +#: elf32-arm.h:2138 #, c-format msgid "" "Error: %s passes floats in %s registers, whereas %s passes them in %s " "registers" msgstr "" -#: elf32-arm.h:2034 elf32-arm.h:2036 +#: elf32-arm.h:2141 elf32-arm.h:2143 msgid "float" msgstr "" -#: elf32-arm.h:2034 elf32-arm.h:2036 +#: elf32-arm.h:2141 elf32-arm.h:2143 msgid "integer" msgstr "" -#: elf32-arm.h:2039 +#: elf32-arm.h:2150 #, c-format -msgid "Error: %s is compiled as position %s code, whereas %s is not" +msgid "Error: %s uses %s floating point, whereas %s uses %s floating point" msgstr "" -#: elf32-arm.h:2042 -msgid "independent" +#: elf32-arm.h:2153 elf32-arm.h:2155 +msgid "soft" msgstr "" -#: elf32-arm.h:2042 -msgid "dependent" +#: elf32-arm.h:2153 elf32-arm.h:2155 +msgid "hard" msgstr "" -#: elf32-arm.h:2048 +#: elf32-arm.h:2162 #, c-format msgid "Warning: %s %s interworking, whereas %s %s" msgstr "" -#: elf32-arm.h:2051 +#: elf32-arm.h:2165 msgid "supports" msgstr "" -#: elf32-arm.h:2051 +#: elf32-arm.h:2165 msgid "does not support" msgstr "" -#: elf32-arm.h:2053 +#: elf32-arm.h:2167 msgid "does not" msgstr "" -#: elf32-arm.h:2053 +#: elf32-arm.h:2167 msgid "does" msgstr "" -#. Ignore init flag - it may not be set, despite the flags field containing valid data. -#: elf32-arm.h:2076 elf32-m68k.c:430 elf32-mips.c:2634 +#. Ignore init flag - it may not be set, despite the flags field +#. containing valid data. +#: elf32-arm.h:2193 elf32-cris.c:615 elf32-m68k.c:430 elf32-mips.c:2695 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.h:2079 +#: elf32-arm.h:2202 msgid " [interworking enabled]" msgstr "" -#: elf32-arm.h:2081 -msgid " [interworking not enabled]" -msgstr "" - -#: elf32-arm.h:2084 +#: elf32-arm.h:2205 msgid " [APCS-26]" msgstr "" -#: elf32-arm.h:2086 +#: elf32-arm.h:2207 msgid " [APCS-32]" msgstr "" -#: elf32-avr.c:852 elf32-fr30.c:659 elf32-v850.c:1685 +#: elf32-arm.h:2216 +msgid " [new ABI]" +msgstr "" + +#: elf32-arm.h:2219 +msgid " [old ABI]" +msgstr "" + +#: elf32-arm.h:2222 +msgid " [software FP]" +msgstr "" + +#: elf32-arm.h:2229 +msgid " [Version1 EABI]" +msgstr "" + +#: elf32-arm.h:2232 +msgid " [sorted symbol table]" +msgstr "" + +#: elf32-arm.h:2234 +msgid " [unsorted symbol table]" +msgstr "" + +#: elf32-arm.h:2240 +msgid " <EABI version unrecognised>" +msgstr "" + +#: elf32-arm.h:2247 +msgid " [relocatable executable]" +msgstr "" + +#: elf32-arm.h:2250 +msgid " [has entry point]" +msgstr "" + +#: elf32-arm.h:2255 +msgid "<Unrecognised flag bits set>" +msgstr "" + +#: elf32-avr.c:850 elf32-cris.c:439 elf32-fr30.c:659 elf32-i860.c:1059 +#: elf32-v850.c:1680 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-i386.c:239 +#: elf32-cris.c:618 +msgid " [symbols have a _ prefix]" +msgstr "" + +#: elf32-cris.c:657 +#, c-format +msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" +msgstr "" + +#: elf32-cris.c:658 +#, c-format +msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" +msgstr "" + +#: elf32-hppa.c:606 +#, c-format +msgid "%s(%s+0x%lx): cannot find stub entry %s" +msgstr "" + +#: elf32-hppa.c:667 +#, c-format +msgid "%s: cannot create stub entry %s" +msgstr "" + +#: elf32-hppa.c:859 +#, c-format +msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections" +msgstr "" + +#: elf32-hppa.c:872 elf32-hppa.c:1568 +#, c-format +msgid "Could not find relocation section for %s" +msgstr "" + +#: elf32-hppa.c:1011 elf32-hppa.c:3362 +#, c-format +msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" +msgstr "" + +#: elf32-hppa.c:1323 +#, c-format +msgid "" +"%s: relocation %s can not be used when making a shared object; recompile " +"with -fPIC" +msgstr "" + +#: elf32-hppa.c:1343 +#, c-format +msgid "" +"%s: relocation %s should not be used when making a shared object; recompile " +"with -fPIC" +msgstr "" + +#: elf32-hppa.c:2755 +#, c-format +msgid "%s: duplicate export stub %s" +msgstr "" + +#: elf32-hppa.c:3253 +#, c-format +msgid "%s(%s+0x%lx): fixing %s" +msgstr "" + +#: elf32-hppa.c:3856 +#, c-format +msgid "%s(%s+0x%lx): cannot handle %s for %s" +msgstr "" + +#: elf32-hppa.c:4173 +msgid ".got section not immediately after .plt section" +msgstr "" + +#: elf32-i386.c:273 #, c-format msgid "%s: invalid relocation type %d" msgstr "" @@ -685,149 +835,151 @@ msgstr "" msgid " [cpu32]" msgstr "" -#: elf32-mcore.c:329 -#, c-format -msgid "%s: compiled for a %s endian system and target is %s endian.\n" -msgstr "" - -#: elf32-mcore.c:377 elf32-mcore.c:504 +#: elf32-mcore.c:366 elf32-mcore.c:493 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mcore.c:463 +#: elf32-mcore.c:452 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:1565 +#: elf32-mips.c:1576 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1714 +#: elf32-mips.c:1725 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "" -#: elf32-mips.c:2469 elf32-ppc.c:1408 -#, c-format -msgid "%s: compiled for a big endian system and target is little endian" -msgstr "" - -#: elf32-mips.c:2471 elf32-ppc.c:1410 -#, c-format -msgid "%s: compiled for a little endian system and target is big endian" -msgstr "" - -#: elf32-mips.c:2520 +#: elf32-mips.c:2582 #, c-format msgid "%s: linking PIC files with non-PIC files" msgstr "" -#: elf32-mips.c:2530 +#: elf32-mips.c:2592 #, c-format msgid "%s: linking abicalls files with non-abicalls files" msgstr "" -#: elf32-mips.c:2560 +#: elf32-mips.c:2621 #, c-format msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" msgstr "" -#: elf32-mips.c:2569 +#: elf32-mips.c:2630 #, c-format msgid "%s: ISA mismatch (%d) with previous modules (%d)" msgstr "" -#: elf32-mips.c:2592 +#: elf32-mips.c:2653 #, c-format msgid "%s: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elf32-mips.c:2606 elf32-ppc.c:1477 elf64-sparc.c:2844 +#: elf32-mips.c:2667 elf32-ppc.c:1477 elf64-sparc.c:2971 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-mips.c:2637 +#: elf32-mips.c:2698 msgid " [abi=O32]" msgstr "" -#: elf32-mips.c:2639 +#: elf32-mips.c:2700 msgid " [abi=O64]" msgstr "" -#: elf32-mips.c:2641 +#: elf32-mips.c:2702 msgid " [abi=EABI32]" msgstr "" -#: elf32-mips.c:2643 +#: elf32-mips.c:2704 msgid " [abi=EABI64]" msgstr "" -#: elf32-mips.c:2645 +#: elf32-mips.c:2706 msgid " [abi unknown]" msgstr "" -#: elf32-mips.c:2647 +#: elf32-mips.c:2708 msgid " [abi=N32]" msgstr "" -#: elf32-mips.c:2649 +#: elf32-mips.c:2710 msgid " [abi=64]" msgstr "" -#: elf32-mips.c:2651 +#: elf32-mips.c:2712 msgid " [no abi set]" msgstr "" -#: elf32-mips.c:2654 +#: elf32-mips.c:2715 msgid " [mips1]" msgstr "" -#: elf32-mips.c:2656 +#: elf32-mips.c:2717 msgid " [mips2]" msgstr "" -#: elf32-mips.c:2658 +#: elf32-mips.c:2719 msgid " [mips3]" msgstr "" -#: elf32-mips.c:2660 +#: elf32-mips.c:2721 msgid " [mips4]" msgstr "" -#: elf32-mips.c:2662 +#: elf32-mips.c:2723 +msgid " [mips5]" +msgstr "" + +#: elf32-mips.c:2725 +msgid " [mips32]" +msgstr "" + +#: elf32-mips.c:2727 +msgid " [mips64]" +msgstr "" + +#: elf32-mips.c:2729 msgid " [unknown ISA]" msgstr "" -#: elf32-mips.c:2665 +#: elf32-mips.c:2732 msgid " [32bitmode]" msgstr "" -#: elf32-mips.c:2667 +#: elf32-mips.c:2734 msgid " [not 32bitmode]" msgstr "" -#: elf32-mips.c:4270 +#: elf32-mips.c:4388 msgid "static procedure (no name)" msgstr "" -#: elf32-mips.c:4887 elf64-alpha.c:4364 +#: elf32-mips.c:5005 elf64-alpha.c:4377 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elf32-mips.c:5414 +#: elf32-mips.c:5570 msgid "not enough GOT space for local GOT entries" msgstr "" -#: elf32-mips.c:6493 +#: elf32-mips.c:6686 #, c-format msgid "%s: %s+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elf32-mips.c:7521 +#: elf32-mips.c:7673 +#, c-format +msgid "Malformed reloc detected for section %s" +msgstr "" + +#: elf32-mips.c:7750 #, c-format msgid "%s: CALL16 reloc at 0x%lx not against global symbol" msgstr "" @@ -849,156 +1001,146 @@ msgstr "" msgid "%s: Unknown special linker type %d" msgstr "" -#: elf32-ppc.c:2251 elf32-ppc.c:2285 elf32-ppc.c:2320 +#: elf32-ppc.c:2245 elf32-ppc.c:2279 elf32-ppc.c:2314 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" msgstr "" -#: elf32-ppc.c:3123 +#: elf32-ppc.c:3129 #, c-format msgid "%s: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:3491 elf32-ppc.c:3513 elf32-ppc.c:3562 +#: elf32-ppc.c:3493 elf32-ppc.c:3514 elf32-ppc.c:3564 #, c-format msgid "" "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:3628 +#: elf32-ppc.c:3630 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-sh.c:681 +#: elf32-sh.c:1084 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES offset" msgstr "" -#: elf32-sh.c:693 +#: elf32-sh.c:1096 #, c-format msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "" -#: elf32-sh.c:710 +#: elf32-sh.c:1113 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" msgstr "" -#: elf32-sh.c:725 +#: elf32-sh.c:1128 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" msgstr "" -#: elf32-sh.c:762 +#: elf32-sh.c:1165 #, c-format msgid "%s: 0x%lx: warning: symbol in unexpected section" msgstr "" -#: elf32-sh.c:884 +#: elf32-sh.c:1287 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" msgstr "" -#: elf32-sh.c:893 +#: elf32-sh.c:1296 #, c-format msgid "%s: 0x%lx: warning: bad count" msgstr "" -#: elf32-sh.c:1279 elf32-sh.c:1666 +#: elf32-sh.c:1689 elf32-sh.c:2076 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" msgstr "" -#: elf32-sparc.c:1486 elf64-sparc.c:2242 +#: elf32-sparc.c:1512 elf64-sparc.c:2262 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "" -#: elf32-sparc.c:1856 -#, c-format -msgid "%s: compiled for a v8plus system and target is v8" -msgstr "" - -#: elf32-sparc.c:1865 -#, c-format -msgid "%s: compiled for a v8plusa system and target is v8plus" -msgstr "" - -#: elf32-sparc.c:1873 +#: elf32-sparc.c:1962 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "" -#: elf32-sparc.c:1888 +#: elf32-sparc.c:1976 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "" -#: elf32-v850.c:680 +#: elf32-v850.c:677 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:683 +#: elf32-v850.c:680 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:686 +#: elf32-v850.c:683 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:689 +#: elf32-v850.c:686 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:692 +#: elf32-v850.c:689 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:1070 +#: elf32-v850.c:1066 msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1689 +#: elf32-v850.c:1684 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1693 +#: elf32-v850.c:1688 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1697 +#: elf32-v850.c:1692 msgid "could not locate special linker symbol __ctbp" msgstr "" -#: elf32-v850.c:1886 +#: elf32-v850.c:1881 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "" -#: elf32-v850.c:1905 +#: elf32-v850.c:1900 #, c-format msgid "private flags = %lx: " msgstr "" -#: elf32-v850.c:1910 +#: elf32-v850.c:1905 msgid "v850 architecture" msgstr "" -#: elf32-v850.c:1911 +#: elf32-v850.c:1906 msgid "v850e architecture" msgstr "" -#: elf32-v850.c:1912 +#: elf32-v850.c:1907 msgid "v850ea architecture" msgstr "" @@ -1006,175 +1148,175 @@ msgstr "" msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:3004 +#: elf64-alpha.c:3014 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-sparc.c:1249 +#: elf64-sparc.c:1248 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" msgstr "" -#: elf64-sparc.c:1286 +#: elf64-sparc.c:1285 msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "" -#: elf64-sparc.c:1306 +#: elf64-sparc.c:1305 msgid "" "Register %%g%d used incompatibly: previously declared in %s to %s, in %s " "redefined to %s" msgstr "" -#: elf64-sparc.c:1329 +#: elf64-sparc.c:1328 #, c-format msgid "Symbol `%s' has differing types: previously %s, REGISTER in %s" msgstr "" -#: elf64-sparc.c:1375 +#: elf64-sparc.c:1374 #, c-format msgid "Symbol `%s' has differing types: REGISTER in %s, %s in %s" msgstr "" -#: elf64-sparc.c:2825 +#: elf64-sparc.c:2952 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf.c:323 +#: elf.c:325 #, c-format msgid "%s: invalid string offset %u >= %lu for section `%s'" msgstr "" -#: elf.c:546 +#: elf.c:566 msgid "" "\n" "Program Header:\n" msgstr "" -#: elf.c:594 +#: elf.c:614 msgid "" "\n" "Dynamic Section:\n" msgstr "" -#: elf.c:696 +#: elf.c:743 msgid "" "\n" "Version definitions:\n" msgstr "" -#: elf.c:719 +#: elf.c:766 msgid "" "\n" "Version References:\n" msgstr "" -#: elf.c:724 +#: elf.c:771 #, c-format msgid " required from %s:\n" msgstr "" -#: elf.c:1286 +#: elf.c:1359 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" msgstr "" -#: elf.c:2045 +#: elf.c:2113 #, c-format msgid "" "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = " "0x%.8lx\n" msgstr "" -#: elf.c:2648 +#: elf.c:2716 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" msgstr "" -#: elf.c:2747 +#: elf.c:2815 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" msgstr "" -#: elf.c:2873 +#: elf.c:2941 #, c-format msgid "Error: First section in segment (%s) starts at 0x%x" msgstr "" -#: elf.c:2876 +#: elf.c:2944 #, c-format msgid " whereas segment starts at 0x%x" msgstr "" -#: elf.c:3146 +#: elf.c:3217 #, c-format msgid "%s: warning: allocated section `%s' not in segment" msgstr "" -#: elf.c:3528 +#: elf.c:3616 #, c-format msgid "%s: symbol `%s' required but not present" msgstr "" -#: elf.c:3537 +#: elf.c:3625 #, c-format msgid "" "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = " "0x%.8lx%s\n" msgstr "" -#: elf.c:3679 +#: elf.c:3866 #, c-format msgid "%s: warning: Empty loadable segment detected\n" msgstr "" -#: elf.c:4956 +#: elf.c:5213 #, c-format msgid "%s: unsupported relocation type %s" msgstr "" -#: elfcode.h:1061 +#: elfcode.h:1084 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elflink.c:423 +#: elflink.c:432 #, c-format msgid "%s: Section %s is already to large to put hole of %ld bytes in" msgstr "" -#: elflink.h:1388 +#: elflink.h:1465 #, c-format msgid "%s: %s: invalid version %u (max %d)" msgstr "" -#: elflink.h:1429 +#: elflink.h:1506 #, c-format msgid "%s: %s: invalid needed version %d" msgstr "" -#: elflink.h:1546 +#: elflink.h:1626 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" msgstr "" -#: elflink.h:1790 +#: elflink.h:1872 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" msgstr "" -#: elflink.h:3480 +#: elflink.h:3659 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.h:3752 +#: elflink.h:3931 #, c-format msgid "%s: undefined versioned symbol name %s" msgstr "" -#: elflink.h:4983 +#: elflink.h:5180 #, c-format msgid "%s: could not find output section %s for input section %s" msgstr "" @@ -1274,16 +1416,26 @@ msgstr "" msgid "%s: address 0x%s out of range for Intex Hex file" msgstr "" -#: libbfd.c:484 +#: libbfd.c:471 #, c-format msgid "not mapping: data=%lx mapped=%d\n" msgstr "" -#: libbfd.c:487 +#: libbfd.c:474 msgid "not mapping: env var not set\n" msgstr "" -#: linker.c:2679 +#: libbfd.c:1370 +#, c-format +msgid "%s: compiled for a big endian system and target is little endian" +msgstr "" + +#: libbfd.c:1372 +#, c-format +msgid "%s: compiled for a little endian system and target is big endian" +msgstr "" + +#: linker.c:2678 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" msgstr "" @@ -1299,330 +1451,328 @@ msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" #. XXX code yet to be written. -#: peicode.h:806 +#: peicode.h:807 #, c-format msgid "%s: Unhandled import type; %x" msgstr "" -#: peicode.h:811 +#: peicode.h:812 #, c-format msgid "%s: Unrecognised import type; %x" msgstr "" -#: peicode.h:825 +#: peicode.h:826 #, c-format msgid "%s: Unrecognised import name type; %x" msgstr "" -#: peicode.h:1182 +#: peicode.h:1183 #, c-format msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#: peicode.h:1194 +#: peicode.h:1195 #, c-format msgid "" "%s: Recognised but unhandled machine type (0x%x) in Import Library Format " "archive" msgstr "" -#: peicode.h:1211 +#: peicode.h:1212 #, c-format msgid "%s: size field is zero in Import Library Format header" msgstr "" -#: peicode.h:1239 +#: peicode.h:1240 #, c-format msgid "%s: string not null terminated in ILF object file." msgstr "" -#: peigen.c:938 +#: peigen.c:993 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: peigen.c:950 +#: peigen.c:1011 #, c-format -msgid "%s: reloc overflow: 0x%lx > 0xffff" +msgid "%s: reloc overflow 1: 0x%lx > 0xffff" msgstr "" -#: peigen.c:963 +#: peigen.c:1024 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "" -#: peigen.c:964 +#: peigen.c:1025 msgid "Import Directory [parts of .idata]" msgstr "" -#: peigen.c:965 +#: peigen.c:1026 msgid "Resource Directory [.rsrc]" msgstr "" -#: peigen.c:966 +#: peigen.c:1027 msgid "Exception Directory [.pdata]" msgstr "" -#: peigen.c:967 +#: peigen.c:1028 msgid "Security Directory" msgstr "" -#: peigen.c:968 +#: peigen.c:1029 msgid "Base Relocation Directory [.reloc]" msgstr "" -#: peigen.c:969 +#: peigen.c:1030 msgid "Debug Directory" msgstr "" -#: peigen.c:970 +#: peigen.c:1031 msgid "Description Directory" msgstr "" -#: peigen.c:971 +#: peigen.c:1032 msgid "Special Directory" msgstr "" -#: peigen.c:972 +#: peigen.c:1033 msgid "Thread Storage Directory [.tls]" msgstr "" -#: peigen.c:973 +#: peigen.c:1034 msgid "Load Configuration Directory" msgstr "" -#: peigen.c:974 +#: peigen.c:1035 msgid "Bound Import Directory" msgstr "" -#: peigen.c:975 +#: peigen.c:1036 msgid "Import Address Table Directory" msgstr "" -#: peigen.c:976 peigen.c:977 peigen.c:978 -msgid "Reserved" +#: peigen.c:1037 +msgid "Delay Import Directory" msgstr "" -#: peigen.c:1022 -msgid "" -"\n" -"The import table is the .idata section\n" +#: peigen.c:1038 peigen.c:1039 +msgid "Reserved" msgstr "" -#: peigen.c:1044 +#: peigen.c:1103 msgid "" "\n" "There is an import table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1048 +#: peigen.c:1108 #, c-format msgid "" "\n" "There is an import table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1089 +#: peigen.c:1147 #, c-format msgid "" "\n" "Function descriptor located at the start address: %04lx\n" msgstr "" -#: peigen.c:1092 +#: peigen.c:1150 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "" -#: peigen.c:1098 +#: peigen.c:1156 msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" msgstr "" -#: peigen.c:1103 +#: peigen.c:1161 +#, c-format msgid "" "\n" -"The Import Tables (interpreted .idata section contents)\n" +"The Import Tables (interpreted %s section contents)\n" msgstr "" -#: peigen.c:1105 +#: peigen.c:1164 msgid " vma: Hint Time Forward DLL First\n" msgstr "" -#: peigen.c:1107 +#: peigen.c:1166 msgid " Table Stamp Chain Name Thunk\n" msgstr "" -#: peigen.c:1157 +#: peigen.c:1216 #, c-format msgid "" "\n" "\tDLL Name: %s\n" msgstr "" -#: peigen.c:1161 peigen.c:1224 +#: peigen.c:1220 peigen.c:1283 msgid "\tvma: Hint/Ord Member-Name\n" msgstr "" -#: peigen.c:1223 +#: peigen.c:1282 msgid "\tThe Import Address Table (difference found)\n" msgstr "" -#: peigen.c:1230 +#: peigen.c:1289 msgid "\t>>> Ran out of IAT members!\n" msgstr "" -#: peigen.c:1248 +#: peigen.c:1308 msgid "\tThe Import Address Table is identical\n" msgstr "" -#: peigen.c:1297 -msgid "" -"\n" -"The export table is the .edata section\n" -msgstr "" - -#: peigen.c:1319 +#: peigen.c:1381 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1323 +#: peigen.c:1386 #, c-format msgid "" "\n" "There is an export table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1355 +#: peigen.c:1417 +#, c-format msgid "" "\n" -"The Export Tables (interpreted .edata section contents)\n" +"The Export Tables (interpreted %s section contents)\n" "\n" msgstr "" -#: peigen.c:1358 +#: peigen.c:1421 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "" -#: peigen.c:1361 +#: peigen.c:1424 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "" -#: peigen.c:1364 +#: peigen.c:1427 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "" -#: peigen.c:1367 +#: peigen.c:1430 msgid "Name \t\t\t\t" msgstr "" -#: peigen.c:1373 +#: peigen.c:1436 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "" -#: peigen.c:1376 +#: peigen.c:1439 msgid "Number in:\n" msgstr "" -#: peigen.c:1379 +#: peigen.c:1442 #, c-format -msgid "\tExport Address Table \t\t%lx\n" +msgid "\tExport Address Table \t\t%08lx\n" msgstr "" -#: peigen.c:1383 +#: peigen.c:1446 #, c-format -msgid "\t[Name Pointer/Ordinal] Table\t%lu\n" +msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "" -#: peigen.c:1386 +#: peigen.c:1449 msgid "Table Addresses\n" msgstr "" -#: peigen.c:1389 +#: peigen.c:1452 msgid "\tExport Address Table \t\t" msgstr "" -#: peigen.c:1394 +#: peigen.c:1457 msgid "\tName Pointer Table \t\t" msgstr "" -#: peigen.c:1399 +#: peigen.c:1462 msgid "\tOrdinal Table \t\t\t" msgstr "" -#: peigen.c:1415 +#: peigen.c:1476 #, c-format msgid "" "\n" "Export Address Table -- Ordinal Base %ld\n" msgstr "" -#: peigen.c:1436 +#: peigen.c:1495 msgid "Forwarder RVA" msgstr "" -#: peigen.c:1444 +#: peigen.c:1506 msgid "Export RVA" msgstr "" -#: peigen.c:1451 +#: peigen.c:1513 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" msgstr "" -#: peigen.c:1496 +#: peigen.c:1568 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "" -#: peigen.c:1500 +#: peigen.c:1572 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" -#: peigen.c:1502 +#: peigen.c:1575 +msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" +msgstr "" + +#: peigen.c:1578 msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" msgstr "" -#: peigen.c:1504 +#: peigen.c:1580 msgid " \t\tAddress Address Handler Data Address Mask\n" msgstr "" -#: peigen.c:1576 +#: peigen.c:1652 msgid " Register save millicode" msgstr "" -#: peigen.c:1579 +#: peigen.c:1655 msgid " Register restore millicode" msgstr "" -#: peigen.c:1582 +#: peigen.c:1658 msgid " Glue code sequence" msgstr "" -#: peigen.c:1628 +#: peigen.c:1709 msgid "" "\n" "\n" "PE File Base Relocations (interpreted .reloc section contents)\n" msgstr "" -#: peigen.c:1663 +#: peigen.c:1744 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" -#: peigen.c:1676 +#: peigen.c:1757 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "" @@ -1630,232 +1780,242 @@ msgstr "" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1714 +#: peigen.c:1796 #, c-format msgid "" "\n" "Characteristics 0x%x\n" msgstr "" -#: pe-mips.c:657 +#: pe-mips.c:653 #, c-format msgid "%s: `ld -r' not supported with PE MIPS objects\n" msgstr "" -#: pe-mips.c:820 +#. OK, at this point the following variables are set up: +#. src = VMA of the memory we're fixing up +#. mem = pointer to memory we're fixing up +#. val = VMA of what we need to refer to +#. +#: pe-mips.c:789 +#, c-format +msgid "%s: unimplemented %s\n" +msgstr "" + +#: pe-mips.c:815 #, c-format msgid "%s: jump too far away\n" msgstr "" -#: pe-mips.c:847 +#: pe-mips.c:842 #, c-format msgid "%s: bad pair/reflo after refhi\n" msgstr "" -#: ppcboot.c:418 +#: ppcboot.c:422 msgid "" "\n" "ppcboot header:\n" msgstr "" -#: ppcboot.c:419 +#: ppcboot.c:423 #, c-format msgid "Entry offset = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:420 +#: ppcboot.c:424 #, c-format msgid "Length = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:423 +#: ppcboot.c:427 #, c-format msgid "Flag field = 0x%.2x\n" msgstr "" -#: ppcboot.c:429 +#: ppcboot.c:433 #, c-format msgid "Partition name = \"%s\"\n" msgstr "" -#: ppcboot.c:448 +#: ppcboot.c:452 #, c-format msgid "" "\n" "Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:454 +#: ppcboot.c:458 #, c-format msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:460 +#: ppcboot.c:464 #, c-format msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:461 +#: ppcboot.c:465 #, c-format msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5335 +#: som.c:5355 msgid "som_sizeof_headers unimplemented" msgstr "" -#: srec.c:290 +#: srec.c:300 #, c-format msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "" -#: syms.c:974 +#: syms.c:968 msgid "Unsupported .stab relocation" msgstr "" -#: vms-gsd.c:357 +#: vms-gsd.c:354 #, c-format msgid "bfd_make_section (%s) failed" msgstr "" -#: vms-gsd.c:371 +#: vms-gsd.c:368 #, c-format msgid "bfd_set_section_flags (%s, %x) failed" msgstr "" -#: vms-gsd.c:407 +#: vms-gsd.c:404 #, c-format msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "" -#: vms-gsd.c:702 +#: vms-gsd.c:699 #, c-format msgid "unknown gsd/egsd subtype %d" msgstr "" -#: vms-hdr.c:405 +#: vms-hdr.c:403 msgid "Object module NOT error-free !\n" msgstr "" -#: vms-misc.c:541 +#: vms-misc.c:539 #, c-format msgid "Stack overflow (%d) in _bfd_vms_push" msgstr "" -#: vms-misc.c:560 +#: vms-misc.c:557 msgid "Stack underflow in _bfd_vms_pop" msgstr "" -#: vms-misc.c:931 +#: vms-misc.c:915 msgid "_bfd_vms_output_counted called with zero bytes" msgstr "" -#: vms-misc.c:936 +#: vms-misc.c:920 msgid "_bfd_vms_output_counted called with too many bytes" msgstr "" -#: vms-misc.c:1069 +#: vms-misc.c:1051 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" -#: vms-misc.c:1133 +#: vms-misc.c:1113 #, c-format msgid "failed to enter %s" msgstr "" -#: vms-tir.c:69 +#: vms-tir.c:68 msgid "No Mem !" msgstr "" -#: vms-tir.c:309 +#: vms-tir.c:302 msgid "Bad section index in ETIR_S_C_STA_PQ" msgstr "" -#: vms-tir.c:324 +#: vms-tir.c:317 #, c-format msgid "Unsupported STA cmd %d" msgstr "" -#: vms-tir.c:329 vms-tir.c:1287 +#: vms-tir.c:322 vms-tir.c:1274 #, c-format msgid "Reserved STA cmd %d" msgstr "" -#: vms-tir.c:436 +#: vms-tir.c:428 #, c-format msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" msgstr "" -#: vms-tir.c:457 +#: vms-tir.c:449 #, c-format msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" msgstr "" -#: vms-tir.c:470 +#: vms-tir.c:462 msgid "ETIR_S_C_STO_RB/AB: Not supported" msgstr "" -#: vms-tir.c:528 +#: vms-tir.c:520 msgid "ETIR_S_C_STO_LP_PSB: Not supported" msgstr "" -#: vms-tir.c:534 +#: vms-tir.c:526 msgid "ETIR_S_C_STO_HINT_GBL: not implemented" msgstr "" -#: vms-tir.c:540 +#: vms-tir.c:532 msgid "ETIR_S_C_STO_HINT_PS: not implemented" msgstr "" -#: vms-tir.c:544 vms-tir.c:1460 +#: vms-tir.c:536 vms-tir.c:1446 #, c-format msgid "Reserved STO cmd %d" msgstr "" -#: vms-tir.c:657 +#: vms-tir.c:649 msgid "ETIR_S_C_OPR_INSV: Not supported" msgstr "" -#: vms-tir.c:675 +#: vms-tir.c:667 msgid "ETIR_S_C_OPR_USH: Not supported" msgstr "" -#: vms-tir.c:681 +#: vms-tir.c:673 msgid "ETIR_S_C_OPR_ROT: Not supported" msgstr "" -#: vms-tir.c:700 +#: vms-tir.c:692 msgid "ETIR_S_C_OPR_REDEF: Not supported" msgstr "" -#: vms-tir.c:706 +#: vms-tir.c:698 msgid "ETIR_S_C_OPR_DFLIT: Not supported" msgstr "" -#: vms-tir.c:710 vms-tir.c:1656 +#: vms-tir.c:702 vms-tir.c:1641 #, c-format msgid "Reserved OPR cmd %d" msgstr "" -#: vms-tir.c:779 vms-tir.c:1726 +#: vms-tir.c:770 vms-tir.c:1710 #, c-format msgid "Reserved CTL cmd %d" msgstr "" -#: vms-tir.c:808 +#: vms-tir.c:798 msgid "ETIR_S_C_STC_LP: not supported" msgstr "" -#: vms-tir.c:826 +#: vms-tir.c:816 msgid "ETIR_S_C_STC_GBL: not supported" msgstr "" -#: vms-tir.c:834 +#: vms-tir.c:824 msgid "ETIR_S_C_STC_GCA: not supported" msgstr "" -#: vms-tir.c:843 +#: vms-tir.c:833 msgid "ETIR_S_C_STC_PS: not supported" msgstr "" @@ -1864,11 +2024,11 @@ msgstr "" #. * arg: - #. * #. -#: vms-tir.c:1187 +#: vms-tir.c:1174 msgid "Stack-from-image not implemented" msgstr "" -#: vms-tir.c:1207 +#: vms-tir.c:1194 msgid "Stack-entry-mask not fully implemented" msgstr "" @@ -1881,171 +2041,171 @@ msgstr "" #. * compare argument descriptor with symbol argument (ARG$V_PASSMECH) #. * and stack TRUE (args match) or FALSE (args dont match) value #. -#: vms-tir.c:1223 +#: vms-tir.c:1210 msgid "PASSMECH not fully implemented" msgstr "" -#: vms-tir.c:1243 +#: vms-tir.c:1230 msgid "Stack-local-symbol not fully implemented" msgstr "" -#: vms-tir.c:1258 +#: vms-tir.c:1245 msgid "Stack-literal not fully implemented" msgstr "" -#: vms-tir.c:1280 +#: vms-tir.c:1267 msgid "Stack-local-symbol-entry-point-mask not fully implemented" msgstr "" -#: vms-tir.c:1456 +#: vms-tir.c:1442 #, c-format msgid "Unimplemented STO cmd %d" msgstr "" -#: vms-tir.c:1596 +#: vms-tir.c:1581 msgid "TIR_S_C_OPR_ASH incomplete" msgstr "" -#: vms-tir.c:1610 +#: vms-tir.c:1595 msgid "TIR_S_C_OPR_USH incomplete" msgstr "" -#: vms-tir.c:1624 +#: vms-tir.c:1609 msgid "TIR_S_C_OPR_ROT incomplete" msgstr "" #. #. * redefine symbol to current location #. -#: vms-tir.c:1645 +#: vms-tir.c:1630 msgid "TIR_S_C_OPR_REDEF not supported" msgstr "" #. #. * define a literal #. -#: vms-tir.c:1652 +#: vms-tir.c:1637 msgid "TIR_S_C_OPR_DFLIT not supported" msgstr "" -#: vms-tir.c:1707 +#: vms-tir.c:1691 msgid "TIR_S_C_CTL_DFLOC not fully implemented" msgstr "" -#: vms-tir.c:1715 +#: vms-tir.c:1699 msgid "TIR_S_C_CTL_STLOC not fully implemented" msgstr "" -#: vms-tir.c:1723 +#: vms-tir.c:1707 msgid "TIR_S_C_CTL_STKDL not fully implemented" msgstr "" -#: vms-tir.c:1778 +#: vms-tir.c:1761 #, c-format msgid "Obj code %d not found" msgstr "" -#: vms-tir.c:2127 +#: vms-tir.c:2102 #, c-format msgid "SEC_RELOC with no relocs in section %s" msgstr "" -#: vms-tir.c:2401 +#: vms-tir.c:2376 #, c-format msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:1661 +#: xcofflink.c:1634 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1713 +#: xcofflink.c:1686 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1736 +#: xcofflink.c:1709 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1748 +#: xcofflink.c:1721 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1787 +#: xcofflink.c:1760 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1911 +#: xcofflink.c:1883 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" msgstr "" -#: xcofflink.c:1930 +#: xcofflink.c:1902 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:2034 +#: xcofflink.c:2006 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:2345 +#: xcofflink.c:2317 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2480 +#: xcofflink.c:2452 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:2501 +#: xcofflink.c:2473 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:3141 +#: xcofflink.c:3113 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:3733 +#: xcofflink.c:3704 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:4709 +#: xcofflink.c:4698 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:5534 xcofflink.c:5890 xcofflink.c:5927 xcofflink.c:6244 +#: xcofflink.c:5523 xcofflink.c:5879 xcofflink.c:5916 xcofflink.c:6233 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5556 xcofflink.c:6255 +#: xcofflink.c:5545 xcofflink.c:6244 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:5571 +#: xcofflink.c:5560 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "" -#: xcofflink.c:6451 +#: xcofflink.c:6440 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: xcofflink.c:6497 +#: xcofflink.c:6486 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" diff --git a/contrib/binutils/bfd/ppcboot.c b/contrib/binutils/bfd/ppcboot.c index 9441848..d92a0a6 100644 --- a/contrib/binutils/bfd/ppcboot.c +++ b/contrib/binutils/bfd/ppcboot.c @@ -234,7 +234,7 @@ ppcboot_get_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - if (bfd_seek (abfd, offset + sizeof(ppcboot_hdr_t), SEEK_SET) != 0 + if (bfd_seek (abfd, offset + sizeof (ppcboot_hdr_t), SEEK_SET) != 0 || bfd_read (location, 1, count, abfd) != count) return false; return true; @@ -536,6 +536,6 @@ const bfd_target ppcboot_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + NULL }; diff --git a/contrib/binutils/bfd/ptrace-core.c b/contrib/binutils/bfd/ptrace-core.c index 0969dce..2c19f6d 100644 --- a/contrib/binutils/bfd/ptrace-core.c +++ b/contrib/binutils/bfd/ptrace-core.c @@ -32,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <signal.h> #include <sys/ptrace.h> - struct trad_core_struct { asection *data_section; @@ -66,7 +65,7 @@ ptrace_unix_core_file_p (abfd) struct trad_core_struct *rawptr; val = bfd_read ((void *)&u, 1, sizeof u, abfd); - if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC + if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC || u.pt_rev != _BCS_PTRACE_REV) { /* Too small to be a core file */ @@ -83,7 +82,7 @@ ptrace_unix_core_file_p (abfd) if (rawptr == NULL) return 0; - + abfd->tdata.trad_core_data = rawptr; rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ @@ -107,8 +106,7 @@ ptrace_unix_core_file_p (abfd) /* FIXME: Need to worry about shared memory, library data, and library text. I don't think that any of these things are supported on the - system on which I am developing this for though. */ - + system on which I am developing this for though. */ core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; @@ -116,11 +114,11 @@ ptrace_unix_core_file_p (abfd) core_datasec (abfd)->_raw_size = u.pt_dsize; core_stacksec (abfd)->_raw_size = u.pt_ssize; - core_regsec (abfd)->_raw_size = sizeof(u); + core_regsec (abfd)->_raw_size = sizeof (u); core_datasec (abfd)->vma = u.pt_o_data_start; core_stacksec (abfd)->vma = USRSTACK - u.pt_ssize; - core_regsec (abfd)->vma = 0 - sizeof(u); /* see trad-core.c */ + core_regsec (abfd)->vma = 0 - sizeof (u); /* see trad-core.c */ core_datasec (abfd)->filepos = (int) u.pt_dataptr; core_stacksec (abfd)->filepos = (int) (u.pt_dataptr + u.pt_dsize); @@ -163,16 +161,16 @@ boolean ptrace_unix_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd, *exec_bfd; { - /* FIXME: Use pt_timdat field of the ptrace_user structure to match + /* FIXME: Use pt_timdat field of the ptrace_user structure to match the date of the executable */ return true; } /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -213,7 +211,7 @@ const bfd_target ptrace_core_vec = bfd_false, bfd_false, bfd_false, bfd_false }, - + BFD_JUMP_TABLE_GENERIC (_bfd_generic), BFD_JUMP_TABLE_COPY (_bfd_generic), BFD_JUMP_TABLE_CORE (ptrace_unix), @@ -225,7 +223,7 @@ const bfd_target ptrace_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/contrib/binutils/bfd/reloc.c b/contrib/binutils/bfd/reloc.c index ef2375a..f37a6a9 100644 --- a/contrib/binutils/bfd/reloc.c +++ b/contrib/binutils/bfd/reloc.c @@ -146,7 +146,6 @@ DESCRIPTION to the relocation offset. Its interpretation is dependent upon the howto. For example, on the 68k the code: - | char foo[]; | main() | { @@ -161,11 +160,9 @@ DESCRIPTION | unlk fp | rts - This could create a reloc pointing to <<foo>>, but leave the offset in the data, something like: - |RELOCATION RECORDS FOR [.text]: |offset type value |00000006 32 _foo @@ -176,21 +173,17 @@ DESCRIPTION |0000000c 4e5e ; unlk fp |0000000e 4e75 ; rts - Using coff and an 88k, some instructions don't have enough space in them to represent the full address range, and pointers have to be loaded in two parts. So you'd get something like: - | or.u r13,r0,hi16(_foo+0x12345678) | ld.b r2,r13,lo16(_foo+0x12345678) | jmp r1 - This should create two relocs, both pointing to <<_foo>>, and with 0x12340000 in their addend field. The data would consist of: - |RELOCATION RECORDS FOR [.text]: |offset type value |00000002 HVRT16 _foo+0x12340000 @@ -200,7 +193,6 @@ DESCRIPTION |00000004 1c4d5678 ; ld.b r2,r13,0x5678 |00000008 f400c001 ; jmp r1 - The relocation routine digs out the value from the data, adds it to the addend to get the original offset, and then adds the value of <<_foo>>. Note that all 32 bits have to be kept around @@ -223,7 +215,6 @@ DESCRIPTION Both relocs contain a pointer to <<foo>>, and the offsets contain junk. - |RELOCATION RECORDS FOR [.text]: |offset type value |00000004 HI22 _foo+0x12345678 @@ -235,7 +226,6 @@ DESCRIPTION |0000000c 81c7e008 ; ret |00000010 81e80000 ; restore - o <<howto>> The <<howto>> field can be imagined as a @@ -391,7 +381,6 @@ FUNCTION DESCRIPTION The HOWTO define is horrible and will go away. - .#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ . {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC} @@ -399,7 +388,6 @@ DESCRIPTION And will be replaced with the totally magic way. But for the moment, we are compatible, so do it this way. - .#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) . @@ -589,7 +577,6 @@ DESCRIPTION */ - bfd_reloc_status_type bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, error_message) @@ -651,7 +638,6 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, else relocation = symbol->value; - reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ @@ -728,8 +714,6 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour - && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 - && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) { @@ -992,7 +976,6 @@ DESCRIPTION */ - bfd_reloc_status_type bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, input_section, error_message) @@ -1124,8 +1107,6 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour - && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 - && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) { @@ -1784,7 +1765,6 @@ displacements off that register. These relocation types are handled specially, because the value the register will have is decided relatively late. - ENUM BFD_RELOC_I960_CALLJ ENUMDOC @@ -2082,6 +2062,25 @@ ENUMDOC i386/elf relocations ENUM + BFD_RELOC_X86_64_GOT32 +ENUMX + BFD_RELOC_X86_64_PLT32 +ENUMX + BFD_RELOC_X86_64_COPY +ENUMX + BFD_RELOC_X86_64_GLOB_DAT +ENUMX + BFD_RELOC_X86_64_JUMP_SLOT +ENUMX + BFD_RELOC_X86_64_RELATIVE +ENUMX + BFD_RELOC_X86_64_GOTPCREL +ENUMX + BFD_RELOC_X86_64_32S +ENUMDOC + x86-64/elf relocations + +ENUM BFD_RELOC_NS32K_IMM_8 ENUMX BFD_RELOC_NS32K_IMM_16 @@ -2204,6 +2203,18 @@ ENUMDOC ARM 26 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. ENUM + BFD_RELOC_ARM_PCREL_BLX +ENUMDOC + ARM 26 bit pc-relative branch. The lowest bit must be zero and is + not stored in the instruction. The 2nd lowest bit comes from a 1 bit + field in the instruction. +ENUM + BFD_RELOC_THUMB_PCREL_BLX +ENUMDOC + Thumb 22 bit pc-relative branch. The lowest bit must be zero and is + not stored in the instruction. The 2nd lowest bit comes from a 1 bit + field in the instruction. +ENUM BFD_RELOC_ARM_IMMEDIATE ENUMX BFD_RELOC_ARM_ADRL_IMMEDIATE @@ -2295,6 +2306,20 @@ ENUMX BFD_RELOC_SH_DATA ENUMX BFD_RELOC_SH_LABEL +ENUMX + BFD_RELOC_SH_LOOP_START +ENUMX + BFD_RELOC_SH_LOOP_END +ENUMX + BFD_RELOC_SH_COPY +ENUMX + BFD_RELOC_SH_GLOB_DAT +ENUMX + BFD_RELOC_SH_JMP_SLOT +ENUMX + BFD_RELOC_SH_RELATIVE +ENUMX + BFD_RELOC_SH_GOTPC ENUMDOC Hitachi SH relocs. Not all of these appear in object files. @@ -2311,7 +2336,7 @@ ENUMDOC ENUM BFD_RELOC_ARC_B22_PCREL ENUMDOC - Argonaut RISC Core (ARC) relocs. + ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. The high 20 bits are installed in bits 26 through 7 of the instruction. @@ -2538,6 +2563,39 @@ ENUMDOC significant 8 bits of the opcode. ENUM + BFD_RELOC_TIC54X_PARTLS7 +ENUMDOC + This is a 7bit reloc for the tms320c54x, where the least + significant 7 bits of a 16 bit word are placed into the least + significant 7 bits of the opcode. + +ENUM + BFD_RELOC_TIC54X_PARTMS9 +ENUMDOC + This is a 9bit DP reloc for the tms320c54x, where the most + significant 9 bits of a 16 bit word are placed into the least + significant 9 bits of the opcode. + +ENUM + BFD_RELOC_TIC54X_23 +ENUMDOC + This is an extended address 23-bit reloc for the tms320c54x. + +ENUM + BFD_RELOC_TIC54X_16_OF_23 +ENUMDOC + This is a 16-bit reloc for the tms320c54x, where the least + significant 16 bits of a 23-bit extended address are placed into + the opcode. + +ENUM + BFD_RELOC_TIC54X_MS7_OF_23 +ENUMDOC + This is a reloc for the tms320c54x, where the most + significant 7 bits of a 23-bit extended address are placed into + the opcode. + +ENUM BFD_RELOC_FR30_48 ENUMDOC This is a 48 bit reloc for the FR30 that stores 32 bits. @@ -2606,7 +2664,7 @@ ENUM BFD_RELOC_AVR_16_PM ENUMDOC This is a 16 bit reloc for the AVR that stores 17 bit value (usually - program memory address) into 16 bits. + program memory address) into 16 bits. ENUM BFD_RELOC_AVR_LO8_LDI ENUMDOC @@ -2700,6 +2758,234 @@ ENUMDOC is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. +ENUM + BFD_RELOC_IA64_IMM14 +ENUMX + BFD_RELOC_IA64_IMM22 +ENUMX + BFD_RELOC_IA64_IMM64 +ENUMX + BFD_RELOC_IA64_DIR32MSB +ENUMX + BFD_RELOC_IA64_DIR32LSB +ENUMX + BFD_RELOC_IA64_DIR64MSB +ENUMX + BFD_RELOC_IA64_DIR64LSB +ENUMX + BFD_RELOC_IA64_GPREL22 +ENUMX + BFD_RELOC_IA64_GPREL64I +ENUMX + BFD_RELOC_IA64_GPREL32MSB +ENUMX + BFD_RELOC_IA64_GPREL32LSB +ENUMX + BFD_RELOC_IA64_GPREL64MSB +ENUMX + BFD_RELOC_IA64_GPREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF22 +ENUMX + BFD_RELOC_IA64_LTOFF64I +ENUMX + BFD_RELOC_IA64_PLTOFF22 +ENUMX + BFD_RELOC_IA64_PLTOFF64I +ENUMX + BFD_RELOC_IA64_PLTOFF64MSB +ENUMX + BFD_RELOC_IA64_PLTOFF64LSB +ENUMX + BFD_RELOC_IA64_FPTR64I +ENUMX + BFD_RELOC_IA64_FPTR32MSB +ENUMX + BFD_RELOC_IA64_FPTR32LSB +ENUMX + BFD_RELOC_IA64_FPTR64MSB +ENUMX + BFD_RELOC_IA64_FPTR64LSB +ENUMX + BFD_RELOC_IA64_PCREL21B +ENUMX + BFD_RELOC_IA64_PCREL21BI +ENUMX + BFD_RELOC_IA64_PCREL21M +ENUMX + BFD_RELOC_IA64_PCREL21F +ENUMX + BFD_RELOC_IA64_PCREL22 +ENUMX + BFD_RELOC_IA64_PCREL60B +ENUMX + BFD_RELOC_IA64_PCREL64I +ENUMX + BFD_RELOC_IA64_PCREL32MSB +ENUMX + BFD_RELOC_IA64_PCREL32LSB +ENUMX + BFD_RELOC_IA64_PCREL64MSB +ENUMX + BFD_RELOC_IA64_PCREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR22 +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64I +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64MSB +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64LSB +ENUMX + BFD_RELOC_IA64_SEGREL32MSB +ENUMX + BFD_RELOC_IA64_SEGREL32LSB +ENUMX + BFD_RELOC_IA64_SEGREL64MSB +ENUMX + BFD_RELOC_IA64_SEGREL64LSB +ENUMX + BFD_RELOC_IA64_SECREL32MSB +ENUMX + BFD_RELOC_IA64_SECREL32LSB +ENUMX + BFD_RELOC_IA64_SECREL64MSB +ENUMX + BFD_RELOC_IA64_SECREL64LSB +ENUMX + BFD_RELOC_IA64_REL32MSB +ENUMX + BFD_RELOC_IA64_REL32LSB +ENUMX + BFD_RELOC_IA64_REL64MSB +ENUMX + BFD_RELOC_IA64_REL64LSB +ENUMX + BFD_RELOC_IA64_LTV32MSB +ENUMX + BFD_RELOC_IA64_LTV32LSB +ENUMX + BFD_RELOC_IA64_LTV64MSB +ENUMX + BFD_RELOC_IA64_LTV64LSB +ENUMX + BFD_RELOC_IA64_IPLTMSB +ENUMX + BFD_RELOC_IA64_IPLTLSB +ENUMX + BFD_RELOC_IA64_COPY +ENUMX + BFD_RELOC_IA64_TPREL22 +ENUMX + BFD_RELOC_IA64_TPREL64MSB +ENUMX + BFD_RELOC_IA64_TPREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF_TP22 +ENUMX + BFD_RELOC_IA64_LTOFF22X +ENUMX + BFD_RELOC_IA64_LDXMOV +ENUMDOC + Intel IA64 Relocations. + +ENUM + BFD_RELOC_M68HC11_HI8 +ENUMDOC + Motorola 68HC11 reloc. + This is the 8 bits high part of an absolute address. +ENUM + BFD_RELOC_M68HC11_LO8 +ENUMDOC + Motorola 68HC11 reloc. + This is the 8 bits low part of an absolute address. +ENUM + BFD_RELOC_M68HC11_3B +ENUMDOC + Motorola 68HC11 reloc. + This is the 3 bits of a value. + +ENUM + BFD_RELOC_CRIS_BDISP8 +ENUMX + BFD_RELOC_CRIS_UNSIGNED_5 +ENUMX + BFD_RELOC_CRIS_SIGNED_6 +ENUMX + BFD_RELOC_CRIS_UNSIGNED_6 +ENUMX + BFD_RELOC_CRIS_UNSIGNED_4 +ENUMDOC + These relocs are only used within the CRIS assembler. They are not + (at present) written to any object files. + +ENUM + BFD_RELOC_860_COPY +ENUMX + BFD_RELOC_860_GLOB_DAT +ENUMX + BFD_RELOC_860_JUMP_SLOT +ENUMX + BFD_RELOC_860_RELATIVE +ENUMX + BFD_RELOC_860_PC26 +ENUMX + BFD_RELOC_860_PLT26 +ENUMX + BFD_RELOC_860_PC16 +ENUMX + BFD_RELOC_860_LOW0 +ENUMX + BFD_RELOC_860_SPLIT0 +ENUMX + BFD_RELOC_860_LOW1 +ENUMX + BFD_RELOC_860_SPLIT1 +ENUMX + BFD_RELOC_860_LOW2 +ENUMX + BFD_RELOC_860_SPLIT2 +ENUMX + BFD_RELOC_860_LOW3 +ENUMX + BFD_RELOC_860_LOGOT0 +ENUMX + BFD_RELOC_860_SPGOT0 +ENUMX + BFD_RELOC_860_LOGOT1 +ENUMX + BFD_RELOC_860_SPGOT1 +ENUMX + BFD_RELOC_860_LOGOTOFF0 +ENUMX + BFD_RELOC_860_SPGOTOFF0 +ENUMX + BFD_RELOC_860_LOGOTOFF1 +ENUMX + BFD_RELOC_860_SPGOTOFF1 +ENUMX + BFD_RELOC_860_LOGOTOFF2 +ENUMX + BFD_RELOC_860_LOGOTOFF3 +ENUMX + BFD_RELOC_860_LOPC +ENUMX + BFD_RELOC_860_HIGHADJ +ENUMX + BFD_RELOC_860_HAGOT +ENUMX + BFD_RELOC_860_HAGOTOFF +ENUMX + BFD_RELOC_860_HAPC +ENUMX + BFD_RELOC_860_HIGH +ENUMX + BFD_RELOC_860_HIGOT +ENUMX + BFD_RELOC_860_HIGOTOFF +ENUMDOC + Intel i860 Relocations. + ENDSENUM BFD_RELOC_UNUSED CODE_FRAGMENT @@ -2707,7 +2993,6 @@ CODE_FRAGMENT .typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; */ - /* FUNCTION bfd_reloc_type_lookup @@ -2723,7 +3008,6 @@ DESCRIPTION */ - reloc_howto_type * bfd_reloc_type_lookup (abfd, code) bfd *abfd; @@ -2735,7 +3019,6 @@ bfd_reloc_type_lookup (abfd, code) static reloc_howto_type bfd_howto_32 = HOWTO (0, 00, 2, 32, false, 0, complain_overflow_bitfield, 0, "VRT32", false, 0xffffffff, 0xffffffff, true); - /* INTERNAL_FUNCTION bfd_default_reloc_type_lookup @@ -2747,7 +3030,6 @@ SYNOPSIS DESCRIPTION Provides a default relocation lookup routine for any architecture. - */ reloc_howto_type * diff --git a/contrib/binutils/bfd/reloc16.c b/contrib/binutils/bfd/reloc16.c index 0e7c18a..cb9636f 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, 1998 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -19,10 +19,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* -Most of this hacked by Steve Chamberlain, - sac@cygnus.com -*/ +/* Most of this hacked by Steve Chamberlain <sac@cygnus.com>. */ /* These routines are used by coff-h8300 and coff-z8k to do relocation. @@ -53,7 +50,7 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section) asymbol *symbol = *(reloc->sym_ptr_ptr); /* A symbol holds a pointer to a section, and an offset from the base of the section. To relocate, we find where the section will - live in the output and add that in */ + live in the output and add that in. */ if (bfd_is_und_section (symbol->section) || bfd_is_com_section (symbol->section)) @@ -79,29 +76,29 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section) value = h->u.c.size; else { - if (! ((*link_info->callbacks->undefined_symbol) - (link_info, bfd_asymbol_name (symbol), - input_section->owner, input_section, reloc->address, - true))) + if (!((*link_info->callbacks->undefined_symbol) + (link_info, bfd_asymbol_name (symbol), + input_section->owner, input_section, reloc->address, + true))) abort (); value = 0; } } - else + else { - value = symbol->value + - symbol->section->output_offset + - symbol->section->output_section->vma; + value = symbol->value + + symbol->section->output_offset + + symbol->section->output_section->vma; } - - /* Add the value contained in the relocation */ + + /* Add the value contained in the relocation. */ value += reloc->addend; - + return value; } void -bfd_perform_slip(abfd, slip, input_section, value) +bfd_perform_slip (abfd, slip, input_section, value) bfd *abfd; unsigned int slip; asection *input_section; @@ -113,13 +110,13 @@ bfd_perform_slip(abfd, slip, input_section, value) BFD_ASSERT (s != (asymbol **) NULL); /* Find all symbols past this point, and make them know - what's happened */ - while (*s) + what's happened. */ + while (*s) { asymbol *p = *s; - if (p->section == input_section) + if (p->section == input_section) { - /* This was pointing into this section, so mangle it */ + /* This was pointing into this section, so mangle it. */ if (p->value > value) { p->value -= slip; @@ -136,17 +133,17 @@ bfd_perform_slip(abfd, slip, input_section, value) } } s++; - } + } } -boolean +boolean bfd_coff_reloc16_relax_section (abfd, i, link_info, again) bfd *abfd; asection *i; struct bfd_link_info *link_info; boolean *again; { - /* Get enough memory to hold the stuff */ + /* Get enough memory to hold the stuff. */ bfd *input_bfd = i->owner; asection *input_section = i; int *shrinks; @@ -166,7 +163,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) if (!reloc_vector && reloc_size > 0) return false; - /* Get the relocs and think about them */ + /* Get the relocs and think about them. */ reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, reloc_vector, _bfd_generic_link_get_symbols (input_bfd)); @@ -190,7 +187,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) entire link, we could use the generic relaxing code in the linker and get better results, particularly for jsr->bsr and 24->16 bit memory reference relaxations. */ - + if (reloc_count > 0) { int another_pass = 0; @@ -208,7 +205,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) another_pass = 0; - for (i = 0, parent = reloc_vector; *parent; parent++, i++) + for (i = 0, parent = reloc_vector; *parent; parent++, i++) { /* Let the target/machine dependent code examine each reloc in this section and attempt to shrink it. */ @@ -224,15 +221,15 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) shrinks[j] += shrink - shrinks[i]; } } - - } while (another_pass); + } + while (another_pass); shrink = shrinks[reloc_count]; - free((char *)shrinks); + free ((char *) shrinks); } - input_section->_cooked_size -= shrink; - free((char *)reloc_vector); + input_section->_cooked_size -= shrink; + free ((char *) reloc_vector); return true; } @@ -250,7 +247,7 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, boolean relocateable; asymbol **symbols; { - /* Get enough memory to hold the stuff */ + /* Get enough memory to hold the stuff. */ bfd *input_bfd = link_order->u.indirect.section->owner; asection *input_section = link_order->u.indirect.section; long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); @@ -267,20 +264,19 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, data, relocateable, symbols); - /* read in the section */ - if (! bfd_get_section_contents(input_bfd, - input_section, - data, - 0, - input_section->_raw_size)) + /* Read in the section. */ + if (!bfd_get_section_contents(input_bfd, + input_section, + data, + 0, + input_section->_raw_size)) return NULL; - - - reloc_vector = (arelent **) bfd_malloc((size_t) reloc_size); + + reloc_vector = (arelent **) bfd_malloc ((size_t) reloc_size); if (!reloc_vector && reloc_size != 0) return NULL; - - reloc_count = bfd_canonicalize_reloc (input_bfd, + + reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, reloc_vector, symbols); @@ -289,49 +285,46 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, free (reloc_vector); return NULL; } - + if (reloc_count > 0) { arelent **parent = reloc_vector; - arelent *reloc ; + arelent *reloc; unsigned int dst_address = 0; unsigned int src_address = 0; unsigned int run; unsigned int idx; - - /* Find how long a run we can do */ - while (dst_address < link_order->size) + + /* Find how long a run we can do. */ + while (dst_address < link_order->size) { reloc = *parent; - if (reloc) + if (reloc) { /* Note that the relaxing didn't tie up the addresses in the relocation, so we use the original address to work out the - run of non-relocated data */ + run of non-relocated data. */ run = reloc->address - src_address; parent++; } - else + else { run = link_order->size - dst_address; } - /* Copy the bytes */ + + /* Copy the bytes. */ for (idx = 0; idx < run; idx++) - { - data[dst_address++] = data[src_address++]; - } - - /* Now do the relocation */ - - if (reloc) + data[dst_address++] = data[src_address++]; + + /* Now do the relocation. */ + if (reloc) { bfd_coff_reloc16_extra_cases (input_bfd, link_info, link_order, reloc, data, &src_address, &dst_address); - } + } } } - free((char *)reloc_vector); + free ((char *) reloc_vector); return data; } - diff --git a/contrib/binutils/bfd/sco5-core.c b/contrib/binutils/bfd/sco5-core.c index 46c97d2..5d5677e 100644 --- a/contrib/binutils/bfd/sco5-core.c +++ b/contrib/binutils/bfd/sco5-core.c @@ -84,7 +84,7 @@ sco5_core_make_empty_symbol (abfd) new->the_bfd = abfd; return new; } - + static struct user * read_uarea(abfd, filepos) bfd *abfd; @@ -109,7 +109,7 @@ read_uarea(abfd, filepos) } /* Sanity check perhaps??? */ - if (rawptr->u.u_dsize > 0x1000000) /* Remember, it's in pages... */ + if (rawptr->u.u_dsize > 0x1000000) /* Remember, it's in pages... */ { bfd_set_error (bfd_error_wrong_format); return NULL; @@ -154,7 +154,7 @@ sco5_core_file_p (abfd) || (bfd_read ((void *)&coffset_siz, 1, sizeof coffset_siz, abfd) != sizeof coffset_siz) ) { - bfd_set_error (bfd_error_wrong_format); + bfd_set_error (bfd_error_wrong_format); return NULL; } @@ -165,50 +165,49 @@ sco5_core_file_p (abfd) != sizeof coffsets) || ((coffsets.u_info != 1) && (coffsets.u_info != C_VERSION))) { - bfd_set_error (bfd_error_wrong_format); + bfd_set_error (bfd_error_wrong_format); return NULL; } - - if (coffsets.u_info == 1) - { + if (coffsets.u_info == 1) + { /* Old version, no section heads, read info from user struct */ u = read_uarea(abfd, coffsets.u_user); if (! u) return NULL; - if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS, + if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS, (bfd_size_type) coffsets.u_usize, 0 - (bfd_vma) u->u_ar0, (file_ptr) coffsets.u_user)) return NULL; - - if (!make_bfd_asection (abfd, ".data", + + if (!make_bfd_asection (abfd, ".data", SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, ((bfd_size_type) u->u_exdata.ux_dsize + u->u_exdata.ux_bsize), (bfd_vma) u->u_exdata.ux_datorg, (file_ptr) coffsets.u_data)) return NULL; - - if (!make_bfd_asection (abfd, ".stack", - SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, + + if (!make_bfd_asection (abfd, ".stack", + SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, (bfd_size_type) u->u_ssize * NBPC, (bfd_vma) u->u_sub, (file_ptr) coffsets.u_stack)) return NULL; return abfd->xvec; /* Done for version 1 */ - } + } /* Immediately before coreoffsets region is a long with offset in core to first coresecthead (CORES_OFFSETS), the long before this is the number of section heads in the list. Read both longs and read the coresecthead and check its validity */ - - if ((bfd_seek (abfd, - coresize - coffset_siz - 2 * sizeof coffset_siz, + + if ((bfd_seek (abfd, + coresize - coffset_siz - 2 * sizeof coffset_siz, SEEK_SET) != 0) || (bfd_read ((void *)&nsecs, 1, sizeof nsecs, abfd) != sizeof nsecs) || (bfd_read ((void *)&cheadoffs, 1, sizeof cheadoffs, abfd) @@ -226,16 +225,16 @@ sco5_core_file_p (abfd) /* Now loop over all regions and map them */ nsecs--; /* We've seen CORES_OFFSETS already */ - for (; nsecs; nsecs--) + for (; nsecs; nsecs--) { if ((bfd_seek (abfd, chead.cs_hseek, SEEK_SET) != 0) || bfd_read ((void *)&chead, 1, sizeof chead, abfd) != sizeof chead) { - bfd_set_error (bfd_error_wrong_format); + bfd_set_error (bfd_error_wrong_format); return NULL; } - switch (chead.cs_stype) + switch (chead.cs_stype) { case CORES_MAGIC: /* Core header, check magic */ if (chead.cs_x.csx_magic != COREMAGIC_NUMBER) @@ -259,7 +258,7 @@ sco5_core_file_p (abfd) *u_ar0. The other is that u_ar0 is sometimes an absolute address in kernel memory, and on other systems it is an offset from the beginning of the `struct user'. - + As a practical matter, we don't know where the registers actually are, so we have to pass the whole area to GDB. We encode the value of u_ar0 by setting the .regs section @@ -267,11 +266,10 @@ sco5_core_file_p (abfd) pointed to by u_ar0 (by setting the vma of the start of the section to -u_ar0). GDB uses this info to locate the regs, using minor trickery to get around the - offset-or-absolute-addr problem. */ + offset-or-absolute-addr problem. */ chead.cs_vaddr = 0 - (bfd_vma) u->u_ar0; - secname = ".reg"; flags = SEC_HAS_CONTENTS; @@ -345,8 +343,8 @@ int sco5_core_file_failing_signal (ignore_abfd) bfd *ignore_abfd; { - return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0) - ? ignore_abfd->tdata.sco5_core_data->u.u_sysabort + return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0) + ? ignore_abfd->tdata.sco5_core_data->u.u_sysabort : -1); } @@ -371,9 +369,9 @@ sco5_core_file_matches_executable_p (core_bfd, exec_bfd) /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -426,6 +424,6 @@ const bfd_target sco5_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/contrib/binutils/bfd/section.c b/contrib/binutils/bfd/section.c index b3b7608..13e10d3 100644 --- a/contrib/binutils/bfd/section.c +++ b/contrib/binutils/bfd/section.c @@ -1,5 +1,5 @@ /* Object file "section" support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -111,7 +111,6 @@ SUBSECTION | size 0x103 | | output_section --------| - SUBSECTION Link orders @@ -133,7 +132,6 @@ SUBSECTION */ - #include "bfd.h" #include "sysdep.h" #include "libbfd.h" @@ -150,10 +148,10 @@ SUBSECTION CODE_FRAGMENT . -. {* This structure is used for a comdat section, as in PE. A comdat -. section is associated with a particular symbol. When the linker -. sees a comdat section, it keeps only one of the sections with a -. given name and associated with a given symbol. *} +.{* This structure is used for a comdat section, as in PE. A comdat +. section is associated with a particular symbol. When the linker +. sees a comdat section, it keeps only one of the sections with a +. given name and associated with a given symbol. *} . .struct bfd_comdat_info .{ @@ -165,340 +163,362 @@ CODE_FRAGMENT . specific code; it is not an index into the list returned by . bfd_canonicalize_symtab. *} . long symbol; -. -. {* If this section is being discarded, the linker uses this field -. to point to the input section which is being kept. *} -. struct sec *sec; .}; . .typedef struct sec .{ -. {* The name of the section; the name isn't a copy, the pointer is -. the same as that passed to bfd_make_section. *} +. {* The name of the section; the name isn't a copy, the pointer is +. the same as that passed to bfd_make_section. *} +. +. const char *name; +. +. {* A unique sequence number. *} . -. CONST char *name; +. int id; . -. {* Which section is it; 0..nth. *} +. {* Which section is it; 0..nth. *} . -. int index; +. int index; . -. {* The next section in the list belonging to the BFD, or NULL. *} +. {* The next section in the list belonging to the BFD, or NULL. *} . -. struct sec *next; +. struct sec *next; . -. {* The field flags contains attributes of the section. Some -. flags are read in from the object file, and some are -. synthesized from other information. *} +. {* The field flags contains attributes of the section. Some +. flags are read in from the object file, and some are +. synthesized from other information. *} . -. flagword flags; +. flagword flags; . .#define SEC_NO_FLAGS 0x000 . -. {* Tells the OS to allocate space for this section when loading. -. This is clear for a section containing debug information -. only. *} +. {* Tells the OS to allocate space for this section when loading. +. This is clear for a section containing debug information only. *} .#define SEC_ALLOC 0x001 . -. {* Tells the OS to load the section from the file when loading. -. This is clear for a .bss section. *} +. {* Tells the OS to load the section from the file when loading. +. This is clear for a .bss section. *} .#define SEC_LOAD 0x002 . -. {* The section contains data still to be relocated, so there is -. some relocation information too. *} +. {* The section contains data still to be relocated, so there is +. some relocation information too. *} .#define SEC_RELOC 0x004 . .#if 0 {* Obsolete ? *} .#define SEC_BALIGN 0x008 .#endif . -. {* A signal to the OS that the section contains read only -. data. *} +. {* A signal to the OS that the section contains read only data. *} .#define SEC_READONLY 0x010 . -. {* The section contains code only. *} +. {* The section contains code only. *} .#define SEC_CODE 0x020 . -. {* The section contains data only. *} +. {* The section contains data only. *} .#define SEC_DATA 0x040 . -. {* The section will reside in ROM. *} +. {* The section will reside in ROM. *} .#define SEC_ROM 0x080 . -. {* The section contains constructor information. This section -. type is used by the linker to create lists of constructors and -. destructors used by <<g++>>. When a back end sees a symbol -. which should be used in a constructor list, it creates a new -. section for the type of name (e.g., <<__CTOR_LIST__>>), attaches -. the symbol to it, and builds a relocation. To build the lists -. of constructors, all the linker has to do is catenate all the -. sections called <<__CTOR_LIST__>> and relocate the data -. contained within - exactly the operations it would peform on -. standard data. *} +. {* The section contains constructor information. This section +. type is used by the linker to create lists of constructors and +. destructors used by <<g++>>. When a back end sees a symbol +. which should be used in a constructor list, it creates a new +. section for the type of name (e.g., <<__CTOR_LIST__>>), attaches +. the symbol to it, and builds a relocation. To build the lists +. of constructors, all the linker has to do is catenate all the +. sections called <<__CTOR_LIST__>> and relocate the data +. contained within - exactly the operations it would peform on +. standard data. *} .#define SEC_CONSTRUCTOR 0x100 . -. {* The section is a constructor, and should be placed at the -. end of the text, data, or bss section(?). *} +. {* The section is a constructor, and should be placed at the +. end of the text, data, or bss section(?). *} .#define SEC_CONSTRUCTOR_TEXT 0x1100 .#define SEC_CONSTRUCTOR_DATA 0x2100 .#define SEC_CONSTRUCTOR_BSS 0x3100 . -. {* The section has contents - a data section could be -. <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be -. <<SEC_HAS_CONTENTS>> *} +. {* The section has contents - a data section could be +. <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be +. <<SEC_HAS_CONTENTS>> *} .#define SEC_HAS_CONTENTS 0x200 . -. {* An instruction to the linker to not output the section -. even if it has information which would normally be written. *} +. {* An instruction to the linker to not output the section +. even if it has information which would normally be written. *} .#define SEC_NEVER_LOAD 0x400 . -. {* The section is a COFF shared library section. This flag is -. only for the linker. If this type of section appears in -. the input file, the linker must copy it to the output file -. without changing the vma or size. FIXME: Although this -. was originally intended to be general, it really is COFF -. specific (and the flag was renamed to indicate this). It -. might be cleaner to have some more general mechanism to -. allow the back end to control what the linker does with -. sections. *} +. {* The section is a COFF shared library section. This flag is +. only for the linker. If this type of section appears in +. the input file, the linker must copy it to the output file +. without changing the vma or size. FIXME: Although this +. was originally intended to be general, it really is COFF +. specific (and the flag was renamed to indicate this). It +. might be cleaner to have some more general mechanism to +. allow the back end to control what the linker does with +. sections. *} .#define SEC_COFF_SHARED_LIBRARY 0x800 . -. {* The section contains common symbols (symbols may be defined -. multiple times, the value of a symbol is the amount of -. space it requires, and the largest symbol value is the one -. used). Most targets have exactly one of these (which we -. translate to bfd_com_section_ptr), but ECOFF has two. *} +. {* The section has GOT references. This flag is only for the +. linker, and is currently only used by the elf32-hppa back end. +. It will be set if global offset table references were detected +. in this section, which indicate to the linker that the section +. contains PIC code, and must be handled specially when doing a +. static link. *} +.#define SEC_HAS_GOT_REF 0x4000 +. +. {* The section contains common symbols (symbols may be defined +. multiple times, the value of a symbol is the amount of +. space it requires, and the largest symbol value is the one +. used). Most targets have exactly one of these (which we +. translate to bfd_com_section_ptr), but ECOFF has two. *} .#define SEC_IS_COMMON 0x8000 . -. {* The section contains only debugging information. For -. example, this is set for ELF .debug and .stab sections. -. strip tests this flag to see if a section can be -. discarded. *} +. {* The section contains only debugging information. For +. example, this is set for ELF .debug and .stab sections. +. strip tests this flag to see if a section can be +. discarded. *} .#define SEC_DEBUGGING 0x10000 . -. {* The contents of this section are held in memory pointed to -. by the contents field. This is checked by -. bfd_get_section_contents, and the data is retrieved from -. memory if appropriate. *} +. {* The contents of this section are held in memory pointed to +. by the contents field. This is checked by bfd_get_section_contents, +. and the data is retrieved from memory if appropriate. *} .#define SEC_IN_MEMORY 0x20000 . -. {* The contents of this section are to be excluded by the -. linker for executable and shared objects unless those -. objects are to be further relocated. *} +. {* The contents of this section are to be excluded by the +. linker for executable and shared objects unless those +. objects are to be further relocated. *} .#define SEC_EXCLUDE 0x40000 . -. {* The contents of this section are to be sorted by the -. based on the address specified in the associated symbol -. table. *} +. {* The contents of this section are to be sorted by the +. based on the address specified in the associated symbol +. table. *} .#define SEC_SORT_ENTRIES 0x80000 . -. {* When linking, duplicate sections of the same name should be -. discarded, rather than being combined into a single section as -. is usually done. This is similar to how common symbols are -. handled. See SEC_LINK_DUPLICATES below. *} +. {* When linking, duplicate sections of the same name should be +. discarded, rather than being combined into a single section as +. is usually done. This is similar to how common symbols are +. handled. See SEC_LINK_DUPLICATES below. *} .#define SEC_LINK_ONCE 0x100000 . -. {* If SEC_LINK_ONCE is set, this bitfield describes how the linker -. should handle duplicate sections. *} +. {* If SEC_LINK_ONCE is set, this bitfield describes how the linker +. should handle duplicate sections. *} .#define SEC_LINK_DUPLICATES 0x600000 . -. {* This value for SEC_LINK_DUPLICATES means that duplicate -. sections with the same name should simply be discarded. *} +. {* This value for SEC_LINK_DUPLICATES means that duplicate +. sections with the same name should simply be discarded. *} .#define SEC_LINK_DUPLICATES_DISCARD 0x0 . -. {* This value for SEC_LINK_DUPLICATES means that the linker -. should warn if there are any duplicate sections, although -. it should still only link one copy. *} +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if there are any duplicate sections, although +. it should still only link one copy. *} .#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 . -. {* This value for SEC_LINK_DUPLICATES means that the linker -. should warn if any duplicate sections are a different size. *} +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if any duplicate sections are a different size. *} .#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 . -. {* This value for SEC_LINK_DUPLICATES means that the linker -. should warn if any duplicate sections contain different -. contents. *} +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if any duplicate sections contain different +. contents. *} .#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 . -. {* This section was created by the linker as part of dynamic -. relocation or other arcane processing. It is skipped when -. going through the first-pass output, trusting that someone -. else up the line will take care of it later. *} +. {* This section was created by the linker as part of dynamic +. relocation or other arcane processing. It is skipped when +. going through the first-pass output, trusting that someone +. else up the line will take care of it later. *} .#define SEC_LINKER_CREATED 0x800000 . -. {* This section should not be subject to garbage collection. *} +. {* This section should not be subject to garbage collection. *} .#define SEC_KEEP 0x1000000 . -. {* This section contains "short" data, and should be placed -. "near" the GP. *} +. {* This section contains "short" data, and should be placed +. "near" the GP. *} .#define SEC_SMALL_DATA 0x2000000 . -. {* This section contains data which may be shared with other -. executables or shared objects. *} +. {* This section contains data which may be shared with other +. executables or shared objects. *} .#define SEC_SHARED 0x4000000 . -. {* End of section flags. *} +. {* When a section with this flag is being linked, then if the size of +. the input section is less than a page, it should not cross a page +. boundary. If the size of the input section is one page or more, it +. should be aligned on a page boundary. *} +.#define SEC_BLOCK 0x8000000 . -. {* Some internal packed boolean fields. *} +. {* Conditionally link this section; do not link if there are no +. references found to any symbol in the section. *} +.#define SEC_CLINK 0x10000000 . -. {* See the vma field. *} -. unsigned int user_set_vma : 1; +. {* End of section flags. *} . -. {* Whether relocations have been processed. *} -. unsigned int reloc_done : 1; +. {* Some internal packed boolean fields. *} . -. {* A mark flag used by some of the linker backends. *} -. unsigned int linker_mark : 1; +. {* See the vma field. *} +. unsigned int user_set_vma : 1; . -. {* A mark flag used by some linker backends for garbage collection. *} -. unsigned int gc_mark : 1; +. {* Whether relocations have been processed. *} +. unsigned int reloc_done : 1; . -. {* End of internal packed boolean fields. *} +. {* A mark flag used by some of the linker backends. *} +. unsigned int linker_mark : 1; . -. {* The virtual memory address of the section - where it will be -. at run time. The symbols are relocated against this. The -. user_set_vma flag is maintained by bfd; if it's not set, the -. backend can assign addresses (for example, in <<a.out>>, where -. the default address for <<.data>> is dependent on the specific -. target and various flags). *} +. {* A mark flag used by some linker backends for garbage collection. *} +. unsigned int gc_mark : 1; . -. bfd_vma vma; +. {* Used by the ELF code to mark sections which have been allocated to segments. *} +. unsigned int segment_mark : 1; . -. {* The load address of the section - where it would be in a -. rom image; really only used for writing section header -. information. *} +. {* End of internal packed boolean fields. *} . -. bfd_vma lma; +. {* The virtual memory address of the section - where it will be +. at run time. The symbols are relocated against this. The +. user_set_vma flag is maintained by bfd; if it's not set, the +. backend can assign addresses (for example, in <<a.out>>, where +. the default address for <<.data>> is dependent on the specific +. target and various flags). *} . -. {* The size of the section in octets, as it will be output. -. Contains a value even if the section has no contents (e.g., the -. size of <<.bss>>). This will be filled in after relocation. *} +. bfd_vma vma; . -. bfd_size_type _cooked_size; +. {* The load address of the section - where it would be in a +. rom image; really only used for writing section header +. information. *} . -. {* The original size on disk of the section, in octets. Normally this -. value is the same as the size, but if some relaxing has -. been done, then this value will be bigger. *} +. bfd_vma lma; . -. bfd_size_type _raw_size; +. {* The size of the section in octets, as it will be output. +. Contains a value even if the section has no contents (e.g., the +. size of <<.bss>>). This will be filled in after relocation. *} . -. {* If this section is going to be output, then this value is the -. offset in *bytes* into the output section of the first byte in the -. input section (byte ==> smallest addressable unit on the -. target). In most cases, if this was going to start at the -. 100th octet (8-bit quantity) in the output section, this value -. would be 100. However, if the target byte size is 16 bits -. (bfd_octets_per_byte is "2"), this value would be 50. *} +. bfd_size_type _cooked_size; . -. bfd_vma output_offset; +. {* The original size on disk of the section, in octets. Normally this +. value is the same as the size, but if some relaxing has +. been done, then this value will be bigger. *} . -. {* The output section through which to map on output. *} +. bfd_size_type _raw_size; . -. struct sec *output_section; +. {* If this section is going to be output, then this value is the +. offset in *bytes* into the output section of the first byte in the +. input section (byte ==> smallest addressable unit on the +. target). In most cases, if this was going to start at the +. 100th octet (8-bit quantity) in the output section, this value +. would be 100. However, if the target byte size is 16 bits +. (bfd_octets_per_byte is "2"), this value would be 50. *} . -. {* The alignment requirement of the section, as an exponent of 2 - -. e.g., 3 aligns to 2^3 (or 8). *} +. bfd_vma output_offset; . -. unsigned int alignment_power; +. {* The output section through which to map on output. *} . -. {* If an input section, a pointer to a vector of relocation -. records for the data in this section. *} +. struct sec *output_section; . -. struct reloc_cache_entry *relocation; +. {* The alignment requirement of the section, as an exponent of 2 - +. e.g., 3 aligns to 2^3 (or 8). *} . -. {* If an output section, a pointer to a vector of pointers to -. relocation records for the data in this section. *} +. unsigned int alignment_power; . -. struct reloc_cache_entry **orelocation; +. {* If an input section, a pointer to a vector of relocation +. records for the data in this section. *} . -. {* The number of relocation records in one of the above *} +. struct reloc_cache_entry *relocation; . -. unsigned reloc_count; +. {* If an output section, a pointer to a vector of pointers to +. relocation records for the data in this section. *} . -. {* Information below is back end specific - and not always used -. or updated. *} +. struct reloc_cache_entry **orelocation; . -. {* File position of section data *} +. {* The number of relocation records in one of the above *} . -. file_ptr filepos; +. unsigned reloc_count; . -. {* File position of relocation info *} +. {* Information below is back end specific - and not always used +. or updated. *} . -. file_ptr rel_filepos; +. {* File position of section data. *} . -. {* File position of line data *} +. file_ptr filepos; . -. file_ptr line_filepos; +. {* File position of relocation info. *} . -. {* Pointer to data for applications *} +. file_ptr rel_filepos; . -. PTR userdata; +. {* File position of line data. *} . -. {* If the SEC_IN_MEMORY flag is set, this points to the actual -. contents. *} -. unsigned char *contents; +. file_ptr line_filepos; . -. {* Attached line number information *} +. {* Pointer to data for applications. *} . -. alent *lineno; +. PTR userdata; . -. {* Number of line number records *} +. {* If the SEC_IN_MEMORY flag is set, this points to the actual +. contents. *} +. unsigned char *contents; . -. unsigned int lineno_count; +. {* Attached line number information. *} . -. {* Optional information about a COMDAT entry; NULL if not COMDAT *} +. alent *lineno; . -. struct bfd_comdat_info *comdat; +. {* Number of line number records. *} . -. {* When a section is being output, this value changes as more -. linenumbers are written out *} +. unsigned int lineno_count; . -. file_ptr moving_line_filepos; +. {* Optional information about a COMDAT entry; NULL if not COMDAT. *} . -. {* What the section number is in the target world *} +. struct bfd_comdat_info *comdat; . -. int target_index; +. {* Points to the kept section if this section is a link-once section, +. and is discarded. *} +. struct sec *kept_section; . -. PTR used_by_bfd; +. {* When a section is being output, this value changes as more +. linenumbers are written out. *} . -. {* If this is a constructor section then here is a list of the -. relocations created to relocate items within it. *} +. file_ptr moving_line_filepos; . -. struct relent_chain *constructor_chain; +. {* What the section number is in the target world. *} . -. {* The BFD which owns the section. *} +. int target_index; . -. bfd *owner; +. PTR used_by_bfd; . -. {* A symbol which points at this section only *} -. struct symbol_cache_entry *symbol; -. struct symbol_cache_entry **symbol_ptr_ptr; +. {* If this is a constructor section then here is a list of the +. relocations created to relocate items within it. *} . -. struct bfd_link_order *link_order_head; -. struct bfd_link_order *link_order_tail; +. struct relent_chain *constructor_chain; +. +. {* The BFD which owns the section. *} +. +. bfd *owner; +. +. {* A symbol which points at this section only *} +. struct symbol_cache_entry *symbol; +. struct symbol_cache_entry **symbol_ptr_ptr; +. +. struct bfd_link_order *link_order_head; +. struct bfd_link_order *link_order_tail; .} asection ; . -. {* These sections are global, and are managed by BFD. The application -. and target back end are not permitted to change the values in -. these sections. New code should use the section_ptr macros rather -. than referring directly to the const sections. The const sections -. may eventually vanish. *} +.{* These sections are global, and are managed by BFD. The application +. and target back end are not permitted to change the values in +. these sections. New code should use the section_ptr macros rather +. than referring directly to the const sections. The const sections +. may eventually vanish. *} .#define BFD_ABS_SECTION_NAME "*ABS*" .#define BFD_UND_SECTION_NAME "*UND*" .#define BFD_COM_SECTION_NAME "*COM*" .#define BFD_IND_SECTION_NAME "*IND*" . -. {* the absolute section *} +.{* the absolute section *} .extern const asection bfd_abs_section; .#define bfd_abs_section_ptr ((asection *) &bfd_abs_section) .#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -. {* Pointer to the undefined section *} +.{* Pointer to the undefined section *} .extern const asection bfd_und_section; .#define bfd_und_section_ptr ((asection *) &bfd_und_section) .#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -. {* Pointer to the common section *} +.{* Pointer to the common section *} .extern const asection bfd_com_section; .#define bfd_com_section_ptr ((asection *) &bfd_com_section) -. {* Pointer to the indirect section *} +.{* Pointer to the indirect section *} .extern const asection bfd_ind_section; .#define bfd_ind_section_ptr ((asection *) &bfd_ind_section) .#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) @@ -538,29 +558,38 @@ static const asymbol global_syms[] = GLOBAL_SYM_INIT (BFD_IND_SECTION_NAME, &bfd_ind_section) }; -#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ - const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \ - const asection SEC = \ - /* name, index, next, flags, set_vma, reloc_done, linker_mark, gc_mark */ \ - { NAME, 0, 0, FLAGS, 0, 0, 0, 0, \ - \ - /* vma, lma, _cooked_size, _raw_size, output_offset, output_section, */ \ - 0, 0, 0, 0, 0, (struct sec *) &SEC, \ - \ - /* 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 *) &global_syms[IDX], \ - \ - /* symbol_ptr_ptr, link_order_head, ..._tail */ \ - (struct symbol_cache_entry **) &SYM, 0, 0 \ +#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ + const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \ + const asection SEC = \ + /* 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, \ + \ + /* _raw_size, output_offset, output_section, alignment_power, */ \ + 0, 0, (struct sec *) &SEC, 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, target_index, */ \ + NULL, NULL, 0, 0, \ + \ + /* used_by_bfd, constructor_chain, owner, */ \ + NULL, NULL, NULL, \ + \ + /* symbol, */ \ + (struct symbol_cache_entry *) &global_syms[IDX], \ + \ + /* symbol_ptr_ptr, */ \ + (struct symbol_cache_entry **) &SYM, \ + \ + /* link_order_head, link_order_tail */ \ + NULL, NULL \ } STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol, @@ -585,7 +614,7 @@ FUNCTION bfd_get_section_by_name SYNOPSIS - asection *bfd_get_section_by_name(bfd *abfd, CONST char *name); + asection *bfd_get_section_by_name(bfd *abfd, const char *name); DESCRIPTION Run through @var{abfd} and return the one of the @@ -601,7 +630,7 @@ DESCRIPTION asection * bfd_get_section_by_name (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { asection *sect; @@ -611,13 +640,62 @@ bfd_get_section_by_name (abfd, name) return NULL; } +/* +FUNCTION + bfd_get_unique_section_name + +SYNOPSIS + char *bfd_get_unique_section_name(bfd *abfd, + const char *templat, + int *count); + +DESCRIPTION + Invent a section name that is unique in @var{abfd} by tacking + a dot and a digit suffix onto the original @var{templat}. If + @var{count} is non-NULL, then it specifies the first number + tried as a suffix to generate a unique name. The value + pointed to by @var{count} will be incremented in this case. +*/ + +char * +bfd_get_unique_section_name (abfd, templat, count) + bfd *abfd; + const char *templat; + int *count; +{ + int num; + unsigned int len; + char *sname; + + len = strlen (templat); + sname = bfd_malloc (len + 8); + if (sname == NULL) + return NULL; + strcpy (sname, templat); + num = 1; + if (count != NULL) + num = *count; + + do + { + /* If we have a million sections, something is badly wrong. */ + if (num > 999999) + abort (); + sprintf (sname + len, ".%d", num++); + } + while (bfd_get_section_by_name (abfd, sname) != NULL); + + if (count != NULL) + *count = num; + return sname; +} /* FUNCTION bfd_make_section_old_way SYNOPSIS - asection *bfd_make_section_old_way(bfd *abfd, CONST char *name); + asection *bfd_make_section_old_way(bfd *abfd, const char *name); DESCRIPTION Create a new empty section called @var{name} @@ -637,11 +715,10 @@ DESCRIPTION */ - asection * bfd_make_section_old_way (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { asection *sec = bfd_get_section_by_name (abfd, name); if (sec == (asection *) NULL) @@ -656,7 +733,7 @@ FUNCTION bfd_make_section_anyway SYNOPSIS - asection *bfd_make_section_anyway(bfd *abfd, CONST char *name); + asection *bfd_make_section_anyway(bfd *abfd, const char *name); DESCRIPTION Create a new empty section called @var{name} and attach it to the end of @@ -671,8 +748,9 @@ DESCRIPTION sec_ptr bfd_make_section_anyway (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { + static int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */ asection *newsect; asection **prev = &abfd->sections; asection *sect = abfd->sections; @@ -694,6 +772,7 @@ bfd_make_section_anyway (abfd, name) return NULL; newsect->name = name; + newsect->id = section_id++; newsect->index = abfd->section_count++; newsect->flags = SEC_NO_FLAGS; @@ -705,13 +784,17 @@ bfd_make_section_anyway (abfd, name) newsect->line_filepos = 0; newsect->owner = abfd; newsect->comdat = NULL; + newsect->kept_section = NULL; /* Create a symbol whos only job is to point to this section. This is useful for things like relocs which are relative to the base of a section. */ newsect->symbol = bfd_make_empty_symbol (abfd); if (newsect->symbol == NULL) - return NULL; + { + bfd_release (abfd, newsect); + return NULL; + } newsect->symbol->name = name; newsect->symbol->value = 0; newsect->symbol->section = newsect; @@ -721,7 +804,7 @@ bfd_make_section_anyway (abfd, name) if (BFD_SEND (abfd, _new_section_hook, (abfd, newsect)) != true) { - free (newsect); + bfd_release (abfd, newsect); return NULL; } @@ -734,7 +817,7 @@ FUNCTION bfd_make_section SYNOPSIS - asection *bfd_make_section(bfd *, CONST char *name); + asection *bfd_make_section(bfd *, const char *name); DESCRIPTION Like <<bfd_make_section_anyway>>, but return <<NULL>> (without calling @@ -746,7 +829,7 @@ DESCRIPTION asection * bfd_make_section (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { asection *sect = abfd->sections; @@ -779,7 +862,6 @@ bfd_make_section (abfd, name) return bfd_make_section_anyway (abfd, name); } - /* FUNCTION bfd_set_section_flags @@ -823,14 +905,13 @@ bfd_set_section_flags (abfd, section, flags) return true; } - /* FUNCTION bfd_map_over_sections SYNOPSIS void bfd_map_over_sections(bfd *abfd, - void (*func)(bfd *abfd, + void (*func) (bfd *abfd, asection *sect, PTR obj), PTR obj); @@ -849,7 +930,6 @@ DESCRIPTION | for (p = abfd->sections; p != NULL; p = p->next) | func(abfd, p, ...) - */ /*VARARGS2*/ @@ -869,7 +949,6 @@ bfd_map_over_sections (abfd, operation, user_storage) abort (); } - /* FUNCTION bfd_set_section_size @@ -894,7 +973,7 @@ bfd_set_section_size (abfd, ptr, val) bfd_size_type val; { /* Once you've started writing to any section you cannot create or change - the size of any others. */ + the size of any others. */ if (abfd->output_has_begun) { @@ -920,15 +999,12 @@ SYNOPSIS file_ptr offset, bfd_size_type count); - DESCRIPTION Sets the contents of the section @var{section} in BFD @var{abfd} to the data starting in memory at @var{data}. The data is written to the output section starting at offset @var{offset} for @var{count} octets. - - Normally <<true>> is returned, else <<false>>. Possible error returns are: o <<bfd_error_no_contents>> - @@ -939,7 +1015,6 @@ DESCRIPTION This routine is front end to the back end function <<_bfd_set_section_contents>>. - */ #define bfd_get_section_size_now(abfd,sec) \ @@ -993,6 +1068,11 @@ bfd_set_section_contents (abfd, section, location, offset, count) break; } + /* Record a copy of the data in memory if desired. */ + if (section->contents + && location != section->contents + offset) + memcpy (section->contents + offset, location, count); + if (BFD_SEND (abfd, _bfd_set_section_contents, (abfd, section, location, offset, count))) { @@ -1024,8 +1104,6 @@ DESCRIPTION with zeroes. If no errors occur, <<true>> is returned, else <<false>>. - - */ boolean bfd_get_section_contents (abfd, section, location, offset, count) @@ -1159,7 +1237,7 @@ _bfd_strip_section_from_output (info, s) } /* If the output section is empty, remove it too. Careful about sections - that have been discarded in the link script -- they are mapped to + that have been discarded in the link script -- they are mapped to bfd_abs_section, which has no owner. */ if (!keep_os && os->owner != NULL) { diff --git a/contrib/binutils/bfd/sparclinux.c b/contrib/binutils/bfd/sparclinux.c index 73a29b3..57bf6c6 100644 --- a/contrib/binutils/bfd/sparclinux.c +++ b/contrib/binutils/bfd/sparclinux.c @@ -95,7 +95,7 @@ sparclinux_write_object_contents (abfd) #define IS_GOT_SYM(name) \ (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0) -/* See if a symbol name is a reference to the procedure linkage table. */ +/* See if a symbol name is a reference to the procedure linkage table. */ #ifndef PLT_REF_PREFIX #define PLT_REF_PREFIX "__PLT_" @@ -478,7 +478,7 @@ linux_tally_symbols (h, data) (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), false, false, true); - /* h2 does not follow indirect symbols. */ + /* h2 does not follow indirect symbols. */ h2 = linux_link_hash_lookup (linux_hash_table (info), (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), @@ -535,7 +535,7 @@ linux_tally_symbols (h, data) } /* Quick and dirty way of stripping these symbols from the - symtab. */ + symtab. */ if (bfd_is_abs_section (h->root.root.u.def.section)) h->root.written = true; } @@ -560,7 +560,7 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info) if (output_bfd->xvec != &MY(vec)) return true; - /* First find the fixups... */ + /* First find the fixups... */ linux_link_hash_traverse (linux_hash_table (info), linux_tally_symbols, (PTR) info); diff --git a/contrib/binutils/bfd/sparcnetbsd.c b/contrib/binutils/bfd/sparcnetbsd.c index 4277bb8..c21f063 100644 --- a/contrib/binutils/bfd/sparcnetbsd.c +++ b/contrib/binutils/bfd/sparcnetbsd.c @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGET_IS_BIG_ENDIAN_P /* SPARC chips use either 4K or 8K pages, but object files always - assume 8K page alignment so they will work on either one. */ + assume 8K page alignment so they will work on either one. */ #define TARGET_PAGE_SIZE 0x2000 #define DEFAULT_ARCH bfd_arch_sparc diff --git a/contrib/binutils/bfd/srec.c b/contrib/binutils/bfd/srec.c index 31f69b0..5602239 100644 --- a/contrib/binutils/bfd/srec.c +++ b/contrib/binutils/bfd/srec.c @@ -1,5 +1,5 @@ /* BFD back-end for s-record objects. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>. @@ -24,7 +24,7 @@ SUBSECTION S-Record handling DESCRIPTION - + Ordinary S-Records cannot hold anything but addresses and data, so that's all that we implement. @@ -42,10 +42,10 @@ DESCRIPTION up and output them when it's time to close the bfd. An s record looks like: - + EXAMPLE S<type><length><address><data><checksum> - + DESCRIPTION Where o length @@ -61,7 +61,7 @@ DESCRIPTION 7) four byte address termination record 8) three byte address termination record 9) two byte address termination record - + o address is the start address of the data following, or in the case of a termination record, the start address of the image @@ -71,7 +71,6 @@ DESCRIPTION is the sum of all the raw byte data in the record, from the length upwards, modulo 256 and subtracted from 255. - SUBSECTION Symbol S-Record handling @@ -101,7 +100,7 @@ EXAMPLE DESCRIPTION We allow symbols to be anywhere in the data stream - the module names are always ignored. - + */ #include "bfd.h" @@ -142,7 +141,7 @@ static asymbol *srec_make_empty_symbol PARAMS ((bfd *)); static long srec_get_symtab_upper_bound PARAMS ((bfd *)); static long srec_get_symtab PARAMS ((bfd *, asymbol **)); -/* Macros for converting between hex and binary. */ +/* Macros for converting between hex and binary. */ static CONST char digs[] = "0123456789ABCDEF"; @@ -154,7 +153,7 @@ static CONST char digs[] = "0123456789ABCDEF"; ch += ((x) & 0xff); #define ISHEX(x) hex_p(x) -/* Initialize by filling in the hex conversion array. */ +/* Initialize by filling in the hex conversion array. */ static void srec_init () @@ -168,10 +167,21 @@ srec_init () } } -/* The maximum number of bytes on a line is FF */ +/* The maximum number of bytes on a line is FF. */ #define MAXCHUNK 0xff -/* The number of bytes we fit onto a line on output */ -#define CHUNK 16 + +/* Default size for a CHUNK. */ +#define DEFAULT_CHUNK 16 + +/* The number of bytes we actually fit onto a line on output. + This variable can be modified by objcopy's --srec-len parameter. + For a 0x75 byte record you should set --srec-len=0x70. */ +unsigned int Chunk = DEFAULT_CHUNK; + +/* The type of srec output (free or forced to S3). + This variable can be modified by objcopy's --srec-forceS3 + parameter. */ +boolean S3Forced = 0; /* When writing an S-record file, the S-records can not be output as they are seen. This structure is used to hold them in memory. */ @@ -467,7 +477,8 @@ srec_scan (abfd) if (! srec_new_symbol (abfd, symname, symval)) goto error_return; } - while (c == ' ' || c == '\t'); + while (c == ' ' || c == '\t') + ; if (c == '\n') ++lineno; @@ -478,7 +489,7 @@ srec_scan (abfd) } break; - + case 'S': { file_ptr pos; @@ -839,7 +850,7 @@ srec_set_arch_mach (abfd, arch, mach) return bfd_default_set_arch_mach (abfd, arch, mach); } -/* we have to save up all the Srecords for a splurge before output */ +/* We have to save up all the Srecords for a splurge before output. */ static boolean srec_set_section_contents (abfd, section, location, offset, bytes_to_do) @@ -866,19 +877,17 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) return false; memcpy ((PTR) data, location, (size_t) bytes_to_do); - if ((section->lma + offset + bytes_to_do - 1) <= 0xffff) - { - - } + /* Ff S3Forced is true then always select S3 records, + regardless of the siez of the addresses. */ + if (S3Forced) + tdata->type = 3; + else if ((section->lma + offset + bytes_to_do - 1) <= 0xffff) + ; /* The default, S1, is OK. */ else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff && tdata->type <= 2) - { - tdata->type = 2; - } + tdata->type = 2; else - { - tdata->type = 3; - } + tdata->type = 3; entry->data = data; entry->where = section->lma + offset; @@ -912,8 +921,8 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) /* Write a record of type, of the supplied number of bytes. The supplied bytes and length don't have a checksum. That's worked out - here -*/ + here. */ + static boolean srec_write_record (abfd, type, address, data, end) bfd *abfd; @@ -933,7 +942,7 @@ srec_write_record (abfd, type, address, data, end) *dst++ = '0' + type; length = dst; - dst += 2; /* leave room for dst*/ + dst += 2; /* Leave room for dst. */ switch (type) { @@ -961,7 +970,7 @@ srec_write_record (abfd, type, address, data, end) dst += 2; } - /* Fill in the length */ + /* Fill in the length. */ TOHEX (length, (dst - length) / 2, check_sum); check_sum &= 0xff; check_sum = 255 - check_sum; @@ -976,8 +985,6 @@ srec_write_record (abfd, type, address, data, end) return true; } - - static boolean srec_write_header (abfd) bfd *abfd; @@ -986,11 +993,10 @@ srec_write_header (abfd) bfd_byte *dst = buffer; unsigned int i; - /* I'll put an arbitary 40 char limit on header size */ + /* I'll put an arbitary 40 char limit on header size. */ for (i = 0; i < 40 && abfd->filename[i]; i++) - { - *dst++ = abfd->filename[i]; - } + *dst++ = abfd->filename[i]; + return srec_write_record (abfd, 0, 0, buffer, dst); } @@ -1008,8 +1014,8 @@ srec_write_section (abfd, tdata, list) bfd_vma address; unsigned int octets_this_chunk = list->size - octets_written; - if (octets_this_chunk > CHUNK) - octets_this_chunk = CHUNK; + if (octets_this_chunk > Chunk) + octets_this_chunk = Chunk; address = list->where + octets_written / bfd_octets_per_byte (abfd); @@ -1038,14 +1044,12 @@ srec_write_terminator (abfd, tdata) abfd->start_address, buffer, buffer); } - - static boolean srec_write_symbols (abfd) bfd *abfd; { char buffer[MAXCHUNK]; - /* Dump out the symbols of a bfd */ + /* Dump out the symbols of a bfd. */ int i; int count = bfd_get_symcount (abfd); @@ -1065,7 +1069,7 @@ srec_write_symbols (abfd) if (! bfd_is_local_label (abfd, s) && (s->flags & BSF_DEBUGGING) == 0) { - /* Just dump out non debug symbols */ + /* Just dump out non debug symbols. */ bfd_size_type l; char buf2[40], *p; @@ -1107,7 +1111,7 @@ internal_srec_write_object_contents (abfd, symbols) if (! srec_write_header (abfd)) return false; - /* Now wander though all the sections provided and output them */ + /* Now wander though all the sections provided and output them. */ list = tdata->head; while (list != (srec_data_list_type *) NULL) @@ -1133,7 +1137,6 @@ symbolsrec_write_object_contents (abfd) return internal_srec_write_object_contents (abfd, 1); } -/*ARGSUSED*/ static int srec_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; @@ -1195,7 +1198,7 @@ srec_get_symtab (abfd, alocation) c->udata.p = NULL; } } - + for (i = 0; i < symcount; i++) *alocation++ = csymbols++; *alocation = NULL; @@ -1203,7 +1206,6 @@ srec_get_symtab (abfd, alocation) return symcount; } -/*ARGSUSED*/ static void srec_get_symbol_info (ignore_abfd, symbol, ret) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -1213,7 +1215,6 @@ srec_get_symbol_info (ignore_abfd, symbol, ret) bfd_symbol_info (symbol, ret); } -/*ARGSUSED*/ static void srec_print_symbol (ignore_abfd, afile, symbol, how) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -1316,12 +1317,10 @@ const bfd_target srec_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; - - const bfd_target symbolsrec_vec = { "symbolsrec", /* name */ @@ -1373,6 +1372,6 @@ const bfd_target symbolsrec_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/contrib/binutils/bfd/stab-syms.c b/contrib/binutils/bfd/stab-syms.c index f4fe6c8..4b0827f 100644 --- a/contrib/binutils/bfd/stab-syms.c +++ b/contrib/binutils/bfd/stab-syms.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" -#define ARCH_SIZE 32 /* Value doesn't matter. */ +#define ARCH_SIZE 32 /* Value doesn't matter. */ #include "libaout.h" #include "aout/aout64.h" @@ -32,13 +32,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* These are not really stab symbols, but it is convenient to have them here for the sake of nm. For completeness, we could also add N_TEXT etc, but those - are never needed, since nm treats those specially. */ + are never needed, since nm treats those specially. */ #define EXTRA_SYMBOLS \ __define_name (N_SETA, "SETA")/* Absolute set element symbol */ \ __define_name (N_SETT, "SETT")/* Text set element symbol */ \ __define_name (N_SETD, "SETD")/* Data set element symbol */ \ __define_name (N_SETB, "SETB")/* Bss set element symbol */ \ - __define_name (N_SETV, "SETV")/* Pointer to set vector in data area. */ \ + __define_name (N_SETV, "SETV")/* Pointer to set vector in data area. */ \ __define_name (N_INDR, "INDR") \ __define_name (N_WARNING, "WARNING") diff --git a/contrib/binutils/bfd/stabs.c b/contrib/binutils/bfd/stabs.c index e9ac167..eb9ce8a 100644 --- a/contrib/binutils/bfd/stabs.c +++ b/contrib/binutils/bfd/stabs.c @@ -108,7 +108,7 @@ struct stab_section_info as the input offsets, because no stabs have been deleted from this section. Otherwise the i'th entry is the number of bytes of stabs that have been deleted prior to the i'th - stab. */ + stab. */ bfd_size_type *cumulative_skips; /* This is an array of string indices. For each stab symbol, we @@ -464,7 +464,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) sinfo->stabstr->_cooked_size = _bfd_stringtab_size (sinfo->strings); /* Calculate the `cumulative_skips' array now that stabs have been - deleted for this section. */ + deleted for this section. */ if (skip != 0) { diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c index 6546f585..8f4c92f 100644 --- a/contrib/binutils/bfd/syms.c +++ b/contrib/binutils/bfd/syms.c @@ -1,5 +1,5 @@ /* Generic symbol-table support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -91,7 +91,6 @@ SUBSECTION All storage for the symbols themselves is in an objalloc connected to the BFD; it is freed when the BFD is closed. - INODE Writing Symbols, Mini Symbols, Reading Symbols, Symbols SUBSECTION @@ -163,8 +162,6 @@ SUBSECTION */ - - /* DOCDD INODE @@ -390,14 +387,12 @@ DESCRIPTION Return the actual number of symbol pointers, not including the NULL. - .#define bfd_canonicalize_symtab(abfd, location) \ . BFD_SEND (abfd, _bfd_canonicalize_symtab,\ . (abfd, location)) */ - /* FUNCTION bfd_set_symtab @@ -474,7 +469,6 @@ bfd_print_symbol_vandf (arg, symbol) : ((type & BSF_OBJECT) ? 'O' : ' ')))); } - /* FUNCTION bfd_make_empty_symbol @@ -537,7 +531,7 @@ static CONST struct section_to_type stt[] = }; /* Return the single-character symbol type corresponding to - section S, or '?' for an unknown COFF section. + section S, or '?' for an unknown COFF section. Check for any leading string which matches, so .text5 returns 't' as well as .text */ @@ -548,7 +542,7 @@ coff_section_type (s) { CONST struct section_to_type *t; - for (t = &stt[0]; t->section; t++) + for (t = &stt[0]; t->section; t++) if (!strncmp (s, t->section, strlen (t->section))) return t->type; @@ -631,7 +625,7 @@ bfd_decode_symclass (symbol) /* FUNCTION - bfd_is_undefined_symclass + bfd_is_undefined_symclass DESCRIPTION Returns non-zero if the class symbol returned by @@ -668,12 +662,12 @@ bfd_symbol_info (symbol, ret) symbol_info *ret; { ret->type = bfd_decode_symclass (symbol); - + if (bfd_is_undefined_symclass (ret->type)) ret->value = 0; else ret->value = symbol->value + symbol->section->vma; - + ret->name = symbol->name; } @@ -788,8 +782,8 @@ struct indexentry static int cmpindexentry (a, b) - const PTR *a; - const PTR *b; + const PTR a; + const PTR b; { const struct indexentry *contestantA = (const struct indexentry *) a; const struct indexentry *contestantB = (const struct indexentry *) b; @@ -1005,7 +999,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, if (bfd_get_32 (abfd, stab + STRDXOFF) == 0) continue; - /* if we did not see a function def, leave space for one. */ + /* if we did not see a function def, leave space for one. */ if (saw_fun == 0) ++info->indextablesize; @@ -1027,7 +1021,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, if (saw_fun == 0) ++info->indextablesize; - + if (info->indextablesize == 0) return true; ++info->indextablesize; @@ -1063,8 +1057,8 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, /* The following code creates a new indextable entry with a NULL function name if there were no N_FUNs in a file. Note that a N_SO without a file name is an EOF and - there could be 2 N_SO following it with the new filename - and directory. */ + there could be 2 N_SO following it with the new filename + and directory. */ if (saw_fun == 0) { info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF); @@ -1076,7 +1070,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, ++i; } saw_fun = 0; - + file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF); if (*file_name == '\0') { @@ -1262,7 +1256,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, *pfound = true; - if (file_name[0] == '/' || directory_name == NULL) + if (IS_ABSOLUTE_PATH(file_name) || directory_name == NULL) *pfilename = file_name; else { diff --git a/contrib/binutils/bfd/sysdep.h b/contrib/binutils/bfd/sysdep.h index 77b5e50a..e344eaf 100644 --- a/contrib/binutils/bfd/sysdep.h +++ b/contrib/binutils/bfd/sysdep.h @@ -126,6 +126,18 @@ extern char *getenv (); #ifdef ENABLE_NLS #include <libintl.h> +/* Note the use of dgetext() and PACKAGE here, rather than gettext(). + + This is because the code in this directory is used to build a library which + will be linked with code in other directories to form programs. We want to + maintain a seperate translation file for this directory however, rather + than being forced to merge it with that of any program linked to libbfd. + This is a library, so it cannot depend on the catalog currently loaded. + + In order to do this, we have to make sure that when we extract messages we + use the OPCODES domain rather than the domain of the program that included + the bfd library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String) + and define PACKAGE to be 'bfd'. (See the code in configure). */ #define _(String) dgettext (PACKAGE, String) #ifdef gettext_noop #define N_(String) gettext_noop (String) diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c index 1f2217b..8f831f0 100644 --- a/contrib/binutils/bfd/targets.c +++ b/contrib/binutils/bfd/targets.c @@ -1,5 +1,5 @@ /* Generic target-file-type support for the BFD library. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "fnmatch.h" /* -SECTION +SECTION Targets DESCRIPTION @@ -34,7 +34,7 @@ DESCRIPTION part of BFD is a structure containing pointers to functions which perform certain low level operations on files. BFD translates the applications's requests through a pointer into - calls to the back end routines. + calls to the back end routines. When a file is opened with <<bfd_openr>>, its format and target are unknown. BFD uses various mechanisms to determine @@ -42,11 +42,11 @@ DESCRIPTION o Create a BFD by calling the internal routine <<_bfd_new_bfd>>, then call <<bfd_find_target>> with the - target string supplied to <<bfd_openr>> and the new BFD pointer. + target string supplied to <<bfd_openr>> and the new BFD pointer. o If a null target string was provided to <<bfd_find_target>>, look up the environment variable <<GNUTARGET>> and use - that as the target string. + that as the target string. o If the target string is still <<NULL>>, or the target string is <<default>>, then use the first item in the target vector @@ -56,7 +56,7 @@ DESCRIPTION o Otherwise, inspect the elements in the target vector one by one, until a match on target name is found. When found, - use it. + use it. o Otherwise return the error <<bfd_error_invalid_target>> to <<bfd_openr>>. @@ -66,7 +66,7 @@ DESCRIPTION Once the BFD has been opened and the target selected, the file format may be determined. This is done by calling - <<bfd_check_format>> on the BFD with a suggested format. + <<bfd_check_format>> on the BFD with a suggested format. If <<target_defaulted>> has been set, each possible target type is tried to see if it recognizes the specified format. <<bfd_check_format>> returns <<true>> when the caller guesses right. @@ -75,7 +75,6 @@ DESCRIPTION @end menu */ - /* INODE @@ -87,17 +86,17 @@ SUBSECTION DESCRIPTION This structure contains everything that BFD knows about a target. It includes things like its byte order, name, and which - routines to call to do various operations. + routines to call to do various operations. Every BFD points to a target structure with its <<xvec>> - member. + member. The macros below are used to dispatch to functions through the <<bfd_target>> vector. They are used in a number of macros further down in @file{bfd.h}, and are also used when calling various routines by hand inside the BFD implementation. The @var{arglist} argument must be parenthesized; it contains all the arguments - to the called function. + to the called function. They make the documentation (more) unpleasant to read, so if someone wants to fix this and not break the above, please do. @@ -116,13 +115,13 @@ DESCRIPTION For operations which index on the BFD format: .#define BFD_SEND_FMT(bfd, message, arglist) \ -. (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) +. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) . .#ifdef DEBUG_BFD_SEND .#undef BFD_SEND_FMT .#define BFD_SEND_FMT(bfd, message, arglist) \ . (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ -. (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \ +. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ . (bfd_assert (__FILE__,__LINE__), NULL)) .#endif @@ -131,16 +130,16 @@ DESCRIPTION module that implements access to a different target under BFD, defines one of these. - FIXME, these names should be rationalised with the names of the entry points which call them. Too bad we can't have one - macro to define them both! + macro to define them both! .enum bfd_flavour { . bfd_target_unknown_flavour, . bfd_target_aout_flavour, . bfd_target_coff_flavour, . bfd_target_ecoff_flavour, +. bfd_target_xcoff_flavour, . bfd_target_elf_flavour, . bfd_target_ieee_flavour, . bfd_target_nlm_flavour, @@ -184,21 +183,21 @@ The order of bytes within the header parts of a file. A mask of all the flags which an executable may have set - from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. -. flagword object_flags; +. flagword object_flags; A mask of all the flags which a section may have set - from the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. . flagword section_flags; -The character normally found at the front of a symbol +The character normally found at the front of a symbol (if any), perhaps `_'. . char symbol_leading_char; The pad character for file names within an archive header. -. char ar_pad_char; +. char ar_pad_char; The maximum number of characters in an archive header. @@ -233,15 +232,15 @@ Byte swapping for the headers Format dependent routines: these are vectors of entry points within the target vector structure, one for each format to check. -Check the format of a file being read. Return a <<bfd_target *>> or zero. +Check the format of a file being read. Return a <<bfd_target *>> or zero. . const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); -Set the format of a file being written. +Set the format of a file being written. . boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); -Write cached information into a file being written, at <<bfd_close>>. +Write cached information into a file being written, at <<bfd_close>>. . boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); @@ -264,7 +263,7 @@ BFD_JUMP_TABLE macros. . {* Called when a new section is created. *} . boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); . {* Read the contents of a section. *} -. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, +. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, . file_ptr, bfd_size_type)); . boolean (*_bfd_get_section_contents_in_window) . PARAMS ((bfd *, sec_ptr, bfd_window *, @@ -288,7 +287,7 @@ BFD_JUMP_TABLE macros. . to another. *} . boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, . bfd *, sec_ptr)); -. {* Called to copy BFD private symbol data from one symbol +. {* Called to copy BFD private symbol data from one symbol . to another. *} . boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, . bfd *, asymbol *)); @@ -324,10 +323,10 @@ BFD_JUMP_TABLE macros. . boolean (*_bfd_construct_extended_name_table) . PARAMS ((bfd *, char **, bfd_size_type *, const char **)); . void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); -. boolean (*write_armap) PARAMS ((bfd *arch, +. boolean (*write_armap) PARAMS ((bfd *arch, . unsigned int elength, . struct orl *map, -. unsigned int orl_count, +. unsigned int orl_count, . int stridx)); . PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); . bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); @@ -467,15 +466,15 @@ and little endian code, and target chosen by the linker has the wrong endianness. The function open_output() in ld/ldlang.c uses this field to find an alternative output format that is suitable. -. {* Opposite endian version of this target. *} +. {* Opposite endian version of this target. *} . const struct bfd_target * alternative_target; -. +. Data for use by back-end routines, which isn't generic enough to belong in this structure. . PTR backend_data; -. +. .} bfd_target; */ @@ -486,49 +485,57 @@ in this structure. we can't intermix extern's and initializers. */ extern const bfd_target a29kcoff_big_vec; extern const bfd_target a_out_adobe_vec; +extern const bfd_target aout0_big_vec; extern const bfd_target aout_arm_big_vec; extern const bfd_target aout_arm_little_vec; extern const bfd_target aout_mips_big_vec; extern const bfd_target aout_mips_little_vec; -extern const bfd_target aout0_big_vec; extern const bfd_target apollocoff_vec; -extern const bfd_target armcoff_little_vec; +extern const bfd_target arm_epoc_pe_big_vec; +extern const bfd_target arm_epoc_pe_little_vec; +extern const bfd_target arm_epoc_pei_big_vec; +extern const bfd_target arm_epoc_pei_little_vec; extern const bfd_target armcoff_big_vec; +extern const bfd_target armcoff_little_vec; extern const bfd_target armnetbsd_vec; -extern const bfd_target armpe_little_vec; extern const bfd_target armpe_big_vec; -extern const bfd_target armpei_little_vec; +extern const bfd_target armpe_little_vec; extern const bfd_target armpei_big_vec; -extern const bfd_target arm_epoc_pe_little_vec; -extern const bfd_target arm_epoc_pe_big_vec; -extern const bfd_target arm_epoc_pei_little_vec; -extern const bfd_target arm_epoc_pei_big_vec; +extern const bfd_target armpei_little_vec; extern const bfd_target b_out_vec_big_host; extern const bfd_target b_out_vec_little_host; -extern const bfd_target bfd_elf64_alpha_vec; +extern const bfd_target bfd_efi_app_ia32_vec; +extern const bfd_target bfd_efi_app_ia64_vec; extern const bfd_target bfd_elf32_avr_vec; +extern const bfd_target bfd_elf32_big_generic_vec; extern const bfd_target bfd_elf32_bigarc_vec; -extern const bfd_target bfd_elf32_bigarm_vec; extern const bfd_target bfd_elf32_bigarm_oabi_vec; -extern const bfd_target bfd_elf32_littlearc_vec; -extern const bfd_target bfd_elf32_littlearm_vec; -extern const bfd_target bfd_elf32_littlearm_oabi_vec; -extern const bfd_target bfd_elf32_big_generic_vec; +extern const bfd_target bfd_elf32_bigarm_vec; extern const bfd_target bfd_elf32_bigmips_vec; -extern const bfd_target bfd_elf64_bigmips_vec; +extern const bfd_target bfd_elf32_cris_vec; extern const bfd_target bfd_elf32_d10v_vec; extern const bfd_target bfd_elf32_d30v_vec; +extern const bfd_target bfd_elf32_fr30_vec; +extern const bfd_target bfd_elf32_hppa_linux_vec; extern const bfd_target bfd_elf32_hppa_vec; extern const bfd_target bfd_elf32_i370_vec; extern const bfd_target bfd_elf32_i386_vec; +extern const bfd_target bfd_elf32_i860_little_vec; extern const bfd_target bfd_elf32_i860_vec; extern const bfd_target bfd_elf32_i960_vec; +extern const bfd_target bfd_elf32_ia64_big_vec; extern const bfd_target bfd_elf32_little_generic_vec; +extern const bfd_target bfd_elf32_littlearc_vec; +extern const bfd_target bfd_elf32_littlearm_oabi_vec; +extern const bfd_target bfd_elf32_littlearm_vec; extern const bfd_target bfd_elf32_littlemips_vec; -extern const bfd_target bfd_elf64_littlemips_vec; extern const bfd_target bfd_elf32_m32r_vec; +extern const bfd_target bfd_elf32_m68hc11_vec; +extern const bfd_target bfd_elf32_m68hc12_vec; extern const bfd_target bfd_elf32_m68k_vec; extern const bfd_target bfd_elf32_m88k_vec; +extern const bfd_target bfd_elf32_mcore_big_vec; +extern const bfd_target bfd_elf32_mcore_little_vec; extern const bfd_target bfd_elf32_mn10200_vec; extern const bfd_target bfd_elf32_mn10300_vec; extern const bfd_target bfd_elf32_pj_vec; @@ -536,50 +543,61 @@ extern const bfd_target bfd_elf32_pjl_vec; extern const bfd_target bfd_elf32_powerpc_vec; extern const bfd_target bfd_elf32_powerpcle_vec; extern const bfd_target bfd_elf32_sh_vec; +extern const bfd_target bfd_elf32_shblin_vec; extern const bfd_target bfd_elf32_shl_vec; +extern const bfd_target bfd_elf32_shlin_vec; extern const bfd_target bfd_elf32_sparc_vec; +extern const bfd_target bfd_elf32_tradbigmips_vec; +extern const bfd_target bfd_elf32_tradlittlemips_vec; +extern const bfd_target bfd_elf32_us_cris_vec; extern const bfd_target bfd_elf32_v850_vec; -extern const bfd_target bfd_elf32_fr30_vec; -extern const bfd_target bfd_elf32_mcore_big_vec; -extern const bfd_target bfd_elf32_mcore_little_vec; +extern const bfd_target bfd_elf64_alpha_vec; extern const bfd_target bfd_elf64_big_generic_vec; +extern const bfd_target bfd_elf64_bigmips_vec; +extern const bfd_target bfd_elf64_hppa_linux_vec; +extern const bfd_target bfd_elf64_hppa_vec; +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_sparc_vec; +extern const bfd_target bfd_elf64_x86_64_vec; +extern const bfd_target bfd_powerpc_pe_vec; +extern const bfd_target bfd_powerpc_pei_vec; +extern const bfd_target bfd_powerpcle_pe_vec; +extern const bfd_target bfd_powerpcle_pei_vec; +extern const bfd_target cris_aout_vec; extern const bfd_target demo_64_vec; extern const bfd_target ecoff_big_vec; -extern const bfd_target ecoff_little_vec; extern const bfd_target ecoff_biglittle_vec; +extern const bfd_target ecoff_little_vec; extern const bfd_target ecoffalpha_little_vec; +extern const bfd_target go32coff_vec; +extern const bfd_target go32stubbedcoff_vec; extern const bfd_target h8300coff_vec; extern const bfd_target h8500coff_vec; extern const bfd_target host_aout_vec; extern const bfd_target hp300bsd_vec; extern const bfd_target hp300hpux_vec; -extern const bfd_target som_vec; extern const bfd_target i386aout_vec; extern const bfd_target i386bsd_vec; +extern const bfd_target i386coff_vec; extern const bfd_target i386dynix_vec; extern const bfd_target i386freebsd_vec; -extern const bfd_target i386os9k_vec; -extern const bfd_target i386coff_vec; -extern const bfd_target bfd_powerpc_pe_vec; -extern const bfd_target bfd_powerpcle_pe_vec; -extern const bfd_target bfd_powerpc_pei_vec; -extern const bfd_target bfd_powerpcle_pei_vec; -extern const bfd_target i386pe_vec; -extern const bfd_target i386pei_vec; -extern const bfd_target go32coff_vec; -extern const bfd_target go32stubbedcoff_vec; extern const bfd_target i386linux_vec; extern const bfd_target i386lynx_aout_vec; extern const bfd_target i386lynx_coff_vec; extern const bfd_target i386mach3_vec; extern const bfd_target i386msdos_vec; extern const bfd_target i386netbsd_vec; +extern const bfd_target i386os9k_vec; +extern const bfd_target i386pe_vec; +extern const bfd_target i386pei_vec; extern const bfd_target i860coff_vec; extern const bfd_target icoff_big_vec; extern const bfd_target icoff_little_vec; extern const bfd_target ieee_vec; +extern const bfd_target m68k4knetbsd_vec; extern const bfd_target m68kaux_coff_vec; extern const bfd_target m68kcoff_vec; extern const bfd_target m68kcoffun_vec; @@ -588,50 +606,57 @@ extern const bfd_target m68klynx_aout_vec; extern const bfd_target m68klynx_coff_vec; extern const bfd_target m68knetbsd_vec; extern const bfd_target m68ksysvcoff_vec; -extern const bfd_target m68k4knetbsd_vec; extern const bfd_target m88kbcs_vec; extern const bfd_target m88kmach3_vec; -extern const bfd_target mipslpe_vec; -extern const bfd_target mipslpei_vec; extern const bfd_target mcore_pe_big_vec; extern const bfd_target mcore_pe_little_vec; extern const bfd_target mcore_pei_big_vec; extern const bfd_target mcore_pei_little_vec; +extern const bfd_target mipslpe_vec; +extern const bfd_target mipslpei_vec; extern const bfd_target newsos3_vec; -extern const bfd_target nlm32_i386_vec; -extern const bfd_target nlm32_sparc_vec; extern const bfd_target nlm32_alpha_vec; +extern const bfd_target nlm32_i386_vec; extern const bfd_target nlm32_powerpc_vec; -extern const bfd_target pc532netbsd_vec; +extern const bfd_target nlm32_sparc_vec; extern const bfd_target oasys_vec; extern const bfd_target pc532machaout_vec; +extern const bfd_target pc532netbsd_vec; +extern const bfd_target pmac_xcoff_vec; extern const bfd_target ppcboot_vec; extern const bfd_target riscix_vec; -extern const bfd_target pmac_xcoff_vec; +extern const bfd_target rs6000coff64_vec; extern const bfd_target rs6000coff_vec; -extern const bfd_target shcoff_vec; -extern const bfd_target shlcoff_vec; extern const bfd_target shcoff_small_vec; +extern const bfd_target shcoff_vec; extern const bfd_target shlcoff_small_vec; +extern const bfd_target shlcoff_vec; extern const bfd_target shlpe_vec; extern const bfd_target shlpei_vec; +extern const bfd_target som_vec; +extern const bfd_target sparccoff_vec; extern const bfd_target sparcle_aout_vec; extern const bfd_target sparclinux_vec; extern const bfd_target sparclynx_aout_vec; extern const bfd_target sparclynx_coff_vec; extern const bfd_target sparcnetbsd_vec; -extern const bfd_target sparccoff_vec; extern const bfd_target sunos_big_vec; extern const bfd_target tekhex_vec; extern const bfd_target tic30_aout_vec; extern const bfd_target tic30_coff_vec; +extern const bfd_target tic54x_coff0_beh_vec; +extern const bfd_target tic54x_coff0_vec; +extern const bfd_target tic54x_coff1_beh_vec; +extern const bfd_target tic54x_coff1_vec; +extern const bfd_target tic54x_coff2_beh_vec; +extern const bfd_target tic54x_coff2_vec; extern const bfd_target tic80coff_vec; extern const bfd_target vaxnetbsd_vec; extern const bfd_target versados_vec; extern const bfd_target vms_alpha_vec; extern const bfd_target vms_vax_vec; -extern const bfd_target we32kcoff_vec; extern const bfd_target w65_vec; +extern const bfd_target we32kcoff_vec; extern const bfd_target z8kcoff_vec; /* srec is always included. */ @@ -683,6 +708,11 @@ const bfd_target * const bfd_target_vector[] = { &b_out_vec_big_host, &b_out_vec_little_host, + &bfd_efi_app_ia32_vec, +#ifdef BFD64 + &bfd_efi_app_ia64_vec, +#endif + /* This, and other vectors, may not be used in any *.mt configuration. But that does not mean they are unnecessary. If configured with --enable-targets=all, objdump or gdb should be able to examine @@ -690,6 +720,10 @@ const bfd_target * const bfd_target_vector[] = { &bfd_elf32_big_generic_vec, #ifdef BFD64 &bfd_elf64_alpha_vec, + &bfd_elf64_hppa_vec, + &bfd_elf64_hppa_linux_vec, + &bfd_elf64_ia64_little_vec, + &bfd_elf64_ia64_big_vec, #endif &bfd_elf32_avr_vec, &bfd_elf32_bigarc_vec, @@ -699,14 +733,19 @@ const bfd_target * const bfd_target_vector[] = { #ifdef BFD64 &bfd_elf64_bigmips_vec, #endif + &bfd_elf32_cris_vec, + &bfd_elf32_us_cris_vec, &bfd_elf32_d10v_vec, &bfd_elf32_d30v_vec, -#if 0 &bfd_elf32_hppa_vec, -#endif + &bfd_elf32_hppa_linux_vec, &bfd_elf32_i370_vec, &bfd_elf32_i386_vec, +#ifdef BFD64 + &bfd_elf64_x86_64_vec, +#endif &bfd_elf32_i860_vec, + &bfd_elf32_i860_little_vec, &bfd_elf32_i960_vec, &bfd_elf32_little_generic_vec, &bfd_elf32_littlearc_vec, @@ -719,6 +758,8 @@ const bfd_target * const bfd_target_vector[] = { &bfd_elf32_m32r_vec, &bfd_elf32_mn10200_vec, &bfd_elf32_mn10300_vec, + &bfd_elf32_m68hc11_vec, + &bfd_elf32_m68hc12_vec, &bfd_elf32_m68k_vec, &bfd_elf32_m88k_vec, &bfd_elf32_sparc_vec, @@ -730,6 +771,8 @@ const bfd_target * const bfd_target_vector[] = { &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. */ &bfd_elf64_big_generic_vec, &bfd_elf64_little_generic_vec, @@ -740,6 +783,8 @@ const bfd_target * const bfd_target_vector[] = { /* We don't include cisco_core_*_vec. Although it has a magic number, the magic number isn't at the beginning of the file, and thus might spuriously match other kinds of files. */ + + &cris_aout_vec, #ifdef BFD64 &demo_64_vec, /* Only compiled if host has long-long support */ #endif @@ -844,10 +889,13 @@ const bfd_target * const bfd_target_vector[] = { &riscix_vec, #endif #if 0 - /* This has the same magic number as RS/6000. */ + /* This has the same magic number as RS/6000. */ &pmac_xcoff_vec, #endif &rs6000coff_vec, +#ifdef BFD64 + &rs6000coff64_vec, +#endif &ppcboot_vec, &shcoff_vec, &shlcoff_vec, @@ -862,6 +910,12 @@ const bfd_target * const bfd_target_vector[] = { &aout0_big_vec, &tic30_aout_vec, &tic30_coff_vec, + &tic54x_coff0_vec, + &tic54x_coff0_beh_vec, + &tic54x_coff1_vec, + &tic54x_coff1_beh_vec, + &tic54x_coff2_vec, + &tic54x_coff2_beh_vec, &tic80coff_vec, &vaxnetbsd_vec, &versados_vec, @@ -931,7 +985,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. */ @@ -1031,7 +1085,7 @@ DESCRIPTION variable to "default" will cause the first entry in the target list to be returned, and "target_defaulted" will be set in the BFD. This causes <<bfd_check_format>> to loop over all the - targets to find the one that matches the file being read. + targets to find the one that matches the file being read. */ const bfd_target * @@ -1114,7 +1168,7 @@ FUNCTION bfd_seach_for_target SYNOPSIS - const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *); + const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); DESCRIPTION Return a pointer to the first transfer vector in the list of diff --git a/contrib/binutils/bfd/tekhex.c b/contrib/binutils/bfd/tekhex.c index b1ffe75..e5fa95a 100644 --- a/contrib/binutils/bfd/tekhex.c +++ b/contrib/binutils/bfd/tekhex.c @@ -24,11 +24,11 @@ SUBSECTION Tektronix Hex Format handling DESCRIPTION - + Tek Hex records can hold symbols and data, but not relocations. Their main application is communication with devices like PROM programmers and ICE equipment. - + It seems that the sections are descibed as being really big, the example I have says that the text section is 0..ffffffff. BFD would barf with this, many apps would try to alloc 4GB to @@ -49,11 +49,10 @@ DESCRIPTION Any number of sections may be created for output, we save them up and output them when it's time to close the bfd. - A TekHex record looks like: EXAMPLE %<block length><type><checksum><stuff><cr> - + DESCRIPTION Where o length @@ -63,7 +62,6 @@ DESCRIPTION 3) symbol record 6) data record 8) termination record - The data can come out of order, and may be discontigous. This is a serial protocol, so big files are unlikely, so we keep a list of 8k chunks @@ -123,7 +121,7 @@ static const bfd_target *tekhex_object_p PARAMS ((bfd *)); static boolean tekhex_mkobject PARAMS ((bfd *)); static long tekhex_get_symtab_upper_bound PARAMS ((bfd *)); static long tekhex_get_symtab PARAMS ((bfd *, asymbol **)); -static void pass_over PARAMS ((bfd *, void (*)(bfd*, int, char *))); +static void pass_over PARAMS ((bfd *, void (*) (bfd*, int, char *))); static void first_phase PARAMS ((bfd *, int, char *)); static void insert_byte PARAMS ((bfd *, int, bfd_vma)); static struct data_struct *find_chunk PARAMS ((bfd *, bfd_vma)); @@ -216,7 +214,6 @@ fcffffff g T_SEGMENT i$1 00000000 g T_SEGMENT $ 00000010 g T_SEGMENT $ - RELOCATION RECORDS FOR [D00000000]: (none) RELOCATION RECORDS FOR [D00008000]: (none) @@ -425,7 +422,7 @@ first_phase (abfd, type, src) char *n = bfd_alloc (abfd, len + 1); if (!n) - abort(); /* FIXME */ + abort (); /* FIXME */ memcpy (n, sym, len + 1); section = bfd_make_section (abfd, n); } @@ -454,7 +451,7 @@ first_phase (abfd, type, src) char type = (*src); if (!new) - abort(); /* FIXME */ + abort (); /* FIXME */ new->symbol.the_bfd = abfd; src++; abfd->symcount++; @@ -464,7 +461,7 @@ first_phase (abfd, type, src) len = getsym (sym, &src); new->symbol.name = bfd_alloc (abfd, len + 1); if (!new->symbol.name) - abort(); /* FIXME */ + abort (); /* FIXME */ memcpy ((char *) (new->symbol.name), sym, len + 1); new->symbol.section = section; if (type <= '4') @@ -1063,6 +1060,6 @@ const bfd_target tekhex_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/contrib/binutils/bfd/trad-core.c b/contrib/binutils/bfd/trad-core.c index aea6366..194da15 100644 --- a/contrib/binutils/bfd/trad-core.c +++ b/contrib/binutils/bfd/trad-core.c @@ -25,7 +25,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libaout.h" /* BFD a.out internal data structures */ #include <sys/param.h> -#include <sys/dir.h> +#ifdef HAVE_DIRENT_H +# include <dirent.h> +#else +# ifdef HAVE_SYS_NDIR_H +# include <sys/ndir.h> +# endif +# ifdef HAVE_SYS_DIR_H +# include <sys/dir.h> +# endif +# ifdef HAVE_NDIR_H +# include <ndir.h> +# endif +#endif #include <signal.h> #include <sys/user.h> /* After a.out.h */ @@ -34,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include TRAD_HEADER #endif - struct trad_core_struct + struct trad_core_struct { asection *data_section; asection *stack_section; @@ -73,7 +85,7 @@ trad_unix_core_file_p (abfd) if (bfd_seek (abfd, TRAD_CORE_USER_OFFSET, SEEK_SET) != 0) return 0; #endif - + val = bfd_read ((void *)&u, 1, sizeof u, abfd); if (val != sizeof u) { @@ -83,7 +95,7 @@ trad_unix_core_file_p (abfd) } /* Sanity check perhaps??? */ - if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */ + if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */ { bfd_set_error (bfd_error_wrong_format); return 0; @@ -140,7 +152,7 @@ trad_unix_core_file_p (abfd) bfd_zmalloc (sizeof (struct trad_core_struct)); if (rawptr == NULL) return 0; - + abfd->tdata.trad_core_data = rawptr; rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ @@ -195,13 +207,13 @@ trad_unix_core_file_p (abfd) from *u_ar0. The other is that u_ar0 is sometimes an absolute address in kernel memory, and on other systems it is an offset from the beginning of the `struct user'. - + As a practical matter, we don't know where the registers actually are, so we have to pass the whole area to GDB. We encode the value of u_ar0 by setting the .regs section up so that its virtual memory address 0 is at the place pointed to by u_ar0 (by setting the vma of the start of the section to -u_ar0). GDB uses this info to locate the regs, - using minor trickery to get around the offset-or-absolute-addr problem. */ + using minor trickery to get around the offset-or-absolute-addr problem. */ core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0; core_datasec (abfd)->filepos = NBPG * UPAGES; @@ -261,9 +273,9 @@ trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd) /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -304,7 +316,7 @@ const bfd_target trad_core_vec = bfd_false, bfd_false, bfd_false, bfd_false }, - + BFD_JUMP_TABLE_GENERIC (_bfd_generic), BFD_JUMP_TABLE_COPY (_bfd_generic), BFD_JUMP_TABLE_CORE (trad_unix), @@ -316,6 +328,6 @@ const bfd_target trad_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; |