summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-05-13 13:29:16 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-05-13 13:29:16 +0000
commit56b2bd657b0d4248b516800fef776d9e2c772d7d (patch)
treecfe48f3cd40d9ef1bec5152dace4afde07f7cb56 /gnu/usr.bin
parent30323be41a1be71af09d81cb33ade9cddea38966 (diff)
Import binutils-2.11.2
- only the binutils package (no gdb here) - don't import libiberty and texinfo, they are elsewhere - remove all .info* generated files
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/binutils/bfd/ChangeLog-98995595
-rw-r--r--gnu/usr.bin/binutils/bfd/MAINTAINERS1
-rw-r--r--gnu/usr.bin/binutils/bfd/acinclude.m422
-rw-r--r--gnu/usr.bin/binutils/bfd/aout-cris.c305
-rw-r--r--gnu/usr.bin/binutils/bfd/aout-sparcle.c2
-rw-r--r--gnu/usr.bin/binutils/bfd/aout-tic30.c46
-rw-r--r--gnu/usr.bin/binutils/bfd/armnetbsd.c4
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-ia64.c201
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-mcore.c156
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-stgo32.c9
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-tic30.c10
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-tic54x.c760
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-tic80.c10
-rw-r--r--gnu/usr.bin/binutils/bfd/coff64-rs6000.c351
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-arc.c32
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-avr.c20
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-cris.c57
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-d10v.c78
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-fr30.c2
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-i370.c5
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-ia64-opc.c589
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-ia64.c57
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-m10300.c2
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-m32r.c4
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-m68hc11.c38
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-m68hc12.c38
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-mcore.c2
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-pj.c9
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-tic54x.c39
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-tic80.c2
-rw-r--r--gnu/usr.bin/binutils/bfd/cpu-v850.c18
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/aoutx.texi2
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/archures.texi166
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/bfdint.texi12
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/bfdt.texi65
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/cache.texi2
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/coffcode.texi12
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/format.texi4
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/hash.texi2
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/libbfd.texi10
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/linker.texi2
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/reloc.texi185
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/section.texi443
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/syms.texi4
-rw-r--r--gnu/usr.bin/binutils/bfd/doc/targets.texi111
-rw-r--r--gnu/usr.bin/binutils/bfd/dwarf1.c242
-rw-r--r--gnu/usr.bin/binutils/bfd/dwarf2.c586
-rw-r--r--gnu/usr.bin/binutils/bfd/efi-app-ia32.c34
-rw-r--r--gnu/usr.bin/binutils/bfd/efi-app-ia64.c35
-rw-r--r--gnu/usr.bin/binutils/bfd/elf-hppa.h1200
-rw-r--r--gnu/usr.bin/binutils/bfd/elf-m10200.c207
-rw-r--r--gnu/usr.bin/binutils/bfd/elf-m10300.c341
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-arc.c221
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-avr.c49
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-cris.c712
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-d10v.c41
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-d30v.c121
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-fr30.c83
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-i370.c70
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-i960.c5
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-m32r.c57
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-m68hc11.c280
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-m68hc12.c280
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-mcore.c92
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-pj.c16
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-sh-lin.c29
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-v850.c313
-rw-r--r--gnu/usr.bin/binutils/bfd/elf64-hppa.c2718
-rw-r--r--gnu/usr.bin/binutils/bfd/elf64-hppa.h47
-rw-r--r--gnu/usr.bin/binutils/bfd/elf64-x86-64.c1935
-rw-r--r--gnu/usr.bin/binutils/bfd/elfarm-nabi.c75
-rw-r--r--gnu/usr.bin/binutils/bfd/elfarm-oabi.c16
-rw-r--r--gnu/usr.bin/binutils/bfd/elfxx-ia64.c4235
-rw-r--r--gnu/usr.bin/binutils/bfd/epoc-pe-arm.c5
-rw-r--r--gnu/usr.bin/binutils/bfd/epoc-pei-arm.c5
-rw-r--r--gnu/usr.bin/binutils/bfd/go32stub.h236
-rw-r--r--gnu/usr.bin/binutils/bfd/libpei.h121
-rw-r--r--gnu/usr.bin/binutils/bfd/pe-mips.c90
-rw-r--r--gnu/usr.bin/binutils/bfd/pe-sh.c3
-rw-r--r--gnu/usr.bin/binutils/bfd/peXXigen.c2043
-rw-r--r--gnu/usr.bin/binutils/bfd/pei-mips.c4
-rw-r--r--gnu/usr.bin/binutils/bfd/pei-sh.c4
-rw-r--r--gnu/usr.bin/binutils/bfd/po/Make-in61
-rw-r--r--gnu/usr.bin/binutils/bfd/po/bfd.pot1014
-rw-r--r--gnu/usr.bin/binutils/bfd/sco5-core.c56
-rw-r--r--gnu/usr.bin/binutils/bfd/sparclinux.c10
-rw-r--r--gnu/usr.bin/binutils/bfd/vms-gsd.c13
-rw-r--r--gnu/usr.bin/binutils/bfd/vms-hdr.c17
-rw-r--r--gnu/usr.bin/binutils/bfd/vms-misc.c294
-rw-r--r--gnu/usr.bin/binutils/bfd/vms-tir.c127
-rw-r--r--gnu/usr.bin/binutils/bfd/vms.c216
-rw-r--r--gnu/usr.bin/binutils/bfd/vms.h4
-rw-r--r--gnu/usr.bin/binutils/bfd/xcoff-target.h194
93 files changed, 24642 insertions, 3399 deletions
diff --git a/gnu/usr.bin/binutils/bfd/ChangeLog-9899 b/gnu/usr.bin/binutils/bfd/ChangeLog-9899
new file mode 100644
index 00000000000..c6348c48667
--- /dev/null
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/MAINTAINERS b/gnu/usr.bin/binutils/bfd/MAINTAINERS
new file mode 100644
index 00000000000..d59a3bd7f88
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/MAINTAINERS
@@ -0,0 +1 @@
+See ../binutils/MAINTAINERS
diff --git a/gnu/usr.bin/binutils/bfd/acinclude.m4 b/gnu/usr.bin/binutils/bfd/acinclude.m4
index cac26e8e7dd..53912943d2c 100644
--- a/gnu/usr.bin/binutils/bfd/acinclude.m4
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/aout-cris.c b/gnu/usr.bin/binutils/bfd/aout-cris.c
new file mode 100644
index 00000000000..ac45232bf0e
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/aout-cris.c
@@ -0,0 +1,305 @@
+/* BFD backend for CRIS a.out binaries.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Axis Communications AB.
+ Written by Hans-Peter Nilsson.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* See info in the file PORTING for documentation of these macros and
+ functions. Beware; some of the information there is outdated. */
+
+#define N_HEADER_IN_TEXT(x) 0
+#define BYTES_IN_WORD 4
+#define N_TXTOFF(x) 32
+#define ENTRY_CAN_BE_ZERO
+#define TEXT_START_ADDR 0
+
+/* Without reading symbols to get the text start symbol, there is no way
+ to know where the text segment starts in an a.out file. Defaulting to
+ anything as constant as TEXT_START_ADDR is bad. But we can guess from
+ the entry point, which is usually within the first 64k of the text
+ segment. We also assume here that the text segment is 64k-aligned.
+ FIXME: It is also wrong to assume that data and bss follow immediately
+ after text, but with those, we don't have any choice besides reading
+ symbol info, and luckily there's no pressing need for correctness for
+ those vma:s at this time. */
+#define N_TXTADDR(x) ((x).a_entry & ~0xffff)
+
+/* If you change this to 4, you can not link to an address N*4+2. */
+#define SEGMENT_SIZE 2
+
+/* For some reason, if the a.out file has Z_MAGIC, then
+ adata(abfd).exec_bytes_size is not used, but rather
+ adata(abfd).zmagic_disk_block_size, even though the exec_header is
+ *not* included in the text segment. A simple workaround is to
+ #define ZMAGIC_DISK_BLOCK_SIZE, which is used if defined; otherwise
+ TARGET_PAGE_SIZE is used. */
+#define ZMAGIC_DISK_BLOCK_SIZE N_TXTOFF (0)
+
+/* It seems odd at first to set a page-size this low, but gives greater
+ freedom in where things can be linked. The drawback is that you have
+ to set alignment and padding in linker scripts. */
+#define TARGET_PAGE_SIZE SEGMENT_SIZE
+#define TARGETNAME "a.out-cris"
+
+/* N_SHARED_LIB gets this reasonable default as of 1999-07-12, but we
+ have to work with 2.9.1. Note that N_SHARED_LIB is used in a
+ SUN-specific context, not applicable to CRIS. */
+#define N_SHARED_LIB(x) 0
+
+/* The definition here seems not used; just provided as a convention. */
+#define DEFAULT_ARCH bfd_arch_cris
+
+/* ??? Spacing might be essential for the parameters in this macro.
+ Do Not Change. */
+#define MY(OP) CAT (cris_aout_,OP)
+#define NAME(x,y) CAT3(cris_aout,_32_,y)
+
+#include "bfd.h"
+
+/* Version 1 of the header. */
+#define MY_exec_hdr_flags 1
+
+#define MY_write_object_contents MY(write_object_contents)
+static boolean MY(write_object_contents) PARAMS ((bfd *));
+
+/* Forward this, so we can use a pointer to it in PARAMS. */
+struct reloc_ext_external;
+
+#define MY_swap_ext_reloc_out MY(swap_ext_reloc_out)
+static void MY(swap_ext_reloc_out) PARAMS ((bfd *, arelent *,
+ struct reloc_ext_external *));
+
+#define MY_swap_ext_reloc_in MY(swap_ext_reloc_in)
+static void MY(swap_ext_reloc_in) PARAMS ((bfd *, struct
+ reloc_ext_external *,
+ arelent *, asymbol **,
+ bfd_size_type));
+
+#define MY_set_sizes MY(set_sizes)
+static boolean MY(set_sizes) PARAMS ((bfd *));
+
+/* To set back reloc_size to ext, we make MY(set_sizes) be called
+ through this construct. Note that MY_set_arch_mach is only called
+ through SET_ARCH_MACH. The default bfd_default_set_arch_mach will
+ not call set_sizes. */
+
+#define MY_set_arch_mach NAME (aout, set_arch_mach)
+#define SET_ARCH_MACH(BFD, EXEC) \
+ MY_set_arch_mach (BFD, DEFAULT_ARCH, N_MACHTYPE (EXEC))
+
+/* These macros describe the binary layout of the reloc information we
+ use in a file. */
+#define RELOC_EXT_BITS_EXTERN_LITTLE 0x80
+#define RELOC_EXT_BITS_TYPE_LITTLE 3
+#define RELOC_EXT_BITS_TYPE_SH_LITTLE 0
+
+#ifndef MY_get_section_contents
+#define MY_get_section_contents aout_32_get_section_contents
+#endif
+
+/* Include generic functions (some are overridden above). */
+#include "aout32.c"
+#include "aout-target.h"
+
+/* We need our own version to set header flags. */
+
+static boolean
+MY(write_object_contents) (abfd)
+ bfd *abfd;
+{
+ struct external_exec exec_bytes;
+ struct internal_exec *execp = exec_hdr (abfd);
+
+ /* We set the reloc type to RELOC_EXT_SIZE, although setting it at all
+ seems unnecessary when inspecting as and ld behavior (not an
+ exhaustive inspection). The default write_object_contents
+ definition sets RELOC_EXT_SIZE, so we follow suite and set it too. */
+ obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
+
+ /* Setting N_SET_MACHTYPE and using N_SET_FLAGS is not performed by
+ the default definition. */
+ if (bfd_get_arch(abfd) == bfd_arch_cris)
+ N_SET_MACHTYPE(*execp, M_CRIS);
+
+ N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
+
+ WRITE_HEADERS (abfd, execp);
+
+ return true;
+}
+
+/* We need our own for these reasons:
+ - Assert that a normal 8, 16 or 32 reloc is output.
+ - Fix what seems to be a weak-bug (perhaps there for valid reasons). */
+
+static void
+MY(swap_ext_reloc_out) (abfd, g, natptr)
+ bfd *abfd;
+ arelent *g;
+ struct reloc_ext_external *natptr;
+{
+ int r_index;
+ int r_extern;
+ unsigned int r_type;
+ unsigned int r_addend;
+ asymbol *sym = *(g->sym_ptr_ptr);
+ asection *output_section = sym->section->output_section;
+
+ PUT_WORD (abfd, g->address, natptr->r_address);
+
+ r_type = (unsigned int) g->howto->type;
+
+ r_addend = g->addend;
+ if ((sym->flags & BSF_SECTION_SYM) != 0)
+ r_addend += (*(g->sym_ptr_ptr))->section->output_section->vma;
+
+ /* If this relocation is relative to a symbol then set the
+ r_index to the symbols index, and the r_extern bit.
+
+ Absolute symbols can come in in two ways, either as an offset
+ from the abs section, or as a symbol which has an abs value.
+ check for that here. */
+
+ if (bfd_is_abs_section (bfd_get_section (sym)))
+ {
+ r_extern = 0;
+ r_index = N_ABS;
+ }
+ else if ((sym->flags & BSF_SECTION_SYM) == 0)
+ {
+ if (bfd_is_und_section (bfd_get_section (sym))
+ /* Remember to check for weak symbols; they count as global. */
+ || (sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
+ r_extern = 1;
+ else
+ r_extern = 0;
+ r_index = (*(g->sym_ptr_ptr))->KEEPIT;
+ }
+ else
+ {
+ /* Just an ordinary section. */
+ r_extern = 0;
+ r_index = output_section->target_index;
+ }
+
+ /* The relocation type is the same as the canonical ones, but only
+ the first 3 are used: RELOC_8, RELOC_16, RELOC_32.
+ We may change this later, but assert this for the moment. */
+ if (r_type > 2)
+ {
+ (*_bfd_error_handler) (_("%s: Invalid relocation type exported: %d"),
+ bfd_get_filename (abfd), r_type);
+
+ bfd_set_error (bfd_error_wrong_format);
+ }
+
+ /* Now the fun stuff. */
+ natptr->r_index[2] = r_index >> 16;
+ natptr->r_index[1] = r_index >> 8;
+ natptr->r_index[0] = r_index;
+ natptr->r_type[0] =
+ (r_extern ? RELOC_EXT_BITS_EXTERN_LITTLE : 0)
+ | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE);
+
+ PUT_WORD (abfd, r_addend, natptr->r_addend);
+}
+
+/* We need our own to assert that a normal 8, 16 or 32 reloc is input. */
+
+static void
+MY(swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
+ bfd *abfd;
+ struct reloc_ext_external *bytes;
+ arelent *cache_ptr;
+ asymbol **symbols;
+ bfd_size_type symcount;
+{
+ unsigned int r_index;
+ int r_extern;
+ unsigned int r_type;
+ struct aoutdata *su = &(abfd->tdata.aout_data->a);
+
+ cache_ptr->address = (GET_SWORD (abfd, bytes->r_address));
+
+ /* Now the fun stuff. */
+ r_index = (bytes->r_index[2] << 16)
+ | (bytes->r_index[1] << 8)
+ | bytes->r_index[0];
+ r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
+ r_type = ((bytes->r_type[0]) >> RELOC_EXT_BITS_TYPE_SH_LITTLE)
+ & RELOC_EXT_BITS_TYPE_LITTLE;
+
+ if (r_type > 2)
+ {
+ (*_bfd_error_handler) (_("%s: Invalid relocation type imported: %d"),
+ bfd_get_filename (abfd), r_type);
+
+ bfd_set_error(bfd_error_wrong_format);
+ }
+
+ cache_ptr->howto = howto_table_ext + r_type;
+
+ if (r_extern && r_index > symcount)
+ {
+ (*_bfd_error_handler)
+ (_("%s: Bad relocation record imported: %d"),
+ bfd_get_filename (abfd), r_index);
+
+ bfd_set_error (bfd_error_wrong_format);
+
+ /* We continue, so we can catch further errors. */
+ r_extern = 0;
+ r_index = N_ABS;
+ }
+
+ /* Magically uses r_extern, symbols etc. Ugly, but it's what's in the
+ default. */
+ MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend));
+}
+
+/* We use the same as the default, except that we also set
+ "obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;", to avoid changing
+ NAME (aout, set_arch_mach) in aoutx. */
+
+static boolean
+MY(set_sizes) (abfd)
+ bfd *abfd;
+{
+ /* Just as the default in aout-target.h (with some #ifdefs folded)... */
+
+ adata(abfd).page_size = TARGET_PAGE_SIZE;
+ adata(abfd).segment_size = SEGMENT_SIZE;
+ adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
+ adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+
+ /* ... except for that we have the extended reloc. The alternative
+ would be to add a check on bfd_arch_cris in NAME (aout,
+ set_arch_mach) in aoutx.h, but I don't want to do that since
+ target-specific things should not be added there. */
+
+ obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
+
+ return true;
+}
+
+/*
+ * Local variables:
+ * eval: (c-set-style "gnu")
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/gnu/usr.bin/binutils/bfd/aout-sparcle.c b/gnu/usr.bin/binutils/bfd/aout-sparcle.c
index 903b1367cb3..d8ad8a57f0e 100644
--- a/gnu/usr.bin/binutils/bfd/aout-sparcle.c
+++ b/gnu/usr.bin/binutils/bfd/aout-sparcle.c
@@ -1,5 +1,5 @@
/* BFD backend for sparc little-endian aout binaries.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright 1996 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/gnu/usr.bin/binutils/bfd/aout-tic30.c b/gnu/usr.bin/binutils/bfd/aout-tic30.c
index 686c15942f8..a3e977d7600 100644
--- a/gnu/usr.bin/binutils/bfd/aout-tic30.c
+++ b/gnu/usr.bin/binutils/bfd/aout-tic30.c
@@ -1,5 +1,5 @@
/* BFD back-end for TMS320C30 a.out binaries.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
@@ -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/gnu/usr.bin/binutils/bfd/armnetbsd.c b/gnu/usr.bin/binutils/bfd/armnetbsd.c
index 3e6ee470708..aa6a882a720 100644
--- a/gnu/usr.bin/binutils/bfd/armnetbsd.c
+++ b/gnu/usr.bin/binutils/bfd/armnetbsd.c
@@ -1,5 +1,5 @@
/* BFD back-end for NetBSD/ARM a.out-ish binaries.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -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/gnu/usr.bin/binutils/bfd/coff-ia64.c b/gnu/usr.bin/binutils/bfd/coff-ia64.c
new file mode 100644
index 00000000000..776d3fac596
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/coff-ia64.c
@@ -0,0 +1,201 @@
+/* BFD back-end for HP/Intel IA-64 COFF files.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by David Mosberger <davidm@hpl.hp.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "coff/ia64.h"
+#include "coff/internal.h"
+#include "coff/pe.h"
+#include "libcoff.h"
+
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
+/* The page size is a guess based on ELF. */
+
+#define COFF_PAGE_SIZE 0x1000
+
+static reloc_howto_type howto_table[] =
+{
+ EMPTY_HOWTO (0),
+};
+
+#define BADMAG(x) IA64BADMAG(x)
+#define IA64 1 /* Customize coffcode.h */
+
+#ifdef COFF_WITH_pep
+# undef AOUTSZ
+# define AOUTSZ PEPAOUTSZ
+# define PEAOUTHDR PEPAOUTHDR
+#endif
+
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ (cache_ptr)->howto = howto_table + (dst)->r_type;
+
+#ifdef COFF_WITH_PE
+/* Return true if this relocation should
+ appear in the output .reloc section. */
+
+static boolean
+in_reloc_p(abfd, howto)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ reloc_howto_type *howto ATTRIBUTE_UNUSED;
+{
+ return 0; /* We don't do relocs for now... */
+}
+#endif
+
+#include "coffcode.h"
+
+static const bfd_target *
+ia64coff_object_p (abfd)
+ bfd *abfd;
+{
+#ifdef COFF_IMAGE_WITH_PE
+ {
+ struct external_PEI_DOS_hdr dos_hdr;
+ struct external_PEI_IMAGE_hdr image_hdr;
+ file_ptr offset;
+
+ if (bfd_seek (abfd, 0x00, SEEK_SET) != 0
+ || bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd)
+ != sizeof (dos_hdr))
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ /* There are really two magic numbers involved; the magic number
+ that says this is a NT executable (PEI) and the magic number
+ that determines the architecture. The former is DOSMAGIC,
+ stored in the e_magic field. The latter is stored in the
+ f_magic field. If the NT magic number isn't valid, the
+ architecture magic number could be mimicked by some other
+ field (specifically, the number of relocs in section 3). Since
+ this routine can only be called correctly for a PEI file, check
+ the e_magic number here, and, if it doesn't match, clobber the
+ f_magic number so that we don't get a false match. */
+ if (bfd_h_get_16 (abfd, (bfd_byte *) dos_hdr.e_magic) != DOSMAGIC)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ offset = bfd_h_get_32 (abfd, (bfd_byte *) dos_hdr.e_lfanew);
+ if (bfd_seek (abfd, (file_ptr) offset, SEEK_SET) != 0
+ || bfd_read (&image_hdr, 1, sizeof (image_hdr), abfd)
+ != sizeof (image_hdr))
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ if (bfd_h_get_32 (abfd, (bfd_byte *) image_hdr.nt_signature)
+ != 0x4550)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ /* Here is the hack. coff_object_p wants to read filhsz bytes to
+ pick up the COFF header for PE, see "struct external_PEI_filehdr"
+ in include/coff/pe.h. We adjust so that that will work. */
+ if (bfd_seek (abfd,
+ (file_ptr) (offset - sizeof (dos_hdr)),
+ SEEK_SET)
+ != 0)
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ }
+#endif
+
+ return coff_object_p (abfd);
+}
+
+const bfd_target
+#ifdef TARGET_SYM
+ TARGET_SYM =
+#else
+ ia64coff_vec =
+#endif
+{
+#ifdef TARGET_NAME
+ TARGET_NAME,
+#else
+ "coff-ia64", /* name */
+#endif
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little */
+
+ (HAS_RELOC | EXEC_P | /* 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 */
+ | SEC_CODE | SEC_DATA),
+#else
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+ | SEC_CODE | SEC_DATA
+ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+#endif
+
+#ifdef TARGET_UNDERSCORE
+ TARGET_UNDERSCORE, /* leading underscore */
+#else
+ 0, /* leading underscore */
+#endif
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ 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 */
+
+/* Note that we allow an object file to be treated as a core file as well. */
+ {_bfd_dummy_target, ia64coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, ia64coff_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),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ COFF_SWAP_TABLE
+};
diff --git a/gnu/usr.bin/binutils/bfd/coff-mcore.c b/gnu/usr.bin/binutils/bfd/coff-mcore.c
index 19cbea1dc80..cd38044fc9e 100644
--- a/gnu/usr.bin/binutils/bfd/coff-mcore.c
+++ b/gnu/usr.bin/binutils/bfd/coff-mcore.c
@@ -1,5 +1,5 @@
/* BFD back-end for Motorola MCore COFF/PE
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -42,7 +42,7 @@ extern boolean mcore_bfd_coff_final_link
static struct bfd_link_hash_table * coff_mcore_link_hash_table_create
PARAMS ((bfd *));
-static bfd_reloc_status_type mcore_coff_unsupported_reloc
+static bfd_reloc_status_type mcore_coff_unsupported_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static boolean coff_mcore_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
@@ -65,41 +65,40 @@ static reloc_howto_type * coff_mcore_rtype_to_howto
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
from smaller values. Start with zero, widen, *then* decrement. */
#define MINUS_ONE (((bfd_vma)0) - 1)
-
static reloc_howto_type mcore_coff_howto_table[] =
{
/* Unused: */
- HOWTO (IMAGE_REL_MCORE_ABSOLUTE,/* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_MCORE_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 */
- NULL, /* special_function */
+ NULL, /* 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 */
-
+
HOWTO (IMAGE_REL_MCORE_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 */
- NULL, /* special_function */
+ NULL, /* 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 */
-
+
/* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions.
- Should not appear in object files. */
+ Should not appear in object files. */
HOWTO (IMAGE_REL_MCORE_PCREL_IMM8BY4, /* type */
2, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -114,7 +113,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
0, /* dst_mask */
true), /* pcrel_offset */
- /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit
+ /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit
Span 2k instructions == 4k bytes.
Only useful pieces at the relocated address are the opcode (5 bits) */
HOWTO (IMAGE_REL_MCORE_PCREL_IMM11BY2,/* type */
@@ -131,7 +130,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
0x7ff, /* dst_mask */
true), /* pcrel_offset */
- /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */
+ /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */
HOWTO (IMAGE_REL_MCORE_PCREL_IMM4BY2, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -146,7 +145,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
0, /* dst_mask */
true), /* pcrel_offset */
- /* 32-bit pc-relative. Eventually this will help support PIC code. */
+ /* 32-bit pc-relative. Eventually this will help support PIC code. */
HOWTO (IMAGE_REL_MCORE_PCREL_32,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -163,11 +162,11 @@ static reloc_howto_type mcore_coff_howto_table[] =
/* Like PCREL_IMM11BY2, this relocation indicates that there is a
'jsri' at the specified address. There is a separate relocation
- entry for the literal pool entry that it references, but we
+ entry for the literal pool entry that it references, but we
might be able to change the jsri to a bsr if the target turns out
to be close enough [even though we won't reclaim the literal pool
entry, we'll get some runtime efficiency back]. Note that this
- is a relocation that we are allowed to safely ignore. */
+ is a relocation that we are allowed to safely ignore. */
HOWTO (IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2,/* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -181,7 +180,7 @@ static reloc_howto_type mcore_coff_howto_table[] =
0x0, /* src_mask */
0x7ff, /* dst_mask */
true), /* pcrel_offset */
-
+
HOWTO (IMAGE_REL_MCORE_RVA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -259,11 +258,10 @@ mcore_emit_base_file_entry (info, output_bfd, input_section, reloc_offset)
if (coff_data (output_bfd)->pe)
addr -= pe_data (output_bfd)->pe_opthdr.ImageBase;
-
+
fwrite (&addr, 1, sizeof (addr), (FILE *) info->base_file);
}
-/*ARGSUSED*/
static bfd_reloc_status_type
mcore_coff_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
@@ -276,17 +274,16 @@ mcore_coff_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
char ** error_message ATTRIBUTE_UNUSED;
{
BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
-
+
_bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"),
bfd_get_filename (abfd),
reloc_entry->howto->name,
reloc_entry->howto->type);
-
+
return bfd_reloc_notsupported;
}
-
-/* A cheesy little macro to make the code a little more readable. */
+/* A cheesy little macro to make the code a little more readable. */
#define HOW2MAP(bfd_rtype, mcore_rtype) \
case bfd_rtype: return & mcore_coff_howto_table [mcore_rtype]
@@ -296,7 +293,7 @@ mcore_coff_reloc_type_lookup (abfd, code)
bfd_reloc_code_real_type code;
{
switch (code)
- {
+ {
HOW2MAP (BFD_RELOC_32, IMAGE_REL_MCORE_ADDR32);
HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM8BY4, IMAGE_REL_MCORE_PCREL_IMM8BY4);
HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM11BY2, IMAGE_REL_MCORE_PCREL_IMM11BY2);
@@ -304,7 +301,7 @@ mcore_coff_reloc_type_lookup (abfd, code)
HOW2MAP (BFD_RELOC_32_PCREL, IMAGE_REL_MCORE_PCREL_32);
HOW2MAP (BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2);
HOW2MAP (BFD_RELOC_RVA, IMAGE_REL_MCORE_RVA);
- default:
+ default:
return NULL;
}
/*NOTREACHED*/
@@ -326,19 +323,18 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
{
reloc_howto_type * howto;
-
if (rel->r_type >= NUM_ELEM (mcore_coff_howto_table))
return NULL;
-
+
howto = mcore_coff_howto_table + rel->r_type;
if (rel->r_type == IMAGE_REL_MCORE_RVA)
* addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
-
+
else if (howto->pc_relative)
{
* addendp = sec->vma - 2; /* XXX guess - is this right ? */
-
+
/* If the symbol is defined, then the generic code is going to
add back the symbol value in order to cancel out an
adjustment it made to the addend. However, we set the addend
@@ -350,7 +346,7 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
}
else
* addendp = 0;
-
+
return howto;
}
@@ -362,8 +358,7 @@ in_reloc_p (abfd, howto)
reloc_howto_type * howto;
{
return ! howto->pc_relative && howto->type != IMAGE_REL_MCORE_RVA;
-}
-
+}
/* The reloc processing routine for the optimized COFF linker. */
static boolean
@@ -382,13 +377,13 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
struct internal_reloc * relend;
boolean hihalf;
bfd_vma hihalf_val;
-
+
/* 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;
-
+
/* Check if we have the same endianess */
if ( input_bfd->xvec->byteorder != output_bfd->xvec->byteorder
&& output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
@@ -408,7 +403,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
rel = relocs;
relend = rel + input_section->reloc_count;
-
+
for (; rel < relend; rel++)
{
long symndx;
@@ -421,7 +416,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
reloc_howto_type * howto = NULL;
struct coff_link_hash_entry * h;
const char * my_name;
-
+
symndx = rel->r_symndx;
loc = contents + rel->r_vaddr - input_section->vma;
@@ -437,7 +432,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
}
addend = 0;
-
+
/* Get the howto and initialise the addend. */
howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
sym, & addend);
@@ -445,7 +440,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
return false;
val = 0;
-
+
if (h == NULL)
{
if (symndx == -1)
@@ -453,8 +448,8 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
asection * sec = sections[symndx];
-
- val = (sym->n_value
+
+ val = (sym->n_value
+ sec->output_section->vma
+ sec->output_offset);
@@ -463,10 +458,10 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
else if ( sym->_n._n_n._n_zeroes == 0
&& sym->_n._n_n._n_offset != 0)
my_name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset;
- else
+ else
{
static char buf [SYMNMLEN + 1];
-
+
strncpy (buf, sym->_n._n_name, SYMNMLEN);
buf[SYMNMLEN] = '\0';
my_name = buf;
@@ -479,7 +474,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type == bfd_link_hash_defweak)
{
asection * sec = h->root.u.def.section;
-
+
val = (h->root.u.def.value
+ sec->output_section->vma
+ sec->output_offset);
@@ -491,12 +486,12 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true)))
return false;
}
-
+
my_name = h->root.root.string;
- }
+ }
rstat = bfd_reloc_ok;
-
+
/* Each case must do its own relocation, setting rstat appropriately. */
switch (r_type)
{
@@ -505,19 +500,19 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_get_filename (input_bfd), r_type);
bfd_set_error (bfd_error_bad_value);
return false;
-
+
case IMAGE_REL_MCORE_ABSOLUTE:
- 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_MCORE_PCREL_IMM8BY4:
case IMAGE_REL_MCORE_PCREL_IMM11BY2:
case IMAGE_REL_MCORE_PCREL_IMM4BY2:
@@ -527,7 +522,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
/* XXX fixme - shouldn't this be like the code for the RVA reloc ? */
rstat = _bfd_relocate_contents (howto, input_bfd, val, loc);
break;
-
+
case IMAGE_REL_MCORE_RVA:
rstat = _bfd_final_link_relocate
(howto, input_bfd,
@@ -535,36 +530,35 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
val, addend);
break;
}
-
+
if (info->base_file)
{
/* Emit a reloc if the backend thinks it needs it. */
if (sym && pe_data (output_bfd)->in_reloc_p (output_bfd, howto))
mcore_emit_base_file_entry (info, output_bfd, input_section, rel->r_vaddr);
}
-
+
switch (rstat)
{
default:
abort ();
-
+
case bfd_reloc_ok:
break;
-
+
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info, my_name, howto->name,
+ (info, my_name, howto->name,
(bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma)))
return false;
}
- }
+ }
return true;
}
-
-/* Tailor coffcode.h -- macro heaven. */
+/* Tailor coffcode.h -- macro heaven. */
/* We use the special COFF backend linker, with our own special touch. */
@@ -581,6 +575,10 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
/* Forward declaration to initialise alterbative_target field. */
extern const bfd_target TARGET_LITTLE_SYM;
-/* The transfer vectors that lead the outside world to all of the above. */
-CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, (SEC_LINK_ONCE | SEC_LINK_DUPLICATES), 0, & TARGET_LITTLE_SYM)
-CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, (SEC_LINK_ONCE | SEC_LINK_DUPLICATES), 0, & TARGET_BIG_SYM)
+/* The transfer vectors that lead the outside world to all of the above. */
+CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED,
+ (SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_READONLY | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+ 0, & TARGET_LITTLE_SYM)
+CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED,
+ (SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_READONLY | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+ 0, & TARGET_BIG_SYM)
diff --git a/gnu/usr.bin/binutils/bfd/coff-stgo32.c b/gnu/usr.bin/binutils/bfd/coff-stgo32.c
index 5a7a716a9e0..9fb9d37cae4 100644
--- a/gnu/usr.bin/binutils/bfd/coff-stgo32.c
+++ b/gnu/usr.bin/binutils/bfd/coff-stgo32.c
@@ -1,5 +1,5 @@
-/* BFD back-end for Intel 386 COFF files (go32 variant with a stub).
- Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub).
+ Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Robert Hoehne.
This file is part of BFD, the Binary File Descriptor library.
@@ -41,13 +41,12 @@
#define COFF_GO32_EXE
#define COFF_LONG_SECTION_NAMES
#define COFF_SUPPORT_GNU_LINKONCE
+#define COFF_LONG_FILENAMES
#define COFF_SECTION_ALIGNMENT_ENTRIES \
{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
- COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \
-{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }
#include "bfd.h"
@@ -111,7 +110,7 @@ static boolean
/* This macro is used, because I cannot assume the endianess of the
host system */
-#define _H(index) (bfd_h_get_16(abfd, (bfd_byte *)(header+index*2)))
+#define _H(index) (bfd_h_get_16(abfd, (bfd_byte *) (header+index*2)))
/* These bytes are a 2048-byte DOS executable, which loads the COFF
image into memory and then runs it. It is called 'stub' */
diff --git a/gnu/usr.bin/binutils/bfd/coff-tic30.c b/gnu/usr.bin/binutils/bfd/coff-tic30.c
index a971f76d7be..5b8ffd4625f 100644
--- a/gnu/usr.bin/binutils/bfd/coff-tic30.c
+++ b/gnu/usr.bin/binutils/bfd/coff-tic30.c
@@ -1,5 +1,5 @@
/* BFD back-end for TMS320C30 coff binaries.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
@@ -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/gnu/usr.bin/binutils/bfd/coff-tic54x.c b/gnu/usr.bin/binutils/bfd/coff-tic54x.c
new file mode 100644
index 00000000000..1e844ced19f
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/coff-tic54x.c
@@ -0,0 +1,760 @@
+/* BFD back-end for TMS320C54X coff binaries.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Timothy Wall (twall@cygnus.com)
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "bfdlink.h"
+#include "coff/tic54x.h"
+#include "coff/internal.h"
+#include "libcoff.h"
+
+#undef F_LSYMS
+#define F_LSYMS F_LSYMS_TICOFF
+
+/*
+ 32-bit operations
+ The octet order is screwy. words are LSB first (LS octet, actually), but
+ longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the
+ first word and 0x1234 in the second. When looking at the data as stored in
+ the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12.
+ Don't bother with 64-bits, as there aren't any.
+ */
+static bfd_vma
+tic54x_getl32(addr)
+ register const bfd_byte *addr;
+{
+ unsigned long v;
+ v = (unsigned long) addr[2];
+ v |= (unsigned long) addr[3] << 8;
+ v |= (unsigned long) addr[0] << 16;
+ v |= (unsigned long) addr[1] << 24;
+ return (bfd_vma) v;
+}
+
+static void
+tic54x_putl32 (data, addr)
+ bfd_vma data;
+ register bfd_byte *addr;
+{
+ addr[2] = (bfd_byte)data;
+ addr[3] = (bfd_byte) (data >> 8);
+ addr[0] = (bfd_byte) (data >> 16);
+ addr[1] = (bfd_byte) (data >> 24);
+}
+
+bfd_signed_vma
+tic54x_getl_signed_32 (addr)
+ register const bfd_byte *addr;
+{
+ unsigned long v;
+
+ v = (unsigned long) addr[2];
+ v |= (unsigned long) addr[3] << 8;
+ v |= (unsigned long) addr[0] << 16;
+ v |= (unsigned long) addr[1] << 24;
+#define COERCE32(x) \
+ ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
+ return COERCE32 (v);
+}
+
+#define coff_get_section_load_page bfd_ticoff_get_section_load_page
+#define coff_set_section_load_page bfd_ticoff_set_section_load_page
+
+void
+bfd_ticoff_set_section_load_page (sect, page)
+ asection *sect;
+ int page;
+{
+ sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page);
+}
+
+int
+bfd_ticoff_get_section_load_page (sect)
+ asection *sect;
+{
+ int page;
+
+ /* Provide meaningful defaults for predefined sections. */
+ if (sect == &bfd_com_section)
+ page = PG_DATA;
+
+ else if (sect == &bfd_und_section
+ || sect == &bfd_abs_section
+ || sect == &bfd_ind_section)
+ page = PG_PROG;
+
+ else
+ page = FLAG_TO_PG (sect->lma);
+
+ return page;
+}
+
+/* Set the architecture appropriately. Allow unkown architectures
+ (e.g. binary). */
+static boolean
+tic54x_set_arch_mach (abfd, arch, machine)
+ bfd *abfd;
+ enum bfd_architecture arch;
+ unsigned long machine;
+{
+ if (arch == bfd_arch_unknown)
+ arch = bfd_arch_tic54x;
+
+ else if (arch != bfd_arch_tic54x)
+ return false;
+
+ return bfd_default_set_arch_mach (abfd, arch, machine);
+}
+
+static bfd_reloc_status_type
+tic54x_relocation (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+
+ if (output_bfd != (bfd *) NULL)
+ {
+ /* This is a partial relocation, and we want to apply the
+ relocation to the reloc entry rather than the raw data.
+ Modify the reloc inplace to reflect what we now know. */
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+ return bfd_reloc_continue;
+}
+
+reloc_howto_type tic54x_howto_table[] =
+{
+/* type,rightshift,size (0=byte, 1=short, 2=long),
+ bit size, pc_relative, bitpos, dont complain_on_overflow,
+ special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset */
+
+ /* NORMAL BANK */
+ /* 16-bit direct reference to symbol's address */
+ HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont,
+ tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false),
+
+ /* 7 LSBs of an address */
+ HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont,
+ tic54x_relocation,"LS7",false,0x007F,0x007F,false),
+
+ /* 9 MSBs of an address */
+ /* TI assembler doesn't shift its encoding, and is thus incompatible */
+ HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont,
+ tic54x_relocation,"MS9",false,0x01FF,0x01FF,false),
+
+ /* 23-bit relocation */
+ HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont,
+ tic54x_relocation,"RELEXT",false,0x7FFFFF,0x7FFFFF,false),
+
+ /* 16 bits of 23-bit extended address */
+ HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont,
+ tic54x_relocation,"RELEXT16",false,0x7FFFFF,0x7FFFFF,false),
+
+ /* upper 7 bits of 23-bit extended address */
+ HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont,
+ tic54x_relocation,"RELEXTMS7",false,0x7F,0x7F,false),
+
+ /* ABSOLUTE BANK */
+ /* 16-bit direct reference to symbol's address, absolute */
+ HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont,
+ tic54x_relocation,"AREL16",false,0xFFFF,0xFFFF,false),
+
+ /* 7 LSBs of an address, absolute */
+ HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont,
+ tic54x_relocation,"ALS7",false,0x007F,0x007F,false),
+
+ /* 9 MSBs of an address, absolute */
+ /* TI assembler doesn't shift its encoding, and is thus incompatible */
+ HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont,
+ tic54x_relocation,"AMS9",false,0x01FF,0x01FF,false),
+
+ /* 23-bit direct reference, absolute */
+ HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont,
+ tic54x_relocation,"ARELEXT",false,0x7FFFFF,0x7FFFFF,false),
+
+ /* 16 bits of 23-bit extended address, absolute */
+ HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont,
+ tic54x_relocation,"ARELEXT16",false,0x7FFFFF,0x7FFFFF,false),
+
+ /* upper 7 bits of 23-bit extended address, absolute */
+ HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont,
+ tic54x_relocation,"ARELEXTMS7",false,0x7F,0x7F,false),
+
+ /* 32-bit relocation exclusively for stabs */
+ HOWTO (R_RELLONG,0,2,32,false,0,complain_overflow_dont,
+ tic54x_relocation,"STAB",false,0xFFFFFFFF,0xFFFFFFFF,false),
+
+};
+
+#define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
+
+/* For the case statement use the code values used tc_gen_reloc (defined in
+ bfd/reloc.c) to map to the howto table entries */
+reloc_howto_type *
+tic54x_coff_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ switch (code)
+ {
+ case BFD_RELOC_16:
+ return &tic54x_howto_table[0];
+ case BFD_RELOC_TIC54X_PARTLS7:
+ return &tic54x_howto_table[1];
+ case BFD_RELOC_TIC54X_PARTMS9:
+ return &tic54x_howto_table[2];
+ case BFD_RELOC_TIC54X_23:
+ return &tic54x_howto_table[3];
+ case BFD_RELOC_TIC54X_16_OF_23:
+ return &tic54x_howto_table[4];
+ case BFD_RELOC_TIC54X_MS7_OF_23:
+ return &tic54x_howto_table[5];
+ case BFD_RELOC_32:
+ return &tic54x_howto_table[12];
+ default:
+ return (reloc_howto_type *) NULL;
+ }
+}
+
+/* Code to turn a r_type into a howto ptr, uses the above howto table.
+ Called after some initial checking by the tic54x_rtype_to_howto fn below */
+static void
+tic54x_lookup_howto (internal, dst)
+ arelent *internal;
+ struct internal_reloc *dst;
+{
+ unsigned i;
+ int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0;
+ for (i = 0; i < sizeof tic54x_howto_table/sizeof tic54x_howto_table[0]; i++)
+ {
+ if (tic54x_howto_table[i].type == dst->r_type)
+ {
+ internal->howto = tic54x_howto_table + i + bank;
+ return;
+ }
+ }
+
+ (*_bfd_error_handler) (_("Unrecognized reloc type 0x%x"),
+ (unsigned int) dst->r_type);
+ abort ();
+}
+
+#define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\
+ tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT)
+
+static void tic54x_reloc_processing();
+
+#define coff_rtype_to_howto coff_tic54x_rtype_to_howto
+
+static reloc_howto_type *
+coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec;
+ struct internal_reloc *rel;
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+ struct internal_syment *sym ATTRIBUTE_UNUSED;
+ bfd_vma *addendp;
+{
+ arelent genrel;
+
+ if (rel->r_symndx == -1 && addendp != NULL)
+ {
+ /* This is a TI "internal relocation", which means that the relocation
+ amount is the amount by which the current section is being relocated
+ in the output section. */
+ *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma;
+ }
+
+ tic54x_lookup_howto (&genrel, rel);
+
+ return genrel.howto;
+}
+
+static boolean
+ticoff0_bad_format_hook (abfd, filehdr)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ PTR filehdr;
+{
+ struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
+
+ if (COFF0_BADMAG (*internal_f))
+ return false;
+
+ return true;
+}
+
+static boolean
+ticoff1_bad_format_hook (abfd, filehdr)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ PTR filehdr;
+{
+ struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
+
+ if (COFF1_BADMAG (*internal_f))
+ return false;
+
+ return true;
+}
+
+/* replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
+ labels */
+static boolean
+ticoff_bfd_is_local_label_name (abfd, name)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ const char *name;
+{
+ if (TICOFF_LOCAL_LABEL_P(name))
+ return true;
+ return false;
+}
+
+#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
+
+/* Customize coffcode.h; the default coff_ functions are set up to use COFF2;
+ coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1
+ and COFF0 vectors use custom _bad_format_hook procs instead of setting
+ BADMAG.
+ */
+#define BADMAG(x) COFF2_BADMAG(x)
+#include "coffcode.h"
+
+static boolean
+tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do)
+ bfd *abfd;
+ sec_ptr section;
+ PTR location;
+ file_ptr offset;
+ bfd_size_type bytes_to_do;
+{
+ return coff_set_section_contents (abfd, section, location,
+ offset, bytes_to_do);
+}
+
+static void
+tic54x_reloc_processing (relent, reloc, symbols, abfd, section)
+ arelent *relent;
+ struct internal_reloc *reloc;
+ asymbol **symbols;
+ bfd *abfd;
+ asection *section;
+{
+ asymbol *ptr;
+
+ relent->address = reloc->r_vaddr;
+
+ if (reloc->r_symndx != -1)
+ {
+ if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
+ {
+ (*_bfd_error_handler)
+ (_("%s: warning: illegal symbol index %ld in relocs"),
+ bfd_get_filename (abfd), reloc->r_symndx);
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ ptr = NULL;
+ }
+ else
+ {
+ relent->sym_ptr_ptr = (symbols
+ + obj_convert (abfd)[reloc->r_symndx]);
+ ptr = *(relent->sym_ptr_ptr);
+ }
+ }
+ else
+ {
+ relent->sym_ptr_ptr = section->symbol_ptr_ptr;
+ ptr = *(relent->sym_ptr_ptr);
+ }
+
+ /* The symbols definitions that we have read in have been
+ relocated as if their sections started at 0. But the offsets
+ refering to the symbols in the raw data have not been
+ modified, so we have to have a negative addend to compensate.
+
+ Note that symbols which used to be common must be left alone */
+
+ /* Calculate any reloc addend by looking at the symbol */
+ CALC_ADDEND (abfd, ptr, *reloc, relent);
+
+ relent->address -= section->vma;
+ /* !! relent->section = (asection *) NULL;*/
+
+ /* Fill in the relent->howto field from reloc->r_type */
+ tic54x_lookup_howto (relent, reloc);
+}
+
+/* COFF0 differs in file/section header size and relocation entry size */
+static CONST bfd_coff_backend_data ticoff0_swap_table =
+{
+ coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
+ coff_SWAP_aux_out, coff_SWAP_sym_out,
+ coff_SWAP_lineno_out, coff_SWAP_reloc_out,
+ coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
+ coff_SWAP_scnhdr_out,
+ FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN,
+#ifdef COFF_LONG_FILENAMES
+ true,
+#else
+ false,
+#endif
+#ifdef COFF_LONG_SECTION_NAMES
+ true,
+#else
+ false,
+#endif
+#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
+ true,
+#else
+ false,
+#endif
+#ifdef COFF_DEBUG_STRING_WIDE_PREFIX
+ 4,
+#else
+ 2,
+#endif
+ COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
+ coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
+ coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook,
+ coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
+ coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
+ coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
+ coff_classify_symbol, coff_compute_section_file_positions,
+ coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
+ coff_adjust_symndx, coff_link_add_one_symbol,
+ coff_link_output_has_begun, coff_final_link_postscript
+};
+
+/* COFF1 differs in section header size */
+static CONST bfd_coff_backend_data ticoff1_swap_table =
+{
+ coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
+ coff_SWAP_aux_out, coff_SWAP_sym_out,
+ coff_SWAP_lineno_out, coff_SWAP_reloc_out,
+ coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
+ coff_SWAP_scnhdr_out,
+ FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
+#ifdef COFF_LONG_FILENAMES
+ true,
+#else
+ false,
+#endif
+#ifdef COFF_LONG_SECTION_NAMES
+ true,
+#else
+ 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, ticoff1_bad_format_hook, coff_set_arch_mach_hook,
+ coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
+ coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
+ coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
+ coff_classify_symbol, coff_compute_section_file_positions,
+ coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
+ coff_adjust_symndx, coff_link_add_one_symbol,
+ coff_link_output_has_begun, coff_final_link_postscript
+};
+
+/* TI COFF v0, DOS tools (little-endian headers) */
+const bfd_target tic54x_coff0_vec =
+{
+ "coff0-c54x", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT ),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ 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},
+ {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),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (tic54x),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
+ (PTR)&ticoff0_swap_table
+};
+
+/* TI COFF v0, SPARC tools (big-endian headers) */
+const bfd_target tic54x_coff0_beh_vec =
+{
+ "coff0-beh-c54x", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_BIG, /* header byte order is big */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT ),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, _bfd_dummy_target},
+ {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),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (tic54x),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ &tic54x_coff0_vec,
+
+ (PTR)&ticoff0_swap_table
+};
+
+/* TI COFF v1, DOS tools (little-endian headers) */
+const bfd_target tic54x_coff1_vec =
+{
+ "coff1-c54x", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT ),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ 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},
+ {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),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (tic54x),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ &tic54x_coff0_beh_vec,
+
+ (PTR)&ticoff1_swap_table
+};
+
+/* TI COFF v1, SPARC tools (big-endian headers) */
+const bfd_target tic54x_coff1_beh_vec =
+{
+ "coff1-beh-c54x", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_BIG, /* header byte order is big */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT ),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, _bfd_dummy_target},
+ {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),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (tic54x),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ &tic54x_coff1_vec,
+
+ (PTR)&ticoff1_swap_table
+};
+
+/* TI COFF v2, TI DOS tools output (little-endian headers) */
+const bfd_target tic54x_coff2_vec =
+{
+ "coff2-c54x", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT ),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ 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},
+ {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),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (tic54x),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ &tic54x_coff1_beh_vec,
+
+ COFF_SWAP_TABLE
+};
+
+/* TI COFF v2, TI SPARC tools output (big-endian headers) */
+const bfd_target tic54x_coff2_beh_vec =
+{
+ "coff2-beh-c54x", /* name */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_BIG, /* header byte order is big */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT ),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ '_', /* leading symbol underscore */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, _bfd_dummy_target},
+ {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),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (tic54x),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ &tic54x_coff2_vec,
+
+ COFF_SWAP_TABLE
+};
diff --git a/gnu/usr.bin/binutils/bfd/coff-tic80.c b/gnu/usr.bin/binutils/bfd/coff-tic80.c
index a8ade33ba9c..2d065627032 100644
--- a/gnu/usr.bin/binutils/bfd/coff-tic80.c
+++ b/gnu/usr.bin/binutils/bfd/coff-tic80.c
@@ -1,5 +1,5 @@
/* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com)
@@ -424,7 +424,7 @@ local16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
/* Code to turn an external r_type into a pointer to an entry in the howto_table.
If passed an r_type we don't recognize the abort rather than silently failing
- to generate an output file. */
+ to generate an output file. */
static void
rtype2howto (cache_ptr, dst)
@@ -465,7 +465,7 @@ coff_tic80_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
{
/* This is a TI "internal relocation", which means that the relocation
amount is the amount by which the current section is being relocated
- in the output section. */
+ in the output section. */
*addendp = (sec -> output_section -> vma + sec -> output_offset) - sec -> vma;
}
RTYPE2HOWTO (&genrel, rel);
@@ -518,7 +518,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
sym = NULL;
}
else
- {
+ {
h = obj_coff_sym_hashes (input_bfd)[symndx];
sym = syms + symndx;
}
@@ -649,7 +649,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
contents[addr + 1] |= hold & 0x80;
break;
}
-
+
case R_PPBASE:
/* Parameter RAM is from 0x1000000 to 0x1000800. */
contents[addr] &=~ 0x3;
diff --git a/gnu/usr.bin/binutils/bfd/coff64-rs6000.c b/gnu/usr.bin/binutils/bfd/coff64-rs6000.c
new file mode 100644
index 00000000000..3d1b8b69eb4
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/coff64-rs6000.c
@@ -0,0 +1,351 @@
+/* BFD back-end for IBM RS/6000 "XCOFF64" files.
+ Copyright 2000, 2001
+ Free Software Foundation, Inc.
+ Written Clinton Popetz.
+ Contributed by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Internalcoff.h and coffcode.h modify themselves based on these flags. */
+#define XCOFF64
+#define RS6000COFF_C 1
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "coff/internal.h"
+#include "coff/rs6k64.h"
+#include "libcoff.h"
+
+#define GET_FILEHDR_SYMPTR bfd_h_get_64
+#define PUT_FILEHDR_SYMPTR bfd_h_put_64
+#define GET_AOUTHDR_DATA_START bfd_h_get_64
+#define PUT_AOUTHDR_DATA_START bfd_h_put_64
+#define GET_AOUTHDR_TEXT_START bfd_h_get_64
+#define PUT_AOUTHDR_TEXT_START bfd_h_put_64
+#define GET_AOUTHDR_TSIZE bfd_h_get_64
+#define PUT_AOUTHDR_TSIZE bfd_h_put_64
+#define GET_AOUTHDR_DSIZE bfd_h_get_64
+#define PUT_AOUTHDR_DSIZE bfd_h_put_64
+#define GET_AOUTHDR_BSIZE bfd_h_get_64
+#define PUT_AOUTHDR_BSIZE bfd_h_put_64
+#define GET_AOUTHDR_ENTRY bfd_h_get_64
+#define PUT_AOUTHDR_ENTRY bfd_h_put_64
+#define GET_SCNHDR_PADDR bfd_h_get_64
+#define PUT_SCNHDR_PADDR bfd_h_put_64
+#define GET_SCNHDR_VADDR bfd_h_get_64
+#define PUT_SCNHDR_VADDR bfd_h_put_64
+#define GET_SCNHDR_SIZE bfd_h_get_64
+#define PUT_SCNHDR_SIZE bfd_h_put_64
+#define GET_SCNHDR_SCNPTR bfd_h_get_64
+#define PUT_SCNHDR_SCNPTR bfd_h_put_64
+#define GET_SCNHDR_RELPTR bfd_h_get_64
+#define PUT_SCNHDR_RELPTR bfd_h_put_64
+#define GET_SCNHDR_LNNOPTR bfd_h_get_64
+#define PUT_SCNHDR_LNNOPTR bfd_h_put_64
+#define GET_SCNHDR_NRELOC bfd_h_get_32
+#define MAX_SCNHDR_NRELOC 0xffffffff
+#define PUT_SCNHDR_NRELOC bfd_h_put_32
+#define GET_SCNHDR_NLNNO bfd_h_get_32
+#define MAX_SCNHDR_NLNNO 0xffffffff
+#define PUT_SCNHDR_NLNNO bfd_h_put_32
+#define GET_RELOC_VADDR bfd_h_get_64
+#define PUT_RELOC_VADDR bfd_h_put_64
+
+#define COFF_FORCE_SYMBOLS_IN_STRINGS
+#define COFF_DEBUG_STRING_WIDE_PREFIX
+
+#define COFF_ADJUST_SCNHDR_OUT_POST(ABFD,INT,EXT) \
+do { \
+ memset (((SCNHDR *)EXT)->s_pad, 0, sizeof (((SCNHDR *)EXT)->s_pad));\
+} while (0)
+
+#define NO_COFF_LINENOS
+
+#define coff_SWAP_lineno_in xcoff64_swap_lineno_in
+#define coff_SWAP_lineno_out xcoff64_swap_lineno_out
+
+#define PUTWORD bfd_h_put_32
+#define PUTHALF bfd_h_put_16
+#define PUTBYTE bfd_h_put_8
+#define GETWORD bfd_h_get_32
+#define GETHALF bfd_h_get_16
+#define GETBYTE bfd_h_get_8
+
+/* For XCOFF64, the effective width of symndx changes depending on
+ whether we are the first entry. Sigh. */
+static void
+xcoff64_swap_lineno_in (abfd, ext1, in1)
+ bfd *abfd;
+ PTR ext1;
+ PTR in1;
+{
+ LINENO *ext = (LINENO *)ext1;
+ struct internal_lineno *in = (struct internal_lineno *)in1;
+
+ in->l_lnno = bfd_h_get_32(abfd, (bfd_byte *) (ext->l_lnno));
+ if (in->l_lnno == 0)
+ in->l_addr.l_symndx =
+ bfd_h_get_32(abfd, (bfd_byte *) ext->l_addr.l_symndx);
+ else
+ in->l_addr.l_symndx =
+ bfd_h_get_64(abfd, (bfd_byte *) ext->l_addr.l_symndx);
+}
+
+static unsigned int
+xcoff64_swap_lineno_out (abfd, inp, outp)
+ bfd *abfd;
+ PTR inp;
+ PTR outp;
+{
+ struct internal_lineno *in = (struct internal_lineno *)inp;
+ struct external_lineno *ext = (struct external_lineno *)outp;
+ PUTWORD(abfd, in->l_addr.l_symndx, (bfd_byte *)
+ ext->l_addr.l_symndx);
+
+ bfd_h_put_32 (abfd, in->l_lnno, (bfd_byte *) (ext->l_lnno));
+ if (in->l_lnno == 0)
+ bfd_h_put_32 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx);
+ else
+ bfd_h_put_64 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx);
+
+ return bfd_coff_linesz (abfd);
+}
+
+static void xcoff64_swap_sym_in PARAMS ((bfd *, PTR, PTR));
+static unsigned int xcoff64_swap_sym_out PARAMS ((bfd *, PTR, PTR));
+static void xcoff64_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+static unsigned int xcoff64_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+
+static void
+xcoff64_swap_sym_in (abfd, ext1, in1)
+ bfd *abfd;
+ PTR ext1;
+ PTR in1;
+{
+ SYMENT *ext = (SYMENT *)ext1;
+ struct internal_syment *in = (struct internal_syment *)in1;
+
+ in->_n._n_n._n_zeroes = 0;
+ in->_n._n_n._n_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->e_offset);
+ in->n_value = bfd_h_get_64(abfd, (bfd_byte *) ext->e.e_value);
+ in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum);
+ in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type);
+ in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
+ in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
+}
+
+static unsigned int
+xcoff64_swap_sym_out (abfd, inp, extp)
+ bfd *abfd;
+ PTR inp;
+ PTR extp;
+{
+ struct internal_syment *in = (struct internal_syment *)inp;
+ SYMENT *ext =(SYMENT *)extp;
+
+ bfd_h_put_32(abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e_offset);
+ bfd_h_put_64(abfd, in->n_value , (bfd_byte *) ext->e.e_value);
+ bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum);
+ bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type);
+ bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass);
+ bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux);
+ return bfd_coff_symesz (abfd);
+}
+
+static void
+xcoff64_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
+ bfd *abfd;
+ PTR ext1;
+ int type;
+ int class;
+ int indx;
+ int numaux;
+ PTR in1;
+{
+ AUXENT *ext = (AUXENT *)ext1;
+ union internal_auxent *in = (union internal_auxent *)in1;
+
+ switch (class) {
+ case C_FILE:
+ if (ext->x_file.x_fname[0] == 0) {
+ in->x_file.x_n.x_zeroes = 0;
+ in->x_file.x_n.x_offset =
+ bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
+ } else {
+ if (numaux > 1)
+ {
+ if (indx == 0)
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname,
+ numaux * sizeof (AUXENT));
+ }
+ else
+ {
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ }
+ }
+ goto end;
+
+ /* RS/6000 "csect" auxents */
+ 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_lo);
+ /* FIXME: If we want section lengths larger than 32 bits, we need
+ to modify the internal coff structures to support it. */
+ 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);
+ goto end;
+ }
+ break;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL) {
+ /* PE defines some extra fields; we zero them out for
+ safety. */
+ in->x_scn.x_checksum = 0;
+ in->x_scn.x_associated = 0;
+ in->x_scn.x_comdat = 0;
+
+ goto end;
+ }
+ break;
+ }
+
+ if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+ {
+ in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_64(abfd, (bfd_byte *)
+ ext->x_sym.x_fcnary.x_fcn.x_lnnoptr);
+ in->x_sym.x_fcnary.x_fcn.x_endndx.l = bfd_h_get_32(abfd, (bfd_byte *)
+ ext->x_sym.x_fcnary.x_fcn.x_endndx);
+ }
+ if (ISFCN(type)) {
+ in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize);
+ }
+ else {
+ in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_32(abfd, (bfd_byte *)
+ ext->x_sym.x_fcnary.x_lnsz.x_lnno);
+ in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *)
+ ext->x_sym.x_fcnary.x_lnsz.x_size);
+ }
+
+end: ;
+ /* the semicolon is because MSVC doesn't like labels at
+ end of block. */
+
+}
+
+static unsigned int
+xcoff64_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
+ bfd *abfd;
+ PTR inp;
+ int type;
+ int class;
+ int indx ATTRIBUTE_UNUSED;
+ int numaux ATTRIBUTE_UNUSED;
+ PTR extp;
+{
+ union internal_auxent *in = (union internal_auxent *)inp;
+ AUXENT *ext = (AUXENT *)extp;
+
+ memset((PTR)ext, 0, bfd_coff_auxesz (abfd));
+ switch (class)
+ {
+ case C_FILE:
+ if (in->x_file.x_fname[0] == 0)
+ {
+ PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes);
+ PUTWORD(abfd,
+ in->x_file.x_n.x_offset,
+ (bfd_byte *) ext->x_file.x_n.x_offset);
+ }
+ else
+ {
+ memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
+ }
+ PUTBYTE (abfd, _AUX_FILE, (bfd_byte *) ext->x_auxtype.x_auxtype);
+ goto end;
+
+ /* 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_lo);
+ 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);
+ PUTBYTE (abfd, _AUX_CSECT, (bfd_byte *) ext->x_auxtype.x_auxtype);
+ goto end;
+ }
+ break;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL) {
+ goto end;
+ }
+ break;
+ }
+
+ if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+ {
+ bfd_h_put_64(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr,
+ (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr);
+ PUTBYTE (abfd, _AUX_FCN, (bfd_byte *) ext->x_auxtype.x_auxtype);
+ PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l,
+ (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx);
+ }
+ if (ISFCN (type))
+ PUTWORD (abfd, in->x_sym.x_misc.x_fsize,
+ (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize);
+ else
+ {
+ bfd_h_put_32(abfd, in->x_sym.x_misc.x_lnsz.x_lnno,
+ (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_lnno);
+ bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size,
+ (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_size);
+ }
+
+end:
+ return bfd_coff_auxesz (abfd);
+}
+
+#define coff_SWAP_sym_in xcoff64_swap_sym_in
+#define coff_SWAP_sym_out xcoff64_swap_sym_out
+#define coff_SWAP_aux_in xcoff64_swap_aux_in
+#define coff_SWAP_aux_out xcoff64_swap_aux_out
+
+#define TARGET_NAME "aixcoff64-rs6000"
+#define TARGET_SYM rs6000coff64_vec
+
+#include "xcoff-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/cpu-arc.c b/gnu/usr.bin/binutils/bfd/cpu-arc.c
index bce59d4c99f..2904ae32d52 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-arc.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-arc.c
@@ -1,5 +1,5 @@
/* BFD support for the ARC processor
- Copyright 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1997, 2001 Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -24,31 +24,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ARC(mach, print_name, default_p, next) \
{ \
- 32, /* 32 bits in a word */ \
- 32, /* 32 bits in an address */ \
- 8, /* 8 bits in a byte */ \
+ 32, /* 32 bits in a word */ \
+ 32, /* 32 bits in an address */ \
+ 8, /* 8 bits in a byte */ \
bfd_arch_arc, \
mach, \
"arc", \
print_name, \
- 4, /* section alignment power */ \
+ 4, /* section alignment power */ \
default_p, \
- bfd_default_compatible, \
+ bfd_default_compatible, \
bfd_default_scan, \
next, \
}
-#if 0 /* ??? Not currently needed, but keep in for future reference. */
static const bfd_arch_info_type arch_info_struct[] =
{
- ARC (bfd_mach_arc_foo, "arc-foo", false, &arch_info_struct[1]),
- ARC (bfd_mach_arc_bar, "arc-bar", false, 0),
+ ARC ( bfd_mach_arc_5, "arc5", false, &arch_info_struct[1] ),
+ ARC ( bfd_mach_arc_5, "base", false, &arch_info_struct[2] ),
+ ARC ( bfd_mach_arc_6, "arc6", false, &arch_info_struct[3] ),
+ ARC ( bfd_mach_arc_7, "arc7", false, &arch_info_struct[4] ),
+ ARC ( bfd_mach_arc_8, "arc8", false, NULL ),
};
-#endif
const bfd_arch_info_type bfd_arc_arch =
- ARC (bfd_mach_arc_base, "arc-base", true, 0 /*&arch_info_struct[0]*/);
-
+ ARC ( bfd_mach_arc_6, "arc", true, &arch_info_struct[0] );
+
/* Utility routines. */
/* Given cpu type NAME, return its bfd_mach_arc_xxx value.
@@ -61,10 +62,7 @@ arc_get_mach (name)
const bfd_arch_info_type *p;
for (p = &bfd_arc_arch; p != NULL; p = p->next)
- {
- /* +4: skip over "arc-" */
- if (strcmp (name, p->printable_name + 4) == 0)
- return p->mach;
- }
+ if (strcmp (name, p->printable_name) == 0)
+ return p->mach;
return -1;
}
diff --git a/gnu/usr.bin/binutils/bfd/cpu-avr.c b/gnu/usr.bin/binutils/bfd/cpu-avr.c
index 637b13fb3fd..1ca48e744ee 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-avr.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-avr.c
@@ -1,5 +1,5 @@
/* BFD library support routines for the AVR architecture.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library.
@@ -22,11 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
-
static const bfd_arch_info_type *compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-
#define N(addr_bits, machine, print, default, next) \
{ \
8, /* 8 bits in a word */ \
@@ -45,17 +43,20 @@ static const bfd_arch_info_type *compatible
static const bfd_arch_info_type arch_info_struct[] =
{
- /* AT90S1200 */
+ /* AT90S1200, ATtiny1x, ATtiny28 */
N (16, bfd_mach_avr1, "avr:1", false, & arch_info_struct[1]),
- /* AT90S2xxx, AT90S4xxx, AT90S81xx, ATtiny22 */
+ /* AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22 */
N (16, bfd_mach_avr2, "avr:2", false, & arch_info_struct[2]),
/* ATmega103, ATmega603 */
N (22, bfd_mach_avr3, "avr:3", false, & arch_info_struct[3]),
- /* ATmega161 */
- N (16, bfd_mach_avr4, "avr:4", false, NULL)
+ /* ATmega83, ATmega85 */
+ N (16, bfd_mach_avr4, "avr:4", false, & arch_info_struct[4]),
+
+ /* ATmega161, ATmega163, ATmega32, AT94K */
+ N (22, bfd_mach_avr5, "avr:5", false, NULL)
};
const bfd_arch_info_type bfd_avr_arch =
@@ -74,7 +75,7 @@ compatible (a,b)
if (a->arch != b->arch)
return NULL;
- /* Special case for ATmega[16]03 (avr:3) and ATmega161 (avr:4). */
+ /* Special case for ATmega[16]03 (avr:3) and ATmega83 (avr:4). */
if ((a->mach == 3 && b->mach == 4)
|| (a->mach == 4 && b->mach == 3))
return NULL;
@@ -84,6 +85,9 @@ compatible (a,b)
if (a->mach <= b->mach)
return b;
+ if (a->mach >= b->mach)
+ return a;
+
/* Never reached! */
return NULL;
}
diff --git a/gnu/usr.bin/binutils/bfd/cpu-cris.c b/gnu/usr.bin/binutils/bfd/cpu-cris.c
new file mode 100644
index 00000000000..10d779f6c9d
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/cpu-cris.c
@@ -0,0 +1,57 @@
+/* BFD support for the Axis CRIS architecture.
+ Copyright 2000 Free Software Foundation, Inc.
+ Contributed by Axis Communications AB.
+ Written by Hans-Peter Nilsson.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type
+bfd_cris_arch =
+{
+ 32, /* There's 32 bits_per_word. */
+ 32, /* There's 32 bits_per_address. */
+ 8, /* There's 8 bits_per_byte. */
+ bfd_arch_cris, /* One of enum bfd_architecture, defined
+ in archures.c and provided in
+ generated header files. */
+ 0xff, /* Only 1 machine, but #255 for
+ historical reasons. */
+ "cris", /* The arch_name. */
+ "cris", /* The printable name is the same. */
+ 1, /* Section alignment power; each section
+ is aligned to (only) 2^1 bytes. */
+ true, /* This is the default "machine", since
+ there's only one. */
+ bfd_default_compatible, /* A default function for testing
+ "machine" compatibility of two
+ bfd_arch_info_type. */
+ bfd_default_scan, /* Check if an bfd_arch_info_type is a
+ match. */
+ NULL /* Pointer to next bfd_arch_info_type in
+ the same family. */
+};
+
+/*
+ * Local variables:
+ * eval: (c-set-style "gnu")
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/gnu/usr.bin/binutils/bfd/cpu-d10v.c b/gnu/usr.bin/binutils/bfd/cpu-d10v.c
index e16c3b79fa9..96946633a51 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-d10v.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-d10v.c
@@ -1,5 +1,5 @@
/* BFD support for the D10V processor
- Copyright 1996, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1999, 2000 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -22,50 +22,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
-static const bfd_arch_info_type d10v_ts3_info =
-{
- 16, /* 16 bits in a word */
- 16, /* 16 bits in an address */
- 8, /* 8 bits in a byte */
+static const bfd_arch_info_type d10v_ts3_info =
+{
+ 16, /* 16 bits in a word */
+ 16, /* 16 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_d10v,
- bfd_mach_d10v_ts3,
- "d10v",
- "d10v:ts3",
- 4, /* section alignment power */
- false,
- bfd_default_compatible,
- bfd_default_scan,
- 0,
+ bfd_mach_d10v_ts3,
+ "d10v",
+ "d10v:ts3",
+ 4, /* section alignment power */
+ false,
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0,
};
-static const bfd_arch_info_type d10v_ts2_info =
+static const bfd_arch_info_type d10v_ts2_info =
{
- 16, /* 16 bits in a word */
- 16, /* 16 bits in an address */
- 8, /* 8 bits in a byte */
+ 16, /* 16 bits in a word */
+ 16, /* 16 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_d10v,
- bfd_mach_d10v_ts2,
- "d10v",
- "d10v:ts2",
- 4, /* section alignment power */
- false,
- bfd_default_compatible,
- bfd_default_scan,
- &d10v_ts3_info,
+ bfd_mach_d10v_ts2,
+ "d10v",
+ "d10v:ts2",
+ 4, /* section alignment power */
+ false,
+ bfd_default_compatible,
+ bfd_default_scan,
+ &d10v_ts3_info,
};
-const bfd_arch_info_type bfd_d10v_arch =
-{
- 16, /* 16 bits in a word */
- 16, /* 16 bits in an address */
- 8, /* 8 bits in a byte */
+const bfd_arch_info_type bfd_d10v_arch =
+{
+ 16, /* 16 bits in a word */
+ 16, /* 16 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_d10v,
- bfd_mach_d10v,
- "d10v",
- "d10v",
- 4, /* section alignment power */
- true,
- bfd_default_compatible,
- bfd_default_scan,
- &d10v_ts2_info,
+ bfd_mach_d10v,
+ "d10v",
+ "d10v",
+ 4, /* section alignment power */
+ true,
+ bfd_default_compatible,
+ bfd_default_scan,
+ &d10v_ts2_info,
};
diff --git a/gnu/usr.bin/binutils/bfd/cpu-fr30.c b/gnu/usr.bin/binutils/bfd/cpu-fr30.c
index 33208f89bbb..b649edb3ee4 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-fr30.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-fr30.c
@@ -1,5 +1,5 @@
/* BFD support for the FR30 processor.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright 1998 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/gnu/usr.bin/binutils/bfd/cpu-i370.c b/gnu/usr.bin/binutils/bfd/cpu-i370.c
index 2331eef913f..c6c599a1b7b 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-i370.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-i370.c
@@ -1,5 +1,6 @@
/* BFD i370 CPU definition
- Copyright (C) 1994, 95, 96, 98, 99, 2000 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 1998, 1999, 2000
+ Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas <linas@linas.org> in 1998, 1999
@@ -46,7 +47,7 @@ i370_compatible (a, b)
static const bfd_arch_info_type arch_info_struct[] =
{
- /* hack alert: old old machines are really 16 and 24 bit arch ... */
+ /* hack alert: old old machines are really 16 and 24 bit arch ... */
{
32, /* 32 bits in a word */
32, /* 32 bits in an address */
diff --git a/gnu/usr.bin/binutils/bfd/cpu-ia64-opc.c b/gnu/usr.bin/binutils/bfd/cpu-ia64-opc.c
new file mode 100644
index 00000000000..8c22942fbe4
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/cpu-ia64-opc.c
@@ -0,0 +1,589 @@
+/* Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Logically, this code should be part of libopcode but since some of
+ the operand insertion/extraction functions help bfd to implement
+ relocations, this code is included as part of elf64-ia64.c. This
+ avoids circular dependencies between libopcode and libbfd and also
+ obviates the need for applications to link in libopcode when all
+ they really want is libbfd.
+
+ --davidm Mon Apr 13 22:14:02 1998 */
+
+#include "../opcodes/ia64-opc.h"
+
+#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0])))
+
+static const char*
+ins_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
+ ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
+{
+ return "internal error---this shouldn't happen";
+}
+
+static const char*
+ext_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
+ ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
+{
+ return "internal error---this shouldn't happen";
+}
+
+static const char*
+ins_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
+ ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+static const char*
+ext_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
+ ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+static const char*
+ins_reg (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ if (value >= 1u << self->field[0].bits)
+ return "register number out of range";
+
+ *code |= value << self->field[0].shift;
+ return 0;
+}
+
+static const char*
+ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ *valuep = ((code >> self->field[0].shift)
+ & ((1u << self->field[0].bits) - 1));
+ return 0;
+}
+
+static const char*
+ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ ia64_insn new = 0;
+ int i;
+
+ for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
+ {
+ new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
+ << self->field[i].shift);
+ value >>= self->field[i].bits;
+ }
+ if (value)
+ return "integer operand out of range";
+
+ *code |= new;
+ return 0;
+}
+
+static const char*
+ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ BFD_HOST_U_64_BIT value = 0;
+ int i, bits = 0, total = 0;
+
+ for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
+ {
+ bits = self->field[i].bits;
+ value |= ((code >> self->field[i].shift)
+ & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
+ total += bits;
+ }
+ *valuep = value;
+ return 0;
+}
+
+static const char*
+ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ if (value & 0x7)
+ return "value not an integer multiple of 8";
+ return ins_immu (self, value >> 3, code);
+}
+
+static const char*
+ext_immus8 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ const char *result;
+
+ result = ext_immu (self, code, valuep);
+ if (result)
+ return result;
+
+ *valuep = *valuep << 3;
+ return 0;
+}
+
+static const char*
+ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
+ ia64_insn *code, int scale)
+{
+ BFD_HOST_64_BIT svalue = value, sign_bit = 0;
+ ia64_insn new = 0;
+ int i;
+
+ svalue >>= scale;
+
+ for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
+ {
+ new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
+ << self->field[i].shift);
+ sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
+ svalue >>= self->field[i].bits;
+ }
+ if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
+ return "integer operand out of range";
+
+ *code |= new;
+ return 0;
+}
+
+static const char*
+ext_imms_scaled (const struct ia64_operand *self, ia64_insn code,
+ ia64_insn *valuep, int scale)
+{
+ int i, bits = 0, total = 0, shift;
+ BFD_HOST_64_BIT val = 0;
+
+ for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
+ {
+ bits = self->field[i].bits;
+ val |= ((code >> self->field[i].shift)
+ & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total;
+ total += bits;
+ }
+ /* sign extend: */
+ shift = 8*sizeof (val) - total;
+ val = (val << shift) >> shift;
+
+ *valuep = (val << scale);
+ return 0;
+}
+
+static const char*
+ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ return ins_imms_scaled (self, value, code, 0);
+}
+
+static const char*
+ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ if (value == (BFD_HOST_U_64_BIT) 0x100000000)
+ value = 0;
+ else
+ value = (((BFD_HOST_64_BIT)value << 32) >> 32);
+
+ return ins_imms_scaled (self, value, code, 0);
+}
+
+static const char*
+ext_imms (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ return ext_imms_scaled (self, code, valuep, 0);
+}
+
+static const char*
+ins_immsm1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ --value;
+ return ins_imms_scaled (self, value, code, 0);
+}
+
+static const char*
+ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value,
+ ia64_insn *code)
+{
+ if (value == (BFD_HOST_U_64_BIT) 0x100000000)
+ value = 0;
+ else
+ value = (((BFD_HOST_64_BIT)value << 32) >> 32);
+
+ --value;
+ return ins_imms_scaled (self, value, code, 0);
+}
+
+static const char*
+ext_immsm1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ const char *res = ext_imms_scaled (self, code, valuep, 0);
+
+ ++*valuep;
+ return res;
+}
+
+static const char*
+ins_imms1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ return ins_imms_scaled (self, value, code, 1);
+}
+
+static const char*
+ext_imms1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ return ext_imms_scaled (self, code, valuep, 1);
+}
+
+static const char*
+ins_imms4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ return ins_imms_scaled (self, value, code, 4);
+}
+
+static const char*
+ext_imms4 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ return ext_imms_scaled (self, code, valuep, 4);
+}
+
+static const char*
+ins_imms16 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ return ins_imms_scaled (self, value, code, 16);
+}
+
+static const char*
+ext_imms16 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ return ext_imms_scaled (self, code, valuep, 16);
+}
+
+static const char*
+ins_cimmu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ ia64_insn mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
+ return ins_immu (self, value ^ mask, code);
+}
+
+static const char*
+ext_cimmu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ const char *result;
+ ia64_insn mask;
+
+ mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
+ result = ext_immu (self, code, valuep);
+ if (!result)
+ {
+ mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
+ *valuep ^= mask;
+ }
+ return result;
+}
+
+static const char*
+ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ --value;
+ if (value >= ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits)
+ return "count out of range";
+
+ *code |= value << self->field[0].shift;
+ return 0;
+}
+
+static const char*
+ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ *valuep = ((code >> self->field[0].shift)
+ & ((((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) - 1)) + 1;
+ return 0;
+}
+
+static const char*
+ins_cnt2b (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ --value;
+
+ if (value > 2)
+ return "count must be in range 1..3";
+
+ *code |= value << self->field[0].shift;
+ return 0;
+}
+
+static const char*
+ext_cnt2b (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ *valuep = ((code >> self->field[0].shift) & 0x3) + 1;
+ return 0;
+}
+
+static const char*
+ins_cnt2c (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ switch (value)
+ {
+ case 0: value = 0; break;
+ case 7: value = 1; break;
+ case 15: value = 2; break;
+ case 16: value = 3; break;
+ default: return "count must be 0, 7, 15, or 16";
+ }
+ *code |= value << self->field[0].shift;
+ return 0;
+}
+
+static const char*
+ext_cnt2c (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ ia64_insn value;
+
+ value = (code >> self->field[0].shift) & 0x3;
+ switch (value)
+ {
+ case 0: value = 0; break;
+ case 1: value = 7; break;
+ case 2: value = 15; break;
+ case 3: value = 16; break;
+ }
+ *valuep = value;
+ return 0;
+}
+
+static const char*
+ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
+{
+ BFD_HOST_64_BIT val = value;
+ BFD_HOST_U_64_BIT sign = 0;
+
+ if (val < 0)
+ {
+ sign = 0x4;
+ value = -value;
+ }
+ switch (value)
+ {
+ case 1: value = 3; break;
+ case 4: value = 2; break;
+ case 8: value = 1; break;
+ case 16: value = 0; break;
+ default: return "count must be +/- 1, 4, 8, or 16";
+ }
+ *code |= (sign | value) << self->field[0].shift;
+ return 0;
+}
+
+static const char*
+ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
+{
+ BFD_HOST_64_BIT val;
+ int negate;
+
+ val = (code >> self->field[0].shift) & 0x7;
+ negate = val & 0x4;
+ switch (val & 0x3)
+ {
+ case 0: val = 16; break;
+ case 1: val = 8; break;
+ case 2: val = 4; break;
+ case 3: val = 1; break;
+ }
+ if (negate)
+ val = -val;
+
+ *valuep = val;
+ return 0;
+}
+
+#define CST IA64_OPND_CLASS_CST
+#define REG IA64_OPND_CLASS_REG
+#define IND IA64_OPND_CLASS_IND
+#define ABS IA64_OPND_CLASS_ABS
+#define REL IA64_OPND_CLASS_REL
+
+#define SDEC IA64_OPND_FLAG_DECIMAL_SIGNED
+#define UDEC IA64_OPND_FLAG_DECIMAL_UNSIGNED
+
+const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] =
+ {
+ /* constants: */
+ { CST, ins_const, ext_const, "NIL", {{ 0, 0}}, 0, "<none>" },
+ { CST, ins_const, ext_const, "ar.ccv", {{ 0, 0}}, 0, "ar.ccv" },
+ { CST, ins_const, ext_const, "ar.pfs", {{ 0, 0}}, 0, "ar.pfs" },
+ { CST, ins_const, ext_const, "1", {{ 0, 0}}, 0, "1" },
+ { CST, ins_const, ext_const, "8", {{ 0, 0}}, 0, "8" },
+ { CST, ins_const, ext_const, "16", {{ 0, 0}}, 0, "16" },
+ { CST, ins_const, ext_const, "r0", {{ 0, 0}}, 0, "r0" },
+ { CST, ins_const, ext_const, "ip", {{ 0, 0}}, 0, "ip" },
+ { CST, ins_const, ext_const, "pr", {{ 0, 0}}, 0, "pr" },
+ { CST, ins_const, ext_const, "pr.rot", {{ 0, 0}}, 0, "pr.rot" },
+ { CST, ins_const, ext_const, "psr", {{ 0, 0}}, 0, "psr" },
+ { CST, ins_const, ext_const, "psr.l", {{ 0, 0}}, 0, "psr.l" },
+ { CST, ins_const, ext_const, "psr.um", {{ 0, 0}}, 0, "psr.um" },
+
+ /* register operands: */
+ { REG, ins_reg, ext_reg, "ar", {{ 7, 20}}, 0, /* AR3 */
+ "an application register" },
+ { REG, ins_reg, ext_reg, "b", {{ 3, 6}}, 0, /* B1 */
+ "a branch register" },
+ { REG, ins_reg, ext_reg, "b", {{ 3, 13}}, 0, /* B2 */
+ "a branch register"},
+ { REG, ins_reg, ext_reg, "cr", {{ 7, 20}}, 0, /* CR */
+ "a control register"},
+ { REG, ins_reg, ext_reg, "f", {{ 7, 6}}, 0, /* F1 */
+ "a floating-point register" },
+ { REG, ins_reg, ext_reg, "f", {{ 7, 13}}, 0, /* F2 */
+ "a floating-point register" },
+ { REG, ins_reg, ext_reg, "f", {{ 7, 20}}, 0, /* F3 */
+ "a floating-point register" },
+ { REG, ins_reg, ext_reg, "f", {{ 7, 27}}, 0, /* F4 */
+ "a floating-point register" },
+ { REG, ins_reg, ext_reg, "p", {{ 6, 6}}, 0, /* P1 */
+ "a predicate register" },
+ { REG, ins_reg, ext_reg, "p", {{ 6, 27}}, 0, /* P2 */
+ "a predicate register" },
+ { REG, ins_reg, ext_reg, "r", {{ 7, 6}}, 0, /* R1 */
+ "a general register" },
+ { REG, ins_reg, ext_reg, "r", {{ 7, 13}}, 0, /* R2 */
+ "a general register" },
+ { REG, ins_reg, ext_reg, "r", {{ 7, 20}}, 0, /* R3 */
+ "a general register" },
+ { REG, ins_reg, ext_reg, "r", {{ 2, 20}}, 0, /* R3_2 */
+ "a general register r0-r3" },
+
+ /* indirect operands: */
+ { IND, ins_reg, ext_reg, "cpuid", {{7, 20}}, 0, /* CPUID_R3 */
+ "a cpuid register" },
+ { IND, ins_reg, ext_reg, "dbr", {{7, 20}}, 0, /* DBR_R3 */
+ "a dbr register" },
+ { IND, ins_reg, ext_reg, "dtr", {{7, 20}}, 0, /* DTR_R3 */
+ "a dtr register" },
+ { IND, ins_reg, ext_reg, "itr", {{7, 20}}, 0, /* ITR_R3 */
+ "an itr register" },
+ { IND, ins_reg, ext_reg, "ibr", {{7, 20}}, 0, /* IBR_R3 */
+ "an ibr register" },
+ { IND, ins_reg, ext_reg, "", {{7, 20}}, 0, /* MR3 */
+ "an indirect memory address" },
+ { IND, ins_reg, ext_reg, "msr", {{7, 20}}, 0, /* MSR_R3 */
+ "an msr register" },
+ { IND, ins_reg, ext_reg, "pkr", {{7, 20}}, 0, /* PKR_R3 */
+ "a pkr register" },
+ { IND, ins_reg, ext_reg, "pmc", {{7, 20}}, 0, /* PMC_R3 */
+ "a pmc register" },
+ { IND, ins_reg, ext_reg, "pmd", {{7, 20}}, 0, /* PMD_R3 */
+ "a pmd register" },
+ { IND, ins_reg, ext_reg, "rr", {{7, 20}}, 0, /* RR_R3 */
+ "an rr register" },
+
+ /* immediate operands: */
+ { ABS, ins_cimmu, ext_cimmu, 0, {{ 5, 20 }}, UDEC, /* CCNT5 */
+ "a 5-bit count (0-31)" },
+ { ABS, ins_cnt, ext_cnt, 0, {{ 2, 27 }}, UDEC, /* CNT2a */
+ "a 2-bit count (1-4)" },
+ { ABS, ins_cnt2b, ext_cnt2b, 0, {{ 2, 27 }}, UDEC, /* CNT2b */
+ "a 2-bit count (1-3)" },
+ { ABS, ins_cnt2c, ext_cnt2c, 0, {{ 2, 30 }}, UDEC, /* CNT2c */
+ "a count (0, 7, 15, or 16)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 5, 14}}, UDEC, /* CNT5 */
+ "a 5-bit count (0-31)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 6, 27}}, UDEC, /* CNT6 */
+ "a 6-bit count (0-63)" },
+ { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 20}}, UDEC, /* CPOS6a */
+ "a 6-bit bit pos (0-63)" },
+ { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 14}}, UDEC, /* CPOS6b */
+ "a 6-bit bit pos (0-63)" },
+ { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 31}}, UDEC, /* CPOS6c */
+ "a 6-bit bit pos (0-63)" },
+ { ABS, ins_imms, ext_imms, 0, {{ 1, 36}}, SDEC, /* IMM1 */
+ "a 1-bit integer (-1, 0)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 2, 13}}, UDEC, /* IMMU2 */
+ "a 2-bit unsigned (0-3)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, 0, /* IMMU7a */
+ "a 7-bit unsigned (0-127)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, 0, /* IMMU7b */
+ "a 7-bit unsigned (0-127)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, UDEC, /* SOF */
+ "a frame size (register count)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, UDEC, /* SOL */
+ "a local register count" },
+ { ABS, ins_immus8,ext_immus8,0, {{ 4, 27}}, UDEC, /* SOR */
+ "a rotating register count (integer multiple of 8)" },
+ { ABS, ins_imms, ext_imms, 0, /* IMM8 */
+ {{ 7, 13}, { 1, 36}}, SDEC,
+ "an 8-bit integer (-128-127)" },
+ { ABS, ins_immsu4, ext_imms, 0, /* IMM8U4 */
+ {{ 7, 13}, { 1, 36}}, SDEC,
+ "an 8-bit signed integer for 32-bit unsigned compare (-128-127)" },
+ { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1 */
+ {{ 7, 13}, { 1, 36}}, SDEC,
+ "an 8-bit integer (-127-128)" },
+ { ABS, ins_immsm1u4, ext_immsm1, 0, /* IMM8M1U4 */
+ {{ 7, 13}, { 1, 36}}, SDEC,
+ "an 8-bit integer for 32-bit unsigned compare (-127-(-1),1-128,0x100000000)" },
+ { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1U8 */
+ {{ 7, 13}, { 1, 36}}, SDEC,
+ "an 8-bit integer for 64-bit unsigned compare (-127-(-1),1-128,0x10000000000000000)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 2, 33}, { 7, 20}}, 0, /* IMMU9 */
+ "a 9-bit unsigned (0-511)" },
+ { ABS, ins_imms, ext_imms, 0, /* IMM9a */
+ {{ 7, 6}, { 1, 27}, { 1, 36}}, SDEC,
+ "a 9-bit integer (-256-255)" },
+ { ABS, ins_imms, ext_imms, 0, /* IMM9b */
+ {{ 7, 13}, { 1, 27}, { 1, 36}}, SDEC,
+ "a 9-bit integer (-256-255)" },
+ { ABS, ins_imms, ext_imms, 0, /* IMM14 */
+ {{ 7, 13}, { 6, 27}, { 1, 36}}, SDEC,
+ "a 14-bit integer (-8192-8191)" },
+ { ABS, ins_imms1, ext_imms1, 0, /* IMM17 */
+ {{ 7, 6}, { 8, 24}, { 1, 36}}, 0,
+ "a 17-bit integer (-65536-65535)" },
+ { ABS, ins_immu, ext_immu, 0, {{20, 6}, { 1, 36}}, 0, /* IMMU21 */
+ "a 21-bit unsigned" },
+ { ABS, ins_imms, ext_imms, 0, /* IMM22 */
+ {{ 7, 13}, { 9, 27}, { 5, 22}, { 1, 36}}, SDEC,
+ "a 22-bit signed integer" },
+ { ABS, ins_immu, ext_immu, 0, /* IMMU24 */
+ {{21, 6}, { 2, 31}, { 1, 36}}, 0,
+ "a 24-bit unsigned" },
+ { ABS, ins_imms16,ext_imms16,0, {{27, 6}, { 1, 36}}, 0, /* IMM44 */
+ "a 44-bit unsigned (least 16 bits ignored/zeroes)" },
+ { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU62 */
+ "a 62-bit unsigned" },
+ { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU64 */
+ "a 64-bit unsigned" },
+ { ABS, ins_inc3, ext_inc3, 0, {{ 3, 13}}, SDEC, /* INC3 */
+ "an increment (+/- 1, 4, 8, or 16)" },
+ { ABS, ins_cnt, ext_cnt, 0, {{ 4, 27}}, UDEC, /* LEN4 */
+ "a 4-bit length (1-16)" },
+ { ABS, ins_cnt, ext_cnt, 0, {{ 6, 27}}, UDEC, /* LEN6 */
+ "a 6-bit length (1-64)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 4, 20}}, 0, /* MBTYPE4 */
+ "a mix type (@rev, @mix, @shuf, @alt, or @brcst)" },
+ { ABS, ins_immu, ext_immu, 0, {{ 8, 20}}, 0, /* MBTYPE8 */
+ "an 8-bit mix type" },
+ { ABS, ins_immu, ext_immu, 0, {{ 6, 14}}, UDEC, /* POS6 */
+ "a 6-bit bit pos (0-63)" },
+ { REL, ins_imms4, ext_imms4, 0, {{ 7, 6}, { 2, 33}}, 0, /* TAG13 */
+ "a branch tag" },
+ { REL, ins_imms4, ext_imms4, 0, {{ 9, 24}}, 0, /* TAG13b */
+ "a branch tag" },
+ { REL, ins_imms4, ext_imms4, 0, {{20, 6}, { 1, 36}}, 0, /* TGT25 */
+ "a branch target" },
+ { REL, ins_imms4, ext_imms4, 0, /* TGT25b */
+ {{ 7, 6}, {13, 20}, { 1, 36}}, 0,
+ "a branch target" },
+ { REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0, /* TGT25c */
+ "a branch target" },
+ { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */
+ "a branch target" },
+ };
diff --git a/gnu/usr.bin/binutils/bfd/cpu-ia64.c b/gnu/usr.bin/binutils/bfd/cpu-ia64.c
new file mode 100644
index 00000000000..1f36568dfa6
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/cpu-ia64.c
@@ -0,0 +1,57 @@
+/* BFD support for the ia64 architecture.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_ia64_elf32_arch =
+ {
+ 64, /* 64 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_ia64,
+ bfd_mach_ia64_elf32,
+ "ia64",
+ "ia64-elf32",
+ 3, /* log2 of section alignment */
+ true, /* the one and only */
+ bfd_default_compatible,
+ bfd_default_scan ,
+ 0,
+ };
+
+const bfd_arch_info_type bfd_ia64_arch =
+ {
+ 64, /* 64 bits in a word */
+ 64, /* 64 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_ia64,
+ bfd_mach_ia64_elf64,
+ "ia64",
+ "ia64-elf64",
+ 3, /* log2 of section alignment */
+ true, /* the one and only */
+ bfd_default_compatible,
+ bfd_default_scan ,
+ &bfd_ia64_elf32_arch,
+ };
+
+#include "cpu-ia64-opc.c"
diff --git a/gnu/usr.bin/binutils/bfd/cpu-m10300.c b/gnu/usr.bin/binutils/bfd/cpu-m10300.c
index c14428edc67..4add3c1aa42 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-m10300.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-m10300.c
@@ -1,5 +1,5 @@
/* BFD support for the Matsushita 10300 processor
- Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/gnu/usr.bin/binutils/bfd/cpu-m32r.c b/gnu/usr.bin/binutils/bfd/cpu-m32r.c
index 895ad413b26..c28b7da41eb 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-m32r.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-m32r.c
@@ -1,5 +1,5 @@
/* BFD support for the M32R processor.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define NEXT NULL
-static const bfd_arch_info_type arch_info_struct[] =
+static const bfd_arch_info_type arch_info_struct[] =
{
N (bfd_mach_m32rx, "m32rx", false, NULL)
};
diff --git a/gnu/usr.bin/binutils/bfd/cpu-m68hc11.c b/gnu/usr.bin/binutils/bfd/cpu-m68hc11.c
new file mode 100644
index 00000000000..12329ebde1c
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/cpu-m68hc11.c
@@ -0,0 +1,38 @@
+/* BFD support for the Motorola 68HC11 processor
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_m68hc11_arch =
+{
+ 16, /* 16 bits in a word */
+ 16, /* 16 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_m68hc11,
+ 0,
+ "m68hc11",
+ "m68hc11",
+ 4, /* section alignment power */
+ true,
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0,
+};
diff --git a/gnu/usr.bin/binutils/bfd/cpu-m68hc12.c b/gnu/usr.bin/binutils/bfd/cpu-m68hc12.c
new file mode 100644
index 00000000000..1810438b291
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/cpu-m68hc12.c
@@ -0,0 +1,38 @@
+/* BFD support for the Motorola 68HC12 processor
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_m68hc12_arch =
+{
+ 16, /* 16 bits in a word */
+ 16, /* 16 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_m68hc12,
+ 0,
+ "m68hc12",
+ "m68hc12",
+ 4, /* section alignment power */
+ true,
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0,
+};
diff --git a/gnu/usr.bin/binutils/bfd/cpu-mcore.c b/gnu/usr.bin/binutils/bfd/cpu-mcore.c
index 760bcde7ae1..624f2723c29 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-mcore.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-mcore.c
@@ -1,5 +1,5 @@
/* BFD library support routines for Motorola's MCore architecture
- Copyright (C) 1993, 1999 Free Software Foundation, Inc.
+ Copyright 1993, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/gnu/usr.bin/binutils/bfd/cpu-pj.c b/gnu/usr.bin/binutils/bfd/cpu-pj.c
index 44ddd332602..0687e4a4bd7 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-pj.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-pj.c
@@ -1,5 +1,5 @@
/* BFD library support routines for the Pico Java architecture.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Transmeta. sac@pobox.com
This file is part of BFD, the Binary File Descriptor library.
@@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
-
-static boolean
+static boolean
scan_mach (info, string)
const struct bfd_arch_info *info;
const char *string;
@@ -33,7 +32,6 @@ scan_mach (info, string)
return false;
}
-
#if 0
/* This routine is provided two arch_infos and returns whether
they'd be compatible */
@@ -49,8 +47,7 @@ compatible (a,b)
}
#endif
-
-static const bfd_arch_info_type arch_info_struct[] =
+static const bfd_arch_info_type arch_info_struct[] =
{
{
32, /* 32 bits in a word */
diff --git a/gnu/usr.bin/binutils/bfd/cpu-tic54x.c b/gnu/usr.bin/binutils/bfd/cpu-tic54x.c
new file mode 100644
index 00000000000..12f5029f219
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/cpu-tic54x.c
@@ -0,0 +1,39 @@
+/* BFD support for the Texas Instruments TMS320C54X architecture.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_tic54x_arch =
+{
+ 16, /* 16 bits in a word */
+ 16, /* 16 bits in an address (except '548) */
+ 16, /* 16 bits in a byte */
+ bfd_arch_tic54x,
+ 0, /* only 1 machine */
+ "tic54x",
+ "tms320c54x",
+ 1,
+ true, /* the one and only */
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0,
+};
diff --git a/gnu/usr.bin/binutils/bfd/cpu-tic80.c b/gnu/usr.bin/binutils/bfd/cpu-tic80.c
index 302866ece9d..8e7af21f883 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-tic80.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-tic80.c
@@ -1,5 +1,5 @@
/* bfd back-end for TI TMS320C80 (MVP) support
- Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+ Copyright 1996 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus support (fnf@cygnus.com)
This file is part of BFD, the Binary File Descriptor library.
diff --git a/gnu/usr.bin/binutils/bfd/cpu-v850.c b/gnu/usr.bin/binutils/bfd/cpu-v850.c
index 539413de022..5eb5b742ad9 100644
--- a/gnu/usr.bin/binutils/bfd/cpu-v850.c
+++ b/gnu/usr.bin/binutils/bfd/cpu-v850.c
@@ -1,5 +1,5 @@
/* BFD support for the NEC V850 processor
- Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -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/gnu/usr.bin/binutils/bfd/doc/aoutx.texi b/gnu/usr.bin/binutils/bfd/doc/aoutx.texi
index d97e96aeb79..d99fd054233 100644
--- a/gnu/usr.bin/binutils/bfd/doc/aoutx.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/archures.texi b/gnu/usr.bin/binutils/bfd/doc/archures.texi
index 6ee20e971cf..5924e7b996c 100644
--- a/gnu/usr.bin/binutils/bfd/doc/archures.texi
+++ b/gnu/usr.bin/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,18 @@ 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
+#define bfd_mach_mcf5200 9
+#define bfd_mach_mcf5206e 10
+#define bfd_mach_mcf5307 11
+#define bfd_mach_mcf5407 12
+ bfd_arch_vax, /* DEC Vax */
+ bfd_arch_i960, /* Intel 960 */
+ /* The order of the following is important.
+ 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 +69,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
@@ -94,37 +101,68 @@ enum bfd_architecture
#define bfd_mach_mips6000 6000
#define bfd_mach_mips8000 8000
#define bfd_mach_mips10000 10000
+#define bfd_mach_mips12000 12000
#define bfd_mach_mips16 16
- 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 +170,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 +183,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 +232,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 +242,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 +429,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 +453,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/gnu/usr.bin/binutils/bfd/doc/bfdint.texi b/gnu/usr.bin/binutils/bfd/doc/bfdint.texi
index 54633be01c4..5aa8ed376f8 100644
--- a/gnu/usr.bin/binutils/bfd/doc/bfdint.texi
+++ b/gnu/usr.bin/binutils/bfd/doc/bfdint.texi
@@ -1,4 +1,7 @@
\input texinfo
+@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
+@c 2000
+@c Free Software Foundation, Inc.
@setfilename bfdint.info
@settitle BFD Internals
@@ -18,8 +21,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/09/12 14:46:00 $.
+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}.
@@ -294,7 +296,7 @@ The target vector starts with a set of constants.
@item name
The name of the target vector. This is an arbitrary string. This is
how the target vector is named in command line options for tools which
-use BFD, such as the @samp{-oformat} linker option.
+use BFD, such as the @samp{--oformat} linker option.
@item flavour
A general description of the type of target. The following flavours are
@@ -1607,6 +1609,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/gnu/usr.bin/binutils/bfd/doc/bfdt.texi b/gnu/usr.bin/binutils/bfd/doc/bfdt.texi
index 98269fb6c6a..b9e6fb79bfe 100644
--- a/gnu/usr.bin/binutils/bfd/doc/bfdt.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/cache.texi b/gnu/usr.bin/binutils/bfd/doc/cache.texi
index 4aafb69ca7a..56d1f185c9f 100644
--- a/gnu/usr.bin/binutils/bfd/doc/cache.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/coffcode.texi b/gnu/usr.bin/binutils/bfd/doc/coffcode.texi
index fcb7e757881..8406a04f80e 100644
--- a/gnu/usr.bin/binutils/bfd/doc/coffcode.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/format.texi b/gnu/usr.bin/binutils/bfd/doc/format.texi
index 3281c36eac8..a181d1cd231 100644
--- a/gnu/usr.bin/binutils/bfd/doc/format.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/hash.texi b/gnu/usr.bin/binutils/bfd/doc/hash.texi
index 7ddc900cd2e..eb87273eceb 100644
--- a/gnu/usr.bin/binutils/bfd/doc/hash.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/libbfd.texi b/gnu/usr.bin/binutils/bfd/doc/libbfd.texi
index d202dc208db..b4b0a1470dc 100644
--- a/gnu/usr.bin/binutils/bfd/doc/libbfd.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/linker.texi b/gnu/usr.bin/binutils/bfd/doc/linker.texi
index b61815643f7..5105cc77fb3 100644
--- a/gnu/usr.bin/binutils/bfd/doc/linker.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/reloc.texi b/gnu/usr.bin/binutils/bfd/doc/reloc.texi
index 89811d81186..52fa2bd663a 100644
--- a/gnu/usr.bin/binutils/bfd/doc/reloc.texi
+++ b/gnu/usr.bin/binutils/bfd/doc/reloc.texi
@@ -599,7 +599,9 @@ Reloc types used for i960/b.out.
@deffnx {} BFD_RELOC_SPARC_GLOB_DAT
@deffnx {} BFD_RELOC_SPARC_JMP_SLOT
@deffnx {} BFD_RELOC_SPARC_RELATIVE
+@deffnx {} BFD_RELOC_SPARC_UA16
@deffnx {} BFD_RELOC_SPARC_UA32
+@deffnx {} BFD_RELOC_SPARC_UA64
SPARC ELF relocations. There is probably some overlap with other
relocation types already defined.
@end deffn
@@ -752,6 +754,17 @@ Relocation against a MIPS literal section.
@deffnx {} BFD_RELOC_MIPS_GOT_PAGE
@deffnx {} BFD_RELOC_MIPS_GOT_OFST
@deffnx {} BFD_RELOC_MIPS_GOT_DISP
+@deffnx {} BFD_RELOC_MIPS_SHIFT5
+@deffnx {} BFD_RELOC_MIPS_SHIFT6
+@deffnx {} BFD_RELOC_MIPS_INSERT_A
+@deffnx {} BFD_RELOC_MIPS_INSERT_B
+@deffnx {} BFD_RELOC_MIPS_DELETE
+@deffnx {} BFD_RELOC_MIPS_HIGHEST
+@deffnx {} BFD_RELOC_MIPS_HIGHER
+@deffnx {} BFD_RELOC_MIPS_SCN_DISP
+@deffnx {} BFD_RELOC_MIPS_REL16
+@deffnx {} BFD_RELOC_MIPS_RELGOT
+@deffnx {} BFD_RELOC_MIPS_JALR
MIPS ELF relocations.
@end deffn
@deffn {} BFD_RELOC_386_GOT32
@@ -764,6 +777,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 +853,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 +910,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 +926,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 +1100,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 +1250,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/gnu/usr.bin/binutils/bfd/doc/section.texi b/gnu/usr.bin/binutils/bfd/doc/section.texi
index 25695900573..0167defc605 100644
--- a/gnu/usr.bin/binutils/bfd/doc/section.texi
+++ b/gnu/usr.bin/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,366 @@ 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;
+ /* Another mark flag used by some of the linker backends. Set for
+ output sections that have a input section. */
+ unsigned int linker_has_input : 1;
- /* A mark flag used by some linker backends for garbage collection. */
- unsigned int gc_mark : 1;
+ /* A mark flag used by some linker backends for garbage collection. */
+ unsigned int gc_mark : 1;
- /* End of internal packed boolean fields. */
+ /* Used by the ELF code to mark sections which have been allocated to segments. */
+ unsigned int segment_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 @code{a.out}, where
- the default address for @code{.data} is dependent on the specific
- target and various flags). */
+ /* End of internal packed boolean fields. */
- bfd_vma vma;
+ /* 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 load address of the section - where it would be in a
- rom image; really only used for writing section header
- information. */
+ bfd_vma vma;
- bfd_vma lma;
+ /* The load address of the section - where it would be in a
+ rom image; really only used for writing section header
+ information. */
- /* 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_vma lma;
- bfd_size_type _cooked_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 @code{.bss}). This will be filled in after relocation. */
- /* 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 _cooked_size;
- bfd_size_type _raw_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. */
- /* 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 _raw_size;
- bfd_vma output_offset;
+ /* 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 output section through which to map on output. */
+ bfd_vma output_offset;
- struct sec *output_section;
+ /* The output section through which to map on output. */
- /* The alignment requirement of the section, as an exponent of 2 -
- e.g., 3 aligns to 2^3 (or 8). */
+ struct sec *output_section;
- unsigned int alignment_power;
+ /* The alignment requirement of the section, as an exponent of 2 -
+ e.g., 3 aligns to 2^3 (or 8). */
- /* If an input section, a pointer to a vector of relocation
- records for the data in this section. */
+ unsigned int alignment_power;
- struct reloc_cache_entry *relocation;
+ /* If an input section, a pointer to a vector of 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 *relocation;
- struct reloc_cache_entry **orelocation;
+ /* If an output section, a pointer to a vector of pointers to
+ relocation records for the data in this section. */
- /* The number of relocation records in one of the above */
+ struct reloc_cache_entry **orelocation;
- unsigned reloc_count;
+ /* The number of relocation records in one of the above */
- /* Information below is back end specific - and not always used
- or updated. */
+ unsigned reloc_count;
- /* File position of section data */
+ /* Information below is back end specific - and not always used
+ or updated. */
- file_ptr filepos;
+ /* File position of section data. */
- /* File position of relocation info */
+ file_ptr filepos;
- file_ptr rel_filepos;
+ /* File position of relocation info. */
- /* File position of line data */
+ file_ptr rel_filepos;
- file_ptr line_filepos;
+ /* File position of line data. */
- /* Pointer to data for applications */
+ file_ptr line_filepos;
- PTR userdata;
+ /* Pointer to data for applications. */
- /* If the SEC_IN_MEMORY flag is set, this points to the actual
- contents. */
- unsigned char *contents;
+ PTR userdata;
- /* Attached line number information */
+ /* If the SEC_IN_MEMORY flag is set, this points to the actual
+ contents. */
+ unsigned char *contents;
- alent *lineno;
+ /* Attached line number information. */
- /* Number of line number records */
+ alent *lineno;
- unsigned int lineno_count;
+ /* Number of line number records. */
- /* Optional information about a COMDAT entry; NULL if not COMDAT */
+ unsigned int lineno_count;
- struct bfd_comdat_info *comdat;
+ /* Optional information about a COMDAT entry; NULL if not COMDAT. */
- /* When a section is being output, this value changes as more
- linenumbers are written out */
+ struct bfd_comdat_info *comdat;
- file_ptr moving_line_filepos;
+ /* Points to the kept section if this section is a link-once section,
+ and is discarded. */
+ struct sec *kept_section;
- /* What the section number is in the target world */
+ /* When a section is being output, this value changes as more
+ linenumbers are written out. */
- int target_index;
+ file_ptr moving_line_filepos;
- PTR used_by_bfd;
+ /* What the section number is in the target world. */
- /* If this is a constructor section then here is a list of the
- relocations created to relocate items within it. */
+ int target_index;
- struct relent_chain *constructor_chain;
+ PTR used_by_bfd;
- /* The BFD which owns the section. */
+ /* If this is a constructor section then here is a list of the
+ relocations created to relocate items within it. */
- bfd *owner;
+ struct relent_chain *constructor_chain;
- /* A symbol which points at this section only */
- struct symbol_cache_entry *symbol;
- struct symbol_cache_entry **symbol_ptr_ptr;
+ /* The BFD which owns the section. */
- struct bfd_link_order *link_order_head;
- struct bfd_link_order *link_order_tail;
+ 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)
@@ -480,7 +506,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 +518,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 +564,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 +584,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 +617,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/gnu/usr.bin/binutils/bfd/doc/syms.texi b/gnu/usr.bin/binutils/bfd/doc/syms.texi
index 74c151b1195..400a10640d2 100644
--- a/gnu/usr.bin/binutils/bfd/doc/syms.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/doc/targets.texi b/gnu/usr.bin/binutils/bfd/doc/targets.texi
index 50086c4d825..0526fafc053 100644
--- a/gnu/usr.bin/binutils/bfd/doc/targets.texi
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/dwarf1.c b/gnu/usr.bin/binutils/bfd/dwarf1.c
index da184cc7058..2fef2ef5189 100644
--- a/gnu/usr.bin/binutils/bfd/dwarf1.c
+++ b/gnu/usr.bin/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,
@@ -467,36 +458,35 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
struct dwarf1_unit* eachUnit;
/* What address are we looking for? */
- bfd_vma addr = offset + section->vma;
+ unsigned long addr = (unsigned long)(offset + section->vma);
*filename_ptr = NULL;
*functionname_ptr = NULL;
*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/gnu/usr.bin/binutils/bfd/dwarf2.c b/gnu/usr.bin/binutils/bfd/dwarf2.c
index b6de2612189..4a032732c98 100644
--- a/gnu/usr.bin/binutils/bfd/dwarf2.c
+++ b/gnu/usr.bin/binutils/bfd/dwarf2.c
@@ -1,5 +1,6 @@
/* DWARF 2 support.
- Copyright 1994, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com).
@@ -36,36 +37,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 +76,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 +195,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 +215,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 +261,7 @@ read_string (abfd, buf, bytes_read_ptr)
*bytes_read_ptr = 1;
return NULL;
}
+
*bytes_read_ptr = strlen (buf) + 1;
return buf;
}
@@ -280,7 +280,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 +290,9 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
shift += 7;
}
while (byte & 0x80);
-
+
* bytes_read_ptr = num_read;
-
+
return result;
}
@@ -320,12 +320,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 +349,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 +393,7 @@ lookup_abbrev (number,abbrevs)
else
abbrev = abbrev->next;
}
+
return NULL;
}
@@ -406,18 +403,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,49 +425,50 @@ 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;
}
- if (offset > stash->dwarf_abbrev_size)
+ if (offset >= stash->dwarf_abbrev_size)
{
- (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)."),
+ (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) greater than or equal to abbrev size (%u)."),
offset, stash->dwarf_abbrev_size );
bfd_set_error (bfd_error_bad_value);
return 0;
}
- 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 +480,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 +527,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 +629,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 +685,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 +700,7 @@ concat_filename (table, file)
}
filename = table->files[file - 1].name;
- if (*filename == '/')
+ if (IS_ABSOLUTE_PATH(filename))
return filename;
else
@@ -723,8 +720,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 +741,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 +757,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 +773,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 +784,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) greater than or equal to 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 +826,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 +848,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 +868,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 +888,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 +901,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 +917,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 +1023,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 +1043,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 +1059,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 +1077,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 +1113,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 +1146,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 +1164,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 +1205,7 @@ scan_unit_for_functions (unit)
case DW_AT_name:
name = DW_STRING (&attr);
break;
-
+
default:
break;
}
@@ -1217,11 +1219,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 +1230,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 +1247,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 +1286,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 +1309,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 +1366,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 +1386,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 +1422,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 +1440,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 +1495,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 +1504,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 +1531,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 +1629,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 +1641,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 +1667,3 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
return false;
}
-
-/* end of file */
diff --git a/gnu/usr.bin/binutils/bfd/efi-app-ia32.c b/gnu/usr.bin/binutils/bfd/efi-app-ia32.c
new file mode 100644
index 00000000000..8519f99a0ba
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/efi-app-ia32.c
@@ -0,0 +1,34 @@
+/* BFD back-end for Intel IA-32 EFI application files.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Contributed by David Mosberger <davidm@hpl.hp.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+
+#define TARGET_SYM bfd_efi_app_ia32_vec
+#define TARGET_NAME "efi-app-ia32"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define PCRELOFFSET true
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-i386.c"
diff --git a/gnu/usr.bin/binutils/bfd/efi-app-ia64.c b/gnu/usr.bin/binutils/bfd/efi-app-ia64.c
new file mode 100644
index 00000000000..61045682ee8
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/efi-app-ia64.c
@@ -0,0 +1,35 @@
+/* BFD back-end for HP/Intel IA-64 EFI application files.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by David Mosberger <davidm@hpl.hp.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+
+#define TARGET_SYM bfd_efi_app_ia64_vec
+#define TARGET_NAME "efi-app-ia64"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define COFF_WITH_pep
+#define PCRELOFFSET true
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-ia64.c"
diff --git a/gnu/usr.bin/binutils/bfd/elf-hppa.h b/gnu/usr.bin/binutils/bfd/elf-hppa.h
index 000ffea3c75..006a2c4a1fb 100644
--- a/gnu/usr.bin/binutils/bfd/elf-hppa.h
+++ b/gnu/usr.bin/binutils/bfd/elf-hppa.h
@@ -1,5 +1,5 @@
/* Common code for PA ELF implementations.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if ARCH_SIZE == 64
#define ELF_R_TYPE(X) ELF64_R_TYPE(X)
#define ELF_R_SYM(X) ELF64_R_SYM(X)
+#define elf_hppa_internal_shdr Elf64_Internal_Shdr
#define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
#define elf_hppa_relocate_section elf64_hppa_relocate_section
#define bfd_elf_bfd_final_link bfd_elf64_bfd_final_link
@@ -36,33 +37,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if ARCH_SIZE == 32
#define ELF_R_TYPE(X) ELF32_R_TYPE(X)
#define ELF_R_SYM(X) ELF32_R_SYM(X)
+#define elf_hppa_internal_shdr Elf32_Internal_Shdr
#define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
#define elf_hppa_relocate_section elf32_hppa_relocate_section
#define bfd_elf_bfd_final_link bfd_elf32_bfd_final_link
#define elf_hppa_final_link elf32_hppa_final_link
#endif
-static boolean
-elf_hppa_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+elf_hppa_reloc_type ** _bfd_elf_hppa_gen_reloc_type
+ PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
-static bfd_reloc_status_type elf_hppa_final_link_relocate
- PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *,
- bfd_byte *, bfd_vma, struct bfd_link_info *,
- asection *, struct elf_link_hash_entry *,
- struct elf64_hppa_dyn_hash_entry *));
+static void elf_hppa_info_to_howto
+ PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+
+static void elf_hppa_info_to_howto_rel
+ PARAMS ((bfd *, arelent *, Elf_Internal_Rel *));
+
+static reloc_howto_type * elf_hppa_reloc_type_lookup
+ PARAMS ((bfd *, bfd_reloc_code_real_type));
-static unsigned long elf_hppa_relocate_insn
- PARAMS ((unsigned long, long, unsigned long));
+static boolean elf_hppa_is_local_label_name
+ PARAMS ((bfd *, const char *));
+static boolean elf_hppa_fake_sections
+ PARAMS ((bfd *abfd, elf_hppa_internal_shdr *, asection *));
+
+static void elf_hppa_final_write_processing
+ PARAMS ((bfd *, boolean));
+
+#if ARCH_SIZE == 64
static boolean elf_hppa_add_symbol_hook
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *));
-static boolean elf_hppa_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-
static boolean elf_hppa_unmark_useless_dynamic_symbols
PARAMS ((struct elf_link_hash_entry *, PTR));
@@ -72,268 +79,527 @@ static boolean elf_hppa_remark_useless_dynamic_symbols
static void elf_hppa_record_segment_addrs
PARAMS ((bfd *, asection *, PTR));
+static boolean elf_hppa_final_link
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean elf_hppa_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
+ bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+
+static bfd_reloc_status_type elf_hppa_final_link_relocate
+ PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *,
+ bfd_byte *, bfd_vma, struct bfd_link_info *,
+ asection *, struct elf_link_hash_entry *,
+ struct elf64_hppa_dyn_hash_entry *));
+
+static unsigned int elf_hppa_relocate_insn
+ PARAMS ((unsigned int, unsigned int, unsigned int));
+#endif
+
/* ELF/PA relocation howto entries. */
static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
{
- {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"},
+ { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false },
/* The values in DIR32 are to placate the check in
_bfd_stab_section_find_nearest_line. */
- {R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false},
- {R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR21L"},
- {R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17R"},
- {R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17F"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14R"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL32"},
-
- {R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL21L"},
- {R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17R"},
- {R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17F"},
- {R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17C"},
- {R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14R"},
- {R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14F"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL21L"},
- {R_PARISC_DPREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14WR"},
-
- {R_PARISC_DPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14DR"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14R"},
- {R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14F"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL21L"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14R"},
- {R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14F"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND21L"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14R"},
- {R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14F"},
-
- {R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SETBASE"},
- {R_PARISC_SECREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SECREL32"},
- {R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL21L"},
- {R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17R"},
- {R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17F"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14R"},
- {R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14F"},
- {R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGBASE"},
- {R_PARISC_SEGREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL32"},
-
- {R_PARISC_PLTOFF21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_PLTOFF14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R"},
- {R_PARISC_PLTOFF14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_LTOFF_FPTR32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32"},
- {R_PARISC_LTOFF_FPTR21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_LTOFF_FPTR14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_FPTR64"},
- {R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL32"},
- {R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL21L"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL14R"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_PCREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL64"},
- {R_PARISC_PCREL22C, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22C"},
- {R_PARISC_PCREL22F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22F"},
- {R_PARISC_PCREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14WR"},
- {R_PARISC_PCREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14DR"},
- {R_PARISC_PCREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16F"},
- {R_PARISC_PCREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16WF"},
- {R_PARISC_PCREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16DF"},
-
- {R_PARISC_DIR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR64"},
- {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"},
- {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"},
- {R_PARISC_DIR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14WR"},
- {R_PARISC_DIR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14DR"},
- {R_PARISC_DIR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16F"},
- {R_PARISC_DIR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16WF"},
- {R_PARISC_DIR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16DF"},
- {R_PARISC_GPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL64"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DLTREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR"},
- {R_PARISC_DLTREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR"},
- {R_PARISC_GPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16F"},
- {R_PARISC_GPREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16WF"},
- {R_PARISC_GPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16DF"},
- {R_PARISC_LTOFF64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF64"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_DLTIND14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR"},
-
- {R_PARISC_DLTIND14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR"},
- {R_PARISC_LTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16F"},
- {R_PARISC_LTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF"},
- {R_PARISC_LTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_BASEREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BSEREL14WR"},
- {R_PARISC_BASEREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_SEGREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL64"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_PLTOFF14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR"},
- {R_PARISC_PLTOFF14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR"},
- {R_PARISC_PLTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F"},
- {R_PARISC_PLTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF"},
- {R_PARISC_PLTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF"},
-
- {R_PARISC_LTOFF_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_LTOFF_FPTR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR"},
- {R_PARISC_LTOFF_FPTR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR"},
- {R_PARISC_LTOFF_FPTR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F"},
- {R_PARISC_LTOFF_FPTR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF"},
- {R_PARISC_LTOFF_FPTR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_COPY"},
- {R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_IPLT"},
-
- {R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_EPLT"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_TPREL32, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL32"},
- {R_PARISC_TPREL21L, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL21L"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_TPREL14R, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14R"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_LTOFF_TP21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_LTOFF_TP14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_LTOFF_TP14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
-
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_TPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL64"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_TPREL14WR, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14WR"},
-
- {R_PARISC_TPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL14DR"},
- {R_PARISC_TPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16F"},
- {R_PARISC_TPREL16WF, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL16WF"},
- {R_PARISC_TPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16DF"},
- {R_PARISC_LTOFF_TP64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"},
- {R_PARISC_LTOFF_TP14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR"},
- {R_PARISC_LTOFF_TP14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR"},
- {R_PARISC_LTOFF_TP16F, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_LTOFF_TP16F"},
-
- {R_PARISC_LTOFF_TP16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF"},
- {R_PARISC_LTOFF_TP16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF"},
+ { R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false },
+ { R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR21L", false, 0, 0, false },
+ { R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR17R", false, 0, 0, false },
+ { R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR17F", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR14R", false, 0, 0, false },
+ { R_PARISC_DIR14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR14F", false, 0, 0, false },
+ /* 8 */
+ { R_PARISC_PCREL12F, 0, 0, 12, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL12F", false, 0, 0, false },
+ { R_PARISC_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL32", false, 0, 0, false },
+ { R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL21L", false, 0, 0, false },
+ { R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL17R", false, 0, 0, false },
+ { R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL17F", false, 0, 0, false },
+ { R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL17C", false, 0, 0, false },
+ { R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL14R", false, 0, 0, false },
+ { R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL14F", false, 0, 0, false },
+ /* 16 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DPREL21L", false, 0, 0, false },
+ { R_PARISC_DPREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DPREL14WR", false, 0, 0, false },
+ { R_PARISC_DPREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DPREL14DR", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DPREL14R", false, 0, 0, false },
+ { R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DPREL14F", false, 0, 0, false },
+ /* 24 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTREL21L", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTREL14R", false, 0, 0, false },
+ { R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTREL14F", false, 0, 0, false },
+ /* 32 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTIND21L", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTIND14R", false, 0, 0, false },
+ { R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTIND14F", false, 0, 0, false },
+ /* 40 */
+ { R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_SETBASE", false, 0, 0, false },
+ { R_PARISC_SECREL32, 0, 0, 32, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_SECREL32", false, 0, 0, false },
+ { R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_BASEREL21L", false, 0, 0, false },
+ { R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_BASEREL17R", false, 0, 0, false },
+ { R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_BASEREL17F", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_BASEREL14R", false, 0, 0, false },
+ { R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_BASEREL14F", false, 0, 0, false },
+ /* 48 */
+ { R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_SEGBASE", false, 0, 0, false },
+ { R_PARISC_SEGREL32, 0, 0, 32, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_SEGREL32", false, 0, 0, false },
+ { R_PARISC_PLTOFF21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_PLTOFF14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R", false, 0, 0, false },
+ { R_PARISC_PLTOFF14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F", false, 0, 0, false },
+ /* 56 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR32, 0, 0, 32, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 64 */
+ { R_PARISC_FPTR64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_FPTR64", false, 0, 0, false },
+ { R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLABEL32", false, 0, 0, false },
+ { R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLABEL21L", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLABEL14R", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 72 */
+ { R_PARISC_PCREL64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL64", false, 0, 0, false },
+ { R_PARISC_PCREL22C, 0, 0, 22, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL22C", false, 0, 0, false },
+ { R_PARISC_PCREL22F, 0, 0, 22, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL22F", false, 0, 0, false },
+ { R_PARISC_PCREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL14WR", false, 0, 0, false },
+ { R_PARISC_PCREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL14DR", false, 0, 0, false },
+ { R_PARISC_PCREL16F, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL16F", false, 0, 0, false },
+ { R_PARISC_PCREL16WF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL16WF", false, 0, 0, false },
+ { R_PARISC_PCREL16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PCREL16DF", false, 0, 0, false },
+ /* 80 */
+ { R_PARISC_DIR64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR64", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DIR14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR14WR", false, 0, 0, false },
+ { R_PARISC_DIR14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR14DR", false, 0, 0, false },
+ { R_PARISC_DIR16F, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR16F", false, 0, 0, false },
+ { R_PARISC_DIR16WF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR16WF", false, 0, 0, false },
+ { R_PARISC_DIR16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DIR16DF", false, 0, 0, false },
+ /* 88 */
+ { R_PARISC_GPREL64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_GPREL64", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DLTREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR", false, 0, 0, false },
+ { R_PARISC_DLTREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR", false, 0, 0, false },
+ { R_PARISC_GPREL16F, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_GPREL16F", false, 0, 0, false },
+ { R_PARISC_GPREL16WF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_GPREL16WF", false, 0, 0, false },
+ { R_PARISC_GPREL16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_GPREL16DF", false, 0, 0, false },
+ /* 96 */
+ { R_PARISC_LTOFF64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF64", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_DLTIND14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR", false, 0, 0, false },
+ { R_PARISC_DLTIND14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR", false, 0, 0, false },
+ { R_PARISC_LTOFF16F, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF16F", false, 0, 0, false },
+ { R_PARISC_LTOFF16WF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false },
+ { R_PARISC_LTOFF16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false },
+ /* 104 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_BASEREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_BASEREL14WR", false, 0, 0, false },
+ { R_PARISC_BASEREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 112 */
+ { R_PARISC_SEGREL64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_SEGREL64", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_PLTOFF14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR", false, 0, 0, false },
+ { R_PARISC_PLTOFF14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR", false, 0, 0, false },
+ { R_PARISC_PLTOFF16F, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F", false, 0, 0, false },
+ { R_PARISC_PLTOFF16WF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF", false, 0, 0, false },
+ { R_PARISC_PLTOFF16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF", false, 0, 0, false },
+ /* 120 */
+ { R_PARISC_LTOFF_FPTR64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR16F, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR16WF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF", false, 0, 0, false },
+ { R_PARISC_LTOFF_FPTR16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 128 */
+ { R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_COPY", false, 0, 0, false },
+ { R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_IPLT", false, 0, 0, false },
+ { R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_EPLT", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 136 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 144 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 152 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_TPREL32, 0, 0, 32, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL32", false, 0, 0, false },
+ { R_PARISC_TPREL21L, 0, 0, 21, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL21L", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_TPREL14R, 0, 0, 14, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL14R", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 160 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP21L, 0, 0, 21, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP14R, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP14F, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F", false, 0, 0, false },
+ /* 168 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 176 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 184 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 192 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 200 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 208 */
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ /* 216 */
+ { R_PARISC_TPREL64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL64", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_TPREL14WR, 0, 0, 14, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL14WR", false, 0, 0, false },
+ { R_PARISC_TPREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL14DR", false, 0, 0, false },
+ { R_PARISC_TPREL16F, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL16F", false, 0, 0, false },
+ { R_PARISC_TPREL16WF, 0, 0, 16, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL16WF", false, 0, 0, false },
+ { R_PARISC_TPREL16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_TPREL16DF", false, 0, 0, false },
+ /* 224 */
+ { R_PARISC_LTOFF_TP64, 0, 0, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP14WR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP14DR, 0, 0, 14, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP16F, 0, 0, 16, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16F", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP16WF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF", false, 0, 0, false },
+ { R_PARISC_LTOFF_TP16DF, 0, 0, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF", false, 0, 0, false },
+ /* 232 */
+ { R_PARISC_GNU_VTENTRY, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_GNU_VTENTRY", false, 0, 0, false },
+ { R_PARISC_GNU_VTINHERIT, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_PARISC_GNU_VTINHERIT", false, 0, 0, false },
};
#define OFFSET_14R_FROM_21L 4
@@ -347,9 +613,9 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
bfd *abfd;
elf_hppa_reloc_type base_type;
int format;
- int field;
- int ignore;
- asymbol *sym;
+ unsigned int field;
+ int ignore ATTRIBUTE_UNUSED;
+ asymbol *sym ATTRIBUTE_UNUSED;
{
elf_hppa_reloc_type *finaltype;
elf_hppa_reloc_type **final_types;
@@ -390,8 +656,12 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
case 14:
switch (field)
{
+ case e_fsel:
+ final_type = R_PARISC_DIR14F;
+ break;
case e_rsel:
case e_rrsel:
+ case e_rdsel:
final_type = R_PARISC_DIR14R;
break;
case e_rtsel:
@@ -419,6 +689,7 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
break;
case e_rsel:
case e_rrsel:
+ case e_rdsel:
final_type = R_PARISC_DIR17R;
break;
default:
@@ -431,6 +702,9 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
{
case e_lsel:
case e_lrsel:
+ case e_ldsel:
+ case e_nlsel:
+ case e_nlrsel:
final_type = R_PARISC_DIR21L;
break;
case e_ltsel:
@@ -485,7 +759,6 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
}
break;
-
case R_HPPA_GOTOFF:
switch (format)
{
@@ -494,9 +767,12 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
{
case e_rsel:
case e_rrsel:
+ case e_rdsel:
+ /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32 */
final_type = base_type + OFFSET_14R_FROM_21L;
break;
case e_fsel:
+ /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32 */
final_type = base_type + OFFSET_14F_FROM_21L;
break;
default:
@@ -507,8 +783,12 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
case 21:
switch (field)
{
- case e_lrsel:
case e_lsel:
+ case e_lrsel:
+ case e_ldsel:
+ case e_nlsel:
+ case e_nlrsel:
+ /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32 */
final_type = base_type;
break;
default:
@@ -521,15 +801,28 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
}
break;
-
case R_HPPA_PCREL_CALL:
switch (format)
{
+ case 12:
+ switch (field)
+ {
+ case e_fsel:
+ final_type = R_PARISC_PCREL12F;
+ break;
+ default:
+ return NULL;
+ }
+ break;
+
case 14:
+ /* Contrary to appearances, these are not calls of any sort.
+ Rather, they are loads/stores with a pcrel reloc. */
switch (field)
{
case e_rsel:
case e_rrsel:
+ case e_rdsel:
final_type = R_PARISC_PCREL14R;
break;
case e_fsel:
@@ -545,6 +838,7 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
{
case e_rsel:
case e_rrsel:
+ case e_rdsel:
final_type = R_PARISC_PCREL17R;
break;
case e_fsel:
@@ -555,23 +849,26 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
}
break;
- case 22:
+ case 21:
switch (field)
{
- case e_fsel:
- final_type = R_PARISC_PCREL22F;
+ case e_lsel:
+ case e_lrsel:
+ case e_ldsel:
+ case e_nlsel:
+ case e_nlrsel:
+ final_type = R_PARISC_PCREL21L;
break;
default:
return NULL;
}
break;
- case 21:
+ case 22:
switch (field)
{
- case e_lsel:
- case e_lrsel:
- final_type = R_PARISC_PCREL21L;
+ case e_fsel:
+ final_type = R_PARISC_PCREL22F;
break;
default:
return NULL;
@@ -583,6 +880,8 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
}
break;
+ case R_PARISC_GNU_VTENTRY:
+ case R_PARISC_GNU_VTINHERIT:
case R_PARISC_SEGREL32:
case R_PARISC_SEGBASE:
/* The defaults are fine for these cases. */
@@ -599,7 +898,7 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
static void
elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc;
Elf_Internal_Rela *elf_reloc;
{
@@ -612,7 +911,7 @@ elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc)
static void
elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc;
Elf_Internal_Rel *elf_reloc;
{
@@ -626,7 +925,7 @@ elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
static reloc_howto_type *
elf_hppa_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
if ((int) code < (int) R_PARISC_UNIMPLEMENTED)
@@ -637,34 +936,6 @@ elf_hppa_reloc_type_lookup (abfd, code)
return NULL;
}
-static void
-elf_hppa_final_write_processing (abfd, linker)
- bfd *abfd;
- boolean linker;
-{
- int mach = bfd_get_mach (abfd);
-
- elf_elfheader (abfd)->e_flags &= ~(EF_PARISC_ARCH | EF_PARISC_TRAPNIL
- | EF_PARISC_EXT | EF_PARISC_LSB
- | EF_PARISC_WIDE | EF_PARISC_NO_KABP
- | EF_PARISC_LAZYSWAP);
-
- if (mach == 10)
- elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_0;
- else if (mach == 11)
- elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_1;
- else if (mach == 20)
- elf_elfheader (abfd)->e_flags |= EFA_PARISC_2_0;
- else if (mach == 25)
- elf_elfheader (abfd)->e_flags |= (EF_PARISC_WIDE
- | EFA_PARISC_2_0
- /* The GNU tools have trapped without
- option since 1993, so need to take
- a step backwards with the ELF
- based toolchains. */
- | EF_PARISC_TRAPNIL);
-}
-
/* Return true if SYM represents a local label symbol. */
static boolean
@@ -672,7 +943,9 @@ elf_hppa_is_local_label_name (abfd, name)
bfd *abfd ATTRIBUTE_UNUSED;
const char *name;
{
- return (name[0] == 'L' && name[1] == '$');
+ if (name[0] == 'L' && name[1] == '$')
+ return 1;
+ return _bfd_elf_is_local_label_name (abfd, name);
}
/* Set the correct type for an ELF section. We do this by the
@@ -681,7 +954,7 @@ elf_hppa_is_local_label_name (abfd, name)
static boolean
elf_hppa_fake_sections (abfd, hdr, sec)
bfd *abfd;
- Elf64_Internal_Shdr *hdr;
+ elf_hppa_internal_shdr *hdr;
asection *sec;
{
register const char *name;
@@ -691,8 +964,12 @@ elf_hppa_fake_sections (abfd, hdr, sec)
if (strcmp (name, ".PARISC.unwind") == 0)
{
int indx;
- asection *sec;
+ asection *asec;
+#if ARCH_SIZE == 64
hdr->sh_type = SHT_LOPROC + 1;
+#else
+ hdr->sh_type = 1;
+#endif
/* ?!? How are unwinds supposed to work for symbols in arbitrary
sections? Or what if we have multiple .text sections in a single
.o file? HP really messed up on this one.
@@ -702,9 +979,9 @@ elf_hppa_fake_sections (abfd, hdr, sec)
So we (gasp) recompute it here. Hopefully nobody ever changes the
way sections are numbered in elf.c! */
- for (sec = abfd->sections, indx = 1; sec; sec = sec->next, indx++)
+ for (asec = abfd->sections, indx = 1; asec; asec = asec->next, indx++)
{
- if (sec->name && strcmp (sec->name, ".text") == 0)
+ if (asec->name && strcmp (asec->name, ".text") == 0)
{
hdr->sh_info = indx;
break;
@@ -717,6 +994,35 @@ elf_hppa_fake_sections (abfd, hdr, sec)
return true;
}
+static void
+elf_hppa_final_write_processing (abfd, linker)
+ bfd *abfd;
+ boolean linker ATTRIBUTE_UNUSED;
+{
+ int mach = bfd_get_mach (abfd);
+
+ elf_elfheader (abfd)->e_flags &= ~(EF_PARISC_ARCH | EF_PARISC_TRAPNIL
+ | EF_PARISC_EXT | EF_PARISC_LSB
+ | EF_PARISC_WIDE | EF_PARISC_NO_KABP
+ | EF_PARISC_LAZYSWAP);
+
+ if (mach == 10)
+ elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_0;
+ else if (mach == 11)
+ elf_elfheader (abfd)->e_flags |= EFA_PARISC_1_1;
+ else if (mach == 20)
+ elf_elfheader (abfd)->e_flags |= EFA_PARISC_2_0;
+ else if (mach == 25)
+ elf_elfheader (abfd)->e_flags |= (EF_PARISC_WIDE
+ | EFA_PARISC_2_0
+ /* The GNU tools have trapped without
+ option since 1993, so need to take
+ a step backwards with the ELF
+ based toolchains. */
+ | EF_PARISC_TRAPNIL);
+}
+
+#if ARCH_SIZE == 64
/* Hook called by the linker routine which adds symbols from an object
file. HP's libraries define symbols with HP specific section
indices, which we have to handle. */
@@ -763,10 +1069,10 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data)
the generic code will warn that it is undefined.
This behavior is undesirable on HPs since the standard shared
- libraries contain reerences to undefined symbols.
+ libraries contain references to undefined symbols.
So we twiddle the flags associated with such symbols so that they
- will not trigger the warning. ?!? FIXME. This is horribly fraglie.
+ will not trigger the warning. ?!? FIXME. This is horribly fragile.
Ultimately we should have better controls over the generic ELF BFD
linker code. */
@@ -784,7 +1090,6 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data)
return true;
}
-
static boolean
elf_hppa_remark_useless_dynamic_symbols (h, data)
struct elf_link_hash_entry *h;
@@ -828,18 +1133,18 @@ elf_hppa_record_segment_addrs (abfd, section, data)
{
struct elf64_hppa_link_hash_table *hppa_info;
bfd_vma value;
-
+
hppa_info = (struct elf64_hppa_link_hash_table *)data;
value = section->vma - section->filepos;
- if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
+ if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
== (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
&& value < hppa_info->text_segment_base)
hppa_info->text_segment_base = value;
- else if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
- == (SEC_ALLOC | SEC_LOAD))
- && value < hppa_info->data_segment_base)
+ else if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
+ == (SEC_ALLOC | SEC_LOAD))
+ && value < hppa_info->data_segment_base)
hppa_info->data_segment_base = value;
}
@@ -855,14 +1160,12 @@ elf_hppa_final_link (abfd, info)
struct bfd_link_info *info;
{
boolean retval;
+ struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
if (! info->relocateable)
{
struct elf_link_hash_entry *gp;
bfd_vma gp_val;
- struct elf64_hppa_link_hash_table *hppa_info;
-
- hppa_info = elf64_hppa_hash_table (info);
/* The linker script defines a value for __gp iff it was referenced
by one of the objects being linked. First try to find the symbol
@@ -877,7 +1180,7 @@ elf_hppa_final_link (abfd, info)
/* Adjust the value of __gp as we may want to slide it into the
.plt section so that the stubs can access PLT entries without
using an addil sequence. */
- gp->root.u.def.value += elf64_hppa_hash_table (info)->gp_offset;
+ gp->root.u.def.value += hppa_info->gp_offset;
gp_val = (gp->root.u.def.section->output_section->vma
+ gp->root.u.def.section->output_offset
@@ -886,7 +1189,6 @@ elf_hppa_final_link (abfd, info)
else
{
asection *sec;
-
/* First look for a .plt section. If found, then __gp is the
address of the .plt + gp_offset.
@@ -919,10 +1221,10 @@ elf_hppa_final_link (abfd, info)
}
/* We need to know the base of the text and data segments so that we
- can perform SEGREL relocations. We will recore the base addresses
+ can perform SEGREL relocations. We will record the base addresses
when we encounter the first SEGREL relocation. */
- elf64_hppa_hash_table (info)->text_segment_base = (bfd_vma)-1;
- elf64_hppa_hash_table (info)->data_segment_base = (bfd_vma)-1;
+ hppa_info->text_segment_base = (bfd_vma)-1;
+ hppa_info->data_segment_base = (bfd_vma)-1;
/* HP's shared libraries have references to symbols that are not
defined anywhere. The generic ELF BFD linker code will complaim
@@ -981,7 +1283,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_vma relocation;
bfd_reloc_status_type r;
const char *sym_name;
- char *dyn_name;
+ const char *dyn_name;
char *dynh_buf = NULL;
size_t dynh_buflen = 0;
struct elf64_hppa_dyn_hash_entry *dyn_h = NULL;
@@ -1030,7 +1332,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
/* If this symbol has an entry in the PA64 dynamic hash
table, then get it. */
- dyn_name = get_dyn_name (input_bfd, h, rel,
+ dyn_name = get_dyn_name (input_section, h, rel,
&dynh_buf, &dynh_buflen);
dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
dyn_name, false, false);
@@ -1053,7 +1355,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
/* If this symbol has an entry in the PA64 dynamic hash
table, then get it. */
- dyn_name = get_dyn_name (input_bfd, h, rel,
+ dyn_name = get_dyn_name (input_section, h, rel,
&dynh_buf, &dynh_buflen);
dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
dyn_name, false, false);
@@ -1089,7 +1391,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
/* If this symbol has an entry in the PA64 dynamic hash
table, then get it. */
- dyn_name = get_dyn_name (input_bfd, h, rel,
+ dyn_name = get_dyn_name (input_section, h, rel,
&dynh_buf, &dynh_buflen);
dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
dyn_name, false, false);
@@ -1154,15 +1456,14 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
return true;
}
-
/* Compute the value for a relocation (REL) during a final link stage,
- then insert the value into the proper location in CONTENTS.
+ then insert the value into the proper location in CONTENTS.
VALUE is a tentative value for the relocation and may be overridden
and modified here based on the specific relocation to be performed.
For example we do conversions for PC-relative branches in this routine
- or redirection of calls to external routines to stubs.
+ or redirection of calls to external routines to stubs.
The work of actually applying the relocation is left to a helper
routine in an attempt to reduce the complexity and size of this
@@ -1180,15 +1481,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
bfd_vma value;
struct bfd_link_info *info;
asection *sym_sec;
- struct elf_link_hash_entry *h;
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED;
struct elf64_hppa_dyn_hash_entry *dyn_h;
{
- unsigned long insn;
+ unsigned int insn;
bfd_vma offset = rel->r_offset;
bfd_vma addend = rel->r_addend;
reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info);
- unsigned long r_type = howto->type;
- unsigned long r_field = e_fsel;
+ unsigned int r_type = howto->type;
bfd_byte *hit_data = contents + offset;
struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
@@ -1199,6 +1499,12 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
case R_PARISC_NONE:
break;
+ /* Basic function call support. I'm not entirely sure if PCREL14F is
+ actually needed or even handled correctly.
+
+ Note for a call to a function defined in another dynamic library
+ we want to redirect the call to a stub. */
+
/* Random PC relative relocs. */
case R_PARISC_PCREL21L:
case R_PARISC_PCREL14R:
@@ -1209,64 +1515,56 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
case R_PARISC_PCREL16WF:
case R_PARISC_PCREL16DF:
{
- if (r_type == R_PARISC_PCREL21L)
- r_field = e_lsel;
- else if (r_type == R_PARISC_PCREL14F
- || r_type == R_PARISC_PCREL16F
- || r_type == R_PARISC_PCREL16WF
- || r_type == R_PARISC_PCREL16DF)
- r_field = e_fsel;
- else
- r_field = e_rsel;
-
/* If this is a call to a function defined in another dynamic
library, then redirect the call to the local stub for this
function. */
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
-
+
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
/* Adjust for any field selectors. */
- value = hppa_field_adjust (value, -8 + addend, r_field);
+ if (r_type == R_PARISC_PCREL21L)
+ value = hppa_field_adjust (value, -8 + addend, e_lsel);
+ else if (r_type == R_PARISC_PCREL14F
+ || r_type == R_PARISC_PCREL16F
+ || r_type == R_PARISC_PCREL16WF
+ || r_type == R_PARISC_PCREL16DF)
+ value = hppa_field_adjust (value, -8 + addend, e_fsel);
+ else
+ value = hppa_field_adjust (value, -8 + addend, e_rsel);
/* Apply the relocation to the given instruction. */
insn = elf_hppa_relocate_insn (insn, value, r_type);
break;
}
- /* Basic function call support. I'm not entirely sure if PCREL14F is
- actually needed or even handled correctly.
-
- Note for a call to a function defined in another dynamic library
- we want to redirect the call to a stub. */
+ case R_PARISC_PCREL12F:
case R_PARISC_PCREL22F:
case R_PARISC_PCREL17F:
case R_PARISC_PCREL22C:
case R_PARISC_PCREL17C:
case R_PARISC_PCREL17R:
{
- if (r_type == R_PARISC_PCREL17R)
- r_field = e_rsel;
- else
- r_field = e_fsel;
-
/* If this is a call to a function defined in another dynamic
library, then redirect the call to the local stub for this
function. */
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
-
+
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
/* Adjust for any field selectors. */
- value = hppa_field_adjust (value, -8 + addend, e_fsel);
+ if (r_type == R_PARISC_PCREL17R)
+ value = hppa_field_adjust (value, -8 + addend, e_rsel);
+ else
+ value = hppa_field_adjust (value, -8 + addend, e_fsel);
/* All branches are implicitly shifted by 2 places. */
value >>= 2;
@@ -1302,12 +1600,12 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
case R_PARISC_LTOFF16DF:
{
/* If this relocation was against a local symbol, then we still
- have not set up the DLT entry (it's not convienent to do so
+ have not set up the DLT entry (it's not convenient to do so
in the "finalize_dlt" routine because it is difficult to get
to the local symbol's value).
So, if this is a local symbol (h == NULL), then we need to
- fill in its DLT entry.
+ fill in its DLT entry.
Similarly we may still need to set up an entry in .opd for
a local function which had its address taken. */
@@ -1353,7 +1651,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
+ hppa_info->dlt_sec->output_section->vma);
value -= _bfd_get_gp_value (output_bfd);
-
/* All DLTIND relocations are basically the same at this point,
except that we need different field selectors for the 21bit
version vs the 14bit versions. */
@@ -1420,6 +1717,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
case R_PARISC_DIR17R:
case R_PARISC_DIR17F:
case R_PARISC_DIR14R:
+ case R_PARISC_DIR14F:
case R_PARISC_DIR14WR:
case R_PARISC_DIR14DR:
case R_PARISC_DIR16F:
@@ -1427,18 +1725,27 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
case R_PARISC_DIR16DF:
{
/* All DIR relocations are basically the same at this point,
- except that we need different field selectors for the 21bit
- version vs the 14bit versions. */
+ except that branch offsets need to be divided by four, and
+ we need different field selectors. Note that we don't
+ redirect absolute calls to local stubs. */
+
if (r_type == R_PARISC_DIR21L)
value = hppa_field_adjust (value, addend, e_lrsel);
else if (r_type == R_PARISC_DIR17F
|| r_type == R_PARISC_DIR16F
|| r_type == R_PARISC_DIR16WF
- || r_type == R_PARISC_DIR16DF)
+ || r_type == R_PARISC_DIR16DF
+ || r_type == R_PARISC_DIR14F)
value = hppa_field_adjust (value, addend, e_fsel);
else
value = hppa_field_adjust (value, addend, e_rrsel);
+ if (r_type == R_PARISC_DIR17R || r_type == R_PARISC_DIR17F)
+ {
+ /* All branches are implicitly shifted by 2 places. */
+ value >>= 2;
+ }
+
insn = elf_hppa_relocate_insn (insn, value, r_type);
break;
}
@@ -1557,7 +1864,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
/* Subtract out the global pointer value to make value a DLT
relative address. */
value -= _bfd_get_gp_value (output_bfd);
- value += addend;
bfd_put_64 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
@@ -1583,14 +1889,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
-
+
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
value += addend;
value -= 8;
- bfd_put_64 (input_bfd, value, hit_data);
+ bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
@@ -1602,8 +1908,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
if (sym_sec == NULL || sym_sec->output_section == NULL)
value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset
+ hppa_info->stub_sec->output_section->vma);
-
-
+
/* Turn VALUE into a proper PC relative address. */
value -= (offset + input_section->output_offset
+ input_section->output_section->vma);
@@ -1614,7 +1919,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
return bfd_reloc_ok;
}
-
case R_PARISC_FPTR64:
{
/* We may still need to create the FPTR itself if it was for
@@ -1641,15 +1945,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
value = (dyn_h->opd_offset
+ hppa_info->opd_sec->output_offset
+ hppa_info->opd_sec->output_section->vma);
-
+
bfd_put_64 (input_bfd, value + addend, hit_data);
return bfd_reloc_ok;
}
case R_PARISC_SECREL32:
bfd_put_32 (input_bfd,
- (value + addend
- - sym_sec->output_section->vma),
+ value + addend - sym_sec->output_section->vma,
hit_data);
return bfd_reloc_ok;
@@ -1660,7 +1963,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
the segment base values. */
if (hppa_info->text_segment_base == (bfd_vma) -1)
bfd_map_over_sections (output_bfd, elf_hppa_record_segment_addrs,
- elf64_hppa_hash_table (info));
+ hppa_info);
/* VALUE holds the absolute address. We want to include the
addend, then turn it into a segment relative address.
@@ -1681,7 +1984,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
bfd_put_64 (input_bfd, value, hit_data);
return bfd_reloc_ok;
}
-
/* Something we don't know how to handle. */
default:
@@ -1690,7 +1992,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
/* Update the instruction word. */
bfd_put_32 (input_bfd, insn, hit_data);
- return (bfd_reloc_ok);
+ return bfd_reloc_ok;
}
/* Relocate the given INSN. VALUE should be the actual value we want
@@ -1699,62 +2001,32 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
Instead this routine is meant to handle the bit manipulations needed
to insert the relocation into the given instruction. */
-static unsigned long
+static unsigned int
elf_hppa_relocate_insn (insn, sym_value, r_type)
- unsigned long insn;
- long sym_value;
- unsigned long r_type;
+ unsigned int insn;
+ unsigned int sym_value;
+ unsigned int r_type;
{
switch (r_type)
{
- /* This is any 22bit branch. In PA2.0 syntax it corresponds to
+ /* This is any 22 bit branch. In PA2.0 syntax it corresponds to
the "B" instruction. */
case R_PARISC_PCREL22F:
case R_PARISC_PCREL22C:
- {
- unsigned int w3, w2, w1, w;
-
- /* These are 22 bit branches. Mask off bits we do not care
- about. */
- sym_value &= 0x3fffff;
+ return (insn & ~ 0x3ff1ffd) | re_assemble_22 (sym_value);
- /* Now extract the W1, W2, W3 and W fields from the value. */
- dis_assemble_22 (sym_value, &w3, &w1, &w2, &w);
+ /* This is any 12 bit branch. */
+ case R_PARISC_PCREL12F:
+ return (insn & ~ 0x1ffd) | re_assemble_12 (sym_value);
- /* Mask out bits for the value in the instruction. */
- insn &= 0xfc00e002;
-
- /* Insert the bits for the W1, W2 and W fields into the
- instruction. */
- insn |= (w3 << 21) | (w2 << 2) | (w1 << 16) | w;
- return insn;
- }
-
- /* This is any 17bit branch. In PA2.0 syntax it also corresponds to
- the "B" instruction as well as BE. */
+ /* This is any 17 bit branch. In PA2.0 syntax it also corresponds
+ to the "B" instruction as well as BE. */
case R_PARISC_PCREL17F:
case R_PARISC_DIR17F:
case R_PARISC_DIR17R:
case R_PARISC_PCREL17C:
case R_PARISC_PCREL17R:
- {
- unsigned int w2, w1, w;
-
- /* These are 17 bit branches. Mask off bits we do not care
- about. */
- sym_value &= 0x1ffff;
-
- /* Now extract the W1, W2 and W fields from the value. */
- dis_assemble_17 (sym_value, &w1, &w2, &w);
-
- /* Mask out bits for the value in the instruction. */
- insn &= 0xffe0e002;
-
- /* Insert the bits for the W1, W2 and W fields into the
- instruction. */
- insn |= (w2 << 2) | (w1 << 16) | w;
- return insn;
- }
+ return (insn & ~ 0x1f1ffd) | re_assemble_17 (sym_value);
/* ADDIL or LDIL instructions. */
case R_PARISC_DLTREL21L:
@@ -1765,20 +2037,9 @@ elf_hppa_relocate_insn (insn, sym_value, r_type)
case R_PARISC_DPREL21L:
case R_PARISC_PLTOFF21L:
case R_PARISC_DIR21L:
- {
- int w;
-
- /* Mask off bits in INSN we do not want. */
- insn &= 0xffe00000;
-
- /* Turn the 21bit value into the proper format. */
- dis_assemble_21 (sym_value, &w);
-
- /* And insert the proper bits into INSN. */
- return insn | w;
- }
+ return (insn & ~ 0x1fffff) | re_assemble_21 (sym_value);
- /* LDO and integer loads/stores with 14bit displacements. */
+ /* LDO and integer loads/stores with 14 bit displacements. */
case R_PARISC_DLTREL14R:
case R_PARISC_DLTREL14F:
case R_PARISC_DLTIND14R:
@@ -1798,22 +2059,12 @@ elf_hppa_relocate_insn (insn, sym_value, r_type)
case R_PARISC_PLTOFF14F:
case R_PARISC_PLTOFF16F:
case R_PARISC_DIR14R:
+ case R_PARISC_DIR14F:
case R_PARISC_DIR16F:
case R_PARISC_LTOFF16F:
- {
- int w;
-
- /* Mask off bits in INSN we do not want. */
- insn &= 0xffffc000;
-
- /* Turn the 14bit value into the proper format. */
- low_sign_unext (sym_value, 14, &w);
+ return (insn & ~ 0x3fff) | low_sign_unext (sym_value, 14);
- /* And insert the proper bits into INSN. */
- return insn | w;
- }
-
- /* Doubleword loads and stores with a 14bit displacement. */
+ /* Doubleword loads and stores with a 14 bit displacement. */
case R_PARISC_DLTREL14DR:
case R_PARISC_DLTIND14DR:
case R_PARISC_LTOFF_FPTR14DR:
@@ -1829,22 +2080,8 @@ elf_hppa_relocate_insn (insn, sym_value, r_type)
case R_PARISC_DIR14DR:
case R_PARISC_DIR16DF:
case R_PARISC_LTOFF16DF:
- {
- /* Mask off bits in INSN we do not want. */
- insn &= 0xffffc00e;
-
- /* The sign bit at 14 moves into bit zero in the destination. */
- insn |= ((sym_value & 0x2000) >> 13);
-
- /* Turn off the bits in sym_value we do not care about. */
- sym_value &= 0x1ff8;
-
- /* Now shift it one bit position left so that it lines up with the
- destination field in INSN. */
- sym_value <<= 1;
-
- return insn | sym_value;
- }
+ return (insn & ~ 0x3ff1) | (((sym_value & 0x2000) >> 13)
+ | ((sym_value & 0x1ff8) << 1));
/* Floating point single word load/store instructions. */
case R_PARISC_DLTREL14WR:
@@ -1862,24 +2099,11 @@ elf_hppa_relocate_insn (insn, sym_value, r_type)
case R_PARISC_DIR16WF:
case R_PARISC_DIR14WR:
case R_PARISC_LTOFF16WF:
- {
- /* Mask off bits in INSN we do not want. */
- insn &= 0xffffc006;
-
- /* The sign bit at 14 moves into bit zero in the destination. */
- insn |= ((sym_value & 0x2000) >> 13);
-
- /* Turn off the bits in sym_value we do not care about. */
- sym_value &= 0x1ffc;
-
- /* Now shift it one bit position left so that it lines up with the
- destination field in INSN. */
- sym_value <<= 1;
-
- return insn | sym_value;
- }
+ return (insn & ~ 0x3ff9) | (((sym_value & 0x2000) >> 13)
+ | ((sym_value & 0x1ffc) << 1));
default:
return insn;
}
}
+#endif
diff --git a/gnu/usr.bin/binutils/bfd/elf-m10200.c b/gnu/usr.bin/binutils/bfd/elf-m10200.c
index 1939635cb2b..fb28d79841a 100644
--- a/gnu/usr.bin/binutils/bfd/elf-m10200.c
+++ b/gnu/usr.bin/binutils/bfd/elf-m10200.c
@@ -1,5 +1,6 @@
/* Matsushita 10200 specific support for 32-bit ELF
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -35,8 +36,7 @@ static boolean mn10200_elf_symbol_address_p
does absolutely nothing. */
#define USE_RELA
-enum reloc_type
-{
+enum reloc_type {
R_MN10200_NONE = 0,
R_MN10200_32,
R_MN10200_16,
@@ -48,8 +48,7 @@ enum reloc_type
R_MN10200_MAX
};
-static reloc_howto_type elf_mn10200_howto_table[] =
-{
+static reloc_howto_type elf_mn10200_howto_table[] = {
/* Dummy relocation. Does nothing. */
HOWTO (R_MN10200_NONE,
0,
@@ -165,20 +164,18 @@ static reloc_howto_type elf_mn10200_howto_table[] =
true),
};
-struct mn10200_reloc_map
-{
+struct mn10200_reloc_map {
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
-static const struct mn10200_reloc_map mn10200_reloc_map[] =
-{
- { BFD_RELOC_NONE, R_MN10200_NONE, },
- { BFD_RELOC_32, R_MN10200_32, },
- { BFD_RELOC_16, R_MN10200_16, },
- { BFD_RELOC_8, R_MN10200_8, },
- { BFD_RELOC_24, R_MN10200_24, },
- { BFD_RELOC_8_PCREL, R_MN10200_PCREL8, },
+static const struct mn10200_reloc_map mn10200_reloc_map[] = {
+ { BFD_RELOC_NONE , R_MN10200_NONE , },
+ { BFD_RELOC_32 , R_MN10200_32 , },
+ { BFD_RELOC_16 , R_MN10200_16 , },
+ { BFD_RELOC_8 , R_MN10200_8 , },
+ { BFD_RELOC_24 , R_MN10200_24 , },
+ { BFD_RELOC_8_PCREL , R_MN10200_PCREL8 , },
{ BFD_RELOC_16_PCREL, R_MN10200_PCREL16, },
{ BFD_RELOC_24_PCREL, R_MN10200_PCREL24, },
};
@@ -250,7 +247,7 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_MN10200_16:
value += addend;
- if ((long)value > 0x7fff || (long)value < -0x8000)
+ if ((long) value > 0x7fff || (long) value < -0x8000)
return bfd_reloc_overflow;
bfd_put_16 (input_bfd, value, hit_data);
@@ -259,7 +256,7 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_MN10200_8:
value += addend;
- if ((long)value > 0x7f || (long)value < -0x80)
+ if ((long) value > 0x7f || (long) value < -0x80)
return bfd_reloc_overflow;
bfd_put_8 (input_bfd, value, hit_data);
@@ -268,7 +265,7 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_MN10200_24:
value += addend;
- if ((long)value > 0x7fffff || (long)value < -0x800000)
+ if ((long) value > 0x7fffff || (long) value < -0x800000)
return bfd_reloc_overflow;
value &= 0xffffff;
@@ -282,8 +279,8 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= (offset + 1);
value += addend;
- if ((long)value > 0xff || (long)value < -0x100)
- return bfd_reloc_overflow;
+ if ((long) value > 0xff || (long) value < -0x100)
+ return bfd_reloc_overflow;
bfd_put_8 (input_bfd, value, hit_data);
return bfd_reloc_ok;
@@ -294,8 +291,8 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= (offset + 2);
value += addend;
- if ((long)value > 0xffff || (long)value < -0x10000)
- return bfd_reloc_overflow;
+ if ((long) value > 0xffff || (long) value < -0x10000)
+ return bfd_reloc_overflow;
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
@@ -306,8 +303,8 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= (offset + 3);
value += addend;
- if ((long)value > 0xffffff || (long)value < -0x1000000)
- return bfd_reloc_overflow;
+ if ((long) value > 0xffffff || (long) value < -0x1000000)
+ return bfd_reloc_overflow;
value &= 0xffffff;
value |= (bfd_get_32 (input_bfd, hit_data) & 0xff000000);
@@ -318,7 +315,6 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
return bfd_reloc_notsupported;
}
}
-
/* Relocate an MN10200 ELF section. */
static boolean
@@ -423,7 +419,7 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (r != bfd_reloc_ok)
{
const char *name;
- const char *msg = (const char *)0;
+ const char *msg = (const char *) 0;
if (h != NULL)
name = h->root.root.string;
@@ -505,11 +501,11 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
abs24, imm24, d24 all look the same at the reloc level. It
might make the code simpler if we had different relocs for
the various relaxable operand types.
-
+
We don't handle imm16->imm8 or d16->d8 as they're very rare
and somewhat more difficult to support. */
-static boolean
+static boolean
mn10200_elf_relax_section (abfd, sec, link_info, again)
bfd *abfd;
asection *sec;
@@ -654,7 +650,6 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
that would be more work, but would require less memory when
the linker is run. */
-
/* Try to turn a 24bit pc-relative branch/call into a 16bit pc-relative
branch/call. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10200_PCREL24)
@@ -669,7 +664,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
/* See if the value will fit in 16 bits, note the high value is
0x7fff + 2 as the target will be two bytes closer if we are
able to relax. */
- if ((long)value < 0x8001 && (long)value > -0x8000)
+ if ((long) value < 0x8001 && (long) value > -0x8000)
{
unsigned char code;
@@ -727,7 +722,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
/* See if the value will fit in 8 bits, note the high value is
0x7f + 1 as the target will be one bytes closer if we are
able to relax. */
- if ((long)value < 0x80 && (long)value > -0x80)
+ if ((long) value < 0x80 && (long) value > -0x80)
{
unsigned char code;
@@ -774,7 +769,6 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
bra lab2
lab1: lab1:
-
This happens when the bCC can't reach lab2 at assembly time,
but due to other relaxations it can reach at link time. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10200_PCREL8)
@@ -814,7 +808,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
continue;
/* Now make sure we are a conditional branch. This may not
- be necessary, but why take the chance.
+ be necessary, but why take the chance.
Note these checks assume that R_MN10200_PCREL8 relocs
only occur on bCC and bCCx insns. If they occured
@@ -848,63 +842,63 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
/* Reverse the condition of the first branch. */
switch (code)
{
- case 0xfc:
- code = 0xfd;
- break;
- case 0xfd:
- code = 0xfc;
- break;
- case 0xfe:
- code = 0xff;
- break;
- case 0xff:
- code = 0xfe;
- break;
- case 0xe8:
- code = 0xe9;
- break;
- case 0xe9:
- code = 0xe8;
- break;
- case 0xe0:
- code = 0xe2;
- break;
- case 0xe2:
- code = 0xe0;
- break;
- case 0xe3:
- code = 0xe1;
- break;
- case 0xe1:
- code = 0xe3;
- break;
- case 0xe4:
- code = 0xe6;
- break;
- case 0xe6:
- code = 0xe4;
- break;
- case 0xe7:
- code = 0xe5;
- break;
- case 0xe5:
- code = 0xe7;
- break;
- case 0xec:
- code = 0xed;
- break;
- case 0xed:
- code = 0xec;
- break;
- case 0xee:
- code = 0xef;
- break;
- case 0xef:
- code = 0xee;
- break;
+ case 0xfc:
+ code = 0xfd;
+ break;
+ case 0xfd:
+ code = 0xfc;
+ break;
+ case 0xfe:
+ code = 0xff;
+ break;
+ case 0xff:
+ code = 0xfe;
+ break;
+ case 0xe8:
+ code = 0xe9;
+ break;
+ case 0xe9:
+ code = 0xe8;
+ break;
+ case 0xe0:
+ code = 0xe2;
+ break;
+ case 0xe2:
+ code = 0xe0;
+ break;
+ case 0xe3:
+ code = 0xe1;
+ break;
+ case 0xe1:
+ code = 0xe3;
+ break;
+ case 0xe4:
+ code = 0xe6;
+ break;
+ case 0xe6:
+ code = 0xe4;
+ break;
+ case 0xe7:
+ code = 0xe5;
+ break;
+ case 0xe5:
+ code = 0xe7;
+ break;
+ case 0xec:
+ code = 0xed;
+ break;
+ case 0xed:
+ code = 0xec;
+ break;
+ case 0xee:
+ code = 0xef;
+ break;
+ case 0xef:
+ code = 0xee;
+ break;
}
bfd_put_8 (abfd, code, contents + irel->r_offset - 1);
-
+
/* Set the reloc type and symbol for the first branch
from the second branch. */
irel->r_info = nrel->r_info;
@@ -929,10 +923,10 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
{
bfd_vma value = symval;
- /* See if the value will fit in 16 bits.
+ /* See if the value will fit in 16 bits.
We allow any 16bit match here. We prune those we can't
handle below. */
- if ((long)value < 0x7fff && (long)value > -0x8000)
+ if ((long) value < 0x7fff && (long) value > -0x8000)
{
unsigned char code;
@@ -991,7 +985,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
*again = true;
break;
- /* mov imm24,an -> mov imm16,an
+ /* mov imm24,an -> mov imm16,an
cmp imm24,an -> cmp imm16,an
mov (abs24),dn -> mov (abs16),dn
mov dn,(abs24) -> mov dn,(abs16)
@@ -1053,7 +1047,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
add imm24,dn -> add imm16,dn
add imm24,an -> add imm16,an
sub imm24,dn -> sub imm16,dn
- sub imm24,an -> sub imm16,an
+ sub imm24,an -> sub imm16,an
And all d24->d16 in memory ops. */
case 0x78:
case 0xd0:
@@ -1075,20 +1069,20 @@ mn10200_elf_relax_section (abfd, sec, link_info, again)
move the value out of high mem and thus not fit
in a signed 16bit value. */
if (((code & 0xfc) == 0x78
- || (code & 0xfc) == 0x60
- || (code & 0xfc) == 0x64
- || (code & 0xfc) == 0x68
- || (code & 0xfc) == 0x6c
- || (code & 0xfc) == 0x80
- || (code & 0xfc) == 0xf0
- || (code & 0xfc) == 0x00
- || (code & 0xfc) == 0x10
- || (code & 0xfc) == 0xb0
- || (code & 0xfc) == 0x30
- || (code & 0xfc) == 0xa0
- || (code & 0xfc) == 0x20
- || (code & 0xfc) == 0x90)
- && (value & 0x8000) != 0)
+ || (code & 0xfc) == 0x60
+ || (code & 0xfc) == 0x64
+ || (code & 0xfc) == 0x68
+ || (code & 0xfc) == 0x6c
+ || (code & 0xfc) == 0x80
+ || (code & 0xfc) == 0xf0
+ || (code & 0xfc) == 0x00
+ || (code & 0xfc) == 0x10
+ || (code & 0xfc) == 0xb0
+ || (code & 0xfc) == 0x30
+ || (code & 0xfc) == 0xa0
+ || (code & 0xfc) == 0x20
+ || (code & 0xfc) == 0x90)
+ && (value & 0x8000) != 0)
continue;
/* Note that we've changed the reldection contents, etc. */
@@ -1506,7 +1500,6 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
return NULL;
}
-
#define TARGET_LITTLE_SYM bfd_elf32_mn10200_vec
#define TARGET_LITTLE_NAME "elf32-mn10200"
#define ELF_ARCH bfd_arch_mn10200
diff --git a/gnu/usr.bin/binutils/bfd/elf-m10300.c b/gnu/usr.bin/binutils/bfd/elf-m10300.c
index 498f538a77f..15380bc64ad 100644
--- a/gnu/usr.bin/binutils/bfd/elf-m10300.c
+++ b/gnu/usr.bin/binutils/bfd/elf-m10300.c
@@ -1,5 +1,6 @@
/* Matsushita 10300 specific support for 32-bit ELF
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,8 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf-bfd.h"
#include "elf/mn10300.h"
-struct elf32_mn10300_link_hash_entry
-{
+struct elf32_mn10300_link_hash_entry {
/* The basic elf link hash table entry. */
struct elf_link_hash_entry root;
@@ -62,8 +62,7 @@ struct elf32_mn10300_link_hash_entry
/* We derive a hash table from the main elf linker hash table so
we can store state variables and a secondary hash table without
resorting to global variables. */
-struct elf32_mn10300_link_hash_table
-{
+struct elf32_mn10300_link_hash_table {
/* The main hash table. */
struct elf_link_hash_table root;
@@ -119,9 +118,7 @@ static void compute_function_info
does absolutely nothing. */
#define USE_RELA
-
-static reloc_howto_type elf_mn10300_howto_table[] =
-{
+static reloc_howto_type elf_mn10300_howto_table[] = {
/* Dummy relocation. Does nothing. */
HOWTO (R_MN10300_NONE,
0,
@@ -265,17 +262,14 @@ static reloc_howto_type elf_mn10300_howto_table[] =
0xffffff,
0xffffff,
false),
-
};
-struct mn10300_reloc_map
-{
+struct mn10300_reloc_map {
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
-static const struct mn10300_reloc_map mn10300_reloc_map[] =
-{
+static const struct mn10300_reloc_map mn10300_reloc_map[] = {
{ BFD_RELOC_NONE, R_MN10300_NONE, },
{ BFD_RELOC_32, R_MN10300_32, },
{ BFD_RELOC_16, R_MN10300_16, },
@@ -342,7 +336,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
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;
@@ -460,7 +454,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_MN10300_24:
value += addend;
- if ((long)value > 0x7fffff || (long)value < -0x800000)
+ if ((long) value > 0x7fffff || (long) value < -0x800000)
return bfd_reloc_overflow;
bfd_put_8 (input_bfd, value & 0xff, hit_data);
@@ -471,7 +465,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_MN10300_16:
value += addend;
- if ((long)value > 0x7fff || (long)value < -0x8000)
+ if ((long) value > 0x7fff || (long) value < -0x8000)
return bfd_reloc_overflow;
bfd_put_16 (input_bfd, value, hit_data);
@@ -480,7 +474,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_MN10300_8:
value += addend;
- if ((long)value > 0x7f || (long)value < -0x80)
+ if ((long) value > 0x7f || (long) value < -0x80)
return bfd_reloc_overflow;
bfd_put_8 (input_bfd, value, hit_data);
@@ -492,7 +486,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= offset;
value += addend;
- if ((long)value > 0xff || (long)value < -0x100)
+ if ((long) value > 0xff || (long) value < -0x100)
return bfd_reloc_overflow;
bfd_put_8 (input_bfd, value, hit_data);
@@ -504,7 +498,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= offset;
value += addend;
- if ((long)value > 0xffff || (long)value < -0x10000)
+ if ((long) value > 0xffff || (long) value < -0x10000)
return bfd_reloc_overflow;
bfd_put_16 (input_bfd, value, hit_data);
@@ -527,7 +521,6 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
return bfd_reloc_notsupported;
}
}
-
/* Relocate an MN10300 ELF section. */
static boolean
@@ -638,7 +631,7 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (r != bfd_reloc_ok)
{
const char *name;
- const char *msg = (const char *)0;
+ const char *msg = (const char *) 0;
if (h != NULL)
name = h->root.root.root.string;
@@ -704,7 +697,7 @@ elf32_mn10300_finish_hash_table_entry (gen_entry, in_args)
struct elf32_mn10300_link_hash_entry *entry;
unsigned int byte_count = 0;
- entry = (struct elf32_mn10300_link_hash_entry *)gen_entry;
+ entry = (struct elf32_mn10300_link_hash_entry *) gen_entry;
/* If we already know we want to convert "call" to "calls" for calls
to this symbol, then return now. */
@@ -767,7 +760,6 @@ elf32_mn10300_finish_hash_table_entry (gen_entry, in_args)
This is only done if the resulting code is no larger
than the original code.
-
* jmp:32 -> jmp:16 2 bytes
* jmp:16 -> bra:8 1 byte
@@ -825,22 +817,22 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* We're going to need all the symbols for each bfd. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
- /* Get cached copy if it exists. */
- if (symtab_hdr->contents != NULL)
- extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
- else
- {
- /* Go get them off disk. */
- extsyms = ((Elf32_External_Sym *)
- bfd_malloc (symtab_hdr->sh_size));
- if (extsyms == NULL)
- goto error_return;
- free_extsyms = extsyms;
- if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
- || (bfd_read (extsyms, 1, symtab_hdr->sh_size, input_bfd)
- != symtab_hdr->sh_size))
- goto error_return;
- }
+ /* Get cached copy if it exists. */
+ if (symtab_hdr->contents != NULL)
+ extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
+ else
+ {
+ /* Go get them off disk. */
+ extsyms = ((Elf32_External_Sym *)
+ bfd_malloc (symtab_hdr->sh_size));
+ if (extsyms == NULL)
+ goto error_return;
+ free_extsyms = extsyms;
+ if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+ || (bfd_read (extsyms, 1, symtab_hdr->sh_size, input_bfd)
+ != symtab_hdr->sh_size))
+ goto error_return;
+ }
/* Iterate over each section in this bfd. */
for (section = input_bfd->sections;
@@ -859,7 +851,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
else if (section->_raw_size != 0)
{
/* Go get them off disk. */
- contents = (bfd_byte *)bfd_malloc (section->_raw_size);
+ contents = (bfd_byte *) bfd_malloc (section->_raw_size);
if (contents == NULL)
goto error_return;
free_contents = contents;
@@ -902,7 +894,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
r_type = ELF32_R_TYPE (irel->r_info);
r_index = ELF32_R_SYM (irel->r_info);
- if (r_type < 0 || r_type >= (int)R_MN10300_MAX)
+ if (r_type < 0 || r_type >= (int) R_MN10300_MAX)
goto error_return;
/* We need the name and hash table entry of the target
@@ -930,7 +922,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
sym_sec = bfd_abs_section_ptr;
else if (isym.st_shndx == SHN_COMMON)
sym_sec = bfd_com_section_ptr;
-
+
sym_name = bfd_elf_string_from_elf_section (input_bfd,
symtab_hdr->sh_link,
isym.st_name);
@@ -947,7 +939,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
if (new_name == 0)
goto error_return;
- sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
+ sprintf (new_name, "%s_%08x",
+ sym_name, (int) sym_sec);
sym_name = new_name;
hash = (struct elf32_mn10300_link_hash_entry *)
@@ -993,7 +986,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
shndx = _bfd_elf_section_from_bfd_section (input_bfd,
section);
-
/* Look at each function defined in this section and
update info for that function. */
esym = extsyms;
@@ -1028,7 +1020,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
if (new_name == 0)
goto error_return;
- sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
+ sprintf (new_name, "%s_%08x",
+ sym_name, (int) sym_sec);
sym_name = new_name;
hash = (struct elf32_mn10300_link_hash_entry *)
@@ -1037,7 +1030,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
true, false);
free (new_name);
compute_function_info (input_bfd, hash,
- isym.st_value, contents);
+ isym.st_value, contents);
}
}
@@ -1122,22 +1115,22 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* We're going to need all the symbols for each bfd. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
- /* Get cached copy if it exists. */
- if (symtab_hdr->contents != NULL)
- extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
- else
- {
- /* Go get them off disk. */
- extsyms = ((Elf32_External_Sym *)
- bfd_malloc (symtab_hdr->sh_size));
- if (extsyms == NULL)
- goto error_return;
- free_extsyms = extsyms;
- if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
- || (bfd_read (extsyms, 1, symtab_hdr->sh_size, input_bfd)
- != symtab_hdr->sh_size))
- goto error_return;
- }
+ /* Get cached copy if it exists. */
+ if (symtab_hdr->contents != NULL)
+ extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
+ else
+ {
+ /* Go get them off disk. */
+ extsyms = ((Elf32_External_Sym *)
+ bfd_malloc (symtab_hdr->sh_size));
+ if (extsyms == NULL)
+ goto error_return;
+ free_extsyms = extsyms;
+ if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+ || (bfd_read (extsyms, 1, symtab_hdr->sh_size, input_bfd)
+ != symtab_hdr->sh_size))
+ goto error_return;
+ }
/* Walk over each section in this bfd. */
for (section = input_bfd->sections;
@@ -1154,15 +1147,15 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
if (section->reloc_count != 0)
{
- /* Get a copy of the native relocations. */
- internal_relocs = (_bfd_elf32_link_read_relocs
- (input_bfd, section, (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;
+ /* Get a copy of the native relocations. */
+ internal_relocs = (_bfd_elf32_link_read_relocs
+ (input_bfd, section, (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;
}
/* Get cached copy of section contents if it exists. */
@@ -1171,7 +1164,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
else
{
/* Go get them off disk. */
- contents = (bfd_byte *)bfd_malloc (section->_raw_size);
+ contents = (bfd_byte *) bfd_malloc (section->_raw_size);
if (contents == NULL)
goto error_return;
free_contents = contents;
@@ -1182,7 +1175,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
goto error_return;
}
-
shndx = _bfd_elf_section_from_bfd_section (input_bfd, section);
/* Now look for any function in this section which needs
@@ -1213,7 +1205,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
sym_sec = bfd_com_section_ptr;
else
abort ();
-
+
sym_name = bfd_elf_string_from_elf_section (input_bfd,
symtab_hdr->sh_link,
isym.st_name);
@@ -1223,7 +1215,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
new_name = bfd_malloc (strlen (sym_name) + 10);
if (new_name == 0)
goto error_return;
- sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
+ sprintf (new_name, "%s_%08x", sym_name, (int) sym_sec);
sym_name = new_name;
sym_hash = (struct elf32_mn10300_link_hash_entry *)
@@ -1247,7 +1239,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
elf_section_data (section)->this_hdr.contents = contents;
free_contents = NULL;
- symtab_hdr->contents = (bfd_byte *)extsyms;
+ symtab_hdr->contents = (bfd_byte *) extsyms;
free_extsyms = NULL;
/* Count how many bytes we're going to delete. */
@@ -1304,7 +1296,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
elf_section_data (section)->this_hdr.contents = contents;
free_contents = NULL;
- symtab_hdr->contents = (bfd_byte *)extsyms;
+ symtab_hdr->contents = (bfd_byte *) extsyms;
free_extsyms = NULL;
/* Count how many bytes we're going to delete. */
@@ -1370,7 +1362,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
}
}
-
/* (Re)initialize for the basic instruction shortening/relaxing pass. */
contents = NULL;
extsyms = NULL;
@@ -1482,7 +1473,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
sym_sec = bfd_com_section_ptr;
else
abort ();
-
+
symval = (isym.st_value
+ sym_sec->output_section->vma
+ sym_sec->output_offset);
@@ -1495,7 +1486,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
new_name = bfd_malloc (strlen (sym_name) + 10);
if (new_name == 0)
goto error_return;
- sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
+ sprintf (new_name, "%s_%08x", sym_name, (int) sym_sec);
sym_name = new_name;
h = (struct elf32_mn10300_link_hash_entry *)
@@ -1609,7 +1600,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* See if the value will fit in 16 bits, note the high value is
0x7fff + 2 as the target will be two bytes closer if we are
able to relax. */
- if ((long)value < 0x8001 && (long)value > -0x8000)
+ if ((long) value < 0x8001 && (long) value > -0x8000)
{
unsigned char code;
@@ -1724,7 +1715,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* See if the value will fit in 8 bits, note the high value is
0x7f + 1 as the target will be one bytes closer if we are
able to relax. */
- if ((long)value < 0x80 && (long)value > -0x80)
+ if ((long) value < 0x80 && (long) value > -0x80)
{
unsigned char code;
@@ -1771,7 +1762,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
bra lab2
lab1: lab1:
-
This happens when the bCC can't reach lab2 at assembly time,
but due to other relaxations it can reach at link time. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_PCREL8)
@@ -1844,48 +1834,48 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* Reverse the condition of the first branch. */
switch (code)
{
- case 0xc8:
- code = 0xc9;
- break;
- case 0xc9:
- code = 0xc8;
- break;
- case 0xc0:
- code = 0xc2;
- break;
- case 0xc2:
- code = 0xc0;
- break;
- case 0xc3:
- code = 0xc1;
- break;
- case 0xc1:
- code = 0xc3;
- break;
- case 0xc4:
- code = 0xc6;
- break;
- case 0xc6:
- code = 0xc4;
- break;
- case 0xc7:
- code = 0xc5;
- break;
- case 0xc5:
- code = 0xc7;
- break;
- case 0xe8:
- code = 0xe9;
- break;
- case 0x9d:
- code = 0xe8;
- break;
- case 0xea:
- code = 0xeb;
- break;
- case 0xeb:
- code = 0xea;
- break;
+ case 0xc8:
+ code = 0xc9;
+ break;
+ case 0xc9:
+ code = 0xc8;
+ break;
+ case 0xc0:
+ code = 0xc2;
+ break;
+ case 0xc2:
+ code = 0xc0;
+ break;
+ case 0xc3:
+ code = 0xc1;
+ break;
+ case 0xc1:
+ code = 0xc3;
+ break;
+ case 0xc4:
+ code = 0xc6;
+ break;
+ case 0xc6:
+ code = 0xc4;
+ break;
+ case 0xc7:
+ code = 0xc5;
+ break;
+ case 0xc5:
+ code = 0xc7;
+ break;
+ case 0xe8:
+ code = 0xe9;
+ break;
+ case 0x9d:
+ code = 0xe8;
+ break;
+ case 0xea:
+ code = 0xeb;
+ break;
+ case 0xeb:
+ code = 0xea;
+ break;
}
bfd_put_8 (abfd, code, contents + irel->r_offset - 1);
@@ -1915,7 +1905,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
value += irel->r_addend;
/* See if the value will fit in 8 bits. */
- if ((long)value < 0x7f && (long)value > -0x80)
+ if ((long) value < 0x7f && (long) value > -0x80)
{
unsigned char code;
@@ -1927,8 +1917,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
if (code == 0xfd)
{
- /* Get the second opcode. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
+ /* Get the second opcode. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
/* We can not relax 0x6b, 0x7b, 0x8b, 0x9b as no 24bit
equivalent instructions exists. */
@@ -1960,9 +1950,9 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
bfd_put_8 (abfd, code, contents + irel->r_offset - 2);
/* Fix the relocation's type. */
- irel->r_info
- = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_MN10300_8);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_MN10300_8);
/* Delete two bytes of data. */
if (!mn10300_elf_relax_delete_bytes (abfd, sec,
@@ -1971,12 +1961,11 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* That will change things, so, we should relax
again. Note that this is not required, and it
- may be slow. */
+ may be slow. */
*again = true;
break;
}
}
-
}
}
}
@@ -1991,7 +1980,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* See if the value will fit in 24 bits.
We allow any 16bit match here. We prune those we can't
handle below. */
- if ((long)value < 0x7fffff && (long)value > -0x800000)
+ if ((long) value < 0x7fffff && (long) value > -0x800000)
{
unsigned char code;
@@ -2009,7 +1998,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* All the am33 32 -> 24 relaxing possibilities. */
/* We can not relax 0x6b, 0x7b, 0x8b, 0x9b as no 24bit
equivalent instructions exists. */
- if (code != 0x6b && code != 0x7b
+ if (code != 0x6b && code != 0x7b
&& code != 0x8b && code != 0x9b
&& ((code & 0x0f) == 0x09 || (code & 0x0f) == 0x08
|| (code & 0x0f) == 0x0a || (code & 0x0f) == 0x0b
@@ -2037,9 +2026,9 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
bfd_put_8 (abfd, code, contents + irel->r_offset - 2);
/* Fix the relocation's type. */
- irel->r_info
- = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_MN10300_24);
+ irel->r_info =
+ ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_MN10300_24);
/* Delete one byte of data. */
if (!mn10300_elf_relax_delete_bytes (abfd, sec,
@@ -2048,19 +2037,18 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* That will change things, so, we should relax
again. Note that this is not required, and it
- may be slow. */
+ may be slow. */
*again = true;
break;
}
}
-
}
}
/* See if the value will fit in 16 bits.
We allow any 16bit match here. We prune those we can't
handle below. */
- if ((long)value < 0x7fff && (long)value > -0x8000)
+ if ((long) value < 0x7fff && (long) value > -0x8000)
{
unsigned char code;
@@ -2195,6 +2183,11 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
case 0x91:
case 0x92:
case 0x93:
+ /* sp-based offsets are zero-extended. */
+ if (code >= 0x90 && code <= 0x93
+ && (long)value < 0)
+ continue;
+
/* Note that we've changed the relocation contents, etc. */
elf_section_data (sec)->relocs = internal_relocs;
free_relocs = NULL;
@@ -2243,6 +2236,11 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
&& (value & 0x8000))
continue;
+ /* mov imm16, an zero-extends the immediate. */
+ if (code == 0xdc
+ && (long)value < 0)
+ continue;
+
/* Note that we've changed the relocation contents, etc. */
elf_section_data (sec)->relocs = internal_relocs;
free_relocs = NULL;
@@ -2288,18 +2286,18 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
break;
/* mov (abs32),an -> mov (abs16),an
- mov (d32,sp),an -> mov (d32,sp),an
- mov (d32,sp),dn -> mov (d32,sp),dn
- movbu (d32,sp),dn -> movbu (d32,sp),dn
- movhu (d32,sp),dn -> movhu (d32,sp),dn
+ mov (d32,sp),an -> mov (d16,sp),an
+ mov (d32,sp),dn -> mov (d16,sp),dn
+ movbu (d32,sp),dn -> movbu (d16,sp),dn
+ movhu (d32,sp),dn -> movhu (d16,sp),dn
add imm32,dn -> add imm16,dn
cmp imm32,dn -> cmp imm16,dn
add imm32,an -> add imm16,an
cmp imm32,an -> cmp imm16,an
- and imm32,dn -> and imm32,dn
- or imm32,dn -> or imm32,dn
- xor imm32,dn -> xor imm32,dn
- btst imm32,dn -> btst imm32,dn */
+ and imm32,dn -> and imm16,dn
+ or imm32,dn -> or imm16,dn
+ xor imm32,dn -> xor imm16,dn
+ btst imm32,dn -> btst imm16,dn */
case 0xa0:
case 0xb0:
@@ -2315,6 +2313,16 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
case 0xe1:
case 0xe2:
case 0xe3:
+ /* cmp imm16, an zero-extends the immediate. */
+ if (code == 0xdc
+ && (long)value < 0)
+ continue;
+
+ /* So do sp-based offsets. */
+ if (code >= 0xb0 && code <= 0xb3
+ && (long)value < 0)
+ continue;
+
/* Note that we've changed the relocation contents, etc. */
elf_section_data (sec)->relocs = internal_relocs;
free_relocs = NULL;
@@ -2363,7 +2371,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* Fix the relocation's type. */
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_MN10300_16);
+ R_MN10300_16);
/* Delete two bytes of data. */
if (!mn10300_elf_relax_delete_bytes (abfd, sec,
@@ -2642,7 +2650,7 @@ mn10300_elf_symbol_address_p (abfd, sec, extsyms, addr)
return true;
}
- sym_hash = (struct elf32_mn10300_link_hash_entry **)(elf_sym_hashes (abfd));
+ sym_hash = (struct elf32_mn10300_link_hash_entry **) (elf_sym_hashes (abfd));
sym_hash_end = (sym_hash
+ (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
- symtab_hdr->sh_info));
@@ -2879,12 +2887,12 @@ elf_mn10300_mach (flags)
{
switch (flags & EF_MN10300_MACH)
{
- case E_MN10300_MACH_MN10300:
- default:
- return bfd_mach_mn10300;
+ case E_MN10300_MACH_MN10300:
+ default:
+ return bfd_mach_mn10300;
- case E_MN10300_MACH_AM33:
- return bfd_mach_am33;
+ case E_MN10300_MACH_AM33:
+ return bfd_mach_am33;
}
}
@@ -2892,7 +2900,6 @@ elf_mn10300_mach (flags)
file. This gets the MN10300 architecture right based on the machine
number. */
-/*ARGSUSED*/
void
_bfd_mn10300_elf_final_write_processing (abfd, linker)
bfd *abfd;
@@ -2902,14 +2909,14 @@ _bfd_mn10300_elf_final_write_processing (abfd, linker)
switch (bfd_get_mach (abfd))
{
- default:
- case bfd_mach_mn10300:
- val = E_MN10300_MACH_MN10300;
- break;
-
- case bfd_mach_am33:
- val = E_MN10300_MACH_AM33;
- break;
+ default:
+ case bfd_mach_mn10300:
+ val = E_MN10300_MACH_MN10300;
+ break;
+
+ case bfd_mach_am33:
+ val = E_MN10300_MACH_AM33;
+ break;
}
elf_elfheader (abfd)->e_flags &= ~ (EF_MN10300_MACH);
@@ -2921,7 +2928,7 @@ _bfd_mn10300_elf_object_p (abfd)
bfd *abfd;
{
bfd_default_set_arch_mach (abfd, bfd_arch_mn10300,
- elf_mn10300_mach (elf_elfheader (abfd)->e_flags));
+ elf_mn10300_mach (elf_elfheader (abfd)->e_flags));
return true;
}
@@ -2948,7 +2955,6 @@ _bfd_mn10300_elf_merge_private_bfd_data (ibfd, obfd)
return true;
}
-
#define TARGET_LITTLE_SYM bfd_elf32_mn10300_vec
#define TARGET_LITTLE_NAME "elf32-mn10300"
#define ELF_ARCH bfd_arch_mn10300
@@ -2977,5 +2983,4 @@ _bfd_mn10300_elf_merge_private_bfd_data (ibfd, obfd)
#define bfd_elf32_bfd_merge_private_bfd_data \
_bfd_mn10300_elf_merge_private_bfd_data
-
#include "elf32-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-arc.c b/gnu/usr.bin/binutils/bfd/elf32-arc.c
index 318dc704e06..82b610435fa 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-arc.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-arc.c
@@ -1,22 +1,22 @@
/* ARC-specific support for 32-bit ELF
- Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1997, 1999, 2001 Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -25,77 +25,80 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf/arc.h"
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+ PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void arc_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
-static boolean arc_elf_object_p PARAMS ((bfd *));
-static void arc_elf_final_write_processing PARAMS ((bfd *, boolean));
+static boolean arc_elf_object_p
+ PARAMS ((bfd *));
+static void arc_elf_final_write_processing
+ PARAMS ((bfd *, boolean));
/* Try to minimize the amount of space occupied by relocation tables
on the ROM (not that the ROM won't be swamped by other ELF overhead). */
+
#define USE_REL
static reloc_howto_type elf_arc_howto_table[] =
{
/* This reloc does nothing. */
- HOWTO (R_ARC_NONE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_ARC_NONE", /* name */
- false, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- false), /* pcrel_offset */
+ HOWTO (R_ARC_NONE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARC_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
/* A standard 32 bit relocation. */
- HOWTO (R_ARC_32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_ARC_32", /* name */
- false, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- false), /* pcrel_offset */
+ HOWTO (R_ARC_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARC_32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
/* A 26 bit absolute branch, right shifted by 2. */
- HOWTO (R_ARC_B26, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_ARC_B26", /* name */
- false, /* partial_inplace */
- 0x00ffffff, /* src_mask */
- 0x00ffffff, /* dst_mask */
- false), /* pcrel_offset */
+ HOWTO (R_ARC_B26, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARC_B26", /* name */
+ false, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ false), /* pcrel_offset */
/* A relative 22 bit branch; bits 21-2 are stored in bits 26-7. */
- HOWTO (R_ARC_B22_PCREL, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 22, /* bitsize */
- true, /* pc_relative */
- 7, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_ARC_B22_PCREL", /* name */
- false, /* partial_inplace */
- 0x07ffff80, /* src_mask */
- 0x07ffff80, /* dst_mask */
- true), /* pcrel_offset */
+ HOWTO (R_ARC_B22_PCREL, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 22, /* bitsize */
+ true, /* pc_relative */
+ 7, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARC_B22_PCREL", /* name */
+ false, /* partial_inplace */
+ 0x07ffff80, /* src_mask */
+ 0x07ffff80, /* dst_mask */
+ true), /* pcrel_offset */
};
@@ -123,14 +126,11 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
{
unsigned int i;
- for (i = 0;
- i < sizeof (arc_reloc_map) / sizeof (struct arc_reloc_map);
- i++)
+ for (i = 0; i < sizeof (arc_reloc_map) / sizeof (struct arc_reloc_map); i++)
{
if (arc_reloc_map[i].bfd_reloc_val == code)
return &elf_arc_howto_table[arc_reloc_map[i].elf_reloc_val];
}
-
return NULL;
}
@@ -155,21 +155,30 @@ static boolean
arc_elf_object_p (abfd)
bfd *abfd;
{
- int mach;
- unsigned long arch = elf_elfheader (abfd)->e_flags & EF_ARC_MACH;
+ int mach = bfd_mach_arc_6;
- switch (arch)
+ if (elf_elfheader(abfd)->e_machine == EM_ARC)
{
- case E_ARC_MACH_BASE:
- mach = bfd_mach_arc_base;
- break;
- default:
- /* Unknown cpu type. ??? What to do? */
- return false;
+ unsigned long arch = elf_elfheader (abfd)->e_flags & EF_ARC_MACH;
+
+ switch (arch)
+ {
+ case E_ARC_MACH_ARC5:
+ mach = bfd_mach_arc_5;
+ break;
+ default:
+ case E_ARC_MACH_ARC6:
+ mach = bfd_mach_arc_6;
+ break;
+ case E_ARC_MACH_ARC7:
+ mach = bfd_mach_arc_7;
+ break;
+ case E_ARC_MACH_ARC8:
+ mach = bfd_mach_arc_8;
+ break;
+ }
}
-
- (void) bfd_default_set_arch_mach (abfd, bfd_arch_arc, mach);
- return true;
+ return bfd_default_set_arch_mach (abfd, bfd_arch_arc, mach);
}
/* The final processing done just before writing out an ARC ELF object file.
@@ -180,34 +189,40 @@ arc_elf_final_write_processing (abfd, linker)
bfd *abfd;
boolean linker ATTRIBUTE_UNUSED;
{
- int mach;
unsigned long val;
- switch (mach = bfd_get_mach (abfd))
+ switch (bfd_get_mach (abfd))
{
- case bfd_mach_arc_base:
- val = E_ARC_MACH_BASE;
+ case bfd_mach_arc_5:
+ val = E_ARC_MACH_ARC5;
break;
default:
- return;
+ case bfd_mach_arc_6:
+ val = E_ARC_MACH_ARC6;
+ break;
+ case bfd_mach_arc_7:
+ val = E_ARC_MACH_ARC7;
+ break;
+ case bfd_mach_arc_8:
+ val = E_ARC_MACH_ARC8;
+ break;
}
-
+ elf_elfheader (abfd)->e_machine = EM_ARC;
elf_elfheader (abfd)->e_flags &=~ EF_ARC_MACH;
elf_elfheader (abfd)->e_flags |= val;
}
-#define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec
-#define TARGET_LITTLE_NAME "elf32-littlearc"
-#define TARGET_BIG_SYM bfd_elf32_bigarc_vec
-#define TARGET_BIG_NAME "elf32-bigarc"
-#define ELF_ARCH bfd_arch_arc
-#define ELF_MACHINE_CODE EM_CYGNUS_ARC
-#define ELF_MAXPAGESIZE 0x1000
-
-#define elf_info_to_howto 0
-#define elf_info_to_howto_rel arc_info_to_howto_rel
-#define elf_backend_object_p arc_elf_object_p
-#define elf_backend_final_write_processing \
- arc_elf_final_write_processing
+#define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec
+#define TARGET_LITTLE_NAME "elf32-littlearc"
+#define TARGET_BIG_SYM bfd_elf32_bigarc_vec
+#define TARGET_BIG_NAME "elf32-bigarc"
+#define ELF_ARCH bfd_arch_arc
+#define ELF_MACHINE_CODE EM_ARC
+#define ELF_MAXPAGESIZE 0x1000
+
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel arc_info_to_howto_rel
+#define elf_backend_object_p arc_elf_object_p
+#define elf_backend_final_write_processing arc_elf_final_write_processing
#include "elf32-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-avr.c b/gnu/usr.bin/binutils/bfd/elf32-avr.c
index c64ab28d295..d776e2c97ce 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-avr.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-avr.c
@@ -1,5 +1,5 @@
/* AVR-specific support for 32-bit ELF
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library.
@@ -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. */
-
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
@@ -47,7 +46,6 @@ static boolean elf32_avr_relocate_section
static void bfd_elf_avr_final_write_processing PARAMS ((bfd *, boolean));
static boolean elf32_avr_object_p PARAMS ((bfd *));
-
/* Use RELA instead of REL */
#undef USE_REL
@@ -369,7 +367,7 @@ struct avr_reloc_map
static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
unsigned int i;
@@ -389,7 +387,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
static void
avr_info_to_howto_rela (abfd, cache_ptr, dst)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr;
Elf32_Internal_Rela *dst;
{
@@ -403,7 +401,7 @@ avr_info_to_howto_rela (abfd, cache_ptr, dst)
static asection *
elf32_avr_gc_mark_hook (abfd, info, rel, h, sym)
bfd *abfd;
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
Elf_Internal_Rela *rel;
struct elf_link_hash_entry *h;
Elf_Internal_Sym *sym;
@@ -442,10 +440,10 @@ elf32_avr_gc_mark_hook (abfd, info, rel, h, sym)
static boolean
elf32_avr_gc_sweep_hook (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
{
/* We don't use got and plt entries for avr. */
return true;
@@ -472,7 +470,7 @@ elf32_avr_check_relocs (abfd, info, sec, relocs)
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;
@@ -516,7 +514,7 @@ avr_final_link_relocate (howto, input_bfd, input_section,
srel = (bfd_signed_vma) relocation;
srel += rel->r_addend;
srel -= rel->r_offset;
- srel -= 2; /* Branch instructions add 2 to the PC... */
+ srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= (input_section->output_section->vma +
input_section->output_offset);
@@ -534,7 +532,7 @@ avr_final_link_relocate (howto, input_bfd, input_section,
srel = (bfd_signed_vma) relocation;
srel += rel->r_addend;
srel -= rel->r_offset;
- srel -= 2; /* Branch instructions add 2 to the PC... */
+ srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= (input_section->output_section->vma +
input_section->output_offset);
@@ -548,15 +546,15 @@ avr_final_link_relocate (howto, input_bfd, input_section,
if (srel < -2048 || srel > 2047)
{
/* Apply WRAPAROUND if possible. */
- if (bfd_get_mach (input_bfd) == bfd_mach_avr2)
+ switch (bfd_get_mach (input_bfd))
{
- if (srel > 2047)
- srel -= 4096;
- else
- srel += 4096;
+ case bfd_mach_avr2:
+ case bfd_mach_avr4:
+ break;
+
+ default:
+ return bfd_reloc_overflow;
}
- else
- return bfd_reloc_overflow;
}
x = bfd_get_16 (input_bfd, contents);
@@ -717,7 +715,7 @@ avr_final_link_relocate (howto, input_bfd, input_section,
static boolean
elf32_avr_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, local_syms, local_sections)
- bfd *output_bfd;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info;
bfd *input_bfd;
asection *input_section;
@@ -899,6 +897,9 @@ bfd_elf_avr_final_write_processing (abfd, linker)
val = E_AVR_MACH_AVR4;
break;
+ case bfd_mach_avr5:
+ val = E_AVR_MACH_AVR5;
+ break;
}
elf_elfheader (abfd)->e_machine = EM_AVR;
@@ -934,13 +935,16 @@ elf32_avr_object_p (abfd)
case E_AVR_MACH_AVR4:
e_set = bfd_mach_avr4;
break;
+
+ case E_AVR_MACH_AVR5:
+ e_set = bfd_mach_avr5;
+ break;
}
}
return bfd_default_set_arch_mach (abfd, bfd_arch_avr,
e_set);
}
-
#define ELF_ARCH bfd_arch_avr
#define ELF_MACHINE_CODE EM_AVR
#define ELF_MAXPAGESIZE 1
@@ -959,5 +963,4 @@ elf32_avr_object_p (abfd)
bfd_elf_avr_final_write_processing
#define elf_backend_object_p elf32_avr_object_p
-
#include "elf32-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-cris.c b/gnu/usr.bin/binutils/bfd/elf32-cris.c
new file mode 100644
index 00000000000..dcb86166249
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elf32-cris.c
@@ -0,0 +1,712 @@
+/* CRIS-specific support for 32-bit ELF.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Axis Communications AB.
+ Written by Hans-Peter Nilsson, based on elf32-fr30.c
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/cris.h"
+
+/* Forward declarations. */
+static reloc_howto_type * cris_reloc_type_lookup
+ PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+
+static void cris_info_to_howto_rela
+ PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
+
+static boolean cris_elf_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+
+static bfd_reloc_status_type cris_final_link_relocate
+ PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, bfd_vma));
+
+static boolean cris_elf_gc_sweep_hook
+ PARAMS ((bfd *, struct bfd_link_info *, asection *,
+ const Elf_Internal_Rela *));
+
+static asection * cris_elf_gc_mark_hook
+ PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *, Elf_Internal_Sym *));
+
+static boolean cris_elf_object_p PARAMS ((bfd *));
+
+static void cris_elf_final_write_processing PARAMS ((bfd *, boolean));
+
+static boolean cris_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
+
+static boolean cris_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
+
+static reloc_howto_type cris_elf_howto_table [] =
+{
+ /* This reloc does nothing. */
+ HOWTO (R_CRIS_NONE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CRIS_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* An 8 bit absolute relocation. */
+ HOWTO (R_CRIS_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CRIS_8", /* name */
+ false, /* partial_inplace */
+ 0x0000, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit absolute relocation. */
+ HOWTO (R_CRIS_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CRIS_16", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 32 bit absolute relocation. */
+ HOWTO (R_CRIS_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CRIS_32", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* An 8 bit absolute relocation. */
+ HOWTO (R_CRIS_8_PCREL, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CRIS_8_PCREL", /* name */
+ false, /* partial_inplace */
+ 0x0000, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit absolute relocation. */
+ HOWTO (R_CRIS_16_PCREL, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CRIS_16", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 32 bit absolute relocation. */
+ HOWTO (R_CRIS_32_PCREL, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CRIS_32", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_CRIS_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_CRIS_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_CRIS_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_CRIS_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false) /* pcrel_offset */
+};
+
+/* Map BFD reloc types to CRIS ELF reloc types. */
+
+struct cris_reloc_map
+{
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned int cris_reloc_val;
+};
+
+static const struct cris_reloc_map cris_reloc_map [] =
+{
+ { BFD_RELOC_NONE, R_CRIS_NONE },
+ { BFD_RELOC_8, R_CRIS_8 },
+ { BFD_RELOC_16, R_CRIS_16 },
+ { BFD_RELOC_32, R_CRIS_32 },
+ { BFD_RELOC_8_PCREL, R_CRIS_8_PCREL },
+ { BFD_RELOC_16_PCREL, R_CRIS_16_PCREL },
+ { BFD_RELOC_32_PCREL, R_CRIS_32_PCREL },
+ { BFD_RELOC_VTABLE_INHERIT, R_CRIS_GNU_VTINHERIT },
+ { BFD_RELOC_VTABLE_ENTRY, R_CRIS_GNU_VTENTRY }
+};
+
+static reloc_howto_type *
+cris_reloc_type_lookup (abfd, code)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+
+ for (i = sizeof (cris_reloc_map) / sizeof (cris_reloc_map[0]);
+ --i;)
+ if (cris_reloc_map [i].bfd_reloc_val == code)
+ return & cris_elf_howto_table [cris_reloc_map[i].cris_reloc_val];
+
+ return NULL;
+}
+
+/* Set the howto pointer for an CRIS ELF reloc. */
+
+static void
+cris_info_to_howto_rela (abfd, cache_ptr, dst)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ arelent * cache_ptr;
+ Elf32_Internal_Rela * dst;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_CRIS_max);
+ cache_ptr->howto = & cris_elf_howto_table [r_type];
+}
+
+/* Perform a single relocation. By default we use the standard BFD
+ routines, but we might have to do a few relocs ourselves in the future. */
+
+static bfd_reloc_status_type
+cris_final_link_relocate (howto, input_bfd, input_section, contents, rel,
+ relocation)
+ reloc_howto_type * howto;
+ bfd * input_bfd;
+ asection * input_section;
+ bfd_byte * contents;
+ Elf_Internal_Rela * rel;
+ bfd_vma relocation;
+{
+ bfd_reloc_status_type r
+ = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
+ return r;
+}
+
+/* Relocate an CRIS ELF section. See elf32-fr30.c, from where this was
+ copied, for further comments. */
+
+static boolean
+cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd * output_bfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info * info;
+ bfd * input_bfd;
+ asection * input_section;
+ bfd_byte * contents;
+ Elf_Internal_Rela * relocs;
+ Elf_Internal_Sym * local_syms;
+ asection ** local_sections;
+{
+ Elf_Internal_Shdr * symtab_hdr;
+ struct elf_link_hash_entry ** sym_hashes;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
+
+ symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+ relend = relocs + input_section->reloc_count;
+
+ /* It seems this can happen with erroneous or unsupported input (mixing
+ a.out and elf in an archive, for example.) */
+ if (sym_hashes == NULL)
+ return false;
+
+ for (rel = relocs; rel < relend; rel ++)
+ {
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
+ struct elf_link_hash_entry * h;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type;
+
+ r_type = ELF32_R_TYPE (rel->r_info);
+
+ if ( r_type == R_CRIS_GNU_VTINHERIT
+ || r_type == R_CRIS_GNU_VTENTRY)
+ continue;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
+ if (info->relocateable)
+ {
+ /* This is a relocateable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections [r_symndx];
+ rel->r_addend += sec->output_offset + sym->st_value;
+ }
+ }
+
+ continue;
+ }
+
+ /* This is a final link. */
+ howto = cris_elf_howto_table + ELF32_R_TYPE (rel->r_info);
+ h = NULL;
+ sym = NULL;
+ sec = NULL;
+
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections [r_symndx];
+ relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+ name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+#if 0
+ fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n",
+ sec->name, name, sym->st_name,
+ sec->output_section->vma, sec->output_offset,
+ sym->st_value, rel->r_addend);
+#endif
+ }
+ else
+ {
+ h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ name = h->root.root.string;
+
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ sec = h->root.u.def.section;
+ relocation = (h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+#if 0
+ fprintf (stderr,
+ "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
+ sec->name, name, h->root.u.def.value,
+ sec->output_section->vma, sec->output_offset, relocation);
+#endif
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ {
+#if 0
+ fprintf (stderr, "undefined: sec: %s, name: %s\n",
+ sec->name, name);
+#endif
+ relocation = 0;
+ }
+ else if (info->shared
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
+ relocation = 0;
+ else
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset, true)))
+ return false;
+#if 0
+ fprintf (stderr, "unknown: name: %s\n", name);
+#endif
+ relocation = 0;
+ }
+ }
+
+ r = cris_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel, relocation);
+
+ if (r != bfd_reloc_ok)
+ {
+ const char * msg = (const char *) NULL;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ r = info->callbacks->reloc_overflow
+ (info, name, howto->name, (bfd_vma) 0,
+ input_bfd, input_section, rel->r_offset);
+ break;
+
+ case bfd_reloc_undefined:
+ r = info->callbacks->undefined_symbol
+ (info, name, input_bfd, input_section, rel->r_offset,
+ true);
+ break;
+
+ case bfd_reloc_outofrange:
+ msg = _("internal error: out of range error");
+ break;
+
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ break;
+
+ case bfd_reloc_dangerous:
+ msg = _("internal error: dangerous relocation");
+ break;
+
+ default:
+ msg = _("internal error: unknown error");
+ break;
+ }
+
+ if (msg)
+ r = info->callbacks->warning
+ (info, msg, name, input_bfd, input_section, rel->r_offset);
+
+ if (! r)
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/* Return the section that should be marked against GC for a given
+ relocation. */
+
+static asection *
+cris_elf_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd * abfd;
+ struct bfd_link_info * info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela * rel;
+ struct elf_link_hash_entry * h;
+ Elf_Internal_Sym * sym;
+{
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_CRIS_GNU_VTINHERIT:
+ case R_CRIS_GNU_VTENTRY:
+ break;
+
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+
+ return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+
+static boolean
+cris_elf_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info * info ATTRIBUTE_UNUSED;
+ asection * sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+/* Look through the relocs for a section during the first phase.
+ Since we don't do .gots or .plts, we just need to consider the
+ virtual table relocs for gc. */
+
+static boolean
+cris_elf_check_relocs (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+
+ if (info->relocateable)
+ return true;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym);
+ if (!elf_bad_symtab (abfd))
+ sym_hashes_end -= symtab_hdr->sh_info;
+
+ rel_end = relocs + sec->reloc_count;
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ struct elf_link_hash_entry *h;
+ unsigned long r_symndx;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_CRIS_GNU_VTINHERIT:
+ 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_CRIS_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return false;
+ break;
+ }
+ }
+
+ return true;
+}
+
+/* Reject a file depending on underscores on symbols. */
+
+static boolean
+cris_elf_object_p (abfd)
+ bfd *abfd;
+{
+ if ((elf_elfheader (abfd)->e_flags & EF_CRIS_UNDERSCORE))
+ return (bfd_get_symbol_leading_char (abfd) == '_');
+ else
+ return (bfd_get_symbol_leading_char (abfd) == 0);
+}
+
+/* Mark presence or absence of leading underscore. */
+
+static void
+cris_elf_final_write_processing (abfd, linker)
+ bfd *abfd;
+ boolean linker ATTRIBUTE_UNUSED;
+{
+ if (bfd_get_symbol_leading_char (abfd) == '_')
+ elf_elfheader (abfd)->e_flags |= EF_CRIS_UNDERSCORE;
+ else
+ elf_elfheader (abfd)->e_flags &= ~EF_CRIS_UNDERSCORE;
+}
+
+/* Display the flags field. */
+
+static boolean
+cris_elf_print_private_bfd_data (abfd, ptr)
+ bfd *abfd;
+ PTR ptr;
+{
+ FILE *file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL)
+
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
+
+ if (elf_elfheader (abfd)->e_flags & EF_CRIS_UNDERSCORE)
+ fprintf (file, _(" [symbols have a _ prefix]"));
+
+ fputc ('\n', file);
+ return true;
+}
+
+/* Don't mix files with and without a leading underscore. */
+
+static boolean
+cris_elf_merge_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ flagword old_flags, new_flags;
+
+ 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;
+
+ if (! elf_flags_init (obfd))
+ {
+ /* This happens when ld starts out with a 'blank' output file. */
+ elf_flags_init (obfd) = true;
+
+ /* Set flags according to current bfd_target. */
+ cris_elf_final_write_processing (obfd, false);
+ }
+
+ old_flags = elf_elfheader (obfd)->e_flags;
+ new_flags = elf_elfheader (ibfd)->e_flags;
+
+ /* Is this good or bad? We'll follow with other excluding flags. */
+ if ((old_flags & EF_CRIS_UNDERSCORE) != (new_flags & EF_CRIS_UNDERSCORE))
+ {
+ (*_bfd_error_handler)
+ ((new_flags & EF_CRIS_UNDERSCORE)
+ ? _("%s: uses _-prefixed symbols, but writing file with non-prefixed symbols")
+ : _("%s: uses non-prefixed symbols, but writing file with _-prefixed symbols"),
+ bfd_get_filename (ibfd));
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ return true;
+}
+
+#define ELF_ARCH bfd_arch_cris
+#define ELF_MACHINE_CODE EM_CRIS
+#define ELF_MAXPAGESIZE 0x2000
+
+#define TARGET_LITTLE_SYM bfd_elf32_cris_vec
+#define TARGET_LITTLE_NAME "elf32-cris"
+#define elf_symbol_leading_char 0
+
+#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto cris_info_to_howto_rela
+#define elf_backend_relocate_section cris_elf_relocate_section
+#define elf_backend_gc_mark_hook cris_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook cris_elf_gc_sweep_hook
+#define elf_backend_check_relocs cris_elf_check_relocs
+
+#define elf_backend_can_gc_sections 1
+
+#define elf_backend_object_p cris_elf_object_p
+#define elf_backend_final_write_processing \
+ cris_elf_final_write_processing
+#define bfd_elf32_bfd_print_private_bfd_data \
+ cris_elf_print_private_bfd_data
+#define bfd_elf32_bfd_merge_private_bfd_data \
+ cris_elf_merge_private_bfd_data
+
+#define bfd_elf32_bfd_reloc_type_lookup cris_reloc_type_lookup
+
+/* Later, we my want to optimize RELA entries into REL entries for dynamic
+ linking and libraries (if it's a win of any significance). Until then,
+ take the easy route. */
+#define elf_backend_may_use_rel_p 0
+#define elf_backend_may_use_rela_p 1
+
+#include "elf32-target.h"
+
+#define INCLUDED_TARGET_FILE
+
+#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_NAME
+#undef elf_symbol_leading_char
+
+#define TARGET_LITTLE_SYM bfd_elf32_us_cris_vec
+#define TARGET_LITTLE_NAME "elf32-us-cris"
+#define elf_symbol_leading_char '_'
+
+#include "elf32-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-d10v.c b/gnu/usr.bin/binutils/bfd/elf32-d10v.c
index dd2e892ad08..913e8578a62 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-d10v.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-d10v.c
@@ -1,5 +1,5 @@
/* D10V-specific support for 32-bit ELF
- Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -22,31 +22,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
#include "elf-bfd.h"
-/* #include "elf/d10v.h" */
+#include "elf/d10v.h"
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void d10v_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
-
/* Use REL instead of RELA to save space */
#define USE_REL
-enum reloc_type
-{
- R_D10V_NONE = 0,
- R_D10V_10_PCREL_R,
- R_D10V_10_PCREL_L,
- R_D10V_16,
- R_D10V_18,
- R_D10V_18_PCREL,
- R_D10V_32,
- R_D10V_GNU_VTINHERIT,
- R_D10V_GNU_VTENTRY,
- R_D10V_max
-};
-
static reloc_howto_type elf_d10v_howto_table[] =
{
/* This reloc does nothing. */
@@ -185,7 +170,7 @@ static reloc_howto_type elf_d10v_howto_table[] =
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
-
+
};
/* Map BFD reloc types to D10V ELF reloc types. */
@@ -300,7 +285,7 @@ elf32_d10v_gc_sweep_hook (abfd, info, sec, relocs)
/* Look through the relocs for a section during the first phase.
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
-
+
static boolean
elf32_d10v_check_relocs (abfd, info, sec, relocs)
bfd *abfd;
@@ -312,28 +297,28 @@ elf32_d10v_check_relocs (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
-
+
if (info->relocateable)
return true;
-
+
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
- sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
+ 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];
-
+
switch (ELF32_R_TYPE (rel->r_info))
{
/* This relocation describes the C++ object vtable hierarchy.
@@ -342,7 +327,7 @@ elf32_d10v_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_D10V_GNU_VTENTRY:
@@ -351,7 +336,7 @@ elf32_d10v_check_relocs (abfd, info, sec, relocs)
break;
}
}
-
+
return true;
}
@@ -464,7 +449,7 @@ elf32_d10v_relocate_section (output_bfd, info, input_bfd, input_section,
if (name == NULL || *name == '\0')
name = bfd_section_name (input_bfd, sec);
}
-
+
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset,
relocation, rel->r_addend);
diff --git a/gnu/usr.bin/binutils/bfd/elf32-d30v.c b/gnu/usr.bin/binutils/bfd/elf32-d30v.c
index 263b5c010e5..249051378f3 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-d30v.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-d30v.c
@@ -1,5 +1,5 @@
/* D30V-specific support for 32-bit ELF
- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -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 "elf/d30v.h"
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
@@ -46,24 +47,6 @@ static bfd_reloc_status_type bfd_elf_d30v_reloc_21 PARAMS ((
bfd *output_bfd,
char **error_message));
-enum reloc_type
-{
- R_D30V_NONE = 0,
- R_D30V_6,
- R_D30V_9_PCREL,
- R_D30V_9_PCREL_R,
- R_D30V_15,
- R_D30V_15_PCREL,
- R_D30V_15_PCREL_R,
- R_D30V_21,
- R_D30V_21_PCREL,
- R_D30V_21_PCREL_R,
- R_D30V_32,
- R_D30V_32_PCREL,
- R_D30V_32_NORMAL,
- R_D30V_max
-};
-
static reloc_howto_type elf_d30v_howto_table[] =
{
/* This reloc does nothing. */
@@ -263,8 +246,8 @@ static reloc_howto_type elf_d30v_howto_table[] =
};
-#define MIN32 (long long)0xffffffff80000000LL
-#define MAX32 0x7fffffffLL
+#define MAX32 ((bfd_signed_vma) 0x7fffffff)
+#define MIN32 (- MAX32 - 1)
static bfd_reloc_status_type
bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message)
@@ -276,7 +259,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
bfd *output_bfd;
char **error_message;
{
- long long relocation;
+ bfd_signed_vma relocation;
bfd_vma in1, in2, num;
bfd_vma tmp_addr = 0;
bfd_reloc_status_type r;
@@ -287,10 +270,17 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
reloc_howto_type *howto = reloc_entry->howto;
int make_absolute = 0;
+ if (output_bfd != (bfd *) NULL)
+ {
+ /* Partial linking -- do nothing. */
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
input_section, output_bfd, error_message);
if (r != bfd_reloc_continue)
- return r;
+ return r;
/* a hacked-up version of bfd_perform_reloc() follows */
if (bfd_is_und_section (symbol->section)
@@ -314,11 +304,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
reloc_target_output_section = symbol->section->output_section;
/* Convert input-section-relative symbol value to absolute. */
- if (output_bfd)
- output_base = 0;
- else
- output_base = reloc_target_output_section->vma;
-
+ output_base = reloc_target_output_section->vma;
relocation += output_base + symbol->section->output_offset;
/* Add in supplied addend. */
@@ -329,23 +315,11 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
if (howto->pc_relative == true)
{
- tmp_addr = input_section->output_section->vma + input_section->output_offset
+ tmp_addr = input_section->output_section->vma + input_section->output_offset
+ reloc_entry->address;
relocation -= tmp_addr;
}
-
- if (output_bfd != (bfd *) NULL)
- {
- /* This is a partial relocation, and we want to apply the relocation
- to the reloc entry rather than the raw data. Modify the reloc
- inplace to reflect what we now know. */
- reloc_entry->addend = relocation;
- reloc_entry->address += input_section->output_offset;
- return flag;
- }
- else
- reloc_entry->addend = 0;
-
+
in1 = bfd_get_32 (abfd, (bfd_byte *) data + addr);
in2 = bfd_get_32 (abfd, (bfd_byte *) data + addr + 4);
@@ -355,30 +329,25 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
| ((in1 & 0x3F) << 26));
in1 &= 0xFFFFFFC0;
in2 = 0x80000000;
-
+
relocation += num;
if (howto->pc_relative == true && howto->bitsize == 32)
{
- /* the D30V has a PC that doesn't wrap and PC-relative jumps */
- /* are signed, so a PC-relative jump can'tbe more than +/- 2^31 byrtes */
- /* if one exceeds this, change it to an absolute jump */
- if (relocation > MAX32)
- {
- relocation = (relocation + tmp_addr) & 0xffffffff;
- make_absolute = 1;
- }
- else if (relocation < MIN32)
+ /* The D30V has a PC that doesn't wrap and PC-relative jumps are
+ signed, so a PC-relative jump can't be more than +/- 2^31 bytes.
+ If one exceeds this, change it to an absolute jump. */
+ if (relocation > MAX32 || relocation < MIN32)
{
relocation = (relocation + tmp_addr) & 0xffffffff;
make_absolute = 1;
}
}
-
+
in1 |= (relocation >> 26) & 0x3F; /* top 6 bits */
- in2 |= ((relocation & 0x03FC0000) << 2); /* next 8 bits */
+ in2 |= ((relocation & 0x03FC0000) << 2); /* next 8 bits */
in2 |= relocation & 0x0003FFFF; /* bottom 18 bits */
-
+
/* change a PC-relative instruction to its absolute equivalent */
/* with this simple hack */
if (make_absolute)
@@ -386,10 +355,9 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
bfd_put_32 (abfd, in1, (bfd_byte *) data + addr);
bfd_put_32 (abfd, in2, (bfd_byte *) data + addr + 4);
-
- return flag;
-}
+ return flag;
+}
static bfd_reloc_status_type
bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message)
@@ -411,10 +379,17 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf
reloc_howto_type *howto = reloc_entry->howto;
int mask, max;
+ if (output_bfd != (bfd *) NULL)
+ {
+ /* Partial linking -- do nothing. */
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
input_section, output_bfd, error_message);
if (r != bfd_reloc_continue)
- return r;
+ return r;
/* a hacked-up version of bfd_perform_reloc() follows */
if (bfd_is_und_section (symbol->section)
@@ -438,11 +413,7 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf
reloc_target_output_section = symbol->section->output_section;
/* Convert input-section-relative symbol value to absolute. */
- if (output_bfd)
- output_base = 0;
- else
- output_base = reloc_target_output_section->vma;
-
+ output_base = reloc_target_output_section->vma;
relocation += output_base + symbol->section->output_offset;
/* Add in supplied addend. */
@@ -453,23 +424,12 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf
if (howto->pc_relative == true)
{
- relocation -= input_section->output_section->vma + input_section->output_offset;
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset);
if (howto->pcrel_offset == true)
relocation -= reloc_entry->address;
}
- if (output_bfd != (bfd *) NULL)
- {
- /* This is a partial relocation, and we want to apply the relocation
- to the reloc entry rather than the raw data. Modify the reloc
- inplace to reflect what we now know. */
- reloc_entry->addend = relocation;
- reloc_entry->address += input_section->output_offset;
- return flag;
- }
- else
- reloc_entry->addend = 0;
-
in1 = bfd_get_32 (abfd, (bfd_byte *) data + addr);
mask = (1 << howto->bitsize) - 1;
@@ -501,16 +461,16 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf
if ((int)relocation > max)
flag = bfd_reloc_overflow;
}
- relocation >>= 3;
+ relocation >>= 3;
if (howto->bitsize == 6)
in1 |= ((relocation & (mask >> 12)) << 12);
else
in1 |= relocation & mask;
bfd_put_32 (abfd, in1, (bfd_byte *) data + addr);
-
+
return flag;
-}
+}
/* Map BFD reloc types to D30V ELF reloc types. */
@@ -520,7 +480,6 @@ struct d30v_reloc_map
unsigned char elf_reloc_val;
};
-
static const struct d30v_reloc_map d30v_reloc_map[] =
{
{ BFD_RELOC_NONE, R_D30V_NONE, },
diff --git a/gnu/usr.bin/binutils/bfd/elf32-fr30.c b/gnu/usr.bin/binutils/bfd/elf32-fr30.c
index 6b295d3e52a..c7a3b2158be 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-fr30.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-fr30.c
@@ -1,5 +1,5 @@
/* FR30-specific support for 32-bit ELF.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,9 +30,9 @@ static bfd_reloc_status_type fr30_elf_i32_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static reloc_howto_type * fr30_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
-static void fr30_info_to_howto_rela
+static void fr30_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
-static boolean fr30_elf_relocate_section
+static boolean fr30_elf_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
static bfd_reloc_status_type fr30_final_link_relocate
PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma));
@@ -132,7 +132,7 @@ static reloc_howto_type fr30_elf_howto_table [] =
0x0000, /* src_mask */
0x00f0, /* dst_mask */
false), /* pcrel_offset */
-
+
/* An 8 bit absolute relocation. */
HOWTO (R_FR30_8_IN_8, /* type */
0, /* rightshift */
@@ -147,7 +147,7 @@ static reloc_howto_type fr30_elf_howto_table [] =
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
false), /* pcrel_offset */
-
+
/* A 9 bit absolute relocation. */
HOWTO (R_FR30_9_IN_8, /* type */
1, /* rightshift */
@@ -162,7 +162,7 @@ static reloc_howto_type fr30_elf_howto_table [] =
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
false), /* pcrel_offset */
-
+
/* A 10 bit absolute relocation. */
HOWTO (R_FR30_10_IN_8, /* type */
2, /* rightshift */
@@ -236,7 +236,6 @@ static reloc_howto_type fr30_elf_howto_table [] =
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
-
};
/* Utility to actually perform an R_FR30_20 reloc. */
@@ -254,7 +253,7 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data,
{
bfd_vma relocation;
unsigned long x;
-
+
/* This part is from bfd_elf_generic_reloc. */
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
@@ -275,16 +274,15 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data,
+ symbol->section->output_offset
+ reloc_entry->addend;
- if (relocation > ((1U << 20) - 1))
+ if (relocation > (((bfd_vma) 1 << 20) - 1))
return bfd_reloc_overflow;
- x = bfd_get_32 (abfd, data + reloc_entry->address);
+ x = bfd_get_32 (abfd, (char *) data + reloc_entry->address);
x = (x & 0xff0f0000) | (relocation & 0x0000ffff) | ((relocation & 0x000f0000) << 4);
- bfd_put_32 (abfd, x, data + reloc_entry->address);
+ bfd_put_32 (abfd, x, (char *) data + reloc_entry->address);
return bfd_reloc_ok;
}
-
/* Utility to actually perform a R_FR30_48 reloc. */
@@ -321,7 +319,7 @@ fr30_elf_i32_reloc (abfd, reloc_entry, symbol, data,
+ symbol->section->output_offset
+ reloc_entry->addend;
- bfd_put_32 (abfd, relocation, data + reloc_entry->address + 2);
+ bfd_put_32 (abfd, relocation, (char *) data + reloc_entry->address + 2);
return bfd_reloc_ok;
}
@@ -362,7 +360,7 @@ fr30_reloc_type_lookup (abfd, code)
--i;)
if (fr30_reloc_map [i].bfd_reloc_val == code)
return & fr30_elf_howto_table [fr30_reloc_map[i].fr30_reloc_val];
-
+
return NULL;
}
@@ -396,7 +394,7 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
bfd_reloc_status_type r = bfd_reloc_ok;
bfd_vma x;
bfd_signed_vma srel;
-
+
switch (howto->type)
{
case R_FR30_20:
@@ -405,12 +403,12 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
if (relocation > ((1 << 20) - 1))
return bfd_reloc_overflow;
-
+
x = bfd_get_32 (input_bfd, contents);
x = (x & 0xff0f0000) | (relocation & 0x0000ffff) | ((relocation & 0x000f0000) << 4);
bfd_put_32 (input_bfd, x, contents);
break;
-
+
case R_FR30_48:
contents += rel->r_offset + 2;
relocation += rel->r_addend;
@@ -422,10 +420,10 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
srel = (bfd_signed_vma) relocation;
srel += rel->r_addend;
srel -= rel->r_offset;
- srel -= 2; /* Branch instructions add 2 to the PC... */
+ srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= (input_section->output_section->vma +
input_section->output_offset);
-
+
if (srel & 1)
return bfd_reloc_outofrange;
if (srel > ((1 << 8) - 1) || (srel < - (1 << 8)))
@@ -439,15 +437,15 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
srel = (bfd_signed_vma) relocation;
srel += rel->r_addend;
srel -= rel->r_offset;
- srel -= 2; /* Branch instructions add 2 to the PC... */
+ srel -= 2; /* Branch instructions add 2 to the PC... */
srel -= (input_section->output_section->vma +
input_section->output_offset);
-
+
if (srel & 1)
return bfd_reloc_outofrange;
if (srel > ((1 << 11) - 1) || (srel < - (1 << 11)))
return bfd_reloc_overflow;
-
+
x = bfd_get_16 (input_bfd, contents);
x = (x & 0xf800) | ((srel >> 1) & 0x7ff);
bfd_put_16 (input_bfd, x, contents);
@@ -461,7 +459,6 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca
return r;
}
-
/* Relocate an FR30 ELF section.
There is some attempt to make this function usable for many architectures,
@@ -528,13 +525,13 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_reloc_status_type r;
const char * name = NULL;
int r_type;
-
+
r_type = ELF32_R_TYPE (rel->r_info);
-
+
if ( r_type == R_FR30_GNU_VTINHERIT
|| r_type == R_FR30_GNU_VTENTRY)
continue;
-
+
r_symndx = ELF32_R_SYM (rel->r_info);
if (info->relocateable)
@@ -546,7 +543,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
-
+
if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
{
sec = local_sections [r_symndx];
@@ -562,7 +559,7 @@ fr30_elf_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;
@@ -570,7 +567,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = (sec->output_section->vma
+ sec->output_offset
+ sym->st_value);
-
+
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
@@ -584,13 +581,13 @@ fr30_elf_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
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
name = h->root.root.string;
-
+
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
@@ -625,7 +622,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = 0;
}
}
-
+
r = fr30_final_link_relocate (howto, input_bfd, input_section,
contents, rel, relocation);
@@ -640,13 +637,13 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
(info, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset);
break;
-
+
case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol
(info, name, input_bfd, input_section, rel->r_offset,
true);
break;
-
+
case bfd_reloc_outofrange:
msg = _("internal error: out of range error");
break;
@@ -739,7 +736,7 @@ fr30_elf_gc_sweep_hook (abfd, info, sec, relocs)
/* Look through the relocs for a section during the first phase.
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
-
+
static boolean
fr30_elf_check_relocs (abfd, info, sec, relocs)
bfd *abfd;
@@ -751,28 +748,28 @@ fr30_elf_check_relocs (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
-
+
if (info->relocateable)
return true;
-
+
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
- sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
+ 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];
-
+
switch (ELF32_R_TYPE (rel->r_info))
{
/* This relocation describes the C++ object vtable hierarchy.
@@ -781,7 +778,7 @@ fr30_elf_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_FR30_GNU_VTENTRY:
@@ -790,7 +787,7 @@ fr30_elf_check_relocs (abfd, info, sec, relocs)
break;
}
}
-
+
return true;
}
diff --git a/gnu/usr.bin/binutils/bfd/elf32-i370.c b/gnu/usr.bin/binutils/bfd/elf32-i370.c
index c8bf94326cd..d70ba53bc6d 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-i370.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-i370.c
@@ -1,5 +1,6 @@
/* i370-specific support for 32-bit ELF
- Copyright 1994, 95, 96, 97, 98, 2000 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001
+ Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas for i370 linas@linas.org
@@ -19,8 +20,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. */
-
-
/* This file is based on a preliminary PowerPC ELF ABI.
But its been hacked on for the IBM 360/370 architectures.
Basically, the 31bit relocation works, and just about everything
@@ -28,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
dynamic loading to work ... its never been tested ...
*/
-
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
@@ -61,7 +59,6 @@ enum i370_reloc_type
R_I370_max
};
-
static reloc_howto_type *i370_elf_howto_table[ (int)R_I370_max ];
@@ -254,13 +251,11 @@ static reloc_howto_type i370_elf_howto_raw[] =
false), /* pcrel_offset */
};
-
static void i370_elf_howto_init PARAMS ((void));
static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr,
Elf32_Internal_Rela *dst));
static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword));
-
/* Initialize the i370_elf_howto_table, so that linear accesses can be done. */
@@ -272,11 +267,10 @@ i370_elf_howto_init ()
for (i = 0; i < sizeof (i370_elf_howto_raw) / sizeof (i370_elf_howto_raw[0]); i++)
{
type = i370_elf_howto_raw[i].type;
- BFD_ASSERT (type < sizeof(i370_elf_howto_table) / sizeof(i370_elf_howto_table[0]));
+ BFD_ASSERT (type < sizeof (i370_elf_howto_table) / sizeof (i370_elf_howto_table[0]));
i370_elf_howto_table[type] = &i370_elf_howto_raw[i];
}
}
-
static reloc_howto_type *
i370_elf_reloc_type_lookup (abfd, code)
@@ -350,7 +344,6 @@ static boolean i370_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_
#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so"
-
/* Set the howto pointer for an i370 ELF reloc. */
static void
@@ -369,7 +362,7 @@ i370_elf_info_to_howto (abfd, cache_ptr, dst)
/* hack alert -- the following several routines look generic to me ...
* why are we bothering with them ???
*/
-/* Function to set whether a module needs the -mrelocatable bit set. */
+/* Function to set whether a module needs the -mrelocatable bit set. */
static boolean
i370_elf_set_private_flags (abfd, flags)
bfd *abfd;
@@ -438,7 +431,6 @@ i370_elf_merge_private_bfd_data (ibfd, obfd)
return true;
}
-
/* Handle an i370 specific section when reading an object file. This
is called when elfcode.h finds a section with an unknown type. */
@@ -470,8 +462,6 @@ i370_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. */
/* XXX hack alert bogus This routine is mostly all junk and almost
@@ -479,7 +469,6 @@ i370_elf_section_from_shdr (abfd, hdr, name)
* just enough to allow glibc-2.1 ld.so to compile & link.
*/
-
static boolean
i370_elf_fake_sections (abfd, shdr, asect)
bfd *abfd ATTRIBUTE_UNUSED;
@@ -494,7 +483,6 @@ i370_elf_fake_sections (abfd, shdr, asect)
return true;
}
-
#if 0
/* Create a special linker section */
@@ -610,7 +598,7 @@ i370_elf_create_dynamic_sections (abfd, info)
return false;
}
- /* xxx beats me, seem to need a rela.text ... */
+ /* xxx beats me, seem to need a rela.text ... */
s = bfd_make_section (abfd, ".rela.text");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
@@ -654,7 +642,6 @@ i370_elf_adjust_dynamic_symbol (info, h)
&& (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
-
s = bfd_get_section_by_name (dynobj, ".rela.text");
BFD_ASSERT (s != NULL);
s->_raw_size += sizeof (Elf32_External_Rela);
@@ -742,7 +729,6 @@ i370_elf_adjust_dynamic_symbol (info, h)
return true;
}
-
/* Increment the index of a dynamic symbol by a given amount. Called
via elf_link_hash_traverse. */
@@ -769,7 +755,6 @@ i370_elf_adjust_dynindx (h, cparg)
return true;
}
-
/* Set the sizes of the dynamic sections. */
/* XXX hack alert bogus This routine is mostly all junk and almost
@@ -879,7 +864,7 @@ i370_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
@@ -959,6 +944,7 @@ i370_elf_size_dynamic_sections (output_bfd, info)
{
if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
return false;
+ info->flags |= DF_TEXTREL;
}
}
@@ -1001,7 +987,6 @@ i370_elf_size_dynamic_sections (output_bfd, info)
return true;
}
-
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table or procedure linkage
@@ -1106,7 +1091,6 @@ i370_elf_check_relocs (abfd, info, sec, relocs)
return true;
}
-
/* Finish up the dynamic sections. */
/* XXX hack alert bogus This routine is mostly all junk and almost
@@ -1247,7 +1231,6 @@ i370_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.
@@ -1413,16 +1396,17 @@ i370_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)
+ else if (info->shared
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
- (*info->callbacks->undefined_symbol)(info,
- h->root.root.string,
- input_bfd,
- input_section,
- rel->r_offset,
- true);
+ (*info->callbacks->undefined_symbol) (info,
+ h->root.root.string,
+ input_bfd,
+ input_section,
+ rel->r_offset,
+ true);
ret = false;
continue;
}
@@ -1560,9 +1544,9 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
#ifdef DEBUG
if (indx <= 0)
{
- printf("indx=%d section=%s flags=%08x name=%s\n",
- indx, osec->name, osec->flags,
- h->root.root.string);
+ printf ("indx=%d section=%s flags=%08x name=%s\n",
+ indx, osec->name, osec->flags,
+ h->root.root.string);
}
#endif
}
@@ -1600,7 +1584,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
continue;
}
-
#ifdef DEBUG
fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n",
howto->name,
@@ -1645,13 +1628,13 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
name = bfd_section_name (input_bfd, sec);
}
- (*info->callbacks->reloc_overflow)(info,
- name,
- howto->name,
- (bfd_vma) 0,
- input_bfd,
- input_section,
- offset);
+ (*info->callbacks->reloc_overflow) (info,
+ name,
+ howto->name,
+ (bfd_vma) 0,
+ input_bfd,
+ input_section,
+ offset);
}
break;
@@ -1659,7 +1642,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
}
-
#ifdef DEBUG
fprintf (stderr, "\n");
#endif
@@ -1688,8 +1670,6 @@ i370_elf_post_process_headers (abfd, link_info)
#define ELF_MAXPAGESIZE 0x1000
#define elf_info_to_howto i370_elf_info_to_howto
-
-
#define elf_backend_plt_not_loaded 1
#define elf_backend_got_symbol_offset 4
diff --git a/gnu/usr.bin/binutils/bfd/elf32-i960.c b/gnu/usr.bin/binutils/bfd/elf32-i960.c
index 839fc3d892a..2cab7c02b5e 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-i960.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-i960.c
@@ -1,5 +1,5 @@
/* Intel 860 specific support for 32-bit ELF
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -102,7 +102,6 @@ elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst)
function. It just short circuits the reloc if producing
relocateable output against an external symbol. */
-/*ARGSUSED*/
bfd_reloc_status_type
elf32_i960_relocate (abfd,
reloc_entry,
@@ -129,7 +128,7 @@ elf32_i960_relocate (abfd,
{
reloc_entry->addend -= symbol->value;
}
- /* This is more dubious. */
+ /* This is more dubious. */
else if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) != 0)
{
diff --git a/gnu/usr.bin/binutils/bfd/elf32-m32r.c b/gnu/usr.bin/binutils/bfd/elf32-m32r.c
index efb65552671..1b82d9db173 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-m32r.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-m32r.c
@@ -1,5 +1,6 @@
/* M32R-specific support for 32-bit ELF.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -566,8 +567,8 @@ m32r_elf_lo16_reloc (input_bfd, reloc_entry, symbol, data,
input_section, output_bfd, error_message);
}
-/* Do generic partial_inplace relocation.
- This is a local replacement for bfd_elf_generic_reloc. */
+/* Do generic partial_inplace relocation.
+ This is a local replacement for bfd_elf_generic_reloc. */
bfd_reloc_status_type
m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data,
@@ -578,7 +579,7 @@ m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data,
PTR data;
asection *input_section;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_reloc_status_type ret;
bfd_vma relocation;
@@ -624,7 +625,7 @@ m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data,
}
relocation += reloc_entry->addend;
- inplace_address = data + reloc_entry->address;
+ inplace_address = (bfd_byte *) data + reloc_entry->address;
#define DOIT(x) \
x = ( (x & ~reloc_entry->howto->dst_mask) | \
@@ -1313,7 +1314,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
When the chip supports parallel 16 bit insns, things may change.
*/
-static boolean
+static boolean
m32r_elf_relax_section (abfd, sec, link_info, again)
bfd *abfd;
asection *sec;
@@ -1925,7 +1926,7 @@ m32r_elf_final_write_processing (abfd, linker)
elf_elfheader (abfd)->e_flags |= val;
}
-/* Function to keep M32R specific file flags. */
+/* Function to keep M32R specific file flags. */
static boolean
m32r_elf_set_private_flags (abfd, flags)
bfd * abfd;
@@ -1986,7 +1987,7 @@ m32r_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;
@@ -2025,22 +2026,22 @@ m32r_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);
-
+
fprintf (file, _("private flags = %lx"), elf_elfheader (abfd)->e_flags);
-
+
switch (elf_elfheader (abfd)->e_flags & EF_M32R_ARCH)
{
default:
case E_M32R_ARCH: fprintf (file, _(": m32r instructions")); break;
case E_M32RX_ARCH: fprintf (file, _(": m32rx instructions")); break;
}
-
+
fputc ('\n', file);
-
+
return true;
}
@@ -2059,14 +2060,14 @@ m32r_elf_gc_mark_hook (abfd, info, rel, h, sym)
case R_M32R_GNU_VTINHERIT:
case R_M32R_GNU_VTENTRY:
break;
-
+
default:
switch (h->root.type)
{
case bfd_link_hash_defined:
case bfd_link_hash_defweak:
return h->root.u.def.section;
-
+
case bfd_link_hash_common:
return h->root.u.c.p->section;
@@ -2099,11 +2100,10 @@ m32r_elf_gc_sweep_hook (abfd, info, sec, relocs)
return true;
}
-
/* Look through the relocs for a section during the first phase.
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
-
+
static boolean
m32r_elf_check_relocs (abfd, info, sec, relocs)
bfd *abfd;
@@ -2115,28 +2115,28 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
-
+
if (info->relocateable)
return true;
-
+
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
- sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
+ 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];
-
+
switch (ELF32_R_TYPE (rel->r_info))
{
/* This relocation describes the C++ object vtable hierarchy.
@@ -2145,7 +2145,7 @@ m32r_elf_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_M32R_GNU_VTENTRY:
@@ -2154,13 +2154,10 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
break;
}
}
-
+
return true;
}
-
-
-
#define ELF_ARCH bfd_arch_m32r
#define ELF_MACHINE_CODE EM_CYGNUS_M32R
#define ELF_MAXPAGESIZE 0x1 /* Explicitly requested by Mitsubishi. */
@@ -2192,5 +2189,5 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
#define bfd_elf32_bfd_merge_private_bfd_data m32r_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags m32r_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data m32r_elf_print_private_bfd_data
-
+
#include "elf32-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-m68hc11.c b/gnu/usr.bin/binutils/bfd/elf32-m68hc11.c
new file mode 100644
index 00000000000..ae69ae255f5
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elf32-m68hc11.c
@@ -0,0 +1,280 @@
+/* Motorola 68HC11-specific support for 32-bit ELF
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Stephane Carrez (stcarrez@worldnet.fr)
+ (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/m68hc11.h"
+
+static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
+PARAMS ((bfd * abfd, bfd_reloc_code_real_type code));
+static void m68hc11_info_to_howto_rel
+PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+
+/* Use REL instead of RELA to save space */
+#define USE_REL
+
+/* The Motorola 68HC11 microcontroler only addresses 64Kb.
+ We must handle 8 and 16-bit relocations. The 32-bit relocation
+ is defined but not used except by gas when -gstabs is used (which
+ is wrong).
+ The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */
+static reloc_howto_type elf_m68hc11_howto_table[] = {
+ /* This reloc does nothing. */
+ HOWTO (R_M68HC11_NONE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit absolute relocation */
+ HOWTO (R_M68HC11_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_8", /* name */
+ false, /* partial_inplace */
+ 0x00ff, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit absolute relocation (upper address) */
+ HOWTO (R_M68HC11_HI8, /* type */
+ 8, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_HI8", /* name */
+ false, /* partial_inplace */
+ 0x00ff, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit absolute relocation (upper address) */
+ HOWTO (R_M68HC11_LO8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_LO8", /* name */
+ false, /* partial_inplace */
+ 0x00ff, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit PC-rel relocation */
+ HOWTO (R_M68HC11_PCREL_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_PCREL_8", /* name */
+ false, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit absolute relocation */
+ HOWTO (R_M68HC11_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont /*bitfield */ , /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_16", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 32 bit absolute relocation. This one is never used for the
+ code relocation. It's used by gas for -gstabs generation. */
+ HOWTO (R_M68HC11_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 3 bit absolute relocation */
+ HOWTO (R_M68HC11_3B, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 3, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_4B", /* name */
+ false, /* partial_inplace */
+ 0x003, /* src_mask */
+ 0x003, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit PC-rel relocation */
+ HOWTO (R_M68HC11_PCREL_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_PCREL_16", /* name */
+ false, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_M68HC11_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_M68HC11_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_M68HC11_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+};
+
+/* Map BFD reloc types to M68HC11 ELF reloc types. */
+
+struct m68hc11_reloc_map
+{
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned char elf_reloc_val;
+};
+
+static const struct m68hc11_reloc_map m68hc11_reloc_map[] = {
+ {BFD_RELOC_NONE, R_M68HC11_NONE,},
+ {BFD_RELOC_8, R_M68HC11_8},
+ {BFD_RELOC_M68HC11_HI8, R_M68HC11_HI8},
+ {BFD_RELOC_M68HC11_LO8, R_M68HC11_LO8},
+ {BFD_RELOC_8_PCREL, R_M68HC11_PCREL_8},
+ {BFD_RELOC_16_PCREL, R_M68HC11_PCREL_16},
+ {BFD_RELOC_16, R_M68HC11_16},
+ {BFD_RELOC_32, R_M68HC11_32},
+ {BFD_RELOC_M68HC11_3B, R_M68HC11_3B},
+
+ /* The following relocs are defined but they probably don't work yet. */
+ {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT},
+ {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY},
+};
+
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+
+ for (i = 0;
+ i < sizeof (m68hc11_reloc_map) / sizeof (struct m68hc11_reloc_map);
+ i++)
+ {
+ if (m68hc11_reloc_map[i].bfd_reloc_val == code)
+ return &elf_m68hc11_howto_table[m68hc11_reloc_map[i].elf_reloc_val];
+ }
+
+ return NULL;
+}
+
+/* Set the howto pointer for an M68HC11 ELF reloc. */
+
+static void
+m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *cache_ptr;
+ Elf32_Internal_Rel *dst;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max);
+ cache_ptr->howto = &elf_m68hc11_howto_table[r_type];
+}
+
+/* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c.
+ The Motorola spec says to use a different Elf machine code. */
+#define ELF_ARCH bfd_arch_m68hc11
+#define ELF_MACHINE_CODE EM_68HC11
+#define ELF_MAXPAGESIZE 0x1000
+
+#define TARGET_BIG_SYM bfd_elf32_m68hc11_vec
+#define TARGET_BIG_NAME "elf32-m68hc11"
+
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel m68hc11_info_to_howto_rel
+#define elf_backend_object_p 0
+#define elf_backend_final_write_processing 0
+
+#include "elf32-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-m68hc12.c b/gnu/usr.bin/binutils/bfd/elf32-m68hc12.c
new file mode 100644
index 00000000000..8f6ca49211f
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elf32-m68hc12.c
@@ -0,0 +1,280 @@
+/* Motorola 68HC12-specific support for 32-bit ELF
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Stephane Carrez (stcarrez@worldnet.fr)
+ (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/m68hc11.h"
+
+static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
+PARAMS ((bfd * abfd, bfd_reloc_code_real_type code));
+static void m68hc11_info_to_howto_rel
+PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+
+/* Use REL instead of RELA to save space */
+#define USE_REL
+
+/* The Motorola 68HC11 microcontroler only addresses 64Kb.
+ We must handle 8 and 16-bit relocations. The 32-bit relocation
+ is defined but not used except by gas when -gstabs is used (which
+ is wrong).
+ The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */
+static reloc_howto_type elf_m68hc11_howto_table[] = {
+ /* This reloc does nothing. */
+ HOWTO (R_M68HC11_NONE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit absolute relocation */
+ HOWTO (R_M68HC11_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_8", /* name */
+ false, /* partial_inplace */
+ 0x00ff, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit absolute relocation (upper address) */
+ HOWTO (R_M68HC11_HI8, /* type */
+ 8, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_HI8", /* name */
+ false, /* partial_inplace */
+ 0x00ff, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit absolute relocation (upper address) */
+ HOWTO (R_M68HC11_LO8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_LO8", /* name */
+ false, /* partial_inplace */
+ 0x00ff, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 8 bit PC-rel relocation */
+ HOWTO (R_M68HC11_PCREL_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_PCREL_8", /* name */
+ false, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x00ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit absolute relocation */
+ HOWTO (R_M68HC11_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont /*bitfield */ , /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_16", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 32 bit absolute relocation. This one is never used for the
+ code relocation. It's used by gas for -gstabs generation. */
+ HOWTO (R_M68HC11_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 3 bit absolute relocation */
+ HOWTO (R_M68HC11_3B, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 3, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_4B", /* name */
+ false, /* partial_inplace */
+ 0x003, /* src_mask */
+ 0x003, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit PC-rel relocation */
+ HOWTO (R_M68HC11_PCREL_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_M68HC11_PCREL_16", /* name */
+ false, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_M68HC11_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_M68HC11_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_M68HC11_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+};
+
+/* Map BFD reloc types to M68HC11 ELF reloc types. */
+
+struct m68hc11_reloc_map
+{
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned char elf_reloc_val;
+};
+
+static const struct m68hc11_reloc_map m68hc11_reloc_map[] = {
+ {BFD_RELOC_NONE, R_M68HC11_NONE,},
+ {BFD_RELOC_8, R_M68HC11_8},
+ {BFD_RELOC_M68HC11_HI8, R_M68HC11_HI8},
+ {BFD_RELOC_M68HC11_LO8, R_M68HC11_LO8},
+ {BFD_RELOC_8_PCREL, R_M68HC11_PCREL_8},
+ {BFD_RELOC_16_PCREL, R_M68HC11_PCREL_16},
+ {BFD_RELOC_16, R_M68HC11_16},
+ {BFD_RELOC_32, R_M68HC11_32},
+ {BFD_RELOC_M68HC11_3B, R_M68HC11_3B},
+
+ /* The following relocs are defined but they probably don't work yet. */
+ {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT},
+ {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY},
+};
+
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+
+ for (i = 0;
+ i < sizeof (m68hc11_reloc_map) / sizeof (struct m68hc11_reloc_map);
+ i++)
+ {
+ if (m68hc11_reloc_map[i].bfd_reloc_val == code)
+ return &elf_m68hc11_howto_table[m68hc11_reloc_map[i].elf_reloc_val];
+ }
+
+ return NULL;
+}
+
+/* Set the howto pointer for an M68HC11 ELF reloc. */
+
+static void
+m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *cache_ptr;
+ Elf32_Internal_Rel *dst;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max);
+ cache_ptr->howto = &elf_m68hc11_howto_table[r_type];
+}
+
+/* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c.
+ The Motorola spec says to use a different Elf machine code. */
+#define ELF_ARCH bfd_arch_m68hc12
+#define ELF_MACHINE_CODE EM_68HC12
+#define ELF_MAXPAGESIZE 0x1000
+
+#define TARGET_BIG_SYM bfd_elf32_m68hc12_vec
+#define TARGET_BIG_NAME "elf32-m68hc12"
+
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel m68hc11_info_to_howto_rel
+#define elf_backend_object_p 0
+#define elf_backend_final_write_processing 0
+
+#include "elf32-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-mcore.c b/gnu/usr.bin/binutils/bfd/elf32-mcore.c
index edc6f678c22..e4b5cd917ac 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-mcore.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-mcore.c
@@ -1,5 +1,5 @@
/* Motorola MCore specific support for 32-bit ELF
- Copyright 1994, 1995, 1999 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <assert.h>
#define USE_RELA /* Only USE_REL is actually significant, but this is
- here are a reminder... */
+ here are a reminder... */
static void mcore_elf_howto_init
PARAMS ((void));
@@ -84,7 +84,7 @@ static reloc_howto_type mcore_elf_howto_raw[] =
false), /* pcrel_offset */
/* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions.
- Should not appear in object files. */
+ Should not appear in object files. */
HOWTO (R_MCORE_PCRELIMM8BY4, /* type */
2, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -99,7 +99,7 @@ static reloc_howto_type mcore_elf_howto_raw[] =
0, /* dst_mask */
true), /* pcrel_offset */
- /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit
+ /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit
Span 2k instructions == 4k bytes.
Only useful pieces at the relocated address are the opcode (5 bits) */
HOWTO (R_MCORE_PCRELIMM11BY2,/* type */
@@ -116,7 +116,7 @@ static reloc_howto_type mcore_elf_howto_raw[] =
0x7ff, /* dst_mask */
true), /* pcrel_offset */
- /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */
+ /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */
HOWTO (R_MCORE_PCRELIMM4BY2, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -131,7 +131,7 @@ static reloc_howto_type mcore_elf_howto_raw[] =
0, /* dst_mask */
true), /* pcrel_offset */
- /* 32-bit pc-relative. Eventually this will help support PIC code. */
+ /* 32-bit pc-relative. Eventually this will help support PIC code. */
HOWTO (R_MCORE_PCREL32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -148,11 +148,11 @@ static reloc_howto_type mcore_elf_howto_raw[] =
/* Like PCRELIMM11BY2, this relocation indicates that there is a
'jsri' at the specified address. There is a separate relocation
- entry for the literal pool entry that it references, but we
+ entry for the literal pool entry that it references, but we
might be able to change the jsri to a bsr if the target turns out
to be close enough [even though we won't reclaim the literal pool
entry, we'll get some runtime efficiency back]. Note that this
- is a relocation that we are allowed to safely ignore. */
+ is a relocation that we are allowed to safely ignore. */
HOWTO (R_MCORE_PCRELJSR_IMM11BY2,/* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -166,7 +166,7 @@ static reloc_howto_type mcore_elf_howto_raw[] =
0x0, /* src_mask */
0x7ff, /* dst_mask */
true), /* pcrel_offset */
-
+
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_MCORE_GNU_VTINHERIT, /* type */
0, /* rightshift */
@@ -196,7 +196,7 @@ static reloc_howto_type mcore_elf_howto_raw[] =
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
-
+
HOWTO (R_MCORE_RELATIVE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -225,15 +225,14 @@ mcore_elf_howto_init ()
for (i = NUM_ELEM (mcore_elf_howto_raw); i--;)
{
unsigned int type;
-
+
type = mcore_elf_howto_raw[i].type;
-
+
BFD_ASSERT (type < NUM_ELEM (mcore_elf_howto_table));
-
+
mcore_elf_howto_table [type] = & mcore_elf_howto_raw [i];
}
}
-
static reloc_howto_type *
mcore_elf_reloc_type_lookup (abfd, code)
@@ -275,11 +274,11 @@ mcore_elf_info_to_howto (abfd, cache_ptr, dst)
mcore_elf_howto_init ();
BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_MCORE_max);
-
+
cache_ptr->howto = mcore_elf_howto_table [ELF32_R_TYPE (dst->r_info)];
}
-/* Function to set whether a module needs the -mrelocatable bit set. */
+/* Function to set whether a module needs the -mrelocatable bit set. */
static boolean
mcore_elf_set_private_flags (abfd, flags)
bfd * abfd;
@@ -322,18 +321,8 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd)
flagword new_flags;
/* Check if we have the same endianess */
- if ( ibfd->xvec->byteorder != obfd->xvec->byteorder
- && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
- {
- (*_bfd_error_handler)
- (_("%s: compiled for a %s endian system and target is %s endian.\n"),
- 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;
- }
+ 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)
@@ -341,7 +330,7 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd)
new_flags = elf_elfheader (ibfd)->e_flags;
old_flags = elf_elfheader (obfd)->e_flags;
-
+
if (! elf_flags_init (obfd)) /* First call, no flags set */
{
elf_flags_init (obfd) = true;
@@ -356,11 +345,9 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd)
return true;
}
-
/* Don't pretend we can deal with unsupported relocs. */
-/*ARGSUSED*/
static bfd_reloc_status_type
mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
@@ -373,7 +360,7 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
char ** error_message ATTRIBUTE_UNUSED;
{
BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0);
-
+
_bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"),
bfd_get_filename (abfd),
reloc_entry->howto->name,
@@ -381,7 +368,6 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section,
return bfd_reloc_notsupported;
}
-
/* The RELOCATE_SECTION function is called by the ELF backend linker
to handle the relocations for a section.
@@ -455,7 +441,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
unsigned long r_symndx;
struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0;
unsigned short oldinst = 0;
-
+
/* Unknown relocation handling */
if ((unsigned) r_type >= (unsigned) R_MCORE_max
|| ! mcore_elf_howto_table [(int)r_type])
@@ -468,10 +454,10 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
ret = false;
continue;
}
-
+
howto = mcore_elf_howto_table [(int) r_type];
r_symndx = ELF32_R_SYM (rel->r_info);
-
+
if (info->relocateable)
{
/* This is a relocateable link. We don't have to change
@@ -481,7 +467,7 @@ mcore_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)
{
sec = local_sections[r_symndx];
@@ -498,7 +484,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* This is a final link. */
- /* Complain about known relocation that are not yet supported */
+ /* Complain about known relocation that are not yet supported. */
if (howto->special_function == mcore_elf_unsupported_reloc)
{
_bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"),
@@ -559,7 +545,6 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
-
#ifdef DEBUG
fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n",
howto->name, r_type, r_symndx, (long) offset, (long) addend);
@@ -574,11 +559,11 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_put_16 (input_bfd, oldinst, contents + offset);
r = bfd_reloc_ok;
}
-
+
if (r != bfd_reloc_ok)
{
ret = false;
-
+
switch (r)
{
default:
@@ -594,7 +579,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
-
+
if (name == NULL)
break;
@@ -643,7 +628,7 @@ mcore_elf_gc_mark_hook (abfd, info, rel, h, sym)
case bfd_link_hash_defined:
case bfd_link_hash_defweak:
return h->root.u.def.section;
-
+
case bfd_link_hash_common:
return h->root.u.c.p->section;
@@ -681,7 +666,7 @@ mcore_elf_gc_sweep_hook (abfd, info, sec, relocs)
/* Look through the relocs for a section during the first phase.
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
-
+
static boolean
mcore_elf_check_relocs (abfd, info, sec, relocs)
bfd * abfd;
@@ -694,30 +679,30 @@ mcore_elf_check_relocs (abfd, info, sec, relocs)
struct elf_link_hash_entry ** sym_hashes_end;
const Elf_Internal_Rela * rel;
const Elf_Internal_Rela * rel_end;
-
+
if (info->relocateable)
return true;
-
+
symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
if (!elf_bad_symtab (abfd))
sym_hashes_end -= symtab_hdr->sh_info;
-
+
rel_end = relocs + sec->reloc_count;
-
+
for (rel = relocs; rel < rel_end; rel++)
{
struct elf_link_hash_entry * h;
unsigned long r_symndx;
-
+
r_symndx = ELF32_R_SYM (rel->r_info);
-
+
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
h = sym_hashes [r_symndx - symtab_hdr->sh_info];
-
+
switch (ELF32_R_TYPE (rel->r_info))
{
/* This relocation describes the C++ object vtable hierarchy.
@@ -726,7 +711,7 @@ mcore_elf_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_MCORE_GNU_VTENTRY:
@@ -735,7 +720,7 @@ mcore_elf_check_relocs (abfd, info, sec, relocs)
break;
}
}
-
+
return true;
}
@@ -750,7 +735,6 @@ mcore_elf_check_relocs (abfd, info, sec, relocs)
#define elf_info_to_howto mcore_elf_info_to_howto
#define elf_info_to_howto_rel NULL
-
#define bfd_elf32_bfd_copy_private_bfd_data mcore_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data mcore_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags mcore_elf_set_private_flags
diff --git a/gnu/usr.bin/binutils/bfd/elf32-pj.c b/gnu/usr.bin/binutils/bfd/elf32-pj.c
index 3b96949f479..d98b1b3b54f 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-pj.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-pj.c
@@ -1,5 +1,5 @@
/* picoJava specific support for 32-bit ELF
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
Contributed by Steve Chamberlan of Transmeta (sac@pobox.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -131,7 +131,6 @@ static reloc_howto_type pj_elf_howto_table[] =
0xffff, /* dst_mask */
true), /* pcrel_offset */
-
HOWTO (R_PJ_CODE_HI16, /* type */
16, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
@@ -176,7 +175,6 @@ static reloc_howto_type pj_elf_howto_table[] =
0, /* dst_mask */
false), /* pcrel_offset */
-
};
/* This function is used for normal relocs. This is like the COFF
@@ -213,8 +211,8 @@ pj_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
return bfd_reloc_undefined;
if (bfd_is_com_section (symbol_in->section))
- sym_value = 0;
- else
+ sym_value = 0;
+ else
sym_value = (symbol_in->value +
symbol_in->section->output_section->vma +
symbol_in->section->output_offset);
@@ -228,7 +226,7 @@ pj_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
break;
/* Relocations in code are always bigendian, no matter what the
- data endianness is. */
+ data endianness is. */
case R_PJ_CODE_DIR32:
insn = bfd_getb32 (hit_data);
@@ -254,7 +252,7 @@ pj_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
insn += (sym_value + reloc_entry->addend) >> 16;
bfd_putb16 (insn, hit_data);
break;
-
+
default:
abort ();
break;
@@ -296,7 +294,7 @@ pj_elf_reloc_type_lookup (abfd, code)
bfd_reloc_code_real_type code;
{
unsigned int i;
-
+
for (i = 0; i < sizeof (pj_reloc_map) / sizeof (struct elf_reloc_map); i++)
{
if (pj_reloc_map[i].bfd_reloc_val == code)
@@ -324,7 +322,7 @@ pj_elf_info_to_howto (abfd, cache_ptr, dst)
}
/* Take this moment to fill in the special picoJava bits in the
- e_flags field. */
+ e_flags field. */
static void
pj_elf_final_write_processing (abfd, linker)
diff --git a/gnu/usr.bin/binutils/bfd/elf32-sh-lin.c b/gnu/usr.bin/binutils/bfd/elf32-sh-lin.c
new file mode 100644
index 00000000000..1ee0a87cab8
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elf32-sh-lin.c
@@ -0,0 +1,29 @@
+/* Hitachi SH specific support for 32-bit Linux
+ Copyright 2000 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#define TARGET_BIG_SYM bfd_elf32_shblin_vec
+#define TARGET_BIG_NAME "elf32-shbig-linux"
+#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec
+#define TARGET_LITTLE_NAME "elf32-sh-linux"
+#define ELF_ARCH bfd_arch_sh
+#define ELF_MACHINE_CODE EM_SH
+#define ELF_MAXPAGESIZE 0x10000
+#define elf_symbol_leading_char 0
+
+#include "elf32-sh.c"
diff --git a/gnu/usr.bin/binutils/bfd/elf32-v850.c b/gnu/usr.bin/binutils/bfd/elf32-v850.c
index 4fe28fc92b9..3df09143d32 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-v850.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-v850.c
@@ -1,5 +1,6 @@
/* V850-specific support for 32-bit ELF
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -17,12 +18,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 +30,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 +101,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 +116,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 +310,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 +460,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 +502,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 +518,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 +540,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 +553,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 +639,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 +755,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 +779,7 @@ remember_hi16s_reloc (abfd, addend, address)
hi16s_counter = 0x10000;
}
-
+
return;
}
@@ -798,7 +793,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 +803,7 @@ find_remembered_hi16s_reloc (addend, already_found)
previous = prev;
match = entry;
}
-
+
prev = entry;
}
@@ -824,9 +819,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 +834,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 +967,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 +1001,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 +1040,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 +1048,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 +1065,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 +1075,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 +1084,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 +1241,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 +1254,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 +1268,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 +1286,50 @@ 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;
}
-
- reloc->addend = relocation;
+#endif
+ 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/gnu/usr.bin/binutils/bfd/elf64-hppa.c b/gnu/usr.bin/binutils/bfd/elf64-hppa.c
new file mode 100644
index 00000000000..4a87358c9df
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elf64-hppa.c
@@ -0,0 +1,2718 @@
+/* Support for HPPA 64-bit ELF
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "alloca-conf.h"
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/hppa.h"
+#include "libhppa.h"
+#include "elf64-hppa.h"
+#define ARCH_SIZE 64
+
+#define PLT_ENTRY_SIZE 0x10
+#define DLT_ENTRY_SIZE 0x8
+#define OPD_ENTRY_SIZE 0x20
+
+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/pa20_64/dld.sl"
+
+/* The stub is supposed to load the target address and target's DP
+ value out of the PLT, then do an external branch to the target
+ address.
+
+ LDD PLTOFF(%r27),%r1
+ BVE (%r1)
+ LDD PLTOFF+8(%r27),%r27
+
+ Note that we must use the LDD with a 14 bit displacement, not the one
+ with a 5 bit displacement. */
+static char plt_stub[] = {0x53, 0x61, 0x00, 0x00, 0xe8, 0x20, 0xd0, 0x00,
+ 0x53, 0x7b, 0x00, 0x00 };
+
+struct elf64_hppa_dyn_hash_entry
+{
+ struct bfd_hash_entry root;
+
+ /* Offsets for this symbol in various linker sections. */
+ bfd_vma dlt_offset;
+ bfd_vma plt_offset;
+ bfd_vma opd_offset;
+ bfd_vma stub_offset;
+
+ /* The symbol table entry, if any, that this was derived from. */
+ struct elf_link_hash_entry *h;
+
+ /* The index of the (possibly local) symbol in the input bfd and its
+ associated BFD. Needed so that we can have relocs against local
+ symbols in shared libraries. */
+ unsigned long sym_indx;
+ bfd *owner;
+
+ /* Dynamic symbols may need to have two different values. One for
+ the dynamic symbol table, one for the normal symbol table.
+
+ In such cases we store the symbol's real value and section
+ index here so we can restore the real value before we write
+ the normal symbol table. */
+ bfd_vma st_value;
+ int st_shndx;
+
+ /* Used to count non-got, non-plt relocations for delayed sizing
+ of relocation sections. */
+ struct elf64_hppa_dyn_reloc_entry
+ {
+ /* Next relocation in the chain. */
+ struct elf64_hppa_dyn_reloc_entry *next;
+
+ /* The type of the relocation. */
+ int type;
+
+ /* The input section of the relocation. */
+ asection *sec;
+
+ /* The index of the section symbol for the input section of
+ the relocation. Only needed when building shared libraries. */
+ int sec_symndx;
+
+ /* The offset within the input section of the relocation. */
+ bfd_vma offset;
+
+ /* The addend for the relocation. */
+ bfd_vma addend;
+
+ } *reloc_entries;
+
+ /* Nonzero if this symbol needs an entry in one of the linker
+ sections. */
+ unsigned want_dlt;
+ unsigned want_plt;
+ unsigned want_opd;
+ unsigned want_stub;
+};
+
+struct elf64_hppa_dyn_hash_table
+{
+ struct bfd_hash_table root;
+};
+
+struct elf64_hppa_link_hash_table
+{
+ struct elf_link_hash_table root;
+
+ /* Shortcuts to get to the various linker defined sections. */
+ asection *dlt_sec;
+ asection *dlt_rel_sec;
+ asection *plt_sec;
+ asection *plt_rel_sec;
+ asection *opd_sec;
+ asection *opd_rel_sec;
+ asection *other_rel_sec;
+
+ /* Offset of __gp within .plt section. When the PLT gets large we want
+ to slide __gp into the PLT section so that we can continue to use
+ single DP relative instructions to load values out of the PLT. */
+ bfd_vma gp_offset;
+
+ /* Note this is not strictly correct. We should create a stub section for
+ each input section with calls. The stub section should be placed before
+ the section with the call. */
+ asection *stub_sec;
+
+ bfd_vma text_segment_base;
+ bfd_vma data_segment_base;
+
+ struct elf64_hppa_dyn_hash_table dyn_hash_table;
+
+ /* We build tables to map from an input section back to its
+ symbol index. This is the BFD for which we currently have
+ a map. */
+ bfd *section_syms_bfd;
+
+ /* Array of symbol numbers for each input section attached to the
+ current BFD. */
+ int *section_syms;
+};
+
+#define elf64_hppa_hash_table(p) \
+ ((struct elf64_hppa_link_hash_table *) ((p)->hash))
+
+typedef struct bfd_hash_entry *(*new_hash_entry_func)
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+
+static boolean elf64_hppa_dyn_hash_table_init
+ PARAMS ((struct elf64_hppa_dyn_hash_table *ht, bfd *abfd,
+ new_hash_entry_func new));
+static struct bfd_hash_entry *elf64_hppa_new_dyn_hash_entry
+ PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table,
+ const char *string));
+static struct bfd_link_hash_table *elf64_hppa_hash_table_create
+ PARAMS ((bfd *abfd));
+static struct elf64_hppa_dyn_hash_entry *elf64_hppa_dyn_hash_lookup
+ PARAMS ((struct elf64_hppa_dyn_hash_table *table, const char *string,
+ boolean create, boolean copy));
+static void elf64_hppa_dyn_hash_traverse
+ PARAMS ((struct elf64_hppa_dyn_hash_table *table,
+ boolean (*func) (struct elf64_hppa_dyn_hash_entry *, PTR),
+ PTR info));
+
+static const char *get_dyn_name
+ PARAMS ((asection *, struct elf_link_hash_entry *,
+ const Elf_Internal_Rela *, char **, size_t *));
+
+/* This must follow the definitions of the various derived linker
+ hash tables and shared functions. */
+#include "elf-hppa.h"
+
+static boolean elf64_hppa_object_p
+ PARAMS ((bfd *));
+
+static boolean elf64_hppa_section_from_shdr
+ PARAMS ((bfd *, Elf64_Internal_Shdr *, char *));
+
+static void elf64_hppa_post_process_headers
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean elf64_hppa_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean elf64_hppa_adjust_dynamic_symbol
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+
+static boolean elf64_hppa_size_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean elf64_hppa_finish_dynamic_symbol
+ PARAMS ((bfd *, struct bfd_link_info *,
+ struct elf_link_hash_entry *, Elf_Internal_Sym *));
+
+static boolean elf64_hppa_finish_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean elf64_hppa_check_relocs
+ PARAMS ((bfd *, struct bfd_link_info *,
+ asection *, const Elf_Internal_Rela *));
+
+static boolean elf64_hppa_dynamic_symbol_p
+ PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *));
+
+static boolean elf64_hppa_mark_exported_functions
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+
+static boolean elf64_hppa_finalize_opd
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean elf64_hppa_finalize_dlt
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean allocate_global_data_dlt
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean allocate_global_data_plt
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean allocate_global_data_stub
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean allocate_global_data_opd
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean get_reloc_section
+ PARAMS ((bfd *, struct elf64_hppa_link_hash_table *, asection *));
+
+static boolean count_dyn_reloc
+ PARAMS ((bfd *, struct elf64_hppa_dyn_hash_entry *,
+ int, asection *, int, bfd_vma, bfd_vma));
+
+static boolean allocate_dynrel_entries
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean elf64_hppa_finalize_dynreloc
+ PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+
+static boolean get_opd
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *));
+
+static boolean get_plt
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *));
+
+static boolean get_dlt
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *));
+
+static boolean get_stub
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *));
+
+static int elf64_hppa_elf_get_symbol_type
+ PARAMS ((Elf_Internal_Sym *, int));
+
+static boolean
+elf64_hppa_dyn_hash_table_init (ht, abfd, new)
+ struct elf64_hppa_dyn_hash_table *ht;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ new_hash_entry_func new;
+{
+ memset (ht, 0, sizeof (*ht));
+ return bfd_hash_table_init (&ht->root, new);
+}
+
+static struct bfd_hash_entry*
+elf64_hppa_new_dyn_hash_entry (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ struct elf64_hppa_dyn_hash_entry *ret;
+ ret = (struct elf64_hppa_dyn_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (!ret)
+ ret = bfd_hash_allocate (table, sizeof (*ret));
+
+ if (!ret)
+ return 0;
+
+ /* Initialize our local data. All zeros, and definitely easier
+ than setting 8 bit fields. */
+ memset (ret, 0, sizeof (*ret));
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct elf64_hppa_dyn_hash_entry *)
+ bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
+
+ return &ret->root;
+}
+
+/* Create the derived linker hash table. The PA64 ELF port uses this
+ derived hash table to keep information specific to the PA ElF
+ linker (without using static variables). */
+
+static struct bfd_link_hash_table*
+elf64_hppa_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct elf64_hppa_link_hash_table *ret;
+
+ ret = bfd_zalloc (abfd, sizeof (*ret));
+ if (!ret)
+ return 0;
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ _bfd_elf_link_hash_newfunc))
+ {
+ bfd_release (abfd, ret);
+ return 0;
+ }
+
+ if (!elf64_hppa_dyn_hash_table_init (&ret->dyn_hash_table, abfd,
+ elf64_hppa_new_dyn_hash_entry))
+ return 0;
+ return &ret->root.root;
+}
+
+/* Look up an entry in a PA64 ELF linker hash table. */
+
+static struct elf64_hppa_dyn_hash_entry *
+elf64_hppa_dyn_hash_lookup(table, string, create, copy)
+ struct elf64_hppa_dyn_hash_table *table;
+ const char *string;
+ boolean create, copy;
+{
+ return ((struct elf64_hppa_dyn_hash_entry *)
+ bfd_hash_lookup (&table->root, string, create, copy));
+}
+
+/* Traverse a PA64 ELF linker hash table. */
+
+static void
+elf64_hppa_dyn_hash_traverse (table, func, info)
+ struct elf64_hppa_dyn_hash_table *table;
+ boolean (*func) PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR));
+ PTR info;
+{
+ (bfd_hash_traverse
+ (&table->root,
+ (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) func,
+ info));
+}
+
+/* Return nonzero if ABFD represents a PA2.0 ELF64 file.
+
+ Additionally we set the default architecture and machine. */
+static boolean
+elf64_hppa_object_p (abfd)
+ bfd *abfd;
+{
+ Elf_Internal_Ehdr * i_ehdrp;
+ unsigned int flags;
+
+ i_ehdrp = elf_elfheader (abfd);
+ if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
+ {
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX)
+ return false;
+ }
+ else
+ {
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_HPUX)
+ return false;
+ }
+
+ flags = i_ehdrp->e_flags;
+ switch (flags & (EF_PARISC_ARCH | EF_PARISC_WIDE))
+ {
+ case EFA_PARISC_1_0:
+ return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 10);
+ case EFA_PARISC_1_1:
+ return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 11);
+ case EFA_PARISC_2_0:
+ return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20);
+ case EFA_PARISC_2_0 | EF_PARISC_WIDE:
+ return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
+ }
+ /* Don't be fussy. */
+ return true;
+}
+
+/* Given section type (hdr->sh_type), return a boolean indicating
+ whether or not the section is an elf64-hppa specific section. */
+static boolean
+elf64_hppa_section_from_shdr (abfd, hdr, name)
+ bfd *abfd;
+ Elf64_Internal_Shdr *hdr;
+ char *name;
+{
+ asection *newsect;
+
+ switch (hdr->sh_type)
+ {
+ case SHT_PARISC_EXT:
+ if (strcmp (name, ".PARISC.archext") != 0)
+ return false;
+ break;
+ case SHT_PARISC_UNWIND:
+ if (strcmp (name, ".PARISC.unwind") != 0)
+ return false;
+ break;
+ case SHT_PARISC_DOC:
+ case SHT_PARISC_ANNOT:
+ default:
+ return false;
+ }
+
+ if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
+ return false;
+ newsect = hdr->bfd_section;
+
+ return true;
+}
+
+/* Construct a string for use in the elf64_hppa_dyn_hash_table. The
+ name describes what was once potentially anonymous memory. We
+ allocate memory as necessary, possibly reusing PBUF/PLEN. */
+
+static const char *
+get_dyn_name (sec, h, rel, pbuf, plen)
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ const Elf_Internal_Rela *rel;
+ char **pbuf;
+ size_t *plen;
+{
+ size_t nlen, tlen;
+ char *buf;
+ size_t len;
+
+ if (h && rel->r_addend == 0)
+ return h->root.root.string;
+
+ if (h)
+ nlen = strlen (h->root.root.string);
+ else
+ nlen = 8 + 1 + sizeof (rel->r_info) * 2 - 8;
+ tlen = nlen + 1 + sizeof (rel->r_addend) * 2 + 1;
+
+ len = *plen;
+ buf = *pbuf;
+ if (len < tlen)
+ {
+ if (buf)
+ free (buf);
+ *pbuf = buf = malloc (tlen);
+ *plen = len = tlen;
+ if (!buf)
+ return NULL;
+ }
+
+ if (h)
+ {
+ memcpy (buf, h->root.root.string, nlen);
+ buf[nlen++] = '+';
+ sprintf_vma (buf + nlen, rel->r_addend);
+ }
+ else
+ {
+ nlen = sprintf (buf, "%x:%lx",
+ sec->id & 0xffffffff,
+ (long) ELF64_R_SYM (rel->r_info));
+ if (rel->r_addend)
+ {
+ buf[nlen++] = '+';
+ sprintf_vma (buf + nlen, rel->r_addend);
+ }
+ }
+
+ return buf;
+}
+
+/* SEC is a section containing relocs for an input BFD when linking; return
+ a suitable section for holding relocs in the output BFD for a link. */
+
+static boolean
+get_reloc_section (abfd, hppa_info, sec)
+ bfd *abfd;
+ struct elf64_hppa_link_hash_table *hppa_info;
+ asection *sec;
+{
+ const char *srel_name;
+ asection *srel;
+ bfd *dynobj;
+
+ srel_name = (bfd_elf_string_from_elf_section
+ (abfd, elf_elfheader(abfd)->e_shstrndx,
+ elf_section_data(sec)->rel_hdr.sh_name));
+ if (srel_name == NULL)
+ return false;
+
+ BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ srel_name+5) == 0)
+ || (strncmp (srel_name, ".rel", 4) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ srel_name+4) == 0));
+
+ dynobj = hppa_info->root.dynobj;
+ if (!dynobj)
+ hppa_info->root.dynobj = dynobj = abfd;
+
+ srel = bfd_get_section_by_name (dynobj, srel_name);
+ if (srel == NULL)
+ {
+ srel = bfd_make_section (dynobj, srel_name);
+ if (srel == NULL
+ || !bfd_set_section_flags (dynobj, srel,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || !bfd_set_section_alignment (dynobj, srel, 3))
+ return false;
+ }
+
+ hppa_info->other_rel_sec = srel;
+ return true;
+}
+
+/* Add a new entry to the list of dynamic relocations against DYN_H.
+
+ We use this to keep a record of all the FPTR relocations against a
+ particular symbol so that we can create FPTR relocations in the
+ output file. */
+
+static boolean
+count_dyn_reloc (abfd, dyn_h, type, sec, sec_symndx, offset, addend)
+ bfd *abfd;
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ int type;
+ asection *sec;
+ int sec_symndx;
+ bfd_vma offset;
+ bfd_vma addend;
+{
+ struct elf64_hppa_dyn_reloc_entry *rent;
+
+ rent = (struct elf64_hppa_dyn_reloc_entry *)
+ bfd_alloc (abfd, sizeof (*rent));
+ if (!rent)
+ return false;
+
+ rent->next = dyn_h->reloc_entries;
+ rent->type = type;
+ rent->sec = sec;
+ rent->sec_symndx = sec_symndx;
+ rent->offset = offset;
+ rent->addend = addend;
+ dyn_h->reloc_entries = rent;
+
+ return true;
+}
+
+/* Scan the RELOCS and record the type of dynamic entries that each
+ referenced symbol needs. */
+
+static boolean
+elf64_hppa_check_relocs (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+ struct elf64_hppa_link_hash_table *hppa_info;
+ const Elf_Internal_Rela *relend;
+ Elf_Internal_Shdr *symtab_hdr;
+ const Elf_Internal_Rela *rel;
+ asection *dlt, *plt, *stubs;
+ char *buf;
+ size_t buf_len;
+ int sec_symndx;
+
+ if (info->relocateable)
+ return true;
+
+ /* If this is the first dynamic object found in the link, create
+ the special sections required for dynamic linking. */
+ if (! elf_hash_table (info)->dynamic_sections_created)
+ {
+ if (! bfd_elf64_link_create_dynamic_sections (abfd, info))
+ return false;
+ }
+
+ hppa_info = elf64_hppa_hash_table (info);
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+
+ /* If necessary, build a new table holding section symbols indices
+ for this BFD. This is disgusting. */
+
+ if (info->shared && hppa_info->section_syms_bfd != abfd)
+ {
+ unsigned long i;
+ int highest_shndx;
+ Elf_Internal_Sym *local_syms, *isym;
+ Elf64_External_Sym *ext_syms, *esym;
+
+ /* We're done with the old cache of section index to section symbol
+ index information. Free it.
+
+ ?!? Note we leak the last section_syms array. Presumably we
+ could free it in one of the later routines in this file. */
+ if (hppa_info->section_syms)
+ free (hppa_info->section_syms);
+
+ /* Allocate memory for the internal and external symbols. */
+ local_syms
+ = (Elf_Internal_Sym *) bfd_malloc (symtab_hdr->sh_info
+ * sizeof (Elf_Internal_Sym));
+ if (local_syms == NULL)
+ return false;
+
+ ext_syms
+ = (Elf64_External_Sym *) bfd_malloc (symtab_hdr->sh_info
+ * sizeof (Elf64_External_Sym));
+ if (ext_syms == NULL)
+ {
+ free (local_syms);
+ return false;
+ }
+
+ /* Read in the local symbols. */
+ if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+ || bfd_read (ext_syms, 1,
+ (symtab_hdr->sh_info
+ * sizeof (Elf64_External_Sym)), abfd)
+ != (symtab_hdr->sh_info * sizeof (Elf64_External_Sym)))
+ {
+ free (local_syms);
+ free (ext_syms);
+ return false;
+ }
+
+ /* Swap in the local symbols, also record the highest section index
+ referenced by the local symbols. */
+ isym = local_syms;
+ esym = ext_syms;
+ highest_shndx = 0;
+ for (i = 0; i < symtab_hdr->sh_info; i++, esym++, isym++)
+ {
+ bfd_elf64_swap_symbol_in (abfd, esym, isym);
+ if (isym->st_shndx > highest_shndx)
+ highest_shndx = isym->st_shndx;
+ }
+
+ /* Now we can free the external symbols. */
+ free (ext_syms);
+
+ /* Allocate an array to hold the section index to section symbol index
+ mapping. Bump by one since we start counting at zero. */
+ highest_shndx++;
+ hppa_info->section_syms = (int *) bfd_malloc (highest_shndx
+ * sizeof (int));
+
+ /* Now walk the local symbols again. If we find a section symbol,
+ record the index of the symbol into the section_syms array. */
+ for (isym = local_syms, i = 0; i < symtab_hdr->sh_info; i++, isym++)
+ {
+ if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
+ hppa_info->section_syms[isym->st_shndx] = i;
+ }
+
+ /* We are finished with the local symbols. Get rid of them. */
+ free (local_syms);
+
+ /* Record which BFD we built the section_syms mapping for. */
+ hppa_info->section_syms_bfd = abfd;
+ }
+
+ /* Record the symbol index for this input section. We may need it for
+ relocations when building shared libraries. When not building shared
+ libraries this value is never really used, but assign it to zero to
+ prevent out of bounds memory accesses in other routines. */
+ if (info->shared)
+ {
+ sec_symndx = _bfd_elf_section_from_bfd_section (abfd, sec);
+
+ /* If we did not find a section symbol for this section, then
+ something went terribly wrong above. */
+ if (sec_symndx == -1)
+ return false;
+
+ sec_symndx = hppa_info->section_syms[sec_symndx];
+ }
+ else
+ sec_symndx = 0;
+
+ dlt = plt = stubs = NULL;
+ buf = NULL;
+ buf_len = 0;
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; ++rel)
+ {
+ enum {
+ NEED_DLT = 1,
+ NEED_PLT = 2,
+ NEED_STUB = 4,
+ NEED_OPD = 8,
+ NEED_DYNREL = 16,
+ };
+
+ struct elf_link_hash_entry *h = NULL;
+ unsigned long r_symndx = ELF64_R_SYM (rel->r_info);
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ int need_entry;
+ const char *addr_name;
+ boolean maybe_dynamic;
+ int dynrel_type = R_PARISC_NONE;
+ static reloc_howto_type *howto;
+
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ /* We're dealing with a global symbol -- find its hash entry
+ and mark it as being referenced. */
+ long indx = r_symndx - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ }
+
+ /* We can only get preliminary data on whether a symbol is
+ locally or externally defined, as not all of the input files
+ have yet been processed. Do something with what we know, as
+ this may help reduce memory usage and processing time later. */
+ maybe_dynamic = false;
+ if (h && ((info->shared && ! info->symbolic)
+ || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
+ || h->root.type == bfd_link_hash_defweak))
+ maybe_dynamic = true;
+
+ howto = elf_hppa_howto_table + ELF64_R_TYPE (rel->r_info);
+ need_entry = 0;
+ switch (howto->type)
+ {
+ /* These are simple indirect references to symbols through the
+ DLT. We need to create a DLT entry for any symbols which
+ appears in a DLTIND relocation. */
+ case R_PARISC_DLTIND21L:
+ case R_PARISC_DLTIND14R:
+ case R_PARISC_DLTIND14F:
+ case R_PARISC_DLTIND14WR:
+ case R_PARISC_DLTIND14DR:
+ need_entry = NEED_DLT;
+ break;
+
+ /* ?!? These need a DLT entry. But I have no idea what to do with
+ the "link time TP value. */
+ case R_PARISC_LTOFF_TP21L:
+ case R_PARISC_LTOFF_TP14R:
+ case R_PARISC_LTOFF_TP14F:
+ case R_PARISC_LTOFF_TP64:
+ case R_PARISC_LTOFF_TP14WR:
+ case R_PARISC_LTOFF_TP14DR:
+ case R_PARISC_LTOFF_TP16F:
+ case R_PARISC_LTOFF_TP16WF:
+ case R_PARISC_LTOFF_TP16DF:
+ need_entry = NEED_DLT;
+ break;
+
+ /* These are function calls. Depending on their precise target we
+ may need to make a stub for them. The stub uses the PLT, so we
+ need to create PLT entries for these symbols too. */
+ case R_PARISC_PCREL12F:
+ case R_PARISC_PCREL17F:
+ case R_PARISC_PCREL22F:
+ case R_PARISC_PCREL32:
+ case R_PARISC_PCREL64:
+ case R_PARISC_PCREL21L:
+ case R_PARISC_PCREL17R:
+ case R_PARISC_PCREL17C:
+ case R_PARISC_PCREL14R:
+ case R_PARISC_PCREL14F:
+ case R_PARISC_PCREL22C:
+ case R_PARISC_PCREL14WR:
+ case R_PARISC_PCREL14DR:
+ case R_PARISC_PCREL16F:
+ case R_PARISC_PCREL16WF:
+ case R_PARISC_PCREL16DF:
+ need_entry = (NEED_PLT | NEED_STUB);
+ break;
+
+ case R_PARISC_PLTOFF21L:
+ case R_PARISC_PLTOFF14R:
+ case R_PARISC_PLTOFF14F:
+ case R_PARISC_PLTOFF14WR:
+ case R_PARISC_PLTOFF14DR:
+ case R_PARISC_PLTOFF16F:
+ case R_PARISC_PLTOFF16WF:
+ case R_PARISC_PLTOFF16DF:
+ need_entry = (NEED_PLT);
+ break;
+
+ case R_PARISC_DIR64:
+ if (info->shared || maybe_dynamic)
+ need_entry = (NEED_DYNREL);
+ dynrel_type = R_PARISC_DIR64;
+ break;
+
+ /* This is an indirect reference through the DLT to get the address
+ of a OPD descriptor. Thus we need to make a DLT entry that points
+ to an OPD entry. */
+ case R_PARISC_LTOFF_FPTR21L:
+ case R_PARISC_LTOFF_FPTR14R:
+ case R_PARISC_LTOFF_FPTR14WR:
+ case R_PARISC_LTOFF_FPTR14DR:
+ case R_PARISC_LTOFF_FPTR32:
+ case R_PARISC_LTOFF_FPTR64:
+ case R_PARISC_LTOFF_FPTR16F:
+ case R_PARISC_LTOFF_FPTR16WF:
+ case R_PARISC_LTOFF_FPTR16DF:
+ if (info->shared || maybe_dynamic)
+ need_entry = (NEED_DLT | NEED_OPD);
+ else
+ need_entry = (NEED_DLT | NEED_OPD);
+ dynrel_type = R_PARISC_FPTR64;
+ break;
+
+ /* This is a simple OPD entry. */
+ case R_PARISC_FPTR64:
+ if (info->shared || maybe_dynamic)
+ need_entry = (NEED_OPD | NEED_DYNREL);
+ else
+ need_entry = (NEED_OPD);
+ dynrel_type = R_PARISC_FPTR64;
+ break;
+
+ /* Add more cases as needed. */
+ }
+
+ if (!need_entry)
+ continue;
+
+ /* Collect a canonical name for this address. */
+ addr_name = get_dyn_name (sec, h, rel, &buf, &buf_len);
+
+ /* Collect the canonical entry data for this address. */
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ addr_name, true, true);
+ BFD_ASSERT (dyn_h);
+
+ /* Stash away enough information to be able to find this symbol
+ regardless of whether or not it is local or global. */
+ dyn_h->h = h;
+ dyn_h->owner = abfd;
+ dyn_h->sym_indx = r_symndx;
+
+ /* ?!? We may need to do some error checking in here. */
+ /* Create what's needed. */
+ if (need_entry & NEED_DLT)
+ {
+ if (! hppa_info->dlt_sec
+ && ! get_dlt (abfd, info, hppa_info))
+ goto err_out;
+ dyn_h->want_dlt = 1;
+ }
+
+ if (need_entry & NEED_PLT)
+ {
+ if (! hppa_info->plt_sec
+ && ! get_plt (abfd, info, hppa_info))
+ goto err_out;
+ dyn_h->want_plt = 1;
+ }
+
+ if (need_entry & NEED_STUB)
+ {
+ if (! hppa_info->stub_sec
+ && ! get_stub (abfd, info, hppa_info))
+ goto err_out;
+ dyn_h->want_stub = 1;
+ }
+
+ if (need_entry & NEED_OPD)
+ {
+ if (! hppa_info->opd_sec
+ && ! get_opd (abfd, info, hppa_info))
+ goto err_out;
+
+ dyn_h->want_opd = 1;
+
+ /* FPTRs are not allocated by the dynamic linker for PA64, though
+ it is possible that will change in the future. */
+
+ /* This could be a local function that had its address taken, in
+ which case H will be NULL. */
+ if (h)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ }
+
+ /* Add a new dynamic relocation to the chain of dynamic
+ relocations for this symbol. */
+ if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC))
+ {
+ if (! hppa_info->other_rel_sec
+ && ! get_reloc_section (abfd, hppa_info, sec))
+ goto err_out;
+
+ if (!count_dyn_reloc (abfd, dyn_h, dynrel_type, sec,
+ sec_symndx, rel->r_offset, rel->r_addend))
+ goto err_out;
+
+ /* If we are building a shared library and we just recorded
+ a dynamic R_PARISC_FPTR64 relocation, then make sure the
+ section symbol for this section ends up in the dynamic
+ symbol table. */
+ if (info->shared && dynrel_type == R_PARISC_FPTR64
+ && ! (_bfd_elf64_link_record_local_dynamic_symbol
+ (info, abfd, sec_symndx)))
+ return false;
+ }
+ }
+
+ if (buf)
+ free (buf);
+ return true;
+
+ err_out:
+ if (buf)
+ free (buf);
+ return false;
+}
+
+struct elf64_hppa_allocate_data
+{
+ struct bfd_link_info *info;
+ bfd_size_type ofs;
+};
+
+/* Should we do dynamic things to this symbol? */
+
+static boolean
+elf64_hppa_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 (h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_defweak)
+ return true;
+
+ if (h->root.root.string[0] == '$' && h->root.root.string[1] == '$')
+ return false;
+
+ 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;
+}
+
+/* Mark all funtions exported by this file so that we can later allocate
+ entries in .opd for them. */
+
+static boolean
+elf64_hppa_mark_exported_functions (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ struct bfd_link_info *info = (struct bfd_link_info *)data;
+ struct elf64_hppa_link_hash_table *hppa_info;
+
+ hppa_info = elf64_hppa_hash_table (info);
+
+ if (h
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && h->root.u.def.section->output_section != NULL
+ && h->type == STT_FUNC)
+ {
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+
+ /* Add this symbol to the PA64 linker hash table. */
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ h->root.root.string, true, true);
+ BFD_ASSERT (dyn_h);
+ dyn_h->h = h;
+
+ if (! hppa_info->opd_sec
+ && ! get_opd (hppa_info->root.dynobj, info, hppa_info))
+ return false;
+
+ dyn_h->want_opd = 1;
+ /* Put a flag here for output_symbol_hook. */
+ dyn_h->st_shndx = -1;
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ }
+
+ return true;
+}
+
+/* Allocate space for a DLT entry. */
+
+static boolean
+allocate_global_data_dlt (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
+
+ if (dyn_h->want_dlt)
+ {
+ struct elf_link_hash_entry *h = dyn_h->h;
+
+ if (x->info->shared)
+ {
+ /* Possibly add the symbol to the local dynamic symbol
+ table since we might need to create a dynamic relocation
+ against it. */
+ if (! h
+ || (h && h->dynindx == -1))
+ {
+ bfd *owner;
+ owner = (h ? h->root.u.def.section->owner : dyn_h->owner);
+
+ if (!_bfd_elf64_link_record_local_dynamic_symbol
+ (x->info, owner, dyn_h->sym_indx))
+ return false;
+ }
+ }
+
+ dyn_h->dlt_offset = x->ofs;
+ x->ofs += DLT_ENTRY_SIZE;
+ }
+ return true;
+}
+
+/* Allocate space for a DLT.PLT entry. */
+
+static boolean
+allocate_global_data_plt (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
+
+ if (dyn_h->want_plt
+ && elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info)
+ && !((dyn_h->h->root.type == bfd_link_hash_defined
+ || dyn_h->h->root.type == bfd_link_hash_defweak)
+ && dyn_h->h->root.u.def.section->output_section != NULL))
+ {
+ dyn_h->plt_offset = x->ofs;
+ x->ofs += PLT_ENTRY_SIZE;
+ if (dyn_h->plt_offset < 0x2000)
+ elf64_hppa_hash_table (x->info)->gp_offset = dyn_h->plt_offset;
+ }
+ else
+ dyn_h->want_plt = 0;
+
+ return true;
+}
+
+/* Allocate space for a STUB entry. */
+
+static boolean
+allocate_global_data_stub (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
+
+ if (dyn_h->want_stub
+ && elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info)
+ && !((dyn_h->h->root.type == bfd_link_hash_defined
+ || dyn_h->h->root.type == bfd_link_hash_defweak)
+ && dyn_h->h->root.u.def.section->output_section != NULL))
+ {
+ dyn_h->stub_offset = x->ofs;
+ x->ofs += sizeof (plt_stub);
+ }
+ else
+ dyn_h->want_stub = 0;
+ return true;
+}
+
+/* Allocate space for a FPTR entry. */
+
+static boolean
+allocate_global_data_opd (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
+
+ if (dyn_h->want_opd)
+ {
+ struct elf_link_hash_entry *h = dyn_h->h;
+
+ if (h)
+ 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;
+
+ /* We never need an opd entry for a symbol which is not
+ defined by this output file. */
+ if (h && h->root.type == bfd_link_hash_undefined)
+ dyn_h->want_opd = 0;
+
+ /* If we are creating a shared library, took the address of a local
+ function or might export this function from this object file, then
+ we have to create an opd descriptor. */
+ else if (x->info->shared
+ || h == NULL
+ || h->dynindx == -1
+ || ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && h->root.u.def.section->output_section != NULL))
+ {
+ /* If we are creating a shared library, then we will have to
+ create a runtime relocation for the symbol to properly
+ initialize the .opd entry. Make sure the symbol gets
+ added to the dynamic symbol table. */
+ if (x->info->shared
+ && (h == NULL || (h->dynindx == -1)))
+ {
+ bfd *owner;
+ owner = (h ? h->root.u.def.section->owner : dyn_h->owner);
+
+ if (!_bfd_elf64_link_record_local_dynamic_symbol
+ (x->info, owner, dyn_h->sym_indx))
+ return false;
+ }
+
+ /* This may not be necessary or desirable anymore now that
+ we have some support for dealing with section symbols
+ in dynamic relocs. But name munging does make the result
+ much easier to debug. ie, the EPLT reloc will reference
+ a symbol like .foobar, instead of .text + offset. */
+ if (x->info->shared && h)
+ {
+ char *new_name;
+ struct elf_link_hash_entry *nh;
+
+ new_name = alloca (strlen (h->root.root.string) + 2);
+ new_name[0] = '.';
+ strcpy (new_name + 1, h->root.root.string);
+
+ nh = elf_link_hash_lookup (elf_hash_table (x->info),
+ new_name, true, true, true);
+
+ nh->root.type = h->root.type;
+ nh->root.u.def.value = h->root.u.def.value;
+ nh->root.u.def.section = h->root.u.def.section;
+
+ if (! bfd_elf64_link_record_dynamic_symbol (x->info, nh))
+ return false;
+
+ }
+ dyn_h->opd_offset = x->ofs;
+ x->ofs += OPD_ENTRY_SIZE;
+ }
+
+ /* Otherwise we do not need an opd entry. */
+ else
+ dyn_h->want_opd = 0;
+ }
+ return true;
+}
+
+/* HP requires the EI_OSABI field to be filled in. The assignment to
+ EI_ABIVERSION may not be strictly necessary. */
+
+static void
+elf64_hppa_post_process_headers (abfd, link_info)
+ bfd * abfd;
+ struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
+{
+ Elf_Internal_Ehdr * i_ehdrp;
+
+ i_ehdrp = elf_elfheader (abfd);
+
+ if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
+ {
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
+ }
+ else
+ {
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX;
+ i_ehdrp->e_ident[EI_ABIVERSION] = 1;
+ }
+}
+
+/* Create function descriptor section (.opd). This section is called .opd
+ because it contains "official prodecure descriptors". The "official"
+ refers to the fact that these descriptors are used when taking the address
+ of a procedure, thus ensuring a unique address for each procedure. */
+
+static boolean
+get_opd (abfd, info, hppa_info)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elf64_hppa_link_hash_table *hppa_info;
+{
+ asection *opd;
+ bfd *dynobj;
+
+ opd = hppa_info->opd_sec;
+ if (!opd)
+ {
+ dynobj = hppa_info->root.dynobj;
+ if (!dynobj)
+ hppa_info->root.dynobj = dynobj = abfd;
+
+ opd = bfd_make_section (dynobj, ".opd");
+ if (!opd
+ || !bfd_set_section_flags (dynobj, opd,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, opd, 3))
+ {
+ BFD_ASSERT (0);
+ return false;
+ }
+
+ hppa_info->opd_sec = opd;
+ }
+
+ return true;
+}
+
+/* Create the PLT section. */
+
+static boolean
+get_plt (abfd, info, hppa_info)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elf64_hppa_link_hash_table *hppa_info;
+{
+ asection *plt;
+ bfd *dynobj;
+
+ plt = hppa_info->plt_sec;
+ if (!plt)
+ {
+ dynobj = hppa_info->root.dynobj;
+ if (!dynobj)
+ hppa_info->root.dynobj = dynobj = abfd;
+
+ plt = bfd_make_section (dynobj, ".plt");
+ if (!plt
+ || !bfd_set_section_flags (dynobj, plt,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, plt, 3))
+ {
+ BFD_ASSERT (0);
+ return false;
+ }
+
+ hppa_info->plt_sec = plt;
+ }
+
+ return true;
+}
+
+/* Create the DLT section. */
+
+static boolean
+get_dlt (abfd, info, hppa_info)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elf64_hppa_link_hash_table *hppa_info;
+{
+ asection *dlt;
+ bfd *dynobj;
+
+ dlt = hppa_info->dlt_sec;
+ if (!dlt)
+ {
+ dynobj = hppa_info->root.dynobj;
+ if (!dynobj)
+ hppa_info->root.dynobj = dynobj = abfd;
+
+ dlt = bfd_make_section (dynobj, ".dlt");
+ if (!dlt
+ || !bfd_set_section_flags (dynobj, dlt,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, dlt, 3))
+ {
+ BFD_ASSERT (0);
+ return false;
+ }
+
+ hppa_info->dlt_sec = dlt;
+ }
+
+ return true;
+}
+
+/* Create the stubs section. */
+
+static boolean
+get_stub (abfd, info, hppa_info)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elf64_hppa_link_hash_table *hppa_info;
+{
+ asection *stub;
+ bfd *dynobj;
+
+ stub = hppa_info->stub_sec;
+ if (!stub)
+ {
+ dynobj = hppa_info->root.dynobj;
+ if (!dynobj)
+ hppa_info->root.dynobj = dynobj = abfd;
+
+ stub = bfd_make_section (dynobj, ".stub");
+ if (!stub
+ || !bfd_set_section_flags (dynobj, stub,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, stub, 3))
+ {
+ BFD_ASSERT (0);
+ return false;
+ }
+
+ hppa_info->stub_sec = stub;
+ }
+
+ return true;
+}
+
+/* Create sections necessary for dynamic linking. This is only a rough
+ cut and will likely change as we learn more about the somewhat
+ unusual dynamic linking scheme HP uses.
+
+ .stub:
+ Contains code to implement cross-space calls. The first time one
+ of the stubs is used it will call into the dynamic linker, later
+ calls will go straight to the target.
+
+ The only stub we support right now looks like
+
+ ldd OFFSET(%dp),%r1
+ bve %r0(%r1)
+ ldd OFFSET+8(%dp),%dp
+
+ Other stubs may be needed in the future. We may want the remove
+ the break/nop instruction. It is only used right now to keep the
+ offset of a .plt entry and a .stub entry in sync.
+
+ .dlt:
+ This is what most people call the .got. HP used a different name.
+ Losers.
+
+ .rela.dlt:
+ Relocations for the DLT.
+
+ .plt:
+ Function pointers as address,gp pairs.
+
+ .rela.plt:
+ Should contain dynamic IPLT (and EPLT?) relocations.
+
+ .opd:
+ FPTRS
+
+ .rela.opd:
+ EPLT relocations for symbols exported from shared libraries. */
+
+static boolean
+elf64_hppa_create_dynamic_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ asection *s;
+
+ if (! get_stub (abfd, info, elf64_hppa_hash_table (info)))
+ return false;
+
+ if (! get_dlt (abfd, info, elf64_hppa_hash_table (info)))
+ return false;
+
+ if (! get_plt (abfd, info, elf64_hppa_hash_table (info)))
+ return false;
+
+ if (! get_opd (abfd, info, elf64_hppa_hash_table (info)))
+ return false;
+
+ s = bfd_make_section(abfd, ".rela.dlt");
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, s, 3))
+ return false;
+ elf64_hppa_hash_table (info)->dlt_rel_sec = s;
+
+ s = bfd_make_section(abfd, ".rela.plt");
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, s, 3))
+ return false;
+ elf64_hppa_hash_table (info)->plt_rel_sec = s;
+
+ s = bfd_make_section(abfd, ".rela.data");
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, s, 3))
+ return false;
+ elf64_hppa_hash_table (info)->other_rel_sec = s;
+
+ s = bfd_make_section(abfd, ".rela.opd");
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, s, 3))
+ return false;
+ elf64_hppa_hash_table (info)->opd_rel_sec = s;
+
+ return true;
+}
+
+/* Allocate dynamic relocations for those symbols that turned out
+ to be dynamic. */
+
+static boolean
+allocate_dynrel_entries (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data;
+ struct elf64_hppa_link_hash_table *hppa_info;
+ struct elf64_hppa_dyn_reloc_entry *rent;
+ boolean dynamic_symbol, shared;
+
+ hppa_info = elf64_hppa_hash_table (x->info);
+ dynamic_symbol = elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info);
+ shared = x->info->shared;
+
+ /* We may need to allocate relocations for a non-dynamic symbol
+ when creating a shared library. */
+ if (!dynamic_symbol && !shared)
+ return true;
+
+ /* Take care of the normal data relocations. */
+
+ for (rent = dyn_h->reloc_entries; rent; rent = rent->next)
+ {
+ switch (rent->type)
+ {
+ case R_PARISC_FPTR64:
+ /* Allocate one iff we are not building a shared library and
+ !want_opd, which by this point will be true only if we're
+ actually allocating one statically in the main executable. */
+ if (!x->info->shared && dyn_h->want_opd)
+ continue;
+ break;
+ }
+ hppa_info->other_rel_sec->_raw_size += sizeof (Elf64_External_Rela);
+
+ /* Make sure this symbol gets into the dynamic symbol table if it is
+ not already recorded. ?!? This should not be in the loop since
+ the symbol need only be added once. */
+ if (dyn_h->h == 0 || dyn_h->h->dynindx == -1)
+ if (!_bfd_elf64_link_record_local_dynamic_symbol
+ (x->info, rent->sec->owner, dyn_h->sym_indx))
+ return false;
+ }
+
+ /* Take care of the GOT and PLT relocations. */
+
+ if ((dynamic_symbol || shared) && dyn_h->want_dlt)
+ hppa_info->dlt_rel_sec->_raw_size += sizeof (Elf64_External_Rela);
+
+ /* If we are building a shared library, then every symbol that has an
+ opd entry will need an EPLT relocation to relocate the symbol's address
+ and __gp value based on the runtime load address. */
+ if (shared && dyn_h->want_opd)
+ hppa_info->opd_rel_sec->_raw_size += sizeof (Elf64_External_Rela);
+
+ if (dyn_h->want_plt && dynamic_symbol)
+ {
+ bfd_size_type t = 0;
+
+ /* Dynamic symbols get one IPLT relocation. Local symbols in
+ shared libraries get two REL relocations. Local symbols in
+ main applications get nothing. */
+ if (dynamic_symbol)
+ t = sizeof (Elf64_External_Rela);
+ else if (shared)
+ t = 2 * sizeof (Elf64_External_Rela);
+
+ hppa_info->plt_rel_sec->_raw_size += t;
+ }
+
+ return true;
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+ regular object. */
+
+static boolean
+elf64_hppa_adjust_dynamic_symbol (info, h)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elf_link_hash_entry *h;
+{
+ /* ??? Undefined symbols with PLT entries should be re-defined
+ to be the PLT entry. */
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->weakdef != NULL)
+ {
+ BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+ || h->weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->weakdef->root.u.def.section;
+ h->root.u.def.value = h->weakdef->root.u.def.value;
+ return true;
+ }
+
+ /* If this is a reference to a symbol defined by a dynamic object which
+ is not a function, we might allocate the symbol in our .dynbss section
+ and allocate a COPY dynamic relocation.
+
+ But PA64 code is canonically PIC, so as a rule we can avoid this sort
+ of hackery. */
+
+ return true;
+}
+
+/* Set the final sizes of the dynamic sections and allocate memory for
+ the contents of our special sections. */
+
+static boolean
+elf64_hppa_size_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ bfd *dynobj;
+ asection *s;
+ boolean plt;
+ boolean relocs;
+ boolean reltext;
+ struct elf64_hppa_allocate_data data;
+ struct elf64_hppa_link_hash_table *hppa_info;
+
+ hppa_info = elf64_hppa_hash_table (info);
+
+ dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Set the contents of the .interp section to the interpreter. */
+ if (! info->shared)
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+ else
+ {
+ /* We may have created entries in the .rela.got section.
+ However, if we are not creating the dynamic sections, we will
+ not actually use these entries. Reset the size of .rela.dlt,
+ which will cause it to get stripped from the output file
+ below. */
+ s = bfd_get_section_by_name (dynobj, ".rela.dlt");
+ if (s != NULL)
+ s->_raw_size = 0;
+ }
+
+ /* Allocate the GOT entries. */
+
+ data.info = info;
+ if (elf64_hppa_hash_table (info)->dlt_sec)
+ {
+ data.ofs = 0x0;
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ allocate_global_data_dlt, &data);
+ hppa_info->dlt_sec->_raw_size = data.ofs;
+
+ data.ofs = 0x0;
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ allocate_global_data_plt, &data);
+ hppa_info->plt_sec->_raw_size = data.ofs;
+
+ data.ofs = 0x0;
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ allocate_global_data_stub, &data);
+ hppa_info->stub_sec->_raw_size = data.ofs;
+ }
+
+ /* Mark each function this program exports so that we will allocate
+ space in the .opd section for each function's FPTR.
+
+ We have to traverse the main linker hash table since we have to
+ find functions which may not have been mentioned in any relocs. */
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf64_hppa_mark_exported_functions,
+ info);
+
+ /* Allocate space for entries in the .opd section. */
+ if (elf64_hppa_hash_table (info)->opd_sec)
+ {
+ data.ofs = 0;
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ allocate_global_data_opd, &data);
+ hppa_info->opd_sec->_raw_size = data.ofs;
+ }
+
+ /* Now allocate space for dynamic relocations, if necessary. */
+ if (hppa_info->root.dynamic_sections_created)
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ allocate_dynrel_entries, &data);
+
+ /* The sizes of all the sections are set. Allocate memory for them. */
+ plt = false;
+ relocs = false;
+ reltext = false;
+ for (s = dynobj->sections; s != NULL; s = s->next)
+ {
+ const char *name;
+ boolean strip;
+
+ if ((s->flags & SEC_LINKER_CREATED) == 0)
+ continue;
+
+ /* It's OK to base decisions on the section name, because none
+ of the dynobj section names depend upon the input files. */
+ name = bfd_get_section_name (dynobj, s);
+
+ strip = 0;
+
+ if (strcmp (name, ".plt") == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ strip = true;
+ }
+ else
+ {
+ /* Remember whether there is a PLT. */
+ plt = true;
+ }
+ }
+ else if (strcmp (name, ".dlt") == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ strip = true;
+ }
+ }
+ else if (strcmp (name, ".opd") == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ strip = true;
+ }
+ }
+ else if (strncmp (name, ".rela", 4) == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ strip = true;
+ }
+ else
+ {
+ asection *target;
+
+ /* Remember whether there are any reloc sections other
+ than .rela.plt. */
+ if (strcmp (name, ".rela.plt") != 0)
+ {
+ const char *outname;
+
+ relocs = true;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL
+ entry. The entries in the .rela.plt section
+ really apply to the .got section, which we
+ created ourselves and so know is not readonly. */
+ 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)
+ reltext = true;
+ }
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ }
+ else if (strncmp (name, ".dlt", 4) != 0
+ && strcmp (name, ".stub") != 0
+ && strcmp (name, ".got") != 0)
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
+
+ if (strip)
+ {
+ _bfd_strip_section_from_output (info, s);
+ continue;
+ }
+
+ /* Allocate memory for the section contents if it has not
+ been allocated already. 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_PARISC_NONE reloc instead of
+ garbage. */
+ if (s->contents == NULL)
+ {
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+ if (s->contents == NULL && s->_raw_size != 0)
+ return false;
+ }
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Always create a DT_PLTGOT. It actually has nothing to do with
+ the PLT, it is how we communicate the __gp value of a load
+ module to the dynamic linker. */
+ if (! bfd_elf64_add_dynamic_entry (info, DT_HP_DLD_FLAGS, 0)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0))
+ return false;
+
+ /* Add some entries to the .dynamic section. We fill in the
+ values later, in elf64_hppa_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
+ if (! info->shared)
+ {
+ if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_HP_DLD_HOOK, 0)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_HP_LOAD_MAP, 0))
+ return false;
+ }
+
+ if (plt)
+ {
+ if (! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0))
+ return false;
+ }
+
+ if (relocs)
+ {
+ 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)))
+ return false;
+ }
+
+ if (reltext)
+ {
+ if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
+ return false;
+ info->flags |= DF_TEXTREL;
+ }
+ }
+
+ return true;
+}
+
+/* Called after we have output the symbol into the dynamic symbol
+ table, but before we output the symbol into the normal symbol
+ table.
+
+ For some symbols we had to change their address when outputting
+ the dynamic symbol table. We undo that change here so that
+ the symbols have their expected value in the normal symbol
+ table. Ick. */
+
+static boolean
+elf64_hppa_link_output_symbol_hook (abfd, info, name, sym, input_sec)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info;
+ const char *name;
+ Elf_Internal_Sym *sym;
+ asection *input_sec ATTRIBUTE_UNUSED;
+{
+ struct elf64_hppa_link_hash_table *hppa_info;
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+
+ /* We may be called with the file symbol or section symbols.
+ They never need munging, so it is safe to ignore them. */
+ if (!name)
+ return true;
+
+ /* Get the PA dyn_symbol (if any) associated with NAME. */
+ hppa_info = elf64_hppa_hash_table (info);
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ name, false, false);
+
+ /* Function symbols for which we created .opd entries *may* have been
+ munged by finish_dynamic_symbol and have to be un-munged here.
+
+ Note that finish_dynamic_symbol sometimes turns dynamic symbols
+ into non-dynamic ones, so we initialize st_shndx to -1 in
+ mark_exported_functions and check to see if it was overwritten
+ here instead of just checking dyn_h->h->dynindx. */
+ if (dyn_h && dyn_h->want_opd && dyn_h->st_shndx != -1)
+ {
+ /* Restore the saved value and section index. */
+ sym->st_value = dyn_h->st_value;
+ sym->st_shndx = dyn_h->st_shndx;
+ }
+
+ return true;
+}
+
+/* Finish up dynamic symbol handling. We set the contents of various
+ dynamic sections here. */
+
+static boolean
+elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ asection *stub, *splt, *sdlt, *sopd, *spltrel, *sdltrel;
+ struct elf64_hppa_link_hash_table *hppa_info;
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+
+ hppa_info = elf64_hppa_hash_table (info);
+ dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
+ h->root.root.string, false, false);
+
+ stub = hppa_info->stub_sec;
+ splt = hppa_info->plt_sec;
+ sdlt = hppa_info->dlt_sec;
+ sopd = hppa_info->opd_sec;
+ spltrel = hppa_info->plt_rel_sec;
+ sdltrel = hppa_info->dlt_rel_sec;
+
+ BFD_ASSERT (stub != NULL && splt != NULL
+ && sopd != NULL && sdlt != NULL)
+
+ /* Incredible. It is actually necessary to NOT use the symbol's real
+ value when building the dynamic symbol table for a shared library.
+ At least for symbols that refer to functions.
+
+ We will store a new value and section index into the symbol long
+ enough to output it into the dynamic symbol table, then we restore
+ the original values (in elf64_hppa_link_output_symbol_hook). */
+ if (dyn_h && dyn_h->want_opd)
+ {
+ /* Save away the original value and section index so that we
+ can restore them later. */
+ dyn_h->st_value = sym->st_value;
+ dyn_h->st_shndx = sym->st_shndx;
+
+ /* For the dynamic symbol table entry, we want the value to be
+ address of this symbol's entry within the .opd section. */
+ sym->st_value = (dyn_h->opd_offset
+ + sopd->output_offset
+ + sopd->output_section->vma);
+ sym->st_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
+ sopd->output_section);
+ }
+
+ /* Initialize a .plt entry if requested. */
+ if (dyn_h && dyn_h->want_plt
+ && elf64_hppa_dynamic_symbol_p (dyn_h->h, info))
+ {
+ bfd_vma value;
+ Elf_Internal_Rela rel;
+
+ /* We do not actually care about the value in the PLT entry
+ if we are creating a shared library and the symbol is
+ still undefined, we create a dynamic relocation to fill
+ in the correct value. */
+ if (info->shared && h->root.type == bfd_link_hash_undefined)
+ value = 0;
+ else
+ value = (h->root.u.def.value + h->root.u.def.section->vma);
+
+ /* Fill in the entry in the procedure linkage table.
+
+ The format of a plt entry is
+ <funcaddr> <__gp>.
+
+ plt_offset is the offset within the PLT section at which to
+ install the PLT entry.
+
+ We are modifying the in-memory PLT contents here, so we do not add
+ in the output_offset of the PLT section. */
+
+ bfd_put_64 (splt->owner, value, splt->contents + dyn_h->plt_offset);
+ value = _bfd_get_gp_value (splt->output_section->owner);
+ bfd_put_64 (splt->owner, value, splt->contents + dyn_h->plt_offset + 0x8);
+
+ /* Create a dynamic IPLT relocation for this entry.
+
+ We are creating a relocation in the output file's PLT section,
+ which is included within the DLT secton. So we do need to include
+ the PLT's output_offset in the computation of the relocation's
+ address. */
+ rel.r_offset = (dyn_h->plt_offset + splt->output_offset
+ + splt->output_section->vma);
+ rel.r_info = ELF64_R_INFO (h->dynindx, R_PARISC_IPLT);
+ rel.r_addend = 0;
+
+ bfd_elf64_swap_reloca_out (splt->output_section->owner, &rel,
+ (((Elf64_External_Rela *)
+ spltrel->contents)
+ + spltrel->reloc_count));
+ spltrel->reloc_count++;
+ }
+
+ /* Initialize an external call stub entry if requested. */
+ if (dyn_h && dyn_h->want_stub
+ && elf64_hppa_dynamic_symbol_p (dyn_h->h, info))
+ {
+ bfd_vma value;
+ int insn;
+ unsigned int max_offset;
+
+ /* Install the generic stub template.
+
+ We are modifying the contents of the stub section, so we do not
+ need to include the stub section's output_offset here. */
+ memcpy (stub->contents + dyn_h->stub_offset, plt_stub, sizeof (plt_stub));
+
+ /* Fix up the first ldd instruction.
+
+ We are modifying the contents of the STUB section in memory,
+ so we do not need to include its output offset in this computation.
+
+ Note the plt_offset value is the value of the PLT entry relative to
+ the start of the PLT section. These instructions will reference
+ data relative to the value of __gp, which may not necessarily have
+ the same address as the start of the PLT section.
+
+ gp_offset contains the offset of __gp within the PLT section. */
+ value = dyn_h->plt_offset - hppa_info->gp_offset;
+
+ insn = bfd_get_32 (stub->owner, stub->contents + dyn_h->stub_offset);
+ if (output_bfd->arch_info->mach >= 25)
+ {
+ /* Wide mode allows 16 bit offsets. */
+ max_offset = 32768;
+ insn &= ~ 0xfff1;
+ insn |= re_assemble_16 (value);
+ }
+ else
+ {
+ max_offset = 8192;
+ insn &= ~ 0x3ff1;
+ insn |= re_assemble_14 (value);
+ }
+
+ if ((value & 7) || value + max_offset >= 2*max_offset - 8)
+ {
+ (*_bfd_error_handler) (_("stub entry for %s cannot load .plt, dp offset = %ld"),
+ dyn_h->root.string,
+ (long) value);
+ return false;
+ }
+
+ bfd_put_32 (stub->owner, insn,
+ stub->contents + dyn_h->stub_offset);
+
+ /* Fix up the second ldd instruction. */
+ value += 8;
+ insn = bfd_get_32 (stub->owner, stub->contents + dyn_h->stub_offset + 8);
+ if (output_bfd->arch_info->mach >= 25)
+ {
+ insn &= ~ 0xfff1;
+ insn |= re_assemble_16 (value);
+ }
+ else
+ {
+ insn &= ~ 0x3ff1;
+ insn |= re_assemble_14 (value);
+ }
+ bfd_put_32 (stub->owner, insn,
+ stub->contents + dyn_h->stub_offset + 8);
+ }
+
+ /* Millicode symbols should not be put in the dynamic
+ symbol table under any circumstances. */
+ if (ELF_ST_TYPE (sym->st_info) == STT_PARISC_MILLI)
+ h->dynindx = -1;
+
+ return true;
+}
+
+/* The .opd section contains FPTRs for each function this file
+ exports. Initialize the FPTR entries. */
+
+static boolean
+elf64_hppa_finalize_opd (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct bfd_link_info *info = (struct bfd_link_info *)data;
+ struct elf64_hppa_link_hash_table *hppa_info;
+ struct elf_link_hash_entry *h = dyn_h->h;
+ asection *sopd;
+ asection *sopdrel;
+
+ hppa_info = elf64_hppa_hash_table (info);
+ sopd = hppa_info->opd_sec;
+ sopdrel = hppa_info->opd_rel_sec;
+
+ if (h && dyn_h && dyn_h->want_opd)
+ {
+ bfd_vma value;
+
+ /* The first two words of an .opd entry are zero.
+
+ We are modifying the contents of the OPD section in memory, so we
+ do not need to include its output offset in this computation. */
+ memset (sopd->contents + dyn_h->opd_offset, 0, 16);
+
+ value = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+
+ /* The next word is the address of the function. */
+ bfd_put_64 (sopd->owner, value, sopd->contents + dyn_h->opd_offset + 16);
+
+ /* The last word is our local __gp value. */
+ value = _bfd_get_gp_value (sopd->output_section->owner);
+ bfd_put_64 (sopd->owner, value, sopd->contents + dyn_h->opd_offset + 24);
+ }
+
+ /* If we are generating a shared library, we must generate EPLT relocations
+ for each entry in the .opd, even for static functions (they may have
+ had their address taken). */
+ if (info->shared && dyn_h && dyn_h->want_opd)
+ {
+ Elf64_Internal_Rela rel;
+ int dynindx;
+
+ /* We may need to do a relocation against a local symbol, in
+ which case we have to look up it's dynamic symbol index off
+ the local symbol hash table. */
+ if (h && h->dynindx != -1)
+ dynindx = h->dynindx;
+ else
+ dynindx
+ = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner,
+ dyn_h->sym_indx);
+
+ /* The offset of this relocation is the absolute address of the
+ .opd entry for this symbol. */
+ rel.r_offset = (dyn_h->opd_offset + sopd->output_offset
+ + sopd->output_section->vma);
+
+ /* If H is non-null, then we have an external symbol.
+
+ It is imperative that we use a different dynamic symbol for the
+ EPLT relocation if the symbol has global scope.
+
+ In the dynamic symbol table, the function symbol will have a value
+ which is address of the function's .opd entry.
+
+ Thus, we can not use that dynamic symbol for the EPLT relocation
+ (if we did, the data in the .opd would reference itself rather
+ than the actual address of the function). Instead we have to use
+ a new dynamic symbol which has the same value as the original global
+ function symbol.
+
+ We prefix the original symbol with a "." and use the new symbol in
+ the EPLT relocation. This new symbol has already been recorded in
+ the symbol table, we just have to look it up and use it.
+
+ We do not have such problems with static functions because we do
+ not make their addresses in the dynamic symbol table point to
+ the .opd entry. Ultimately this should be safe since a static
+ function can not be directly referenced outside of its shared
+ library.
+
+ We do have to play similar games for FPTR relocations in shared
+ libraries, including those for static symbols. See the FPTR
+ handling in elf64_hppa_finalize_dynreloc. */
+ if (h)
+ {
+ char *new_name;
+ struct elf_link_hash_entry *nh;
+
+ new_name = alloca (strlen (h->root.root.string) + 2);
+ new_name[0] = '.';
+ strcpy (new_name + 1, h->root.root.string);
+
+ nh = elf_link_hash_lookup (elf_hash_table (info),
+ new_name, false, false, false);
+
+ /* All we really want from the new symbol is its dynamic
+ symbol index. */
+ dynindx = nh->dynindx;
+ }
+
+ rel.r_addend = 0;
+ rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_EPLT);
+
+ bfd_elf64_swap_reloca_out (sopd->output_section->owner, &rel,
+ (((Elf64_External_Rela *)
+ sopdrel->contents)
+ + sopdrel->reloc_count));
+ sopdrel->reloc_count++;
+ }
+ return true;
+}
+
+/* The .dlt section contains addresses for items referenced through the
+ dlt. Note that we can have a DLTIND relocation for a local symbol, thus
+ we can not depend on finish_dynamic_symbol to initialize the .dlt. */
+
+static boolean
+elf64_hppa_finalize_dlt (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct bfd_link_info *info = (struct bfd_link_info *)data;
+ struct elf64_hppa_link_hash_table *hppa_info;
+ asection *sdlt, *sdltrel;
+ struct elf_link_hash_entry *h = dyn_h->h;
+
+ hppa_info = elf64_hppa_hash_table (info);
+
+ sdlt = hppa_info->dlt_sec;
+ sdltrel = hppa_info->dlt_rel_sec;
+
+ /* H/DYN_H may refer to a local variable and we know it's
+ address, so there is no need to create a relocation. Just install
+ the proper value into the DLT, note this shortcut can not be
+ skipped when building a shared library. */
+ if (! info->shared && h && dyn_h && dyn_h->want_dlt)
+ {
+ bfd_vma value;
+
+ /* If we had an LTOFF_FPTR style relocation we want the DLT entry
+ to point to the FPTR entry in the .opd section.
+
+ We include the OPD's output offset in this computation as
+ we are referring to an absolute address in the resulting
+ object file. */
+ if (dyn_h->want_opd)
+ {
+ value = (dyn_h->opd_offset
+ + hppa_info->opd_sec->output_offset
+ + hppa_info->opd_sec->output_section->vma);
+ }
+ else
+ {
+ value = (h->root.u.def.value
+ + h->root.u.def.section->output_offset);
+
+ if (h->root.u.def.section->output_section)
+ value += h->root.u.def.section->output_section->vma;
+ else
+ value += h->root.u.def.section->vma;
+ }
+
+ /* We do not need to include the output offset of the DLT section
+ here because we are modifying the in-memory contents. */
+ bfd_put_64 (sdlt->owner, value, sdlt->contents + dyn_h->dlt_offset);
+ }
+
+ /* Create a relocation for the DLT entry assocated with this symbol.
+ When building a shared library the symbol does not have to be dynamic. */
+ if (dyn_h->want_dlt
+ && (elf64_hppa_dynamic_symbol_p (dyn_h->h, info) || info->shared))
+ {
+ Elf64_Internal_Rela rel;
+ int dynindx;
+
+ /* We may need to do a relocation against a local symbol, in
+ which case we have to look up it's dynamic symbol index off
+ the local symbol hash table. */
+ if (h && h->dynindx != -1)
+ dynindx = h->dynindx;
+ else
+ dynindx
+ = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner,
+ dyn_h->sym_indx);
+
+ /* Create a dynamic relocation for this entry. Do include the output
+ offset of the DLT entry since we need an absolute address in the
+ resulting object file. */
+ rel.r_offset = (dyn_h->dlt_offset + sdlt->output_offset
+ + sdlt->output_section->vma);
+ if (h && h->type == STT_FUNC)
+ rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_FPTR64);
+ else
+ rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_DIR64);
+ rel.r_addend = 0;
+
+ bfd_elf64_swap_reloca_out (sdlt->output_section->owner, &rel,
+ (((Elf64_External_Rela *)
+ sdltrel->contents)
+ + sdltrel->reloc_count));
+ sdltrel->reloc_count++;
+ }
+ return true;
+}
+
+/* Finalize the dynamic relocations. Specifically the FPTR relocations
+ for dynamic functions used to initialize static data. */
+
+static boolean
+elf64_hppa_finalize_dynreloc (dyn_h, data)
+ struct elf64_hppa_dyn_hash_entry *dyn_h;
+ PTR data;
+{
+ struct bfd_link_info *info = (struct bfd_link_info *)data;
+ struct elf64_hppa_link_hash_table *hppa_info;
+ struct elf_link_hash_entry *h;
+ int dynamic_symbol;
+
+ dynamic_symbol = elf64_hppa_dynamic_symbol_p (dyn_h->h, info);
+
+ if (!dynamic_symbol && !info->shared)
+ return true;
+
+ if (dyn_h->reloc_entries)
+ {
+ struct elf64_hppa_dyn_reloc_entry *rent;
+ int dynindx;
+
+ hppa_info = elf64_hppa_hash_table (info);
+ h = dyn_h->h;
+
+ /* We may need to do a relocation against a local symbol, in
+ which case we have to look up it's dynamic symbol index off
+ the local symbol hash table. */
+ if (h && h->dynindx != -1)
+ dynindx = h->dynindx;
+ else
+ dynindx
+ = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner,
+ dyn_h->sym_indx);
+
+ for (rent = dyn_h->reloc_entries; rent; rent = rent->next)
+ {
+ Elf64_Internal_Rela rel;
+
+ switch (rent->type)
+ {
+ case R_PARISC_FPTR64:
+ /* Allocate one iff we are not building a shared library and
+ !want_opd, which by this point will be true only if we're
+ actually allocating one statically in the main executable. */
+ if (!info->shared && dyn_h->want_opd)
+ continue;
+ break;
+ }
+
+ /* Create a dynamic relocation for this entry.
+
+ We need the output offset for the reloc's section because
+ we are creating an absolute address in the resulting object
+ file. */
+ rel.r_offset = (rent->offset + rent->sec->output_offset
+ + rent->sec->output_section->vma);
+
+ /* An FPTR64 relocation implies that we took the address of
+ a function and that the function has an entry in the .opd
+ section. We want the FPTR64 relocation to reference the
+ entry in .opd.
+
+ We could munge the symbol value in the dynamic symbol table
+ (in fact we already do for functions with global scope) to point
+ to the .opd entry. Then we could use that dynamic symbol in
+ this relocation.
+
+ Or we could do something sensible, not munge the symbol's
+ address and instead just use a different symbol to reference
+ the .opd entry. At least that seems sensible until you
+ realize there's no local dynamic symbols we can use for that
+ purpose. Thus the hair in the check_relocs routine.
+
+ We use a section symbol recorded by check_relocs as the
+ base symbol for the relocation. The addend is the difference
+ between the section symbol and the address of the .opd entry. */
+ if (info->shared && rent->type == R_PARISC_FPTR64)
+ {
+ bfd_vma value, value2;
+
+ /* First compute the address of the opd entry for this symbol. */
+ value = (dyn_h->opd_offset
+ + hppa_info->opd_sec->output_section->vma
+ + hppa_info->opd_sec->output_offset);
+
+ /* Compute the value of the start of the section with
+ the relocation. */
+ value2 = (rent->sec->output_section->vma
+ + rent->sec->output_offset);
+
+ /* Compute the difference between the start of the section
+ with the relocation and the opd entry. */
+ value -= value2;
+
+ /* The result becomes the addend of the relocation. */
+ rel.r_addend = value;
+
+ /* The section symbol becomes the symbol for the dynamic
+ relocation. */
+ dynindx
+ = _bfd_elf_link_lookup_local_dynindx (info,
+ rent->sec->owner,
+ rent->sec_symndx);
+ }
+ else
+ rel.r_addend = rent->addend;
+
+ rel.r_info = ELF64_R_INFO (dynindx, rent->type);
+
+ bfd_elf64_swap_reloca_out (hppa_info->other_rel_sec->output_section->owner,
+ &rel,
+ (((Elf64_External_Rela *)
+ hppa_info->other_rel_sec->contents)
+ + hppa_info->other_rel_sec->reloc_count));
+ hppa_info->other_rel_sec->reloc_count++;
+ }
+ }
+
+ return true;
+}
+
+/* Finish up the dynamic sections. */
+
+static boolean
+elf64_hppa_finish_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ bfd *dynobj;
+ asection *sdyn;
+ struct elf64_hppa_link_hash_table *hppa_info;
+
+ hppa_info = elf64_hppa_hash_table (info);
+
+ /* Finalize the contents of the .opd section. */
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ elf64_hppa_finalize_opd,
+ info);
+
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ elf64_hppa_finalize_dynreloc,
+ info);
+
+ /* Finalize the contents of the .dlt section. */
+ dynobj = elf_hash_table (info)->dynobj;
+ /* Finalize the contents of the .dlt section. */
+ elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
+ elf64_hppa_finalize_dlt,
+ info);
+
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ Elf64_External_Dyn *dyncon, *dynconend;
+
+ BFD_ASSERT (sdyn != NULL);
+
+ dyncon = (Elf64_External_Dyn *) sdyn->contents;
+ dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+ asection *s;
+
+ bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ break;
+
+ case DT_HP_LOAD_MAP:
+ /* Compute the absolute address of 16byte scratchpad area
+ for the dynamic linker.
+
+ By convention the linker script will allocate the scratchpad
+ area at the start of the .data section. So all we have to
+ to is find the start of the .data section. */
+ s = bfd_get_section_by_name (output_bfd, ".data");
+ dyn.d_un.d_ptr = s->vma;
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTGOT:
+ /* HP's use PLTGOT to set the GOT register. */
+ dyn.d_un.d_ptr = _bfd_get_gp_value (output_bfd);
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_JMPREL:
+ s = hppa_info->plt_rel_sec;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTRELSZ:
+ s = hppa_info->plt_rel_sec;
+ dyn.d_un.d_val = s->_raw_size;
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_RELA:
+ s = hppa_info->other_rel_sec;
+ if (! s)
+ s = hppa_info->dlt_rel_sec;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_RELASZ:
+ s = hppa_info->other_rel_sec;
+ dyn.d_un.d_val = s->_raw_size;
+ s = hppa_info->dlt_rel_sec;
+ dyn.d_un.d_val += s->_raw_size;
+ s = hppa_info->opd_rel_sec;
+ dyn.d_un.d_val += s->_raw_size;
+ /* There is some question about whether or not the size of
+ the PLT relocs should be included here. HP's tools do
+ it, so we'll emulate them. */
+ s = hppa_info->plt_rel_sec;
+ dyn.d_un.d_val += s->_raw_size;
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ }
+ }
+ }
+
+ return true;
+}
+
+/* Return the number of additional phdrs we will need.
+
+ The generic ELF code only creates PT_PHDRs for executables. The HP
+ dynamic linker requires PT_PHDRs for dynamic libraries too.
+
+ This routine indicates that the backend needs one additional program
+ header for that case.
+
+ Note we do not have access to the link info structure here, so we have
+ to guess whether or not we are building a shared library based on the
+ existence of a .interp section. */
+
+static int
+elf64_hppa_additional_program_headers (abfd)
+ bfd *abfd;
+{
+ asection *s;
+
+ /* If we are creating a shared library, then we have to create a
+ PT_PHDR segment. HP's dynamic linker chokes without it. */
+ s = bfd_get_section_by_name (abfd, ".interp");
+ if (! s)
+ return 1;
+ return 0;
+}
+
+/* Allocate and initialize any program headers required by this
+ specific backend.
+
+ The generic ELF code only creates PT_PHDRs for executables. The HP
+ dynamic linker requires PT_PHDRs for dynamic libraries too.
+
+ This allocates the PT_PHDR and initializes it in a manner suitable
+ for the HP linker.
+
+ Note we do not have access to the link info structure here, so we have
+ to guess whether or not we are building a shared library based on the
+ existence of a .interp section. */
+
+static boolean
+elf64_hppa_modify_segment_map (abfd)
+ bfd *abfd;
+{
+ struct elf_segment_map *m;
+ asection *s;
+
+ s = bfd_get_section_by_name (abfd, ".interp");
+ if (! s)
+ {
+ for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+ if (m->p_type == PT_PHDR)
+ break;
+ if (m == NULL)
+ {
+ m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m);
+ if (m == NULL)
+ return false;
+
+ m->p_type = PT_PHDR;
+ m->p_flags = PF_R | PF_X;
+ m->p_flags_valid = 1;
+ m->p_paddr_valid = 1;
+ m->includes_phdrs = 1;
+
+ m->next = elf_tdata (abfd)->segment_map;
+ elf_tdata (abfd)->segment_map = m;
+ }
+ }
+
+ for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+ if (m->p_type == PT_LOAD)
+ {
+ unsigned int i;
+
+ for (i = 0; i < m->count; i++)
+ {
+ /* The code "hint" is not really a hint. It is a requirement
+ for certain versions of the HP dynamic linker. Worse yet,
+ it must be set even if the shared library does not have
+ any code in its "text" segment (thus the check for .hash
+ to catch this situation). */
+ if (m->sections[i]->flags & SEC_CODE
+ || (strcmp (m->sections[i]->name, ".hash") == 0))
+ m->p_flags |= (PF_X | PF_HP_CODE);
+ }
+ }
+
+ return true;
+}
+
+/* Called when writing out an object file to decide the type of a
+ symbol. */
+static int
+elf64_hppa_elf_get_symbol_type (elf_sym, type)
+ Elf_Internal_Sym *elf_sym;
+ int type;
+{
+ if (ELF_ST_TYPE (elf_sym->st_info) == STT_PARISC_MILLI)
+ return STT_PARISC_MILLI;
+ else
+ return type;
+}
+
+/* The hash bucket size is the standard one, namely 4. */
+
+const struct elf_size_info hppa64_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),
+ 4,
+ 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_BIG_SYM bfd_elf64_hppa_vec
+#define TARGET_BIG_NAME "elf64-hppa"
+#define ELF_ARCH bfd_arch_hppa
+#define ELF_MACHINE_CODE EM_PARISC
+/* This is not strictly correct. The maximum page size for PA2.0 is
+ 64M. But everything still uses 4k. */
+#define ELF_MAXPAGESIZE 0x1000
+#define bfd_elf64_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup
+#define bfd_elf64_bfd_is_local_label_name elf_hppa_is_local_label_name
+#define elf_info_to_howto elf_hppa_info_to_howto
+#define elf_info_to_howto_rel elf_hppa_info_to_howto_rel
+
+#define elf_backend_section_from_shdr elf64_hppa_section_from_shdr
+#define elf_backend_object_p elf64_hppa_object_p
+#define elf_backend_final_write_processing \
+ elf_hppa_final_write_processing
+#define elf_backend_fake_sections elf_hppa_fake_sections
+#define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook
+
+#define elf_backend_relocate_section elf_hppa_relocate_section
+
+#define bfd_elf64_bfd_final_link elf_hppa_final_link
+
+#define elf_backend_create_dynamic_sections \
+ elf64_hppa_create_dynamic_sections
+#define elf_backend_post_process_headers elf64_hppa_post_process_headers
+
+#define elf_backend_adjust_dynamic_symbol \
+ elf64_hppa_adjust_dynamic_symbol
+
+#define elf_backend_size_dynamic_sections \
+ elf64_hppa_size_dynamic_sections
+
+#define elf_backend_finish_dynamic_symbol \
+ elf64_hppa_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections \
+ elf64_hppa_finish_dynamic_sections
+
+/* Stuff for the BFD linker: */
+#define bfd_elf64_bfd_link_hash_table_create \
+ elf64_hppa_hash_table_create
+
+#define elf_backend_check_relocs \
+ elf64_hppa_check_relocs
+
+#define elf_backend_size_info \
+ hppa64_elf_size_info
+
+#define elf_backend_additional_program_headers \
+ elf64_hppa_additional_program_headers
+
+#define elf_backend_modify_segment_map \
+ elf64_hppa_modify_segment_map
+
+#define elf_backend_link_output_symbol_hook \
+ elf64_hppa_link_output_symbol_hook
+
+#define elf_backend_want_got_plt 0
+#define elf_backend_plt_readonly 0
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size 0
+#define elf_backend_plt_header_size 0
+#define elf_backend_type_change_ok true
+#define elf_backend_get_symbol_type elf64_hppa_elf_get_symbol_type
+
+#include "elf64-target.h"
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf64_hppa_linux_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf64-hppa-linux"
+
+#define INCLUDED_TARGET_FILE 1
+#include "elf64-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elf64-hppa.h b/gnu/usr.bin/binutils/bfd/elf64-hppa.h
new file mode 100644
index 00000000000..b5dc5d4b783
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elf64-hppa.h
@@ -0,0 +1,47 @@
+/* ELF64/HPPA support
+
+ Copyright 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _ELF64_HPPA_H
+#define _ELF64_HPPA_H
+
+#include "elf-bfd.h"
+#include "libhppa.h"
+#include "elf/hppa.h"
+
+extern elf_hppa_reloc_type ** _bfd_elf64_hppa_gen_reloc_type
+ PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
+
+/* Define groups of basic relocations. FIXME: These should
+ be the only basic relocations created by GAS. The rest
+ should be internal to the BFD backend.
+
+ The idea is both SOM and ELF define these basic relocation
+ types so they map into a SOM or ELF specific relocation
+ as appropriate. This allows GAS to share much more code
+ between the two target object formats. */
+
+#define R_HPPA_NONE R_PARISC_NONE
+#define R_HPPA R_PARISC_DIR64
+#define R_HPPA_GOTOFF R_PARISC_DLTREL21L
+#define R_HPPA_PCREL_CALL R_PARISC_PCREL21L
+#define R_HPPA_ABS_CALL R_PARISC_DIR17F
+#define R_HPPA_COMPLEX R_PARISC_UNIMPLEMENTED
+
+#endif /* _ELF64_HPPA_H */
diff --git a/gnu/usr.bin/binutils/bfd/elf64-x86-64.c b/gnu/usr.bin/binutils/bfd/elf64-x86-64.c
new file mode 100644
index 00000000000..206e70c3a69
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elf64-x86-64.c
@@ -0,0 +1,1935 @@
+/* X86-64 specific support for 64-bit ELF
+ Copyright 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Jan Hubicka <jh@suse.cz>.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+
+#include "elf/x86-64.h"
+
+/* We use only the RELA entries. */
+#define USE_RELA
+
+/* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */
+#define MINUS_ONE (~ (bfd_vma) 0)
+
+/* The relocation "howto" table. Order of fields:
+ type, size, bitsize, pc_relative, complain_on_overflow,
+ special_function, name, partial_inplace, src_mask, dst_pack, pcrel_offset. */
+static reloc_howto_type x86_64_elf_howto_table[] =
+{
+ HOWTO(R_X86_64_NONE, 0, 0, 0, false, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_X86_64_NONE", false, 0x00000000, 0x00000000,
+ false),
+ HOWTO(R_X86_64_64, 0, 4, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_X86_64_64", false, MINUS_ONE, MINUS_ONE,
+ false),
+ HOWTO(R_X86_64_PC32, 0, 4, 32, true, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_PC32", false, 0xffffffff, 0xffffffff,
+ true),
+ HOWTO(R_X86_64_GOT32, 0, 4, 32, false, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_GOT32", false, 0xffffffff, 0xffffffff,
+ false),
+ HOWTO(R_X86_64_PLT32, 0, 4, 32, true, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_PLT32", false, 0xffffffff, 0xffffffff,
+ true),
+ HOWTO(R_X86_64_COPY, 0, 4, 32, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_X86_64_COPY", false, 0xffffffff, 0xffffffff,
+ false),
+ HOWTO(R_X86_64_GLOB_DAT, 0, 4, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_X86_64_GLOB_DAT", false, MINUS_ONE,
+ MINUS_ONE, false),
+ HOWTO(R_X86_64_JUMP_SLOT, 0, 4, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_X86_64_JUMP_SLOT", false, MINUS_ONE,
+ MINUS_ONE, false),
+ HOWTO(R_X86_64_RELATIVE, 0, 4, 64, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_X86_64_RELATIVE", false, MINUS_ONE,
+ MINUS_ONE, false),
+ HOWTO(R_X86_64_GOTPCREL, 0, 4, 32, true,0 , complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_GOTPCREL", false, 0xffffffff,
+ 0xffffffff, true),
+ HOWTO(R_X86_64_32, 0, 4, 32, false, 0, complain_overflow_unsigned,
+ bfd_elf_generic_reloc, "R_X86_64_32", false, 0xffffffff, 0xffffffff,
+ false),
+ HOWTO(R_X86_64_32S, 0, 4, 32, false, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_32S", false, 0xffffffff, 0xffffffff,
+ false),
+ HOWTO(R_X86_64_16, 0, 1, 16, false, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_X86_64_16", false, 0xffff, 0xffff, false),
+ HOWTO(R_X86_64_PC16,0, 1, 16, true, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_X86_64_PC16", false, 0xffff, 0xffff, true),
+ HOWTO(R_X86_64_8, 0, 0, 8, false, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_8", false, 0xff, 0xff, false),
+ HOWTO(R_X86_64_PC8, 0, 0, 8, true, 0, complain_overflow_signed,
+ bfd_elf_generic_reloc, "R_X86_64_PC8", false, 0xff, 0xff, true)
+};
+
+/* Map BFD relocs to the x86_64 elf relocs. */
+struct elf_reloc_map
+{
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned char elf_reloc_val;
+};
+
+static CONST struct elf_reloc_map x86_64_reloc_map[] =
+{
+ { BFD_RELOC_NONE, R_X86_64_NONE, },
+ { BFD_RELOC_64, R_X86_64_64, },
+ { BFD_RELOC_32_PCREL, R_X86_64_PC32, },
+ { BFD_RELOC_X86_64_GOT32, R_X86_64_GOT32,},
+ { BFD_RELOC_X86_64_PLT32, R_X86_64_PLT32,},
+ { BFD_RELOC_X86_64_COPY, R_X86_64_COPY, },
+ { BFD_RELOC_X86_64_GLOB_DAT, R_X86_64_GLOB_DAT, },
+ { BFD_RELOC_X86_64_JUMP_SLOT, R_X86_64_JUMP_SLOT, },
+ { BFD_RELOC_X86_64_RELATIVE, R_X86_64_RELATIVE, },
+ { BFD_RELOC_X86_64_GOTPCREL, R_X86_64_GOTPCREL, },
+ { BFD_RELOC_32, R_X86_64_32, },
+ { BFD_RELOC_X86_64_32S, R_X86_64_32S, },
+ { BFD_RELOC_16, R_X86_64_16, },
+ { BFD_RELOC_16_PCREL, R_X86_64_PC16, },
+ { BFD_RELOC_8, R_X86_64_8, },
+ { BFD_RELOC_8_PCREL, R_X86_64_PC8, },
+};
+
+static reloc_howto_type *elf64_x86_64_reloc_type_lookup
+ PARAMS ((bfd *, bfd_reloc_code_real_type));
+static void elf64_x86_64_info_to_howto
+ PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *));
+static struct bfd_link_hash_table *elf64_x86_64_link_hash_table_create
+ PARAMS ((bfd *));
+
+static struct bfd_hash_entry *elf64_x86_64_link_hash_newfunc
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+static boolean elf64_x86_64_adjust_dynamic_symbol
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+
+static boolean elf64_x86_64_size_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+static boolean elf64_x86_64_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+static boolean elf64_x86_64_finish_dynamic_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ Elf_Internal_Sym *sym));
+static boolean elf64_x86_64_finish_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+/* Given a BFD reloc type, return a HOWTO structure. */
+static reloc_howto_type *
+elf64_x86_64_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+ for (i = 0; i < sizeof (x86_64_reloc_map) / sizeof (struct elf_reloc_map);
+ i++)
+ {
+ if (x86_64_reloc_map[i].bfd_reloc_val == code)
+ return &x86_64_elf_howto_table[(int)
+ x86_64_reloc_map[i].elf_reloc_val];
+ }
+ return 0;
+}
+
+/* Given an x86_64 ELF reloc type, fill in an arelent structure. */
+
+static void
+elf64_x86_64_info_to_howto (abfd, cache_ptr, dst)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *cache_ptr;
+ Elf64_Internal_Rela *dst;
+{
+ unsigned r_type;
+
+ r_type = ELF64_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_X86_64_max);
+ cache_ptr->howto = &x86_64_elf_howto_table[r_type];
+ BFD_ASSERT (r_type == cache_ptr->howto->type);
+}
+
+/* Functions for the x86-64 ELF linker. */
+
+/* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+#define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
+
+/* The size in bytes of an entry in the global offset table. */
+
+#define GOT_ENTRY_SIZE 8
+
+/* 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. See the
+ SVR4 ABI i386 supplement and the x86-64 ABI to see how this works. */
+
+static const bfd_byte elf64_x86_64_plt0_entry[PLT_ENTRY_SIZE] =
+{
+ 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */
+ 0xff, 0x25, 16, 0, 0, 0, /* jmpq *GOT+16(%rip) */
+ 0x90, 0x90, 0x90, 0x90 /* pad out to 16 bytes with nops. */
+};
+
+/* Subsequent entries in a procedure linkage table look like this. */
+
+static const bfd_byte elf64_x86_64_plt_entry[PLT_ENTRY_SIZE] =
+{
+ 0xff, 0x25, /* jmpq *name@GOTPC(%rip) */
+ 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
+ 0x68, /* pushq immediate */
+ 0, 0, 0, 0, /* replaced with index into relocation table. */
+ 0xe9, /* jmp relative */
+ 0, 0, 0, 0 /* replaced with offset to start of .plt0. */
+};
+
+/* The x86-64 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
+ linking with -Bsymbolic. We store the information in a field
+ extending the regular ELF linker hash table. */
+
+/* This structure keeps track of the number of PC relative relocs we
+ have copied for a given symbol. */
+
+struct elf64_x86_64_pcrel_relocs_copied
+{
+ /* Next section. */
+ struct elf64_x86_64_pcrel_relocs_copied *next;
+ /* A section in dynobj. */
+ asection *section;
+ /* Number of relocs copied in this section. */
+ bfd_size_type count;
+};
+
+/* x86-64 ELF linker hash entry. */
+
+struct elf64_x86_64_link_hash_entry
+{
+ struct elf_link_hash_entry root;
+
+ /* Number of PC relative relocs copied for this symbol. */
+ struct elf64_x86_64_pcrel_relocs_copied *pcrel_relocs_copied;
+};
+
+/* x86-64 ELF linker hash table. */
+
+struct elf64_x86_64_link_hash_table
+{
+ struct elf_link_hash_table root;
+};
+
+/* Declare this now that the above structures are defined. */
+
+static boolean elf64_x86_64_discard_copies
+ PARAMS ((struct elf64_x86_64_link_hash_entry *, PTR));
+
+/* Traverse an x86-64 ELF linker hash table. */
+
+#define elf64_x86_64_link_hash_traverse(table, func, info) \
+ (elf_link_hash_traverse \
+ (&(table)->root, \
+ (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \
+ (info)))
+
+/* Get the x86-64 ELF linker hash table from a link_info structure. */
+
+#define elf64_x86_64_hash_table(p) \
+ ((struct elf64_x86_64_link_hash_table *) ((p)->hash))
+
+/* Create an entry in an x86-64 ELF linker hash table. */
+
+static struct bfd_hash_entry *
+elf64_x86_64_link_hash_newfunc (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ struct elf64_x86_64_link_hash_entry *ret =
+ (struct elf64_x86_64_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == (struct elf64_x86_64_link_hash_entry *) NULL)
+ ret = ((struct elf64_x86_64_link_hash_entry *)
+ bfd_hash_allocate (table,
+ sizeof (struct elf64_x86_64_link_hash_entry)));
+ if (ret == (struct elf64_x86_64_link_hash_entry *) NULL)
+ return (struct bfd_hash_entry *) ret;
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct elf64_x86_64_link_hash_entry *)
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
+ if (ret != (struct elf64_x86_64_link_hash_entry *) NULL)
+ {
+ ret->pcrel_relocs_copied = NULL;
+ }
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Create an X86-64 ELF linker hash table. */
+
+static struct bfd_link_hash_table *
+elf64_x86_64_link_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct elf64_x86_64_link_hash_table *ret;
+
+ ret = ((struct elf64_x86_64_link_hash_table *)
+ bfd_alloc (abfd, sizeof (struct elf64_x86_64_link_hash_table)));
+ if (ret == (struct elf64_x86_64_link_hash_table *) NULL)
+ return NULL;
+
+ if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elf64_x86_64_link_hash_newfunc))
+ {
+ bfd_release (abfd, ret);
+ return NULL;
+ }
+
+ return &ret->root.root;
+}
+
+boolean
+elf64_x86_64_elf_object_p (abfd)
+ bfd *abfd;
+{
+ /* Set the right machine number for an x86-64 elf64 file. */
+ bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64);
+ return true;
+}
+
+/* Look through the relocs for a section during the first phase, and
+ allocate space in the global offset table or procedure linkage
+ table. */
+
+static boolean
+elf64_x86_64_check_relocs (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+ bfd *dynobj;
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_signed_vma *local_got_refcounts;
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+ asection *sgot;
+ asection *srelgot;
+ asection *sreloc;
+
+ if (info->relocateable)
+ return true;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
+ sgot = srelgot = sreloc = NULL;
+ rel_end = relocs + sec->reloc_count;
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
+ r_symndx = ELF64_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)
+ {
+ switch (ELF64_R_TYPE (rel->r_info))
+ {
+ case R_X86_64_GOT32:
+ case R_X86_64_GOTPCREL:
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! _bfd_elf_create_got_section (dynobj, info))
+ return false;
+ break;
+ }
+ }
+
+ switch (ELF64_R_TYPE (rel->r_info))
+ {
+ case R_X86_64_GOTPCREL:
+ case R_X86_64_GOT32:
+ /* This symbol requires a global offset table entry. */
+
+ if (sgot == NULL)
+ {
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ BFD_ASSERT (sgot != NULL);
+ }
+
+ if (srelgot == NULL && (h != NULL || info->shared))
+ {
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ if (srelgot == NULL)
+ {
+ srelgot = bfd_make_section (dynobj, ".rela.got");
+ if (srelgot == NULL
+ || ! bfd_set_section_flags (dynobj, srelgot,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || ! bfd_set_section_alignment (dynobj, srelgot, 3))
+ return false;
+ }
+ }
+
+ if (h != NULL)
+ {
+ if (h->got.refcount == -1)
+ {
+ h->got.refcount = 1;
+
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ {
+ if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+ return false;
+ }
+
+ sgot->_raw_size += GOT_ENTRY_SIZE;
+ srelgot->_raw_size += sizeof (Elf64_External_Rela);
+ }
+ else
+ h->got.refcount += 1;
+ }
+ else
+ {
+ /* This is a global offset table entry for a local symbol. */
+ if (local_got_refcounts == NULL)
+ {
+ size_t size;
+
+ 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_refcounts (abfd) = local_got_refcounts;
+ memset (local_got_refcounts, -1, size);
+ }
+ if (local_got_refcounts[r_symndx] == -1)
+ {
+ local_got_refcounts[r_symndx] = 1;
+
+ sgot->_raw_size += GOT_ENTRY_SIZE;
+ if (info->shared)
+ {
+ /* If we are generating a shared object, we need to
+ output a R_X86_64_RELATIVE reloc so that the dynamic
+ linker can adjust this GOT entry. */
+ srelgot->_raw_size += sizeof (Elf64_External_Rela);
+ }
+ }
+ else
+ local_got_refcounts[r_symndx] += 1;
+ }
+ break;
+
+ case R_X86_64_PLT32:
+ /* This symbol requires a procedure linkage table entry. We
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code which is
+ never referenced by a dynamic object, in which case we
+ don't need to generate a procedure linkage table entry
+ after all. */
+
+ /* If this is a local symbol, we resolve it directly without
+ creating a procedure linkage table entry. */
+ if (h == NULL)
+ continue;
+
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ if (h->plt.refcount == -1)
+ h->plt.refcount = 1;
+ else
+ h->plt.refcount += 1;
+ break;
+
+ case R_X86_64_8:
+ case R_X86_64_16:
+ case R_X86_64_32:
+ case R_X86_64_64:
+ case R_X86_64_32S:
+ case R_X86_64_PC32:
+ if (h != NULL)
+ 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.
+ A similar situation occurs when creating shared libraries
+ and symbol visibility changes render the symbol local. */
+ if (info->shared
+ && (sec->flags & SEC_ALLOC) != 0
+ && (((ELF64_R_TYPE (rel->r_info) != R_X86_64_PC8)
+ && (ELF64_R_TYPE (rel->r_info) != R_X86_64_PC16)
+ && (ELF64_R_TYPE (rel->r_info) != R_X86_64_PC32))
+ || (h != NULL
+ && (! info->symbolic
+ || (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. */
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (abfd,
+ elf_elfheader (abfd)->e_shstrndx,
+ elf_section_data (sec)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ if (sreloc == NULL)
+ {
+ flagword flags;
+
+ sreloc = bfd_make_section (dynobj, name);
+ flags = (SEC_HAS_CONTENTS | SEC_READONLY
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+ if ((sec->flags & SEC_ALLOC) != 0)
+ flags |= SEC_ALLOC | SEC_LOAD;
+ if (sreloc == NULL
+ || ! bfd_set_section_flags (dynobj, sreloc, flags)
+ || ! bfd_set_section_alignment (dynobj, sreloc, 3))
+ return false;
+ }
+ }
+
+ sreloc->_raw_size += sizeof (Elf64_External_Rela);
+
+ /* 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
+ elf64_x86_64 linker hash table, which means that h is
+ really a pointer to an elf64_x86_64_link_hash_entry. */
+ if (h != NULL
+ && ((ELF64_R_TYPE (rel->r_info) == R_X86_64_PC8)
+ || (ELF64_R_TYPE (rel->r_info) == R_X86_64_PC16)
+ || (ELF64_R_TYPE (rel->r_info) == R_X86_64_PC32)))
+ {
+ struct elf64_x86_64_link_hash_entry *eh;
+ struct elf64_x86_64_pcrel_relocs_copied *p;
+
+ eh = (struct elf64_x86_64_link_hash_entry *) h;
+
+ for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next)
+ if (p->section == sreloc)
+ break;
+
+ if (p == NULL)
+ {
+ p = ((struct elf64_x86_64_pcrel_relocs_copied *)
+ bfd_alloc (dynobj, sizeof *p));
+ if (p == NULL)
+ return false;
+ p->next = eh->pcrel_relocs_copied;
+ eh->pcrel_relocs_copied = p;
+ p->section = sreloc;
+ p->count = 0;
+ }
+
+ ++p->count;
+ }
+ }
+ break;
+ }
+ }
+
+ return true;
+}
+
+/* Return the section that should be marked against GC for a given
+ relocation. */
+
+static asection *
+elf64_x86_64_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel ATTRIBUTE_UNUSED;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ if (h != NULL)
+ {
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+
+ return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+
+static boolean
+elf64_x86_64_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+ 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, ".rela.got");
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; rel++)
+ switch (ELF64_R_TYPE (rel->r_info))
+ {
+ case R_X86_64_GOT32:
+ case R_X86_64_GOTPCREL:
+ r_symndx = ELF64_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 -= GOT_ENTRY_SIZE;
+ srelgot->_raw_size -= sizeof (Elf64_External_Rela);
+ }
+ }
+ }
+ 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 -= GOT_ENTRY_SIZE;
+ if (info->shared)
+ srelgot->_raw_size -= sizeof (Elf64_External_Rela);
+ }
+ }
+ }
+ break;
+
+ case R_X86_64_PLT32:
+ r_symndx = ELF64_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;
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+ regular object. The current definition is in some section of the
+ dynamic object, but we're not including those sections. We have to
+ change the definition to something the rest of the link can
+ understand. */
+
+static boolean
+elf64_x86_64_adjust_dynamic_symbol (info, h)
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+{
+ bfd *dynobj;
+ asection *s;
+ unsigned int power_of_two;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ /* Make sure we know what is going on here. */
+ BFD_ASSERT (dynobj != NULL
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+ || h->weakdef != NULL
+ || ((h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0
+ && (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. */
+ 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)
+ || (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, 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;
+ }
+
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ {
+ if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+ return false;
+ }
+
+ s = bfd_get_section_by_name (dynobj, ".plt");
+ BFD_ASSERT (s != NULL);
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->_raw_size == 0)
+ s->_raw_size = PLT_ENTRY_SIZE;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->_raw_size;
+ }
+
+ h->plt.offset = s->_raw_size;
+
+ /* Make room for this entry. */
+ s->_raw_size += PLT_ENTRY_SIZE;
+
+ /* 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 += GOT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .rela.plt section. */
+ s = bfd_get_section_by_name (dynobj, ".rela.plt");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size += sizeof (Elf64_External_Rela);
+
+ return true;
+ }
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->weakdef != NULL)
+ {
+ BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+ || h->weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->weakdef->root.u.def.section;
+ h->root.u.def.value = h->weakdef->root.u.def.value;
+ return true;
+ }
+
+ /* This is a reference to a symbol defined by a dynamic object which
+ is not a function. */
+
+ /* If we are creating a shared library, we must presume that the
+ only references to the symbol are via the global offset table.
+ For such cases we need not do anything here; the relocations will
+ be handled correctly by relocate_section. */
+ if (info->shared)
+ return true;
+
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
+ return true;
+
+ /* We must allocate the symbol in our .dynbss section, which will
+ become part of the .bss section of the executable. There will be
+ an entry for this symbol in the .dynsym section. The dynamic
+ object will contain position independent code, so all references
+ from the dynamic object to this symbol will go through the global
+ offset table. The dynamic linker will use the .dynsym entry to
+ determine the address it must put in the global offset table, so
+ both the dynamic object and the regular object will refer to the
+ same memory location for the variable. */
+
+ s = bfd_get_section_by_name (dynobj, ".dynbss");
+ BFD_ASSERT (s != NULL);
+
+ /* We must generate a R_X86_64_COPY reloc to tell the dynamic linker
+ to copy the initial value out of the dynamic object and into the
+ runtime process image. We need to remember the offset into the
+ .rela.bss section we are going to use. */
+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+ {
+ asection *srel;
+
+ srel = bfd_get_section_by_name (dynobj, ".rela.bss");
+ BFD_ASSERT (srel != NULL);
+ srel->_raw_size += sizeof (Elf64_External_Rela);
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
+ }
+
+ /* We need to figure out the alignment required for this symbol. I
+ have no idea how ELF linkers handle this. 16-bytes is the size
+ of the largest type that requires hard alignment -- long double. */
+ /* FIXME: This is VERY ugly. Should be fixed for all architectures using
+ this construct. */
+ power_of_two = bfd_log2 (h->size);
+ if (power_of_two > 4)
+ power_of_two = 4;
+
+ /* Apply the required alignment. */
+ s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two));
+ if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ {
+ if (! bfd_set_section_alignment (dynobj, s, power_of_two))
+ return false;
+ }
+
+ /* Define the symbol as being at this point in the section. */
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->_raw_size;
+
+ /* Increment the section size to make room for the symbol. */
+ s->_raw_size += h->size;
+
+ return true;
+}
+
+/* Set the sizes of the dynamic sections. */
+
+static boolean
+elf64_x86_64_size_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ bfd *dynobj;
+ asection *s;
+ boolean plt;
+ boolean relocs;
+ boolean reltext;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Set the contents of the .interp section to the interpreter. */
+ if (! info->shared)
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+ else
+ {
+ /* We may have created entries in the .rela.got section.
+ However, if we are not creating the dynamic sections, we will
+ not actually use these entries. Reset the size of .rela.got,
+ which will cause it to get stripped from the output file
+ below. */
+ s = bfd_get_section_by_name (dynobj, ".rela.got");
+ if (s != NULL)
+ s->_raw_size = 0;
+ }
+
+ /* If this is a -Bsymbolic shared link, then we need to discard all
+ 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)
+ elf64_x86_64_link_hash_traverse (elf64_x86_64_hash_table (info),
+ elf64_x86_64_discard_copies,
+ (PTR) info);
+
+ /* The check_relocs and adjust_dynamic_symbol entry points have
+ determined the sizes of the various dynamic sections. Allocate
+ memory for them. */
+ plt = relocs = reltext = false;
+ for (s = dynobj->sections; s != NULL; s = s->next)
+ {
+ const char *name;
+ boolean strip;
+
+ if ((s->flags & SEC_LINKER_CREATED) == 0)
+ continue;
+
+ /* It's OK to base decisions on the section name, because none
+ of the dynobj section names depend upon the input files. */
+ name = bfd_get_section_name (dynobj, s);
+
+ strip = false;
+ if (strcmp (name, ".plt") == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ strip = true;
+ }
+ else
+ {
+ /* Remember whether there is a PLT. */
+ plt = true;
+ }
+ }
+ else if (strncmp (name, ".rela", 5) == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ strip = true;
+ }
+ else
+ {
+ asection *target;
+
+ /* Remember whether there are any reloc sections other
+ than .rela.plt. */
+ if (strcmp (name, ".rela.plt") != 0)
+ {
+ const char *outname;
+
+ relocs = true;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL
+ entry. The entries in the .rela.plt section
+ really apply to the .got section, which we
+ created ourselves and so know is not readonly. */
+ outname = bfd_get_section_name (output_bfd,
+ s->output_section);
+ target = bfd_get_section_by_name (output_bfd, outname + 5);
+ if (target != NULL
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0)
+ reltext = true;
+ }
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ }
+ else if (strncmp (name, ".got", 4) != 0)
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
+
+ if (strip)
+ {
+ _bfd_strip_section_from_output (info, s);
+ continue;
+ }
+
+ /* 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_X86_64_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;
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Add some entries to the .dynamic section. We fill in the
+ values later, in elf64_x86_64_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
+ if (! info->shared)
+ {
+ if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0))
+ return false;
+ }
+
+ if (plt)
+ {
+ if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+ || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0))
+ return false;
+ }
+
+ if (relocs)
+ {
+ 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)))
+ return false;
+ }
+
+ if (reltext)
+ {
+ if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
+ return false;
+ info->flags |= DF_TEXTREL;
+ }
+ }
+
+ return true;
+}
+
+/* This function is called via elf64_x86_64_link_hash_traverse if we are
+ 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. */
+
+static boolean
+elf64_x86_64_discard_copies (h, inf)
+ struct elf64_x86_64_link_hash_entry *h;
+ PTR inf;
+{
+ struct elf64_x86_64_pcrel_relocs_copied *s;
+ 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 (Elf64_External_Rela);
+ }
+
+ return true;
+}
+
+/* Relocate an x86_64 ELF section. */
+
+static boolean
+elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ Elf_Internal_Rela *relocs;
+ Elf_Internal_Sym *local_syms;
+ asection **local_sections;
+{
+ bfd *dynobj;
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_vma *local_got_offsets;
+ asection *sgot;
+ asection *splt;
+ asection *sreloc;
+ Elf_Internal_Rela *rela;
+ Elf_Internal_Rela *relend;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+ local_got_offsets = elf_local_got_offsets (input_bfd);
+
+ sreloc = splt = sgot = NULL;
+ if (dynobj != NULL)
+ {
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ }
+
+ rela = relocs;
+ relend = relocs + input_section->reloc_count;
+ for (; rela < relend; rela++)
+ {
+ int r_type;
+ reloc_howto_type *howto;
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ unsigned int indx;
+
+ r_type = ELF64_R_TYPE (rela->r_info);
+
+ if ((indx = (unsigned) r_type) >= R_X86_64_max)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ howto = x86_64_elf_howto_table + indx;
+
+ r_symndx = ELF64_R_SYM (rela->r_info);
+
+ if (info->relocateable)
+ {
+ /* This is a relocateable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections[r_symndx];
+ rela->r_addend += sec->output_offset + sym->st_value;
+ }
+ }
+
+ continue;
+ }
+
+ /* This is a final link. */
+ h = NULL;
+ sym = NULL;
+ sec = NULL;
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+ }
+ 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)
+ {
+ sec = h->root.u.def.section;
+ if ((r_type == R_X86_64_PLT32
+ && splt != NULL
+ && h->plt.offset != (bfd_vma) -1)
+ || ((r_type == R_X86_64_GOT32 || r_type == R_X86_64_GOTPCREL)
+ && 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
+ && ((! info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ && (r_type == R_X86_64_8
+ || r_type == R_X86_64_16
+ || r_type == R_X86_64_32
+ || r_type == R_X86_64_64
+ || r_type == R_X86_64_PC8
+ || r_type == R_X86_64_PC16
+ || r_type == R_X86_64_PC32)
+ && ((input_section->flags & SEC_ALLOC) != 0
+ /* DWARF will emit R_X86_64_32 relocations in its
+ sections against symbols defined externally
+ in shared libraries. We can't do anything
+ with them here. */
+ || ((input_section->flags & SEC_DEBUGGING) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
+ {
+ /* In these cases, we don't need the relocation
+ value. We check specially because in some
+ obscure cases sec->output_section will be NULL. */
+ 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
+ + sec->output_offset);
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ relocation = 0;
+ 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, h->root.root.string, input_bfd,
+ input_section, rela->r_offset,
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
+ return false;
+ relocation = 0;
+ }
+ }
+
+ /* When generating a shared object, the relocations handled here are
+ copied into the output file to be resolved at run time. */
+ switch (r_type)
+ {
+ case R_X86_64_GOT32:
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ case R_X86_64_GOTPCREL:
+ /* Use global offset table as symbol value. */
+ BFD_ASSERT (sgot != NULL);
+
+ if (h != NULL)
+ {
+ bfd_vma off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ 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)))
+ {
+ /* This is actually a static link, or it is a -Bsymbolic
+ link and the symbol is defined locally, or the symbol
+ was forced to be local because of a version file. We
+ must initialize this entry in the global offset table.
+ Since the offset must always be a multiple of 8, we
+ use the least significant bit to record whether we
+ have initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This is
+ done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_64 (output_bfd, relocation,
+ sgot->contents + off);
+ h->got.offset |= 1;
+ }
+ }
+ if (r_type == R_X86_64_GOTPCREL)
+ relocation = sgot->output_section->vma + sgot->output_offset + off;
+ else
+ relocation = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 8. We use
+ the least significant bit to record whether we have
+ already generated the necessary reloc. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_64 (output_bfd, relocation, sgot->contents + off);
+
+ if (info->shared)
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_X86_64_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE);
+ outrel.r_addend = relocation;
+ bfd_elf64_swap_reloca_out (output_bfd, &outrel,
+ (((Elf64_External_Rela *)
+ srelgot->contents)
+ + srelgot->reloc_count));
+ ++srelgot->reloc_count;
+ }
+
+ local_got_offsets[r_symndx] |= 1;
+ }
+
+ if (r_type == R_X86_64_GOTPCREL)
+ relocation = sgot->output_section->vma + sgot->output_offset + off;
+ else
+ relocation = sgot->output_offset + off;
+ }
+
+ break;
+
+ case R_X86_64_PLT32:
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table. */
+
+ /* 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 || splt == NULL)
+ {
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+ break;
+ }
+
+ relocation = (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset);
+ break;
+
+ case R_X86_64_PC8:
+ case R_X86_64_PC16:
+ case R_X86_64_PC32:
+ if (h == NULL)
+ break;
+ /* Fall through. */
+ case R_X86_64_8:
+ case R_X86_64_16:
+ case R_X86_64_32:
+ case R_X86_64_64:
+ /* FIXME: The ABI says the linker should make sure the value is
+ the same when it's zeroextended to 64 bit. */
+ if (info->shared
+ && (input_section->flags & SEC_ALLOC) != 0
+ && ((r_type != R_X86_64_PC8
+ && r_type != R_X86_64_PC16
+ && r_type != R_X86_64_PC32)
+ || (! info->symbolic
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)))
+
+ {
+ Elf_Internal_Rela outrel;
+ boolean skip, relocate;
+
+ /* When generating a shared object, these relocations
+ are copied into the output file to be resolved at run
+ time. */
+
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd,
+ elf_elfheader (input_bfd)->e_shstrndx,
+ elf_section_data (input_section)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (input_bfd,
+ input_section),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (sreloc != NULL);
+ }
+
+ skip = false;
+
+ if (elf_section_data (input_section)->stab_info == NULL)
+ outrel.r_offset = rela->r_offset;
+ else
+ {
+ bfd_vma off;
+
+ off = (_bfd_stab_section_offset
+ (output_bfd, &elf_hash_table (info)->stab_info,
+ input_section,
+ &elf_section_data (input_section)->stab_info,
+ rela->r_offset));
+ if (off == (bfd_vma) -1)
+ skip = true;
+ outrel.r_offset = off;
+ }
+
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+
+ if (skip)
+ {
+ memset (&outrel, 0, sizeof outrel);
+ relocate = false;
+ }
+ /* 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))
+ {
+ BFD_ASSERT (h->dynindx != -1);
+ relocate = false;
+ outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = relocation + rela->r_addend;
+ }
+ else
+ {
+ if (r_type == R_X86_64_64)
+ {
+ relocate = true;
+ outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE);
+ outrel.r_addend = relocation + rela->r_addend;
+ }
+ else
+ {
+ long indx;
+
+ if (h == NULL)
+ sec = local_sections[r_symndx];
+ else
+ {
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || (h->root.type
+ == bfd_link_hash_defweak));
+ sec = h->root.u.def.section;
+ }
+ if (sec != NULL && bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ else
+ {
+ asection *osec;
+
+ osec = sec->output_section;
+ indx = elf_section_data (osec)->dynindx;
+ BFD_ASSERT (indx > 0);
+ }
+
+ relocate = false;
+ outrel.r_info = ELF64_R_INFO (indx, r_type);
+ outrel.r_addend = relocation + rela->r_addend;
+ }
+
+ }
+
+ bfd_elf64_swap_reloca_out (output_bfd, &outrel,
+ (((Elf64_External_Rela *)
+ 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. */
+ if (! relocate)
+ continue;
+ }
+
+ break;
+
+ default:
+ break;
+ }
+
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rela->r_offset,
+ relocation, rela->r_addend);
+
+ if (r != bfd_reloc_ok)
+ {
+ switch (r)
+ {
+ default:
+ case bfd_reloc_outofrange:
+ abort ();
+ case bfd_reloc_overflow:
+ {
+ const char *name;
+
+ if (h != NULL)
+ name = h->root.root.string;
+ else
+ {
+ name = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym->st_name);
+ if (name == NULL)
+ return false;
+ if (*name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+ if (! ((*info->callbacks->reloc_overflow)
+ (info, name, howto->name, (bfd_vma) 0,
+ input_bfd, input_section, rela->r_offset)))
+ return false;
+ }
+ break;
+ }
+ }
+ }
+
+ return true;
+}
+
+/* Finish up dynamic symbol handling. We set the contents of various
+ dynamic sections here. */
+
+static boolean
+elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ bfd *dynobj;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+ asection *splt;
+ asection *sgot;
+ asection *srela;
+ bfd_vma plt_index;
+ bfd_vma got_offset;
+ Elf_Internal_Rela rela;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+
+ BFD_ASSERT (h->dynindx != -1);
+
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ sgot = bfd_get_section_by_name (dynobj, ".got.plt");
+ srela = bfd_get_section_by_name (dynobj, ".rela.plt");
+ BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
+
+ /* Get the index in the procedure linkage table which
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is GOT_ENTRY_SIZE
+ bytes. The first three are reserved for the dynamic linker. */
+ got_offset = (plt_index + 3) * GOT_ENTRY_SIZE;
+
+ /* Fill in the entry in the procedure linkage table. */
+ memcpy (splt->contents + h->plt.offset, elf64_x86_64_plt_entry,
+ PLT_ENTRY_SIZE);
+
+ /* Insert the relocation positions of the plt section. The magic
+ numbers at the end of the statements are the positions of the
+ relocations in the plt section. */
+ /* Put offset for jmp *name@GOTPCREL(%rip), since the
+ instruction uses 6 bytes, subtract this value. */
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset
+ + got_offset
+ - splt->output_section->vma
+ - splt->output_offset
+ - h->plt.offset
+ - 6),
+ splt->contents + h->plt.offset + 2);
+ /* Put relocation index. */
+ bfd_put_32 (output_bfd, plt_index,
+ splt->contents + h->plt.offset + 7);
+ /* Put offset for jmp .PLT0. */
+ bfd_put_32 (output_bfd, - (h->plt.offset + PLT_ENTRY_SIZE),
+ splt->contents + h->plt.offset + 12);
+
+ /* Fill in the entry in the global offset table, initially this
+ points to the pushq instruction in the PLT which is at offset 6. */
+ bfd_put_64 (output_bfd, (splt->output_section->vma + splt->output_offset
+ + h->plt.offset + 6),
+ sgot->contents + got_offset);
+
+ /* Fill in the entry in the .rela.plt section. */
+ rela.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + got_offset);
+ rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_JUMP_SLOT);
+ rela.r_addend = 0;
+ bfd_elf64_swap_reloca_out (output_bfd, &rela,
+ ((Elf64_External_Rela *) srela->contents
+ + plt_index));
+
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ /* 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;
+ }
+ }
+
+ if (h->got.offset != (bfd_vma) -1)
+ {
+ asection *sgot;
+ asection *srela;
+ Elf_Internal_Rela rela;
+
+ /* This symbol has an entry in the global offset table. Set it
+ up. */
+
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ srela = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (sgot != NULL && srela != NULL);
+
+ rela.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + (h->got.offset &~ 1));
+
+ /* If this is a static link, or it is a -Bsymbolic link and the
+ symbol is defined locally or was forced to be local because
+ of a version file, we just want to emit a RELATIVE reloc.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
+ if (! elf_hash_table (info)->dynamic_sections_created
+ || (info->shared
+ && (info->symbolic || h->dynindx == -1)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ {
+ BFD_ASSERT((h->got.offset & 1) != 0);
+ rela.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE);
+ rela.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
+ else
+ {
+ BFD_ASSERT((h->got.offset & 1) == 0);
+ bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_GLOB_DAT);
+ rela.r_addend = 0;
+ }
+
+ bfd_elf64_swap_reloca_out (output_bfd, &rela,
+ ((Elf64_External_Rela *) srela->contents
+ + srela->reloc_count));
+ ++srela->reloc_count;
+ }
+
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
+ {
+ asection *s;
+ Elf_Internal_Rela rela;
+
+ /* 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));
+
+ s = bfd_get_section_by_name (h->root.u.def.section->owner,
+ ".rela.bss");
+ BFD_ASSERT (s != NULL);
+
+ rela.r_offset = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_COPY);
+ rela.r_addend = 0;
+ bfd_elf64_swap_reloca_out (output_bfd, &rela,
+ ((Elf64_External_Rela *) s->contents
+ + s->reloc_count));
+ ++s->reloc_count;
+ }
+
+ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
+ if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ sym->st_shndx = SHN_ABS;
+
+ return true;
+}
+
+/* Finish up the dynamic sections. */
+
+static boolean
+elf64_x86_64_finish_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ bfd *dynobj;
+ asection *sdyn;
+ asection *sgot;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ sgot = bfd_get_section_by_name (dynobj, ".got.plt");
+ BFD_ASSERT (sgot != NULL);
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ asection *splt;
+ Elf64_External_Dyn *dyncon, *dynconend;
+
+ BFD_ASSERT (sdyn != NULL);
+
+ dyncon = (Elf64_External_Dyn *) sdyn->contents;
+ dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+ const char *name;
+ asection *s;
+
+ bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ continue;
+
+ case DT_PLTGOT:
+ name = ".got";
+ goto get_vma;
+
+ case DT_JMPREL:
+ name = ".rela.plt";
+
+ get_vma:
+ s = bfd_get_section_by_name (output_bfd, name);
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma;
+ break;
+
+ case DT_RELASZ:
+ /* FIXME: This comment and code is from elf64-alpha.c: */
+ /* My interpretation of the TIS v1.1 ELF document indicates
+ that RELASZ should not include JMPREL. This is not what
+ the rest of the BFD does. It is, however, what the
+ glibc ld.so wants. Do this fixup here until we found
+ out who is right. */
+ s = bfd_get_section_by_name (output_bfd, ".rela.plt");
+ if (s)
+ {
+ /* Subtract JMPREL size from RELASZ. */
+ dyn.d_un.d_val -=
+ (s->_cooked_size ? s->_cooked_size : s->_raw_size);
+ }
+ break;
+
+ case DT_PLTRELSZ:
+ s = bfd_get_section_by_name (output_bfd, ".rela.plt");
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_val =
+ (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size);
+ break;
+ }
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ }
+
+ /* Initialize the contents of the .plt section. */
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ BFD_ASSERT (splt != NULL);
+ if (splt->_raw_size > 0)
+ {
+ /* Fill in the first entry in the procedure linkage table. */
+ memcpy (splt->contents, elf64_x86_64_plt0_entry, PLT_ENTRY_SIZE);
+ /* Add offset for pushq GOT+8(%rip), since the instruction
+ uses 6 bytes subtract this value. */
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset
+ + 8
+ - splt->output_section->vma
+ - splt->output_offset
+ - 6),
+ splt->contents + 2);
+ /* Add offset for jmp *GOT+16(%rip). The 12 is the offset to
+ the end of the instruction. */
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset
+ + 16
+ - splt->output_section->vma
+ - splt->output_offset
+ - 12),
+ splt->contents + 8);
+
+ }
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize =
+ PLT_ENTRY_SIZE;
+ }
+
+ /* Set the first entry in the global offset table to the address of
+ the dynamic section. */
+ if (sgot->_raw_size > 0)
+ {
+ if (sdyn == NULL)
+ bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents);
+ else
+ bfd_put_64 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
+ /* Write GOT[1] and GOT[2], needed for the dynamic linker. */
+ bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + GOT_ENTRY_SIZE);
+ bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + GOT_ENTRY_SIZE*2);
+ }
+
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize =
+ GOT_ENTRY_SIZE;
+
+ return true;
+}
+
+
+#define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec
+#define TARGET_LITTLE_NAME "elf64-x86-64"
+#define ELF_ARCH bfd_arch_i386
+#define ELF_MACHINE_CODE EM_X86_64
+#define ELF_MAXPAGESIZE 0x100000
+
+#define elf_backend_can_gc_sections 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size (GOT_ENTRY_SIZE*3)
+#define elf_backend_plt_header_size PLT_ENTRY_SIZE
+
+#define elf_info_to_howto elf64_x86_64_info_to_howto
+
+#define bfd_elf64_bfd_final_link _bfd_elf64_gc_common_final_link
+#define bfd_elf64_bfd_link_hash_table_create \
+ elf64_x86_64_link_hash_table_create
+#define bfd_elf64_bfd_reloc_type_lookup elf64_x86_64_reloc_type_lookup
+
+#define elf_backend_adjust_dynamic_symbol elf64_x86_64_adjust_dynamic_symbol
+#define elf_backend_check_relocs elf64_x86_64_check_relocs
+#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
+#define elf_backend_finish_dynamic_sections \
+ elf64_x86_64_finish_dynamic_sections
+#define elf_backend_finish_dynamic_symbol elf64_x86_64_finish_dynamic_symbol
+#define elf_backend_gc_mark_hook elf64_x86_64_gc_mark_hook
+#define elf_backend_gc_sweep_hook elf64_x86_64_gc_sweep_hook
+#define elf_backend_relocate_section elf64_x86_64_relocate_section
+#define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections
+#define elf_backend_object_p elf64_x86_64_elf_object_p
+
+#include "elf64-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/elfarm-nabi.c b/gnu/usr.bin/binutils/bfd/elfarm-nabi.c
index 38778b73be3..ee91e36c7f4 100644
--- a/gnu/usr.bin/binutils/bfd/elfarm-nabi.c
+++ b/gnu/usr.bin/binutils/bfd/elfarm-nabi.c
@@ -1,5 +1,5 @@
/* 32-bit ELF support for ARM new abi option.
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -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/gnu/usr.bin/binutils/bfd/elfarm-oabi.c b/gnu/usr.bin/binutils/bfd/elfarm-oabi.c
index 72f62f23809..b4f93f0f782 100644
--- a/gnu/usr.bin/binutils/bfd/elfarm-oabi.c
+++ b/gnu/usr.bin/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, 2001 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/gnu/usr.bin/binutils/bfd/elfxx-ia64.c b/gnu/usr.bin/binutils/bfd/elfxx-ia64.c
new file mode 100644
index 00000000000..c86f7a9eed2
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/elfxx-ia64.c
@@ -0,0 +1,4235 @@
+/* IA-64 support for 64-bit ELF
+ Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "opcode/ia64.h"
+#include "elf/ia64.h"
+
+/*
+ * THE RULES for all the stuff the linker creates --
+ *
+ * GOT Entries created in response to LTOFF or LTOFF_FPTR
+ * relocations. Dynamic relocs created for dynamic
+ * symbols in an application; REL relocs for locals
+ * in a shared library.
+ *
+ * FPTR The canonical function descriptor. Created for local
+ * symbols in applications. Descriptors for dynamic symbols
+ * and local symbols in shared libraries are created by
+ * ld.so. Thus there are no dynamic relocs against these
+ * objects. The FPTR relocs for such _are_ passed through
+ * to the dynamic relocation tables.
+ *
+ * FULL_PLT Created for a PCREL21B relocation against a dynamic symbol.
+ * Requires the creation of a PLTOFF entry. This does not
+ * require any dynamic relocations.
+ *
+ * PLTOFF Created by PLTOFF relocations. For local symbols, this
+ * is an alternate function descriptor, and in shared libraries
+ * requires two REL relocations. Note that this cannot be
+ * transformed into an FPTR relocation, since it must be in
+ * range of the GP. For dynamic symbols, this is a function
+ * descriptor for a MIN_PLT entry, and requires one IPLT reloc.
+ *
+ * MIN_PLT Created by PLTOFF entries against dynamic symbols. This
+ * does not reqire dynamic relocations.
+ */
+
+#define USE_RELA /* we want RELA relocs, not REL */
+
+#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0])))
+
+typedef struct bfd_hash_entry *(*new_hash_entry_func)
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+
+/* In dynamically (linker-) created sections, we generally need to keep track
+ of the place a symbol or expression got allocated to. This is done via hash
+ tables that store entries of the following type. */
+
+struct elfNN_ia64_dyn_sym_info
+{
+ /* The addend for which this entry is relevant. */
+ bfd_vma addend;
+
+ /* Next addend in the list. */
+ struct elfNN_ia64_dyn_sym_info *next;
+
+ bfd_vma got_offset;
+ bfd_vma fptr_offset;
+ bfd_vma pltoff_offset;
+ bfd_vma plt_offset;
+ bfd_vma plt2_offset;
+
+ /* The symbol table entry, if any, that this was derrived from. */
+ struct elf_link_hash_entry *h;
+
+ /* Used to count non-got, non-plt relocations for delayed sizing
+ of relocation sections. */
+ struct elfNN_ia64_dyn_reloc_entry
+ {
+ struct elfNN_ia64_dyn_reloc_entry *next;
+ asection *srel;
+ int type;
+ int count;
+ } *reloc_entries;
+
+ /* True when the section contents have been updated. */
+ unsigned got_done : 1;
+ unsigned fptr_done : 1;
+ unsigned pltoff_done : 1;
+
+ /* True for the different kinds of linker data we want created. */
+ unsigned want_got : 1;
+ unsigned want_fptr : 1;
+ unsigned want_ltoff_fptr : 1;
+ unsigned want_plt : 1;
+ unsigned want_plt2 : 1;
+ unsigned want_pltoff : 1;
+};
+
+struct elfNN_ia64_local_hash_entry
+{
+ struct bfd_hash_entry root;
+ struct elfNN_ia64_dyn_sym_info *info;
+};
+
+struct elfNN_ia64_local_hash_table
+{
+ struct bfd_hash_table root;
+ /* No additional fields for now. */
+};
+
+struct elfNN_ia64_link_hash_entry
+{
+ struct elf_link_hash_entry root;
+ struct elfNN_ia64_dyn_sym_info *info;
+};
+
+struct elfNN_ia64_link_hash_table
+{
+ /* The main hash table */
+ struct elf_link_hash_table root;
+
+ asection *got_sec; /* the linkage table section (or NULL) */
+ asection *rel_got_sec; /* dynamic relocation section for same */
+ asection *fptr_sec; /* function descriptor table (or NULL) */
+ asection *plt_sec; /* the primary plt section (or NULL) */
+ asection *pltoff_sec; /* private descriptors for plt (or NULL) */
+ asection *rel_pltoff_sec; /* dynamic relocation section for same */
+
+ bfd_size_type minplt_entries; /* number of minplt entries */
+
+ struct elfNN_ia64_local_hash_table loc_hash_table;
+};
+
+#define elfNN_ia64_hash_table(p) \
+ ((struct elfNN_ia64_link_hash_table *) ((p)->hash))
+
+static bfd_reloc_status_type elfNN_ia64_reloc
+ PARAMS ((bfd *abfd, arelent *reloc, asymbol *sym, PTR data,
+ asection *input_section, bfd *output_bfd, char **error_message));
+static reloc_howto_type * lookup_howto
+ PARAMS ((unsigned int rtype));
+static reloc_howto_type *elfNN_ia64_reloc_type_lookup
+ PARAMS ((bfd *abfd, bfd_reloc_code_real_type bfd_code));
+static void elfNN_ia64_info_to_howto
+ PARAMS ((bfd *abfd, arelent *bfd_reloc, ElfNN_Internal_Rela *elf_reloc));
+static boolean elfNN_ia64_relax_section
+ PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info,
+ boolean *again));
+static boolean is_unwind_section_name
+ PARAMS ((const char *));
+static boolean elfNN_ia64_section_from_shdr
+ PARAMS ((bfd *, ElfNN_Internal_Shdr *, char *));
+static boolean elfNN_ia64_fake_sections
+ PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec));
+static void elfNN_ia64_final_write_processing
+ PARAMS ((bfd *abfd, boolean linker));
+static boolean elfNN_ia64_add_symbol_hook
+ PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym,
+ const char **namep, flagword *flagsp, asection **secp,
+ bfd_vma *valp));
+static int elfNN_ia64_additional_program_headers
+ PARAMS ((bfd *abfd));
+static boolean elfNN_ia64_is_local_label_name
+ PARAMS ((bfd *abfd, const char *name));
+static boolean elfNN_ia64_dynamic_symbol_p
+ PARAMS ((struct elf_link_hash_entry *h, struct bfd_link_info *info));
+static boolean elfNN_ia64_local_hash_table_init
+ PARAMS ((struct elfNN_ia64_local_hash_table *ht, bfd *abfd,
+ new_hash_entry_func new));
+static struct bfd_hash_entry *elfNN_ia64_new_loc_hash_entry
+ PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table,
+ const char *string));
+static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry
+ PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table,
+ const char *string));
+static struct bfd_link_hash_table *elfNN_ia64_hash_table_create
+ PARAMS ((bfd *abfd));
+static struct elfNN_ia64_local_hash_entry *elfNN_ia64_local_hash_lookup
+ PARAMS ((struct elfNN_ia64_local_hash_table *table, const char *string,
+ boolean create, boolean copy));
+static void elfNN_ia64_dyn_sym_traverse
+ PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info,
+ boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR),
+ PTR info));
+static boolean elfNN_ia64_create_dynamic_sections
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+static struct elfNN_ia64_dyn_sym_info * get_dyn_sym_info
+ PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info,
+ struct elf_link_hash_entry *h,
+ bfd *abfd, const Elf_Internal_Rela *rel, boolean create));
+static asection *get_got
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ struct elfNN_ia64_link_hash_table *ia64_info));
+static asection *get_fptr
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ struct elfNN_ia64_link_hash_table *ia64_info));
+static asection *get_pltoff
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ struct elfNN_ia64_link_hash_table *ia64_info));
+static asection *get_reloc_section
+ PARAMS ((bfd *abfd, struct elfNN_ia64_link_hash_table *ia64_info,
+ asection *sec, boolean create));
+static boolean count_dyn_reloc
+ PARAMS ((bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i,
+ asection *srel, int type));
+static boolean elfNN_ia64_check_relocs
+ PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec,
+ const Elf_Internal_Rela *relocs));
+static boolean elfNN_ia64_adjust_dynamic_symbol
+ PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h));
+static unsigned long global_sym_index
+ PARAMS ((struct elf_link_hash_entry *h));
+static boolean allocate_fptr
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean allocate_global_data_got
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean allocate_global_fptr_got
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean allocate_local_got
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean allocate_pltoff_entries
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean allocate_plt_entries
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean allocate_plt2_entries
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean allocate_dynrel_entries
+ PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data));
+static boolean elfNN_ia64_size_dynamic_sections
+ PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
+static bfd_reloc_status_type elfNN_ia64_install_value
+ PARAMS ((bfd *abfd, bfd_byte *hit_addr, bfd_vma val, unsigned int r_type));
+static void elfNN_ia64_install_dyn_reloc
+ PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec,
+ asection *srel, bfd_vma offset, unsigned int type,
+ long dynindx, bfd_vma addend));
+static bfd_vma set_got_entry
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ struct elfNN_ia64_dyn_sym_info *dyn_i, long dynindx,
+ bfd_vma addend, bfd_vma value, unsigned int dyn_r_type));
+static bfd_vma set_fptr_entry
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ struct elfNN_ia64_dyn_sym_info *dyn_i,
+ bfd_vma value));
+static bfd_vma set_pltoff_entry
+ PARAMS ((bfd *abfd, struct bfd_link_info *info,
+ struct elfNN_ia64_dyn_sym_info *dyn_i,
+ bfd_vma value, boolean));
+static boolean elfNN_ia64_final_link
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+static boolean elfNN_ia64_relocate_section
+ PARAMS ((bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd,
+ asection *input_section, bfd_byte *contents,
+ Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms,
+ asection **local_sections));
+static boolean elfNN_ia64_finish_dynamic_symbol
+ PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
+ struct elf_link_hash_entry *h, Elf_Internal_Sym *sym));
+static boolean elfNN_ia64_finish_dynamic_sections
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+static boolean elfNN_ia64_set_private_flags
+ PARAMS ((bfd *abfd, flagword flags));
+static boolean elfNN_ia64_copy_private_bfd_data
+ PARAMS ((bfd *ibfd, bfd *obfd));
+static boolean elfNN_ia64_merge_private_bfd_data
+ PARAMS ((bfd *ibfd, bfd *obfd));
+static boolean elfNN_ia64_print_private_bfd_data
+ PARAMS ((bfd *abfd, PTR ptr));
+
+/* ia64-specific relocation */
+
+/* Perform a relocation. Not much to do here as all the hard work is
+ done in elfNN_ia64_final_link_relocate. */
+static bfd_reloc_status_type
+elfNN_ia64_reloc (abfd, reloc, sym, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc;
+ asymbol *sym ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ if (output_bfd)
+ {
+ reloc->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+ *error_message = "Unsupported call to elfNN_ia64_reloc";
+ return bfd_reloc_notsupported;
+}
+
+#define IA64_HOWTO(TYPE, NAME, SIZE, PCREL, IN) \
+ HOWTO (TYPE, 0, SIZE, 0, PCREL, 0, complain_overflow_signed, \
+ elfNN_ia64_reloc, NAME, false, 0, 0, IN)
+
+/* This table has to be sorted according to increasing number of the
+ TYPE field. */
+static reloc_howto_type ia64_howto_table[] =
+ {
+ IA64_HOWTO (R_IA64_NONE, "NONE", 0, false, true),
+
+ IA64_HOWTO (R_IA64_IMM14, "IMM14", 0, false, true),
+ IA64_HOWTO (R_IA64_IMM22, "IMM22", 0, false, true),
+ IA64_HOWTO (R_IA64_IMM64, "IMM64", 0, false, true),
+ IA64_HOWTO (R_IA64_DIR32MSB, "DIR32MSB", 2, false, true),
+ IA64_HOWTO (R_IA64_DIR32LSB, "DIR32LSB", 2, false, true),
+ IA64_HOWTO (R_IA64_DIR64MSB, "DIR64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_DIR64LSB, "DIR64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_GPREL22, "GPREL22", 0, false, true),
+ IA64_HOWTO (R_IA64_GPREL64I, "GPREL64I", 0, false, true),
+ IA64_HOWTO (R_IA64_GPREL32MSB, "GPREL32MSB", 2, false, true),
+ IA64_HOWTO (R_IA64_GPREL32LSB, "GPREL32LSB", 2, false, true),
+ IA64_HOWTO (R_IA64_GPREL64MSB, "GPREL64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_GPREL64LSB, "GPREL64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_LTOFF22, "LTOFF22", 0, false, true),
+ IA64_HOWTO (R_IA64_LTOFF64I, "LTOFF64I", 0, false, true),
+
+ IA64_HOWTO (R_IA64_PLTOFF22, "PLTOFF22", 0, false, true),
+ IA64_HOWTO (R_IA64_PLTOFF64I, "PLTOFF64I", 0, false, true),
+ IA64_HOWTO (R_IA64_PLTOFF64MSB, "PLTOFF64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_PLTOFF64LSB, "PLTOFF64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_FPTR64I, "FPTR64I", 0, false, true),
+ IA64_HOWTO (R_IA64_FPTR32MSB, "FPTR32MSB", 2, false, true),
+ IA64_HOWTO (R_IA64_FPTR32LSB, "FPTR32LSB", 2, false, true),
+ IA64_HOWTO (R_IA64_FPTR64MSB, "FPTR64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_FPTR64LSB, "FPTR64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_PCREL60B, "PCREL60B", 0, true, true),
+ IA64_HOWTO (R_IA64_PCREL21B, "PCREL21B", 0, true, true),
+ IA64_HOWTO (R_IA64_PCREL21M, "PCREL21M", 0, true, true),
+ IA64_HOWTO (R_IA64_PCREL21F, "PCREL21F", 0, true, true),
+ IA64_HOWTO (R_IA64_PCREL32MSB, "PCREL32MSB", 2, true, true),
+ IA64_HOWTO (R_IA64_PCREL32LSB, "PCREL32LSB", 2, true, true),
+ IA64_HOWTO (R_IA64_PCREL64MSB, "PCREL64MSB", 4, true, true),
+ IA64_HOWTO (R_IA64_PCREL64LSB, "PCREL64LSB", 4, true, true),
+
+ IA64_HOWTO (R_IA64_LTOFF_FPTR22, "LTOFF_FPTR22", 0, false, true),
+ IA64_HOWTO (R_IA64_LTOFF_FPTR64I, "LTOFF_FPTR64I", 0, false, true),
+ IA64_HOWTO (R_IA64_LTOFF_FPTR64MSB, "LTOFF_FPTR64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_SEGREL32MSB, "SEGREL32MSB", 2, false, true),
+ IA64_HOWTO (R_IA64_SEGREL32LSB, "SEGREL32LSB", 2, false, true),
+ IA64_HOWTO (R_IA64_SEGREL64MSB, "SEGREL64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_SEGREL64LSB, "SEGREL64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_SECREL32MSB, "SECREL32MSB", 2, false, true),
+ IA64_HOWTO (R_IA64_SECREL32LSB, "SECREL32LSB", 2, false, true),
+ IA64_HOWTO (R_IA64_SECREL64MSB, "SECREL64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_SECREL64LSB, "SECREL64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_REL32MSB, "REL32MSB", 2, false, true),
+ IA64_HOWTO (R_IA64_REL32LSB, "REL32LSB", 2, false, true),
+ IA64_HOWTO (R_IA64_REL64MSB, "REL64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_REL64LSB, "REL64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_LTV32MSB, "LTV32MSB", 2, false, true),
+ IA64_HOWTO (R_IA64_LTV32LSB, "LTV32LSB", 2, false, true),
+ IA64_HOWTO (R_IA64_LTV64MSB, "LTV64MSB", 4, false, true),
+ IA64_HOWTO (R_IA64_LTV64LSB, "LTV64LSB", 4, false, true),
+
+ IA64_HOWTO (R_IA64_PCREL21BI, "PCREL21BI", 0, true, true),
+ IA64_HOWTO (R_IA64_PCREL22, "PCREL22", 0, true, true),
+ IA64_HOWTO (R_IA64_PCREL64I, "PCREL64I", 0, true, true),
+
+ IA64_HOWTO (R_IA64_IPLTMSB, "IPLTMSB", 4, false, true),
+ IA64_HOWTO (R_IA64_IPLTLSB, "IPLTLSB", 4, false, true),
+ IA64_HOWTO (R_IA64_COPY, "COPY", 4, false, true),
+ IA64_HOWTO (R_IA64_LTOFF22X, "LTOFF22X", 0, false, true),
+ IA64_HOWTO (R_IA64_LDXMOV, "LDXMOV", 0, false, true),
+
+ IA64_HOWTO (R_IA64_TPREL22, "TPREL22", 0, false, false),
+ IA64_HOWTO (R_IA64_TPREL64MSB, "TPREL64MSB", 8, false, false),
+ IA64_HOWTO (R_IA64_TPREL64LSB, "TPREL64LSB", 8, false, false),
+ IA64_HOWTO (R_IA64_LTOFF_TP22, "LTOFF_TP22", 0, false, false),
+ };
+
+static unsigned char elf_code_to_howto_index[R_IA64_MAX_RELOC_CODE + 1];
+
+/* Given a BFD reloc type, return the matching HOWTO structure. */
+
+static reloc_howto_type*
+lookup_howto (rtype)
+ unsigned int rtype;
+{
+ static int inited = 0;
+ int i;
+
+ if (!inited)
+ {
+ inited = 1;
+
+ memset (elf_code_to_howto_index, 0xff, sizeof (elf_code_to_howto_index));
+ for (i = 0; i < NELEMS (ia64_howto_table); ++i)
+ elf_code_to_howto_index[ia64_howto_table[i].type] = i;
+ }
+
+ BFD_ASSERT (rtype <= R_IA64_MAX_RELOC_CODE);
+ i = elf_code_to_howto_index[rtype];
+ if (i >= NELEMS (ia64_howto_table))
+ return 0;
+ return ia64_howto_table + i;
+}
+
+static reloc_howto_type*
+elfNN_ia64_reloc_type_lookup (abfd, bfd_code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type bfd_code;
+{
+ unsigned int rtype;
+
+ switch (bfd_code)
+ {
+ case BFD_RELOC_NONE: rtype = R_IA64_NONE; break;
+
+ case BFD_RELOC_IA64_IMM14: rtype = R_IA64_IMM14; break;
+ case BFD_RELOC_IA64_IMM22: rtype = R_IA64_IMM22; break;
+ case BFD_RELOC_IA64_IMM64: rtype = R_IA64_IMM64; break;
+
+ case BFD_RELOC_IA64_DIR32MSB: rtype = R_IA64_DIR32MSB; break;
+ case BFD_RELOC_IA64_DIR32LSB: rtype = R_IA64_DIR32LSB; break;
+ case BFD_RELOC_IA64_DIR64MSB: rtype = R_IA64_DIR64MSB; break;
+ case BFD_RELOC_IA64_DIR64LSB: rtype = R_IA64_DIR64LSB; break;
+
+ case BFD_RELOC_IA64_GPREL22: rtype = R_IA64_GPREL22; break;
+ case BFD_RELOC_IA64_GPREL64I: rtype = R_IA64_GPREL64I; break;
+ case BFD_RELOC_IA64_GPREL32MSB: rtype = R_IA64_GPREL32MSB; break;
+ case BFD_RELOC_IA64_GPREL32LSB: rtype = R_IA64_GPREL32LSB; break;
+ case BFD_RELOC_IA64_GPREL64MSB: rtype = R_IA64_GPREL64MSB; break;
+ case BFD_RELOC_IA64_GPREL64LSB: rtype = R_IA64_GPREL64LSB; break;
+
+ case BFD_RELOC_IA64_LTOFF22: rtype = R_IA64_LTOFF22; break;
+ case BFD_RELOC_IA64_LTOFF64I: rtype = R_IA64_LTOFF64I; break;
+
+ case BFD_RELOC_IA64_PLTOFF22: rtype = R_IA64_PLTOFF22; break;
+ case BFD_RELOC_IA64_PLTOFF64I: rtype = R_IA64_PLTOFF64I; break;
+ case BFD_RELOC_IA64_PLTOFF64MSB: rtype = R_IA64_PLTOFF64MSB; break;
+ case BFD_RELOC_IA64_PLTOFF64LSB: rtype = R_IA64_PLTOFF64LSB; break;
+ case BFD_RELOC_IA64_FPTR64I: rtype = R_IA64_FPTR64I; break;
+ case BFD_RELOC_IA64_FPTR32MSB: rtype = R_IA64_FPTR32MSB; break;
+ case BFD_RELOC_IA64_FPTR32LSB: rtype = R_IA64_FPTR32LSB; break;
+ case BFD_RELOC_IA64_FPTR64MSB: rtype = R_IA64_FPTR64MSB; break;
+ case BFD_RELOC_IA64_FPTR64LSB: rtype = R_IA64_FPTR64LSB; break;
+
+ case BFD_RELOC_IA64_PCREL21B: rtype = R_IA64_PCREL21B; break;
+ case BFD_RELOC_IA64_PCREL21BI: rtype = R_IA64_PCREL21BI; break;
+ case BFD_RELOC_IA64_PCREL21M: rtype = R_IA64_PCREL21M; break;
+ case BFD_RELOC_IA64_PCREL21F: rtype = R_IA64_PCREL21F; break;
+ case BFD_RELOC_IA64_PCREL22: rtype = R_IA64_PCREL22; break;
+ case BFD_RELOC_IA64_PCREL60B: rtype = R_IA64_PCREL60B; break;
+ case BFD_RELOC_IA64_PCREL64I: rtype = R_IA64_PCREL64I; break;
+ case BFD_RELOC_IA64_PCREL32MSB: rtype = R_IA64_PCREL32MSB; break;
+ case BFD_RELOC_IA64_PCREL32LSB: rtype = R_IA64_PCREL32LSB; break;
+ case BFD_RELOC_IA64_PCREL64MSB: rtype = R_IA64_PCREL64MSB; break;
+ case BFD_RELOC_IA64_PCREL64LSB: rtype = R_IA64_PCREL64LSB; break;
+
+ case BFD_RELOC_IA64_LTOFF_FPTR22: rtype = R_IA64_LTOFF_FPTR22; break;
+ case BFD_RELOC_IA64_LTOFF_FPTR64I: rtype = R_IA64_LTOFF_FPTR64I; break;
+ case BFD_RELOC_IA64_LTOFF_FPTR64MSB: rtype = R_IA64_LTOFF_FPTR64MSB; break;
+ case BFD_RELOC_IA64_LTOFF_FPTR64LSB: rtype = R_IA64_LTOFF_FPTR64LSB; break;
+
+ case BFD_RELOC_IA64_SEGREL32MSB: rtype = R_IA64_SEGREL32MSB; break;
+ case BFD_RELOC_IA64_SEGREL32LSB: rtype = R_IA64_SEGREL32LSB; break;
+ case BFD_RELOC_IA64_SEGREL64MSB: rtype = R_IA64_SEGREL64MSB; break;
+ case BFD_RELOC_IA64_SEGREL64LSB: rtype = R_IA64_SEGREL64LSB; break;
+
+ case BFD_RELOC_IA64_SECREL32MSB: rtype = R_IA64_SECREL32MSB; break;
+ case BFD_RELOC_IA64_SECREL32LSB: rtype = R_IA64_SECREL32LSB; break;
+ case BFD_RELOC_IA64_SECREL64MSB: rtype = R_IA64_SECREL64MSB; break;
+ case BFD_RELOC_IA64_SECREL64LSB: rtype = R_IA64_SECREL64LSB; break;
+
+ case BFD_RELOC_IA64_REL32MSB: rtype = R_IA64_REL32MSB; break;
+ case BFD_RELOC_IA64_REL32LSB: rtype = R_IA64_REL32LSB; break;
+ case BFD_RELOC_IA64_REL64MSB: rtype = R_IA64_REL64MSB; break;
+ case BFD_RELOC_IA64_REL64LSB: rtype = R_IA64_REL64LSB; break;
+
+ case BFD_RELOC_IA64_LTV32MSB: rtype = R_IA64_LTV32MSB; break;
+ case BFD_RELOC_IA64_LTV32LSB: rtype = R_IA64_LTV32LSB; break;
+ case BFD_RELOC_IA64_LTV64MSB: rtype = R_IA64_LTV64MSB; break;
+ case BFD_RELOC_IA64_LTV64LSB: rtype = R_IA64_LTV64LSB; break;
+
+ case BFD_RELOC_IA64_IPLTMSB: rtype = R_IA64_IPLTMSB; break;
+ case BFD_RELOC_IA64_IPLTLSB: rtype = R_IA64_IPLTLSB; break;
+ case BFD_RELOC_IA64_COPY: rtype = R_IA64_COPY; break;
+ case BFD_RELOC_IA64_LTOFF22X: rtype = R_IA64_LTOFF22X; break;
+ case BFD_RELOC_IA64_LDXMOV: rtype = R_IA64_LDXMOV; break;
+
+ case BFD_RELOC_IA64_TPREL22: rtype = R_IA64_TPREL22; break;
+ case BFD_RELOC_IA64_TPREL64MSB: rtype = R_IA64_TPREL64MSB; break;
+ case BFD_RELOC_IA64_TPREL64LSB: rtype = R_IA64_TPREL64LSB; break;
+ case BFD_RELOC_IA64_LTOFF_TP22: rtype = R_IA64_LTOFF_TP22; break;
+
+ default: return 0;
+ }
+ return lookup_howto (rtype);
+}
+
+/* Given a ELF reloc, return the matching HOWTO structure. */
+
+static void
+elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *bfd_reloc;
+ ElfNN_Internal_Rela *elf_reloc;
+{
+ bfd_reloc->howto = lookup_howto (ELFNN_R_TYPE (elf_reloc->r_info));
+}
+
+#define PLT_HEADER_SIZE (3 * 16)
+#define PLT_MIN_ENTRY_SIZE (1 * 16)
+#define PLT_FULL_ENTRY_SIZE (2 * 16)
+#define PLT_RESERVED_WORDS 3
+
+static const bfd_byte plt_header[PLT_HEADER_SIZE] =
+{
+ 0x0b, 0x10, 0x00, 0x1c, 0x00, 0x21, /* [MMI] mov r2=r14;; */
+ 0xe0, 0x00, 0x08, 0x00, 0x48, 0x00, /* addl r14=0,r2 */
+ 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */
+ 0x0b, 0x80, 0x20, 0x1c, 0x18, 0x14, /* [MMI] ld8 r16=[r14],8;; */
+ 0x10, 0x41, 0x38, 0x30, 0x28, 0x00, /* ld8 r17=[r14],8 */
+ 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */
+ 0x11, 0x08, 0x00, 0x1c, 0x18, 0x10, /* [MIB] ld8 r1=[r14] */
+ 0x60, 0x88, 0x04, 0x80, 0x03, 0x00, /* mov b6=r17 */
+ 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
+};
+
+static const bfd_byte plt_min_entry[PLT_MIN_ENTRY_SIZE] =
+{
+ 0x11, 0x78, 0x00, 0x00, 0x00, 0x24, /* [MIB] mov r15=0 */
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */
+ 0x00, 0x00, 0x00, 0x40 /* br.few 0 <PLT0>;; */
+};
+
+static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
+{
+ 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */
+ 0x00, 0x41, 0x3c, 0x30, 0x28, 0xc0, /* ld8 r16=[r15],8 */
+ 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */
+ 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */
+ 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
+ 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
+};
+
+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+
+/* Select out of range branch fixup type. Note that Itanium does
+ not support brl, and so it gets emulated by the kernel. */
+#undef USE_BRL
+
+static const bfd_byte oor_brl[16] =
+{
+ 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */
+ 0x00, 0x00, 0x00, 0xc0
+};
+
+static const bfd_byte oor_ip[48] =
+{
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */
+ 0x01, 0x00, 0x00, 0x60,
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */
+ 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */
+ 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */
+ 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */
+ 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
+ 0x60, 0x00, 0x80, 0x00 /* br b6;; */
+};
+
+/* These functions do relaxation for IA-64 ELF.
+
+ This is primarily to support branches to targets out of range;
+ relaxation of R_IA64_LTOFF22X and R_IA64_LDXMOV not yet supported. */
+
+static boolean
+elfNN_ia64_relax_section (abfd, sec, link_info, again)
+ bfd *abfd;
+ asection *sec;
+ struct bfd_link_info *link_info;
+ boolean *again;
+{
+ struct one_fixup
+ {
+ struct one_fixup *next;
+ asection *tsec;
+ bfd_vma toff;
+ bfd_vma trampoff;
+ };
+
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *free_relocs = NULL;
+ Elf_Internal_Rela *irel, *irelend;
+ bfd_byte *contents;
+ bfd_byte *free_contents = NULL;
+ ElfNN_External_Sym *extsyms;
+ ElfNN_External_Sym *free_extsyms = NULL;
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ struct one_fixup *fixups = NULL;
+ boolean changed_contents = false;
+ boolean changed_relocs = false;
+
+ /* Assume we're not going to change any sizes, and we'll only need
+ one pass. */
+ *again = false;
+
+ /* Nothing to do if there are no relocations. */
+ if ((sec->flags & SEC_RELOC) == 0
+ || sec->reloc_count == 0)
+ return true;
+
+ /* If this is the first time we have been called for this section,
+ initialize the cooked size. */
+ if (sec->_cooked_size == 0)
+ sec->_cooked_size = sec->_raw_size;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+
+ /* Load the relocations for this section. */
+ internal_relocs = (_bfd_elfNN_link_read_relocs
+ (abfd, sec, (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;
+
+ ia64_info = elfNN_ia64_hash_table (link_info);
+ irelend = internal_relocs + sec->reloc_count;
+
+ for (irel = internal_relocs; irel < irelend; irel++)
+ if (ELFNN_R_TYPE (irel->r_info) == (int) R_IA64_PCREL21B)
+ break;
+
+ /* No branch-type relocations. */
+ if (irel == irelend)
+ {
+ if (free_relocs != NULL)
+ free (free_relocs);
+ return true;
+ }
+
+ /* Get the section contents. */
+ if (elf_section_data (sec)->this_hdr.contents != NULL)
+ contents = elf_section_data (sec)->this_hdr.contents;
+ else
+ {
+ 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,
+ (file_ptr) 0, sec->_raw_size))
+ goto error_return;
+ }
+
+ /* Read this BFD's symbols. */
+ if (symtab_hdr->contents != NULL)
+ extsyms = (ElfNN_External_Sym *) symtab_hdr->contents;
+ else
+ {
+ extsyms = (ElfNN_External_Sym *) 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))
+ goto error_return;
+ }
+
+ for (; irel < irelend; irel++)
+ {
+ bfd_vma symaddr, reladdr, trampoff, toff, roff;
+ Elf_Internal_Sym isym;
+ asection *tsec;
+ struct one_fixup *f;
+
+ if (ELFNN_R_TYPE (irel->r_info) != (int) R_IA64_PCREL21B)
+ continue;
+
+ /* Get the value of the symbol referred to by the reloc. */
+ if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ {
+ /* A local symbol. */
+ bfd_elfNN_swap_symbol_in (abfd,
+ extsyms + ELFNN_R_SYM (irel->r_info),
+ &isym);
+ if (isym.st_shndx == SHN_UNDEF)
+ continue; /* We can't do anthing with undefined symbols. */
+ else if (isym.st_shndx == SHN_ABS)
+ tsec = bfd_abs_section_ptr;
+ else if (isym.st_shndx == SHN_COMMON)
+ tsec = bfd_com_section_ptr;
+ else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE)
+ tsec = bfd_section_from_elf_index (abfd, isym.st_shndx);
+ else
+ continue; /* who knows. */
+
+ toff = isym.st_value;
+ }
+ else
+ {
+ unsigned long indx;
+ struct elf_link_hash_entry *h;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+
+ indx = ELFNN_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+
+ 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;
+
+ dyn_i = get_dyn_sym_info (ia64_info, h, abfd, irel, false);
+
+ /* For branches to dynamic symbols, we're interested instead
+ in a branch to the PLT entry. */
+ if (dyn_i && dyn_i->want_plt2)
+ {
+ tsec = ia64_info->plt_sec;
+ toff = dyn_i->plt2_offset;
+ }
+ else
+ {
+ /* We can't do anthing with undefined symbols. */
+ if (h->root.type == bfd_link_hash_undefined
+ || h->root.type == bfd_link_hash_undefweak)
+ continue;
+
+ tsec = h->root.u.def.section;
+ toff = h->root.u.def.value;
+ }
+ }
+
+ symaddr = (tsec->output_section->vma
+ + tsec->output_offset
+ + toff
+ + irel->r_addend);
+
+ roff = irel->r_offset;
+ reladdr = (sec->output_section->vma
+ + sec->output_offset
+ + roff) & -4;
+
+ /* If the branch is in range, no need to do anything. */
+ if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000
+ && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0)
+ continue;
+
+ /* If the branch and target are in the same section, you've
+ got one honking big section and we can't help you. You'll
+ get an error message later. */
+ if (tsec == sec)
+ continue;
+
+ /* Look for an existing fixup to this address. */
+ for (f = fixups; f ; f = f->next)
+ if (f->tsec == tsec && f->toff == toff)
+ break;
+
+ if (f == NULL)
+ {
+ /* Two alternatives: If it's a branch to a PLT entry, we can
+ make a copy of the FULL_PLT entry. Otherwise, we'll have
+ to use a `brl' insn to get where we're going. */
+
+ int size;
+
+ if (tsec == ia64_info->plt_sec)
+ size = sizeof (plt_full_entry);
+ else
+ {
+#ifdef USE_BRL
+ size = sizeof (oor_brl);
+#else
+ size = sizeof (oor_ip);
+#endif
+ }
+
+ /* Resize the current section to make room for the new branch. */
+ trampoff = (sec->_cooked_size + 15) & -16;
+ contents = (bfd_byte *) bfd_realloc (contents, trampoff + size);
+ if (contents == NULL)
+ goto error_return;
+ sec->_cooked_size = trampoff + size;
+
+ if (tsec == ia64_info->plt_sec)
+ {
+ memcpy (contents + trampoff, plt_full_entry, size);
+
+ /* Hijack the old relocation for use as the PLTOFF reloc. */
+ irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
+ R_IA64_PLTOFF22);
+ irel->r_offset = trampoff;
+ }
+ else
+ {
+#ifdef USE_BRL
+ memcpy (contents + trampoff, oor_brl, size);
+ irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
+ R_IA64_PCREL60B);
+ irel->r_offset = trampoff + 2;
+#else
+ memcpy (contents + trampoff, oor_ip, size);
+ irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
+ R_IA64_PCREL64I);
+ irel->r_addend -= 16;
+ irel->r_offset = trampoff + 2;
+#endif
+ }
+
+ /* Record the fixup so we don't do it again this section. */
+ f = (struct one_fixup *) bfd_malloc (sizeof (*f));
+ f->next = fixups;
+ f->tsec = tsec;
+ f->toff = toff;
+ f->trampoff = trampoff;
+ fixups = f;
+ }
+ else
+ {
+ /* Nop out the reloc, since we're finalizing things here. */
+ irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE);
+ }
+
+ /* Fix up the existing branch to hit the trampoline. Hope like
+ hell this doesn't overflow too. */
+ if (elfNN_ia64_install_value (abfd, contents + roff,
+ f->trampoff - (roff & -4),
+ R_IA64_PCREL21B) != bfd_reloc_ok)
+ goto error_return;
+
+ changed_contents = true;
+ changed_relocs = true;
+ }
+
+ /* Clean up and go home. */
+ while (fixups)
+ {
+ struct one_fixup *f = fixups;
+ fixups = fixups->next;
+ free (f);
+ }
+
+ if (changed_relocs)
+ elf_section_data (sec)->relocs = internal_relocs;
+ else if (free_relocs != NULL)
+ free (free_relocs);
+
+ if (changed_contents)
+ elf_section_data (sec)->this_hdr.contents = contents;
+ else if (free_contents != NULL)
+ {
+ if (! link_info->keep_memory)
+ free (free_contents);
+ else
+ {
+ /* Cache the section contents for elf_link_input_bfd. */
+ elf_section_data (sec)->this_hdr.contents = contents;
+ }
+ }
+
+ if (free_extsyms != NULL)
+ {
+ if (! link_info->keep_memory)
+ free (free_extsyms);
+ else
+ {
+ /* Cache the symbols for elf_link_input_bfd. */
+ symtab_hdr->contents = extsyms;
+ }
+ }
+
+ *again = changed_contents || changed_relocs;
+ return true;
+
+ error_return:
+ if (free_relocs != NULL)
+ free (free_relocs);
+ if (free_contents != NULL)
+ free (free_contents);
+ if (free_extsyms != NULL)
+ free (free_extsyms);
+ return false;
+}
+
+/* Return true if NAME is an unwind table section name. */
+
+static inline boolean
+is_unwind_section_name (name)
+ const char *name;
+{
+ size_t len1, len2, len3;
+
+ len1 = sizeof (ELF_STRING_ia64_unwind) - 1;
+ len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1;
+ len3 = sizeof (ELF_STRING_ia64_unwind_once) - 1;
+ return ((strncmp (name, ELF_STRING_ia64_unwind, len1) == 0
+ && strncmp (name, ELF_STRING_ia64_unwind_info, len2) != 0)
+ || strncmp (name, ELF_STRING_ia64_unwind_once, len3) == 0);
+}
+
+/* Handle an IA-64 specific section when reading an object file. This
+ is called when elfcode.h finds a section with an unknown type. */
+
+static boolean
+elfNN_ia64_section_from_shdr (abfd, hdr, name)
+ bfd *abfd;
+ ElfNN_Internal_Shdr *hdr;
+ char *name;
+{
+ asection *newsect;
+
+ /* There ought to be a place to keep ELF backend specific flags, but
+ at the moment there isn't one. We just keep track of the
+ sections by their name, instead. Fortunately, the ABI gives
+ suggested names for all the MIPS specific sections, so we will
+ probably get away with this. */
+ switch (hdr->sh_type)
+ {
+ case SHT_IA_64_UNWIND:
+ break;
+
+ case SHT_IA_64_EXT:
+ if (strcmp (name, ELF_STRING_ia64_archext) != 0)
+ return false;
+ break;
+
+ default:
+ return false;
+ }
+
+ if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
+ return false;
+ newsect = hdr->bfd_section;
+
+ return true;
+}
+
+/* Convert IA-64 specific section flags to bfd internal section flags. */
+
+/* ??? There is no bfd internal flag equivalent to the SHF_IA_64_NORECOV
+ flag. */
+
+static boolean
+elfNN_ia64_section_flags (flags, hdr)
+ flagword *flags;
+ ElfNN_Internal_Shdr *hdr;
+{
+ if (hdr->sh_flags & SHF_IA_64_SHORT)
+ *flags |= SEC_SMALL_DATA;
+
+ return true;
+}
+
+/* Set the correct type for an IA-64 ELF section. We do this by the
+ section name, which is a hack, but ought to work. */
+
+static boolean
+elfNN_ia64_fake_sections (abfd, hdr, sec)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ ElfNN_Internal_Shdr *hdr;
+ asection *sec;
+{
+ register const char *name;
+
+ name = bfd_get_section_name (abfd, sec);
+
+ if (is_unwind_section_name (name))
+ {
+ /* We don't have the sections numbered at this point, so sh_info
+ is set later, in elfNN_ia64_final_write_processing. */
+ hdr->sh_type = SHT_IA_64_UNWIND;
+ hdr->sh_flags |= SHF_LINK_ORDER;
+ }
+ else if (strcmp (name, ELF_STRING_ia64_archext) == 0)
+ hdr->sh_type = SHT_IA_64_EXT;
+ else if (strcmp (name, ".reloc") == 0)
+ /*
+ * This is an ugly, but unfortunately necessary hack that is
+ * needed when producing EFI binaries on IA-64. It tells
+ * elf.c:elf_fake_sections() not to consider ".reloc" as a section
+ * containing ELF relocation info. We need this hack in order to
+ * be able to generate ELF binaries that can be translated into
+ * EFI applications (which are essentially COFF objects). Those
+ * files contain a COFF ".reloc" section inside an ELFNN object,
+ * which would normally cause BFD to segfault because it would
+ * attempt to interpret this section as containing relocation
+ * entries for section "oc". With this hack enabled, ".reloc"
+ * will be treated as a normal data section, which will avoid the
+ * segfault. However, you won't be able to create an ELFNN binary
+ * with a section named "oc" that needs relocations, but that's
+ * the kind of ugly side-effects you get when detecting section
+ * types based on their names... In practice, this limitation is
+ * unlikely to bite.
+ */
+ hdr->sh_type = SHT_PROGBITS;
+
+ if (sec->flags & SEC_SMALL_DATA)
+ hdr->sh_flags |= SHF_IA_64_SHORT;
+
+ return true;
+}
+
+/* The final processing done just before writing out an IA-64 ELF
+ object file. */
+
+static void
+elfNN_ia64_final_write_processing (abfd, linker)
+ bfd *abfd;
+ boolean linker ATTRIBUTE_UNUSED;
+{
+ Elf_Internal_Shdr *hdr;
+ const char *sname;
+ asection *text_sect, *s;
+ size_t len;
+
+ for (s = abfd->sections; s; s = s->next)
+ {
+ hdr = &elf_section_data (s)->this_hdr;
+ switch (hdr->sh_type)
+ {
+ case SHT_IA_64_UNWIND:
+ /* See comments in gas/config/tc-ia64.c:dot_endp on why we
+ have to do this. */
+ sname = bfd_get_section_name (abfd, s);
+ len = sizeof (ELF_STRING_ia64_unwind) - 1;
+ if (sname && strncmp (sname, ELF_STRING_ia64_unwind, len) == 0)
+ {
+ sname += len;
+
+ if (sname[0] == '\0')
+ /* .IA_64.unwind -> .text */
+ text_sect = bfd_get_section_by_name (abfd, ".text");
+ else
+ /* .IA_64.unwindFOO -> FOO */
+ text_sect = bfd_get_section_by_name (abfd, sname);
+ }
+ else if (sname
+ && (len = sizeof (ELF_STRING_ia64_unwind_once) - 1,
+ strncmp (sname, ELF_STRING_ia64_unwind_once, len)) == 0)
+ {
+ /* .gnu.linkonce.ia64unw.FOO -> .gnu.linkonce.t.FOO */
+ size_t len2 = sizeof (".gnu.linkonce.t.") - 1;
+ char *once_name = alloca (len2 + strlen (sname) - len + 1);
+
+ memcpy (once_name, ".gnu.linkonce.t.", len2);
+ strcpy (once_name + len2, sname + len);
+ text_sect = bfd_get_section_by_name (abfd, once_name);
+ }
+ else
+ /* last resort: fall back on .text */
+ text_sect = bfd_get_section_by_name (abfd, ".text");
+
+ if (text_sect)
+ {
+ /* The IA-64 processor-specific ABI requires setting
+ sh_link to the unwind section, whereas HP-UX requires
+ sh_info to do so. For maximum compatibility, we'll
+ set both for now... */
+ hdr->sh_link = elf_section_data (text_sect)->this_idx;
+ hdr->sh_info = elf_section_data (text_sect)->this_idx;
+ }
+ break;
+ }
+ }
+}
+
+/* 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. */
+
+static boolean
+elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ const Elf_Internal_Sym *sym;
+ const char **namep ATTRIBUTE_UNUSED;
+ flagword *flagsp ATTRIBUTE_UNUSED;
+ asection **secp;
+ bfd_vma *valp;
+{
+ if (sym->st_shndx == SHN_COMMON
+ && !info->relocateable
+ && sym->st_size <= (unsigned) bfd_get_gp_size (abfd))
+ {
+ /* Common symbols less than or equal to -G nn bytes are
+ automatically put into .sbss. */
+
+ asection *scomm = bfd_get_section_by_name (abfd, ".scommon");
+
+ if (scomm == NULL)
+ {
+ scomm = bfd_make_section (abfd, ".scommon");
+ if (scomm == NULL
+ || !bfd_set_section_flags (abfd, scomm, (SEC_ALLOC
+ | SEC_IS_COMMON
+ | SEC_LINKER_CREATED)))
+ return false;
+ }
+
+ *secp = scomm;
+ *valp = sym->st_size;
+ }
+
+ return true;
+}
+
+/* Return the number of additional phdrs we will need. */
+
+static int
+elfNN_ia64_additional_program_headers (abfd)
+ bfd *abfd;
+{
+ asection *s;
+ int ret = 0;
+
+ /* See if we need a PT_IA_64_ARCHEXT segment. */
+ s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext);
+ if (s && (s->flags & SEC_LOAD))
+ ++ret;
+
+ /* Count how many PT_IA_64_UNWIND segments we need. */
+ for (s = abfd->sections; s; s = s->next)
+ if (is_unwind_section_name(s->name) && (s->flags & SEC_LOAD))
+ ++ret;
+
+ return ret;
+}
+
+static boolean
+elfNN_ia64_modify_segment_map (abfd)
+ bfd *abfd;
+{
+ struct elf_segment_map *m, **pm;
+ Elf_Internal_Shdr *hdr;
+ asection *s;
+
+ /* If we need a PT_IA_64_ARCHEXT segment, it must come before
+ all PT_LOAD segments. */
+ s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext);
+ if (s && (s->flags & SEC_LOAD))
+ {
+ for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+ if (m->p_type == PT_IA_64_ARCHEXT)
+ break;
+ if (m == NULL)
+ {
+ m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m);
+ if (m == NULL)
+ return false;
+
+ m->p_type = PT_IA_64_ARCHEXT;
+ m->count = 1;
+ m->sections[0] = s;
+
+ /* We want to put it after the PHDR and INTERP segments. */
+ pm = &elf_tdata (abfd)->segment_map;
+ while (*pm != NULL
+ && ((*pm)->p_type == PT_PHDR
+ || (*pm)->p_type == PT_INTERP))
+ pm = &(*pm)->next;
+
+ m->next = *pm;
+ *pm = m;
+ }
+ }
+
+ /* Install PT_IA_64_UNWIND segments, if needed. */
+ for (s = abfd->sections; s; s = s->next)
+ {
+ hdr = &elf_section_data (s)->this_hdr;
+ if (hdr->sh_type != SHT_IA_64_UNWIND)
+ continue;
+
+ if (s && (s->flags & SEC_LOAD))
+ {
+ for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+ if (m->p_type == PT_IA_64_UNWIND && m->sections[0] == s)
+ break;
+
+ if (m == NULL)
+ {
+ m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m);
+ if (m == NULL)
+ return false;
+
+ m->p_type = PT_IA_64_UNWIND;
+ m->count = 1;
+ m->sections[0] = s;
+ m->next = NULL;
+
+ /* We want to put it last. */
+ pm = &elf_tdata (abfd)->segment_map;
+ while (*pm != NULL)
+ pm = &(*pm)->next;
+ *pm = m;
+ }
+ }
+ }
+
+ /* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of
+ the input sections for each output section in the segment and testing
+ for SHF_IA_64_NORECOV on each. */
+ for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+ if (m->p_type == PT_LOAD)
+ {
+ int i;
+ for (i = m->count - 1; i >= 0; --i)
+ {
+ struct bfd_link_order *order = m->sections[i]->link_order_head;
+ while (order)
+ {
+ if (order->type == bfd_indirect_link_order)
+ {
+ asection *is = order->u.indirect.section;
+ bfd_vma flags = elf_section_data(is)->this_hdr.sh_flags;
+ if (flags & SHF_IA_64_NORECOV)
+ {
+ m->p_flags |= PF_IA_64_NORECOV;
+ goto found;
+ }
+ }
+ order = order->next;
+ }
+ }
+ found:;
+ }
+
+ return true;
+}
+
+/* According to the Tahoe assembler spec, all labels starting with a
+ '.' are local. */
+
+static boolean
+elfNN_ia64_is_local_label_name (abfd, name)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ const char *name;
+{
+ return name[0] == '.';
+}
+
+/* Should we do dynamic things to this symbol? */
+
+static boolean
+elfNN_ia64_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;
+ switch (ELF_ST_VISIBILITY (h->other))
+ {
+ case STV_INTERNAL:
+ case STV_HIDDEN:
+ 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;
+}
+
+static boolean
+elfNN_ia64_local_hash_table_init (ht, abfd, new)
+ struct elfNN_ia64_local_hash_table *ht;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ new_hash_entry_func new;
+{
+ memset (ht, 0, sizeof (*ht));
+ return bfd_hash_table_init (&ht->root, new);
+}
+
+static struct bfd_hash_entry*
+elfNN_ia64_new_loc_hash_entry (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ struct elfNN_ia64_local_hash_entry *ret;
+ ret = (struct elfNN_ia64_local_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (!ret)
+ ret = bfd_hash_allocate (table, sizeof (*ret));
+
+ if (!ret)
+ return 0;
+
+ /* Initialize our local data. All zeros, and definitely easier
+ than setting a handful of bit fields. */
+ memset (ret, 0, sizeof (*ret));
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct elfNN_ia64_local_hash_entry *)
+ bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+static struct bfd_hash_entry*
+elfNN_ia64_new_elf_hash_entry (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ struct elfNN_ia64_link_hash_entry *ret;
+ ret = (struct elfNN_ia64_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (!ret)
+ ret = bfd_hash_allocate (table, sizeof (*ret));
+
+ if (!ret)
+ return 0;
+
+ /* Initialize our local data. All zeros, and definitely easier
+ than setting a handful of bit fields. */
+ memset (ret, 0, sizeof (*ret));
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct elfNN_ia64_link_hash_entry *)
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+static void
+elfNN_ia64_hash_copy_indirect (xdir, xind)
+ struct elf_link_hash_entry *xdir, *xind;
+{
+ struct elfNN_ia64_link_hash_entry *dir, *ind;
+
+ dir = (struct elfNN_ia64_link_hash_entry *)xdir;
+ ind = (struct elfNN_ia64_link_hash_entry *)xind;
+
+ /* Copy down any references that we may have already seen to the
+ symbol which just became indirect. */
+
+ dir->root.elf_link_hash_flags |=
+ (ind->root.elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
+
+ /* Copy over the got and plt data. This would have been done
+ by check_relocs. */
+
+ if (dir->info == NULL)
+ {
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+
+ dir->info = dyn_i = ind->info;
+ ind->info = NULL;
+
+ /* Fix up the dyn_sym_info pointers to the global symbol. */
+ for (; dyn_i; dyn_i = dyn_i->next)
+ dyn_i->h = &dir->root;
+ }
+ BFD_ASSERT (ind->info == NULL);
+
+ /* Copy over the dynindx. */
+
+ if (dir->root.dynindx == -1)
+ {
+ dir->root.dynindx = ind->root.dynindx;
+ dir->root.dynstr_index = ind->root.dynstr_index;
+ ind->root.dynindx = -1;
+ ind->root.dynstr_index = 0;
+ }
+ BFD_ASSERT (ind->root.dynindx == -1);
+}
+
+static void
+elfNN_ia64_hash_hide_symbol (info, xh)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elf_link_hash_entry *xh;
+{
+ struct elfNN_ia64_link_hash_entry *h;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+
+ h = (struct elfNN_ia64_link_hash_entry *)xh;
+
+ h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+ h->root.dynindx = -1;
+
+ for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next)
+ dyn_i->want_plt2 = 0;
+}
+
+/* Create the derived linker hash table. The IA-64 ELF port uses this
+ derived hash table to keep information specific to the IA-64 ElF
+ linker (without using static variables). */
+
+static struct bfd_link_hash_table*
+elfNN_ia64_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct elfNN_ia64_link_hash_table *ret;
+
+ ret = bfd_alloc (abfd, sizeof (*ret));
+ if (!ret)
+ return 0;
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elfNN_ia64_new_elf_hash_entry))
+ {
+ bfd_release (abfd, ret);
+ return 0;
+ }
+
+ if (!elfNN_ia64_local_hash_table_init (&ret->loc_hash_table, abfd,
+ elfNN_ia64_new_loc_hash_entry))
+ return 0;
+ return &ret->root.root;
+}
+
+/* Look up an entry in a Alpha ELF linker hash table. */
+
+static INLINE struct elfNN_ia64_local_hash_entry *
+elfNN_ia64_local_hash_lookup(table, string, create, copy)
+ struct elfNN_ia64_local_hash_table *table;
+ const char *string;
+ boolean create, copy;
+{
+ return ((struct elfNN_ia64_local_hash_entry *)
+ bfd_hash_lookup (&table->root, string, create, copy));
+}
+
+/* Traverse both local and global hash tables. */
+
+struct elfNN_ia64_dyn_sym_traverse_data
+{
+ boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR));
+ PTR data;
+};
+
+static boolean
+elfNN_ia64_global_dyn_sym_thunk (xentry, xdata)
+ struct bfd_hash_entry *xentry;
+ PTR xdata;
+{
+ struct elfNN_ia64_link_hash_entry *entry
+ = (struct elfNN_ia64_link_hash_entry *) xentry;
+ struct elfNN_ia64_dyn_sym_traverse_data *data
+ = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+
+ for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
+ if (! (*data->func) (dyn_i, data->data))
+ return false;
+ return true;
+}
+
+static boolean
+elfNN_ia64_local_dyn_sym_thunk (xentry, xdata)
+ struct bfd_hash_entry *xentry;
+ PTR xdata;
+{
+ struct elfNN_ia64_local_hash_entry *entry
+ = (struct elfNN_ia64_local_hash_entry *) xentry;
+ struct elfNN_ia64_dyn_sym_traverse_data *data
+ = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+
+ for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next)
+ if (! (*data->func) (dyn_i, data->data))
+ return false;
+ return true;
+}
+
+static void
+elfNN_ia64_dyn_sym_traverse (ia64_info, func, data)
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR));
+ PTR data;
+{
+ struct elfNN_ia64_dyn_sym_traverse_data xdata;
+
+ xdata.func = func;
+ xdata.data = data;
+
+ elf_link_hash_traverse (&ia64_info->root,
+ elfNN_ia64_global_dyn_sym_thunk, &xdata);
+ bfd_hash_traverse (&ia64_info->loc_hash_table.root,
+ elfNN_ia64_local_dyn_sym_thunk, &xdata);
+}
+
+static boolean
+elfNN_ia64_create_dynamic_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *s;
+
+ if (! _bfd_elf_create_dynamic_sections (abfd, info))
+ return false;
+
+ ia64_info = elfNN_ia64_hash_table (info);
+
+ ia64_info->plt_sec = bfd_get_section_by_name (abfd, ".plt");
+ ia64_info->got_sec = bfd_get_section_by_name (abfd, ".got");
+
+ {
+ flagword flags = bfd_get_section_flags (abfd, ia64_info->got_sec);
+ bfd_set_section_flags (abfd, ia64_info->got_sec, SEC_SMALL_DATA | flags);
+ }
+
+ if (!get_pltoff (abfd, info, ia64_info))
+ return false;
+
+ s = bfd_make_section(abfd, ".rela.IA_64.pltoff");
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || !bfd_set_section_alignment (abfd, s, 3))
+ return false;
+ ia64_info->rel_pltoff_sec = s;
+
+ s = bfd_make_section(abfd, ".rela.got");
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || !bfd_set_section_alignment (abfd, s, 3))
+ return false;
+ ia64_info->rel_got_sec = s;
+
+ return true;
+}
+
+/* Find and/or create a descriptor for dynamic symbol info. This will
+ vary based on global or local symbol, and the addend to the reloc. */
+
+static struct elfNN_ia64_dyn_sym_info *
+get_dyn_sym_info (ia64_info, h, abfd, rel, create)
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ struct elf_link_hash_entry *h;
+ bfd *abfd;
+ const Elf_Internal_Rela *rel;
+ boolean create;
+{
+ struct elfNN_ia64_dyn_sym_info **pp;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ bfd_vma addend = rel ? rel->r_addend : 0;
+
+ if (h)
+ pp = &((struct elfNN_ia64_link_hash_entry *)h)->info;
+ else
+ {
+ struct elfNN_ia64_local_hash_entry *loc_h;
+ char *addr_name;
+ size_t len;
+
+ /* Construct a string for use in the elfNN_ia64_local_hash_table.
+ The name describes what was once anonymous memory. */
+
+ len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1;
+ len += 10; /* %p slop */
+
+ addr_name = alloca (len);
+ sprintf (addr_name, "%p:%lx", (void *) abfd, ELFNN_R_SYM (rel->r_info));
+
+ /* Collect the canonical entry data for this address. */
+ loc_h = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table,
+ addr_name, create, create);
+ BFD_ASSERT (loc_h);
+
+ pp = &loc_h->info;
+ }
+
+ for (dyn_i = *pp; dyn_i && dyn_i->addend != addend; dyn_i = *pp)
+ pp = &dyn_i->next;
+
+ if (dyn_i == NULL && create)
+ {
+ dyn_i = (struct elfNN_ia64_dyn_sym_info *)
+ bfd_zalloc (abfd, sizeof *dyn_i);
+ *pp = dyn_i;
+ dyn_i->addend = addend;
+ }
+
+ return dyn_i;
+}
+
+static asection *
+get_got (abfd, info, ia64_info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ struct elfNN_ia64_link_hash_table *ia64_info;
+{
+ asection *got;
+ bfd *dynobj;
+
+ got = ia64_info->got_sec;
+ if (!got)
+ {
+ flagword flags;
+
+ dynobj = ia64_info->root.dynobj;
+ if (!dynobj)
+ ia64_info->root.dynobj = dynobj = abfd;
+ if (!_bfd_elf_create_got_section (dynobj, info))
+ return 0;
+
+ got = bfd_get_section_by_name (dynobj, ".got");
+ BFD_ASSERT (got);
+ ia64_info->got_sec = got;
+
+ flags = bfd_get_section_flags (abfd, got);
+ bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags);
+ }
+
+ return got;
+}
+
+/* Create function descriptor section (.opd). This section is called .opd
+ because it contains "official prodecure descriptors". The "official"
+ refers to the fact that these descriptors are used when taking the address
+ of a procedure, thus ensuring a unique address for each procedure. */
+
+static asection *
+get_fptr (abfd, info, ia64_info)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elfNN_ia64_link_hash_table *ia64_info;
+{
+ asection *fptr;
+ bfd *dynobj;
+
+ fptr = ia64_info->fptr_sec;
+ if (!fptr)
+ {
+ dynobj = ia64_info->root.dynobj;
+ if (!dynobj)
+ ia64_info->root.dynobj = dynobj = abfd;
+
+ fptr = bfd_make_section (dynobj, ".opd");
+ if (!fptr
+ || !bfd_set_section_flags (dynobj, fptr,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, fptr, 4))
+ {
+ BFD_ASSERT (0);
+ return NULL;
+ }
+
+ ia64_info->fptr_sec = fptr;
+ }
+
+ return fptr;
+}
+
+static asection *
+get_pltoff (abfd, info, ia64_info)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elfNN_ia64_link_hash_table *ia64_info;
+{
+ asection *pltoff;
+ bfd *dynobj;
+
+ pltoff = ia64_info->pltoff_sec;
+ if (!pltoff)
+ {
+ dynobj = ia64_info->root.dynobj;
+ if (!dynobj)
+ ia64_info->root.dynobj = dynobj = abfd;
+
+ pltoff = bfd_make_section (dynobj, ELF_STRING_ia64_pltoff);
+ if (!pltoff
+ || !bfd_set_section_flags (dynobj, pltoff,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_SMALL_DATA
+ | SEC_LINKER_CREATED))
+ || !bfd_set_section_alignment (abfd, pltoff, 4))
+ {
+ BFD_ASSERT (0);
+ return NULL;
+ }
+
+ ia64_info->pltoff_sec = pltoff;
+ }
+
+ return pltoff;
+}
+
+static asection *
+get_reloc_section (abfd, ia64_info, sec, create)
+ bfd *abfd;
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *sec;
+ boolean create;
+{
+ const char *srel_name;
+ asection *srel;
+ bfd *dynobj;
+
+ srel_name = (bfd_elf_string_from_elf_section
+ (abfd, elf_elfheader(abfd)->e_shstrndx,
+ elf_section_data(sec)->rel_hdr.sh_name));
+ if (srel_name == NULL)
+ return NULL;
+
+ BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ srel_name+5) == 0)
+ || (strncmp (srel_name, ".rel", 4) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ srel_name+4) == 0));
+
+ dynobj = ia64_info->root.dynobj;
+ if (!dynobj)
+ ia64_info->root.dynobj = dynobj = abfd;
+
+ srel = bfd_get_section_by_name (dynobj, srel_name);
+ if (srel == NULL && create)
+ {
+ srel = bfd_make_section (dynobj, srel_name);
+ if (srel == NULL
+ || !bfd_set_section_flags (dynobj, srel,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || !bfd_set_section_alignment (dynobj, srel, 3))
+ return NULL;
+ }
+
+ return srel;
+}
+
+static boolean
+count_dyn_reloc (abfd, dyn_i, srel, type)
+ bfd *abfd;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ asection *srel;
+ int type;
+{
+ struct elfNN_ia64_dyn_reloc_entry *rent;
+
+ for (rent = dyn_i->reloc_entries; rent; rent = rent->next)
+ if (rent->srel == srel && rent->type == type)
+ break;
+
+ if (!rent)
+ {
+ rent = (struct elfNN_ia64_dyn_reloc_entry *)
+ bfd_alloc (abfd, sizeof (*rent));
+ if (!rent)
+ return false;
+
+ rent->next = dyn_i->reloc_entries;
+ rent->srel = srel;
+ rent->type = type;
+ rent->count = 0;
+ dyn_i->reloc_entries = rent;
+ }
+ rent->count++;
+
+ return true;
+}
+
+static boolean
+elfNN_ia64_check_relocs (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ const Elf_Internal_Rela *relend;
+ Elf_Internal_Shdr *symtab_hdr;
+ const Elf_Internal_Rela *rel;
+ asection *got, *fptr, *srel;
+
+ if (info->relocateable)
+ return true;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ ia64_info = elfNN_ia64_hash_table (info);
+
+ got = fptr = srel = NULL;
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; ++rel)
+ {
+ enum {
+ NEED_GOT = 1,
+ NEED_FPTR = 2,
+ NEED_PLTOFF = 4,
+ NEED_MIN_PLT = 8,
+ NEED_FULL_PLT = 16,
+ NEED_DYNREL = 32,
+ NEED_LTOFF_FPTR = 64,
+ };
+
+ struct elf_link_hash_entry *h = NULL;
+ unsigned long r_symndx = ELFNN_R_SYM (rel->r_info);
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ int need_entry;
+ boolean maybe_dynamic;
+ int dynrel_type = R_IA64_NONE;
+
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ /* We're dealing with a global symbol -- find its hash entry
+ and mark it as being referenced. */
+ long indx = r_symndx - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ }
+
+ /* We can only get preliminary data on whether a symbol is
+ locally or externally defined, as not all of the input files
+ have yet been processed. Do something with what we know, as
+ this may help reduce memory usage and processing time later. */
+ maybe_dynamic = false;
+ if (h && ((info->shared && ! info->symbolic)
+ || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
+ || h->root.type == bfd_link_hash_defweak))
+ maybe_dynamic = true;
+
+ need_entry = 0;
+ switch (ELFNN_R_TYPE (rel->r_info))
+ {
+ case R_IA64_TPREL22:
+ case R_IA64_TPREL64MSB:
+ case R_IA64_TPREL64LSB:
+ case R_IA64_LTOFF_TP22:
+ return false;
+
+ case R_IA64_LTOFF_FPTR22:
+ case R_IA64_LTOFF_FPTR64I:
+ case R_IA64_LTOFF_FPTR64MSB:
+ case R_IA64_LTOFF_FPTR64LSB:
+ need_entry = NEED_FPTR | NEED_GOT | NEED_LTOFF_FPTR;
+ break;
+
+ case R_IA64_FPTR64I:
+ case R_IA64_FPTR32MSB:
+ case R_IA64_FPTR32LSB:
+ case R_IA64_FPTR64MSB:
+ case R_IA64_FPTR64LSB:
+ if (info->shared || h)
+ need_entry = NEED_FPTR | NEED_DYNREL;
+ else
+ need_entry = NEED_FPTR;
+ dynrel_type = R_IA64_FPTR64LSB;
+ break;
+
+ case R_IA64_LTOFF22:
+ case R_IA64_LTOFF22X:
+ case R_IA64_LTOFF64I:
+ need_entry = NEED_GOT;
+ break;
+
+ case R_IA64_PLTOFF22:
+ case R_IA64_PLTOFF64I:
+ case R_IA64_PLTOFF64MSB:
+ case R_IA64_PLTOFF64LSB:
+ need_entry = NEED_PLTOFF;
+ if (h)
+ {
+ if (maybe_dynamic)
+ need_entry |= NEED_MIN_PLT;
+ }
+ else
+ {
+ (*info->callbacks->warning)
+ (info, _("@pltoff reloc against local symbol"), 0,
+ abfd, 0, 0);
+ }
+ break;
+
+ case R_IA64_PCREL21B:
+ case R_IA64_PCREL60B:
+ /* Depending on where this symbol is defined, we may or may not
+ need a full plt entry. Only skip if we know we'll not need
+ the entry -- static or symbolic, and the symbol definition
+ has already been seen. */
+ if (maybe_dynamic && rel->r_addend == 0)
+ need_entry = NEED_FULL_PLT;
+ break;
+
+ case R_IA64_IMM14:
+ case R_IA64_IMM22:
+ case R_IA64_IMM64:
+ case R_IA64_DIR32MSB:
+ case R_IA64_DIR32LSB:
+ case R_IA64_DIR64MSB:
+ case R_IA64_DIR64LSB:
+ /* Shared objects will always need at least a REL relocation. */
+ if (info->shared || maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ dynrel_type = R_IA64_DIR64LSB;
+ break;
+
+ case R_IA64_IPLTMSB:
+ case R_IA64_IPLTLSB:
+ /* Shared objects will always need at least a REL relocation. */
+ if (info->shared || maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ dynrel_type = R_IA64_IPLTLSB;
+ break;
+
+ case R_IA64_PCREL22:
+ case R_IA64_PCREL64I:
+ case R_IA64_PCREL32MSB:
+ case R_IA64_PCREL32LSB:
+ case R_IA64_PCREL64MSB:
+ case R_IA64_PCREL64LSB:
+ if (maybe_dynamic)
+ need_entry = NEED_DYNREL;
+ dynrel_type = R_IA64_PCREL64LSB;
+ break;
+ }
+
+ if (!need_entry)
+ continue;
+
+ if ((need_entry & NEED_FPTR) != 0
+ && rel->r_addend)
+ {
+ (*info->callbacks->warning)
+ (info, _("non-zero addend in @fptr reloc"), 0,
+ abfd, 0, 0);
+ }
+
+ dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, true);
+
+ /* Record whether or not this is a local symbol. */
+ dyn_i->h = h;
+
+ /* Create what's needed. */
+ if (need_entry & NEED_GOT)
+ {
+ if (!got)
+ {
+ got = get_got (abfd, info, ia64_info);
+ if (!got)
+ return false;
+ }
+ dyn_i->want_got = 1;
+ }
+ if (need_entry & NEED_FPTR)
+ {
+ if (!fptr)
+ {
+ fptr = get_fptr (abfd, info, ia64_info);
+ if (!fptr)
+ return false;
+ }
+
+ /* FPTRs for shared libraries are allocated by the dynamic
+ linker. Make sure this local symbol will appear in the
+ dynamic symbol table. */
+ if (!h && info->shared)
+ {
+ if (! (_bfd_elfNN_link_record_local_dynamic_symbol
+ (info, abfd, r_symndx)))
+ return false;
+ }
+
+ dyn_i->want_fptr = 1;
+ }
+ if (need_entry & NEED_LTOFF_FPTR)
+ dyn_i->want_ltoff_fptr = 1;
+ if (need_entry & (NEED_MIN_PLT | NEED_FULL_PLT))
+ {
+ if (!ia64_info->root.dynobj)
+ ia64_info->root.dynobj = abfd;
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ dyn_i->want_plt = 1;
+ }
+ if (need_entry & NEED_FULL_PLT)
+ dyn_i->want_plt2 = 1;
+ if (need_entry & NEED_PLTOFF)
+ dyn_i->want_pltoff = 1;
+ if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC))
+ {
+ if (!srel)
+ {
+ srel = get_reloc_section (abfd, ia64_info, sec, true);
+ if (!srel)
+ return false;
+ }
+ if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+struct elfNN_ia64_allocate_data
+{
+ struct bfd_link_info *info;
+ bfd_size_type ofs;
+};
+
+/* For cleanliness, and potentially faster dynamic loading, allocate
+ external GOT entries first. */
+
+static boolean
+allocate_global_data_got (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+
+ if (dyn_i->want_got
+ && ! dyn_i->want_fptr
+ && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info))
+ {
+ dyn_i->got_offset = x->ofs;
+ x->ofs += 8;
+ }
+ return true;
+}
+
+/* Next, allocate all the GOT entries used by LTOFF_FPTR relocs. */
+
+static boolean
+allocate_global_fptr_got (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+
+ if (dyn_i->want_got
+ && dyn_i->want_fptr
+ && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info))
+ {
+ dyn_i->got_offset = x->ofs;
+ x->ofs += 8;
+ }
+ return true;
+}
+
+/* Lastly, allocate all the GOT entries for local data. */
+
+static boolean
+allocate_local_got (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+
+ if (dyn_i->want_got
+ && ! elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info))
+ {
+ dyn_i->got_offset = x->ofs;
+ x->ofs += 8;
+ }
+ return true;
+}
+
+/* Search for the index of a global symbol in it's defining object file. */
+
+static unsigned long
+global_sym_index (h)
+ struct elf_link_hash_entry *h;
+{
+ struct elf_link_hash_entry **p;
+ bfd *obj;
+
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak);
+
+ obj = h->root.u.def.section->owner;
+ for (p = elf_sym_hashes (obj); *p != h; ++p)
+ continue;
+
+ return p - elf_sym_hashes (obj) + elf_tdata (obj)->symtab_hdr.sh_info;
+}
+
+/* Allocate function descriptors. We can do these for every function
+ in a main executable that is not exported. */
+
+static boolean
+allocate_fptr (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+
+ if (dyn_i->want_fptr)
+ {
+ struct elf_link_hash_entry *h = dyn_i->h;
+
+ if (h)
+ 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 (x->info->shared)
+ {
+ if (h && h->dynindx == -1)
+ {
+ BFD_ASSERT ((h->root.type == bfd_link_hash_defined)
+ || (h->root.type == bfd_link_hash_defweak));
+
+ if (!_bfd_elfNN_link_record_local_dynamic_symbol
+ (x->info, h->root.u.def.section->owner,
+ global_sym_index (h)))
+ return false;
+ }
+
+ dyn_i->want_fptr = 0;
+ }
+ else if (h == NULL || h->dynindx == -1)
+ {
+ dyn_i->fptr_offset = x->ofs;
+ x->ofs += 16;
+ }
+ else
+ dyn_i->want_fptr = 0;
+ }
+ return true;
+}
+
+/* Allocate all the minimal PLT entries. */
+
+static boolean
+allocate_plt_entries (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+
+ if (dyn_i->want_plt)
+ {
+ struct elf_link_hash_entry *h = dyn_i->h;
+
+ if (h)
+ 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;
+
+ /* ??? Versioned symbols seem to lose ELF_LINK_HASH_NEEDS_PLT. */
+ if (elfNN_ia64_dynamic_symbol_p (h, x->info))
+ {
+ bfd_size_type offset = x->ofs;
+ if (offset == 0)
+ offset = PLT_HEADER_SIZE;
+ dyn_i->plt_offset = offset;
+ x->ofs = offset + PLT_MIN_ENTRY_SIZE;
+
+ dyn_i->want_pltoff = 1;
+ }
+ else
+ {
+ dyn_i->want_plt = 0;
+ dyn_i->want_plt2 = 0;
+ }
+ }
+ return true;
+}
+
+/* Allocate all the full PLT entries. */
+
+static boolean
+allocate_plt2_entries (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+
+ if (dyn_i->want_plt2)
+ {
+ struct elf_link_hash_entry *h = dyn_i->h;
+ bfd_size_type ofs = x->ofs;
+
+ dyn_i->plt2_offset = ofs;
+ x->ofs = ofs + PLT_FULL_ENTRY_SIZE;
+
+ 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;
+ dyn_i->h->plt.offset = ofs;
+ }
+ return true;
+}
+
+/* Allocate all the PLTOFF entries requested by relocations and
+ plt entries. We can't share space with allocated FPTR entries,
+ because the latter are not necessarily addressable by the GP.
+ ??? Relaxation might be able to determine that they are. */
+
+static boolean
+allocate_pltoff_entries (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+
+ if (dyn_i->want_pltoff)
+ {
+ dyn_i->pltoff_offset = x->ofs;
+ x->ofs += 16;
+ }
+ return true;
+}
+
+/* Allocate dynamic relocations for those symbols that turned out
+ to be dynamic. */
+
+static boolean
+allocate_dynrel_entries (dyn_i, data)
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ PTR data;
+{
+ struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data;
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ struct elfNN_ia64_dyn_reloc_entry *rent;
+ boolean dynamic_symbol, shared;
+
+ ia64_info = elfNN_ia64_hash_table (x->info);
+ dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info);
+ shared = x->info->shared;
+
+ /* Take care of the normal data relocations. */
+
+ for (rent = dyn_i->reloc_entries; rent; rent = rent->next)
+ {
+ int count = rent->count;
+
+ switch (rent->type)
+ {
+ case R_IA64_FPTR64LSB:
+ /* Allocate one iff !want_fptr, which by this point will
+ be true only if we're actually allocating one statically
+ in the main executable. */
+ if (dyn_i->want_fptr)
+ continue;
+ break;
+ case R_IA64_PCREL64LSB:
+ if (!dynamic_symbol)
+ continue;
+ break;
+ case R_IA64_DIR64LSB:
+ if (!dynamic_symbol && !shared)
+ continue;
+ break;
+ case R_IA64_IPLTLSB:
+ if (!dynamic_symbol && !shared)
+ continue;
+ /* Use two REL relocations for IPLT relocations
+ against local symbols. */
+ if (!dynamic_symbol)
+ count *= 2;
+ break;
+ default:
+ abort ();
+ }
+ rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * count;
+ }
+
+ /* Take care of the GOT and PLT relocations. */
+
+ if (((dynamic_symbol || shared) && dyn_i->want_got)
+ || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1))
+ ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
+
+ if (dyn_i->want_pltoff)
+ {
+ bfd_size_type t = 0;
+
+ /* Dynamic symbols get one IPLT relocation. Local symbols in
+ shared libraries get two REL relocations. Local symbols in
+ main applications get nothing. */
+ if (dynamic_symbol)
+ t = sizeof (ElfNN_External_Rela);
+ else if (shared)
+ t = 2 * sizeof (ElfNN_External_Rela);
+
+ ia64_info->rel_pltoff_sec->_raw_size += t;
+ }
+
+ return true;
+}
+
+static boolean
+elfNN_ia64_adjust_dynamic_symbol (info, h)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ struct elf_link_hash_entry *h;
+{
+ /* ??? Undefined symbols with PLT entries should be re-defined
+ to be the PLT entry. */
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->weakdef != NULL)
+ {
+ BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+ || h->weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->weakdef->root.u.def.section;
+ h->root.u.def.value = h->weakdef->root.u.def.value;
+ return true;
+ }
+
+ /* If this is a reference to a symbol defined by a dynamic object which
+ is not a function, we might allocate the symbol in our .dynbss section
+ and allocate a COPY dynamic relocation.
+
+ But IA-64 code is canonically PIC, so as a rule we can avoid this sort
+ of hackery. */
+
+ return true;
+}
+
+static boolean
+elfNN_ia64_size_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ struct elfNN_ia64_allocate_data data;
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *sec;
+ bfd *dynobj;
+ boolean reltext = false;
+ boolean relplt = false;
+
+ dynobj = elf_hash_table(info)->dynobj;
+ ia64_info = elfNN_ia64_hash_table (info);
+ BFD_ASSERT(dynobj != NULL);
+ data.info = info;
+
+ /* Set the contents of the .interp section to the interpreter. */
+ if (ia64_info->root.dynamic_sections_created
+ && !info->shared)
+ {
+ sec = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (sec != NULL);
+ sec->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
+ sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
+ }
+
+ /* Allocate the GOT entries. */
+
+ if (ia64_info->got_sec)
+ {
+ data.ofs = 0;
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data);
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data);
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data);
+ ia64_info->got_sec->_raw_size = data.ofs;
+ }
+
+ /* Allocate the FPTR entries. */
+
+ if (ia64_info->fptr_sec)
+ {
+ data.ofs = 0;
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_fptr, &data);
+ ia64_info->fptr_sec->_raw_size = data.ofs;
+ }
+
+ /* Now that we've seen all of the input files, we can decide which
+ symbols need plt entries. Allocate the minimal PLT entries first.
+ We do this even though dynamic_sections_created may be false, because
+ this has the side-effect of clearing want_plt and want_plt2. */
+
+ data.ofs = 0;
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt_entries, &data);
+
+ ia64_info->minplt_entries = 0;
+ if (data.ofs)
+ {
+ ia64_info->minplt_entries
+ = (data.ofs - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE;
+ }
+
+ /* Align the pointer for the plt2 entries. */
+ data.ofs = (data.ofs + 31) & -32;
+
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt2_entries, &data);
+ if (data.ofs != 0)
+ {
+ BFD_ASSERT (ia64_info->root.dynamic_sections_created);
+
+ ia64_info->plt_sec->_raw_size = data.ofs;
+
+ /* If we've got a .plt, we need some extra memory for the dynamic
+ linker. We stuff these in .got.plt. */
+ sec = bfd_get_section_by_name (dynobj, ".got.plt");
+ sec->_raw_size = 8 * PLT_RESERVED_WORDS;
+ }
+
+ /* Allocate the PLTOFF entries. */
+
+ if (ia64_info->pltoff_sec)
+ {
+ data.ofs = 0;
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_pltoff_entries, &data);
+ ia64_info->pltoff_sec->_raw_size = data.ofs;
+ }
+
+ if (ia64_info->root.dynamic_sections_created)
+ {
+ /* Allocate space for the dynamic relocations that turned out to be
+ required. */
+
+ elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data);
+ }
+
+ /* We have now determined the sizes of the various dynamic sections.
+ Allocate memory for them. */
+ for (sec = dynobj->sections; sec != NULL; sec = sec->next)
+ {
+ boolean strip;
+
+ if (!(sec->flags & SEC_LINKER_CREATED))
+ continue;
+
+ /* If we don't need this section, strip it from the output file.
+ There were several sections primarily related to dynamic
+ linking that must be create before the linker maps input
+ sections to output sections. The linker does that before
+ bfd_elf_size_dynamic_sections is called, and it is that
+ function which decides whether anything needs to go into
+ these sections. */
+
+ strip = (sec->_raw_size == 0);
+
+ if (sec == ia64_info->got_sec)
+ strip = false;
+ else if (sec == ia64_info->rel_got_sec)
+ {
+ if (strip)
+ ia64_info->rel_got_sec = NULL;
+ else
+ /* We use the reloc_count field as a counter if we need to
+ copy relocs into the output file. */
+ sec->reloc_count = 0;
+ }
+ else if (sec == ia64_info->fptr_sec)
+ {
+ if (strip)
+ ia64_info->fptr_sec = NULL;
+ }
+ else if (sec == ia64_info->plt_sec)
+ {
+ if (strip)
+ ia64_info->plt_sec = NULL;
+ }
+ else if (sec == ia64_info->pltoff_sec)
+ {
+ if (strip)
+ ia64_info->pltoff_sec = NULL;
+ }
+ else if (sec == ia64_info->rel_pltoff_sec)
+ {
+ if (strip)
+ ia64_info->rel_pltoff_sec = NULL;
+ else
+ {
+ relplt = true;
+ /* We use the reloc_count field as a counter if we need to
+ copy relocs into the output file. */
+ sec->reloc_count = 0;
+ }
+ }
+ else
+ {
+ const char *name;
+
+ /* It's OK to base decisions on the section name, because none
+ of the dynobj section names depend upon the input files. */
+ name = bfd_get_section_name (dynobj, sec);
+
+ if (strcmp (name, ".got.plt") == 0)
+ strip = false;
+ else if (strncmp (name, ".rel", 4) == 0)
+ {
+ if (!strip)
+ {
+ const char *outname;
+ asection *target;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL entry. */
+ outname = bfd_get_section_name (output_bfd,
+ sec->output_section);
+ if (outname[4] == 'a')
+ outname += 5;
+ else
+ outname += 4;
+
+ target = bfd_get_section_by_name (output_bfd, outname);
+ if (target != NULL
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0)
+ reltext = true;
+
+ /* We use the reloc_count field as a counter if we need to
+ copy relocs into the output file. */
+ sec->reloc_count = 0;
+ }
+ }
+ else
+ continue;
+ }
+
+ if (strip)
+ _bfd_strip_section_from_output (info, sec);
+ else
+ {
+ /* Allocate memory for the section contents. */
+ sec->contents = (bfd_byte *) bfd_zalloc(dynobj, sec->_raw_size);
+ if (sec->contents == NULL && sec->_raw_size != 0)
+ return false;
+ }
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Add some entries to the .dynamic section. We fill in the values
+ later (in finish_dynamic_sections) but we must add the entries now
+ so that we get the correct size for the .dynamic section. */
+
+ if (!info->shared)
+ {
+ /* The DT_DEBUG entry is filled in by the dynamic linker and used
+ by the debugger. */
+ if (!bfd_elfNN_add_dynamic_entry (info, DT_DEBUG, 0))
+ return false;
+ }
+
+ if (! bfd_elfNN_add_dynamic_entry (info, DT_IA_64_PLT_RESERVE, 0))
+ return false;
+ if (! bfd_elfNN_add_dynamic_entry (info, DT_PLTGOT, 0))
+ return false;
+
+ if (relplt)
+ {
+ if (! bfd_elfNN_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+ || ! bfd_elfNN_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+ || ! bfd_elfNN_add_dynamic_entry (info, DT_JMPREL, 0))
+ return false;
+ }
+
+ if (! bfd_elfNN_add_dynamic_entry (info, DT_RELA, 0)
+ || ! bfd_elfNN_add_dynamic_entry (info, DT_RELASZ, 0)
+ || ! bfd_elfNN_add_dynamic_entry (info, DT_RELAENT,
+ sizeof (ElfNN_External_Rela)))
+ return false;
+
+ if (reltext)
+ {
+ if (! bfd_elfNN_add_dynamic_entry (info, DT_TEXTREL, 0))
+ return false;
+ info->flags |= DF_TEXTREL;
+ }
+ }
+
+ /* ??? Perhaps force __gp local. */
+
+ return true;
+}
+
+static bfd_reloc_status_type
+elfNN_ia64_install_value (abfd, hit_addr, val, r_type)
+ bfd *abfd;
+ bfd_byte *hit_addr;
+ bfd_vma val;
+ unsigned int r_type;
+{
+ const struct ia64_operand *op;
+ int bigendian = 0, shift = 0;
+ bfd_vma t0, t1, insn, dword;
+ enum ia64_opnd opnd;
+ const char *err;
+ size_t size = 8;
+
+ opnd = IA64_OPND_NIL;
+ switch (r_type)
+ {
+ case R_IA64_NONE:
+ case R_IA64_LDXMOV:
+ return bfd_reloc_ok;
+
+ /* Instruction relocations. */
+
+ case R_IA64_IMM14: opnd = IA64_OPND_IMM14; break;
+
+ case R_IA64_PCREL21F: opnd = IA64_OPND_TGT25; break;
+ case R_IA64_PCREL21M: opnd = IA64_OPND_TGT25b; break;
+ case R_IA64_PCREL60B: opnd = IA64_OPND_TGT64; break;
+ case R_IA64_PCREL21B:
+ case R_IA64_PCREL21BI:
+ opnd = IA64_OPND_TGT25c;
+ break;
+
+ case R_IA64_IMM22:
+ case R_IA64_GPREL22:
+ case R_IA64_LTOFF22:
+ case R_IA64_LTOFF22X:
+ case R_IA64_PLTOFF22:
+ case R_IA64_PCREL22:
+ case R_IA64_LTOFF_FPTR22:
+ opnd = IA64_OPND_IMM22;
+ break;
+
+ case R_IA64_IMM64:
+ case R_IA64_GPREL64I:
+ case R_IA64_LTOFF64I:
+ case R_IA64_PLTOFF64I:
+ case R_IA64_PCREL64I:
+ case R_IA64_FPTR64I:
+ case R_IA64_LTOFF_FPTR64I:
+ opnd = IA64_OPND_IMMU64;
+ break;
+
+ /* Data relocations. */
+
+ case R_IA64_DIR32MSB:
+ case R_IA64_GPREL32MSB:
+ case R_IA64_FPTR32MSB:
+ case R_IA64_PCREL32MSB:
+ case R_IA64_SEGREL32MSB:
+ case R_IA64_SECREL32MSB:
+ case R_IA64_LTV32MSB:
+ size = 4; bigendian = 1;
+ break;
+
+ case R_IA64_DIR32LSB:
+ case R_IA64_GPREL32LSB:
+ case R_IA64_FPTR32LSB:
+ case R_IA64_PCREL32LSB:
+ case R_IA64_SEGREL32LSB:
+ case R_IA64_SECREL32LSB:
+ case R_IA64_LTV32LSB:
+ size = 4; bigendian = 0;
+ break;
+
+ case R_IA64_DIR64MSB:
+ case R_IA64_GPREL64MSB:
+ case R_IA64_PLTOFF64MSB:
+ case R_IA64_FPTR64MSB:
+ case R_IA64_PCREL64MSB:
+ case R_IA64_LTOFF_FPTR64MSB:
+ case R_IA64_SEGREL64MSB:
+ case R_IA64_SECREL64MSB:
+ case R_IA64_LTV64MSB:
+ size = 8; bigendian = 1;
+ break;
+
+ case R_IA64_DIR64LSB:
+ case R_IA64_GPREL64LSB:
+ case R_IA64_PLTOFF64LSB:
+ case R_IA64_FPTR64LSB:
+ case R_IA64_PCREL64LSB:
+ case R_IA64_LTOFF_FPTR64LSB:
+ case R_IA64_SEGREL64LSB:
+ case R_IA64_SECREL64LSB:
+ case R_IA64_LTV64LSB:
+ size = 8; bigendian = 0;
+ break;
+
+ /* Unsupported / Dynamic relocations. */
+ default:
+ return bfd_reloc_notsupported;
+ }
+
+ switch (opnd)
+ {
+ case IA64_OPND_IMMU64:
+ hit_addr -= (long) hit_addr & 0x3;
+ t0 = bfd_get_64 (abfd, hit_addr);
+ t1 = bfd_get_64 (abfd, hit_addr + 8);
+
+ /* tmpl/s: bits 0.. 5 in t0
+ slot 0: bits 5..45 in t0
+ slot 1: bits 46..63 in t0, bits 0..22 in t1
+ slot 2: bits 23..63 in t1 */
+
+ /* First, clear the bits that form the 64 bit constant. */
+ t0 &= ~(0x3ffffLL << 46);
+ t1 &= ~(0x7fffffLL
+ | (( (0x07fLL << 13) | (0x1ffLL << 27)
+ | (0x01fLL << 22) | (0x001LL << 21)
+ | (0x001LL << 36)) << 23));
+
+ t0 |= ((val >> 22) & 0x03ffffLL) << 46; /* 18 lsbs of imm41 */
+ t1 |= ((val >> 40) & 0x7fffffLL) << 0; /* 23 msbs of imm41 */
+ t1 |= ( (((val >> 0) & 0x07f) << 13) /* imm7b */
+ | (((val >> 7) & 0x1ff) << 27) /* imm9d */
+ | (((val >> 16) & 0x01f) << 22) /* imm5c */
+ | (((val >> 21) & 0x001) << 21) /* ic */
+ | (((val >> 63) & 0x001) << 36)) << 23; /* i */
+
+ bfd_put_64 (abfd, t0, hit_addr);
+ bfd_put_64 (abfd, t1, hit_addr + 8);
+ break;
+
+ case IA64_OPND_TGT64:
+ hit_addr -= (long) hit_addr & 0x3;
+ t0 = bfd_get_64 (abfd, hit_addr);
+ t1 = bfd_get_64 (abfd, hit_addr + 8);
+
+ /* tmpl/s: bits 0.. 5 in t0
+ slot 0: bits 5..45 in t0
+ slot 1: bits 46..63 in t0, bits 0..22 in t1
+ slot 2: bits 23..63 in t1 */
+
+ /* First, clear the bits that form the 64 bit constant. */
+ t0 &= ~(0x3ffffLL << 46);
+ t1 &= ~(0x7fffffLL
+ | ((1LL << 36 | 0xfffffLL << 13) << 23));
+
+ val >>= 4;
+ t0 |= ((val >> 20) & 0xffffLL) << 2 << 46; /* 16 lsbs of imm39 */
+ t1 |= ((val >> 36) & 0x7fffffLL) << 0; /* 23 msbs of imm39 */
+ t1 |= ((((val >> 0) & 0xfffffLL) << 13) /* imm20b */
+ | (((val >> 59) & 0x1LL) << 36)) << 23; /* i */
+
+ bfd_put_64 (abfd, t0, hit_addr);
+ bfd_put_64 (abfd, t1, hit_addr + 8);
+ break;
+
+ default:
+ switch ((long) hit_addr & 0x3)
+ {
+ case 0: shift = 5; break;
+ case 1: shift = 14; hit_addr += 3; break;
+ case 2: shift = 23; hit_addr += 6; break;
+ case 3: return bfd_reloc_notsupported; /* shouldn't happen... */
+ }
+ dword = bfd_get_64 (abfd, hit_addr);
+ insn = (dword >> shift) & 0x1ffffffffffLL;
+
+ op = elf64_ia64_operands + opnd;
+ err = (*op->insert) (op, val, &insn);
+ if (err)
+ return bfd_reloc_overflow;
+
+ dword &= ~(0x1ffffffffffLL << shift);
+ dword |= (insn << shift);
+ bfd_put_64 (abfd, dword, hit_addr);
+ break;
+
+ case IA64_OPND_NIL:
+ /* A data relocation. */
+ if (bigendian)
+ if (size == 4)
+ bfd_putb32 (val, hit_addr);
+ else
+ bfd_putb64 (val, hit_addr);
+ else
+ if (size == 4)
+ bfd_putl32 (val, hit_addr);
+ else
+ bfd_putl64 (val, hit_addr);
+ break;
+ }
+
+ return bfd_reloc_ok;
+}
+
+static void
+elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type,
+ dynindx, addend)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ asection *sec;
+ asection *srel;
+ bfd_vma offset;
+ unsigned int type;
+ long dynindx;
+ bfd_vma addend;
+{
+ Elf_Internal_Rela outrel;
+
+ outrel.r_offset = (sec->output_section->vma
+ + sec->output_offset
+ + offset);
+
+ BFD_ASSERT (dynindx != -1);
+ outrel.r_info = ELFNN_R_INFO (dynindx, type);
+ outrel.r_addend = addend;
+
+ if (elf_section_data (sec)->stab_info != NULL)
+ {
+ /* This may be NULL for linker-generated relocations, as it is
+ inconvenient to pass all the bits around. And this shouldn't
+ happen. */
+ BFD_ASSERT (info != NULL);
+
+ offset = (_bfd_stab_section_offset
+ (abfd, &elf_hash_table (info)->stab_info, sec,
+ &elf_section_data (sec)->stab_info, offset));
+ if (offset == (bfd_vma) -1)
+ {
+ /* Run for the hills. We shouldn't be outputting a relocation
+ for this. So do what everyone else does and output a no-op. */
+ outrel.r_info = ELFNN_R_INFO (0, R_IA64_NONE);
+ outrel.r_addend = 0;
+ offset = 0;
+ }
+ outrel.r_offset = offset;
+ }
+
+ bfd_elfNN_swap_reloca_out (abfd, &outrel,
+ ((ElfNN_External_Rela *) srel->contents
+ + srel->reloc_count++));
+ BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count
+ <= srel->_cooked_size);
+}
+
+/* Store an entry for target address TARGET_ADDR in the linkage table
+ and return the gp-relative address of the linkage table entry. */
+
+static bfd_vma
+set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ long dynindx;
+ bfd_vma addend;
+ bfd_vma value;
+ unsigned int dyn_r_type;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *got_sec;
+
+ ia64_info = elfNN_ia64_hash_table (info);
+ got_sec = ia64_info->got_sec;
+
+ BFD_ASSERT ((dyn_i->got_offset & 7) == 0);
+
+ if (! dyn_i->got_done)
+ {
+ dyn_i->got_done = true;
+
+ /* Store the target address in the linkage table entry. */
+ bfd_put_64 (abfd, value, got_sec->contents + dyn_i->got_offset);
+
+ /* Install a dynamic relocation if needed. */
+ if (info->shared
+ || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info)
+ || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB))
+ {
+ if (dynindx == -1)
+ {
+ dyn_r_type = R_IA64_REL64LSB;
+ dynindx = 0;
+ addend = value;
+ }
+
+ if (bfd_big_endian (abfd))
+ {
+ switch (dyn_r_type)
+ {
+ case R_IA64_REL64LSB:
+ dyn_r_type = R_IA64_REL64MSB;
+ break;
+ case R_IA64_DIR64LSB:
+ dyn_r_type = R_IA64_DIR64MSB;
+ break;
+ case R_IA64_FPTR64LSB:
+ dyn_r_type = R_IA64_FPTR64MSB;
+ break;
+ default:
+ BFD_ASSERT (false);
+ break;
+ }
+ }
+
+ elfNN_ia64_install_dyn_reloc (abfd, NULL, got_sec,
+ ia64_info->rel_got_sec,
+ dyn_i->got_offset, dyn_r_type,
+ dynindx, addend);
+ }
+ }
+
+ /* Return the address of the linkage table entry. */
+ value = (got_sec->output_section->vma
+ + got_sec->output_offset
+ + dyn_i->got_offset);
+
+ return value;
+}
+
+/* Fill in a function descriptor consisting of the function's code
+ address and its global pointer. Return the descriptor's address. */
+
+static bfd_vma
+set_fptr_entry (abfd, info, dyn_i, value)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ bfd_vma value;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *fptr_sec;
+
+ ia64_info = elfNN_ia64_hash_table (info);
+ fptr_sec = ia64_info->fptr_sec;
+
+ if (!dyn_i->fptr_done)
+ {
+ dyn_i->fptr_done = 1;
+
+ /* Fill in the function descriptor. */
+ bfd_put_64 (abfd, value, fptr_sec->contents + dyn_i->fptr_offset);
+ bfd_put_64 (abfd, _bfd_get_gp_value (abfd),
+ fptr_sec->contents + dyn_i->fptr_offset + 8);
+ }
+
+ /* Return the descriptor's address. */
+ value = (fptr_sec->output_section->vma
+ + fptr_sec->output_offset
+ + dyn_i->fptr_offset);
+
+ return value;
+}
+
+/* Fill in a PLTOFF entry consisting of the function's code address
+ and its global pointer. Return the descriptor's address. */
+
+static bfd_vma
+set_pltoff_entry (abfd, info, dyn_i, value, is_plt)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ bfd_vma value;
+ boolean is_plt;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *pltoff_sec;
+
+ ia64_info = elfNN_ia64_hash_table (info);
+ pltoff_sec = ia64_info->pltoff_sec;
+
+ /* Don't do anything if this symbol uses a real PLT entry. In
+ that case, we'll fill this in during finish_dynamic_symbol. */
+ if ((! dyn_i->want_plt || is_plt)
+ && !dyn_i->pltoff_done)
+ {
+ bfd_vma gp = _bfd_get_gp_value (abfd);
+
+ /* Fill in the function descriptor. */
+ bfd_put_64 (abfd, value, pltoff_sec->contents + dyn_i->pltoff_offset);
+ bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8);
+
+ /* Install dynamic relocations if needed. */
+ if (!is_plt && info->shared)
+ {
+ unsigned int dyn_r_type;
+
+ if (bfd_big_endian (abfd))
+ dyn_r_type = R_IA64_REL64MSB;
+ else
+ dyn_r_type = R_IA64_REL64LSB;
+
+ elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec,
+ ia64_info->rel_pltoff_sec,
+ dyn_i->pltoff_offset,
+ dyn_r_type, 0, value);
+ elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec,
+ ia64_info->rel_pltoff_sec,
+ dyn_i->pltoff_offset + 8,
+ dyn_r_type, 0, gp);
+ }
+
+ dyn_i->pltoff_done = 1;
+ }
+
+ /* Return the descriptor's address. */
+ value = (pltoff_sec->output_section->vma
+ + pltoff_sec->output_offset
+ + dyn_i->pltoff_offset);
+
+ return value;
+}
+
+/* Called through qsort to sort the .IA_64.unwind section during a
+ non-relocatable link. Set elfNN_ia64_unwind_entry_compare_bfd
+ to the output bfd so we can do proper endianness frobbing. */
+
+static bfd *elfNN_ia64_unwind_entry_compare_bfd;
+
+static int
+elfNN_ia64_unwind_entry_compare (a, b)
+ PTR a;
+ PTR b;
+{
+ bfd_vma av, bv;
+
+ av = bfd_get_64 (elfNN_ia64_unwind_entry_compare_bfd, a);
+ bv = bfd_get_64 (elfNN_ia64_unwind_entry_compare_bfd, b);
+
+ return (av < bv ? -1 : av > bv ? 1 : 0);
+}
+
+static boolean
+elfNN_ia64_final_link (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ asection *unwind_output_sec;
+
+ ia64_info = elfNN_ia64_hash_table (info);
+
+ /* Make sure we've got ourselves a nice fat __gp value. */
+ if (!info->relocateable)
+ {
+ bfd_vma min_vma = (bfd_vma) -1, max_vma = 0;
+ bfd_vma min_short_vma = min_vma, max_short_vma = 0;
+ struct elf_link_hash_entry *gp;
+ bfd_vma gp_val;
+ asection *os;
+
+ /* Find the min and max vma of all sections marked short. Also
+ collect min and max vma of any type, for use in selecting a
+ nice gp. */
+ for (os = abfd->sections; os ; os = os->next)
+ {
+ bfd_vma lo, hi;
+
+ if ((os->flags & SEC_ALLOC) == 0)
+ continue;
+
+ lo = os->vma;
+ hi = os->vma + os->_raw_size;
+ if (hi < lo)
+ hi = (bfd_vma) -1;
+
+ if (min_vma > lo)
+ min_vma = lo;
+ if (max_vma < hi)
+ max_vma = hi;
+ if (os->flags & SEC_SMALL_DATA)
+ {
+ if (min_short_vma > lo)
+ min_short_vma = lo;
+ if (max_short_vma < hi)
+ max_short_vma = hi;
+ }
+ }
+
+ /* See if the user wants to force a value. */
+ gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", false,
+ false, false);
+
+ if (gp
+ && (gp->root.type == bfd_link_hash_defined
+ || gp->root.type == bfd_link_hash_defweak))
+ {
+ asection *gp_sec = gp->root.u.def.section;
+ gp_val = (gp->root.u.def.value
+ + gp_sec->output_section->vma
+ + gp_sec->output_offset);
+ }
+ else
+ {
+ /* Pick a sensible value. */
+
+ asection *got_sec = ia64_info->got_sec;
+
+ /* Start with just the address of the .got. */
+ if (got_sec)
+ gp_val = got_sec->output_section->vma;
+ else if (max_short_vma != 0)
+ gp_val = min_short_vma;
+ else
+ gp_val = min_vma;
+
+ /* If it is possible to address the entire image, but we
+ don't with the choice above, adjust. */
+ if (max_vma - min_vma < 0x400000
+ && max_vma - gp_val <= 0x200000
+ && gp_val - min_vma > 0x200000)
+ gp_val = min_vma + 0x200000;
+ else if (max_short_vma != 0)
+ {
+ /* If we don't cover all the short data, adjust. */
+ if (max_short_vma - gp_val >= 0x200000)
+ gp_val = min_short_vma + 0x200000;
+
+ /* If we're addressing stuff past the end, adjust back. */
+ if (gp_val > max_vma)
+ gp_val = max_vma - 0x200000 + 8;
+ }
+ }
+
+ /* Validate whether all SHF_IA_64_SHORT sections are within
+ range of the chosen GP. */
+
+ if (max_short_vma != 0)
+ {
+ if (max_short_vma - min_short_vma >= 0x400000)
+ {
+ (*_bfd_error_handler)
+ (_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
+ bfd_get_filename (abfd),
+ (unsigned long) (max_short_vma - min_short_vma));
+ return false;
+ }
+ else if ((gp_val > min_short_vma
+ && gp_val - min_short_vma > 0x200000)
+ || (gp_val < max_short_vma
+ && max_short_vma - gp_val >= 0x200000))
+ {
+ (*_bfd_error_handler)
+ (_("%s: __gp does not cover short data segment"),
+ bfd_get_filename (abfd));
+ return false;
+ }
+ }
+
+ _bfd_set_gp_value (abfd, gp_val);
+
+ if (gp)
+ {
+ gp->root.type = bfd_link_hash_defined;
+ gp->root.u.def.value = gp_val;
+ gp->root.u.def.section = bfd_abs_section_ptr;
+ }
+ }
+
+ /* If we're producing a final executable, we need to sort the contents
+ of the .IA_64.unwind section. Force this section to be relocated
+ into memory rather than written immediately to the output file. */
+ unwind_output_sec = NULL;
+ if (!info->relocateable)
+ {
+ asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
+ if (s)
+ {
+ unwind_output_sec = s->output_section;
+ unwind_output_sec->contents
+ = bfd_malloc (unwind_output_sec->_raw_size);
+ if (unwind_output_sec->contents == NULL)
+ return false;
+ }
+ }
+
+ /* Invoke the regular ELF backend linker to do all the work. */
+ if (!bfd_elfNN_bfd_final_link (abfd, info))
+ return false;
+
+ if (unwind_output_sec)
+ {
+ elfNN_ia64_unwind_entry_compare_bfd = abfd;
+ qsort (unwind_output_sec->contents, unwind_output_sec->_raw_size / 24,
+ 24, elfNN_ia64_unwind_entry_compare);
+
+ if (! bfd_set_section_contents (abfd, unwind_output_sec,
+ unwind_output_sec->contents, 0,
+ unwind_output_sec->_raw_size))
+ return false;
+ }
+
+ return true;
+}
+
+static boolean
+elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ Elf_Internal_Rela *relocs;
+ Elf_Internal_Sym *local_syms;
+ asection **local_sections;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Rela *rel;
+ Elf_Internal_Rela *relend;
+ asection *srel;
+ boolean ret_val = true; /* for non-fatal errors */
+ bfd_vma gp_val;
+
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ ia64_info = elfNN_ia64_hash_table (info);
+
+ /* Infect various flags from the input section to the output section. */
+ if (info->relocateable)
+ {
+ bfd_vma flags;
+
+ flags = elf_section_data(input_section)->this_hdr.sh_flags;
+ flags &= SHF_IA_64_NORECOV;
+
+ elf_section_data(input_section->output_section)
+ ->this_hdr.sh_flags |= flags;
+ }
+
+ gp_val = _bfd_get_gp_value (output_bfd);
+ srel = get_reloc_section (input_bfd, ia64_info, input_section, false);
+
+ rel = relocs;
+ relend = relocs + input_section->reloc_count;
+ for (; rel < relend; ++rel)
+ {
+ struct elf_link_hash_entry *h;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+ bfd_reloc_status_type r;
+ reloc_howto_type *howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym *sym;
+ unsigned int r_type;
+ bfd_vma value;
+ asection *sym_sec;
+ bfd_byte *hit_addr;
+ boolean dynamic_symbol_p;
+ boolean undef_weak_ref;
+
+ r_type = ELFNN_R_TYPE (rel->r_info);
+ if (r_type > R_IA64_MAX_RELOC_CODE)
+ {
+ (*_bfd_error_handler)
+ (_("%s: unknown relocation type %d"),
+ bfd_get_filename (input_bfd), (int)r_type);
+ bfd_set_error (bfd_error_bad_value);
+ ret_val = false;
+ continue;
+ }
+ howto = lookup_howto (r_type);
+ r_symndx = ELFNN_R_SYM (rel->r_info);
+
+ if (info->relocateable)
+ {
+ /* This is a relocateable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sym_sec = local_sections[r_symndx];
+ rel->r_addend += sym_sec->output_offset;
+ }
+ }
+ continue;
+ }
+
+ /* This is a final link. */
+
+ h = NULL;
+ sym = NULL;
+ sym_sec = NULL;
+ undef_weak_ref = false;
+
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ /* Reloc against local symbol. */
+ sym = local_syms + r_symndx;
+ sym_sec = local_sections[r_symndx];
+ value = (sym_sec->output_section->vma
+ + sym_sec->output_offset
+ + sym->st_value);
+ }
+ else
+ {
+ long indx;
+
+ /* Reloc against global symbol. */
+ indx = r_symndx - symtab_hdr->sh_info;
+ h = elf_sym_hashes (input_bfd)[indx];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ value = 0;
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ sym_sec = h->root.u.def.section;
+
+ /* Detect the cases that sym_sec->output_section is
+ expected to be NULL -- all cases in which the symbol
+ is defined in another shared module. This includes
+ PLT relocs for which we've created a PLT entry and
+ other relocs for which we're prepared to create
+ dynamic relocations. */
+ /* ??? Just accept it NULL and continue. */
+
+ if (sym_sec->output_section != NULL)
+ {
+ value = (h->root.u.def.value
+ + sym_sec->output_section->vma
+ + sym_sec->output_offset);
+ }
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ undef_weak_ref = true;
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
+ ;
+ else
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other)))))
+ return false;
+ ret_val = false;
+ continue;
+ }
+ }
+
+ hit_addr = contents + rel->r_offset;
+ value += rel->r_addend;
+ dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info);
+
+ switch (r_type)
+ {
+ case R_IA64_NONE:
+ case R_IA64_LDXMOV:
+ continue;
+
+ case R_IA64_IMM14:
+ case R_IA64_IMM22:
+ case R_IA64_IMM64:
+ case R_IA64_DIR32MSB:
+ case R_IA64_DIR32LSB:
+ case R_IA64_DIR64MSB:
+ case R_IA64_DIR64LSB:
+ /* Install a dynamic relocation for this reloc. */
+ if ((dynamic_symbol_p || info->shared)
+ && (input_section->flags & SEC_ALLOC) != 0)
+ {
+ unsigned int dyn_r_type;
+ long dynindx;
+ bfd_vma addend;
+
+ BFD_ASSERT (srel != NULL);
+
+ /* If we don't need dynamic symbol lookup, find a
+ matching RELATIVE relocation. */
+ dyn_r_type = r_type;
+ if (dynamic_symbol_p)
+ {
+ dynindx = h->dynindx;
+ addend = rel->r_addend;
+ value = 0;
+ }
+ else
+ {
+ switch (r_type)
+ {
+ case R_IA64_DIR32MSB:
+ dyn_r_type = R_IA64_REL32MSB;
+ break;
+ case R_IA64_DIR32LSB:
+ dyn_r_type = R_IA64_REL32LSB;
+ break;
+ case R_IA64_DIR64MSB:
+ dyn_r_type = R_IA64_REL64MSB;
+ break;
+ case R_IA64_DIR64LSB:
+ dyn_r_type = R_IA64_REL64LSB;
+ break;
+
+ default:
+ /* We can't represent this without a dynamic symbol.
+ Adjust the relocation to be against an output
+ section symbol, which are always present in the
+ dynamic symbol table. */
+ /* ??? People shouldn't be doing non-pic code in
+ shared libraries. Hork. */
+ (*_bfd_error_handler)
+ (_("%s: linking non-pic code in a shared library"),
+ bfd_get_filename (input_bfd));
+ ret_val = false;
+ continue;
+ }
+ dynindx = 0;
+ addend = value;
+ }
+
+ elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section,
+ srel, rel->r_offset, dyn_r_type,
+ dynindx, addend);
+ }
+ /* FALLTHRU */
+
+ case R_IA64_LTV32MSB:
+ case R_IA64_LTV32LSB:
+ case R_IA64_LTV64MSB:
+ case R_IA64_LTV64LSB:
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ break;
+
+ case R_IA64_GPREL22:
+ case R_IA64_GPREL64I:
+ case R_IA64_GPREL32MSB:
+ case R_IA64_GPREL32LSB:
+ case R_IA64_GPREL64MSB:
+ case R_IA64_GPREL64LSB:
+ if (dynamic_symbol_p)
+ {
+ (*_bfd_error_handler)
+ (_("%s: @gprel relocation against dynamic symbol %s"),
+ bfd_get_filename (input_bfd), h->root.root.string);
+ ret_val = false;
+ continue;
+ }
+ value -= gp_val;
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ break;
+
+ case R_IA64_LTOFF22:
+ case R_IA64_LTOFF22X:
+ case R_IA64_LTOFF64I:
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false);
+ value = set_got_entry (input_bfd, info, dyn_i, (h ? h->dynindx : -1),
+ rel->r_addend, value, R_IA64_DIR64LSB);
+ value -= gp_val;
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ break;
+
+ case R_IA64_PLTOFF22:
+ case R_IA64_PLTOFF64I:
+ case R_IA64_PLTOFF64MSB:
+ case R_IA64_PLTOFF64LSB:
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false);
+ value = set_pltoff_entry (output_bfd, info, dyn_i, value, false);
+ value -= gp_val;
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ break;
+
+ case R_IA64_FPTR64I:
+ case R_IA64_FPTR32MSB:
+ case R_IA64_FPTR32LSB:
+ case R_IA64_FPTR64MSB:
+ case R_IA64_FPTR64LSB:
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false);
+ if (dyn_i->want_fptr)
+ {
+ if (!undef_weak_ref)
+ value = set_fptr_entry (output_bfd, info, dyn_i, value);
+ }
+ else
+ {
+ long dynindx;
+
+ /* Otherwise, we expect the dynamic linker to create
+ the entry. */
+
+ if (h)
+ {
+ if (h->dynindx != -1)
+ dynindx = h->dynindx;
+ else
+ dynindx = (_bfd_elf_link_lookup_local_dynindx
+ (info, h->root.u.def.section->owner,
+ global_sym_index (h)));
+ }
+ else
+ {
+ dynindx = (_bfd_elf_link_lookup_local_dynindx
+ (info, input_bfd, r_symndx));
+ }
+
+ elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section,
+ srel, rel->r_offset, r_type,
+ dynindx, rel->r_addend);
+ value = 0;
+ }
+
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ break;
+
+ case R_IA64_LTOFF_FPTR22:
+ case R_IA64_LTOFF_FPTR64I:
+ case R_IA64_LTOFF_FPTR64MSB:
+ case R_IA64_LTOFF_FPTR64LSB:
+ {
+ long dynindx;
+
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false);
+ if (dyn_i->want_fptr)
+ {
+ BFD_ASSERT (h == NULL || h->dynindx == -1)
+ if (!undef_weak_ref)
+ value = set_fptr_entry (output_bfd, info, dyn_i, value);
+ dynindx = -1;
+ }
+ else
+ {
+ /* Otherwise, we expect the dynamic linker to create
+ the entry. */
+ if (h)
+ {
+ if (h->dynindx != -1)
+ dynindx = h->dynindx;
+ else
+ dynindx = (_bfd_elf_link_lookup_local_dynindx
+ (info, h->root.u.def.section->owner,
+ global_sym_index (h)));
+ }
+ else
+ dynindx = (_bfd_elf_link_lookup_local_dynindx
+ (info, input_bfd, r_symndx));
+ value = 0;
+ }
+
+ value = set_got_entry (output_bfd, info, dyn_i, dynindx,
+ rel->r_addend, value, R_IA64_FPTR64LSB);
+ value -= gp_val;
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ }
+ break;
+
+ case R_IA64_PCREL32MSB:
+ case R_IA64_PCREL32LSB:
+ case R_IA64_PCREL64MSB:
+ case R_IA64_PCREL64LSB:
+ /* Install a dynamic relocation for this reloc. */
+ if (dynamic_symbol_p)
+ {
+ BFD_ASSERT (srel != NULL);
+
+ elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section,
+ srel, rel->r_offset, r_type,
+ h->dynindx, rel->r_addend);
+ }
+ goto finish_pcrel;
+
+ case R_IA64_PCREL21BI:
+ case R_IA64_PCREL21F:
+ case R_IA64_PCREL21M:
+ /* ??? These two are only used for speculation fixup code.
+ They should never be dynamic. */
+ if (dynamic_symbol_p)
+ {
+ (*_bfd_error_handler)
+ (_("%s: dynamic relocation against speculation fixup"),
+ bfd_get_filename (input_bfd));
+ ret_val = false;
+ continue;
+ }
+ if (undef_weak_ref)
+ {
+ (*_bfd_error_handler)
+ (_("%s: speculation fixup against undefined weak symbol"),
+ bfd_get_filename (input_bfd));
+ ret_val = false;
+ continue;
+ }
+ goto finish_pcrel;
+
+ case R_IA64_PCREL21B:
+ case R_IA64_PCREL60B:
+ /* We should have created a PLT entry for any dynamic symbol. */
+ dyn_i = NULL;
+ if (h)
+ dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
+
+ if (dyn_i && dyn_i->want_plt2)
+ {
+ /* Should have caught this earlier. */
+ BFD_ASSERT (rel->r_addend == 0);
+
+ value = (ia64_info->plt_sec->output_section->vma
+ + ia64_info->plt_sec->output_offset
+ + dyn_i->plt2_offset);
+ }
+ else
+ {
+ /* Since there's no PLT entry, Validate that this is
+ locally defined. */
+ BFD_ASSERT (undef_weak_ref || sym_sec->output_section != NULL);
+
+ /* If the symbol is undef_weak, we shouldn't be trying
+ to call it. There's every chance that we'd wind up
+ with an out-of-range fixup here. Don't bother setting
+ any value at all. */
+ if (undef_weak_ref)
+ continue;
+ }
+ goto finish_pcrel;
+
+ case R_IA64_PCREL22:
+ case R_IA64_PCREL64I:
+ finish_pcrel:
+ /* Make pc-relative. */
+ value -= (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset) & ~ (bfd_vma) 0x3;
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ break;
+
+ case R_IA64_SEGREL32MSB:
+ case R_IA64_SEGREL32LSB:
+ case R_IA64_SEGREL64MSB:
+ case R_IA64_SEGREL64LSB:
+ {
+ struct elf_segment_map *m;
+ Elf_Internal_Phdr *p;
+
+ /* Find the segment that contains the output_section. */
+ for (m = elf_tdata (output_bfd)->segment_map,
+ p = elf_tdata (output_bfd)->phdr;
+ m != NULL;
+ m = m->next, p++)
+ {
+ int i;
+ for (i = m->count - 1; i >= 0; i--)
+ if (m->sections[i] == sym_sec->output_section)
+ break;
+ if (i >= 0)
+ break;
+ }
+
+ if (m == NULL)
+ {
+ /* If the input section was discarded from the output, then
+ do nothing. */
+
+ if (bfd_is_abs_section (sym_sec->output_section))
+ r = bfd_reloc_ok;
+ else
+ r = bfd_reloc_notsupported;
+ }
+ else
+ {
+ /* The VMA of the segment is the vaddr of the associated
+ program header. */
+ if (value > p->p_vaddr)
+ value -= p->p_vaddr;
+ else
+ value = 0;
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value,
+ r_type);
+ }
+ break;
+ }
+
+ case R_IA64_SECREL32MSB:
+ case R_IA64_SECREL32LSB:
+ case R_IA64_SECREL64MSB:
+ case R_IA64_SECREL64LSB:
+ /* Make output-section relative. */
+ if (value > input_section->output_section->vma)
+ value -= input_section->output_section->vma;
+ else
+ value = 0;
+ r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ break;
+
+ case R_IA64_IPLTMSB:
+ case R_IA64_IPLTLSB:
+ /* Install a dynamic relocation for this reloc. */
+ if ((dynamic_symbol_p || info->shared)
+ && (input_section->flags & SEC_ALLOC) != 0)
+ {
+ BFD_ASSERT (srel != NULL);
+
+ /* If we don't need dynamic symbol lookup, install two
+ RELATIVE relocations. */
+ if (! dynamic_symbol_p)
+ {
+ unsigned int dyn_r_type;
+
+ if (r_type == R_IA64_IPLTMSB)
+ dyn_r_type = R_IA64_REL64MSB;
+ else
+ dyn_r_type = R_IA64_REL64LSB;
+
+ elfNN_ia64_install_dyn_reloc (output_bfd, info,
+ input_section,
+ srel, rel->r_offset,
+ dyn_r_type, 0, value);
+ elfNN_ia64_install_dyn_reloc (output_bfd, info,
+ input_section,
+ srel, rel->r_offset + 8,
+ dyn_r_type, 0, gp_val);
+ }
+ else
+ elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section,
+ srel, rel->r_offset, r_type,
+ h->dynindx, rel->r_addend);
+ }
+
+ if (r_type == R_IA64_IPLTMSB)
+ r_type = R_IA64_DIR64MSB;
+ else
+ r_type = R_IA64_DIR64LSB;
+ elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+ r = elfNN_ia64_install_value (output_bfd, hit_addr + 8, gp_val,
+ r_type);
+ break;
+
+ default:
+ r = bfd_reloc_notsupported;
+ break;
+ }
+
+ switch (r)
+ {
+ case bfd_reloc_ok:
+ break;
+
+ case bfd_reloc_undefined:
+ /* This can happen for global table relative relocs if
+ __gp is undefined. This is a panic situation so we
+ don't try to continue. */
+ (*info->callbacks->undefined_symbol)
+ (info, "__gp", input_bfd, input_section, rel->r_offset, 1);
+ return false;
+
+ case bfd_reloc_notsupported:
+ {
+ const char *name;
+
+ if (h)
+ name = h->root.root.string;
+ else
+ {
+ name = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym->st_name);
+ if (name == NULL)
+ return false;
+ if (*name == '\0')
+ name = bfd_section_name (input_bfd, input_section);
+ }
+ if (!(*info->callbacks->warning) (info, _("unsupported reloc"),
+ name, input_bfd,
+ input_section, rel->r_offset))
+ return false;
+ ret_val = false;
+ }
+ break;
+
+ case bfd_reloc_dangerous:
+ case bfd_reloc_outofrange:
+ case bfd_reloc_overflow:
+ default:
+ {
+ const char *name;
+
+ if (h)
+ name = h->root.root.string;
+ else
+ {
+ name = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym->st_name);
+ if (name == NULL)
+ return false;
+ if (*name == '\0')
+ name = bfd_section_name (input_bfd, input_section);
+ }
+ if (!(*info->callbacks->reloc_overflow) (info, name,
+ howto->name, 0,
+ input_bfd,
+ input_section,
+ rel->r_offset))
+ return false;
+ ret_val = false;
+ }
+ break;
+ }
+ }
+
+ return ret_val;
+}
+
+static boolean
+elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ struct elfNN_ia64_dyn_sym_info *dyn_i;
+
+ ia64_info = elfNN_ia64_hash_table (info);
+ dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
+
+ /* Fill in the PLT data, if required. */
+ if (dyn_i && dyn_i->want_plt)
+ {
+ Elf_Internal_Rela outrel;
+ bfd_byte *loc;
+ asection *plt_sec;
+ bfd_vma plt_addr, pltoff_addr, gp_val, index;
+ ElfNN_External_Rela *rel;
+
+ gp_val = _bfd_get_gp_value (output_bfd);
+
+ /* Initialize the minimal PLT entry. */
+
+ index = (dyn_i->plt_offset - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE;
+ plt_sec = ia64_info->plt_sec;
+ loc = plt_sec->contents + dyn_i->plt_offset;
+
+ memcpy (loc, plt_min_entry, PLT_MIN_ENTRY_SIZE);
+ elfNN_ia64_install_value (output_bfd, loc, index, R_IA64_IMM22);
+ elfNN_ia64_install_value (output_bfd, loc+2, -dyn_i->plt_offset,
+ R_IA64_PCREL21B);
+
+ plt_addr = (plt_sec->output_section->vma
+ + plt_sec->output_offset
+ + dyn_i->plt_offset);
+ pltoff_addr = set_pltoff_entry (output_bfd, info, dyn_i, plt_addr, true);
+
+ /* Initialize the FULL PLT entry, if needed. */
+ if (dyn_i->want_plt2)
+ {
+ loc = plt_sec->contents + dyn_i->plt2_offset;
+
+ memcpy (loc, plt_full_entry, PLT_FULL_ENTRY_SIZE);
+ elfNN_ia64_install_value (output_bfd, loc, pltoff_addr - gp_val,
+ R_IA64_IMM22);
+
+ /* Mark the symbol as undefined, rather than as defined in the
+ plt section. Leave the value alone. */
+ /* ??? We didn't redefine it in adjust_dynamic_symbol in the
+ first place. But perhaps elflink.h did some for us. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ sym->st_shndx = SHN_UNDEF;
+ }
+
+ /* Create the dynamic relocation. */
+ outrel.r_offset = pltoff_addr;
+ if (bfd_little_endian (output_bfd))
+ outrel.r_info = ELFNN_R_INFO (h->dynindx, R_IA64_IPLTLSB);
+ else
+ outrel.r_info = ELFNN_R_INFO (h->dynindx, R_IA64_IPLTMSB);
+ outrel.r_addend = 0;
+
+ /* This is fun. In the .IA_64.pltoff section, we've got entries
+ that correspond both to real PLT entries, and those that
+ happened to resolve to local symbols but need to be created
+ to satisfy @pltoff relocations. The .rela.IA_64.pltoff
+ relocations for the real PLT should come at the end of the
+ section, so that they can be indexed by plt entry at runtime.
+
+ We emitted all of the relocations for the non-PLT @pltoff
+ entries during relocate_section. So we can consider the
+ existing sec->reloc_count to be the base of the array of
+ PLT relocations. */
+
+ rel = (ElfNN_External_Rela *)ia64_info->rel_pltoff_sec->contents;
+ rel += ia64_info->rel_pltoff_sec->reloc_count;
+
+ bfd_elfNN_swap_reloca_out (output_bfd, &outrel, rel + index);
+ }
+
+ /* Mark some specially defined symbols as absolute. */
+ if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
+ || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+ sym->st_shndx = SHN_ABS;
+
+ return true;
+}
+
+static boolean
+elfNN_ia64_finish_dynamic_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ struct elfNN_ia64_link_hash_table *ia64_info;
+ bfd *dynobj;
+
+ ia64_info = elfNN_ia64_hash_table (info);
+ dynobj = ia64_info->root.dynobj;
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ ElfNN_External_Dyn *dyncon, *dynconend;
+ asection *sdyn, *sgotplt;
+ bfd_vma gp_val;
+
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+ sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
+ BFD_ASSERT (sdyn != NULL);
+ dyncon = (ElfNN_External_Dyn *) sdyn->contents;
+ dynconend = (ElfNN_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+
+ gp_val = _bfd_get_gp_value (abfd);
+
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+
+ bfd_elfNN_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ case DT_PLTGOT:
+ dyn.d_un.d_ptr = gp_val;
+ break;
+
+ case DT_PLTRELSZ:
+ dyn.d_un.d_val = (ia64_info->minplt_entries
+ * sizeof (ElfNN_External_Rela));
+ break;
+
+ case DT_JMPREL:
+ /* See the comment above in finish_dynamic_symbol. */
+ dyn.d_un.d_ptr = (ia64_info->rel_pltoff_sec->output_section->vma
+ + ia64_info->rel_pltoff_sec->output_offset
+ + (ia64_info->rel_pltoff_sec->reloc_count
+ * sizeof (ElfNN_External_Rela)));
+ break;
+
+ case DT_IA_64_PLT_RESERVE:
+ dyn.d_un.d_ptr = (sgotplt->output_section->vma
+ + sgotplt->output_offset);
+ break;
+
+ case DT_RELASZ:
+ /* Do not have RELASZ include JMPREL. This makes things
+ easier on ld.so. This is not what the rest of BFD set up. */
+ dyn.d_un.d_val -= (ia64_info->minplt_entries
+ * sizeof (ElfNN_External_Rela));
+ break;
+ }
+
+ bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon);
+ }
+
+ /* Initialize the PLT0 entry */
+ if (ia64_info->plt_sec)
+ {
+ bfd_byte *loc = ia64_info->plt_sec->contents;
+ bfd_vma pltres;
+
+ memcpy (loc, plt_header, PLT_HEADER_SIZE);
+
+ pltres = (sgotplt->output_section->vma
+ + sgotplt->output_offset
+ - gp_val);
+
+ elfNN_ia64_install_value (abfd, loc+1, pltres, R_IA64_GPREL22);
+ }
+ }
+
+ return true;
+}
+
+/* ELF file flag handling: */
+
+/* Function to keep IA-64 specific file flags. */
+static boolean
+elfNN_ia64_set_private_flags (abfd, flags)
+ bfd *abfd;
+ flagword flags;
+{
+ BFD_ASSERT (!elf_flags_init (abfd)
+ || elf_elfheader (abfd)->e_flags == flags);
+
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = true;
+ return true;
+}
+
+/* Copy backend specific data from one object module to another */
+static boolean
+elfNN_ia64_copy_private_bfd_data (ibfd, obfd)
+ bfd *ibfd, *obfd;
+{
+ if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ BFD_ASSERT (!elf_flags_init (obfd)
+ || (elf_elfheader (obfd)->e_flags
+ == elf_elfheader (ibfd)->e_flags));
+
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+ elf_flags_init (obfd) = true;
+ return true;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+static boolean
+elfNN_ia64_merge_private_bfd_data (ibfd, obfd)
+ bfd *ibfd, *obfd;
+{
+ flagword out_flags;
+ flagword in_flags;
+ boolean ok = true;
+
+ /* Don't even pretend to support mixed-format linking. */
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return false;
+
+ in_flags = elf_elfheader (ibfd)->e_flags;
+ out_flags = elf_elfheader (obfd)->e_flags;
+
+ if (! elf_flags_init (obfd))
+ {
+ elf_flags_init (obfd) = true;
+ elf_elfheader (obfd)->e_flags = in_flags;
+
+ if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
+ && bfd_get_arch_info (obfd)->the_default)
+ {
+ return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
+ bfd_get_mach (ibfd));
+ }
+
+ return true;
+ }
+
+ /* Check flag compatibility. */
+ if (in_flags == out_flags)
+ return true;
+
+ /* Output has EF_IA_64_REDUCEDFP set only if all inputs have it set. */
+ if (!(in_flags & EF_IA_64_REDUCEDFP) && (out_flags & EF_IA_64_REDUCEDFP))
+ elf_elfheader (obfd)->e_flags &= ~EF_IA_64_REDUCEDFP;
+
+ if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL))
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking trap-on-NULL-dereference with non-trapping files"),
+ bfd_get_filename (ibfd));
+
+ bfd_set_error (bfd_error_bad_value);
+ ok = false;
+ }
+ if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE))
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking big-endian files with little-endian files"),
+ bfd_get_filename (ibfd));
+
+ bfd_set_error (bfd_error_bad_value);
+ ok = false;
+ }
+ if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64))
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking 64-bit files with 32-bit files"),
+ bfd_get_filename (ibfd));
+
+ bfd_set_error (bfd_error_bad_value);
+ ok = false;
+ }
+ if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP))
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking constant-gp files with non-constant-gp files"),
+ bfd_get_filename (ibfd));
+
+ bfd_set_error (bfd_error_bad_value);
+ ok = false;
+ }
+ if ((in_flags & EF_IA_64_NOFUNCDESC_CONS_GP)
+ != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP))
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking auto-pic files with non-auto-pic files"),
+ bfd_get_filename (ibfd));
+
+ bfd_set_error (bfd_error_bad_value);
+ ok = false;
+ }
+
+ return ok;
+}
+
+static boolean
+elfNN_ia64_print_private_bfd_data (abfd, ptr)
+ bfd *abfd;
+ PTR ptr;
+{
+ FILE *file = (FILE *) ptr;
+ flagword flags = elf_elfheader (abfd)->e_flags;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+ fprintf (file, "private flags = %s%s%s%s%s%s%s%s\n",
+ (flags & EF_IA_64_TRAPNIL) ? "TRAPNIL, " : "",
+ (flags & EF_IA_64_EXT) ? "EXT, " : "",
+ (flags & EF_IA_64_BE) ? "BE, " : "LE, ",
+ (flags & EF_IA_64_REDUCEDFP) ? "REDUCEDFP, " : "",
+ (flags & EF_IA_64_CONS_GP) ? "CONS_GP, " : "",
+ (flags & EF_IA_64_NOFUNCDESC_CONS_GP) ? "NOFUNCDESC_CONS_GP, " : "",
+ (flags & EF_IA_64_ABSOLUTE) ? "ABSOLUTE, " : "",
+ (flags & EF_IA_64_ABI64) ? "ABI64" : "ABI32");
+
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+ return true;
+}
+
+#define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec
+#define TARGET_LITTLE_NAME "elfNN-ia64-little"
+#define TARGET_BIG_SYM bfd_elfNN_ia64_big_vec
+#define TARGET_BIG_NAME "elfNN-ia64-big"
+#define ELF_ARCH bfd_arch_ia64
+#define ELF_MACHINE_CODE EM_IA_64
+#define ELF_MACHINE_ALT1 1999 /* EAS2.3 */
+#define ELF_MACHINE_ALT2 1998 /* EAS2.2 */
+#define ELF_MAXPAGESIZE 0x10000 /* 64KB */
+
+#define elf_backend_section_from_shdr \
+ elfNN_ia64_section_from_shdr
+#define elf_backend_section_flags \
+ elfNN_ia64_section_flags
+#define elf_backend_fake_sections \
+ elfNN_ia64_fake_sections
+#define elf_backend_final_write_processing \
+ elfNN_ia64_final_write_processing
+#define elf_backend_add_symbol_hook \
+ elfNN_ia64_add_symbol_hook
+#define elf_backend_additional_program_headers \
+ elfNN_ia64_additional_program_headers
+#define elf_backend_modify_segment_map \
+ elfNN_ia64_modify_segment_map
+#define elf_info_to_howto \
+ elfNN_ia64_info_to_howto
+
+#define bfd_elfNN_bfd_reloc_type_lookup \
+ elfNN_ia64_reloc_type_lookup
+#define bfd_elfNN_bfd_is_local_label_name \
+ elfNN_ia64_is_local_label_name
+#define bfd_elfNN_bfd_relax_section \
+ elfNN_ia64_relax_section
+
+/* Stuff for the BFD linker: */
+#define bfd_elfNN_bfd_link_hash_table_create \
+ elfNN_ia64_hash_table_create
+#define elf_backend_create_dynamic_sections \
+ elfNN_ia64_create_dynamic_sections
+#define elf_backend_check_relocs \
+ elfNN_ia64_check_relocs
+#define elf_backend_adjust_dynamic_symbol \
+ elfNN_ia64_adjust_dynamic_symbol
+#define elf_backend_size_dynamic_sections \
+ elfNN_ia64_size_dynamic_sections
+#define elf_backend_relocate_section \
+ elfNN_ia64_relocate_section
+#define elf_backend_finish_dynamic_symbol \
+ elfNN_ia64_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections \
+ elfNN_ia64_finish_dynamic_sections
+#define bfd_elfNN_bfd_final_link \
+ elfNN_ia64_final_link
+
+#define bfd_elfNN_bfd_copy_private_bfd_data \
+ elfNN_ia64_copy_private_bfd_data
+#define bfd_elfNN_bfd_merge_private_bfd_data \
+ elfNN_ia64_merge_private_bfd_data
+#define bfd_elfNN_bfd_set_private_flags \
+ elfNN_ia64_set_private_flags
+#define bfd_elfNN_bfd_print_private_bfd_data \
+ elfNN_ia64_print_private_bfd_data
+
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_plt_alignment 5
+#define elf_backend_got_header_size 0
+#define elf_backend_plt_header_size PLT_HEADER_SIZE
+#define elf_backend_want_got_plt 1
+#define elf_backend_may_use_rel_p 1
+#define elf_backend_may_use_rela_p 1
+#define elf_backend_default_use_rela_p 1
+#define elf_backend_want_dynbss 0
+#define elf_backend_copy_indirect_symbol elfNN_ia64_hash_copy_indirect
+#define elf_backend_hide_symbol elfNN_ia64_hash_hide_symbol
+
+#include "elfNN-target.h"
diff --git a/gnu/usr.bin/binutils/bfd/epoc-pe-arm.c b/gnu/usr.bin/binutils/bfd/epoc-pe-arm.c
index 48a277a9dca..a6e0f8da544 100644
--- a/gnu/usr.bin/binutils/bfd/epoc-pe-arm.c
+++ b/gnu/usr.bin/binutils/bfd/epoc-pe-arm.c
@@ -1,5 +1,5 @@
/* BFD back-end for ARM EPOC PE files.
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -32,5 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define bfd_arm_process_before_allocation \
bfd_arm_epoc_pe_process_before_allocation
-#include "pe-arm.c"
+#define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_CODE | SEC_READONLY | SEC_DATA)
+#include "pe-arm.c"
diff --git a/gnu/usr.bin/binutils/bfd/epoc-pei-arm.c b/gnu/usr.bin/binutils/bfd/epoc-pei-arm.c
index 0f2548d3809..fb286efd8ff 100644
--- a/gnu/usr.bin/binutils/bfd/epoc-pei-arm.c
+++ b/gnu/usr.bin/binutils/bfd/epoc-pei-arm.c
@@ -1,5 +1,5 @@
/* BFD back-end for ARM EPOC PE IMAGE COFF files.
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -25,5 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_BIG_SYM arm_epoc_pei_big_vec
#define TARGET_BIG_NAME "epoc-pei-arm-big"
-#include "pei-arm.c"
+#define EXTRA_S_FLAGS (SEC_CODE | SEC_READONLY | SEC_DATA)
+#include "pei-arm.c"
diff --git a/gnu/usr.bin/binutils/bfd/go32stub.h b/gnu/usr.bin/binutils/bfd/go32stub.h
index 3e4388c087b..333eec068be 100644
--- a/gnu/usr.bin/binutils/bfd/go32stub.h
+++ b/gnu/usr.bin/binutils/bfd/go32stub.h
@@ -1,128 +1,128 @@
0x4d,0x5a,0x00,0x00,0x04,0x00,0x00,0x00,0x20,0x00,0x27,0x00,0xff,0xff,0x00,0x00,
-0x60,0x07,0x00,0x00,0x54,0x00,0x00,0x00,0x0d,0x0a,0x73,0x74,0x75,0x62,0x2e,0x68,
-0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x20,0x66,0x72,0x6f,0x6d,0x20,
-0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x79,0x20,0x64,0x6a,0x61,0x73,
-0x6d,0x2c,0x20,0x6f,0x6e,0x20,0x57,0x65,0x64,0x20,0x4a,0x75,0x6e,0x20,0x31,0x31,
-0x20,0x31,0x36,0x3a,0x30,0x39,0x3a,0x31,0x35,0x20,0x31,0x39,0x39,0x37,0x0d,0x0a,
-0x54,0x68,0x65,0x20,0x53,0x54,0x55,0x42,0x2e,0x45,0x58,0x45,0x20,0x73,0x74,0x75,
-0x62,0x20,0x6c,0x6f,0x61,0x64,0x65,0x72,0x20,0x69,0x73,0x20,0x43,0x6f,0x70,0x79,
-0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x31,0x39,0x39,0x33,0x2d,0x31,
-0x39,0x39,0x35,0x20,0x44,0x4a,0x20,0x44,0x65,0x6c,0x6f,0x72,0x69,0x65,0x2e,0x20,
-0x0d,0x0a,0x50,0x65,0x72,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,0x20,0x67,0x72,0x61,
-0x6e,0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x75,0x73,0x65,0x20,0x66,0x6f,0x72,0x20,
-0x61,0x6e,0x79,0x20,0x70,0x75,0x72,0x70,0x6f,0x73,0x65,0x20,0x70,0x72,0x6f,0x76,
-0x69,0x64,0x65,0x64,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x6f,0x70,0x79,0x72,0x69,
-0x67,0x68,0x74,0x20,0x0d,0x0a,0x72,0x65,0x6d,0x61,0x69,0x6e,0x73,0x20,0x70,0x72,
-0x65,0x73,0x65,0x6e,0x74,0x20,0x61,0x6e,0x64,0x20,0x75,0x6e,0x6d,0x6f,0x64,0x69,
-0x66,0x69,0x65,0x64,0x2e,0x20,0x0d,0x0a,0x54,0x68,0x69,0x73,0x20,0x6f,0x6e,0x6c,
-0x79,0x20,0x61,0x70,0x70,0x6c,0x69,0x65,0x73,0x20,0x74,0x6f,0x20,0x74,0x68,0x65,
-0x20,0x73,0x74,0x75,0x62,0x2c,0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20,0x6e,
-0x65,0x63,0x63,0x65,0x73,0x73,0x61,0x72,0x69,0x6c,0x79,0x20,0x74,0x68,0x65,0x20,
-0x77,0x68,0x6f,0x6c,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x2e,0x0a,0x0d,
-0x0a,0x24,0x49,0x64,0x3a,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,
-0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x31,0x31,0x2f,0x39,0x37,0x20,0x31,0x36,
-0x3a,0x30,0x39,0x3a,0x31,0x35,0x20,0x62,0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x20,
-0x24,0x0a,0x0d,0x0a,0x40,0x28,0x23,0x29,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,
-0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x31,0x31,0x2f,0x39,0x37,
-0x20,0x31,0x36,0x3a,0x30,0x39,0x3a,0x31,0x35,0x20,0x62,0x79,0x20,0x64,0x6a,0x61,
-0x73,0x6d,0x0a,0x0d,0x0a,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x60,0x07,0x00,0x00,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x0a,0x73,0x74,
+0x75,0x62,0x2e,0x68,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x20,0x66,
+0x72,0x6f,0x6d,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x79,0x20,
+0x64,0x6a,0x61,0x73,0x6d,0x2c,0x20,0x6f,0x6e,0x20,0x57,0x65,0x64,0x20,0x4a,0x75,
+0x6e,0x20,0x32,0x38,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x32,0x30,
+0x30,0x30,0x0d,0x0a,0x54,0x68,0x65,0x20,0x53,0x54,0x55,0x42,0x2e,0x45,0x58,0x45,
+0x20,0x73,0x74,0x75,0x62,0x20,0x6c,0x6f,0x61,0x64,0x65,0x72,0x20,0x69,0x73,0x20,
+0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x31,0x39,
+0x39,0x33,0x2d,0x31,0x39,0x39,0x35,0x20,0x44,0x4a,0x20,0x44,0x65,0x6c,0x6f,0x72,
+0x69,0x65,0x2e,0x20,0x0d,0x0a,0x50,0x65,0x72,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,
+0x20,0x67,0x72,0x61,0x6e,0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x75,0x73,0x65,0x20,
+0x66,0x6f,0x72,0x20,0x61,0x6e,0x79,0x20,0x70,0x75,0x72,0x70,0x6f,0x73,0x65,0x20,
+0x70,0x72,0x6f,0x76,0x69,0x64,0x65,0x64,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x6f,
+0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x0d,0x0a,0x72,0x65,0x6d,0x61,0x69,0x6e,
+0x73,0x20,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x20,0x61,0x6e,0x64,0x20,0x75,0x6e,
+0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,0x64,0x2e,0x20,0x0d,0x0a,0x54,0x68,0x69,0x73,
+0x20,0x6f,0x6e,0x6c,0x79,0x20,0x61,0x70,0x70,0x6c,0x69,0x65,0x73,0x20,0x74,0x6f,
+0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x75,0x62,0x2c,0x20,0x61,0x6e,0x64,0x20,0x6e,
+0x6f,0x74,0x20,0x6e,0x65,0x63,0x65,0x73,0x73,0x61,0x72,0x69,0x6c,0x79,0x20,0x74,
+0x68,0x65,0x20,0x77,0x68,0x6f,0x6c,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,
+0x2e,0x0a,0x0d,0x0a,0x24,0x49,0x64,0x3a,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,
+0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x32,0x38,0x2f,0x31,0x30,
+0x30,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x62,0x79,0x20,0x64,0x6a,
+0x61,0x73,0x6d,0x20,0x24,0x0a,0x0d,0x0a,0x40,0x28,0x23,0x29,0x20,0x73,0x74,0x75,
+0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x32,
+0x38,0x2f,0x31,0x30,0x30,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x62,
+0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x0a,0x0d,0x0a,0x1a,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x67,0x6f,0x33,0x32,0x73,0x74,0x75,0x62,0x2c,0x20,0x76,0x20,0x32,0x2e,0x30,0x30,
-0x54,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x67,0x6f,0x33,0x32,0x73,0x74,0x75,0x62,0x2c,0x20,0x76,0x20,0x32,0x2e,0x30,0x32,
+0x54,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x43,0x57,0x53,0x44,0x50,0x4d,0x49,0x2e,0x45,0x58,0x45,0x00,
0x00,0x00,0x00,0x00,0x0e,0x1f,0x8c,0x1e,0x24,0x00,0x8c,0x06,0x60,0x07,0xfc,0xb4,
-0x30,0xcd,0x21,0x3c,0x03,0x73,0x06,0xba,0x86,0x05,0xe9,0xb2,0x03,0xa2,0x69,0x08,
-0xbb,0x70,0x08,0xa1,0x20,0x00,0x39,0xc3,0x73,0x02,0x89,0xc3,0x89,0x1e,0x20,0x00,
-0xfe,0xc7,0xb9,0x04,0xff,0xd3,0xeb,0xb4,0x4a,0xcd,0x21,0x73,0x0a,0xd3,0xe3,0xfe,
-0xcf,0x89,0x1e,0x20,0x00,0xeb,0xd9,0x26,0x8e,0x06,0x2c,0x00,0x31,0xff,0x30,0xc0,
-0xa9,0xf2,0xae,0x26,0x81,0x3d,0x50,0x41,0x75,0x15,0xaf,0x26,0x81,0x3d,0x54,0x48,
-0x75,0x0d,0xaf,0x26,0x80,0x3d,0x3d,0x75,0x06,0x47,0x89,0x3e,0x67,0x04,0x4f,0xae,
-0x75,0xdf,0xaf,0x06,0x57,0x31,0xc9,0x74,0x10,0xba,0x5d,0x05,0xe9,0x50,0x03,0x09,
-0xc9,0x75,0xf6,0x41,0xe8,0x92,0x03,0x72,0xf0,0xb8,0x87,0x16,0xcd,0x2f,0x09,0xc0,
-0x75,0xed,0x80,0xe3,0x01,0x74,0xe8,0x89,0x3e,0x00,0x06,0x8c,0x06,0x02,0x06,0x89,
-0x36,0x04,0x06,0x5f,0x07,0xe8,0xd5,0x02,0x89,0x3e,0x2a,0x00,0x89,0x36,0x62,0x07,
-0x80,0x3e,0x2c,0x00,0x00,0x74,0x24,0xb9,0x08,0x00,0xbf,0x2c,0x00,0x8a,0x05,0x47,
-0x08,0xc0,0x74,0x05,0x88,0x07,0x43,0xe2,0xf4,0x66,0xc7,0x07,0x2e,0x45,0x58,0x45,
-0x81,0xc3,0x04,0x00,0xc6,0x07,0x00,0x89,0x1e,0x62,0x07,0xb8,0x00,0x3d,0xba,0x64,
-0x07,0xcd,0x21,0x0f,0x82,0xb4,0x02,0xa3,0x06,0x06,0x89,0xc3,0xb9,0x06,0x00,0xba,
-0xb5,0x07,0xb4,0x3f,0xcd,0x21,0x31,0xd2,0x31,0xc9,0xa1,0xb5,0x07,0x3d,0x4c,0x01,
-0x74,0x1b,0x3d,0x4d,0x5a,0x0f,0x85,0x97,0x02,0x8b,0x16,0xb9,0x07,0xc1,0xe2,0x09,
-0x8b,0x1e,0xb7,0x07,0x09,0xdb,0x74,0x05,0x80,0xee,0x02,0x01,0xda,0x89,0x16,0xbb,
-0x07,0x89,0x0e,0xbd,0x07,0xb8,0x00,0x42,0x8b,0x1e,0x06,0x06,0xcd,0x21,0xb9,0xa8,
-0x00,0xba,0xbf,0x07,0xb4,0x3f,0xcd,0x21,0x3d,0xa8,0x00,0x75,0x06,0x81,0x3e,0xbf,
-0x07,0x4c,0x01,0x0f,0x85,0x5e,0x02,0x66,0xa1,0xe3,0x07,0x66,0xa3,0x10,0x06,0x66,
-0x8b,0x0e,0xbb,0x07,0x66,0xa1,0x03,0x08,0x66,0x01,0xc8,0x66,0xa3,0x08,0x06,0x66,
-0xa1,0x2b,0x08,0x66,0x01,0xc8,0x66,0xa3,0x0c,0x06,0x66,0x8b,0x1e,0x4b,0x08,0x66,
-0xa1,0x4f,0x08,0x66,0x01,0xc3,0x66,0xb8,0x01,0x00,0x01,0x00,0x66,0x39,0xc3,0x73,
-0x03,0x66,0x89,0xc3,0x66,0x81,0xc3,0xff,0xff,0x00,0x00,0x31,0xdb,0x66,0x89,0x1e,
-0x1c,0x00,0xe8,0xe8,0x02,0x8b,0x1e,0x04,0x06,0x09,0xdb,0x74,0x0a,0xb4,0x48,0xcd,
-0x21,0x0f,0x82,0x10,0x02,0x8e,0xc0,0xe8,0xfb,0x02,0xb8,0x01,0x00,0xff,0x1e,0x00,
-0x06,0x0f,0x82,0x08,0x02,0x8c,0x06,0x26,0x00,0x8c,0x0e,0x28,0x00,0x8c,0xd8,0xa3,
-0x22,0x00,0x8e,0xc0,0x31,0xc0,0xb9,0x01,0x00,0xcd,0x31,0x72,0x07,0xa3,0x14,0x06,
-0x31,0xc0,0xcd,0x31,0x0f,0x82,0xea,0x01,0xa3,0x16,0x06,0x66,0x8b,0x0e,0x1c,0x00,
-0xb8,0x01,0x05,0x8b,0x1e,0x1e,0x00,0xcd,0x31,0x0f,0x82,0xda,0x01,0x89,0x1e,0x1a,
-0x06,0x89,0x0e,0x18,0x06,0x89,0x36,0x1a,0x00,0x89,0x3e,0x18,0x00,0xb8,0x07,0x00,
-0x8b,0x1e,0x14,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,0x06,0xcd,0x31,0xb8,0x09,
-0x00,0x8c,0xc9,0x81,0xe1,0x03,0x00,0xc1,0xe1,0x05,0x51,0x81,0xc9,0x9b,0xc0,0xcd,
-0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x07,
-0x00,0x8b,0x1e,0x16,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,0x06,0xcd,0x31,0xb8,
-0x09,0x00,0x59,0x81,0xc9,0x93,0xc0,0xcd,0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00,
-0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x00,0x01,0xbb,0x00,0x0f,0xcd,0x31,0x73,0x10,
-0x3d,0x08,0x00,0x0f,0x85,0x65,0x01,0xb8,0x00,0x01,0xcd,0x31,0x0f,0x82,0x5c,0x01,
-0xa3,0x1c,0x06,0x89,0x16,0x1e,0x06,0xc1,0xe3,0x04,0x89,0x1e,0x20,0x06,0x66,0x8b,
-0x36,0x08,0x06,0x66,0x8b,0x3e,0xfb,0x07,0x66,0x8b,0x0e,0xff,0x07,0xe8,0x49,0x00,
-0x66,0x8b,0x36,0x0c,0x06,0x66,0x8b,0x3e,0x23,0x08,0x66,0x8b,0x0e,0x27,0x08,0xe8,
-0x37,0x00,0x8e,0x06,0x16,0x06,0x66,0x8b,0x3e,0x4b,0x08,0x66,0x8b,0x0e,0x4f,0x08,
-0x66,0x31,0xc0,0x66,0xc1,0xe9,0x02,0x67,0xf3,0x66,0xab,0xb4,0x3e,0x8b,0x1e,0x06,
-0x06,0xcd,0x21,0xb8,0x01,0x01,0x8b,0x16,0x1e,0x06,0xcd,0x31,0x1e,0x0f,0xa1,0x8e,
-0x1e,0x16,0x06,0x66,0x64,0xff,0x2e,0x10,0x06,0x66,0x89,0xf0,0x66,0x25,0xff,0x01,
-0x00,0x00,0x66,0x01,0xc1,0x29,0xc6,0x66,0x29,0xc7,0x66,0x89,0x0e,0x26,0x06,0x66,
-0x89,0x3e,0x22,0x06,0xe8,0xfe,0x00,0x89,0x36,0x3e,0x06,0x66,0xc1,0xee,0x10,0x89,
-0x36,0x42,0x06,0x8b,0x1e,0x06,0x06,0x89,0x1e,0x3a,0x06,0xc7,0x06,0x46,0x06,0x00,
-0x42,0xe8,0xf2,0x00,0xa1,0x1c,0x06,0xa3,0x4e,0x06,0xc7,0x06,0x3e,0x06,0x00,0x00,
-0xc6,0x06,0x47,0x06,0x3f,0xa1,0x28,0x06,0x09,0xc0,0x75,0x09,0xa1,0x26,0x06,0x3b,
-0x06,0x20,0x06,0x76,0x03,0xa1,0x20,0x06,0xa3,0x42,0x06,0xe8,0xc8,0x00,0x66,0x31,
-0xc9,0x8b,0x0e,0x46,0x06,0x66,0x8b,0x3e,0x22,0x06,0x66,0x01,0x0e,0x22,0x06,0x66,
-0x29,0x0e,0x26,0x06,0x66,0x31,0xf6,0xc1,0xe9,0x02,0x1e,0x06,0x8e,0x06,0x16,0x06,
-0x8e,0x1e,0x1e,0x06,0x67,0xf3,0x66,0xa5,0x07,0x1f,0x66,0x03,0x0e,0x26,0x06,0x75,
-0xaf,0xc3,0x3c,0x3a,0x74,0x06,0x3c,0x2f,0x74,0x02,0x3c,0x5c,0xc3,0xbe,0x64,0x07,
-0x89,0xf3,0x26,0x8a,0x05,0x47,0x88,0x04,0x38,0xe0,0x74,0x0e,0x08,0xc0,0x74,0x0a,
-0x46,0xe8,0xde,0xff,0x75,0xec,0x89,0xf3,0x74,0xe8,0xc3,0xba,0x26,0x05,0xeb,0x08,
-0xba,0x34,0x05,0xeb,0x03,0xba,0x3e,0x05,0x52,0x8b,0x1e,0x62,0x07,0xc6,0x07,0x24,
-0xbb,0x64,0x07,0xeb,0x1e,0xe8,0xed,0x00,0xba,0x78,0x05,0xeb,0x12,0xba,0x91,0x05,
-0xeb,0x0d,0xba,0xa3,0x05,0xeb,0x08,0xba,0xb5,0x05,0xeb,0x03,0xba,0x78,0x05,0x52,
-0xbb,0x19,0x05,0xe8,0x14,0x00,0x5b,0xe8,0x10,0x00,0xbb,0x42,0x04,0xe8,0x0a,0x00,
-0xb8,0xff,0x4c,0xcd,0x21,0x43,0xb4,0x02,0xcd,0x21,0x8a,0x17,0x80,0xfa,0x24,0x75,
-0xf4,0xc3,0x0d,0x0a,0x24,0x50,0x51,0x57,0x31,0xc0,0xbf,0x2a,0x06,0xb9,0x19,0x00,
-0xf3,0xab,0x5f,0x59,0x58,0xc3,0xb8,0x00,0x03,0xbb,0x21,0x00,0x31,0xc9,0x66,0xbf,
-0x2a,0x06,0x00,0x00,0xcd,0x31,0xc3,0x00,0x00,0x30,0xe4,0xe8,0x5f,0xff,0x89,0xde,
-0x8b,0x3e,0x67,0x04,0xeb,0x18,0xb4,0x3b,0xe8,0x52,0xff,0x81,0xfe,0x64,0x07,0x74,
-0x13,0x8a,0x84,0xff,0xff,0xe8,0x3a,0xff,0x74,0x04,0xc6,0x04,0x5c,0x46,0xe8,0x03,
-0x00,0x72,0xe3,0xc3,0xe8,0x36,0x00,0xbb,0x44,0x00,0x8a,0x07,0x88,0x04,0x43,0x46,
-0x08,0xc0,0x75,0xf6,0x06,0x57,0x1e,0x07,0xe8,0x9a,0xff,0xbb,0x2a,0x06,0x8c,0x9f,
-0x04,0x00,0x89,0x9f,0x02,0x00,0xba,0x64,0x07,0xb8,0x00,0x4b,0xcd,0x21,0x5f,0x07,
-0x72,0x09,0xb4,0x4d,0xcd,0x21,0x2d,0x00,0x03,0xf7,0xd8,0xeb,0x28,0x80,0x3e,0x69,
-0x08,0x05,0x72,0x20,0xb8,0x00,0x58,0xcd,0x21,0xa2,0x67,0x08,0xb8,0x02,0x58,0xcd,
-0x21,0xa2,0x68,0x08,0xb8,0x01,0x58,0xbb,0x80,0x00,0xcd,0x21,0xb8,0x03,0x58,0xbb,
-0x01,0x00,0xcd,0x21,0xc3,0x9c,0x80,0x3e,0x69,0x08,0x05,0x72,0x1a,0x50,0x53,0xb8,
-0x03,0x58,0x8a,0x1e,0x68,0x08,0x30,0xff,0xcd,0x21,0xb8,0x01,0x58,0x8a,0x1e,0x67,
-0x08,0x30,0xff,0xcd,0x21,0x5b,0x58,0x9d,0xc3,0x4c,0x6f,0x61,0x64,0x20,0x65,0x72,
-0x72,0x6f,0x72,0x3a,0x20,0x24,0x3a,0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f,
-0x70,0x65,0x6e,0x24,0x3a,0x20,0x6e,0x6f,0x74,0x20,0x45,0x58,0x45,0x24,0x3a,0x20,
-0x6e,0x6f,0x74,0x20,0x43,0x4f,0x46,0x46,0x20,0x28,0x43,0x68,0x65,0x63,0x6b,0x20,
-0x66,0x6f,0x72,0x20,0x76,0x69,0x72,0x75,0x73,0x65,0x73,0x29,0x24,0x6e,0x6f,0x20,
-0x44,0x50,0x4d,0x49,0x20,0x2d,0x20,0x47,0x65,0x74,0x20,0x63,0x73,0x64,0x70,0x6d,
-0x69,0x2a,0x62,0x2e,0x7a,0x69,0x70,0x24,0x6e,0x6f,0x20,0x44,0x4f,0x53,0x20,0x6d,
-0x65,0x6d,0x6f,0x72,0x79,0x24,0x6e,0x65,0x65,0x64,0x20,0x44,0x4f,0x53,0x20,0x33,
-0x24,0x63,0x61,0x6e,0x27,0x74,0x20,0x73,0x77,0x69,0x74,0x63,0x68,0x20,0x6d,0x6f,
-0x64,0x65,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x73,0x65,0x6c,0x65,0x63,
-0x74,0x6f,0x72,0x73,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x6d,0x65,0x6d,
-0x6f,0x72,0x79,0x24,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,
-0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,
-0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,
+0x30,0xcd,0x21,0x3c,0x03,0x73,0x08,0xb0,0x6d,0xba,0xa7,0x05,0xe9,0xd4,0x03,0xa2,
+0x69,0x08,0xbe,0x20,0x00,0x8b,0x04,0x09,0xc0,0x75,0x02,0xb4,0xfe,0xbb,0x70,0x08,
+0x39,0xc3,0x73,0x02,0x89,0xc3,0x89,0x1c,0xfe,0xc7,0xb9,0x04,0xff,0xd3,0xeb,0xb4,
+0x4a,0xcd,0x21,0x73,0x08,0xd3,0xe3,0xfe,0xcf,0x89,0x1c,0xeb,0xd8,0x26,0x8e,0x06,
+0x2c,0x00,0x31,0xff,0x30,0xc0,0xa9,0xf2,0xae,0x26,0x81,0x3d,0x50,0x41,0x75,0x15,
+0xaf,0x26,0x81,0x3d,0x54,0x48,0x75,0x0d,0xaf,0x26,0x80,0x3d,0x3d,0x75,0x06,0x47,
+0x89,0x3e,0x8c,0x04,0x4f,0xae,0x75,0xdf,0xaf,0xb4,0x3e,0xbb,0x13,0x00,0xcd,0x21,
+0xb4,0x3e,0xbb,0x12,0x00,0xcd,0x21,0x06,0x57,0x31,0xc9,0x74,0x12,0xb0,0x6e,0xba,
+0x7e,0x05,0xe9,0x5e,0x03,0x09,0xc9,0x75,0xf4,0x41,0xe8,0xa1,0x03,0x72,0xee,0xb8,
+0x87,0x16,0xcd,0x2f,0x09,0xc0,0x75,0xed,0x80,0xe3,0x01,0x74,0xe8,0x89,0x3e,0x00,
+0x06,0x8c,0x06,0x02,0x06,0x89,0x36,0x04,0x06,0x5f,0x07,0xe8,0xd3,0x02,0x89,0x3e,
+0x2a,0x00,0x89,0x36,0x62,0x07,0x80,0x3e,0x2c,0x00,0x00,0x74,0x23,0xb9,0x08,0x00,
+0xbf,0x2c,0x00,0x8a,0x05,0x47,0x08,0xc0,0x74,0x05,0x88,0x07,0x43,0xe2,0xf4,0x66,
+0xc7,0x07,0x2e,0x45,0x58,0x45,0x83,0xc3,0x04,0xc6,0x07,0x00,0x89,0x1e,0x62,0x07,
+0xb8,0x00,0x3d,0xba,0x64,0x07,0xcd,0x21,0x0f,0x82,0xb3,0x02,0xa3,0x06,0x06,0x89,
+0xc3,0xb9,0x06,0x00,0xba,0xb5,0x07,0xb4,0x3f,0xcd,0x21,0x31,0xd2,0x31,0xc9,0xa1,
+0xb5,0x07,0x3d,0x4c,0x01,0x74,0x1b,0x3d,0x4d,0x5a,0x0f,0x85,0x98,0x02,0x8b,0x16,
+0xb9,0x07,0xc1,0xe2,0x09,0x8b,0x1e,0xb7,0x07,0x09,0xdb,0x74,0x05,0x80,0xee,0x02,
+0x01,0xda,0x89,0x16,0xbb,0x07,0x89,0x0e,0xbd,0x07,0xb8,0x00,0x42,0x8b,0x1e,0x06,
+0x06,0xcd,0x21,0xb9,0xa8,0x00,0xba,0xbf,0x07,0xb4,0x3f,0xcd,0x21,0x3d,0xa8,0x00,
+0x75,0x06,0x81,0x3e,0xbf,0x07,0x4c,0x01,0x0f,0x85,0x61,0x02,0x66,0xa1,0xe3,0x07,
+0x66,0xa3,0x10,0x06,0x66,0x8b,0x0e,0xbb,0x07,0x66,0xa1,0x03,0x08,0x66,0x01,0xc8,
+0x66,0xa3,0x08,0x06,0x66,0xa1,0x2b,0x08,0x66,0x01,0xc8,0x66,0xa3,0x0c,0x06,0x66,
+0x8b,0x1e,0x4b,0x08,0x66,0xa1,0x4f,0x08,0x66,0x01,0xc3,0x66,0xb8,0x01,0x00,0x01,
+0x00,0x66,0x39,0xc3,0x73,0x03,0x66,0x89,0xc3,0x66,0x81,0xc3,0xff,0xff,0x00,0x00,
+0x31,0xdb,0x66,0x89,0x1e,0x1c,0x00,0xe8,0xf5,0x02,0x8b,0x1e,0x04,0x06,0x09,0xdb,
+0x74,0x0a,0xb4,0x48,0xcd,0x21,0x0f,0x82,0x15,0x02,0x8e,0xc0,0xe8,0x08,0x03,0xb8,
+0x01,0x00,0xff,0x1e,0x00,0x06,0x0f,0x82,0x0f,0x02,0x8c,0x06,0x26,0x00,0x8c,0x0e,
+0x28,0x00,0x8c,0xd8,0xa3,0x22,0x00,0x8e,0xc0,0x31,0xc0,0xb9,0x01,0x00,0xcd,0x31,
+0x72,0x07,0xa3,0x14,0x06,0x31,0xc0,0xcd,0x31,0x0f,0x82,0xf3,0x01,0xa3,0x16,0x06,
+0x66,0x8b,0x0e,0x1c,0x00,0xb8,0x01,0x05,0x8b,0x1e,0x1e,0x00,0xcd,0x31,0x0f,0x82,
+0xe5,0x01,0x89,0x1e,0x1a,0x06,0x89,0x0e,0x18,0x06,0x89,0x36,0x1a,0x00,0x89,0x3e,
+0x18,0x00,0xb8,0x07,0x00,0x8b,0x1e,0x14,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,
+0x06,0xcd,0x31,0xb8,0x09,0x00,0x8c,0xc9,0x83,0xe1,0x03,0xc1,0xe1,0x05,0x51,0x81,
+0xc9,0x9b,0xc0,0xcd,0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff,
+0xcd,0x31,0xb8,0x07,0x00,0x8b,0x1e,0x16,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,
+0x06,0xcd,0x31,0xb8,0x09,0x00,0x59,0x81,0xc9,0x93,0xc0,0xcd,0x31,0xb8,0x08,0x00,
+0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x00,0x01,0xbb,0x00,0x0f,
+0xcd,0x31,0x73,0x10,0x3d,0x08,0x00,0x0f,0x85,0x73,0x01,0xb8,0x00,0x01,0xcd,0x31,
+0x0f,0x82,0x6a,0x01,0xa3,0x1c,0x06,0x89,0x16,0x1e,0x06,0xc1,0xe3,0x04,0x89,0x1e,
+0x20,0x06,0x66,0x8b,0x36,0x08,0x06,0x66,0x8b,0x3e,0xfb,0x07,0x66,0x8b,0x0e,0xff,
+0x07,0xe8,0x49,0x00,0x66,0x8b,0x36,0x0c,0x06,0x66,0x8b,0x3e,0x23,0x08,0x66,0x8b,
+0x0e,0x27,0x08,0xe8,0x37,0x00,0x8e,0x06,0x16,0x06,0x66,0x8b,0x3e,0x4b,0x08,0x66,
+0x8b,0x0e,0x4f,0x08,0x66,0x31,0xc0,0x66,0xc1,0xe9,0x02,0x67,0xf3,0x66,0xab,0xb4,
+0x3e,0x8b,0x1e,0x06,0x06,0xcd,0x21,0xb8,0x01,0x01,0x8b,0x16,0x1e,0x06,0xcd,0x31,
+0x1e,0x0f,0xa1,0x8e,0x1e,0x16,0x06,0x66,0x64,0xff,0x2e,0x10,0x06,0x66,0x89,0xf0,
+0x66,0x25,0xff,0x01,0x00,0x00,0x66,0x01,0xc1,0x29,0xc6,0x66,0x29,0xc7,0x66,0x89,
+0x0e,0x26,0x06,0x66,0x89,0x3e,0x22,0x06,0xe8,0x0f,0x01,0x89,0x36,0x3e,0x06,0x66,
+0xc1,0xee,0x10,0x89,0x36,0x42,0x06,0x8b,0x1e,0x06,0x06,0x89,0x1e,0x3a,0x06,0xc7,
+0x06,0x46,0x06,0x00,0x42,0xe8,0x03,0x01,0xa1,0x1c,0x06,0xa3,0x4e,0x06,0xc7,0x06,
+0x3e,0x06,0x00,0x00,0xc6,0x06,0x47,0x06,0x3f,0xa1,0x28,0x06,0x09,0xc0,0x75,0x09,
+0xa1,0x26,0x06,0x3b,0x06,0x20,0x06,0x76,0x03,0xa1,0x20,0x06,0xa3,0x42,0x06,0xe8,
+0xd9,0x00,0x66,0x31,0xc9,0x8b,0x0e,0x46,0x06,0x66,0x8b,0x3e,0x22,0x06,0x66,0x01,
+0x0e,0x22,0x06,0x66,0x29,0x0e,0x26,0x06,0x66,0x31,0xf6,0xc1,0xe9,0x02,0x1e,0x06,
+0x8e,0x06,0x16,0x06,0x8e,0x1e,0x1e,0x06,0x67,0xf3,0x66,0xa5,0x07,0x1f,0x66,0x03,
+0x0e,0x26,0x06,0x75,0xaf,0xc3,0x3c,0x3a,0x74,0x06,0x3c,0x2f,0x74,0x02,0x3c,0x5c,
+0xc3,0xbe,0x64,0x07,0x89,0xf3,0x26,0x8a,0x05,0x47,0x88,0x04,0x38,0xe0,0x74,0x0e,
+0x08,0xc0,0x74,0x0a,0x46,0xe8,0xde,0xff,0x75,0xec,0x89,0xf3,0x74,0xe8,0xc3,0xb0,
+0x66,0xba,0x48,0x05,0xeb,0x0c,0xb0,0x67,0xba,0x55,0x05,0xeb,0x05,0xb0,0x68,0xba,
+0x5f,0x05,0x52,0x8b,0x1e,0x62,0x07,0xc6,0x07,0x24,0xbb,0x64,0x07,0xeb,0x28,0xe8,
+0xf5,0x00,0xb0,0x69,0xba,0x99,0x05,0xeb,0x1a,0xb0,0x6a,0xba,0xb2,0x05,0xeb,0x13,
+0xb0,0x6b,0xba,0xc4,0x05,0xeb,0x0c,0xb0,0x6c,0xba,0xd6,0x05,0xeb,0x05,0xb0,0x69,
+0xba,0x99,0x05,0x52,0xbb,0x3b,0x05,0xe8,0x15,0x00,0x5b,0xe8,0x11,0x00,0xbb,0x67,
+0x04,0xe8,0x0b,0x00,0xb4,0x4c,0xcd,0x21,0x43,0x50,0xb4,0x02,0xcd,0x21,0x58,0x8a,
+0x17,0x80,0xfa,0x24,0x75,0xf2,0xc3,0x0d,0x0a,0x24,0x50,0x51,0x57,0x31,0xc0,0xbf,
+0x2a,0x06,0xb9,0x19,0x00,0xf3,0xab,0x5f,0x59,0x58,0xc3,0xb8,0x00,0x03,0xbb,0x21,
+0x00,0x31,0xc9,0x66,0xbf,0x2a,0x06,0x00,0x00,0xcd,0x31,0xc3,0x00,0x00,0x30,0xe4,
+0xe8,0x4e,0xff,0x89,0xde,0x8b,0x3e,0x8c,0x04,0xeb,0x17,0xb4,0x3b,0xe8,0x41,0xff,
+0x81,0xfe,0x64,0x07,0x74,0x12,0x8a,0x44,0xff,0xe8,0x2a,0xff,0x74,0x04,0xc6,0x04,
+0x5c,0x46,0xe8,0x03,0x00,0x72,0xe4,0xc3,0xe8,0x34,0x00,0xbb,0x44,0x00,0x8a,0x07,
+0x88,0x04,0x43,0x46,0x08,0xc0,0x75,0xf6,0x06,0x57,0x1e,0x07,0xe8,0x9b,0xff,0xbb,
+0x2a,0x06,0x8c,0x5f,0x04,0x89,0x5f,0x02,0xba,0x64,0x07,0xb8,0x00,0x4b,0xcd,0x21,
+0x5f,0x07,0x72,0x09,0xb4,0x4d,0xcd,0x21,0x2d,0x00,0x03,0xf7,0xd8,0xeb,0x28,0x80,
+0x3e,0x69,0x08,0x05,0x72,0x20,0xb8,0x00,0x58,0xcd,0x21,0xa2,0x67,0x08,0xb8,0x02,
+0x58,0xcd,0x21,0xa2,0x68,0x08,0xb8,0x01,0x58,0xbb,0x80,0x00,0xcd,0x21,0xb8,0x03,
+0x58,0xbb,0x01,0x00,0xcd,0x21,0xc3,0x9c,0x80,0x3e,0x69,0x08,0x05,0x72,0x1a,0x50,
+0x53,0xb8,0x03,0x58,0x8a,0x1e,0x68,0x08,0x30,0xff,0xcd,0x21,0xb8,0x01,0x58,0x8a,
+0x1e,0x67,0x08,0x30,0xff,0xcd,0x21,0x5b,0x58,0x9d,0xc3,0x4c,0x6f,0x61,0x64,0x20,
+0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x24,0x3a,0x20,0x63,0x61,0x6e,0x27,0x74,0x20,
+0x6f,0x70,0x65,0x6e,0x24,0x3a,0x20,0x6e,0x6f,0x74,0x20,0x45,0x58,0x45,0x24,0x3a,
+0x20,0x6e,0x6f,0x74,0x20,0x43,0x4f,0x46,0x46,0x20,0x28,0x43,0x68,0x65,0x63,0x6b,
+0x20,0x66,0x6f,0x72,0x20,0x76,0x69,0x72,0x75,0x73,0x65,0x73,0x29,0x24,0x6e,0x6f,
+0x20,0x44,0x50,0x4d,0x49,0x20,0x2d,0x20,0x47,0x65,0x74,0x20,0x63,0x73,0x64,0x70,
+0x6d,0x69,0x2a,0x62,0x2e,0x7a,0x69,0x70,0x24,0x6e,0x6f,0x20,0x44,0x4f,0x53,0x20,
+0x6d,0x65,0x6d,0x6f,0x72,0x79,0x24,0x6e,0x65,0x65,0x64,0x20,0x44,0x4f,0x53,0x20,
+0x33,0x24,0x63,0x61,0x6e,0x27,0x74,0x20,0x73,0x77,0x69,0x74,0x63,0x68,0x20,0x6d,
+0x6f,0x64,0x65,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x73,0x65,0x6c,0x65,
+0x63,0x74,0x6f,0x72,0x73,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x6d,0x65,
+0x6d,0x6f,0x72,0x79,0x24,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,
0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90
diff --git a/gnu/usr.bin/binutils/bfd/libpei.h b/gnu/usr.bin/binutils/bfd/libpei.h
index 88f9f738229..5b9cc045cc9 100644
--- a/gnu/usr.bin/binutils/bfd/libpei.h
+++ b/gnu/usr.bin/binutils/bfd/libpei.h
@@ -1,5 +1,6 @@
/* Support for the generic parts of PE/PEI; common header information.
- Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Written by Cygnus Solutions.
This file is part of BFD, the Binary File Descriptor library.
@@ -192,6 +193,72 @@ PE/PEI rearrangement (and code added): Donn Terry
#define PUT_SCNHDR_LNNOPTR bfd_h_put_32
#endif
+#ifdef COFF_WITH_pep
+
+#define GET_OPTHDR_IMAGE_BASE bfd_h_get_64
+#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_64
+#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_64
+#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_64
+#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_64
+#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_64
+#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_64
+#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_64
+#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_64
+#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_64
+#define GET_PDATA_ENTRY bfd_get_64
+
+#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common
+#define _bfd_XX_bfd_copy_private_section_data _bfd_pep_bfd_copy_private_section_data
+#define _bfd_XX_get_symbol_info _bfd_pep_get_symbol_info
+#define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out
+#define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common
+#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript
+#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript
+#define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out
+#define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in
+#define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out
+#define _bfd_XXi_swap_aux_in _bfd_pepi_swap_aux_in
+#define _bfd_XXi_swap_aux_out _bfd_pepi_swap_aux_out
+#define _bfd_XXi_swap_lineno_in _bfd_pepi_swap_lineno_in
+#define _bfd_XXi_swap_lineno_out _bfd_pepi_swap_lineno_out
+#define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out
+#define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in
+#define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out
+
+#else /* !COFF_WITH_pep */
+
+#define GET_OPTHDR_IMAGE_BASE bfd_h_get_32
+#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_32
+#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_32
+#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_32
+#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_32
+#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_32
+#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_32
+#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_32
+#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_32
+#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_32
+#define GET_PDATA_ENTRY bfd_get_32
+
+#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common
+#define _bfd_XX_bfd_copy_private_section_data _bfd_pe_bfd_copy_private_section_data
+#define _bfd_XX_get_symbol_info _bfd_pe_get_symbol_info
+#define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out
+#define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common
+#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript
+#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript
+#define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out
+#define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in
+#define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out
+#define _bfd_XXi_swap_aux_in _bfd_pei_swap_aux_in
+#define _bfd_XXi_swap_aux_out _bfd_pei_swap_aux_out
+#define _bfd_XXi_swap_lineno_in _bfd_pei_swap_lineno_in
+#define _bfd_XXi_swap_lineno_out _bfd_pei_swap_lineno_out
+#define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out
+#define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in
+#define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out
+
+#endif /* !COFF_WITH_pep */
+
/* These functions are architecture dependent, and are in peicode.h:
coff_swap_reloc_in
int coff_swap_reloc_out
@@ -204,51 +271,51 @@ PE/PEI rearrangement (and code added): Donn Terry
implementations architecture types, and actually appear in
peigen.c. */
-void _bfd_pei_swap_sym_in PARAMS ((bfd*, PTR, PTR));
-#define coff_swap_sym_in _bfd_pei_swap_sym_in
+void _bfd_XXi_swap_sym_in PARAMS ((bfd*, PTR, PTR));
+#define coff_swap_sym_in _bfd_XXi_swap_sym_in
-unsigned int _bfd_pei_swap_sym_out PARAMS ((bfd*, PTR, PTR));
-#define coff_swap_sym_out _bfd_pei_swap_sym_out
+unsigned int _bfd_XXi_swap_sym_out PARAMS ((bfd*, PTR, PTR));
+#define coff_swap_sym_out _bfd_XXi_swap_sym_out
-void _bfd_pei_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
-#define coff_swap_aux_in _bfd_pei_swap_aux_in
+void _bfd_XXi_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+#define coff_swap_aux_in _bfd_XXi_swap_aux_in
-unsigned int _bfd_pei_swap_aux_out \
+unsigned int _bfd_XXi_swap_aux_out \
PARAMS ((bfd *, PTR, int, int, int, int, PTR));
-#define coff_swap_aux_out _bfd_pei_swap_aux_out
+#define coff_swap_aux_out _bfd_XXi_swap_aux_out
-void _bfd_pei_swap_lineno_in PARAMS ((bfd*, PTR, PTR));
-#define coff_swap_lineno_in _bfd_pei_swap_lineno_in
+void _bfd_XXi_swap_lineno_in PARAMS ((bfd*, PTR, PTR));
+#define coff_swap_lineno_in _bfd_XXi_swap_lineno_in
-unsigned int _bfd_pei_swap_lineno_out PARAMS ((bfd*, PTR, PTR));
-#define coff_swap_lineno_out _bfd_pei_swap_lineno_out
+unsigned int _bfd_XXi_swap_lineno_out PARAMS ((bfd*, PTR, PTR));
+#define coff_swap_lineno_out _bfd_XXi_swap_lineno_out
-void _bfd_pei_swap_aouthdr_in PARAMS ((bfd*, PTR, PTR));
-#define coff_swap_aouthdr_in _bfd_pei_swap_aouthdr_in
+void _bfd_XXi_swap_aouthdr_in PARAMS ((bfd*, PTR, PTR));
+#define coff_swap_aouthdr_in _bfd_XXi_swap_aouthdr_in
-unsigned int _bfd_pei_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR));
-#define coff_swap_aouthdr_out _bfd_pei_swap_aouthdr_out
+unsigned int _bfd_XXi_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR));
+#define coff_swap_aouthdr_out _bfd_XXi_swap_aouthdr_out
-unsigned int _bfd_pei_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR));
-#define coff_swap_scnhdr_out _bfd_pei_swap_scnhdr_out
+unsigned int _bfd_XXi_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR));
+#define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out
-boolean _bfd_pe_print_private_bfd_data_common PARAMS ((bfd *, PTR));
+boolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR));
-boolean _bfd_pe_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *));
+boolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *));
-void _bfd_pe_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
+void _bfd_XX_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
-boolean _bfd_pei_final_link_postscript
+boolean _bfd_XXi_final_link_postscript
PARAMS ((bfd *, struct coff_final_link_info *));
#ifndef coff_final_link_postscript
-#define coff_final_link_postscript _bfd_pei_final_link_postscript
+#define coff_final_link_postscript _bfd_XXi_final_link_postscript
#endif
/* The following are needed only for ONE of pe or pei, but don't
otherwise vary; peicode.h fixes up ifdefs but we provide the
prototype. */
-unsigned int _bfd_pe_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR));
-unsigned int _bfd_pei_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR));
-boolean _bfd_pe_bfd_copy_private_section_data
+unsigned int _bfd_XX_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR));
+unsigned int _bfd_XXi_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR));
+boolean _bfd_XX_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));
diff --git a/gnu/usr.bin/binutils/bfd/pe-mips.c b/gnu/usr.bin/binutils/bfd/pe-mips.c
index 9b89369b37b..62395ce956b 100644
--- a/gnu/usr.bin/binutils/bfd/pe-mips.c
+++ b/gnu/usr.bin/binutils/bfd/pe-mips.c
@@ -1,5 +1,6 @@
/* BFD back-end for MIPS PE COFF files.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001 Free Software Foundation, Inc.
Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
This file is part of BFD, the Binary File Descriptor library.
@@ -34,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libcoff.h"
-static bfd_reloc_status_type coff_mips_reloc
+static bfd_reloc_status_type coff_mips_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static reloc_howto_type *coff_mips_rtype_to_howto
PARAMS ((bfd *, asection *, struct internal_reloc *,
@@ -166,21 +167,21 @@ coff_mips_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. */
+ 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 && howto->type != MIPS_R_RVA;
-}
+}
#endif
#ifndef PCRELOFFSET
#define PCRELOFFSET false
#endif
-static reloc_howto_type howto_table[] =
+static reloc_howto_type howto_table[] =
{
/* Reloc type 0 is ignored. The reloc reading code ensures that
this is a reference to the .abs section, which will cause
@@ -336,33 +337,33 @@ static reloc_howto_type howto_table[] =
EMPTY_HOWTO (31),
EMPTY_HOWTO (32),
EMPTY_HOWTO (33),
- HOWTO (MIPS_R_RVA, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (MIPS_R_RVA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_mips_reloc, /* special_function */
- "rva32", /* name */
- true, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ coff_mips_reloc, /* special_function */
+ "rva32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */
EMPTY_HOWTO (35),
EMPTY_HOWTO (36),
- HOWTO (MIPS_R_PAIR, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (MIPS_R_PAIR, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_mips_reloc, /* special_function */
- "PAIR", /* name */
- true, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ coff_mips_reloc, /* special_function */
+ "PAIR", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */
};
@@ -408,7 +409,6 @@ static reloc_howto_type howto_table[] =
cache_ptr->addend += asect->vma; \
}
-
/* Convert an rtype to howto for the COFF backend linker. */
static reloc_howto_type *
@@ -439,7 +439,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
function will be adding in the final value of the symbol. We
need to subtract out the current size in order to get the
correct result. */
-
+
BFD_ASSERT (h != NULL);
#ifndef COFF_WITH_PE
@@ -458,7 +458,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
/* If the output symbol is common (in which case this must be a
relocateable link), we need to add in the final size of the
common symbol. */
- if (h != NULL && h->root.type == bfd_link_hash_common)
+ if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
#endif
@@ -488,11 +488,8 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
#define coff_rtype_to_howto coff_mips_rtype_to_howto
-
#define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup
-
-
/* Get the howto structure for a generic reloc type. */
static reloc_howto_type *
@@ -577,7 +574,7 @@ mips_swap_reloc_in (abfd, src, dst)
reloc_dst->r_offset = reloc_dst->r_symndx;
if (reloc_dst->r_offset & 0x8000)
reloc_dst->r_offset -= 0x10000;
- /*printf("dj: pair offset is %08x\n", reloc_dst->r_offset);*/
+ /*printf ("dj: pair offset is %08x\n", reloc_dst->r_offset);*/
reloc_dst->r_symndx = pair_prev.r_symndx;
break;
}
@@ -654,7 +651,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
if (info->relocateable)
{
- (*_bfd_error_handler)(_("\
+ (*_bfd_error_handler) (_("\
%s: `ld -r' not supported with PE MIPS objects\n"),
bfd_get_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
@@ -665,7 +662,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
== output_bfd->xvec->byteorder);
#if 0
- printf("dj: relocate %s(%s) %08x\n",
+ printf ("dj: relocate %s(%s) %08x\n",
input_bfd->filename, input_section->name,
input_section->output_section->vma + input_section->output_offset);
#endif
@@ -700,7 +697,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
sym = NULL;
}
else
- {
+ {
h = obj_coff_sym_hashes (input_bfd)[symndx];
sym = syms + symndx;
}
@@ -715,7 +712,6 @@ coff_pe_mips_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)
@@ -779,7 +775,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
src = rel->r_vaddr + input_section->output_section->vma
+ input_section->output_offset;
#if 0
- printf("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n",
+ printf ("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n",
rel->r_type, howto_table[rel->r_type].name,
src, rel->r_vaddr, *(unsigned long *)mem, val, rel->r_offset,
h?h->root.root.string:"(none)");
@@ -791,7 +787,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
val = VMA of what we need to refer to
*/
-#define UI(x) (*_bfd_error_handler)(_("%s: unimplemented %s\n"), \
+#define UI(x) (*_bfd_error_handler) (_("%s: unimplemented %s\n"), \
bfd_get_filename (input_bfd), x); \
bfd_set_error (bfd_error_bad_value);
@@ -807,7 +803,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
case MIPS_R_REFWORD:
tmp = bfd_get_32(input_bfd, mem);
- /* printf("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */
+ /* printf ("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */
tmp += val;
bfd_put_32(input_bfd, tmp, mem);
break;
@@ -817,7 +813,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
targ = val + (tmp&0x03ffffff)*4;
if ((src & 0xf0000000) != (targ & 0xf0000000))
{
- (*_bfd_error_handler)(_("%s: jump too far away\n"),
+ (*_bfd_error_handler) (_("%s: jump too far away\n"),
bfd_get_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -844,7 +840,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
targ = val + low + ((tmp & 0xffff) << 16);
break;
default:
- (*_bfd_error_handler)(_("%s: bad pair/reflo after refhi\n"),
+ (*_bfd_error_handler) (_("%s: bad pair/reflo after refhi\n"),
bfd_get_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -857,7 +853,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
case MIPS_R_REFLO:
tmp = bfd_get_32(input_bfd, mem);
targ = val + (tmp & 0xffff);
- /* printf("refword: src=%08x targ=%08x\n", src, targ); */
+ /* printf ("refword: src=%08x targ=%08x\n", src, targ); */
tmp &= 0xffff0000;
tmp |= targ & 0xffff;
bfd_put_32(input_bfd, tmp, mem);
@@ -886,7 +882,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
case MIPS_R_RVA:
tmp = bfd_get_32 (input_bfd, mem);
- /* printf("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */
+ /* printf ("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */
tmp += val
- pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
bfd_put_32 (input_bfd, tmp, mem);
@@ -974,7 +970,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 */
@@ -993,6 +989,6 @@ const bfd_target
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
NULL,
-
+
COFF_SWAP_TABLE
};
diff --git a/gnu/usr.bin/binutils/bfd/pe-sh.c b/gnu/usr.bin/binutils/bfd/pe-sh.c
index 7e48b0ef527..08526e6218e 100644
--- a/gnu/usr.bin/binutils/bfd/pe-sh.c
+++ b/gnu/usr.bin/binutils/bfd/pe-sh.c
@@ -1,5 +1,5 @@
/* BFD back-end for SH PECOFF files.
- Copyright 1995, 2000 Free Software Foundation, Inc.
+ Copyright 1995, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
-
#define TARGET_SHL_SYM shlpe_vec
#define TARGET_SHL_NAME "pe-shl"
#define COFF_WITH_PE
diff --git a/gnu/usr.bin/binutils/bfd/peXXigen.c b/gnu/usr.bin/binutils/bfd/peXXigen.c
new file mode 100644
index 00000000000..0e1eaeac536
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/peXXigen.c
@@ -0,0 +1,2043 @@
+/* Support for the generic parts of PE/PEI; the common executable parts.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+ Written by Cygnus Solutions.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Most of this hacked by Steve Chamberlain <sac@cygnus.com>.
+
+ PE/PEI rearrangement (and code added): Donn Terry
+ Softway Systems, Inc.
+*/
+
+/* Hey look, some documentation [and in a place you expect to find it]!
+
+ The main reference for the pei format is "Microsoft Portable Executable
+ and Common Object File Format Specification 4.1". Get it if you need to
+ do some serious hacking on this code.
+
+ Another reference:
+ "Peering Inside the PE: A Tour of the Win32 Portable Executable
+ File Format", MSJ 1994, Volume 9.
+
+ The *sole* difference between the pe format and the pei format is that the
+ latter has an MSDOS 2.0 .exe header on the front that prints the message
+ "This app must be run under Windows." (or some such).
+ (FIXME: Whether that statement is *really* true or not is unknown.
+ Are there more subtle differences between pe and pei formats?
+ For now assume there aren't. If you find one, then for God sakes
+ document it here!)
+
+ The Microsoft docs use the word "image" instead of "executable" because
+ the former can also refer to a DLL (shared library). Confusion can arise
+ because the `i' in `pei' also refers to "image". The `pe' format can
+ also create images (i.e. executables), it's just that to run on a win32
+ system you need to use the pei format.
+
+ FIXME: Please add more docs here so the next poor fool that has to hack
+ on this code has a chance of getting something accomplished without
+ wasting too much time.
+*/
+
+/* This expands into COFF_WITH_pe or COFF_WITH_pep depending on whether
+ we're compiling for straight PE or PE+. */
+#define COFF_WITH_XX
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "coff/internal.h"
+
+/* NOTE: it's strange to be including an architecture specific header
+ in what's supposed to be general (to PE/PEI) code. However, that's
+ where the definitions are, and they don't vary per architecture
+ within PE/PEI, so we get them from there. FIXME: The lack of
+ variance is an assumption which may prove to be incorrect if new
+ PE/PEI targets are created. */
+#ifdef COFF_WITH_pep
+# include "coff/ia64.h"
+#else
+# include "coff/i386.h"
+#endif
+
+#include "coff/pe.h"
+#include "libcoff.h"
+#include "libpei.h"
+
+#ifdef COFF_WITH_pep
+# undef AOUTSZ
+# define AOUTSZ PEPAOUTSZ
+# define PEAOUTHDR PEPAOUTHDR
+#endif
+
+/* FIXME: This file has various tests of POWERPC_LE_PE. Those tests
+ worked when the code was in peicode.h, but no longer work now that
+ the code is in peigen.c. PowerPC NT is said to be dead. If
+ anybody wants to revive the code, you will have to figure out how
+ to handle those issues. */
+
+static void add_data_entry
+ PARAMS ((bfd *, struct internal_extra_pe_aouthdr *, int, char *, bfd_vma));
+static boolean pe_print_pdata PARAMS ((bfd *, PTR));
+static boolean pe_print_reloc PARAMS ((bfd *, PTR));
+
+/**********************************************************************/
+
+void
+_bfd_XXi_swap_sym_in (abfd, ext1, in1)
+ bfd *abfd;
+ PTR ext1;
+ PTR in1;
+{
+ SYMENT *ext = (SYMENT *) ext1;
+ struct internal_syment *in = (struct internal_syment *) in1;
+
+ if (ext->e.e_name[0] == 0)
+ {
+ in->_n._n_n._n_zeroes = 0;
+ in->_n._n_n._n_offset =
+ bfd_h_get_32 (abfd, (bfd_byte *) ext->e.e.e_offset);
+ }
+ else
+ {
+ memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN);
+ }
+
+ in->n_value = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_value);
+ in->n_scnum = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_scnum);
+ if (sizeof (ext->e_type) == 2)
+ {
+ in->n_type = bfd_h_get_16 (abfd, (bfd_byte *) ext->e_type);
+ }
+ else
+ {
+ in->n_type = bfd_h_get_32 (abfd, (bfd_byte *) ext->e_type);
+ }
+ in->n_sclass = bfd_h_get_8 (abfd, ext->e_sclass);
+ in->n_numaux = bfd_h_get_8 (abfd, ext->e_numaux);
+
+#ifndef STRICT_PE_FORMAT
+ /* This is for Gnu-created DLLs. */
+
+ /* The section symbols for the .idata$ sections have class 0x68
+ (C_SECTION), which MS documentation indicates is a section
+ symbol. Unfortunately, the value field in the symbol is simply a
+ copy of the .idata section's flags rather than something useful.
+ When these symbols are encountered, change the value to 0 so that
+ they will be handled somewhat correctly in the bfd code. */
+ if (in->n_sclass == C_SECTION)
+ {
+ in->n_value = 0x0;
+
+#if 0
+ /* FIXME: This is clearly wrong. The problem seems to be that
+ undefined C_SECTION symbols appear in the first object of a
+ MS generated .lib file, and the symbols are not defined
+ anywhere. */
+ in->n_scnum = 1;
+
+ /* I have tried setting the class to 3 and using the following
+ to set the section number. This will put the address of the
+ pointer to the string kernel32.dll at addresses 0 and 0x10
+ off start of idata section which is not correct. */
+#if 0
+ if (strcmp (in->_n._n_name, ".idata$4") == 0)
+ in->n_scnum = 3;
+ else
+ in->n_scnum = 2;
+#endif
+#else
+ /* Create synthetic empty sections as needed. DJ */
+ if (in->n_scnum == 0)
+ {
+ asection *sec;
+ for (sec = abfd->sections; sec; sec = sec->next)
+ {
+ if (strcmp (sec->name, in->n_name) == 0)
+ {
+ in->n_scnum = sec->target_index;
+ break;
+ }
+ }
+ }
+ if (in->n_scnum == 0)
+ {
+ int unused_section_number = 0;
+ asection *sec;
+ char *name;
+ for (sec = abfd->sections; sec; sec = sec->next)
+ if (unused_section_number <= sec->target_index)
+ unused_section_number = sec->target_index + 1;
+
+ name = bfd_alloc (abfd, strlen (in->n_name) + 10);
+ if (name == NULL)
+ return;
+ strcpy (name, in->n_name);
+ sec = bfd_make_section_anyway (abfd, name);
+
+ sec->vma = 0;
+ sec->lma = 0;
+ sec->_cooked_size = 0;
+ sec->_raw_size = 0;
+ sec->filepos = 0;
+ sec->rel_filepos = 0;
+ sec->reloc_count = 0;
+ sec->line_filepos = 0;
+ sec->lineno_count = 0;
+ sec->userdata = NULL;
+ sec->next = (asection *) NULL;
+ sec->flags = 0;
+ sec->alignment_power = 2;
+ sec->flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD;
+
+ sec->target_index = unused_section_number;
+
+ in->n_scnum = unused_section_number;
+ }
+ in->n_sclass = C_STAT;
+#endif
+ }
+#endif
+
+#ifdef coff_swap_sym_in_hook
+ /* This won't work in peigen.c, but since it's for PPC PE, it's not
+ worth fixing. */
+ coff_swap_sym_in_hook (abfd, ext1, in1);
+#endif
+}
+
+unsigned int
+_bfd_XXi_swap_sym_out (abfd, inp, extp)
+ bfd *abfd;
+ PTR inp;
+ PTR extp;
+{
+ struct internal_syment *in = (struct internal_syment *) inp;
+ SYMENT *ext = (SYMENT *) extp;
+ if (in->_n._n_name[0] == 0)
+ {
+ bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->e.e.e_zeroes);
+ bfd_h_put_32 (abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e.e.e_offset);
+ }
+ else
+ {
+ memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN);
+ }
+
+ bfd_h_put_32 (abfd, in->n_value, (bfd_byte *) ext->e_value);
+ bfd_h_put_16 (abfd, in->n_scnum, (bfd_byte *) ext->e_scnum);
+ if (sizeof (ext->e_type) == 2)
+ {
+ bfd_h_put_16 (abfd, in->n_type, (bfd_byte *) ext->e_type);
+ }
+ else
+ {
+ bfd_h_put_32 (abfd, in->n_type, (bfd_byte *) ext->e_type);
+ }
+ bfd_h_put_8 (abfd, in->n_sclass, ext->e_sclass);
+ bfd_h_put_8 (abfd, in->n_numaux, ext->e_numaux);
+
+ return SYMESZ;
+}
+
+void
+_bfd_XXi_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
+ bfd *abfd;
+ PTR ext1;
+ int type;
+ int class;
+ int indx ATTRIBUTE_UNUSED;
+ int numaux ATTRIBUTE_UNUSED;
+ PTR in1;
+{
+ AUXENT *ext = (AUXENT *) ext1;
+ union internal_auxent *in = (union internal_auxent *) in1;
+
+ switch (class)
+ {
+ case C_FILE:
+ if (ext->x_file.x_fname[0] == 0)
+ {
+ in->x_file.x_n.x_zeroes = 0;
+ in->x_file.x_n.x_offset =
+ bfd_h_get_32 (abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
+ }
+ else
+ {
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ }
+ return;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL)
+ {
+ in->x_scn.x_scnlen = GET_SCN_SCNLEN (abfd, ext);
+ in->x_scn.x_nreloc = GET_SCN_NRELOC (abfd, ext);
+ in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext);
+ in->x_scn.x_checksum =
+ bfd_h_get_32 (abfd, (bfd_byte *) ext->x_scn.x_checksum);
+ in->x_scn.x_associated =
+ bfd_h_get_16 (abfd, (bfd_byte *) ext->x_scn.x_associated);
+ in->x_scn.x_comdat =
+ bfd_h_get_8 (abfd, (bfd_byte *) ext->x_scn.x_comdat);
+ return;
+ }
+ break;
+ }
+
+ in->x_sym.x_tagndx.l = bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_tagndx);
+ in->x_sym.x_tvndx = bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_tvndx);
+
+ if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+ {
+ in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR (abfd, ext);
+ in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX (abfd, ext);
+ }
+ else
+ {
+ in->x_sym.x_fcnary.x_ary.x_dimen[0] =
+ bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
+ in->x_sym.x_fcnary.x_ary.x_dimen[1] =
+ bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
+ in->x_sym.x_fcnary.x_ary.x_dimen[2] =
+ bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
+ in->x_sym.x_fcnary.x_ary.x_dimen[3] =
+ bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
+ }
+
+ if (ISFCN (type))
+ {
+ in->x_sym.x_misc.x_fsize =
+ bfd_h_get_32 (abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize);
+ }
+ else
+ {
+ in->x_sym.x_misc.x_lnsz.x_lnno = GET_LNSZ_LNNO (abfd, ext);
+ in->x_sym.x_misc.x_lnsz.x_size = GET_LNSZ_SIZE (abfd, ext);
+ }
+}
+
+unsigned int
+_bfd_XXi_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
+ bfd *abfd;
+ PTR inp;
+ int type;
+ int class;
+ int indx ATTRIBUTE_UNUSED;
+ int numaux ATTRIBUTE_UNUSED;
+ PTR extp;
+{
+ union internal_auxent *in = (union internal_auxent *) inp;
+ AUXENT *ext = (AUXENT *) extp;
+
+ memset ((PTR) ext, 0, AUXESZ);
+ switch (class)
+ {
+ case C_FILE:
+ if (in->x_file.x_fname[0] == 0)
+ {
+ bfd_h_put_32 (abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes);
+ bfd_h_put_32 (abfd,
+ in->x_file.x_n.x_offset,
+ (bfd_byte *) ext->x_file.x_n.x_offset);
+ }
+ else
+ {
+ memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN);
+ }
+ return AUXESZ;
+
+ case C_STAT:
+ case C_LEAFSTAT:
+ case C_HIDDEN:
+ if (type == T_NULL)
+ {
+ PUT_SCN_SCNLEN (abfd, in->x_scn.x_scnlen, ext);
+ PUT_SCN_NRELOC (abfd, in->x_scn.x_nreloc, ext);
+ PUT_SCN_NLINNO (abfd, in->x_scn.x_nlinno, ext);
+ bfd_h_put_32 (abfd, in->x_scn.x_checksum,
+ (bfd_byte *) ext->x_scn.x_checksum);
+ bfd_h_put_16 (abfd, in->x_scn.x_associated,
+ (bfd_byte *) ext->x_scn.x_associated);
+ bfd_h_put_8 (abfd, in->x_scn.x_comdat,
+ (bfd_byte *) ext->x_scn.x_comdat);
+ return AUXESZ;
+ }
+ break;
+ }
+
+ bfd_h_put_32 (abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx);
+ bfd_h_put_16 (abfd, in->x_sym.x_tvndx, (bfd_byte *) ext->x_sym.x_tvndx);
+
+ if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class))
+ {
+ PUT_FCN_LNNOPTR (abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext);
+ PUT_FCN_ENDNDX (abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext);
+ }
+ else
+ {
+ bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0],
+ (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]);
+ bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1],
+ (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]);
+ bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2],
+ (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]);
+ bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3],
+ (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
+ }
+
+ if (ISFCN (type))
+ bfd_h_put_32 (abfd, in->x_sym.x_misc.x_fsize,
+ (bfd_byte *) ext->x_sym.x_misc.x_fsize);
+ else
+ {
+ PUT_LNSZ_LNNO (abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext);
+ PUT_LNSZ_SIZE (abfd, in->x_sym.x_misc.x_lnsz.x_size, ext);
+ }
+
+ return AUXESZ;
+}
+
+void
+_bfd_XXi_swap_lineno_in (abfd, ext1, in1)
+ bfd *abfd;
+ PTR ext1;
+ PTR in1;
+{
+ LINENO *ext = (LINENO *) ext1;
+ struct internal_lineno *in = (struct internal_lineno *) in1;
+
+ in->l_addr.l_symndx = bfd_h_get_32 (abfd, (bfd_byte *) ext->l_addr.l_symndx);
+ in->l_lnno = GET_LINENO_LNNO (abfd, ext);
+}
+
+unsigned int
+_bfd_XXi_swap_lineno_out (abfd, inp, outp)
+ bfd *abfd;
+ PTR inp;
+ PTR outp;
+{
+ struct internal_lineno *in = (struct internal_lineno *) inp;
+ struct external_lineno *ext = (struct external_lineno *) outp;
+ bfd_h_put_32 (abfd, in->l_addr.l_symndx, (bfd_byte *)
+ ext->l_addr.l_symndx);
+
+ PUT_LINENO_LNNO (abfd, in->l_lnno, ext);
+ return LINESZ;
+}
+
+void
+_bfd_XXi_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1)
+ bfd *abfd;
+ PTR aouthdr_ext1;
+ PTR aouthdr_int1;
+{
+ struct internal_extra_pe_aouthdr *a;
+ PEAOUTHDR *src = (PEAOUTHDR *) (aouthdr_ext1);
+ AOUTHDR *aouthdr_ext = (AOUTHDR *) aouthdr_ext1;
+ struct internal_aouthdr *aouthdr_int = (struct internal_aouthdr *)aouthdr_int1;
+
+ aouthdr_int->magic = bfd_h_get_16 (abfd, (bfd_byte *) aouthdr_ext->magic);
+ aouthdr_int->vstamp = bfd_h_get_16 (abfd, (bfd_byte *) aouthdr_ext->vstamp);
+ aouthdr_int->tsize =
+ GET_AOUTHDR_TSIZE (abfd, (bfd_byte *) aouthdr_ext->tsize);
+ aouthdr_int->dsize =
+ GET_AOUTHDR_DSIZE (abfd, (bfd_byte *) aouthdr_ext->dsize);
+ aouthdr_int->bsize =
+ GET_AOUTHDR_BSIZE (abfd, (bfd_byte *) aouthdr_ext->bsize);
+ aouthdr_int->entry =
+ GET_AOUTHDR_ENTRY (abfd, (bfd_byte *) aouthdr_ext->entry);
+ aouthdr_int->text_start =
+ GET_AOUTHDR_TEXT_START (abfd, (bfd_byte *) aouthdr_ext->text_start);
+#ifndef COFF_WITH_pep
+ /* PE32+ does not have data_start member! */
+ aouthdr_int->data_start =
+ GET_AOUTHDR_DATA_START (abfd, (bfd_byte *) aouthdr_ext->data_start);
+#endif
+
+ a = &aouthdr_int->pe;
+ a->ImageBase = GET_OPTHDR_IMAGE_BASE (abfd, (bfd_byte *) src->ImageBase);
+ a->SectionAlignment = bfd_h_get_32 (abfd, (bfd_byte *) src->SectionAlignment);
+ a->FileAlignment = bfd_h_get_32 (abfd, (bfd_byte *) src->FileAlignment);
+ a->MajorOperatingSystemVersion =
+ bfd_h_get_16 (abfd, (bfd_byte *) src->MajorOperatingSystemVersion);
+ a->MinorOperatingSystemVersion =
+ bfd_h_get_16 (abfd, (bfd_byte *) src->MinorOperatingSystemVersion);
+ a->MajorImageVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MajorImageVersion);
+ a->MinorImageVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MinorImageVersion);
+ a->MajorSubsystemVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MajorSubsystemVersion);
+ a->MinorSubsystemVersion = bfd_h_get_16 (abfd, (bfd_byte *) src->MinorSubsystemVersion);
+ a->Reserved1 = bfd_h_get_32 (abfd, (bfd_byte *) src->Reserved1);
+ a->SizeOfImage = bfd_h_get_32 (abfd, (bfd_byte *) src->SizeOfImage);
+ a->SizeOfHeaders = bfd_h_get_32 (abfd, (bfd_byte *) src->SizeOfHeaders);
+ a->CheckSum = bfd_h_get_32 (abfd, (bfd_byte *) src->CheckSum);
+ a->Subsystem = bfd_h_get_16 (abfd, (bfd_byte *) src->Subsystem);
+ a->DllCharacteristics = bfd_h_get_16 (abfd, (bfd_byte *) src->DllCharacteristics);
+ a->SizeOfStackReserve = GET_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, (bfd_byte *) src->SizeOfStackReserve);
+ a->SizeOfStackCommit = GET_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, (bfd_byte *) src->SizeOfStackCommit);
+ a->SizeOfHeapReserve = GET_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, (bfd_byte *) src->SizeOfHeapReserve);
+ a->SizeOfHeapCommit = GET_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, (bfd_byte *) src->SizeOfHeapCommit);
+ a->LoaderFlags = bfd_h_get_32 (abfd, (bfd_byte *) src->LoaderFlags);
+ a->NumberOfRvaAndSizes = bfd_h_get_32 (abfd, (bfd_byte *) src->NumberOfRvaAndSizes);
+
+ {
+ int idx;
+ for (idx = 0; idx < 16; idx++)
+ {
+ /* If data directory is empty, rva also should be 0. */
+ int size =
+ bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][1]);
+ a->DataDirectory[idx].Size = size;
+
+ if (size)
+ {
+ a->DataDirectory[idx].VirtualAddress =
+ bfd_h_get_32 (abfd, (bfd_byte *) src->DataDirectory[idx][0]);
+ }
+ else
+ a->DataDirectory[idx].VirtualAddress = 0;
+ }
+ }
+
+ if (aouthdr_int->entry)
+ {
+ aouthdr_int->entry += a->ImageBase;
+#ifndef COFF_WITH_pep
+ aouthdr_int->entry &= 0xffffffff;
+#endif
+ }
+ if (aouthdr_int->tsize)
+ {
+ aouthdr_int->text_start += a->ImageBase;
+#ifndef COFF_WITH_pep
+ aouthdr_int->text_start &= 0xffffffff;
+#endif
+ }
+#ifndef COFF_WITH_pep
+ /* PE32+ does not have data_start member! */
+ if (aouthdr_int->dsize)
+ {
+ aouthdr_int->data_start += a->ImageBase;
+ aouthdr_int->data_start &= 0xffffffff;
+ }
+#endif
+
+#ifdef POWERPC_LE_PE
+ /* These three fields are normally set up by ppc_relocate_section.
+ In the case of reading a file in, we can pick them up from the
+ DataDirectory. */
+ first_thunk_address = a->DataDirectory[12].VirtualAddress;
+ thunk_size = a->DataDirectory[12].Size;
+ import_table_size = a->DataDirectory[1].Size;
+#endif
+
+}
+
+/* A support function for below. */
+
+static void
+add_data_entry (abfd, aout, idx, name, base)
+ bfd *abfd;
+ struct internal_extra_pe_aouthdr *aout;
+ int idx;
+ char *name;
+ bfd_vma base;
+{
+ asection *sec = bfd_get_section_by_name (abfd, name);
+
+ /* add import directory information if it exists */
+ if ((sec != NULL)
+ && (coff_section_data (abfd, sec) != NULL)
+ && (pei_section_data (abfd, sec) != NULL))
+ {
+ /* If data directory is empty, rva also should be 0 */
+ int size = pei_section_data (abfd, sec)->virt_size;
+ aout->DataDirectory[idx].Size = size;
+
+ if (size)
+ {
+ aout->DataDirectory[idx].VirtualAddress =
+ (sec->vma - base) & 0xffffffff;
+ sec->flags |= SEC_DATA;
+ }
+ }
+}
+
+unsigned int
+_bfd_XXi_swap_aouthdr_out (abfd, in, out)
+ bfd *abfd;
+ PTR in;
+ PTR out;
+{
+ struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *) in;
+ pe_data_type *pe = pe_data (abfd);
+ struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr;
+ PEAOUTHDR *aouthdr_out = (PEAOUTHDR *) out;
+ bfd_vma sa, fa, ib;
+
+ if (pe->force_minimum_alignment)
+ {
+ if (!extra->FileAlignment)
+ extra->FileAlignment = PE_DEF_FILE_ALIGNMENT;
+ if (!extra->SectionAlignment)
+ extra->SectionAlignment = PE_DEF_SECTION_ALIGNMENT;
+ }
+
+ if (extra->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN)
+ extra->Subsystem = pe->target_subsystem;
+
+ sa = extra->SectionAlignment;
+ fa = extra->FileAlignment;
+ ib = extra->ImageBase;
+
+ if (aouthdr_in->tsize)
+ {
+ aouthdr_in->text_start -= ib;
+#ifndef COFF_WITH_pep
+ aouthdr_in->text_start &= 0xffffffff;
+#endif
+ }
+ if (aouthdr_in->dsize)
+ {
+ aouthdr_in->data_start -= ib;
+#ifndef COFF_WITH_pep
+ aouthdr_in->data_start &= 0xffffffff;
+#endif
+ }
+ if (aouthdr_in->entry)
+ {
+ aouthdr_in->entry -= ib;
+#ifndef COFF_WITH_pep
+ aouthdr_in->entry &= 0xffffffff;
+#endif
+ }
+
+#define FA(x) (((x) + fa -1 ) & (- fa))
+#define SA(x) (((x) + sa -1 ) & (- sa))
+
+ /* We like to have the sizes aligned. */
+
+ aouthdr_in->bsize = FA (aouthdr_in->bsize);
+
+ extra->NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES;
+
+ /* first null out all data directory entries .. */
+ memset (extra->DataDirectory, sizeof (extra->DataDirectory), 0);
+
+ add_data_entry (abfd, extra, 0, ".edata", ib);
+
+ /* Don't call add_data_entry for .idata$2 or .idata$5. It's done in
+ bfd_coff_final_link where all the required information is
+ available. */
+
+ /* However, until other .idata fixes are made (pending patch), the
+ entry for .idata is needed for backwards compatability. FIXME. */
+ add_data_entry (abfd, extra, 1, ".idata", ib);
+
+ add_data_entry (abfd, extra, 2, ".rsrc", ib);
+
+ add_data_entry (abfd, extra, 3, ".pdata", ib);
+
+ /* For some reason, the virtual size (which is what's set by
+ add_data_entry) for .reloc is not the same as the size recorded
+ in this slot by MSVC; it doesn't seem to cause problems (so far),
+ but since it's the best we've got, use it. It does do the right
+ thing for .pdata. */
+ if (pe->has_reloc_section)
+ add_data_entry (abfd, extra, 5, ".reloc", ib);
+
+ {
+ asection *sec;
+ bfd_vma dsize = 0;
+ bfd_vma isize = SA(abfd->sections->filepos);
+ bfd_vma tsize = 0;
+
+ for (sec = abfd->sections; sec; sec = sec->next)
+ {
+ int rounded = FA(sec->_raw_size);
+
+ if (sec->flags & SEC_DATA)
+ dsize += rounded;
+ if (sec->flags & SEC_CODE)
+ tsize += rounded;
+ /* The image size is the total VIRTUAL size (which is what is
+ in the virt_size field). Files have been seen (from MSVC
+ 5.0 link.exe) where the file size of the .data segment is
+ quite small compared to the virtual size. Without this
+ fix, strip munges the file. */
+ isize += SA (FA (pei_section_data (abfd, sec)->virt_size));
+ }
+
+ aouthdr_in->dsize = dsize;
+ aouthdr_in->tsize = tsize;
+ extra->SizeOfImage = isize;
+ }
+
+ extra->SizeOfHeaders = abfd->sections->filepos;
+ bfd_h_put_16 (abfd, aouthdr_in->magic, (bfd_byte *) aouthdr_out->standard.magic);
+
+#define LINKER_VERSION 256 /* That is, 2.56 */
+
+ /* This piece of magic sets the "linker version" field to
+ LINKER_VERSION. */
+ bfd_h_put_16 (abfd,
+ LINKER_VERSION / 100 + (LINKER_VERSION % 100) * 256,
+ (bfd_byte *) aouthdr_out->standard.vstamp);
+
+ PUT_AOUTHDR_TSIZE (abfd, aouthdr_in->tsize, (bfd_byte *) aouthdr_out->standard.tsize);
+ PUT_AOUTHDR_DSIZE (abfd, aouthdr_in->dsize, (bfd_byte *) aouthdr_out->standard.dsize);
+ PUT_AOUTHDR_BSIZE (abfd, aouthdr_in->bsize, (bfd_byte *) aouthdr_out->standard.bsize);
+ PUT_AOUTHDR_ENTRY (abfd, aouthdr_in->entry, (bfd_byte *) aouthdr_out->standard.entry);
+ PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start,
+ (bfd_byte *) aouthdr_out->standard.text_start);
+
+#ifndef COFF_WITH_pep
+ /* PE32+ does not have data_start member! */
+ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start,
+ (bfd_byte *) aouthdr_out->standard.data_start);
+#endif
+
+ PUT_OPTHDR_IMAGE_BASE (abfd, extra->ImageBase,
+ (bfd_byte *) aouthdr_out->ImageBase);
+ bfd_h_put_32 (abfd, extra->SectionAlignment,
+ (bfd_byte *) aouthdr_out->SectionAlignment);
+ bfd_h_put_32 (abfd, extra->FileAlignment,
+ (bfd_byte *) aouthdr_out->FileAlignment);
+ bfd_h_put_16 (abfd, extra->MajorOperatingSystemVersion,
+ (bfd_byte *) aouthdr_out->MajorOperatingSystemVersion);
+ bfd_h_put_16 (abfd, extra->MinorOperatingSystemVersion,
+ (bfd_byte *) aouthdr_out->MinorOperatingSystemVersion);
+ bfd_h_put_16 (abfd, extra->MajorImageVersion,
+ (bfd_byte *) aouthdr_out->MajorImageVersion);
+ bfd_h_put_16 (abfd, extra->MinorImageVersion,
+ (bfd_byte *) aouthdr_out->MinorImageVersion);
+ bfd_h_put_16 (abfd, extra->MajorSubsystemVersion,
+ (bfd_byte *) aouthdr_out->MajorSubsystemVersion);
+ bfd_h_put_16 (abfd, extra->MinorSubsystemVersion,
+ (bfd_byte *) aouthdr_out->MinorSubsystemVersion);
+ bfd_h_put_32 (abfd, extra->Reserved1,
+ (bfd_byte *) aouthdr_out->Reserved1);
+ bfd_h_put_32 (abfd, extra->SizeOfImage,
+ (bfd_byte *) aouthdr_out->SizeOfImage);
+ bfd_h_put_32 (abfd, extra->SizeOfHeaders,
+ (bfd_byte *) aouthdr_out->SizeOfHeaders);
+ bfd_h_put_32 (abfd, extra->CheckSum,
+ (bfd_byte *) aouthdr_out->CheckSum);
+ bfd_h_put_16 (abfd, extra->Subsystem,
+ (bfd_byte *) aouthdr_out->Subsystem);
+ bfd_h_put_16 (abfd, extra->DllCharacteristics,
+ (bfd_byte *) aouthdr_out->DllCharacteristics);
+ PUT_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, extra->SizeOfStackReserve,
+ (bfd_byte *) aouthdr_out->SizeOfStackReserve);
+ PUT_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, extra->SizeOfStackCommit,
+ (bfd_byte *) aouthdr_out->SizeOfStackCommit);
+ PUT_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, extra->SizeOfHeapReserve,
+ (bfd_byte *) aouthdr_out->SizeOfHeapReserve);
+ PUT_OPTHDR_SIZE_OF_HEAP_COMMIT (abfd, extra->SizeOfHeapCommit,
+ (bfd_byte *) aouthdr_out->SizeOfHeapCommit);
+ bfd_h_put_32 (abfd, extra->LoaderFlags,
+ (bfd_byte *) aouthdr_out->LoaderFlags);
+ bfd_h_put_32 (abfd, extra->NumberOfRvaAndSizes,
+ (bfd_byte *) aouthdr_out->NumberOfRvaAndSizes);
+ {
+ int idx;
+ for (idx = 0; idx < 16; idx++)
+ {
+ bfd_h_put_32 (abfd, extra->DataDirectory[idx].VirtualAddress,
+ (bfd_byte *) aouthdr_out->DataDirectory[idx][0]);
+ bfd_h_put_32 (abfd, extra->DataDirectory[idx].Size,
+ (bfd_byte *) aouthdr_out->DataDirectory[idx][1]);
+ }
+ }
+
+ return AOUTSZ;
+}
+
+unsigned int
+_bfd_XXi_only_swap_filehdr_out (abfd, in, out)
+ bfd *abfd;
+ PTR in;
+ PTR out;
+{
+ int idx;
+ struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
+ struct external_PEI_filehdr *filehdr_out = (struct external_PEI_filehdr *) out;
+
+ if (pe_data (abfd)->has_reloc_section)
+ filehdr_in->f_flags &= ~F_RELFLG;
+
+ if (pe_data (abfd)->dll)
+ filehdr_in->f_flags |= F_DLL;
+
+ filehdr_in->pe.e_magic = DOSMAGIC;
+ filehdr_in->pe.e_cblp = 0x90;
+ filehdr_in->pe.e_cp = 0x3;
+ filehdr_in->pe.e_crlc = 0x0;
+ filehdr_in->pe.e_cparhdr = 0x4;
+ filehdr_in->pe.e_minalloc = 0x0;
+ filehdr_in->pe.e_maxalloc = 0xffff;
+ filehdr_in->pe.e_ss = 0x0;
+ filehdr_in->pe.e_sp = 0xb8;
+ filehdr_in->pe.e_csum = 0x0;
+ filehdr_in->pe.e_ip = 0x0;
+ filehdr_in->pe.e_cs = 0x0;
+ filehdr_in->pe.e_lfarlc = 0x40;
+ filehdr_in->pe.e_ovno = 0x0;
+
+ for (idx = 0; idx < 4; idx++)
+ filehdr_in->pe.e_res[idx] = 0x0;
+
+ filehdr_in->pe.e_oemid = 0x0;
+ filehdr_in->pe.e_oeminfo = 0x0;
+
+ for (idx = 0; idx < 10; idx++)
+ filehdr_in->pe.e_res2[idx] = 0x0;
+
+ filehdr_in->pe.e_lfanew = 0x80;
+
+ /* This next collection of data are mostly just characters. It
+ appears to be constant within the headers put on NT exes. */
+ filehdr_in->pe.dos_message[0] = 0x0eba1f0e;
+ filehdr_in->pe.dos_message[1] = 0xcd09b400;
+ filehdr_in->pe.dos_message[2] = 0x4c01b821;
+ filehdr_in->pe.dos_message[3] = 0x685421cd;
+ filehdr_in->pe.dos_message[4] = 0x70207369;
+ filehdr_in->pe.dos_message[5] = 0x72676f72;
+ filehdr_in->pe.dos_message[6] = 0x63206d61;
+ filehdr_in->pe.dos_message[7] = 0x6f6e6e61;
+ filehdr_in->pe.dos_message[8] = 0x65622074;
+ filehdr_in->pe.dos_message[9] = 0x6e757220;
+ filehdr_in->pe.dos_message[10] = 0x206e6920;
+ filehdr_in->pe.dos_message[11] = 0x20534f44;
+ filehdr_in->pe.dos_message[12] = 0x65646f6d;
+ filehdr_in->pe.dos_message[13] = 0x0a0d0d2e;
+ filehdr_in->pe.dos_message[14] = 0x24;
+ filehdr_in->pe.dos_message[15] = 0x0;
+ filehdr_in->pe.nt_signature = NT_SIGNATURE;
+
+ bfd_h_put_16 (abfd, filehdr_in->f_magic, (bfd_byte *) filehdr_out->f_magic);
+ bfd_h_put_16 (abfd, filehdr_in->f_nscns, (bfd_byte *) filehdr_out->f_nscns);
+
+ bfd_h_put_32 (abfd, time (0), (bfd_byte *) filehdr_out->f_timdat);
+ PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr,
+ (bfd_byte *) filehdr_out->f_symptr);
+ bfd_h_put_32 (abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms);
+ bfd_h_put_16 (abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr);
+ bfd_h_put_16 (abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags);
+
+ /* put in extra dos header stuff. This data remains essentially
+ constant, it just has to be tacked on to the beginning of all exes
+ for NT */
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_magic, (bfd_byte *) filehdr_out->e_magic);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_cblp, (bfd_byte *) filehdr_out->e_cblp);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_cp, (bfd_byte *) filehdr_out->e_cp);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_crlc, (bfd_byte *) filehdr_out->e_crlc);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_cparhdr,
+ (bfd_byte *) filehdr_out->e_cparhdr);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_minalloc,
+ (bfd_byte *) filehdr_out->e_minalloc);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_maxalloc,
+ (bfd_byte *) filehdr_out->e_maxalloc);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_ss, (bfd_byte *) filehdr_out->e_ss);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_sp, (bfd_byte *) filehdr_out->e_sp);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_csum, (bfd_byte *) filehdr_out->e_csum);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_ip, (bfd_byte *) filehdr_out->e_ip);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_cs, (bfd_byte *) filehdr_out->e_cs);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_lfarlc, (bfd_byte *) filehdr_out->e_lfarlc);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_ovno, (bfd_byte *) filehdr_out->e_ovno);
+ {
+ int idx;
+ for (idx = 0; idx < 4; idx++)
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_res[idx],
+ (bfd_byte *) filehdr_out->e_res[idx]);
+ }
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_oemid, (bfd_byte *) filehdr_out->e_oemid);
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_oeminfo,
+ (bfd_byte *) filehdr_out->e_oeminfo);
+ {
+ int idx;
+ for (idx = 0; idx < 10; idx++)
+ bfd_h_put_16 (abfd, filehdr_in->pe.e_res2[idx],
+ (bfd_byte *) filehdr_out->e_res2[idx]);
+ }
+ bfd_h_put_32 (abfd, filehdr_in->pe.e_lfanew, (bfd_byte *) filehdr_out->e_lfanew);
+
+ {
+ int idx;
+ for (idx = 0; idx < 16; idx++)
+ bfd_h_put_32 (abfd, filehdr_in->pe.dos_message[idx],
+ (bfd_byte *) filehdr_out->dos_message[idx]);
+ }
+
+ /* Also put in the NT signature. */
+ bfd_h_put_32 (abfd, filehdr_in->pe.nt_signature,
+ (bfd_byte *) filehdr_out->nt_signature);
+
+ return FILHSZ;
+}
+
+unsigned int
+_bfd_XX_only_swap_filehdr_out (abfd, in, out)
+ bfd *abfd;
+ PTR in;
+ PTR out;
+{
+ struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in;
+ FILHDR *filehdr_out = (FILHDR *) out;
+
+ bfd_h_put_16 (abfd, filehdr_in->f_magic, (bfd_byte *) filehdr_out->f_magic);
+ bfd_h_put_16 (abfd, filehdr_in->f_nscns, (bfd_byte *) filehdr_out->f_nscns);
+ bfd_h_put_32 (abfd, filehdr_in->f_timdat, (bfd_byte *) filehdr_out->f_timdat);
+ PUT_FILEHDR_SYMPTR (abfd, (bfd_vma) filehdr_in->f_symptr,
+ (bfd_byte *) filehdr_out->f_symptr);
+ bfd_h_put_32 (abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms);
+ bfd_h_put_16 (abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr);
+ bfd_h_put_16 (abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags);
+
+ return FILHSZ;
+}
+
+unsigned int
+_bfd_XXi_swap_scnhdr_out (abfd, in, out)
+ bfd *abfd;
+ PTR in;
+ PTR out;
+{
+ struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in;
+ SCNHDR *scnhdr_ext = (SCNHDR *) out;
+ unsigned int ret = SCNHSZ;
+ bfd_vma ps;
+ bfd_vma ss;
+
+ memcpy (scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
+
+ PUT_SCNHDR_VADDR (abfd,
+ ((scnhdr_int->s_vaddr
+ - pe_data (abfd)->pe_opthdr.ImageBase)
+ & 0xffffffff),
+ (bfd_byte *) scnhdr_ext->s_vaddr);
+
+ /* NT wants the size data to be rounded up to the next
+ NT_FILE_ALIGNMENT, but zero if it has no content (as in .bss,
+ sometimes). */
+
+ if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0)
+ {
+ ps = scnhdr_int->s_size;
+ ss = 0;
+ }
+ else
+ {
+ ps = scnhdr_int->s_paddr;
+ ss = scnhdr_int->s_size;
+ }
+
+ PUT_SCNHDR_SIZE (abfd, ss,
+ (bfd_byte *) scnhdr_ext->s_size);
+
+ /* s_paddr in PE is really the virtual size. */
+ PUT_SCNHDR_PADDR (abfd, ps, (bfd_byte *) scnhdr_ext->s_paddr);
+
+ PUT_SCNHDR_SCNPTR (abfd, scnhdr_int->s_scnptr,
+ (bfd_byte *) scnhdr_ext->s_scnptr);
+ PUT_SCNHDR_RELPTR (abfd, scnhdr_int->s_relptr,
+ (bfd_byte *) scnhdr_ext->s_relptr);
+ PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr,
+ (bfd_byte *) scnhdr_ext->s_lnnoptr);
+
+ /* Extra flags must be set when dealing with NT. All sections should also
+ have the IMAGE_SCN_MEM_READ (0x40000000) flag set. In addition, the
+ .text section must have IMAGE_SCN_MEM_EXECUTE (0x20000000) and the data
+ sections (.idata, .data, .bss, .CRT) must have IMAGE_SCN_MEM_WRITE set
+ (this is especially important when dealing with the .idata section since
+ the addresses for routines from .dlls must be overwritten). If .reloc
+ section data is ever generated, we must add IMAGE_SCN_MEM_DISCARDABLE
+ (0x02000000). Also, the resource data should also be read and
+ writable. */
+
+ /* FIXME: alignment is also encoded in this field, at least on ppc (krk) */
+ /* FIXME: even worse, I don't see how to get the original alignment field*/
+ /* back... */
+
+ {
+ int flags = scnhdr_int->s_flags;
+ bfd_h_put_32 (abfd, flags, (bfd_byte *) scnhdr_ext->s_flags);
+ }
+
+ if (coff_data (abfd)->link_info
+ && ! coff_data (abfd)->link_info->relocateable
+ && ! coff_data (abfd)->link_info->shared
+ && strcmp (scnhdr_int->s_name, ".text") == 0)
+ {
+ /* By inference from looking at MS output, the 32 bit field
+ which is the combintion of the number_of_relocs and
+ number_of_linenos is used for the line number count in
+ executables. A 16-bit field won't do for cc1. The MS
+ document says that the number of relocs is zero for
+ executables, but the 17-th bit has been observed to be there.
+ Overflow is not an issue: a 4G-line program will overflow a
+ bunch of other fields long before this! */
+ bfd_h_put_16 (abfd, scnhdr_int->s_nlnno & 0xffff,
+ (bfd_byte *) scnhdr_ext->s_nlnno);
+ bfd_h_put_16 (abfd, scnhdr_int->s_nlnno >> 16,
+ (bfd_byte *) scnhdr_ext->s_nreloc);
+ }
+ else
+ {
+ if (scnhdr_int->s_nlnno <= 0xffff)
+ bfd_h_put_16 (abfd, scnhdr_int->s_nlnno,
+ (bfd_byte *) scnhdr_ext->s_nlnno);
+ else
+ {
+ (*_bfd_error_handler) (_("%s: line number overflow: 0x%lx > 0xffff"),
+ bfd_get_filename (abfd),
+ scnhdr_int->s_nlnno);
+ bfd_set_error (bfd_error_file_truncated);
+ bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
+ ret = 0;
+ }
+ if (scnhdr_int->s_nreloc <= 0xffff)
+ bfd_h_put_16 (abfd, scnhdr_int->s_nreloc,
+ (bfd_byte *) scnhdr_ext->s_nreloc);
+ else
+ {
+ /* PE can deal with large #s of relocs, but not here */
+ bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc);
+ scnhdr_int->s_flags |= IMAGE_SCN_LNK_NRELOC_OVFL;
+ bfd_h_put_32 (abfd, scnhdr_int->s_flags,
+ (bfd_byte *) scnhdr_ext->s_flags);
+#if 0
+ (*_bfd_error_handler) (_("%s: reloc overflow 1: 0x%lx > 0xffff"),
+ bfd_get_filename (abfd),
+ scnhdr_int->s_nreloc);
+ bfd_set_error (bfd_error_file_truncated);
+ bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc);
+ ret = 0;
+#endif
+ }
+ }
+ return ret;
+}
+
+static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = {
+ N_("Export Directory [.edata (or where ever we found it)]"),
+ N_("Import Directory [parts of .idata]"),
+ N_("Resource Directory [.rsrc]"),
+ N_("Exception Directory [.pdata]"),
+ N_("Security Directory"),
+ N_("Base Relocation Directory [.reloc]"),
+ N_("Debug Directory"),
+ N_("Description Directory"),
+ N_("Special Directory"),
+ N_("Thread Storage Directory [.tls]"),
+ N_("Load Configuration Directory"),
+ N_("Bound Import Directory"),
+ N_("Import Address Table Directory"),
+ N_("Delay Import Directory"),
+ N_("Reserved"),
+ N_("Reserved")
+};
+
+/**********************************************************************/
+#ifdef POWERPC_LE_PE
+/* The code for the PPC really falls in the "architecture dependent"
+ category. However, it's not clear that anyone will ever care, so
+ we're ignoring the issue for now; if/when PPC matters, some of this
+ may need to go into peicode.h, or arguments passed to enable the
+ PPC- specific code. */
+#endif
+
+/**********************************************************************/
+static boolean
+pe_print_idata (abfd, vfile)
+ bfd *abfd;
+ PTR vfile;
+{
+ FILE *file = (FILE *) vfile;
+ bfd_byte *data;
+ asection *section;
+ bfd_signed_vma adj;
+
+#ifdef POWERPC_LE_PE
+ asection *rel_section = bfd_get_section_by_name (abfd, ".reldata");
+#endif
+
+ bfd_size_type datasize = 0;
+ bfd_size_type dataoff;
+ bfd_size_type i;
+ int onaline = 20;
+
+ pe_data_type *pe = pe_data (abfd);
+ struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr;
+
+ bfd_vma addr;
+
+ addr = extra->DataDirectory[1].VirtualAddress;
+
+ if (addr == 0 && extra->DataDirectory[1].Size == 0)
+ {
+ /* Maybe the extra header isn't there. Look for the section. */
+ section = bfd_get_section_by_name (abfd, ".idata");
+ if (section == NULL)
+ return true;
+
+ addr = section->vma;
+ datasize = bfd_section_size (abfd, section);
+ if (datasize == 0)
+ return true;
+ }
+ else
+ {
+ addr += extra->ImageBase;
+ for (section = abfd->sections; section != NULL; section = section->next)
+ {
+ datasize = bfd_section_size (abfd, section);
+ if (addr >= section->vma && addr < section->vma + datasize)
+ break;
+ }
+
+ if (section == NULL)
+ {
+ fprintf (file,
+ _("\nThere is an import table, but the section containing it could not be found\n"));
+ return true;
+ }
+ }
+
+ fprintf (file, _("\nThere is an import table in %s at 0x%lx\n"),
+ section->name, (unsigned long) addr);
+
+ dataoff = addr - section->vma;
+ datasize -= dataoff;
+
+#ifdef POWERPC_LE_PE
+ if (rel_section != 0 && bfd_section_size (abfd, rel_section) != 0)
+ {
+ /* The toc address can be found by taking the starting address,
+ which on the PPC locates a function descriptor. The
+ descriptor consists of the function code starting address
+ followed by the address of the toc. The starting address we
+ get from the bfd, and the descriptor is supposed to be in the
+ .reldata section. */
+
+ bfd_vma loadable_toc_address;
+ bfd_vma toc_address;
+ bfd_vma start_address;
+ bfd_byte *data = 0;
+ int offset;
+
+ data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd,
+ rel_section));
+ if (data == NULL && bfd_section_size (abfd, rel_section) != 0)
+ return false;
+
+ bfd_get_section_contents (abfd,
+ rel_section,
+ (PTR) data, 0,
+ bfd_section_size (abfd, rel_section));
+
+ offset = abfd->start_address - rel_section->vma;
+
+ start_address = bfd_get_32 (abfd, data + offset);
+ loadable_toc_address = bfd_get_32 (abfd, data + offset + 4);
+ toc_address = loadable_toc_address - 32768;
+
+ fprintf (file,
+ _("\nFunction descriptor located at the start address: %04lx\n"),
+ (unsigned long int) (abfd->start_address));
+ fprintf (file,
+ _("\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"),
+ start_address, loadable_toc_address, toc_address);
+ }
+ else
+ {
+ fprintf (file,
+ _("\nNo reldata section! Function descriptor not decoded.\n"));
+ }
+#endif
+
+ fprintf (file,
+ _("\nThe Import Tables (interpreted %s section contents)\n"),
+ section->name);
+ fprintf (file,
+ _(" vma: Hint Time Forward DLL First\n"));
+ fprintf (file,
+ _(" Table Stamp Chain Name Thunk\n"));
+
+ data = (bfd_byte *) bfd_malloc (dataoff + datasize);
+ if (data == NULL)
+ return false;
+
+ /* Read the whole section. Some of the fields might be before dataoff. */
+ if (! bfd_get_section_contents (abfd, section, (PTR) data,
+ 0, dataoff + datasize))
+ return false;
+
+ adj = section->vma - extra->ImageBase;
+
+ for (i = 0; i < datasize; i += onaline)
+ {
+ bfd_vma hint_addr;
+ bfd_vma time_stamp;
+ bfd_vma forward_chain;
+ bfd_vma dll_name;
+ bfd_vma first_thunk;
+ int idx = 0;
+ bfd_size_type j;
+ char *dll;
+
+ /* print (i + extra->DataDirectory[1].VirtualAddress) */
+ fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff));
+
+ if (i + 20 > datasize)
+ {
+ /* Check stuff. */
+ ;
+ }
+
+ hint_addr = bfd_get_32 (abfd, data + i + dataoff);
+ time_stamp = bfd_get_32 (abfd, data + i + 4 + dataoff);
+ forward_chain = bfd_get_32 (abfd, data + i + 8 + dataoff);
+ dll_name = bfd_get_32 (abfd, data + i + 12 + dataoff);
+ first_thunk = bfd_get_32 (abfd, data + i + 16 + dataoff);
+
+ fprintf (file, "%08lx %08lx %08lx %08lx %08lx\n",
+ (unsigned long) hint_addr,
+ (unsigned long) time_stamp,
+ (unsigned long) forward_chain,
+ (unsigned long) dll_name,
+ (unsigned long) first_thunk);
+
+ if (hint_addr == 0 && first_thunk == 0)
+ break;
+
+ dll = (char *) data + dll_name - adj;
+ fprintf (file, _("\n\tDLL Name: %s\n"), dll);
+
+ if (hint_addr != 0)
+ {
+ fprintf (file, _("\tvma: Hint/Ord Member-Name\n"));
+
+ idx = hint_addr - adj;
+
+ for (j = 0; j < datasize; j += 4)
+ {
+ unsigned long member = bfd_get_32 (abfd, data + idx + j);
+
+ if (member == 0)
+ break;
+ if (member & 0x80000000)
+ fprintf (file, "\t%04lx\t %4lu", member,
+ member & 0x7fffffff);
+ else
+ {
+ int ordinal;
+ char *member_name;
+
+ ordinal = bfd_get_16 (abfd, data + member - adj);
+ member_name = (char *) data + member - adj + 2;
+ fprintf (file, "\t%04lx\t %4d %s",
+ member, ordinal, member_name);
+ }
+
+ /* If the time stamp is not zero, the import address
+ table holds actual addresses. */
+ if (time_stamp != 0
+ && first_thunk != 0
+ && first_thunk != hint_addr)
+ fprintf (file, "\t%04lx",
+ (long) bfd_get_32 (abfd, data + first_thunk - adj + j));
+
+ fprintf (file, "\n");
+ }
+ }
+
+ if (hint_addr != first_thunk && time_stamp == 0)
+ {
+ int differ = 0;
+ int idx2;
+
+ idx2 = first_thunk - adj;
+
+ for (j = 0; j < datasize; j += 4)
+ {
+ int ordinal;
+ char *member_name;
+ bfd_vma hint_member = 0;
+ bfd_vma iat_member;
+
+ if (hint_addr != 0)
+ hint_member = bfd_get_32 (abfd, data + idx + j);
+ iat_member = bfd_get_32 (abfd, data + idx2 + j);
+
+ if (hint_addr == 0 && iat_member == 0)
+ break;
+
+ if (hint_addr == 0 || hint_member != iat_member)
+ {
+ if (differ == 0)
+ {
+ fprintf (file,
+ _("\tThe Import Address Table (difference found)\n"));
+ fprintf (file, _("\tvma: Hint/Ord Member-Name\n"));
+ differ = 1;
+ }
+ if (iat_member == 0)
+ {
+ fprintf (file,
+ _("\t>>> Ran out of IAT members!\n"));
+ }
+ else
+ {
+ ordinal = bfd_get_16 (abfd, data + iat_member - adj);
+ member_name = (char *) data + iat_member - adj + 2;
+ fprintf (file, "\t%04lx\t %4d %s\n",
+ (unsigned long) iat_member,
+ ordinal,
+ member_name);
+ }
+ }
+
+ if (hint_addr != 0 && hint_member == 0)
+ break;
+ }
+ if (differ == 0)
+ {
+ fprintf (file,
+ _("\tThe Import Address Table is identical\n"));
+ }
+ }
+
+ fprintf (file, "\n");
+
+ }
+
+ free (data);
+
+ return true;
+}
+
+static boolean
+pe_print_edata (abfd, vfile)
+ bfd *abfd;
+ PTR vfile;
+{
+ FILE *file = (FILE *) vfile;
+ bfd_byte *data;
+ asection *section;
+
+ bfd_size_type datasize = 0;
+ bfd_size_type dataoff;
+ bfd_size_type i;
+
+ bfd_signed_vma adj;
+ struct EDT_type {
+ long export_flags; /* reserved - should be zero */
+ long time_stamp;
+ short major_ver;
+ short minor_ver;
+ bfd_vma name; /* rva - relative to image base */
+ long base; /* ordinal base */
+ unsigned long num_functions; /* Number in the export address table */
+ unsigned long num_names; /* Number in the name pointer table */
+ bfd_vma eat_addr; /* rva to the export address table */
+ bfd_vma npt_addr; /* rva to the Export Name Pointer Table */
+ bfd_vma ot_addr; /* rva to the Ordinal Table */
+ } edt;
+
+ pe_data_type *pe = pe_data (abfd);
+ struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr;
+
+ bfd_vma addr;
+
+ addr = extra->DataDirectory[0].VirtualAddress;
+
+ if (addr == 0 && extra->DataDirectory[0].Size == 0)
+ {
+ /* Maybe the extra header isn't there. Look for the section. */
+ section = bfd_get_section_by_name (abfd, ".edata");
+ if (section == NULL)
+ return true;
+
+ addr = section->vma;
+ datasize = bfd_section_size (abfd, section);
+ if (datasize == 0)
+ return true;
+ }
+ else
+ {
+ addr += extra->ImageBase;
+ for (section = abfd->sections; section != NULL; section = section->next)
+ {
+ datasize = bfd_section_size (abfd, section);
+ if (addr >= section->vma && addr < section->vma + datasize)
+ break;
+ }
+
+ if (section == NULL)
+ {
+ fprintf (file,
+ _("\nThere is an export table, but the section containing it could not be found\n"));
+ return true;
+ }
+ }
+
+ fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"),
+ section->name, (unsigned long) addr);
+
+ dataoff = addr - section->vma;
+ datasize -= dataoff;
+
+ data = (bfd_byte *) bfd_malloc (datasize);
+ if (data == NULL)
+ return false;
+
+ if (! bfd_get_section_contents (abfd, section, (PTR) data, dataoff,
+ datasize))
+ return false;
+
+ /* Go get Export Directory Table. */
+ edt.export_flags = bfd_get_32 (abfd, data + 0);
+ edt.time_stamp = bfd_get_32 (abfd, data + 4);
+ edt.major_ver = bfd_get_16 (abfd, data + 8);
+ edt.minor_ver = bfd_get_16 (abfd, data + 10);
+ edt.name = bfd_get_32 (abfd, data + 12);
+ edt.base = bfd_get_32 (abfd, data + 16);
+ edt.num_functions = bfd_get_32 (abfd, data + 20);
+ edt.num_names = bfd_get_32 (abfd, data + 24);
+ edt.eat_addr = bfd_get_32 (abfd, data + 28);
+ edt.npt_addr = bfd_get_32 (abfd, data + 32);
+ edt.ot_addr = bfd_get_32 (abfd, data + 36);
+
+ adj = section->vma - extra->ImageBase + dataoff;
+
+ /* Dump the EDT first first */
+ fprintf (file,
+ _("\nThe Export Tables (interpreted %s section contents)\n\n"),
+ section->name);
+
+ fprintf (file,
+ _("Export Flags \t\t\t%lx\n"), (unsigned long) edt.export_flags);
+
+ fprintf (file,
+ _("Time/Date stamp \t\t%lx\n"), (unsigned long) edt.time_stamp);
+
+ fprintf (file,
+ _("Major/Minor \t\t\t%d/%d\n"), edt.major_ver, edt.minor_ver);
+
+ fprintf (file,
+ _("Name \t\t\t\t"));
+ fprintf_vma (file, edt.name);
+ fprintf (file,
+ " %s\n", data + edt.name - adj);
+
+ fprintf (file,
+ _("Ordinal Base \t\t\t%ld\n"), edt.base);
+
+ fprintf (file,
+ _("Number in:\n"));
+
+ fprintf (file,
+ _("\tExport Address Table \t\t%08lx\n"),
+ edt.num_functions);
+
+ fprintf (file,
+ _("\t[Name Pointer/Ordinal] Table\t%08lx\n"), edt.num_names);
+
+ fprintf (file,
+ _("Table Addresses\n"));
+
+ fprintf (file,
+ _("\tExport Address Table \t\t"));
+ fprintf_vma (file, edt.eat_addr);
+ fprintf (file, "\n");
+
+ fprintf (file,
+ _("\tName Pointer Table \t\t"));
+ fprintf_vma (file, edt.npt_addr);
+ fprintf (file, "\n");
+
+ fprintf (file,
+ _("\tOrdinal Table \t\t\t"));
+ fprintf_vma (file, edt.ot_addr);
+ fprintf (file, "\n");
+
+ /* The next table to find is the Export Address Table. It's basically
+ a list of pointers that either locate a function in this dll, or
+ forward the call to another dll. Something like:
+ typedef union {
+ long export_rva;
+ long forwarder_rva;
+ } export_address_table_entry;
+ */
+
+ fprintf (file,
+ _("\nExport Address Table -- Ordinal Base %ld\n"),
+ edt.base);
+
+ for (i = 0; i < edt.num_functions; ++i)
+ {
+ bfd_vma eat_member = bfd_get_32 (abfd,
+ data + edt.eat_addr + (i * 4) - adj);
+ if (eat_member == 0)
+ continue;
+
+ if (eat_member - adj <= datasize)
+ {
+ /* This rva is to a name (forwarding function) in our section. */
+ /* Should locate a function descriptor. */
+ fprintf (file,
+ "\t[%4ld] +base[%4ld] %04lx %s -- %s\n",
+ (long) i,
+ (long) (i + edt.base),
+ (unsigned long) eat_member,
+ _("Forwarder RVA"),
+ data + eat_member - adj);
+ }
+ else
+ {
+ /* Should locate a function descriptor in the reldata section. */
+ fprintf (file,
+ "\t[%4ld] +base[%4ld] %04lx %s\n",
+ (long) i,
+ (long) (i + edt.base),
+ (unsigned long) eat_member,
+ _("Export RVA"));
+ }
+ }
+
+ /* The Export Name Pointer Table is paired with the Export Ordinal Table. */
+ /* Dump them in parallel for clarity. */
+ fprintf (file,
+ _("\n[Ordinal/Name Pointer] Table\n"));
+
+ for (i = 0; i < edt.num_names; ++i)
+ {
+ bfd_vma name_ptr = bfd_get_32 (abfd,
+ data +
+ edt.npt_addr
+ + (i*4) - adj);
+
+ char *name = (char *) data + name_ptr - adj;
+
+ bfd_vma ord = bfd_get_16 (abfd,
+ data +
+ edt.ot_addr
+ + (i*2) - adj);
+ fprintf (file,
+ "\t[%4ld] %s\n", (long) ord, name);
+ }
+
+ free (data);
+
+ return true;
+}
+
+/* This really is architecture dependent. On IA-64, a .pdata entry
+ consists of three dwords containing relative virtual addresses that
+ specify the start and end address of the code range the entry
+ covers and the address of the corresponding unwind info data. */
+
+static boolean
+pe_print_pdata (abfd, vfile)
+ bfd *abfd;
+ PTR vfile;
+{
+#ifdef COFF_WITH_pep
+# define PDATA_ROW_SIZE (3*8)
+#else
+# define PDATA_ROW_SIZE (5*4)
+#endif
+ FILE *file = (FILE *) vfile;
+ bfd_byte *data = 0;
+ asection *section = bfd_get_section_by_name (abfd, ".pdata");
+ bfd_size_type datasize = 0;
+ bfd_size_type i;
+ bfd_size_type start, stop;
+ int onaline = PDATA_ROW_SIZE;
+
+ if (section == NULL
+ || coff_section_data (abfd, section) == NULL
+ || pei_section_data (abfd, section) == NULL)
+ return true;
+
+ stop = pei_section_data (abfd, section)->virt_size;
+ if ((stop % onaline) != 0)
+ fprintf (file,
+ _("Warning, .pdata section size (%ld) is not a multiple of %d\n"),
+ (long) stop, onaline);
+
+ fprintf (file,
+ _("\nThe Function Table (interpreted .pdata section contents)\n"));
+#ifdef COFF_WITH_pep
+ fprintf (file,
+ _(" vma:\t\t\tBegin Address End Address Unwind Info\n"));
+#else
+ fprintf (file,
+ _(" vma:\t\tBegin End EH EH PrologEnd Exception\n"));
+ fprintf (file,
+ _(" \t\tAddress Address Handler Data Address Mask\n"));
+#endif
+
+ if (bfd_section_size (abfd, section) == 0)
+ return true;
+
+ data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section));
+ datasize = bfd_section_size (abfd, section);
+ if (data == NULL && datasize != 0)
+ return false;
+
+ bfd_get_section_contents (abfd,
+ section,
+ (PTR) data, 0,
+ bfd_section_size (abfd, section));
+
+ start = 0;
+
+ for (i = start; i < stop; i += onaline)
+ {
+ bfd_vma begin_addr;
+ bfd_vma end_addr;
+ bfd_vma eh_handler;
+ bfd_vma eh_data;
+ bfd_vma prolog_end_addr;
+ int em_data;
+
+ if (i + PDATA_ROW_SIZE > stop)
+ break;
+
+ begin_addr = GET_PDATA_ENTRY (abfd, data + i );
+ end_addr = GET_PDATA_ENTRY (abfd, data + i + 4);
+ eh_handler = GET_PDATA_ENTRY (abfd, data + i + 8);
+ eh_data = GET_PDATA_ENTRY (abfd, data + i + 12);
+ prolog_end_addr = GET_PDATA_ENTRY (abfd, data + i + 16);
+
+ if (begin_addr == 0 && end_addr == 0 && eh_handler == 0
+ && eh_data == 0 && prolog_end_addr == 0)
+ {
+ /* We are probably into the padding of the section now. */
+ break;
+ }
+
+ em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3);
+ eh_handler &= ~(bfd_vma) 0x3;
+ prolog_end_addr &= ~(bfd_vma) 0x3;
+
+ fputc (' ', file);
+ fprintf_vma (file, i + section->vma); fputc ('\t', file);
+ fprintf_vma (file, begin_addr); fputc (' ', file);
+ fprintf_vma (file, end_addr); fputc (' ', file);
+ fprintf_vma (file, eh_handler);
+#ifndef COFF_WITH_pep
+ fputc (' ', file);
+ fprintf_vma (file, eh_data); fputc (' ', file);
+ fprintf_vma (file, prolog_end_addr);
+ fprintf (file, " %x", em_data);
+#endif
+
+#ifdef POWERPC_LE_PE
+ if (eh_handler == 0 && eh_data != 0)
+ {
+ /* Special bits here, although the meaning may be a little
+ mysterious. The only one I know for sure is 0x03. */
+ /* Code Significance */
+ /* 0x00 None */
+ /* 0x01 Register Save Millicode */
+ /* 0x02 Register Restore Millicode */
+ /* 0x03 Glue Code Sequence */
+ switch (eh_data)
+ {
+ case 0x01:
+ fprintf (file, _(" Register save millicode"));
+ break;
+ case 0x02:
+ fprintf (file, _(" Register restore millicode"));
+ break;
+ case 0x03:
+ fprintf (file, _(" Glue code sequence"));
+ break;
+ default:
+ break;
+ }
+ }
+#endif
+ fprintf (file, "\n");
+ }
+
+ free (data);
+
+ return true;
+}
+
+#define IMAGE_REL_BASED_HIGHADJ 4
+static const char * const tbl[] = {
+ "ABSOLUTE",
+ "HIGH",
+ "LOW",
+ "HIGHLOW",
+ "HIGHADJ",
+ "MIPS_JMPADDR",
+ "SECTION",
+ "REL32",
+ "RESERVED1",
+ "MIPS_JMPADDR16",
+ "DIR64",
+ "HIGH3ADJ"
+ "UNKNOWN", /* MUST be last */
+};
+
+static boolean
+pe_print_reloc (abfd, vfile)
+ bfd *abfd;
+ PTR vfile;
+{
+ FILE *file = (FILE *) vfile;
+ bfd_byte *data = 0;
+ asection *section = bfd_get_section_by_name (abfd, ".reloc");
+ bfd_size_type datasize = 0;
+ bfd_size_type i;
+ bfd_size_type start, stop;
+
+ if (section == NULL)
+ return true;
+
+ if (bfd_section_size (abfd, section) == 0)
+ return true;
+
+ fprintf (file,
+ _("\n\nPE File Base Relocations (interpreted .reloc section contents)\n"));
+
+ data = (bfd_byte *) bfd_malloc ((size_t) bfd_section_size (abfd, section));
+ datasize = bfd_section_size (abfd, section);
+ if (data == NULL && datasize != 0)
+ return false;
+
+ bfd_get_section_contents (abfd,
+ section,
+ (PTR) data, 0,
+ bfd_section_size (abfd, section));
+
+ start = 0;
+
+ stop = bfd_section_size (abfd, section);
+
+ for (i = start; i < stop;)
+ {
+ int j;
+ bfd_vma virtual_address;
+ long number, size;
+
+ /* The .reloc section is a sequence of blocks, with a header consisting
+ of two 32 bit quantities, followed by a number of 16 bit entries */
+
+ virtual_address = bfd_get_32 (abfd, data+i);
+ size = bfd_get_32 (abfd, data+i+4);
+ number = (size - 8) / 2;
+
+ if (size == 0)
+ {
+ break;
+ }
+
+ fprintf (file,
+ _("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"),
+ (unsigned long) virtual_address, size, size, number);
+
+ for (j = 0; j < number; ++j)
+ {
+ unsigned short e = bfd_get_16 (abfd, data + i + 8 + j * 2);
+ unsigned int t = (e & 0xF000) >> 12;
+ int off = e & 0x0FFF;
+
+ if (t >= sizeof (tbl) / sizeof (tbl[0]))
+ t = (sizeof (tbl) / sizeof (tbl[0])) - 1;
+
+ fprintf (file,
+ _("\treloc %4d offset %4x [%4lx] %s"),
+ j, off, (long) (off + virtual_address), tbl[t]);
+
+ /* HIGHADJ takes an argument, - the next record *is* the
+ low 16 bits of addend. */
+ if (t == IMAGE_REL_BASED_HIGHADJ)
+ {
+ fprintf (file, " (%4x)",
+ ((unsigned int)
+ bfd_get_16 (abfd, data + i + 8 + j * 2 + 2)));
+ j++;
+ }
+
+ fprintf (file, "\n");
+ }
+ i += size;
+ }
+
+ free (data);
+
+ return true;
+}
+
+/* Print out the program headers. */
+
+boolean
+_bfd_XX_print_private_bfd_data_common (abfd, vfile)
+ bfd *abfd;
+ PTR vfile;
+{
+ FILE *file = (FILE *) vfile;
+ int j;
+ pe_data_type *pe = pe_data (abfd);
+ struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr;
+ const char *subsystem_name = NULL;
+
+ /* The MS dumpbin program reportedly ands with 0xff0f before
+ printing the characteristics field. Not sure why. No reason to
+ emulate it here. */
+ fprintf (file, _("\nCharacteristics 0x%x\n"), pe->real_flags);
+#undef PF
+#define PF(x, y) if (pe->real_flags & x) { fprintf (file, "\t%s\n", y); }
+ PF (F_RELFLG, "relocations stripped");
+ PF (F_EXEC, "executable");
+ PF (F_LNNO, "line numbers stripped");
+ PF (F_LSYMS, "symbols stripped");
+ PF (0x80, "little endian");
+ PF (F_AR32WR, "32 bit words");
+ PF (0x200, "debugging information removed");
+ PF (0x1000, "system file");
+ PF (F_DLL, "DLL");
+ PF (0x8000, "big endian");
+#undef PF
+
+ /* ctime implies '\n'. */
+ fprintf (file, "\nTime/Date\t\t%s", ctime (&pe->coff.timestamp));
+ fprintf (file, "\nImageBase\t\t");
+ fprintf_vma (file, i->ImageBase);
+ fprintf (file, "\nSectionAlignment\t");
+ fprintf_vma (file, i->SectionAlignment);
+ fprintf (file, "\nFileAlignment\t\t");
+ fprintf_vma (file, i->FileAlignment);
+ fprintf (file, "\nMajorOSystemVersion\t%d\n", i->MajorOperatingSystemVersion);
+ fprintf (file, "MinorOSystemVersion\t%d\n", i->MinorOperatingSystemVersion);
+ fprintf (file, "MajorImageVersion\t%d\n", i->MajorImageVersion);
+ fprintf (file, "MinorImageVersion\t%d\n", i->MinorImageVersion);
+ fprintf (file, "MajorSubsystemVersion\t%d\n", i->MajorSubsystemVersion);
+ fprintf (file, "MinorSubsystemVersion\t%d\n", i->MinorSubsystemVersion);
+ fprintf (file, "Win32Version\t\t%08lx\n", i->Reserved1);
+ fprintf (file, "SizeOfImage\t\t%08lx\n", i->SizeOfImage);
+ fprintf (file, "SizeOfHeaders\t\t%08lx\n", i->SizeOfHeaders);
+ fprintf (file, "CheckSum\t\t%08lx\n", i->CheckSum);
+ switch (i->Subsystem)
+ {
+ case IMAGE_SUBSYSTEM_UNKNOWN:
+ subsystem_name = "unspecified";
+ break;
+ case IMAGE_SUBSYSTEM_NATIVE:
+ subsystem_name = "NT native";
+ break;
+ case IMAGE_SUBSYSTEM_WINDOWS_GUI:
+ subsystem_name = "Windows GUI";
+ break;
+ case IMAGE_SUBSYSTEM_WINDOWS_CUI:
+ subsystem_name = "Windows CUI";
+ break;
+ case IMAGE_SUBSYSTEM_POSIX_CUI:
+ subsystem_name = "POSIX CUI";
+ break;
+ case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI:
+ subsystem_name = "Wince CUI";
+ break;
+ case IMAGE_SUBSYSTEM_EFI_APPLICATION:
+ subsystem_name = "EFI application";
+ break;
+ case IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER:
+ subsystem_name = "EFI boot service driver";
+ break;
+ case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:
+ subsystem_name = "EFI runtime driver";
+ break;
+ }
+ fprintf (file, "Subsystem\t\t%08x", i->Subsystem);
+ if (subsystem_name)
+ fprintf (file, "\t(%s)", subsystem_name);
+ fprintf (file, "\nDllCharacteristics\t%08x\n", i->DllCharacteristics);
+ fprintf (file, "SizeOfStackReserve\t");
+ fprintf_vma (file, i->SizeOfStackReserve);
+ fprintf (file, "\nSizeOfStackCommit\t");
+ fprintf_vma (file, i->SizeOfStackCommit);
+ fprintf (file, "\nSizeOfHeapReserve\t");
+ fprintf_vma (file, i->SizeOfHeapReserve);
+ fprintf (file, "\nSizeOfHeapCommit\t");
+ fprintf_vma (file, i->SizeOfHeapCommit);
+ fprintf (file, "\nLoaderFlags\t\t%08lx\n", i->LoaderFlags);
+ fprintf (file, "NumberOfRvaAndSizes\t%08lx\n", i->NumberOfRvaAndSizes);
+
+ fprintf (file, "\nThe Data Directory\n");
+ for (j = 0; j < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; j++)
+ {
+ fprintf (file, "Entry %1x ", j);
+ fprintf_vma (file, i->DataDirectory[j].VirtualAddress);
+ fprintf (file, " %08lx ", i->DataDirectory[j].Size);
+ fprintf (file, "%s\n", dir_names[j]);
+ }
+
+ pe_print_idata (abfd, vfile);
+ pe_print_edata (abfd, vfile);
+ pe_print_pdata (abfd, vfile);
+ pe_print_reloc (abfd, vfile);
+
+ return true;
+}
+
+/* Copy any private info we understand from the input bfd
+ to the output bfd. */
+
+boolean
+_bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd)
+ bfd *ibfd, *obfd;
+{
+ /* One day we may try to grok other private data. */
+ if (ibfd->xvec->flavour != bfd_target_coff_flavour
+ || obfd->xvec->flavour != bfd_target_coff_flavour)
+ return true;
+
+ pe_data (obfd)->pe_opthdr = pe_data (ibfd)->pe_opthdr;
+ pe_data (obfd)->dll = pe_data (ibfd)->dll;
+
+ /* for strip: if we removed .reloc, we'll make a real mess of things
+ if we don't remove this entry as well. */
+ if (! pe_data (obfd)->has_reloc_section)
+ {
+ pe_data (obfd)->pe_opthdr.DataDirectory[5].VirtualAddress = 0;
+ pe_data (obfd)->pe_opthdr.DataDirectory[5].Size = 0;
+ }
+ return true;
+}
+
+/* Copy private section data. */
+boolean
+_bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
+ bfd *ibfd;
+ asection *isec;
+ bfd *obfd;
+ asection *osec;
+{
+ if (bfd_get_flavour (ibfd) != bfd_target_coff_flavour
+ || bfd_get_flavour (obfd) != bfd_target_coff_flavour)
+ return true;
+
+ if (coff_section_data (ibfd, isec) != NULL
+ && pei_section_data (ibfd, isec) != NULL)
+ {
+ if (coff_section_data (obfd, osec) == NULL)
+ {
+ osec->used_by_bfd =
+ (PTR) bfd_zalloc (obfd, sizeof (struct coff_section_tdata));
+ if (osec->used_by_bfd == NULL)
+ return false;
+ }
+ if (pei_section_data (obfd, osec) == NULL)
+ {
+ coff_section_data (obfd, osec)->tdata =
+ (PTR) bfd_zalloc (obfd, sizeof (struct pei_section_tdata));
+ if (coff_section_data (obfd, osec)->tdata == NULL)
+ return false;
+ }
+ pei_section_data (obfd, osec)->virt_size =
+ pei_section_data (ibfd, isec)->virt_size;
+ pei_section_data (obfd, osec)->pe_flags =
+ pei_section_data (ibfd, isec)->pe_flags;
+ }
+
+ return true;
+}
+
+void
+_bfd_XX_get_symbol_info (abfd, symbol, ret)
+ bfd *abfd;
+ asymbol *symbol;
+ symbol_info *ret;
+{
+ coff_get_symbol_info (abfd, symbol, ret);
+#if 0 /* This code no longer appears to be necessary.
+ ImageBase has already been added in by coff_swap_scnhdr_in. */
+ if (pe_data (abfd) != NULL
+ && ((symbol->flags & BSF_DEBUGGING) == 0
+ || (symbol->flags & BSF_DEBUGGING_RELOC) != 0)
+ && ! bfd_is_abs_section (symbol->section))
+ ret->value += pe_data (abfd)->pe_opthdr.ImageBase;
+#endif
+}
+
+/* Handle the .idata section and other things that need symbol table
+ access. */
+
+boolean
+_bfd_XXi_final_link_postscript (abfd, pfinfo)
+ bfd *abfd;
+ struct coff_final_link_info *pfinfo;
+{
+ struct coff_link_hash_entry *h1;
+ struct bfd_link_info *info = pfinfo->info;
+
+ /* There are a few fields that need to be filled in now while we
+ have symbol table access.
+
+ The .idata subsections aren't directly available as sections, but
+ they are in the symbol table, so get them from there. */
+
+ /* The import directory. This is the address of .idata$2, with size
+ of .idata$2 + .idata$3. */
+ h1 = coff_link_hash_lookup (coff_hash_table (info),
+ ".idata$2", false, false, true);
+ if (h1 != NULL)
+ {
+ pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress =
+ (h1->root.u.def.value
+ + h1->root.u.def.section->output_section->vma
+ + h1->root.u.def.section->output_offset);
+ h1 = coff_link_hash_lookup (coff_hash_table (info),
+ ".idata$4", false, false, true);
+ pe_data (abfd)->pe_opthdr.DataDirectory[1].Size =
+ ((h1->root.u.def.value
+ + h1->root.u.def.section->output_section->vma
+ + h1->root.u.def.section->output_offset)
+ - pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress);
+
+ /* The import address table. This is the size/address of
+ .idata$5. */
+ h1 = coff_link_hash_lookup (coff_hash_table (info),
+ ".idata$5", false, false, true);
+ pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress =
+ (h1->root.u.def.value
+ + h1->root.u.def.section->output_section->vma
+ + h1->root.u.def.section->output_offset);
+ h1 = coff_link_hash_lookup (coff_hash_table (info),
+ ".idata$6", false, false, true);
+ pe_data (abfd)->pe_opthdr.DataDirectory[12].Size =
+ ((h1->root.u.def.value
+ + h1->root.u.def.section->output_section->vma
+ + h1->root.u.def.section->output_offset)
+ - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress);
+ }
+
+ /* If we couldn't find idata$2, we either have an excessively
+ trivial program or are in DEEP trouble; we have to assume trivial
+ program.... */
+ return true;
+}
diff --git a/gnu/usr.bin/binutils/bfd/pei-mips.c b/gnu/usr.bin/binutils/bfd/pei-mips.c
index 472d35d97b2..84c6ff0b0e3 100644
--- a/gnu/usr.bin/binutils/bfd/pei-mips.c
+++ b/gnu/usr.bin/binutils/bfd/pei-mips.c
@@ -1,5 +1,5 @@
/* BFD back-end for MIPS PE IMAGE COFF files.
- Copyright 1995, 2000 Free Software Foundation, Inc.
+ Copyright 1995, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -28,5 +28,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "pe-mips.c"
-
-
diff --git a/gnu/usr.bin/binutils/bfd/pei-sh.c b/gnu/usr.bin/binutils/bfd/pei-sh.c
index 2fb8b1ca23a..c46b0dbe04e 100644
--- a/gnu/usr.bin/binutils/bfd/pei-sh.c
+++ b/gnu/usr.bin/binutils/bfd/pei-sh.c
@@ -1,5 +1,5 @@
/* BFD back-end for SH PE IMAGE COFF files.
- Copyright 1995, 2000 Free Software Foundation, Inc.
+ Copyright 1995, 2000, 2001 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -31,5 +31,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "coff-sh.c"
-
-
diff --git a/gnu/usr.bin/binutils/bfd/po/Make-in b/gnu/usr.bin/binutils/bfd/po/Make-in
index 0552db1feef..2414748d744 100644
--- a/gnu/usr.bin/binutils/bfd/po/Make-in
+++ b/gnu/usr.bin/binutils/bfd/po/Make-in
@@ -46,10 +46,16 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
SOURCES = cat-id-tbl.c
POFILES = @POFILES@
GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
+DISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
-POTFILES = \
+# Note - the following line gets processed by bfd/configure and amended
+# to contain the full list of source dir POTFILES.
+SRC-POTFILES = \
+
+# Note - the following line gets processed by bfd/configure and amended
+# to contain the full list of build dir POTFILES.
+BLD-POTFILES = \
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
@@ -82,10 +88,17 @@ all: all-@USE_NLS@
all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
all-no:
-$(srcdir)/$(PACKAGE).pot: $(POTFILES)
- $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
+$(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES)
+ $(XGETTEXT) --default-domain=$(PACKAGE) \
+ --directory=$(top_srcdir) \
+ --add-comments --keyword=_ --keyword=N_ \
+ --files-from=$(srcdir)/SRC-POTFILES.in
+ $(XGETTEXT) --default-domain=$(PACKAGE) \
+ --directory=.. \
+ --directory=. \
--add-comments --keyword=_ --keyword=N_ \
- --files-from=$(srcdir)/POTFILES.in
+ --join-existing \
+ --files-from=$(srcdir)/BLD-POTFILES.in
rm -f $(srcdir)/$(PACKAGE).pot
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
@@ -191,7 +204,8 @@ mostlyclean:
clean: mostlyclean
distclean: clean
- rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+ rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m
+ rm -f SRC-POTFILES BLD-POTFILES SRC-POTFILES.in BLD-POTFILES.in
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@@ -225,23 +239,48 @@ update-po: Makefile
fi; \
done
-POTFILES: POTFILES.in
+SRC-POTFILES: SRC-POTFILES.in
( if test 'x$(srcdir)' != 'x.'; then \
posrcprefix='$(top_srcdir)/'; \
else \
posrcprefix="../"; \
fi; \
rm -f $@-t $@ \
- && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
+ && (sed -e '/^#/d' \
+ -e '/^[ ]*$$/d' \
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
| sed -e '$$s/\\$$//') > $@-t \
&& chmod a-w $@-t \
&& mv $@-t $@ )
-POTFILES.in: @MAINT@ ../Makefile
- cd .. && $(MAKE) po/POTFILES.in
+BLD-POTFILES: BLD-POTFILES.in
+ ( rm -f $@-t $@ \
+ && (sed -e '/^#/d' \
+ -e '/^[ ]*$$/d' \
+ -e "s@.*@ ../& \\\\@" < $(srcdir)/$@.in \
+ | sed -e '$$s/\\$$//') > $@-t \
+ && chmod a-w $@-t \
+ && mv $@-t $@ )
+
+SRC-POTFILES.in: @MAINT@ ../Makefile
+ cd .. && $(MAKE) po/SRC-POTFILES.in
-Makefile: Make-in ../config.status POTFILES
+BLD-POTFILES.in: @MAINT@ ../Makefile
+ cd .. && $(MAKE) po/BLD-POTFILES.in
+
+# Note - The presence of SRC-POTFILES and BLD-POTFILES as dependencies
+# here breaks the implementation of the 'distclean' rule for maintainers.
+# This is because if 'make distclean' is run in the BFD directory, the
+# Makefile there will be deleted before 'distclean' is made here, and so
+# the dependency SRC-POTFILES -> SRC-POTFILES.in -> ../Makefile cannot
+# be satisfied.
+#
+# The SRC-POTFILES and BLD-POTFILES dependencies cannot be removed,
+# however since it is necessary that these files be built during
+# *configure* time, so that configure can insert them into the
+# po/Makefile that it is creating, so that the Makefile will have
+# the correct dependencies.
+Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES
cd .. \
&& CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/gnu/usr.bin/binutils/bfd/po/bfd.pot b/gnu/usr.bin/binutils/bfd/po/bfd.pot
index b08ec3649c9..e77b05d44f3 100644
--- a/gnu/usr.bin/binutils/bfd/po/bfd.pot
+++ b/gnu/usr.bin/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/gnu/usr.bin/binutils/bfd/sco5-core.c b/gnu/usr.bin/binutils/bfd/sco5-core.c
index 46c97d25889..62f9c986f53 100644
--- a/gnu/usr.bin/binutils/bfd/sco5-core.c
+++ b/gnu/usr.bin/binutils/bfd/sco5-core.c
@@ -1,5 +1,5 @@
/* BFD back end for SCO5 core files (U-area and raw sections)
- Copyright 1998 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
Written by Jouke Numan <jnuman@hiscom.nl>
This file is part of BFD, the Binary File Descriptor library.
@@ -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/gnu/usr.bin/binutils/bfd/sparclinux.c b/gnu/usr.bin/binutils/bfd/sparclinux.c
index 73a29b39b26..b877018e336 100644
--- a/gnu/usr.bin/binutils/bfd/sparclinux.c
+++ b/gnu/usr.bin/binutils/bfd/sparclinux.c
@@ -1,5 +1,5 @@
/* BFD back-end for linux flavored sparc a.out binaries.
- Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -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/gnu/usr.bin/binutils/bfd/vms-gsd.c b/gnu/usr.bin/binutils/bfd/vms-gsd.c
index ac3fe6986cc..773823c0baa 100644
--- a/gnu/usr.bin/binutils/bfd/vms-gsd.c
+++ b/gnu/usr.bin/binutils/bfd/vms-gsd.c
@@ -1,6 +1,6 @@
/* vms-gsd.c -- BFD back-end for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
go and read the openVMS linker manual (esp. appendix B)
if you don't know what's going on here :-)
@@ -21,7 +21,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. */
-
#include <ctype.h>
#include "bfd.h"
@@ -85,7 +84,6 @@ static struct sec_flags_struct vax_section_flags[] = {
(SEC_IN_MEMORY|SEC_DATA|SEC_HAS_CONTENTS|SEC_ALLOC|SEC_LOAD) }
};
-
/* These flags are deccrtl/vaxcrtl (openVMS 6.2 Alpha) compatible */
static struct sec_flags_struct evax_section_flags[] = {
@@ -170,7 +168,6 @@ vms_secflag_by_name (abfd, section_flags, name, size)
return section_flags[i].flags_always;
}
-
/* Retrieve vms section flags by name and size */
static flagword
@@ -653,7 +650,7 @@ _bfd_vms_slurp_gsd (abfd, objtype)
new_flags |= BSF_FUNCTION;
}
symbol->value = bfd_getl64 (vms_rec+8);
- symbol->section = (asection *)((unsigned long) bfd_getl32 (vms_rec+28));
+ symbol->section = (asection *) ((unsigned long) bfd_getl32 (vms_rec+28));
#if VMS_DEBUG
vms_debug(4, "egsd sym def #%d (%s, %d, %04x=%s)\n", abfd->symcount,
symbol->name, (int)symbol->section, old_flags, flag2str(gsyflagdesc, old_flags));
@@ -899,9 +896,9 @@ _bfd_vms_write_gsd (abfd, objtype)
{
_bfd_vms_output_quad (abfd, symbol->value);
_bfd_vms_output_quad (abfd,
- ((asymbol *)(symbol->udata.p))->value);
+ ((asymbol *) (symbol->udata.p))->value);
_bfd_vms_output_long (abfd,
- (((asymbol *)(symbol->udata.p))
+ (((asymbol *) (symbol->udata.p))
->section->index));
_bfd_vms_output_long (abfd, symbol->section->index);
}
@@ -921,7 +918,7 @@ _bfd_vms_write_gsd (abfd, objtype)
_bfd_vms_output_alignment (abfd, 8);
_bfd_vms_output_pop (abfd);
- _bfd_vms_output_end (abfd);
+ _bfd_vms_output_end (abfd);
return 0;
}
diff --git a/gnu/usr.bin/binutils/bfd/vms-hdr.c b/gnu/usr.bin/binutils/bfd/vms-hdr.c
index 3b36b3278c5..228066f2e73 100644
--- a/gnu/usr.bin/binutils/bfd/vms-hdr.c
+++ b/gnu/usr.bin/binutils/bfd/vms-hdr.c
@@ -1,6 +1,6 @@
/* vms-hdr.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
HDR record handling functions
EMH record handling functions
@@ -33,9 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "vms.h"
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
/*---------------------------------------------------------------------------*/
-
/* Read & process emh record
return 0 on success, -1 on error */
@@ -196,11 +198,9 @@ _bfd_vms_slurp_hdr (abfd, objtype)
return 0;
}
-
/*-----------------------------------------------------------------------------*/
/* Output routines. */
-
/* Manufacure a VMS like time on a unix based system.
stolen from obj-vms.c */
@@ -240,7 +240,6 @@ get_vms_time_string ()
return tbuf;
}
-
/* write object header for bfd abfd */
int
@@ -253,7 +252,6 @@ _bfd_vms_write_hdr (abfd, objtype)
int had_case = 0;
int had_file = 0;
-
#if VMS_DEBUG
vms_debug (2, "vms_write_hdr (%p)\n", abfd);
#endif
@@ -392,7 +390,7 @@ _bfd_vms_slurp_eom (abfd, objtype)
vms_rec = PRIV(vms_rec);
- if ((objtype == OBJ_S_C_EOM)
+ if ((objtype == OBJ_S_C_EOM)
|| (objtype == OBJ_S_C_EOMW))
{
}
@@ -420,7 +418,6 @@ _bfd_vms_slurp_eom (abfd, objtype)
return 0;
}
-
/* Write eom record for bfd abfd */
int
@@ -433,7 +430,7 @@ _bfd_vms_write_eom (abfd, objtype)
#endif
_bfd_vms_output_begin (abfd, objtype, -1);
- _bfd_vms_output_long (abfd, (unsigned long)(PRIV(vms_linkage_index) >> 1));
+ _bfd_vms_output_long (abfd, (unsigned long) (PRIV(vms_linkage_index) >> 1));
_bfd_vms_output_byte (abfd, 0); /* completion code */
_bfd_vms_output_byte (abfd, 0); /* fill byte */
@@ -448,7 +445,7 @@ _bfd_vms_write_eom (abfd, objtype)
return -1;
}
_bfd_vms_output_short (abfd, 0);
- _bfd_vms_output_long (abfd, (unsigned long)(section->index));
+ _bfd_vms_output_long (abfd, (unsigned long) (section->index));
_bfd_vms_output_long (abfd,
(unsigned long) bfd_get_start_address (abfd));
_bfd_vms_output_long (abfd, 0);
diff --git a/gnu/usr.bin/binutils/bfd/vms-misc.c b/gnu/usr.bin/binutils/bfd/vms-misc.c
index 311192c8b91..ce66a27678f 100644
--- a/gnu/usr.bin/binutils/bfd/vms-misc.c
+++ b/gnu/usr.bin/binutils/bfd/vms-misc.c
@@ -1,6 +1,7 @@
/* vms-misc.c -- Miscellaneous functions for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Written by Klaus K"ampf (kkaempf@rmi.de)
@@ -18,7 +19,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. */
-
#if __STDC__
#include <stdarg.h>
#endif
@@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
evaluates environment variable VMS_DEBUG for a
numerical value on the first call
all error levels below this value are printed
-
+
levels:
1 toplevel bfd calls (functions from the bfd vector)
2 functions called by bfd calls
@@ -74,10 +74,10 @@ _bfd_vms_debug (int level, char *format, ...)
if (abslvl > min_level)
return;
- while(--level>0)
- fprintf(output, " ");
+ while (--level>0)
+ fprintf (output, " ");
va_start(args, format);
- vfprintf(output, format, args);
+ vfprintf (output, format, args);
fflush(output);
va_end(args);
@@ -112,16 +112,15 @@ _bfd_vms_debug (level, format, a1, a2, a3, a4, a5, a6)
if (level > min_level)
return;
- while(--level>0)
- fprintf(output, " ");
- fprintf(output, format, a1, a2, a3, a4, a5, a6);
+ while (--level>0)
+ fprintf (output, " ");
+ fprintf (output, format, a1, a2, a3, a4, a5, a6);
fflush(output);
return;
}
#endif /* __STDC__ */
-
/* a debug function
hex dump 'size' bytes starting at 'ptr' */
@@ -168,7 +167,6 @@ _bfd_hexdump (level, ptr, size, offset)
return;
}
#endif
-
/* hash functions
@@ -212,7 +210,6 @@ _bfd_vms_hash_newfunc (entry, table, string)
return (struct bfd_hash_entry *)ret;
}
-
/* object file input functions */
@@ -235,43 +232,41 @@ _bfd_vms_get_header_values (abfd, buf, type, length)
vms_debug (10, "_bfd_vms_get_header_values type %x, length %x\n", (type?*type:0), (length?*length:0));
#endif
-
return;
}
-
/* Get next record from object file to vms_buf
set PRIV(buf_size) and return it
-
+
this is a little tricky since it should be portable.
-
+
the openVMS object file has 'variable length' which means that
read() returns data in chunks of (hopefully) correct and expected
size. The linker (and other tools on vms) depend on that. Unix doesn't
know about 'formatted' files, so reading and writing such an object
file in a unix environment is not trivial.
-
+
With the tool 'file' (available on all vms ftp sites), one
can view and change the attributes of a file. Changing from
'variable length' to 'fixed length, 512 bytes' reveals the
record length at the first 2 bytes of every record. The same
happens during the transfer of object files from vms to unix,
at least with ucx, dec's implementation of tcp/ip.
-
+
The vms format repeats the length at bytes 2 & 3 of every record.
-
+
On the first call (file_format == FF_UNKNOWN) we check if
the first and the third byte pair (!) of the record match.
If they do it's an object file in an unix environment or with
wrong attributes (FF_FOREIGN), else we should be in a vms
environment where read() returns the record size (FF_NATIVE).
-
+
reading is always done in 2 steps.
first just the record header is read and the length extracted
by get_header_values
then the read buffer is adjusted and the remaining bytes are
read in.
-
+
all file i/o is always done on even file positions */
int
@@ -291,19 +286,19 @@ _bfd_vms_get_record (abfd)
on VAX there's no length information in the record
so start with OBJ_S_C_MAXRECSIZ */
- if (PRIV(buf_size) == 0)
+ if (PRIV (buf_size) == 0)
{
- if (PRIV(is_vax))
+ if (PRIV (is_vax))
{
- PRIV(vms_buf) = (unsigned char *) malloc (OBJ_S_C_MAXRECSIZ);
- PRIV(buf_size) = OBJ_S_C_MAXRECSIZ;
- PRIV(file_format) = FF_VAX;
+ PRIV (vms_buf) = (unsigned char *) malloc (OBJ_S_C_MAXRECSIZ);
+ PRIV (buf_size) = OBJ_S_C_MAXRECSIZ;
+ PRIV (file_format) = FF_VAX;
}
else
- PRIV(vms_buf) = (unsigned char *) malloc (6);
+ PRIV (vms_buf) = (unsigned char *) malloc (6);
}
- vms_buf = PRIV(vms_buf);
+ vms_buf = PRIV (vms_buf);
if (vms_buf == 0)
{
@@ -311,30 +306,31 @@ _bfd_vms_get_record (abfd)
return -1;
}
- switch (PRIV(file_format))
+ switch (PRIV (file_format))
{
- case FF_UNKNOWN:
- case FF_FOREIGN:
- test_len = 6; /* probe 6 bytes */
- test_start = 2; /* where the record starts */
+ case FF_UNKNOWN:
+ case FF_FOREIGN:
+ test_len = 6; /* probe 6 bytes */
+ test_start = 2; /* where the record starts */
break;
- case FF_NATIVE:
- test_len = 4;
- test_start = 0;
+ case FF_NATIVE:
+ test_len = 4;
+ test_start = 0;
break;
- case FF_VAX:
- test_len = 0;
- test_start = 0;
+ default:
+ case FF_VAX:
+ test_len = 0;
+ test_start = 0;
break;
- }
+ }
/* skip odd alignment byte */
if (bfd_tell (abfd) & 1)
{
- if (bfd_read (PRIV(vms_buf), 1, 1, abfd) != 1)
+ if (bfd_read (PRIV (vms_buf), 1, 1, abfd) != 1)
{
bfd_set_error (bfd_error_file_truncated);
return 0;
@@ -344,7 +340,7 @@ _bfd_vms_get_record (abfd)
/* read the record header on Alpha. */
if ((test_len != 0)
- && (bfd_read (PRIV(vms_buf), 1, test_len, abfd)
+ && (bfd_read (PRIV (vms_buf), 1, test_len, abfd)
!= (bfd_size_type) test_len))
{
bfd_set_error (bfd_error_file_truncated);
@@ -353,39 +349,39 @@ _bfd_vms_get_record (abfd)
/* check file format on first call */
- if (PRIV(file_format) == FF_UNKNOWN)
+ if (PRIV (file_format) == FF_UNKNOWN)
{ /* record length repeats ? */
if ( (vms_buf[0] == vms_buf[4])
&& (vms_buf[1] == vms_buf[5]))
{
- PRIV(file_format) = FF_FOREIGN; /* Y: foreign environment */
+ PRIV (file_format) = FF_FOREIGN; /* Y: foreign environment */
test_start = 2;
}
else
{
- PRIV(file_format) = FF_NATIVE; /* N: native environment */
+ PRIV (file_format) = FF_NATIVE; /* N: native environment */
test_start = 0;
}
}
- if (PRIV(is_vax))
+ if (PRIV (is_vax))
{
- PRIV(rec_length) = bfd_read (vms_buf, 1, PRIV(buf_size), abfd);
- if (PRIV(rec_length) <= 0)
+ PRIV (rec_length) = bfd_read (vms_buf, 1, PRIV (buf_size), abfd);
+ if (PRIV (rec_length) <= 0)
{
bfd_set_error (bfd_error_file_truncated);
return 0;
}
- PRIV(vms_rec) = vms_buf;
+ PRIV (vms_rec) = vms_buf;
}
else /* Alpha */
{
/* extract vms record length */
_bfd_vms_get_header_values (abfd, vms_buf+test_start, NULL,
- &PRIV(rec_length));
+ &PRIV (rec_length));
- if (PRIV(rec_length) <= 0)
+ if (PRIV (rec_length) <= 0)
{
bfd_set_error (bfd_error_file_truncated);
return 0;
@@ -393,7 +389,7 @@ _bfd_vms_get_record (abfd)
/* that's what the linker manual says */
- if (PRIV(rec_length) > EOBJ_S_C_MAXRECSIZ)
+ if (PRIV (rec_length) > EOBJ_S_C_MAXRECSIZ)
{
bfd_set_error (bfd_error_file_truncated);
return 0;
@@ -401,21 +397,21 @@ _bfd_vms_get_record (abfd)
/* adjust the buffer */
- if (PRIV(rec_length) > PRIV(buf_size))
+ if (PRIV (rec_length) > PRIV (buf_size))
{
- PRIV(vms_buf) = (unsigned char *) realloc (vms_buf, PRIV(rec_length));
- vms_buf = PRIV(vms_buf);
+ PRIV (vms_buf) = (unsigned char *) realloc (vms_buf, PRIV (rec_length));
+ vms_buf = PRIV (vms_buf);
if (vms_buf == 0)
{
bfd_set_error (bfd_error_no_memory);
return -1;
}
- PRIV(buf_size) = PRIV(rec_length);
+ PRIV (buf_size) = PRIV (rec_length);
}
/* read the remaining record */
- remaining = PRIV(rec_length) - test_len + test_start;
+ remaining = PRIV (rec_length) - test_len + test_start;
#if VMS_DEBUG
vms_debug (10, "bfd_read remaining %d\n", remaining);
@@ -426,17 +422,16 @@ _bfd_vms_get_record (abfd)
bfd_set_error (bfd_error_file_truncated);
return 0;
}
- PRIV(vms_rec) = vms_buf + test_start;
+ PRIV (vms_rec) = vms_buf + test_start;
}
#if VMS_DEBUG
- vms_debug (11, "bfd_read rec_length %d\n", PRIV(rec_length));
+ vms_debug (11, "bfd_read rec_length %d\n", PRIV (rec_length));
#endif
- return PRIV(rec_length);
+ return PRIV (rec_length);
}
-
/* get next vms record from file
update vms_rec and rec_length to new (remaining) values */
@@ -446,12 +441,12 @@ _bfd_vms_next_record (abfd)
{
#if VMS_DEBUG
vms_debug (8, "_bfd_vms_next_record (len %d, size %d)\n",
- PRIV(rec_length), PRIV(rec_size));
+ PRIV (rec_length), PRIV (rec_size));
#endif
- if (PRIV(rec_length) > 0)
+ if (PRIV (rec_length) > 0)
{
- PRIV(vms_rec) += PRIV(rec_size);
+ PRIV (vms_rec) += PRIV (rec_size);
}
else
{
@@ -459,28 +454,30 @@ _bfd_vms_next_record (abfd)
return -1;
}
- if (PRIV(is_vax))
+ if (!PRIV (vms_rec) || !PRIV (vms_buf)
+ || PRIV (vms_rec) >= (PRIV (vms_buf) + PRIV (buf_size)))
+ return -1;
+
+ if (PRIV (is_vax))
{
- PRIV(rec_type) = *(PRIV(vms_rec));
- PRIV(rec_size) = PRIV(rec_length);
+ PRIV (rec_type) = *(PRIV (vms_rec));
+ PRIV (rec_size) = PRIV (rec_length);
}
else
{
- _bfd_vms_get_header_values (abfd, PRIV(vms_rec), &PRIV(rec_type),
- &PRIV(rec_size));
+ _bfd_vms_get_header_values (abfd, PRIV (vms_rec), &PRIV (rec_type),
+ &PRIV (rec_size));
}
- PRIV(rec_length) -= PRIV(rec_size);
+ PRIV (rec_length) -= PRIV (rec_size);
#if VMS_DEBUG
vms_debug (8, "_bfd_vms_next_record: rec %p, size %d, length %d, type %d\n",
- PRIV(vms_rec), PRIV(rec_size), PRIV(rec_length),
- PRIV(rec_type));
+ PRIV (vms_rec), PRIV (rec_size), PRIV (rec_length),
+ PRIV (rec_type));
#endif
- return PRIV(rec_type);
+ return PRIV (rec_type);
}
-
-
/* Copy sized string (string with fixed length) to new allocated area
size is string length (size of record) */
@@ -511,7 +508,6 @@ _bfd_vms_save_counted_string (ptr)
return _bfd_vms_save_sized_string (ptr, len);
}
-
/* stack routines for vms ETIR commands */
@@ -526,25 +522,24 @@ _bfd_vms_push (abfd, val, psect)
static int last_psect;
#if VMS_DEBUG
- vms_debug (4, "<push %016lx(%d) at %d>\n", val, psect, PRIV(stackptr));
+ vms_debug (4, "<push %016lx(%d) at %d>\n", val, psect, PRIV (stackptr));
#endif
if (psect >= 0)
last_psect = psect;
- PRIV(stack[PRIV(stackptr)]).value = val;
- PRIV(stack[PRIV(stackptr)]).psect = last_psect;
- PRIV(stackptr)++;
- if (PRIV(stackptr) >= STACKSIZE)
+ PRIV (stack[PRIV (stackptr)]).value = val;
+ PRIV (stack[PRIV (stackptr)]).psect = last_psect;
+ PRIV (stackptr)++;
+ if (PRIV (stackptr) >= STACKSIZE)
{
bfd_set_error (bfd_error_bad_value);
- (*_bfd_error_handler) (_("Stack overflow (%d) in _bfd_vms_push"), PRIV(stackptr));
+ (*_bfd_error_handler) (_("Stack overflow (%d) in _bfd_vms_push"), PRIV (stackptr));
exit (1);
}
return;
}
-
/* Pop value and section index */
uquad
@@ -554,24 +549,23 @@ _bfd_vms_pop (abfd, psect)
{
uquad value;
- if (PRIV(stackptr) == 0)
+ if (PRIV (stackptr) == 0)
{
bfd_set_error (bfd_error_bad_value);
(*_bfd_error_handler) (_("Stack underflow in _bfd_vms_pop"));
exit (1);
}
- PRIV(stackptr)--;
- value = PRIV(stack[PRIV(stackptr)]).value;
- if ((psect != NULL) && (PRIV(stack[PRIV(stackptr)]).psect >= 0))
- *psect = PRIV(stack[PRIV(stackptr)]).psect;
+ PRIV (stackptr)--;
+ value = PRIV (stack[PRIV (stackptr)]).value;
+ if ((psect != NULL) && (PRIV (stack[PRIV (stackptr)]).psect >= 0))
+ *psect = PRIV (stack[PRIV (stackptr)]).psect;
#if VMS_DEBUG
- vms_debug (4, "<pop %016lx(%d)>\n", value, PRIV(stack[PRIV(stackptr)]).psect);
+ vms_debug (4, "<pop %016lx(%d)>\n", value, PRIV (stack[PRIV (stackptr)]).psect);
#endif
return value;
}
-
/* object file output functions */
@@ -589,7 +583,7 @@ add_new_contents (abfd, section)
{
vms_section *sptr, *newptr;
- sptr = PRIV(vms_section_table)[section->index];
+ sptr = PRIV (vms_section_table)[section->index];
if (sptr != NULL)
return sptr;
@@ -602,11 +596,10 @@ add_new_contents (abfd, section)
newptr->offset = 0;
newptr->size = section->_raw_size;
newptr->next = 0;
- PRIV(vms_section_table)[section->index] = newptr;
+ PRIV (vms_section_table)[section->index] = newptr;
return newptr;
}
-
/* Save section data & offset to an vms_section structure
vms_section_table[] holds the vms_section chain */
@@ -635,7 +628,6 @@ _bfd_save_vms_section (abfd, section, data, offset, count)
return true;
}
-
/* Get vms_section pointer to saved contents for section # index */
vms_section *
@@ -648,9 +640,8 @@ _bfd_get_vms_section (abfd, index)
bfd_set_error (bfd_error_nonrepresentable_section);
return NULL;
}
- return PRIV(vms_section_table)[index];
+ return PRIV (vms_section_table)[index];
}
-
/* Object output routines */
@@ -674,12 +665,12 @@ _bfd_vms_output_begin (abfd, rectype, rechead)
/* save current output position to fill in lenght later */
- if (PRIV(push_level) > 0)
- PRIV(length_pos) = PRIV(output_size);
+ if (PRIV (push_level) > 0)
+ PRIV (length_pos) = PRIV (output_size);
#if VMS_DEBUG
vms_debug (6, "_bfd_vms_output_begin: length_pos = %d\n",
- PRIV(length_pos));
+ PRIV (length_pos));
#endif
_bfd_vms_output_short (abfd,0); /* placeholder for length */
@@ -690,7 +681,6 @@ _bfd_vms_output_begin (abfd, rectype, rechead)
return;
}
-
/* Set record/subrecord alignment */
void
@@ -702,11 +692,10 @@ _bfd_vms_output_alignment (abfd, alignto)
vms_debug (6, "_bfd_vms_output_alignment(%d)\n", alignto);
#endif
- PRIV(output_alignment) = alignto;
+ PRIV (output_alignment) = alignto;
return;
}
-
/* Prepare for subrecord fields */
void
@@ -714,15 +703,14 @@ _bfd_vms_output_push (abfd)
bfd *abfd;
{
#if VMS_DEBUG
- vms_debug (6, "vms_output_push(pushed_size = %d)\n", PRIV(output_size));
+ vms_debug (6, "vms_output_push(pushed_size = %d)\n", PRIV (output_size));
#endif
- PRIV(push_level)++;
- PRIV(pushed_size) = PRIV(output_size);
+ PRIV (push_level)++;
+ PRIV (pushed_size) = PRIV (output_size);
return;
}
-
/* End of subrecord fields */
void
@@ -730,87 +718,85 @@ _bfd_vms_output_pop (abfd)
bfd *abfd;
{
#if VMS_DEBUG
- vms_debug (6, "vms_output_pop(pushed_size = %d)\n", PRIV(pushed_size));
+ vms_debug (6, "vms_output_pop(pushed_size = %d)\n", PRIV (pushed_size));
#endif
_bfd_vms_output_flush (abfd);
- PRIV(length_pos) = 2;
+ PRIV (length_pos) = 2;
#if VMS_DEBUG
- vms_debug (6, "vms_output_pop: length_pos = %d\n", PRIV(length_pos));
+ vms_debug (6, "vms_output_pop: length_pos = %d\n", PRIV (length_pos));
#endif
- PRIV(pushed_size) = 0;
- PRIV(push_level)--;
+ PRIV (pushed_size) = 0;
+ PRIV (push_level)--;
return;
}
-
/* Flush unwritten output, ends current record */
void
_bfd_vms_output_flush (abfd)
bfd *abfd;
{
- int real_size = PRIV(output_size);
+ int real_size = PRIV (output_size);
int aligncount;
int length;
#if VMS_DEBUG
vms_debug (6, "_bfd_vms_output_flush(real_size = %d, pushed_size %d at lenpos %d)\n",
- real_size, PRIV(pushed_size), PRIV(length_pos));
+ real_size, PRIV (pushed_size), PRIV (length_pos));
#endif
- if (PRIV(push_level) > 0)
- length = real_size - PRIV(pushed_size);
+ if (PRIV (push_level) > 0)
+ length = real_size - PRIV (pushed_size);
else
length = real_size;
if (length == 0)
return;
- aligncount = (PRIV(output_alignment)
- - (length % PRIV(output_alignment))) % PRIV(output_alignment);
+ aligncount = (PRIV (output_alignment)
+ - (length % PRIV (output_alignment))) % PRIV (output_alignment);
#if VMS_DEBUG
vms_debug (6, "align: adding %d bytes\n", aligncount);
#endif
- while(aligncount-- > 0)
+ while (aligncount-- > 0)
{
- PRIV(output_buf)[real_size++] = 0;
+ PRIV (output_buf)[real_size++] = 0;
#if 0
/* this is why I *love* vms: inconsistency :-}
alignment is added to the subrecord length
but not to the record length */
- if (PRIV(push_level) > 0)
+ if (PRIV (push_level) > 0)
#endif
length++;
}
/* put length to buffer */
- PRIV(output_size) = PRIV(length_pos);
+ PRIV (output_size) = PRIV (length_pos);
_bfd_vms_output_short (abfd, (unsigned int)length);
- if (PRIV(push_level) == 0)
+ if (PRIV (push_level) == 0)
{
#ifndef VMS
/* write length first, see FF_FOREIGN in the input routines */
- fwrite (PRIV(output_buf)+2, 2, 1, (FILE *)abfd->iostream);
+ fwrite (PRIV (output_buf)+2, 2, 1, (FILE *)abfd->iostream);
#endif
- fwrite (PRIV(output_buf), real_size, 1, (FILE *)abfd->iostream);
+ fwrite (PRIV (output_buf), real_size, 1, (FILE *)abfd->iostream);
- PRIV(output_size) = 0;
+ PRIV (output_size) = 0;
}
else
{
- PRIV(output_size) = real_size;
- PRIV(pushed_size) = PRIV(output_size);
+ PRIV (output_size) = real_size;
+ PRIV (pushed_size) = PRIV (output_size);
}
return;
}
-
/* End record output */
void
@@ -826,7 +812,6 @@ _bfd_vms_output_end (abfd)
return;
}
-
/* check remaining buffer size
return what's left. */
@@ -840,10 +825,9 @@ _bfd_vms_output_check (abfd, size)
vms_debug (6, "_bfd_vms_output_check(%d)\n", size);
#endif
- return (MAX_OUTREC_SIZE - (PRIV(output_size) + size + MIN_OUTREC_LUFT));
+ return (MAX_OUTREC_SIZE - (PRIV (output_size) + size + MIN_OUTREC_LUFT));
}
-
/* Output byte (8 bit) value */
void
@@ -855,12 +839,11 @@ _bfd_vms_output_byte (abfd, value)
vms_debug (6, "_bfd_vms_output_byte(%02x)\n", value);
#endif
- bfd_put_8 (abfd, value & 0xff, PRIV(output_buf) + PRIV(output_size));
- PRIV(output_size) += 1;
+ bfd_put_8 (abfd, value & 0xff, PRIV (output_buf) + PRIV (output_size));
+ PRIV (output_size) += 1;
return;
}
-
/* Output short (16 bit) value */
void
@@ -872,12 +855,11 @@ _bfd_vms_output_short (abfd, value)
vms_debug (6, "_bfd_vms_output_short (%04x)\n", value);
#endif
- bfd_put_16 (abfd, value & 0xffff, PRIV(output_buf) + PRIV(output_size));
- PRIV(output_size) += 2;
+ bfd_put_16 (abfd, value & 0xffff, PRIV (output_buf) + PRIV (output_size));
+ PRIV (output_size) += 2;
return;
}
-
/* Output long (32 bit) value */
void
@@ -889,12 +871,11 @@ _bfd_vms_output_long (abfd, value)
vms_debug (6, "_bfd_vms_output_long (%08lx)\n", value);
#endif
- bfd_put_32 (abfd, value, PRIV(output_buf) + PRIV(output_size));
- PRIV(output_size) += 4;
+ bfd_put_32 (abfd, value, PRIV (output_buf) + PRIV (output_size));
+ PRIV (output_size) += 4;
return;
}
-
/* Output quad (64 bit) value */
void
@@ -906,12 +887,11 @@ _bfd_vms_output_quad (abfd, value)
vms_debug (6, "_bfd_vms_output_quad(%016lx)\n", value);
#endif
- bfd_put_64(abfd, value, PRIV(output_buf) + PRIV(output_size));
- PRIV(output_size) += 8;
+ bfd_put_64(abfd, value, PRIV (output_buf) + PRIV (output_size));
+ PRIV (output_size) += 8;
return;
}
-
/* Output c-string as counted string */
void
@@ -940,7 +920,6 @@ int len;
_bfd_vms_output_dump (abfd, (unsigned char *)value, len);
}
-
/* Output character area */
void
@@ -956,13 +935,12 @@ _bfd_vms_output_dump (abfd, data, length)
if (length == 0)
return;
- memcpy (PRIV(output_buf) + PRIV(output_size), data, length);
- PRIV(output_size) += length;
+ memcpy (PRIV (output_buf) + PRIV (output_size), data, length);
+ PRIV (output_size) += length;
return;
}
-
/* Output count bytes of value */
void
@@ -977,8 +955,8 @@ _bfd_vms_output_fill (abfd, value, count)
if (count == 0)
return;
- memset (PRIV(output_buf) + PRIV(output_size), value, count);
- PRIV(output_size) += count;
+ memset (PRIV (output_buf) + PRIV (output_size), value, count);
+ PRIV (output_size) += count;
return;
}
@@ -1043,7 +1021,7 @@ _bfd_vms_length_hash_symbol (abfd, in, maxlen)
}
else
{
- if (PRIV(flag_hash_long_names))
+ if (PRIV (flag_hash_long_names))
i = maxlen-9;
else
i = maxlen;
@@ -1054,7 +1032,7 @@ _bfd_vms_length_hash_symbol (abfd, in, maxlen)
out += i;
if ((in_len > maxlen)
- && PRIV(flag_hash_long_names))
+ && PRIV (flag_hash_long_names))
sprintf (out, "_%08lx", result);
else
*out = 0;
@@ -1064,14 +1042,13 @@ _bfd_vms_length_hash_symbol (abfd, in, maxlen)
#endif
if (in_len > maxlen
- && PRIV(flag_hash_long_names)
- && PRIV(flag_show_after_trunc))
+ && PRIV (flag_hash_long_names)
+ && PRIV (flag_show_after_trunc))
printf (_("Symbol %s replaced by %s\n"), old_name, new_name);
return outbuf;
}
-
/* Allocate and initialize a new symbol. */
static asymbol *
@@ -1094,7 +1071,6 @@ new_symbol (abfd, name)
return symbol;
}
-
/* Allocate and enter a new private symbol. */
vms_symbol_entry *
@@ -1109,13 +1085,13 @@ _bfd_vms_enter_symbol (abfd, name)
#endif
entry = (vms_symbol_entry *)
- bfd_hash_lookup (PRIV(vms_symbol_table), name, false, false);
+ bfd_hash_lookup (PRIV (vms_symbol_table), name, false, false);
if (entry == 0)
{
#if VMS_DEBUG
_bfd_vms_debug (8, "creating hash entry for %s\n", name);
#endif
- entry = (vms_symbol_entry *)bfd_hash_lookup (PRIV(vms_symbol_table), name, true, false);
+ entry = (vms_symbol_entry *)bfd_hash_lookup (PRIV (vms_symbol_table), name, true, false);
if (entry != 0)
{
asymbol *symbol;
@@ -1123,7 +1099,7 @@ _bfd_vms_enter_symbol (abfd, name)
if (symbol != 0)
{
entry->symbol = symbol;
- PRIV(gsd_sym_count)++;
+ PRIV (gsd_sym_count)++;
abfd->symcount++;
}
else
diff --git a/gnu/usr.bin/binutils/bfd/vms-tir.c b/gnu/usr.bin/binutils/bfd/vms-tir.c
index 124b1b39d89..1f3446c7346 100644
--- a/gnu/usr.bin/binutils/bfd/vms-tir.c
+++ b/gnu/usr.bin/binutils/bfd/vms-tir.c
@@ -1,6 +1,6 @@
/* vms-tir.c -- BFD back-end for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
TIR record handling functions
ETIR record handling functions
@@ -24,7 +24,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. */
-
/* The following type abbreviations are used:
cs counted string (ascii string with length byte)
@@ -96,7 +95,6 @@ image_set_ptr (abfd, psect, offset)
return;
}
-
/* Increment image buffer pointer by offset */
static void
@@ -113,7 +111,6 @@ image_inc_ptr (abfd, offset)
return;
}
-
/* Dump multiple bytes to section image */
static void
@@ -136,7 +133,6 @@ image_dump (abfd, ptr, size, offset)
return;
}
-
/* Write byte to section image */
static void
@@ -155,7 +151,6 @@ image_write_b (abfd, value)
return;
}
-
/* Write 2-byte word to image */
static void
@@ -176,7 +171,6 @@ image_write_w (abfd, value)
return;
}
-
/* Write 4-byte long to image */
static void
@@ -197,7 +191,6 @@ image_write_l (abfd, value)
return;
}
-
/* Write 8-byte quad to image */
static void
@@ -222,12 +215,12 @@ image_write_q (abfd, value)
#define HIGHBIT(op) ((op & 0x80000000L) == 0x80000000L)
/* etir_sta
-
+
vms stack commands
-
+
handle sta_xxx commands in etir section
ptr points to data area in record
-
+
see table B-8 of the openVMS linker manual */
static boolean
@@ -268,7 +261,7 @@ etir_sta (abfd, cmd, ptr)
}
else
{
- _bfd_vms_push (abfd, (uquad)(entry->symbol->value), -1);
+ _bfd_vms_push (abfd, (uquad) (entry->symbol->value), -1);
}
}
break;
@@ -336,15 +329,14 @@ etir_sta (abfd, cmd, ptr)
return true;
}
-
/*
etir_sto
-
+
vms store commands
-
+
handle sto_xxx commands in etir section
ptr points to data area in record
-
+
see table B-9 of the openVMS linker manual */
static boolean
@@ -438,7 +430,7 @@ etir_sto (abfd, cmd, ptr)
return false;
}
else
- image_write_q (abfd, (uquad)(entry->symbol->value)); /* FIXME, reloc */
+ image_write_q (abfd, (uquad) (entry->symbol->value)); /* FIXME, reloc */
}
break;
@@ -459,7 +451,7 @@ etir_sto (abfd, cmd, ptr)
return false;
}
else
- image_write_q (abfd, (uquad)(entry->symbol->value)); /* FIXME, reloc */
+ image_write_q (abfd, (uquad) (entry->symbol->value)); /* FIXME, reloc */
}
break;
@@ -518,7 +510,7 @@ etir_sto (abfd, cmd, ptr)
image_write_l (abfd, (unsigned long)0); /* FIXME, reloc */
}
else
- image_write_l (abfd, (unsigned long)(entry->symbol->value)); /* FIXME, reloc */
+ image_write_l (abfd, (unsigned long) (entry->symbol->value)); /* FIXME, reloc */
}
break;
@@ -552,7 +544,7 @@ etir_sto (abfd, cmd, ptr)
all 32 bit signed arithmetic
all word just like a stack calculator
arguments are popped from stack, results are pushed on stack
-
+
see table B-10 of the openVMS linker manual */
static boolean
@@ -582,7 +574,7 @@ etir_opr (abfd, cmd, ptr)
case ETIR_S_C_OPR_ADD:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 + op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 + op2), -1);
break;
/* subtract */
@@ -590,7 +582,7 @@ etir_opr (abfd, cmd, ptr)
case ETIR_S_C_OPR_SUB:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op2 - op1), -1);
+ _bfd_vms_push (abfd, (uquad) (op2 - op1), -1);
break;
/* multiply */
@@ -598,7 +590,7 @@ etir_opr (abfd, cmd, ptr)
case ETIR_S_C_OPR_MUL:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 * op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 * op2), -1);
break;
/* divide */
@@ -609,7 +601,7 @@ etir_opr (abfd, cmd, ptr)
if (op2 == 0)
_bfd_vms_push (abfd, (uquad)0L, -1);
else
- _bfd_vms_push (abfd, (uquad)(op2 / op1), -1);
+ _bfd_vms_push (abfd, (uquad) (op2 / op1), -1);
break;
/* logical and */
@@ -617,7 +609,7 @@ etir_opr (abfd, cmd, ptr)
case ETIR_S_C_OPR_AND:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 & op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 & op2), -1);
break;
/* logical inclusive or */
@@ -625,7 +617,7 @@ etir_opr (abfd, cmd, ptr)
case ETIR_S_C_OPR_IOR:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 | op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 | op2), -1);
break;
/* logical exclusive or */
@@ -633,21 +625,21 @@ etir_opr (abfd, cmd, ptr)
case ETIR_S_C_OPR_EOR:
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 ^ op2), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 ^ op2), -1);
break;
/* negate */
case ETIR_S_C_OPR_NEG:
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(-op1), -1);
+ _bfd_vms_push (abfd, (uquad) (-op1), -1);
break;
/* complement */
case ETIR_S_C_OPR_COM:
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (uquad)(op1 ^ -1L), -1);
+ _bfd_vms_push (abfd, (uquad) (op1 ^ -1L), -1);
break;
/* insert field */
@@ -714,9 +706,8 @@ etir_opr (abfd, cmd, ptr)
return true;
}
-
/* control commands
-
+
see table B-11 of the openVMS linker manual */
static boolean
@@ -782,9 +773,8 @@ etir_ctl (abfd, cmd, ptr)
return true;
}
-
/* store conditional commands
-
+
see table B-12 and B-13 of the openVMS linker manual */
static boolean
@@ -904,7 +894,6 @@ etir_stc (abfd, cmd, ptr)
return true;
}
-
static asection *
new_section (abfd, idx)
bfd *abfd ATTRIBUTE_UNUSED;
@@ -943,7 +932,6 @@ new_section (abfd, idx)
return section;
}
-
static int
alloc_section (abfd, idx)
bfd *abfd;
@@ -969,7 +957,6 @@ alloc_section (abfd, idx)
return 0;
}
-
/*
* tir_sta
*
@@ -1010,7 +997,7 @@ tir_sta (bfd *abfd, unsigned char *ptr)
if (entry == (vms_symbol_entry *)NULL)
return 0;
- _bfd_vms_push (abfd, (unsigned long)(entry->symbol->value), -1);
+ _bfd_vms_push (abfd, (unsigned long) (entry->symbol->value), -1);
ptr += *ptr + 1;
}
break;
@@ -1292,7 +1279,6 @@ tir_sta (bfd *abfd, unsigned char *ptr)
return ptr;
}
-
/*
* tir_sto
*
@@ -1464,7 +1450,6 @@ tir_sto (bfd *abfd, unsigned char *ptr)
return ptr;
}
-
/*
* stack operator commands
* all 32 bit signed arithmetic
@@ -1498,7 +1483,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 + op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 + op2), -1);
break;
case TIR_S_C_OPR_SUB:
@@ -1507,7 +1492,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op2 - op1), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op2 - op1), -1);
break;
case TIR_S_C_OPR_MUL:
@@ -1516,7 +1501,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 * op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 * op2), -1);
break;
case TIR_S_C_OPR_DIV:
@@ -1528,7 +1513,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
if (op2 == 0)
_bfd_vms_push (abfd, (unsigned long)0L, -1);
else
- _bfd_vms_push (abfd, (unsigned long)(op2 / op1), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op2 / op1), -1);
break;
case TIR_S_C_OPR_AND:
@@ -1537,7 +1522,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 & op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 & op2), -1);
break;
case TIR_S_C_OPR_IOR:
@@ -1546,7 +1531,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
* logical inclusive or
*/
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 | op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 | op2), -1);
break;
case TIR_S_C_OPR_EOR:
@@ -1555,7 +1540,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
op2 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 ^ op2), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 ^ op2), -1);
break;
case TIR_S_C_OPR_NEG:
@@ -1563,7 +1548,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
* negate
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(-op1), -1);
+ _bfd_vms_push (abfd, (unsigned long) (-op1), -1);
break;
case TIR_S_C_OPR_COM:
@@ -1571,7 +1556,7 @@ tir_opr (bfd *abfd, unsigned char *ptr)
* complement
*/
op1 = (long)_bfd_vms_pop (abfd, NULL);
- _bfd_vms_push (abfd, (unsigned long)(op1 ^ -1L), -1);
+ _bfd_vms_push (abfd, (unsigned long) (op1 ^ -1L), -1);
break;
case TIR_S_C_OPR_INSV:
@@ -1660,7 +1645,6 @@ tir_opr (bfd *abfd, unsigned char *ptr)
return ptr;
}
-
static unsigned char *
tir_ctl (bfd *abfd, unsigned char *ptr)
/*
@@ -1729,7 +1713,6 @@ tir_ctl (bfd *abfd, unsigned char *ptr)
return ptr;
}
-
/*
* handle command from TIR section
*/
@@ -1740,7 +1723,7 @@ tir_cmd (bfd *abfd, unsigned char *ptr)
struct {
int mincod;
int maxcod;
- unsigned char * (*explain)(bfd *, unsigned char *);
+ unsigned char * (*explain) (bfd *, unsigned char *);
} tir_table[] = {
{ 0, TIR_S_C_MAXSTACOD, tir_sta }
,{ TIR_S_C_MINSTOCOD, TIR_S_C_MAXSTOCOD, tir_sto }
@@ -1765,7 +1748,7 @@ tir_cmd (bfd *abfd, unsigned char *ptr)
{
while (tir_table[i].mincod >= 0)
{
- if ( (tir_table[i].mincod <= *ptr)
+ if ( (tir_table[i].mincod <= *ptr)
&& (*ptr <= tir_table[i].maxcod))
{
ptr = tir_table[i].explain (abfd, ptr);
@@ -1783,7 +1766,6 @@ tir_cmd (bfd *abfd, unsigned char *ptr)
return ptr;
}
-
/* handle command from ETIR section */
static int
@@ -1814,7 +1796,7 @@ etir_cmd (abfd, cmd, ptr)
while (etir_table[i].mincod >= 0)
{
- if ( (etir_table[i].mincod <= cmd)
+ if ( (etir_table[i].mincod <= cmd)
&& (cmd <= etir_table[i].maxcod))
{
if (!etir_table[i].explain (abfd, cmd, ptr))
@@ -1830,7 +1812,6 @@ etir_cmd (abfd, cmd, ptr)
return 0;
}
-
/* Text Information and Relocation Records (OBJ$C_TIR)
handle tir record */
@@ -1858,7 +1839,6 @@ analyze_tir (abfd, ptr, length)
return 0;
}
-
/* Text Information and Relocation Records (EOBJ$C_ETIR)
handle etir record */
@@ -1895,9 +1875,8 @@ analyze_etir (abfd, ptr, length)
return result;
}
-
/* process ETIR record
-
+
return 0 on success, -1 on error */
int
@@ -1931,10 +1910,9 @@ _bfd_vms_slurp_tir (abfd, objtype)
return result;
}
-
/* process EDBG record
return 0 on success, -1 on error
-
+
not implemented yet */
int
@@ -1950,10 +1928,9 @@ _bfd_vms_slurp_dbg (abfd, objtype)
return 0;
}
-
/* process ETBT record
return 0 on success, -1 on error
-
+
not implemented yet */
int
@@ -1968,10 +1945,9 @@ _bfd_vms_slurp_tbt (abfd, objtype)
return 0;
}
-
/* process LNK record
return 0 on success, -1 on error
-
+
not implemented yet */
int
@@ -2032,7 +2008,7 @@ sto_imm (abfd, sptr, vaddr, index)
}
_bfd_vms_output_begin (abfd, ETIR_S_C_STO_IMM, -1);
- _bfd_vms_output_long (abfd, (unsigned long)(size));
+ _bfd_vms_output_long (abfd, (unsigned long) (size));
_bfd_vms_output_dump (abfd, cptr, size);
_bfd_vms_output_flush (abfd);
@@ -2077,14 +2053,13 @@ start_etir_record (abfd, index, offset, justoffset)
return;
}
-
/* end etir record */
static void
end_etir_record (abfd)
bfd *abfd;
{
_bfd_vms_output_pop (abfd);
- _bfd_vms_output_end (abfd);
+ _bfd_vms_output_end (abfd);
}
/* write section contents for bfd abfd */
@@ -2115,7 +2090,7 @@ _bfd_vms_write_tir (abfd, objtype)
{
#if VMS_DEBUG
- _bfd_vms_debug (4, "writing %d. section '%s' (%d bytes)\n", section->index, section->name, (int)(section->_raw_size));
+ _bfd_vms_debug (4, "writing %d. section '%s' (%d bytes)\n", section->index, section->name, (int) (section->_raw_size));
#endif
if (section->flags & SEC_RELOC)
@@ -2138,7 +2113,7 @@ _bfd_vms_write_tir (abfd, objtype)
_bfd_vms_debug (4, "sym %s in sec %s, value %08lx, addr %08lx, off %08lx, len %d: %s\n",
(*(*rptr)->sym_ptr_ptr)->name,
(*(*rptr)->sym_ptr_ptr)->section->name,
- (long)(*(*rptr)->sym_ptr_ptr)->value,
+ (long) (*(*rptr)->sym_ptr_ptr)->value,
(*rptr)->address, (*rptr)->addend,
bfd_get_reloc_size((*rptr)->howto),
(*rptr)->howto->name);
@@ -2160,7 +2135,7 @@ _bfd_vms_write_tir (abfd, objtype)
return -1;
}
- vaddr = (bfd_vma)(sptr->offset);
+ vaddr = (bfd_vma) (sptr->offset);
start_etir_record (abfd, section->index, (uquad) sptr->offset,
false);
@@ -2259,9 +2234,9 @@ _bfd_vms_write_tir (abfd, objtype)
ETIR_S_C_STA_PQ,
-1);
_bfd_vms_output_long (abfd,
- (unsigned long)(sec->index));
+ (unsigned long) (sec->index));
_bfd_vms_output_quad (abfd,
- ((uquad)(*rptr)->addend
+ ((uquad) (*rptr)->addend
+ (uquad)sym->value));
_bfd_vms_output_flush (abfd);
_bfd_vms_output_begin (abfd,
@@ -2325,9 +2300,9 @@ _bfd_vms_write_tir (abfd, objtype)
ETIR_S_C_STA_PQ,
-1);
_bfd_vms_output_long (abfd,
- (unsigned long)(sec->index));
+ (unsigned long) (sec->index));
_bfd_vms_output_quad (abfd,
- ((uquad)(*rptr)->addend
+ ((uquad) (*rptr)->addend
+ (uquad)sym->value));
_bfd_vms_output_flush (abfd);
_bfd_vms_output_begin (abfd,
@@ -2348,7 +2323,7 @@ _bfd_vms_write_tir (abfd, objtype)
sptr->size = hint_size;
#if 0
vms_output_begin(abfd, ETIR_S_C_STO_HINT_GBL, -1);
- vms_output_long(abfd, (unsigned long)(sec->index));
+ vms_output_long(abfd, (unsigned long) (sec->index));
vms_output_quad(abfd, (uquad)addr);
vms_output_counted(abfd, _bfd_vms_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ));
@@ -2456,7 +2431,6 @@ _bfd_vms_write_tir (abfd, objtype)
return 0;
}
-
/* write traceback data for bfd abfd */
int
@@ -2471,7 +2445,6 @@ _bfd_vms_write_tbt (abfd, objtype)
return 0;
}
-
/* write debug info for bfd abfd */
int
diff --git a/gnu/usr.bin/binutils/bfd/vms.c b/gnu/usr.bin/binutils/bfd/vms.c
index f0ea63ff92d..273c6f9961f 100644
--- a/gnu/usr.bin/binutils/bfd/vms.c
+++ b/gnu/usr.bin/binutils/bfd/vms.c
@@ -1,6 +1,7 @@
/* vms.c -- BFD back-end for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Written by Klaus K"ampf (kkaempf@rmi.de)
@@ -170,7 +171,7 @@ const bfd_target vms_alpha_vec =
BFD_JUMP_TABLE_DYNAMIC (vms),
NULL,
-
+
(PTR) 0
};
@@ -216,7 +217,7 @@ const bfd_target vms_vax_vec =
BFD_JUMP_TABLE_DYNAMIC (vms),
NULL,
-
+
(PTR) 0
};
@@ -241,72 +242,71 @@ vms_initialize (abfd)
return false;
#ifdef __ALPHA
- PRIV(is_vax) = 0;
+ PRIV (is_vax) = 0;
#else
- PRIV(is_vax) = 1;
+ PRIV (is_vax) = 1;
#endif
- PRIV(vms_buf) = 0;
- PRIV(buf_size) = 0;
- PRIV(rec_length) = 0;
- PRIV(file_format) = FF_UNKNOWN;
- PRIV(fixup_done) = false;
- PRIV(sections) = NULL;
+ PRIV (vms_buf) = 0;
+ PRIV (buf_size) = 0;
+ PRIV (rec_length) = 0;
+ PRIV (file_format) = FF_UNKNOWN;
+ PRIV (fixup_done) = false;
+ PRIV (sections) = NULL;
- PRIV(stack) = ((struct stack_struct *)
+ PRIV (stack) = ((struct stack_struct *)
bfd_malloc (sizeof (struct stack_struct) * STACKSIZE));
- if (PRIV(stack) == 0)
+ if (PRIV (stack) == 0)
{
vms_init_no_mem1:
free (abfd->tdata.any);
abfd->tdata.any = 0;
return false;
}
- PRIV(stackptr) = 0;
+ PRIV (stackptr) = 0;
- PRIV(vms_symbol_table) = ((struct bfd_hash_table *)
+ PRIV (vms_symbol_table) = ((struct bfd_hash_table *)
bfd_malloc (sizeof (struct bfd_hash_table)));
- if (PRIV(vms_symbol_table) == 0)
+ if (PRIV (vms_symbol_table) == 0)
{
vms_init_no_mem2:
- free (PRIV(stack));
- PRIV(stack) = 0;
+ free (PRIV (stack));
+ PRIV (stack) = 0;
goto vms_init_no_mem1;
}
- if (!bfd_hash_table_init (PRIV(vms_symbol_table), _bfd_vms_hash_newfunc))
+ if (!bfd_hash_table_init (PRIV (vms_symbol_table), _bfd_vms_hash_newfunc))
return false;
- PRIV(location_stack) = ((struct location_struct *)
+ PRIV (location_stack) = ((struct location_struct *)
bfd_malloc (sizeof (struct location_struct)
* LOCATION_SAVE_SIZE));
- if (PRIV(location_stack) == 0)
+ if (PRIV (location_stack) == 0)
{
vms_init_no_mem3:
- free (PRIV(vms_symbol_table));
- PRIV(vms_symbol_table) = 0;
+ free (PRIV (vms_symbol_table));
+ PRIV (vms_symbol_table) = 0;
goto vms_init_no_mem2;
}
for (i = 0; i < VMS_SECTION_COUNT; i++)
- PRIV(vms_section_table)[i] = NULL;
+ PRIV (vms_section_table)[i] = NULL;
- PRIV(output_buf) = (unsigned char *) malloc (MAX_OUTREC_SIZE);
- if (PRIV(output_buf) == 0)
+ PRIV (output_buf) = (unsigned char *) malloc (MAX_OUTREC_SIZE);
+ if (PRIV (output_buf) == 0)
{
- free (PRIV(location_stack));
- PRIV(location_stack) = 0;
+ free (PRIV (location_stack));
+ PRIV (location_stack) = 0;
goto vms_init_no_mem3;
}
- PRIV(push_level) = 0;
- PRIV(pushed_size) = 0;
- PRIV(length_pos) = 2;
- PRIV(output_size) = 0;
- PRIV(output_alignment) = 1;
+ PRIV (push_level) = 0;
+ PRIV (pushed_size) = 0;
+ PRIV (length_pos) = 2;
+ PRIV (output_size) = 0;
+ PRIV (output_alignment) = 1;
return true;
}
-
/* Fill symbol->section with section ptr
symbol->section is filled with the section index for defined symbols
during reading the GSD/EGSD section. But we need the pointer to the
@@ -345,7 +345,6 @@ fill_section_ptr (entry, sections)
return true;
}
-
/* Fixup sections
set up all pointers and arrays, counters and sizes are fixed now
@@ -359,7 +358,7 @@ static boolean
vms_fixup_sections (abfd)
bfd *abfd;
{
- if (PRIV(fixup_done))
+ if (PRIV (fixup_done))
return true;
/*
@@ -367,11 +366,11 @@ vms_fixup_sections (abfd)
*/
/* can't provide section count as argument to fill_section_ptr(). */
- priv_section_count = PRIV(section_count);
- bfd_hash_traverse (PRIV(vms_symbol_table), fill_section_ptr,
- (PTR)(PRIV(sections)));
+ priv_section_count = PRIV (section_count);
+ bfd_hash_traverse (PRIV (vms_symbol_table), fill_section_ptr,
+ (PTR) (PRIV (sections)));
- PRIV(fixup_done) = true;
+ PRIV (fixup_done) = true;
return true;
}
@@ -416,14 +415,14 @@ vms_object_p (abfd)
if (_bfd_vms_next_record (abfd) < 0)
{
#if VMS_DEBUG
- vms_debug (2, "next_record failed\n");
+ vms_debug (2, "next_record failed\n");
#endif
bfd_set_error (bfd_error_wrong_format);
return 0;
}
if ((prev_type == EOBJ_S_C_EGSD)
- && (PRIV(rec_type) != EOBJ_S_C_EGSD))
+ && (PRIV (rec_type) != EOBJ_S_C_EGSD))
{
if (vms_fixup_sections (abfd) == false)
{
@@ -435,7 +434,7 @@ vms_object_p (abfd)
}
}
- prev_type = PRIV(rec_type);
+ prev_type = PRIV (rec_type);
if (target_vector == 0)
{
@@ -501,7 +500,7 @@ vms_object_p (abfd)
}
/* set arch_info to vax */
-
+
arch = bfd_scan_arch ("vax");
PRIV (is_vax) = 1;
#if VMS_DEBUG
@@ -511,7 +510,7 @@ vms_object_p (abfd)
else if (target_vector == &vms_alpha_vec)
{
/* set arch_info to alpha */
-
+
arch = bfd_scan_arch ("alpha");
PRIV (is_vax) = 0;
#if VMS_DEBUG
@@ -532,7 +531,6 @@ vms_object_p (abfd)
return target_vector;
}
-
/* Check the format for a file being read.
Return a (bfd_target *) if it's an archive file or zero. */
@@ -547,7 +545,6 @@ vms_archive_p (abfd)
return 0;
}
-
/* Set the format of a file being written. */
static boolean
@@ -581,7 +578,6 @@ vms_mkobject (abfd)
return true;
}
-
/* Write cached information into a file being written, at bfd_close. */
static boolean
@@ -594,7 +590,7 @@ vms_write_object_contents (abfd)
if (abfd->section_count > 0) /* we have sections */
{
- if (PRIV(is_vax))
+ if (PRIV (is_vax))
{
if (_bfd_vms_write_hdr (abfd, OBJ_S_C_HDR) != 0)
return false;
@@ -654,17 +650,17 @@ vms_close_and_cleanup (abfd)
if (abfd == 0)
return true;
- if (PRIV(vms_buf) != NULL)
+ if (PRIV (vms_buf) != NULL)
{
- free (PRIV(vms_buf));
- PRIV(vms_buf) = NULL;
+ free (PRIV (vms_buf));
+ PRIV (vms_buf) = NULL;
}
- PRIV(buf_size) = 0;
+ PRIV (buf_size) = 0;
- if (PRIV(output_buf) != 0)
+ if (PRIV (output_buf) != 0)
{
- free (PRIV(output_buf));
- PRIV(output_buf) = 0;
+ free (PRIV (output_buf));
+ PRIV (output_buf) = 0;
}
sec = abfd->sections;
@@ -675,40 +671,40 @@ vms_close_and_cleanup (abfd)
sec = sec->next;
}
- if (PRIV(sections) != NULL)
+ if (PRIV (sections) != NULL)
{
- free (PRIV(sections));
- PRIV(sections) = NULL;
+ free (PRIV (sections));
+ PRIV (sections) = NULL;
}
- if (PRIV(vms_symbol_table))
+ if (PRIV (vms_symbol_table))
{
- bfd_hash_table_free (PRIV(vms_symbol_table));
- PRIV(vms_symbol_table) = 0;
+ bfd_hash_table_free (PRIV (vms_symbol_table));
+ PRIV (vms_symbol_table) = 0;
}
- if (PRIV(stack))
+ if (PRIV (stack))
{
- free (PRIV(stack));
- PRIV(stack) = 0;
+ free (PRIV (stack));
+ PRIV (stack) = 0;
}
- if (PRIV(location_stack))
+ if (PRIV (location_stack))
{
- free (PRIV(location_stack));
- PRIV(location_stack) = 0;
+ free (PRIV (location_stack));
+ PRIV (location_stack) = 0;
}
for (i = 0; i < VMS_SECTION_COUNT; i++)
{
- es = PRIV(vms_section_table)[i];
+ es = PRIV (vms_section_table)[i];
while (es != NULL)
{
es1 = es->next;
free (es);
es = es1;
}
- PRIV(vms_section_table)[i] = NULL;
+ PRIV (vms_section_table)[i] = NULL;
}
free (abfd->tdata.any);
@@ -717,7 +713,6 @@ vms_close_and_cleanup (abfd)
return true;
}
-
/* Ask the BFD to free all cached information. */
static boolean
vms_bfd_free_cached_info (abfd)
@@ -729,7 +724,6 @@ vms_bfd_free_cached_info (abfd)
return true;
}
-
/* Called when a new section is created. */
static boolean
@@ -742,18 +736,18 @@ vms_new_section_hook (abfd, section)
#endif
bfd_set_section_alignment(abfd, section, 4);
- if (abfd->section_count > PRIV(section_count))
+ if (abfd->section_count > PRIV (section_count))
{
- PRIV(sections) = ((asection **)
- bfd_realloc (PRIV(sections), abfd->section_count * sizeof (asection *)));
- if (PRIV(sections) == 0)
+ PRIV (sections) = ((asection **)
+ bfd_realloc (PRIV (sections), abfd->section_count * sizeof (asection *)));
+ if (PRIV (sections) == 0)
return false;
- PRIV(section_count) = abfd->section_count;
+ PRIV (section_count) = abfd->section_count;
}
#if VMS_DEBUG
- vms_debug (6, "section_count: %d\n", PRIV(section_count));
+ vms_debug (6, "section_count: %d\n", PRIV (section_count));
#endif
- PRIV(sections)[section->index] = section;
+ PRIV (sections)[section->index] = section;
#if VMS_DEBUG
vms_debug (7, "%d: %s\n", section->index, section->name);
#endif
@@ -761,7 +755,6 @@ vms_new_section_hook (abfd, section)
return true;
}
-
/* Read the contents of a section.
buf points to a buffer of buf_size bytes to be filled with
section data (starting at offset into section) */
@@ -822,7 +815,6 @@ vms_bfd_copy_private_bfd_data (src, dest)
return true;
}
-
/* 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:
@@ -841,7 +833,6 @@ vms_bfd_merge_private_bfd_data (ibfd, obfd)
return true;
}
-
/* Set private BFD flag information in the BFD @var{abfd}.
Return <<true>> on success, <<false>> on error. Possible error
returns are:
@@ -860,7 +851,6 @@ vms_bfd_set_private_flags (abfd, flags)
return true;
}
-
/* Called to copy BFD private section data from one object file
to another. */
@@ -881,7 +871,7 @@ vms_bfd_copy_private_section_data (srcbfd, srcsec, dstbfd, dstsec)
/* Called to copy BFD private symbol data from one object file
to another. */
-static boolean
+static boolean
vms_bfd_copy_private_symbol_data (ibfd, isym, obfd, osym)
bfd *ibfd ATTRIBUTE_UNUSED;
asymbol *isym ATTRIBUTE_UNUSED;
@@ -910,7 +900,6 @@ vms_core_file_failing_command (abfd)
return 0;
}
-
/* Returns the signal number which caused the core dump which
generated the file the BFD abfd is attached to. */
@@ -924,7 +913,6 @@ vms_core_file_failing_signal (abfd)
return 0;
}
-
/* Return true if the core file attached to core_bfd was generated
by a run of the executable file attached to exec_bfd, false otherwise. */
@@ -954,7 +942,6 @@ vms_slurp_armap (abfd)
return false;
}
-
/* ??? do something with an extended name table.
Return false on error, true otherwise. */
@@ -968,7 +955,6 @@ vms_slurp_extended_name_table (abfd)
return false;
}
-
/* ??? do something with an extended name table.
Return false on error, true otherwise. */
@@ -985,7 +971,6 @@ vms_construct_extended_name_table (abfd, tabloc, tablen, name)
return false;
}
-
/* Truncate the name of an archive to match system-dependent restrictions */
static void
@@ -1000,7 +985,6 @@ vms_truncate_arname (abfd, pathname, arhdr)
return;
}
-
/* ??? write archive map */
static boolean
@@ -1030,7 +1014,6 @@ vms_read_ar_hdr (abfd)
return (PTR)0;
}
-
/* Provided a BFD, @var{archive}, containing an archive and NULL, open
an input BFD on the first contained element and returns that.
Subsequent calls should pass the archive and the previous return value
@@ -1045,10 +1028,9 @@ vms_openr_next_archived_file (arch, prev)
#if VMS_DEBUG
vms_debug (1, "vms_openr_next_archived_file(%p, %p)\n", arch, prev);
#endif
- return false;
+ return NULL;
}
-
/* Return the BFD which is referenced by the symbol in ABFD indexed by
INDEX. INDEX should have been returned by bfd_get_next_mapent. */
@@ -1063,7 +1045,6 @@ vms_get_elt_at_index (abfd, index)
return _bfd_generic_get_elt_at_index(abfd, index);
}
-
/* ???
-> bfd_generic_stat_arch_elt */
@@ -1078,7 +1059,6 @@ vms_generic_stat_arch_elt (abfd, stat)
return bfd_generic_stat_arch_elt(abfd, stat);
}
-
/* This is a new function in bfd 2.5 */
static boolean
@@ -1103,12 +1083,11 @@ vms_get_symtab_upper_bound (abfd)
bfd *abfd;
{
#if VMS_DEBUG
- vms_debug (1, "vms_get_symtab_upper_bound(%p), %d symbols\n", abfd, PRIV(gsd_sym_count));
+ vms_debug (1, "vms_get_symtab_upper_bound(%p), %d symbols\n", abfd, PRIV (gsd_sym_count));
#endif
- return (PRIV(gsd_sym_count)+1) * sizeof(asymbol *);
+ return (PRIV (gsd_sym_count)+1) * sizeof (asymbol *);
}
-
/* Copy symbols from hash table to symbol vector
called from bfd_hash_traverse in vms_get_symtab
@@ -1122,14 +1101,13 @@ copy_symbols (entry, arg)
bfd *abfd = (bfd *) arg;
if (entry == NULL) /* init counter */
- PRIV(symnum) = 0;
+ PRIV (symnum) = 0;
else /* fill vector, inc counter */
- PRIV(symcache)[PRIV(symnum)++] = ((vms_symbol_entry *)entry)->symbol;
+ PRIV (symcache)[PRIV (symnum)++] = ((vms_symbol_entry *)entry)->symbol;
return true;
}
-
/* Read the symbols from the BFD abfd, and fills in the vector
location with pointers to the symbols and a trailing NULL.
@@ -1149,15 +1127,14 @@ vms_get_symtab (abfd, symbols)
/* traverse table and fill symbols vector */
- PRIV(symcache) = symbols;
- bfd_hash_traverse(PRIV(vms_symbol_table), copy_symbols, (PTR)abfd);
+ PRIV (symcache) = symbols;
+ bfd_hash_traverse(PRIV (vms_symbol_table), copy_symbols, (PTR)abfd);
- symbols[PRIV(gsd_sym_count)] = NULL;
+ symbols[PRIV (gsd_sym_count)] = NULL;
- return PRIV(gsd_sym_count);
+ return PRIV (gsd_sym_count);
}
-
/* Create a new asymbol structure for the BFD abfd and return a pointer
to it.
This routine is necessary because each back end has private information
@@ -1168,7 +1145,7 @@ asymbol *
_bfd_vms_make_empty_symbol (abfd)
bfd *abfd;
{
- asymbol *symbol = (asymbol *)bfd_zalloc(abfd, sizeof(asymbol));
+ asymbol *symbol = (asymbol *)bfd_zalloc(abfd, sizeof (asymbol));
#if VMS_DEBUG
vms_debug (1, "_bfd_vms_make_empty_symbol(%p)\n", abfd);
@@ -1184,7 +1161,6 @@ _bfd_vms_make_empty_symbol (abfd)
return symbol;
}
-
/* Print symbol to file according to how. how is one of
bfd_print_symbol_name just print the name
bfd_print_symbol_more print more (???)
@@ -1205,9 +1181,7 @@ vms_print_symbol (abfd, file, symbol, how)
{
case bfd_print_symbol_name:
case bfd_print_symbol_more:
- fprintf((FILE *)file," %s", symbol->name);
- break;
-
+ fprintf ((FILE *)file," %s", symbol->name);
break;
case bfd_print_symbol_all:
@@ -1216,14 +1190,13 @@ vms_print_symbol (abfd, file, symbol, how)
bfd_print_symbol_vandf((PTR)file,symbol);
- fprintf((FILE *)file," %-8s %s", section_name, symbol->name);
+ fprintf ((FILE *)file," %-8s %s", section_name, symbol->name);
}
break;
}
return;
}
-
/* Return information about symbol in ret.
fill type, value and name
@@ -1281,7 +1254,6 @@ vms_get_symbol_info (abfd, symbol, ret)
return;
}
-
/* Return true if the given symbol sym in the BFD abfd is
a compiler generated local label, else return false. */
@@ -1296,7 +1268,6 @@ vms_bfd_is_local_label_name (abfd, name)
return name[0] == '$';
}
-
/* Get source line number for symbol */
static alent *
@@ -1310,7 +1281,6 @@ vms_get_lineno (abfd, symbol)
return 0;
}
-
/* Provided a BFD, a section and an offset into the section, calculate and
return the name of the source file and the line nearest to the wanted
location. */
@@ -1332,7 +1302,6 @@ vms_find_nearest_line (abfd, section, symbols, offset, file, func, line)
return false;
}
-
/* 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. */
@@ -1349,7 +1318,6 @@ vms_bfd_make_debug_symbol (abfd, ptr, size)
return 0;
}
-
/* Read minisymbols. For minisymbols, we use the unmodified a.out
symbols. The minisymbol_to_symbol function translates these into
BFD asymbol structures. */
@@ -1401,7 +1369,6 @@ vms_get_reloc_upper_bound (abfd, section)
return -1L;
}
-
/* Call the back end associated with the open BFD abfd and translate the
external form of the relocation information attached to sec into the
internal canonical form. Place the table into memory at loc, which has
@@ -1710,7 +1677,6 @@ vms_bfd_reloc_type_lookup (abfd, code)
return &alpha_howto_table[alpha_type];
}
-
/*-- Part 4.7, writing an object file ---------------------------------------*/
/* Set the architecture and machine type in BFD abfd to arch and mach.
@@ -1731,7 +1697,6 @@ vms_set_arch_mach (abfd, arch, mach)
return true;
}
-
/* Sets the contents of the section section in BFD abfd to the data starting
in memory at data. The data is written to the output section starting at
offset offset for count bytes.
@@ -1757,7 +1722,6 @@ vms_set_section_contents (abfd, section, location, offset, count)
return _bfd_save_vms_section(abfd, section, location, offset, count);
}
-
/*-- Part 4.8, linker -------------------------------------------------------*/
/* Get the size of the section headers. */
@@ -1773,7 +1737,6 @@ vms_sizeof_headers (abfd, reloc)
return 0;
}
-
/* Provides default handling of relocation effort for back ends
which can't be bothered to do it efficiently. */
@@ -1794,7 +1757,6 @@ vms_bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
return 0;
}
-
/* ??? */
static boolean
@@ -1822,7 +1784,6 @@ vms_bfd_gc_sections (abfd, link_info)
return true;
}
-
/* Create a hash table for the linker. Different backends store
different information in this table. */
@@ -1836,7 +1797,6 @@ vms_bfd_link_hash_table_create (abfd)
return 0;
}
-
/* Add symbols from this object file into the hash table. */
static boolean
@@ -1850,7 +1810,6 @@ vms_bfd_link_add_symbols (abfd, link_info)
return false;
}
-
/* Do a link based on the link_order structures attached to each
section of the BFD. */
@@ -1903,7 +1862,6 @@ vms_bfd_print_private_bfd_data (abfd, file)
return 0;
}
-
/* Read in the dynamic symbols. */
static long
@@ -1917,7 +1875,6 @@ vms_canonicalize_dynamic_symtab (abfd, symbols)
return 0L;
}
-
/* Get the amount of memory required to hold the dynamic relocs. */
static long
@@ -1930,7 +1887,6 @@ vms_get_dynamic_reloc_upper_bound (abfd)
return 0L;
}
-
/* Read in the dynamic relocs. */
static long
diff --git a/gnu/usr.bin/binutils/bfd/vms.h b/gnu/usr.bin/binutils/bfd/vms.h
index 714398699de..0b1f7fad538 100644
--- a/gnu/usr.bin/binutils/bfd/vms.h
+++ b/gnu/usr.bin/binutils/bfd/vms.h
@@ -1,6 +1,6 @@
#undef vms
/* vms.h -- Header file for VMS (Alpha and Vax) support.
- Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
Written by Klaus K"ampf (kkaempf@rmi.de)
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef VMS_H
#define VMS_H
-
/* Constants starting with 'Exxx_' are for openVMS/Alpha (EVAX object language) */
/* VMS Text, information and relocation record (TIR/ETIR) definitions. */
@@ -531,7 +530,6 @@ struct hdr_struc {
char *hdr_c_ttl;
};
-
/* vms end of module */
struct eom_struc {
diff --git a/gnu/usr.bin/binutils/bfd/xcoff-target.h b/gnu/usr.bin/binutils/bfd/xcoff-target.h
new file mode 100644
index 00000000000..a3cc0c07e2e
--- /dev/null
+++ b/gnu/usr.bin/binutils/bfd/xcoff-target.h
@@ -0,0 +1,194 @@
+/* Common definitions for backends based on IBM RS/6000 "XCOFF64" files.
+ Copyright 2000, 2001
+ Free Software Foundation, Inc.
+ Contributed by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Internalcoff.h and coffcode.h modify themselves based on this flag. */
+#define RS6000COFF_C 1
+
+#define SELECT_RELOC(internal, howto) \
+ { \
+ internal.r_type = howto->type; \
+ internal.r_size = \
+ ((howto->complain_on_overflow == complain_overflow_signed \
+ ? 0x80 \
+ : 0) \
+ | (howto->bitsize - 1)); \
+ }
+
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
+
+#define COFF_LONG_FILENAMES
+
+#define NO_COFF_SYMBOLS
+
+#define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst)
+
+#define coff_mkobject _bfd_xcoff_mkobject
+#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
+#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
+#define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
+#define coff_relocate_section _bfd_ppc_xcoff_relocate_section
+
+#define CORE_FILE_P _bfd_dummy_target
+
+#define coff_core_file_failing_command _bfd_nocore_core_file_failing_command
+#define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal
+#define coff_core_file_matches_executable_p \
+ _bfd_nocore_core_file_matches_executable_p
+
+#ifdef AIX_CORE
+#undef CORE_FILE_P
+#define CORE_FILE_P rs6000coff_core_p
+extern const bfd_target * rs6000coff_core_p ();
+extern boolean rs6000coff_core_file_matches_executable_p ();
+
+#undef coff_core_file_matches_executable_p
+#define coff_core_file_matches_executable_p \
+ rs6000coff_core_file_matches_executable_p
+
+extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd));
+#undef coff_core_file_failing_command
+#define coff_core_file_failing_command rs6000coff_core_file_failing_command
+
+extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd));
+#undef coff_core_file_failing_signal
+#define coff_core_file_failing_signal rs6000coff_core_file_failing_signal
+#endif /* AIX_CORE */
+
+#ifdef LYNX_CORE
+
+#undef CORE_FILE_P
+#define CORE_FILE_P lynx_core_file_p
+extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd));
+
+extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd,
+ bfd *exec_bfd));
+#undef coff_core_file_matches_executable_p
+#define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p
+
+extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd));
+#undef coff_core_file_failing_command
+#define coff_core_file_failing_command lynx_core_file_failing_command
+
+extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd));
+#undef coff_core_file_failing_signal
+#define coff_core_file_failing_signal lynx_core_file_failing_signal
+
+#endif /* LYNX_CORE */
+
+#define _bfd_xcoff_bfd_get_relocated_section_contents \
+ coff_bfd_get_relocated_section_contents
+#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section
+#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections
+#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section
+
+/* XCOFF archives do not have anything which corresponds to an
+ extended name table. */
+
+#define _bfd_xcoff_slurp_extended_name_table bfd_false
+#define _bfd_xcoff_construct_extended_name_table \
+ ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
+ bfd_false)
+#define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname
+
+/* We can use the standard get_elt_at_index routine. */
+
+#define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
+
+/* XCOFF archives do not have a timestamp. */
+
+#define _bfd_xcoff_update_armap_timestamp bfd_true
+
+extern boolean _bfd_xcoff_mkobject PARAMS ((bfd *));
+extern boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
+extern boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *));
+extern void _bfd_xcoff_rtype2howto
+ PARAMS ((arelent *, struct internal_reloc *));
+extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup
+ PARAMS ((bfd *, bfd_reloc_code_real_type));
+extern boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *));
+extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *));
+extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *));
+extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
+extern int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
+extern boolean _bfd_xcoff_write_armap
+ PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
+extern boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *));
+extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean));
+extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR));
+extern unsigned int _bfd_xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR));
+extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
+
+#ifndef coff_SWAP_sym_in
+#define coff_SWAP_sym_in _bfd_xcoff_swap_sym_in
+#define coff_SWAP_sym_out _bfd_xcoff_swap_sym_out
+#define coff_SWAP_aux_in _bfd_xcoff_swap_aux_in
+#define coff_SWAP_aux_out _bfd_xcoff_swap_aux_out
+#endif
+
+#include "coffcode.h"
+
+/* The transfer vector that leads the outside world to all of the above. */
+
+const bfd_target TARGET_SYM =
+{
+ TARGET_NAME,
+ bfd_target_xcoff_flavour,
+ BFD_ENDIAN_BIG, /* data byte order is big */
+ BFD_ENDIAN_BIG, /* header byte order is big */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG | DYNAMIC |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT),
+
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ 0, /* leading char */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen??? FIXMEmgo */
+
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ _bfd_xcoff_archive_p, CORE_FILE_P},
+ {bfd_false, coff_mkobject, /* bfd_set_format */
+ _bfd_generic_mkarchive, bfd_false},
+ {bfd_false, coff_write_object_contents, /* bfd_write_contents */
+ _bfd_xcoff_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (coff),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (coff),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (_bfd_xcoff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
+
+ NULL,
+
+ COFF_SWAP_TABLE
+};