From: Chanho Park Date: Wed, 25 Feb 2015 09:03:48 +0000 (+0900) Subject: Imported Upstream version 7.9 X-Git-Tag: upstream/7.9^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=003ea5a89ab7e9eaa65cb158a953d63dac2612c6;p=platform%2Fupstream%2Fgdb.git Imported Upstream version 7.9 --- diff --git a/ChangeLog b/ChangeLog index dcf12bb27..6dcf4ca9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,90 @@ +2015-01-03 Andrew Pinski + + * Makefile.def (flags_to_pass): Pass OBJCOPY_FOR_TARGET also. + * Makefile.tpl (HOST_EXPORTS): Add OBJCOPY_FOR_TARGET. + (BASE_TARGET_EXPORTS): Add OBJCOPY. + (OBJCOPY_FOR_TARGET): New variable. + (EXTRA_TARGET_FLAGS): Add OBJCOPY. + * Makefile.in: Regenerate. + * configure.ac: Check for already installed target objcopy. + Also GCC_TARGET_TOOL on objcopy. + * configure: Regenerate. + +2015-01-02 Hans-Peter Nilsson + + * config.sub: Update from upstream, to 2015-01-01 version. + * config.guess: Ditto. + +2014-12-06 Eric Botcazou + + * config.sub: Update from upstream config repo. + +2014-11-24 H.J. Lu + + * libtool.m4: Updated from GCC trunk. + +2014-11-16 Jan-Benedict Glaw + + * config.guess: Update from upstream config repo. + * config.sub: Ditto. + +2014-11-16 Jan-Benedict Glaw + + * move-if-change: Update from upstream gnulib. + +2014-11-16 Jan-Benedict Glaw + + * compile: Sync with upstream Automake. + * depcomp: Ditto. + * install-sh: Ditto. + * missing: Ditto. + * mkinstalldirs: Ditto. + * ylwrap: Ditto. + +2014-10-15 Tristan Gingold + + * src-release.sh (do_proto_toplev): Configure with --target. + +2014-10-03 Jing Yu + + * configure.ac: Add aarch64 to list of targets that support gold. + * configure: Regenerate. + +2014-09-12 Andrew Bennett + + * configure.ac: Add mips*-img-elf* target triple. + * configure: Regenerate. + +2014-09-06 Kuan-Lin Chen + * configure: Disable gdb for nds32*-*-* until supported. + * configure.ac: Disable gdb for nds32*-*-* until supported. + +2014-09-05 Joel Brobecker + + * configure: Regenerate. + +2014-08-27 Will Newton + + * src-release.sh: New file. + * src-release: Remove file. + +2014-07-27 Joel Sherrill + + GDB not supported for or1k*-*-rtems* + * configure.ac (or1k*-*-rtems*): gdb not supported. The ordering + of the stanzas results in this not being caught by or1k*-*-* later. + * configure. Regenerated. + +2014-07-25 Samuel Bronson + + * .gitattributes: New file for use with git-merge-changelog. + +2014-07-21 Joel Sherrill + + Disable gdb for or1k*-*-* until supported + * configure.ac (or1k*-*-*): Disable gdb. + * configure: Regenerated. + 2014-05-14 Sandra Loosemore * configure.ac (target_makefile_frag): Set for nios2-*-elf*. diff --git a/MAINTAINERS b/MAINTAINERS index dd8601b4f..b09fbc0ea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -47,7 +47,10 @@ gdb/; readline/; sim/; GDB's part of include/ See also gdb/MAINTAINERS and sim/MAINTAINERS. include/ - See binutils/, gdb/, sid/, gcc/, libiberty/ etc. + The rule is that if the file exists in the gcc tree + then gcc owns it. Thus you have to look at the gcc tree + to know whether any particular file is owned by gcc. + See also binutils/, gdb/, sid/, gcc/, libiberty/ etc. intl/; config.rhost; libiberty/; libiberty's part of include/; compile; depcomp; install-sh; missing; ylwrap; config/ diff --git a/Makefile.def b/Makefile.def index ec2b0f278..7b739ffe3 100644 --- a/Makefile.def +++ b/Makefile.def @@ -271,6 +271,7 @@ flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; }; flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; }; flags_to_pass = { flag= NM_FOR_TARGET ; }; flags_to_pass = { flag= OBJDUMP_FOR_TARGET ; }; +flags_to_pass = { flag= OBJCOPY_FOR_TARGET ; }; flags_to_pass = { flag= RANLIB_FOR_TARGET ; }; flags_to_pass = { flag= READELF_FOR_TARGET ; }; flags_to_pass = { flag= STRIP_FOR_TARGET ; }; diff --git a/Makefile.in b/Makefile.in index bf06dce8a..1472dd8d5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -213,6 +213,7 @@ HOST_EXPORTS = \ LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \ NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \ OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \ + OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \ RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \ READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ @@ -285,6 +286,7 @@ BASE_TARGET_EXPORTS = \ LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \ NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \ OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \ + OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ READELF="$(READELF_FOR_TARGET)"; export READELF; \ STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ @@ -536,6 +538,7 @@ LD_FOR_TARGET=@LD_FOR_TARGET@ LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ NM_FOR_TARGET=@NM_FOR_TARGET@ OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ +OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ READELF_FOR_TARGET=@READELF_FOR_TARGET@ STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ @@ -755,6 +758,7 @@ BASE_FLAGS_TO_PASS = \ "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \ + "OBJCOPY_FOR_TARGET=$(OBJCOPY_FOR_TARGET)" \ "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ "READELF_FOR_TARGET=$(READELF_FOR_TARGET)" \ "STRIP_FOR_TARGET=$(STRIP_FOR_TARGET)" \ @@ -851,6 +855,7 @@ EXTRA_TARGET_FLAGS = \ 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ 'NM=$(COMPILER_NM_FOR_TARGET)' \ 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ + 'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \ 'RANLIB=$$(RANLIB_FOR_TARGET)' \ 'READELF=$$(READELF_FOR_TARGET)' \ 'WINDRES=$$(WINDRES_FOR_TARGET)' \ diff --git a/Makefile.tpl b/Makefile.tpl index 54a8dc3dd..f9bbbdeaa 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -216,6 +216,7 @@ HOST_EXPORTS = \ LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \ NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \ OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \ + OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \ RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \ READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ @@ -288,6 +289,7 @@ BASE_TARGET_EXPORTS = \ LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \ NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \ OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \ + OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ READELF="$(READELF_FOR_TARGET)"; export READELF; \ STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ @@ -489,6 +491,7 @@ LD_FOR_TARGET=@LD_FOR_TARGET@ LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ NM_FOR_TARGET=@NM_FOR_TARGET@ OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@ +OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ READELF_FOR_TARGET=@READELF_FOR_TARGET@ STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ @@ -656,6 +659,7 @@ EXTRA_TARGET_FLAGS = \ 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ 'NM=$(COMPILER_NM_FOR_TARGET)' \ 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \ + 'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \ 'RANLIB=$$(RANLIB_FOR_TARGET)' \ 'READELF=$$(READELF_FOR_TARGET)' \ 'WINDRES=$$(WINDRES_FOR_TARGET)' \ diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a2b06f967..9918dbdf8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,1339 +1,98 @@ -2014-09-18 Jan Kratochvil - - PR gdb/17407 - * elfcode.h (bfd_from_remote_memory): Use SIZE for HIGH_OFFSET. - -2014-07-16 H.J. Lu - - * elf32-i386.c (elf_i386_plt_sym_val): Match PLT entry only for - ELFOSABI_GNU input. - * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. - (elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise. - -2014-07-16 H.J. Lu - - PR binutils/17154 - * elf32-i386.c (elf_i386_plt_sym_val): Only match R_*_JUMP_SLOT - and R_*_IRELATIVE relocation offset with PLT entry. - * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. - (elf_x86_64_plt_sym_val_offset_plt_bnd): New. - (elf_x86_64_get_synthetic_symtab): Use it. - -2014-06-24 Philippe De Muyter - - * targets.c (_bfd_target_vector): Add missing #ifdef BFD64 for - a number of targets. - -2014-06-11 Joel Brobecker +2015-01-13 Joel Brobecker * development.sh (development): Set to false. -2014-06-11 Alan Modra - - * linker.c (unwrap_hash_lookup): Add missing parens. - -2014-06-11 Kai Tietz - - * libcoff-in.h (coff_tdata): Make relocbase member unsigned. - * libcoff.h: Regenerated. - -2014-06-10 Alan Modra - - PR ld/16910 - * linker.c (unwrap_hash_lookup): New function. - * elf-bfd (RELOC_FOR_GLOBAL_SYMBOL): Call unwrap_hash_lookup. - * elf32-i370.c (i370_elf_relocate_section): Likewise. - * elf32-m32c.c (m32c_elf_relocate_section): Likewise. - * elf32-m32r.c (m32r_elf_relocate_section): Likewise. - * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. - * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. - * elf32-spu.c (spu_elf_relocate_section): Likewise. - * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. - -2014-06-07 Alan Modra - - * elf32-ppc.c (ppc_elf_relocate_section): Treat field of cmpli - insn as a bitfield; Use complain_overflow_bitfield. - * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. - -2014-06-05 Joel Brobecker - - * development.sh: New file. - * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh. - Make -Werror the default with GCC only if DEVELOPMENT is true. - * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add - $(srcdir)/development.sh. - * Makefile.in, configure: Regenerate. - -2014-06-04 Will Newton - - * elfnn-aarch64.c (tpoff_base): Make test of tls_sec - being non-NULL into an assert. - (elfNN_aarch64_tls_relax): Remove unused code. - -2014-06-03 DJ Delorie - - * elf32-rx.c (rx_table_map): Use BFD_VMA_FMT for portability. - -2014-06-03 Nick Clifton - - PR ld/16807 - * peXXigen.c (rsrc_process_section): Page align the new contents - befgore writing out. - -2014-06-03 Alan Modra - - * elf64-ppc.c (ADDIS_R12_R2): Define. - (build_plt_stub): Support fusion on ELFv2 stub. - (ppc_build_one_stub): Likewise for plt branch stubs. - -2014-05-28 Alan Modra - - * elf32-rx.c (rx_table_map): Delete set but not used variables. - -2014-05-28 Tristan Gingold - - * dwarf2.c (lookup_address_in_function_table): Add best_fit_len - to keep the length of the best fit range. - (lookup_symbol_in_function_table, info_hash_lookup_funcinfo): - Likewise. - -2014-05-27 DJ Delorie - - * bfd/elf32-rx.c (get_symbol_value_maybe): New. - (rx_elf_relocate_section): If we find a reloc against - $tableentry$default$, redirect it to the appropriate - $tableentry$$. - (RX_Table_Info): New. - (rx_table_find): New. Check all tables and SEC_KEEP all sections - with table parts in them. - (rx_check_directives): New. - (rx_table_map_2): New. - (rx_table_map): New. - (rx_additional_link_map_text): New. Called to dump tables to the - map file. - * bfd/elf32-rx.h: New. - -2014-05-20 DJ Delorie - - * elf32-msp430.c (msp430_elf_relax_adjust_locals): Avoid overflow. - -2014-05-20 Alan Modra - - PR 16952 - * elf32-ppc.c (ppc_elf_create_linker_section): Move earlier. - Remove redundant setting of htab->elf.dynobj. Don't align. - Define .sdata symbols using _bfd_elf_define_linkage_sym. - (ppc_elf_create_glink): Call ppc_elf_create_linker_section. - (create_sdata_sym): Delete. - (elf_allocate_pointer_linker_section): Rename from - elf_create_pointer_linker_section. Align section. - (ppc_elf_check_relocs): Don't call ppc_elf_creat_linker_section - directly here, or create_sdata_sym. Set ref_regular on _SDA_BASE_ - and _SDA2_BASE_. - (ppc_elf_size_dynamic_sections): Remove ATTRIBUTE_UNUSED on param. - Remove unnecessary tests on _SDA_BASE_ sym. - (maybe_strip_sdasym, ppc_elf_maybe_strip_sdata_syms): New functions. - (ppc_elf_relocate_section): Tighten SDA reloc symbol section checks. - * elf32-ppc.h (ppc_elf_set_sdata_syms): Delete. - (ppc_elf_maybe_strip_sdata_syms): Declare. - -2014-05-16 Ryan Mansfield - - * config.bfd: Move QNX target_cflags from arm-*-netbsd* to arm-*-nto*. - -2014-05-16 Jon Turney - - * peXXigen.c (pe_print_debugdata): Don't interpret debug directory - in a section with no contents. - (is_vma_in_section, find_section_by_vma): New functions. - (_bfd_XX_bfd_copy_private_bfd_data_common): Recalculate file - offsets in the debug directory. - (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record): - Byte-swap GUID from little-endian to big-endian order for - consistent and conventional display. - -2014-05-16 Kaushik Phata - - * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if - 64-bit doubles objects mix with 32-bit doubles objects. - (rl78_elf_print_private_bfd_data): Describe 64-bit doubles flag. - -2014-05-08 Hans-Peter Nilsson - - * mmo.c: Update URLs in documentation comments. - -2014-05-02 Volodymyr Arbatov - David Weatherford - Max Filippov - - * elf32-xtensa.c (relax_section): treat R_XTENSA_DIFF* relocations as - signed. - -2014-05-07 Andreas Tobler - - * config.bfd: Add proper arm config for *-*-freebsd*. - -2014-05-07 Andrew Bennett - - * aoutx.h (NAME (aout, machine_type)): Add mips32r3, mips64r3, - mips32r5 and mips64r5. - * archures.c (bfd_architecture): Likewise. - * bfd-in2.h (bfd_architecture): Likewise. - * cpu-mips.c (arch_info_struct): Likewise. - * elfxx-mips.c (mips_set_isa_flags): Likewise. - -2014-05-06 Richard Sandiford - - * elfxx-mips.h (elfxx-mips.h): Declare. - * elfxx-mips.c (mips_elf_merge_obj_attributes): Use it to report - Tag_GNU_MIPS_ABI_FP mismatches. - (_bfd_mips_fp_abi_string): New function. - -2014-05-02 Alan Modra - - * targets.c: Sort bfd_target vectors somewhat alphabetically. - * configure.in: Likewise. - * configure: Regenerate. - -2014-05-02 Alan Modra - - * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-ns32k.c, - * aout-sparcle.c, * aout0.c, * aoutx.h, * armnetbsd.c, * bout.c, - * cf-i386lynx.c, * cf-sparclynx.c, * cisco-core.c, * coff-alpha.c, - * coff-apollo.c, * coff-arm.c, * coff-aux.c, * coff-go32.c, - * coff-h8300.c, * coff-h8500.c, * coff-i386.c, * coff-i860.c, - * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mips.c, - * coff-rs6000.c, * coff-sh.c, * coff-sparc.c, * coff-stgo32.c, - * coff-svm68k.c, * coff-tic80.c, * coff-u68k.c, * coff-w65.c, - * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, - * coff64-rs6000.c, * config.bfd, * configure.com, * configure.in, - * demo64.c, * elf-m10200.c, * elf-m10300.c, * elf32-am33lin.c, - * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, - * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, - * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, - * elf32-fr30.c, * elf32-frv.c, * elf32-gen.c, * elf32-h8300.c, - * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-i860.c, - * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, - * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, - * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, - * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, - * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, - * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, - * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-sh-symbian.c, - * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, - * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-v850.c, - * elf32-vax.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c, - * elf32-xtensa.c, * elf64-alpha.c, * elf64-gen.c, * elf64-hppa.c, - * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, - * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, - * elf64-x86-64.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, - * epoc-pe-arm.c, * epoc-pei-arm.c, * hp300bsd.c, * hp300hpux.c, - * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386bsd.c, - * i386dynix.c, * i386freebsd.c, * i386linux.c, * i386lynx.c, - * i386mach3.c, * i386msdos.c, * i386netbsd.c, * i386os9k.c, - * irix-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, - * m88kmach3.c, * m88kopenbsd.c, * mach-o-i386.c, * mach-o-x86-64.c, - * makefile.vms, * mipsbsd.c, * mmo.c, * netbsd-core.c, * newsos3.c, - * nlm32-alpha.c, * nlm32-i386.c, * nlm32-ppc.c, * nlm32-sparc.c, - * ns32knetbsd.c, * osf-core.c, * pc532-mach.c, * pe-arm-wince.c, - * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-ppc.c, - * pe-sh.c, * pe-x86_64.c, * pei-arm-wince.c, * pei-arm.c, - * pei-i386.c, * pei-ia64.c, * pei-mcore.c, * pei-mips.c, * pei-ppc.c, - * pei-sh.c, * pei-x86_64.c, * ppcboot.c, * ptrace-core.c, * riscix.c, - * sco5-core.c, * som.c, * sparclinux.c, * sparclynx.c, - * sparcnetbsd.c, * sunos.c, * targets.c, * trad-core.c, - * vax1knetbsd.c, * vaxbsd.c, * vaxnetbsd.c, * versados.c, - * vms-alpha.c, * vms-lib.c: Rename bfd targets to - ____vec. Adjust associated MY macros - on aout targets. - * configure: Regenerate. - -2014-05-01 Hans-Peter Nilsson - - * mmo.c (mmo File layout documentation): Add note about low bits - of address. - (mmo_write_chunk): When handling data remainder, assert that - previous remaining data is flushed. - (mmo_write_loc_chunk): Only look for trailing and leading zeros - when dealing with an aligned VMA and for aligned lengths. Don't skip - the last 32-bit-word of zeros. - (mmo_write_loc_chunk): Emit an error if the VMA is not aligned. - (mmo_scan) : Move re-alignment of vma before - emitting data, not after updating it. - : Call mmo_decide_section with aligned vma. - -2014-04-30 Nick Clifton - - * compress.c (bfd_is_section_compressed): When checking the - .debug_str section, also check the fifth byte in the section is - not part of a string. - -2014-04-30 Alan Modra - - * elf-eh-frame.c (struct cie.personality): Replace val with sym. - (find_merged_cie): Identify personality functions by (bfd_id,index) - pair when a local sym is used. - -2014-04-29 Christian Svensson - - * elf32-or1k.c: Fix a bug where non-TLS relocations would be forced - into .rela.got if it contained TLS relocations as well. - -2014-04-28 Nick Clifton - - PR ld/16821 - * peXXigen.c (_bfd_XXi_swap_sym_out): Rework fix to avoid compile - time warning. - -2014-04-26 Alan Modra - - * po/SRC-POTFILES.in: Regenerate. - * configure: Regenerate. - -2014-04-25 Nick Clifton +2015-01-12 Terry Guo - PR ld/16821 - * peXXigen.c (_bfd_XXi_swap_sym_out): Another fix for building on - a 342-bit host. This time for older versions of gcc. - -2014-04-24 Nick Clifton - - * peXXigen.c (rsrc_print_section): Fix compile time warning for - 32-bit hosts. - -2014-04-24 Alan Modra - - PR 16867 - * dwarf2.c: Formatting. - (struct dwarf2_debug): Make adjusted_section_count signed. - (unset_sections): Make i signed. - (set_debug_vma): New function. - (place_sections): Handle separate debug object file. Set VMA - on debug sections, even if they have an output section. Also - set VMA on zero size sections, and non-load but alloc sections. - Set adjusted_section_count to -1 when no section adjustment. - Malloc adjusted_sections. Don't double last_vma. Transfer - alloc section VMAs to separate debug file. - (_bfd_dwarf2_cleanup_debug_info): Free adjusted_sections. - (_bfd_dwarf2_slurp_debug_info): Add do_place parameter. Drop - test on symbols being the same before using old stash. Read - and use separate debug file symbols. Call place_sections. - (find_line): Don't call place_sections here. - * libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Update proto. - * libbfd.h: Regenerate. - * mach-o.c (bfd_mach_o_find_nearest_line): Adjust - _bfd_dwarf2_slurp_debug_info call. - * simple.c (simple_save_output_info): Clarify comment. - -2014-04-24 Nick Clifton - - PR ld/16807 - * peXXigen.c (struct rsrc_regions): New structure. - (rsrc_print_resource_directory): Use new structure. Include - offset of directory in listing. - (rsrc_print_resource_entry): Likewise. - (rsrc_print_section): Likewise. - (rsrc_count_entries): Do not increment sizeof_strings or - sizeof_leaves. - (rsrc_count_directory): Do not increment sizeof_tables. - (rsrc_compute_region_sizes): New function. - (rsrc_write_leaf): Maintain 8-byte alignment for resource data. - (rsrc_process_section): Compute size of regions after merging - entries. - -2014-04-23 Alan Modra - - PR ld/16787 - * dwarf2.c (struct dwarf2_debug): Add sec_vma field. - (place_sections): Do not modify VMA of sections when called from - linker after sections have been placed in output sections. Short - circuit single section case. - (save_section_vma, section_vma_same): New functions. - (_bfd_dwarf2_slurp_debug_info): Throw away stash if section VMAs - change. - * reloc.c (bfd_perform_relocation): Do not modify reloc addend - when non-relocatable. - -2014-04-22 Nick Clifton - - PR ld/16821 - * peXXigen.c (_bfd_XXi_swap_sym_out): Fix for 32-bit hosts. - -2014-04-22 Christian Svensson - - * Makefile.am: Remove openrisc and or32 support. Add support for or1k. - * archures.c: Likewise. - * coffcode.h: Likewise. - * config.bfd: Likewise. - * configure.in: Likewise. - * reloc.c: Likewise. - * targets.c: Likewise. - * cpu-or1k.c: New file. - * elf32-or1k.c: New file. - * coff-or32.c: Delete. - * cpu-openrisc.c: Delete. - * cpu-or32.c: Delete. - * elf32-openrisc.c: Delete. - * elf32-or32.c: Delete. - * Makefile.in: Regenerate. - * bfd-in2.h: Regenerate. - * configure: Regenerate. - * libbfd.h: Regenerate. - -2014-04-22 Yuanhui Zhang - - PR ld/16821 - * peXXigen.c (abs_finder): Fix for 32-bit host builds. - -2014-04-22 Will Newton - - * elfnn-aarch64.c (elfNN_aarch64_section_flags): Remove - function. (elf_backend_section_flags): Remove define. - -2014-04-21 Richard Henderson - - * elf64-alpha.c (elf64_alpha_size_got_sections): New may_merge - parameter; honor it and disable got merging when false. - (elf64_alpha_relax_got_load): Do not relax to GPREL relocs during - the first pass of relaxation. - (elf64_alpha_relax_with_lituse): Likewise. Move relaxed relocs to - the end of the LITERAL+LITUSE chain. - (elf64_alpha_relax_section): Only process LITERAL relocs during the - second pass of relaxation. - - * configure.ac (use_secureplt): Enable by default. - * configure: Rebuild. - -2014-04-18 Tristan Gingold - - * mach-o.h (bfd_mach_o_dyld_info_command): Add rebase_content, - bind_content, weak_bind_content, lazy_bind_content, - export_content. - (bfd_mach_o_load_command): Add comments, add next field. - (mach_o_data_struct): Replace commands field by first_command - and last_command. - * mach-o.c (bfd_mach_o_append_command): New function. - (bfd_mach_o_bfd_copy_private_symbol_data): Add blank lines. - (bfd_mach_o_bfd_copy_private_section_data): Check flavour, - copy fields. - (bfd_mach_o_bfd_copy_private_header_data): Copy load commands. - (bfd_mach_o_pad4, bfd_mach_o_pad_command): New functions. - (bfd_mach_o_write_thread): Use macro instead of literal. - (bfd_mach_o_write_dylinker, bfd_mach_o_write_dylib) - (bfd_mach_o_write_main, bfd_mach_o_write_dyld_info): New - functions. - (bfd_mach_o_write_symtab_content): New function (extracted - from bfd_mach_o_write_symtab). - (bfd_mach_o_write_symtab): Split. - (bfd_mach_o_count_indirect_symbols): Move - (bfd_mach_o_build_dysymtab): Remove layout code. - (bfd_mach_o_write_contents): Rewritten to build commands in order. - (bfd_mach_o_count_sections_for_seg): Remove. - (bfd_mach_o_build_obj_seg_command): New function (extracted from - bfd_mach_o_build_seg_command). - (bfd_mach_o_build_exec_seg_command): New function. - (bfd_mach_o_build_dysymtab_command): Remove. - (bfd_mach_o_layout_commands): New function. - (bfd_mach_o_init_segment): New function. - (bfd_mach_o_build_commands): Major rework to handle non-object - files. - (bfd_mach_o_alloc_and_read, bfd_mach_o_read_dyld_content): New + * elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New function. - (bfd_mach_o_read_dyld_info): Clear content fields. - (bfd_mach_o_read_segment): Adjust call. - (bfd_mach_o_flatten_sections): Adjust as now load commands are - chained. - (bfd_mach_o_scan_start_address, bfd_mach_o_scan) - (bfd_mach_o_mkobject_init, bfd_mach_o_get_base_address) - (bfd_mach_o_lookup_command, bfd_mach_o_core_fetch_environment): - Likewise. - -2014-04-18 Tristan Gingold - - * mach-o-target.c (bfd_mach_o_bfd_copy_private_header_data): - Define instead of bfd_mach_o_bfd_copy_private_bfd_data. - * mach-o.c (bfd_mach_o_bfd_copy_private_bfd_data): Rename. - * mach-o.h (bfd_mach_o_bfd_copy_private_bfd_data): Likewise. - -2014-04-18 Tristan Gingold - - * mach-o.h (bfd_mach_o_dylinker_command) - (bfd_mach_o_dylib_command, bfd_mach_o_fvmlib_command): Remove - name_len field. - * mach-o.c (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib) - (bfd_mach_o_read_fvmlib): Adjust after name_len removal. - -2014-04-18 Tristan Gingold - - * mach-o.h (bfd_mach_o_backend_data): Add page_size field. - * mach-o-target.c: Check TARGET_PAGESIZE is defined. - (TARGET_NAME_BACKEND): Add TARGET_PAGESIZE. - * mach-o.c (TARGET_PAGESIZE): Define and undefined for - each targets declared. - * mach-o-x86-64.c (TARGET_PAGESIZE): Define. - * mach-o-i386.c (TARGET_PAGESIZE): Define. - -2014-04-18 Tristan Gingold - - * mach-o.c (bfd_mach_o_write_thread) - (bfd_mach_o_write_section_32, bfd_mach_o_write_section_64) - (bfd_mach_o_write_segment_32, bfd_mach_o_write_segment_64) - (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib) - (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_prebind_cksum) - (bfd_mach_o_read_twolevel_hints, bfd_mach_o_read_fvmlib) - (bfd_mach_o_read_thread, bfd_mach_o_read_dysymtab) - (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid) - (bfd_mach_o_read_linkedit, bfd_mach_o_read_str) - (bfd_mach_o_read_dyld_info, bfd_mach_o_read_segment) - (bfd_mach_o_read_segment_32, bfd_mach_o_read_segment_64) - (bfd_mach_o_read_command): Now return a boolean status. - Adjust return statements. - (bfd_mach_o_write_contents, bfd_mach_o_scan): Adjust tests. - (bfd_mach_o_core_file_failing_command): Remove useless initialization. - -2014-04-17 Kwok Cheung Yeung - - * elfxx-mips.c (struct mips_got_info): Delete assigned_gotno - field. Add assigned_low_gotno and assigned_high_gotno fields. - (mips_elf_create_local_got_entry): Update out-of-space condition. - Set index of new GOT entry to assigned_low_gotno if required by - the current relocation, else set it to assigned_high_gotno. - (mips_elf_set_global_gotidx): Replace uses of assigned_gotno - with assigned_low_gotno. - (mips_elf_multi_got): Initialize assigned_low_gotno and - assigned_high_gotno in secondary GOTs. Use assigned_low_gotno - in place of assigned_gotno when handling global GOT entries. - (mips_elf_lay_out_got): Initialize assigned_low_gotno and - assigned_high_gotno. - (_bfd_mips_elf_finish_dynamic_sections): Account for a possible - gap in the middle of local GOT space. - -2014-04-17 Alan Modra - - PR 16846 - * elflink.c (_bfd_elf_merge_symbol): Ignore TLS mismatch when - current bfd is a plugin. Don't always set type_change_ok - when old bfd is a plugin. - -2014-04-16 Tristan Gingold - - * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype - flag. - -2014-04-16 Alan Modra - - * elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area - with "ba 0" rather than zeros. - -2014-04-15 Marcus Shawcroft - - * (elfNN_aarch64_tls_relax): Fix instruction mask. - -2014-04-14 Alan Modra - - * elf32-ppc.c (BA): Define - (ppc_elf_link_hash_table_create): Correct default_params. - (write_glink_stub): Pad small plt call stub with "ba 0" rather - than "nop" for ppc476_workaround. - (ppc_elf_finish_dynamic_sections): Likewise for branch table - and __glink_PLTresolve. Ensure plt call stub at end of page - doesn't allow fall-thru prefetch. - -2014-04-11 Nick Clifton - - PR ld/16821 - * peXXigen.c (abs_finder): New function. - (_bfd_XXi_swap_sym_out): For absolute symbols with values larger - than 1^32 try to convert them into section relative values - instead. - -2014-04-11 Nick Clifton - - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - -2014-04-10 Cesar Philippidis - - * elf32-nios2.c (nios2_elf32_build_stubs): Ignore dynobjs - when building function stubs. - -2014-04-10 Senthil Kumar Selvaraj - - * elf32-avr.c: Add DIFF relocations for AVR. - (avr_final_link_relocate): Handle the DIFF relocs. - (bfd_elf_avr_diff_reloc): New. - (elf32_avr_is_diff_reloc): New. - (elf32_avr_adjust_diff_reloc_value): Reduce difference value. - (elf32_avr_relax_delete_bytes): Recompute difference after deleting - bytes. - - * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations - -2014-04-09 Alan Modra - - * libcoff.h: Regenerate. - -2014-04-09 Alan Modra - - * elf32-ppc.c (ppc_elf_relocate_section): Remove bctr from list - of safe ppc476 insns at end of page. Also remove non-branch insns. - Expand comments. - -2014-04-08 Jon Turney - - * peXXigen.c (pe_print_debugdata): New function: Displays the - contents of the debug directory and decodes codeview entries. - (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) - (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record): - Add functions for reading and writing debugdir and codeview - records. - * libpei.h (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) - (_bfd_XXi_write_codeview_record): Add prototypes and macros. - * libcoff-in.h (pe_tdata): Add build-id data. - * libcoff.h: Regenerate. - * coffcode.h (coff_write_object_contents): Run build_id - after_write_object_contents hook. - -2014-04-05 Alan Modra - - * elflink.c (_bfd_elf_add_default_symbol): Pass poldbfd when - merging non-default sym. - -2014-04-04 Tristan Gingold - - * mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not - configured for. - -2014-04-04 Tristan Gingold - - * mach-o.c (bfd_mach_o_convert_section_name_to_mach_o): Fix - thinko on names length. - -2014-04-04 Tristan Gingold - - * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index - of output_section. - * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto. - -2014-04-04 Tristan Gingold - - * bfd.c (bfd_get_arch_size): Default is taken from arch. - -2014-04-03 Jon Turney - - * peXXigen.c (pe_print_edata): Verify edt.name lies inside - section before dereferencing. - (pe_print_idata, pe_print_edata, pe_print_reloc) - (rsrc_print_section): Don't bother interpreting the contents - of sections which have no contents. - -2014-04-03 Maria Guseva - - PR ld/16803 - * elf.c (_bfd_elf_set_section_contents): Use correct type to hold - file position. - -2014-04-03 Tristan Gingold - - * mach-o.c (bfd_mach_o_mangle_symbols): Use index from - output_section. - (bfd_mach_o_build_seg_command): Add comment. Realign segment. - Fix style. - (bfd_mach_o_build_commands, bfd_mach_o_read_thread): Fix style. - -2014-04-03 Alan Modra - - * elf-bfd.h (struct elf_backend_data - ): Replace "size_t size" - with "bfd_size_type size". - (_bfd_elf32_bfd_from_remote_memory): Likewise. - (_bfd_elf64_bfd_from_remote_memory): Likewise. - * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. - * elfcode.h (bfd_from_remote_memory): Likewise. - * bfd-in.h (bfd_elf_bfd_from_remote_memory): Likewise. - * bfd-in2.h: Regenerate. - -2014-04-02 Tristan Gingold - - * mach-o.h (bfd_mach_o_twolevel_hints_command) - (bfd_mach_o_prebind_cksum_command): New types. - (bfd_mach_o_prebound_dylib_command): Rewrite. - (bfd_mach_o_load_command): Add prebind_cksum and twolevel_hints - fields. - * mach-o.c (bfd_mach_o_read_prebound_dylib): Read and decode the - command. - (bfd_mach_o_read_prebind_cksum): New function. - (bfd_mach_o_read_twolevel_hints): Ditto. - (bfd_mach_o_read_command): Handle prebind cksum and twolevel hints - commands. - -2014-04-02 Alan Modra - - * elfcode.h (bfd_from_remote_memory): Add "size" parameter. - Consolidate code handling possible section headers past end of - segment. Don't use p_align for page size guess, instead use - minpagesize. Take note of ld.so clearing section headers when - p_memsz > p_filesz. Handle file header specifying no section - headers. Handle zero p_align throughout. Default loadbase to - zero. Add comments. Rename contents_size to high_offset, and - make it a bfd_vma. Delete unnecessary bfd_set_error calls. - * bfd-in.h (bfd_elf_bfd_from_remote_memory): Update prototpe. - * elf-bfd.h (struct elf_backend_data ): - Likewise. - (_bfd_elf32_bfd_from_remote_memory): Likewise. - (_bfd_elf64_bfd_from_remote_memory): Likewise. - * elf.c (bfd_elf_bfd_from_remote_memory): Adjust. - * bfd-in2.h: Regnerate. - -2014-04-01 Tristan Gingold - - * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash - when num == 0. - -2014-03-27 Yury Gribov - Pavel Fedin - - * elf32-arm.c: Add support for limited pretty-printing of PLT - entries on eabi and nacl targets. - (elf32_arm_get_synthetic_symtab): Add new callback. - (elf32_arm_nacl_plt_sym_val): Likewise. - (elf32_arm_plt0_size): Add helper function. - (elf32_arm_plt_size): Likewise. - -2014-03-27 Tristan Gingold - - * mach-o.c (bfd_mach_o_read_dylinker): Remove assert. - (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT. - -2014-03-27 Tristan Gingold - - * mach-o.h (bfd_mach_o_get_base_address): New prototype. - * mach-o.c (bfd_mach_o_write_symtab) - (bfd_mach_o_write_contents) - (bfd_mach_o_set_section_flags_from_bfd) - (bfd_mach_o_build_seg_command): Fix indentation. - (bfd_mach_o_get_base_address): New function. - -2014-03-26 Nick Clifton - - * cofflink.c (_bfd_coff_generic_relocate_section): Skip - relocations in discarded sections. - -2014-03-26 Tristan Gingold - - * mach-o.c (bfd_mach_o_convert_architecture): Add - BFD_MACH_O_CPU_TYPE_ARM64. - -2014-03-26 Alan Modra - - * elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly - needed plt entries when taking the address of functions for - abiversion == 0 (ie. unknown) as well as abiversion == 2. - Move opd setup and abiversion checks to.. - (ppc64_elf_before_check_relocs): ..here. Renamed from - ppc64_elf_process_dot_syms. Set output abiversion from input and - input abiversion from output, if either is not set. - (ppc64_elf_merge_private_bfd_data): Don't merge flags here. - (elf_backend_check_directives): Update. - -2014-03-25 Will Newton - - * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): - Set value of DT_PLTRELSZ and DT_RELASZ based on the size - of input sections rather than output sections. - -2014-03-20 Will Newton - - PR ld/16715 - * elf32-arm.c (elf32_arm_check_relocs): Set - pointer_equality_needed for absolute references within - executable links. - (elf32_arm_finish_dynamic_symbol): Set st_value to zero - unless pointer_equality_needed is set. - -2014-03-19 Nick Clifton - - * peXXigen.c (rsrc_process_section): Add code to scan input - sections and record their lengths. Use these lengths to find the - start of each merged .rsrc section. - -2014-03-17 Tristan Gingold - - * mach-o.c (bfd_mach_o_read_dylib): Handle lazy load dylib. - (bfd_mach_o_read_command): Ditto. - -2014-03-14 Meador Inge - - * configure.in: Add strnlen to AC_CHECK_DECLS. - * config.in: Regenerate. - * configure: Regenerate. - * sysdep.h (strnlen): Add prototype. - -2014-03-14 Alan Modra - - * elf32-ppc.c (ppc_elf_relocate_section): Correct overflow - handling for VLE_SDA21 relocs. - -2014-03-13 Tristan Gingold - - * peicode.h (pe_ILF_object_p): Adjust, as the version number - has been read. - (pe_bfd_object_p): Also read version number to detect ILF. - * pe-x86_64.c (COFF_WITH_PE_BIGOBJ): Define. - (x86_64pe_bigobj_vec): Define - * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_max_nscns field. - (bfd_coff_max_nscns): New macro. - (coff_compute_section_file_positions): Use unsigned int for - target_index. Compare with bfd_coff_max_nscns. - (bfd_coff_std_swap_table, ticoff0_swap_table, ticoff1_swap_table): - Set a value for _bfd_coff_max_nscns. - (header_bigobj_classid): New constant. - (coff_bigobj_swap_filehdr_in, coff_bigobj_swap_filehdr_out) - (coff_bigobj_swap_sym_in, coff_bigobj_swap_sym_out) - (coff_bigobj_swap_aux_in, coff_bigobj_swap_aux_out): New - functions. - (bigobj_swap_table): New table. - * libcoff.h: Regenerate. - * coff-sh.c (bfd_coff_small_swap_table): Likewise. - * coff-alpha.c (alpha_ecoff_backend_data): Add value for - _bfd_coff_max_nscns. - * coff-mips.c (mips_ecoff_backend_data): Likewise. - * coff-rs6000.c (bfd_xcoff_backend_data) - (bfd_pmac_xcoff_backend_data): Likewise. - * coff64-rs6000.c (bfd_xcoff_backend_data) - (bfd_xcoff_aix5_backend_data): Likewise. - * targets.c (x86_64pe_bigobj_vec): Declare. - * configure.in (x86_64pe_bigobj_vec): New vector. - * configure: Regenerate. - * config.bfd: Add bigobj object format for Windows targets. - -2014-03-12 Nick Clifton - - PR ld/16671 - * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format - before testing for vxworks. - -2014-03-12 Alan Modra - - * Makefile.in: Regenerate. - -2014-03-12 Alan Modra - - PR 16690 - * elf.c (copy_elf_program_header): Ignore first section lma if - non-alloc. - -2014-03-11 Alan Modra - - PR 16686 - * coff-rs6000.c: Include stdint.h. - * coff64-rs6000.c: Likewise. - -2014-03-10 Tristan Gingold - - * ticoff.h: Removed. - -2014-03-08 Alan Modra - - * elf32-ppc.c (ppc_elf_howto_raw): Correct overflow check for - many relocations. Correct bitsize and rightshift too for a number - of VLE relocs. Describe R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO. - Correct dst_mask on R_PPC_VLE_SDA21_LO. - (ppc_elf_vle_split16): Tidy, delete unnecessary prototype. - (ppc_elf_relocate_section): Modify overflow test for 16-bit - fields in instructions to signed/unsigned according to whether - the field takes a signed or unsigned value. Tidy vle split16 code. - Correct R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO handling. - -2014-03-08 Alan Modra - - * elf64-ppc.c (ppc64_elf_howto_raw): Use complain_overflow_signed - for R_PPC64_ADDR14, R_PPC64_ADDR14_BRTAKEN, R_PPC64_ADDR14_BRNTAKEN, - R_PPC64_SECTOFF, R_PPC64_ADDR16_DS, R_PPC64_SECTOFF_DS, - R_PPC64_REL16 entries. Use complain_overflow_dont for R_PPC64_TOC. - (ppc64_elf_relocate_section): Modify overflow test for 16-bit - fields in instructions to signed/unsigned according to whether - the field takes a signed or unsigned value. - -2014-03-07 Pedro Alves - - PR gdb/16696 - * rs6000-core.c (rs6000coff_core_p): Cast pointers to bfd_vma - through ptr_to_uint instead of through long. - -2014-03-06 Nick Clifton - - PR 16664 - * elf-attrs.c (_bfd_elf_parse_attributes): Add checks for corrupt - attribute section names. - -2014-03-05 Alan Modra - - Update copyright years. - -2014-03-05 Alan Modra - - * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_ADDR64_LOCAL entry. - (ppc64_elf_reloc_type_lookup): Support R_PPC64_ADDR64_LOCAL. - (ppc64_elf_check_relocs): Likewise. - (ppc64_elf_relocate_section): Likewise. - * Add BFD_RELOC_PPC64_ADDR64_LOCAL. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - -2014-03-04 Heiher - - * elfxx-mips.c (mips_set_isa_flags): Use E_MIPS_ARCH_64R2 for - Loongson-3A. - (mips_mach_extensions): Make bfd_mach_mips_loongson_3a an - extension of bfd_mach_mipsisa64r2. - -2014-03-04 Nick Clifton - - PR ld/16017 - * elf32-arm.c (elf32_thumb2_plt0_entry): New array. - (elf32_thumb2_plt_entry): New array. - (elf32_arm_create_dynamic_sections): Set PLT entry sizes when - using thumb2 based PLT. - (elf32_arm_populate_plt_entry): Handle generating Thumb2 based PLT - entries. - (elf32_arm_final_link_relocate): Do not bias jumps to Thumb based - PLT entries. - (elf32_arm_finish_dynamic_sections): Handle creation of Thumb2 - based PLT 0-entry. - (elf32_arm_output_plt_map_1): Handle creation of local symbols for - Thumb2 based PLT 0-entry. - (elf32_arm_output_arch_local_syms): Handle creation of local - symbols for Thumb2 based PLT entries. - -2014-02-28 Alan Modra - - PR ld/16643 - * elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly - the same conditions we called check_relocs. - -2014-02-27 Yuri Gribov - - * bfd-in.h: Add export of bfd_elf32_arm_use_long_plt. - * bfd-in2.h: Regenerate. - * elf32-arm.c (elf32_arm_plt_entry_long): New array. - (elf32_arm_link_hash_table_create): Set plt_entry_size to 16 if - using long PLT entries. - (bfd_elf32_arm_use_long_plt): New function. - (elf32_arm_populate_plt_entry): Add support for long PLT entries. - -2014-02-27 Alan Modra - - * elf32-ppc.c (ppc_elf_link_hash_table_create): Provide default - params for targets that don't use ppc32elf.em. - -2014-02-20 Chung-Lin Tang - - * elf32-nios2.c (nios2_elf32_relocate_section): Fix calculation - of GOTOFF relocations. - -2014-02-19 Igor Zamyatin - H.J. Lu - - * elf64-x86-64.c (elf_x86_64_bnd_plt0_entry): New. - (elf_x86_64_legacy_plt_entry): Likewise. - (elf_x86_64_bnd_plt_entry): Likewise. - (elf_x86_64_legacy_plt2_entry): Likewise. - (elf_x86_64_bnd_plt2_entry): Likewise. - (elf_x86_64_bnd_arch_bed): Likewise. - (elf_x86_64_link_hash_entry): Add has_bnd_reloc and plt_bnd. - (elf_x86_64_link_hash_table): Add plt_bnd. - (elf_x86_64_link_hash_newfunc): Initialize has_bnd_reloc and - plt_bnd. - (elf_x86_64_copy_indirect_symbol): Also copy has_bnd_reloc. - (elf_x86_64_check_relocs): Create the second PLT for Intel MPX - in 64-bit mode. - (elf_x86_64_allocate_dynrelocs): Handle the second PLT for IFUNC - symbols. Resolve call to the second PLT if it is created. - (elf_x86_64_size_dynamic_sections): Keep the second PLT section. - (elf_x86_64_relocate_section): Resolve PLT references to the - second PLT if it is created. - (elf_x86_64_finish_dynamic_symbol): Use BND PLT0 and fill the - second PLT entry for BND relocation. - (elf_x86_64_finish_dynamic_sections): Use MPX backend data if - the second PLT is created. - (elf_x86_64_get_synthetic_symtab): New. - (bfd_elf64_get_synthetic_symtab): Likewise. Undefine for NaCl. - -2014-02-19 Alan Modra - - * elf64-ppc.h (struct ppc64_elf_params): Add save_restore_funcs. - * elf64-ppc.c (ppc64_elf_func_desc_adjust): Use it to control - provision of out-of-line register save/restore routines. - -2014-02-18 Jack Carter - - * elfxx-mips.c(_bfd_mips_elf_modify_segment_map): Deleted hard coding of - PT_DYNAMIC segment flags. - -2014-02-17 Jan Kratochvil - - PR binutils/16595 - * simple.c (struct saved_offsets): New. - (simple_save_output_info): Use it for ptr. - (simple_restore_output_info): Use it for ptr. Check section_count. - (bfd_simple_get_relocated_section_contents): Use it for saved_offsets. - -2014-02-17 Alan Modra - - * elf64-ppc.h (struct ppc64_elf_params): Define. - (ppc64_elf_init_stub_bfd, ppc64_elf_edit_opd, ppc64_elf_tls_setup, - ppc64_elf_setup_section_lists, ppc64_elf_size_stubs, - ppc64_elf_build_stubs): Update prototype. - * elf64-ppp.c (struct ppc_link_hash_table): Add params, delete other - fields now in params. Adjust code throughout file. - (ppc64_elf_init_stub_bfd): Delete "abfd" parameter, add "params". - Save params pointer in htab. - (ppc64_elf_edit_opd, ppc64_elf_tls_setup, - ppc64_elf_setup_section_lists, ppc64_elf_size_stubs, - ppc64_elf_build_stubs): Remove parameters now in "params". - -2014-02-17 Alan Modra - - * elf32-ppc.c (ppc_elf_relocate_section): Move relocs on insns - patched for ppc476 workaround. Reapply branch taken/not taken - relocs. - -2014-02-12 Alan Modra - - * elf32-ppc.c (ppc_elf_relax_section): Don't build long-branch - stubs for calls to __tls_get_addr that we know will later be - optimised away. - -2014-02-12 Alan Modra - - * elf32-ppc.c (ppc_elf_relax_section): Enable ppc476 workaround - for ld -r, when code sections are sufficiently aligned. - * elf32-ppc.h (struct ppc_elf_params): Delete pagesize. Add - pagesize_p2. - -2014-02-12 Alan Modra - - PR gold/15530 - * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support - --export-dynamic and --dynamic-list marking of symbols. - * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Reorder - cheap tests first. - -2014-02-10 H.J. Lu - - PR gold/16530 - * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in - executables if it matches dynamic_list. - -2014-02-10 Alan Modra - - * po/SRC-POTFILES.in: Regenerate. - * po/bfd.pot: Regenerate. - -2014-02-09 Alan Modra - - * elf-bfd.h (struct elf_backend_data): Add caches_rawsize. - * elfxx-target.h (elf_backend_caches_rawsize): Define. - (elfNN_bed): Init new field. - * elflink.c (elf_link_input_bfd): Handle caches_rawsize. - * elf32-ppc.c (shared_stub_entry): Zero addi offset. - (ppc_elf_relax_section): Don't reallocate section here, write - stubs, or write out relocs for ld -r here.. - (ppc_elf_relocate_section): ..instead write stubs here, and use - existing code to write out relocs for ld -r. Fix offset - adjustment on reloc for little-endian. - (elf_backend_caches_rawsize): Define. - -2014-02-07 Rainer Orth - - PR build/16550 - * cache.c (bfd_cache_max_open): Cast RLIM_INFINITY to rlim_t. - -2014-02-04 Jan Kratochvil - - * coff-rs6000.c (xcoff_write_archive_contents_big): Free OFFSETS in - return paths. Three times. - * elf64-ppc.c (ppc64_elf_link_hash_table_create): Free HTAB in all - return paths. - (ppc64_elf_tls_optimize): Free TOC_REF in return path. - (ppc64_elf_edit_toc): Free USED in return path. - -2014-02-03 Sandra Loosemore - - * reloc.c (BFD_RELOC_NIOS2_GOT_LO, BFD_RELOC_NIOS2_GOT_HA): New. - (BFD_RELOC_NIOS2_CALL_LO, BFD_RELOC_NIOS2_CALL_HA): New. - * libbfd.h: Regenerated. - * bfd-in2.h: Regenerated. - * elf32-nios2.c (elf_nios2_howto_table_rel): Add new relocations. - (nios2_reloc_map): Likewise. - (GOT_USED, CALL_USED): Renamed from GOT16_USED and CALL16_USED. - Fixed all references. - (nios2_elf32_relocate_section): Add new relocations. - (nios2_elf32_check_relocs): Likewise. - (nios2_elf32_gc_sweep_hook): Likewise. - -2014-02-03 Alan Modra - - * elf32-ppc.c (struct ppc_elf_link_hash_table): Add params. - Delete emit_stub_syms, no_tls_get_addr_opt. Update all uses. - (ppc_elf_link_params): New function. - (ppc_elf_create_glink): Align .glink to 64 bytes for ppc476 - workaround. - (ppc_elf_select_plt_layout): Remove plt_style and emit_stub_syms - parameters. Use htab->params instead. - (ppc_elf_tls_setup): Remove no_tls_get_addr_opt parameter. - (ppc_elf_size_dynamic_sections): Align __glink_PLTresolve to - 64 bytes for ppc476 workaround. - (struct ppc_elf_relax_info): New. - (ppc_elf_relax_section): Exclude linker created sections and - those too small to hold one instruction. Don't add another - branch around trampolines on later relax passes. Don't - generate trampolines for undefined symbols when !relocatable, - nor for plugin symbols. Allocate space for ppc476 workaround - patch area. Free fixups on error return path. - (ppc_elf_relocate_section): Handle ppc476 workaround patching. - * elf32-ppc.h (struct ppc_elf_params): New. - (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Update prototype. - (ppc_elf_link_params): Declare. - * section.c (SEC_INFO_TYPE_TARGET): Define. - * bfd-in2.h: Regenerate. - -2014-02-02 Sandra Loosemore - - * elf32-nios2.c (struct elf32_nios2_link_hash_table): Add - h_gp_got field. - (nios2_elf32_relocate_section): Use got_base to adjust - GOT-pointer-relative relocations relative to _gp_got. - (create_got_section): Create _gp_got symbol. - (nios2_elf32_finish_dynamic_symbol): Make _gp_got absolute. - (nios2_elf32_size_dynamic_sections): Set _gp_got offset. - -2014-01-30 Sandra Loosemore - - * bfd-in2.h: Update from reloc.c. - * elf32-nios2.c: Include elf32-nios2.h. - (elf_nios2_howto_table_rel): Add entry for R_NIOS2_CALL26_NOAT. - (nios2_reloc_map): Likewise. - (enum elf32_nios2_stub_type): Declare. - (struct elf32_nios2_stub_hash_entry): Declare. - (nios2_stub_hash_entry, nios2_stub_hash_lookup): New macros. - (struct elf32_nios2_link_hash_entry): Add hsh_cache field. - (struct elf32_nios2_link_hash_table): Add new fields bstab, - stub_bfd, add_stub_section, layout_sections_again, stub_group, - bfd_count, top_index, input_list, all_local_syms. - (nios2_call26_stub_entry): New. - (nios2_elf32_install_imm16): Move up in file. - (nios2_elf32_install_data): Move up in file. - (hiadj): Move up in file. - (stub_hash_newfunc): New. - (link_hash_newfunc): Initialize hsh_cache field. - (STUB_SUFFIX): New. - (nios2_stub_name): New. - (nios2_get_stub_entry): New. - (nios2_add_stub): New. - (nios2_elf32_setup_section_lists): New. - (nios2_elf32_next_input_section): New. - (CALL26_SEGMENT): New. - (MAX_STUB_SECTION_SIZE): New. - (group_sections): New. - (nios2_type_of_stub): New. - (nios2_build_one_stub): New. - (nios2_size_one_stub): New. - (get_local_syms): New. - (nios2_elf32_size_stubs): New. - (nios2_elf32_build_stubs): New. - (nios2_elf32_do_call26_relocate): Correct CALL26 overflow test. - (nios2_elf32_relocate_section): Handle R_NIOS2_CALL26_NOAT. Add - trampolines for R_NIOS2_CALL26 stubs. - (nios2_elf32_check_relocs): Handle R_NIOS2_CALL26_NOAT. - (nios2_elf32_gc_sweep_hook): Likewise. - (nios2_elf32_link_hash_table_create): Initialize the stub hash table. - (nios2_elf32_link_hash_table_free): New. - (bfd_elf32_bfd_link_hash_table_free): Define. - * elf32-nios2.h: New file. - * libbfd.h: Update from reloc.c. - * reloc.c (BFD_RELOC_NIOS2_CALL26_NOAT): New. - -2014-01-29 Nick Clifton - - PR binutils/16318 - * elf32-metag.c (elf_metag_post_process_headers): Call - _bfd_elf_post_process_headers. - * elf32-sh64.c (sh64_elf_copy_private_data): Call - _bfd_elf_copy_private_data. - * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise. - -2014-01-29 Nick Clifton - - * bfd-in.h (bfd_set_section_vma): Delete. - (bfd_set_section_alignment): Delete. - (bfd_set_section_userdata): Delete. - (bfd_set_cacheable): Delete. - * bfd.c (bfd_set_cacheable): New static inline function. - * section.c (bfd_set_section_userdata): Likewise. - (bfd_set_section_vma): Likewise. - (bfd_set_section_alignment): Likewise. - * bfd-in2.h: Regenerate. - -2014-01-28 Nick Clifton - - * dwarf2.c (find_abstract_instance_name): For DW_FORM_ref_addr - attributes select the CU containing the abbreviation, which may not - be the current CU. - -2014-01-24 Alan Modra - - * elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed - to get_relocs for ELFv2. - -2014-01-23 H.J. Lu - - PR ld/16498 - * elf.c (_bfd_elf_map_sections_to_segments): Issue a linker error - if TLS sections are not adjacent. - -2014-01-22 Alan Modra - - * elflink.c (elf_link_add_object_symbols): Call minfo for --as-needed. - -2014-01-22 Alan Modra - - * elf64-ppc.c (STK_LINKER): Comment typo fix. - -2014-01-21 H.J. Lu - - PR ld/16467 - * elflink.c (_bfd_elf_merge_symbol): When types of the existing - regular default symbol definition and the versioned dynamic - symbol definition mismatch, skip the default symbol definition - if one of them is IFUNC. - -2014-01-21 H.J. Lu - - PR ld/2404 - * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared, - info->export_dynamic nor h->ref_dynamic for type mismatch when - adding the default version. - -2014-01-16 Alan Modra - - * elfxx-mips.c (mips_elf_record_got_page_entry): Pass in a - mips_elf_traverse_got_arg* rather than mips_got_info*. - Adjust caller. Alloc on output_bfd rather than symbol section - owner. - -2014-01-15 H.J. Lu - - * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last - change. - * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. - -2014-01-14 H.J. Lu - - PR ld/16428 - * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't discard relocs - against __ehdr_start. - * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. - -2014-01-14 H.J. Lu - - * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last - change. - * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. + (_bfd_elf_gc_mark_extra_sections): Use it. -2014-01-14 H.J. Lu +2015-01-11 H.J. Lu - PR ld/16428 - * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't update reloc - count if there are any non pc-relative relocs. - * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. + PR ld/17827 + * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE, + only discard space for pc-relative relocs symbols which turn + out to need copy relocs. -2014-01-14 Michael Hudson-Doyle - Kugan Vivekanandarajah +2015-01-09 Nick Clifton - * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct - offset while calculating relocation address. - (elfNN_aarch64_create_small_pltn_entry): Likewise. - (elfNN_aarch64_init_small_plt0_entry): Likewise. + * tekhex.c (getvalue): Fix thinko in test for correct extraction + of value. + (getsym): Return false if there was not enough data to extract the + symbol. -2014-01-13 Ma Jiang +2015-01-09 Anthony Green - PR ld/16202 - * elf32-arm.c (elf32_arm_final_link_relocate): Refetch addends for - R_ARM_ABS8 and R_ARM_ABS16. + * elf32-moxie.c (ELF_MACHINE_ALT1): Define. -2014-01-13 Alan Modra +2015-01-08 Nick Clifton - * elf32-ppc.c (ppc_elf_check_relocs): For @local call to ifunc, - error when shared and force a plt call otherwise. - (ppc_elf_size_dynamic_sections): Don't emit DT_PPC_GOT unless - plt_type == PLT_NEW. - (ppc_elf_relocate_section): Add missing test to resolve ifuncs to - the appropriate call stub. + * elf32-msp430.c (msp430_elf_relax_section): Add relaxation of + 16-bit absolute BR instructions to 10-bit pc-relative JMP + instructions. -2014-01-10 Alan Modra +2015-01-08 Nick Clifton - PR ld/14207 - PR ld/16322 - PR binutils/16323 - * elf.c (assign_file_positions_for_load_sections): Revert last change. - (assign_file_positions_for_non_load_sections): When setting up - PT_GNU_RELRO header, don't require a corresponding PT_LOAD - header that completely covers the relro region. + PR binutils/17512 + * coffcode.h (coff_slurp_symbol_table): Return false if we failed + to load the line table. + * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum + maxpagesize of 1. + * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if + the Data Directory Size is too large. -2014-01-09 Tristan Gingold +2015-01-06 H.J. Lu - * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): use jump - table macros and add macros to initializa the structure. + PR binutils/17512 + * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation. + * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise. -2014-01-08 H.J. Lu +2015-01-06 Nick Clifton - PR ld/14207 - PR ld/16322 - PR binutils/16323 - * elf.c (_bfd_elf_map_sections_to_segments): Don't check section - size for PT_GNU_RELRO segment. - (assign_file_positions_for_load_sections): If PT_LOAD segment - doesn't fit PT_GNU_RELRO segment, adjust its p_filesz and p_memsz. + PR binutils/17512 + * mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the + string table. -2014-01-07 Tom Tromey + * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1. + (bfd_perform_relocation): Include the size of the reloc in the + test for an out of range relocation. + (bfd_generic_get_relocated_section_contents): Remove reloc range + test. - * elf32-xtensa.c (vsprint_msg): Don't use old VA_* compatibility - wrappers. + * coff-i860.c (CALC_ADDEND): Always set an addend value. + * tekhex.c (getvalue): Add an end pointer parameter. Use it to + avoid reading off the end of the buffer. + (getsym): Likewise. + (first_phase): Likewise. + (pass_over): Pass an end pointer to the invoked function. -2014-01-03 Nick Clifton +2015-01-05 H.J. Lu - PR binutils/16199 - * elf.c (vma_page_aligned_bias): Handle a maxpagesize value of - zero. + PR binutils/17512 + * elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt + input. + * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise. -2014-01-02 Yuanhui Zhang +2015-01-05 Nick Clifton - PR binutils/14289 - * pef.c (bfd_pef_xlib_read_header): Increase buffer size to 80. + PR binutils/17512 + * archive.c (do_slurp_bsd_armap): Make sure that the parsed sized + is at least big enough for the header to be read. + * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocs. + * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks. + (bfd_mach_o_read_command): Prevetn duplicate error messages about + unrecognized commands. + * syms.c (_bfd_stab_section_find_nearest_line): Add range checks + when indexing into the string table. -2014-01-02 Nick Clifton +2015-01-01 Alan Modra - PR binutils/11983 - * archive.c (_bfd_get_elt_at_filepos): Store a copy of the - filename in the bfd's filename field. - * elfcode.h (bfd_from_remote_memory): Likewise. - * ieee.c (ieee_object_p): Likewise. - * mach-o.c (bfd_mach_o_fat_member_init): Likewise. - * oasys.c (oasys_openr_next_archived_file): Likewise. - * vms-lib.c (_bfd_vms_lib_get_module): Likewise. - * opncls.c (bfd_fopen): Likewise. - (bfd_openstreamr): Likewise. - (bfd_openr_iovec): Likewise. - (bfd_openw): Likewise. - (bfd_create): Likewise. - (_bfd_delete_bfd): Free filename. + Update year range in copyright notice of all files. -For older changes see ChangeLog-2013 +For older changes see ChangeLog-2014 -Copyright (C) 2014 Free Software Foundation, Inc. +Copyright (C) 2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/bfd/ChangeLog-2014 b/bfd/ChangeLog-2014 new file mode 100644 index 000000000..02b1ef7d9 --- /dev/null +++ b/bfd/ChangeLog-2014 @@ -0,0 +1,3430 @@ +2014-12-30 H.J. Lu + + PR ld/17773 + * elflink.c (bfd_elf_final_link): Assign the file position for + the symbol string table only there are symbols to be emitted. + +2014-12-28 Alan Modra + + PR 17766 + * pei-x86_64.c (pex64_bfd_print_pdata_section): Correct string + length. Use memcpy rather than strcpy. + +2014-12-26 Alan Modra + + PR 17755 + * elf64-sh64.c (sh_elf64_copy_private_data_internal): Delete code + copying SHF_SH5_ISA32. + +2014-12-25 Thomas Preud'homme + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new + Tag_ABI_VFP_args value and replace hardcoded values by enum values. + (elf32_arm_post_process_headers): Set e_flags in ELF header as hard + float only when Tag_ABI_VFP_args is 1, using new enum value + AEABI_VFP_args_vfp to check that. + +2014-12-24 H.J. Lu + + * pei-x86_64.c (pex64_bfd_print_pdata_section): Add cast to + unsigned long. + +2014-12-24 Pierre Muller + + Add support for pdata output for pe coff objects. + * pe-x86_64.c (pex64_bfd_print_pdata): Add external + declaration. + (bfd_pe_print_data): Set macro to pex64_bfd_print_data. + * pei-x86_64.c (pex64_bfd_print_pdata): Changed to + global function. Now handles multiple .pdata sections. + (pex_bfd_print_pdata_section): New static helper function, + using most of old pex_bfd_print_pdata function code, but adding + support for coff pe objects, which might have some fields + starting at zero offset. + (pex64_print_all_pdata_sections) : New static helper function, + used in call to bfd_map_over_sections inside new + pex66_bfd_print_pdata function. + (bfd_boolean pdata_count): New static variable, used to return + bfd_boolean value for pex64_bfd_print_pdata function. + +2014-12-24 Alan Modra + + * linker.c (_bfd_generic_link_output_symbols): Remove BSF_WEAK + flag from bfd_link_hash_defined symbols. + +2014-12-23 Andrew Burgess + + * elf32-avr.c (bfd_elf_avr_final_write_processing): Don't set + EF_AVR_LINKRELAX_PREPARED unconditionally. + +2014-12-23 Alan Modra + + * elflink.c (_bfd_elf_define_linkage_sym): Set linker_def. + * linker.c (_bfd_generic_link_add_one_symbol): Clear linker_def + for CDEF, DEF, DEFW, COM. + +2014-12-22 Nick Clifton + + PR binutils/17512 + * archive.c (do_slurp_bsd_armap): Return if the parsed_size is + zero. + (bfd_slurp_armap): Zero terminate the name. + (bfd_generic_stat_arch_elt): If there is no header, fail. + * elf32-arc.c (arc_info_to_howto_rel): Replace BFD_ASSERT with + error message. + * elf32-avr.c (avr_info_to_howto_rela): Likewise. + * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise. + * elf32-cris.c (cris_info_to_howto_rela): Likewise. + * elf32-d10v.c (d10v_info_to_howto_rel): Likewise. + * elf32-d30v.c (d30v_info_to_howto_rel): Likewise. + * elf32-dlx.c (dlx_rtype_to_howto): Likewise. + * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise. + * elf32-fr30.c (fr30_info_to_howto_rela): Likewise. + * elf32-frv.c (frv_info_to_howto_rela): Likewise. + * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise. + * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise. + * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise. + * elf32-lm32.c (lm32_info_to_howto_rela): Likewise. + * elf32-m32c.c (m32c_info_to_howto_rela): Likewise. + * elf32-m32r.c (m32r_info_to_howto_rel): Likewise. + * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise. + * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise. + * elf32-mep.c (mep_info_to_howto_rela): Likewise. + * elf32-metag.c (metag_info_to_howto_rela): Likewise. + * elf32-moxie.c (moxie_info_to_howto_rela): Likewise. + * elf32-msp430.c (msp430_info_to_howto_rela): Likewise. + * elf32-mt.c (mt_info_to_howto_rela): Likewise. + * elf32-nds32.c (nds32_info_to_howto_rel): Likewise. + * elf32-or1k.c (or1k_info_to_howto_rela): Likewise. + * elf32-rl78.c (rl78_info_to_howto_rela): Likewise. + * elf32-rx.c (rx_info_to_howto_rela): Likewise. + * elf32-v850.c (v850_elf_info_to_howto_rel): Likewise. + * elf32-visium.c (visium_info_to_howto_rela): Likewise. + * elf32-xgate.c (xgate_info_to_howto_rel): Likewise. + * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise. + * elf64-mmix.c (mmix_info_to_howto_rela): Likewise. + * elf64-x86-64.c (elf_x86_64_reloc_type_lookup): Likewise. + * elfnn-aarch64.c (elfNN_aarch64_bfd_reloc_from_type): Likewise. + * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Add range + checking of reloc symbol index. + * mach-o.c (bfd_mach_o_canonicalize_one_reloc): If no symbols have + been provided then set the reloc's symbol to undefined. + * reloc.c (bfd_generic_get_relocated_section_contents): Add range + checking of the reloc to be applied. + * versados.c (process_otr): Add more range checks. + (versados_canonicalize_reloc): If the section is unknown, set the + symbol to undefined. + * vms-alpha.c (_bfd_vms_slurp_eisd): Add range checks. + (alpha_vms_object_p): Likewise. + +2014-12-18 Richard Henderson + + * elf32-ppc.c (ELF_COMMONPAGESIZE): Set to 64k. + * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise. + +2014-12-16 Nick Clifton + + PR binutils/17512 + * format.c (bfd_check_format_matches): Check for a matching vector + before using match priorities. + * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Fix off-by-one + errors with previous delta. + +2014-12-15 H.J. Lu + + PR ld/17713 + * elflink.c (_bfd_elf_gc_mark_rsec): Check corrupt input. + +2014-12-13 H.J. Lu + + PR ld/17689 + * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add needs_copy. + Change has_bnd_reloc to bit field. + (elf_x86_64_link_hash_newfunc): Initialize needs_copy and + has_bnd_reloc to 0. + (elf_x86_64_check_relocs): Set has_bnd_reloc to 1 instead + of TRUE. + (elf_x86_64_adjust_dynamic_symbol): Copy needs_copy from the + real definition to a weak symbol. + (elf_x86_64_allocate_dynrelocs): Also check needs_copy of a + weak symbol for PIE when discarding space for relocs against + symbols which turn out to need copy relocs. + (elf_x86_64_relocate_section): Also check needs_copy of a + weak symbol for PIE with copy reloc. + +2014-12-12 Alan Modra + + PR 15228 + * elflink.c (_bfd_elf_adjust_dynamic_copy): Call bfd_set_error. + +2014-12-12 Alan Modra + + PR 15228 + * elflink.c (_bfd_elf_adjust_dynamic_copy): Add "info" param. + Error on copy relocs against protected symbols. + (elf_merge_st_other): Set h->protected_def. + * elf-bfd.h (struct elf_link_hash_entry): Add "protected_def". + (_bfd_elf_adjust_dynamic_copy): Update prototype. + * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Update + _bfd_elf_adjust_dynamic_copy call. + * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise. + * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise. + * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise. + * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise. + * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise. + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise. + * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise. + * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise. + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise. + * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise. + * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise. + * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise. + * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise. + * elf32-tilepro.c (tilepro_elf_adjust_dynamic_symbol): Likewise. + * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise. + * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise. + * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise. + * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise. + * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise. + * elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise. + +2014-12-11 Keith Seitz + + * elf.c (elf_parse_notes): Define convenience macro + GROKER_ELEMENT to add elements to 'grokers' array. + Add 'len' element to 'grokers'. + Use grokers.len instead of sizeof in string + comparisons. + +2014-12-10 Alan Modra + + * Makefile.am (BFD32_LIBS, BFD32_LIBS_CFILES): Remove dwarf2 + and coffgen. Add coff-bfd. Sort. + (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add coffgen and dwarf2. + * bfd-in.h (bfd_coff_get_syment, bfd_coff_get_auxent): Delete. + (struct coff_comdat_info, bfd_coff_get_comdat_section): Delete. + * coffgen.c (coff_symbol_from): Move to coff-bfd.h as macro, + without unused param. Update uses. + (bfd_coff_get_comdat_section): Move to coff-bfd.h as macro. + (bfd_coff_get_syment, bfd_coff_get_auxent): Move to coff-bfd.c. + * libcoff-in.h: #include "coff-bfd.h". + (struct coff_section_tdata, coff_section_data): Move to coff-bfd.h. + (coff_symbol_from): Delete. + * coff-bfd.c: New file. + * coff-bfd.h: New file. + * coff-i386.c: Update coff_symbol_from occurrences. + * coff-i960.c: Likewise. + * coff-m68k.c: Likewise. + * coff-sh.c: Likewise. + * coff-x86_64.c: Likewise. + * coffcode.h: Likewise. + * pe-mips.c: Likewise. + * configure.ac (elf): Add dwarf2.lo. + (coffgen, coff, ecoff, xcoff): Define. Use when mapping bfd + target vectors to .o files. Add dwarf2 for mach-o targets. + Fix the sh target FIXME. + * po/SRC-POTFILES.in: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + +2014-12-10 Alan Modra + + PR 17541 + * dwarf2.c (struct comp_unit): Add "lang". + (non_mangled): New function. + (struct funcinfo): Add "is_linkage". Reorder for better packing. + Make "name" a const char*. + (lookup_address_in_function_table): Delete functionname_ptr param. + (find_abstract_instance_name): Add is_linkage param. Set if we + have DW_AT_linkage_name or non_mangled DW_AT_name. + (scan_unit_for_symbols): Similarly set func->is_linkage. + (parse_comp_unit): Stash DW_AT_language. + (comp_unit_find_nearest_line): Replace functionname_ptr param + with function_ptr param. + (_bfd_dwarf2_find_nearest_line): Adjust above calls. Set + functionname_ptr from function->name. Call _bfd_elf_find_function + to retrieve symbol for function if not linkage name. + (_bfd_elf_find_function): Add bfd_target_elf_flavour test, moved from.. + * elf.c (elf_find_function): ..here. + (_bfd_elf_find_nearest_line): Adjust calls. + * elf-bfd.h (_bfd_elf_find_function): Declare. + +2014-12-10 Alan Modra + + * dwarf2.c (read_address): Check bfd_target_elf_flavour before + calling get_elf_backend_data. + (_bfd_dwarf2_find_nearest_line): Fix parens. + +2014-12-10 Alan Modra + + PR 17666 + * elf-bfd.h (struct elf_backend_data): Add sort_relocs_p. + * elfxx-target.h (elf_backend_sort_relocs_p): Define. + (elfNN_bed): Init new field. + * elflink.c (elf_link_adjust_relocs): Conditionally sort. + (bfd_elf_final_link): Control sorting of relocs. + * elfxx-mips.c (_bfd_mips_elf_sort_relocs_p): New function. + * elfxx-mips.h (_bfd_mips_elf_sort_relocs_p): Declare. + * elf32-mips.c (elf_backend_sort_relocs_p): Define. + * elf64-mips.c (elf_backend_sort_relocs_p): Define. + +2014-12-09 Nick Clifton + + PR binutils/17512 + * archive64.c (bfd_elf64_archive_slurp_armap): Add range checks. + * libbfd.c (safe_read_leb128): New function. + * libbfd-in.h (safe_read_leb128): Add prototype. + * libbfd.h: Regenerate. + * elf-attrs.c (_bfd_elf_parse_attributes): Use safe_read_leb128. + Check for an over-long subsection length. + * elf.c (elf_parse_notes): Check that the namedata is long enough + for the string comparison that is about to be performed. + (elf_read_notes): Zero-terminate the note buffer. + +2014-12-09 Alan Modra + + * elf64-ppc.c (sort_r_offset): Delete. + (ppc64_elf_edit_opd): Don't sort input relocs. + +2014-12-06 Eric Botcazou + + * config.bfd: Add Visium support. + * configure.ac: Likewise. + * configure: Regenerate. + * Makefile.am (ALL_MACHINES): Add cpu-visium.lo. + (ALL_MACHINES_CFILES): Add cpu-visium.c. + (BFD32_BACKENDS): Add elf32-visium.lo. + (BFD32_BACKENDS_CFILES): Add elf32-visium.c. + * Makefile.in: Regenerate. + * archures.c (DESCRIPTION): Add Visium support. + (bfd_visium_arch): Declare. + (bfd_archures_list): Add bfd_visium_arch. + * reloc.c: Add Visium relocations. + * targets.c (visium_elf32_vec): Declare. + (_bfd_target_vector): Add visium_elf32_vec. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + * cpu-visium.c: New file. + * elf32-visium.c: Likewise. + * po/SRC-POTFILES.in: Regenerate. + +2014-12-05 Steve Ellcey + + * ecoff.c (_bfd_ecoff_slurp_symbol_table): Add cast. + +2014-12-05 H.J. Lu + + * elf64-x86-64.c (bfd_elf32_get_synthetic_symtab): New. + +2014-12-04 H.J. Lu + + PR binutils/17677 + * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): New prototype. + * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): New + function. + * elf32-i386.c (elf_i386_plt_sym_val): Removed. + (elf_backend_plt_sym_val): Likewise. + (elf_i386_get_plt_sym_val): New. + (elf_i386_get_synthetic_symtab): Likewise. + (bfd_elf32_get_synthetic_symtab): Likewise. + * elf64-x86-64.c (elf_x86_64_plt_sym_val): Removed. + (elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise. + (elf_backend_plt_sym_val): Likewise. + (elf_x86_64_get_plt_sym_val): New. + (elf_x86_64_get_synthetic_symtab): Use + _bfd_elf_ifunc_get_synthetic_symtab. + (bfd_elf64_get_synthetic_symtab): Don't undefine for NaCl. + +2014-12-04 Alan Modra + + PR 17666 + * elflink.c: Include bfd_stdint.h. + (cmp_ext32l_r_offset, cmp_ext32b_r_offset, + cmp_ext64l_r_offset, cmp_ext64b_r_offset): New functions. + (elf_link_adjust_relocs): Sort relocs. Free rel hashes after + sorting invalidates. + +2014-12-03 Nick Clifton + + PR binutils/17512 + * compress.c (bfd_get_full_section_contents): Fail if there are no + section contents available when the compress_status is + COMPRESS_SECTION_DONE. + * libbfd.c (bfd_malloc): Refuse to allocate a negative size. + (bfd_malloc2): Use bfd_malloc. + (bfd_realloc): Refuse to reallocate a negative size. + (bfd_realloc2): Use bfd_realloc. + (bfd_realloc_or_free): Use bfd_realloc. + (bfd_zmalloc): Use bfd_malloc. + (bfd_zmalloc): Use bfd_malloc2. + * opncls.c (bfd_alloc): Refuse to allocate a negative size. + +2014-12-03 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Reformat. + +2014-12-02 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_relocate_section): Check + info->executable for symbols which need copy relocs. + +2014-12-02 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_check_relocs): Revert the last + change. + (elf_x86_64_adjust_dynamic_symbol): Don't check !info->shared + with ELIMINATE_COPY_RELOCS. + (elf_x86_64_allocate_dynrelocs): For PIE, discard space for + relocs against symbols which turn out to need copy relocs. + +2014-12-02 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Always + allow copy relocs for building executables. + (elf_x86_64_check_relocs): Allow copy relocs for non-GOT + pc-relative relocation in shared object. + (elf_x86_64_adjust_dynamic_symbol): Allocate copy relocs for + PIE. + (elf_x86_64_relocate_section): Don't copy a pc-relative + relocation into the output file if the symbol needs copy reloc. + +2014-12-02 Andrew Bennett + + * elfxx-mips.c (mips_elf_calculate_relocation): Only check for + overflow on non-weak undefined symbols. + +2014-12-02 Alan Modra + + * elf64-ppc.c (OPD_NDX): Define. Use throughout for sizing/indexing + _opd_sec_data array, halving required memory. + (sort_r_offset): New function. + (ppc64_elf_edit_opd): Sort incoming relocs. Accept .opd + sections with a mix of 16 and 24 byte OPD entries. Don't + attempt to honour --non-overlapping-opd for .opd sections with + unexpected relocs. Simplify opd entry size calculations by + first finding the reloc for the next entry. Make edit loop + handle one opd entry per iteration, with an inner loop + handling relocs per entry. + +2014-12-01 Nick Clifton + + PR binutils/17512 + * archive.c (do_slurp_coff_armap): Add range checks to prevent + running off the end of the string table. + * compress.c (bfd_get_full_section_contents): Return a NULL + pointer for zero sized sections. Do not attempt to copy a buffer + onto itself. + * elf-attrs.c (_bfd_elf_parse_attributes): Check for an empty + header. Add range checks to avoid running off the end of the + section. + * elf.c (bfd_elf_get_str_section): Seek before allocating so that + if the seek fails, no memory is allocated. + (bfd_elf_string_from_elf_section): Do not allocate a string from a + non string section. It only leads to trouble later on. + (_bfd_elf_print_private_bfd_data): Check for there being too + little external dynamic data. + (bfd_section_from_shdr): Replace assertion with a failure mode. + (bfd_section_from_shdr): When walking a loaded group section use + the internal structure size, not the external size. Check for the + group section being empty. + * elf32-i386.c (elf_i386_rtype_to_howto): Replace assertion with a + failure mode. + * elfcode.h (elf_slurp_reloc_table): Likewise. + * reloc.c (bfd_perform_relocation): Avoid seg-fault if the howto + parameter is NULL. + +2014-11-30 Alan Modra + + PR 16452, 16457 + * elflink.c (_bfd_elf_link_find_version_dependencies): Exclude + symbols from libraries that won't be listed in DT_NEEDED. + (elf_link_output_extsym): Don't output verdefs for such symbols. + +2014-11-28 Alan Modra + + * elf.c (_bfd_elf_slurp_version_tables): Exit loops when vn_next/ + vna_next/vd_next/vda_next is zero. Correct counts. + +2014-11-27 Nick Clifton + + PR binutils/17512 + * ecoff.c (_bfd_ecoff_slurp_symbol_table): Warn about and correct + a discrepancy between the isymMax and ifdMax values in the + symbolic header. + * elf.c (_bfd_elf_print_private_bfd_data): Fix the range check + scanning the external dynamic entries. + +2014-11-26 Nick Clifton + + PR binutils/17512 + * coff-h8300.c (rtype2howto): Replace abort with returning a NULL + value. + * coff-h8500.c (rtype2howto): Likewise. + * coff-tic30.c (rtype2howto): Likewise. + * coff-z80.c (rtype2howto): Likewise. + * coff-z8k.c (rtype2howto): Likewise. + * coff-ia64.c (RTYPE2HOWTO): Always return a valid howto. + * coff-m68k.c (m68k_rtype2howto): Return a NULL howto if none + could be found. + * coff-mcore.c (RTYPE2HOWTO): Add range checking. + * coff-w65.c (rtype2howto): Likewise. + * coff-we32k.c (RTYPE2HOWTO): Likewise. + * pe-mips.c (RTYPE2HOWTO): Likewise. + * coff-x86_64.c (coff_amd64_reloc): Likewise. Replace abort with + an error return. + * coffcode.h (coff_slurp_reloc_table): Allow the rel parameter to + be unused. + * coffgen.c (make_a_section_from_file): Check the length of a + section name before testing to see if it is a debug section name. + (coff_object_p): Zero out any uninitialised bytes in the opt + header. + * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Test for the raw + source being empty when there are values to be processed. + (_bfd_ecoff_slurp_symbol_table): Add range check. + * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Likewise. + (bfd_mach_o_mangle_sections): Move test for too many sections to + before the allocation of the section table. + (bfd_mach_o_read_symtab_strtab): If the read fails, free the + memory and nullify the symbol pointer. + * reloc.c (bfd_generic_get_relocated_section_contents): Add + handling of a bfd_reloc_notsupported return value. + * versados.c (EDATA): Add range checking. + (get_record): Likewise. + (process_otr): Check for contents being available before updating + them. + (versados_canonicalize_reloc): Add range check. + +2014-11-26 Alan Modra + + * elf.c (_bfd_elf_slurp_version_tables): Delay allocation of + internal verref buffer. Error for zero sh_info. Print errors. + Check for zero vd_ndx. Use bfd_zalloc for vd_auxptr buffer. + +2014-11-25 H.J. Lu + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use + NAME##_get_symbol_version_string. + (bfd_get_symbol_version_string): New. + * aout-adobe.c (aout_32_get_symbol_version_string): Define using + _bfd_nosymbols define. + * aout-target.h (MY_get_symbol_version_string): Likewise. + * aout-tic30.c (MY_get_symbol_version_string): Likewise. + * binary.c (binary_get_symbol_version_string): Likewise. + * bout.c (aout_32_get_symbol_version_string): Likewise. + * coff-rs6000.c (_bfd_xcoff_get_symbol_version_string): Likewise. + * i386msdos.c (msdos_get_symbol_version_string): Likewise. + * i386os9k.c (aout_32_get_symbol_version_string): Likewise. + * ieee.c (ieee_get_symbol_version_string): Likewise. + * ihex.c (ihex_get_symbol_version_string): Likewise. + * libecoff.h (_bfd_ecoff_get_symbol_version_string): Likewise. + * mach-o-target.c (bfd_mach_o_get_symbol_version_string): Likewise. + * mmo.c (mmo_get_symbol_version_string): Likewise. + * nlm-target.h (nlm_get_symbol_version_string): Likewise. + * oasys.c (oasys_get_symbol_version_string): Likewise. + * pef.c (bfd_pef_get_symbol_version_string): Likewise. + * plugin.c (bfd_plugin_get_symbol_version_string): Likewise. + * ppcboot.c (ppcboot_get_symbol_version_string): Likewise. + * som.c (som_get_symbol_version_string): Likewise. + * srec.c (srec_get_symbol_version_string): Likewise. + * tekhex.c (tekhex_get_symbol_version_string): Likewise. + * versados.c (versados_get_symbol_version_string): Likewise. + * vms-alpha.c (alpha_vms_get_symbol_version_string): Likewise. + * xsym.c (bfd_sym_get_symbol_version_string): Likewise. + + * coff64-rs6000.c (rs6000_xcoff64_vec): Use + coff_get_symbol_version_string. + (rs6000_xcoff64_aix_vec): Likewise. + + * elf-bfd.h (bfd_elf_get_symbol_version_string): Renamed to ... + (_bfd_elf_get_symbol_version_string): This. + * elf.c: Likewise. + (bfd_elf_print_symbol): Updated. + * elfxx-target.h (bfd_elfNN_get_symbol_version_string): Define. + + * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Define. + * libcoff-in.h (coff_get_symbol_version_string): Likewise. + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + * libcoff.h: Likewise. + +2014-11-25 H.J. Lu + + PR binutils/16496 + * elf-bfd.h (bfd_elf_get_symbol_version_string): New. + * elf.c (bfd_elf_get_symbol_version_string): New. Extracted + from bfd_elf_print_symbol. + (bfd_elf_print_symbol): Use it. + +2014-11-25 H.J. Lu + + * elf32-i386.c (elf_i386_got_plt_entry): New. + (elf_i386_pic_got_plt_entry): Likewise. + (elf_i386_link_hash_entry): Add plt_got. + (elf_i386_link_hash_table): Likewise. + (elf_i386_link_hash_newfunc): Initialize plt_got.offset to -1. + (elf_i386_get_local_sym_hash): Likewise. + (elf_i386_check_relocs): Create the GOT PLT if there are both + PLT and GOT references when the regular PLT is used. + (elf_i386_allocate_dynrelocs): Use the GOT PLT if there are + both PLT and GOT references unless pointer equality is needed. + (elf_i386_relocate_section): Also check the GOT PLT when + resolving R_386_PLT32. + (elf_i386_finish_dynamic_symbol): Use the GOT PLT if it is + available. + + * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add plt_got. + (elf_x86_64_link_hash_table): Likewise. + (elf_x86_64_link_hash_newfunc): Initialize plt_got.offset to -1. + (elf_x86_64_get_local_sym_hash): Likewise. + (elf_x86_64_check_relocs): Create the GOT PLT if there are both + PLT and GOT references when the regular PLT is used. + (elf_x86_64_allocate_dynrelocs): Use the GOT PLT if there are + both PLT and GOT references unless pointer equality is needed. + (elf_x86_64_relocate_section): Also check the GOT PLT when + resolving R_X86_64_PLT32. + (elf_x86_64_finish_dynamic_symbol): Use the GOT PLT if it is + available. + +2014-11-24 H.J. Lu + + * configure: Regenerated. + +2014-11-24 Tejas Belagod + + * elfnn-aarch64.c (elf_aarch64_compare_mapping): New. + (erratum_835769_scan): Sort map list. + +2014-11-24 Alan Modra + + * elf64-ppc.c (plt_stub_pad): Correct. + +2014-11-23 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_check_relocs): Assert size of + elf_x86_64_bnd_plt2_entry and elf_x86_64_legacy_plt2_entry. + (elf_x86_64_allocate_dynrelocs): Don't assert size of + elf_x86_64_bnd_plt2_entry and elf_x86_64_legacy_plt2_entry. + +2014-11-22 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check + branch displacement overflow in PLT entry. + +2014-11-21 Nick Clifton + + PR binutils/17512 + * coffgen.c (coff_get_normalized_symtab): Check for an excessive + number of auxillary entries. + * ieee.c (next_byte): Convert to a function. Return FALSE if the + next byte is beyond the end of the buffer. + (parse_int): Test the return value of next_byte. + (parse_expression): Convert to boolean. Return FALSE if the + parsing failed. Test the return value of next_byte. + (ieee_seek): Convert to a function. Return FALSE if the seek goes + beyond the end of the buffer. + (ieee_slurp_external_symbols): Test the return value of ieee_seek + and next_byte. + (ieee_slurp_sections): Convert to boolean. Return FALSE if the + operation failed. Test the return value of ieee_seek and + next_byte. + (ieee_archive_p): Test the return value of ieee_seek and + next_byte. + (do_one): Likewise. + (ieee_slurp_section_data): Likewise. + (ieee_object_p): Likewise. Store the size of the buffer in the + total_amt field in the header. + * libieee.h (common_header_type): Add amt field. + * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the + reloc's value is within range. + (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the + operation fails. + * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with + an error message. + (pex64_dump_xdata): Check for buffer overflows. + * versados.c (process_otr): Check that the section exists before + taking its size. + (versados_object_p): Make sure that enough data was read for the + header to be checked. + * vms-alpha.c (vms_get_remaining_object_record): Change + read_so_far parameter to an unsigned int. Check that the amount + read is in range. + +2014-11-21 H.J. Lu + + * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Optimize + PC-relative offset overflow check. + +2014-11-21 Alexander Cherepanov + + PR binutils/17512 + * coffgen.c (_bfd_coff_read_string_table): Test allocation of + string table before clearing the first few bytes. + +2014-11-21 Terry Guo + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Support FPv5. + +2014-11-20 Alan Modra + + * elf64-ppc.c (group_sections): Init stub14_group_size from + --stub-group-size parameter divided by 1024. + +2014-11-20 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Correct ppc476 workaround + alignment calculation. + +2014-11-20 Terry Guo + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Skip if input bfd + hasn't attribute section. + +2014-11-20 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Add __go_go to thread_starters. + +2014-11-18 H.J. Lu + + PR ld/17618 + * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check + PC-relative offset overflow in PLT entry. + +2014-11-18 Nick Clifton + + PR binutils/17512 + * peXXIgen.c (pe_print_pdata): Fail if the section's virtual size + is larger than its real size. + (rsrc_print_section): Fix off-by-one error checking for overflow. + * pei-x86_64.c (pex64_bfd_print_pdata): Handle empty unwind + sections. + +2014-11-18 Igor Zamyatin + + * elf64-x86-64.c (elf_x86_64_check_relocs): Enable MPX PLT only + for -z bndplt. + +2014-11-14 Nick Clifton + + PR binutils/17597 + * opncls.c (bfd_get_debug_link_info): Avoid reading off the end of + the section. + (bfd_get_alt_debug_link_info): Likewise. + +2014-11-14 Nick Clifton + + PR binutils/17512 + * ieee.c (ieee_archive_p) Skip processing if no bytes are read at + all. + (ieee_object_p): Likewise. + +2014-11-13 H.J. Lu + + * coffcode.h (coff_slurp_line_table): Add cast to unsigned int. + +2014-11-13 H.J. Lu + + * coffcode.h (coff_pointerize_aux_hook): Fix a typo. + +2014-11-13 H.J. Lu + + PR gas/17598 + * elf64-x86-64.c (elf_x86_64_check_relocs): Treat + R_X86_64_GOTPLT64 the same as R_X86_64_GOT64. + (elf_x86_64_relocate_section): Likewise. + +2014-11-13 Nick Clifton + + PR binutils/17512 + * coffcode.h (coff_ptr_struct): Add is_sym field. + (coff_new_section_hook): Set the is_sym field. + (coff_pointerize_aux_hook): Check the is_sym field. + (coff_print_aux): Likewise. + (coff_compute_section_file_positions): Likewise. + (coff_write_object_contents): Likewise. + (coff_slurp_line_table): Likewise. + (coff_slurp_symbol_table): Likewise. + (CALC_ADDEND): Likewise. + * coffgen.c (coff_renumber_symbols): Likewise. + (coff_mangle_symbols): Likewise. + (coff_fix_symbol_name): Likewise. + (coff_write_symbol): Likewise. + (coff_write_alien_symbol): Likewise. + (coff_write_native_symbol): Likewise. + (coff_write_symbols): Likewise. + (coff_write_linenumbers): Likewise. + (coff_pointerize_aux): Likewise. + (coff_get_normalized_symtab): Likewise. + (coff_get_symbol_info): Likewise. + (bfd_coff_get_syment): Likewise. + (bfd_coff_get_auxent): Likewise. + (coff_print_symbol): Likewise. + (coff_find_nearest_line_with_names): Likewise. + (bfd_coff_set_symbol_class): Likewise. + (coff_make_empty_symbol): Set the is_sym field. + (coff_bfd_make_debug_symbol): Likewise. + * peicode.h (pe_ILF_make_a_symbol): Likewise. + * libcoff.h: Regenerate. + * libcoff-in.h: Regenerate. + +2014-11-12 Nick Clifton + + PR binutils/17512 + * coffcode.h (coff_slurp_line_table): Set the line number of + corrupt entries to -1. + (coff_slurp_symbol_table): Alway initialise the value of the + symbol. + * coffgen.c (coff_print_symbol): Check that the combined pointer + is valid. + (coff_print_symbol): Do not print negative line numbers. + * peXXigen.c (pe_print_idata): Add range checking displaying + member names. + +2014-11-12 Alan Modra + + PR binutils/17512 + * coffcode.h (coff_slurp_line_table): Drop line number info + not preceded by a valid function entry. Revert last change. + +2014-11-11 Nick Clifton + + PR binutils/17512 + * coffcode.h (coff_slurp_line_table): Initialise the parts of the + line number cache that would not be initialised by the copy from + the new line number table. + (coff_classify_symbol): Allow for _bfd_coff_internal_syment_name + returning NULL. + * coffgen.c (coff_get_normalized_symbols): Get the external + symbols before allocating space for the internal symbols, in case + the get fails. + * elf.c (_bfd_elf_slurp_version_tables): Only allocate a verref + array if one is needed. Likewise with the verdef array. + * peXXigen.c (_bfd_XXi_swap_sym_in): Replace abort()'s with error + messages. + (_bfd_XXi_swap_aux_in): Make sure that all fields of the aux + structure are initialised. + (pe_print_edata): Avoid reading off the end of the data buffer. + +2014-11-11 Alan Modra + + PR binutils/17512 + * coffcode.h (coff_slurp_line_table): Use updated lineno_count + when building func_table. + +2014-11-11 Alan Modra + + PR binutils/17512 + * coffcode.h (coff_slurp_line_table): Don't bfd_zalloc, just + memset the particular bits we need. Update src after hitting loop + "continue". Don't count lineno omitted due to invalid symbols in + nbr_func, and update lineno_count. Init entire terminating + lineno. Don't both allocating terminator in n_lineno_cache. + Redirect sym->lineno pointer to where n_lineno_cache will be + copied, and free n_lineno_cache. + * pe-mips.c (NUM_HOWTOS): Typo fix. + +2014-11-11 Alan Modra + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust section + size check to account for possible zero terminator. + +2014-11-10 James Cowgill + + * elfxx-mips.c (_bfd_mips_elf_section_processing): don't force small + data sections to be PROGBITS + +2014-11-10 Nick Clifton + + PR binutils/17521 + * coff-i386.c (NUM_HOWTOS): New define. + (RTYPE2HOWTO): Use it. + (coff_i386_rtype_to_howto): Likewise. + (coff_i386_reloc_name_lookup): Likewise. + (CALC_ADDEND): Check that reloc r_type field is valid. + * coff-x86_64.c (NUM_HOWTOS): New define. + (RTYPE2HOWTO): Use it. + (coff_amd64_rtype_to_howto): Likewise. + (coff_amd64_reloc_name_lookup): Likewise. + (CALC_ADDEND): Check that reloc r_type field is valid. + * coffcode.h (coff_slurp_line_table): Check for symbol table + indexing underflow. + (coff_slurp_symbol_table): Use zalloc to ensure that all table + entries are initialised. + * coffgen.c (_bfd_coff_read_string_table): Initialise unused bits + in the string table. Also ensure that the table is 0 terminated. + (coff_get_normalized_symtab): Check for symbol table indexing + underflow. + * opncls.c (bfd_alloc): Catch the case where a small negative size + can result in only 1 byte being allocated. + (bfd_alloc2): Use bfd_alloc. + * pe-mips.c (NUM_HOWTOS): New define. + (coff_mips_reloc_name_lookup): Use it. + (CALC_ADDEND): Check that reloc r_type field is valid. + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Initialise unused entries + in the DataDirectory. + (pe_print_idata): Avoid reading beyond the end of the data block + wen printing strings. + (pe_print_edata): Likewise. + Check for table indexing underflow. + * peicode.h (pe_mkobject): Initialise the pe_opthdr field. + (pe_bfd_object_p): Allocate and initialize enough space to hold a + PEAOUTHDR, even if the opt_hdr field specified less. + +2014-11-08 Alan Modra + + * peXXigen.c (pe_print_idata): Revert last patch, cast lhs instead. + +2014-11-07 H.J. Lu + + * peXXigen.c (pe_print_idata): Cast to unsigned long in range + checks. + +2014-11-07 H.J. Lu + + PR ld/17482 + * elf64-x86-64.c (elf_x86_64_relocate_section): Update comments + for IE->LE transition. + +2014-11-07 Alan Modra + + * tekhex.c (tekhex_set_arch_mach): Ignore unknown arch errors. + +2014-11-07 Alan Modra + + * tekhex.c (CHUNK_SPAN): Define. + (struct data_struct ): Use one byte per span, update + all code accessing this field. + (find_chunk): Add create param, don't create new entry unless set. + (insert_byte): Don't save zeros. + (first_phase): Set section SEC_CODE or SEC_DATA flag depending + on symbol type. Create an alternate section if both types of + symbol are given. Attach type '2' and '6' symbols to absolute + section. + (move_section_contents): Fix caching of chunk. Don't create chunk + when reading, or for writing zeros. + (tekhex_set_section_contents): Don't create initial chunks. + (tekhex_write_object_contents): Use CHUNK_SPAN. + +2014-11-07 Alan Modra + + * aoutx.h (aout_get_external_symbols): Tidy allocation of symbol buffer. + +2014-11-07 Alan Modra + + * archive.c (_bfd_slurp_extended_name_table): Revert bfd_get_size check. + * coffcode.h (coff_set_alignment_hook): Likewise. + (coff_slurp_line_table): Likewise. + * coffgen.c (coff_get_normalized_symtab): Likewise. + (_bfd_coff_get_external_symbols): Likewise. + * elf.c (bfd_elf_get_str_section): Likewise. + * tekhex.c (first_phase): Likewise. + +2014-11-06 Nick Clifton + + * aoutx.h (slurp_symbol_table): Revert previous delta. + (slurp_reloc_table): Likewise. + * compress.c (bfd_get_full_section_contents): Remove file size + test. + * coffgen.c (coff_get_normalized_symtab): Allow zero-sized symtabs + and do not complain about linker generated files. + +2014-11-06 Will Newton + + * elf-attrs.c (_bfd_elf_parse_attributes): Handle zero + length sections and sub-sections. + +2014-11-04 Nick Clifton + + PR binutils/17512 + * coffcode.h (handle_COMDAT): Replace abort with BFD_ASSERT. + Replace another abort with an error message. + (coff_slurp_line_table): Add more range checking. + * peXXigen.c (pe_print_debugdata): Add range checking. + +2014-11-05 James Cowgill + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Fix segfault + when creating a dso with discarded dynsym section. + +2014-11-05 Matthew Fortune + + * elfxx-mips.c (update_mips_abiflags_isa): Add E_MIPS_ARCH_32R6 + and E_MIPS_ARCH_64R6 support. + +2014-11-05 Nick Clifton + + PR binutils/17512 + * coffcode.h (coff_set_alignment_hook): Warn if the file lies + about the number of relocations it contains. + (coff_sort_func_alent): Return 0 if the pointers are NULL. + (coff_slurp_line_table): Add more range checks. Do not free new + tables created when sorting line numbers. + * peXXigen.c (pe_print_idata): Add range checks. + (pe_print_edata): Likewise. + (rsrc_print_resource_entries): Likewise. Avoid printing control + characters. Terminate priniting if corruption is detected. + (rsrc_print_resource_directory): Terminate printing if an unknown + directory type is encountered. + (pe_print_debugdata): Fix off-by-one error. + (rsrc_count_entries): Add range checking. + (rsrc_parse_entry): Likewise. + +2014-11-04 Nick Clifton + + PR binutils/17512 + * compress.c (bfd_get_full_section_contents): Improve test for + linker created objects. + + PR binutils/17533 + * archive.c (_bfd_slurp_extended_name_table): Handle archives with + corrupt extended name tables. + +2014-11-04 Alan Modra + + * elf32-spu.c (ovl_mgr_stat): New function. + (spu_elf_open_builtin_lib): Pass to bfd_openr_iovec. + +2014-11-03 Andrew Burgess + + * elf32-avr.c (elf32_avr_relax_delete_bytes): During linker + relaxation, reduce the size of symbols that span the deleted + bytes. + +2014-11-03 Andrew Burgess + + * elf32-avr.c (elf32_avr_relax_delete_bytes): Modify symbols + located at the very end of the section. + +2014-11-03 Nick Clifton + + PR binutils/17512 + * aoutx.h (slurp_symbol_table): Check that computed table size is + not bigger than the file from which is it being read. + (slurp_reloc_table): Likewise. + * coffcode.h (coff_slurp_line_table): Remove unneeded local + 'warned'. Do not try to print the details of a symbol with an + invalid index. + * coffgen.c (make_a_sectiobn_from_file): Check computed string + index against length of string table. + (bfd_coff_internal_syment_name): Check read in string offset + against length of string table. + (build_debug_section): Return a pointer to the section used. + (_bfd_coff_read_string_table): Store the length of the string + table in the coff_tdata structure. + (bfd_coff_free_symbols): Set the length of the string table to + zero when it is freed. + (coff_get_normalized_symtab): Check offsets against string table + or data table lengths as appropriate. + * cofflink.c (_bfd_coff_link_input_bfd): Check offset against + length of string table. + * compress.c (bfd_get_full_section_contents): Check computed size + against the size of the file. + * libcoff-in.h (obj_coff_strings_len): Define. + (struct coff_tdata): Add strings_len field. + * libcoff.h: Regenerate. + * peXXigen.c (pe_print_debugdata): Do not attempt to print the + data if the debug section is too small. + * xcofflink.c (xcoff_link_input_bfd): Check offset against + length of string table. + +2014-11-03 Nick Clifton + + * po/fi.po: Updated Finnish translation. + +2014-10-31 Andrew Pinski + Naveen H.S + + * archures.c: Add octeon3 for mips target. + * bfd-in2.h: Regenerate. + * bfd/cpu-mips.c: Define I_mipsocteon3. + nfo_struct): Add octeon3 support. + * bfd/elfxx-mips.c: (_bfd_elf_mips_mach): Add support for + octeon3. + (mips_set_isa_flags): Add support for octeon3. + (bfd_mips_isa_ext): Add bfd_mach_mips_octeon3. + (mips_mach_extensions): Make bfd_mach_mips_octeon3 an + extension of bfd_mach_mips_octeon2. + (print_mips_isa_ext): Print the value of Octeon3. + +2014-10-31 Nick Clifton + + PR binutils/17512 + * coffgen.c (_bfd_coff_get_external_symbols): Do not try to load a + symbol table bigger than the file. + * elf.c (bfd_elf_get_str_section): Do not try to load a string + table bigger than the file. + * tekhex.c (first_phase): Check that the section range is sane. + +2014-10-30 Nick Clifton + + PR binutils/17512 + * ihex.c (ihex_scan): Fix typo in invocation of ihex_bad_byte. + * coffgen.c (coff_get_normalized_symtab): Prevent buffer overrun. + +2014-10-29 Nick Clifton + + * elf.c (bfd_section_from_shdr): Fix heap use after free memory + leak. + +2014-10-29 Dennis Brueni + + * elf.c (elfcore_write_lwpstatus): Fix typo in call to memcpy. + +2014-10-28 Nick Clifton + + PR binutils/17512 + * elf.c (bfd_section_from_shdr): Allocate and free the recursion + detection table on a per-bfd basis. + * peXXigen.c (pe_print_edata): Handle binaries with a truncated + export table. + +2014-10-28 Andreas Schwab + Nick Clifton + + PR binutils/17510 + * srec.c (srec_bad_byte): Increase size of buf to allow for + negative values. + (srec_scan): Use an unsigned char buffer to hold header bytes. + +2014-10-27 Nick Clifton + + PR binutils/17512 + * elf.c (bfd_section_from_shdr): Detect and warn about ELF + binaries with a group of sections linked by the string table + indicies. + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries + with an invalid value for NumberOfRvaAndSizes. + (pe_print_edata): Detect out of range rvas and entry counts for + the Export Address table, Name Pointer table and Ordinal table. + + PR binutils/17510 + * elf.c (setup_group): Improve handling of corrupt group + sections. + +2014-10-24 Tejas Belagod + + * bfd-in.h (bfd_elf64_aarch64_set_options): Add a parameter. + * bfd-in2.h (bfd_elf64_aarch64_set_options): Likewise. + * elfnn-aarch64.c (aarch64_erratum_835769_stub): New. + (elf_aarch64_stub_type): Add new type + aarch64_stub_erratum_835769_veneer. + (elf_aarch64_stub_hash_entry): New fields for erratum 835769. + (aarch64_erratum_835769_fix): New data struct to record erratum + 835769. + (elf_aarch64_link_hash_table: Global flags for 835769. + (aarch64_build_one_stub): Add case for 835769. + (aarch64_size_one_stub): Likewise. + (aarch64_mem_op_p, aarch64_mlxl_p, + aarch64_erratum_sequence,erratum_835769_scan): + New. Decode and scan functions for erratum 835769. + (elf_aarch64_create_or_find_stub_sec): New. + (elfNN_aarch64_size_stubs): Look for erratum 835769 and record + them. + (bfd_elfNN_aarch64_set_options: Set global flag for 835769. + (erratum_835769_branch_to_stub_data, + make_branch_to_erratum_835769_stub):New. Connect up all the + erratum stubs to occurances by branches. + (elfNN_aarch64_write_section): New hook. + (aarch64_map_one_stub): Output erratum stub symbol. + (elfNN_aarch64_size_dynamic_sections): Init mapping symbol + information for erratum 835769. + (elf_backend_write_section): Define. + +2014-10-23 Victor Kamensky + + * elf32-arm.c (read_code32): New function to read 32 bit + arm instruction. + (read_code16): New function to read 16 bit thumb instrution. + (elf32_arm_plt0_size, elf32_arm_plt_size): Use read_code32 + and read_code16 to read instructions. + +2014-10-22 Matthew Fortune + + * elfxx-mips.c (print_mips_ases): Print unknown ASEs. + (print_mips_isa_ext): Print the value of an unknown extension. + +2014-10-21 Alan Modra + + * elf64-ppc.c (ppc64_elf_tls_optimize): Ignore relocs against toc + entries that aren't a multiple of 8 rather than failing assertion. + +2014-10-21 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Add gcc-4.9 libgomp functions + to thread_starter. + +2014-10-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_add_symbol_hook): If function code + section for function symbols defined in .opd is discarded, let + the symbol appear to be undefined. + (opd_entry_value): Ensure the result section is that for the + function code section in the same object as the OPD entry. + +2014-10-16 Alan Modra + + PR 17492 + * elf32-arm.c (elf32_arm_add_symbol_hook): Only set has_gnu_symbols + on ELF output bfd. + * elf32-i386.c (elf_i386_add_symbol_hook): Likewise. + * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. + * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. + * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. + * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. + * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise. + * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise. + * elf-s390-common.c (elf_s390_add_symbol_hook): Likewise. Handle + STB_GNU_UNIQUE too. + +2014-10-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_before_check_relocs): Do .opd processing + even when output is not ppc64 ELF. Remove redundant tests on + type of input bfd. + +2014-10-15 Alan Modra + + PR 17481 + * aoutx.h (NAME (aout, find_nearest_line)): Add "discriminator_ptr" + param, group "section" and "offset" params. Zero discriminator. + * bfd.c (bfd_find_nearest_line): Implement with new + _bfd_find_nearest_line. + (bfd_find_nearest_line_discriminator): Likewise. + * coff-i386.c (_bfd_generic_find_nearest_line_discriminator): Don't + define. + * coff-rs6000.c (xcoff_find_nearest_line, + xcoff_find_nearest_line_discriminator): Delete. + (_bfd_xcoff_find_nearest_line): Don't define. + (_bfd_xcoff_find_nearest_line): Define as coff_find_nearest_line. + * coff-x86_64.c (_bfd_generic_find_nearest_line_discriminator): Don't + define. + * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Adjust. + * coffgen.c (coff_find_nearest_line_with_names): Reorder params, + adjust _bfd_dwarf2_find_nearest_line call. + (coff_find_nearest_line): Add "discriminator_ptr" param, reorder + others. Set discriminator. Adjust call. + (coff_find_nearest_line_discriminator): Delete. + * dwarf1.c (_bfd_dwarf1_find_nearest_line): Reorder params. + * dwarf2.c (find_line): Rename to.. + (_bfd_dwarf2_find_nearest_line): ..this, reordering params. + Simplify setting of do_line. Delete old function. + (_bfd_dwarf2_find_line): Delete. + * ecoff.c (_bfd_ecoff_find_nearest_line): Reorder params, add + discriminator_ptr and set it. + * elf-bfd.h (_bfd_elf_find_nearest_line): Update prototype. + (_bfd_elf_find_nearest_line_discriminator): Delete. + (_bfd_elf_find_line_discriminator): Delete. + (_bfd_generic_find_nearest_line_discriminator): Don't define. + * elf.c (elf_find_function): Reorder params. + (_bfd_elf_find_nearest_line): Reorder params, add discriminator_ptr. + Adjust calls. + (_bfd_elf_find_nearest_line_discriminator): Delete. + (_bfd_elf_find_line): Adjust call. + * elf32-arm.c (arm_elf_find_function): Reorder params. + (elf32_arm_find_nearest_line): Reorder params, add discriminator_ptr. + Adjust calls. + * elf64-alpha.c (elf64_alpha_find_nearest_line): Similarly. + * elfnn-aarch64.c (aarch64_elf_find_function): Reorder params. + (elfNN_aarch64_find_nearest_line): Reorder params, add + discriminator_ptr. Adjust calls. + * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Similarly. + * elfxx-mips.h (_bfd_mips_elf_find_nearest_line): Update prototype. + * libaout.h (NAME (aout, find_nearest_line)): Update prototype. + * libbfd-in.h (_bfd_nosymbols_find_nearest_line): Update. + (_bfd_dwarf1_find_nearest_line): Likewise. + (_bfd_dwarf2_find_nearest_line): Likewise. + (_bfd_dwarf2_find_line): Delete. + (_bfd_generic_find_nearest_line_discriminator): Delete. + * libbfd.c (_bfd_generic_find_nearest_line_discriminator): Delete. + * libcoff-in.h (coff_find_nearest_line): Update prototype. + (coff_find_nearest_line_discriminator): Delete. + (coff_find_nearest_line_with_names): Update prototype. + * libecoff.h (_bfd_ecoff_find_nearest_line): Update prototype. + * mach-o.c (bfd_mach_o_find_nearest_line): Reorder params, add + discriminator_ptr. Adjust calls. + * mach-o.h (bfd_mach_o_find_nearest_line): Update prototype. + * pdp11.c (NAME (aout, find_nearest_line)): Reorder params, add + discriminator_ptr and set. + * som.c (som_find_nearest_line): Similarly. + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Delete entry for + _bfd_find_nearest_line_discriminator. + (struct bfd_target <_bfd_find_nearest_line>): Adjust prototype. + (struct bfd_target <_bfd_find_nearest_line_discriminator>): Delete. + * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Rename to.. + (_bfd_vms_find_nearest_line): ..this. Reorder params, add + "discriminator" and set. + (_bfd_vms_find_nearest_line_discriminator): Delete. + (_bfd_generic_find_nearest_line_discriminator): Don't define. + (alpha_vms_find_nearest_line): Update define. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2014-10-15 Alan Modra + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_find_line. + * aout-adobe.c (aout_32_find_line): Define. + (aout_32_bfd_make_debug_symbol, aout_32_bfd_reloc_type_lookup, + aout_32_bfd_reloc_name_lookup): Define using _bfd_nosymbols define. + * aout-target.h (MY_find_line): Define. + * aout-tic30.c (MY_find_line): Define. + * binary.c (binary_find_line): Define. + * bout.c (aout_32_find_line): Define. + * coff-rs6000.c (_bfd_xcoff_find_line): Define. + * coff64-rs6000.c (rs6000_xcoff64_vec): Use coff_find_line. + (rs6000_xcoff64_aix_vec): Likewise. + * elf-bfd.h (_bfd_generic_find_line): Don't define. + * elfxx-target.h (bfd_elfNN_find_line): Define. + * i386msdos.c (msdos_find_line): Define. + * i386os9k.c (aout_32_find_line): Define. + * ieee.c (ieee_find_nearest_line, ieee_find_inliner_info): Delete func. + (ieee_find_nearest_line, ieee_find_line, + ieee_find_inliner_info): Define. + * ihex.c (ihex_find_line): Define. + * libbfd-in.h (_bfd_nosymbols_find_line): Define. + (_bfd_generic_find_line): Don't define. + * libbfd.c (_bfd_generic_find_line): Delete. + * libcoff-in.h (coff_find_line): Define. + * libecoff.h (_bfd_ecoff_find_line): Define. + * mach-o.h (bfd_mach_o_find_line): Define. + * mmo.c (mmo_find_line): Define. + * nlm-target.h (nlm_find_line): Define. + * oasys.c (oasys_find_nearest_line, oasys_find_inliner_info): Delete. + (oasys_find_nearest_line, oasys_find_line, + oasys_find_inliner_info): Define. + * pef.c (bfd_pef_find_line): Define. + * plugin.c (bfd_plugin_find_line): Define. + * ppcboot.c (ppcboot_find_line): Define. + * som.c (som_find_line): Define. + * srec.c (srec_find_line): Define. + * tekhex.c (tekhex_find_line): Define. + * versados.c (versados_find_line): Define. + * vms-alpha.c (alpha_vms_find_line): Define. + * xsym.c (bfd_sym_find_line): Define. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2014-10-15 Tristan Gingold + + * version.m4: Bump version to 2.25.51 + * configure: Regenerate. + +2014-10-14 H.J. Lu + + * elf32-i386.c (elf_i386_convert_mov_to_lea): Skip if relocation + offset is less than 2. + * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. + +2014-10-14 Alan Modra + + PR 17453 + * libbfd.c (COERCE16, COERCE32, COERCE64): Use unsigned types. + (EIGHT_GAZILLION): Delete. + +2014-10-13 Alan Modra + + PR 17467 + * elf-eh-frame.c (ENSURE_NO_RELOCS): Don't stop at first NONE reloc. + (_bfd_elf_parse_eh_frame): When relocatable output, don't set + flags enabling conversion of CIEs and FDEs to use relative encoding. + (find_merged_cie): Similarly. + (_bfd_elf_write_section_eh_frame): Don't edit FDEs when + relocatable, except for CIE pointer. + * elflink.c (bfd_elf_reloc_symbol_deleted_p): Return true for + relocs against symbols in dropped comdat group sections. + (bfd_elf_discard_info): Do some eh_frame optimisation when + relocatable. + +2014-10-09 Jose E. Marchesi + + * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Handle + the hwcaps2 object attribute. + +2014-10-04 Alan Modra + + PR 17447 + * elf-bfd.h (struct eh_cie_fde): Comment re NULL u.fde.cie_inf. + * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Mark zero address + range FDEs for discarding. + (vma_compare): Sort on range after address. + (_bfd_elf_gc_mark_fdes): Test for NULL u.fde.cie_inf. + (_bfd_elf_discard_section_eh_frame): Likewise. Write "FDE" in + error message rather than "fde". + (_bfd_elf_write_section_eh_frame_hdr): Write "PC" and "FDE" in + error message. + +2014-09-29 H.J. Lu + + PR ld/17440 + * elf32-i386.c (elf_i386_fbsd_post_process_headers): Fix build + for OLD_FREEBSD_ABI_LABEL. + +2014-09-24 Markus Trippelsdorf + + PR 17422 + * plugin.c (try_claim): New function. Moved from + bfd_plugin_object_p. + (try_load_plugin): Pass through bfd. Add test. + (load_plugin): Pass through bfd. + (bfd_plugin_object_p): Move logic to try_claim. + +2014-09-23 Sterling Augustine + + * elf32-xtensa.c (is_resolvable_asm_expansion): for cross-section + call relaxation use furthermost addresses where call source and + destination can be to check whether it's in the range of a direct + call. + +2014-09-22 Alan Modra + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Don't return + false for overflow or overlapping FDEs. Give more detail in + error messages. + +2014-09-22 Andrew Bennett + + * elfxx-mips.c (mips_elf_calculate_relocation): Don't sign extend + the addend if relocations are RELA. + +2014-09-22 Kuan-Lin Chen + + * elf32-nds32.c (nds32_elf_ex9_build_hash_table, + nds32_elf_ex9_relocation_check): Synchronize the argument type. + +2014-09-19 Andreas Krebbel + + * elf32-s390.c: Don't replace R_390_TLS_LE32 with R_390_TLS_TPOFF + for PIE. + * elf64-s390.c: Don't replace R_390_TLS_LE64 with R_390_TLS_TPOFF + for PIE. + +2014-09-18 Jan Kratochvil + + PR gdb/17407 + * elfcode.h (bfd_from_remote_memory): Use SIZE for HIGH_OFFSET. + +2014-09-16 Terry Guo + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Return false if + failed to merge. + +2014-09-16 Kuan-Lin Chen + + * bfd-in2.h: Regenerate. + * elf32-nds32.c (nds32_elf_mkobject): Hook bfd_elf32_mkobject. + (nds32_elf_relax_section): Code refactoring. + (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2, + nds32_elf_relax_longcall3, nds32_elf_relax_longcall4, + nds32_elf_relax_longcall5, nds32_elf_relax_longcall6): Relax call + pattern. The first three is moved from nds32_elf_relax_section, + and the last three is new function. + (nds32_elf_relax_longjump1, nds32_elf_relax_longjump2, + nds32_elf_relax_longjump3, nds32_elf_relax_longjump4, + nds32_elf_relax_longjump5, nds32_elf_relax_longjump6, + nds32_elf_relax_longjump7): Relax condition branch pattern. The first + three is moved from nds32_elf_relax_section, and the last four + is new function. + (nds32_elf_relax_loadstore, nds32_elf_relax_lo12): Relax load-store + pattern and address setting pattern. + (nds32_elf_relax_piclo12, nds32_elf_relax_ptr, + nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff, + nds32_elf_relax_gotoff_suff): Relax pic pattern. + (nds32_elf_relax_letlslo12, nds32_elf_relax_letlsadd, + nds32_elf_relax_letlsls): Relax TLS pattern. + (nds32_relax_adjust_label): Adjust alignment and nop. + (nds32_elf_pick_relax): Choose relaxation optimization. + (nds32_elf_get_relocated_section_contents): New hook. + (nds32_elf_order_insn_times, nds32_elf_ex9_build_itable): Release ex9 + table 234th entry. + * elf32-nds32.h: Declare. + * libbfd.h: Regenerate. + * reloc.c: Add nds32 new relocations. + +2014-09-15 Chen Gang + + * dwarf2.c (find_abstract_instance_name): Use 'form' instead of + 'name' for the typo issue, which related with commit + 60d77146a249ae9b51d7ce98930cdbedb2cfa352. + +2014-09-15 Andrew Bennett + Matthew Fortune + + * aoutx.h (NAME (aout, machine_type)): Add mips32r6 and mips64r6. + * archures.c (bfd_architecture): Likewise. + * bfd-in2.h (bfd_architecture): Likewise. + (bfd_reloc_code_real): Add relocs BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3 and + BFD_RELOC_MIPS_19_PCREL_S2. + * cpu-mips.c (arch_info_struct): Add mips32r6 and mips64r6. + * elf32-mips.c: Define relocs R_MIPS_PC21_S2, R_MIPS_PC26_S2 + R_MIPS_PC18_S3, R_MIPS_PC19_S2, R_MIPS_PCHI16 and R_MIPS_PCLO16. + (mips_reloc_map): Add entries for BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and + BFD_RELOC_LO16_PCREL. + * elf64-mips.c: Define REL, and RELA relocations R_MIPS_PC21_S2, + R_MIPS_PC26_S2, R_MIPS_PC18_S3, R_MIPS_PC19_S2, R_MIPS_PCHI16 + and R_MIPS_PCLO16. + (mips_reloc_map): Add entries for BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and + BFD_RELOC_LO16_PCREL. + * elfn32-mips.c: Likewise. + * elfxx-mips.c (MIPSR6_P): New define. + (mipsr6_exec_plt_entry): New array. + (hi16_reloc_p): Add support for R_MIPS_PCHI16. + (lo16_reloc_p): Add support for R_MIPS_PCLO16. + (aligned_pcrel_reloc_p): New function. + (mips_elf_relocation_needs_la25_stub): Add support for relocs: + R_MIPS_PC21_S2 and R_MIPS_PC26_S2. + (mips_elf_calculate_relocation): Add support for relocs: + R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3, R_MIPS_PC19_S2, + R_MIPS_PCHI16 and R_MIPS_PCLO16. + (_bfd_elf_mips_mach): Add support for mips32r6 and mips64r6. + (mips_elf_add_lo16_rel_addend): Add support for R_MIPS_PCHI16. + (_bfd_mips_elf_check_relocs): Add support for relocs: + R_MIPS_PC21_S2 and R_MIPS_PC26_S2. + (_bfd_mips_elf_relocate_section): Add a check for unaligned + pc relative relocs. + (_bfd_mips_elf_finish_dynamic_symbol): Add support for MIPS r6 + plt entry. + (mips_set_isa_flags): Add support for mips32r6 and mips64r6. + (_bfd_mips_elf_print_private_bfd_data): Likewise. + (mips_32bit_flags_p): Add support for mips32r6. + * libbfd.h (bfd_reloc_code_real_names): Add entries for + BFD_RELOC_MIPS_21_PCREL_S2, BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3 and BFD_RELOC_MIPS_19_PCREL_S2. + * reloc.c: Document relocs BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3 and + BFD_RELOC_MIPS_19_PCREL_S2. + * config.bfd: Add mips*-img-elf* target triple. + +2014-09-12 Andrew Bennett + + * config.bfd: Add mips*-img-elf* target triple. + +2014-09-12 Alan Modra + + * elf-bfd.h (struct eh_frame_array_ent): Add "range". + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Stash address + range of FDEs to hdr_info->array. + (_bfd_elf_write_section_eh_frame_hdr): Report overflow in + .eh_frame_hdr entries, and overlapping FDEs. + +2014-09-10 Alan Modra + + * elf.c (assign_file_positions_except_relocs): Move section header + placement to.. + (_bfd_elf_assign_file_positions_for_relocs): ..here. Make static. + * elf-bfd.h (_bfd_elf_assign_file_positions_for_relocs): Delete. + * elflink.c (bfd_elf_final_link): Don't call above function. + +2014-08-30 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Fix off by one error. + +2014-08-29 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Report a different + error for calls via a toc adjusting stub without a nop. + +2014-08-29 Alan Modra + + * vms-alpha.c (alpha_vma_object_p): Don't return file_truncated + error. Remove redundant bfd_set_error. + +2014-08-29 Alan Modra + + * srec.c (srec_scan): Revert last change. Report an error for + S-records with less than the miniumum byte count. + +2014-08-28 H.J. Lu + + * srec.c (srec_scan): Return error for 0 size. + +2014-08-27 H.J. Lu + + PR ld/17306 + * elf32-i386.c (elf_i386_convert_mov_to_lea): Use bfd_is_abs_section + to check discarded input section. + * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. + +2014-08-27 H.J. Lu + + PR ld/17313 + * elflink.c (elf_link_add_object_symbols): Don't attach dynamic + sections to input from ld --just-symbols. + +2014-08-26 DJ Delorie + + * elf32-rl78.c (rl78_elf_relax_section): Disambiguate test for + relaxation type. + +2014-08-26 Jiong Wang + + * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Initialize non_got_ref + properly for MOVW_G0/1/2_NC and MOVW_G3. Reject them when linking + shared library. + (elfNN_aarch64_gc_sweep_hook): Add check on these relocs. + +2014-08-26 Nick Clifton + + * config.bfd: Fix typo in or1knd selection. + +2014-08-22 Kai Tietz + + PR binutils/11822 + * coffcode.h (coff_compute_section_file_positions): Keep + FileAlignment valid as set. + +2014-08-22 Alan Modra + + * elf-eh-frame.c (struct cie): Delete "output_sec" field. + (cie_eq, cie_compute_hash): Use output_section from cie_inf instead. + +2014-08-22 Alan Modra + + * elf-bfd.h (struct eh_frame_hdr_info): Delete merge_cies and + parsed_eh_frames. + (_bfd_elf_begin_eh_frame_parsing): Delete. + (_bfd_elf_end_eh_frame_parsing): Delete. + * elf-eh-frame.c (_bfd_elf_begin_eh_frame_parsing): Delete. + (_bfd_elf_end_eh_frame_parsing): Delete. + (_bfd_elf_parse_eh_frame): Don't test parsed_eh_frame. Test + !info->relocatable in place of merge_cies. + * elflink.c (bfd_elf_gc_sections, bfd_elf_discard_info): Adjust. + * elf64-ppc.c (glink_eh_frame_cie): Pad to multiple of 8. + (ppc64_elf_size_stubs): Likewise pad stub FDE. + (ppc64_elf_build_stubs): Move code setting glink .eh_frame to.. + (ppc64_elf_size_stubs): ..here and.. + (ppc64_elf_finish_dynamic_sections): ..here. + +2014-08-21 Maciej W. Rozycki + + * elf64-ppc.h (ppc64_elf_set_toc): Fix indentation. + +2014-08-21 Tony Wang + + * elf32-arm.c (elf32_arm_final_link_relocate): Implement + the veneer routine for R_ARM_THM_JUMP19. + (arm_type_of_stub): Add conditional clause for R_ARM_THM_JUMP19 + (elf32_arm_size_stub): Ditto. + +2014-08-20 Roland McGrath + + PR ld/17277 + * elf32-arm.c (elf32_arm_check_relocs): Increment P->pc_count for + all reloc types with pc_relative set in the howto, not just for + R_ARM_REL32 and R_ARM_REL32_NOI. + (allocate_dynrelocs_for_symbol): Update comment. + (elf32_arm_gc_sweep_hook): For all reloc types with pc_relative + set in the howto, set call_reloc_p and may_need_local_target_p but + not may_become_dynamic_p; not only for R_ARM_REL32 and R_ARM_REL32_NOI. + (elf32_arm_check_relocs): Likewise. + +2014-08-20 Will Newton + + * config.bfd: Default armeb-*-eabi* to big endian. + +2014-08-19 Alan Modra + + * configure: Regenerate. + +2014-08-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't attempt to + use dynrelocs for ifunc. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Similarly. + +2014-08-18 Alan Modra + + PR 17287 + * elflink.c (on_needed_list): Only consider libraries that have + been loaded. + +2014-08-18 Alan Modra + + * elflink.c (bfd_elf_discard_info): Return int error status. + * stabs.c (_bfd_discard_section_stabs): Comment typo fix. + * bfd-in.h (bfd_elf_discard_info): Updata prototype. + * bfd-in2.h: Regenerate. + +2014-08-14 Alan Modra + + * peXXigen.c (pe_print_reloc): Protect against access past end + of .reloc section. + +2014-08-14 Alan Modra + + PR 16563 + * elflink.c (bfd_elf_discard_info): Process .eh_frame and .stab + in the order they are mapped to output sections. + +2014-08-14 Alan Modra + + * configure.ac: Delete redundant plugin related checks. + * configure: Regenerate. + +2014-08-13 Stefan Kristiansson + + * elf32-or1k.c (or1k_elf_relocate_section, or1k_elf_check_relocs, + allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL + and SYMBOLIC_BIND. + +2014-08-12 Alan Modra + + * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Only call "notice" + here when not calling the generic add_symbol function. Formatting. + Correct handling of indirect symbols. Update notice call. + * elflink.c (_bfd_elf_notice_as_needed): Update notice call. + * linker.c (_bfd_generic_link_add_one_symbol): Create indirect + symbols early. Update notice call. Add comments regarding weak + symbols vs. indirect. + +2014-08-12 Alan Modra + + PR ld/16746 + * linker.c (_bfd_generic_link_add_one_symbol ): Handle + !lto_plugin_active. + +2014-08-07 Chen Gang + + * coff-ppc.c (coff_ppc_relocate_section): Ensure local symbols are + zero terminated. + +2014-08-07 H.J. Lu + Alan Modra + + PR ld/16746 + * linker.c (_bfd_generic_link_add_one_symbol): Don't issue a + warning for references in LTO IR to warning symbols. + +2014-08-07 Alan Modra + + * linker.c (WARN, CWARN): Collapse these states to WARN. + (_bfd_generic_link_add_one_symbol): Use old CWARN case for + new WARN. + +2014-08-05 Doug Evans + + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + +2014-08-05 Maciej W. Rozycki + + * elfxx-mips.c (_bfd_mips_elf_discard_info): Set section's + rawsize if changing size. + +2014-08-05 Alan Modra + + PR ld/17226 + * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Typo fix. + +2014-08-05 Alan Modra + + * linker.c (generic_link_check_archive_element): Move handling + of command link -u symbols with a common symbol def to the + code handling non-common symbols so that archive element symbols + are loaded. Use generic_link_add_object_symbols. + +2014-08-05 Alan Modra + + PR 13557 + * linker.c (struct archive_list, struct archive_hash_entry, + struct archive_hash_table, archive_hash_newfunc, + archive_hash_table_init, archive_hash_lookup, archive_hash_allocate, + archive_hash_table_free): Delete. + (_bfd_generic_link_add_archive_symbols): Add h and name params to + checkfn. Rewrite using a straight-forward scan over archive map. + (generic_link_check_archive_element_no_collect, + generic_link_check_archive_element_collect, + generic_link_check_archive_element): Add h and name params. + * aoutx.h (aout_link_check_archive_element): Likewise. + * pdp11.c (aout_link_check_archive_element): Likewise. + * xcofflink.c (xcoff_link_check_archive_element): Likewise. + * cofflink.c (coff_link_check_archive_element): Likewise. Don't + scan symbols, simply add archive element whenever h is undefined. + (coff_link_check_ar_symbols): Delete. + * ecoff.c (read_ext_syms_and_strs): Delete. + (reread_ext_syms_and_strs): Delete. + (ecoff_link_check_archive_element): Add h and name param. Don't + scan symbols, simply add based on h. Use ecoff_link_add_object_symbols. + * elflink.c (elf_link_is_defined_archive_symbol): Don't test + archive_pass. + (elf_link_add_archive_symbols): Delete "defined" array, merge + functionality into "included". Make "included" a char array. Don't + set or test archive_pass. + * libbfd-in.h (_bfd_generic_link_add_archive_symbols): Update. + * libbfd.h: Regenerate. + +2014-08-01 Takashi Yoshii + + PR 10373 + * elf32-sh.c (sh_elf_relax_section): Add jmp to bra relaxing. + +2014-07-29 Matthew Fortune + + * elfxx-mips.c (ABI_O32_P, MIPS_ELF_ABIFLAGS_SECTION_NAME_P): New macro. + (mips_elf_obj_tdata): Add abiflags and abiflags_valid fields. + (bfd_mips_elf_swap_abiflags_v0_in): New function. + (bfd_mips_elf_swap_abiflags_v0_out): Likewise. + (_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_ABIFLAGS. + (_bfd_mips_elf_fake_sections): Likewise. + (_bfd_mips_elf_always_size_sections): Handle .MIPS.abiflags. + (_bfd_mips_elf_additional_program_headers): Account for new + PT_MIPS_ABIFLAGS program header. + (_bfd_mips_elf_modify_segment_map): Create PT_MIPS_ABIFLAGS segment and + associate with .MIPS.abiflags. + (_bfd_mips_elf_gc_mark_extra_sections): New function. + (bfd_mips_isa_ext, update_mips_abiflags_isa): New static function. + (infer_mips_abiflags): Likewise. + (_bfd_mips_elf_final_link): Handle .MIPS.abiflags. + (mips_32bit_flags_p): Moved higher. + (mips_elf_merge_obj_attributes, _bfd_mips_fp_abi_string): Error + checking for FP ABIs. + (_bfd_mips_elf_merge_private_bfd_data): Restructure and add abiflags + checks. Check EF_MIPS_FP64 flag consistency. + (print_mips_ases, print_mips_isa_ext): New static function. + (print_mips_fp_abi_value, get_mips_reg_size): Likewise. + (_bfd_mips_elf_print_private_bfd_data): Display abiflags data. + (_bfd_mips_post_process_headers): Set EI_ABIVERSION = 3 for + Val_GNU_MIPS_ABI_FP_64 or Val_GNU_MIPS_ABI_FP_64A. + * elfxx-mips.h (_bfd_mips_elf_gc_mark_extra_sections): New prototype. + * elf32-mips.c (elf_backend_gc_mark_extra_sections): Implement. + * elfn32-mips.c (elf_backend_gc_mark_extra_sections): Implement. + * elf64-mips.c (elf_backend_gc_mark_extra_sections): Implement. + +2014-07-28 Alan Modra + + PR 13227 + * archive.c (_bfd_compute_and_write_armap): Warn on adding + __gnu_lto_slim to armap. + * linker.c (_bfd_generic_link_add_one_symbol): Warn on adding + __gnu_lto_slim to linker hash table. + +2014-07-27 Anthony Green + + * config.bfd: Add moxie-*-moxiebox*. + +2014-07-21 Joel Sherrill + + Add or reactivate or1k-*-rtems* + * config.bfd (or1k-*-rtems*): Reactivate. + +2014-07-16 H.J. Lu + + * elf32-i386.c (elf_i386_plt_sym_val): Match PLT entry only for + ELFOSABI_GNU input. + * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. + (elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise. + +2014-07-16 H.J. Lu + + PR binutils/17154 + * elf32-i386.c (elf_i386_plt_sym_val): Only match R_*_JUMP_SLOT + and R_*_IRELATIVE relocation offset with PLT entry. + * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. + (elf_x86_64_plt_sym_val_offset_plt_bnd): New. + (elf_x86_64_get_synthetic_symtab): Use it. + +2014-07-15 H.J. Lu + + PR ld/17057 + * elf32-i386.c (elf_i386_compute_jump_table_size): Replace + next_tls_desc_index with elf.srelplt->reloc_count. + +2014-07-15 Alan Modra + + * cache.c (cache_bread_1): Don't return -1 when fread returns + a positive value. + +2014-07-15 Alan Modra + + * elflink.c (elf_merge_st_other): Update comments. Simplify + visibility handling. Make isym const. Move code modifying + isym->st_other for --exclude-libs to.. + (elf_link_add_object_symbols): ..here. + +2014-07-11 Maks Naumov + + PR 17141 + * elf.c (_bfd_elf_strtab_add): Check strtab name for failure. + +2014-07-08 Nick Clifton + + PR ld/17110 + * elf32-sh.c (sh_elf_osec_to_segment): Do not look for output + segments in input bfds. + +2014-07-08 Will Newton + + * elf32-arm.c (ELF_MAXPAGESIZE): Increase the default + value to 64kB and remove custom setting for NaCl. + +2014-07-08 Alan Modra + + * elflink.c (_bfd_elf_copy_link_hash_symbol_type): Copy st_other + bits from source to dest. + * linker.c (_bfd_generic_copy_link_hash_symbol_type): Update comment. + * targets.c (struct bfd_target <_bfd_copy_link_hash_symbol_type>): + Likewise. + * bfd-in2.h: Regenerate. + +2014-07-08 Jiong Wang + + * elfnn-aarch64.c (elf_backend_rela_normal): Set to 1. + (elfNN_aarch64_relocate_section): Remove duplicated addend adjustment + when info->relocatable be true. + +2014-07-07 Barney Stratford + + * elf32-avr.c: Handle R_AVR_PORT5 and R_AVR_PORT6. + * reloc.c: Add BFD_RELOC_AVR_PORT5 and BFD_RELOC_AVR_PORT6. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2014-07-04 Alan Modra + + * Makefile.am: Update "configure.in" comments. + * PORTING: Likewise. + * aoutx.h: Likewise. + * configure.host: Likewise. + * doc/bfdint.texi: Likewise. + * targets.c: Likewise. + * warning.m4: Likewise. + * Makefile.in: Regenerate. + +2014-07-04 Alan Modra + + * configure.ac: Rename from configure.in. + * Makefile.in: Regenerate. + * config.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2014-07-04 Alan Modra + + * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove configure.in. + * Makefile.in: Regenerate. + +2014-07-04 Alan Modra + + * version.m4: New file. + * configure.in: Include version.m4. + (AC_INIT): Update. + * Makefile.am (RELEASE): Delete. + (bfdver.h): Depend on development.sh, use instead of RELEASE. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2014-07-02 Alan Modra + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Clear + pointer_equality_needed when !readonly_dynrelocs. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. + +2014-07-02 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Set DF_STATIC_TLS for PIEs too. + * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. + +2014-07-01 Alan Modra + + * bfd.c (struct bfd): Reorganise for better packing. Delete + "ifd" field. Make "format", "direction" and "flags" bitfields. + (HAS_LOAD_PAGE): Delete, renumber following flags. + * bfd-in2.h: Regenerate. + * coff-tic4x.c: Remove HAS_LOAD_PAGE from extra flags in target vecs. + +2014-07-01 Alan Modra + + * elf64-ppc.c (ppc_stub_type): Add ppc_stub_global_entry. + (struct ppc_link_hash_table): Increase size of stub_count array. + (build_global_entry_stubs): Emit symbol on global entry stub. + (ppc64_elf_build_stubs): NULL check htab->brlt. Add global entry + stub stats. + +2014-07-01 Alan Modra + + * elf64-ppc.c (abiversion, set_abiversion): Move earlier. + (ppc64_elf_branch_reloc): Adjust addend for ELFv2 local offset. + (ppc64_elf_set_toc): Set ".TOC." symbol value when using + generic linker. + (ppc64_elf_relocate_section): Disable ELFv2 function entry + optimisation when --traditional-format. + +2014-07-01 Barney Stratford + Senthil Kumar Selvaraj + Pitchumani Sivanupandi + Soundararajan + + * archures.c: Add avrtiny architecture for avr target. + * cpu-avr.c (arch_info_struct): Add avrtiny arch info. + * elf32-avr.c (elf_avr_howto_table): New relocation R_AVR_LDS_STS_16 + added for 16 bit LDS/STS instruction of avrtiny arch. + (avr_reloc_map): Reloc R_AVR_LDS_STS_16 is mapped to + BFD_RELOC_AVR_LDS_STS_16. + (bfd_elf_avr_final_write_processing): Select machine number + avrtiny arch. + (elf32_avr_object_p): Set machine number for avrtiny arch. + * reloc.c: Add documentation for BFD_RELOC_AVR_LDS_STS_16 reloc. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2014-06-26 Nick Clifton + + PR binutils/16949 + * dwarf2.c (is_str_attr): New function. + (find_abstract_instance_name): Use it to determine when an + attribute has a string value. + +2014-06-24 Alan Modra + + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Arrange to keep + .sdata/.sdata2 when _SDA_BASE_/_SDA2_BASE_ should be output + for --emit-relocs. + +2014-06-21 Philippe De Muyter + + * targets.c (_bfd_target_vector): Add missing #ifdef BFD64 for + a number of targets. + +2014-06-20 Kyle McMartin + + * elf32-arm.c (elf32_arm_check_relocs): Set DF_STATIC_TLS when + emitting initial-exec relocs when not linking an executable. + +2014-06-16 Will Newton + + * elf32-arm.c (elf32_arm_allocate_plt_entry): Increment + htab->next_tls_desc_index in the non-IPLT case. + Calculate GOT offset correctly for the non-IPLT case. + (allocate_dynrelocs_for_symbol): Don't increment + htab->next_tls_desc_index here. + +2014-06-16 Alan Modra + + * elf32-vax.c (elf_vax_size_dynamic_sections): Clear linker + created sections. + +2014-06-13 Omair Javaid + + * elfxx-aarch64.c (stdarg.h): Include. + (string.h): Include. + (_bfd_aarch64_elf_grok_prstatus): Updated. + (_bfd_aarch64_elf_grok_psinfo): New function. + (_bfd_aarch64_elf_write_core_note): New function. + * elfxx-aarch64.h (elf_backend_grok_psinfo): Define. + (elf_backend_write_core_note): Define. + +2014-06-13 Alan Modra + + * archive.c: Include bfdlink.h. + (_bfd_archive_close_and_cleanup): Call linker hash_table_free. + * bfd.c (struct bfd): Add is_linker_output field. + * elf-bfd.h (_bfd_elf_link_hash_table_free): Update prototype. + * linker.c (_bfd_link_hash_table_init): Set up hash_table_free, + link.hash and is_linker_output. + (_bfd_generic_link_hash_table_free): Replace bfd_link_hash_table* + param with bfd*. Assert is_linker_output and link.hash, and + clear them before exit. + * elf-m10300.c (elf32_mn10300_link_hash_table_free): Replace + bfd_link_hash_table* param with bfd*. Hack is_linker_output + and link.hash so we can free two linker hash tables. + (elf32_mn10300_link_hash_table_create): Create static_hash_table + first. Clean up on errors. Set hash_table_free pointer. + * elf32-arm.c (elf32_arm_link_hash_table_free): Replace + bfd_link_hash_table* param with bfd*. + (elf32_arm_link_hash_table_create): Clean up on errors. Set + hash_table_free pointer. + * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc1x.c, + * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf32-xgate.c, + * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c, * elflink.c, + * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, + * xcofflink.c: Similarly. + * simple.c (bfd_simple_get_relocated_section_contents): Save and + clear link.next before creating linker hash table. Clean up on + errors, and restore link.next on exit. + * elf32-m68hc1x.h (m68hc11_elf_bfd_link_hash_table_free): Delete. + * elf32-xgate.h (xgate_elf_bfd_link_hash_table_free): Delete. + * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table_free): Delete. + * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Delete. + * hash.c (bfd_hash_table_init_n): Free table on error. + * libbfd-in.h (_bfd_generic_link_hash_table_free): Update proto. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2014-06-13 Alan Modra + + PR 17047 + * targets.c (BFD_JUMP_TABLE): Delete NAME##_bfd_link_hash_table_free. + (struct bfd_target <_bfd_link_hash_table_free>): Delete. + * bfd.c (bfd_link_hash_table_free): Don't define. + * aout-adobe.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c, + * coff64-rs6000.c, * coffcode.h, * elf-m10300.c, * elf32-arm.c, + * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc11.c, + * elf32-m68hc12.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, + * elf32-sparc.c, * elf32-xgate.c, * elf64-ia64-vms.c, * elf64-ppc.c, + * elf64-sparc.c, * elf64-x86-64.c, * elfnn-aarch64.c, * elfnn-ia64.c, + * elfxx-target.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, + * libbfd-in.h, * libecoff.h, * mach-o-target.c, * mmo.c, + * nlm-target.h, * oasys.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, + * srec.c, * tekhex.c, * verilog.c, * versados.c, * vms-alpha.c, + * xsym.c: Don't define various link_hash_table_free defines, and + remove from bfd_target vars. Temporarily reference some of the + target link_hash_table_free functions to avoid warnings. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2014-06-13 Alan Modra + + * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c, + * elf32-i386.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-metag.c, + * elf32-nios2.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c, + * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, * xcofflink.c: + Move link_hash_table_free functions before their corresponding + link_hash_table_create functions. + +2014-06-13 Alan Modra + + * bfd.c (struct bfd): Replace link_next with a union. + * aoutx.h, * bfd.c, * coff-ppc.c, * coff-rs6000.c, * cofflink.c, + * ecoff.c, * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, + * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c, + * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-metag.c, + * elf32-microblaze.c, * elf32-nds32.c, * elf32-nios2.c, + * elf32-or1k.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c, + * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, + * elf32-tic6x.c, * elf32-tilepro.c, * elf32-xstormy16.c, + * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, + * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-x86-64.c, + * elflink.c, * elfnn-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, + * elfxx-tilegx.c, * linker.c, * pdp11.c, * peXXigen.c, * simple.c, + * sunos.c, * vms-alpha.c, * xcofflink.c: Update for above. + * bfd-in2.h: Regenerate. + +2014-06-11 Alan Modra + + * linker.c (unwrap_hash_lookup): Add missing parens. + +2014-06-11 Kai Tietz + + * libcoff-in.h (coff_tdata): Make relocbase member unsigned. + * libcoff.h: Regenerated. + +2014-06-10 Alan Modra + + PR ld/16910 + * linker.c (unwrap_hash_lookup): New function. + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Call unwrap_hash_lookup. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m32c.c (m32c_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. + * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. + * elf32-spu.c (spu_elf_relocate_section): Likewise. + * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. + +2014-06-07 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Treat field of cmpli + insn as a bitfield; Use complain_overflow_bitfield. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + +2014-06-05 Joel Brobecker + + * development.sh: New file. + * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh. + Make -Werror the default with GCC only if DEVELOPMENT is true. + * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add + $(srcdir)/development.sh. + * Makefile.in, configure: Regenerate. + +2014-06-04 Will Newton + + * elfnn-aarch64.c (tpoff_base): Make test of tls_sec + being non-NULL into an assert. + (elfNN_aarch64_tls_relax): Remove unused code. + +2014-06-03 DJ Delorie + + * elf32-rx.c (rx_table_map): Use BFD_VMA_FMT for portability. + +2014-06-03 Nick Clifton + + PR ld/16807 + * peXXigen.c (rsrc_process_section): Page align the new contents + befgore writing out. + +2014-06-03 Alan Modra + + * elf64-ppc.c (ADDIS_R12_R2): Define. + (build_plt_stub): Support fusion on ELFv2 stub. + (ppc_build_one_stub): Likewise for plt branch stubs. + +2014-05-28 Alan Modra + + * elf32-rx.c (rx_table_map): Delete set but not used variables. + +2014-05-28 Tristan Gingold + + * dwarf2.c (lookup_address_in_function_table): Add best_fit_len + to keep the length of the best fit range. + (lookup_symbol_in_function_table, info_hash_lookup_funcinfo): + Likewise. + +2014-05-27 DJ Delorie + + * elf32-rx.c (get_symbol_value_maybe): New. + (rx_elf_relocate_section): If we find a reloc against + $tableentry$default$, redirect it to the appropriate + $tableentry$$. + (RX_Table_Info): New. + (rx_table_find): New. Check all tables and SEC_KEEP all sections + with table parts in them. + (rx_check_directives): New. + (rx_table_map_2): New. + (rx_table_map): New. + (rx_additional_link_map_text): New. Called to dump tables to the + map file. + * elf32-rx.h: New. + +2014-05-20 DJ Delorie + + * elf32-msp430.c (msp430_elf_relax_adjust_locals): Avoid overflow. + +2014-05-20 Alan Modra + + PR 16952 + * elf32-ppc.c (ppc_elf_create_linker_section): Move earlier. + Remove redundant setting of htab->elf.dynobj. Don't align. + Define .sdata symbols using _bfd_elf_define_linkage_sym. + (ppc_elf_create_glink): Call ppc_elf_create_linker_section. + (create_sdata_sym): Delete. + (elf_allocate_pointer_linker_section): Rename from + elf_create_pointer_linker_section. Align section. + (ppc_elf_check_relocs): Don't call ppc_elf_creat_linker_section + directly here, or create_sdata_sym. Set ref_regular on _SDA_BASE_ + and _SDA2_BASE_. + (ppc_elf_size_dynamic_sections): Remove ATTRIBUTE_UNUSED on param. + Remove unnecessary tests on _SDA_BASE_ sym. + (maybe_strip_sdasym, ppc_elf_maybe_strip_sdata_syms): New functions. + (ppc_elf_relocate_section): Tighten SDA reloc symbol section checks. + * elf32-ppc.h (ppc_elf_set_sdata_syms): Delete. + (ppc_elf_maybe_strip_sdata_syms): Declare. + +2014-05-16 Ryan Mansfield + + * config.bfd: Move QNX target_cflags from arm-*-netbsd* to arm-*-nto*. + +2014-05-16 Jon Turney + + * peXXigen.c (pe_print_debugdata): Don't interpret debug directory + in a section with no contents. + (is_vma_in_section, find_section_by_vma): New functions. + (_bfd_XX_bfd_copy_private_bfd_data_common): Recalculate file + offsets in the debug directory. + (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record): + Byte-swap GUID from little-endian to big-endian order for + consistent and conventional display. + +2014-05-16 Kaushik Phata + + * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if + 64-bit doubles objects mix with 32-bit doubles objects. + (rl78_elf_print_private_bfd_data): Describe 64-bit doubles flag. + +2014-05-08 Hans-Peter Nilsson + + * mmo.c: Update URLs in documentation comments. + +2014-05-02 Volodymyr Arbatov + David Weatherford + Max Filippov + + * elf32-xtensa.c (relax_section): treat R_XTENSA_DIFF* relocations as + signed. + +2014-05-07 Andreas Tobler + + * config.bfd: Add proper arm config for *-*-freebsd*. + +2014-05-07 Andrew Bennett + + * aoutx.h (NAME (aout, machine_type)): Add mips32r3, mips64r3, + mips32r5 and mips64r5. + * archures.c (bfd_architecture): Likewise. + * bfd-in2.h (bfd_architecture): Likewise. + * cpu-mips.c (arch_info_struct): Likewise. + * elfxx-mips.c (mips_set_isa_flags): Likewise. + +2014-05-06 Richard Sandiford + + * elfxx-mips.h (elfxx-mips.h): Declare. + * elfxx-mips.c (mips_elf_merge_obj_attributes): Use it to report + Tag_GNU_MIPS_ABI_FP mismatches. + (_bfd_mips_fp_abi_string): New function. + +2014-05-02 Alan Modra + + * targets.c: Sort bfd_target vectors somewhat alphabetically. + * configure.in: Likewise. + * configure: Regenerate. + +2014-05-02 Alan Modra + + * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-ns32k.c, + * aout-sparcle.c, * aout0.c, * aoutx.h, * armnetbsd.c, * bout.c, + * cf-i386lynx.c, * cf-sparclynx.c, * cisco-core.c, * coff-alpha.c, + * coff-apollo.c, * coff-arm.c, * coff-aux.c, * coff-go32.c, + * coff-h8300.c, * coff-h8500.c, * coff-i386.c, * coff-i860.c, + * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mips.c, + * coff-rs6000.c, * coff-sh.c, * coff-sparc.c, * coff-stgo32.c, + * coff-svm68k.c, * coff-tic80.c, * coff-u68k.c, * coff-w65.c, + * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, + * coff64-rs6000.c, * config.bfd, * configure.com, * configure.in, + * demo64.c, * elf-m10200.c, * elf-m10300.c, * elf32-am33lin.c, + * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, + * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, + * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, + * elf32-fr30.c, * elf32-frv.c, * elf32-gen.c, * elf32-h8300.c, + * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-i860.c, + * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, + * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, + * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, + * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, + * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nios2.c, + * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, + * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-sh-symbian.c, + * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, + * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-v850.c, + * elf32-vax.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c, + * elf32-xtensa.c, * elf64-alpha.c, * elf64-gen.c, * elf64-hppa.c, + * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, + * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, + * elf64-x86-64.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, + * epoc-pe-arm.c, * epoc-pei-arm.c, * hp300bsd.c, * hp300hpux.c, + * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386bsd.c, + * i386dynix.c, * i386freebsd.c, * i386linux.c, * i386lynx.c, + * i386mach3.c, * i386msdos.c, * i386netbsd.c, * i386os9k.c, + * irix-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, + * m88kmach3.c, * m88kopenbsd.c, * mach-o-i386.c, * mach-o-x86-64.c, + * makefile.vms, * mipsbsd.c, * mmo.c, * netbsd-core.c, * newsos3.c, + * nlm32-alpha.c, * nlm32-i386.c, * nlm32-ppc.c, * nlm32-sparc.c, + * ns32knetbsd.c, * osf-core.c, * pc532-mach.c, * pe-arm-wince.c, + * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-ppc.c, + * pe-sh.c, * pe-x86_64.c, * pei-arm-wince.c, * pei-arm.c, + * pei-i386.c, * pei-ia64.c, * pei-mcore.c, * pei-mips.c, * pei-ppc.c, + * pei-sh.c, * pei-x86_64.c, * ppcboot.c, * ptrace-core.c, * riscix.c, + * sco5-core.c, * som.c, * sparclinux.c, * sparclynx.c, + * sparcnetbsd.c, * sunos.c, * targets.c, * trad-core.c, + * vax1knetbsd.c, * vaxbsd.c, * vaxnetbsd.c, * versados.c, + * vms-alpha.c, * vms-lib.c: Rename bfd targets to + ____vec. Adjust associated MY macros + on aout targets. + * configure: Regenerate. + +2014-05-01 Hans-Peter Nilsson + + * mmo.c (mmo File layout documentation): Add note about low bits + of address. + (mmo_write_chunk): When handling data remainder, assert that + previous remaining data is flushed. + (mmo_write_loc_chunk): Only look for trailing and leading zeros + when dealing with an aligned VMA and for aligned lengths. Don't skip + the last 32-bit-word of zeros. + (mmo_write_loc_chunk): Emit an error if the VMA is not aligned. + (mmo_scan) : Move re-alignment of vma before + emitting data, not after updating it. + : Call mmo_decide_section with aligned vma. + +2014-04-30 Nick Clifton + + * compress.c (bfd_is_section_compressed): When checking the + .debug_str section, also check the fifth byte in the section is + not part of a string. + +2014-04-30 Alan Modra + + * elf-eh-frame.c (struct cie.personality): Replace val with sym. + (find_merged_cie): Identify personality functions by (bfd_id,index) + pair when a local sym is used. + +2014-04-29 Christian Svensson + + * elf32-or1k.c: Fix a bug where non-TLS relocations would be forced + into .rela.got if it contained TLS relocations as well. + +2014-04-28 Nick Clifton + + PR ld/16821 + * peXXigen.c (_bfd_XXi_swap_sym_out): Rework fix to avoid compile + time warning. + +2014-04-26 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + * configure: Regenerate. + +2014-04-25 Nick Clifton + + PR ld/16821 + * peXXigen.c (_bfd_XXi_swap_sym_out): Another fix for building on + a 342-bit host. This time for older versions of gcc. + +2014-04-24 Nick Clifton + + * peXXigen.c (rsrc_print_section): Fix compile time warning for + 32-bit hosts. + +2014-04-24 Alan Modra + + PR 16867 + * dwarf2.c: Formatting. + (struct dwarf2_debug): Make adjusted_section_count signed. + (unset_sections): Make i signed. + (set_debug_vma): New function. + (place_sections): Handle separate debug object file. Set VMA + on debug sections, even if they have an output section. Also + set VMA on zero size sections, and non-load but alloc sections. + Set adjusted_section_count to -1 when no section adjustment. + Malloc adjusted_sections. Don't double last_vma. Transfer + alloc section VMAs to separate debug file. + (_bfd_dwarf2_cleanup_debug_info): Free adjusted_sections. + (_bfd_dwarf2_slurp_debug_info): Add do_place parameter. Drop + test on symbols being the same before using old stash. Read + and use separate debug file symbols. Call place_sections. + (find_line): Don't call place_sections here. + * libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Update proto. + * libbfd.h: Regenerate. + * mach-o.c (bfd_mach_o_find_nearest_line): Adjust + _bfd_dwarf2_slurp_debug_info call. + * simple.c (simple_save_output_info): Clarify comment. + +2014-04-24 Nick Clifton + + PR ld/16807 + * peXXigen.c (struct rsrc_regions): New structure. + (rsrc_print_resource_directory): Use new structure. Include + offset of directory in listing. + (rsrc_print_resource_entry): Likewise. + (rsrc_print_section): Likewise. + (rsrc_count_entries): Do not increment sizeof_strings or + sizeof_leaves. + (rsrc_count_directory): Do not increment sizeof_tables. + (rsrc_compute_region_sizes): New function. + (rsrc_write_leaf): Maintain 8-byte alignment for resource data. + (rsrc_process_section): Compute size of regions after merging + entries. + +2014-04-23 Alan Modra + + PR ld/16787 + * dwarf2.c (struct dwarf2_debug): Add sec_vma field. + (place_sections): Do not modify VMA of sections when called from + linker after sections have been placed in output sections. Short + circuit single section case. + (save_section_vma, section_vma_same): New functions. + (_bfd_dwarf2_slurp_debug_info): Throw away stash if section VMAs + change. + * reloc.c (bfd_perform_relocation): Do not modify reloc addend + when non-relocatable. + +2014-04-22 Nick Clifton + + PR ld/16821 + * peXXigen.c (_bfd_XXi_swap_sym_out): Fix for 32-bit hosts. + +2014-04-22 Christian Svensson + + * Makefile.am: Remove openrisc and or32 support. Add support for or1k. + * archures.c: Likewise. + * coffcode.h: Likewise. + * config.bfd: Likewise. + * configure.in: Likewise. + * reloc.c: Likewise. + * targets.c: Likewise. + * cpu-or1k.c: New file. + * elf32-or1k.c: New file. + * coff-or32.c: Delete. + * cpu-openrisc.c: Delete. + * cpu-or32.c: Delete. + * elf32-openrisc.c: Delete. + * elf32-or32.c: Delete. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + +2014-04-22 Yuanhui Zhang + + PR ld/16821 + * peXXigen.c (abs_finder): Fix for 32-bit host builds. + +2014-04-22 Will Newton + + * elfnn-aarch64.c (elfNN_aarch64_section_flags): Remove + function. (elf_backend_section_flags): Remove define. + +2014-04-21 Richard Henderson + + * elf64-alpha.c (elf64_alpha_size_got_sections): New may_merge + parameter; honor it and disable got merging when false. + (elf64_alpha_relax_got_load): Do not relax to GPREL relocs during + the first pass of relaxation. + (elf64_alpha_relax_with_lituse): Likewise. Move relaxed relocs to + the end of the LITERAL+LITUSE chain. + (elf64_alpha_relax_section): Only process LITERAL relocs during the + second pass of relaxation. + + * configure.ac (use_secureplt): Enable by default. + * configure: Rebuild. + +2014-04-18 Tristan Gingold + + * mach-o.h (bfd_mach_o_dyld_info_command): Add rebase_content, + bind_content, weak_bind_content, lazy_bind_content, + export_content. + (bfd_mach_o_load_command): Add comments, add next field. + (mach_o_data_struct): Replace commands field by first_command + and last_command. + * mach-o.c (bfd_mach_o_append_command): New function. + (bfd_mach_o_bfd_copy_private_symbol_data): Add blank lines. + (bfd_mach_o_bfd_copy_private_section_data): Check flavour, + copy fields. + (bfd_mach_o_bfd_copy_private_header_data): Copy load commands. + (bfd_mach_o_pad4, bfd_mach_o_pad_command): New functions. + (bfd_mach_o_write_thread): Use macro instead of literal. + (bfd_mach_o_write_dylinker, bfd_mach_o_write_dylib) + (bfd_mach_o_write_main, bfd_mach_o_write_dyld_info): New + functions. + (bfd_mach_o_write_symtab_content): New function (extracted + from bfd_mach_o_write_symtab). + (bfd_mach_o_write_symtab): Split. + (bfd_mach_o_count_indirect_symbols): Move + (bfd_mach_o_build_dysymtab): Remove layout code. + (bfd_mach_o_write_contents): Rewritten to build commands in order. + (bfd_mach_o_count_sections_for_seg): Remove. + (bfd_mach_o_build_obj_seg_command): New function (extracted from + bfd_mach_o_build_seg_command). + (bfd_mach_o_build_exec_seg_command): New function. + (bfd_mach_o_build_dysymtab_command): Remove. + (bfd_mach_o_layout_commands): New function. + (bfd_mach_o_init_segment): New function. + (bfd_mach_o_build_commands): Major rework to handle non-object + files. + (bfd_mach_o_alloc_and_read, bfd_mach_o_read_dyld_content): New + function. + (bfd_mach_o_read_dyld_info): Clear content fields. + (bfd_mach_o_read_segment): Adjust call. + (bfd_mach_o_flatten_sections): Adjust as now load commands are + chained. + (bfd_mach_o_scan_start_address, bfd_mach_o_scan) + (bfd_mach_o_mkobject_init, bfd_mach_o_get_base_address) + (bfd_mach_o_lookup_command, bfd_mach_o_core_fetch_environment): + Likewise. + +2014-04-18 Tristan Gingold + + * mach-o-target.c (bfd_mach_o_bfd_copy_private_header_data): + Define instead of bfd_mach_o_bfd_copy_private_bfd_data. + * mach-o.c (bfd_mach_o_bfd_copy_private_bfd_data): Rename. + * mach-o.h (bfd_mach_o_bfd_copy_private_bfd_data): Likewise. + +2014-04-18 Tristan Gingold + + * mach-o.h (bfd_mach_o_dylinker_command) + (bfd_mach_o_dylib_command, bfd_mach_o_fvmlib_command): Remove + name_len field. + * mach-o.c (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib) + (bfd_mach_o_read_fvmlib): Adjust after name_len removal. + +2014-04-18 Tristan Gingold + + * mach-o.h (bfd_mach_o_backend_data): Add page_size field. + * mach-o-target.c: Check TARGET_PAGESIZE is defined. + (TARGET_NAME_BACKEND): Add TARGET_PAGESIZE. + * mach-o.c (TARGET_PAGESIZE): Define and undefined for + each targets declared. + * mach-o-x86-64.c (TARGET_PAGESIZE): Define. + * mach-o-i386.c (TARGET_PAGESIZE): Define. + +2014-04-18 Tristan Gingold + + * mach-o.c (bfd_mach_o_write_thread) + (bfd_mach_o_write_section_32, bfd_mach_o_write_section_64) + (bfd_mach_o_write_segment_32, bfd_mach_o_write_segment_64) + (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib) + (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_prebind_cksum) + (bfd_mach_o_read_twolevel_hints, bfd_mach_o_read_fvmlib) + (bfd_mach_o_read_thread, bfd_mach_o_read_dysymtab) + (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid) + (bfd_mach_o_read_linkedit, bfd_mach_o_read_str) + (bfd_mach_o_read_dyld_info, bfd_mach_o_read_segment) + (bfd_mach_o_read_segment_32, bfd_mach_o_read_segment_64) + (bfd_mach_o_read_command): Now return a boolean status. + Adjust return statements. + (bfd_mach_o_write_contents, bfd_mach_o_scan): Adjust tests. + (bfd_mach_o_core_file_failing_command): Remove useless initialization. + +2014-04-17 Kwok Cheung Yeung + + * elfxx-mips.c (struct mips_got_info): Delete assigned_gotno + field. Add assigned_low_gotno and assigned_high_gotno fields. + (mips_elf_create_local_got_entry): Update out-of-space condition. + Set index of new GOT entry to assigned_low_gotno if required by + the current relocation, else set it to assigned_high_gotno. + (mips_elf_set_global_gotidx): Replace uses of assigned_gotno + with assigned_low_gotno. + (mips_elf_multi_got): Initialize assigned_low_gotno and + assigned_high_gotno in secondary GOTs. Use assigned_low_gotno + in place of assigned_gotno when handling global GOT entries. + (mips_elf_lay_out_got): Initialize assigned_low_gotno and + assigned_high_gotno. + (_bfd_mips_elf_finish_dynamic_sections): Account for a possible + gap in the middle of local GOT space. + +2014-04-17 Alan Modra + + PR 16846 + * elflink.c (_bfd_elf_merge_symbol): Ignore TLS mismatch when + current bfd is a plugin. Don't always set type_change_ok + when old bfd is a plugin. + +2014-04-16 Tristan Gingold + + * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype + flag. + +2014-04-16 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area + with "ba 0" rather than zeros. + +2014-04-15 Marcus Shawcroft + + * (elfNN_aarch64_tls_relax): Fix instruction mask. + +2014-04-14 Alan Modra + + * elf32-ppc.c (BA): Define + (ppc_elf_link_hash_table_create): Correct default_params. + (write_glink_stub): Pad small plt call stub with "ba 0" rather + than "nop" for ppc476_workaround. + (ppc_elf_finish_dynamic_sections): Likewise for branch table + and __glink_PLTresolve. Ensure plt call stub at end of page + doesn't allow fall-thru prefetch. + +2014-04-11 Nick Clifton + + PR ld/16821 + * peXXigen.c (abs_finder): New function. + (_bfd_XXi_swap_sym_out): For absolute symbols with values larger + than 1^32 try to convert them into section relative values + instead. + +2014-04-11 Nick Clifton + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2014-04-10 Cesar Philippidis + + * elf32-nios2.c (nios2_elf32_build_stubs): Ignore dynobjs + when building function stubs. + +2014-04-10 Senthil Kumar Selvaraj + + * elf32-avr.c: Add DIFF relocations for AVR. + (avr_final_link_relocate): Handle the DIFF relocs. + (bfd_elf_avr_diff_reloc): New. + (elf32_avr_is_diff_reloc): New. + (elf32_avr_adjust_diff_reloc_value): Reduce difference value. + (elf32_avr_relax_delete_bytes): Recompute difference after deleting + bytes. + + * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations + +2014-04-09 Alan Modra + + * libcoff.h: Regenerate. + +2014-04-09 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Remove bctr from list + of safe ppc476 insns at end of page. Also remove non-branch insns. + Expand comments. + +2014-04-08 Jon Turney + + * peXXigen.c (pe_print_debugdata): New function: Displays the + contents of the debug directory and decodes codeview entries. + (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) + (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record): + Add functions for reading and writing debugdir and codeview + records. + * libpei.h (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) + (_bfd_XXi_write_codeview_record): Add prototypes and macros. + * libcoff-in.h (pe_tdata): Add build-id data. + * libcoff.h: Regenerate. + * coffcode.h (coff_write_object_contents): Run build_id + after_write_object_contents hook. + +2014-04-05 Alan Modra + + * elflink.c (_bfd_elf_add_default_symbol): Pass poldbfd when + merging non-default sym. + +2014-04-04 Tristan Gingold + + * mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not + configured for. + +2014-04-04 Tristan Gingold + + * mach-o.c (bfd_mach_o_convert_section_name_to_mach_o): Fix + thinko on names length. + +2014-04-04 Tristan Gingold + + * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index + of output_section. + * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto. + +2014-04-04 Tristan Gingold + + * bfd.c (bfd_get_arch_size): Default is taken from arch. + +2014-04-03 Jon Turney + + * peXXigen.c (pe_print_edata): Verify edt.name lies inside + section before dereferencing. + (pe_print_idata, pe_print_edata, pe_print_reloc) + (rsrc_print_section): Don't bother interpreting the contents + of sections which have no contents. + +2014-04-03 Maria Guseva + + PR ld/16803 + * elf.c (_bfd_elf_set_section_contents): Use correct type to hold + file position. + +2014-04-03 Tristan Gingold + + * mach-o.c (bfd_mach_o_mangle_symbols): Use index from + output_section. + (bfd_mach_o_build_seg_command): Add comment. Realign segment. + Fix style. + (bfd_mach_o_build_commands, bfd_mach_o_read_thread): Fix style. + +2014-04-03 Alan Modra + + * elf-bfd.h (struct elf_backend_data + ): Replace "size_t size" + with "bfd_size_type size". + (_bfd_elf32_bfd_from_remote_memory): Likewise. + (_bfd_elf64_bfd_from_remote_memory): Likewise. + * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. + * elfcode.h (bfd_from_remote_memory): Likewise. + * bfd-in.h (bfd_elf_bfd_from_remote_memory): Likewise. + * bfd-in2.h: Regenerate. + +2014-04-02 Tristan Gingold + + * mach-o.h (bfd_mach_o_twolevel_hints_command) + (bfd_mach_o_prebind_cksum_command): New types. + (bfd_mach_o_prebound_dylib_command): Rewrite. + (bfd_mach_o_load_command): Add prebind_cksum and twolevel_hints + fields. + * mach-o.c (bfd_mach_o_read_prebound_dylib): Read and decode the + command. + (bfd_mach_o_read_prebind_cksum): New function. + (bfd_mach_o_read_twolevel_hints): Ditto. + (bfd_mach_o_read_command): Handle prebind cksum and twolevel hints + commands. + +2014-04-02 Alan Modra + + * elfcode.h (bfd_from_remote_memory): Add "size" parameter. + Consolidate code handling possible section headers past end of + segment. Don't use p_align for page size guess, instead use + minpagesize. Take note of ld.so clearing section headers when + p_memsz > p_filesz. Handle file header specifying no section + headers. Handle zero p_align throughout. Default loadbase to + zero. Add comments. Rename contents_size to high_offset, and + make it a bfd_vma. Delete unnecessary bfd_set_error calls. + * bfd-in.h (bfd_elf_bfd_from_remote_memory): Update prototpe. + * elf-bfd.h (struct elf_backend_data ): + Likewise. + (_bfd_elf32_bfd_from_remote_memory): Likewise. + (_bfd_elf64_bfd_from_remote_memory): Likewise. + * elf.c (bfd_elf_bfd_from_remote_memory): Adjust. + * bfd-in2.h: Regnerate. + +2014-04-01 Tristan Gingold + + * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash + when num == 0. + +2014-03-27 Yury Gribov + Pavel Fedin + + * elf32-arm.c: Add support for limited pretty-printing of PLT + entries on eabi and nacl targets. + (elf32_arm_get_synthetic_symtab): Add new callback. + (elf32_arm_nacl_plt_sym_val): Likewise. + (elf32_arm_plt0_size): Add helper function. + (elf32_arm_plt_size): Likewise. + +2014-03-27 Tristan Gingold + + * mach-o.c (bfd_mach_o_read_dylinker): Remove assert. + (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT. + +2014-03-27 Tristan Gingold + + * mach-o.h (bfd_mach_o_get_base_address): New prototype. + * mach-o.c (bfd_mach_o_write_symtab) + (bfd_mach_o_write_contents) + (bfd_mach_o_set_section_flags_from_bfd) + (bfd_mach_o_build_seg_command): Fix indentation. + (bfd_mach_o_get_base_address): New function. + +2014-03-26 Nick Clifton + + * cofflink.c (_bfd_coff_generic_relocate_section): Skip + relocations in discarded sections. + +2014-03-26 Tristan Gingold + + * mach-o.c (bfd_mach_o_convert_architecture): Add + BFD_MACH_O_CPU_TYPE_ARM64. + +2014-03-26 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly + needed plt entries when taking the address of functions for + abiversion == 0 (ie. unknown) as well as abiversion == 2. + Move opd setup and abiversion checks to.. + (ppc64_elf_before_check_relocs): ..here. Renamed from + ppc64_elf_process_dot_syms. Set output abiversion from input and + input abiversion from output, if either is not set. + (ppc64_elf_merge_private_bfd_data): Don't merge flags here. + (elf_backend_check_directives): Update. + +2014-03-25 Will Newton + + * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): + Set value of DT_PLTRELSZ and DT_RELASZ based on the size + of input sections rather than output sections. + +2014-03-20 Will Newton + + PR ld/16715 + * elf32-arm.c (elf32_arm_check_relocs): Set + pointer_equality_needed for absolute references within + executable links. + (elf32_arm_finish_dynamic_symbol): Set st_value to zero + unless pointer_equality_needed is set. + +2014-03-19 Nick Clifton + + * peXXigen.c (rsrc_process_section): Add code to scan input + sections and record their lengths. Use these lengths to find the + start of each merged .rsrc section. + +2014-03-17 Tristan Gingold + + * mach-o.c (bfd_mach_o_read_dylib): Handle lazy load dylib. + (bfd_mach_o_read_command): Ditto. + +2014-03-14 Meador Inge + + * configure.in: Add strnlen to AC_CHECK_DECLS. + * config.in: Regenerate. + * configure: Regenerate. + * sysdep.h (strnlen): Add prototype. + +2014-03-14 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Correct overflow + handling for VLE_SDA21 relocs. + +2014-03-13 Tristan Gingold + + * peicode.h (pe_ILF_object_p): Adjust, as the version number + has been read. + (pe_bfd_object_p): Also read version number to detect ILF. + * pe-x86_64.c (COFF_WITH_PE_BIGOBJ): Define. + (x86_64pe_bigobj_vec): Define + * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_max_nscns field. + (bfd_coff_max_nscns): New macro. + (coff_compute_section_file_positions): Use unsigned int for + target_index. Compare with bfd_coff_max_nscns. + (bfd_coff_std_swap_table, ticoff0_swap_table, ticoff1_swap_table): + Set a value for _bfd_coff_max_nscns. + (header_bigobj_classid): New constant. + (coff_bigobj_swap_filehdr_in, coff_bigobj_swap_filehdr_out) + (coff_bigobj_swap_sym_in, coff_bigobj_swap_sym_out) + (coff_bigobj_swap_aux_in, coff_bigobj_swap_aux_out): New + functions. + (bigobj_swap_table): New table. + * libcoff.h: Regenerate. + * coff-sh.c (bfd_coff_small_swap_table): Likewise. + * coff-alpha.c (alpha_ecoff_backend_data): Add value for + _bfd_coff_max_nscns. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * coff-rs6000.c (bfd_xcoff_backend_data) + (bfd_pmac_xcoff_backend_data): Likewise. + * coff64-rs6000.c (bfd_xcoff_backend_data) + (bfd_xcoff_aix5_backend_data): Likewise. + * targets.c (x86_64pe_bigobj_vec): Declare. + * configure.in (x86_64pe_bigobj_vec): New vector. + * configure: Regenerate. + * config.bfd: Add bigobj object format for Windows targets. + +2014-03-12 Nick Clifton + + PR ld/16671 + * elf32-arm.c (elf32_arm_add_symbol_hook): Check for ARM format + before testing for vxworks. + +2014-03-12 Alan Modra + + * Makefile.in: Regenerate. + +2014-03-12 Alan Modra + + PR 16690 + * elf.c (copy_elf_program_header): Ignore first section lma if + non-alloc. + +2014-03-11 Alan Modra + + PR 16686 + * coff-rs6000.c: Include stdint.h. + * coff64-rs6000.c: Likewise. + +2014-03-10 Tristan Gingold + + * ticoff.h: Removed. + +2014-03-08 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_raw): Correct overflow check for + many relocations. Correct bitsize and rightshift too for a number + of VLE relocs. Describe R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO. + Correct dst_mask on R_PPC_VLE_SDA21_LO. + (ppc_elf_vle_split16): Tidy, delete unnecessary prototype. + (ppc_elf_relocate_section): Modify overflow test for 16-bit + fields in instructions to signed/unsigned according to whether + the field takes a signed or unsigned value. Tidy vle split16 code. + Correct R_PPC_VLE_SDA21 and R_PPC_VLE_SDA21_LO handling. + +2014-03-08 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw): Use complain_overflow_signed + for R_PPC64_ADDR14, R_PPC64_ADDR14_BRTAKEN, R_PPC64_ADDR14_BRNTAKEN, + R_PPC64_SECTOFF, R_PPC64_ADDR16_DS, R_PPC64_SECTOFF_DS, + R_PPC64_REL16 entries. Use complain_overflow_dont for R_PPC64_TOC. + (ppc64_elf_relocate_section): Modify overflow test for 16-bit + fields in instructions to signed/unsigned according to whether + the field takes a signed or unsigned value. + +2014-03-07 Pedro Alves + + PR gdb/16696 + * rs6000-core.c (rs6000coff_core_p): Cast pointers to bfd_vma + through ptr_to_uint instead of through long. + +2014-03-06 Nick Clifton + + PR 16664 + * elf-attrs.c (_bfd_elf_parse_attributes): Add checks for corrupt + attribute section names. + +2014-03-05 Alan Modra + + Update copyright years. + +2014-03-05 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_ADDR64_LOCAL entry. + (ppc64_elf_reloc_type_lookup): Support R_PPC64_ADDR64_LOCAL. + (ppc64_elf_check_relocs): Likewise. + (ppc64_elf_relocate_section): Likewise. + * Add BFD_RELOC_PPC64_ADDR64_LOCAL. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2014-03-04 Heiher + + * elfxx-mips.c (mips_set_isa_flags): Use E_MIPS_ARCH_64R2 for + Loongson-3A. + (mips_mach_extensions): Make bfd_mach_mips_loongson_3a an + extension of bfd_mach_mipsisa64r2. + +2014-03-04 Nick Clifton + + PR ld/16017 + * elf32-arm.c (elf32_thumb2_plt0_entry): New array. + (elf32_thumb2_plt_entry): New array. + (elf32_arm_create_dynamic_sections): Set PLT entry sizes when + using thumb2 based PLT. + (elf32_arm_populate_plt_entry): Handle generating Thumb2 based PLT + entries. + (elf32_arm_final_link_relocate): Do not bias jumps to Thumb based + PLT entries. + (elf32_arm_finish_dynamic_sections): Handle creation of Thumb2 + based PLT 0-entry. + (elf32_arm_output_plt_map_1): Handle creation of local symbols for + Thumb2 based PLT 0-entry. + (elf32_arm_output_arch_local_syms): Handle creation of local + symbols for Thumb2 based PLT entries. + +2014-02-28 Alan Modra + + PR ld/16643 + * elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly + the same conditions we called check_relocs. + +2014-02-27 Yuri Gribov + + * bfd-in.h: Add export of bfd_elf32_arm_use_long_plt. + * bfd-in2.h: Regenerate. + * elf32-arm.c (elf32_arm_plt_entry_long): New array. + (elf32_arm_link_hash_table_create): Set plt_entry_size to 16 if + using long PLT entries. + (bfd_elf32_arm_use_long_plt): New function. + (elf32_arm_populate_plt_entry): Add support for long PLT entries. + +2014-02-27 Alan Modra + + * elf32-ppc.c (ppc_elf_link_hash_table_create): Provide default + params for targets that don't use ppc32elf.em. + +2014-02-20 Chung-Lin Tang + + * elf32-nios2.c (nios2_elf32_relocate_section): Fix calculation + of GOTOFF relocations. + +2014-02-19 Igor Zamyatin + H.J. Lu + + * elf64-x86-64.c (elf_x86_64_bnd_plt0_entry): New. + (elf_x86_64_legacy_plt_entry): Likewise. + (elf_x86_64_bnd_plt_entry): Likewise. + (elf_x86_64_legacy_plt2_entry): Likewise. + (elf_x86_64_bnd_plt2_entry): Likewise. + (elf_x86_64_bnd_arch_bed): Likewise. + (elf_x86_64_link_hash_entry): Add has_bnd_reloc and plt_bnd. + (elf_x86_64_link_hash_table): Add plt_bnd. + (elf_x86_64_link_hash_newfunc): Initialize has_bnd_reloc and + plt_bnd. + (elf_x86_64_copy_indirect_symbol): Also copy has_bnd_reloc. + (elf_x86_64_check_relocs): Create the second PLT for Intel MPX + in 64-bit mode. + (elf_x86_64_allocate_dynrelocs): Handle the second PLT for IFUNC + symbols. Resolve call to the second PLT if it is created. + (elf_x86_64_size_dynamic_sections): Keep the second PLT section. + (elf_x86_64_relocate_section): Resolve PLT references to the + second PLT if it is created. + (elf_x86_64_finish_dynamic_symbol): Use BND PLT0 and fill the + second PLT entry for BND relocation. + (elf_x86_64_finish_dynamic_sections): Use MPX backend data if + the second PLT is created. + (elf_x86_64_get_synthetic_symtab): New. + (bfd_elf64_get_synthetic_symtab): Likewise. Undefine for NaCl. + +2014-02-19 Alan Modra + + * elf64-ppc.h (struct ppc64_elf_params): Add save_restore_funcs. + * elf64-ppc.c (ppc64_elf_func_desc_adjust): Use it to control + provision of out-of-line register save/restore routines. + +2014-02-18 Jack Carter + + * elfxx-mips.c(_bfd_mips_elf_modify_segment_map): Deleted hard coding of + PT_DYNAMIC segment flags. + +2014-02-17 Jan Kratochvil + + PR binutils/16595 + * simple.c (struct saved_offsets): New. + (simple_save_output_info): Use it for ptr. + (simple_restore_output_info): Use it for ptr. Check section_count. + (bfd_simple_get_relocated_section_contents): Use it for saved_offsets. + +2014-02-17 Alan Modra + + * elf64-ppc.h (struct ppc64_elf_params): Define. + (ppc64_elf_init_stub_bfd, ppc64_elf_edit_opd, ppc64_elf_tls_setup, + ppc64_elf_setup_section_lists, ppc64_elf_size_stubs, + ppc64_elf_build_stubs): Update prototype. + * elf64-ppp.c (struct ppc_link_hash_table): Add params, delete other + fields now in params. Adjust code throughout file. + (ppc64_elf_init_stub_bfd): Delete "abfd" parameter, add "params". + Save params pointer in htab. + (ppc64_elf_edit_opd, ppc64_elf_tls_setup, + ppc64_elf_setup_section_lists, ppc64_elf_size_stubs, + ppc64_elf_build_stubs): Remove parameters now in "params". + +2014-02-17 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Move relocs on insns + patched for ppc476 workaround. Reapply branch taken/not taken + relocs. + +2014-02-12 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Don't build long-branch + stubs for calls to __tls_get_addr that we know will later be + optimised away. + +2014-02-12 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Enable ppc476 workaround + for ld -r, when code sections are sufficiently aligned. + * elf32-ppc.h (struct ppc_elf_params): Delete pagesize. Add + pagesize_p2. + +2014-02-12 Alan Modra + + PR gold/15530 + * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support + --export-dynamic and --dynamic-list marking of symbols. + * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Reorder + cheap tests first. + +2014-02-10 H.J. Lu + + PR gold/16530 + * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in + executables if it matches dynamic_list. + +2014-02-10 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + +2014-02-09 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add caches_rawsize. + * elfxx-target.h (elf_backend_caches_rawsize): Define. + (elfNN_bed): Init new field. + * elflink.c (elf_link_input_bfd): Handle caches_rawsize. + * elf32-ppc.c (shared_stub_entry): Zero addi offset. + (ppc_elf_relax_section): Don't reallocate section here, write + stubs, or write out relocs for ld -r here.. + (ppc_elf_relocate_section): ..instead write stubs here, and use + existing code to write out relocs for ld -r. Fix offset + adjustment on reloc for little-endian. + (elf_backend_caches_rawsize): Define. + +2014-02-07 Rainer Orth + + PR build/16550 + * cache.c (bfd_cache_max_open): Cast RLIM_INFINITY to rlim_t. + +2014-02-04 Jan Kratochvil + + * coff-rs6000.c (xcoff_write_archive_contents_big): Free OFFSETS in + return paths. Three times. + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Free HTAB in all + return paths. + (ppc64_elf_tls_optimize): Free TOC_REF in return path. + (ppc64_elf_edit_toc): Free USED in return path. + +2014-02-03 Sandra Loosemore + + * reloc.c (BFD_RELOC_NIOS2_GOT_LO, BFD_RELOC_NIOS2_GOT_HA): New. + (BFD_RELOC_NIOS2_CALL_LO, BFD_RELOC_NIOS2_CALL_HA): New. + * libbfd.h: Regenerated. + * bfd-in2.h: Regenerated. + * elf32-nios2.c (elf_nios2_howto_table_rel): Add new relocations. + (nios2_reloc_map): Likewise. + (GOT_USED, CALL_USED): Renamed from GOT16_USED and CALL16_USED. + Fixed all references. + (nios2_elf32_relocate_section): Add new relocations. + (nios2_elf32_check_relocs): Likewise. + (nios2_elf32_gc_sweep_hook): Likewise. + +2014-02-03 Alan Modra + + * elf32-ppc.c (struct ppc_elf_link_hash_table): Add params. + Delete emit_stub_syms, no_tls_get_addr_opt. Update all uses. + (ppc_elf_link_params): New function. + (ppc_elf_create_glink): Align .glink to 64 bytes for ppc476 + workaround. + (ppc_elf_select_plt_layout): Remove plt_style and emit_stub_syms + parameters. Use htab->params instead. + (ppc_elf_tls_setup): Remove no_tls_get_addr_opt parameter. + (ppc_elf_size_dynamic_sections): Align __glink_PLTresolve to + 64 bytes for ppc476 workaround. + (struct ppc_elf_relax_info): New. + (ppc_elf_relax_section): Exclude linker created sections and + those too small to hold one instruction. Don't add another + branch around trampolines on later relax passes. Don't + generate trampolines for undefined symbols when !relocatable, + nor for plugin symbols. Allocate space for ppc476 workaround + patch area. Free fixups on error return path. + (ppc_elf_relocate_section): Handle ppc476 workaround patching. + * elf32-ppc.h (struct ppc_elf_params): New. + (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Update prototype. + (ppc_elf_link_params): Declare. + * section.c (SEC_INFO_TYPE_TARGET): Define. + * bfd-in2.h: Regenerate. + +2014-02-02 Sandra Loosemore + + * elf32-nios2.c (struct elf32_nios2_link_hash_table): Add + h_gp_got field. + (nios2_elf32_relocate_section): Use got_base to adjust + GOT-pointer-relative relocations relative to _gp_got. + (create_got_section): Create _gp_got symbol. + (nios2_elf32_finish_dynamic_symbol): Make _gp_got absolute. + (nios2_elf32_size_dynamic_sections): Set _gp_got offset. + +2014-01-30 Sandra Loosemore + + * bfd-in2.h: Update from reloc.c. + * elf32-nios2.c: Include elf32-nios2.h. + (elf_nios2_howto_table_rel): Add entry for R_NIOS2_CALL26_NOAT. + (nios2_reloc_map): Likewise. + (enum elf32_nios2_stub_type): Declare. + (struct elf32_nios2_stub_hash_entry): Declare. + (nios2_stub_hash_entry, nios2_stub_hash_lookup): New macros. + (struct elf32_nios2_link_hash_entry): Add hsh_cache field. + (struct elf32_nios2_link_hash_table): Add new fields bstab, + stub_bfd, add_stub_section, layout_sections_again, stub_group, + bfd_count, top_index, input_list, all_local_syms. + (nios2_call26_stub_entry): New. + (nios2_elf32_install_imm16): Move up in file. + (nios2_elf32_install_data): Move up in file. + (hiadj): Move up in file. + (stub_hash_newfunc): New. + (link_hash_newfunc): Initialize hsh_cache field. + (STUB_SUFFIX): New. + (nios2_stub_name): New. + (nios2_get_stub_entry): New. + (nios2_add_stub): New. + (nios2_elf32_setup_section_lists): New. + (nios2_elf32_next_input_section): New. + (CALL26_SEGMENT): New. + (MAX_STUB_SECTION_SIZE): New. + (group_sections): New. + (nios2_type_of_stub): New. + (nios2_build_one_stub): New. + (nios2_size_one_stub): New. + (get_local_syms): New. + (nios2_elf32_size_stubs): New. + (nios2_elf32_build_stubs): New. + (nios2_elf32_do_call26_relocate): Correct CALL26 overflow test. + (nios2_elf32_relocate_section): Handle R_NIOS2_CALL26_NOAT. Add + trampolines for R_NIOS2_CALL26 stubs. + (nios2_elf32_check_relocs): Handle R_NIOS2_CALL26_NOAT. + (nios2_elf32_gc_sweep_hook): Likewise. + (nios2_elf32_link_hash_table_create): Initialize the stub hash table. + (nios2_elf32_link_hash_table_free): New. + (bfd_elf32_bfd_link_hash_table_free): Define. + * elf32-nios2.h: New file. + * libbfd.h: Update from reloc.c. + * reloc.c (BFD_RELOC_NIOS2_CALL26_NOAT): New. + +2014-01-29 Nick Clifton + + PR binutils/16318 + * elf32-metag.c (elf_metag_post_process_headers): Call + _bfd_elf_post_process_headers. + * elf32-sh64.c (sh64_elf_copy_private_data): Call + _bfd_elf_copy_private_data. + * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise. + +2014-01-29 Nick Clifton + + * bfd-in.h (bfd_set_section_vma): Delete. + (bfd_set_section_alignment): Delete. + (bfd_set_section_userdata): Delete. + (bfd_set_cacheable): Delete. + * bfd.c (bfd_set_cacheable): New static inline function. + * section.c (bfd_set_section_userdata): Likewise. + (bfd_set_section_vma): Likewise. + (bfd_set_section_alignment): Likewise. + * bfd-in2.h: Regenerate. + +2014-01-28 Nick Clifton + + * dwarf2.c (find_abstract_instance_name): For DW_FORM_ref_addr + attributes select the CU containing the abbreviation, which may not + be the current CU. + +2014-01-24 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed + to get_relocs for ELFv2. + +2014-01-23 H.J. Lu + + PR ld/16498 + * elf.c (_bfd_elf_map_sections_to_segments): Issue a linker error + if TLS sections are not adjacent. + +2014-01-22 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Call minfo for --as-needed. + +2014-01-22 Alan Modra + + * elf64-ppc.c (STK_LINKER): Comment typo fix. + +2014-01-21 H.J. Lu + + PR ld/16467 + * elflink.c (_bfd_elf_merge_symbol): When types of the existing + regular default symbol definition and the versioned dynamic + symbol definition mismatch, skip the default symbol definition + if one of them is IFUNC. + +2014-01-21 H.J. Lu + + PR ld/2404 + * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared, + info->export_dynamic nor h->ref_dynamic for type mismatch when + adding the default version. + +2014-01-16 Alan Modra + + * elfxx-mips.c (mips_elf_record_got_page_entry): Pass in a + mips_elf_traverse_got_arg* rather than mips_got_info*. + Adjust caller. Alloc on output_bfd rather than symbol section + owner. + +2014-01-15 H.J. Lu + + * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last + change. + * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. + +2014-01-14 H.J. Lu + + PR ld/16428 + * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't discard relocs + against __ehdr_start. + * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. + +2014-01-14 H.J. Lu + + * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last + change. + * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. + +2014-01-14 H.J. Lu + + PR ld/16428 + * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't update reloc + count if there are any non pc-relative relocs. + * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise. + +2014-01-14 Michael Hudson-Doyle + Kugan Vivekanandarajah + + * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use correct + offset while calculating relocation address. + (elfNN_aarch64_create_small_pltn_entry): Likewise. + (elfNN_aarch64_init_small_plt0_entry): Likewise. + +2014-01-13 Ma Jiang + + PR ld/16202 + * elf32-arm.c (elf32_arm_final_link_relocate): Refetch addends for + R_ARM_ABS8 and R_ARM_ABS16. + +2014-01-13 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): For @local call to ifunc, + error when shared and force a plt call otherwise. + (ppc_elf_size_dynamic_sections): Don't emit DT_PPC_GOT unless + plt_type == PLT_NEW. + (ppc_elf_relocate_section): Add missing test to resolve ifuncs to + the appropriate call stub. + +2014-01-10 Alan Modra + + PR ld/14207 + PR ld/16322 + PR binutils/16323 + * elf.c (assign_file_positions_for_load_sections): Revert last change. + (assign_file_positions_for_non_load_sections): When setting up + PT_GNU_RELRO header, don't require a corresponding PT_LOAD + header that completely covers the relro region. + +2014-01-09 Tristan Gingold + + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): use jump + table macros and add macros to initializa the structure. + +2014-01-08 H.J. Lu + + PR ld/14207 + PR ld/16322 + PR binutils/16323 + * elf.c (_bfd_elf_map_sections_to_segments): Don't check section + size for PT_GNU_RELRO segment. + (assign_file_positions_for_load_sections): If PT_LOAD segment + doesn't fit PT_GNU_RELRO segment, adjust its p_filesz and p_memsz. + +2014-01-07 Tom Tromey + + * elf32-xtensa.c (vsprint_msg): Don't use old VA_* compatibility + wrappers. + +2014-01-03 Nick Clifton + + PR binutils/16199 + * elf.c (vma_page_aligned_bias): Handle a maxpagesize value of + zero. + +2014-01-02 Yuanhui Zhang + + PR binutils/14289 + * pef.c (bfd_pef_xlib_read_header): Increase buffer size to 80. + +2014-01-02 Nick Clifton + + PR binutils/11983 + * archive.c (_bfd_get_elt_at_filepos): Store a copy of the + filename in the bfd's filename field. + * elfcode.h (bfd_from_remote_memory): Likewise. + * ieee.c (ieee_object_p): Likewise. + * mach-o.c (bfd_mach_o_fat_member_init): Likewise. + * oasys.c (oasys_openr_next_archived_file): Likewise. + * vms-lib.c (_bfd_vms_lib_get_module): Likewise. + * opncls.c (bfd_fopen): Likewise. + (bfd_openstreamr): Likewise. + (bfd_openr_iovec): Likewise. + (bfd_openw): Likewise. + (bfd_create): Likewise. + (_bfd_delete_bfd): Free filename. + +For older changes see ChangeLog-2013 + +Copyright (C) 2014 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/bfd/MAINTAINERS b/bfd/MAINTAINERS index 9ee4884ba..041d8f4e3 100644 --- a/bfd/MAINTAINERS +++ b/bfd/MAINTAINERS @@ -1,6 +1,6 @@ See ../binutils/MAINTAINERS -Copyright (C) 2012-2014 Free Software Foundation, Inc. +Copyright (C) 2012-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 595c4893d..8ffdbb12e 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to generate Makefile.in # -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,9 +20,6 @@ AUTOMAKE_OPTIONS = 1.11 no-dist foreign ACLOCAL_AMFLAGS = -I . -I .. -I ../config -# Uncomment the following line when doing a release. -# RELEASE=y - INCDIR = $(srcdir)/../include CSEARCH = -I. -I$(srcdir) -I$(INCDIR) @@ -67,21 +64,19 @@ BFD_H = bfd.h # debugger). BFD32_LIBS = \ archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ - cache.lo coffgen.lo corefile.lo \ - format.lo init.lo libbfd.lo opncls.lo reloc.lo \ - section.lo syms.lo targets.lo hash.lo linker.lo \ - srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \ - merge.lo dwarf2.lo simple.lo compress.lo verilog.lo + cache.lo coff-bfd.lo compress.lo corefile.lo format.lo hash.lo \ + init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo \ + section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo \ + binary.lo ihex.lo srec.lo tekhex.lo verilog.lo BFD64_LIBS = archive64.lo BFD32_LIBS_CFILES = \ archive.c archures.c bfd.c bfdio.c bfdwin.c \ - cache.c coffgen.c corefile.c \ - format.c init.c libbfd.c opncls.c reloc.c \ - section.c syms.c targets.c hash.c linker.c \ - srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \ - merge.c dwarf2.c simple.c compress.c verilog.c + cache.c coff-bfd.c compress.c corefile.c format.c hash.c \ + init.c libbfd.c linker.c merge.c opncls.c reloc.c \ + section.c simple.c stab-syms.c stabs.c syms.c targets.c \ + binary.c ihex.c srec.c tekhex.c verilog.c BFD64_LIBS_CFILES = archive64.c @@ -162,6 +157,7 @@ ALL_MACHINES = \ cpu-v850.lo \ cpu-v850_rh850.lo \ cpu-vax.lo \ + cpu-visium.lo \ cpu-w65.lo \ cpu-we32k.lo \ cpu-xc16x.lo \ @@ -246,6 +242,7 @@ ALL_MACHINES_CFILES = \ cpu-v850.c \ cpu-v850_rh850.c \ cpu-vax.c \ + cpu-visium.c \ cpu-w65.c \ cpu-we32k.c \ cpu-xc16x.c \ @@ -296,8 +293,10 @@ BFD32_BACKENDS = \ coff-we32k.lo \ coff-z80.lo \ coff-z8k.lo \ + coffgen.lo \ cofflink.lo \ dwarf1.lo \ + dwarf2.lo \ ecoff.lo \ ecofflink.lo \ elf-attrs.lo \ @@ -367,6 +366,7 @@ BFD32_BACKENDS = \ elf32-tilepro.lo \ elf32-v850.lo \ elf32-vax.lo \ + elf32-visium.lo \ elf32-xc16x.lo \ elf32-xgate.lo \ elf32-xstormy16.lo \ @@ -483,8 +483,10 @@ BFD32_BACKENDS_CFILES = \ coff-we32k.c \ coff-z80.c \ coff-z8k.c \ + coffgen.c \ cofflink.c \ dwarf1.c \ + dwarf2.c \ ecoff.c \ ecofflink.c \ elf-attrs.c \ @@ -554,6 +556,7 @@ BFD32_BACKENDS_CFILES = \ elf32-tilepro.c \ elf32-v850.c \ elf32-vax.c \ + elf32-visium.c \ elf32-xc16x.c \ elf32-xgate.c \ elf32-xstormy16.c \ @@ -735,16 +738,14 @@ OPTIONAL_BACKENDS_CFILES = \ sco5-core.c \ trad-core.c -# We want to rerun configure if configure.in, config.bfd or -# configure.host change. configure.in is needed since the version -# number in Makefile comes from configure.in. +# Reconfigure if config.bfd or configure.host changes. +# development.sh is used to determine -Werror default. CONFIG_STATUS_DEPENDENCIES = \ - $(srcdir)/configure.in \ $(srcdir)/config.bfd \ $(srcdir)/configure.host \ $(srcdir)/development.sh -# These are defined by configure.in: +# These are defined by configure: WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ @@ -1027,14 +1028,15 @@ CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion -bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in +bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in @echo "creating $@" @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ bfd_version_string="\"$(VERSION)\"" ;\ bfd_soversion="$(VERSION)" ;\ bfd_version_package="\"$(PKGVERSION)\"" ;\ report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ - if test "x$(RELEASE)" = x ; then \ + . $(srcdir)/development.sh ;\ + if test "$$development" = true ; then \ bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 2ea851650..2c9435ce1 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -16,7 +16,7 @@ @SET_MAKE@ # -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -80,7 +80,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/bfd.m4 $(top_srcdir)/warning.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/zlib.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -121,11 +121,10 @@ am__installdirs = "$(DESTDIR)$(bfdlibdir)" \ LTLIBRARIES = $(bfdlib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ - cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo \ - opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo \ - linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo \ - stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo \ - verilog.lo + cache.lo coff-bfd.lo compress.lo corefile.lo format.lo hash.lo \ + init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo \ + section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo \ + binary.lo ihex.lo srec.lo tekhex.lo verilog.lo am_libbfd_la_OBJECTS = $(am__objects_1) libbfd_la_OBJECTS = $(am_libbfd_la_OBJECTS) libbfd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -337,9 +336,6 @@ top_srcdir = @top_srcdir@ wordsize = @wordsize@ AUTOMAKE_OPTIONS = 1.11 no-dist foreign ACLOCAL_AMFLAGS = -I . -I .. -I ../config - -# Uncomment the following line when doing a release. -# RELEASE=y INCDIR = $(srcdir)/../include CSEARCH = -I. -I$(srcdir) -I$(INCDIR) SUBDIRS = doc po @@ -369,20 +365,18 @@ BFD_H = bfd.h # debugger). BFD32_LIBS = \ archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ - cache.lo coffgen.lo corefile.lo \ - format.lo init.lo libbfd.lo opncls.lo reloc.lo \ - section.lo syms.lo targets.lo hash.lo linker.lo \ - srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \ - merge.lo dwarf2.lo simple.lo compress.lo verilog.lo + cache.lo coff-bfd.lo compress.lo corefile.lo format.lo hash.lo \ + init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo \ + section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo \ + binary.lo ihex.lo srec.lo tekhex.lo verilog.lo BFD64_LIBS = archive64.lo BFD32_LIBS_CFILES = \ archive.c archures.c bfd.c bfdio.c bfdwin.c \ - cache.c coffgen.c corefile.c \ - format.c init.c libbfd.c opncls.c reloc.c \ - section.c syms.c targets.c hash.c linker.c \ - srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \ - merge.c dwarf2.c simple.c compress.c verilog.c + cache.c coff-bfd.c compress.c corefile.c format.c hash.c \ + init.c libbfd.c linker.c merge.c opncls.c reloc.c \ + section.c simple.c stab-syms.c stabs.c syms.c targets.c \ + binary.c ihex.c srec.c tekhex.c verilog.c BFD64_LIBS_CFILES = archive64.c @@ -463,6 +457,7 @@ ALL_MACHINES = \ cpu-v850.lo \ cpu-v850_rh850.lo \ cpu-vax.lo \ + cpu-visium.lo \ cpu-w65.lo \ cpu-we32k.lo \ cpu-xc16x.lo \ @@ -547,6 +542,7 @@ ALL_MACHINES_CFILES = \ cpu-v850.c \ cpu-v850_rh850.c \ cpu-vax.c \ + cpu-visium.c \ cpu-w65.c \ cpu-we32k.c \ cpu-xc16x.c \ @@ -598,8 +594,10 @@ BFD32_BACKENDS = \ coff-we32k.lo \ coff-z80.lo \ coff-z8k.lo \ + coffgen.lo \ cofflink.lo \ dwarf1.lo \ + dwarf2.lo \ ecoff.lo \ ecofflink.lo \ elf-attrs.lo \ @@ -669,6 +667,7 @@ BFD32_BACKENDS = \ elf32-tilepro.lo \ elf32-v850.lo \ elf32-vax.lo \ + elf32-visium.lo \ elf32-xc16x.lo \ elf32-xgate.lo \ elf32-xstormy16.lo \ @@ -785,8 +784,10 @@ BFD32_BACKENDS_CFILES = \ coff-we32k.c \ coff-z80.c \ coff-z8k.c \ + coffgen.c \ cofflink.c \ dwarf1.c \ + dwarf2.c \ ecoff.c \ ecofflink.c \ elf-attrs.c \ @@ -856,6 +857,7 @@ BFD32_BACKENDS_CFILES = \ elf32-tilepro.c \ elf32-v850.c \ elf32-vax.c \ + elf32-visium.c \ elf32-xc16x.c \ elf32-xgate.c \ elf32-xstormy16.c \ @@ -1039,17 +1041,15 @@ OPTIONAL_BACKENDS_CFILES = \ trad-core.c -# We want to rerun configure if configure.in, config.bfd or -# configure.host change. configure.in is needed since the version -# number in Makefile comes from configure.in. +# Reconfigure if config.bfd or configure.host changes. +# development.sh is used to determine -Werror default. CONFIG_STATUS_DEPENDENCIES = \ - $(srcdir)/configure.in \ $(srcdir)/config.bfd \ $(srcdir)/configure.host \ $(srcdir)/development.sh -# These are defined by configure.in: +# These are defined by configure: WORDSIZE = @wordsize@ ALL_BACKENDS = @all_backends@ BFD_BACKENDS = @bfd_backends@ @@ -1273,6 +1273,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-apollo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-arm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-aux.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-bfd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-go32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-h8300.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-h8500.Plo@am__quote@ @@ -1376,6 +1377,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-v850.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-v850_rh850.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-vax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-visium.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-w65.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-we32k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xc16x.Plo@am__quote@ @@ -1461,6 +1463,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-tilepro.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-v850.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-vax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-visium.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xc16x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xgate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xstormy16.Plo@am__quote@ @@ -2087,14 +2090,15 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h touch stmp-lcoff-h -bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in +bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in @echo "creating $@" @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ bfd_version_string="\"$(VERSION)\"" ;\ bfd_soversion="$(VERSION)" ;\ bfd_version_package="\"$(PKGVERSION)\"" ;\ report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ - if test "x$(RELEASE)" = x ; then \ + . $(srcdir)/development.sh ;\ + if test "$$development" = true ; then \ bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ diff --git a/bfd/PORTING b/bfd/PORTING index 37e2c8706..cfde807bf 100644 --- a/bfd/PORTING +++ b/bfd/PORTING @@ -19,7 +19,7 @@ You need to create .c and config/.mt, and add a case for it to a case statements in bfd/configure.host and bfd/config.bfd, which associates each canonical host type with a BFD host type (used as the base of the makefile fragment names), and to the -table in bfd/configure.in which associates each target vector with +table in bfd/configure.ac which associates each target vector with the .o files it uses. config/.mt is a Makefile fragment. @@ -29,7 +29,7 @@ SELECT_ARCHITECTURES=bfd__arch See the list of cpu types in archures.c, or "ls cpu-*.c". If your architecture is new, you need to add it to the tables -in bfd/archures.c, opcodes/configure.in, and binutils/objdump.c. +in bfd/archures.c, opcodes/configure.ac, and binutils/objdump.c. For more information about .mt and .mh files, see config/README. @@ -82,7 +82,7 @@ TARGETNAME The name of the target, for run-time lookups. Usually "a.out-" -Copyright (C) 2012-2014 Free Software Foundation, Inc. +Copyright (C) 2012-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/bfd/README b/bfd/README index 09fc6c7e0..28b2d17d8 100644 --- a/bfd/README +++ b/bfd/README @@ -48,7 +48,7 @@ gcc manual. Bug reports without patches will be remembered, but they may never get fixed until somebody volunteers to fix them. -Copyright (C) 2012-2014 Free Software Foundation, Inc. +Copyright (C) 2012-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/bfd/TODO b/bfd/TODO index 076588ac6..e74baae0c 100644 --- a/bfd/TODO +++ b/bfd/TODO @@ -20,7 +20,7 @@ Things that still need to be done: -*- Text -*- o - upgrade the reloc handling as per Steve's suggestion. -Copyright (C) 2012-2014 Free Software Foundation, Inc. +Copyright (C) 2012-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4 index 31a4bf967..acb641900 100644 --- a/bfd/acinclude.m4 +++ b/bfd/acinclude.m4 @@ -1,5 +1,5 @@ dnl -dnl Copyright (C) 2012-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. dnl dnl This file is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by diff --git a/bfd/aix386-core.c b/bfd/aix386-core.c index d3e2080fb..b534736f6 100644 --- a/bfd/aix386-core.c +++ b/bfd/aix386-core.c @@ -1,7 +1,7 @@ /* BFD back-end for AIX on PS/2 core files. This was based on trad-core.c, which was written by John Gilmore of Cygnus Support. - Copyright (C) 1988-2014 Free Software Foundation, Inc. + Copyright (C) 1988-2015 Free Software Foundation, Inc. Written by Minh Tran-Le . Converted to back end form by Ian Lance Taylor . diff --git a/bfd/aix5ppc-core.c b/bfd/aix5ppc-core.c index 82593ffa4..fe034b9c6 100644 --- a/bfd/aix5ppc-core.c +++ b/bfd/aix5ppc-core.c @@ -1,5 +1,5 @@ /* IBM RS/6000 "XCOFF" back-end for BFD. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. Written by Tom Rix Contributed by Red Hat Inc. diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index 904a5bc29..7e781d4d7 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -1,5 +1,5 @@ /* BFD back-end for a.out.adobe binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. Based on bout.c. This file is part of BFD, the Binary File Descriptor library. @@ -446,9 +446,11 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, /* Build the transfer vector for Adobe A.Out files. */ -#define aout_32_bfd_make_debug_symbol ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) -#define aout_32_bfd_reloc_type_lookup ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) -#define aout_32_bfd_reloc_name_lookup ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) +#define aout_32_find_line _bfd_nosymbols_find_line +#define aout_32_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string +#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol +#define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup +#define aout_32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info #define aout_32_set_arch_mach aout_adobe_set_arch_mach #define aout_32_set_section_contents aout_adobe_set_section_contents @@ -464,7 +466,6 @@ aout_adobe_sizeof_headers (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define aout_32_section_already_linked _bfd_generic_section_already_linked #define aout_32_bfd_define_common_symbol bfd_generic_define_common_symbol #define aout_32_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define aout_32_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols #define aout_32_bfd_link_just_syms _bfd_generic_link_just_syms #define aout_32_bfd_copy_link_hash_symbol_type \ diff --git a/bfd/aout-arm.c b/bfd/aout-arm.c index 5f336ff5e..9e5bb8fe8 100644 --- a/bfd/aout-arm.c +++ b/bfd/aout-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for raw ARM a.out binaries. - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/aout-cris.c b/bfd/aout-cris.c index 01b7bcf04..166e305c1 100644 --- a/bfd/aout-cris.c +++ b/bfd/aout-cris.c @@ -1,5 +1,5 @@ /* BFD backend for CRIS a.out binaries. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hans-Peter Nilsson. diff --git a/bfd/aout-ns32k.c b/bfd/aout-ns32k.c index b436b2125..cf95a99f6 100644 --- a/bfd/aout-ns32k.c +++ b/bfd/aout-ns32k.c @@ -1,5 +1,5 @@ /* BFD back-end for ns32k a.out-ish binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Contributed by Ian Dall (idall@eleceng.adelaide.edu.au). This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/aout-sparcle.c b/bfd/aout-sparcle.c index 0d75a28c3..1184166a3 100644 --- a/bfd/aout-sparcle.c +++ b/bfd/aout-sparcle.c @@ -1,5 +1,5 @@ /* BFD backend for sparc little-endian aout binaries. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/aout-target.h b/bfd/aout-target.h index 9786f42dc..0c97a4af5 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -1,5 +1,5 @@ /* Define a target vector and some small routines for a variant of a.out. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -459,6 +459,10 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #ifndef MY_get_symbol_info #define MY_get_symbol_info NAME (aout, get_symbol_info) #endif +#ifndef MY_get_symbol_version_string +#define MY_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string +#endif #ifndef MY_get_lineno #define MY_get_lineno NAME (aout, get_lineno) #endif @@ -468,6 +472,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #ifndef MY_find_nearest_line #define MY_find_nearest_line NAME (aout, find_nearest_line) #endif +#ifndef MY_find_line +#define MY_find_line _bfd_nosymbols_find_line +#endif #ifndef MY_find_inliner_info #define MY_find_inliner_info _bfd_nosymbols_find_inliner_info #endif @@ -521,9 +528,6 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #ifndef MY_bfd_link_hash_table_create #define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create) #endif -#ifndef MY_bfd_link_hash_table_free -#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free -#endif #ifndef MY_bfd_link_add_symbols #define MY_bfd_link_add_symbols NAME (aout, link_add_symbols) #endif diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index 680ef610c..7fcdf6240 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 a.out binaries. - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 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. @@ -917,6 +917,10 @@ tic30_aout_set_arch_mach (bfd *abfd, #ifndef MY_get_symbol_info #define MY_get_symbol_info NAME (aout, get_symbol_info) #endif +#ifndef MY_get_symbol_version_string +#define MY_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string +#endif #ifndef MY_get_lineno #define MY_get_lineno NAME (aout, get_lineno) #endif @@ -926,6 +930,9 @@ tic30_aout_set_arch_mach (bfd *abfd, #ifndef MY_find_nearest_line #define MY_find_nearest_line NAME (aout, find_nearest_line) #endif +#ifndef MY_find_line +#define MY_find_line _bfd_nosymbols_find_line +#endif #ifndef MY_find_inliner_info #define MY_find_inliner_info _bfd_nosymbols_find_inliner_info #endif @@ -979,9 +986,6 @@ tic30_aout_set_arch_mach (bfd *abfd, #ifndef MY_bfd_link_hash_table_create #define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create) #endif -#ifndef MY_bfd_link_hash_table_free -#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free -#endif #ifndef MY_bfd_link_add_symbols #define MY_bfd_link_add_symbols NAME (aout, link_add_symbols) #endif diff --git a/bfd/aout0.c b/bfd/aout0.c index a0370e39d..7f093ee81 100644 --- a/bfd/aout0.c +++ b/bfd/aout0.c @@ -1,5 +1,5 @@ /* BFD backend for SunOS style a.out with flags set to 0 - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/aout32.c b/bfd/aout32.c index a6f6df3e2..4d566e413 100644 --- a/bfd/aout32.c +++ b/bfd/aout32.c @@ -1,5 +1,5 @@ /* BFD back-end for 32-bit a.out files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/aout64.c b/bfd/aout64.c index 6474a76e3..212ec844f 100644 --- a/bfd/aout64.c +++ b/bfd/aout64.c @@ -1,5 +1,5 @@ /* BFD back-end for 64-bit a.out files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h index 63c16d978..7f4883545 100644 --- a/bfd/aoutf1.h +++ b/bfd/aoutf1.h @@ -1,5 +1,5 @@ /* A.out "format 1" file handling code for BFD. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 79abe42b2..d4e0fecb6 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1,5 +1,5 @@ /* BFD semi-generic back-end for a.out binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -101,7 +101,7 @@ DESCRIPTION | TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec | TDEPFILES= host-aout.o trad-core.o - in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in} + in the @file{config/@var{XXX}.mt} file, and modify @file{configure.ac} to use the @file{@var{XXX}.mt} file (by setting "<>") when your configuration is selected. */ @@ -793,11 +793,13 @@ NAME (aout, machine_type) (enum bfd_architecture arch, case bfd_mach_mipsisa32r2: case bfd_mach_mipsisa32r3: case bfd_mach_mipsisa32r5: + case bfd_mach_mipsisa32r6: case bfd_mach_mips5: case bfd_mach_mipsisa64: case bfd_mach_mipsisa64r2: case bfd_mach_mipsisa64r3: case bfd_mach_mipsisa64r5: + case bfd_mach_mipsisa64r6: case bfd_mach_mips_sb1: case bfd_mach_mips_xlr: /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ @@ -1298,14 +1300,14 @@ aout_get_external_symbols (bfd *abfd) { bfd_size_type count; struct external_nlist *syms; + bfd_size_type amt = exec_hdr (abfd)->a_syms; - count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE; + count = amt / EXTERNAL_NLIST_SIZE; if (count == 0) return TRUE; /* Nothing to do. */ #ifdef USE_MMAP - if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), - exec_hdr (abfd)->a_syms, + if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), amt, &obj_aout_sym_window (abfd), TRUE)) return FALSE; syms = (struct external_nlist *) obj_aout_sym_window (abfd).data; @@ -1313,20 +1315,16 @@ aout_get_external_symbols (bfd *abfd) /* We allocate using malloc to make the values easy to free later on. If we put them on the objalloc it might not be possible to free them. */ - syms = (struct external_nlist *) bfd_malloc (count * EXTERNAL_NLIST_SIZE); + syms = (struct external_nlist *) bfd_malloc (amt); if (syms == NULL) return FALSE; - { - bfd_size_type amt; - amt = exec_hdr (abfd)->a_syms; - if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 - || bfd_bread (syms, amt, abfd) != amt) - { - free (syms); - return FALSE; - } - } + if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 + || bfd_bread (syms, amt, abfd) != amt) + { + free (syms); + return FALSE; + } #endif obj_aout_external_syms (abfd) = syms; @@ -2638,12 +2636,13 @@ NAME (aout, minisymbol_to_symbol) (bfd *abfd, bfd_boolean NAME (aout, find_nearest_line) (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *disriminator_ptr) { /* Run down the file looking for the filename, function and linenumber. */ asymbol **p; @@ -2661,6 +2660,8 @@ NAME (aout, find_nearest_line) (bfd *abfd, *filename_ptr = abfd->filename; *functionname_ptr = 0; *line_ptr = 0; + if (disriminator_ptr) + *disriminator_ptr = 0; if (symbols != NULL) { @@ -3404,6 +3405,8 @@ aout_link_check_ar_symbols (bfd *abfd, static bfd_boolean aout_link_check_archive_element (bfd *abfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, bfd_boolean *pneeded) { bfd *oldbfd; @@ -5309,7 +5312,7 @@ aout_link_input_bfd (struct aout_final_link_info *flaginfo, bfd *input_bfd) /* Do the final link step. This is called on the output BFD. The INFO structure should point to a list of BFDs linked through the - link_next field which can be used to find each BFD which takes part + link.next field which can be used to find each BFD which takes part in the output. Also, each section in ABFD should point to a list of bfd_link_order structures which list all the input sections for the output section. */ @@ -5356,7 +5359,7 @@ NAME (aout, final_link) (bfd *abfd, max_contents_size = 0; max_relocs_size = 0; max_sym_count = 0; - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { bfd_size_type sz; @@ -5495,7 +5498,7 @@ NAME (aout, final_link) (bfd *abfd, We use the output_has_begun field of the input BFDs to see whether we have already handled it. */ - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) sub->output_has_begun = FALSE; /* Mark all sections which are to be included in the link. This diff --git a/bfd/archive.c b/bfd/archive.c index 157a3f7c4..cc4c52f7b 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -1,5 +1,5 @@ /* BFD back-end for archive files (libraries). - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. This file is part of BFD, the Binary File Descriptor library. @@ -140,6 +140,7 @@ SUBSECTION #include "safe-ctype.h" #include "hashtab.h" #include "filenames.h" +#include "bfdlink.h" #ifndef errno extern int errno; @@ -901,6 +902,10 @@ do_slurp_bsd_armap (bfd *abfd) return FALSE; parsed_size = mapdata->parsed_size; free (mapdata); + /* PR 17512: file: 883ff754. */ + /* PR 17512: file: 0458885f. */ + if (parsed_size < 4) + return FALSE; raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size); if (raw_armap == NULL) @@ -916,7 +921,6 @@ do_slurp_bsd_armap (bfd *abfd) } ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE; - if (ardata->symdef_count * BSD_SYMDEF_SIZE > parsed_size - BSD_SYMDEF_COUNT_SIZE) { @@ -1037,12 +1041,19 @@ do_slurp_coff_armap (bfd *abfd) } /* OK, build the carsyms. */ - for (i = 0; i < nsymz; i++) + for (i = 0; i < nsymz && stringsize > 0; i++) { + bfd_size_type len; + rawptr = raw_armap + i; carsyms->file_offset = swap ((bfd_byte *) rawptr); carsyms->name = stringbase; - stringbase += strlen (stringbase) + 1; + /* PR 17512: file: 4a1d50c1. */ + len = strnlen (stringbase, stringsize); + if (len < stringsize) + len ++; + stringbase += len; + stringsize -= len; carsyms++; } *stringbase = 0; @@ -1130,6 +1141,7 @@ bfd_slurp_armap (bfd *abfd) return FALSE; if (bfd_seek (abfd, -(file_ptr) (sizeof (hdr) + 20), SEEK_CUR) != 0) return FALSE; + extname[20] = 0; if (CONST_STRNEQ (extname, "__.SYMDEF SORTED") || CONST_STRNEQ (extname, "__.SYMDEF")) return do_slurp_bsd_armap (abfd); @@ -1299,6 +1311,8 @@ _bfd_slurp_extended_name_table (bfd *abfd) { byebye: free (namedata); + bfd_ardata (abfd)->extended_names = NULL; + bfd_ardata (abfd)->extended_names_size = 0; return FALSE; } @@ -1315,11 +1329,12 @@ _bfd_slurp_extended_name_table (bfd *abfd) text, the entries in the list are newline-padded, not null padded. In SVR4-style archives, the names also have a trailing '/'. DOS/NT created archive often have \ in them - We'll fix all problems here.. */ + We'll fix all problems here. */ { char *ext_names = bfd_ardata (abfd)->extended_names; char *temp = ext_names; char *limit = temp + namedata->parsed_size; + for (; temp < limit; ++temp) { if (*temp == ARFMAG[1]) @@ -1960,7 +1975,9 @@ bfd_generic_stat_arch_elt (bfd *abfd, struct stat *buf) } hdr = arch_hdr (abfd); - + /* PR 17512: file: 3d9e9fe9. */ + if (hdr == NULL) + return -1; #define foo(arelt, stelt, size) \ buf->stelt = strtol (hdr->arelt, &aloser, size); \ if (aloser == hdr->arelt) \ @@ -2356,6 +2373,10 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) map = new_map; } + if (strcmp (syms[src_count]->name, "__gnu_lto_slim") == 0) + (*_bfd_error_handler) + (_("%s: plugin needed to handle lto object"), + bfd_get_filename (current)); namelen = strlen (syms[src_count]->name); amt = sizeof (char *); map[orl_count].name = (char **) bfd_alloc (arch, amt); @@ -2751,5 +2772,8 @@ _bfd_archive_close_and_cleanup (bfd *abfd) } } } + if (abfd->is_linker_output) + (*abfd->link.hash->hash_table_free) (abfd); + return TRUE; } diff --git a/bfd/archive64.c b/bfd/archive64.c index 6b87ec520..8dbdc7507 100644 --- a/bfd/archive64.c +++ b/bfd/archive64.c @@ -1,5 +1,5 @@ /* Support for 64-bit ELF archives. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. @@ -46,6 +46,7 @@ bfd_elf64_archive_slurp_armap (bfd *abfd) struct areltdata *mapdata; bfd_byte int_buf[8]; char *stringbase; + char *stringend; bfd_byte *raw_armap = NULL; carsym *carsyms; bfd_size_type amt; @@ -92,11 +93,18 @@ bfd_elf64_archive_slurp_armap (bfd *abfd) ptrsize = 8 * nsymz; amt = carsym_size + stringsize + 1; + if (carsym_size < nsymz || ptrsize < nsymz || amt < nsymz) + { + bfd_set_error (bfd_error_malformed_archive); + return FALSE; + } ardata->symdefs = (struct carsym *) bfd_zalloc (abfd, amt); if (ardata->symdefs == NULL) return FALSE; carsyms = ardata->symdefs; stringbase = ((char *) ardata->symdefs) + carsym_size; + stringbase[stringsize] = 0; + stringend = stringbase + stringsize; raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize); if (raw_armap == NULL) @@ -114,7 +122,8 @@ bfd_elf64_archive_slurp_armap (bfd *abfd) { carsyms->file_offset = bfd_getb64 (raw_armap + i * 8); carsyms->name = stringbase; - stringbase += strlen (stringbase) + 1; + if (stringbase < stringend) + stringbase += strlen (stringbase) + 1; ++carsyms; } *stringbase = '\0'; diff --git a/bfd/archures.c b/bfd/archures.c index 9b47504c0..ca20fb2c0 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -1,5 +1,5 @@ /* BFD library support routines for architectures. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -179,15 +179,18 @@ DESCRIPTION .#define bfd_mach_mips_octeon 6501 .#define bfd_mach_mips_octeonp 6601 .#define bfd_mach_mips_octeon2 6502 +.#define bfd_mach_mips_octeon3 6503 .#define bfd_mach_mips_xlr 887682 {* decimal 'XLR' *} .#define bfd_mach_mipsisa32 32 .#define bfd_mach_mipsisa32r2 33 .#define bfd_mach_mipsisa32r3 34 .#define bfd_mach_mipsisa32r5 36 +.#define bfd_mach_mipsisa32r6 37 .#define bfd_mach_mipsisa64 64 .#define bfd_mach_mipsisa64r2 65 .#define bfd_mach_mipsisa64r3 66 .#define bfd_mach_mipsisa64r5 68 +.#define bfd_mach_mipsisa64r6 69 .#define bfd_mach_mips_micromips 96 . bfd_arch_i386, {* Intel 386 *} .#define bfd_mach_i386_intel_syntax (1 << 0) @@ -410,6 +413,7 @@ DESCRIPTION .#define bfd_mach_avr5 5 .#define bfd_mach_avr51 51 .#define bfd_mach_avr6 6 +.#define bfd_mach_avrtiny 100 .#define bfd_mach_avrxmega1 101 .#define bfd_mach_avrxmega2 102 .#define bfd_mach_avrxmega3 103 @@ -493,6 +497,8 @@ DESCRIPTION .#define bfd_mach_aarch64_ilp32 32 . bfd_arch_nios2, .#define bfd_mach_nios2 0 +. bfd_arch_visium, {* Visium *} +.#define bfd_mach_visium 1 . bfd_arch_last . }; */ @@ -612,6 +618,7 @@ extern const bfd_arch_info_type bfd_tilepro_arch; extern const bfd_arch_info_type bfd_v850_arch; extern const bfd_arch_info_type bfd_v850_rh850_arch; extern const bfd_arch_info_type bfd_vax_arch; +extern const bfd_arch_info_type bfd_visium_arch; extern const bfd_arch_info_type bfd_w65_arch; extern const bfd_arch_info_type bfd_we32k_arch; extern const bfd_arch_info_type bfd_xstormy16_arch; @@ -698,6 +705,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_v850_arch, &bfd_v850_rh850_arch, &bfd_vax_arch, + &bfd_visium_arch, &bfd_w65_arch, &bfd_we32k_arch, &bfd_xstormy16_arch, diff --git a/bfd/armnetbsd.c b/bfd/armnetbsd.c index 05b763598..a8a2e3380 100644 --- a/bfd/armnetbsd.c +++ b/bfd/armnetbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for NetBSD/ARM a.out-ish binaries. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 83f125bd8..4b3738023 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -1,6 +1,6 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -658,7 +658,7 @@ extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info +extern int bfd_elf_discard_info (bfd *, struct bfd_link_info *); extern unsigned int _bfd_elf_default_action_discarded (struct bfd_section *); @@ -806,12 +806,6 @@ struct internal_syment; union internal_auxent; #endif -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - extern bfd_boolean bfd_coff_set_symbol_class (bfd *, struct bfd_symbol *, unsigned int); @@ -937,10 +931,10 @@ extern void bfd_elf32_aarch64_init_maps (bfd *); extern void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); + (bfd *, struct bfd_link_info *, int, int, int, int); extern void bfd_elf32_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); + (bfd *, struct bfd_link_info *, int, int, int, int); /* ELF AArch64 mapping symbol support. */ #define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) @@ -991,23 +985,3 @@ extern void bfd_elf32_ia64_after_parse extern void bfd_elf64_ia64_after_parse (int); - -/* 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 coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info * bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 8b7f2eef4..b718f10d0 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -7,7 +7,7 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -665,7 +665,7 @@ extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info +extern int bfd_elf_discard_info (bfd *, struct bfd_link_info *); extern unsigned int _bfd_elf_default_action_discarded (struct bfd_section *); @@ -813,12 +813,6 @@ struct internal_syment; union internal_auxent; #endif -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - extern bfd_boolean bfd_coff_set_symbol_class (bfd *, struct bfd_symbol *, unsigned int); @@ -944,10 +938,10 @@ extern void bfd_elf32_aarch64_init_maps (bfd *); extern void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); + (bfd *, struct bfd_link_info *, int, int, int, int); extern void bfd_elf32_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); + (bfd *, struct bfd_link_info *, int, int, int, int); /* ELF AArch64 mapping symbol support. */ #define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) @@ -998,30 +992,11 @@ extern void bfd_elf32_ia64_after_parse extern void bfd_elf64_ia64_after_parse (int); - -/* 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 coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info * bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); /* Extracted from init.c. */ void bfd_init (void); /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1206,6 +1181,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1964,15 +1940,18 @@ enum bfd_architecture #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 +#define bfd_mach_mips_octeon3 6503 #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 #define bfd_mach_mipsisa32r3 34 #define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 #define bfd_mach_mipsisa64r3 66 #define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_intel_syntax (1 << 0) @@ -2195,6 +2174,7 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 +#define bfd_mach_avrtiny 100 #define bfd_mach_avrxmega1 101 #define bfd_mach_avrxmega2 102 #define bfd_mach_avrxmega3 103 @@ -2278,6 +2258,8 @@ enum bfd_architecture #define bfd_mach_aarch64_ilp32 32 bfd_arch_nios2, #define bfd_mach_nios2 0 + bfd_arch_visium, /* Visium */ +#define bfd_mach_visium 1 bfd_arch_last }; @@ -2343,6 +2325,7 @@ unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { /* No errors detected. */ @@ -2392,6 +2375,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2410,6 +2394,7 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; +struct bfd_symbol; /* Forward declaration. */ struct reloc_howto_struct { @@ -2937,6 +2922,12 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -3942,6 +3933,13 @@ and shift left by 0 for use in lbi.gp, sbi.gp... */ BFD_RELOC_NDS32_15_FIXED, BFD_RELOC_NDS32_17_FIXED, BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, /* for PIC */ BFD_RELOC_NDS32_PLTREL_HI20, @@ -4002,12 +4000,32 @@ This is a 5 bit absolute address. */ BFD_RELOC_NDS32_DIFF16, BFD_RELOC_NDS32_DIFF32, BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ BFD_RELOC_NDS32_DATA, BFD_RELOC_NDS32_TRAN, BFD_RELOC_NDS32_17IFC_PCREL, BFD_RELOC_NDS32_10IFCU_PCREL, +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_TPOFF, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -4475,6 +4493,18 @@ value. */ BFD_RELOC_AVR_DIFF16, BFD_RELOC_AVR_DIFF32, +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -6013,7 +6043,17 @@ assembler and not (currently) written to any object files. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -6211,6 +6251,7 @@ bfd_boolean bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -6221,9 +6262,6 @@ enum bfd_direction struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -6246,17 +6284,17 @@ struct bfd /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ - flagword flags; + flagword flags : 17; /* Values that may appear in the flags field of a BFD. These also appear in the object_flags field of the bfd_target structure, where @@ -6315,26 +6353,23 @@ struct bfd struct. */ #define BFD_IN_MEMORY 0x800 - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 - /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ @@ -6345,6 +6380,42 @@ struct bfd (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + /* 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. */ @@ -6369,17 +6440,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -6394,12 +6469,12 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union @@ -6451,39 +6526,6 @@ struct bfd struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; }; /* See note beside bfd_set_section_userdata. */ @@ -6494,6 +6536,7 @@ bfd_set_cacheable (bfd * abfd, bfd_boolean val) return TRUE; } + typedef enum bfd_error { bfd_error_no_error = 0, @@ -6529,6 +6572,7 @@ const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); + typedef void (*bfd_error_handler_type) (const char *, ...); bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); @@ -6537,6 +6581,7 @@ void bfd_set_error_program_name (const char *); bfd_error_handler_type bfd_get_error_handler (void); + typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, const char *bfd_file, @@ -6592,12 +6637,12 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6646,9 +6691,6 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6958,12 +7000,12 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ @@ -6980,14 +7022,14 @@ typedef struct bfd_target void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, symbol_info *); #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) + (bfd *, struct bfd_symbol *, bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma, const char **, const char **, unsigned int *, unsigned int *); bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, struct bfd_symbol *, @@ -7041,7 +7083,6 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ @@ -7068,16 +7109,14 @@ typedef struct bfd_target struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) void (*_bfd_copy_link_hash_symbol_type) diff --git a/bfd/bfd.c b/bfd/bfd.c index 41de1bbd4..29a7c5d2b 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1,5 +1,5 @@ /* Generic BFD library interface and support routines. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -46,9 +46,6 @@ CODE_FRAGMENT . .struct bfd .{ -. {* A unique identifier of the BFD *} -. unsigned int id; -. . {* The filename the application opened the BFD with. *} . const char *filename; . @@ -71,17 +68,17 @@ CODE_FRAGMENT . {* File modified time, if mtime_set is TRUE. *} . long mtime; . -. {* Reserved for an unimplemented file locking extension. *} -. int ifd; +. {* A unique identifier of the BFD *} +. unsigned int id; . . {* The format which belongs to the BFD. (object, core, etc.) *} -. bfd_format format; +. ENUM_BITFIELD (bfd_format) format : 3; . . {* The direction with which the BFD was opened. *} -. enum bfd_direction direction; +. ENUM_BITFIELD (bfd_direction) direction : 2; . . {* Format_specific flags. *} -. flagword flags; +. flagword flags : 17; . . {* Values that may appear in the flags field of a BFD. These also . appear in the object_flags field of the bfd_target structure, where @@ -140,26 +137,23 @@ CODE_FRAGMENT . struct. *} .#define BFD_IN_MEMORY 0x800 . -. {* The sections in this BFD specify a memory page. *} -.#define HAS_LOAD_PAGE 0x1000 -. . {* This BFD has been created by the linker and doesn't correspond . to any input file. *} -.#define BFD_LINKER_CREATED 0x2000 +.#define BFD_LINKER_CREATED 0x1000 . . {* This may be set before writing out a BFD to request that it . be written using values for UIDs, GIDs, timestamps, etc. that . will be consistent from run to run. *} -.#define BFD_DETERMINISTIC_OUTPUT 0x4000 +.#define BFD_DETERMINISTIC_OUTPUT 0x2000 . . {* Compress sections in this BFD. *} -.#define BFD_COMPRESS 0x8000 +.#define BFD_COMPRESS 0x4000 . . {* Decompress sections in this BFD. *} -.#define BFD_DECOMPRESS 0x10000 +.#define BFD_DECOMPRESS 0x8000 . . {* BFD is a dummy, for plugins. *} -.#define BFD_PLUGIN 0x20000 +.#define BFD_PLUGIN 0x10000 . . {* Flags bits to be saved in bfd_preserve_save. *} .#define BFD_FLAGS_SAVED \ @@ -170,6 +164,42 @@ CODE_FRAGMENT . (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ . | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) . +. {* Is the file descriptor being cached? That is, can it be closed as +. needed, and re-opened when accessed later? *} +. unsigned int cacheable : 1; +. +. {* Marks whether there was a default target specified when the +. BFD was opened. This is used to select which matching algorithm +. to use to choose the back end. *} +. unsigned int target_defaulted : 1; +. +. {* ... and here: (``once'' means at least once). *} +. unsigned int opened_once : 1; +. +. {* Set if we have a locally maintained mtime value, rather than +. getting it from the file each time. *} +. unsigned int mtime_set : 1; +. +. {* Flag set if symbols from this BFD should not be exported. *} +. unsigned int no_export : 1; +. +. {* Remember when output has begun, to stop strange things +. from happening. *} +. unsigned int output_has_begun : 1; +. +. {* Have archive map. *} +. unsigned int has_armap : 1; +. +. {* Set if this is a thin archive. *} +. unsigned int is_thin_archive : 1; +. +. {* Set if only required symbols should be added in the link hash table for +. this object. Used by VMS linkers. *} +. unsigned int selective_search : 1; +. +. {* Set if this is the linker output BFD. *} +. unsigned int is_linker_output : 1; +. . {* 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. *} @@ -194,17 +224,21 @@ CODE_FRAGMENT . {* The number of sections. *} . unsigned int section_count; . +. {* A field used by _bfd_generic_link_add_archive_symbols. This will +. be used only for archive elements. *} +. int archive_pass; +. . {* Stuff only useful for object files: . The start address. *} . bfd_vma start_address; . -. {* Used for input and output. *} -. unsigned int symcount; -. . {* Symbol table for output BFD (with symcount entries). . Also used by the linker to cache input BFD symbols. *} . struct bfd_symbol **outsymbols; . +. {* Used for input and output. *} +. unsigned int symcount; +. . {* Used for slurped dynamic symbol tables. *} . unsigned int dynsymcount; . @@ -219,12 +253,12 @@ CODE_FRAGMENT . struct bfd *nested_archives; {* List of nested archive in a flattened . thin archive. *} . -. {* A chain of BFD structures involved in a link. *} -. struct bfd *link_next; -. -. {* A field used by _bfd_generic_link_add_archive_symbols. This will -. be used only for archive elements. *} -. int archive_pass; +. union { +. {* For input BFDs, a chain of BFDs involved in a link. *} +. struct bfd *next; +. {* For output BFD, the linker hash table. *} +. struct bfd_link_hash_table *hash; +. } link; . . {* Used by the back end to hold private data. *} . union @@ -276,39 +310,6 @@ CODE_FRAGMENT . struct objalloc *, but we use void * to avoid requiring the inclusion . of objalloc.h. *} . void *memory; -. -. {* Is the file descriptor being cached? That is, can it be closed as -. needed, and re-opened when accessed later? *} -. unsigned int cacheable : 1; -. -. {* Marks whether there was a default target specified when the -. BFD was opened. This is used to select which matching algorithm -. to use to choose the back end. *} -. unsigned int target_defaulted : 1; -. -. {* ... and here: (``once'' means at least once). *} -. unsigned int opened_once : 1; -. -. {* Set if we have a locally maintained mtime value, rather than -. getting it from the file each time. *} -. unsigned int mtime_set : 1; -. -. {* Flag set if symbols from this BFD should not be exported. *} -. unsigned int no_export : 1; -. -. {* Remember when output has begun, to stop strange things -. from happening. *} -. unsigned int output_has_begun : 1; -. -. {* Have archive map. *} -. unsigned int has_armap : 1; -. -. {* Set if this is a thin archive. *} -. unsigned int is_thin_archive : 1; -. -. {* Set if only required symbols should be added in the link hash table for -. this object. Used by VMS linkers. *} -. unsigned int selective_search : 1; .}; . .{* See note beside bfd_set_section_userdata. *} @@ -1443,12 +1444,12 @@ DESCRIPTION . .#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)) +. (abfd, syms, sec, off, file, func, line, NULL)) . .#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ . line, disc) \ -. BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ -. (abfd, sec, syms, off, file, func, line, disc)) +. BFD_SEND (abfd, _bfd_find_nearest_line, \ +. (abfd, syms, sec, off, file, func, line, disc)) . .#define bfd_find_line(abfd, syms, sym, file, line) \ . BFD_SEND (abfd, _bfd_find_line, \ @@ -1497,9 +1498,6 @@ DESCRIPTION .#define bfd_link_hash_table_create(abfd) \ . BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) . -.#define bfd_link_hash_table_free(abfd, hash) \ -. BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) -. .#define bfd_link_add_symbols(abfd, info) \ . BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) . diff --git a/bfd/bfd.m4 b/bfd/bfd.m4 index 6b711e24a..aa28847f1 100644 --- a/bfd/bfd.m4 +++ b/bfd/bfd.m4 @@ -1,6 +1,6 @@ dnl This file was derived from acinclude.m4. dnl -dnl Copyright (C) 2012-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. dnl dnl This file is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by diff --git a/bfd/bfdio.c b/bfd/bfdio.c index 14619f58f..89406e3c7 100644 --- a/bfd/bfdio.c +++ b/bfd/bfdio.c @@ -1,6 +1,6 @@ /* Low-level I/O routines for BFDs. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/bfd/bfdwin.c b/bfd/bfdwin.c index 2af868aa3..d133656ab 100644 --- a/bfd/bfdwin.c +++ b/bfd/bfdwin.c @@ -1,5 +1,5 @@ /* Support for memory-mapped windows into a BFD. - Copyright (C) 1995-2014 Free Software Foundation, Inc. + Copyright (C) 1995-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/binary.c b/bfd/binary.c index 13825d205..9ed61aa9c 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -1,5 +1,5 @@ /* BFD back-end for binary objects. - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, This file is part of BFD, the Binary File Descriptor library. @@ -190,6 +190,8 @@ binary_canonicalize_symtab (bfd *abfd, asymbol **alocation) #define binary_make_empty_symbol _bfd_generic_make_empty_symbol #define binary_print_symbol _bfd_nosymbols_print_symbol +#define binary_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string /* Get information about a symbol. */ @@ -204,6 +206,7 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define binary_bfd_is_local_label_name bfd_generic_is_local_label_name #define binary_get_lineno _bfd_nosymbols_get_lineno #define binary_find_nearest_line _bfd_nosymbols_find_nearest_line +#define binary_find_line _bfd_nosymbols_find_line #define binary_find_inliner_info _bfd_nosymbols_find_inliner_info #define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define binary_read_minisymbols _bfd_generic_read_minisymbols @@ -305,7 +308,6 @@ binary_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define binary_section_already_linked _bfd_generic_section_already_linked #define binary_bfd_define_common_symbol bfd_generic_define_common_symbol #define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define binary_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define binary_bfd_link_just_syms _bfd_generic_link_just_syms #define binary_bfd_copy_link_hash_symbol_type \ _bfd_generic_copy_link_hash_symbol_type diff --git a/bfd/bout.c b/bfd/bout.c index fddc77d07..8ca3c782b 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 960 b.out binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -1374,10 +1374,11 @@ b_out_bfd_get_relocated_section_contents (bfd *output_bfd, /* Build the transfer vectors for Big and Little-Endian B.OUT files. */ +#define aout_32_find_line _bfd_nosymbols_find_line +#define aout_32_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info #define b_out_bfd_link_hash_table_create _bfd_generic_link_hash_table_create -#define b_out_bfd_link_hash_table_free _bfd_generic_link_hash_table_free #define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols #define b_out_bfd_link_just_syms _bfd_generic_link_just_syms #define b_out_bfd_copy_link_hash_symbol_type \ diff --git a/bfd/cache.c b/bfd/cache.c index 27fe70a84..94a82daff 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -1,6 +1,6 @@ /* BFD library -- caching of file descriptors. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). @@ -310,7 +310,7 @@ cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes) if (nread == (file_ptr)-1) { bfd_set_error (bfd_error_system_call); - return -1; + return nread; } #else nread = fread (buf, 1, nbytes, f); @@ -320,7 +320,7 @@ cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes) if (nread < nbytes && ferror (f)) { bfd_set_error (bfd_error_system_call); - return -1; + return nread; } #endif if (nread < nbytes) diff --git a/bfd/cf-i386lynx.c b/bfd/cf-i386lynx.c index 480c27577..73bd5da8f 100644 --- a/bfd/cf-i386lynx.c +++ b/bfd/cf-i386lynx.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 COFF LynxOS files. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cf-sparclynx.c b/bfd/cf-sparclynx.c index 2be004849..d127fbc94 100644 --- a/bfd/cf-sparclynx.c +++ b/bfd/cf-sparclynx.c @@ -1,5 +1,5 @@ /* BFD back-end for Sparc COFF LynxOS files. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c index 36845a280..50f1458e7 100644 --- a/bfd/cisco-core.c +++ b/bfd/cisco-core.c @@ -1,5 +1,5 @@ /* BFD back-end for CISCO crash dumps. - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index 0e78088ad..0fdbded0a 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -1,5 +1,5 @@ /* BFD back-end for ALPHA Extended-Coff files. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c index 2c755986e..14a54831b 100644 --- a/bfd/coff-apollo.c +++ b/bfd/coff-apollo.c @@ -1,5 +1,5 @@ /* BFD back-end for Apollo 68000 COFF binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. By Troy Rollo (troy@cbme.unsw.edu.au) Based on m68k standard COFF version Written by Cygnus Support. diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index d47b77e35..74ce0172b 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for ARM COFF files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-aux.c b/bfd/coff-aux.c index e79c77ae5..1f8a81f09 100644 --- a/bfd/coff-aux.c +++ b/bfd/coff-aux.c @@ -1,5 +1,5 @@ /* BFD back-end for Apple M68K COFF A/UX 3.x files. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Written by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -73,20 +73,17 @@ coff_m68k_aux_link_add_one_symbol (struct bfd_link_info *info, bfd_boolean collect, struct bfd_link_hash_entry **hashp) { - struct bfd_link_hash_entry *h; + struct bfd_link_hash_entry *h, *inh, *t; - if ((flags & (BSF_WARNING | BSF_CONSTRUCTOR | BSF_WEAK)) == 0 && - !bfd_is_und_section (section) && - !bfd_is_com_section (section)) + if ((flags & (BSF_WARNING | BSF_CONSTRUCTOR | BSF_WEAK)) == 0 + && !bfd_is_und_section (section) + && !bfd_is_com_section (section)) { /* The new symbol is a definition or an indirect definition */ /* This bit copied from linker.c */ if (hashp != NULL && *hashp != NULL) - { - h = *hashp; - BFD_ASSERT (strcmp (h->root.string, name) == 0); - } + h = *hashp; else { h = bfd_link_hash_lookup (info->hash, name, TRUE, copy, FALSE); @@ -98,37 +95,46 @@ coff_m68k_aux_link_add_one_symbol (struct bfd_link_info *info, } } - if (info->notice_hash != (struct bfd_hash_table *) NULL - && (bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) - != (struct bfd_hash_entry *) NULL)) - { - if (! (*info->callbacks->notice) (info, h, abfd, section, value, - flags, string)) - return FALSE; - } - if (hashp != (struct bfd_link_hash_entry **) NULL) *hashp = h; /* end duplication from linker.c */ - if (h->type == bfd_link_hash_defined - || h->type == bfd_link_hash_indirect) + t = h; + inh = NULL; + if (h->type == bfd_link_hash_indirect) { - asection *msec; + inh = h->u.i.link; + t = inh; + } - if (h->type == bfd_link_hash_defined) - msec = h->u.def.section; - else - msec = bfd_ind_section_ptr; + if (t->type == bfd_link_hash_defined) + { + asection *msec = t->u.def.section; + bfd_boolean special = FALSE; if (bfd_is_abs_section (msec) && !bfd_is_abs_section (section)) { - h->u.def.section = section; - h->u.def.value = value; - return TRUE; + t->u.def.section = section; + t->u.def.value = value; + special = TRUE; } else if (bfd_is_abs_section (section) && !bfd_is_abs_section (msec)) - return TRUE; + special = TRUE; + + if (special) + { + if (info->notice_all + || (info->notice_hash != NULL + && bfd_hash_lookup (info->notice_hash, name, + FALSE, FALSE) != NULL)) + { + if (!(*info->callbacks->notice) (info, h, inh, + abfd, section, value, flags)) + return FALSE; + } + + return TRUE; + } } } diff --git a/bfd/coff-bfd.c b/bfd/coff-bfd.c new file mode 100644 index 000000000..21337bf76 --- /dev/null +++ b/bfd/coff-bfd.c @@ -0,0 +1,99 @@ +/* BFD COFF interfaces used outside of BFD. + Copyright (C) 1990-2015 Free Software Foundation, Inc. + Written 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 3 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., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "sysdep.h" +#include "bfd.h" +#include "libbfd.h" +#include "coff/internal.h" +#include "libcoff.h" + +/* Return the COFF syment for a symbol. */ + +bfd_boolean +bfd_coff_get_syment (bfd *abfd, + asymbol *symbol, + struct internal_syment *psyment) +{ + coff_symbol_type *csym; + + csym = coff_symbol_from (symbol); + if (csym == NULL || csym->native == NULL + || ! csym->native->is_sym) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + *psyment = csym->native->u.syment; + + if (csym->native->fix_value) + psyment->n_value = psyment->n_value - + (bfd_hostptr_t) obj_raw_syments (abfd); + + /* FIXME: We should handle fix_line here. */ + + return TRUE; +} + +/* Return the COFF auxent for a symbol. */ + +bfd_boolean +bfd_coff_get_auxent (bfd *abfd, + asymbol *symbol, + int indx, + union internal_auxent *pauxent) +{ + coff_symbol_type *csym; + combined_entry_type *ent; + + csym = coff_symbol_from (symbol); + + if (csym == NULL + || csym->native == NULL + || ! csym->native->is_sym + || indx >= csym->native->u.syment.n_numaux) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + ent = csym->native + indx + 1; + + BFD_ASSERT (! ent->is_sym); + *pauxent = ent->u.auxent; + + if (ent->fix_tag) + pauxent->x_sym.x_tagndx.l = + ((combined_entry_type *) pauxent->x_sym.x_tagndx.p + - obj_raw_syments (abfd)); + + if (ent->fix_end) + pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l = + ((combined_entry_type *) pauxent->x_sym.x_fcnary.x_fcn.x_endndx.p + - obj_raw_syments (abfd)); + + if (ent->fix_scnlen) + pauxent->x_csect.x_scnlen.l = + ((combined_entry_type *) pauxent->x_csect.x_scnlen.p + - obj_raw_syments (abfd)); + + return TRUE; +} diff --git a/bfd/coff-bfd.h b/bfd/coff-bfd.h new file mode 100644 index 000000000..1ca5f69f9 --- /dev/null +++ b/bfd/coff-bfd.h @@ -0,0 +1,86 @@ +/* BFD COFF interfaces used outside of BFD. + Copyright (C) 1990-2015 Free Software Foundation, Inc. + Written 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 3 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., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +/* 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 coff_comdat_info +{ + /* The name of the symbol associated with a comdat section. */ + const char *name; + + /* The local symbol table index of the symbol associated with a + comdat section. This is only meaningful to the object file format + specific code; it is not an index into the list returned by + bfd_canonicalize_symtab. */ + long symbol; +}; + +/* The used_by_bfd field of a section may be set to a pointer to this + structure. */ + +struct coff_section_tdata +{ + /* The relocs, swapped into COFF internal form. This may be NULL. */ + struct internal_reloc *relocs; + /* If this is TRUE, the relocs entry may not be freed. */ + bfd_boolean keep_relocs; + /* The section contents. This may be NULL. */ + bfd_byte *contents; + /* If this is TRUE, the contents entry may not be freed. */ + bfd_boolean keep_contents; + /* Information cached by coff_find_nearest_line. */ + bfd_vma offset; + unsigned int i; + const char *function; + /* Optional information about a COMDAT entry; NULL if not COMDAT. */ + struct coff_comdat_info *comdat; + int line_base; + /* A pointer used for .stab linking optimizations. */ + void * stab_info; + /* Available for individual backends. */ + void * tdata; +}; + +/* An accessor macro for the coff_section_tdata structure. */ +#define coff_section_data(abfd, sec) \ + ((struct coff_section_tdata *) (sec)->used_by_bfd) + +#define bfd_coff_get_comdat_section(abfd, sec) \ + ((bfd_get_flavour (abfd) == bfd_target_coff_flavour \ + && coff_section_data (abfd, sec) != NULL) \ + ? coff_section_data (abfd, sec)->comdat : NULL) + +#define coff_symbol_from(symbol) \ + ((bfd_family_coff (bfd_asymbol_bfd (symbol)) \ + && bfd_asymbol_bfd (symbol)->tdata.coff_obj_data) \ + ? (coff_symbol_type *) (symbol) : NULL) + +struct internal_syment; +union internal_auxent; + +extern bfd_boolean bfd_coff_get_syment + (bfd *, struct bfd_symbol *, struct internal_syment *); + +extern bfd_boolean bfd_coff_get_auxent + (bfd *, struct bfd_symbol *, int, union internal_auxent *); diff --git a/bfd/coff-go32.c b/bfd/coff-go32.c index 479726506..f67895f68 100644 --- a/bfd/coff-go32.c +++ b/bfd/coff-go32.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 COFF files (DJGPP variant). - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by DJ Delorie. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index 5ec48c960..86945acab 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -1,5 +1,5 @@ /* BFD back-end for Renesas H8/300 COFF binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Steve Chamberlain, . This file is part of BFD, the Binary File Descriptor library. @@ -337,7 +337,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst) internal->howto = howto_table + 19; break; default: - abort (); + internal->howto = NULL; break; } } diff --git a/bfd/coff-h8500.c b/bfd/coff-h8500.c index 574f95648..052de7b21 100644 --- a/bfd/coff-h8500.c +++ b/bfd/coff-h8500.c @@ -1,5 +1,5 @@ /* BFD back-end for Renesas H8/500 COFF binaries. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -95,7 +95,7 @@ rtype2howto (arelent * internal, struct internal_reloc *dst) switch (dst->r_type) { default: - abort (); + internal->howto = NULL; break; case R_H8500_IMM8: internal->howto = &r_imm8; diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 6a9dbcaf9..20d240204 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 COFF files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -340,16 +340,18 @@ static reloc_howto_type howto_table[] = PCRELOFFSET) /* pcrel_offset */ }; +#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0])) + /* Turn a howto into a reloc nunmber */ #define SELECT_RELOC(x,howto) { x.r_type = howto->type; } #define BADMAG(x) I386BADMAG(x) #define I386 1 /* Customize coffcode.h */ -#define RTYPE2HOWTO(cache_ptr, dst) \ - ((cache_ptr)->howto = \ - ((dst)->r_type < sizeof (howto_table) / sizeof (howto_table[0]) \ - ? howto_table + (dst)->r_type \ +#define RTYPE2HOWTO(cache_ptr, dst) \ + ((cache_ptr)->howto = \ + ((dst)->r_type < NUM_HOWTOS \ + ? howto_table + (dst)->r_type \ : NULL)) /* For 386 COFF a STYP_NOLOAD | STYP_BSS section is part of a shared @@ -377,7 +379,7 @@ static reloc_howto_type howto_table[] = coffsym = (obj_symbols (abfd) \ + (cache_ptr->sym_ptr_ptr - symbols)); \ else if (ptr) \ - coffsym = coff_symbol_from (abfd, ptr); \ + coffsym = coff_symbol_from (ptr); \ if (coffsym != (coff_symbol_type *) NULL \ && coffsym->native->u.syment.n_scnum == 0) \ cache_ptr->addend = - coffsym->native->u.syment.n_value; \ @@ -386,7 +388,8 @@ static reloc_howto_type howto_table[] = cache_ptr->addend = - (ptr->section->vma + ptr->value); \ else \ cache_ptr->addend = 0; \ - if (ptr && howto_table[reloc.r_type].pc_relative) \ + if (ptr && reloc.r_type < NUM_HOWTOS \ + && howto_table[reloc.r_type].pc_relative) \ cache_ptr->addend += asect->vma; \ } @@ -438,7 +441,7 @@ coff_i386_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, { reloc_howto_type *howto; - if (rel->r_type >= sizeof (howto_table) / sizeof (howto_table[0])) + if (rel->r_type >= NUM_HOWTOS) { bfd_set_error (bfd_error_bad_value); return NULL; @@ -574,7 +577,7 @@ coff_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, { unsigned int i; - for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + for (i = 0; i < NUM_HOWTOS; i++) if (howto_table[i].name != NULL && strcasecmp (howto_table[i].name, r_name) == 0) return &howto_table[i]; @@ -605,9 +608,6 @@ coff_i386_is_local_label_name (bfd *abfd, const char *name) #include "coffcode.h" -#define _bfd_generic_find_nearest_line_discriminator \ - coff_find_nearest_line_discriminator - const bfd_target #ifdef TARGET_SYM TARGET_SYM = diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index 341183f16..8573a8deb 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel i860 COFF files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in coff-i386.c Harry Dolan , October 1995 @@ -467,7 +467,10 @@ static reloc_howto_type howto_table[] = FIXME: This macro refers to symbols and asect; these are from the calling function, not the macro arguments. */ -#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) +/* PR 17512: file: 0a38fb7c + Set an addend value, even if it is not going to be used. A tool + like coffdump might be used to print out the contents of the reloc. */ +#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) (cache_ptr)->addend = 0 /* We use the special COFF backend linker. */ #define coff_relocate_section _bfd_coff_generic_relocate_section diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index 144825763..dbd197f49 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 960 COFF files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -62,22 +62,22 @@ coff_i960_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name) /* This is just like the usual CALC_ADDEND, but it includes the section VMA for PC relative relocs. */ #ifndef CALC_ADDEND -#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ - { \ - coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \ - if (ptr && bfd_asymbol_bfd (ptr) != abfd) \ - coffsym = (obj_symbols (abfd) \ - + (cache_ptr->sym_ptr_ptr - symbols)); \ - else if (ptr) \ - coffsym = coff_symbol_from (abfd, ptr); \ - if (coffsym != (coff_symbol_type *) NULL \ - && coffsym->native->u.syment.n_scnum == 0) \ - cache_ptr->addend = 0; \ - else if (ptr && bfd_asymbol_bfd (ptr) == abfd \ - && ptr->section != (asection *) NULL) \ - cache_ptr->addend = - (ptr->section->vma + ptr->value); \ - else \ - cache_ptr->addend = 0; \ +#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ + { \ + coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \ + if (ptr && bfd_asymbol_bfd (ptr) != abfd) \ + coffsym = (obj_symbols (abfd) \ + + (cache_ptr->sym_ptr_ptr - symbols)); \ + else if (ptr) \ + coffsym = coff_symbol_from (ptr); \ + if (coffsym != (coff_symbol_type *) NULL \ + && coffsym->native->u.syment.n_scnum == 0) \ + cache_ptr->addend = 0; \ + else if (ptr && bfd_asymbol_bfd (ptr) == abfd \ + && ptr->section != (asection *) NULL) \ + cache_ptr->addend = - (ptr->section->vma + ptr->value); \ + else \ + cache_ptr->addend = 0; \ if (ptr && (reloc.r_type == 25 || reloc.r_type == 27)) \ cache_ptr->addend += asect->vma; \ } diff --git a/bfd/coff-ia64.c b/bfd/coff-ia64.c index 38a0a381f..0df3a9e34 100644 --- a/bfd/coff-ia64.c +++ b/bfd/coff-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 COFF files. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -47,7 +47,7 @@ static reloc_howto_type howto_table[] = #endif #define RTYPE2HOWTO(cache_ptr, dst) \ - (cache_ptr)->howto = howto_table + (dst)->r_type; + (cache_ptr)->howto = howto_table; #ifdef COFF_WITH_PE /* Return TRUE if this relocation should diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index f7089a681..e90aec72f 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola 68000 COFF binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -143,6 +143,7 @@ m68k_rtype2howto (arelent *internal, int relocentry) case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break; case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break; case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break; + default: internal->howto = NULL; break; } } @@ -359,7 +360,7 @@ m68kcoff_common_addend_special_fn (bfd *abfd, coffsym = (obj_symbols (abfd) \ + (cache_ptr->sym_ptr_ptr - symbols)); \ else if (ptr) \ - coffsym = coff_symbol_from (abfd, ptr); \ + coffsym = coff_symbol_from (ptr); \ if (coffsym != (coff_symbol_type *) NULL \ && coffsym->native->u.syment.n_scnum == 0) \ cache_ptr->addend = - coffsym->native->u.syment.n_value; \ diff --git a/bfd/coff-m88k.c b/bfd/coff-m88k.c index 7d474f951..a6e01cc38 100644 --- a/bfd/coff-m88k.c +++ b/bfd/coff-m88k.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola 88000 COFF "Binary Compatibility Standard" files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c index 7dad44fdc..45d491743 100644 --- a/bfd/coff-mcore.c +++ b/bfd/coff-mcore.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola MCore COFF/PE - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -273,16 +273,15 @@ mcore_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, } #undef HOW2MAP +#define NUM_HOWTOS NUM_ELEM (mcore_coff_howto_table) + static reloc_howto_type * mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) { unsigned int i; - for (i = 0; - i < (sizeof (mcore_coff_howto_table) - / sizeof (mcore_coff_howto_table[0])); - i++) + for (i = 0; i < NUM_HOWTOS; i++) if (mcore_coff_howto_table[i].name != NULL && strcasecmp (mcore_coff_howto_table[i].name, r_name) == 0) return &mcore_coff_howto_table[i]; @@ -290,8 +289,11 @@ mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } -#define RTYPE2HOWTO(cache_ptr, dst) \ - (cache_ptr)->howto = mcore_coff_howto_table + (dst)->r_type; +#define RTYPE2HOWTO(cache_ptr, dst) \ + ((cache_ptr)->howto = \ + ((dst)->r_type < NUM_HOWTOS \ + ? mcore_coff_howto_table + (dst)->r_type \ + : NULL)) static reloc_howto_type * coff_mcore_rtype_to_howto (bfd * abfd ATTRIBUTE_UNUSED, @@ -303,7 +305,7 @@ coff_mcore_rtype_to_howto (bfd * abfd ATTRIBUTE_UNUSED, { reloc_howto_type * howto; - if (rel->r_type >= NUM_ELEM (mcore_coff_howto_table)) + if (rel->r_type >= NUM_HOWTOS) return NULL; howto = mcore_coff_howto_table + rel->r_type; diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 298671c11..a49057218 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1,5 +1,5 @@ /* BFD back-end for MIPS Extended-Coff files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index cf173a284..237980d6a 100644 --- a/bfd/coff-ppc.c +++ b/bfd/coff-ppc.c @@ -1,5 +1,5 @@ /* BFD back-end for PowerPC Microsoft Portable Executable files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Original version pieced together by Kim Knuttila (krk@cygnus.com) @@ -1073,10 +1073,11 @@ coff_ppc_relocate_section (bfd *output_bfd, { /* It is a file local symbol. */ int *local_toc_table; - const char *name; + char name[SYMNMLEN + 1]; sym = syms + symndx; - name = sym->_n._n_name; + strncpy (name, sym->_n._n_name, SYMNMLEN); + name[SYMNMLEN] = '\0'; local_toc_table = obj_coff_local_toc_table(input_bfd); our_toc_offset = local_toc_table[symndx]; @@ -1225,9 +1226,14 @@ coff_ppc_relocate_section (bfd *output_bfd, case IMAGE_REL_PPC_ABSOLUTE: { const char *my_name; + char buf[SYMNMLEN + 1]; if (h == 0) - my_name = (syms+symndx)->_n._n_name; + { + strncpy (buf, (syms+symndx)->_n._n_name, SYMNMLEN); + buf[SYMNMLEN] = '\0'; + my_name = buf; + } else my_name = h->root.root.root.string; @@ -1288,11 +1294,8 @@ coff_ppc_relocate_section (bfd *output_bfd, } if (h == 0) - { - /* It is a file local symbol. */ - sym = syms + symndx; - name = sym->_n._n_name; - } + /* It is a file local symbol. */ + sym = syms + symndx; else { char *target = 0; @@ -2149,7 +2152,7 @@ ppc_bfd_coff_final_link (bfd *abfd, struct bfd_link_info *info) the opportunity to clear the output_has_begun fields of all the input BFD's. */ max_sym_count = 0; - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { bfd_size_type sz; diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 4c41740a5..8fbfa16ad 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF" files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Metin G. Ozisik, Mimi Phuong-Thao Vo, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -430,39 +430,6 @@ static const struct dwarf_debug_section xcoff_debug_sections[] = { NULL, NULL }, /* .debug_weaknames */ { NULL, NULL }, }; - -static bfd_boolean -xcoff_find_nearest_line (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr) -{ - return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - -static bfd_boolean -xcoff_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator) -{ - *discriminator = 0; - return coff_find_nearest_line_with_names (abfd, xcoff_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - void _bfd_xcoff_swap_sym_in (bfd *abfd, void * ext1, void * in1) @@ -2608,7 +2575,7 @@ _bfd_xcoff_sizeof_headers (bfd *abfd, return -1; /* Sum. */ - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) for (s = sub->sections; s != NULL; s = s->next) { struct nbr_reloc_lineno *e = &n_rl[s->output_section->index]; @@ -4041,13 +4008,14 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { #define _bfd_xcoff_make_empty_symbol coff_make_empty_symbol #define _bfd_xcoff_print_symbol coff_print_symbol #define _bfd_xcoff_get_symbol_info coff_get_symbol_info +#define _bfd_xcoff_get_symbol_version_string \ + _bfd_nosymbols_get_symbol_version_string #define _bfd_xcoff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define _bfd_xcoff_bfd_is_target_special_symbol \ coff_bfd_is_target_special_symbol #define _bfd_xcoff_get_lineno coff_get_lineno -#define _bfd_xcoff_find_nearest_line xcoff_find_nearest_line -#define _bfd_generic_find_nearest_line_discriminator \ - xcoff_find_nearest_line_discriminator +#define _bfd_xcoff_find_nearest_line coff_find_nearest_line +#define _bfd_xcoff_find_line coff_find_line #define _bfd_xcoff_find_inliner_info coff_find_inliner_info #define _bfd_xcoff_bfd_make_debug_symbol coff_bfd_make_debug_symbol #define _bfd_xcoff_read_minisymbols _bfd_generic_read_minisymbols diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index 23e32ec63..5fb4da2b8 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -1,5 +1,5 @@ /* BFD back-end for Renesas Super-H COFF binaries. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . Relaxing code written by Ian Lance Taylor, . @@ -530,22 +530,22 @@ sh_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* This is the same as the macro in coffcode.h, except that it copies r_offset into reloc_entry->addend for some relocs. */ -#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ - { \ - coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \ - if (ptr && bfd_asymbol_bfd (ptr) != abfd) \ - coffsym = (obj_symbols (abfd) \ - + (cache_ptr->sym_ptr_ptr - symbols)); \ - else if (ptr) \ - coffsym = coff_symbol_from (abfd, ptr); \ - if (coffsym != (coff_symbol_type *) NULL \ - && coffsym->native->u.syment.n_scnum == 0) \ - cache_ptr->addend = 0; \ - else if (ptr && bfd_asymbol_bfd (ptr) == abfd \ - && ptr->section != (asection *) NULL) \ - cache_ptr->addend = - (ptr->section->vma + ptr->value); \ - else \ - cache_ptr->addend = 0; \ +#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \ + { \ + coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \ + if (ptr && bfd_asymbol_bfd (ptr) != abfd) \ + coffsym = (obj_symbols (abfd) \ + + (cache_ptr->sym_ptr_ptr - symbols)); \ + else if (ptr) \ + coffsym = coff_symbol_from (ptr); \ + if (coffsym != (coff_symbol_type *) NULL \ + && coffsym->native->u.syment.n_scnum == 0) \ + cache_ptr->addend = 0; \ + else if (ptr && bfd_asymbol_bfd (ptr) == abfd \ + && ptr->section != (asection *) NULL) \ + cache_ptr->addend = - (ptr->section->vma + ptr->value); \ + else \ + cache_ptr->addend = 0; \ if ((reloc).r_type == R_SH_SWITCH8 \ || (reloc).r_type == R_SH_SWITCH16 \ || (reloc).r_type == R_SH_SWITCH32 \ diff --git a/bfd/coff-sparc.c b/bfd/coff-sparc.c index 031dcd085..232ceface 100644 --- a/bfd/coff-sparc.c +++ b/bfd/coff-sparc.c @@ -1,5 +1,5 @@ /* BFD back-end for Sparc COFF files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-stgo32.c b/bfd/coff-stgo32.c index 4dc90149e..5efd69cd5 100644 --- a/bfd/coff-stgo32.c +++ b/bfd/coff-stgo32.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub). - Copyright (C) 1997-2014 Free Software Foundation, Inc. + Copyright (C) 1997-2015 Free Software Foundation, Inc. Written by Robert Hoehne. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-svm68k.c b/bfd/coff-svm68k.c index f759abbe2..8e733bff3 100644 --- a/bfd/coff-svm68k.c +++ b/bfd/coff-svm68k.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola sysv68 - Copyright (C) 1997-2014 Free Software Foundation, Inc. + Copyright (C) 1997-2015 Free Software Foundation, Inc. Written by Philippe De Muyter . This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-tic30.c b/bfd/coff-tic30.c index 740c82c86..545ac5e93 100644 --- a/bfd/coff-tic30.c +++ b/bfd/coff-tic30.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 coff binaries. - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 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. @@ -136,7 +136,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst) internal->howto = &tic30_coff_howto_table[4]; break; default: - abort (); + internal->howto = NULL; break; } } diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c index 36a890154..e6cd95d2b 100644 --- a/bfd/coff-tic4x.c +++ b/bfd/coff-tic4x.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C4X coff binaries. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) @@ -261,30 +261,30 @@ tic4x_reloc_processing (arelent *relent, /* TI COFF v0, DOS tools (little-endian headers). */ CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff0_vec, "coff0-tic4x", - HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_', + 0, SEC_CODE | SEC_READONLY, '_', NULL, &ticoff0_swap_table); /* TI COFF v0, SPARC tools (big-endian headers). */ CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff0_beh_vec, "coff0-beh-tic4x", - HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_', + 0, SEC_CODE | SEC_READONLY, '_', &tic4x_coff0_vec, &ticoff0_swap_table); /* TI COFF v1, DOS tools (little-endian headers). */ CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff1_vec, "coff1-tic4x", - HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_', + 0, SEC_CODE | SEC_READONLY, '_', &tic4x_coff0_beh_vec, &ticoff1_swap_table); /* TI COFF v1, SPARC tools (big-endian headers). */ CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff1_beh_vec, "coff1-beh-tic4x", - HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_', + 0, SEC_CODE | SEC_READONLY, '_', &tic4x_coff1_vec, &ticoff1_swap_table); /* TI COFF v2, TI DOS tools output (little-endian headers). */ CREATE_LITTLE_COFF_TARGET_VEC(tic4x_coff2_vec, "coff2-tic4x", - HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_', + 0, SEC_CODE | SEC_READONLY, '_', &tic4x_coff1_beh_vec, COFF_SWAP_TABLE); /* TI COFF v2, TI SPARC tools output (big-endian headers). */ CREATE_BIGHDR_COFF_TARGET_VEC(tic4x_coff2_beh_vec, "coff2-beh-tic4x", - HAS_LOAD_PAGE, SEC_CODE | SEC_READONLY, '_', + 0, SEC_CODE | SEC_READONLY, '_', &tic4x_coff2_vec, COFF_SWAP_TABLE); diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c index 3027c9e87..600b1fe0f 100644 --- a/bfd/coff-tic54x.c +++ b/bfd/coff-tic54x.c @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C54X coff binaries. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c index 80bb05ef1..10d50f0aa 100644 --- a/bfd/coff-tic80.c +++ b/bfd/coff-tic80.c @@ -1,5 +1,5 @@ /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP). - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Written by Fred Fish (fnf@cygnus.com) diff --git a/bfd/coff-u68k.c b/bfd/coff-u68k.c index 260853ce1..d07f7cd87 100644 --- a/bfd/coff-u68k.c +++ b/bfd/coff-u68k.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola 68000 COFF binaries having underscore with name. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c index f2087308a..1872feb74 100644 --- a/bfd/coff-w65.c +++ b/bfd/coff-w65.c @@ -1,5 +1,5 @@ /* BFD back-end for WDC 65816 COFF binaries. - Copyright (C) 1995-2014 Free Software Foundation, Inc. + Copyright (C) 1995-2015 Free Software Foundation, Inc. Written by Steve Chamberlain, . This file is part of BFD, the Binary File Descriptor library. @@ -31,16 +31,18 @@ static reloc_howto_type howto_table[] = { HOWTO (R_W65_ABS8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), - HOWTO (R_W65_ABS16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), - HOWTO (R_W65_ABS24, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "abs24", TRUE, 0x00ffffff, 0x00ffffff, FALSE), - HOWTO (R_W65_ABS8S8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, ">abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), - HOWTO (R_W65_ABS8S16, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "^abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), - HOWTO (R_W65_ABS16S8, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, ">abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), - HOWTO (R_W65_ABS16S16,1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "^abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), - HOWTO (R_W65_PCR8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "pcrel8", TRUE, 0x000000ff, 0x000000ff, TRUE), - HOWTO (R_W65_PCR16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "pcrel16", TRUE, 0x0000ffff, 0x0000ffff, TRUE), - HOWTO (R_W65_DP, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "dp", TRUE, 0x000000ff, 0x000000ff, FALSE), - }; + HOWTO (R_W65_ABS16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), + HOWTO (R_W65_ABS24, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "abs24", TRUE, 0x00ffffff, 0x00ffffff, FALSE), + HOWTO (R_W65_ABS8S8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, ">abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), + HOWTO (R_W65_ABS8S16, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "^abs8", TRUE, 0x000000ff, 0x000000ff, FALSE), + HOWTO (R_W65_ABS16S8, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, ">abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), + HOWTO (R_W65_ABS16S16,1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "^abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE), + HOWTO (R_W65_PCR8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "pcrel8", TRUE, 0x000000ff, 0x000000ff, TRUE), + HOWTO (R_W65_PCR16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "pcrel16", TRUE, 0x0000ffff, 0x0000ffff, TRUE), + HOWTO (R_W65_DP, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "dp", TRUE, 0x000000ff, 0x000000ff, FALSE), +}; + +#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0])) /* Turn a howto into a reloc number. */ @@ -61,7 +63,7 @@ static reloc_howto_type howto_table[] = static int select_reloc (reloc_howto_type *howto) { - return howto->type ; + return howto->type; } /* Code to turn a r_type into a howto ptr, uses the above howto table. */ @@ -70,7 +72,10 @@ static void rtype2howto (arelent *internal, struct internal_reloc *dst) { - internal->howto = howto_table + dst->r_type - 1; + if (dst->r_type > 0 && dst->r_type <= NUM_HOWTOS) + internal->howto = howto_table + dst->r_type - 1; + else + internal->howto = NULL; } #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) diff --git a/bfd/coff-we32k.c b/bfd/coff-we32k.c index d5481b8ff..7dba256d7 100644 --- a/bfd/coff-we32k.c +++ b/bfd/coff-we32k.c @@ -1,5 +1,5 @@ /* BFD back-end for we32k COFF files. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@cs.widener.edu). This file is part of BFD, the Binary File Descriptor library. @@ -53,14 +53,19 @@ static reloc_howto_type howto_table[] = HOWTO(R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE), }; +#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0])) + /* Turn a howto into a reloc nunmber */ #define SELECT_RELOC(x,howto) { x.r_type = howto->type; } #define BADMAG(x) WE32KBADMAG(x) #define WE32K 1 -#define RTYPE2HOWTO(cache_ptr, dst) \ - (cache_ptr)->howto = howto_table + (dst)->r_type; +#define RTYPE2HOWTO(cache_ptr, dst) \ + ((cache_ptr)->howto = \ + ((dst)->r_type < NUM_HOWTOS \ + ? howto_table + (dst)->r_type \ + : NULL)) #ifndef bfd_pe_print_pdata #define bfd_pe_print_pdata NULL diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c index 682658fcb..fb5971d63 100644 --- a/bfd/coff-x86_64.c +++ b/bfd/coff-x86_64.c @@ -1,5 +1,5 @@ /* BFD back-end for AMD 64 COFF files. - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -143,6 +143,16 @@ coff_amd64_reloc (bfd *abfd, reloc_howto_type *howto = reloc_entry->howto; unsigned char *addr = (unsigned char *) data + reloc_entry->address; + /* FIXME: We do not have an end address for data, so we cannot + accurately range check any addresses computed against it. + cf: PR binutils/17512: file: 1085-1761-0.004. + For now we do the best that we can. */ + if (addr < (unsigned char *) data || addr > ((unsigned char *) data) + input_section->size) + { + bfd_set_error (bfd_error_bad_value); + return bfd_reloc_notsupported; + } + switch (howto->size) { case 0: @@ -177,7 +187,8 @@ coff_amd64_reloc (bfd *abfd, break; default: - abort (); + bfd_set_error (bfd_error_bad_value); + return bfd_reloc_notsupported; } } @@ -448,6 +459,8 @@ static reloc_howto_type howto_table[] = PCRELOFFSET) /* pcrel_offset */ }; +#define NUM_HOWTOS ARRAY_SIZE (howto_table) + /* Turn a howto into a reloc nunmber */ #define SELECT_RELOC(x,howto) { x.r_type = howto->type; } @@ -456,7 +469,7 @@ static reloc_howto_type howto_table[] = #define RTYPE2HOWTO(cache_ptr, dst) \ ((cache_ptr)->howto = \ - ((dst)->r_type < ARRAY_SIZE (howto_table)) \ + ((dst)->r_type < NUM_HOWTOS) \ ? howto_table + (dst)->r_type \ : NULL) @@ -486,7 +499,7 @@ static reloc_howto_type howto_table[] = coffsym = (obj_symbols (abfd) \ + (cache_ptr->sym_ptr_ptr - symbols)); \ else if (ptr) \ - coffsym = coff_symbol_from (abfd, ptr); \ + coffsym = coff_symbol_from (ptr); \ \ if (coffsym != NULL \ && coffsym->native->u.syment.n_scnum == 0) \ @@ -496,7 +509,8 @@ static reloc_howto_type howto_table[] = cache_ptr->addend = - (ptr->section->vma + ptr->value); \ else \ cache_ptr->addend = 0; \ - if (ptr && howto_table[reloc.r_type].pc_relative) \ + if (ptr && reloc.r_type < NUM_HOWTOS \ + && howto_table[reloc.r_type].pc_relative) \ cache_ptr->addend += asect->vma; \ } @@ -546,7 +560,7 @@ coff_amd64_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, { reloc_howto_type *howto; - if (rel->r_type >= ARRAY_SIZE (howto_table)) + if (rel->r_type >= NUM_HOWTOS) { bfd_set_error (bfd_error_bad_value); return NULL; @@ -689,7 +703,7 @@ coff_amd64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, { unsigned int i; - for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) + for (i = 0; i < NUM_HOWTOS; i++) if (howto_table[i].name != NULL && strcasecmp (howto_table[i].name, r_name) == 0) return &howto_table[i]; @@ -730,9 +744,6 @@ coff_amd64_is_local_label_name (bfd *abfd, const char *name) #define amd64coff_object_p coff_object_p #endif -#define _bfd_generic_find_nearest_line_discriminator \ - coff_find_nearest_line_discriminator - const bfd_target #ifdef TARGET_SYM TARGET_SYM = diff --git a/bfd/coff-z80.c b/bfd/coff-z80.c index 7b62cdf14..786cf9528 100644 --- a/bfd/coff-z80.c +++ b/bfd/coff-z80.c @@ -1,5 +1,5 @@ /* BFD back-end for Zilog Z80 COFF binaries. - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. Contributed by Arnold Metselaar This file is part of BFD, the Binary File Descriptor library. @@ -81,7 +81,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst) switch (dst->r_type) { default: - abort (); + internal->howto = NULL; break; case R_IMM8: internal->howto = &r_imm8; diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c index c85713ff8..25e63a4b6 100644 --- a/bfd/coff-z8k.c +++ b/bfd/coff-z8k.c @@ -1,5 +1,5 @@ /* BFD back-end for Zilog Z800n COFF binaries. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Steve Chamberlain, . @@ -85,7 +85,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst) switch (dst->r_type) { default: - abort (); + internal->howto = NULL; break; case R_IMM8: internal->howto = &r_imm8; diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index eb3b05b08..ba984694f 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -2712,12 +2712,12 @@ const bfd_target rs6000_xcoff64_vec = coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, + coff_get_symbol_version_string, _bfd_xcoff_is_local_label_name, coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, - _bfd_generic_find_nearest_line_discriminator, - _bfd_generic_find_line, + coff_find_line, coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, @@ -2738,7 +2738,6 @@ const bfd_target rs6000_xcoff64_vec = bfd_generic_get_relocated_section_contents, bfd_generic_relax_section, _bfd_xcoff_bfd_link_hash_table_create, - _bfd_generic_link_hash_table_free, _bfd_xcoff_bfd_link_add_symbols, _bfd_generic_link_just_syms, _bfd_generic_copy_link_hash_symbol_type, @@ -2971,12 +2970,12 @@ const bfd_target rs6000_xcoff64_aix_vec = coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, + coff_get_symbol_version_string, _bfd_xcoff_is_local_label_name, coff_bfd_is_target_special_symbol, coff_get_lineno, coff_find_nearest_line, - _bfd_generic_find_nearest_line_discriminator, - _bfd_generic_find_line, + coff_find_line, coff_find_inliner_info, coff_bfd_make_debug_symbol, _bfd_generic_read_minisymbols, @@ -2997,7 +2996,6 @@ const bfd_target rs6000_xcoff64_aix_vec = bfd_generic_get_relocated_section_contents, bfd_generic_relax_section, _bfd_xcoff_bfd_link_hash_table_create, - _bfd_generic_link_hash_table_free, _bfd_xcoff_bfd_link_add_symbols, _bfd_generic_link_just_syms, _bfd_generic_copy_link_hash_symbol_type, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index ba3cfa276..9e1c20acf 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1,5 +1,5 @@ /* Support for the generic parts of most COFF variants, for BFD. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -307,7 +307,7 @@ CODE_FRAGMENT .typedef struct coff_ptr_struct .{ . {* Remembers the offset from the first symbol in the file for -. this symbol. Generated by coff_renumber_symbols. *} +. this symbol. Generated by coff_renumber_symbols. *} . unsigned int offset; . . {* Should the value of this symbol be renumbered. Used for @@ -315,15 +315,15 @@ CODE_FRAGMENT . unsigned int fix_value : 1; . . {* Should the tag field of this symbol be renumbered. -. Created by coff_pointerize_aux. *} +. Created by coff_pointerize_aux. *} . unsigned int fix_tag : 1; . . {* Should the endidx field of this symbol be renumbered. -. Created by coff_pointerize_aux. *} +. Created by coff_pointerize_aux. *} . unsigned int fix_end : 1; . . {* Should the x_csect.x_scnlen field be renumbered. -. Created by coff_pointerize_aux. *} +. Created by coff_pointerize_aux. *} . unsigned int fix_scnlen : 1; . . {* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the @@ -331,12 +331,15 @@ CODE_FRAGMENT . unsigned int fix_line : 1; . . {* The container for the symbol structure as read and translated -. from the file. *} +. from the file. *} . union . { . union internal_auxent auxent; . struct internal_syment syment; . } u; +. +. {* Selector for the union above. *} +. bfd_boolean is_sym; .} combined_entry_type; . . @@ -928,12 +931,7 @@ handle_COMDAT (bfd * abfd, bfd_coff_swap_sym_in (abfd, esym, & isym); - if (sizeof (internal_s->s_name) > SYMNMLEN) - { - /* This case implies that the matching - symbol name will be in the string table. */ - abort (); - } + BFD_ASSERT (sizeof (internal_s->s_name) <= SYMNMLEN); if (isym.n_scnum == section->target_index) { @@ -964,8 +962,12 @@ handle_COMDAT (bfd * abfd, /* All 3 branches use this. */ symname = _bfd_coff_internal_syment_name (abfd, &isym, buf); + /* PR 17512 file: 078-11867-0.004 */ if (symname == NULL) - abort (); + { + _bfd_error_handler (_("%B: unable to load COMDAT section name"), abfd); + break; + } switch (seen_state) { @@ -1797,6 +1799,7 @@ coff_new_section_hook (bfd * abfd, asection * section) in case this symbol winds up getting written out. The value 0 for n_numaux is already correct. */ + native->is_sym = TRUE; native->u.syment.n_type = T_NULL; native->u.syment.n_sclass = sclass; @@ -2498,11 +2501,13 @@ coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED, unsigned int indaux, combined_entry_type *aux) { + BFD_ASSERT (symbol->is_sym); int n_sclass = symbol->u.syment.n_sclass; if (CSECT_SYM_P (n_sclass) && indaux + 1 == symbol->u.syment.n_numaux) { + BFD_ASSERT (! aux->is_sym); if (SMTYP_SMTYP (aux->u.auxent.x_csect.x_smtyp) == XTY_LD) { aux->u.auxent.x_csect.x_scnlen.p = @@ -2535,6 +2540,7 @@ coff_pointerize_aux_hook (bfd *abfd ATTRIBUTE_UNUSED, /* Return TRUE if we don't want to pointerize this aux entry, which is the case for the lastfirst aux entry for a C_LEAFPROC symbol. */ return (indaux == 1 + && symbol->is_sym && (symbol->u.syment.n_sclass == C_LEAFPROC || symbol->u.syment.n_sclass == C_LEAFSTAT || symbol->u.syment.n_sclass == C_LEAFEXT)); @@ -2557,6 +2563,8 @@ coff_print_aux (bfd *abfd ATTRIBUTE_UNUSED, combined_entry_type *aux ATTRIBUTE_UNUSED, unsigned int indaux ATTRIBUTE_UNUSED) { + BFD_ASSERT (symbol->is_sym); + BFD_ASSERT (! aux->is_sym); #ifdef RS6000COFF_C if (CSECT_SYM_P (symbol->u.syment.n_sclass) && indaux + 1 == symbol->u.syment.n_numaux) @@ -3134,7 +3142,8 @@ coff_compute_section_file_positions (bfd * abfd) #ifdef COFF_IMAGE_WITH_PE int page_size; - if (coff_data (abfd)->link_info) + if (coff_data (abfd)->link_info + || (pe_data (abfd) && pe_data (abfd)->pe_opthdr.FileAlignment)) { page_size = pe_data (abfd)->pe_opthdr.FileAlignment; @@ -3165,9 +3174,10 @@ coff_compute_section_file_positions (bfd * abfd) { coff_symbol_type *cf; - cf = coff_symbol_from (abfd, *symp); + cf = coff_symbol_from (*symp); if (cf != NULL && cf->native != NULL + && cf->native->is_sym && SYMNAME_IN_DEBUG (&cf->native->u.syment)) { size_t len; @@ -3862,9 +3872,10 @@ coff_write_object_contents (bfd * abfd) /* See if this is the section symbol. */ if (strcmp ((*psym)->name, current->name) == 0) { - csym = coff_symbol_from (abfd, *psym); + csym = coff_symbol_from (*psym); if (csym == NULL || csym->native == NULL + || ! csym->native->is_sym || csym->native->u.syment.n_numaux < 1 || csym->native->u.syment.n_sclass != C_STAT || csym->native->u.syment.n_type != T_NULL) @@ -3887,6 +3898,7 @@ coff_write_object_contents (bfd * abfd) x_associated field is not currently supported. */ aux = csym->native + 1; + BFD_ASSERT (! aux->is_sym); switch (current->flags & SEC_LINK_DUPLICATES) { case SEC_LINK_DUPLICATES_DISCARD: @@ -4032,8 +4044,6 @@ coff_write_object_contents (bfd * abfd) internal_f.f_flags |= F_DYNLOAD; #endif - memset (&internal_a, 0, sizeof internal_a); - /* Set up architecture-dependent stuff. */ { unsigned int magic = 0; @@ -4455,11 +4465,11 @@ buy_and_read (bfd *abfd, file_ptr where, bfd_size_type size) void * area = bfd_alloc (abfd, size); if (!area) - return (NULL); + return NULL; if (bfd_seek (abfd, where, SEEK_SET) != 0 || bfd_bread (area, size, abfd) != size) - return (NULL); - return (area); + return NULL; + return area; } /* @@ -4493,6 +4503,8 @@ coff_sort_func_alent (const void * arg1, const void * arg2) const coff_symbol_type *s1 = (const coff_symbol_type *) (al1->u.sym); const coff_symbol_type *s2 = (const coff_symbol_type *) (al2->u.sym); + if (s1 == NULL || s2 == NULL) + return 0; if (s1->symbol.value < s2->symbol.value) return -1; else if (s1->symbol.value > s2->symbol.value) @@ -4510,9 +4522,10 @@ coff_slurp_line_table (bfd *abfd, asection *asect) unsigned int counter; alent *cache_ptr; bfd_vma prev_offset = 0; - int ordered = 1; + bfd_boolean ordered = TRUE; unsigned int nbr_func; LINENO *src; + bfd_boolean have_func; BFD_ASSERT (asect->lineno == NULL); @@ -4535,57 +4548,85 @@ coff_slurp_line_table (bfd *abfd, asection *asect) asect->lineno = lineno_cache; src = native_lineno; nbr_func = 0; + have_func = FALSE; - for (counter = 0; counter < asect->lineno_count; counter++) + for (counter = 0; counter < asect->lineno_count; counter++, src++) { struct internal_lineno dst; bfd_coff_swap_lineno_in (abfd, src, &dst); cache_ptr->line_number = dst.l_lnno; + /* Appease memory checkers that get all excited about + uninitialised memory when copying alents if u.offset is + larger than u.sym. (64-bit BFD on 32-bit host.) */ + memset (&cache_ptr->u, 0, sizeof (cache_ptr->u)); if (cache_ptr->line_number == 0) { - bfd_boolean warned; - bfd_signed_vma symndx; + combined_entry_type * ent; + bfd_vma symndx; coff_symbol_type *sym; - nbr_func++; - warned = FALSE; + have_func = FALSE; symndx = dst.l_addr.l_symndx; - if (symndx < 0 - || (bfd_vma) symndx >= obj_raw_syment_count (abfd)) + if (symndx >= obj_raw_syment_count (abfd)) { (*_bfd_error_handler) - (_("%B: warning: illegal symbol index %ld in line numbers"), - abfd, (long) symndx); - symndx = 0; - warned = TRUE; + (_("%B: warning: illegal symbol index 0x%lx in line number entry %d"), + abfd, (long) symndx, counter); + cache_ptr->line_number = -1; + continue; } + ent = obj_raw_syments (abfd) + symndx; /* FIXME: We should not be casting between ints and pointers like this. */ - sym = ((coff_symbol_type *) - ((symndx + obj_raw_syments (abfd)) - ->u.syment._n._n_n._n_zeroes)); + if (! ent->is_sym) + { + (*_bfd_error_handler) + (_("%B: warning: illegal symbol index 0x%lx in line number entry %d"), + abfd, (long) symndx, counter); + cache_ptr->line_number = -1; + continue; + } + sym = (coff_symbol_type *) (ent->u.syment._n._n_n._n_zeroes); + + /* PR 17512 file: 078-10659-0.004 */ + if (sym < obj_symbols (abfd) + || sym >= obj_symbols (abfd) + bfd_get_symcount (abfd)) + { + (*_bfd_error_handler) + (_("%B: warning: illegal symbol in line number entry %d"), + abfd, counter); + cache_ptr->line_number = -1; + continue; + } + + have_func = TRUE; + nbr_func++; cache_ptr->u.sym = (asymbol *) sym; - if (sym->lineno != NULL && ! warned) + if (sym->lineno != NULL) (*_bfd_error_handler) (_("%B: warning: duplicate line number information for `%s'"), abfd, bfd_asymbol_name (&sym->symbol)); sym->lineno = cache_ptr; if (sym->symbol.value < prev_offset) - ordered = 0; + ordered = FALSE; prev_offset = sym->symbol.value; } + else if (!have_func) + /* Drop line information that has no associated function. + PR 17521: file: 078-10659-0.004. */ + continue; else - cache_ptr->u.offset = dst.l_addr.l_paddr - - bfd_section_vma (abfd, asect); - + cache_ptr->u.offset = (dst.l_addr.l_paddr + - bfd_section_vma (abfd, asect)); cache_ptr++; - src++; } - cache_ptr->line_number = 0; + + asect->lineno_count = cache_ptr - lineno_cache; + memset (cache_ptr, 0, sizeof (*cache_ptr)); bfd_release (abfd, native_lineno); /* On some systems (eg AIX5.3) the lineno table may not be sorted. */ @@ -4602,15 +4643,17 @@ coff_slurp_line_table (bfd *abfd, asection *asect) alent **p = func_table; unsigned int i; - for (i = 0; i < counter; i++) + for (i = 0; i < asect->lineno_count; i++) if (lineno_cache[i].line_number == 0) *p++ = &lineno_cache[i]; + BFD_ASSERT ((unsigned int) (p - func_table) == nbr_func); + /* Sort by functions. */ qsort (func_table, nbr_func, sizeof (alent *), coff_sort_func_alent); /* Create the new sorted table. */ - amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent); + amt = (bfd_size_type) asect->lineno_count * sizeof (alent); n_lineno_cache = (alent *) bfd_alloc (abfd, amt); if (n_lineno_cache != NULL) { @@ -4621,18 +4664,18 @@ coff_slurp_line_table (bfd *abfd, asection *asect) coff_symbol_type *sym; alent *old_ptr = func_table[i]; - /* Copy the function entry and update it. */ - *n_cache_ptr = *old_ptr; - sym = (coff_symbol_type *)n_cache_ptr->u.sym; - sym->lineno = n_cache_ptr; - n_cache_ptr++; - old_ptr++; - - /* Copy the line number entries. */ - while (old_ptr->line_number != 0) + /* Update the function entry. */ + sym = (coff_symbol_type *) old_ptr->u.sym; + /* PR binutils/17512: Point the lineno to where + this entry will be after the memcpy below. */ + sym->lineno = lineno_cache + (n_cache_ptr - n_lineno_cache); + /* Copy the function and line number entries. */ + do *n_cache_ptr++ = *old_ptr++; + while (old_ptr->line_number != 0); } - n_cache_ptr->line_number = 0; + BFD_ASSERT ((bfd_size_type) (n_cache_ptr - n_lineno_cache) == (amt / sizeof (alent))); + memcpy (lineno_cache, n_lineno_cache, amt); } bfd_release (abfd, func_table); @@ -4671,7 +4714,7 @@ coff_slurp_symbol_table (bfd * abfd) amt = obj_raw_syment_count (abfd); amt *= sizeof (unsigned int); - table_ptr = (unsigned int *) bfd_alloc (abfd, amt); + table_ptr = (unsigned int *) bfd_zalloc (abfd, amt); if (table_ptr == NULL) return FALSE; @@ -4685,14 +4728,17 @@ coff_slurp_symbol_table (bfd * abfd) { combined_entry_type *src = native_symbols + this_index; table_ptr[this_index] = number_of_symbols; - dst->symbol.the_bfd = abfd; + dst->symbol.the_bfd = abfd; + BFD_ASSERT (src->is_sym); dst->symbol.name = (char *) (src->u.syment._n._n_n._n_offset); /* We use the native name field to point to the cached field. */ src->u.syment._n._n_n._n_zeroes = (bfd_hostptr_t) dst; dst->symbol.section = coff_section_from_bfd_index (abfd, src->u.syment.n_scnum); dst->symbol.flags = 0; + /* PR 17512: file: 079-7098-0.001:0.1. */ + dst->symbol.value = 0; dst->done_lineno = FALSE; switch (src->u.syment.n_sclass) @@ -4966,22 +5012,22 @@ coff_slurp_symbol_table (bfd * abfd) #if defined(TIC80COFF) || defined(TICOFF) case C_UEXT: /* Tentative external definition. */ #endif - case C_EXTLAB: /* External load time label. */ - case C_HIDDEN: /* Ext symbol in dmert public lib. */ default: (*_bfd_error_handler) (_("%B: Unrecognized storage class %d for %s symbol `%s'"), abfd, src->u.syment.n_sclass, dst->symbol.section->name, dst->symbol.name); + case C_EXTLAB: /* External load time label. */ + case C_HIDDEN: /* Ext symbol in dmert public lib. */ dst->symbol.flags = BSF_DEBUGGING; dst->symbol.value = (src->u.syment.n_value); break; } dst->native = src; - dst->symbol.udata.i = 0; dst->lineno = NULL; + this_index += (src->u.syment.n_numaux) + 1; dst++; number_of_symbols++; @@ -5000,7 +5046,8 @@ coff_slurp_symbol_table (bfd * abfd) p = abfd->sections; while (p) { - coff_slurp_line_table (abfd, p); + if (! coff_slurp_line_table (abfd, p)) + return FALSE; p = p->next; } } @@ -5064,13 +5111,13 @@ coff_classify_symbol (bfd *abfd, if (syment->n_value == 0) { asection *sec; - char buf[SYMNMLEN + 1]; - - sec = coff_section_from_bfd_index (abfd, syment->n_scnum); - if (sec != NULL - && (strcmp (bfd_get_section_name (abfd, sec), - _bfd_coff_internal_syment_name (abfd, syment, buf)) - == 0)) + char * name; + char buf[SYMNMLEN + 1]; + + name = _bfd_coff_internal_syment_name (abfd, syment, buf) + sec = coff_section_from_bfd_index (abfd, syment->n_scnum); + if (sec != NULL && name != NULL + && (strcmp (bfd_get_section_name (abfd, sec), name) == 0)) return COFF_SYMBOL_PE_SECTION; } #endif @@ -5139,8 +5186,9 @@ SUBSUBSECTION coffsym = (obj_symbols (abfd) \ + (cache_ptr->sym_ptr_ptr - symbols)); \ else if (ptr) \ - coffsym = coff_symbol_from (abfd, ptr); \ + coffsym = coff_symbol_from (ptr); \ if (coffsym != NULL \ + && coffsym->native->is_sym \ && coffsym->native->u.syment.n_scnum == 0) \ cache_ptr->addend = 0; \ else if (ptr && bfd_asymbol_bfd (ptr) == abfd \ @@ -5263,7 +5311,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols) static reloc_howto_type * coff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, asection *sec ATTRIBUTE_UNUSED, - struct internal_reloc *rel, + struct internal_reloc *rel ATTRIBUTE_UNUSED, struct coff_link_hash_entry *h ATTRIBUTE_UNUSED, struct internal_syment *sym ATTRIBUTE_UNUSED, bfd_vma *addendp ATTRIBUTE_UNUSED) @@ -5355,10 +5403,6 @@ dummy_reloc16_extra_cases (bfd *abfd ATTRIBUTE_UNUSED, } #endif -#ifndef coff_bfd_link_hash_table_free -#define coff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free -#endif - /* If coff_relocate_section is defined, we can use the optimized COFF backend linker. Otherwise we must continue to use the old linker. */ @@ -5590,7 +5634,7 @@ static bfd_coff_backend_data ticoff1_swap_table = #endif #ifdef COFF_WITH_PE_BIGOBJ -/* The UUID for bigobj files. */ +/* The UID for bigobj files. */ static const char header_bigobj_classid[16] = { diff --git a/bfd/coffgen.c b/bfd/coffgen.c index a7d5e485b..aa015597b 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1,5 +1,5 @@ /* Support for the generic parts of COFF, for BFD. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -84,9 +84,8 @@ make_a_section_from_file (bfd *abfd, strings = _bfd_coff_read_string_table (abfd); if (strings == NULL) return FALSE; - /* FIXME: For extra safety, we should make sure that - strindex does not run us past the end, but right now we - don't know the length of the string table. */ + if ((bfd_size_type)(strindex + 2) >= obj_coff_strings_len (abfd)) + return FALSE; strings += strindex; name = (char *) bfd_alloc (abfd, (bfd_size_type) strlen (strings) + 1 + 1); @@ -147,8 +146,9 @@ make_a_section_from_file (bfd *abfd, /* Compress/decompress DWARF debug sections with names: .debug_* and .zdebug_*, after the section flags is set. */ if ((flags & SEC_DEBUGGING) + && strlen (name) > 7 && ((name[1] == 'd' && name[6] == '_') - || (name[1] == 'z' && name[7] == '_'))) + || (strlen (name) > 8 && name[1] == 'z' && name[7] == '_'))) { enum { nothing, compress, decompress } action = nothing; char *new_name = NULL; @@ -366,6 +366,10 @@ coff_object_p (bfd *abfd) bfd_release (abfd, opthdr); return NULL; } + /* PR 17512: file: 11056-1136-0.004. */ + if (internal_f.f_opthdr < aoutsz) + memset (((char *) opthdr) + internal_f.f_opthdr, 0, aoutsz - internal_f.f_opthdr); + bfd_coff_swap_aouthdr_in (abfd, opthdr, (void *) &internal_a); bfd_release (abfd, opthdr); } @@ -464,6 +468,8 @@ _bfd_coff_internal_syment_name (bfd *abfd, if (strings == NULL) return NULL; } + if (sym->_n._n_n._n_offset >= obj_coff_strings_len (abfd)) + return NULL; return strings + sym->_n._n_n._n_offset; } } @@ -627,22 +633,6 @@ coff_count_linenumbers (bfd *abfd) return total; } -/* Takes a bfd and a symbol, returns a pointer to the coff specific - area of the symbol if there is one. */ - -coff_symbol_type * -coff_symbol_from (bfd *ignore_abfd ATTRIBUTE_UNUSED, - asymbol *symbol) -{ - if (!bfd_family_coff (bfd_asymbol_bfd (symbol))) - return (coff_symbol_type *) NULL; - - if (bfd_asymbol_bfd (symbol)->tdata.coff_obj_data == (coff_data_type *) NULL) - return (coff_symbol_type *) NULL; - - return (coff_symbol_type *) symbol; -} - static void fixup_symbol_value (bfd *abfd, coff_symbol_type *coff_symbol_ptr, @@ -759,13 +749,16 @@ coff_renumber_symbols (bfd *bfd_ptr, int *first_undef) for (symbol_index = 0; symbol_index < symbol_count; symbol_index++) { - coff_symbol_type *coff_symbol_ptr = coff_symbol_from (bfd_ptr, symbol_ptr_ptr[symbol_index]); + coff_symbol_type *coff_symbol_ptr; + + coff_symbol_ptr = coff_symbol_from (symbol_ptr_ptr[symbol_index]); symbol_ptr_ptr[symbol_index]->udata.i = symbol_index; if (coff_symbol_ptr && coff_symbol_ptr->native) { combined_entry_type *s = coff_symbol_ptr->native; int i; + BFD_ASSERT (s->is_sym); if (s->u.syment.n_sclass == C_FILE) { if (last_file != NULL) @@ -802,14 +795,15 @@ coff_mangle_symbols (bfd *bfd_ptr) for (symbol_index = 0; symbol_index < symbol_count; symbol_index++) { - coff_symbol_type *coff_symbol_ptr = - coff_symbol_from (bfd_ptr, symbol_ptr_ptr[symbol_index]); + coff_symbol_type *coff_symbol_ptr; + coff_symbol_ptr = coff_symbol_from (symbol_ptr_ptr[symbol_index]); if (coff_symbol_ptr && coff_symbol_ptr->native) { int i; combined_entry_type *s = coff_symbol_ptr->native; + BFD_ASSERT (s->is_sym); if (s->fix_value) { /* FIXME: We should use a union here. */ @@ -833,6 +827,8 @@ coff_mangle_symbols (bfd *bfd_ptr) for (i = 0; i < s->u.syment.n_numaux; i++) { combined_entry_type *a = s + i + 1; + + BFD_ASSERT (! a->is_sym); if (a->fix_tag) { a->u.auxent.x_sym.x_tagndx.l = @@ -876,6 +872,7 @@ coff_fix_symbol_name (bfd *abfd, } name_length = strlen (name); + BFD_ASSERT (native->is_sym); if (native->u.syment.n_sclass == C_FILE && native->u.syment.n_numaux > 0) { @@ -891,6 +888,7 @@ coff_fix_symbol_name (bfd *abfd, else strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); + BFD_ASSERT (! (native + 1)->is_sym); auxent = &(native + 1)->u.auxent; filnmlen = bfd_coff_filnmlen (abfd); @@ -993,6 +991,8 @@ coff_write_symbol (bfd *abfd, void * buf; bfd_size_type symesz; + BFD_ASSERT (native->is_sym); + if (native->u.syment.n_sclass == C_FILE) symbol->flags |= BSF_DEBUGGING; @@ -1033,6 +1033,7 @@ coff_write_symbol (bfd *abfd, return FALSE; for (j = 0; j < native->u.syment.n_numaux; j++) { + BFD_ASSERT (! (native + j + 1)->is_sym); bfd_coff_swap_aux_out (abfd, &((native + j + 1)->u.auxent), type, n_sclass, (int) j, @@ -1078,10 +1079,12 @@ coff_write_alien_symbol (bfd *abfd, { symbol->name = ""; if (isym != NULL) - memset (isym, 0, sizeof(*isym)); + memset (isym, 0, sizeof (*isym)); return TRUE; } native = dummy; + native->is_sym = TRUE; + native[1].is_sym = FALSE; native->u.syment.n_type = T_NULL; native->u.syment.n_flags = 0; native->u.syment.n_numaux = 0; @@ -1108,7 +1111,7 @@ coff_write_alien_symbol (bfd *abfd, name to keep it from being put in the string table. */ symbol->name = ""; if (isym != NULL) - memset (isym, 0, sizeof(*isym)); + memset (isym, 0, sizeof (*isym)); return TRUE; } else @@ -1122,7 +1125,7 @@ coff_write_alien_symbol (bfd *abfd, /* Copy the any flags from the file header into the symbol. FIXME: Why? */ { - coff_symbol_type *c = coff_symbol_from (abfd, symbol); + coff_symbol_type *c = coff_symbol_from (symbol); if (c != (coff_symbol_type *) NULL) native->u.syment.n_flags = bfd_asymbol_bfd (&c->symbol)->flags; } @@ -1167,6 +1170,7 @@ coff_write_native_symbol (bfd *abfd, return TRUE; } + BFD_ASSERT (native->is_sym); /* If this symbol has an associated line number, we must store the symbol index in the line number field. We also tag the auxent to point to the right place in the lineno table. */ @@ -1253,7 +1257,7 @@ coff_write_symbols (bfd *abfd) for (p = abfd->outsymbols, i = 0; i < limit; i++, p++) { asymbol *symbol = *p; - coff_symbol_type *c_symbol = coff_symbol_from (abfd, symbol); + coff_symbol_type *c_symbol = coff_symbol_from (symbol); if (c_symbol == (coff_symbol_type *) NULL || c_symbol->native == (combined_entry_type *) NULL) @@ -1276,8 +1280,9 @@ coff_write_symbols (bfd *abfd) symbol which has no associated section and we do not have to worry about this, all we need to know is that it is local. */ current_error_handler = bfd_set_error_handler (null_error_handler); + BFD_ASSERT (c_symbol->native->is_sym); sym_class = bfd_coff_classify_symbol (abfd, - &c_symbol->native->u.syment); + &c_symbol->native->u.syment); (void) bfd_set_error_handler (current_error_handler); n_sclass = &c_symbol->native->u.syment.n_sclass; @@ -1352,7 +1357,7 @@ coff_write_symbols (bfd *abfd) { asymbol *q = *p; size_t name_length = strlen (q->name); - coff_symbol_type *c_symbol = coff_symbol_from (abfd, q); + coff_symbol_type *c_symbol = coff_symbol_from (q); size_t maxlen; /* Figure out whether the symbol name should go in the string @@ -1368,6 +1373,9 @@ coff_write_symbols (bfd *abfd) file name, nor does it go in the .debug section. */ maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; + else if (! c_symbol->native->is_sym) + maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; + else if (bfd_coff_symname_in_debug (abfd, &c_symbol->native->u.syment)) /* This symbol name is in the XCOFF .debug section. @@ -1458,6 +1466,7 @@ coff_write_linenumbers (bfd *abfd) { /* Found a linenumber entry, output. */ struct internal_lineno out; + memset ((void *) & out, 0, sizeof (out)); out.l_lnno = 0; out.l_addr.l_symndx = l->u.offset; @@ -1505,6 +1514,7 @@ coff_pointerize_aux (bfd *abfd, unsigned int type = symbol->u.syment.n_type; unsigned int n_sclass = symbol->u.syment.n_sclass; + BFD_ASSERT (symbol->is_sym); if (coff_backend_info (abfd)->_bfd_coff_pointerize_aux_hook) { if ((*coff_backend_info (abfd)->_bfd_coff_pointerize_aux_hook) @@ -1518,6 +1528,7 @@ coff_pointerize_aux (bfd *abfd, if (n_sclass == C_FILE) return; + BFD_ASSERT (! auxent->is_sym); /* Otherwise patch up. */ #define N_TMASK coff_data (abfd)->local_n_tmask #define N_BTSHFT coff_data (abfd)->local_n_btshft @@ -1545,7 +1556,7 @@ coff_pointerize_aux (bfd *abfd, we didn't want to go to the trouble until someone needed it. */ static char * -build_debug_section (bfd *abfd) +build_debug_section (bfd *abfd, asection ** sect_return) { char *debug_section; file_ptr position; @@ -1573,6 +1584,8 @@ build_debug_section (bfd *abfd) || bfd_bread (debug_section, sec_size, abfd) != sec_size || bfd_seek (abfd, position, SEEK_SET) != 0) return NULL; + + * sect_return = sect; return debug_section; } @@ -1635,7 +1648,9 @@ _bfd_coff_get_external_symbols (bfd *abfd) /* Read in the external strings. The strings are not loaded until they are needed. This is because we have no simple way of - detecting a missing string table in an archive. */ + detecting a missing string table in an archive. If the strings + are loaded then the STRINGS and STRINGS_LEN fields in the + coff_tdata structure will be set. */ const char * _bfd_coff_read_string_table (bfd *abfd) @@ -1685,10 +1700,16 @@ _bfd_coff_read_string_table (bfd *abfd) return NULL; } - strings = (char *) bfd_malloc (strsize); + strings = (char *) bfd_malloc (strsize + 1); if (strings == NULL) return NULL; + /* PR 17521 file: 079-54929-0.004. + A corrupt file could contain an index that points into the first + STRING_SIZE_SIZE bytes of the string table, so make sure that + they are zero. */ + memset (strings, 0, STRING_SIZE_SIZE); + if (bfd_bread (strings + STRING_SIZE_SIZE, strsize - STRING_SIZE_SIZE, abfd) != strsize - STRING_SIZE_SIZE) { @@ -1697,7 +1718,9 @@ _bfd_coff_read_string_table (bfd *abfd) } obj_coff_strings (abfd) = strings; - + obj_coff_strings_len (abfd) = strsize; + /* Terminate the string table, just in case. */ + strings[strsize] = 0; return strings; } @@ -1717,6 +1740,7 @@ _bfd_coff_free_symbols (bfd *abfd) { free (obj_coff_strings (abfd)); obj_coff_strings (abfd) = NULL; + obj_coff_strings_len (abfd) = 0; } return TRUE; } @@ -1737,21 +1761,22 @@ coff_get_normalized_symtab (bfd *abfd) char *raw_src; char *raw_end; const char *string_table = NULL; - char *debug_section = NULL; + asection * debug_sec = NULL; + char *debug_sec_data = NULL; bfd_size_type size; if (obj_raw_syments (abfd) != NULL) return obj_raw_syments (abfd); + if (! _bfd_coff_get_external_symbols (abfd)) + return NULL; + size = obj_raw_syment_count (abfd) * sizeof (combined_entry_type); internal = (combined_entry_type *) bfd_zalloc (abfd, size); if (internal == NULL && size != 0) return NULL; internal_end = internal + obj_raw_syment_count (abfd); - - if (! _bfd_coff_get_external_symbols (abfd)) - return NULL; - + raw_src = (char *) obj_coff_external_syms (abfd); /* Mark the end of the symbols. */ @@ -1766,23 +1791,44 @@ coff_get_normalized_symtab (bfd *abfd) raw_src < raw_end; raw_src += symesz, internal_ptr++) { - unsigned int i; + bfd_coff_swap_sym_in (abfd, (void *) raw_src, (void *) & internal_ptr->u.syment); symbol_ptr = internal_ptr; + internal_ptr->is_sym = TRUE; + + /* PR 17512: file: 1353-1166-0.004. */ + if (symbol_ptr->u.syment.n_sclass == C_FILE + && symbol_ptr->u.syment.n_numaux > 0 + && raw_src + symesz + symbol_ptr->u.syment.n_numaux + * sizeof (union internal_auxent) >= raw_end) + { + bfd_release (abfd, internal); + return NULL; + } for (i = 0; i < symbol_ptr->u.syment.n_numaux; i++) { internal_ptr++; + /* PR 17512: Prevent buffer overrun. */ + if (internal_ptr >= internal_end) + { + bfd_release (abfd, internal); + return NULL; + } + raw_src += symesz; + bfd_coff_swap_aux_in (abfd, (void *) raw_src, symbol_ptr->u.syment.n_type, symbol_ptr->u.syment.n_sclass, (int) i, symbol_ptr->u.syment.n_numaux, &(internal_ptr->u.auxent)); + + internal_ptr->is_sym = FALSE; coff_pointerize_aux (abfd, internal, symbol_ptr, i, internal_ptr); } @@ -1796,12 +1842,18 @@ coff_get_normalized_symtab (bfd *abfd) for (internal_ptr = internal; internal_ptr < internal_end; internal_ptr++) { + BFD_ASSERT (internal_ptr->is_sym); + if (internal_ptr->u.syment.n_sclass == C_FILE && internal_ptr->u.syment.n_numaux > 0) { + combined_entry_type * aux = internal_ptr + 1; + /* Make a file symbol point to the name in the auxent, since the text ".file" is redundant. */ - if ((internal_ptr + 1)->u.auxent.x_file.x_n.x_zeroes == 0) + BFD_ASSERT (! aux->is_sym); + + if (aux->u.auxent.x_file.x_n.x_zeroes == 0) { /* The filename is a long one, point into the string table. */ if (string_table == NULL) @@ -1811,10 +1863,12 @@ coff_get_normalized_symtab (bfd *abfd) return NULL; } - internal_ptr->u.syment._n._n_n._n_offset = - ((bfd_hostptr_t) - (string_table - + (internal_ptr + 1)->u.auxent.x_file.x_n.x_offset)); + if ((bfd_size_type)(aux->u.auxent.x_file.x_n.x_offset) + >= obj_coff_strings_len (abfd)) + internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) _(""); + else + internal_ptr->u.syment._n._n_n._n_offset = + (bfd_hostptr_t) (string_table + (aux->u.auxent.x_file.x_n.x_offset)); } else { @@ -1824,15 +1878,15 @@ coff_get_normalized_symtab (bfd *abfd) if (internal_ptr->u.syment.n_numaux > 1 && coff_data (abfd)->pe) internal_ptr->u.syment._n._n_n._n_offset = - ((bfd_hostptr_t) - copy_name (abfd, - (internal_ptr + 1)->u.auxent.x_file.x_fname, - internal_ptr->u.syment.n_numaux * symesz)); + (bfd_hostptr_t) + copy_name (abfd, + aux->u.auxent.x_file.x_fname, + internal_ptr->u.syment.n_numaux * symesz); else internal_ptr->u.syment._n._n_n._n_offset = ((bfd_hostptr_t) copy_name (abfd, - (internal_ptr + 1)->u.auxent.x_file.x_fname, + aux->u.auxent.x_file.x_fname, (size_t) bfd_coff_filnmlen (abfd))); } } @@ -1869,18 +1923,33 @@ coff_get_normalized_symtab (bfd *abfd) if (string_table == NULL) return NULL; } - internal_ptr->u.syment._n._n_n._n_offset = - ((bfd_hostptr_t) - (string_table - + internal_ptr->u.syment._n._n_n._n_offset)); + if (internal_ptr->u.syment._n._n_n._n_offset >= obj_coff_strings_len (abfd) + || string_table + internal_ptr->u.syment._n._n_n._n_offset < string_table) + internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) _(""); + else + internal_ptr->u.syment._n._n_n._n_offset = + ((bfd_hostptr_t) + (string_table + + internal_ptr->u.syment._n._n_n._n_offset)); } else { /* Long name in debug section. Very similar. */ - if (debug_section == NULL) - debug_section = build_debug_section (abfd); - internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) - (debug_section + internal_ptr->u.syment._n._n_n._n_offset); + if (debug_sec_data == NULL) + debug_sec_data = build_debug_section (abfd, & debug_sec); + if (debug_sec_data != NULL) + { + BFD_ASSERT (debug_sec != NULL); + /* PR binutils/17512: Catch out of range offsets into the debug data. */ + if (internal_ptr->u.syment._n._n_n._n_offset > debug_sec->size + || debug_sec_data + internal_ptr->u.syment._n._n_n._n_offset < debug_sec_data) + internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) _(""); + else + internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) + (debug_sec_data + internal_ptr->u.syment._n._n_n._n_offset); + } + else + internal_ptr->u.syment._n._n_n._n_offset = (bfd_hostptr_t) ""; } } internal_ptr += internal_ptr->u.syment.n_numaux; @@ -1913,7 +1982,7 @@ coff_make_empty_symbol (bfd *abfd) if (new_symbol == NULL) return NULL; new_symbol->symbol.section = 0; - new_symbol->native = 0; + new_symbol->native = NULL; new_symbol->lineno = NULL; new_symbol->done_lineno = FALSE; new_symbol->symbol.the_bfd = abfd; @@ -1939,6 +2008,7 @@ coff_bfd_make_debug_symbol (bfd *abfd, new_symbol->native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (!new_symbol->native) return NULL; + new_symbol->native->is_sym = TRUE; new_symbol->symbol.section = bfd_abs_section_ptr; new_symbol->symbol.flags = BSF_DEBUGGING; new_symbol->lineno = NULL; @@ -1954,81 +2024,12 @@ coff_get_symbol_info (bfd *abfd, asymbol *symbol, symbol_info *ret) bfd_symbol_info (symbol, ret); if (coffsymbol (symbol)->native != NULL - && coffsymbol (symbol)->native->fix_value) + && coffsymbol (symbol)->native->fix_value + && coffsymbol (symbol)->native->is_sym) ret->value = coffsymbol (symbol)->native->u.syment.n_value - (bfd_hostptr_t) obj_raw_syments (abfd); } -/* Return the COFF syment for a symbol. */ - -bfd_boolean -bfd_coff_get_syment (bfd *abfd, - asymbol *symbol, - struct internal_syment *psyment) -{ - coff_symbol_type *csym; - - csym = coff_symbol_from (abfd, symbol); - if (csym == NULL || csym->native == NULL) - { - bfd_set_error (bfd_error_invalid_operation); - return FALSE; - } - - *psyment = csym->native->u.syment; - - if (csym->native->fix_value) - psyment->n_value = psyment->n_value - - (bfd_hostptr_t) obj_raw_syments (abfd); - - /* FIXME: We should handle fix_line here. */ - - return TRUE; -} - -/* Return the COFF auxent for a symbol. */ - -bfd_boolean -bfd_coff_get_auxent (bfd *abfd, - asymbol *symbol, - int indx, - union internal_auxent *pauxent) -{ - coff_symbol_type *csym; - combined_entry_type *ent; - - csym = coff_symbol_from (abfd, symbol); - - if (csym == NULL - || csym->native == NULL - || indx >= csym->native->u.syment.n_numaux) - { - bfd_set_error (bfd_error_invalid_operation); - return FALSE; - } - - ent = csym->native + indx + 1; - - *pauxent = ent->u.auxent; - - if (ent->fix_tag) - pauxent->x_sym.x_tagndx.l = - ((combined_entry_type *) pauxent->x_sym.x_tagndx.p - - obj_raw_syments (abfd)); - - if (ent->fix_end) - pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l = - ((combined_entry_type *) pauxent->x_sym.x_fcnary.x_fcn.x_endndx.p - - obj_raw_syments (abfd)); - - if (ent->fix_scnlen) - pauxent->x_csect.x_scnlen.l = - ((combined_entry_type *) pauxent->x_csect.x_scnlen.p - - obj_raw_syments (abfd)); - - return TRUE; -} - /* Print out information about COFF symbol. */ void @@ -2062,6 +2063,15 @@ coff_print_symbol (bfd *abfd, fprintf (file, "[%3ld]", (long) (combined - root)); + /* PR 17512: file: 079-33786-0.001:0.1. */ + if (combined < obj_raw_syments (abfd) + || combined >= obj_raw_syments (abfd) + obj_raw_syment_count (abfd)) + { + fprintf (file, _(" %s"), symbol->name); + break; + } + + BFD_ASSERT (combined->is_sym); if (! combined->fix_value) val = (bfd_vma) combined->u.syment.n_value; else @@ -2081,6 +2091,7 @@ coff_print_symbol (bfd *abfd, combined_entry_type *auxp = combined + aux + 1; long tagndx; + BFD_ASSERT (! auxp->is_sym); if (auxp->fix_tag) tagndx = auxp->u.auxent.x_sym.x_tagndx.p - root; else @@ -2155,8 +2166,11 @@ coff_print_symbol (bfd *abfd, l++; while (l->line_number) { - fprintf (file, "\n%4d : ", l->line_number); - bfd_fprintf_vma (abfd, file, l->u.offset + symbol->section->vma); + if (l->line_number > 0) + { + fprintf (file, "\n%4d : ", l->line_number); + bfd_fprintf_vma (abfd, file, l->u.offset + symbol->section->vma); + } l++; } } @@ -2191,13 +2205,13 @@ _bfd_coff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean coff_find_nearest_line_with_names (bfd *abfd, - const struct dwarf_debug_section *debug_sections, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + const struct dwarf_debug_section *debug_sections) { bfd_boolean found; unsigned int i; @@ -2222,10 +2236,9 @@ coff_find_nearest_line_with_names (bfd *abfd, return TRUE; /* Also try examining DWARF2 debugging information. */ - if (_bfd_dwarf2_find_nearest_line (abfd, debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, 0, + line_ptr, NULL, debug_sections, 0, &coff_data(abfd)->dwarf2_find_line_info)) return TRUE; @@ -2248,6 +2261,7 @@ coff_find_nearest_line_with_names (bfd *abfd, pend = p + cof->raw_syment_count; while (p < pend) { + BFD_ASSERT (p->is_sym); if (p->u.syment.n_sclass == C_FILE) break; p += 1 + p->u.syment.n_numaux; @@ -2271,6 +2285,7 @@ coff_find_nearest_line_with_names (bfd *abfd, p2 < pend; p2 += 1 + p2->u.syment.n_numaux) { + BFD_ASSERT (p2->is_sym); if (p2->u.syment.n_scnum > 0 && (section == coff_section_from_bfd_index (abfd, @@ -2282,6 +2297,8 @@ coff_find_nearest_line_with_names (bfd *abfd, break; } } + if (p2 >= pend) + break; file_addr = (bfd_vma) p2->u.syment.n_value; /* PR 11512: Include the section address of the function name symbol. */ @@ -2346,6 +2363,8 @@ coff_find_nearest_line_with_names (bfd *abfd, if (coff->native) { combined_entry_type *s = coff->native; + + BFD_ASSERT (s->is_sym); s = s + 1 + s->u.syment.n_numaux; /* In XCOFF a debugging symbol can follow the @@ -2358,6 +2377,7 @@ coff_find_nearest_line_with_names (bfd *abfd, { /* The linenumber is stored in the auxent. */ union internal_auxent *a = &((s + 1)->u.auxent); + line_base = a->x_sym.x_misc.x_lnsz.x_lnno; *line_ptr = line_base; } @@ -2407,37 +2427,21 @@ coff_find_nearest_line_with_names (bfd *abfd, bfd_boolean coff_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { - return coff_find_nearest_line_with_names (abfd, dwarf_debug_sections, - section, symbols, offset, + if (discriminator_ptr) + *discriminator_ptr = 0; + return coff_find_nearest_line_with_names (abfd, symbols, section, offset, filename_ptr, functionname_ptr, - line_ptr); + line_ptr, dwarf_debug_sections); } -bfd_boolean -coff_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator) -{ - *discriminator = 0; - return coff_find_nearest_line_with_names (abfd, dwarf_debug_sections, - section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr); -} - - bfd_boolean coff_find_inliner_info (bfd *abfd, const char **filename_ptr, @@ -2475,7 +2479,7 @@ bfd_coff_set_symbol_class (bfd * abfd, { coff_symbol_type * csym; - csym = coff_symbol_from (abfd, symbol); + csym = coff_symbol_from (symbol); if (csym == NULL) { bfd_set_error (bfd_error_invalid_operation); @@ -2495,6 +2499,7 @@ bfd_coff_set_symbol_class (bfd * abfd, if (native == NULL) return FALSE; + native->is_sym = TRUE; native->u.syment.n_type = T_NULL; native->u.syment.n_sclass = symbol_class; @@ -2530,16 +2535,6 @@ bfd_coff_set_symbol_class (bfd * abfd, return TRUE; } -struct coff_comdat_info * -bfd_coff_get_comdat_section (bfd *abfd, struct bfd_section *sec) -{ - if (bfd_get_flavour (abfd) == bfd_target_coff_flavour - && coff_section_data (abfd, sec) != NULL) - return coff_section_data (abfd, sec)->comdat; - else - return NULL; -} - bfd_boolean _bfd_coff_section_already_linked (bfd *abfd, asection *sec, diff --git a/bfd/cofflink.c b/bfd/cofflink.c index bfb1ebba0..ee4d032cb 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1,5 +1,5 @@ /* COFF specific linker code. - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -29,9 +29,11 @@ #include "libcoff.h" #include "safe-ctype.h" -static bfd_boolean coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info); -static bfd_boolean coff_link_check_archive_element (bfd *abfd, struct bfd_link_info *info, bfd_boolean *pneeded); -static bfd_boolean coff_link_add_symbols (bfd *abfd, struct bfd_link_info *info); +static bfd_boolean coff_link_add_object_symbols (bfd *, struct bfd_link_info *); +static bfd_boolean coff_link_check_archive_element + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, const char *, + bfd_boolean *); +static bfd_boolean coff_link_add_symbols (bfd *, struct bfd_link_info *); /* Return TRUE if SYM is a weak, external symbol. */ #define IS_WEAK_EXTERNAL(abfd, sym) \ @@ -190,74 +192,6 @@ coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) return TRUE; } -/* Look through the symbols to see if this object file should be - included in the link. */ - -static bfd_boolean -coff_link_check_ar_symbols (bfd *abfd, - struct bfd_link_info *info, - bfd_boolean *pneeded, - bfd **subsbfd) -{ - bfd_size_type symesz; - bfd_byte *esym; - bfd_byte *esym_end; - - *pneeded = FALSE; - - symesz = bfd_coff_symesz (abfd); - esym = (bfd_byte *) obj_coff_external_syms (abfd); - esym_end = esym + obj_raw_syment_count (abfd) * symesz; - while (esym < esym_end) - { - struct internal_syment sym; - enum coff_symbol_classification classification; - - bfd_coff_swap_sym_in (abfd, esym, &sym); - - classification = bfd_coff_classify_symbol (abfd, &sym); - if (classification == COFF_SYMBOL_GLOBAL - || classification == COFF_SYMBOL_COMMON) - { - const char *name; - char buf[SYMNMLEN + 1]; - struct bfd_link_hash_entry *h; - - /* This symbol is externally visible, and is defined by this - object file. */ - name = _bfd_coff_internal_syment_name (abfd, &sym, buf); - if (name == NULL) - return FALSE; - h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); - - /* Auto import. */ - if (!h - && info->pei386_auto_import - && CONST_STRNEQ (name, "__imp_")) - h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE); - - /* We are only interested in symbols that are currently - undefined. If a symbol is currently known to be common, - COFF linkers do not bring in an object file which defines - it. */ - if (h != (struct bfd_link_hash_entry *) NULL - && h->type == bfd_link_hash_undefined) - { - if (!(*info->callbacks - ->add_archive_element) (info, abfd, name, subsbfd)) - return FALSE; - *pneeded = TRUE; - return TRUE; - } - } - - esym += (sym.n_numaux + 1) * symesz; - } - - /* We do not need this object file. */ - return TRUE; -} - /* Check a single archive element to see if we need to include it in the link. *PNEEDED is set according to whether this element is needed in the link or not. This is called via @@ -266,41 +200,23 @@ coff_link_check_ar_symbols (bfd *abfd, static bfd_boolean coff_link_check_archive_element (bfd *abfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h, + const char *name, bfd_boolean *pneeded) { - bfd *oldbfd; - bfd_boolean needed; + *pneeded = FALSE; - if (!_bfd_coff_get_external_symbols (abfd)) - return FALSE; + /* We are only interested in symbols that are currently undefined. + If a symbol is currently known to be common, COFF linkers do not + bring in an object file which defines it. */ + if (h->type != bfd_link_hash_undefined) + return TRUE; - oldbfd = abfd; - if (!coff_link_check_ar_symbols (abfd, info, pneeded, &abfd)) + if (!(*info->callbacks->add_archive_element) (info, abfd, name, &abfd)) return FALSE; + *pneeded = TRUE; - needed = *pneeded; - if (needed) - { - /* Potentially, the add_archive_element hook may have set a - substitute BFD for us. */ - if (abfd != oldbfd) - { - if (!info->keep_memory - && !_bfd_coff_free_symbols (oldbfd)) - return FALSE; - if (!_bfd_coff_get_external_symbols (abfd)) - return FALSE; - } - if (!coff_link_add_symbols (abfd, info)) - return FALSE; - } - - if (!info->keep_memory || !needed) - { - if (!_bfd_coff_free_symbols (abfd)) - return FALSE; - } - return TRUE; + return coff_link_add_object_symbols (abfd, info); } /* Add all the symbols from an object file to the hash table. */ @@ -860,7 +776,7 @@ _bfd_coff_final_link (bfd *abfd, the opportunity to clear the output_has_begun fields of all the input BFD's. */ max_sym_count = 0; - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { size_t sz; @@ -945,7 +861,7 @@ _bfd_coff_final_link (bfd *abfd, if (flaginfo.info->strip != strip_all && flaginfo.info->discard != discard_all) { /* Add local symbols from foreign inputs. */ - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { unsigned int i; @@ -2087,7 +2003,10 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd) if (strings == NULL) return FALSE; } - filename = strings + auxp->x_file.x_n.x_offset; + if ((bfd_size_type) auxp->x_file.x_n.x_offset >= obj_coff_strings_len (input_bfd)) + filename = _(""); + else + filename = strings + auxp->x_file.x_n.x_offset; indx = _bfd_stringtab_add (flaginfo->strtab, filename, hash, copy); if (indx == (bfd_size_type) -1) diff --git a/bfd/coffswap.h b/bfd/coffswap.h index c62be2eb9..d07f3c3ec 100644 --- a/bfd/coffswap.h +++ b/bfd/coffswap.h @@ -1,5 +1,5 @@ /* Generic COFF swapping routines, for BFD. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/compress.c b/bfd/compress.c index 20eef9528..0087a665d 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -1,5 +1,5 @@ /* Compressed section support (intended for debug sections). - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -152,7 +152,8 @@ DESCRIPTION return @var{*ptr} with memory malloc'd by this function. Return @code{TRUE} if the full section contents is retrieved - successfully. + successfully. If the section has no contents then this function + returns @code{TRUE} but @var{*ptr} is set to NULL. */ bfd_boolean @@ -172,7 +173,10 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) else sz = sec->size; if (sz == 0) - return TRUE; + { + *ptr = NULL; + return TRUE; + } switch (sec->compress_status) { @@ -183,6 +187,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) if (p == NULL) return FALSE; } + if (!bfd_get_section_contents (abfd, sec, p, 0, sz)) { if (*ptr != p) @@ -239,6 +244,8 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) #endif case COMPRESS_SECTION_DONE: + if (sec->contents == NULL) + return FALSE; if (p == NULL) { p = (bfd_byte *) bfd_malloc (sz); @@ -246,7 +253,9 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) return FALSE; *ptr = p; } - memcpy (p, sec->contents, sz); + /* PR 17512; file: 5bc29788. */ + if (p != sec->contents) + memcpy (p, sec->contents, sz); return TRUE; default: diff --git a/bfd/config.bfd b/bfd/config.bfd index 1f822f24d..75f21e38d 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1,6 +1,6 @@ # config.bfd # -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -77,7 +77,6 @@ case $targ in m68*-bull-sysv* | \ maxq-*-coff | \ mips*el-*-rtems* | \ - or1k-*-rtems* | \ powerpcle-*-rtems* | \ sparc*-*-rtemsaout* | \ sparc-*-lynxos* | \ @@ -128,6 +127,7 @@ spu*) targ_archs=bfd_spu_arch ;; tilegx*) targ_archs=bfd_tilegx_arch ;; tilepro*) targ_archs=bfd_tilepro_arch ;; v850*) targ_archs="bfd_v850_arch bfd_v850_rh850_arch" ;; +visium*) targ_archs=bfd_visium_arch ;; x86_64*) targ_archs=bfd_i386_arch ;; xtensa*) targ_archs=bfd_xtensa_arch ;; xgate) targ_archs=bfd_xgate_arch ;; @@ -329,7 +329,7 @@ case "${targ}" in targ_defvec=arm_elf32_le_vec targ_selvecs=arm_elf32_be_vec ;; - armeb-*-elf | arm*b-*-freebsd* | arm*b-*-linux-*) + armeb-*-elf | arm*b-*-freebsd* | arm*b-*-linux-* | armeb-*-eabi*) targ_defvec=arm_elf32_be_vec targ_selvecs=arm_elf32_le_vec ;; @@ -447,6 +447,10 @@ case "${targ}" in targ_selvecs=moxie_elf32_le_vec ;; + moxie-*-moxiebox*) + targ_defvec=moxie_elf32_le_vec + ;; + h8300*-*-rtemscoff*) targ_defvec=h8300_coff_vec targ_underscore=yes @@ -1030,7 +1034,7 @@ case "${targ}" in targ_defvec=mips_elf32_trad_le_vec targ_selvecs="mips_elf32_trad_be_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" ;; - mips*-sde-elf* | mips*-mti-elf*) + mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*) targ_defvec=mips_elf32_trad_be_vec targ_selvecs="mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" ;; @@ -1170,11 +1174,11 @@ case "${targ}" in targ_selvecs=nios2_elf32_be_vec ;; - or1k-*-elf | or1k-*-linux*) + or1k-*-elf | or1k-*-linux* | or1k-*-rtems*) targ_defvec=or1k_elf32_vec ;; - or1knd-*-elf | or1knd-*-linux*) + or1knd-*-elf | or1knd-*-linux* | or1knd-*-rtems*) targ_defvec=or1k_elf32_vec ;; @@ -1654,6 +1658,10 @@ case "${targ}" in targ_defvec=vax_elf32_vec ;; + visium-*-elf) + targ_defvec=visium_elf32_vec + ;; + we32k-*-*) targ_defvec=we32k_coff_vec ;; diff --git a/bfd/config.in b/bfd/config.in index 05829e27f..b911bf6ef 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -1,4 +1,4 @@ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ diff --git a/bfd/configure b/bfd/configure index f3df01c94..f7a9e81a7 100755 --- a/bfd/configure +++ b/bfd/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for bfd 2.24.51. +# Generated by GNU Autoconf 2.64 for bfd 2.25.51. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bfd' PACKAGE_TARNAME='bfd' -PACKAGE_VERSION='2.24.51' -PACKAGE_STRING='bfd 2.24.51' +PACKAGE_VERSION='2.25.51' +PACKAGE_STRING='bfd 2.25.51' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1349,7 +1349,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bfd 2.24.51 to adapt to many kinds of systems. +\`configure' configures bfd 2.25.51 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1420,7 +1420,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bfd 2.24.51:";; + short | recursive ) echo "Configuration of bfd 2.25.51:";; esac cat <<\_ACEOF @@ -1435,7 +1435,7 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-plugins Enable support for plugins (defaults no) + --enable-plugins Enable support for plugins --disable-largefile omit support for large files --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-targets alternative target configurations @@ -1541,7 +1541,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bfd configure 2.24.51 +bfd configure 2.25.51 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2183,7 +2183,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bfd $as_me 2.24.51, which was +It was created by bfd $as_me 2.25.51, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -3991,7 +3991,7 @@ fi # Define the identity of the package. PACKAGE='bfd' - VERSION='2.24.51' + VERSION='2.25.51' cat >>confdefs.h <<_ACEOF @@ -7938,7 +7938,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) + 10.[012][,.]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; @@ -9211,7 +9211,7 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler @@ -11776,17 +11776,106 @@ CC="$lt_save_CC" # even in directories otherwise not depending on the $plugins option. -# Check whether --enable-plugins was given. + maybe_plugins=no + for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + maybe_plugins=yes +fi + +done + + for ac_header in windows.h +do : + ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default +" +if test "x$ac_cv_header_windows_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + maybe_plugins=yes +fi + +done + + + # Check whether --enable-plugins was given. if test "${enable_plugins+set}" = set; then : enableval=$enable_plugins; case "${enableval}" in - yes | "") plugins=yes ;; - no) plugins=no ;; - *) plugins=yes ;; - esac + no) plugins=no ;; + *) plugins=yes + if test "$maybe_plugins" != "yes" ; then + as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5 + fi ;; + esac +else + plugins=$maybe_plugins + +fi + + if test "$plugins" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if test "${ac_cv_search_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_dlopen+set}" = set; then : + break +fi +done +if test "${ac_cv_search_dlopen+set}" = set; then : + else - plugins=no + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + fi + fi case "${host}" in @@ -12012,10 +12101,6 @@ fi if test "$plugins" = "yes"; then - if test "$enable_dlopen" != "yes" ; then - as_fn_error " - Building BFD with plugin support requires a host that supports -ldl." "$LINENO" 5 - fi enable_targets="$enable_targets plugin" fi @@ -13532,21 +13617,6 @@ fi fi -for ac_header in windows.h dlfcn.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5 $as_echo_n "checking whether string.h and strings.h may both be included... " >&6; } if test "${gcc_cv_header_string+set}" = set; then : @@ -15206,7 +15276,11 @@ selarchs="$f" tb= elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo - elf-eh-frame.lo dwarf1.lo" + elf-eh-frame.lo dwarf1.lo dwarf2.lo" +coffgen="coffgen.lo dwarf2.lo" +coff="cofflink.lo $coffgen" +ecoff="ecofflink.lo $coffgen" +xcoff="xcofflink.lo $coffgen" for vec in $selvecs do @@ -15219,7 +15293,7 @@ do aarch64_elf32_le_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;; aarch64_elf64_be_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;; aarch64_elf64_le_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;; - alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;; + alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo $ecoff"; target_size=64 ;; alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; alpha_nlm32_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;; @@ -15236,8 +15310,8 @@ do arm_aout_le_vec) tb="$tb aout-arm.lo aout32.lo" ;; arm_aout_nbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; arm_aout_riscix_vec) tb="$tb aout32.lo riscix.lo" ;; - arm_coff_be_vec) tb="$tb coff-arm.lo cofflink.lo " ;; - arm_coff_le_vec) tb="$tb coff-arm.lo cofflink.lo " ;; + arm_coff_be_vec) tb="$tb coff-arm.lo $coff" ;; + arm_coff_le_vec) tb="$tb coff-arm.lo $coff" ;; arm_elf32_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; arm_elf32_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; arm_elf32_nacl_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; @@ -15246,18 +15320,18 @@ do arm_elf32_symbian_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; arm_elf32_vxworks_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; arm_elf32_vxworks_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_pe_be_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_le_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_epoc_be_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_epoc_le_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_wince_be_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_wince_le_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_be_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_le_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_epoc_be_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_epoc_le_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_wince_be_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_wince_le_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; + arm_pe_be_vec) tb="$tb pe-arm.lo peigen.lo $coff" ;; + arm_pe_le_vec) tb="$tb pe-arm.lo peigen.lo $coff" ;; + arm_pe_epoc_be_vec) tb="$tb epoc-pe-arm.lo peigen.lo $coff" ;; + arm_pe_epoc_le_vec) tb="$tb epoc-pe-arm.lo peigen.lo $coff" ;; + arm_pe_wince_be_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo $coff" ;; + arm_pe_wince_le_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo $coff" ;; + arm_pei_be_vec) tb="$tb pei-arm.lo peigen.lo $coff" ;; + arm_pei_le_vec) tb="$tb pei-arm.lo peigen.lo $coff" ;; + arm_pei_epoc_be_vec) tb="$tb epoc-pei-arm.lo peigen.lo $coff" ;; + arm_pei_epoc_le_vec) tb="$tb epoc-pei-arm.lo peigen.lo $coff" ;; + arm_pei_wince_be_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo $coff" ;; + arm_pei_wince_le_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo $coff" ;; avr_elf32_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfin_elf32_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;; bfin_elf32_fdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;; @@ -15280,9 +15354,9 @@ do fr30_elf32_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; frv_elf32_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; frv_elf32_fdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; - h8300_coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;; + h8300_coff_vec) tb="$tb coff-h8300.lo reloc16.lo $coffgen" ;; h8300_elf32_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; - h8500_coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;; + h8500_coff_vec) tb="$tb coff-h8500.lo reloc16.lo $coffgen" ;; hppa_elf32_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; hppa_elf32_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; hppa_elf32_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; @@ -15299,10 +15373,10 @@ do i386_aout_mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;; i386_aout_nbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; i386_aout_os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; - i386_coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;; - i386_coff_go32_vec) tb="$tb coff-go32.lo cofflink.lo" ;; - i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;; - i386_coff_lynx_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;; + i386_coff_vec) tb="$tb coff-i386.lo $coff" ;; + i386_coff_go32_vec) tb="$tb coff-go32.lo $coff" ;; + i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo $coff" ;; + i386_coff_lynx_vec) tb="$tb cf-i386lynx.lo lynx-core.lo $coff" ;; i386_elf32_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; i386_elf32_fbsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; i386_elf32_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; @@ -15311,9 +15385,9 @@ do i386_mach_o_vec) tb="$tb mach-o-i386.lo" ;; i386_msdos_vec) tb="$tb i386msdos.lo" ;; i386_nlm32_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; - i386_pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; - i386_pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;; - i860_coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;; + i386_pe_vec) tb="$tb pe-i386.lo peigen.lo $coff" ;; + i386_pei_vec) tb="$tb pei-i386.lo peigen.lo $coff" ;; + i860_coff_vec) tb="$tb coff-i860.lo $coff" ;; i860_elf32_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; i860_elf32_le_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; i960_elf32_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; @@ -15323,9 +15397,9 @@ do ia64_elf64_le_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; ia64_elf64_hpux_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; ia64_elf64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;; - ia64_pei_vec) tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; - icoff_be_vec) tb="$tb coff-i960.lo cofflink.lo" ;; - icoff_le_vec) tb="$tb coff-i960.lo cofflink.lo" ;; + ia64_pei_vec) tb="$tb pei-ia64.lo pepigen.lo $coff"; target_size=64 ;; + icoff_be_vec) tb="$tb coff-i960.lo $coff" ;; + icoff_le_vec) tb="$tb coff-i960.lo $coff" ;; ieee_vec) tb="$tb ieee.lo" ;; ip2k_elf32_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; iq2000_elf32_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;; @@ -15348,56 +15422,56 @@ do m68k_aout_linux_vec) tb="$tb m68klinux.lo aout32.lo" ;; m68k_aout_nbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;; m68k_aout_newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; - m68k_coff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;; - m68k_coff_apollo_vec) tb="$tb coff-apollo.lo" ;; - m68k_coff_aux_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;; - m68k_coff_sysv_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; - m68k_coff_un_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;; + m68k_coff_vec) tb="$tb coff-m68k.lo $coff" ;; + m68k_coff_apollo_vec) tb="$tb coff-apollo.lo $coffgen" ;; + m68k_coff_aux_vec) tb="$tb coff-aux.lo coff-m68k.lo $coff" ;; + m68k_coff_sysv_vec) tb="$tb coff-svm68k.lo $coff" ;; + m68k_coff_un_vec) tb="$tb coff-u68k.lo coff-m68k.lo $coff" ;; m68k_elf32_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; m68k_versados_vec) tb="$tb versados.lo" ;; m88k_aout_mach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; m88k_aout_obsd_vec) tb="$tb m88kopenbsd.lo aout32.lo" ;; - m88k_coff_bcs_vec) tb="$tb coff-m88k.lo" ;; + m88k_coff_bcs_vec) tb="$tb coff-m88k.lo $coffgen" ;; m88k_elf32_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; - mach_o_be_vec) tb="$tb mach-o.lo" ;; - mach_o_le_vec) tb="$tb mach-o.lo" ;; - mach_o_fat_vec) tb="$tb mach-o.lo" ;; + mach_o_be_vec) tb="$tb mach-o.lo dwarf2.lo" ;; + mach_o_le_vec) tb="$tb mach-o.lo dwarf2.lo" ;; + mach_o_fat_vec) tb="$tb mach-o.lo dwarf2.lo" ;; mcore_elf32_be_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; mcore_elf32_le_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; - mcore_pe_be_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; - mcore_pe_le_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; - mcore_pei_be_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; - mcore_pei_le_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; + mcore_pe_be_vec) tb="$tb pe-mcore.lo peigen.lo $coff" ;; + mcore_pe_le_vec) tb="$tb pe-mcore.lo peigen.lo $coff" ;; + mcore_pei_be_vec) tb="$tb pei-mcore.lo peigen.lo $coff" ;; + mcore_pei_le_vec) tb="$tb pei-mcore.lo peigen.lo $coff" ;; mep_elf32_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; mep_elf32_le_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; metag_elf32_vec) tb="$tb elf32-metag.lo elf32.lo $elf" ;; microblaze_elf32_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;; microblaze_elf32_le_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;; - mips_ecoff_be_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; - mips_ecoff_le_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; - mips_ecoff_bele_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; - mips_elf32_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_n_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_n_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntrad_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntrad_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntradfbsd_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntradfbsd_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_trad_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_trad_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_tradfbsd_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_tradfbsd_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_vxworks_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_vxworks_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf64_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_trad_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_trad_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_tradfbsd_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_tradfbsd_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_pe_le_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; - mips_pei_le_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; + mips_ecoff_be_vec) tb="$tb coff-mips.lo ecoff.lo $ecoff" ;; + mips_ecoff_le_vec) tb="$tb coff-mips.lo ecoff.lo $ecoff" ;; + mips_ecoff_bele_vec) tb="$tb coff-mips.lo ecoff.lo $ecoff" ;; + mips_elf32_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_n_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_n_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntrad_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntrad_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntradfbsd_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntradfbsd_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_trad_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_trad_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_tradfbsd_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_tradfbsd_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_vxworks_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_vxworks_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf64_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_trad_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_trad_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_tradfbsd_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_tradfbsd_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_pe_le_vec) tb="$tb pe-mips.lo peigen.lo $coff" ;; + mips_pei_le_vec) tb="$tb pei-mips.lo peigen.lo $coff" ;; mmix_elf64_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; mmix_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; mn10200_elf32_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; @@ -15431,15 +15505,15 @@ do powerpc_elf64_le_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; powerpc_elf64_fbsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; powerpc_nlm32_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; - powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_pei_le_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; + powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;; + powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;; + powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo $coff" ;; + powerpc_pei_le_vec) tb="$tb pei-ppc.lo peigen.lo $coff" ;; + powerpc_xcoff_vec) tb="$tb coff-rs6000.lo $xcoff" ;; rl78_elf32_vec) tb="$tb elf32-rl78.lo elf32.lo $elf" ;; - rs6000_xcoff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; - rs6000_xcoff64_aix_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; - rs6000_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; + rs6000_xcoff64_vec) tb="$tb coff64-rs6000.lo aix5ppc-core.lo $xcoff"; target_size=64 ;; + rs6000_xcoff64_aix_vec) tb="$tb coff64-rs6000.lo aix5ppc-core.lo $xcoff"; target_size=64 ;; + rs6000_xcoff_vec) tb="$tb coff-rs6000.lo $xcoff" ;; rx_elf32_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; rx_elf32_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; rx_elf32_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; @@ -15447,45 +15521,42 @@ do s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;; score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;; - # FIXME: We include cofflink.lo not because it's needed for - # sh64_elf32[_le]_vec, but because we include sh_elf32[_le]_vec - # which needs it but does not list it. Should be fixed in right place. - sh64_elf32_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_linux_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_linux_be_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; - sh64_elf32_nbsd_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; + sh64_elf32_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_linux_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_linux_be_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" ;; + sh64_elf32_nbsd_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" ;; sh64_elf64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; sh64_elf64_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; sh64_elf64_linux_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; sh64_elf64_linux_be_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; sh64_elf64_nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; sh64_elf64_nbsd_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - sh_coff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_coff_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_coff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_coff_small_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_elf32_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_fdpic_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_fdpic_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_linux_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_linux_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_nbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_nbsd_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_symbian_le_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_vxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; - sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; + sh_coff_vec) tb="$tb coff-sh.lo $coff" ;; + sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;; + sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;; + sh_coff_small_le_vec) tb="$tb coff-sh.lo $coff" ;; + sh_elf32_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_fdpic_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_fdpic_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_linux_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_linux_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_nbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_nbsd_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_symbian_le_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_vxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo $coff" ;; + sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo $coff" ;; sparc_aout_le_vec) tb="$tb aout-sparcle.lo aout32.lo" ;; sparc_aout_linux_vec) tb="$tb sparclinux.lo aout32.lo" ;; sparc_aout_lynx_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;; sparc_aout_nbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; sparc_aout_sunos_be_vec) tb="$tb sunos.lo aout32.lo" ;; - sparc_coff_vec) tb="$tb coff-sparc.lo" ;; - sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;; + sparc_coff_vec) tb="$tb coff-sparc.lo $coffgen" ;; + sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo $coffgen" ;; sparc_elf32_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; sparc_elf32_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; sparc_elf32_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; @@ -15496,26 +15567,26 @@ do spu_elf32_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; sym_vec) tb="$tb xsym.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; - tic30_coff_vec) tb="$tb coff-tic30.lo" ;; - tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;; - tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; + tic30_coff_vec) tb="$tb coff-tic30.lo $coffgen" ;; + tic4x_coff0_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff1_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff2_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic54x_coff0_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff1_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff2_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo $coffgen" ;; tic6x_elf32_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; tic6x_elf32_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; tic6x_elf32_c6000_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; tic6x_elf32_c6000_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; tic6x_elf32_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; tic6x_elf32_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; - tic80_coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; + tic80_coff_vec) tb="$tb coff-tic80.lo $coff" ;; tilegx_elf32_be_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;; tilegx_elf32_le_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;; tilegx_elf64_be_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;; @@ -15527,9 +15598,10 @@ do vax_aout_bsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;; vax_aout_nbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;; vax_elf32_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; - w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo" ;; - we32k_coff_vec) tb="$tb coff-we32k.lo" ;; - x86_64_coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;; + visium_elf32_vec) tb="$tb elf32-visium.lo elf32.lo $elf" ;; + w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo $coffgen" ;; + we32k_coff_vec) tb="$tb coff-we32k.lo $coffgen" ;; + x86_64_coff_vec) tb="$tb coff-x86_64.lo $coff"; target_size=64 ;; x86_64_elf32_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; x86_64_elf32_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; x86_64_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; @@ -15537,16 +15609,16 @@ do x86_64_elf64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; x86_64_elf64_sol2_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; x86_64_mach_o_vec) tb="$tb mach-o-x86-64.lo" ;; - x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; - x86_64_pe_be_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; - x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; + x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; + x86_64_pe_be_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; + x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; xc16x_elf32_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;; xgate_elf32_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;; xstormy16_elf32_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; xtensa_elf32_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; xtensa_elf32_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; - z80_coff_vec) tb="$tb coff-z80.lo reloc16.lo" ;; - z8k_coff_vec) tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;; + z80_coff_vec) tb="$tb coff-z80.lo reloc16.lo $coffgen" ;; + z8k_coff_vec) tb="$tb coff-z8k.lo reloc16.lo $coff" ;; # These appear out of order in targets.c srec_vec) tb="$tb srec.lo" ;; @@ -16497,7 +16569,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bfd $as_me 2.24.51, which was +This file was extended by bfd $as_me 2.25.51, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16561,7 +16633,7 @@ Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -bfd config.status 2.24.51 +bfd config.status 2.25.51 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/bfd/configure.ac b/bfd/configure.ac new file mode 100644 index 000000000..a2743a033 --- /dev/null +++ b/bfd/configure.ac @@ -0,0 +1,1201 @@ +dnl Process this file with autoconf to produce a configure script. +dnl +dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. +dnl +dnl This file is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; see the file COPYING3. If not see +dnl . +dnl + +AC_PREREQ(2.59) +m4_include([version.m4]) +AC_INIT([bfd], BFD_VERSION) +AC_CONFIG_SRCDIR([libbfd.c]) + +AC_CANONICAL_TARGET +AC_ISC_POSIX + +AM_INIT_AUTOMAKE + +dnl These must be called before LT_INIT, because it may want +dnl to call AC_CHECK_PROG. +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(RANLIB, ranlib, :) + +dnl Default to a non shared library. This may be overridden by the +dnl configure option --enable-shared. +AC_DISABLE_SHARED + +AC_PROG_CC +AC_GNU_SOURCE +AC_USE_SYSTEM_EXTENSIONS + +LT_INIT([dlopen]) + +# AC_PLUGINS setting $plugins is called by ACX_LARGEFILE. +ACX_LARGEFILE + +AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes") + +if test "$plugins" = "yes"; then + enable_targets="$enable_targets plugin" +fi + +AC_ARG_ENABLE(64-bit-bfd, +[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)], +[case "${enableval}" in + yes) want64=true ;; + no) want64=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;; +esac],[want64=false])dnl + +AC_ARG_ENABLE(targets, +[ --enable-targets alternative target configurations], +[case "${enableval}" in + yes | "") AC_MSG_ERROR([enable-targets option must specify target names or 'all']) + ;; + no) enable_targets= ;; + *) enable_targets=$enableval ;; +esac])dnl + +AC_ARG_WITH(mmap, +[ --with-mmap try using mmap for BFD input files if available], +[case "${withval}" in + yes) want_mmap=true ;; + no) want_mmap=false ;; + *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;; +esac],[want_mmap=false])dnl + +AC_ARG_ENABLE(secureplt, +[ --enable-secureplt Default to creating read-only plt entries], +[case "${enableval}" in + yes) use_secureplt=true ;; + no) use_secureplt=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;; +esac],[use_secureplt=true])dnl +if test $use_secureplt = true; then + AC_DEFINE(USE_SECUREPLT, 1, + [Define if we should default to creating read-only plt entries]) +fi + +AC_ARG_ENABLE(leading-mingw64-underscores, + AS_HELP_STRING([--enable-leading-mingw64-underscores], + [Enable leading underscores on 64 bit mingw targets]), + [],[]) +AS_IF([ test x"$enable_leading_mingw64_underscores" = xyes ], + [AC_DEFINE(USE_MINGW64_LEADING_UNDERSCORES, 1, + [Define if we should use leading underscore on 64 bit mingw targets])]) + +DEBUGDIR=${libdir}/debug +AC_ARG_WITH(separate-debug-dir, + AS_HELP_STRING([--with-separate-debug-dir=DIR], + [Look for global separate debug info in DIR [[default=LIBDIR/debug]]]), +[DEBUGDIR="${withval}"]) +AC_SUBST(DEBUGDIR) + +# Check to see if we should allow the generation of +# symbols with the ELF standard's STT_COMMON type. +AC_ARG_ENABLE(elf-stt-common, +[ --enable-elf-stt-common Allow the generation of ELF symbols with the STT_COMMON type], +[case "${enableval}" in + yes) want_elf_stt_common=true ;; + no) want_elf_stt_common=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for ELF STT_COMMON option) ;; + esac], +# We have to choose a default behaviour. For native builds we could +# test whether the loader supports the STT_COMMON type, but that would +# mean that built binaries could not be exported to older systems where +# the loader does not support it. So by default we always choose to +# disable this feature. + want_elf_stt_common=false)dnl +if test $want_elf_stt_common = true; then + AC_DEFINE(USE_STT_COMMON, 1, + [Define if we may generate symbols with ELF's STT_COMMON type]) +fi + +ACX_PKGVERSION([GNU Binutils]) +ACX_BUGURL([http://www.sourceware.org/bugzilla/]) + +AM_BINUTILS_WARNINGS + +AC_CONFIG_HEADERS(config.h:config.in) + +# PR 14072 +AH_VERBATIM([00_CONFIG_H_CHECK], +[/* Check that config.h is #included before system headers + (this works only for glibc, but that should be enough). */ +#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) +# error config.h must be #included before system headers +#endif +#define __CONFIG_H__ 1]) + +if test -z "$target" ; then + AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) +fi + +AM_MAINTAINER_MODE +AM_CONDITIONAL(GENINSRC_NEVER, false) +AM_INSTALL_LIBBFD +AC_EXEEXT + +host64=false +target64=false +bfd_default_target_size=32 + +# host stuff: + +ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi id ru uk" +ZW_GNU_GETTEXT_SISTER_DIR +AM_PO_SUBDIRS + +# Permit host specific settings. +. ${srcdir}/configure.host + +AC_SUBST(HDEFINES) +AC_PROG_INSTALL + +BFD_HOST_64BIT_LONG=0 +BFD_HOST_64BIT_LONG_LONG=0 +BFD_HOST_64_BIT_DEFINED=0 +BFD_HOST_64_BIT= +BFD_HOST_U_64_BIT= +BFD_HOSTPTR_T="unsigned long" + +AC_CHECK_SIZEOF(long long) +AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(long) + +if test "x${ac_cv_sizeof_void_p}" = "x8"; then + host64=true +fi + +if test "x${ac_cv_sizeof_long}" = "x8"; then + BFD_HOST_64BIT_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" +elif test "x${ac_cv_sizeof_long_long}" = "x8"; then + BFD_HOST_64BIT_LONG_LONG=1 + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long" + if test "x${ac_cv_sizeof_void_p}" = "x8"; then + BFD_HOSTPTR_T="unsigned long long" + fi +fi + +if test -n "${HOST_64BIT_TYPE}" -a -n "${HOST_U_64BIT_TYPE}"; then + BFD_HOST_64_BIT_DEFINED=1 + BFD_HOST_64_BIT="${HOST_64BIT_TYPE}" + BFD_HOST_U_64_BIT="${HOST_U_64BIT_TYPE}" +fi + +AC_SUBST(BFD_HOST_64BIT_LONG) +AC_SUBST(BFD_HOST_64BIT_LONG_LONG) +AC_SUBST(BFD_HOST_64_BIT_DEFINED) +AC_SUBST(BFD_HOST_64_BIT) +AC_SUBST(BFD_HOST_U_64_BIT) +AC_SUBST(BFD_HOSTPTR_T) + +BFD_CC_FOR_BUILD + +AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h wchar.h) +AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h) +GCC_HEADER_STDINT(bfd_stdint.h) +AC_HEADER_TIME +AC_HEADER_DIRENT + +ACX_HEADER_STRING +AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno) +AC_CHECK_FUNCS(strtoull getrlimit) + +AC_CHECK_DECLS(basename) +AC_CHECK_DECLS(ftello) +AC_CHECK_DECLS(ftello64) +AC_CHECK_DECLS(fseeko) +AC_CHECK_DECLS(fseeko64) + +BFD_BINARY_FOPEN + +AC_CHECK_DECLS(ffs) +AC_CHECK_DECLS(free) +AC_CHECK_DECLS(getenv) +AC_CHECK_DECLS(malloc) +AC_CHECK_DECLS(realloc) +AC_CHECK_DECLS(stpcpy) +AC_CHECK_DECLS(strstr) +AC_CHECK_DECLS(snprintf) +AC_CHECK_DECLS(vsnprintf) +AC_CHECK_DECLS(strnlen) + +# Link in zlib if we can. This allows us to read compressed debug sections. +# This is used only by compress.c. +AM_ZLIB + +# If we are configured native, pick a core file support file. +COREFILE= +COREFLAG= +CORE_HEADER= +TRAD_HEADER= +if test "${target}" = "${host}"; then + case "${host}" in + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu | alpha*-*-*vms*) + COREFILE='' + ;; + alpha*-*-linux-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; + alpha*-*-netbsd* | alpha*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + alpha*-*-*) + COREFILE=osf-core.lo + ;; + arm-*-freebsd* | arm-*-kfreebsd*-gnu) + COREFILE='' ;; + arm-*-netbsd* | arm-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + arm-*-riscix) COREFILE=trad-core.lo ;; + hppa*-*-hpux*) COREFILE=hpux-core.lo ;; + hppa*-*-hiux*) COREFILE=hpux-core.lo ;; + hppa*-*-mpeix*) COREFILE=hpux-core.lo ;; + hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo" + COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;; + hppa*-*-netbsd* | hppa*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + + i370-*-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i370linux.h"' + ;; + +changequote(,)dnl + i[3-7]86-sequent-bsd*) +changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/symmetry.h"' + ;; +changequote(,)dnl + i[3-7]86-sequent-sysv4*) ;; + i[3-7]86-sequent-sysv*) +changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/symmetry.h"' + ;; +changequote(,)dnl + i[3-7]86-*-bsdi) +changequote([,])dnl + COREFILE= + ;; +changequote(,)dnl + i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234] | i[3-7]86-*-freebsd4\.[01234]\.* | i[3-7]86-*-freebsd*aout*) +changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386bsd.h"' + ;; +changequote(,)dnl + i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*) +changequote([,])dnl + COREFILE='' + TRAD_HEADER='"hosts/i386bsd.h"' + ;; +changequote(,)dnl + i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd*) +changequote([,])dnl + COREFILE=netbsd-core.lo + ;; +changequote(,)dnl + i[3-7]86-esix-sysv3*) +changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/esix.h"' + ;; +changequote(,)dnl + i[3-7]86-*-sco3.2v5*) +changequote([,])dnl + COREFILE=sco5-core.lo + ;; +changequote(,)dnl + i[3-7]86-*-sco* | i[3-7]86-*-isc*) +changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386sco.h"' + ;; +changequote(,)dnl + i[3-7]86-*-mach3*) +changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386mach3.h"' + ;; +changequote(,)dnl + i[3-7]86-*-linux-*) +changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' + case "$enable_targets"-"$want64" in + *x86_64-*linux*|*-true) + CORE_HEADER='"hosts/x86-64linux.h"' + esac + ;; +changequote(,)dnl + i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; + i[3-7]86-*-aix*) COREFILE=aix386-core.lo ;; +changequote([,])dnl + i860-*-mach3* | i860-*-osf1*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i860mach3.h"' + ;; + mips-*-netbsd* | mips*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + mips-dec-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/decstation.h"' + ;; + mips-sgi-irix4*) COREFILE=irix-core.lo ;; + mips-sgi-irix5*) COREFILE=irix-core.lo ;; + mips-sgi-irix6*) COREFILE=irix-core.lo ;; + mips-*-sysv4*) ;; + mips-*-sysv* | mips-*-riscos*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/riscos.h"' + ;; + mips-sony-bsd*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/news-mips.h"' + ;; + m68*-bull*-sysv*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/dpx2.h"' + ;; + m68*-hp-hpux*) COREFILE=hpux-core.lo ;; + m68*-hp-bsd*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; + m68*-*-linux-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; + m68*-motorola-sysv*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/delta68.h"' + ;; + m68*-sony-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/news.h"' + ;; + m68*-*-netbsd* | m68*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + m68*-apple-aux*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68kaux.h"' + ;; + m88*-*-sysv4*) + ;; + m88*-motorola-sysv*) + COREFILE=ptrace-core.lo + ;; + m88*-*-mach3*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m88kmach3.h"' + ;; + m88*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + ns32k-pc532-mach) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/pc532mach.h"' + ;; + ns32k-*-netbsd* | ns32k-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + rs6000-*-lynx*) + COREFILE=lynx-core.lo + ;; +changequote(,)dnl + rs6000-*-aix[5-9].* | powerpc-*-aix[5-9].*) +changequote([,])dnl + COREFILE=rs6000-core.lo + COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE" + ;; +changequote(,)dnl + rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*) +changequote([,])dnl + COREFILE=rs6000-core.lo + COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE" + # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE + # have c_impl as a member of struct core_dumpx + AC_MSG_CHECKING([for c_impl in struct core_dumpx]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct core_dumpx c; c.c_impl = 0;]])],[AC_DEFINE(HAVE_ST_C_IMPL, 1, + [Define if struct core_dumpx has member c_impl]) + AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) + ;; + rs6000-*-aix4*) COREFILE=rs6000-core.lo ;; + rs6000-*-*) COREFILE=rs6000-core.lo ;; + powerpc-*-aix4*) COREFILE=rs6000-core.lo ;; + powerpc-*-aix*) COREFILE=rs6000-core.lo ;; + powerpc-*-beos*) ;; + powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) + COREFILE='' ;; + powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; + powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; + s390*-*-*) COREFILE=trad-core.lo ;; + sh*-*-netbsd* | sh*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + sparc-*-netbsd* | sparc*-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + tahoe-*-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/tahoe.h"' + ;; + vax-*-netbsd* | vax-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + vax-*-ultrix2*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/vaxult2.h"' + ;; + vax-*-ultrix*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/vaxult2.h"' + ;; + vax-*-linux-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/vaxlinux.h"' + ;; + vax-*-*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/vaxbsd.h"' + ;; + x86_64-*-linux*) + CORE_HEADER='"hosts/x86-64linux.h"' + ;; + x86_64-*-netbsd* | x86_64-*-openbsd*) + COREFILE=netbsd-core.lo + ;; + esac + + case "$COREFILE" in + aix386-core.lo) COREFLAG=-DAIX386_CORE ;; + hppabsd-core.lo) COREFLAG=-DHPPABSD_CORE ;; + hpux-core.lo) COREFLAG=-DHPUX_CORE ;; + irix-core.lo) COREFLAG=-DIRIX_CORE ;; + lynx-core.lo) COREFLAG=-DLYNX_CORE ;; + netbsd-core.lo) COREFLAG=-DNETBSD_CORE ;; + osf-core.lo) COREFLAG=-DOSF_CORE ;; + ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;; + rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;; + sco5-core.lo) COREFLAG="$COREFLAG -DSCO5_CORE" ;; + trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;; + esac + + # ELF corefile support has several flavors, but all of + # them use something called + AC_CHECK_HEADERS(sys/procfs.h) + if test "$ac_cv_header_sys_procfs_h" = yes; then + BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who) + BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t) + BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo_t, pr_pid) + BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo32_t, pr_pid) + BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo_t, pr_pid) + BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo32_t, pr_pid) + BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg) + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_fpreg) + BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t) + fi +fi +AC_SUBST(COREFILE) +AC_SUBST(COREFLAG) +if test -n "$CORE_HEADER"; then + AC_DEFINE_UNQUOTED(CORE_HEADER, $CORE_HEADER, + [Name of host specific core header file to include in elf.c.]) +fi +if test -n "$TRAD_HEADER"; then + AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, + [Name of host specific header file to include in trad-core.c.]) +fi + +# Check if linker supports --as-needed and --no-as-needed options +AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed, + [bfd_cv_ld_as_needed=no + if $LD --help 2>/dev/null | grep as-needed > /dev/null; then + bfd_cv_ld_as_needed=yes + fi + ]) + +LT_LIB_M + +# When building a shared libbfd, link against the pic version of libiberty +# so that apps that use libbfd won't need libiberty just to satisfy any +# libbfd references. +# We can't do that if a pic libiberty is unavailable since including non-pic +# code would insert text relocations into libbfd. +SHARED_LIBADD= +SHARED_LDFLAGS= +if test "$enable_shared" = "yes"; then +changequote(,)dnl + x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` +changequote([,])dnl + if test -n "$x"; then + SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" + fi + +# More hacks to build DLLs on Windows. + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" + ;; + + # Hack to build or1k-src on OSX + or1k*-*-darwin*) + SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl" + ;; + esac + + if test -n "$SHARED_LIBADD"; then + if test -n "$LIBM"; then + if test x"$bfd_cv_ld_as_needed" = xyes; then + # Link against libm only when needed. Put -lc, -lm inside -Wl + # to stop libtool reordering these options. + SHARED_LIBADD="$SHARED_LIBADD -Wl,-lc,--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed" + else + SHARED_LIBADD="$SHARED_LIBADD $LIBM" + fi + fi + fi +fi +AC_SUBST(SHARED_LDFLAGS) +AC_SUBST(SHARED_LIBADD) + +# target stuff: + +# Canonicalize the secondary target names. +if test -n "$enable_targets" ; then + for targ in `echo $enable_targets | sed 's/,/ /g'` + do + result=`$ac_config_sub $targ 2>/dev/null` + if test -n "$result" ; then + canon_targets="$canon_targets $result" + else + # Allow targets that config.sub doesn't recognize, like "all". + canon_targets="$canon_targets $targ" + fi + done +fi + +all_targets=false +defvec= +selvecs= +assocvecs= +selarchs= +TDEFINES= +for targ in $target $canon_targets +do + if test "x$targ" = "xall"; then + all_targets=true + assocvecs="$assocvecs $targ_defvec $targ_selvecs" + else + . $srcdir/config.bfd + if test "x$targ" = "x$target"; then + defvec=$targ_defvec + fi + selvecs="$selvecs $targ_defvec $targ_selvecs" + selarchs="$selarchs $targ_archs" + TDEFINES="$TDEFINES $targ_cflags" + fi +done +AC_SUBST(TDEFINES) + +# This processing still needs to be done if we're to decide properly whether +# 64-bit support needs to be compiled in. Currently, it will be included if +# the default or any other explicitly requested target requires it; it +# will not be included on a 32-bit host if no 64-bit target is requested, and +# no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is +# used. + +# uniq the default and selected vectors in all the configured targets. +f="" +for i in $selvecs ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +selvecs="$f" + + +# uniq the associated vectors in all the configured targets. +f="" +for i in $assocvecs ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +assocvecs="$f" + + +# uniq the architectures in all the configured targets. +f="" +for i in $selarchs ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +selarchs="$f" + +# Target backend .o files. +tb= + +elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo + elf-eh-frame.lo dwarf1.lo dwarf2.lo" +coffgen="coffgen.lo dwarf2.lo" +coff="cofflink.lo $coffgen" +ecoff="ecofflink.lo $coffgen" +xcoff="xcofflink.lo $coffgen" + +for vec in $selvecs +do + target_size=32 + case "$vec" in + # This list is alphabetized to make it easy to compare + # with the two vector lists in targets.c. For the same reason, + # use one entry per line, even though this leads to long lines. + aarch64_elf32_be_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;; + aarch64_elf32_le_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;; + aarch64_elf64_be_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;; + aarch64_elf64_le_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;; + alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo $ecoff"; target_size=64 ;; + alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; + alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; + alpha_nlm32_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;; + alpha_vms_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;; + alpha_vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;; + am33_elf32_linux_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; + aout0_be_vec) tb="$tb aout0.lo aout32.lo" ;; + aout64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;; + aout_vec) tb="$tb host-aout.lo aout32.lo" ;; + aout_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;; + arc_elf32_be_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; + arc_elf32_le_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; + arm_aout_be_vec) tb="$tb aout-arm.lo aout32.lo" ;; + arm_aout_le_vec) tb="$tb aout-arm.lo aout32.lo" ;; + arm_aout_nbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; + arm_aout_riscix_vec) tb="$tb aout32.lo riscix.lo" ;; + arm_coff_be_vec) tb="$tb coff-arm.lo $coff" ;; + arm_coff_le_vec) tb="$tb coff-arm.lo $coff" ;; + arm_elf32_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_elf32_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_elf32_nacl_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_elf32_nacl_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_elf32_symbian_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_elf32_symbian_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_elf32_vxworks_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_elf32_vxworks_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; + arm_pe_be_vec) tb="$tb pe-arm.lo peigen.lo $coff" ;; + arm_pe_le_vec) tb="$tb pe-arm.lo peigen.lo $coff" ;; + arm_pe_epoc_be_vec) tb="$tb epoc-pe-arm.lo peigen.lo $coff" ;; + arm_pe_epoc_le_vec) tb="$tb epoc-pe-arm.lo peigen.lo $coff" ;; + arm_pe_wince_be_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo $coff" ;; + arm_pe_wince_le_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo $coff" ;; + arm_pei_be_vec) tb="$tb pei-arm.lo peigen.lo $coff" ;; + arm_pei_le_vec) tb="$tb pei-arm.lo peigen.lo $coff" ;; + arm_pei_epoc_be_vec) tb="$tb epoc-pei-arm.lo peigen.lo $coff" ;; + arm_pei_epoc_le_vec) tb="$tb epoc-pei-arm.lo peigen.lo $coff" ;; + arm_pei_wince_be_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo $coff" ;; + arm_pei_wince_le_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo $coff" ;; + avr_elf32_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; + bfin_elf32_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;; + bfin_elf32_fdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;; + bout_be_vec) tb="$tb bout.lo aout32.lo" ;; + bout_le_vec) tb="$tb bout.lo aout32.lo" ;; + cr16_elf32_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;; + cr16c_elf32_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;; + cris_aout_vec) tb="$tb aout-cris.lo" ;; + cris_elf32_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; + cris_elf32_us_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; + crx_elf32_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;; + d10v_elf32_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; + d30v_elf32_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; + dlx_elf32_be_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;; + elf32_be_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; + elf32_le_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; + elf64_be_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + elf64_le_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + epiphany_elf32_vec) tb="$tb elf32-epiphany.lo elf32.lo $elf" ;; + fr30_elf32_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; + frv_elf32_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; + frv_elf32_fdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; + h8300_coff_vec) tb="$tb coff-h8300.lo reloc16.lo $coffgen" ;; + h8300_elf32_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; + h8500_coff_vec) tb="$tb coff-h8500.lo reloc16.lo $coffgen" ;; + hppa_elf32_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + hppa_elf32_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + hppa_elf32_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; + hppa_elf64_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; + hppa_elf64_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; + hppa_som_vec) tb="$tb som.lo" ;; + i370_elf32_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; + i386_aout_vec) tb="$tb i386aout.lo aout32.lo" ;; + i386_aout_bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; + i386_aout_dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; + i386_aout_fbsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; + i386_aout_linux_vec) tb="$tb i386linux.lo aout32.lo" ;; + i386_aout_lynx_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;; + i386_aout_mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;; + i386_aout_nbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; + i386_aout_os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; + i386_coff_vec) tb="$tb coff-i386.lo $coff" ;; + i386_coff_go32_vec) tb="$tb coff-go32.lo $coff" ;; + i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo $coff" ;; + i386_coff_lynx_vec) tb="$tb cf-i386lynx.lo lynx-core.lo $coff" ;; + i386_elf32_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; + i386_elf32_fbsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; + i386_elf32_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; + i386_elf32_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; + i386_elf32_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; + i386_mach_o_vec) tb="$tb mach-o-i386.lo" ;; + i386_msdos_vec) tb="$tb i386msdos.lo" ;; + i386_nlm32_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; + i386_pe_vec) tb="$tb pe-i386.lo peigen.lo $coff" ;; + i386_pei_vec) tb="$tb pei-i386.lo peigen.lo $coff" ;; + i860_coff_vec) tb="$tb coff-i860.lo $coff" ;; + i860_elf32_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; + i860_elf32_le_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; + i960_elf32_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; + ia64_elf32_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;; + ia64_elf32_hpux_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;; + ia64_elf64_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; + ia64_elf64_le_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; + ia64_elf64_hpux_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; + ia64_elf64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;; + ia64_pei_vec) tb="$tb pei-ia64.lo pepigen.lo $coff"; target_size=64 ;; + icoff_be_vec) tb="$tb coff-i960.lo $coff" ;; + icoff_le_vec) tb="$tb coff-i960.lo $coff" ;; + ieee_vec) tb="$tb ieee.lo" ;; + ip2k_elf32_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; + iq2000_elf32_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;; + k1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + k1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + l1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + l1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + lm32_elf32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;; + lm32_elf32_fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;; + m32c_elf32_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;; + m32r_elf32_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + m32r_elf32_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + m32r_elf32_linux_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + m32r_elf32_linux_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + m68hc11_elf32_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;; + m68hc12_elf32_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;; + m68k_aout_4knbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;; + m68k_aout_hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;; + m68k_aout_hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;; + m68k_aout_linux_vec) tb="$tb m68klinux.lo aout32.lo" ;; + m68k_aout_nbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;; + m68k_aout_newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; + m68k_coff_vec) tb="$tb coff-m68k.lo $coff" ;; + m68k_coff_apollo_vec) tb="$tb coff-apollo.lo $coffgen" ;; + m68k_coff_aux_vec) tb="$tb coff-aux.lo coff-m68k.lo $coff" ;; + m68k_coff_sysv_vec) tb="$tb coff-svm68k.lo $coff" ;; + m68k_coff_un_vec) tb="$tb coff-u68k.lo coff-m68k.lo $coff" ;; + m68k_elf32_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; + m68k_versados_vec) tb="$tb versados.lo" ;; + m88k_aout_mach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; + m88k_aout_obsd_vec) tb="$tb m88kopenbsd.lo aout32.lo" ;; + m88k_coff_bcs_vec) tb="$tb coff-m88k.lo $coffgen" ;; + m88k_elf32_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; + mach_o_be_vec) tb="$tb mach-o.lo dwarf2.lo" ;; + mach_o_le_vec) tb="$tb mach-o.lo dwarf2.lo" ;; + mach_o_fat_vec) tb="$tb mach-o.lo dwarf2.lo" ;; + mcore_elf32_be_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; + mcore_elf32_le_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; + mcore_pe_be_vec) tb="$tb pe-mcore.lo peigen.lo $coff" ;; + mcore_pe_le_vec) tb="$tb pe-mcore.lo peigen.lo $coff" ;; + mcore_pei_be_vec) tb="$tb pei-mcore.lo peigen.lo $coff" ;; + mcore_pei_le_vec) tb="$tb pei-mcore.lo peigen.lo $coff" ;; + mep_elf32_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; + mep_elf32_le_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; + metag_elf32_vec) tb="$tb elf32-metag.lo elf32.lo $elf" ;; + microblaze_elf32_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;; + microblaze_elf32_le_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;; + mips_ecoff_be_vec) tb="$tb coff-mips.lo ecoff.lo $ecoff" ;; + mips_ecoff_le_vec) tb="$tb coff-mips.lo ecoff.lo $ecoff" ;; + mips_ecoff_bele_vec) tb="$tb coff-mips.lo ecoff.lo $ecoff" ;; + mips_elf32_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_n_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_n_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntrad_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntrad_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntradfbsd_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_ntradfbsd_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf32_trad_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_trad_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_tradfbsd_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_tradfbsd_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_vxworks_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf32_vxworks_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff" ;; + mips_elf64_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_trad_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_trad_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_tradfbsd_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_elf64_tradfbsd_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf $ecoff"; target_size=64 ;; + mips_pe_le_vec) tb="$tb pe-mips.lo peigen.lo $coff" ;; + mips_pei_le_vec) tb="$tb pei-mips.lo peigen.lo $coff" ;; + mmix_elf64_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; + mmix_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; + mn10200_elf32_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; + mn10300_elf32_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + moxie_elf32_be_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;; + moxie_elf32_le_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;; + msp430_elf32_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; + msp430_elf32_ti_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; + mt_elf32_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;; + nds32_elf32_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nds32_elf32_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nds32_elf32_linux_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nds32_elf32_linux_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; + nios2_elf32_be_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; + nios2_elf32_le_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; + ns32k_aout_pc532mach_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; + ns32k_aout_pc532nbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; + or1k_elf32_vec) tb="$tb elf32-or1k.lo elf32.lo $elf" ;; + pdp11_aout_vec) tb="$tb pdp11.lo" ;; + pef_vec) tb="$tb pef.lo" ;; + pef_xlib_vec) tb="$tb pef.lo" ;; + pj_elf32_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;; + pj_elf32_le_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;; + plugin_vec) tb="$tb plugin.lo" ;; + powerpc_boot_vec) tb="$tb ppcboot.lo" ;; + powerpc_elf32_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; + powerpc_elf32_le_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; + powerpc_elf32_fbsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; + powerpc_elf32_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; + powerpc_elf64_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; + powerpc_elf64_le_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; + powerpc_elf64_fbsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; + powerpc_nlm32_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; + powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;; + powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo $coff" ;; + powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo $coff" ;; + powerpc_pei_le_vec) tb="$tb pei-ppc.lo peigen.lo $coff" ;; + powerpc_xcoff_vec) tb="$tb coff-rs6000.lo $xcoff" ;; + rl78_elf32_vec) tb="$tb elf32-rl78.lo elf32.lo $elf" ;; + rs6000_xcoff64_vec) tb="$tb coff64-rs6000.lo aix5ppc-core.lo $xcoff"; target_size=64 ;; + rs6000_xcoff64_aix_vec) tb="$tb coff64-rs6000.lo aix5ppc-core.lo $xcoff"; target_size=64 ;; + rs6000_xcoff_vec) tb="$tb coff-rs6000.lo $xcoff" ;; + rx_elf32_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; + rx_elf32_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; + rx_elf32_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; + s390_elf32_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; + s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; + score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;; + score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;; + sh64_elf32_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_linux_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_linux_be_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" target_size=64 ;; + sh64_elf32_nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" ;; + sh64_elf32_nbsd_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf" ;; + sh64_elf64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + sh64_elf64_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + sh64_elf64_linux_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + sh64_elf64_linux_be_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + sh64_elf64_nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + sh64_elf64_nbsd_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + sh_coff_vec) tb="$tb coff-sh.lo $coff" ;; + sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;; + sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;; + sh_coff_small_le_vec) tb="$tb coff-sh.lo $coff" ;; + sh_elf32_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_fdpic_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_fdpic_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_linux_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_linux_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_nbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_nbsd_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_symbian_le_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_vxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo $coff" ;; + sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo $coff" ;; + sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo $coff" ;; + sparc_aout_le_vec) tb="$tb aout-sparcle.lo aout32.lo" ;; + sparc_aout_linux_vec) tb="$tb sparclinux.lo aout32.lo" ;; + sparc_aout_lynx_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;; + sparc_aout_nbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; + sparc_aout_sunos_be_vec) tb="$tb sunos.lo aout32.lo" ;; + sparc_coff_vec) tb="$tb coff-sparc.lo $coffgen" ;; + sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo $coffgen" ;; + sparc_elf32_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; + sparc_elf32_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; + sparc_elf32_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; + sparc_elf64_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; + sparc_elf64_fbsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; + sparc_elf64_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; + sparc_nlm32_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; + spu_elf32_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; + sym_vec) tb="$tb xsym.lo" ;; + tic30_aout_vec) tb="$tb aout-tic30.lo" ;; + tic30_coff_vec) tb="$tb coff-tic30.lo $coffgen" ;; + tic4x_coff0_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff1_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff2_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo $coffgen" ;; + tic54x_coff0_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff1_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff2_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo $coffgen" ;; + tic6x_elf32_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + tic6x_elf32_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + tic6x_elf32_c6000_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + tic6x_elf32_c6000_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + tic6x_elf32_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + tic6x_elf32_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; + tic80_coff_vec) tb="$tb coff-tic80.lo $coff" ;; + tilegx_elf32_be_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;; + tilegx_elf32_le_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;; + tilegx_elf64_be_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;; + tilegx_elf64_le_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;; + tilepro_elf32_vec) tb="$tb elf32-tilepro.lo elf32.lo $elf" ;; + v800_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; + v850_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; + vax_aout_1knbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;; + vax_aout_bsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;; + vax_aout_nbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;; + vax_elf32_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; + visium_elf32_vec) tb="$tb elf32-visium.lo elf32.lo $elf" ;; + w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo $coffgen" ;; + we32k_coff_vec) tb="$tb coff-we32k.lo $coffgen" ;; + x86_64_coff_vec) tb="$tb coff-x86_64.lo $coff"; target_size=64 ;; + x86_64_elf32_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; + x86_64_elf32_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; + x86_64_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + x86_64_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + x86_64_elf64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + x86_64_elf64_sol2_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; + x86_64_mach_o_vec) tb="$tb mach-o-x86-64.lo" ;; + x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; + x86_64_pe_be_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; + x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; + xc16x_elf32_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;; + xgate_elf32_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;; + xstormy16_elf32_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; + xtensa_elf32_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; + xtensa_elf32_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; + z80_coff_vec) tb="$tb coff-z80.lo reloc16.lo $coffgen" ;; + z8k_coff_vec) tb="$tb coff-z8k.lo reloc16.lo $coff" ;; + + # These appear out of order in targets.c + srec_vec) tb="$tb srec.lo" ;; + symbolsrec_vec) tb="$tb srec.lo" ;; + tekhex_vec) tb="$tb tekhex.lo" ;; + core_cisco_be_vec) tb="$tb cisco-core.lo" ;; + core_cisco_le_vec) tb="$tb cisco-core.lo" ;; + + "") ;; + *) AC_MSG_ERROR(*** unknown target vector $vec) ;; + esac + + if test ${target_size} = 64; then + target64=true + fi + if test x"${vec}" = x"${defvec}"; then + bfd_default_target_size=${target_size} + fi +done + +# Target architecture .o files. +# A couple of CPUs use shorter file names to avoid problems on DOS +# filesystems. +ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/` + +# Weed out duplicate .o files. +f="" +for i in $tb ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +tb="$f" + +f="" +for i in $ta ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +ta="$f" + +bfd_backends="$tb" +bfd_machines="$ta" + +if test x${all_targets} = xtrue ; then + bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)' + bfd_machines="${bfd_machines}"' $(ALL_MACHINES)' + selvecs= + havevecs=-DHAVE_all_vecs + selarchs= + test -n "$assocvecs" && + assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` +else # all_targets is true + # Only set these if they will be nonempty, for the clever echo. + havevecs= + assocvecs= + test -n "$selvecs" && + havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'` + test -n "$selvecs" && + selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` + test -n "$selarchs" && + selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` +fi # all_targets is true + +case ${host64}-${target64}-${want64} in + *true*) + wordsize=64 + bfd64_libs='$(BFD64_LIBS)' + all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' + if test $BFD_HOST_64_BIT_DEFINED = 0; then + AC_MSG_WARN([You have requested a 64 bit BFD configuration, but]) + AC_MSG_WARN([your compiler may not have a 64 bit integral type]) + fi + if test -n "$GCC" ; then + bad_64bit_gcc=no; + AC_MSG_CHECKING([for gcc version with buggy 64-bit support]) + # Add more tests for gcc versions with non-working 64-bit support here. + AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:], + bad_64bit_gcc=yes; + AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]), + AC_MSG_RESULT(no)) + if test $bad_64bit_gcc = yes ; then + AC_MSG_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration]) + fi + fi + ;; + false-false-false) + wordsize=32 + all_backends='$(BFD32_BACKENDS)' + ;; +esac + +AC_SUBST(wordsize) +AC_SUBST(bfd64_libs) +AC_SUBST(all_backends) +AC_SUBST(bfd_backends) +AC_SUBST(bfd_machines) +AC_SUBST(bfd_default_target_size) + +if test "$plugins" = "yes"; then + supports_plugins=1 +else + supports_plugins=0 +fi +AC_SUBST(supports_plugins) +AC_SUBST(lt_cv_dlopen_libs) + +# Determine the host dependant file_ptr a.k.a. off_t type. In order +# prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and +# fseeko, long. This assumes that sizeof off_t is .ge. sizeof long. +# Hopefully a reasonable assumption since fseeko et.al. should be +# upward compatible. +AC_CHECK_FUNCS(ftello ftello64 fseeko fseeko64 fopen64) +if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then + AC_CHECK_SIZEOF(off_t) +fi +AC_MSG_CHECKING([file_ptr type]) +bfd_file_ptr="long" +bfd_ufile_ptr="unsigned long" +if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ + -o x"${ac_cv_sizeof_off_t}" = x8; then + bfd_file_ptr=BFD_HOST_64_BIT + bfd_ufile_ptr=BFD_HOST_U_64_BIT +fi +AC_MSG_RESULT($bfd_file_ptr) +AC_SUBST(bfd_file_ptr) +AC_SUBST(bfd_ufile_ptr) + + +tdefaults="" +test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" +test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" +test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'" +test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" +AC_SUBST(tdefaults) +AC_SUBST(havevecs) + +dnl AC_CHECK_HEADERS(sys/mman.h) +AC_FUNC_MMAP +AC_CHECK_FUNCS(madvise mprotect) +case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in + true+yes ) AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;; +esac + +rm -f doc/config.status +AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in]) + +dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of +dnl our two separate POTFILES. Yuck. +AC_CONFIG_COMMANDS([default], +[[ +case "$srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; +esac +POFILES= +GMOFILES= +for lang in dummy $OBSOLETE_ALL_LINGUAS; do + if test $lang != dummy; then + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + fi +done +sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \ + -e '/BLD-POTFILES =/r po/BLD-POTFILES' \ + -e "s,@POFILES@,$POFILES," \ + -e "s,@GMOFILES@,$GMOFILES," \ + po/Makefile.in > po/Makefile]],[[]]) + +dnl Required by html, pdf, install-pdf and install-html +AC_SUBST(datarootdir) +AC_SUBST(docdir) +AC_SUBST(htmldir) +AC_SUBST(pdfdir) + +AC_OUTPUT diff --git a/bfd/configure.com b/bfd/configure.com index 707ba4978..7f7411d05 100644 --- a/bfd/configure.com +++ b/bfd/configure.com @@ -7,7 +7,7 @@ $! $! Written by Klaus K"ampf (kkaempf@rmi.de) $! Rewritten by Tristan Gingold (gingold@adacore.com) $! -$! Copyright (C) 2012-2014 Free Software Foundation, Inc. +$! Copyright (C) 2012-2015 Free Software Foundation, Inc. $! $! This file is free software; you can redistribute it and/or modify $! it under the terms of the GNU General Public License as published by diff --git a/bfd/configure.host b/bfd/configure.host index e796b6a55..0e1de45b5 100644 --- a/bfd/configure.host +++ b/bfd/configure.host @@ -1,5 +1,5 @@ # -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ # Since the "bfd/hosts" directory is shared by the bfd, opcodes, and # binutils directories (at least), the index to it is also shared. -# This is that index. Each configure.in file should source this file +# This is that index. Each configure.ac file should source this file # in its per-host part. # This sets the following shell variables: diff --git a/bfd/configure.in b/bfd/configure.in deleted file mode 100644 index 2cc44990e..000000000 --- a/bfd/configure.in +++ /dev/null @@ -1,1204 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -dnl -dnl Copyright (C) 2012-2014 Free Software Foundation, Inc. -dnl -dnl This file is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; see the file COPYING3. If not see -dnl . -dnl - -AC_PREREQ(2.59) -AC_INIT([bfd], [2.24.51]) -AC_CONFIG_SRCDIR([libbfd.c]) - -AC_CANONICAL_TARGET -AC_ISC_POSIX - -AM_INIT_AUTOMAKE - -dnl These must be called before LT_INIT, because it may want -dnl to call AC_CHECK_PROG. -AC_CHECK_TOOL(AR, ar) -AC_CHECK_TOOL(RANLIB, ranlib, :) - -dnl Default to a non shared library. This may be overridden by the -dnl configure option --enable-shared. -AC_DISABLE_SHARED - -AC_PROG_CC -AC_GNU_SOURCE -AC_USE_SYSTEM_EXTENSIONS - -LT_INIT([dlopen]) - -# AC_PLUGINS setting $plugins is called by ACX_LARGEFILE. -ACX_LARGEFILE - -AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes") - -if test "$plugins" = "yes"; then - if test "$enable_dlopen" != "yes" ; then - AC_MSG_ERROR([ - Building BFD with plugin support requires a host that supports -ldl.]) - fi - enable_targets="$enable_targets plugin" -fi - -AC_ARG_ENABLE(64-bit-bfd, -[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)], -[case "${enableval}" in - yes) want64=true ;; - no) want64=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;; -esac],[want64=false])dnl - -AC_ARG_ENABLE(targets, -[ --enable-targets alternative target configurations], -[case "${enableval}" in - yes | "") AC_MSG_ERROR([enable-targets option must specify target names or 'all']) - ;; - no) enable_targets= ;; - *) enable_targets=$enableval ;; -esac])dnl - -AC_ARG_WITH(mmap, -[ --with-mmap try using mmap for BFD input files if available], -[case "${withval}" in - yes) want_mmap=true ;; - no) want_mmap=false ;; - *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;; -esac],[want_mmap=false])dnl - -AC_ARG_ENABLE(secureplt, -[ --enable-secureplt Default to creating read-only plt entries], -[case "${enableval}" in - yes) use_secureplt=true ;; - no) use_secureplt=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;; -esac],[use_secureplt=true])dnl -if test $use_secureplt = true; then - AC_DEFINE(USE_SECUREPLT, 1, - [Define if we should default to creating read-only plt entries]) -fi - -AC_ARG_ENABLE(leading-mingw64-underscores, - AS_HELP_STRING([--enable-leading-mingw64-underscores], - [Enable leading underscores on 64 bit mingw targets]), - [],[]) -AS_IF([ test x"$enable_leading_mingw64_underscores" = xyes ], - [AC_DEFINE(USE_MINGW64_LEADING_UNDERSCORES, 1, - [Define if we should use leading underscore on 64 bit mingw targets])]) - -DEBUGDIR=${libdir}/debug -AC_ARG_WITH(separate-debug-dir, - AS_HELP_STRING([--with-separate-debug-dir=DIR], - [Look for global separate debug info in DIR [[default=LIBDIR/debug]]]), -[DEBUGDIR="${withval}"]) -AC_SUBST(DEBUGDIR) - -# Check to see if we should allow the generation of -# symbols with the ELF standard's STT_COMMON type. -AC_ARG_ENABLE(elf-stt-common, -[ --enable-elf-stt-common Allow the generation of ELF symbols with the STT_COMMON type], -[case "${enableval}" in - yes) want_elf_stt_common=true ;; - no) want_elf_stt_common=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for ELF STT_COMMON option) ;; - esac], -# We have to choose a default behaviour. For native builds we could -# test whether the loader supports the STT_COMMON type, but that would -# mean that built binaries could not be exported to older systems where -# the loader does not support it. So by default we always choose to -# disable this feature. - want_elf_stt_common=false)dnl -if test $want_elf_stt_common = true; then - AC_DEFINE(USE_STT_COMMON, 1, - [Define if we may generate symbols with ELF's STT_COMMON type]) -fi - -ACX_PKGVERSION([GNU Binutils]) -ACX_BUGURL([http://www.sourceware.org/bugzilla/]) - -AM_BINUTILS_WARNINGS - -AC_CONFIG_HEADERS(config.h:config.in) - -# PR 14072 -AH_VERBATIM([00_CONFIG_H_CHECK], -[/* Check that config.h is #included before system headers - (this works only for glibc, but that should be enough). */ -#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) -# error config.h must be #included before system headers -#endif -#define __CONFIG_H__ 1]) - -if test -z "$target" ; then - AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) -fi - -AM_MAINTAINER_MODE -AM_CONDITIONAL(GENINSRC_NEVER, false) -AM_INSTALL_LIBBFD -AC_EXEEXT - -host64=false -target64=false -bfd_default_target_size=32 - -# host stuff: - -ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi id ru uk" -ZW_GNU_GETTEXT_SISTER_DIR -AM_PO_SUBDIRS - -# Permit host specific settings. -. ${srcdir}/configure.host - -AC_SUBST(HDEFINES) -AC_PROG_INSTALL - -BFD_HOST_64BIT_LONG=0 -BFD_HOST_64BIT_LONG_LONG=0 -BFD_HOST_64_BIT_DEFINED=0 -BFD_HOST_64_BIT= -BFD_HOST_U_64_BIT= -BFD_HOSTPTR_T="unsigned long" - -AC_CHECK_SIZEOF(long long) -AC_CHECK_SIZEOF(void *) -AC_CHECK_SIZEOF(long) - -if test "x${ac_cv_sizeof_void_p}" = "x8"; then - host64=true -fi - -if test "x${ac_cv_sizeof_long}" = "x8"; then - BFD_HOST_64BIT_LONG=1 - test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" - test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" -elif test "x${ac_cv_sizeof_long_long}" = "x8"; then - BFD_HOST_64BIT_LONG_LONG=1 - test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long" - test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long" - if test "x${ac_cv_sizeof_void_p}" = "x8"; then - BFD_HOSTPTR_T="unsigned long long" - fi -fi - -if test -n "${HOST_64BIT_TYPE}" -a -n "${HOST_U_64BIT_TYPE}"; then - BFD_HOST_64_BIT_DEFINED=1 - BFD_HOST_64_BIT="${HOST_64BIT_TYPE}" - BFD_HOST_U_64_BIT="${HOST_U_64BIT_TYPE}" -fi - -AC_SUBST(BFD_HOST_64BIT_LONG) -AC_SUBST(BFD_HOST_64BIT_LONG_LONG) -AC_SUBST(BFD_HOST_64_BIT_DEFINED) -AC_SUBST(BFD_HOST_64_BIT) -AC_SUBST(BFD_HOST_U_64_BIT) -AC_SUBST(BFD_HOSTPTR_T) - -BFD_CC_FOR_BUILD - -AC_CHECK_HEADERS(alloca.h stddef.h string.h strings.h stdlib.h time.h unistd.h wchar.h) -AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h sys/resource.h) -GCC_HEADER_STDINT(bfd_stdint.h) -AC_HEADER_TIME -AC_HEADER_DIRENT - -AC_CHECK_HEADERS(windows.h dlfcn.h) - -ACX_HEADER_STRING -AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno) -AC_CHECK_FUNCS(strtoull getrlimit) - -AC_CHECK_DECLS(basename) -AC_CHECK_DECLS(ftello) -AC_CHECK_DECLS(ftello64) -AC_CHECK_DECLS(fseeko) -AC_CHECK_DECLS(fseeko64) - -BFD_BINARY_FOPEN - -AC_CHECK_DECLS(ffs) -AC_CHECK_DECLS(free) -AC_CHECK_DECLS(getenv) -AC_CHECK_DECLS(malloc) -AC_CHECK_DECLS(realloc) -AC_CHECK_DECLS(stpcpy) -AC_CHECK_DECLS(strstr) -AC_CHECK_DECLS(snprintf) -AC_CHECK_DECLS(vsnprintf) -AC_CHECK_DECLS(strnlen) - -# Link in zlib if we can. This allows us to read compressed debug sections. -# This is used only by compress.c. -AM_ZLIB - -# If we are configured native, pick a core file support file. -COREFILE= -COREFLAG= -CORE_HEADER= -TRAD_HEADER= -if test "${target}" = "${host}"; then - case "${host}" in - alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu | alpha*-*-*vms*) - COREFILE='' - ;; - alpha*-*-linux-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/alphalinux.h"' - ;; - alpha*-*-netbsd* | alpha*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - alpha*-*-*) - COREFILE=osf-core.lo - ;; - arm-*-freebsd* | arm-*-kfreebsd*-gnu) - COREFILE='' ;; - arm-*-netbsd* | arm-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - arm-*-riscix) COREFILE=trad-core.lo ;; - hppa*-*-hpux*) COREFILE=hpux-core.lo ;; - hppa*-*-hiux*) COREFILE=hpux-core.lo ;; - hppa*-*-mpeix*) COREFILE=hpux-core.lo ;; - hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo" - COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;; - hppa*-*-netbsd* | hppa*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - - i370-*-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i370linux.h"' - ;; - -changequote(,)dnl - i[3-7]86-sequent-bsd*) -changequote([,])dnl - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/symmetry.h"' - ;; -changequote(,)dnl - i[3-7]86-sequent-sysv4*) ;; - i[3-7]86-sequent-sysv*) -changequote([,])dnl - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/symmetry.h"' - ;; -changequote(,)dnl - i[3-7]86-*-bsdi) -changequote([,])dnl - COREFILE= - ;; -changequote(,)dnl - i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234] | i[3-7]86-*-freebsd4\.[01234]\.* | i[3-7]86-*-freebsd*aout*) -changequote([,])dnl - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i386bsd.h"' - ;; -changequote(,)dnl - i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*) -changequote([,])dnl - COREFILE='' - TRAD_HEADER='"hosts/i386bsd.h"' - ;; -changequote(,)dnl - i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd*) -changequote([,])dnl - COREFILE=netbsd-core.lo - ;; -changequote(,)dnl - i[3-7]86-esix-sysv3*) -changequote([,])dnl - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/esix.h"' - ;; -changequote(,)dnl - i[3-7]86-*-sco3.2v5*) -changequote([,])dnl - COREFILE=sco5-core.lo - ;; -changequote(,)dnl - i[3-7]86-*-sco* | i[3-7]86-*-isc*) -changequote([,])dnl - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i386sco.h"' - ;; -changequote(,)dnl - i[3-7]86-*-mach3*) -changequote([,])dnl - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i386mach3.h"' - ;; -changequote(,)dnl - i[3-7]86-*-linux-*) -changequote([,])dnl - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i386linux.h"' - case "$enable_targets"-"$want64" in - *x86_64-*linux*|*-true) - CORE_HEADER='"hosts/x86-64linux.h"' - esac - ;; -changequote(,)dnl - i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; - i[3-7]86-*-aix*) COREFILE=aix386-core.lo ;; -changequote([,])dnl - i860-*-mach3* | i860-*-osf1*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i860mach3.h"' - ;; - mips-*-netbsd* | mips*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - mips-dec-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/decstation.h"' - ;; - mips-sgi-irix4*) COREFILE=irix-core.lo ;; - mips-sgi-irix5*) COREFILE=irix-core.lo ;; - mips-sgi-irix6*) COREFILE=irix-core.lo ;; - mips-*-sysv4*) ;; - mips-*-sysv* | mips-*-riscos*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/riscos.h"' - ;; - mips-sony-bsd*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/news-mips.h"' - ;; - m68*-bull*-sysv*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/dpx2.h"' - ;; - m68*-hp-hpux*) COREFILE=hpux-core.lo ;; - m68*-hp-bsd*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/hp300bsd.h"' - ;; - m68*-*-linux-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/m68klinux.h"' - ;; - m68*-motorola-sysv*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/delta68.h"' - ;; - m68*-sony-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/news.h"' - ;; - m68*-*-netbsd* | m68*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - m68*-apple-aux*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/m68kaux.h"' - ;; - m88*-*-sysv4*) - ;; - m88*-motorola-sysv*) - COREFILE=ptrace-core.lo - ;; - m88*-*-mach3*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/m88kmach3.h"' - ;; - m88*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - ns32k-pc532-mach) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/pc532mach.h"' - ;; - ns32k-*-netbsd* | ns32k-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - rs6000-*-lynx*) - COREFILE=lynx-core.lo - ;; -changequote(,)dnl - rs6000-*-aix[5-9].* | powerpc-*-aix[5-9].*) -changequote([,])dnl - COREFILE=rs6000-core.lo - COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE" - ;; -changequote(,)dnl - rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*) -changequote([,])dnl - COREFILE=rs6000-core.lo - COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE" - # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE - # have c_impl as a member of struct core_dumpx - AC_MSG_CHECKING([for c_impl in struct core_dumpx]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct core_dumpx c; c.c_impl = 0;]])],[AC_DEFINE(HAVE_ST_C_IMPL, 1, - [Define if struct core_dumpx has member c_impl]) - AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) - ;; - rs6000-*-aix4*) COREFILE=rs6000-core.lo ;; - rs6000-*-*) COREFILE=rs6000-core.lo ;; - powerpc-*-aix4*) COREFILE=rs6000-core.lo ;; - powerpc-*-aix*) COREFILE=rs6000-core.lo ;; - powerpc-*-beos*) ;; - powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) - COREFILE='' ;; - powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; - powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; - s390*-*-*) COREFILE=trad-core.lo ;; - sh*-*-netbsd* | sh*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - sparc-*-netbsd* | sparc*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - tahoe-*-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/tahoe.h"' - ;; - vax-*-netbsd* | vax-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - vax-*-ultrix2*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/vaxult2.h"' - ;; - vax-*-ultrix*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/vaxult2.h"' - ;; - vax-*-linux-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/vaxlinux.h"' - ;; - vax-*-*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/vaxbsd.h"' - ;; - x86_64-*-linux*) - CORE_HEADER='"hosts/x86-64linux.h"' - ;; - x86_64-*-netbsd* | x86_64-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - esac - - case "$COREFILE" in - aix386-core.lo) COREFLAG=-DAIX386_CORE ;; - hppabsd-core.lo) COREFLAG=-DHPPABSD_CORE ;; - hpux-core.lo) COREFLAG=-DHPUX_CORE ;; - irix-core.lo) COREFLAG=-DIRIX_CORE ;; - lynx-core.lo) COREFLAG=-DLYNX_CORE ;; - netbsd-core.lo) COREFLAG=-DNETBSD_CORE ;; - osf-core.lo) COREFLAG=-DOSF_CORE ;; - ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;; - rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;; - sco5-core.lo) COREFLAG="$COREFLAG -DSCO5_CORE" ;; - trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;; - esac - - # ELF corefile support has several flavors, but all of - # them use something called - AC_CHECK_HEADERS(sys/procfs.h) - if test "$ac_cv_header_sys_procfs_h" = yes; then - BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t) - BFD_HAVE_SYS_PROCFS_TYPE(prstatus32_t) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus32_t, pr_who) - BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t) - BFD_HAVE_SYS_PROCFS_TYPE(pxstatus_t) - BFD_HAVE_SYS_PROCFS_TYPE(pstatus32_t) - BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo_t, pr_pid) - BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo32_t) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prpsinfo32_t, pr_pid) - BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo_t, pr_pid) - BFD_HAVE_SYS_PROCFS_TYPE(psinfo32_t) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(psinfo32_t, pr_pid) - BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t) - BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg) - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_fpreg) - BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t) - fi -fi -AC_SUBST(COREFILE) -AC_SUBST(COREFLAG) -if test -n "$CORE_HEADER"; then - AC_DEFINE_UNQUOTED(CORE_HEADER, $CORE_HEADER, - [Name of host specific core header file to include in elf.c.]) -fi -if test -n "$TRAD_HEADER"; then - AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER, - [Name of host specific header file to include in trad-core.c.]) -fi - -# Check if linker supports --as-needed and --no-as-needed options -AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed, - [bfd_cv_ld_as_needed=no - if $LD --help 2>/dev/null | grep as-needed > /dev/null; then - bfd_cv_ld_as_needed=yes - fi - ]) - -LT_LIB_M - -# When building a shared libbfd, link against the pic version of libiberty -# so that apps that use libbfd won't need libiberty just to satisfy any -# libbfd references. -# We can't do that if a pic libiberty is unavailable since including non-pic -# code would insert text relocations into libbfd. -SHARED_LIBADD= -SHARED_LDFLAGS= -if test "$enable_shared" = "yes"; then -changequote(,)dnl - x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` -changequote([,])dnl - if test -n "$x"; then - SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" - fi - -# More hacks to build DLLs on Windows. - case "${host}" in - *-*-cygwin*) - SHARED_LDFLAGS="-no-undefined" - SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" - ;; - - # Hack to build or1k-src on OSX - or1k*-*-darwin*) - SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl" - ;; - esac - - if test -n "$SHARED_LIBADD"; then - if test -n "$LIBM"; then - if test x"$bfd_cv_ld_as_needed" = xyes; then - # Link against libm only when needed. Put -lc, -lm inside -Wl - # to stop libtool reordering these options. - SHARED_LIBADD="$SHARED_LIBADD -Wl,-lc,--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed" - else - SHARED_LIBADD="$SHARED_LIBADD $LIBM" - fi - fi - fi -fi -AC_SUBST(SHARED_LDFLAGS) -AC_SUBST(SHARED_LIBADD) - -# target stuff: - -# Canonicalize the secondary target names. -if test -n "$enable_targets" ; then - for targ in `echo $enable_targets | sed 's/,/ /g'` - do - result=`$ac_config_sub $targ 2>/dev/null` - if test -n "$result" ; then - canon_targets="$canon_targets $result" - else - # Allow targets that config.sub doesn't recognize, like "all". - canon_targets="$canon_targets $targ" - fi - done -fi - -all_targets=false -defvec= -selvecs= -assocvecs= -selarchs= -TDEFINES= -for targ in $target $canon_targets -do - if test "x$targ" = "xall"; then - all_targets=true - assocvecs="$assocvecs $targ_defvec $targ_selvecs" - else - . $srcdir/config.bfd - if test "x$targ" = "x$target"; then - defvec=$targ_defvec - fi - selvecs="$selvecs $targ_defvec $targ_selvecs" - selarchs="$selarchs $targ_archs" - TDEFINES="$TDEFINES $targ_cflags" - fi -done -AC_SUBST(TDEFINES) - -# This processing still needs to be done if we're to decide properly whether -# 64-bit support needs to be compiled in. Currently, it will be included if -# the default or any other explicitly requested target requires it; it -# will not be included on a 32-bit host if no 64-bit target is requested, and -# no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is -# used. - -# uniq the default and selected vectors in all the configured targets. -f="" -for i in $selvecs ; do - case " $f " in - *" $i "*) ;; - *) f="$f $i" ;; - esac -done -selvecs="$f" - - -# uniq the associated vectors in all the configured targets. -f="" -for i in $assocvecs ; do - case " $f " in - *" $i "*) ;; - *) f="$f $i" ;; - esac -done -assocvecs="$f" - - -# uniq the architectures in all the configured targets. -f="" -for i in $selarchs ; do - case " $f " in - *" $i "*) ;; - *) f="$f $i" ;; - esac -done -selarchs="$f" - -# Target backend .o files. -tb= - -elf="elf.lo elflink.lo elf-attrs.lo elf-strtab.lo - elf-eh-frame.lo dwarf1.lo" - -for vec in $selvecs -do - target_size=32 - case "$vec" in - # This list is alphabetized to make it easy to compare - # with the two vector lists in targets.c. For the same reason, - # use one entry per line, even though this leads to long lines. - aarch64_elf32_be_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;; - aarch64_elf32_le_vec) tb="$tb elf32-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf32.lo $elf"; target_size=64 ;; - aarch64_elf64_be_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;; - aarch64_elf64_le_vec) tb="$tb elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;; - alpha_ecoff_le_vec) tb="$tb coff-alpha.lo ecoff.lo ecofflink.lo"; target_size=64 ;; - alpha_elf64_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; - alpha_elf64_fbsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; - alpha_nlm32_vec) tb="$tb nlm32-alpha.lo nlm32.lo nlm.lo"; target_size=64 ;; - alpha_vms_vec) tb="$tb vms-alpha.lo vms-misc.lo vms-lib.lo"; target_size=64 ;; - alpha_vms_lib_txt_vec) tb="$tb vms-lib.lo vms-misc.lo" ;; - am33_elf32_linux_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; - aout0_be_vec) tb="$tb aout0.lo aout32.lo" ;; - aout64_vec) tb="$tb demo64.lo aout64.lo"; target_size=64 ;; - aout_vec) tb="$tb host-aout.lo aout32.lo" ;; - aout_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;; - arc_elf32_be_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - arc_elf32_le_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; - arm_aout_be_vec) tb="$tb aout-arm.lo aout32.lo" ;; - arm_aout_le_vec) tb="$tb aout-arm.lo aout32.lo" ;; - arm_aout_nbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;; - arm_aout_riscix_vec) tb="$tb aout32.lo riscix.lo" ;; - arm_coff_be_vec) tb="$tb coff-arm.lo cofflink.lo " ;; - arm_coff_le_vec) tb="$tb coff-arm.lo cofflink.lo " ;; - arm_elf32_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_elf32_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_elf32_nacl_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_elf32_nacl_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_elf32_symbian_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_elf32_symbian_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_elf32_vxworks_be_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_elf32_vxworks_le_vec) tb="$tb elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo $elf" ;; - arm_pe_be_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_le_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_epoc_be_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_epoc_le_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_wince_be_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pe_wince_le_vec) tb="$tb pe-arm-wince.lo pe-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_be_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_le_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_epoc_be_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_epoc_le_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_wince_be_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; - arm_pei_wince_le_vec) tb="$tb pei-arm-wince.lo pei-arm.lo peigen.lo cofflink.lo " ;; - avr_elf32_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; - bfin_elf32_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;; - bfin_elf32_fdpic_vec) tb="$tb elf32-bfin.lo elf32.lo $elf" ;; - bout_be_vec) tb="$tb bout.lo aout32.lo" ;; - bout_le_vec) tb="$tb bout.lo aout32.lo" ;; - cr16_elf32_vec) tb="$tb elf32-cr16.lo elf32.lo $elf" ;; - cr16c_elf32_vec) tb="$tb elf32-cr16c.lo elf32.lo $elf" ;; - cris_aout_vec) tb="$tb aout-cris.lo" ;; - cris_elf32_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; - cris_elf32_us_vec) tb="$tb elf32-cris.lo elf32.lo $elf" ;; - crx_elf32_vec) tb="$tb elf32-crx.lo elf32.lo $elf" ;; - d10v_elf32_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; - d30v_elf32_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; - dlx_elf32_be_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;; - elf32_be_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; - elf32_le_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; - elf64_be_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; - elf64_le_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; - epiphany_elf32_vec) tb="$tb elf32-epiphany.lo elf32.lo $elf" ;; - fr30_elf32_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; - frv_elf32_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; - frv_elf32_fdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; - h8300_coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;; - h8300_elf32_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; - h8500_coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;; - hppa_elf32_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; - hppa_elf32_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; - hppa_elf32_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; - hppa_elf64_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; - hppa_elf64_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; - hppa_som_vec) tb="$tb som.lo" ;; - i370_elf32_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; - i386_aout_vec) tb="$tb i386aout.lo aout32.lo" ;; - i386_aout_bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; - i386_aout_dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;; - i386_aout_fbsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;; - i386_aout_linux_vec) tb="$tb i386linux.lo aout32.lo" ;; - i386_aout_lynx_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;; - i386_aout_mach3_vec) tb="$tb i386mach3.lo aout32.lo" ;; - i386_aout_nbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; - i386_aout_os9k_vec) tb="$tb i386os9k.lo aout32.lo" ;; - i386_coff_vec) tb="$tb coff-i386.lo cofflink.lo" ;; - i386_coff_go32_vec) tb="$tb coff-go32.lo cofflink.lo" ;; - i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;; - i386_coff_lynx_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;; - i386_elf32_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - i386_elf32_fbsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - i386_elf32_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - i386_elf32_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - i386_elf32_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - i386_mach_o_vec) tb="$tb mach-o-i386.lo" ;; - i386_msdos_vec) tb="$tb i386msdos.lo" ;; - i386_nlm32_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; - i386_pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;; - i386_pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;; - i860_coff_vec) tb="$tb coff-i860.lo cofflink.lo" ;; - i860_elf32_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; - i860_elf32_le_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; - i960_elf32_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; - ia64_elf32_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;; - ia64_elf32_hpux_be_vec) tb="$tb elf32-ia64.lo elfxx-ia64.lo elf32.lo $elf" ;; - ia64_elf64_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; - ia64_elf64_le_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; - ia64_elf64_hpux_be_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; - ia64_elf64_vms_vec) tb="$tb elf64-ia64-vms.lo elf64-ia64.lo elfxx-ia64.lo elf64.lo vms-lib.lo vms-misc.lo $elf"; target_size=64 ;; - ia64_pei_vec) tb="$tb pei-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; - icoff_be_vec) tb="$tb coff-i960.lo cofflink.lo" ;; - icoff_le_vec) tb="$tb coff-i960.lo cofflink.lo" ;; - ieee_vec) tb="$tb ieee.lo" ;; - ip2k_elf32_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; - iq2000_elf32_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;; - k1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - k1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - l1om_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - l1om_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - lm32_elf32_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;; - lm32_elf32_fdpic_vec) tb="$tb elf32-lm32.lo elf32.lo $elf" ;; - m32c_elf32_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;; - m32r_elf32_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; - m32r_elf32_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; - m32r_elf32_linux_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; - m32r_elf32_linux_le_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; - m68hc11_elf32_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;; - m68hc12_elf32_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;; - m68k_aout_4knbsd_vec) tb="$tb m68k4knetbsd.lo aout32.lo" ;; - m68k_aout_hp300bsd_vec) tb="$tb hp300bsd.lo aout32.lo" ;; - m68k_aout_hp300hpux_vec) tb="$tb hp300hpux.lo aout32.lo" ;; - m68k_aout_linux_vec) tb="$tb m68klinux.lo aout32.lo" ;; - m68k_aout_nbsd_vec) tb="$tb m68knetbsd.lo aout32.lo" ;; - m68k_aout_newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;; - m68k_coff_vec) tb="$tb coff-m68k.lo cofflink.lo" ;; - m68k_coff_apollo_vec) tb="$tb coff-apollo.lo" ;; - m68k_coff_aux_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;; - m68k_coff_sysv_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; - m68k_coff_un_vec) tb="$tb coff-u68k.lo coff-m68k.lo cofflink.lo" ;; - m68k_elf32_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; - m68k_versados_vec) tb="$tb versados.lo" ;; - m88k_aout_mach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; - m88k_aout_obsd_vec) tb="$tb m88kopenbsd.lo aout32.lo" ;; - m88k_coff_bcs_vec) tb="$tb coff-m88k.lo" ;; - m88k_elf32_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; - mach_o_be_vec) tb="$tb mach-o.lo" ;; - mach_o_le_vec) tb="$tb mach-o.lo" ;; - mach_o_fat_vec) tb="$tb mach-o.lo" ;; - mcore_elf32_be_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; - mcore_elf32_le_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; - mcore_pe_be_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; - mcore_pe_le_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; - mcore_pei_be_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; - mcore_pei_le_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; - mep_elf32_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; - mep_elf32_le_vec) tb="$tb elf32-mep.lo elf32.lo $elf" ;; - metag_elf32_vec) tb="$tb elf32-metag.lo elf32.lo $elf" ;; - microblaze_elf32_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;; - microblaze_elf32_le_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;; - mips_ecoff_be_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; - mips_ecoff_le_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; - mips_ecoff_bele_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;; - mips_elf32_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_n_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_n_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntrad_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntrad_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntradfbsd_be_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_ntradfbsd_le_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf32_trad_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_trad_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_tradfbsd_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_tradfbsd_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_vxworks_be_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf32_vxworks_le_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo" ;; - mips_elf64_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_trad_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_trad_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_tradfbsd_be_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_elf64_tradfbsd_le_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - mips_pe_le_vec) tb="$tb pe-mips.lo peigen.lo cofflink.lo" ;; - mips_pei_le_vec) tb="$tb pei-mips.lo peigen.lo cofflink.lo" ;; - mmix_elf64_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; - mmix_mmo_vec) tb="$tb mmo.lo" target_size=64 ;; - mn10200_elf32_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; - mn10300_elf32_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; - moxie_elf32_be_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;; - moxie_elf32_le_vec) tb="$tb elf32-moxie.lo elf32.lo $elf" ;; - msp430_elf32_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; - msp430_elf32_ti_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; - mt_elf32_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;; - nds32_elf32_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; - nds32_elf32_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; - nds32_elf32_linux_be_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; - nds32_elf32_linux_le_vec) tb="$tb elf32-nds32.lo elf32.lo $elf" ;; - nios2_elf32_be_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; - nios2_elf32_le_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;; - ns32k_aout_pc532mach_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; - ns32k_aout_pc532nbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; - or1k_elf32_vec) tb="$tb elf32-or1k.lo elf32.lo $elf" ;; - pdp11_aout_vec) tb="$tb pdp11.lo" ;; - pef_vec) tb="$tb pef.lo" ;; - pef_xlib_vec) tb="$tb pef.lo" ;; - pj_elf32_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;; - pj_elf32_le_vec) tb="$tb elf32-pj.lo elf32.lo $elf" ;; - plugin_vec) tb="$tb plugin.lo" ;; - powerpc_boot_vec) tb="$tb ppcboot.lo" ;; - powerpc_elf32_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; - powerpc_elf32_le_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; - powerpc_elf32_fbsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; - powerpc_elf32_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; - powerpc_elf64_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; - powerpc_elf64_le_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; - powerpc_elf64_fbsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; - powerpc_nlm32_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; - powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_pe_le_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_pei_le_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;; - powerpc_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; - rl78_elf32_vec) tb="$tb elf32-rl78.lo elf32.lo $elf" ;; - rs6000_xcoff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; - rs6000_xcoff64_aix_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;; - rs6000_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; - rx_elf32_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; - rx_elf32_be_ns_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; - rx_elf32_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; - s390_elf32_vec) tb="$tb elf32-s390.lo elf32.lo $elf" ;; - s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; - score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;; - score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo $elf"; want64=true; target_size=64 ;; - # FIXME: We include cofflink.lo not because it's needed for - # sh64_elf32[_le]_vec, but because we include sh_elf32[_le]_vec - # which needs it but does not list it. Should be fixed in right place. - sh64_elf32_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_linux_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_linux_be_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - sh64_elf32_nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; - sh64_elf32_nbsd_le_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf cofflink.lo" ;; - sh64_elf64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - sh64_elf64_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - sh64_elf64_linux_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - sh64_elf64_linux_be_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - sh64_elf64_nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - sh64_elf64_nbsd_le_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - sh_coff_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_coff_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_coff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_coff_small_le_vec) tb="$tb coff-sh.lo cofflink.lo" ;; - sh_elf32_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_fdpic_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_fdpic_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_linux_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_linux_be_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_nbsd_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_nbsd_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - sh_elf32_symbian_le_vec) tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_vxworks_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_elf32_vxworks_le_vec) tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;; - sh_pe_le_vec) tb="$tb pe-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; - sh_pei_le_vec) tb="$tb pei-sh.lo coff-sh.lo peigen.lo cofflink.lo" ;; - sparc_aout_le_vec) tb="$tb aout-sparcle.lo aout32.lo" ;; - sparc_aout_linux_vec) tb="$tb sparclinux.lo aout32.lo" ;; - sparc_aout_lynx_vec) tb="$tb sparclynx.lo lynx-core.lo aout32.lo" ;; - sparc_aout_nbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; - sparc_aout_sunos_be_vec) tb="$tb sunos.lo aout32.lo" ;; - sparc_coff_vec) tb="$tb coff-sparc.lo" ;; - sparc_coff_lynx_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;; - sparc_elf32_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; - sparc_elf32_sol2_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; - sparc_elf32_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;; - sparc_elf64_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; - sparc_elf64_fbsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; - sparc_elf64_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;; - sparc_nlm32_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; - spu_elf32_vec) tb="$tb elf32-spu.lo elf32.lo $elf" ;; - sym_vec) tb="$tb xsym.lo" ;; - tic30_aout_vec) tb="$tb aout-tic30.lo" ;; - tic30_coff_vec) tb="$tb coff-tic30.lo" ;; - tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;; - tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;; - tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff1_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff2_vec) tb="$tb coff-tic54x.lo" ;; - tic54x_coff2_beh_vec) tb="$tb coff-tic54x.lo" ;; - tic6x_elf32_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; - tic6x_elf32_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; - tic6x_elf32_c6000_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; - tic6x_elf32_c6000_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; - tic6x_elf32_linux_be_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; - tic6x_elf32_linux_le_vec) tb="$tb elf32-tic6x.lo elf32.lo $elf" ;; - tic80_coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;; - tilegx_elf32_be_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;; - tilegx_elf32_le_vec) tb="$tb elf32-tilegx.lo elfxx-tilegx.lo elf32.lo $elf" ; target_size=32 ;; - tilegx_elf64_be_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;; - tilegx_elf64_le_vec) tb="$tb elf64-tilegx.lo elfxx-tilegx.lo elf64.lo $elf" ; target_size=64 ;; - tilepro_elf32_vec) tb="$tb elf32-tilepro.lo elf32.lo $elf" ;; - v800_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; - v850_elf32_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; - vax_aout_1knbsd_vec) tb="$tb vax1knetbsd.lo aout32.lo" ;; - vax_aout_bsd_vec) tb="$tb vaxbsd.lo aout32.lo" ;; - vax_aout_nbsd_vec) tb="$tb vaxnetbsd.lo aout32.lo" ;; - vax_elf32_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; - w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo" ;; - we32k_coff_vec) tb="$tb coff-we32k.lo" ;; - x86_64_coff_vec) tb="$tb coff-x86_64.lo cofflink.lo"; target_size=64 ;; - x86_64_elf32_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; - x86_64_elf32_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; - x86_64_elf64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - x86_64_elf64_fbsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - x86_64_elf64_nacl_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - x86_64_elf64_sol2_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo $elf"; target_size=64 ;; - x86_64_mach_o_vec) tb="$tb mach-o-x86-64.lo" ;; - x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; - x86_64_pe_be_vec) tb="$tb pe-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; - x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo cofflink.lo"; target_size=64 ;; - xc16x_elf32_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;; - xgate_elf32_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;; - xstormy16_elf32_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; - xtensa_elf32_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; - xtensa_elf32_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; - z80_coff_vec) tb="$tb coff-z80.lo reloc16.lo" ;; - z8k_coff_vec) tb="$tb coff-z8k.lo reloc16.lo cofflink.lo" ;; - - # These appear out of order in targets.c - srec_vec) tb="$tb srec.lo" ;; - symbolsrec_vec) tb="$tb srec.lo" ;; - tekhex_vec) tb="$tb tekhex.lo" ;; - core_cisco_be_vec) tb="$tb cisco-core.lo" ;; - core_cisco_le_vec) tb="$tb cisco-core.lo" ;; - - "") ;; - *) AC_MSG_ERROR(*** unknown target vector $vec) ;; - esac - - if test ${target_size} = 64; then - target64=true - fi - if test x"${vec}" = x"${defvec}"; then - bfd_default_target_size=${target_size} - fi -done - -# Target architecture .o files. -# A couple of CPUs use shorter file names to avoid problems on DOS -# filesystems. -ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.lo/g -e s/mn10200/m10200/ -e s/mn10300/m10300/` - -# Weed out duplicate .o files. -f="" -for i in $tb ; do - case " $f " in - *" $i "*) ;; - *) f="$f $i" ;; - esac -done -tb="$f" - -f="" -for i in $ta ; do - case " $f " in - *" $i "*) ;; - *) f="$f $i" ;; - esac -done -ta="$f" - -bfd_backends="$tb" -bfd_machines="$ta" - -if test x${all_targets} = xtrue ; then - bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)' - bfd_machines="${bfd_machines}"' $(ALL_MACHINES)' - selvecs= - havevecs=-DHAVE_all_vecs - selarchs= - test -n "$assocvecs" && - assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` -else # all_targets is true - # Only set these if they will be nonempty, for the clever echo. - havevecs= - assocvecs= - test -n "$selvecs" && - havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'` - test -n "$selvecs" && - selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` - test -n "$selarchs" && - selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` -fi # all_targets is true - -case ${host64}-${target64}-${want64} in - *true*) - wordsize=64 - bfd64_libs='$(BFD64_LIBS)' - all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' - if test $BFD_HOST_64_BIT_DEFINED = 0; then - AC_MSG_WARN([You have requested a 64 bit BFD configuration, but]) - AC_MSG_WARN([your compiler may not have a 64 bit integral type]) - fi - if test -n "$GCC" ; then - bad_64bit_gcc=no; - AC_MSG_CHECKING([for gcc version with buggy 64-bit support]) - # Add more tests for gcc versions with non-working 64-bit support here. - AC_EGREP_CPP([: 2 : 91 : 1 :],[:__GNUC__:__GNUC_MINOR__:__i386__:], - bad_64bit_gcc=yes; - AC_MSG_RESULT([yes: egcs-1.1.2 on ix86 spotted]), - AC_MSG_RESULT(no)) - if test $bad_64bit_gcc = yes ; then - AC_MSG_ERROR([A newer version of gcc is needed for the requested 64-bit BFD configuration]) - fi - fi - ;; - false-false-false) - wordsize=32 - all_backends='$(BFD32_BACKENDS)' - ;; -esac - -AC_SUBST(wordsize) -AC_SUBST(bfd64_libs) -AC_SUBST(all_backends) -AC_SUBST(bfd_backends) -AC_SUBST(bfd_machines) -AC_SUBST(bfd_default_target_size) - -if test "$plugins" = "yes"; then - supports_plugins=1 -else - supports_plugins=0 -fi -AC_SUBST(supports_plugins) -AC_SUBST(lt_cv_dlopen_libs) - -# Determine the host dependant file_ptr a.k.a. off_t type. In order -# prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and -# fseeko, long. This assumes that sizeof off_t is .ge. sizeof long. -# Hopefully a reasonable assumption since fseeko et.al. should be -# upward compatible. -AC_CHECK_FUNCS(ftello ftello64 fseeko fseeko64 fopen64) -if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then - AC_CHECK_SIZEOF(off_t) -fi -AC_MSG_CHECKING([file_ptr type]) -bfd_file_ptr="long" -bfd_ufile_ptr="unsigned long" -if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ - -o x"${ac_cv_sizeof_off_t}" = x8; then - bfd_file_ptr=BFD_HOST_64_BIT - bfd_ufile_ptr=BFD_HOST_U_64_BIT -fi -AC_MSG_RESULT($bfd_file_ptr) -AC_SUBST(bfd_file_ptr) -AC_SUBST(bfd_ufile_ptr) - - -tdefaults="" -test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" -test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" -test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'" -test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" -AC_SUBST(tdefaults) -AC_SUBST(havevecs) - -dnl AC_CHECK_HEADERS(sys/mman.h) -AC_FUNC_MMAP -AC_CHECK_FUNCS(madvise mprotect) -case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in - true+yes ) AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;; -esac - -rm -f doc/config.status -AC_CONFIG_FILES([Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in]) - -dnl We need this duplication, even though we use AM_PO_SUBDIRS, because of -dnl our two separate POTFILES. Yuck. -AC_CONFIG_COMMANDS([default], -[[ -case "$srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; -esac -POFILES= -GMOFILES= -for lang in dummy $OBSOLETE_ALL_LINGUAS; do - if test $lang != dummy; then - POFILES="$POFILES $srcdirpre$lang.po" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - fi -done -sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' \ - -e '/BLD-POTFILES =/r po/BLD-POTFILES' \ - -e "s,@POFILES@,$POFILES," \ - -e "s,@GMOFILES@,$GMOFILES," \ - po/Makefile.in > po/Makefile]],[[]]) - -dnl Required by html, pdf, install-pdf and install-html -AC_SUBST(datarootdir) -AC_SUBST(docdir) -AC_SUBST(htmldir) -AC_SUBST(pdfdir) - -AC_OUTPUT diff --git a/bfd/corefile.c b/bfd/corefile.c index 1b87e86bc..53f6b46f7 100644 --- a/bfd/corefile.c +++ b/bfd/corefile.c @@ -1,5 +1,5 @@ /* Core file generic interface routines for BFD. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-aarch64.c b/bfd/cpu-aarch64.c index 616eb275e..7d767f080 100644 --- a/bfd/cpu-aarch64.c +++ b/bfd/cpu-aarch64.c @@ -1,5 +1,5 @@ /* BFD support for AArch64. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Contributed by ARM Ltd. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-alpha.c b/bfd/cpu-alpha.c index da1666137..193a7288e 100644 --- a/bfd/cpu-alpha.c +++ b/bfd/cpu-alpha.c @@ -1,5 +1,5 @@ /* BFD support for the Alpha architecture. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-arc.c b/bfd/cpu-arc.c index 0636105b9..a99e5391e 100644 --- a/bfd/cpu-arc.c +++ b/bfd/cpu-arc.c @@ -1,5 +1,5 @@ /* BFD support for the ARC processor - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index 149c2e5b8..7d68500fd 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -1,5 +1,5 @@ /* BFD support for the ARM processor - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-avr.c b/bfd/cpu-avr.c index 060c9a26d..ed172f00f 100644 --- a/bfd/cpu-avr.c +++ b/bfd/cpu-avr.c @@ -1,5 +1,5 @@ /* BFD library support routines for the AVR architecture. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by Denis Chertykov This file is part of BFD, the Binary File Descriptor library. @@ -67,7 +67,6 @@ compatible (const bfd_arch_info_type * a, return a; if (a->mach == bfd_mach_avr31 && b->mach == bfd_mach_avr3) return b; - if (a->mach == bfd_mach_avr3 && b->mach == bfd_mach_avr35) return a; if (a->mach == bfd_mach_avr35 && b->mach == bfd_mach_avr3) @@ -78,7 +77,6 @@ compatible (const bfd_arch_info_type * a, if (a->mach == bfd_mach_avr51 && b->mach == bfd_mach_avr5) return b; - return NULL; } @@ -135,25 +133,28 @@ static const bfd_arch_info_type arch_info_struct[] = /* 3-Byte PC. */ N (22, bfd_mach_avr6, "avr:6", FALSE, & arch_info_struct[10]), - /* Xmega 1 */ - N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[11]), - - /* Xmega 2 */ - N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[12]), - - /* Xmega 3 */ - N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[13]), - - /* Xmega 4 */ - N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[14]), - - /* Xmega 5 */ - N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[15]), - - /* Xmega 6 */ - N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[16]), - - /* Xmega 7 */ + /* Tiny core (AVR Tiny). */ + N (16, bfd_mach_avrtiny, "avr:100", FALSE, & arch_info_struct[11]), + + /* Xmega 1. */ + N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[12]), + + /* Xmega 2. */ + N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[13]), + + /* Xmega 3. */ + N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[14]), + + /* Xmega 4. */ + N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[15]), + + /* Xmega 5. */ + N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[16]), + + /* Xmega 6. */ + N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[17]), + + /* Xmega 7. */ N (24, bfd_mach_avrxmega7, "avr:107", FALSE, NULL) }; diff --git a/bfd/cpu-bfin.c b/bfd/cpu-bfin.c index 433904d66..1b7d29d2c 100644 --- a/bfd/cpu-bfin.c +++ b/bfd/cpu-bfin.c @@ -1,6 +1,6 @@ /* BFD Support for the ADI Blackfin processor. - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-cr16.c b/bfd/cpu-cr16.c index 2b1af76ba..4eb9105cf 100644 --- a/bfd/cpu-cr16.c +++ b/bfd/cpu-cr16.c @@ -1,5 +1,5 @@ /* BFD support for the CR16 processor. - Copyright (C) 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2015 Free Software Foundation, Inc. Written by M R Swami Reddy This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-cr16c.c b/bfd/cpu-cr16c.c index 00d9b9c1f..5fd1969ad 100644 --- a/bfd/cpu-cr16c.c +++ b/bfd/cpu-cr16c.c @@ -1,5 +1,5 @@ /* BFD support for the CR16C processor. - Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-cris.c b/bfd/cpu-cris.c index 0a35d9bab..74668a7be 100644 --- a/bfd/cpu-cris.c +++ b/bfd/cpu-cris.c @@ -1,5 +1,5 @@ /* BFD support for the Axis CRIS architecture. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hans-Peter Nilsson. diff --git a/bfd/cpu-crx.c b/bfd/cpu-crx.c index f393cb731..6b2875418 100644 --- a/bfd/cpu-crx.c +++ b/bfd/cpu-crx.c @@ -1,5 +1,5 @@ /* BFD support for the CRX processor. - Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-d10v.c b/bfd/cpu-d10v.c index 367b99961..281fe9106 100644 --- a/bfd/cpu-d10v.c +++ b/bfd/cpu-d10v.c @@ -1,5 +1,5 @@ /* BFD support for the D10V processor - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-d30v.c b/bfd/cpu-d30v.c index 11eae81e6..1c41d052b 100644 --- a/bfd/cpu-d30v.c +++ b/bfd/cpu-d30v.c @@ -1,5 +1,5 @@ /* BFD support for the Mitsubishi D30V processor - Copyright (C) 1997-2014 Free Software Foundation, Inc. + Copyright (C) 1997-2015 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-dlx.c b/bfd/cpu-dlx.c index 00e133622..d877cebb1 100644 --- a/bfd/cpu-dlx.c +++ b/bfd/cpu-dlx.c @@ -1,5 +1,5 @@ /* BFD support for the DLX Microprocessor architecture. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. Hacked by Kuang Hwa Lin This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-epiphany.c b/bfd/cpu-epiphany.c index 26ffc03d5..020788d36 100644 --- a/bfd/cpu-epiphany.c +++ b/bfd/cpu-epiphany.c @@ -1,5 +1,5 @@ /* BFD support for the Adapteva EPIPHANY processor. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Contributed by Embecosm on behalf of Adapteva, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-fr30.c b/bfd/cpu-fr30.c index 9af19a5f5..a239a2165 100644 --- a/bfd/cpu-fr30.c +++ b/bfd/cpu-fr30.c @@ -1,5 +1,5 @@ /* BFD support for the FR30 processor. - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-frv.c b/bfd/cpu-frv.c index fe611d768..44d7ccb7a 100644 --- a/bfd/cpu-frv.c +++ b/bfd/cpu-frv.c @@ -1,5 +1,5 @@ /* BFD support for the FRV processor. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c index cd6e8ed07..8a86e7678 100644 --- a/bfd/cpu-h8300.c +++ b/bfd/cpu-h8300.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Renesas H8/300 architecture. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-h8500.c b/bfd/cpu-h8500.c index d01984abf..278bcdbcd 100644 --- a/bfd/cpu-h8500.c +++ b/bfd/cpu-h8500.c @@ -1,5 +1,5 @@ /* BFD library support routines for the H8/500 architecture. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-hppa.c b/bfd/cpu-hppa.c index 8089a9577..8ec1f5bb6 100644 --- a/bfd/cpu-hppa.c +++ b/bfd/cpu-hppa.c @@ -1,5 +1,5 @@ /* BFD support for the HP Precision Architecture architecture. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-i370.c b/bfd/cpu-i370.c index bb5bc2fd0..7e6b702d3 100644 --- a/bfd/cpu-i370.c +++ b/bfd/cpu-i370.c @@ -1,5 +1,5 @@ /* BFD i370 CPU definition - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas in 1998, 1999 diff --git a/bfd/cpu-i386.c b/bfd/cpu-i386.c index 5e488529a..b727ac819 100644 --- a/bfd/cpu-i386.c +++ b/bfd/cpu-i386.c @@ -1,5 +1,5 @@ /* BFD support for the Intel 386 architecture. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-i860.c b/bfd/cpu-i860.c index 71452bacc..c79df52be 100644 --- a/bfd/cpu-i860.c +++ b/bfd/cpu-i860.c @@ -1,5 +1,5 @@ /* BFD support for the Intel 860 architecture. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in cpu-i386.c Harry Dolan , October 1995 diff --git a/bfd/cpu-i960.c b/bfd/cpu-i960.c index bdcae8c5b..761435c3b 100644 --- a/bfd/cpu-i960.c +++ b/bfd/cpu-i960.c @@ -1,5 +1,5 @@ /* BFD library support routines for the i960 architecture. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-ia64-opc.c b/bfd/cpu-ia64-opc.c index dd023fd85..85908294a 100644 --- a/bfd/cpu-ia64-opc.c +++ b/bfd/cpu-ia64-opc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2014 Free Software Foundation, Inc. +/* Copyright (C) 1998-2015 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-ia64.c b/bfd/cpu-ia64.c index 6017e4547..6ef6156bb 100644 --- a/bfd/cpu-ia64.c +++ b/bfd/cpu-ia64.c @@ -1,5 +1,5 @@ /* BFD support for the ia64 architecture. - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-ip2k.c b/bfd/cpu-ip2k.c index a9c12cb1f..0b654bfbc 100644 --- a/bfd/cpu-ip2k.c +++ b/bfd/cpu-ip2k.c @@ -1,5 +1,5 @@ /* BFD support for the Scenix IP2xxx processor. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-iq2000.c b/bfd/cpu-iq2000.c index 82524f4a5..ffafaad67 100644 --- a/bfd/cpu-iq2000.c +++ b/bfd/cpu-iq2000.c @@ -1,5 +1,5 @@ /* BFD support for the Vitesse IQ2000 processor. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-k1om.c b/bfd/cpu-k1om.c index c946d145d..56489b715 100644 --- a/bfd/cpu-k1om.c +++ b/bfd/cpu-k1om.c @@ -1,5 +1,5 @@ /* BFD support for the Intel K1OM architecture. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-l1om.c b/bfd/cpu-l1om.c index 3648959c4..a5fff914c 100644 --- a/bfd/cpu-l1om.c +++ b/bfd/cpu-l1om.c @@ -1,5 +1,5 @@ /* BFD support for the Intel L1OM architecture. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-lm32.c b/bfd/cpu-lm32.c index e93599731..4c8b56a82 100644 --- a/bfd/cpu-lm32.c +++ b/bfd/cpu-lm32.c @@ -1,5 +1,5 @@ /* BFD support for the Lattice Mico32 architecture. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Contributed by Jon Beniston This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m10200.c b/bfd/cpu-m10200.c index 003ff9cfc..8f35ef5d7 100644 --- a/bfd/cpu-m10200.c +++ b/bfd/cpu-m10200.c @@ -1,5 +1,5 @@ /* BFD support for the Matsushita 10200 processor - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m10300.c b/bfd/cpu-m10300.c index c7f68da77..764b7d519 100644 --- a/bfd/cpu-m10300.c +++ b/bfd/cpu-m10300.c @@ -1,5 +1,5 @@ /* BFD support for the Matsushita 10300 processor - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m32c.c b/bfd/cpu-m32c.c index bb915dfe7..3b8c01ae1 100644 --- a/bfd/cpu-m32c.c +++ b/bfd/cpu-m32c.c @@ -1,5 +1,5 @@ /* BFD support for the M16C/M32C processors. - Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m32r.c b/bfd/cpu-m32r.c index 24a103400..54fa4f9c3 100644 --- a/bfd/cpu-m32r.c +++ b/bfd/cpu-m32r.c @@ -1,5 +1,5 @@ /* BFD support for the M32R processor. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m68hc11.c b/bfd/cpu-m68hc11.c index 68af7f2c6..1798a15f9 100644 --- a/bfd/cpu-m68hc11.c +++ b/bfd/cpu-m68hc11.c @@ -1,5 +1,5 @@ /* BFD support for the Motorola 68HC11 processor - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m68hc12.c b/bfd/cpu-m68hc12.c index 4b6fe20b0..f15ddbcbf 100644 --- a/bfd/cpu-m68hc12.c +++ b/bfd/cpu-m68hc12.c @@ -1,5 +1,5 @@ /* BFD support for the Motorola 68HC12 processor - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c index 2810994af..2356e135f 100644 --- a/bfd/cpu-m68k.c +++ b/bfd/cpu-m68k.c @@ -1,5 +1,5 @@ /* BFD library support routines for architectures. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m88k.c b/bfd/cpu-m88k.c index da4f03cdf..15e1ec709 100644 --- a/bfd/cpu-m88k.c +++ b/bfd/cpu-m88k.c @@ -1,5 +1,5 @@ /* bfd back-end for m88k support - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m9s12x.c b/bfd/cpu-m9s12x.c index 83bbfa3bb..4a5b45e43 100644 --- a/bfd/cpu-m9s12x.c +++ b/bfd/cpu-m9s12x.c @@ -1,5 +1,5 @@ /* BFD support for the Freescale 9S12X processor - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-m9s12xg.c b/bfd/cpu-m9s12xg.c index a5475682b..e2487bbab 100644 --- a/bfd/cpu-m9s12xg.c +++ b/bfd/cpu-m9s12xg.c @@ -1,5 +1,5 @@ /* BFD support for the Freescale 9S12-XGATE co-processor - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-mcore.c b/bfd/cpu-mcore.c index 06a6e3090..ebf7005f7 100644 --- a/bfd/cpu-mcore.c +++ b/bfd/cpu-mcore.c @@ -1,5 +1,5 @@ /* BFD library support routines for Motorola's MCore architecture - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-mep.c b/bfd/cpu-mep.c index 5c7479251..71764e305 100644 --- a/bfd/cpu-mep.c +++ b/bfd/cpu-mep.c @@ -1,5 +1,5 @@ /* BFD support for the Toshiba Media Engine Processor. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-metag.c b/bfd/cpu-metag.c index a1aa92db3..c852b772a 100644 --- a/bfd/cpu-metag.c +++ b/bfd/cpu-metag.c @@ -1,5 +1,5 @@ /* BFD support for the Imagination Technologies Meta processor. - Copyright (C) 2013-2014 Free Software Foundation, Inc. + Copyright (C) 2013-2015 Free Software Foundation, Inc. Contributed by Imagination Technologies Ltd. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-microblaze.c b/bfd/cpu-microblaze.c index 023aa6cb2..4399660c7 100644 --- a/bfd/cpu-microblaze.c +++ b/bfd/cpu-microblaze.c @@ -1,6 +1,6 @@ /* BFD Xilinx MicroBlaze architecture definition - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c index 360049ce9..8a9475d97 100644 --- a/bfd/cpu-mips.c +++ b/bfd/cpu-mips.c @@ -1,5 +1,5 @@ /* bfd back-end for mips support - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -89,10 +89,12 @@ enum I_mipsisa32r2, I_mipsisa32r3, I_mipsisa32r5, + I_mipsisa32r6, I_mipsisa64, I_mipsisa64r2, I_mipsisa64r3, I_mipsisa64r5, + I_mipsisa64r6, I_sb1, I_loongson_2e, I_loongson_2f, @@ -100,6 +102,7 @@ enum I_mipsocteon, I_mipsocteonp, I_mipsocteon2, + I_mipsocteon3, I_xlr, I_micromips }; @@ -137,10 +140,12 @@ static const bfd_arch_info_type arch_info_struct[] = N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)), N (32, 32, bfd_mach_mipsisa32r3,"mips:isa32r3", FALSE, NN(I_mipsisa32r3)), N (32, 32, bfd_mach_mipsisa32r5,"mips:isa32r5", FALSE, NN(I_mipsisa32r5)), + N (32, 32, bfd_mach_mipsisa32r6,"mips:isa32r6", FALSE, NN(I_mipsisa32r6)), N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)), N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)), N (64, 64, bfd_mach_mipsisa64r3,"mips:isa64r3", FALSE, NN(I_mipsisa64r3)), N (64, 64, bfd_mach_mipsisa64r5,"mips:isa64r5", FALSE, NN(I_mipsisa64r5)), + N (64, 64, bfd_mach_mipsisa64r6,"mips:isa64r6", FALSE, NN(I_mipsisa64r6)), N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)), N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)), N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)), @@ -148,6 +153,7 @@ static const bfd_arch_info_type arch_info_struct[] = N (64, 64, bfd_mach_mips_octeon,"mips:octeon", FALSE, NN(I_mipsocteon)), N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+", FALSE, NN(I_mipsocteonp)), N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2", FALSE, NN(I_mipsocteon2)), + N (64, 64, bfd_mach_mips_octeon3, "mips:octeon3", FALSE, NN(I_mipsocteon3)), N (64, 64, bfd_mach_mips_xlr, "mips:xlr", FALSE, NN(I_xlr)), N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0) }; diff --git a/bfd/cpu-mmix.c b/bfd/cpu-mmix.c index 0d8584c53..443a73980 100644 --- a/bfd/cpu-mmix.c +++ b/bfd/cpu-mmix.c @@ -1,5 +1,5 @@ /* BFD library support routines for MMIX. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson (hp@bitrange.com) This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-moxie.c b/bfd/cpu-moxie.c index 949dd2b0d..bc1dd99f2 100644 --- a/bfd/cpu-moxie.c +++ b/bfd/cpu-moxie.c @@ -1,5 +1,5 @@ /* BFD support for the moxie processor. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Written by Anthony Green This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-msp430.c b/bfd/cpu-msp430.c index 275a0abab..243319cfe 100644 --- a/bfd/cpu-msp430.c +++ b/bfd/cpu-msp430.c @@ -1,5 +1,5 @@ /* BFD library support routines for the MSP architecture. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-mt.c b/bfd/cpu-mt.c index ea5fc5a82..50e401535 100644 --- a/bfd/cpu-mt.c +++ b/bfd/cpu-mt.c @@ -1,5 +1,5 @@ /* BFD support for the Morpho Technologies MT processor. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-nds32.c b/bfd/cpu-nds32.c index d40d56a82..6c35ee46b 100644 --- a/bfd/cpu-nds32.c +++ b/bfd/cpu-nds32.c @@ -1,5 +1,5 @@ /* BFD support for the NDS32 processor - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. Contributed by Andes Technology Corporation. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-nios2.c b/bfd/cpu-nios2.c index 95ae1d942..57539db14 100644 --- a/bfd/cpu-nios2.c +++ b/bfd/cpu-nios2.c @@ -1,5 +1,5 @@ /* BFD support for the Altera Nios II processor. - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. Contributed by Nigel Gray (ngray@altera.com). Contributed by Mentor Graphics, Inc. diff --git a/bfd/cpu-ns32k.c b/bfd/cpu-ns32k.c index 55ee03039..a08cf889b 100644 --- a/bfd/cpu-ns32k.c +++ b/bfd/cpu-ns32k.c @@ -1,5 +1,5 @@ /* BFD support for the ns32k architecture. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Almost totally rewritten by Ian Dall from initial work by Andrew Cagney. diff --git a/bfd/cpu-or1k.c b/bfd/cpu-or1k.c index 7abf2cb2d..b95b1d801 100644 --- a/bfd/cpu-or1k.c +++ b/bfd/cpu-or1k.c @@ -1,5 +1,5 @@ /* BFD support for the OpenRISC 1000 architecture. - Copyright 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. Contributed for OR32 by Ivan Guzvinec This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-pdp11.c b/bfd/cpu-pdp11.c index cf8e7e25d..0c8c04433 100644 --- a/bfd/cpu-pdp11.c +++ b/bfd/cpu-pdp11.c @@ -1,5 +1,5 @@ /* BFD back-end for PDP-11 support. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-pj.c b/bfd/cpu-pj.c index dfbe8c421..3124c13bf 100644 --- a/bfd/cpu-pj.c +++ b/bfd/cpu-pj.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Pico Java architecture. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Transmeta. sac@pobox.com This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-plugin.c b/bfd/cpu-plugin.c index 76fd68788..638de773f 100644 --- a/bfd/cpu-plugin.c +++ b/bfd/cpu-plugin.c @@ -1,5 +1,5 @@ /* BFD support for plugins. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-powerpc.c b/bfd/cpu-powerpc.c index 8d7bebc00..d2acf2f9b 100644 --- a/bfd/cpu-powerpc.c +++ b/bfd/cpu-powerpc.c @@ -1,5 +1,5 @@ /* BFD PowerPC CPU definition - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-rl78.c b/bfd/cpu-rl78.c index 2b30626be..2177c899f 100644 --- a/bfd/cpu-rl78.c +++ b/bfd/cpu-rl78.c @@ -1,5 +1,5 @@ /* BFD support for the RL78 processor. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-rs6000.c b/bfd/cpu-rs6000.c index b8022c3d4..4848fc0f5 100644 --- a/bfd/cpu-rs6000.c +++ b/bfd/cpu-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for rs6000 support - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Mimi Phuong-Thao Vo of IBM and John Gilmore of Cygnus Support. diff --git a/bfd/cpu-rx.c b/bfd/cpu-rx.c index 677c49019..f929a9baf 100644 --- a/bfd/cpu-rx.c +++ b/bfd/cpu-rx.c @@ -1,5 +1,5 @@ /* BFD support for the RX processor. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-s390.c b/bfd/cpu-s390.c index badf39da3..5fd3271bb 100644 --- a/bfd/cpu-s390.c +++ b/bfd/cpu-s390.c @@ -1,5 +1,5 @@ /* BFD support for the s390 processor. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-score.c b/bfd/cpu-score.c index 42db5b34d..b02c51ce7 100644 --- a/bfd/cpu-score.c +++ b/bfd/cpu-score.c @@ -1,5 +1,5 @@ /* BFD support for the score processor - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. Contributed by Brain.lin (brain.lin@sunplusct.com) Mei Ligang (ligang@sunnorth.com.cn) diff --git a/bfd/cpu-sh.c b/bfd/cpu-sh.c index 2a8b931c8..d516d66b6 100644 --- a/bfd/cpu-sh.c +++ b/bfd/cpu-sh.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Renesas / SuperH SH architecture. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-sparc.c b/bfd/cpu-sparc.c index f215c67ab..ba7a0f550 100644 --- a/bfd/cpu-sparc.c +++ b/bfd/cpu-sparc.c @@ -1,5 +1,5 @@ /* BFD support for the SPARC architecture. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-spu.c b/bfd/cpu-spu.c index 3e0db39bc..26dc2d604 100644 --- a/bfd/cpu-spu.c +++ b/bfd/cpu-spu.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2014 Free Software Foundation, Inc. +/* Copyright (C) 2006-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-tic30.c b/bfd/cpu-tic30.c index f866b8944..94ee8e0b9 100644 --- a/bfd/cpu-tic30.c +++ b/bfd/cpu-tic30.c @@ -1,5 +1,5 @@ /* BFD support for the Texas Instruments TMS320C30 architecture. - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-tic4x.c b/bfd/cpu-tic4x.c index 551afe8dd..fb5164c60 100644 --- a/bfd/cpu-tic4x.c +++ b/bfd/cpu-tic4x.c @@ -1,5 +1,5 @@ /* bfd back-end for TMS320C[34]x support - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) diff --git a/bfd/cpu-tic54x.c b/bfd/cpu-tic54x.c index 0e3b56d6e..ec89f6048 100644 --- a/bfd/cpu-tic54x.c +++ b/bfd/cpu-tic54x.c @@ -1,5 +1,5 @@ /* BFD support for the Texas Instruments TMS320C54X architecture. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-tic6x.c b/bfd/cpu-tic6x.c index ed9581ccd..6e6062ee7 100644 --- a/bfd/cpu-tic6x.c +++ b/bfd/cpu-tic6x.c @@ -1,5 +1,5 @@ /* BFD support for the TI C6X processor. - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-tic80.c b/bfd/cpu-tic80.c index 83995e0d7..0e16fb156 100644 --- a/bfd/cpu-tic80.c +++ b/bfd/cpu-tic80.c @@ -1,5 +1,5 @@ /* bfd back-end for TI TMS320C80 (MVP) support - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 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/bfd/cpu-tilegx.c b/bfd/cpu-tilegx.c index f5126f5c1..ab9526b6e 100644 --- a/bfd/cpu-tilegx.c +++ b/bfd/cpu-tilegx.c @@ -1,5 +1,5 @@ /* BFD support for the TILE-Gx processor. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-tilepro.c b/bfd/cpu-tilepro.c index 6be1d7b4a..6f2032040 100644 --- a/bfd/cpu-tilepro.c +++ b/bfd/cpu-tilepro.c @@ -1,5 +1,5 @@ /* BFD support for the TILEPro processor. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-v850.c b/bfd/cpu-v850.c index 60b65635d..cda7517b2 100644 --- a/bfd/cpu-v850.c +++ b/bfd/cpu-v850.c @@ -1,5 +1,5 @@ /* BFD support for the NEC V850 processor - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-v850_rh850.c b/bfd/cpu-v850_rh850.c index 796284537..9ffae514a 100644 --- a/bfd/cpu-v850_rh850.c +++ b/bfd/cpu-v850_rh850.c @@ -1,5 +1,5 @@ /* BFD support for the NEC V850 processor with the RH850 ABI. - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-vax.c b/bfd/cpu-vax.c index 225b3f4a0..b35200781 100644 --- a/bfd/cpu-vax.c +++ b/bfd/cpu-vax.c @@ -1,5 +1,5 @@ /* bfd back-end for vax support - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-visium.c b/bfd/cpu-visium.c new file mode 100644 index 000000000..a21bb1105 --- /dev/null +++ b/bfd/cpu-visium.c @@ -0,0 +1,41 @@ +/* BFD support for the Visium processor. + + Copyright (C) 2003-2015 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 3 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., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#include "sysdep.h" +#include "bfd.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_visium_arch = +{ + 32, /* bits per word */ + 32, /* bits per address */ + 8, /* bits per byte */ + bfd_arch_visium, /* architecture */ + bfd_mach_visium, /* machine */ + "visium", /* architecture name */ + "visium", /* printable name */ + 2, /* section align power */ + TRUE, /* the default ? */ + bfd_default_compatible, /* architecture comparison fn */ + bfd_default_scan, /* string to architecture convert fn */ + bfd_arch_default_fill, /* default fill */ + NULL /* next in list */ +}; diff --git a/bfd/cpu-w65.c b/bfd/cpu-w65.c index f3d0d5216..129b10f8e 100644 --- a/bfd/cpu-w65.c +++ b/bfd/cpu-w65.c @@ -1,5 +1,5 @@ /* BFD library support routines for the WDC 65816 architecture. - Copyright (C) 1995-2014 Free Software Foundation, Inc. + Copyright (C) 1995-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-we32k.c b/bfd/cpu-we32k.c index 5577ae8f5..986c9e5a2 100644 --- a/bfd/cpu-we32k.c +++ b/bfd/cpu-we32k.c @@ -1,5 +1,5 @@ /* bfd back-end for we32k support - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@cs.widener.edu). This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-xc16x.c b/bfd/cpu-xc16x.c index cdcc4e85b..43d568285 100644 --- a/bfd/cpu-xc16x.c +++ b/bfd/cpu-xc16x.c @@ -1,5 +1,5 @@ /* BFD support for the Infineon XC16X Microcontroller. - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. Contributed by KPIT Cummins Infosystems This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-xgate.c b/bfd/cpu-xgate.c index f8bfdf9ef..4e76c413c 100644 --- a/bfd/cpu-xgate.c +++ b/bfd/cpu-xgate.c @@ -1,5 +1,5 @@ /* BFD support for the Freescale XGATE processor - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-xstormy16.c b/bfd/cpu-xstormy16.c index 2e2578b88..ddf084f90 100644 --- a/bfd/cpu-xstormy16.c +++ b/bfd/cpu-xstormy16.c @@ -1,5 +1,5 @@ /* BFD support for the XSTORMY16 processor. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-xtensa.c b/bfd/cpu-xtensa.c index 5eb02e92c..9c48b33ca 100644 --- a/bfd/cpu-xtensa.c +++ b/bfd/cpu-xtensa.c @@ -1,5 +1,5 @@ /* BFD support for the Xtensa processor. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-z80.c b/bfd/cpu-z80.c index d7bb6f2cc..785cb238b 100644 --- a/bfd/cpu-z80.c +++ b/bfd/cpu-z80.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Z80 architecture. - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. Contributed by Arnold Metselaar This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/cpu-z8k.c b/bfd/cpu-z8k.c index 9c6547cfb..8dd801f12 100644 --- a/bfd/cpu-z8k.c +++ b/bfd/cpu-z8k.c @@ -1,5 +1,5 @@ /* BFD library support routines for the Z800n architecture. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/demo64.c b/bfd/demo64.c index 83db63edb..26d48f352 100644 --- a/bfd/demo64.c +++ b/bfd/demo64.c @@ -1,5 +1,5 @@ /* BFD backend for demonstration 64-bit a.out binaries. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/development.sh b/bfd/development.sh index 416ec8c8f..0e65c0788 100644 --- a/bfd/development.sh +++ b/bfd/development.sh @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is part of GDB. # diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 93d82fbf1..fe3d6913a 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,3 +1,28 @@ +2015-01-12 Bernd Edlinger + Alan Modra + + PR 17817 + * Makefile.am (aoutx.stamp): cp -p $srcdir/aoutx.texi to keep + timestamps so that makeinfo need not be installed. + (archive.stamp, archures.stamp, bfdt.stamp, cache.stamp, + coffcode.stamp, core.stamp, elf.stamp, elfcode.stamp, mmo.stamp, + format.stamp, libbfd.stamp, bfdio.stamp, bfdwin.stamp, + opncls.stamp, reloc.stamp, section.stamp, syms.stamp, targets.stamp, + init.stamp, hash.stamp, linker.stamp): Similarly. + (bfdver.texi): Use test rather than [ ] in commands. + * Makefile.in: Regenerate. + +2014-08-05 Doug Evans + + * chew.c (skip_past_newline_1): New function. + (outputdots): Call it. + (skip_past_newline): Ditto. + +2014-08-05 Alan Modra + + * chew.c (print_stack_level, main): Cast result of pointer + difference to match format string. + 2014-04-09 Alan Modra * Makefile.am ($(MKDOC)): New rule, depend on chew.stamp. Move @@ -293,7 +318,7 @@ For older changes see ChangeLog-9103 -Copyright (C) 2004-2014 Free Software Foundation, Inc. +Copyright (C) 2004-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am index 3f6985933..779f36109 100644 --- a/bfd/doc/Makefile.am +++ b/bfd/doc/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to generate Makefile.in # -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -97,18 +97,21 @@ protos: libbfd.h libcoff.h bfd.h aoutx.texi: aoutx.stamp ; @true aoutx.stamp: $(srcdir)/../aoutx.h $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >aoutx.tmp + test -e aoutx.texi || test ! -f $(srcdir)/aoutx.texi || cp -p $(srcdir)/aoutx.texi . $(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi touch $@ archive.texi: archive.stamp ; @true archive.stamp: $(srcdir)/../archive.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >archive.tmp + test -e archive.texi || test ! -f $(srcdir)/archive.texi || cp -p $(srcdir)/archive.texi . $(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi touch $@ archures.texi: archures.stamp ; @true archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >archures.tmp + test -e archures.texi || test ! -f $(srcdir)/archures.texi || cp -p $(srcdir)/archures.texi . $(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi touch $@ @@ -117,114 +120,133 @@ archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC) bfdt.texi: bfdt.stamp ; @true bfdt.stamp: $(srcdir)/../bfd.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfd.tmp + test -e bfdt.texi || test ! -f $(srcdir)/bfdt.texi || cp -p $(srcdir)/bfdt.texi . $(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi touch $@ cache.texi: cache.stamp ; @true cache.stamp: $(srcdir)/../cache.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >cache.tmp + test -e cache.texi || test ! -f $(srcdir)/cache.texi || cp -p $(srcdir)/cache.texi . $(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi touch $@ coffcode.texi: coffcode.stamp ; @true coffcode.stamp: $(srcdir)/../coffcode.h $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >coffcode.tmp + test -e coffcode.texi || test ! -f $(srcdir)/coffcode.texi || cp -p $(srcdir)/coffcode.texi . $(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi touch $@ core.texi: core.stamp ; @true core.stamp: $(srcdir)/../corefile.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >core.tmp + test -e core.texi || test ! -f $(srcdir)/core.texi || cp -p $(srcdir)/core.texi . $(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi touch $@ elf.texi: elf.stamp ; @true elf.stamp: $(srcdir)/../elf.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >elf.tmp + test -e elf.texi || test ! -f $(srcdir)/elf.texi || cp -p $(srcdir)/elf.texi . $(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi touch $@ elfcode.texi: elfcode.stamp ; @true elfcode.stamp: $(srcdir)/../elfcode.h $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >elfcode.tmp + test -e elfcode.texi || test ! -f $(srcdir)/elfcode.texi || cp -p $(srcdir)/elfcode.texi . $(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi touch $@ mmo.texi: mmo.stamp ; @true mmo.stamp: $(srcdir)/../mmo.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >mmo.tmp + test -e mmo.texi || test ! -f $(srcdir)/mmo.texi || cp -p $(srcdir)/mmo.texi . $(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi touch $@ format.texi: format.stamp ; @true format.stamp: $(srcdir)/../format.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >format.tmp + test -e format.texi || test ! -f $(srcdir)/format.texi || cp -p $(srcdir)/format.texi . $(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi touch $@ libbfd.texi: libbfd.stamp ; @true libbfd.stamp: $(srcdir)/../libbfd.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >libbfd.tmp + test -e libbfd.texi || test ! -f $(srcdir)/libbfd.texi || cp -p $(srcdir)/libbfd.texi . $(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi touch $@ bfdio.texi: bfdio.stamp ; @true bfdio.stamp: $(srcdir)/../bfdio.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdio.tmp + test -e bfdio.texi || test ! -f $(srcdir)/bfdio.texi || cp -p $(srcdir)/bfdio.texi . $(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi touch $@ bfdwin.texi: bfdwin.stamp ; @true bfdwin.stamp: $(srcdir)/../bfdwin.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdwin.tmp + test -e bfdwin.texi || test ! -f $(srcdir)/bfdwin.texi || cp -p $(srcdir)/bfdwin.texi . $(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi touch $@ opncls.texi: opncls.stamp ; @true opncls.stamp: $(srcdir)/../opncls.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >opncls.tmp + test -e opncls.texi || test ! -f $(srcdir)/opncls.texi || cp -p $(srcdir)/opncls.texi . $(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi touch $@ reloc.texi: reloc.stamp ; @true reloc.stamp: $(srcdir)/../reloc.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >reloc.tmp + test -e reloc.texi || test ! -f $(srcdir)/reloc.texi || cp -p $(srcdir)/reloc.texi . $(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi touch $@ section.texi: section.stamp ; @true section.stamp: $(srcdir)/../section.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >section.tmp + test -e section.texi || test ! -f $(srcdir)/section.texi || cp -p $(srcdir)/section.texi . $(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi touch $@ syms.texi: syms.stamp ; @true syms.stamp: $(srcdir)/../syms.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >syms.tmp + test -e syms.texi || test ! -f $(srcdir)/syms.texi || cp -p $(srcdir)/syms.texi . $(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi touch $@ targets.texi: targets.stamp ; @true targets.stamp: $(srcdir)/../targets.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >targets.tmp + test -e targets.texi || test ! -f $(srcdir)/targets.texi || cp -p $(srcdir)/targets.texi . $(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi touch $@ init.texi: init.stamp ; @true init.stamp: $(srcdir)/../init.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >init.tmp + test -e init.texi || test ! -f $(srcdir)/init.texi || cp -p $(srcdir)/init.texi . $(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi touch $@ hash.texi: hash.stamp ; @true hash.stamp: $(srcdir)/../hash.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >hash.tmp + test -e hash.texi || test ! -f $(srcdir)/hash.texi || cp -p $(srcdir)/hash.texi . $(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi touch $@ linker.texi: linker.stamp ; @true linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >linker.tmp + test -e linker.texi || test ! -f $(srcdir)/linker.texi || cp -p $(srcdir)/linker.texi . $(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi touch $@ @@ -316,11 +338,11 @@ bfd.h: $(BFD_H_DEP) bfdver.texi: $(srcdir)/Makefile.in @echo "creating $@"; \ echo "@set VERSION $(VERSION)" > bfdver.texi; \ - if [ -n "$(PKGVERSION)" ]; then \ + if test -n "$(PKGVERSION)"; then \ echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \ fi; \ echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \ - if [ -n "$(REPORT_BUGS_TEXI)" ]; then \ + if test -n "$(REPORT_BUGS_TEXI)"; then \ echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \ fi diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in index 77e837cf3..78d8ec058 100644 --- a/bfd/doc/Makefile.in +++ b/bfd/doc/Makefile.in @@ -16,7 +16,7 @@ @SET_MAKE@ # -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -76,7 +76,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/bfd.m4 $(top_srcdir)/warning.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/zlib.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs @@ -796,18 +796,21 @@ protos: libbfd.h libcoff.h bfd.h aoutx.texi: aoutx.stamp ; @true aoutx.stamp: $(srcdir)/../aoutx.h $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >aoutx.tmp + test -e aoutx.texi || test ! -f $(srcdir)/aoutx.texi || cp -p $(srcdir)/aoutx.texi . $(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi touch $@ archive.texi: archive.stamp ; @true archive.stamp: $(srcdir)/../archive.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >archive.tmp + test -e archive.texi || test ! -f $(srcdir)/archive.texi || cp -p $(srcdir)/archive.texi . $(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi touch $@ archures.texi: archures.stamp ; @true archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >archures.tmp + test -e archures.texi || test ! -f $(srcdir)/archures.texi || cp -p $(srcdir)/archures.texi . $(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi touch $@ @@ -816,114 +819,133 @@ archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC) bfdt.texi: bfdt.stamp ; @true bfdt.stamp: $(srcdir)/../bfd.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfd.tmp + test -e bfdt.texi || test ! -f $(srcdir)/bfdt.texi || cp -p $(srcdir)/bfdt.texi . $(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi touch $@ cache.texi: cache.stamp ; @true cache.stamp: $(srcdir)/../cache.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >cache.tmp + test -e cache.texi || test ! -f $(srcdir)/cache.texi || cp -p $(srcdir)/cache.texi . $(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi touch $@ coffcode.texi: coffcode.stamp ; @true coffcode.stamp: $(srcdir)/../coffcode.h $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >coffcode.tmp + test -e coffcode.texi || test ! -f $(srcdir)/coffcode.texi || cp -p $(srcdir)/coffcode.texi . $(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi touch $@ core.texi: core.stamp ; @true core.stamp: $(srcdir)/../corefile.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >core.tmp + test -e core.texi || test ! -f $(srcdir)/core.texi || cp -p $(srcdir)/core.texi . $(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi touch $@ elf.texi: elf.stamp ; @true elf.stamp: $(srcdir)/../elf.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >elf.tmp + test -e elf.texi || test ! -f $(srcdir)/elf.texi || cp -p $(srcdir)/elf.texi . $(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi touch $@ elfcode.texi: elfcode.stamp ; @true elfcode.stamp: $(srcdir)/../elfcode.h $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >elfcode.tmp + test -e elfcode.texi || test ! -f $(srcdir)/elfcode.texi || cp -p $(srcdir)/elfcode.texi . $(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi touch $@ mmo.texi: mmo.stamp ; @true mmo.stamp: $(srcdir)/../mmo.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >mmo.tmp + test -e mmo.texi || test ! -f $(srcdir)/mmo.texi || cp -p $(srcdir)/mmo.texi . $(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi touch $@ format.texi: format.stamp ; @true format.stamp: $(srcdir)/../format.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >format.tmp + test -e format.texi || test ! -f $(srcdir)/format.texi || cp -p $(srcdir)/format.texi . $(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi touch $@ libbfd.texi: libbfd.stamp ; @true libbfd.stamp: $(srcdir)/../libbfd.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >libbfd.tmp + test -e libbfd.texi || test ! -f $(srcdir)/libbfd.texi || cp -p $(srcdir)/libbfd.texi . $(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi touch $@ bfdio.texi: bfdio.stamp ; @true bfdio.stamp: $(srcdir)/../bfdio.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdio.tmp + test -e bfdio.texi || test ! -f $(srcdir)/bfdio.texi || cp -p $(srcdir)/bfdio.texi . $(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi touch $@ bfdwin.texi: bfdwin.stamp ; @true bfdwin.stamp: $(srcdir)/../bfdwin.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdwin.tmp + test -e bfdwin.texi || test ! -f $(srcdir)/bfdwin.texi || cp -p $(srcdir)/bfdwin.texi . $(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi touch $@ opncls.texi: opncls.stamp ; @true opncls.stamp: $(srcdir)/../opncls.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >opncls.tmp + test -e opncls.texi || test ! -f $(srcdir)/opncls.texi || cp -p $(srcdir)/opncls.texi . $(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi touch $@ reloc.texi: reloc.stamp ; @true reloc.stamp: $(srcdir)/../reloc.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >reloc.tmp + test -e reloc.texi || test ! -f $(srcdir)/reloc.texi || cp -p $(srcdir)/reloc.texi . $(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi touch $@ section.texi: section.stamp ; @true section.stamp: $(srcdir)/../section.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >section.tmp + test -e section.texi || test ! -f $(srcdir)/section.texi || cp -p $(srcdir)/section.texi . $(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi touch $@ syms.texi: syms.stamp ; @true syms.stamp: $(srcdir)/../syms.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >syms.tmp + test -e syms.texi || test ! -f $(srcdir)/syms.texi || cp -p $(srcdir)/syms.texi . $(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi touch $@ targets.texi: targets.stamp ; @true targets.stamp: $(srcdir)/../targets.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >targets.tmp + test -e targets.texi || test ! -f $(srcdir)/targets.texi || cp -p $(srcdir)/targets.texi . $(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi touch $@ init.texi: init.stamp ; @true init.stamp: $(srcdir)/../init.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >init.tmp + test -e init.texi || test ! -f $(srcdir)/init.texi || cp -p $(srcdir)/init.texi . $(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi touch $@ hash.texi: hash.stamp ; @true hash.stamp: $(srcdir)/../hash.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >hash.tmp + test -e hash.texi || test ! -f $(srcdir)/hash.texi || cp -p $(srcdir)/hash.texi . $(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi touch $@ linker.texi: linker.stamp ; @true linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC) ./$(MKDOC) -f $(srcdir)/doc.str < $< >linker.tmp + test -e linker.texi || test ! -f $(srcdir)/linker.texi || cp -p $(srcdir)/linker.texi . $(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi touch $@ @@ -970,11 +992,11 @@ bfd.h: $(BFD_H_DEP) bfdver.texi: $(srcdir)/Makefile.in @echo "creating $@"; \ echo "@set VERSION $(VERSION)" > bfdver.texi; \ - if [ -n "$(PKGVERSION)" ]; then \ + if test -n "$(PKGVERSION)"; then \ echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \ fi; \ echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \ - if [ -n "$(REPORT_BUGS_TEXI)" ]; then \ + if test -n "$(REPORT_BUGS_TEXI)"; then \ echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \ fi diff --git a/bfd/doc/aoutx.texi b/bfd/doc/aoutx.texi index 35f84179f..2afe59dd6 100644 --- a/bfd/doc/aoutx.texi +++ b/bfd/doc/aoutx.texi @@ -90,7 +90,7 @@ to use @file{host-aout.c}, specify: TDEPFILES= host-aout.o trad-core.o @end example -in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in} +in the @file{config/@var{XXX}.mt} file, and modify @file{configure.ac} to use the @file{@var{XXX}.mt} file (by setting "@code{bfd_target=XXX}") when your configuration is selected. diff --git a/bfd/doc/archures.texi b/bfd/doc/archures.texi index 99fe4d316..698f67ac3 100644 --- a/bfd/doc/archures.texi +++ b/bfd/doc/archures.texi @@ -146,15 +146,18 @@ enum bfd_architecture #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 +#define bfd_mach_mips_octeon3 6503 #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 #define bfd_mach_mipsisa32r3 34 #define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 #define bfd_mach_mipsisa64r3 66 #define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_intel_syntax (1 << 0) @@ -377,6 +380,7 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 +#define bfd_mach_avrtiny 100 #define bfd_mach_avrxmega1 101 #define bfd_mach_avrxmega2 102 #define bfd_mach_avrxmega3 103 @@ -460,6 +464,8 @@ enum bfd_architecture #define bfd_mach_aarch64_ilp32 32 bfd_arch_nios2, #define bfd_mach_nios2 0 + bfd_arch_visium, /* Visium */ +#define bfd_mach_visium 1 bfd_arch_last @}; @end example diff --git a/bfd/doc/bfd.info b/bfd/doc/bfd.info index 454fcbf0d..449e503ce 100644 --- a/bfd/doc/bfd.info +++ b/bfd/doc/bfd.info @@ -2,7 +2,7 @@ This is bfd.info, produced by makeinfo version 5.2 from bfd.texinfo. This file documents the BFD library. - Copyright (C) 1991-2014 Free Software Foundation, Inc. + Copyright (C) 1991-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -340,9 +340,6 @@ major data about the file and pointers to the rest of the data. struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -365,17 +362,17 @@ major data about the file and pointers to the rest of the data. /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ - flagword flags; + flagword flags : 17; /* Values that may appear in the flags field of a BFD. These also appear in the object_flags field of the bfd_target structure, where @@ -434,26 +431,23 @@ major data about the file and pointers to the rest of the data. struct. */ #define BFD_IN_MEMORY 0x800 - /* The sections in this BFD specify a memory page. */ - #define HAS_LOAD_PAGE 0x1000 - /* This BFD has been created by the linker and doesn't correspond to any input file. */ - #define BFD_LINKER_CREATED 0x2000 + #define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ - #define BFD_DETERMINISTIC_OUTPUT 0x4000 + #define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ - #define BFD_COMPRESS 0x8000 + #define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ - #define BFD_DECOMPRESS 0x10000 + #define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ - #define BFD_PLUGIN 0x20000 + #define BFD_PLUGIN 0x10000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ @@ -464,6 +458,42 @@ major data about the file and pointers to the rest of the data. (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + /* 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. */ @@ -488,17 +518,21 @@ major data about the file and pointers to the rest of the data. /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -513,12 +547,12 @@ major data about the file and pointers to the rest of the data. struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union @@ -570,39 +604,6 @@ major data about the file and pointers to the rest of the data. struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; }; /* See note beside bfd_set_section_userdata. */ @@ -988,12 +989,12 @@ The following functions exist but have not yet been 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)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -1042,9 +1043,6 @@ The following functions exist but have not yet been documented. #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) - #define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -3720,6 +3718,11 @@ attributes. -- : BFD_RELOC_MICROMIPS_10_PCREL_S1 -- : BFD_RELOC_MICROMIPS_16_PCREL_S1 microMIPS PC-relative relocations. + -- : BFD_RELOC_MIPS_21_PCREL_S2 + -- : BFD_RELOC_MIPS_26_PCREL_S2 + -- : BFD_RELOC_MIPS_18_PCREL_S3 + -- : BFD_RELOC_MIPS_19_PCREL_S2 + MIPS PC-relative relocations. -- : BFD_RELOC_MICROMIPS_GPREL16 -- : BFD_RELOC_MICROMIPS_HI16 -- : BFD_RELOC_MICROMIPS_HI16_S @@ -4582,6 +4585,13 @@ attributes. -- : BFD_RELOC_NDS32_15_FIXED -- : BFD_RELOC_NDS32_17_FIXED -- : BFD_RELOC_NDS32_25_FIXED + -- : BFD_RELOC_NDS32_LONGCALL4 + -- : BFD_RELOC_NDS32_LONGCALL5 + -- : BFD_RELOC_NDS32_LONGCALL6 + -- : BFD_RELOC_NDS32_LONGJUMP4 + -- : BFD_RELOC_NDS32_LONGJUMP5 + -- : BFD_RELOC_NDS32_LONGJUMP6 + -- : BFD_RELOC_NDS32_LONGJUMP7 for relax -- : BFD_RELOC_NDS32_PLTREL_HI20 -- : BFD_RELOC_NDS32_PLTREL_LO12 @@ -4633,12 +4643,29 @@ attributes. -- : BFD_RELOC_NDS32_DIFF16 -- : BFD_RELOC_NDS32_DIFF32 -- : BFD_RELOC_NDS32_DIFF_ULEB128 + -- : BFD_RELOC_NDS32_EMPTY + relaxation relative relocation types -- : BFD_RELOC_NDS32_25_ABS + This is a 25 bit absolute address. -- : BFD_RELOC_NDS32_DATA -- : BFD_RELOC_NDS32_TRAN -- : BFD_RELOC_NDS32_17IFC_PCREL -- : BFD_RELOC_NDS32_10IFCU_PCREL - relaxation relative relocation types + For ex9 and ifc using. + -- : BFD_RELOC_NDS32_TPOFF + -- : BFD_RELOC_NDS32_TLS_LE_HI20 + -- : BFD_RELOC_NDS32_TLS_LE_LO12 + -- : BFD_RELOC_NDS32_TLS_LE_ADD + -- : BFD_RELOC_NDS32_TLS_LE_LS + -- : BFD_RELOC_NDS32_GOTTPOFF + -- : BFD_RELOC_NDS32_TLS_IE_HI20 + -- : BFD_RELOC_NDS32_TLS_IE_LO12S2 + -- : BFD_RELOC_NDS32_TLS_TPOFF + -- : BFD_RELOC_NDS32_TLS_LE_20 + -- : BFD_RELOC_NDS32_TLS_LE_15S0 + -- : BFD_RELOC_NDS32_TLS_LE_15S1 + -- : BFD_RELOC_NDS32_TLS_LE_15S2 + For TLS. -- : BFD_RELOC_V850_9_PCREL This is a 9-bit reloc -- : BFD_RELOC_V850_22_PCREL @@ -5011,6 +5038,15 @@ attributes. assuming no relaxation. The relocation encodes the position of the second symbol so the linker can determine whether to adjust the field value. + -- : BFD_RELOC_AVR_LDS_STS_16 + This is a 7 bit reloc for the AVR that stores SRAM address for + 16bit lds and sts instructions supported only tiny core. + -- : BFD_RELOC_AVR_PORT6 + This is a 6 bit reloc for the AVR that stores an I/O register + number for the IN and OUT instructions + -- : BFD_RELOC_AVR_PORT5 + This is a 5 bit reloc for the AVR that stores an I/O register + number for the SBIC, SBIS, SBI and CBI instructions -- : BFD_RELOC_RL78_NEG8 -- : BFD_RELOC_RL78_NEG16 -- : BFD_RELOC_RL78_NEG24 @@ -6296,6 +6332,14 @@ attributes. displacement) -- : BFD_RELOC_EPIPHANY_IMM8 Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. + -- : BFD_RELOC_VISIUM_HI16 + -- : BFD_RELOC_VISIUM_LO16 + -- : BFD_RELOC_VISIUM_IM16 + -- : BFD_RELOC_VISIUM_REL16 + -- : BFD_RELOC_VISIUM_HI16_PCREL + -- : BFD_RELOC_VISIUM_LO16_PCREL + -- : BFD_RELOC_VISIUM_IM16_PCREL + Visium Relocations. typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; @@ -6774,12 +6818,12 @@ BFD_JUMP_TABLE macros. NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ @@ -6796,14 +6840,14 @@ BFD_JUMP_TABLE macros. void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, symbol_info *); #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) + (bfd *, struct bfd_symbol *, bfd_boolean *); + #define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma, const char **, const char **, unsigned int *, unsigned int *); bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, struct bfd_symbol *, @@ -6857,7 +6901,6 @@ BFD_JUMP_TABLE macros. NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ @@ -6884,16 +6927,14 @@ BFD_JUMP_TABLE macros. struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) void (*_bfd_copy_link_hash_symbol_type) @@ -7194,15 +7235,18 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 + #define bfd_mach_mips_octeon3 6503 #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 #define bfd_mach_mipsisa32r3 34 #define bfd_mach_mipsisa32r5 36 + #define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 #define bfd_mach_mipsisa64r3 66 #define bfd_mach_mipsisa64r5 68 + #define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_intel_syntax (1 << 0) @@ -7425,6 +7469,7 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 + #define bfd_mach_avrtiny 100 #define bfd_mach_avrxmega1 101 #define bfd_mach_avrxmega2 102 #define bfd_mach_avrxmega3 103 @@ -7508,6 +7553,8 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_aarch64_ilp32 32 bfd_arch_nios2, #define bfd_mach_nios2 0 + bfd_arch_visium, /* Visium */ + #define bfd_mach_visium 1 bfd_arch_last }; @@ -8575,24 +8622,14 @@ linker hash table instead.) In most cases the work of looking through the symbols in the archive should be done by the '_bfd_generic_link_add_archive_symbols' function. -This function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which elements should -be included. '_bfd_generic_link_add_archive_symbols' is passed a -function to call to make the final decision about adding an archive -element to the link and to do the actual work of adding the symbols to -the linker hash table. - - The function passed to '_bfd_generic_link_add_archive_symbols' must -read the symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to be -included, the 'add_archive_element' linker callback routine must be -called with the element as an argument, and the element's symbols must -be added to the linker hash table just as though the element had itself -been passed to the '_bfd_link_add_symbols' function. The -'add_archive_element' callback has the option to indicate that it would -like to replace the element archive with a substitute BFD, in which case -it is the symbols of that substitute BFD that must be added to the -linker hash table instead. +'_bfd_generic_link_add_archive_symbols' is passed a function to call to +make the final decision about adding an archive element to the link and +to do the actual work of adding the symbols to the linker hash table. +If the element is to be included, the 'add_archive_element' linker +callback routine must be called with the element as an argument, and the +element's symbols must be added to the linker hash table just as though +the element had itself been passed to the '_bfd_link_add_symbols' +function. When the a.out '_bfd_link_add_symbols' function receives an archive, it calls '_bfd_generic_link_add_archive_symbols' passing @@ -8652,7 +8689,7 @@ some data structures for the function to use. The 'input_bfds' field of the 'bfd_link_info' structure will point to a list of all the input files included in the link. These files are -linked through the 'link_next' field of the 'bfd' structure. +linked through the 'link.next' field of the 'bfd' structure. Each section in the output file will have a list of 'link_order' structures attached to the 'map_head.link_order' field (the 'link_order' @@ -9151,7 +9188,7 @@ host. To configure a new machine to use 'host-aout.c', specify: TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec TDEPFILES= host-aout.o trad-core.o - in the 'config/XXX.mt' file, and modify 'configure.in' to use the + in the 'config/XXX.mt' file, and modify 'configure.ac' to use the 'XXX.mt' file (by setting "'bfd_target=XXX'") when your configuration is selected. @@ -9516,7 +9553,7 @@ The hidden information for an 'asymbol' is described in a typedef struct coff_ptr_struct { /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ + this symbol. Generated by coff_renumber_symbols. */ unsigned int offset; /* Should the value of this symbol be renumbered. Used for @@ -9524,15 +9561,15 @@ The hidden information for an 'asymbol' is described in a unsigned int fix_value : 1; /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ + Created by coff_pointerize_aux. */ unsigned int fix_tag : 1; /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ + Created by coff_pointerize_aux. */ unsigned int fix_end : 1; /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ + Created by coff_pointerize_aux. */ unsigned int fix_scnlen : 1; /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the @@ -9540,12 +9577,15 @@ The hidden information for an 'asymbol' is described in a unsigned int fix_line : 1; /* The container for the symbol structure as read and translated - from the file. */ + from the file. */ union { union internal_auxent auxent; struct internal_syment syment; } u; + + /* Selector for the union above. */ + bfd_boolean is_sym; } combined_entry_type; @@ -10804,33 +10844,33 @@ BFD Index (line 238) * bfd_alloc2: Opening and Closing. (line 247) -* bfd_alt_mach_code: Miscellaneous. (line 305) -* bfd_arch_bits_per_address: Architectures. (line 595) -* bfd_arch_bits_per_byte: Architectures. (line 587) -* bfd_arch_default_fill: Architectures. (line 676) -* bfd_arch_get_compatible: Architectures. (line 530) -* bfd_arch_list: Architectures. (line 521) -* bfd_arch_mach_octets_per_byte: Architectures. (line 664) -* BFD_ARELOC_BFIN_ADD: howto manager. (line 1006) -* BFD_ARELOC_BFIN_ADDR: howto manager. (line 1040) -* BFD_ARELOC_BFIN_AND: howto manager. (line 1020) -* BFD_ARELOC_BFIN_COMP: howto manager. (line 1034) -* BFD_ARELOC_BFIN_CONST: howto manager. (line 1004) -* BFD_ARELOC_BFIN_DIV: howto manager. (line 1012) -* BFD_ARELOC_BFIN_HWPAGE: howto manager. (line 1038) -* BFD_ARELOC_BFIN_LAND: howto manager. (line 1026) -* BFD_ARELOC_BFIN_LEN: howto manager. (line 1030) -* BFD_ARELOC_BFIN_LOR: howto manager. (line 1028) -* BFD_ARELOC_BFIN_LSHIFT: howto manager. (line 1016) -* BFD_ARELOC_BFIN_MOD: howto manager. (line 1014) -* BFD_ARELOC_BFIN_MULT: howto manager. (line 1010) -* BFD_ARELOC_BFIN_NEG: howto manager. (line 1032) -* BFD_ARELOC_BFIN_OR: howto manager. (line 1022) -* BFD_ARELOC_BFIN_PAGE: howto manager. (line 1036) -* BFD_ARELOC_BFIN_PUSH: howto manager. (line 1002) -* BFD_ARELOC_BFIN_RSHIFT: howto manager. (line 1018) -* BFD_ARELOC_BFIN_SUB: howto manager. (line 1008) -* BFD_ARELOC_BFIN_XOR: howto manager. (line 1024) +* bfd_alt_mach_code: Miscellaneous. (line 302) +* bfd_arch_bits_per_address: Architectures. (line 601) +* bfd_arch_bits_per_byte: Architectures. (line 593) +* bfd_arch_default_fill: Architectures. (line 682) +* bfd_arch_get_compatible: Architectures. (line 536) +* bfd_arch_list: Architectures. (line 527) +* bfd_arch_mach_octets_per_byte: Architectures. (line 670) +* BFD_ARELOC_BFIN_ADD: howto manager. (line 1011) +* BFD_ARELOC_BFIN_ADDR: howto manager. (line 1045) +* BFD_ARELOC_BFIN_AND: howto manager. (line 1025) +* BFD_ARELOC_BFIN_COMP: howto manager. (line 1039) +* BFD_ARELOC_BFIN_CONST: howto manager. (line 1009) +* BFD_ARELOC_BFIN_DIV: howto manager. (line 1017) +* BFD_ARELOC_BFIN_HWPAGE: howto manager. (line 1043) +* BFD_ARELOC_BFIN_LAND: howto manager. (line 1031) +* BFD_ARELOC_BFIN_LEN: howto manager. (line 1035) +* BFD_ARELOC_BFIN_LOR: howto manager. (line 1033) +* BFD_ARELOC_BFIN_LSHIFT: howto manager. (line 1021) +* BFD_ARELOC_BFIN_MOD: howto manager. (line 1019) +* BFD_ARELOC_BFIN_MULT: howto manager. (line 1015) +* BFD_ARELOC_BFIN_NEG: howto manager. (line 1037) +* BFD_ARELOC_BFIN_OR: howto manager. (line 1027) +* BFD_ARELOC_BFIN_PAGE: howto manager. (line 1041) +* BFD_ARELOC_BFIN_PUSH: howto manager. (line 1007) +* BFD_ARELOC_BFIN_RSHIFT: howto manager. (line 1023) +* BFD_ARELOC_BFIN_SUB: howto manager. (line 1013) +* BFD_ARELOC_BFIN_XOR: howto manager. (line 1029) * bfd_cache_close: File Caching. (line 25) * bfd_cache_close_all: File Caching. (line 38) * bfd_cache_init: File Caching. (line 17) @@ -10846,7 +10886,7 @@ BFD Index (line 160) * bfd_close_all_done: Opening and Closing. (line 178) -* bfd_coff_backend_data: coff. (line 304) +* bfd_coff_backend_data: coff. (line 307) * bfd_copy_private_bfd_data: Miscellaneous. (line 157) * bfd_copy_private_header_data: Miscellaneous. (line 140) * bfd_copy_private_section_data: section prototypes. (line 277) @@ -10861,22 +10901,22 @@ BFD Index (line 386) * bfd_decode_symclass: symbol handling functions. (line 116) -* bfd_default_arch_struct: Architectures. (line 542) -* bfd_default_compatible: Architectures. (line 604) -* bfd_default_reloc_type_lookup: howto manager. (line 2950) -* bfd_default_scan: Architectures. (line 613) -* bfd_default_set_arch_mach: Architectures. (line 560) -* bfd_demangle: Miscellaneous. (line 356) -* bfd_emul_get_commonpagesize: Miscellaneous. (line 336) -* bfd_emul_get_maxpagesize: Miscellaneous. (line 316) -* bfd_emul_set_commonpagesize: Miscellaneous. (line 347) -* bfd_emul_set_maxpagesize: Miscellaneous. (line 327) +* bfd_default_arch_struct: Architectures. (line 548) +* bfd_default_compatible: Architectures. (line 610) +* bfd_default_reloc_type_lookup: howto manager. (line 2996) +* bfd_default_scan: Architectures. (line 619) +* bfd_default_set_arch_mach: Architectures. (line 566) +* bfd_demangle: Miscellaneous. (line 353) +* bfd_emul_get_commonpagesize: Miscellaneous. (line 333) +* bfd_emul_get_maxpagesize: Miscellaneous. (line 313) +* bfd_emul_set_commonpagesize: Miscellaneous. (line 344) +* bfd_emul_set_maxpagesize: Miscellaneous. (line 324) * bfd_errmsg: Error reporting. (line 67) * bfd_fdopenr: Opening and Closing. (line 56) * bfd_fill_in_gnu_debuglink_section: Opening and Closing. (line 400) -* bfd_find_target: bfd_target. (line 476) +* bfd_find_target: bfd_target. (line 473) * bfd_find_version_for_sym: Writing the symbol table. (line 83) * bfd_follow_gnu_debugaltlink: Opening and Closing. @@ -10889,16 +10929,16 @@ BFD Index * bfd_generic_define_common_symbol: Writing the symbol table. (line 69) * bfd_generic_discard_group: section prototypes. (line 302) -* bfd_generic_gc_sections: howto manager. (line 2981) -* bfd_generic_get_relocated_section_contents: howto manager. (line 3011) +* bfd_generic_gc_sections: howto manager. (line 3027) +* bfd_generic_get_relocated_section_contents: howto manager. (line 3057) * bfd_generic_is_group_section: section prototypes. (line 294) -* bfd_generic_lookup_section_flags: howto manager. (line 2991) -* bfd_generic_merge_sections: howto manager. (line 3001) -* bfd_generic_relax_section: howto manager. (line 2968) +* bfd_generic_lookup_section_flags: howto manager. (line 3037) +* bfd_generic_merge_sections: howto manager. (line 3047) +* bfd_generic_relax_section: howto manager. (line 3014) * bfd_get_alt_debug_link_info: Opening and Closing. (line 299) -* bfd_get_arch: Architectures. (line 571) -* bfd_get_arch_info: Architectures. (line 623) +* bfd_get_arch: Architectures. (line 577) +* bfd_get_arch_info: Architectures. (line 629) * bfd_get_arch_size: Miscellaneous. (line 61) * bfd_get_assert_handler: Error reporting. (line 152) * bfd_get_debug_link_info: Opening and Closing. @@ -10907,22 +10947,22 @@ BFD Index * bfd_get_error_handler: Error reporting. (line 119) * bfd_get_gp_size: Miscellaneous. (line 104) * bfd_get_linker_section: section prototypes. (line 35) -* bfd_get_mach: Architectures. (line 579) -* bfd_get_mtime: Miscellaneous. (line 406) +* bfd_get_mach: Architectures. (line 585) +* bfd_get_mtime: Miscellaneous. (line 403) * bfd_get_next_mapent: Archives. (line 57) * bfd_get_next_section_by_name: section prototypes. (line 25) -* bfd_get_reloc_code_name: howto manager. (line 2959) +* bfd_get_reloc_code_name: howto manager. (line 3005) * bfd_get_reloc_size: typedef arelent. (line 331) * bfd_get_reloc_upper_bound: Miscellaneous. (line 8) * bfd_get_section_by_name: section prototypes. (line 16) * bfd_get_section_by_name_if: section prototypes. (line 44) * bfd_get_section_contents: section prototypes. (line 250) * bfd_get_sign_extend_vma: Miscellaneous. (line 76) -* bfd_get_size: Miscellaneous. (line 415) +* bfd_get_size: Miscellaneous. (line 412) * bfd_get_size <1>: Internal. (line 24) * bfd_get_symtab_upper_bound: symbol handling functions. (line 5) -* bfd_get_target_info: bfd_target. (line 492) +* bfd_get_target_info: bfd_target. (line 489) * bfd_get_unique_section_name: section prototypes. (line 63) * bfd_hash_allocate: Creating and Freeing a Hash Table. (line 17) @@ -10956,7 +10996,7 @@ BFD Index * bfd_link_split_section: Writing the symbol table. (line 43) * bfd_log2: Internal. (line 166) -* bfd_lookup_arch: Architectures. (line 631) +* bfd_lookup_arch: Architectures. (line 637) * bfd_make_debug_symbol: symbol handling functions. (line 106) * bfd_make_empty_symbol: symbol handling functions. @@ -10973,8 +11013,8 @@ BFD Index * bfd_malloc_and_get_section: section prototypes. (line 267) * bfd_map_over_sections: section prototypes. (line 176) * bfd_merge_private_bfd_data: Miscellaneous. (line 172) -* bfd_mmap: Miscellaneous. (line 443) -* bfd_octets_per_byte: Architectures. (line 654) +* bfd_mmap: Miscellaneous. (line 440) +* bfd_octets_per_byte: Architectures. (line 660) * bfd_openr: Opening and Closing. (line 37) * bfd_openr_iovec: Opening and Closing. @@ -10987,54 +11027,54 @@ BFD Index * bfd_open_file: File Caching. (line 51) * bfd_perform_relocation: typedef arelent. (line 369) * bfd_perror: Error reporting. (line 76) -* bfd_printable_arch_mach: Architectures. (line 642) -* bfd_printable_name: Architectures. (line 502) +* bfd_printable_arch_mach: Architectures. (line 648) +* bfd_printable_name: Architectures. (line 508) * bfd_print_symbol_vandf: symbol handling functions. (line 73) * bfd_put_size: Internal. (line 21) * BFD_RELOC_12_PCREL: howto manager. (line 37) * BFD_RELOC_14: howto manager. (line 30) * BFD_RELOC_16: howto manager. (line 29) -* BFD_RELOC_16C_ABS20: howto manager. (line 2048) -* BFD_RELOC_16C_ABS20_C: howto manager. (line 2049) -* BFD_RELOC_16C_ABS24: howto manager. (line 2050) -* BFD_RELOC_16C_ABS24_C: howto manager. (line 2051) -* BFD_RELOC_16C_DISP04: howto manager. (line 2028) -* BFD_RELOC_16C_DISP04_C: howto manager. (line 2029) -* BFD_RELOC_16C_DISP08: howto manager. (line 2030) -* BFD_RELOC_16C_DISP08_C: howto manager. (line 2031) -* BFD_RELOC_16C_DISP16: howto manager. (line 2032) -* BFD_RELOC_16C_DISP16_C: howto manager. (line 2033) -* BFD_RELOC_16C_DISP24: howto manager. (line 2034) -* BFD_RELOC_16C_DISP24a: howto manager. (line 2036) -* BFD_RELOC_16C_DISP24a_C: howto manager. (line 2037) -* BFD_RELOC_16C_DISP24_C: howto manager. (line 2035) -* BFD_RELOC_16C_IMM04: howto manager. (line 2052) -* BFD_RELOC_16C_IMM04_C: howto manager. (line 2053) -* BFD_RELOC_16C_IMM16: howto manager. (line 2054) -* BFD_RELOC_16C_IMM16_C: howto manager. (line 2055) -* BFD_RELOC_16C_IMM20: howto manager. (line 2056) -* BFD_RELOC_16C_IMM20_C: howto manager. (line 2057) -* BFD_RELOC_16C_IMM24: howto manager. (line 2058) -* BFD_RELOC_16C_IMM24_C: howto manager. (line 2059) -* BFD_RELOC_16C_IMM32: howto manager. (line 2060) -* BFD_RELOC_16C_IMM32_C: howto manager. (line 2061) -* BFD_RELOC_16C_NUM08: howto manager. (line 2022) -* BFD_RELOC_16C_NUM08_C: howto manager. (line 2023) -* BFD_RELOC_16C_NUM16: howto manager. (line 2024) -* BFD_RELOC_16C_NUM16_C: howto manager. (line 2025) -* BFD_RELOC_16C_NUM32: howto manager. (line 2026) -* BFD_RELOC_16C_NUM32_C: howto manager. (line 2027) -* BFD_RELOC_16C_REG04: howto manager. (line 2038) -* BFD_RELOC_16C_REG04a: howto manager. (line 2040) -* BFD_RELOC_16C_REG04a_C: howto manager. (line 2041) -* BFD_RELOC_16C_REG04_C: howto manager. (line 2039) -* BFD_RELOC_16C_REG14: howto manager. (line 2042) -* BFD_RELOC_16C_REG14_C: howto manager. (line 2043) -* BFD_RELOC_16C_REG16: howto manager. (line 2044) -* BFD_RELOC_16C_REG16_C: howto manager. (line 2045) -* BFD_RELOC_16C_REG20: howto manager. (line 2046) -* BFD_RELOC_16C_REG20_C: howto manager. (line 2047) +* BFD_RELOC_16C_ABS20: howto manager. (line 2086) +* BFD_RELOC_16C_ABS20_C: howto manager. (line 2087) +* BFD_RELOC_16C_ABS24: howto manager. (line 2088) +* BFD_RELOC_16C_ABS24_C: howto manager. (line 2089) +* BFD_RELOC_16C_DISP04: howto manager. (line 2066) +* BFD_RELOC_16C_DISP04_C: howto manager. (line 2067) +* BFD_RELOC_16C_DISP08: howto manager. (line 2068) +* BFD_RELOC_16C_DISP08_C: howto manager. (line 2069) +* BFD_RELOC_16C_DISP16: howto manager. (line 2070) +* BFD_RELOC_16C_DISP16_C: howto manager. (line 2071) +* BFD_RELOC_16C_DISP24: howto manager. (line 2072) +* BFD_RELOC_16C_DISP24a: howto manager. (line 2074) +* BFD_RELOC_16C_DISP24a_C: howto manager. (line 2075) +* BFD_RELOC_16C_DISP24_C: howto manager. (line 2073) +* BFD_RELOC_16C_IMM04: howto manager. (line 2090) +* BFD_RELOC_16C_IMM04_C: howto manager. (line 2091) +* BFD_RELOC_16C_IMM16: howto manager. (line 2092) +* BFD_RELOC_16C_IMM16_C: howto manager. (line 2093) +* BFD_RELOC_16C_IMM20: howto manager. (line 2094) +* BFD_RELOC_16C_IMM20_C: howto manager. (line 2095) +* BFD_RELOC_16C_IMM24: howto manager. (line 2096) +* BFD_RELOC_16C_IMM24_C: howto manager. (line 2097) +* BFD_RELOC_16C_IMM32: howto manager. (line 2098) +* BFD_RELOC_16C_IMM32_C: howto manager. (line 2099) +* BFD_RELOC_16C_NUM08: howto manager. (line 2060) +* BFD_RELOC_16C_NUM08_C: howto manager. (line 2061) +* BFD_RELOC_16C_NUM16: howto manager. (line 2062) +* BFD_RELOC_16C_NUM16_C: howto manager. (line 2063) +* BFD_RELOC_16C_NUM32: howto manager. (line 2064) +* BFD_RELOC_16C_NUM32_C: howto manager. (line 2065) +* BFD_RELOC_16C_REG04: howto manager. (line 2076) +* BFD_RELOC_16C_REG04a: howto manager. (line 2078) +* BFD_RELOC_16C_REG04a_C: howto manager. (line 2079) +* BFD_RELOC_16C_REG04_C: howto manager. (line 2077) +* BFD_RELOC_16C_REG14: howto manager. (line 2080) +* BFD_RELOC_16C_REG14_C: howto manager. (line 2081) +* BFD_RELOC_16C_REG16: howto manager. (line 2082) +* BFD_RELOC_16C_REG16_C: howto manager. (line 2083) +* BFD_RELOC_16C_REG20: howto manager. (line 2084) +* BFD_RELOC_16C_REG20_C: howto manager. (line 2085) * BFD_RELOC_16_BASEREL: howto manager. (line 92) * BFD_RELOC_16_GOTOFF: howto manager. (line 51) * BFD_RELOC_16_GOT_PCREL: howto manager. (line 48) @@ -11056,85 +11096,85 @@ BFD Index * BFD_RELOC_32_PLTOFF: howto manager. (line 62) * BFD_RELOC_32_PLT_PCREL: howto manager. (line 57) * BFD_RELOC_32_SECREL: howto manager. (line 45) -* BFD_RELOC_386_COPY: howto manager. (line 510) -* BFD_RELOC_386_GLOB_DAT: howto manager. (line 511) -* BFD_RELOC_386_GOT32: howto manager. (line 508) -* BFD_RELOC_386_GOTOFF: howto manager. (line 514) -* BFD_RELOC_386_GOTPC: howto manager. (line 515) -* BFD_RELOC_386_IRELATIVE: howto manager. (line 531) -* BFD_RELOC_386_JUMP_SLOT: howto manager. (line 512) -* BFD_RELOC_386_PLT32: howto manager. (line 509) -* BFD_RELOC_386_RELATIVE: howto manager. (line 513) -* BFD_RELOC_386_TLS_DESC: howto manager. (line 530) -* BFD_RELOC_386_TLS_DESC_CALL: howto manager. (line 529) -* BFD_RELOC_386_TLS_DTPMOD32: howto manager. (line 525) -* BFD_RELOC_386_TLS_DTPOFF32: howto manager. (line 526) -* BFD_RELOC_386_TLS_GD: howto manager. (line 520) -* BFD_RELOC_386_TLS_GOTDESC: howto manager. (line 528) -* BFD_RELOC_386_TLS_GOTIE: howto manager. (line 518) -* BFD_RELOC_386_TLS_IE: howto manager. (line 517) -* BFD_RELOC_386_TLS_IE_32: howto manager. (line 523) -* BFD_RELOC_386_TLS_LDM: howto manager. (line 521) -* BFD_RELOC_386_TLS_LDO_32: howto manager. (line 522) -* BFD_RELOC_386_TLS_LE: howto manager. (line 519) -* BFD_RELOC_386_TLS_LE_32: howto manager. (line 524) -* BFD_RELOC_386_TLS_TPOFF: howto manager. (line 516) -* BFD_RELOC_386_TLS_TPOFF32: howto manager. (line 527) -* BFD_RELOC_390_12: howto manager. (line 1712) -* BFD_RELOC_390_20: howto manager. (line 1793) -* BFD_RELOC_390_COPY: howto manager. (line 1718) -* BFD_RELOC_390_GLOB_DAT: howto manager. (line 1720) -* BFD_RELOC_390_GOT12: howto manager. (line 1714) -* BFD_RELOC_390_GOT16: howto manager. (line 1728) -* BFD_RELOC_390_GOT20: howto manager. (line 1794) -* BFD_RELOC_390_GOT64: howto manager. (line 1748) -* BFD_RELOC_390_GOTENT: howto manager. (line 1752) -* BFD_RELOC_390_GOTOFF64: howto manager. (line 1754) -* BFD_RELOC_390_GOTPC: howto manager. (line 1726) -* BFD_RELOC_390_GOTPCDBL: howto manager. (line 1746) -* BFD_RELOC_390_GOTPLT12: howto manager. (line 1756) -* BFD_RELOC_390_GOTPLT16: howto manager. (line 1758) -* BFD_RELOC_390_GOTPLT20: howto manager. (line 1795) -* BFD_RELOC_390_GOTPLT32: howto manager. (line 1760) -* BFD_RELOC_390_GOTPLT64: howto manager. (line 1762) -* BFD_RELOC_390_GOTPLTENT: howto manager. (line 1764) -* BFD_RELOC_390_IRELATIVE: howto manager. (line 1798) -* BFD_RELOC_390_JMP_SLOT: howto manager. (line 1722) -* BFD_RELOC_390_PC12DBL: howto manager. (line 1730) -* BFD_RELOC_390_PC16DBL: howto manager. (line 1734) -* BFD_RELOC_390_PC24DBL: howto manager. (line 1738) -* BFD_RELOC_390_PC32DBL: howto manager. (line 1742) -* BFD_RELOC_390_PLT12DBL: howto manager. (line 1732) -* BFD_RELOC_390_PLT16DBL: howto manager. (line 1736) -* BFD_RELOC_390_PLT24DBL: howto manager. (line 1740) -* BFD_RELOC_390_PLT32: howto manager. (line 1716) -* BFD_RELOC_390_PLT32DBL: howto manager. (line 1744) -* BFD_RELOC_390_PLT64: howto manager. (line 1750) -* BFD_RELOC_390_PLTOFF16: howto manager. (line 1766) -* BFD_RELOC_390_PLTOFF32: howto manager. (line 1768) -* BFD_RELOC_390_PLTOFF64: howto manager. (line 1770) -* BFD_RELOC_390_RELATIVE: howto manager. (line 1724) -* BFD_RELOC_390_TLS_DTPMOD: howto manager. (line 1789) -* BFD_RELOC_390_TLS_DTPOFF: howto manager. (line 1790) -* BFD_RELOC_390_TLS_GD32: howto manager. (line 1775) -* BFD_RELOC_390_TLS_GD64: howto manager. (line 1776) -* BFD_RELOC_390_TLS_GDCALL: howto manager. (line 1773) -* BFD_RELOC_390_TLS_GOTIE12: howto manager. (line 1777) -* BFD_RELOC_390_TLS_GOTIE20: howto manager. (line 1796) -* BFD_RELOC_390_TLS_GOTIE32: howto manager. (line 1778) -* BFD_RELOC_390_TLS_GOTIE64: howto manager. (line 1779) -* BFD_RELOC_390_TLS_IE32: howto manager. (line 1782) -* BFD_RELOC_390_TLS_IE64: howto manager. (line 1783) -* BFD_RELOC_390_TLS_IEENT: howto manager. (line 1784) -* BFD_RELOC_390_TLS_LDCALL: howto manager. (line 1774) -* BFD_RELOC_390_TLS_LDM32: howto manager. (line 1780) -* BFD_RELOC_390_TLS_LDM64: howto manager. (line 1781) -* BFD_RELOC_390_TLS_LDO32: howto manager. (line 1787) -* BFD_RELOC_390_TLS_LDO64: howto manager. (line 1788) -* BFD_RELOC_390_TLS_LE32: howto manager. (line 1785) -* BFD_RELOC_390_TLS_LE64: howto manager. (line 1786) -* BFD_RELOC_390_TLS_LOAD: howto manager. (line 1772) -* BFD_RELOC_390_TLS_TPOFF: howto manager. (line 1791) +* BFD_RELOC_386_COPY: howto manager. (line 515) +* BFD_RELOC_386_GLOB_DAT: howto manager. (line 516) +* BFD_RELOC_386_GOT32: howto manager. (line 513) +* BFD_RELOC_386_GOTOFF: howto manager. (line 519) +* BFD_RELOC_386_GOTPC: howto manager. (line 520) +* BFD_RELOC_386_IRELATIVE: howto manager. (line 536) +* BFD_RELOC_386_JUMP_SLOT: howto manager. (line 517) +* BFD_RELOC_386_PLT32: howto manager. (line 514) +* BFD_RELOC_386_RELATIVE: howto manager. (line 518) +* BFD_RELOC_386_TLS_DESC: howto manager. (line 535) +* BFD_RELOC_386_TLS_DESC_CALL: howto manager. (line 534) +* BFD_RELOC_386_TLS_DTPMOD32: howto manager. (line 530) +* BFD_RELOC_386_TLS_DTPOFF32: howto manager. (line 531) +* BFD_RELOC_386_TLS_GD: howto manager. (line 525) +* BFD_RELOC_386_TLS_GOTDESC: howto manager. (line 533) +* BFD_RELOC_386_TLS_GOTIE: howto manager. (line 523) +* BFD_RELOC_386_TLS_IE: howto manager. (line 522) +* BFD_RELOC_386_TLS_IE_32: howto manager. (line 528) +* BFD_RELOC_386_TLS_LDM: howto manager. (line 526) +* BFD_RELOC_386_TLS_LDO_32: howto manager. (line 527) +* BFD_RELOC_386_TLS_LE: howto manager. (line 524) +* BFD_RELOC_386_TLS_LE_32: howto manager. (line 529) +* BFD_RELOC_386_TLS_TPOFF: howto manager. (line 521) +* BFD_RELOC_386_TLS_TPOFF32: howto manager. (line 532) +* BFD_RELOC_390_12: howto manager. (line 1750) +* BFD_RELOC_390_20: howto manager. (line 1831) +* BFD_RELOC_390_COPY: howto manager. (line 1756) +* BFD_RELOC_390_GLOB_DAT: howto manager. (line 1758) +* BFD_RELOC_390_GOT12: howto manager. (line 1752) +* BFD_RELOC_390_GOT16: howto manager. (line 1766) +* BFD_RELOC_390_GOT20: howto manager. (line 1832) +* BFD_RELOC_390_GOT64: howto manager. (line 1786) +* BFD_RELOC_390_GOTENT: howto manager. (line 1790) +* BFD_RELOC_390_GOTOFF64: howto manager. (line 1792) +* BFD_RELOC_390_GOTPC: howto manager. (line 1764) +* BFD_RELOC_390_GOTPCDBL: howto manager. (line 1784) +* BFD_RELOC_390_GOTPLT12: howto manager. (line 1794) +* BFD_RELOC_390_GOTPLT16: howto manager. (line 1796) +* BFD_RELOC_390_GOTPLT20: howto manager. (line 1833) +* BFD_RELOC_390_GOTPLT32: howto manager. (line 1798) +* BFD_RELOC_390_GOTPLT64: howto manager. (line 1800) +* BFD_RELOC_390_GOTPLTENT: howto manager. (line 1802) +* BFD_RELOC_390_IRELATIVE: howto manager. (line 1836) +* BFD_RELOC_390_JMP_SLOT: howto manager. (line 1760) +* BFD_RELOC_390_PC12DBL: howto manager. (line 1768) +* BFD_RELOC_390_PC16DBL: howto manager. (line 1772) +* BFD_RELOC_390_PC24DBL: howto manager. (line 1776) +* BFD_RELOC_390_PC32DBL: howto manager. (line 1780) +* BFD_RELOC_390_PLT12DBL: howto manager. (line 1770) +* BFD_RELOC_390_PLT16DBL: howto manager. (line 1774) +* BFD_RELOC_390_PLT24DBL: howto manager. (line 1778) +* BFD_RELOC_390_PLT32: howto manager. (line 1754) +* BFD_RELOC_390_PLT32DBL: howto manager. (line 1782) +* BFD_RELOC_390_PLT64: howto manager. (line 1788) +* BFD_RELOC_390_PLTOFF16: howto manager. (line 1804) +* BFD_RELOC_390_PLTOFF32: howto manager. (line 1806) +* BFD_RELOC_390_PLTOFF64: howto manager. (line 1808) +* BFD_RELOC_390_RELATIVE: howto manager. (line 1762) +* BFD_RELOC_390_TLS_DTPMOD: howto manager. (line 1827) +* BFD_RELOC_390_TLS_DTPOFF: howto manager. (line 1828) +* BFD_RELOC_390_TLS_GD32: howto manager. (line 1813) +* BFD_RELOC_390_TLS_GD64: howto manager. (line 1814) +* BFD_RELOC_390_TLS_GDCALL: howto manager. (line 1811) +* BFD_RELOC_390_TLS_GOTIE12: howto manager. (line 1815) +* BFD_RELOC_390_TLS_GOTIE20: howto manager. (line 1834) +* BFD_RELOC_390_TLS_GOTIE32: howto manager. (line 1816) +* BFD_RELOC_390_TLS_GOTIE64: howto manager. (line 1817) +* BFD_RELOC_390_TLS_IE32: howto manager. (line 1820) +* BFD_RELOC_390_TLS_IE64: howto manager. (line 1821) +* BFD_RELOC_390_TLS_IEENT: howto manager. (line 1822) +* BFD_RELOC_390_TLS_LDCALL: howto manager. (line 1812) +* BFD_RELOC_390_TLS_LDM32: howto manager. (line 1818) +* BFD_RELOC_390_TLS_LDM64: howto manager. (line 1819) +* BFD_RELOC_390_TLS_LDO32: howto manager. (line 1825) +* BFD_RELOC_390_TLS_LDO64: howto manager. (line 1826) +* BFD_RELOC_390_TLS_LE32: howto manager. (line 1823) +* BFD_RELOC_390_TLS_LE64: howto manager. (line 1824) +* BFD_RELOC_390_TLS_LOAD: howto manager. (line 1810) +* BFD_RELOC_390_TLS_TPOFF: howto manager. (line 1829) * BFD_RELOC_64: howto manager. (line 25) * BFD_RELOC_64_PCREL: howto manager. (line 33) * BFD_RELOC_64_PLTOFF: howto manager. (line 61) @@ -11158,38 +11198,38 @@ BFD Index * BFD_RELOC_68K_TLS_LE32: howto manager. (line 87) * BFD_RELOC_68K_TLS_LE8: howto manager. (line 89) * BFD_RELOC_8: howto manager. (line 31) -* BFD_RELOC_860_COPY: howto manager. (line 2163) -* BFD_RELOC_860_GLOB_DAT: howto manager. (line 2164) -* BFD_RELOC_860_HAGOT: howto manager. (line 2189) -* BFD_RELOC_860_HAGOTOFF: howto manager. (line 2190) -* BFD_RELOC_860_HAPC: howto manager. (line 2191) -* BFD_RELOC_860_HIGH: howto manager. (line 2192) -* BFD_RELOC_860_HIGHADJ: howto manager. (line 2188) -* BFD_RELOC_860_HIGOT: howto manager. (line 2193) -* BFD_RELOC_860_HIGOTOFF: howto manager. (line 2194) -* BFD_RELOC_860_JUMP_SLOT: howto manager. (line 2165) -* BFD_RELOC_860_LOGOT0: howto manager. (line 2177) -* BFD_RELOC_860_LOGOT1: howto manager. (line 2179) -* BFD_RELOC_860_LOGOTOFF0: howto manager. (line 2181) -* BFD_RELOC_860_LOGOTOFF1: howto manager. (line 2183) -* BFD_RELOC_860_LOGOTOFF2: howto manager. (line 2185) -* BFD_RELOC_860_LOGOTOFF3: howto manager. (line 2186) -* BFD_RELOC_860_LOPC: howto manager. (line 2187) -* BFD_RELOC_860_LOW0: howto manager. (line 2170) -* BFD_RELOC_860_LOW1: howto manager. (line 2172) -* BFD_RELOC_860_LOW2: howto manager. (line 2174) -* BFD_RELOC_860_LOW3: howto manager. (line 2176) -* BFD_RELOC_860_PC16: howto manager. (line 2169) -* BFD_RELOC_860_PC26: howto manager. (line 2167) -* BFD_RELOC_860_PLT26: howto manager. (line 2168) -* BFD_RELOC_860_RELATIVE: howto manager. (line 2166) -* BFD_RELOC_860_SPGOT0: howto manager. (line 2178) -* BFD_RELOC_860_SPGOT1: howto manager. (line 2180) -* BFD_RELOC_860_SPGOTOFF0: howto manager. (line 2182) -* BFD_RELOC_860_SPGOTOFF1: howto manager. (line 2184) -* BFD_RELOC_860_SPLIT0: howto manager. (line 2171) -* BFD_RELOC_860_SPLIT1: howto manager. (line 2173) -* BFD_RELOC_860_SPLIT2: howto manager. (line 2175) +* BFD_RELOC_860_COPY: howto manager. (line 2201) +* BFD_RELOC_860_GLOB_DAT: howto manager. (line 2202) +* BFD_RELOC_860_HAGOT: howto manager. (line 2227) +* BFD_RELOC_860_HAGOTOFF: howto manager. (line 2228) +* BFD_RELOC_860_HAPC: howto manager. (line 2229) +* BFD_RELOC_860_HIGH: howto manager. (line 2230) +* BFD_RELOC_860_HIGHADJ: howto manager. (line 2226) +* BFD_RELOC_860_HIGOT: howto manager. (line 2231) +* BFD_RELOC_860_HIGOTOFF: howto manager. (line 2232) +* BFD_RELOC_860_JUMP_SLOT: howto manager. (line 2203) +* BFD_RELOC_860_LOGOT0: howto manager. (line 2215) +* BFD_RELOC_860_LOGOT1: howto manager. (line 2217) +* BFD_RELOC_860_LOGOTOFF0: howto manager. (line 2219) +* BFD_RELOC_860_LOGOTOFF1: howto manager. (line 2221) +* BFD_RELOC_860_LOGOTOFF2: howto manager. (line 2223) +* BFD_RELOC_860_LOGOTOFF3: howto manager. (line 2224) +* BFD_RELOC_860_LOPC: howto manager. (line 2225) +* BFD_RELOC_860_LOW0: howto manager. (line 2208) +* BFD_RELOC_860_LOW1: howto manager. (line 2210) +* BFD_RELOC_860_LOW2: howto manager. (line 2212) +* BFD_RELOC_860_LOW3: howto manager. (line 2214) +* BFD_RELOC_860_PC16: howto manager. (line 2207) +* BFD_RELOC_860_PC26: howto manager. (line 2205) +* BFD_RELOC_860_PLT26: howto manager. (line 2206) +* BFD_RELOC_860_RELATIVE: howto manager. (line 2204) +* BFD_RELOC_860_SPGOT0: howto manager. (line 2216) +* BFD_RELOC_860_SPGOT1: howto manager. (line 2218) +* BFD_RELOC_860_SPGOTOFF0: howto manager. (line 2220) +* BFD_RELOC_860_SPGOTOFF1: howto manager. (line 2222) +* BFD_RELOC_860_SPLIT0: howto manager. (line 2209) +* BFD_RELOC_860_SPLIT1: howto manager. (line 2211) +* BFD_RELOC_860_SPLIT2: howto manager. (line 2213) * BFD_RELOC_8_BASEREL: howto manager. (line 96) * BFD_RELOC_8_FFnn: howto manager. (line 99) * BFD_RELOC_8_GOTOFF: howto manager. (line 55) @@ -11197,89 +11237,89 @@ BFD Index * BFD_RELOC_8_PCREL: howto manager. (line 38) * BFD_RELOC_8_PLTOFF: howto manager. (line 67) * BFD_RELOC_8_PLT_PCREL: howto manager. (line 60) -* BFD_RELOC_AARCH64_16: howto manager. (line 2517) -* BFD_RELOC_AARCH64_16_PCREL: howto manager. (line 2523) -* BFD_RELOC_AARCH64_32: howto manager. (line 2516) -* BFD_RELOC_AARCH64_32_PCREL: howto manager. (line 2522) -* BFD_RELOC_AARCH64_64: howto manager. (line 2515) -* BFD_RELOC_AARCH64_64_PCREL: howto manager. (line 2521) -* BFD_RELOC_AARCH64_ADD_LO12: howto manager. (line 2573) -* BFD_RELOC_AARCH64_ADR_GOT_PAGE: howto manager. (line 2619) -* BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL: howto manager. (line 2569) -* BFD_RELOC_AARCH64_ADR_HI21_PCREL: howto manager. (line 2566) -* BFD_RELOC_AARCH64_ADR_LO21_PCREL: howto manager. (line 2563) -* BFD_RELOC_AARCH64_BRANCH19: howto manager. (line 2585) -* BFD_RELOC_AARCH64_CALL26: howto manager. (line 2593) -* BFD_RELOC_AARCH64_COPY: howto manager. (line 2690) -* BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP: howto manager. (line 2714) -* BFD_RELOC_AARCH64_GLOB_DAT: howto manager. (line 2692) -* BFD_RELOC_AARCH64_GOT_LD_PREL19: howto manager. (line 2613) -* BFD_RELOC_AARCH64_IRELATIVE: howto manager. (line 2706) -* BFD_RELOC_AARCH64_JUMP26: howto manager. (line 2589) -* BFD_RELOC_AARCH64_JUMP_SLOT: howto manager. (line 2694) -* BFD_RELOC_AARCH64_LD32_GOT_LO12_NC: howto manager. (line 2627) -* BFD_RELOC_AARCH64_LD64_GOT_LO12_NC: howto manager. (line 2623) -* BFD_RELOC_AARCH64_LDST128_LO12: howto manager. (line 2609) -* BFD_RELOC_AARCH64_LDST16_LO12: howto manager. (line 2597) -* BFD_RELOC_AARCH64_LDST32_LO12: howto manager. (line 2601) -* BFD_RELOC_AARCH64_LDST64_LO12: howto manager. (line 2605) -* BFD_RELOC_AARCH64_LDST8_LO12: howto manager. (line 2577) -* BFD_RELOC_AARCH64_LDST_LO12: howto manager. (line 2717) -* BFD_RELOC_AARCH64_LD_GOT_LO12_NC: howto manager. (line 2721) -* BFD_RELOC_AARCH64_LD_LO19_PCREL: howto manager. (line 2559) -* BFD_RELOC_AARCH64_MOVW_G0: howto manager. (line 2526) -* BFD_RELOC_AARCH64_MOVW_G0_NC: howto manager. (line 2529) -* BFD_RELOC_AARCH64_MOVW_G0_S: howto manager. (line 2547) -* BFD_RELOC_AARCH64_MOVW_G1: howto manager. (line 2532) -* BFD_RELOC_AARCH64_MOVW_G1_NC: howto manager. (line 2535) -* BFD_RELOC_AARCH64_MOVW_G1_S: howto manager. (line 2551) -* BFD_RELOC_AARCH64_MOVW_G2: howto manager. (line 2538) -* BFD_RELOC_AARCH64_MOVW_G2_NC: howto manager. (line 2541) -* BFD_RELOC_AARCH64_MOVW_G2_S: howto manager. (line 2555) -* BFD_RELOC_AARCH64_MOVW_G3: howto manager. (line 2544) -* BFD_RELOC_AARCH64_NONE: howto manager. (line 2513) -* BFD_RELOC_AARCH64_RELATIVE: howto manager. (line 2696) -* BFD_RELOC_AARCH64_RELOC_END: howto manager. (line 2708) -* BFD_RELOC_AARCH64_RELOC_START: howto manager. (line 2508) -* BFD_RELOC_AARCH64_TLSDESC: howto manager. (line 2704) -* BFD_RELOC_AARCH64_TLSDESC_ADD: howto manager. (line 2686) -* BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC: howto manager. (line 2678) -* BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: howto manager. (line 2672) -* BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21: howto manager. (line 2670) -* BFD_RELOC_AARCH64_TLSDESC_CALL: howto manager. (line 2688) -* BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC: howto manager. (line 2676) -* BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC: howto manager. (line 2674) -* BFD_RELOC_AARCH64_TLSDESC_LDR: howto manager. (line 2684) -* BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC: howto manager. (line 2727) -* BFD_RELOC_AARCH64_TLSDESC_LD_PREL19: howto manager. (line 2668) -* BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: howto manager. (line 2682) -* BFD_RELOC_AARCH64_TLSDESC_OFF_G1: howto manager. (line 2680) -* BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: howto manager. (line 2636) -* BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: howto manager. (line 2631) +* BFD_RELOC_AARCH64_16: howto manager. (line 2555) +* BFD_RELOC_AARCH64_16_PCREL: howto manager. (line 2561) +* BFD_RELOC_AARCH64_32: howto manager. (line 2554) +* BFD_RELOC_AARCH64_32_PCREL: howto manager. (line 2560) +* BFD_RELOC_AARCH64_64: howto manager. (line 2553) +* BFD_RELOC_AARCH64_64_PCREL: howto manager. (line 2559) +* BFD_RELOC_AARCH64_ADD_LO12: howto manager. (line 2611) +* BFD_RELOC_AARCH64_ADR_GOT_PAGE: howto manager. (line 2657) +* BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL: howto manager. (line 2607) +* BFD_RELOC_AARCH64_ADR_HI21_PCREL: howto manager. (line 2604) +* BFD_RELOC_AARCH64_ADR_LO21_PCREL: howto manager. (line 2601) +* BFD_RELOC_AARCH64_BRANCH19: howto manager. (line 2623) +* BFD_RELOC_AARCH64_CALL26: howto manager. (line 2631) +* BFD_RELOC_AARCH64_COPY: howto manager. (line 2728) +* BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP: howto manager. (line 2752) +* BFD_RELOC_AARCH64_GLOB_DAT: howto manager. (line 2730) +* BFD_RELOC_AARCH64_GOT_LD_PREL19: howto manager. (line 2651) +* BFD_RELOC_AARCH64_IRELATIVE: howto manager. (line 2744) +* BFD_RELOC_AARCH64_JUMP26: howto manager. (line 2627) +* BFD_RELOC_AARCH64_JUMP_SLOT: howto manager. (line 2732) +* BFD_RELOC_AARCH64_LD32_GOT_LO12_NC: howto manager. (line 2665) +* BFD_RELOC_AARCH64_LD64_GOT_LO12_NC: howto manager. (line 2661) +* BFD_RELOC_AARCH64_LDST128_LO12: howto manager. (line 2647) +* BFD_RELOC_AARCH64_LDST16_LO12: howto manager. (line 2635) +* BFD_RELOC_AARCH64_LDST32_LO12: howto manager. (line 2639) +* BFD_RELOC_AARCH64_LDST64_LO12: howto manager. (line 2643) +* BFD_RELOC_AARCH64_LDST8_LO12: howto manager. (line 2615) +* BFD_RELOC_AARCH64_LDST_LO12: howto manager. (line 2755) +* BFD_RELOC_AARCH64_LD_GOT_LO12_NC: howto manager. (line 2759) +* BFD_RELOC_AARCH64_LD_LO19_PCREL: howto manager. (line 2597) +* BFD_RELOC_AARCH64_MOVW_G0: howto manager. (line 2564) +* BFD_RELOC_AARCH64_MOVW_G0_NC: howto manager. (line 2567) +* BFD_RELOC_AARCH64_MOVW_G0_S: howto manager. (line 2585) +* BFD_RELOC_AARCH64_MOVW_G1: howto manager. (line 2570) +* BFD_RELOC_AARCH64_MOVW_G1_NC: howto manager. (line 2573) +* BFD_RELOC_AARCH64_MOVW_G1_S: howto manager. (line 2589) +* BFD_RELOC_AARCH64_MOVW_G2: howto manager. (line 2576) +* BFD_RELOC_AARCH64_MOVW_G2_NC: howto manager. (line 2579) +* BFD_RELOC_AARCH64_MOVW_G2_S: howto manager. (line 2593) +* BFD_RELOC_AARCH64_MOVW_G3: howto manager. (line 2582) +* BFD_RELOC_AARCH64_NONE: howto manager. (line 2551) +* BFD_RELOC_AARCH64_RELATIVE: howto manager. (line 2734) +* BFD_RELOC_AARCH64_RELOC_END: howto manager. (line 2746) +* BFD_RELOC_AARCH64_RELOC_START: howto manager. (line 2546) +* BFD_RELOC_AARCH64_TLSDESC: howto manager. (line 2742) +* BFD_RELOC_AARCH64_TLSDESC_ADD: howto manager. (line 2724) +* BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC: howto manager. (line 2716) +* BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: howto manager. (line 2710) +* BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21: howto manager. (line 2708) +* BFD_RELOC_AARCH64_TLSDESC_CALL: howto manager. (line 2726) +* BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC: howto manager. (line 2714) +* BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC: howto manager. (line 2712) +* BFD_RELOC_AARCH64_TLSDESC_LDR: howto manager. (line 2722) +* BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC: howto manager. (line 2765) +* BFD_RELOC_AARCH64_TLSDESC_LD_PREL19: howto manager. (line 2706) +* BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: howto manager. (line 2720) +* BFD_RELOC_AARCH64_TLSDESC_OFF_G1: howto manager. (line 2718) +* BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: howto manager. (line 2674) +* BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: howto manager. (line 2669) * BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: howto manager. - (line 2644) + (line 2682) * BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC: howto manager. - (line 2648) + (line 2686) * BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: howto manager. - (line 2646) + (line 2684) * BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC: howto manager. - (line 2724) -* BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: howto manager. (line 2650) + (line 2762) +* BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19: howto manager. (line 2688) * BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: howto manager. - (line 2642) -* BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: howto manager. (line 2640) -* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12: howto manager. (line 2662) -* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12: howto manager. (line 2664) -* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC: howto manager. (line 2666) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: howto manager. (line 2658) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC: howto manager. (line 2660) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1: howto manager. (line 2654) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC: howto manager. (line 2656) -* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2: howto manager. (line 2652) -* BFD_RELOC_AARCH64_TLS_DTPMOD: howto manager. (line 2698) -* BFD_RELOC_AARCH64_TLS_DTPREL: howto manager. (line 2700) -* BFD_RELOC_AARCH64_TLS_TPREL: howto manager. (line 2702) -* BFD_RELOC_AARCH64_TSTBR14: howto manager. (line 2581) + (line 2680) +* BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: howto manager. (line 2678) +* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12: howto manager. (line 2700) +* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12: howto manager. (line 2702) +* BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC: howto manager. (line 2704) +* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: howto manager. (line 2696) +* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC: howto manager. (line 2698) +* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1: howto manager. (line 2692) +* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC: howto manager. (line 2694) +* BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2: howto manager. (line 2690) +* BFD_RELOC_AARCH64_TLS_DTPMOD: howto manager. (line 2736) +* BFD_RELOC_AARCH64_TLS_DTPREL: howto manager. (line 2738) +* BFD_RELOC_AARCH64_TLS_TPREL: howto manager. (line 2740) +* BFD_RELOC_AARCH64_TSTBR14: howto manager. (line 2619) * BFD_RELOC_ALPHA_BOH: howto manager. (line 292) * BFD_RELOC_ALPHA_BRSGP: howto manager. (line 279) * BFD_RELOC_ALPHA_BSR: howto manager. (line 286) @@ -11309,359 +11349,362 @@ BFD Index * BFD_RELOC_ALPHA_TPREL64: howto manager. (line 304) * BFD_RELOC_ALPHA_TPREL_HI16: howto manager. (line 305) * BFD_RELOC_ALPHA_TPREL_LO16: howto manager. (line 306) -* BFD_RELOC_ARC_B22_PCREL: howto manager. (line 953) -* BFD_RELOC_ARC_B26: howto manager. (line 957) -* BFD_RELOC_ARM_ADRL_IMMEDIATE: howto manager. (line 827) -* BFD_RELOC_ARM_ADR_IMM: howto manager. (line 841) -* BFD_RELOC_ARM_ALU_PC_G0: howto manager. (line 794) -* BFD_RELOC_ARM_ALU_PC_G0_NC: howto manager. (line 793) -* BFD_RELOC_ARM_ALU_PC_G1: howto manager. (line 796) -* BFD_RELOC_ARM_ALU_PC_G1_NC: howto manager. (line 795) -* BFD_RELOC_ARM_ALU_PC_G2: howto manager. (line 797) -* BFD_RELOC_ARM_ALU_SB_G0: howto manager. (line 808) -* BFD_RELOC_ARM_ALU_SB_G0_NC: howto manager. (line 807) -* BFD_RELOC_ARM_ALU_SB_G1: howto manager. (line 810) -* BFD_RELOC_ARM_ALU_SB_G1_NC: howto manager. (line 809) -* BFD_RELOC_ARM_ALU_SB_G2: howto manager. (line 811) -* BFD_RELOC_ARM_CP_OFF_IMM: howto manager. (line 837) -* BFD_RELOC_ARM_CP_OFF_IMM_S2: howto manager. (line 838) -* BFD_RELOC_ARM_GLOB_DAT: howto manager. (line 770) -* BFD_RELOC_ARM_GOT32: howto manager. (line 771) -* BFD_RELOC_ARM_GOTOFF: howto manager. (line 774) -* BFD_RELOC_ARM_GOTPC: howto manager. (line 775) -* BFD_RELOC_ARM_GOT_PREL: howto manager. (line 776) -* BFD_RELOC_ARM_HVC: howto manager. (line 834) -* BFD_RELOC_ARM_HWLITERAL: howto manager. (line 848) -* BFD_RELOC_ARM_IMMEDIATE: howto manager. (line 826) -* BFD_RELOC_ARM_IN_POOL: howto manager. (line 844) -* BFD_RELOC_ARM_IRELATIVE: howto manager. (line 824) -* BFD_RELOC_ARM_JUMP_SLOT: howto manager. (line 769) -* BFD_RELOC_ARM_LDC_PC_G0: howto manager. (line 804) -* BFD_RELOC_ARM_LDC_PC_G1: howto manager. (line 805) -* BFD_RELOC_ARM_LDC_PC_G2: howto manager. (line 806) -* BFD_RELOC_ARM_LDC_SB_G0: howto manager. (line 818) -* BFD_RELOC_ARM_LDC_SB_G1: howto manager. (line 819) -* BFD_RELOC_ARM_LDC_SB_G2: howto manager. (line 820) -* BFD_RELOC_ARM_LDRS_PC_G0: howto manager. (line 801) -* BFD_RELOC_ARM_LDRS_PC_G1: howto manager. (line 802) -* BFD_RELOC_ARM_LDRS_PC_G2: howto manager. (line 803) -* BFD_RELOC_ARM_LDRS_SB_G0: howto manager. (line 815) -* BFD_RELOC_ARM_LDRS_SB_G1: howto manager. (line 816) -* BFD_RELOC_ARM_LDRS_SB_G2: howto manager. (line 817) -* BFD_RELOC_ARM_LDR_IMM: howto manager. (line 842) -* BFD_RELOC_ARM_LDR_PC_G0: howto manager. (line 798) -* BFD_RELOC_ARM_LDR_PC_G1: howto manager. (line 799) -* BFD_RELOC_ARM_LDR_PC_G2: howto manager. (line 800) -* BFD_RELOC_ARM_LDR_SB_G0: howto manager. (line 812) -* BFD_RELOC_ARM_LDR_SB_G1: howto manager. (line 813) -* BFD_RELOC_ARM_LDR_SB_G2: howto manager. (line 814) -* BFD_RELOC_ARM_LITERAL: howto manager. (line 843) -* BFD_RELOC_ARM_MOVT: howto manager. (line 761) -* BFD_RELOC_ARM_MOVT_PCREL: howto manager. (line 763) -* BFD_RELOC_ARM_MOVW: howto manager. (line 760) -* BFD_RELOC_ARM_MOVW_PCREL: howto manager. (line 762) -* BFD_RELOC_ARM_MULTI: howto manager. (line 836) -* BFD_RELOC_ARM_OFFSET_IMM: howto manager. (line 741) -* BFD_RELOC_ARM_OFFSET_IMM8: howto manager. (line 845) -* BFD_RELOC_ARM_PCREL_BLX: howto manager. (line 717) -* BFD_RELOC_ARM_PCREL_BRANCH: howto manager. (line 714) -* BFD_RELOC_ARM_PCREL_CALL: howto manager. (line 725) -* BFD_RELOC_ARM_PCREL_JUMP: howto manager. (line 728) -* BFD_RELOC_ARM_PLT32: howto manager. (line 772) -* BFD_RELOC_ARM_PREL31: howto manager. (line 758) -* BFD_RELOC_ARM_RELATIVE: howto manager. (line 773) -* BFD_RELOC_ARM_ROSEGREL32: howto manager. (line 750) -* BFD_RELOC_ARM_SBREL32: howto manager. (line 752) -* BFD_RELOC_ARM_SHIFT_IMM: howto manager. (line 832) -* BFD_RELOC_ARM_SMC: howto manager. (line 833) -* BFD_RELOC_ARM_SWI: howto manager. (line 835) -* BFD_RELOC_ARM_T32_ADD_IMM: howto manager. (line 829) -* BFD_RELOC_ARM_T32_ADD_PC12: howto manager. (line 831) -* BFD_RELOC_ARM_T32_CP_OFF_IMM: howto manager. (line 839) -* BFD_RELOC_ARM_T32_CP_OFF_IMM_S2: howto manager. (line 840) -* BFD_RELOC_ARM_T32_IMM12: howto manager. (line 830) -* BFD_RELOC_ARM_T32_IMMEDIATE: howto manager. (line 828) -* BFD_RELOC_ARM_T32_OFFSET_IMM: howto manager. (line 847) -* BFD_RELOC_ARM_T32_OFFSET_U8: howto manager. (line 846) -* BFD_RELOC_ARM_TARGET1: howto manager. (line 747) -* BFD_RELOC_ARM_TARGET2: howto manager. (line 754) -* BFD_RELOC_ARM_THM_TLS_CALL: howto manager. (line 788) -* BFD_RELOC_ARM_THM_TLS_DESCSEQ: howto manager. (line 790) -* BFD_RELOC_ARM_THUMB_ADD: howto manager. (line 849) -* BFD_RELOC_ARM_THUMB_IMM: howto manager. (line 850) -* BFD_RELOC_ARM_THUMB_MOVT: howto manager. (line 765) -* BFD_RELOC_ARM_THUMB_MOVT_PCREL: howto manager. (line 767) -* BFD_RELOC_ARM_THUMB_MOVW: howto manager. (line 764) -* BFD_RELOC_ARM_THUMB_MOVW_PCREL: howto manager. (line 766) -* BFD_RELOC_ARM_THUMB_OFFSET: howto manager. (line 744) -* BFD_RELOC_ARM_THUMB_SHIFT: howto manager. (line 851) -* BFD_RELOC_ARM_TLS_CALL: howto manager. (line 787) -* BFD_RELOC_ARM_TLS_DESC: howto manager. (line 791) -* BFD_RELOC_ARM_TLS_DESCSEQ: howto manager. (line 789) -* BFD_RELOC_ARM_TLS_DTPMOD32: howto manager. (line 782) -* BFD_RELOC_ARM_TLS_DTPOFF32: howto manager. (line 781) -* BFD_RELOC_ARM_TLS_GD32: howto manager. (line 778) -* BFD_RELOC_ARM_TLS_GOTDESC: howto manager. (line 786) -* BFD_RELOC_ARM_TLS_IE32: howto manager. (line 784) -* BFD_RELOC_ARM_TLS_LDM32: howto manager. (line 780) -* BFD_RELOC_ARM_TLS_LDO32: howto manager. (line 779) -* BFD_RELOC_ARM_TLS_LE32: howto manager. (line 785) -* BFD_RELOC_ARM_TLS_TPOFF32: howto manager. (line 783) -* BFD_RELOC_ARM_V4BX: howto manager. (line 822) -* BFD_RELOC_AVR_13_PCREL: howto manager. (line 1555) -* BFD_RELOC_AVR_16_PM: howto manager. (line 1558) -* BFD_RELOC_AVR_6: howto manager. (line 1626) -* BFD_RELOC_AVR_6_ADIW: howto manager. (line 1629) -* BFD_RELOC_AVR_7_PCREL: howto manager. (line 1552) -* BFD_RELOC_AVR_8_HI: howto manager. (line 1635) -* BFD_RELOC_AVR_8_HLO: howto manager. (line 1638) -* BFD_RELOC_AVR_8_LO: howto manager. (line 1632) -* BFD_RELOC_AVR_CALL: howto manager. (line 1620) -* BFD_RELOC_AVR_DIFF16: howto manager. (line 1642) -* BFD_RELOC_AVR_DIFF32: howto manager. (line 1643) -* BFD_RELOC_AVR_DIFF8: howto manager. (line 1641) -* BFD_RELOC_AVR_HH8_LDI: howto manager. (line 1567) -* BFD_RELOC_AVR_HH8_LDI_NEG: howto manager. (line 1582) -* BFD_RELOC_AVR_HH8_LDI_PM: howto manager. (line 1605) -* BFD_RELOC_AVR_HH8_LDI_PM_NEG: howto manager. (line 1616) -* BFD_RELOC_AVR_HI8_LDI: howto manager. (line 1564) -* BFD_RELOC_AVR_HI8_LDI_GS: howto manager. (line 1600) -* BFD_RELOC_AVR_HI8_LDI_NEG: howto manager. (line 1578) -* BFD_RELOC_AVR_HI8_LDI_PM: howto manager. (line 1597) -* BFD_RELOC_AVR_HI8_LDI_PM_NEG: howto manager. (line 1612) -* BFD_RELOC_AVR_LDI: howto manager. (line 1623) -* BFD_RELOC_AVR_LO8_LDI: howto manager. (line 1561) -* BFD_RELOC_AVR_LO8_LDI_GS: howto manager. (line 1592) -* BFD_RELOC_AVR_LO8_LDI_NEG: howto manager. (line 1574) -* BFD_RELOC_AVR_LO8_LDI_PM: howto manager. (line 1589) -* BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. (line 1609) -* BFD_RELOC_AVR_MS8_LDI: howto manager. (line 1571) -* BFD_RELOC_AVR_MS8_LDI_NEG: howto manager. (line 1586) -* BFD_RELOC_BFIN_10_PCREL: howto manager. (line 971) -* BFD_RELOC_BFIN_11_PCREL: howto manager. (line 973) -* BFD_RELOC_BFIN_12_PCREL_JUMP: howto manager. (line 975) -* BFD_RELOC_BFIN_12_PCREL_JUMP_S: howto manager. (line 977) -* BFD_RELOC_BFIN_16_HIGH: howto manager. (line 963) -* BFD_RELOC_BFIN_16_IMM: howto manager. (line 961) -* BFD_RELOC_BFIN_16_LOW: howto manager. (line 969) -* BFD_RELOC_BFIN_24_PCREL_CALL_X: howto manager. (line 979) -* BFD_RELOC_BFIN_24_PCREL_JUMP_L: howto manager. (line 981) -* BFD_RELOC_BFIN_4_PCREL: howto manager. (line 965) -* BFD_RELOC_BFIN_5_PCREL: howto manager. (line 967) -* BFD_RELOC_BFIN_FUNCDESC: howto manager. (line 986) -* BFD_RELOC_BFIN_FUNCDESC_GOT17M4: howto manager. (line 987) -* BFD_RELOC_BFIN_FUNCDESC_GOTHI: howto manager. (line 988) -* BFD_RELOC_BFIN_FUNCDESC_GOTLO: howto manager. (line 989) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4: howto manager. (line 991) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI: howto manager. (line 992) -* BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO: howto manager. (line 993) -* BFD_RELOC_BFIN_FUNCDESC_VALUE: howto manager. (line 990) -* BFD_RELOC_BFIN_GOT: howto manager. (line 998) -* BFD_RELOC_BFIN_GOT17M4: howto manager. (line 983) -* BFD_RELOC_BFIN_GOTHI: howto manager. (line 984) -* BFD_RELOC_BFIN_GOTLO: howto manager. (line 985) -* BFD_RELOC_BFIN_GOTOFF17M4: howto manager. (line 994) -* BFD_RELOC_BFIN_GOTOFFHI: howto manager. (line 995) -* BFD_RELOC_BFIN_GOTOFFLO: howto manager. (line 996) -* BFD_RELOC_BFIN_PLTPC: howto manager. (line 1000) -* BFD_RELOC_C6000_ABS_H16: howto manager. (line 1397) -* BFD_RELOC_C6000_ABS_L16: howto manager. (line 1396) -* BFD_RELOC_C6000_ABS_S16: howto manager. (line 1395) -* BFD_RELOC_C6000_ALIGN: howto manager. (line 1418) -* BFD_RELOC_C6000_COPY: howto manager. (line 1413) -* BFD_RELOC_C6000_DSBT_INDEX: howto manager. (line 1411) -* BFD_RELOC_C6000_EHTYPE: howto manager. (line 1415) -* BFD_RELOC_C6000_FPHEAD: howto manager. (line 1419) -* BFD_RELOC_C6000_JUMP_SLOT: howto manager. (line 1414) -* BFD_RELOC_C6000_NOCMP: howto manager. (line 1420) -* BFD_RELOC_C6000_PCR_H16: howto manager. (line 1416) -* BFD_RELOC_C6000_PCR_L16: howto manager. (line 1417) -* BFD_RELOC_C6000_PCR_S10: howto manager. (line 1393) -* BFD_RELOC_C6000_PCR_S12: howto manager. (line 1392) -* BFD_RELOC_C6000_PCR_S21: howto manager. (line 1391) -* BFD_RELOC_C6000_PCR_S7: howto manager. (line 1394) -* BFD_RELOC_C6000_PREL31: howto manager. (line 1412) -* BFD_RELOC_C6000_SBR_GOT_H16_W: howto manager. (line 1410) -* BFD_RELOC_C6000_SBR_GOT_L16_W: howto manager. (line 1409) -* BFD_RELOC_C6000_SBR_GOT_U15_W: howto manager. (line 1408) -* BFD_RELOC_C6000_SBR_H16_B: howto manager. (line 1405) -* BFD_RELOC_C6000_SBR_H16_H: howto manager. (line 1406) -* BFD_RELOC_C6000_SBR_H16_W: howto manager. (line 1407) -* BFD_RELOC_C6000_SBR_L16_B: howto manager. (line 1402) -* BFD_RELOC_C6000_SBR_L16_H: howto manager. (line 1403) -* BFD_RELOC_C6000_SBR_L16_W: howto manager. (line 1404) -* BFD_RELOC_C6000_SBR_S16: howto manager. (line 1401) -* BFD_RELOC_C6000_SBR_U15_B: howto manager. (line 1398) -* BFD_RELOC_C6000_SBR_U15_H: howto manager. (line 1399) -* BFD_RELOC_C6000_SBR_U15_W: howto manager. (line 1400) +* BFD_RELOC_ARC_B22_PCREL: howto manager. (line 958) +* BFD_RELOC_ARC_B26: howto manager. (line 962) +* BFD_RELOC_ARM_ADRL_IMMEDIATE: howto manager. (line 832) +* BFD_RELOC_ARM_ADR_IMM: howto manager. (line 846) +* BFD_RELOC_ARM_ALU_PC_G0: howto manager. (line 799) +* BFD_RELOC_ARM_ALU_PC_G0_NC: howto manager. (line 798) +* BFD_RELOC_ARM_ALU_PC_G1: howto manager. (line 801) +* BFD_RELOC_ARM_ALU_PC_G1_NC: howto manager. (line 800) +* BFD_RELOC_ARM_ALU_PC_G2: howto manager. (line 802) +* BFD_RELOC_ARM_ALU_SB_G0: howto manager. (line 813) +* BFD_RELOC_ARM_ALU_SB_G0_NC: howto manager. (line 812) +* BFD_RELOC_ARM_ALU_SB_G1: howto manager. (line 815) +* BFD_RELOC_ARM_ALU_SB_G1_NC: howto manager. (line 814) +* BFD_RELOC_ARM_ALU_SB_G2: howto manager. (line 816) +* BFD_RELOC_ARM_CP_OFF_IMM: howto manager. (line 842) +* BFD_RELOC_ARM_CP_OFF_IMM_S2: howto manager. (line 843) +* BFD_RELOC_ARM_GLOB_DAT: howto manager. (line 775) +* BFD_RELOC_ARM_GOT32: howto manager. (line 776) +* BFD_RELOC_ARM_GOTOFF: howto manager. (line 779) +* BFD_RELOC_ARM_GOTPC: howto manager. (line 780) +* BFD_RELOC_ARM_GOT_PREL: howto manager. (line 781) +* BFD_RELOC_ARM_HVC: howto manager. (line 839) +* BFD_RELOC_ARM_HWLITERAL: howto manager. (line 853) +* BFD_RELOC_ARM_IMMEDIATE: howto manager. (line 831) +* BFD_RELOC_ARM_IN_POOL: howto manager. (line 849) +* BFD_RELOC_ARM_IRELATIVE: howto manager. (line 829) +* BFD_RELOC_ARM_JUMP_SLOT: howto manager. (line 774) +* BFD_RELOC_ARM_LDC_PC_G0: howto manager. (line 809) +* BFD_RELOC_ARM_LDC_PC_G1: howto manager. (line 810) +* BFD_RELOC_ARM_LDC_PC_G2: howto manager. (line 811) +* BFD_RELOC_ARM_LDC_SB_G0: howto manager. (line 823) +* BFD_RELOC_ARM_LDC_SB_G1: howto manager. (line 824) +* BFD_RELOC_ARM_LDC_SB_G2: howto manager. (line 825) +* BFD_RELOC_ARM_LDRS_PC_G0: howto manager. (line 806) +* BFD_RELOC_ARM_LDRS_PC_G1: howto manager. (line 807) +* BFD_RELOC_ARM_LDRS_PC_G2: howto manager. (line 808) +* BFD_RELOC_ARM_LDRS_SB_G0: howto manager. (line 820) +* BFD_RELOC_ARM_LDRS_SB_G1: howto manager. (line 821) +* BFD_RELOC_ARM_LDRS_SB_G2: howto manager. (line 822) +* BFD_RELOC_ARM_LDR_IMM: howto manager. (line 847) +* BFD_RELOC_ARM_LDR_PC_G0: howto manager. (line 803) +* BFD_RELOC_ARM_LDR_PC_G1: howto manager. (line 804) +* BFD_RELOC_ARM_LDR_PC_G2: howto manager. (line 805) +* BFD_RELOC_ARM_LDR_SB_G0: howto manager. (line 817) +* BFD_RELOC_ARM_LDR_SB_G1: howto manager. (line 818) +* BFD_RELOC_ARM_LDR_SB_G2: howto manager. (line 819) +* BFD_RELOC_ARM_LITERAL: howto manager. (line 848) +* BFD_RELOC_ARM_MOVT: howto manager. (line 766) +* BFD_RELOC_ARM_MOVT_PCREL: howto manager. (line 768) +* BFD_RELOC_ARM_MOVW: howto manager. (line 765) +* BFD_RELOC_ARM_MOVW_PCREL: howto manager. (line 767) +* BFD_RELOC_ARM_MULTI: howto manager. (line 841) +* BFD_RELOC_ARM_OFFSET_IMM: howto manager. (line 746) +* BFD_RELOC_ARM_OFFSET_IMM8: howto manager. (line 850) +* BFD_RELOC_ARM_PCREL_BLX: howto manager. (line 722) +* BFD_RELOC_ARM_PCREL_BRANCH: howto manager. (line 719) +* BFD_RELOC_ARM_PCREL_CALL: howto manager. (line 730) +* BFD_RELOC_ARM_PCREL_JUMP: howto manager. (line 733) +* BFD_RELOC_ARM_PLT32: howto manager. (line 777) +* BFD_RELOC_ARM_PREL31: howto manager. (line 763) +* BFD_RELOC_ARM_RELATIVE: howto manager. (line 778) +* BFD_RELOC_ARM_ROSEGREL32: howto manager. (line 755) +* BFD_RELOC_ARM_SBREL32: howto manager. (line 757) +* BFD_RELOC_ARM_SHIFT_IMM: howto manager. (line 837) +* BFD_RELOC_ARM_SMC: howto manager. (line 838) +* BFD_RELOC_ARM_SWI: howto manager. (line 840) +* BFD_RELOC_ARM_T32_ADD_IMM: howto manager. (line 834) +* BFD_RELOC_ARM_T32_ADD_PC12: howto manager. (line 836) +* BFD_RELOC_ARM_T32_CP_OFF_IMM: howto manager. (line 844) +* BFD_RELOC_ARM_T32_CP_OFF_IMM_S2: howto manager. (line 845) +* BFD_RELOC_ARM_T32_IMM12: howto manager. (line 835) +* BFD_RELOC_ARM_T32_IMMEDIATE: howto manager. (line 833) +* BFD_RELOC_ARM_T32_OFFSET_IMM: howto manager. (line 852) +* BFD_RELOC_ARM_T32_OFFSET_U8: howto manager. (line 851) +* BFD_RELOC_ARM_TARGET1: howto manager. (line 752) +* BFD_RELOC_ARM_TARGET2: howto manager. (line 759) +* BFD_RELOC_ARM_THM_TLS_CALL: howto manager. (line 793) +* BFD_RELOC_ARM_THM_TLS_DESCSEQ: howto manager. (line 795) +* BFD_RELOC_ARM_THUMB_ADD: howto manager. (line 854) +* BFD_RELOC_ARM_THUMB_IMM: howto manager. (line 855) +* BFD_RELOC_ARM_THUMB_MOVT: howto manager. (line 770) +* BFD_RELOC_ARM_THUMB_MOVT_PCREL: howto manager. (line 772) +* BFD_RELOC_ARM_THUMB_MOVW: howto manager. (line 769) +* BFD_RELOC_ARM_THUMB_MOVW_PCREL: howto manager. (line 771) +* BFD_RELOC_ARM_THUMB_OFFSET: howto manager. (line 749) +* BFD_RELOC_ARM_THUMB_SHIFT: howto manager. (line 856) +* BFD_RELOC_ARM_TLS_CALL: howto manager. (line 792) +* BFD_RELOC_ARM_TLS_DESC: howto manager. (line 796) +* BFD_RELOC_ARM_TLS_DESCSEQ: howto manager. (line 794) +* BFD_RELOC_ARM_TLS_DTPMOD32: howto manager. (line 787) +* BFD_RELOC_ARM_TLS_DTPOFF32: howto manager. (line 786) +* BFD_RELOC_ARM_TLS_GD32: howto manager. (line 783) +* BFD_RELOC_ARM_TLS_GOTDESC: howto manager. (line 791) +* BFD_RELOC_ARM_TLS_IE32: howto manager. (line 789) +* BFD_RELOC_ARM_TLS_LDM32: howto manager. (line 785) +* BFD_RELOC_ARM_TLS_LDO32: howto manager. (line 784) +* BFD_RELOC_ARM_TLS_LE32: howto manager. (line 790) +* BFD_RELOC_ARM_TLS_TPOFF32: howto manager. (line 788) +* BFD_RELOC_ARM_V4BX: howto manager. (line 827) +* BFD_RELOC_AVR_13_PCREL: howto manager. (line 1584) +* BFD_RELOC_AVR_16_PM: howto manager. (line 1587) +* BFD_RELOC_AVR_6: howto manager. (line 1655) +* BFD_RELOC_AVR_6_ADIW: howto manager. (line 1658) +* BFD_RELOC_AVR_7_PCREL: howto manager. (line 1581) +* BFD_RELOC_AVR_8_HI: howto manager. (line 1664) +* BFD_RELOC_AVR_8_HLO: howto manager. (line 1667) +* BFD_RELOC_AVR_8_LO: howto manager. (line 1661) +* BFD_RELOC_AVR_CALL: howto manager. (line 1649) +* BFD_RELOC_AVR_DIFF16: howto manager. (line 1671) +* BFD_RELOC_AVR_DIFF32: howto manager. (line 1672) +* BFD_RELOC_AVR_DIFF8: howto manager. (line 1670) +* BFD_RELOC_AVR_HH8_LDI: howto manager. (line 1596) +* BFD_RELOC_AVR_HH8_LDI_NEG: howto manager. (line 1611) +* BFD_RELOC_AVR_HH8_LDI_PM: howto manager. (line 1634) +* BFD_RELOC_AVR_HH8_LDI_PM_NEG: howto manager. (line 1645) +* BFD_RELOC_AVR_HI8_LDI: howto manager. (line 1593) +* BFD_RELOC_AVR_HI8_LDI_GS: howto manager. (line 1629) +* BFD_RELOC_AVR_HI8_LDI_NEG: howto manager. (line 1607) +* BFD_RELOC_AVR_HI8_LDI_PM: howto manager. (line 1626) +* BFD_RELOC_AVR_HI8_LDI_PM_NEG: howto manager. (line 1641) +* BFD_RELOC_AVR_LDI: howto manager. (line 1652) +* BFD_RELOC_AVR_LDS_STS_16: howto manager. (line 1679) +* BFD_RELOC_AVR_LO8_LDI: howto manager. (line 1590) +* BFD_RELOC_AVR_LO8_LDI_GS: howto manager. (line 1621) +* BFD_RELOC_AVR_LO8_LDI_NEG: howto manager. (line 1603) +* BFD_RELOC_AVR_LO8_LDI_PM: howto manager. (line 1618) +* BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. (line 1638) +* BFD_RELOC_AVR_MS8_LDI: howto manager. (line 1600) +* BFD_RELOC_AVR_MS8_LDI_NEG: howto manager. (line 1615) +* BFD_RELOC_AVR_PORT5: howto manager. (line 1685) +* BFD_RELOC_AVR_PORT6: howto manager. (line 1682) +* BFD_RELOC_BFIN_10_PCREL: howto manager. (line 976) +* BFD_RELOC_BFIN_11_PCREL: howto manager. (line 978) +* BFD_RELOC_BFIN_12_PCREL_JUMP: howto manager. (line 980) +* BFD_RELOC_BFIN_12_PCREL_JUMP_S: howto manager. (line 982) +* BFD_RELOC_BFIN_16_HIGH: howto manager. (line 968) +* BFD_RELOC_BFIN_16_IMM: howto manager. (line 966) +* BFD_RELOC_BFIN_16_LOW: howto manager. (line 974) +* BFD_RELOC_BFIN_24_PCREL_CALL_X: howto manager. (line 984) +* BFD_RELOC_BFIN_24_PCREL_JUMP_L: howto manager. (line 986) +* BFD_RELOC_BFIN_4_PCREL: howto manager. (line 970) +* BFD_RELOC_BFIN_5_PCREL: howto manager. (line 972) +* BFD_RELOC_BFIN_FUNCDESC: howto manager. (line 991) +* BFD_RELOC_BFIN_FUNCDESC_GOT17M4: howto manager. (line 992) +* BFD_RELOC_BFIN_FUNCDESC_GOTHI: howto manager. (line 993) +* BFD_RELOC_BFIN_FUNCDESC_GOTLO: howto manager. (line 994) +* BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4: howto manager. (line 996) +* BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI: howto manager. (line 997) +* BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO: howto manager. (line 998) +* BFD_RELOC_BFIN_FUNCDESC_VALUE: howto manager. (line 995) +* BFD_RELOC_BFIN_GOT: howto manager. (line 1003) +* BFD_RELOC_BFIN_GOT17M4: howto manager. (line 988) +* BFD_RELOC_BFIN_GOTHI: howto manager. (line 989) +* BFD_RELOC_BFIN_GOTLO: howto manager. (line 990) +* BFD_RELOC_BFIN_GOTOFF17M4: howto manager. (line 999) +* BFD_RELOC_BFIN_GOTOFFHI: howto manager. (line 1000) +* BFD_RELOC_BFIN_GOTOFFLO: howto manager. (line 1001) +* BFD_RELOC_BFIN_PLTPC: howto manager. (line 1005) +* BFD_RELOC_C6000_ABS_H16: howto manager. (line 1426) +* BFD_RELOC_C6000_ABS_L16: howto manager. (line 1425) +* BFD_RELOC_C6000_ABS_S16: howto manager. (line 1424) +* BFD_RELOC_C6000_ALIGN: howto manager. (line 1447) +* BFD_RELOC_C6000_COPY: howto manager. (line 1442) +* BFD_RELOC_C6000_DSBT_INDEX: howto manager. (line 1440) +* BFD_RELOC_C6000_EHTYPE: howto manager. (line 1444) +* BFD_RELOC_C6000_FPHEAD: howto manager. (line 1448) +* BFD_RELOC_C6000_JUMP_SLOT: howto manager. (line 1443) +* BFD_RELOC_C6000_NOCMP: howto manager. (line 1449) +* BFD_RELOC_C6000_PCR_H16: howto manager. (line 1445) +* BFD_RELOC_C6000_PCR_L16: howto manager. (line 1446) +* BFD_RELOC_C6000_PCR_S10: howto manager. (line 1422) +* BFD_RELOC_C6000_PCR_S12: howto manager. (line 1421) +* BFD_RELOC_C6000_PCR_S21: howto manager. (line 1420) +* BFD_RELOC_C6000_PCR_S7: howto manager. (line 1423) +* BFD_RELOC_C6000_PREL31: howto manager. (line 1441) +* BFD_RELOC_C6000_SBR_GOT_H16_W: howto manager. (line 1439) +* BFD_RELOC_C6000_SBR_GOT_L16_W: howto manager. (line 1438) +* BFD_RELOC_C6000_SBR_GOT_U15_W: howto manager. (line 1437) +* BFD_RELOC_C6000_SBR_H16_B: howto manager. (line 1434) +* BFD_RELOC_C6000_SBR_H16_H: howto manager. (line 1435) +* BFD_RELOC_C6000_SBR_H16_W: howto manager. (line 1436) +* BFD_RELOC_C6000_SBR_L16_B: howto manager. (line 1431) +* BFD_RELOC_C6000_SBR_L16_H: howto manager. (line 1432) +* BFD_RELOC_C6000_SBR_L16_W: howto manager. (line 1433) +* BFD_RELOC_C6000_SBR_S16: howto manager. (line 1430) +* BFD_RELOC_C6000_SBR_U15_B: howto manager. (line 1427) +* BFD_RELOC_C6000_SBR_U15_H: howto manager. (line 1428) +* BFD_RELOC_C6000_SBR_U15_W: howto manager. (line 1429) * bfd_reloc_code_type: howto manager. (line 9) -* BFD_RELOC_CR16_ABS20: howto manager. (line 2075) -* BFD_RELOC_CR16_ABS24: howto manager. (line 2076) -* BFD_RELOC_CR16_DISP16: howto manager. (line 2086) -* BFD_RELOC_CR16_DISP20: howto manager. (line 2087) -* BFD_RELOC_CR16_DISP24: howto manager. (line 2088) -* BFD_RELOC_CR16_DISP24a: howto manager. (line 2089) -* BFD_RELOC_CR16_DISP4: howto manager. (line 2084) -* BFD_RELOC_CR16_DISP8: howto manager. (line 2085) -* BFD_RELOC_CR16_GLOB_DAT: howto manager. (line 2095) -* BFD_RELOC_CR16_GOTC_REGREL20: howto manager. (line 2094) -* BFD_RELOC_CR16_GOT_REGREL20: howto manager. (line 2093) -* BFD_RELOC_CR16_IMM16: howto manager. (line 2079) -* BFD_RELOC_CR16_IMM20: howto manager. (line 2080) -* BFD_RELOC_CR16_IMM24: howto manager. (line 2081) -* BFD_RELOC_CR16_IMM32: howto manager. (line 2082) -* BFD_RELOC_CR16_IMM32a: howto manager. (line 2083) -* BFD_RELOC_CR16_IMM4: howto manager. (line 2077) -* BFD_RELOC_CR16_IMM8: howto manager. (line 2078) -* BFD_RELOC_CR16_NUM16: howto manager. (line 2064) -* BFD_RELOC_CR16_NUM32: howto manager. (line 2065) -* BFD_RELOC_CR16_NUM32a: howto manager. (line 2066) -* BFD_RELOC_CR16_NUM8: howto manager. (line 2063) -* BFD_RELOC_CR16_REGREL0: howto manager. (line 2067) -* BFD_RELOC_CR16_REGREL14: howto manager. (line 2070) -* BFD_RELOC_CR16_REGREL14a: howto manager. (line 2071) -* BFD_RELOC_CR16_REGREL16: howto manager. (line 2072) -* BFD_RELOC_CR16_REGREL20: howto manager. (line 2073) -* BFD_RELOC_CR16_REGREL20a: howto manager. (line 2074) -* BFD_RELOC_CR16_REGREL4: howto manager. (line 2068) -* BFD_RELOC_CR16_REGREL4a: howto manager. (line 2069) -* BFD_RELOC_CR16_SWITCH16: howto manager. (line 2091) -* BFD_RELOC_CR16_SWITCH32: howto manager. (line 2092) -* BFD_RELOC_CR16_SWITCH8: howto manager. (line 2090) -* BFD_RELOC_CRIS_16_DTPREL: howto manager. (line 2155) -* BFD_RELOC_CRIS_16_GOT: howto manager. (line 2137) -* BFD_RELOC_CRIS_16_GOTPLT: howto manager. (line 2141) -* BFD_RELOC_CRIS_16_GOT_GD: howto manager. (line 2151) -* BFD_RELOC_CRIS_16_GOT_TPREL: howto manager. (line 2157) -* BFD_RELOC_CRIS_16_TPREL: howto manager. (line 2159) -* BFD_RELOC_CRIS_32_DTPREL: howto manager. (line 2154) -* BFD_RELOC_CRIS_32_GD: howto manager. (line 2152) -* BFD_RELOC_CRIS_32_GOT: howto manager. (line 2135) -* BFD_RELOC_CRIS_32_GOTPLT: howto manager. (line 2139) -* BFD_RELOC_CRIS_32_GOTREL: howto manager. (line 2143) -* BFD_RELOC_CRIS_32_GOT_GD: howto manager. (line 2150) -* BFD_RELOC_CRIS_32_GOT_TPREL: howto manager. (line 2156) -* BFD_RELOC_CRIS_32_IE: howto manager. (line 2161) -* BFD_RELOC_CRIS_32_PLT_GOTREL: howto manager. (line 2145) -* BFD_RELOC_CRIS_32_PLT_PCREL: howto manager. (line 2147) -* BFD_RELOC_CRIS_32_TPREL: howto manager. (line 2158) -* BFD_RELOC_CRIS_BDISP8: howto manager. (line 2118) -* BFD_RELOC_CRIS_COPY: howto manager. (line 2130) -* BFD_RELOC_CRIS_DTP: howto manager. (line 2153) -* BFD_RELOC_CRIS_DTPMOD: howto manager. (line 2160) -* BFD_RELOC_CRIS_GLOB_DAT: howto manager. (line 2131) -* BFD_RELOC_CRIS_JUMP_SLOT: howto manager. (line 2132) -* BFD_RELOC_CRIS_LAPCQ_OFFSET: howto manager. (line 2126) -* BFD_RELOC_CRIS_RELATIVE: howto manager. (line 2133) -* BFD_RELOC_CRIS_SIGNED_16: howto manager. (line 2124) -* BFD_RELOC_CRIS_SIGNED_6: howto manager. (line 2120) -* BFD_RELOC_CRIS_SIGNED_8: howto manager. (line 2122) -* BFD_RELOC_CRIS_UNSIGNED_16: howto manager. (line 2125) -* BFD_RELOC_CRIS_UNSIGNED_4: howto manager. (line 2127) -* BFD_RELOC_CRIS_UNSIGNED_5: howto manager. (line 2119) -* BFD_RELOC_CRIS_UNSIGNED_6: howto manager. (line 2121) -* BFD_RELOC_CRIS_UNSIGNED_8: howto manager. (line 2123) -* BFD_RELOC_CRX_ABS16: howto manager. (line 2107) -* BFD_RELOC_CRX_ABS32: howto manager. (line 2108) -* BFD_RELOC_CRX_IMM16: howto manager. (line 2112) -* BFD_RELOC_CRX_IMM32: howto manager. (line 2113) -* BFD_RELOC_CRX_NUM16: howto manager. (line 2110) -* BFD_RELOC_CRX_NUM32: howto manager. (line 2111) -* BFD_RELOC_CRX_NUM8: howto manager. (line 2109) -* BFD_RELOC_CRX_REGREL12: howto manager. (line 2103) -* BFD_RELOC_CRX_REGREL22: howto manager. (line 2104) -* BFD_RELOC_CRX_REGREL28: howto manager. (line 2105) -* BFD_RELOC_CRX_REGREL32: howto manager. (line 2106) -* BFD_RELOC_CRX_REL16: howto manager. (line 2100) -* BFD_RELOC_CRX_REL24: howto manager. (line 2101) -* BFD_RELOC_CRX_REL32: howto manager. (line 2102) -* BFD_RELOC_CRX_REL4: howto manager. (line 2097) -* BFD_RELOC_CRX_REL8: howto manager. (line 2098) -* BFD_RELOC_CRX_REL8_CMP: howto manager. (line 2099) -* BFD_RELOC_CRX_SWITCH16: howto manager. (line 2115) -* BFD_RELOC_CRX_SWITCH32: howto manager. (line 2116) -* BFD_RELOC_CRX_SWITCH8: howto manager. (line 2114) -* BFD_RELOC_CTOR: howto manager. (line 709) -* BFD_RELOC_D10V_10_PCREL_L: howto manager. (line 1045) -* BFD_RELOC_D10V_10_PCREL_R: howto manager. (line 1042) -* BFD_RELOC_D10V_18: howto manager. (line 1049) -* BFD_RELOC_D10V_18_PCREL: howto manager. (line 1051) -* BFD_RELOC_D30V_15: howto manager. (line 1062) -* BFD_RELOC_D30V_15_PCREL: howto manager. (line 1065) -* BFD_RELOC_D30V_15_PCREL_R: howto manager. (line 1068) -* BFD_RELOC_D30V_21: howto manager. (line 1072) -* BFD_RELOC_D30V_21_PCREL: howto manager. (line 1075) -* BFD_RELOC_D30V_21_PCREL_R: howto manager. (line 1078) -* BFD_RELOC_D30V_32: howto manager. (line 1082) -* BFD_RELOC_D30V_32_PCREL: howto manager. (line 1084) -* BFD_RELOC_D30V_6: howto manager. (line 1053) -* BFD_RELOC_D30V_9_PCREL: howto manager. (line 1055) -* BFD_RELOC_D30V_9_PCREL_R: howto manager. (line 1058) -* BFD_RELOC_DLX_HI16_S: howto manager. (line 1086) -* BFD_RELOC_DLX_JMP26: howto manager. (line 1090) -* BFD_RELOC_DLX_LO16: howto manager. (line 1088) -* BFD_RELOC_EPIPHANY_HIGH: howto manager. (line 2924) -* BFD_RELOC_EPIPHANY_IMM11: howto manager. (line 2930) -* BFD_RELOC_EPIPHANY_IMM8: howto manager. (line 2933) -* BFD_RELOC_EPIPHANY_LOW: howto manager. (line 2926) -* BFD_RELOC_EPIPHANY_SIMM11: howto manager. (line 2928) -* BFD_RELOC_EPIPHANY_SIMM24: howto manager. (line 2922) -* BFD_RELOC_EPIPHANY_SIMM8: howto manager. (line 2920) -* BFD_RELOC_FR30_10_IN_8: howto manager. (line 1436) -* BFD_RELOC_FR30_12_PCREL: howto manager. (line 1442) -* BFD_RELOC_FR30_20: howto manager. (line 1424) -* BFD_RELOC_FR30_48: howto manager. (line 1422) -* BFD_RELOC_FR30_6_IN_4: howto manager. (line 1427) -* BFD_RELOC_FR30_8_IN_8: howto manager. (line 1430) -* BFD_RELOC_FR30_9_IN_8: howto manager. (line 1433) -* BFD_RELOC_FR30_9_PCREL: howto manager. (line 1439) -* BFD_RELOC_FRV_FUNCDESC: howto manager. (line 438) -* BFD_RELOC_FRV_FUNCDESC_GOT12: howto manager. (line 439) -* BFD_RELOC_FRV_FUNCDESC_GOTHI: howto manager. (line 440) -* BFD_RELOC_FRV_FUNCDESC_GOTLO: howto manager. (line 441) -* BFD_RELOC_FRV_FUNCDESC_GOTOFF12: howto manager. (line 443) -* BFD_RELOC_FRV_FUNCDESC_GOTOFFHI: howto manager. (line 444) -* BFD_RELOC_FRV_FUNCDESC_GOTOFFLO: howto manager. (line 445) -* BFD_RELOC_FRV_FUNCDESC_VALUE: howto manager. (line 442) -* BFD_RELOC_FRV_GETTLSOFF: howto manager. (line 449) -* BFD_RELOC_FRV_GETTLSOFF_RELAX: howto manager. (line 462) -* BFD_RELOC_FRV_GOT12: howto manager. (line 435) -* BFD_RELOC_FRV_GOTHI: howto manager. (line 436) -* BFD_RELOC_FRV_GOTLO: howto manager. (line 437) -* BFD_RELOC_FRV_GOTOFF12: howto manager. (line 446) -* BFD_RELOC_FRV_GOTOFFHI: howto manager. (line 447) -* BFD_RELOC_FRV_GOTOFFLO: howto manager. (line 448) -* BFD_RELOC_FRV_GOTTLSDESC12: howto manager. (line 451) -* BFD_RELOC_FRV_GOTTLSDESCHI: howto manager. (line 452) -* BFD_RELOC_FRV_GOTTLSDESCLO: howto manager. (line 453) -* BFD_RELOC_FRV_GOTTLSOFF12: howto manager. (line 457) -* BFD_RELOC_FRV_GOTTLSOFFHI: howto manager. (line 458) -* BFD_RELOC_FRV_GOTTLSOFFLO: howto manager. (line 459) -* BFD_RELOC_FRV_GPREL12: howto manager. (line 430) -* BFD_RELOC_FRV_GPREL32: howto manager. (line 432) -* BFD_RELOC_FRV_GPRELHI: howto manager. (line 433) -* BFD_RELOC_FRV_GPRELLO: howto manager. (line 434) -* BFD_RELOC_FRV_GPRELU12: howto manager. (line 431) -* BFD_RELOC_FRV_HI16: howto manager. (line 429) -* BFD_RELOC_FRV_LABEL16: howto manager. (line 426) -* BFD_RELOC_FRV_LABEL24: howto manager. (line 427) -* BFD_RELOC_FRV_LO16: howto manager. (line 428) -* BFD_RELOC_FRV_TLSDESC_RELAX: howto manager. (line 461) -* BFD_RELOC_FRV_TLSDESC_VALUE: howto manager. (line 450) -* BFD_RELOC_FRV_TLSMOFF: howto manager. (line 464) -* BFD_RELOC_FRV_TLSMOFF12: howto manager. (line 454) -* BFD_RELOC_FRV_TLSMOFFHI: howto manager. (line 455) -* BFD_RELOC_FRV_TLSMOFFLO: howto manager. (line 456) -* BFD_RELOC_FRV_TLSOFF: howto manager. (line 460) -* BFD_RELOC_FRV_TLSOFF_RELAX: howto manager. (line 463) +* BFD_RELOC_CR16_ABS20: howto manager. (line 2113) +* BFD_RELOC_CR16_ABS24: howto manager. (line 2114) +* BFD_RELOC_CR16_DISP16: howto manager. (line 2124) +* BFD_RELOC_CR16_DISP20: howto manager. (line 2125) +* BFD_RELOC_CR16_DISP24: howto manager. (line 2126) +* BFD_RELOC_CR16_DISP24a: howto manager. (line 2127) +* BFD_RELOC_CR16_DISP4: howto manager. (line 2122) +* BFD_RELOC_CR16_DISP8: howto manager. (line 2123) +* BFD_RELOC_CR16_GLOB_DAT: howto manager. (line 2133) +* BFD_RELOC_CR16_GOTC_REGREL20: howto manager. (line 2132) +* BFD_RELOC_CR16_GOT_REGREL20: howto manager. (line 2131) +* BFD_RELOC_CR16_IMM16: howto manager. (line 2117) +* BFD_RELOC_CR16_IMM20: howto manager. (line 2118) +* BFD_RELOC_CR16_IMM24: howto manager. (line 2119) +* BFD_RELOC_CR16_IMM32: howto manager. (line 2120) +* BFD_RELOC_CR16_IMM32a: howto manager. (line 2121) +* BFD_RELOC_CR16_IMM4: howto manager. (line 2115) +* BFD_RELOC_CR16_IMM8: howto manager. (line 2116) +* BFD_RELOC_CR16_NUM16: howto manager. (line 2102) +* BFD_RELOC_CR16_NUM32: howto manager. (line 2103) +* BFD_RELOC_CR16_NUM32a: howto manager. (line 2104) +* BFD_RELOC_CR16_NUM8: howto manager. (line 2101) +* BFD_RELOC_CR16_REGREL0: howto manager. (line 2105) +* BFD_RELOC_CR16_REGREL14: howto manager. (line 2108) +* BFD_RELOC_CR16_REGREL14a: howto manager. (line 2109) +* BFD_RELOC_CR16_REGREL16: howto manager. (line 2110) +* BFD_RELOC_CR16_REGREL20: howto manager. (line 2111) +* BFD_RELOC_CR16_REGREL20a: howto manager. (line 2112) +* BFD_RELOC_CR16_REGREL4: howto manager. (line 2106) +* BFD_RELOC_CR16_REGREL4a: howto manager. (line 2107) +* BFD_RELOC_CR16_SWITCH16: howto manager. (line 2129) +* BFD_RELOC_CR16_SWITCH32: howto manager. (line 2130) +* BFD_RELOC_CR16_SWITCH8: howto manager. (line 2128) +* BFD_RELOC_CRIS_16_DTPREL: howto manager. (line 2193) +* BFD_RELOC_CRIS_16_GOT: howto manager. (line 2175) +* BFD_RELOC_CRIS_16_GOTPLT: howto manager. (line 2179) +* BFD_RELOC_CRIS_16_GOT_GD: howto manager. (line 2189) +* BFD_RELOC_CRIS_16_GOT_TPREL: howto manager. (line 2195) +* BFD_RELOC_CRIS_16_TPREL: howto manager. (line 2197) +* BFD_RELOC_CRIS_32_DTPREL: howto manager. (line 2192) +* BFD_RELOC_CRIS_32_GD: howto manager. (line 2190) +* BFD_RELOC_CRIS_32_GOT: howto manager. (line 2173) +* BFD_RELOC_CRIS_32_GOTPLT: howto manager. (line 2177) +* BFD_RELOC_CRIS_32_GOTREL: howto manager. (line 2181) +* BFD_RELOC_CRIS_32_GOT_GD: howto manager. (line 2188) +* BFD_RELOC_CRIS_32_GOT_TPREL: howto manager. (line 2194) +* BFD_RELOC_CRIS_32_IE: howto manager. (line 2199) +* BFD_RELOC_CRIS_32_PLT_GOTREL: howto manager. (line 2183) +* BFD_RELOC_CRIS_32_PLT_PCREL: howto manager. (line 2185) +* BFD_RELOC_CRIS_32_TPREL: howto manager. (line 2196) +* BFD_RELOC_CRIS_BDISP8: howto manager. (line 2156) +* BFD_RELOC_CRIS_COPY: howto manager. (line 2168) +* BFD_RELOC_CRIS_DTP: howto manager. (line 2191) +* BFD_RELOC_CRIS_DTPMOD: howto manager. (line 2198) +* BFD_RELOC_CRIS_GLOB_DAT: howto manager. (line 2169) +* BFD_RELOC_CRIS_JUMP_SLOT: howto manager. (line 2170) +* BFD_RELOC_CRIS_LAPCQ_OFFSET: howto manager. (line 2164) +* BFD_RELOC_CRIS_RELATIVE: howto manager. (line 2171) +* BFD_RELOC_CRIS_SIGNED_16: howto manager. (line 2162) +* BFD_RELOC_CRIS_SIGNED_6: howto manager. (line 2158) +* BFD_RELOC_CRIS_SIGNED_8: howto manager. (line 2160) +* BFD_RELOC_CRIS_UNSIGNED_16: howto manager. (line 2163) +* BFD_RELOC_CRIS_UNSIGNED_4: howto manager. (line 2165) +* BFD_RELOC_CRIS_UNSIGNED_5: howto manager. (line 2157) +* BFD_RELOC_CRIS_UNSIGNED_6: howto manager. (line 2159) +* BFD_RELOC_CRIS_UNSIGNED_8: howto manager. (line 2161) +* BFD_RELOC_CRX_ABS16: howto manager. (line 2145) +* BFD_RELOC_CRX_ABS32: howto manager. (line 2146) +* BFD_RELOC_CRX_IMM16: howto manager. (line 2150) +* BFD_RELOC_CRX_IMM32: howto manager. (line 2151) +* BFD_RELOC_CRX_NUM16: howto manager. (line 2148) +* BFD_RELOC_CRX_NUM32: howto manager. (line 2149) +* BFD_RELOC_CRX_NUM8: howto manager. (line 2147) +* BFD_RELOC_CRX_REGREL12: howto manager. (line 2141) +* BFD_RELOC_CRX_REGREL22: howto manager. (line 2142) +* BFD_RELOC_CRX_REGREL28: howto manager. (line 2143) +* BFD_RELOC_CRX_REGREL32: howto manager. (line 2144) +* BFD_RELOC_CRX_REL16: howto manager. (line 2138) +* BFD_RELOC_CRX_REL24: howto manager. (line 2139) +* BFD_RELOC_CRX_REL32: howto manager. (line 2140) +* BFD_RELOC_CRX_REL4: howto manager. (line 2135) +* BFD_RELOC_CRX_REL8: howto manager. (line 2136) +* BFD_RELOC_CRX_REL8_CMP: howto manager. (line 2137) +* BFD_RELOC_CRX_SWITCH16: howto manager. (line 2153) +* BFD_RELOC_CRX_SWITCH32: howto manager. (line 2154) +* BFD_RELOC_CRX_SWITCH8: howto manager. (line 2152) +* BFD_RELOC_CTOR: howto manager. (line 714) +* BFD_RELOC_D10V_10_PCREL_L: howto manager. (line 1050) +* BFD_RELOC_D10V_10_PCREL_R: howto manager. (line 1047) +* BFD_RELOC_D10V_18: howto manager. (line 1054) +* BFD_RELOC_D10V_18_PCREL: howto manager. (line 1056) +* BFD_RELOC_D30V_15: howto manager. (line 1067) +* BFD_RELOC_D30V_15_PCREL: howto manager. (line 1070) +* BFD_RELOC_D30V_15_PCREL_R: howto manager. (line 1073) +* BFD_RELOC_D30V_21: howto manager. (line 1077) +* BFD_RELOC_D30V_21_PCREL: howto manager. (line 1080) +* BFD_RELOC_D30V_21_PCREL_R: howto manager. (line 1083) +* BFD_RELOC_D30V_32: howto manager. (line 1087) +* BFD_RELOC_D30V_32_PCREL: howto manager. (line 1089) +* BFD_RELOC_D30V_6: howto manager. (line 1058) +* BFD_RELOC_D30V_9_PCREL: howto manager. (line 1060) +* BFD_RELOC_D30V_9_PCREL_R: howto manager. (line 1063) +* BFD_RELOC_DLX_HI16_S: howto manager. (line 1091) +* BFD_RELOC_DLX_JMP26: howto manager. (line 1095) +* BFD_RELOC_DLX_LO16: howto manager. (line 1093) +* BFD_RELOC_EPIPHANY_HIGH: howto manager. (line 2962) +* BFD_RELOC_EPIPHANY_IMM11: howto manager. (line 2968) +* BFD_RELOC_EPIPHANY_IMM8: howto manager. (line 2971) +* BFD_RELOC_EPIPHANY_LOW: howto manager. (line 2964) +* BFD_RELOC_EPIPHANY_SIMM11: howto manager. (line 2966) +* BFD_RELOC_EPIPHANY_SIMM24: howto manager. (line 2960) +* BFD_RELOC_EPIPHANY_SIMM8: howto manager. (line 2958) +* BFD_RELOC_FR30_10_IN_8: howto manager. (line 1465) +* BFD_RELOC_FR30_12_PCREL: howto manager. (line 1471) +* BFD_RELOC_FR30_20: howto manager. (line 1453) +* BFD_RELOC_FR30_48: howto manager. (line 1451) +* BFD_RELOC_FR30_6_IN_4: howto manager. (line 1456) +* BFD_RELOC_FR30_8_IN_8: howto manager. (line 1459) +* BFD_RELOC_FR30_9_IN_8: howto manager. (line 1462) +* BFD_RELOC_FR30_9_PCREL: howto manager. (line 1468) +* BFD_RELOC_FRV_FUNCDESC: howto manager. (line 443) +* BFD_RELOC_FRV_FUNCDESC_GOT12: howto manager. (line 444) +* BFD_RELOC_FRV_FUNCDESC_GOTHI: howto manager. (line 445) +* BFD_RELOC_FRV_FUNCDESC_GOTLO: howto manager. (line 446) +* BFD_RELOC_FRV_FUNCDESC_GOTOFF12: howto manager. (line 448) +* BFD_RELOC_FRV_FUNCDESC_GOTOFFHI: howto manager. (line 449) +* BFD_RELOC_FRV_FUNCDESC_GOTOFFLO: howto manager. (line 450) +* BFD_RELOC_FRV_FUNCDESC_VALUE: howto manager. (line 447) +* BFD_RELOC_FRV_GETTLSOFF: howto manager. (line 454) +* BFD_RELOC_FRV_GETTLSOFF_RELAX: howto manager. (line 467) +* BFD_RELOC_FRV_GOT12: howto manager. (line 440) +* BFD_RELOC_FRV_GOTHI: howto manager. (line 441) +* BFD_RELOC_FRV_GOTLO: howto manager. (line 442) +* BFD_RELOC_FRV_GOTOFF12: howto manager. (line 451) +* BFD_RELOC_FRV_GOTOFFHI: howto manager. (line 452) +* BFD_RELOC_FRV_GOTOFFLO: howto manager. (line 453) +* BFD_RELOC_FRV_GOTTLSDESC12: howto manager. (line 456) +* BFD_RELOC_FRV_GOTTLSDESCHI: howto manager. (line 457) +* BFD_RELOC_FRV_GOTTLSDESCLO: howto manager. (line 458) +* BFD_RELOC_FRV_GOTTLSOFF12: howto manager. (line 462) +* BFD_RELOC_FRV_GOTTLSOFFHI: howto manager. (line 463) +* BFD_RELOC_FRV_GOTTLSOFFLO: howto manager. (line 464) +* BFD_RELOC_FRV_GPREL12: howto manager. (line 435) +* BFD_RELOC_FRV_GPREL32: howto manager. (line 437) +* BFD_RELOC_FRV_GPRELHI: howto manager. (line 438) +* BFD_RELOC_FRV_GPRELLO: howto manager. (line 439) +* BFD_RELOC_FRV_GPRELU12: howto manager. (line 436) +* BFD_RELOC_FRV_HI16: howto manager. (line 434) +* BFD_RELOC_FRV_LABEL16: howto manager. (line 431) +* BFD_RELOC_FRV_LABEL24: howto manager. (line 432) +* BFD_RELOC_FRV_LO16: howto manager. (line 433) +* BFD_RELOC_FRV_TLSDESC_RELAX: howto manager. (line 466) +* BFD_RELOC_FRV_TLSDESC_VALUE: howto manager. (line 455) +* BFD_RELOC_FRV_TLSMOFF: howto manager. (line 469) +* BFD_RELOC_FRV_TLSMOFF12: howto manager. (line 459) +* BFD_RELOC_FRV_TLSMOFFHI: howto manager. (line 460) +* BFD_RELOC_FRV_TLSMOFFLO: howto manager. (line 461) +* BFD_RELOC_FRV_TLSOFF: howto manager. (line 465) +* BFD_RELOC_FRV_TLSOFF_RELAX: howto manager. (line 468) * BFD_RELOC_GPREL16: howto manager. (line 114) * BFD_RELOC_GPREL32: howto manager. (line 115) -* BFD_RELOC_H8_DIR16A8: howto manager. (line 2221) -* BFD_RELOC_H8_DIR16R8: howto manager. (line 2222) -* BFD_RELOC_H8_DIR24A8: howto manager. (line 2223) -* BFD_RELOC_H8_DIR24R8: howto manager. (line 2224) -* BFD_RELOC_H8_DIR32A16: howto manager. (line 2225) -* BFD_RELOC_H8_DISP32A16: howto manager. (line 2226) +* BFD_RELOC_H8_DIR16A8: howto manager. (line 2259) +* BFD_RELOC_H8_DIR16R8: howto manager. (line 2260) +* BFD_RELOC_H8_DIR24A8: howto manager. (line 2261) +* BFD_RELOC_H8_DIR24R8: howto manager. (line 2262) +* BFD_RELOC_H8_DIR32A16: howto manager. (line 2263) +* BFD_RELOC_H8_DISP32A16: howto manager. (line 2264) * BFD_RELOC_HI16: howto manager. (line 316) * BFD_RELOC_HI16_BASEREL: howto manager. (line 94) * BFD_RELOC_HI16_GOTOFF: howto manager. (line 53) @@ -11673,287 +11716,287 @@ BFD Index * BFD_RELOC_HI16_S_PCREL: howto manager. (line 327) * BFD_RELOC_HI16_S_PLTOFF: howto manager. (line 66) * BFD_RELOC_HI22: howto manager. (line 110) -* BFD_RELOC_I370_D12: howto manager. (line 707) +* BFD_RELOC_I370_D12: howto manager. (line 712) * BFD_RELOC_I960_CALLJ: howto manager. (line 120) -* BFD_RELOC_IA64_COPY: howto manager. (line 1924) -* BFD_RELOC_IA64_DIR32LSB: howto manager. (line 1869) -* BFD_RELOC_IA64_DIR32MSB: howto manager. (line 1868) -* BFD_RELOC_IA64_DIR64LSB: howto manager. (line 1871) -* BFD_RELOC_IA64_DIR64MSB: howto manager. (line 1870) -* BFD_RELOC_IA64_DTPMOD64LSB: howto manager. (line 1934) -* BFD_RELOC_IA64_DTPMOD64MSB: howto manager. (line 1933) -* BFD_RELOC_IA64_DTPREL14: howto manager. (line 1936) -* BFD_RELOC_IA64_DTPREL22: howto manager. (line 1937) -* BFD_RELOC_IA64_DTPREL32LSB: howto manager. (line 1940) -* BFD_RELOC_IA64_DTPREL32MSB: howto manager. (line 1939) -* BFD_RELOC_IA64_DTPREL64I: howto manager. (line 1938) -* BFD_RELOC_IA64_DTPREL64LSB: howto manager. (line 1942) -* BFD_RELOC_IA64_DTPREL64MSB: howto manager. (line 1941) -* BFD_RELOC_IA64_FPTR32LSB: howto manager. (line 1886) -* BFD_RELOC_IA64_FPTR32MSB: howto manager. (line 1885) -* BFD_RELOC_IA64_FPTR64I: howto manager. (line 1884) -* BFD_RELOC_IA64_FPTR64LSB: howto manager. (line 1888) -* BFD_RELOC_IA64_FPTR64MSB: howto manager. (line 1887) -* BFD_RELOC_IA64_GPREL22: howto manager. (line 1872) -* BFD_RELOC_IA64_GPREL32LSB: howto manager. (line 1875) -* BFD_RELOC_IA64_GPREL32MSB: howto manager. (line 1874) -* BFD_RELOC_IA64_GPREL64I: howto manager. (line 1873) -* BFD_RELOC_IA64_GPREL64LSB: howto manager. (line 1877) -* BFD_RELOC_IA64_GPREL64MSB: howto manager. (line 1876) -* BFD_RELOC_IA64_IMM14: howto manager. (line 1865) -* BFD_RELOC_IA64_IMM22: howto manager. (line 1866) -* BFD_RELOC_IA64_IMM64: howto manager. (line 1867) -* BFD_RELOC_IA64_IPLTLSB: howto manager. (line 1923) -* BFD_RELOC_IA64_IPLTMSB: howto manager. (line 1922) -* BFD_RELOC_IA64_LDXMOV: howto manager. (line 1926) -* BFD_RELOC_IA64_LTOFF22: howto manager. (line 1878) -* BFD_RELOC_IA64_LTOFF22X: howto manager. (line 1925) -* BFD_RELOC_IA64_LTOFF64I: howto manager. (line 1879) -* BFD_RELOC_IA64_LTOFF_DTPMOD22: howto manager. (line 1935) -* BFD_RELOC_IA64_LTOFF_DTPREL22: howto manager. (line 1943) -* BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. (line 1900) -* BFD_RELOC_IA64_LTOFF_FPTR32LSB: howto manager. (line 1903) -* BFD_RELOC_IA64_LTOFF_FPTR32MSB: howto manager. (line 1902) -* BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. (line 1901) -* BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. (line 1905) -* BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. (line 1904) -* BFD_RELOC_IA64_LTOFF_TPREL22: howto manager. (line 1932) -* BFD_RELOC_IA64_LTV32LSB: howto manager. (line 1919) -* BFD_RELOC_IA64_LTV32MSB: howto manager. (line 1918) -* BFD_RELOC_IA64_LTV64LSB: howto manager. (line 1921) -* BFD_RELOC_IA64_LTV64MSB: howto manager. (line 1920) -* BFD_RELOC_IA64_PCREL21B: howto manager. (line 1889) -* BFD_RELOC_IA64_PCREL21BI: howto manager. (line 1890) -* BFD_RELOC_IA64_PCREL21F: howto manager. (line 1892) -* BFD_RELOC_IA64_PCREL21M: howto manager. (line 1891) -* BFD_RELOC_IA64_PCREL22: howto manager. (line 1893) -* BFD_RELOC_IA64_PCREL32LSB: howto manager. (line 1897) -* BFD_RELOC_IA64_PCREL32MSB: howto manager. (line 1896) -* BFD_RELOC_IA64_PCREL60B: howto manager. (line 1894) -* BFD_RELOC_IA64_PCREL64I: howto manager. (line 1895) -* BFD_RELOC_IA64_PCREL64LSB: howto manager. (line 1899) -* BFD_RELOC_IA64_PCREL64MSB: howto manager. (line 1898) -* BFD_RELOC_IA64_PLTOFF22: howto manager. (line 1880) -* BFD_RELOC_IA64_PLTOFF64I: howto manager. (line 1881) -* BFD_RELOC_IA64_PLTOFF64LSB: howto manager. (line 1883) -* BFD_RELOC_IA64_PLTOFF64MSB: howto manager. (line 1882) -* BFD_RELOC_IA64_REL32LSB: howto manager. (line 1915) -* BFD_RELOC_IA64_REL32MSB: howto manager. (line 1914) -* BFD_RELOC_IA64_REL64LSB: howto manager. (line 1917) -* BFD_RELOC_IA64_REL64MSB: howto manager. (line 1916) -* BFD_RELOC_IA64_SECREL32LSB: howto manager. (line 1911) -* BFD_RELOC_IA64_SECREL32MSB: howto manager. (line 1910) -* BFD_RELOC_IA64_SECREL64LSB: howto manager. (line 1913) -* BFD_RELOC_IA64_SECREL64MSB: howto manager. (line 1912) -* BFD_RELOC_IA64_SEGREL32LSB: howto manager. (line 1907) -* BFD_RELOC_IA64_SEGREL32MSB: howto manager. (line 1906) -* BFD_RELOC_IA64_SEGREL64LSB: howto manager. (line 1909) -* BFD_RELOC_IA64_SEGREL64MSB: howto manager. (line 1908) -* BFD_RELOC_IA64_TPREL14: howto manager. (line 1927) -* BFD_RELOC_IA64_TPREL22: howto manager. (line 1928) -* BFD_RELOC_IA64_TPREL64I: howto manager. (line 1929) -* BFD_RELOC_IA64_TPREL64LSB: howto manager. (line 1931) -* BFD_RELOC_IA64_TPREL64MSB: howto manager. (line 1930) -* BFD_RELOC_IP2K_ADDR16CJP: howto manager. (line 1826) -* BFD_RELOC_IP2K_BANK: howto manager. (line 1824) -* BFD_RELOC_IP2K_EX8DATA: howto manager. (line 1832) -* BFD_RELOC_IP2K_FR9: howto manager. (line 1822) -* BFD_RELOC_IP2K_FR_OFFSET: howto manager. (line 1841) -* BFD_RELOC_IP2K_HI8DATA: howto manager. (line 1831) -* BFD_RELOC_IP2K_HI8INSN: howto manager. (line 1835) -* BFD_RELOC_IP2K_LO8DATA: howto manager. (line 1830) -* BFD_RELOC_IP2K_LO8INSN: howto manager. (line 1834) -* BFD_RELOC_IP2K_PAGE3: howto manager. (line 1828) -* BFD_RELOC_IP2K_PC_SKIP: howto manager. (line 1837) -* BFD_RELOC_IP2K_TEXT: howto manager. (line 1839) -* BFD_RELOC_IQ2000_OFFSET_16: howto manager. (line 2319) -* BFD_RELOC_IQ2000_OFFSET_21: howto manager. (line 2320) -* BFD_RELOC_IQ2000_UHI16: howto manager. (line 2321) -* BFD_RELOC_LM32_16_GOT: howto manager. (line 2411) -* BFD_RELOC_LM32_BRANCH: howto manager. (line 2410) -* BFD_RELOC_LM32_CALL: howto manager. (line 2409) -* BFD_RELOC_LM32_COPY: howto manager. (line 2414) -* BFD_RELOC_LM32_GLOB_DAT: howto manager. (line 2415) -* BFD_RELOC_LM32_GOTOFF_HI16: howto manager. (line 2412) -* BFD_RELOC_LM32_GOTOFF_LO16: howto manager. (line 2413) -* BFD_RELOC_LM32_JMP_SLOT: howto manager. (line 2416) -* BFD_RELOC_LM32_RELATIVE: howto manager. (line 2417) +* BFD_RELOC_IA64_COPY: howto manager. (line 1962) +* BFD_RELOC_IA64_DIR32LSB: howto manager. (line 1907) +* BFD_RELOC_IA64_DIR32MSB: howto manager. (line 1906) +* BFD_RELOC_IA64_DIR64LSB: howto manager. (line 1909) +* BFD_RELOC_IA64_DIR64MSB: howto manager. (line 1908) +* BFD_RELOC_IA64_DTPMOD64LSB: howto manager. (line 1972) +* BFD_RELOC_IA64_DTPMOD64MSB: howto manager. (line 1971) +* BFD_RELOC_IA64_DTPREL14: howto manager. (line 1974) +* BFD_RELOC_IA64_DTPREL22: howto manager. (line 1975) +* BFD_RELOC_IA64_DTPREL32LSB: howto manager. (line 1978) +* BFD_RELOC_IA64_DTPREL32MSB: howto manager. (line 1977) +* BFD_RELOC_IA64_DTPREL64I: howto manager. (line 1976) +* BFD_RELOC_IA64_DTPREL64LSB: howto manager. (line 1980) +* BFD_RELOC_IA64_DTPREL64MSB: howto manager. (line 1979) +* BFD_RELOC_IA64_FPTR32LSB: howto manager. (line 1924) +* BFD_RELOC_IA64_FPTR32MSB: howto manager. (line 1923) +* BFD_RELOC_IA64_FPTR64I: howto manager. (line 1922) +* BFD_RELOC_IA64_FPTR64LSB: howto manager. (line 1926) +* BFD_RELOC_IA64_FPTR64MSB: howto manager. (line 1925) +* BFD_RELOC_IA64_GPREL22: howto manager. (line 1910) +* BFD_RELOC_IA64_GPREL32LSB: howto manager. (line 1913) +* BFD_RELOC_IA64_GPREL32MSB: howto manager. (line 1912) +* BFD_RELOC_IA64_GPREL64I: howto manager. (line 1911) +* BFD_RELOC_IA64_GPREL64LSB: howto manager. (line 1915) +* BFD_RELOC_IA64_GPREL64MSB: howto manager. (line 1914) +* BFD_RELOC_IA64_IMM14: howto manager. (line 1903) +* BFD_RELOC_IA64_IMM22: howto manager. (line 1904) +* BFD_RELOC_IA64_IMM64: howto manager. (line 1905) +* BFD_RELOC_IA64_IPLTLSB: howto manager. (line 1961) +* BFD_RELOC_IA64_IPLTMSB: howto manager. (line 1960) +* BFD_RELOC_IA64_LDXMOV: howto manager. (line 1964) +* BFD_RELOC_IA64_LTOFF22: howto manager. (line 1916) +* BFD_RELOC_IA64_LTOFF22X: howto manager. (line 1963) +* BFD_RELOC_IA64_LTOFF64I: howto manager. (line 1917) +* BFD_RELOC_IA64_LTOFF_DTPMOD22: howto manager. (line 1973) +* BFD_RELOC_IA64_LTOFF_DTPREL22: howto manager. (line 1981) +* BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. (line 1938) +* BFD_RELOC_IA64_LTOFF_FPTR32LSB: howto manager. (line 1941) +* BFD_RELOC_IA64_LTOFF_FPTR32MSB: howto manager. (line 1940) +* BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. (line 1939) +* BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. (line 1943) +* BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. (line 1942) +* BFD_RELOC_IA64_LTOFF_TPREL22: howto manager. (line 1970) +* BFD_RELOC_IA64_LTV32LSB: howto manager. (line 1957) +* BFD_RELOC_IA64_LTV32MSB: howto manager. (line 1956) +* BFD_RELOC_IA64_LTV64LSB: howto manager. (line 1959) +* BFD_RELOC_IA64_LTV64MSB: howto manager. (line 1958) +* BFD_RELOC_IA64_PCREL21B: howto manager. (line 1927) +* BFD_RELOC_IA64_PCREL21BI: howto manager. (line 1928) +* BFD_RELOC_IA64_PCREL21F: howto manager. (line 1930) +* BFD_RELOC_IA64_PCREL21M: howto manager. (line 1929) +* BFD_RELOC_IA64_PCREL22: howto manager. (line 1931) +* BFD_RELOC_IA64_PCREL32LSB: howto manager. (line 1935) +* BFD_RELOC_IA64_PCREL32MSB: howto manager. (line 1934) +* BFD_RELOC_IA64_PCREL60B: howto manager. (line 1932) +* BFD_RELOC_IA64_PCREL64I: howto manager. (line 1933) +* BFD_RELOC_IA64_PCREL64LSB: howto manager. (line 1937) +* BFD_RELOC_IA64_PCREL64MSB: howto manager. (line 1936) +* BFD_RELOC_IA64_PLTOFF22: howto manager. (line 1918) +* BFD_RELOC_IA64_PLTOFF64I: howto manager. (line 1919) +* BFD_RELOC_IA64_PLTOFF64LSB: howto manager. (line 1921) +* BFD_RELOC_IA64_PLTOFF64MSB: howto manager. (line 1920) +* BFD_RELOC_IA64_REL32LSB: howto manager. (line 1953) +* BFD_RELOC_IA64_REL32MSB: howto manager. (line 1952) +* BFD_RELOC_IA64_REL64LSB: howto manager. (line 1955) +* BFD_RELOC_IA64_REL64MSB: howto manager. (line 1954) +* BFD_RELOC_IA64_SECREL32LSB: howto manager. (line 1949) +* BFD_RELOC_IA64_SECREL32MSB: howto manager. (line 1948) +* BFD_RELOC_IA64_SECREL64LSB: howto manager. (line 1951) +* BFD_RELOC_IA64_SECREL64MSB: howto manager. (line 1950) +* BFD_RELOC_IA64_SEGREL32LSB: howto manager. (line 1945) +* BFD_RELOC_IA64_SEGREL32MSB: howto manager. (line 1944) +* BFD_RELOC_IA64_SEGREL64LSB: howto manager. (line 1947) +* BFD_RELOC_IA64_SEGREL64MSB: howto manager. (line 1946) +* BFD_RELOC_IA64_TPREL14: howto manager. (line 1965) +* BFD_RELOC_IA64_TPREL22: howto manager. (line 1966) +* BFD_RELOC_IA64_TPREL64I: howto manager. (line 1967) +* BFD_RELOC_IA64_TPREL64LSB: howto manager. (line 1969) +* BFD_RELOC_IA64_TPREL64MSB: howto manager. (line 1968) +* BFD_RELOC_IP2K_ADDR16CJP: howto manager. (line 1864) +* BFD_RELOC_IP2K_BANK: howto manager. (line 1862) +* BFD_RELOC_IP2K_EX8DATA: howto manager. (line 1870) +* BFD_RELOC_IP2K_FR9: howto manager. (line 1860) +* BFD_RELOC_IP2K_FR_OFFSET: howto manager. (line 1879) +* BFD_RELOC_IP2K_HI8DATA: howto manager. (line 1869) +* BFD_RELOC_IP2K_HI8INSN: howto manager. (line 1873) +* BFD_RELOC_IP2K_LO8DATA: howto manager. (line 1868) +* BFD_RELOC_IP2K_LO8INSN: howto manager. (line 1872) +* BFD_RELOC_IP2K_PAGE3: howto manager. (line 1866) +* BFD_RELOC_IP2K_PC_SKIP: howto manager. (line 1875) +* BFD_RELOC_IP2K_TEXT: howto manager. (line 1877) +* BFD_RELOC_IQ2000_OFFSET_16: howto manager. (line 2357) +* BFD_RELOC_IQ2000_OFFSET_21: howto manager. (line 2358) +* BFD_RELOC_IQ2000_UHI16: howto manager. (line 2359) +* BFD_RELOC_LM32_16_GOT: howto manager. (line 2449) +* BFD_RELOC_LM32_BRANCH: howto manager. (line 2448) +* BFD_RELOC_LM32_CALL: howto manager. (line 2447) +* BFD_RELOC_LM32_COPY: howto manager. (line 2452) +* BFD_RELOC_LM32_GLOB_DAT: howto manager. (line 2453) +* BFD_RELOC_LM32_GOTOFF_HI16: howto manager. (line 2450) +* BFD_RELOC_LM32_GOTOFF_LO16: howto manager. (line 2451) +* BFD_RELOC_LM32_JMP_SLOT: howto manager. (line 2454) +* BFD_RELOC_LM32_RELATIVE: howto manager. (line 2455) * BFD_RELOC_LO10: howto manager. (line 111) * BFD_RELOC_LO16: howto manager. (line 323) * BFD_RELOC_LO16_BASEREL: howto manager. (line 93) * BFD_RELOC_LO16_GOTOFF: howto manager. (line 52) * BFD_RELOC_LO16_PCREL: howto manager. (line 329) * BFD_RELOC_LO16_PLTOFF: howto manager. (line 64) -* BFD_RELOC_M32C_HI8: howto manager. (line 1092) -* BFD_RELOC_M32C_RL_1ADDR: howto manager. (line 1094) -* BFD_RELOC_M32C_RL_2ADDR: howto manager. (line 1095) -* BFD_RELOC_M32C_RL_JUMP: howto manager. (line 1093) -* BFD_RELOC_M32R_10_PCREL: howto manager. (line 1100) -* BFD_RELOC_M32R_18_PCREL: howto manager. (line 1103) -* BFD_RELOC_M32R_24: howto manager. (line 1097) -* BFD_RELOC_M32R_26_PCREL: howto manager. (line 1105) -* BFD_RELOC_M32R_26_PLTREL: howto manager. (line 1119) -* BFD_RELOC_M32R_COPY: howto manager. (line 1120) -* BFD_RELOC_M32R_GLOB_DAT: howto manager. (line 1121) -* BFD_RELOC_M32R_GOT16_HI_SLO: howto manager. (line 1130) -* BFD_RELOC_M32R_GOT16_HI_ULO: howto manager. (line 1129) -* BFD_RELOC_M32R_GOT16_LO: howto manager. (line 1131) -* BFD_RELOC_M32R_GOT24: howto manager. (line 1118) -* BFD_RELOC_M32R_GOTOFF: howto manager. (line 1124) -* BFD_RELOC_M32R_GOTOFF_HI_SLO: howto manager. (line 1126) -* BFD_RELOC_M32R_GOTOFF_HI_ULO: howto manager. (line 1125) -* BFD_RELOC_M32R_GOTOFF_LO: howto manager. (line 1127) -* BFD_RELOC_M32R_GOTPC24: howto manager. (line 1128) -* BFD_RELOC_M32R_GOTPC_HI_SLO: howto manager. (line 1133) -* BFD_RELOC_M32R_GOTPC_HI_ULO: howto manager. (line 1132) -* BFD_RELOC_M32R_GOTPC_LO: howto manager. (line 1134) -* BFD_RELOC_M32R_HI16_SLO: howto manager. (line 1110) -* BFD_RELOC_M32R_HI16_ULO: howto manager. (line 1107) -* BFD_RELOC_M32R_JMP_SLOT: howto manager. (line 1122) -* BFD_RELOC_M32R_LO16: howto manager. (line 1113) -* BFD_RELOC_M32R_RELATIVE: howto manager. (line 1123) -* BFD_RELOC_M32R_SDA16: howto manager. (line 1115) -* BFD_RELOC_M68HC11_24: howto manager. (line 1971) -* BFD_RELOC_M68HC11_3B: howto manager. (line 1951) -* BFD_RELOC_M68HC11_HI8: howto manager. (line 1945) -* BFD_RELOC_M68HC11_LO16: howto manager. (line 1962) -* BFD_RELOC_M68HC11_LO8: howto manager. (line 1948) -* BFD_RELOC_M68HC11_PAGE: howto manager. (line 1967) -* BFD_RELOC_M68HC11_RL_GROUP: howto manager. (line 1958) -* BFD_RELOC_M68HC11_RL_JUMP: howto manager. (line 1953) -* BFD_RELOC_M68HC12_10_PCREL: howto manager. (line 2014) -* BFD_RELOC_M68HC12_16B: howto manager. (line 2010) -* BFD_RELOC_M68HC12_5B: howto manager. (line 1976) -* BFD_RELOC_M68HC12_9B: howto manager. (line 2008) -* BFD_RELOC_M68HC12_9_PCREL: howto manager. (line 2012) -* BFD_RELOC_M68HC12_HI8XG: howto manager. (line 2019) -* BFD_RELOC_M68HC12_LO8XG: howto manager. (line 2016) -* BFD_RELOC_MACH_O_LOCAL_SECTDIFF: howto manager. (line 2422) -* BFD_RELOC_MACH_O_PAIR: howto manager. (line 2424) -* BFD_RELOC_MACH_O_SECTDIFF: howto manager. (line 2419) -* BFD_RELOC_MACH_O_X86_64_BRANCH32: howto manager. (line 2426) -* BFD_RELOC_MACH_O_X86_64_BRANCH8: howto manager. (line 2427) -* BFD_RELOC_MACH_O_X86_64_GOT: howto manager. (line 2430) -* BFD_RELOC_MACH_O_X86_64_GOT_LOAD: howto manager. (line 2432) -* BFD_RELOC_MACH_O_X86_64_PCREL32_1: howto manager. (line 2439) -* BFD_RELOC_MACH_O_X86_64_PCREL32_2: howto manager. (line 2441) -* BFD_RELOC_MACH_O_X86_64_PCREL32_4: howto manager. (line 2443) -* BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32: howto manager. (line 2435) -* BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64: howto manager. (line 2437) -* BFD_RELOC_MCORE_PCREL_32: howto manager. (line 1448) -* BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. (line 1446) -* BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. (line 1447) -* BFD_RELOC_MCORE_PCREL_IMM8BY4: howto manager. (line 1445) -* BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: howto manager. (line 1449) -* BFD_RELOC_MCORE_RVA: howto manager. (line 1450) -* BFD_RELOC_MEP_16: howto manager. (line 1453) -* BFD_RELOC_MEP_32: howto manager. (line 1454) -* BFD_RELOC_MEP_8: howto manager. (line 1452) -* BFD_RELOC_MEP_ADDR24A4: howto manager. (line 1469) -* BFD_RELOC_MEP_GNU_VTENTRY: howto manager. (line 1471) -* BFD_RELOC_MEP_GNU_VTINHERIT: howto manager. (line 1470) -* BFD_RELOC_MEP_GPREL: howto manager. (line 1463) -* BFD_RELOC_MEP_HI16S: howto manager. (line 1462) -* BFD_RELOC_MEP_HI16U: howto manager. (line 1461) -* BFD_RELOC_MEP_LOW16: howto manager. (line 1460) -* BFD_RELOC_MEP_PCABS24A2: howto manager. (line 1459) -* BFD_RELOC_MEP_PCREL12A2: howto manager. (line 1456) -* BFD_RELOC_MEP_PCREL17A2: howto manager. (line 1457) -* BFD_RELOC_MEP_PCREL24A2: howto manager. (line 1458) -* BFD_RELOC_MEP_PCREL8A2: howto manager. (line 1455) -* BFD_RELOC_MEP_TPREL: howto manager. (line 1464) -* BFD_RELOC_MEP_TPREL7: howto manager. (line 1465) -* BFD_RELOC_MEP_TPREL7A2: howto manager. (line 1466) -* BFD_RELOC_MEP_TPREL7A4: howto manager. (line 1467) -* BFD_RELOC_MEP_UIMM24: howto manager. (line 1468) -* BFD_RELOC_METAG_COPY: howto manager. (line 1492) -* BFD_RELOC_METAG_GETSETOFF: howto manager. (line 1476) -* BFD_RELOC_METAG_GETSET_GOT: howto manager. (line 1484) -* BFD_RELOC_METAG_GETSET_GOTOFF: howto manager. (line 1483) -* BFD_RELOC_METAG_GLOB_DAT: howto manager. (line 1495) -* BFD_RELOC_METAG_GOTOFF: howto manager. (line 1490) -* BFD_RELOC_METAG_HI16_GOTOFF: howto manager. (line 1481) -* BFD_RELOC_METAG_HI16_GOTPC: howto manager. (line 1485) -* BFD_RELOC_METAG_HI16_PLT: howto manager. (line 1487) -* BFD_RELOC_METAG_HIADDR16: howto manager. (line 1473) -* BFD_RELOC_METAG_HIOG: howto manager. (line 1477) -* BFD_RELOC_METAG_JMP_SLOT: howto manager. (line 1493) -* BFD_RELOC_METAG_LO16_GOTOFF: howto manager. (line 1482) -* BFD_RELOC_METAG_LO16_GOTPC: howto manager. (line 1486) -* BFD_RELOC_METAG_LO16_PLT: howto manager. (line 1488) -* BFD_RELOC_METAG_LOADDR16: howto manager. (line 1474) -* BFD_RELOC_METAG_LOOG: howto manager. (line 1478) -* BFD_RELOC_METAG_PLT: howto manager. (line 1491) -* BFD_RELOC_METAG_REL16: howto manager. (line 1480) -* BFD_RELOC_METAG_REL8: howto manager. (line 1479) -* BFD_RELOC_METAG_RELATIVE: howto manager. (line 1494) -* BFD_RELOC_METAG_RELBRANCH: howto manager. (line 1475) -* BFD_RELOC_METAG_RELBRANCH_PLT: howto manager. (line 1489) -* BFD_RELOC_METAG_TLS_DTPMOD: howto manager. (line 1506) -* BFD_RELOC_METAG_TLS_DTPOFF: howto manager. (line 1507) -* BFD_RELOC_METAG_TLS_GD: howto manager. (line 1496) -* BFD_RELOC_METAG_TLS_IE: howto manager. (line 1501) -* BFD_RELOC_METAG_TLS_IENONPIC: howto manager. (line 1502) -* BFD_RELOC_METAG_TLS_IENONPIC_HI16: howto manager. (line 1503) -* BFD_RELOC_METAG_TLS_IENONPIC_LO16: howto manager. (line 1504) -* BFD_RELOC_METAG_TLS_LDM: howto manager. (line 1497) -* BFD_RELOC_METAG_TLS_LDO: howto manager. (line 1500) -* BFD_RELOC_METAG_TLS_LDO_HI16: howto manager. (line 1498) -* BFD_RELOC_METAG_TLS_LDO_LO16: howto manager. (line 1499) -* BFD_RELOC_METAG_TLS_LE: howto manager. (line 1508) -* BFD_RELOC_METAG_TLS_LE_HI16: howto manager. (line 1509) -* BFD_RELOC_METAG_TLS_LE_LO16: howto manager. (line 1510) -* BFD_RELOC_METAG_TLS_TPOFF: howto manager. (line 1505) -* BFD_RELOC_MICROBLAZE_32_GOTOFF: howto manager. (line 2479) -* BFD_RELOC_MICROBLAZE_32_LO: howto manager. (line 2445) -* BFD_RELOC_MICROBLAZE_32_LO_PCREL: howto manager. (line 2448) -* BFD_RELOC_MICROBLAZE_32_ROSDA: howto manager. (line 2451) -* BFD_RELOC_MICROBLAZE_32_RWSDA: howto manager. (line 2454) -* BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM: howto manager. (line 2457) -* BFD_RELOC_MICROBLAZE_32_TLSDTPMOD: howto manager. (line 2495) -* BFD_RELOC_MICROBLAZE_32_TLSDTPREL: howto manager. (line 2497) -* BFD_RELOC_MICROBLAZE_64_GOT: howto manager. (line 2468) -* BFD_RELOC_MICROBLAZE_64_GOTOFF: howto manager. (line 2475) -* BFD_RELOC_MICROBLAZE_64_GOTPC: howto manager. (line 2464) -* BFD_RELOC_MICROBLAZE_64_NONE: howto manager. (line 2460) -* BFD_RELOC_MICROBLAZE_64_PLT: howto manager. (line 2471) -* BFD_RELOC_MICROBLAZE_64_TLS: howto manager. (line 2485) -* BFD_RELOC_MICROBLAZE_64_TLSDTPREL: howto manager. (line 2499) -* BFD_RELOC_MICROBLAZE_64_TLSGD: howto manager. (line 2487) -* BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL: howto manager. (line 2502) -* BFD_RELOC_MICROBLAZE_64_TLSLD: howto manager. (line 2491) -* BFD_RELOC_MICROBLAZE_64_TLSTPREL: howto manager. (line 2505) -* BFD_RELOC_MICROBLAZE_COPY: howto manager. (line 2482) +* BFD_RELOC_M32C_HI8: howto manager. (line 1097) +* BFD_RELOC_M32C_RL_1ADDR: howto manager. (line 1099) +* BFD_RELOC_M32C_RL_2ADDR: howto manager. (line 1100) +* BFD_RELOC_M32C_RL_JUMP: howto manager. (line 1098) +* BFD_RELOC_M32R_10_PCREL: howto manager. (line 1105) +* BFD_RELOC_M32R_18_PCREL: howto manager. (line 1108) +* BFD_RELOC_M32R_24: howto manager. (line 1102) +* BFD_RELOC_M32R_26_PCREL: howto manager. (line 1110) +* BFD_RELOC_M32R_26_PLTREL: howto manager. (line 1124) +* BFD_RELOC_M32R_COPY: howto manager. (line 1125) +* BFD_RELOC_M32R_GLOB_DAT: howto manager. (line 1126) +* BFD_RELOC_M32R_GOT16_HI_SLO: howto manager. (line 1135) +* BFD_RELOC_M32R_GOT16_HI_ULO: howto manager. (line 1134) +* BFD_RELOC_M32R_GOT16_LO: howto manager. (line 1136) +* BFD_RELOC_M32R_GOT24: howto manager. (line 1123) +* BFD_RELOC_M32R_GOTOFF: howto manager. (line 1129) +* BFD_RELOC_M32R_GOTOFF_HI_SLO: howto manager. (line 1131) +* BFD_RELOC_M32R_GOTOFF_HI_ULO: howto manager. (line 1130) +* BFD_RELOC_M32R_GOTOFF_LO: howto manager. (line 1132) +* BFD_RELOC_M32R_GOTPC24: howto manager. (line 1133) +* BFD_RELOC_M32R_GOTPC_HI_SLO: howto manager. (line 1138) +* BFD_RELOC_M32R_GOTPC_HI_ULO: howto manager. (line 1137) +* BFD_RELOC_M32R_GOTPC_LO: howto manager. (line 1139) +* BFD_RELOC_M32R_HI16_SLO: howto manager. (line 1115) +* BFD_RELOC_M32R_HI16_ULO: howto manager. (line 1112) +* BFD_RELOC_M32R_JMP_SLOT: howto manager. (line 1127) +* BFD_RELOC_M32R_LO16: howto manager. (line 1118) +* BFD_RELOC_M32R_RELATIVE: howto manager. (line 1128) +* BFD_RELOC_M32R_SDA16: howto manager. (line 1120) +* BFD_RELOC_M68HC11_24: howto manager. (line 2009) +* BFD_RELOC_M68HC11_3B: howto manager. (line 1989) +* BFD_RELOC_M68HC11_HI8: howto manager. (line 1983) +* BFD_RELOC_M68HC11_LO16: howto manager. (line 2000) +* BFD_RELOC_M68HC11_LO8: howto manager. (line 1986) +* BFD_RELOC_M68HC11_PAGE: howto manager. (line 2005) +* BFD_RELOC_M68HC11_RL_GROUP: howto manager. (line 1996) +* BFD_RELOC_M68HC11_RL_JUMP: howto manager. (line 1991) +* BFD_RELOC_M68HC12_10_PCREL: howto manager. (line 2052) +* BFD_RELOC_M68HC12_16B: howto manager. (line 2048) +* BFD_RELOC_M68HC12_5B: howto manager. (line 2014) +* BFD_RELOC_M68HC12_9B: howto manager. (line 2046) +* BFD_RELOC_M68HC12_9_PCREL: howto manager. (line 2050) +* BFD_RELOC_M68HC12_HI8XG: howto manager. (line 2057) +* BFD_RELOC_M68HC12_LO8XG: howto manager. (line 2054) +* BFD_RELOC_MACH_O_LOCAL_SECTDIFF: howto manager. (line 2460) +* BFD_RELOC_MACH_O_PAIR: howto manager. (line 2462) +* BFD_RELOC_MACH_O_SECTDIFF: howto manager. (line 2457) +* BFD_RELOC_MACH_O_X86_64_BRANCH32: howto manager. (line 2464) +* BFD_RELOC_MACH_O_X86_64_BRANCH8: howto manager. (line 2465) +* BFD_RELOC_MACH_O_X86_64_GOT: howto manager. (line 2468) +* BFD_RELOC_MACH_O_X86_64_GOT_LOAD: howto manager. (line 2470) +* BFD_RELOC_MACH_O_X86_64_PCREL32_1: howto manager. (line 2477) +* BFD_RELOC_MACH_O_X86_64_PCREL32_2: howto manager. (line 2479) +* BFD_RELOC_MACH_O_X86_64_PCREL32_4: howto manager. (line 2481) +* BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32: howto manager. (line 2473) +* BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64: howto manager. (line 2475) +* BFD_RELOC_MCORE_PCREL_32: howto manager. (line 1477) +* BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. (line 1475) +* BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. (line 1476) +* BFD_RELOC_MCORE_PCREL_IMM8BY4: howto manager. (line 1474) +* BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: howto manager. (line 1478) +* BFD_RELOC_MCORE_RVA: howto manager. (line 1479) +* BFD_RELOC_MEP_16: howto manager. (line 1482) +* BFD_RELOC_MEP_32: howto manager. (line 1483) +* BFD_RELOC_MEP_8: howto manager. (line 1481) +* BFD_RELOC_MEP_ADDR24A4: howto manager. (line 1498) +* BFD_RELOC_MEP_GNU_VTENTRY: howto manager. (line 1500) +* BFD_RELOC_MEP_GNU_VTINHERIT: howto manager. (line 1499) +* BFD_RELOC_MEP_GPREL: howto manager. (line 1492) +* BFD_RELOC_MEP_HI16S: howto manager. (line 1491) +* BFD_RELOC_MEP_HI16U: howto manager. (line 1490) +* BFD_RELOC_MEP_LOW16: howto manager. (line 1489) +* BFD_RELOC_MEP_PCABS24A2: howto manager. (line 1488) +* BFD_RELOC_MEP_PCREL12A2: howto manager. (line 1485) +* BFD_RELOC_MEP_PCREL17A2: howto manager. (line 1486) +* BFD_RELOC_MEP_PCREL24A2: howto manager. (line 1487) +* BFD_RELOC_MEP_PCREL8A2: howto manager. (line 1484) +* BFD_RELOC_MEP_TPREL: howto manager. (line 1493) +* BFD_RELOC_MEP_TPREL7: howto manager. (line 1494) +* BFD_RELOC_MEP_TPREL7A2: howto manager. (line 1495) +* BFD_RELOC_MEP_TPREL7A4: howto manager. (line 1496) +* BFD_RELOC_MEP_UIMM24: howto manager. (line 1497) +* BFD_RELOC_METAG_COPY: howto manager. (line 1521) +* BFD_RELOC_METAG_GETSETOFF: howto manager. (line 1505) +* BFD_RELOC_METAG_GETSET_GOT: howto manager. (line 1513) +* BFD_RELOC_METAG_GETSET_GOTOFF: howto manager. (line 1512) +* BFD_RELOC_METAG_GLOB_DAT: howto manager. (line 1524) +* BFD_RELOC_METAG_GOTOFF: howto manager. (line 1519) +* BFD_RELOC_METAG_HI16_GOTOFF: howto manager. (line 1510) +* BFD_RELOC_METAG_HI16_GOTPC: howto manager. (line 1514) +* BFD_RELOC_METAG_HI16_PLT: howto manager. (line 1516) +* BFD_RELOC_METAG_HIADDR16: howto manager. (line 1502) +* BFD_RELOC_METAG_HIOG: howto manager. (line 1506) +* BFD_RELOC_METAG_JMP_SLOT: howto manager. (line 1522) +* BFD_RELOC_METAG_LO16_GOTOFF: howto manager. (line 1511) +* BFD_RELOC_METAG_LO16_GOTPC: howto manager. (line 1515) +* BFD_RELOC_METAG_LO16_PLT: howto manager. (line 1517) +* BFD_RELOC_METAG_LOADDR16: howto manager. (line 1503) +* BFD_RELOC_METAG_LOOG: howto manager. (line 1507) +* BFD_RELOC_METAG_PLT: howto manager. (line 1520) +* BFD_RELOC_METAG_REL16: howto manager. (line 1509) +* BFD_RELOC_METAG_REL8: howto manager. (line 1508) +* BFD_RELOC_METAG_RELATIVE: howto manager. (line 1523) +* BFD_RELOC_METAG_RELBRANCH: howto manager. (line 1504) +* BFD_RELOC_METAG_RELBRANCH_PLT: howto manager. (line 1518) +* BFD_RELOC_METAG_TLS_DTPMOD: howto manager. (line 1535) +* BFD_RELOC_METAG_TLS_DTPOFF: howto manager. (line 1536) +* BFD_RELOC_METAG_TLS_GD: howto manager. (line 1525) +* BFD_RELOC_METAG_TLS_IE: howto manager. (line 1530) +* BFD_RELOC_METAG_TLS_IENONPIC: howto manager. (line 1531) +* BFD_RELOC_METAG_TLS_IENONPIC_HI16: howto manager. (line 1532) +* BFD_RELOC_METAG_TLS_IENONPIC_LO16: howto manager. (line 1533) +* BFD_RELOC_METAG_TLS_LDM: howto manager. (line 1526) +* BFD_RELOC_METAG_TLS_LDO: howto manager. (line 1529) +* BFD_RELOC_METAG_TLS_LDO_HI16: howto manager. (line 1527) +* BFD_RELOC_METAG_TLS_LDO_LO16: howto manager. (line 1528) +* BFD_RELOC_METAG_TLS_LE: howto manager. (line 1537) +* BFD_RELOC_METAG_TLS_LE_HI16: howto manager. (line 1538) +* BFD_RELOC_METAG_TLS_LE_LO16: howto manager. (line 1539) +* BFD_RELOC_METAG_TLS_TPOFF: howto manager. (line 1534) +* BFD_RELOC_MICROBLAZE_32_GOTOFF: howto manager. (line 2517) +* BFD_RELOC_MICROBLAZE_32_LO: howto manager. (line 2483) +* BFD_RELOC_MICROBLAZE_32_LO_PCREL: howto manager. (line 2486) +* BFD_RELOC_MICROBLAZE_32_ROSDA: howto manager. (line 2489) +* BFD_RELOC_MICROBLAZE_32_RWSDA: howto manager. (line 2492) +* BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM: howto manager. (line 2495) +* BFD_RELOC_MICROBLAZE_32_TLSDTPMOD: howto manager. (line 2533) +* BFD_RELOC_MICROBLAZE_32_TLSDTPREL: howto manager. (line 2535) +* BFD_RELOC_MICROBLAZE_64_GOT: howto manager. (line 2506) +* BFD_RELOC_MICROBLAZE_64_GOTOFF: howto manager. (line 2513) +* BFD_RELOC_MICROBLAZE_64_GOTPC: howto manager. (line 2502) +* BFD_RELOC_MICROBLAZE_64_NONE: howto manager. (line 2498) +* BFD_RELOC_MICROBLAZE_64_PLT: howto manager. (line 2509) +* BFD_RELOC_MICROBLAZE_64_TLS: howto manager. (line 2523) +* BFD_RELOC_MICROBLAZE_64_TLSDTPREL: howto manager. (line 2537) +* BFD_RELOC_MICROBLAZE_64_TLSGD: howto manager. (line 2525) +* BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL: howto manager. (line 2540) +* BFD_RELOC_MICROBLAZE_64_TLSLD: howto manager. (line 2529) +* BFD_RELOC_MICROBLAZE_64_TLSTPREL: howto manager. (line 2543) +* BFD_RELOC_MICROBLAZE_COPY: howto manager. (line 2520) * BFD_RELOC_MICROMIPS_10_PCREL_S1: howto manager. (line 356) * BFD_RELOC_MICROMIPS_16_PCREL_S1: howto manager. (line 357) * BFD_RELOC_MICROMIPS_7_PCREL_S1: howto manager. (line 355) -* BFD_RELOC_MICROMIPS_CALL16: howto manager. (line 367) -* BFD_RELOC_MICROMIPS_CALL_HI16: howto manager. (line 373) -* BFD_RELOC_MICROMIPS_CALL_LO16: howto manager. (line 375) -* BFD_RELOC_MICROMIPS_GOT16: howto manager. (line 365) -* BFD_RELOC_MICROMIPS_GOT_DISP: howto manager. (line 383) -* BFD_RELOC_MICROMIPS_GOT_HI16: howto manager. (line 369) -* BFD_RELOC_MICROMIPS_GOT_LO16: howto manager. (line 371) -* BFD_RELOC_MICROMIPS_GOT_OFST: howto manager. (line 381) -* BFD_RELOC_MICROMIPS_GOT_PAGE: howto manager. (line 379) -* BFD_RELOC_MICROMIPS_GPREL16: howto manager. (line 359) -* BFD_RELOC_MICROMIPS_HI16: howto manager. (line 360) -* BFD_RELOC_MICROMIPS_HI16_S: howto manager. (line 361) -* BFD_RELOC_MICROMIPS_HIGHER: howto manager. (line 392) -* BFD_RELOC_MICROMIPS_HIGHEST: howto manager. (line 390) -* BFD_RELOC_MICROMIPS_JALR: howto manager. (line 398) +* BFD_RELOC_MICROMIPS_CALL16: howto manager. (line 372) +* BFD_RELOC_MICROMIPS_CALL_HI16: howto manager. (line 378) +* BFD_RELOC_MICROMIPS_CALL_LO16: howto manager. (line 380) +* BFD_RELOC_MICROMIPS_GOT16: howto manager. (line 370) +* BFD_RELOC_MICROMIPS_GOT_DISP: howto manager. (line 388) +* BFD_RELOC_MICROMIPS_GOT_HI16: howto manager. (line 374) +* BFD_RELOC_MICROMIPS_GOT_LO16: howto manager. (line 376) +* BFD_RELOC_MICROMIPS_GOT_OFST: howto manager. (line 386) +* BFD_RELOC_MICROMIPS_GOT_PAGE: howto manager. (line 384) +* BFD_RELOC_MICROMIPS_GPREL16: howto manager. (line 364) +* BFD_RELOC_MICROMIPS_HI16: howto manager. (line 365) +* BFD_RELOC_MICROMIPS_HI16_S: howto manager. (line 366) +* BFD_RELOC_MICROMIPS_HIGHER: howto manager. (line 397) +* BFD_RELOC_MICROMIPS_HIGHEST: howto manager. (line 395) +* BFD_RELOC_MICROMIPS_JALR: howto manager. (line 403) * BFD_RELOC_MICROMIPS_JMP: howto manager. (line 310) * BFD_RELOC_MICROMIPS_LITERAL: howto manager. (line 353) -* BFD_RELOC_MICROMIPS_LO16: howto manager. (line 362) -* BFD_RELOC_MICROMIPS_SCN_DISP: howto manager. (line 394) -* BFD_RELOC_MICROMIPS_SUB: howto manager. (line 377) -* BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16: howto manager. (line 408) -* BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16: howto manager. (line 410) -* BFD_RELOC_MICROMIPS_TLS_GD: howto manager. (line 404) -* BFD_RELOC_MICROMIPS_TLS_GOTTPREL: howto manager. (line 412) -* BFD_RELOC_MICROMIPS_TLS_LDM: howto manager. (line 406) -* BFD_RELOC_MICROMIPS_TLS_TPREL_HI16: howto manager. (line 416) -* BFD_RELOC_MICROMIPS_TLS_TPREL_LO16: howto manager. (line 418) +* BFD_RELOC_MICROMIPS_LO16: howto manager. (line 367) +* BFD_RELOC_MICROMIPS_SCN_DISP: howto manager. (line 399) +* BFD_RELOC_MICROMIPS_SUB: howto manager. (line 382) +* BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16: howto manager. (line 413) +* BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16: howto manager. (line 415) +* BFD_RELOC_MICROMIPS_TLS_GD: howto manager. (line 409) +* BFD_RELOC_MICROMIPS_TLS_GOTTPREL: howto manager. (line 417) +* BFD_RELOC_MICROMIPS_TLS_LDM: howto manager. (line 411) +* BFD_RELOC_MICROMIPS_TLS_TPREL_HI16: howto manager. (line 421) +* BFD_RELOC_MICROMIPS_TLS_TPREL_LO16: howto manager. (line 423) * BFD_RELOC_MIPS16_CALL16: howto manager. (line 332) * BFD_RELOC_MIPS16_GOT16: howto manager. (line 331) * BFD_RELOC_MIPS16_GPREL: howto manager. (line 314) @@ -11968,588 +12011,613 @@ BFD Index * BFD_RELOC_MIPS16_TLS_LDM: howto manager. (line 345) * BFD_RELOC_MIPS16_TLS_TPREL_HI16: howto manager. (line 349) * BFD_RELOC_MIPS16_TLS_TPREL_LO16: howto manager. (line 350) -* BFD_RELOC_MIPS_CALL16: howto manager. (line 366) -* BFD_RELOC_MIPS_CALL_HI16: howto manager. (line 372) -* BFD_RELOC_MIPS_CALL_LO16: howto manager. (line 374) -* BFD_RELOC_MIPS_COPY: howto manager. (line 421) -* BFD_RELOC_MIPS_DELETE: howto manager. (line 388) -* BFD_RELOC_MIPS_EH: howto manager. (line 419) -* BFD_RELOC_MIPS_GOT16: howto manager. (line 364) -* BFD_RELOC_MIPS_GOT_DISP: howto manager. (line 382) -* BFD_RELOC_MIPS_GOT_HI16: howto manager. (line 368) -* BFD_RELOC_MIPS_GOT_LO16: howto manager. (line 370) -* BFD_RELOC_MIPS_GOT_OFST: howto manager. (line 380) -* BFD_RELOC_MIPS_GOT_PAGE: howto manager. (line 378) -* BFD_RELOC_MIPS_HIGHER: howto manager. (line 391) -* BFD_RELOC_MIPS_HIGHEST: howto manager. (line 389) -* BFD_RELOC_MIPS_INSERT_A: howto manager. (line 386) -* BFD_RELOC_MIPS_INSERT_B: howto manager. (line 387) -* BFD_RELOC_MIPS_JALR: howto manager. (line 397) +* BFD_RELOC_MIPS_18_PCREL_S3: howto manager. (line 361) +* BFD_RELOC_MIPS_19_PCREL_S2: howto manager. (line 362) +* BFD_RELOC_MIPS_21_PCREL_S2: howto manager. (line 359) +* BFD_RELOC_MIPS_26_PCREL_S2: howto manager. (line 360) +* BFD_RELOC_MIPS_CALL16: howto manager. (line 371) +* BFD_RELOC_MIPS_CALL_HI16: howto manager. (line 377) +* BFD_RELOC_MIPS_CALL_LO16: howto manager. (line 379) +* BFD_RELOC_MIPS_COPY: howto manager. (line 426) +* BFD_RELOC_MIPS_DELETE: howto manager. (line 393) +* BFD_RELOC_MIPS_EH: howto manager. (line 424) +* BFD_RELOC_MIPS_GOT16: howto manager. (line 369) +* BFD_RELOC_MIPS_GOT_DISP: howto manager. (line 387) +* BFD_RELOC_MIPS_GOT_HI16: howto manager. (line 373) +* BFD_RELOC_MIPS_GOT_LO16: howto manager. (line 375) +* BFD_RELOC_MIPS_GOT_OFST: howto manager. (line 385) +* BFD_RELOC_MIPS_GOT_PAGE: howto manager. (line 383) +* BFD_RELOC_MIPS_HIGHER: howto manager. (line 396) +* BFD_RELOC_MIPS_HIGHEST: howto manager. (line 394) +* BFD_RELOC_MIPS_INSERT_A: howto manager. (line 391) +* BFD_RELOC_MIPS_INSERT_B: howto manager. (line 392) +* BFD_RELOC_MIPS_JALR: howto manager. (line 402) * BFD_RELOC_MIPS_JMP: howto manager. (line 309) -* BFD_RELOC_MIPS_JUMP_SLOT: howto manager. (line 422) +* BFD_RELOC_MIPS_JUMP_SLOT: howto manager. (line 427) * BFD_RELOC_MIPS_LITERAL: howto manager. (line 352) -* BFD_RELOC_MIPS_REL16: howto manager. (line 395) -* BFD_RELOC_MIPS_RELGOT: howto manager. (line 396) -* BFD_RELOC_MIPS_SCN_DISP: howto manager. (line 393) -* BFD_RELOC_MIPS_SHIFT5: howto manager. (line 384) -* BFD_RELOC_MIPS_SHIFT6: howto manager. (line 385) -* BFD_RELOC_MIPS_SUB: howto manager. (line 376) -* BFD_RELOC_MIPS_TLS_DTPMOD32: howto manager. (line 399) -* BFD_RELOC_MIPS_TLS_DTPMOD64: howto manager. (line 401) -* BFD_RELOC_MIPS_TLS_DTPREL32: howto manager. (line 400) -* BFD_RELOC_MIPS_TLS_DTPREL64: howto manager. (line 402) -* BFD_RELOC_MIPS_TLS_DTPREL_HI16: howto manager. (line 407) -* BFD_RELOC_MIPS_TLS_DTPREL_LO16: howto manager. (line 409) -* BFD_RELOC_MIPS_TLS_GD: howto manager. (line 403) -* BFD_RELOC_MIPS_TLS_GOTTPREL: howto manager. (line 411) -* BFD_RELOC_MIPS_TLS_LDM: howto manager. (line 405) -* BFD_RELOC_MIPS_TLS_TPREL32: howto manager. (line 413) -* BFD_RELOC_MIPS_TLS_TPREL64: howto manager. (line 414) -* BFD_RELOC_MIPS_TLS_TPREL_HI16: howto manager. (line 415) -* BFD_RELOC_MIPS_TLS_TPREL_LO16: howto manager. (line 417) -* BFD_RELOC_MMIX_ADDR19: howto manager. (line 1534) -* BFD_RELOC_MMIX_ADDR27: howto manager. (line 1537) -* BFD_RELOC_MMIX_BASE_PLUS_OFFSET: howto manager. (line 1546) -* BFD_RELOC_MMIX_CBRANCH: howto manager. (line 1517) -* BFD_RELOC_MMIX_CBRANCH_1: howto manager. (line 1519) -* BFD_RELOC_MMIX_CBRANCH_2: howto manager. (line 1520) -* BFD_RELOC_MMIX_CBRANCH_3: howto manager. (line 1521) -* BFD_RELOC_MMIX_CBRANCH_J: howto manager. (line 1518) -* BFD_RELOC_MMIX_GETA: howto manager. (line 1512) -* BFD_RELOC_MMIX_GETA_1: howto manager. (line 1513) -* BFD_RELOC_MMIX_GETA_2: howto manager. (line 1514) -* BFD_RELOC_MMIX_GETA_3: howto manager. (line 1515) -* BFD_RELOC_MMIX_JMP: howto manager. (line 1529) -* BFD_RELOC_MMIX_JMP_1: howto manager. (line 1530) -* BFD_RELOC_MMIX_JMP_2: howto manager. (line 1531) -* BFD_RELOC_MMIX_JMP_3: howto manager. (line 1532) -* BFD_RELOC_MMIX_LOCAL: howto manager. (line 1549) -* BFD_RELOC_MMIX_PUSHJ: howto manager. (line 1523) -* BFD_RELOC_MMIX_PUSHJ_1: howto manager. (line 1524) -* BFD_RELOC_MMIX_PUSHJ_2: howto manager. (line 1525) -* BFD_RELOC_MMIX_PUSHJ_3: howto manager. (line 1526) -* BFD_RELOC_MMIX_PUSHJ_STUBBABLE: howto manager. (line 1527) -* BFD_RELOC_MMIX_REG: howto manager. (line 1543) -* BFD_RELOC_MMIX_REG_OR_BYTE: howto manager. (line 1540) -* BFD_RELOC_MN10300_16_PCREL: howto manager. (line 505) -* BFD_RELOC_MN10300_32_PCREL: howto manager. (line 502) -* BFD_RELOC_MN10300_ALIGN: howto manager. (line 489) -* BFD_RELOC_MN10300_COPY: howto manager. (line 477) -* BFD_RELOC_MN10300_GLOB_DAT: howto manager. (line 479) -* BFD_RELOC_MN10300_GOT16: howto manager. (line 474) -* BFD_RELOC_MN10300_GOT24: howto manager. (line 471) -* BFD_RELOC_MN10300_GOT32: howto manager. (line 468) -* BFD_RELOC_MN10300_GOTOFF24: howto manager. (line 466) -* BFD_RELOC_MN10300_JMP_SLOT: howto manager. (line 481) -* BFD_RELOC_MN10300_RELATIVE: howto manager. (line 483) -* BFD_RELOC_MN10300_SYM_DIFF: howto manager. (line 485) -* BFD_RELOC_MN10300_TLS_DTPMOD: howto manager. (line 498) -* BFD_RELOC_MN10300_TLS_DTPOFF: howto manager. (line 499) -* BFD_RELOC_MN10300_TLS_GD: howto manager. (line 492) -* BFD_RELOC_MN10300_TLS_GOTIE: howto manager. (line 495) -* BFD_RELOC_MN10300_TLS_IE: howto manager. (line 496) -* BFD_RELOC_MN10300_TLS_LD: howto manager. (line 493) -* BFD_RELOC_MN10300_TLS_LDO: howto manager. (line 494) -* BFD_RELOC_MN10300_TLS_LE: howto manager. (line 497) -* BFD_RELOC_MN10300_TLS_TPOFF: howto manager. (line 500) -* BFD_RELOC_MOXIE_10_PCREL: howto manager. (line 424) -* BFD_RELOC_MSP430X_ABS16: howto manager. (line 2274) -* BFD_RELOC_MSP430X_ABS20_ADR_DST: howto manager. (line 2271) -* BFD_RELOC_MSP430X_ABS20_ADR_SRC: howto manager. (line 2270) -* BFD_RELOC_MSP430X_ABS20_EXT_DST: howto manager. (line 2268) -* BFD_RELOC_MSP430X_ABS20_EXT_ODST: howto manager. (line 2269) -* BFD_RELOC_MSP430X_ABS20_EXT_SRC: howto manager. (line 2267) -* BFD_RELOC_MSP430X_PCR16: howto manager. (line 2272) -* BFD_RELOC_MSP430X_PCR20_CALL: howto manager. (line 2273) -* BFD_RELOC_MSP430X_PCR20_EXT_DST: howto manager. (line 2265) -* BFD_RELOC_MSP430X_PCR20_EXT_ODST: howto manager. (line 2266) -* BFD_RELOC_MSP430X_PCR20_EXT_SRC: howto manager. (line 2264) -* BFD_RELOC_MSP430_10_PCREL: howto manager. (line 2256) -* BFD_RELOC_MSP430_16: howto manager. (line 2258) -* BFD_RELOC_MSP430_16_BYTE: howto manager. (line 2260) -* BFD_RELOC_MSP430_16_PCREL: howto manager. (line 2257) -* BFD_RELOC_MSP430_16_PCREL_BYTE: howto manager. (line 2259) -* BFD_RELOC_MSP430_2X_PCREL: howto manager. (line 2261) -* BFD_RELOC_MSP430_ABS8: howto manager. (line 2263) -* BFD_RELOC_MSP430_ABS_HI16: howto manager. (line 2275) -* BFD_RELOC_MSP430_PREL31: howto manager. (line 2276) -* BFD_RELOC_MSP430_RL_PCREL: howto manager. (line 2262) -* BFD_RELOC_MSP430_SYM_DIFF: howto manager. (line 2277) -* BFD_RELOC_MT_GNU_VTENTRY: howto manager. (line 2252) -* BFD_RELOC_MT_GNU_VTINHERIT: howto manager. (line 2250) -* BFD_RELOC_MT_HI16: howto manager. (line 2246) -* BFD_RELOC_MT_LO16: howto manager. (line 2248) -* BFD_RELOC_MT_PC16: howto manager. (line 2244) -* BFD_RELOC_MT_PCINSN8: howto manager. (line 2254) -* BFD_RELOC_NDS32_10IFCU_PCREL: howto manager. (line 1276) -* BFD_RELOC_NDS32_10_UPCREL: howto manager. (line 1250) -* BFD_RELOC_NDS32_15_FIXED: howto manager. (line 1218) -* BFD_RELOC_NDS32_15_PCREL: howto manager. (line 1144) -* BFD_RELOC_NDS32_17IFC_PCREL: howto manager. (line 1275) -* BFD_RELOC_NDS32_17_FIXED: howto manager. (line 1219) -* BFD_RELOC_NDS32_17_PCREL: howto manager. (line 1146) -* BFD_RELOC_NDS32_20: howto manager. (line 1136) -* BFD_RELOC_NDS32_25_ABS: howto manager. (line 1272) -* BFD_RELOC_NDS32_25_FIXED: howto manager. (line 1220) -* BFD_RELOC_NDS32_25_PCREL: howto manager. (line 1148) -* BFD_RELOC_NDS32_25_PLTREL: howto manager. (line 1194) -* BFD_RELOC_NDS32_5: howto manager. (line 1248) -* BFD_RELOC_NDS32_9_FIXED: howto manager. (line 1217) -* BFD_RELOC_NDS32_9_PCREL: howto manager. (line 1138) -* BFD_RELOC_NDS32_9_PLTREL: howto manager. (line 1193) -* BFD_RELOC_NDS32_COPY: howto manager. (line 1195) -* BFD_RELOC_NDS32_DATA: howto manager. (line 1273) -* BFD_RELOC_NDS32_DIFF16: howto manager. (line 1269) -* BFD_RELOC_NDS32_DIFF32: howto manager. (line 1270) -* BFD_RELOC_NDS32_DIFF8: howto manager. (line 1268) -* BFD_RELOC_NDS32_DIFF_ULEB128: howto manager. (line 1271) -* BFD_RELOC_NDS32_DWARF2_LEB: howto manager. (line 1234) -* BFD_RELOC_NDS32_DWARF2_OP1: howto manager. (line 1232) -* BFD_RELOC_NDS32_DWARF2_OP2: howto manager. (line 1233) -* BFD_RELOC_NDS32_GLOB_DAT: howto manager. (line 1196) -* BFD_RELOC_NDS32_GOT15S2: howto manager. (line 1245) -* BFD_RELOC_NDS32_GOT17S2: howto manager. (line 1246) -* BFD_RELOC_NDS32_GOT20: howto manager. (line 1192) -* BFD_RELOC_NDS32_GOTOFF: howto manager. (line 1199) -* BFD_RELOC_NDS32_GOTOFF_HI20: howto manager. (line 1200) -* BFD_RELOC_NDS32_GOTOFF_LO12: howto manager. (line 1201) -* BFD_RELOC_NDS32_GOTOFF_LO15: howto manager. (line 1243) -* BFD_RELOC_NDS32_GOTOFF_LO19: howto manager. (line 1244) -* BFD_RELOC_NDS32_GOTOFF_SUFF: howto manager. (line 1257) -* BFD_RELOC_NDS32_GOTPC20: howto manager. (line 1202) -* BFD_RELOC_NDS32_GOTPC_HI20: howto manager. (line 1205) -* BFD_RELOC_NDS32_GOTPC_LO12: howto manager. (line 1206) -* BFD_RELOC_NDS32_GOT_HI20: howto manager. (line 1203) -* BFD_RELOC_NDS32_GOT_LO12: howto manager. (line 1204) -* BFD_RELOC_NDS32_GOT_LO15: howto manager. (line 1241) -* BFD_RELOC_NDS32_GOT_LO19: howto manager. (line 1242) -* BFD_RELOC_NDS32_GOT_SUFF: howto manager. (line 1256) -* BFD_RELOC_NDS32_HI20: howto manager. (line 1150) -* BFD_RELOC_NDS32_INSN16: howto manager. (line 1208) -* BFD_RELOC_NDS32_JMP_SLOT: howto manager. (line 1197) -* BFD_RELOC_NDS32_LABEL: howto manager. (line 1209) -* BFD_RELOC_NDS32_LO12S0: howto manager. (line 1162) -* BFD_RELOC_NDS32_LO12S0_ORI: howto manager. (line 1165) -* BFD_RELOC_NDS32_LO12S1: howto manager. (line 1159) -* BFD_RELOC_NDS32_LO12S2: howto manager. (line 1156) -* BFD_RELOC_NDS32_LO12S2_DP: howto manager. (line 1229) -* BFD_RELOC_NDS32_LO12S2_SP: howto manager. (line 1230) -* BFD_RELOC_NDS32_LO12S3: howto manager. (line 1153) -* BFD_RELOC_NDS32_LOADSTORE: howto manager. (line 1216) -* BFD_RELOC_NDS32_LONGCALL1: howto manager. (line 1210) -* BFD_RELOC_NDS32_LONGCALL2: howto manager. (line 1211) -* BFD_RELOC_NDS32_LONGCALL3: howto manager. (line 1212) -* BFD_RELOC_NDS32_LONGJUMP1: howto manager. (line 1213) -* BFD_RELOC_NDS32_LONGJUMP2: howto manager. (line 1214) -* BFD_RELOC_NDS32_LONGJUMP3: howto manager. (line 1215) -* BFD_RELOC_NDS32_MINUEND: howto manager. (line 1266) -* BFD_RELOC_NDS32_MULCALL_SUFF: howto manager. (line 1259) -* BFD_RELOC_NDS32_PLTBLOCK: howto manager. (line 1263) -* BFD_RELOC_NDS32_PLTREL_HI20: howto manager. (line 1222) -* BFD_RELOC_NDS32_PLTREL_LO12: howto manager. (line 1223) -* BFD_RELOC_NDS32_PLT_GOTREL_HI20: howto manager. (line 1224) -* BFD_RELOC_NDS32_PLT_GOTREL_LO12: howto manager. (line 1225) -* BFD_RELOC_NDS32_PLT_GOTREL_LO15: howto manager. (line 1239) -* BFD_RELOC_NDS32_PLT_GOTREL_LO19: howto manager. (line 1240) -* BFD_RELOC_NDS32_PLT_GOTREL_LO20: howto manager. (line 1238) -* BFD_RELOC_NDS32_PLT_GOT_SUFF: howto manager. (line 1258) -* BFD_RELOC_NDS32_PTR: howto manager. (line 1260) -* BFD_RELOC_NDS32_PTR_COUNT: howto manager. (line 1261) -* BFD_RELOC_NDS32_PTR_RESOLVED: howto manager. (line 1262) -* BFD_RELOC_NDS32_RELATIVE: howto manager. (line 1198) -* BFD_RELOC_NDS32_RELAX_ENTRY: howto manager. (line 1255) -* BFD_RELOC_NDS32_RELAX_REGION_BEGIN: howto manager. (line 1264) -* BFD_RELOC_NDS32_RELAX_REGION_END: howto manager. (line 1265) -* BFD_RELOC_NDS32_SDA12S2_DP: howto manager. (line 1227) -* BFD_RELOC_NDS32_SDA12S2_SP: howto manager. (line 1228) -* BFD_RELOC_NDS32_SDA15S0: howto manager. (line 1177) -* BFD_RELOC_NDS32_SDA15S1: howto manager. (line 1174) -* BFD_RELOC_NDS32_SDA15S2: howto manager. (line 1171) -* BFD_RELOC_NDS32_SDA15S3: howto manager. (line 1168) -* BFD_RELOC_NDS32_SDA16S3: howto manager. (line 1180) -* BFD_RELOC_NDS32_SDA17S2: howto manager. (line 1183) -* BFD_RELOC_NDS32_SDA18S1: howto manager. (line 1186) -* BFD_RELOC_NDS32_SDA19S0: howto manager. (line 1189) -* BFD_RELOC_NDS32_SDA_FP7U2_RELA: howto manager. (line 1253) -* BFD_RELOC_NDS32_SUBTRAHEND: howto manager. (line 1267) -* BFD_RELOC_NDS32_TRAN: howto manager. (line 1274) -* BFD_RELOC_NDS32_UPDATE_TA: howto manager. (line 1236) -* BFD_RELOC_NDS32_WORD_9_PCREL: howto manager. (line 1141) -* BFD_RELOC_NIOS2_ALIGN: howto manager. (line 2293) -* BFD_RELOC_NIOS2_CACHE_OPX: howto manager. (line 2283) -* BFD_RELOC_NIOS2_CALL16: howto manager. (line 2295) -* BFD_RELOC_NIOS2_CALL26: howto manager. (line 2281) -* BFD_RELOC_NIOS2_CALL26_NOAT: howto manager. (line 2313) -* BFD_RELOC_NIOS2_CALLR: howto manager. (line 2292) -* BFD_RELOC_NIOS2_CALL_HA: howto manager. (line 2317) -* BFD_RELOC_NIOS2_CALL_LO: howto manager. (line 2316) -* BFD_RELOC_NIOS2_CJMP: howto manager. (line 2291) -* BFD_RELOC_NIOS2_COPY: howto manager. (line 2308) -* BFD_RELOC_NIOS2_GLOB_DAT: howto manager. (line 2309) -* BFD_RELOC_NIOS2_GOT16: howto manager. (line 2294) -* BFD_RELOC_NIOS2_GOTOFF: howto manager. (line 2312) -* BFD_RELOC_NIOS2_GOTOFF_HA: howto manager. (line 2297) -* BFD_RELOC_NIOS2_GOTOFF_LO: howto manager. (line 2296) -* BFD_RELOC_NIOS2_GOT_HA: howto manager. (line 2315) -* BFD_RELOC_NIOS2_GOT_LO: howto manager. (line 2314) -* BFD_RELOC_NIOS2_GPREL: howto manager. (line 2289) -* BFD_RELOC_NIOS2_HI16: howto manager. (line 2286) -* BFD_RELOC_NIOS2_HIADJ16: howto manager. (line 2288) -* BFD_RELOC_NIOS2_IMM5: howto manager. (line 2282) -* BFD_RELOC_NIOS2_IMM6: howto manager. (line 2284) -* BFD_RELOC_NIOS2_IMM8: howto manager. (line 2285) -* BFD_RELOC_NIOS2_JUMP_SLOT: howto manager. (line 2310) -* BFD_RELOC_NIOS2_LO16: howto manager. (line 2287) -* BFD_RELOC_NIOS2_PCREL_HA: howto manager. (line 2299) -* BFD_RELOC_NIOS2_PCREL_LO: howto manager. (line 2298) -* BFD_RELOC_NIOS2_RELATIVE: howto manager. (line 2311) -* BFD_RELOC_NIOS2_S16: howto manager. (line 2279) -* BFD_RELOC_NIOS2_TLS_DTPMOD: howto manager. (line 2305) -* BFD_RELOC_NIOS2_TLS_DTPREL: howto manager. (line 2306) -* BFD_RELOC_NIOS2_TLS_GD16: howto manager. (line 2300) -* BFD_RELOC_NIOS2_TLS_IE16: howto manager. (line 2303) -* BFD_RELOC_NIOS2_TLS_LDM16: howto manager. (line 2301) -* BFD_RELOC_NIOS2_TLS_LDO16: howto manager. (line 2302) -* BFD_RELOC_NIOS2_TLS_LE16: howto manager. (line 2304) -* BFD_RELOC_NIOS2_TLS_TPREL: howto manager. (line 2307) -* BFD_RELOC_NIOS2_U16: howto manager. (line 2280) -* BFD_RELOC_NIOS2_UJMP: howto manager. (line 2290) +* BFD_RELOC_MIPS_REL16: howto manager. (line 400) +* BFD_RELOC_MIPS_RELGOT: howto manager. (line 401) +* BFD_RELOC_MIPS_SCN_DISP: howto manager. (line 398) +* BFD_RELOC_MIPS_SHIFT5: howto manager. (line 389) +* BFD_RELOC_MIPS_SHIFT6: howto manager. (line 390) +* BFD_RELOC_MIPS_SUB: howto manager. (line 381) +* BFD_RELOC_MIPS_TLS_DTPMOD32: howto manager. (line 404) +* BFD_RELOC_MIPS_TLS_DTPMOD64: howto manager. (line 406) +* BFD_RELOC_MIPS_TLS_DTPREL32: howto manager. (line 405) +* BFD_RELOC_MIPS_TLS_DTPREL64: howto manager. (line 407) +* BFD_RELOC_MIPS_TLS_DTPREL_HI16: howto manager. (line 412) +* BFD_RELOC_MIPS_TLS_DTPREL_LO16: howto manager. (line 414) +* BFD_RELOC_MIPS_TLS_GD: howto manager. (line 408) +* BFD_RELOC_MIPS_TLS_GOTTPREL: howto manager. (line 416) +* BFD_RELOC_MIPS_TLS_LDM: howto manager. (line 410) +* BFD_RELOC_MIPS_TLS_TPREL32: howto manager. (line 418) +* BFD_RELOC_MIPS_TLS_TPREL64: howto manager. (line 419) +* BFD_RELOC_MIPS_TLS_TPREL_HI16: howto manager. (line 420) +* BFD_RELOC_MIPS_TLS_TPREL_LO16: howto manager. (line 422) +* BFD_RELOC_MMIX_ADDR19: howto manager. (line 1563) +* BFD_RELOC_MMIX_ADDR27: howto manager. (line 1566) +* BFD_RELOC_MMIX_BASE_PLUS_OFFSET: howto manager. (line 1575) +* BFD_RELOC_MMIX_CBRANCH: howto manager. (line 1546) +* BFD_RELOC_MMIX_CBRANCH_1: howto manager. (line 1548) +* BFD_RELOC_MMIX_CBRANCH_2: howto manager. (line 1549) +* BFD_RELOC_MMIX_CBRANCH_3: howto manager. (line 1550) +* BFD_RELOC_MMIX_CBRANCH_J: howto manager. (line 1547) +* BFD_RELOC_MMIX_GETA: howto manager. (line 1541) +* BFD_RELOC_MMIX_GETA_1: howto manager. (line 1542) +* BFD_RELOC_MMIX_GETA_2: howto manager. (line 1543) +* BFD_RELOC_MMIX_GETA_3: howto manager. (line 1544) +* BFD_RELOC_MMIX_JMP: howto manager. (line 1558) +* BFD_RELOC_MMIX_JMP_1: howto manager. (line 1559) +* BFD_RELOC_MMIX_JMP_2: howto manager. (line 1560) +* BFD_RELOC_MMIX_JMP_3: howto manager. (line 1561) +* BFD_RELOC_MMIX_LOCAL: howto manager. (line 1578) +* BFD_RELOC_MMIX_PUSHJ: howto manager. (line 1552) +* BFD_RELOC_MMIX_PUSHJ_1: howto manager. (line 1553) +* BFD_RELOC_MMIX_PUSHJ_2: howto manager. (line 1554) +* BFD_RELOC_MMIX_PUSHJ_3: howto manager. (line 1555) +* BFD_RELOC_MMIX_PUSHJ_STUBBABLE: howto manager. (line 1556) +* BFD_RELOC_MMIX_REG: howto manager. (line 1572) +* BFD_RELOC_MMIX_REG_OR_BYTE: howto manager. (line 1569) +* BFD_RELOC_MN10300_16_PCREL: howto manager. (line 510) +* BFD_RELOC_MN10300_32_PCREL: howto manager. (line 507) +* BFD_RELOC_MN10300_ALIGN: howto manager. (line 494) +* BFD_RELOC_MN10300_COPY: howto manager. (line 482) +* BFD_RELOC_MN10300_GLOB_DAT: howto manager. (line 484) +* BFD_RELOC_MN10300_GOT16: howto manager. (line 479) +* BFD_RELOC_MN10300_GOT24: howto manager. (line 476) +* BFD_RELOC_MN10300_GOT32: howto manager. (line 473) +* BFD_RELOC_MN10300_GOTOFF24: howto manager. (line 471) +* BFD_RELOC_MN10300_JMP_SLOT: howto manager. (line 486) +* BFD_RELOC_MN10300_RELATIVE: howto manager. (line 488) +* BFD_RELOC_MN10300_SYM_DIFF: howto manager. (line 490) +* BFD_RELOC_MN10300_TLS_DTPMOD: howto manager. (line 503) +* BFD_RELOC_MN10300_TLS_DTPOFF: howto manager. (line 504) +* BFD_RELOC_MN10300_TLS_GD: howto manager. (line 497) +* BFD_RELOC_MN10300_TLS_GOTIE: howto manager. (line 500) +* BFD_RELOC_MN10300_TLS_IE: howto manager. (line 501) +* BFD_RELOC_MN10300_TLS_LD: howto manager. (line 498) +* BFD_RELOC_MN10300_TLS_LDO: howto manager. (line 499) +* BFD_RELOC_MN10300_TLS_LE: howto manager. (line 502) +* BFD_RELOC_MN10300_TLS_TPOFF: howto manager. (line 505) +* BFD_RELOC_MOXIE_10_PCREL: howto manager. (line 429) +* BFD_RELOC_MSP430X_ABS16: howto manager. (line 2312) +* BFD_RELOC_MSP430X_ABS20_ADR_DST: howto manager. (line 2309) +* BFD_RELOC_MSP430X_ABS20_ADR_SRC: howto manager. (line 2308) +* BFD_RELOC_MSP430X_ABS20_EXT_DST: howto manager. (line 2306) +* BFD_RELOC_MSP430X_ABS20_EXT_ODST: howto manager. (line 2307) +* BFD_RELOC_MSP430X_ABS20_EXT_SRC: howto manager. (line 2305) +* BFD_RELOC_MSP430X_PCR16: howto manager. (line 2310) +* BFD_RELOC_MSP430X_PCR20_CALL: howto manager. (line 2311) +* BFD_RELOC_MSP430X_PCR20_EXT_DST: howto manager. (line 2303) +* BFD_RELOC_MSP430X_PCR20_EXT_ODST: howto manager. (line 2304) +* BFD_RELOC_MSP430X_PCR20_EXT_SRC: howto manager. (line 2302) +* BFD_RELOC_MSP430_10_PCREL: howto manager. (line 2294) +* BFD_RELOC_MSP430_16: howto manager. (line 2296) +* BFD_RELOC_MSP430_16_BYTE: howto manager. (line 2298) +* BFD_RELOC_MSP430_16_PCREL: howto manager. (line 2295) +* BFD_RELOC_MSP430_16_PCREL_BYTE: howto manager. (line 2297) +* BFD_RELOC_MSP430_2X_PCREL: howto manager. (line 2299) +* BFD_RELOC_MSP430_ABS8: howto manager. (line 2301) +* BFD_RELOC_MSP430_ABS_HI16: howto manager. (line 2313) +* BFD_RELOC_MSP430_PREL31: howto manager. (line 2314) +* BFD_RELOC_MSP430_RL_PCREL: howto manager. (line 2300) +* BFD_RELOC_MSP430_SYM_DIFF: howto manager. (line 2315) +* BFD_RELOC_MT_GNU_VTENTRY: howto manager. (line 2290) +* BFD_RELOC_MT_GNU_VTINHERIT: howto manager. (line 2288) +* BFD_RELOC_MT_HI16: howto manager. (line 2284) +* BFD_RELOC_MT_LO16: howto manager. (line 2286) +* BFD_RELOC_MT_PC16: howto manager. (line 2282) +* BFD_RELOC_MT_PCINSN8: howto manager. (line 2292) +* BFD_RELOC_NDS32_10IFCU_PCREL: howto manager. (line 1291) +* BFD_RELOC_NDS32_10_UPCREL: howto manager. (line 1262) +* BFD_RELOC_NDS32_15_FIXED: howto manager. (line 1223) +* BFD_RELOC_NDS32_15_PCREL: howto manager. (line 1149) +* BFD_RELOC_NDS32_17IFC_PCREL: howto manager. (line 1290) +* BFD_RELOC_NDS32_17_FIXED: howto manager. (line 1224) +* BFD_RELOC_NDS32_17_PCREL: howto manager. (line 1151) +* BFD_RELOC_NDS32_20: howto manager. (line 1141) +* BFD_RELOC_NDS32_25_ABS: howto manager. (line 1286) +* BFD_RELOC_NDS32_25_FIXED: howto manager. (line 1225) +* BFD_RELOC_NDS32_25_PCREL: howto manager. (line 1153) +* BFD_RELOC_NDS32_25_PLTREL: howto manager. (line 1199) +* BFD_RELOC_NDS32_5: howto manager. (line 1260) +* BFD_RELOC_NDS32_9_FIXED: howto manager. (line 1222) +* BFD_RELOC_NDS32_9_PCREL: howto manager. (line 1143) +* BFD_RELOC_NDS32_9_PLTREL: howto manager. (line 1198) +* BFD_RELOC_NDS32_COPY: howto manager. (line 1200) +* BFD_RELOC_NDS32_DATA: howto manager. (line 1288) +* BFD_RELOC_NDS32_DIFF16: howto manager. (line 1281) +* BFD_RELOC_NDS32_DIFF32: howto manager. (line 1282) +* BFD_RELOC_NDS32_DIFF8: howto manager. (line 1280) +* BFD_RELOC_NDS32_DIFF_ULEB128: howto manager. (line 1283) +* BFD_RELOC_NDS32_DWARF2_LEB: howto manager. (line 1246) +* BFD_RELOC_NDS32_DWARF2_OP1: howto manager. (line 1244) +* BFD_RELOC_NDS32_DWARF2_OP2: howto manager. (line 1245) +* BFD_RELOC_NDS32_EMPTY: howto manager. (line 1284) +* BFD_RELOC_NDS32_GLOB_DAT: howto manager. (line 1201) +* BFD_RELOC_NDS32_GOT15S2: howto manager. (line 1257) +* BFD_RELOC_NDS32_GOT17S2: howto manager. (line 1258) +* BFD_RELOC_NDS32_GOT20: howto manager. (line 1197) +* BFD_RELOC_NDS32_GOTOFF: howto manager. (line 1204) +* BFD_RELOC_NDS32_GOTOFF_HI20: howto manager. (line 1205) +* BFD_RELOC_NDS32_GOTOFF_LO12: howto manager. (line 1206) +* BFD_RELOC_NDS32_GOTOFF_LO15: howto manager. (line 1255) +* BFD_RELOC_NDS32_GOTOFF_LO19: howto manager. (line 1256) +* BFD_RELOC_NDS32_GOTOFF_SUFF: howto manager. (line 1269) +* BFD_RELOC_NDS32_GOTPC20: howto manager. (line 1207) +* BFD_RELOC_NDS32_GOTPC_HI20: howto manager. (line 1210) +* BFD_RELOC_NDS32_GOTPC_LO12: howto manager. (line 1211) +* BFD_RELOC_NDS32_GOTTPOFF: howto manager. (line 1298) +* BFD_RELOC_NDS32_GOT_HI20: howto manager. (line 1208) +* BFD_RELOC_NDS32_GOT_LO12: howto manager. (line 1209) +* BFD_RELOC_NDS32_GOT_LO15: howto manager. (line 1253) +* BFD_RELOC_NDS32_GOT_LO19: howto manager. (line 1254) +* BFD_RELOC_NDS32_GOT_SUFF: howto manager. (line 1268) +* BFD_RELOC_NDS32_HI20: howto manager. (line 1155) +* BFD_RELOC_NDS32_INSN16: howto manager. (line 1213) +* BFD_RELOC_NDS32_JMP_SLOT: howto manager. (line 1202) +* BFD_RELOC_NDS32_LABEL: howto manager. (line 1214) +* BFD_RELOC_NDS32_LO12S0: howto manager. (line 1167) +* BFD_RELOC_NDS32_LO12S0_ORI: howto manager. (line 1170) +* BFD_RELOC_NDS32_LO12S1: howto manager. (line 1164) +* BFD_RELOC_NDS32_LO12S2: howto manager. (line 1161) +* BFD_RELOC_NDS32_LO12S2_DP: howto manager. (line 1241) +* BFD_RELOC_NDS32_LO12S2_SP: howto manager. (line 1242) +* BFD_RELOC_NDS32_LO12S3: howto manager. (line 1158) +* BFD_RELOC_NDS32_LOADSTORE: howto manager. (line 1221) +* BFD_RELOC_NDS32_LONGCALL1: howto manager. (line 1215) +* BFD_RELOC_NDS32_LONGCALL2: howto manager. (line 1216) +* BFD_RELOC_NDS32_LONGCALL3: howto manager. (line 1217) +* BFD_RELOC_NDS32_LONGCALL4: howto manager. (line 1226) +* BFD_RELOC_NDS32_LONGCALL5: howto manager. (line 1227) +* BFD_RELOC_NDS32_LONGCALL6: howto manager. (line 1228) +* BFD_RELOC_NDS32_LONGJUMP1: howto manager. (line 1218) +* BFD_RELOC_NDS32_LONGJUMP2: howto manager. (line 1219) +* BFD_RELOC_NDS32_LONGJUMP3: howto manager. (line 1220) +* BFD_RELOC_NDS32_LONGJUMP4: howto manager. (line 1229) +* BFD_RELOC_NDS32_LONGJUMP5: howto manager. (line 1230) +* BFD_RELOC_NDS32_LONGJUMP6: howto manager. (line 1231) +* BFD_RELOC_NDS32_LONGJUMP7: howto manager. (line 1232) +* BFD_RELOC_NDS32_MINUEND: howto manager. (line 1278) +* BFD_RELOC_NDS32_MULCALL_SUFF: howto manager. (line 1271) +* BFD_RELOC_NDS32_PLTBLOCK: howto manager. (line 1275) +* BFD_RELOC_NDS32_PLTREL_HI20: howto manager. (line 1234) +* BFD_RELOC_NDS32_PLTREL_LO12: howto manager. (line 1235) +* BFD_RELOC_NDS32_PLT_GOTREL_HI20: howto manager. (line 1236) +* BFD_RELOC_NDS32_PLT_GOTREL_LO12: howto manager. (line 1237) +* BFD_RELOC_NDS32_PLT_GOTREL_LO15: howto manager. (line 1251) +* BFD_RELOC_NDS32_PLT_GOTREL_LO19: howto manager. (line 1252) +* BFD_RELOC_NDS32_PLT_GOTREL_LO20: howto manager. (line 1250) +* BFD_RELOC_NDS32_PLT_GOT_SUFF: howto manager. (line 1270) +* BFD_RELOC_NDS32_PTR: howto manager. (line 1272) +* BFD_RELOC_NDS32_PTR_COUNT: howto manager. (line 1273) +* BFD_RELOC_NDS32_PTR_RESOLVED: howto manager. (line 1274) +* BFD_RELOC_NDS32_RELATIVE: howto manager. (line 1203) +* BFD_RELOC_NDS32_RELAX_ENTRY: howto manager. (line 1267) +* BFD_RELOC_NDS32_RELAX_REGION_BEGIN: howto manager. (line 1276) +* BFD_RELOC_NDS32_RELAX_REGION_END: howto manager. (line 1277) +* BFD_RELOC_NDS32_SDA12S2_DP: howto manager. (line 1239) +* BFD_RELOC_NDS32_SDA12S2_SP: howto manager. (line 1240) +* BFD_RELOC_NDS32_SDA15S0: howto manager. (line 1182) +* BFD_RELOC_NDS32_SDA15S1: howto manager. (line 1179) +* BFD_RELOC_NDS32_SDA15S2: howto manager. (line 1176) +* BFD_RELOC_NDS32_SDA15S3: howto manager. (line 1173) +* BFD_RELOC_NDS32_SDA16S3: howto manager. (line 1185) +* BFD_RELOC_NDS32_SDA17S2: howto manager. (line 1188) +* BFD_RELOC_NDS32_SDA18S1: howto manager. (line 1191) +* BFD_RELOC_NDS32_SDA19S0: howto manager. (line 1194) +* BFD_RELOC_NDS32_SDA_FP7U2_RELA: howto manager. (line 1265) +* BFD_RELOC_NDS32_SUBTRAHEND: howto manager. (line 1279) +* BFD_RELOC_NDS32_TLS_IE_HI20: howto manager. (line 1299) +* BFD_RELOC_NDS32_TLS_IE_LO12S2: howto manager. (line 1300) +* BFD_RELOC_NDS32_TLS_LE_15S0: howto manager. (line 1303) +* BFD_RELOC_NDS32_TLS_LE_15S1: howto manager. (line 1304) +* BFD_RELOC_NDS32_TLS_LE_15S2: howto manager. (line 1305) +* BFD_RELOC_NDS32_TLS_LE_20: howto manager. (line 1302) +* BFD_RELOC_NDS32_TLS_LE_ADD: howto manager. (line 1296) +* BFD_RELOC_NDS32_TLS_LE_HI20: howto manager. (line 1294) +* BFD_RELOC_NDS32_TLS_LE_LO12: howto manager. (line 1295) +* BFD_RELOC_NDS32_TLS_LE_LS: howto manager. (line 1297) +* BFD_RELOC_NDS32_TLS_TPOFF: howto manager. (line 1301) +* BFD_RELOC_NDS32_TPOFF: howto manager. (line 1293) +* BFD_RELOC_NDS32_TRAN: howto manager. (line 1289) +* BFD_RELOC_NDS32_UPDATE_TA: howto manager. (line 1248) +* BFD_RELOC_NDS32_WORD_9_PCREL: howto manager. (line 1146) +* BFD_RELOC_NIOS2_ALIGN: howto manager. (line 2331) +* BFD_RELOC_NIOS2_CACHE_OPX: howto manager. (line 2321) +* BFD_RELOC_NIOS2_CALL16: howto manager. (line 2333) +* BFD_RELOC_NIOS2_CALL26: howto manager. (line 2319) +* BFD_RELOC_NIOS2_CALL26_NOAT: howto manager. (line 2351) +* BFD_RELOC_NIOS2_CALLR: howto manager. (line 2330) +* BFD_RELOC_NIOS2_CALL_HA: howto manager. (line 2355) +* BFD_RELOC_NIOS2_CALL_LO: howto manager. (line 2354) +* BFD_RELOC_NIOS2_CJMP: howto manager. (line 2329) +* BFD_RELOC_NIOS2_COPY: howto manager. (line 2346) +* BFD_RELOC_NIOS2_GLOB_DAT: howto manager. (line 2347) +* BFD_RELOC_NIOS2_GOT16: howto manager. (line 2332) +* BFD_RELOC_NIOS2_GOTOFF: howto manager. (line 2350) +* BFD_RELOC_NIOS2_GOTOFF_HA: howto manager. (line 2335) +* BFD_RELOC_NIOS2_GOTOFF_LO: howto manager. (line 2334) +* BFD_RELOC_NIOS2_GOT_HA: howto manager. (line 2353) +* BFD_RELOC_NIOS2_GOT_LO: howto manager. (line 2352) +* BFD_RELOC_NIOS2_GPREL: howto manager. (line 2327) +* BFD_RELOC_NIOS2_HI16: howto manager. (line 2324) +* BFD_RELOC_NIOS2_HIADJ16: howto manager. (line 2326) +* BFD_RELOC_NIOS2_IMM5: howto manager. (line 2320) +* BFD_RELOC_NIOS2_IMM6: howto manager. (line 2322) +* BFD_RELOC_NIOS2_IMM8: howto manager. (line 2323) +* BFD_RELOC_NIOS2_JUMP_SLOT: howto manager. (line 2348) +* BFD_RELOC_NIOS2_LO16: howto manager. (line 2325) +* BFD_RELOC_NIOS2_PCREL_HA: howto manager. (line 2337) +* BFD_RELOC_NIOS2_PCREL_LO: howto manager. (line 2336) +* BFD_RELOC_NIOS2_RELATIVE: howto manager. (line 2349) +* BFD_RELOC_NIOS2_S16: howto manager. (line 2317) +* BFD_RELOC_NIOS2_TLS_DTPMOD: howto manager. (line 2343) +* BFD_RELOC_NIOS2_TLS_DTPREL: howto manager. (line 2344) +* BFD_RELOC_NIOS2_TLS_GD16: howto manager. (line 2338) +* BFD_RELOC_NIOS2_TLS_IE16: howto manager. (line 2341) +* BFD_RELOC_NIOS2_TLS_LDM16: howto manager. (line 2339) +* BFD_RELOC_NIOS2_TLS_LDO16: howto manager. (line 2340) +* BFD_RELOC_NIOS2_TLS_LE16: howto manager. (line 2342) +* BFD_RELOC_NIOS2_TLS_TPREL: howto manager. (line 2345) +* BFD_RELOC_NIOS2_U16: howto manager. (line 2318) +* BFD_RELOC_NIOS2_UJMP: howto manager. (line 2328) * BFD_RELOC_NONE: howto manager. (line 122) -* BFD_RELOC_NS32K_DISP_16: howto manager. (line 570) -* BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. (line 573) -* BFD_RELOC_NS32K_DISP_32: howto manager. (line 571) -* BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. (line 574) -* BFD_RELOC_NS32K_DISP_8: howto manager. (line 569) -* BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. (line 572) -* BFD_RELOC_NS32K_IMM_16: howto manager. (line 564) -* BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. (line 567) -* BFD_RELOC_NS32K_IMM_32: howto manager. (line 565) -* BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. (line 568) -* BFD_RELOC_NS32K_IMM_8: howto manager. (line 563) -* BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. (line 566) -* BFD_RELOC_OR1K_COPY: howto manager. (line 2203) -* BFD_RELOC_OR1K_GLOB_DAT: howto manager. (line 2204) -* BFD_RELOC_OR1K_GOT16: howto manager. (line 2199) -* BFD_RELOC_OR1K_GOTOFF_HI16: howto manager. (line 2201) -* BFD_RELOC_OR1K_GOTOFF_LO16: howto manager. (line 2202) -* BFD_RELOC_OR1K_GOTPC_HI16: howto manager. (line 2197) -* BFD_RELOC_OR1K_GOTPC_LO16: howto manager. (line 2198) -* BFD_RELOC_OR1K_JMP_SLOT: howto manager. (line 2205) -* BFD_RELOC_OR1K_PLT26: howto manager. (line 2200) -* BFD_RELOC_OR1K_RELATIVE: howto manager. (line 2206) -* BFD_RELOC_OR1K_REL_26: howto manager. (line 2196) -* BFD_RELOC_OR1K_TLS_DTPMOD: howto manager. (line 2219) -* BFD_RELOC_OR1K_TLS_DTPOFF: howto manager. (line 2218) -* BFD_RELOC_OR1K_TLS_GD_HI16: howto manager. (line 2207) -* BFD_RELOC_OR1K_TLS_GD_LO16: howto manager. (line 2208) -* BFD_RELOC_OR1K_TLS_IE_HI16: howto manager. (line 2213) -* BFD_RELOC_OR1K_TLS_IE_LO16: howto manager. (line 2214) -* BFD_RELOC_OR1K_TLS_LDM_HI16: howto manager. (line 2209) -* BFD_RELOC_OR1K_TLS_LDM_LO16: howto manager. (line 2210) -* BFD_RELOC_OR1K_TLS_LDO_HI16: howto manager. (line 2211) -* BFD_RELOC_OR1K_TLS_LDO_LO16: howto manager. (line 2212) -* BFD_RELOC_OR1K_TLS_LE_HI16: howto manager. (line 2215) -* BFD_RELOC_OR1K_TLS_LE_LO16: howto manager. (line 2216) -* BFD_RELOC_OR1K_TLS_TPOFF: howto manager. (line 2217) -* BFD_RELOC_PDP11_DISP_6_PCREL: howto manager. (line 577) -* BFD_RELOC_PDP11_DISP_8_PCREL: howto manager. (line 576) -* BFD_RELOC_PJ_CODE_DIR16: howto manager. (line 581) -* BFD_RELOC_PJ_CODE_DIR32: howto manager. (line 582) -* BFD_RELOC_PJ_CODE_HI16: howto manager. (line 579) -* BFD_RELOC_PJ_CODE_LO16: howto manager. (line 580) -* BFD_RELOC_PJ_CODE_REL16: howto manager. (line 583) -* BFD_RELOC_PJ_CODE_REL32: howto manager. (line 584) -* BFD_RELOC_PPC64_ADDR16_DS: howto manager. (line 645) -* BFD_RELOC_PPC64_ADDR16_HIGH: howto manager. (line 656) -* BFD_RELOC_PPC64_ADDR16_HIGHA: howto manager. (line 657) -* BFD_RELOC_PPC64_ADDR16_LO_DS: howto manager. (line 646) -* BFD_RELOC_PPC64_ADDR64_LOCAL: howto manager. (line 658) -* BFD_RELOC_PPC64_DTPREL16_DS: howto manager. (line 696) -* BFD_RELOC_PPC64_DTPREL16_HIGH: howto manager. (line 704) -* BFD_RELOC_PPC64_DTPREL16_HIGHA: howto manager. (line 705) -* BFD_RELOC_PPC64_DTPREL16_HIGHER: howto manager. (line 698) -* BFD_RELOC_PPC64_DTPREL16_HIGHERA: howto manager. (line 699) -* BFD_RELOC_PPC64_DTPREL16_HIGHEST: howto manager. (line 700) -* BFD_RELOC_PPC64_DTPREL16_HIGHESTA: howto manager. (line 701) -* BFD_RELOC_PPC64_DTPREL16_LO_DS: howto manager. (line 697) -* BFD_RELOC_PPC64_GOT16_DS: howto manager. (line 647) -* BFD_RELOC_PPC64_GOT16_LO_DS: howto manager. (line 648) -* BFD_RELOC_PPC64_HIGHER: howto manager. (line 633) -* BFD_RELOC_PPC64_HIGHER_S: howto manager. (line 634) -* BFD_RELOC_PPC64_HIGHEST: howto manager. (line 635) -* BFD_RELOC_PPC64_HIGHEST_S: howto manager. (line 636) -* BFD_RELOC_PPC64_PLT16_LO_DS: howto manager. (line 649) -* BFD_RELOC_PPC64_PLTGOT16: howto manager. (line 641) -* BFD_RELOC_PPC64_PLTGOT16_DS: howto manager. (line 654) -* BFD_RELOC_PPC64_PLTGOT16_HA: howto manager. (line 644) -* BFD_RELOC_PPC64_PLTGOT16_HI: howto manager. (line 643) -* BFD_RELOC_PPC64_PLTGOT16_LO: howto manager. (line 642) -* BFD_RELOC_PPC64_PLTGOT16_LO_DS: howto manager. (line 655) -* BFD_RELOC_PPC64_SECTOFF_DS: howto manager. (line 650) -* BFD_RELOC_PPC64_SECTOFF_LO_DS: howto manager. (line 651) -* BFD_RELOC_PPC64_TOC: howto manager. (line 640) -* BFD_RELOC_PPC64_TOC16_DS: howto manager. (line 652) -* BFD_RELOC_PPC64_TOC16_HA: howto manager. (line 639) -* BFD_RELOC_PPC64_TOC16_HI: howto manager. (line 638) -* BFD_RELOC_PPC64_TOC16_LO: howto manager. (line 637) -* BFD_RELOC_PPC64_TOC16_LO_DS: howto manager. (line 653) -* BFD_RELOC_PPC64_TPREL16_DS: howto manager. (line 690) -* BFD_RELOC_PPC64_TPREL16_HIGH: howto manager. (line 702) -* BFD_RELOC_PPC64_TPREL16_HIGHA: howto manager. (line 703) -* BFD_RELOC_PPC64_TPREL16_HIGHER: howto manager. (line 692) -* BFD_RELOC_PPC64_TPREL16_HIGHERA: howto manager. (line 693) -* BFD_RELOC_PPC64_TPREL16_HIGHEST: howto manager. (line 694) -* BFD_RELOC_PPC64_TPREL16_HIGHESTA: howto manager. (line 695) -* BFD_RELOC_PPC64_TPREL16_LO_DS: howto manager. (line 691) -* BFD_RELOC_PPC_B16: howto manager. (line 589) -* BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. (line 591) -* BFD_RELOC_PPC_B16_BRTAKEN: howto manager. (line 590) -* BFD_RELOC_PPC_B26: howto manager. (line 586) -* BFD_RELOC_PPC_BA16: howto manager. (line 592) -* BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. (line 594) -* BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. (line 593) -* BFD_RELOC_PPC_BA26: howto manager. (line 587) -* BFD_RELOC_PPC_COPY: howto manager. (line 595) -* BFD_RELOC_PPC_DTPMOD: howto manager. (line 663) -* BFD_RELOC_PPC_DTPREL: howto manager. (line 673) -* BFD_RELOC_PPC_DTPREL16: howto manager. (line 669) -* BFD_RELOC_PPC_DTPREL16_HA: howto manager. (line 672) -* BFD_RELOC_PPC_DTPREL16_HI: howto manager. (line 671) -* BFD_RELOC_PPC_DTPREL16_LO: howto manager. (line 670) -* BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. (line 614) -* BFD_RELOC_PPC_EMB_MRKREF: howto manager. (line 609) -* BFD_RELOC_PPC_EMB_NADDR16: howto manager. (line 601) -* BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. (line 604) -* BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. (line 603) -* BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. (line 602) -* BFD_RELOC_PPC_EMB_NADDR32: howto manager. (line 600) -* BFD_RELOC_PPC_EMB_RELSDA: howto manager. (line 615) -* BFD_RELOC_PPC_EMB_RELSEC16: howto manager. (line 610) -* BFD_RELOC_PPC_EMB_RELST_HA: howto manager. (line 613) -* BFD_RELOC_PPC_EMB_RELST_HI: howto manager. (line 612) -* BFD_RELOC_PPC_EMB_RELST_LO: howto manager. (line 611) -* BFD_RELOC_PPC_EMB_SDA21: howto manager. (line 608) -* BFD_RELOC_PPC_EMB_SDA2I16: howto manager. (line 606) -* BFD_RELOC_PPC_EMB_SDA2REL: howto manager. (line 607) -* BFD_RELOC_PPC_EMB_SDAI16: howto manager. (line 605) -* BFD_RELOC_PPC_GLOB_DAT: howto manager. (line 596) -* BFD_RELOC_PPC_GOT_DTPREL16: howto manager. (line 686) -* BFD_RELOC_PPC_GOT_DTPREL16_HA: howto manager. (line 689) -* BFD_RELOC_PPC_GOT_DTPREL16_HI: howto manager. (line 688) -* BFD_RELOC_PPC_GOT_DTPREL16_LO: howto manager. (line 687) -* BFD_RELOC_PPC_GOT_TLSGD16: howto manager. (line 674) -* BFD_RELOC_PPC_GOT_TLSGD16_HA: howto manager. (line 677) -* BFD_RELOC_PPC_GOT_TLSGD16_HI: howto manager. (line 676) -* BFD_RELOC_PPC_GOT_TLSGD16_LO: howto manager. (line 675) -* BFD_RELOC_PPC_GOT_TLSLD16: howto manager. (line 678) -* BFD_RELOC_PPC_GOT_TLSLD16_HA: howto manager. (line 681) -* BFD_RELOC_PPC_GOT_TLSLD16_HI: howto manager. (line 680) -* BFD_RELOC_PPC_GOT_TLSLD16_LO: howto manager. (line 679) -* BFD_RELOC_PPC_GOT_TPREL16: howto manager. (line 682) -* BFD_RELOC_PPC_GOT_TPREL16_HA: howto manager. (line 685) -* BFD_RELOC_PPC_GOT_TPREL16_HI: howto manager. (line 684) -* BFD_RELOC_PPC_GOT_TPREL16_LO: howto manager. (line 683) -* BFD_RELOC_PPC_JMP_SLOT: howto manager. (line 597) -* BFD_RELOC_PPC_LOCAL24PC: howto manager. (line 599) -* BFD_RELOC_PPC_RELATIVE: howto manager. (line 598) -* BFD_RELOC_PPC_TLS: howto manager. (line 660) -* BFD_RELOC_PPC_TLSGD: howto manager. (line 661) -* BFD_RELOC_PPC_TLSLD: howto manager. (line 662) -* BFD_RELOC_PPC_TOC16: howto manager. (line 588) -* BFD_RELOC_PPC_TPREL: howto manager. (line 668) -* BFD_RELOC_PPC_TPREL16: howto manager. (line 664) -* BFD_RELOC_PPC_TPREL16_HA: howto manager. (line 667) -* BFD_RELOC_PPC_TPREL16_HI: howto manager. (line 666) -* BFD_RELOC_PPC_TPREL16_LO: howto manager. (line 665) -* BFD_RELOC_PPC_VLE_HA16A: howto manager. (line 623) -* BFD_RELOC_PPC_VLE_HA16D: howto manager. (line 624) -* BFD_RELOC_PPC_VLE_HI16A: howto manager. (line 621) -* BFD_RELOC_PPC_VLE_HI16D: howto manager. (line 622) -* BFD_RELOC_PPC_VLE_LO16A: howto manager. (line 619) -* BFD_RELOC_PPC_VLE_LO16D: howto manager. (line 620) -* BFD_RELOC_PPC_VLE_REL15: howto manager. (line 617) -* BFD_RELOC_PPC_VLE_REL24: howto manager. (line 618) -* BFD_RELOC_PPC_VLE_REL8: howto manager. (line 616) -* BFD_RELOC_PPC_VLE_SDA21: howto manager. (line 625) -* BFD_RELOC_PPC_VLE_SDA21_LO: howto manager. (line 626) -* BFD_RELOC_PPC_VLE_SDAREL_HA16A: howto manager. (line 631) -* BFD_RELOC_PPC_VLE_SDAREL_HA16D: howto manager. (line 632) -* BFD_RELOC_PPC_VLE_SDAREL_HI16A: howto manager. (line 629) -* BFD_RELOC_PPC_VLE_SDAREL_HI16D: howto manager. (line 630) -* BFD_RELOC_PPC_VLE_SDAREL_LO16A: howto manager. (line 627) -* BFD_RELOC_PPC_VLE_SDAREL_LO16D: howto manager. (line 628) -* BFD_RELOC_RELC: howto manager. (line 2233) -* BFD_RELOC_RL78_16U: howto manager. (line 1658) -* BFD_RELOC_RL78_16_OP: howto manager. (line 1654) -* BFD_RELOC_RL78_24U: howto manager. (line 1659) -* BFD_RELOC_RL78_24_OP: howto manager. (line 1655) -* BFD_RELOC_RL78_32_OP: howto manager. (line 1656) -* BFD_RELOC_RL78_8U: howto manager. (line 1657) -* BFD_RELOC_RL78_ABS16: howto manager. (line 1671) -* BFD_RELOC_RL78_ABS16U: howto manager. (line 1675) -* BFD_RELOC_RL78_ABS16UL: howto manager. (line 1677) -* BFD_RELOC_RL78_ABS16UW: howto manager. (line 1676) -* BFD_RELOC_RL78_ABS16_REV: howto manager. (line 1672) -* BFD_RELOC_RL78_ABS32: howto manager. (line 1673) -* BFD_RELOC_RL78_ABS32_REV: howto manager. (line 1674) -* BFD_RELOC_RL78_ABS8: howto manager. (line 1670) -* BFD_RELOC_RL78_CODE: howto manager. (line 1682) -* BFD_RELOC_RL78_DIFF: howto manager. (line 1661) -* BFD_RELOC_RL78_DIR3U_PCREL: howto manager. (line 1660) -* BFD_RELOC_RL78_GPRELB: howto manager. (line 1662) -* BFD_RELOC_RL78_GPRELL: howto manager. (line 1664) -* BFD_RELOC_RL78_GPRELW: howto manager. (line 1663) -* BFD_RELOC_RL78_HI16: howto manager. (line 1679) -* BFD_RELOC_RL78_HI8: howto manager. (line 1680) -* BFD_RELOC_RL78_LO16: howto manager. (line 1681) -* BFD_RELOC_RL78_NEG16: howto manager. (line 1651) -* BFD_RELOC_RL78_NEG24: howto manager. (line 1652) -* BFD_RELOC_RL78_NEG32: howto manager. (line 1653) -* BFD_RELOC_RL78_NEG8: howto manager. (line 1650) -* BFD_RELOC_RL78_OP_AND: howto manager. (line 1668) -* BFD_RELOC_RL78_OP_NEG: howto manager. (line 1667) -* BFD_RELOC_RL78_OP_SHRA: howto manager. (line 1669) -* BFD_RELOC_RL78_OP_SUBTRACT: howto manager. (line 1666) -* BFD_RELOC_RL78_RELAX: howto manager. (line 1678) -* BFD_RELOC_RL78_SYM: howto manager. (line 1665) +* BFD_RELOC_NS32K_DISP_16: howto manager. (line 575) +* BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. (line 578) +* BFD_RELOC_NS32K_DISP_32: howto manager. (line 576) +* BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. (line 579) +* BFD_RELOC_NS32K_DISP_8: howto manager. (line 574) +* BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. (line 577) +* BFD_RELOC_NS32K_IMM_16: howto manager. (line 569) +* BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. (line 572) +* BFD_RELOC_NS32K_IMM_32: howto manager. (line 570) +* BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. (line 573) +* BFD_RELOC_NS32K_IMM_8: howto manager. (line 568) +* BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. (line 571) +* BFD_RELOC_OR1K_COPY: howto manager. (line 2241) +* BFD_RELOC_OR1K_GLOB_DAT: howto manager. (line 2242) +* BFD_RELOC_OR1K_GOT16: howto manager. (line 2237) +* BFD_RELOC_OR1K_GOTOFF_HI16: howto manager. (line 2239) +* BFD_RELOC_OR1K_GOTOFF_LO16: howto manager. (line 2240) +* BFD_RELOC_OR1K_GOTPC_HI16: howto manager. (line 2235) +* BFD_RELOC_OR1K_GOTPC_LO16: howto manager. (line 2236) +* BFD_RELOC_OR1K_JMP_SLOT: howto manager. (line 2243) +* BFD_RELOC_OR1K_PLT26: howto manager. (line 2238) +* BFD_RELOC_OR1K_RELATIVE: howto manager. (line 2244) +* BFD_RELOC_OR1K_REL_26: howto manager. (line 2234) +* BFD_RELOC_OR1K_TLS_DTPMOD: howto manager. (line 2257) +* BFD_RELOC_OR1K_TLS_DTPOFF: howto manager. (line 2256) +* BFD_RELOC_OR1K_TLS_GD_HI16: howto manager. (line 2245) +* BFD_RELOC_OR1K_TLS_GD_LO16: howto manager. (line 2246) +* BFD_RELOC_OR1K_TLS_IE_HI16: howto manager. (line 2251) +* BFD_RELOC_OR1K_TLS_IE_LO16: howto manager. (line 2252) +* BFD_RELOC_OR1K_TLS_LDM_HI16: howto manager. (line 2247) +* BFD_RELOC_OR1K_TLS_LDM_LO16: howto manager. (line 2248) +* BFD_RELOC_OR1K_TLS_LDO_HI16: howto manager. (line 2249) +* BFD_RELOC_OR1K_TLS_LDO_LO16: howto manager. (line 2250) +* BFD_RELOC_OR1K_TLS_LE_HI16: howto manager. (line 2253) +* BFD_RELOC_OR1K_TLS_LE_LO16: howto manager. (line 2254) +* BFD_RELOC_OR1K_TLS_TPOFF: howto manager. (line 2255) +* BFD_RELOC_PDP11_DISP_6_PCREL: howto manager. (line 582) +* BFD_RELOC_PDP11_DISP_8_PCREL: howto manager. (line 581) +* BFD_RELOC_PJ_CODE_DIR16: howto manager. (line 586) +* BFD_RELOC_PJ_CODE_DIR32: howto manager. (line 587) +* BFD_RELOC_PJ_CODE_HI16: howto manager. (line 584) +* BFD_RELOC_PJ_CODE_LO16: howto manager. (line 585) +* BFD_RELOC_PJ_CODE_REL16: howto manager. (line 588) +* BFD_RELOC_PJ_CODE_REL32: howto manager. (line 589) +* BFD_RELOC_PPC64_ADDR16_DS: howto manager. (line 650) +* BFD_RELOC_PPC64_ADDR16_HIGH: howto manager. (line 661) +* BFD_RELOC_PPC64_ADDR16_HIGHA: howto manager. (line 662) +* BFD_RELOC_PPC64_ADDR16_LO_DS: howto manager. (line 651) +* BFD_RELOC_PPC64_ADDR64_LOCAL: howto manager. (line 663) +* BFD_RELOC_PPC64_DTPREL16_DS: howto manager. (line 701) +* BFD_RELOC_PPC64_DTPREL16_HIGH: howto manager. (line 709) +* BFD_RELOC_PPC64_DTPREL16_HIGHA: howto manager. (line 710) +* BFD_RELOC_PPC64_DTPREL16_HIGHER: howto manager. (line 703) +* BFD_RELOC_PPC64_DTPREL16_HIGHERA: howto manager. (line 704) +* BFD_RELOC_PPC64_DTPREL16_HIGHEST: howto manager. (line 705) +* BFD_RELOC_PPC64_DTPREL16_HIGHESTA: howto manager. (line 706) +* BFD_RELOC_PPC64_DTPREL16_LO_DS: howto manager. (line 702) +* BFD_RELOC_PPC64_GOT16_DS: howto manager. (line 652) +* BFD_RELOC_PPC64_GOT16_LO_DS: howto manager. (line 653) +* BFD_RELOC_PPC64_HIGHER: howto manager. (line 638) +* BFD_RELOC_PPC64_HIGHER_S: howto manager. (line 639) +* BFD_RELOC_PPC64_HIGHEST: howto manager. (line 640) +* BFD_RELOC_PPC64_HIGHEST_S: howto manager. (line 641) +* BFD_RELOC_PPC64_PLT16_LO_DS: howto manager. (line 654) +* BFD_RELOC_PPC64_PLTGOT16: howto manager. (line 646) +* BFD_RELOC_PPC64_PLTGOT16_DS: howto manager. (line 659) +* BFD_RELOC_PPC64_PLTGOT16_HA: howto manager. (line 649) +* BFD_RELOC_PPC64_PLTGOT16_HI: howto manager. (line 648) +* BFD_RELOC_PPC64_PLTGOT16_LO: howto manager. (line 647) +* BFD_RELOC_PPC64_PLTGOT16_LO_DS: howto manager. (line 660) +* BFD_RELOC_PPC64_SECTOFF_DS: howto manager. (line 655) +* BFD_RELOC_PPC64_SECTOFF_LO_DS: howto manager. (line 656) +* BFD_RELOC_PPC64_TOC: howto manager. (line 645) +* BFD_RELOC_PPC64_TOC16_DS: howto manager. (line 657) +* BFD_RELOC_PPC64_TOC16_HA: howto manager. (line 644) +* BFD_RELOC_PPC64_TOC16_HI: howto manager. (line 643) +* BFD_RELOC_PPC64_TOC16_LO: howto manager. (line 642) +* BFD_RELOC_PPC64_TOC16_LO_DS: howto manager. (line 658) +* BFD_RELOC_PPC64_TPREL16_DS: howto manager. (line 695) +* BFD_RELOC_PPC64_TPREL16_HIGH: howto manager. (line 707) +* BFD_RELOC_PPC64_TPREL16_HIGHA: howto manager. (line 708) +* BFD_RELOC_PPC64_TPREL16_HIGHER: howto manager. (line 697) +* BFD_RELOC_PPC64_TPREL16_HIGHERA: howto manager. (line 698) +* BFD_RELOC_PPC64_TPREL16_HIGHEST: howto manager. (line 699) +* BFD_RELOC_PPC64_TPREL16_HIGHESTA: howto manager. (line 700) +* BFD_RELOC_PPC64_TPREL16_LO_DS: howto manager. (line 696) +* BFD_RELOC_PPC_B16: howto manager. (line 594) +* BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. (line 596) +* BFD_RELOC_PPC_B16_BRTAKEN: howto manager. (line 595) +* BFD_RELOC_PPC_B26: howto manager. (line 591) +* BFD_RELOC_PPC_BA16: howto manager. (line 597) +* BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. (line 599) +* BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. (line 598) +* BFD_RELOC_PPC_BA26: howto manager. (line 592) +* BFD_RELOC_PPC_COPY: howto manager. (line 600) +* BFD_RELOC_PPC_DTPMOD: howto manager. (line 668) +* BFD_RELOC_PPC_DTPREL: howto manager. (line 678) +* BFD_RELOC_PPC_DTPREL16: howto manager. (line 674) +* BFD_RELOC_PPC_DTPREL16_HA: howto manager. (line 677) +* BFD_RELOC_PPC_DTPREL16_HI: howto manager. (line 676) +* BFD_RELOC_PPC_DTPREL16_LO: howto manager. (line 675) +* BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. (line 619) +* BFD_RELOC_PPC_EMB_MRKREF: howto manager. (line 614) +* BFD_RELOC_PPC_EMB_NADDR16: howto manager. (line 606) +* BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. (line 609) +* BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. (line 608) +* BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. (line 607) +* BFD_RELOC_PPC_EMB_NADDR32: howto manager. (line 605) +* BFD_RELOC_PPC_EMB_RELSDA: howto manager. (line 620) +* BFD_RELOC_PPC_EMB_RELSEC16: howto manager. (line 615) +* BFD_RELOC_PPC_EMB_RELST_HA: howto manager. (line 618) +* BFD_RELOC_PPC_EMB_RELST_HI: howto manager. (line 617) +* BFD_RELOC_PPC_EMB_RELST_LO: howto manager. (line 616) +* BFD_RELOC_PPC_EMB_SDA21: howto manager. (line 613) +* BFD_RELOC_PPC_EMB_SDA2I16: howto manager. (line 611) +* BFD_RELOC_PPC_EMB_SDA2REL: howto manager. (line 612) +* BFD_RELOC_PPC_EMB_SDAI16: howto manager. (line 610) +* BFD_RELOC_PPC_GLOB_DAT: howto manager. (line 601) +* BFD_RELOC_PPC_GOT_DTPREL16: howto manager. (line 691) +* BFD_RELOC_PPC_GOT_DTPREL16_HA: howto manager. (line 694) +* BFD_RELOC_PPC_GOT_DTPREL16_HI: howto manager. (line 693) +* BFD_RELOC_PPC_GOT_DTPREL16_LO: howto manager. (line 692) +* BFD_RELOC_PPC_GOT_TLSGD16: howto manager. (line 679) +* BFD_RELOC_PPC_GOT_TLSGD16_HA: howto manager. (line 682) +* BFD_RELOC_PPC_GOT_TLSGD16_HI: howto manager. (line 681) +* BFD_RELOC_PPC_GOT_TLSGD16_LO: howto manager. (line 680) +* BFD_RELOC_PPC_GOT_TLSLD16: howto manager. (line 683) +* BFD_RELOC_PPC_GOT_TLSLD16_HA: howto manager. (line 686) +* BFD_RELOC_PPC_GOT_TLSLD16_HI: howto manager. (line 685) +* BFD_RELOC_PPC_GOT_TLSLD16_LO: howto manager. (line 684) +* BFD_RELOC_PPC_GOT_TPREL16: howto manager. (line 687) +* BFD_RELOC_PPC_GOT_TPREL16_HA: howto manager. (line 690) +* BFD_RELOC_PPC_GOT_TPREL16_HI: howto manager. (line 689) +* BFD_RELOC_PPC_GOT_TPREL16_LO: howto manager. (line 688) +* BFD_RELOC_PPC_JMP_SLOT: howto manager. (line 602) +* BFD_RELOC_PPC_LOCAL24PC: howto manager. (line 604) +* BFD_RELOC_PPC_RELATIVE: howto manager. (line 603) +* BFD_RELOC_PPC_TLS: howto manager. (line 665) +* BFD_RELOC_PPC_TLSGD: howto manager. (line 666) +* BFD_RELOC_PPC_TLSLD: howto manager. (line 667) +* BFD_RELOC_PPC_TOC16: howto manager. (line 593) +* BFD_RELOC_PPC_TPREL: howto manager. (line 673) +* BFD_RELOC_PPC_TPREL16: howto manager. (line 669) +* BFD_RELOC_PPC_TPREL16_HA: howto manager. (line 672) +* BFD_RELOC_PPC_TPREL16_HI: howto manager. (line 671) +* BFD_RELOC_PPC_TPREL16_LO: howto manager. (line 670) +* BFD_RELOC_PPC_VLE_HA16A: howto manager. (line 628) +* BFD_RELOC_PPC_VLE_HA16D: howto manager. (line 629) +* BFD_RELOC_PPC_VLE_HI16A: howto manager. (line 626) +* BFD_RELOC_PPC_VLE_HI16D: howto manager. (line 627) +* BFD_RELOC_PPC_VLE_LO16A: howto manager. (line 624) +* BFD_RELOC_PPC_VLE_LO16D: howto manager. (line 625) +* BFD_RELOC_PPC_VLE_REL15: howto manager. (line 622) +* BFD_RELOC_PPC_VLE_REL24: howto manager. (line 623) +* BFD_RELOC_PPC_VLE_REL8: howto manager. (line 621) +* BFD_RELOC_PPC_VLE_SDA21: howto manager. (line 630) +* BFD_RELOC_PPC_VLE_SDA21_LO: howto manager. (line 631) +* BFD_RELOC_PPC_VLE_SDAREL_HA16A: howto manager. (line 636) +* BFD_RELOC_PPC_VLE_SDAREL_HA16D: howto manager. (line 637) +* BFD_RELOC_PPC_VLE_SDAREL_HI16A: howto manager. (line 634) +* BFD_RELOC_PPC_VLE_SDAREL_HI16D: howto manager. (line 635) +* BFD_RELOC_PPC_VLE_SDAREL_LO16A: howto manager. (line 632) +* BFD_RELOC_PPC_VLE_SDAREL_LO16D: howto manager. (line 633) +* BFD_RELOC_RELC: howto manager. (line 2271) +* BFD_RELOC_RL78_16U: howto manager. (line 1696) +* BFD_RELOC_RL78_16_OP: howto manager. (line 1692) +* BFD_RELOC_RL78_24U: howto manager. (line 1697) +* BFD_RELOC_RL78_24_OP: howto manager. (line 1693) +* BFD_RELOC_RL78_32_OP: howto manager. (line 1694) +* BFD_RELOC_RL78_8U: howto manager. (line 1695) +* BFD_RELOC_RL78_ABS16: howto manager. (line 1709) +* BFD_RELOC_RL78_ABS16U: howto manager. (line 1713) +* BFD_RELOC_RL78_ABS16UL: howto manager. (line 1715) +* BFD_RELOC_RL78_ABS16UW: howto manager. (line 1714) +* BFD_RELOC_RL78_ABS16_REV: howto manager. (line 1710) +* BFD_RELOC_RL78_ABS32: howto manager. (line 1711) +* BFD_RELOC_RL78_ABS32_REV: howto manager. (line 1712) +* BFD_RELOC_RL78_ABS8: howto manager. (line 1708) +* BFD_RELOC_RL78_CODE: howto manager. (line 1720) +* BFD_RELOC_RL78_DIFF: howto manager. (line 1699) +* BFD_RELOC_RL78_DIR3U_PCREL: howto manager. (line 1698) +* BFD_RELOC_RL78_GPRELB: howto manager. (line 1700) +* BFD_RELOC_RL78_GPRELL: howto manager. (line 1702) +* BFD_RELOC_RL78_GPRELW: howto manager. (line 1701) +* BFD_RELOC_RL78_HI16: howto manager. (line 1717) +* BFD_RELOC_RL78_HI8: howto manager. (line 1718) +* BFD_RELOC_RL78_LO16: howto manager. (line 1719) +* BFD_RELOC_RL78_NEG16: howto manager. (line 1689) +* BFD_RELOC_RL78_NEG24: howto manager. (line 1690) +* BFD_RELOC_RL78_NEG32: howto manager. (line 1691) +* BFD_RELOC_RL78_NEG8: howto manager. (line 1688) +* BFD_RELOC_RL78_OP_AND: howto manager. (line 1706) +* BFD_RELOC_RL78_OP_NEG: howto manager. (line 1705) +* BFD_RELOC_RL78_OP_SHRA: howto manager. (line 1707) +* BFD_RELOC_RL78_OP_SUBTRACT: howto manager. (line 1704) +* BFD_RELOC_RL78_RELAX: howto manager. (line 1716) +* BFD_RELOC_RL78_SYM: howto manager. (line 1703) * BFD_RELOC_RVA: howto manager. (line 97) -* BFD_RELOC_RX_16U: howto manager. (line 1692) -* BFD_RELOC_RX_16_OP: howto manager. (line 1688) -* BFD_RELOC_RX_24U: howto manager. (line 1693) -* BFD_RELOC_RX_24_OP: howto manager. (line 1689) -* BFD_RELOC_RX_32_OP: howto manager. (line 1690) -* BFD_RELOC_RX_8U: howto manager. (line 1691) -* BFD_RELOC_RX_ABS16: howto manager. (line 1703) -* BFD_RELOC_RX_ABS16U: howto manager. (line 1707) -* BFD_RELOC_RX_ABS16UL: howto manager. (line 1709) -* BFD_RELOC_RX_ABS16UW: howto manager. (line 1708) -* BFD_RELOC_RX_ABS16_REV: howto manager. (line 1704) -* BFD_RELOC_RX_ABS32: howto manager. (line 1705) -* BFD_RELOC_RX_ABS32_REV: howto manager. (line 1706) -* BFD_RELOC_RX_ABS8: howto manager. (line 1702) -* BFD_RELOC_RX_DIFF: howto manager. (line 1695) -* BFD_RELOC_RX_DIR3U_PCREL: howto manager. (line 1694) -* BFD_RELOC_RX_GPRELB: howto manager. (line 1696) -* BFD_RELOC_RX_GPRELL: howto manager. (line 1698) -* BFD_RELOC_RX_GPRELW: howto manager. (line 1697) -* BFD_RELOC_RX_NEG16: howto manager. (line 1685) -* BFD_RELOC_RX_NEG24: howto manager. (line 1686) -* BFD_RELOC_RX_NEG32: howto manager. (line 1687) -* BFD_RELOC_RX_NEG8: howto manager. (line 1684) -* BFD_RELOC_RX_OP_NEG: howto manager. (line 1701) -* BFD_RELOC_RX_OP_SUBTRACT: howto manager. (line 1700) -* BFD_RELOC_RX_RELAX: howto manager. (line 1710) -* BFD_RELOC_RX_SYM: howto manager. (line 1699) -* BFD_RELOC_SCORE16_BRANCH: howto manager. (line 1813) -* BFD_RELOC_SCORE16_JMP: howto manager. (line 1811) -* BFD_RELOC_SCORE_BCMP: howto manager. (line 1815) -* BFD_RELOC_SCORE_BRANCH: howto manager. (line 1805) -* BFD_RELOC_SCORE_CALL15: howto manager. (line 1819) -* BFD_RELOC_SCORE_DUMMY2: howto manager. (line 1802) -* BFD_RELOC_SCORE_DUMMY_HI16: howto manager. (line 1820) -* BFD_RELOC_SCORE_GOT15: howto manager. (line 1817) -* BFD_RELOC_SCORE_GOT_LO16: howto manager. (line 1818) -* BFD_RELOC_SCORE_GPREL15: howto manager. (line 1800) -* BFD_RELOC_SCORE_IMM30: howto manager. (line 1807) -* BFD_RELOC_SCORE_IMM32: howto manager. (line 1809) -* BFD_RELOC_SCORE_JMP: howto manager. (line 1803) -* BFD_RELOC_SH_ALIGN: howto manager. (line 876) -* BFD_RELOC_SH_CODE: howto manager. (line 877) -* BFD_RELOC_SH_COPY: howto manager. (line 882) -* BFD_RELOC_SH_COPY64: howto manager. (line 907) -* BFD_RELOC_SH_COUNT: howto manager. (line 875) -* BFD_RELOC_SH_DATA: howto manager. (line 878) -* BFD_RELOC_SH_DISP12: howto manager. (line 858) -* BFD_RELOC_SH_DISP12BY2: howto manager. (line 859) -* BFD_RELOC_SH_DISP12BY4: howto manager. (line 860) -* BFD_RELOC_SH_DISP12BY8: howto manager. (line 861) -* BFD_RELOC_SH_DISP20: howto manager. (line 862) -* BFD_RELOC_SH_DISP20BY8: howto manager. (line 863) -* BFD_RELOC_SH_FUNCDESC: howto manager. (line 950) -* BFD_RELOC_SH_GLOB_DAT: howto manager. (line 883) -* BFD_RELOC_SH_GLOB_DAT64: howto manager. (line 908) -* BFD_RELOC_SH_GOT10BY4: howto manager. (line 911) -* BFD_RELOC_SH_GOT10BY8: howto manager. (line 912) -* BFD_RELOC_SH_GOT20: howto manager. (line 944) -* BFD_RELOC_SH_GOTFUNCDESC: howto manager. (line 946) -* BFD_RELOC_SH_GOTFUNCDESC20: howto manager. (line 947) -* BFD_RELOC_SH_GOTOFF20: howto manager. (line 945) -* BFD_RELOC_SH_GOTOFFFUNCDESC: howto manager. (line 948) -* BFD_RELOC_SH_GOTOFFFUNCDESC20: howto manager. (line 949) -* BFD_RELOC_SH_GOTOFF_HI16: howto manager. (line 902) -* BFD_RELOC_SH_GOTOFF_LOW16: howto manager. (line 899) -* BFD_RELOC_SH_GOTOFF_MEDHI16: howto manager. (line 901) -* BFD_RELOC_SH_GOTOFF_MEDLOW16: howto manager. (line 900) -* BFD_RELOC_SH_GOTPC: howto manager. (line 886) -* BFD_RELOC_SH_GOTPC_HI16: howto manager. (line 906) -* BFD_RELOC_SH_GOTPC_LOW16: howto manager. (line 903) -* BFD_RELOC_SH_GOTPC_MEDHI16: howto manager. (line 905) -* BFD_RELOC_SH_GOTPC_MEDLOW16: howto manager. (line 904) -* BFD_RELOC_SH_GOTPLT10BY4: howto manager. (line 913) -* BFD_RELOC_SH_GOTPLT10BY8: howto manager. (line 914) -* BFD_RELOC_SH_GOTPLT32: howto manager. (line 915) -* BFD_RELOC_SH_GOTPLT_HI16: howto manager. (line 894) -* BFD_RELOC_SH_GOTPLT_LOW16: howto manager. (line 891) -* BFD_RELOC_SH_GOTPLT_MEDHI16: howto manager. (line 893) -* BFD_RELOC_SH_GOTPLT_MEDLOW16: howto manager. (line 892) -* BFD_RELOC_SH_GOT_HI16: howto manager. (line 890) -* BFD_RELOC_SH_GOT_LOW16: howto manager. (line 887) -* BFD_RELOC_SH_GOT_MEDHI16: howto manager. (line 889) -* BFD_RELOC_SH_GOT_MEDLOW16: howto manager. (line 888) -* BFD_RELOC_SH_IMM3: howto manager. (line 856) -* BFD_RELOC_SH_IMM3U: howto manager. (line 857) -* BFD_RELOC_SH_IMM4: howto manager. (line 864) -* BFD_RELOC_SH_IMM4BY2: howto manager. (line 865) -* BFD_RELOC_SH_IMM4BY4: howto manager. (line 866) -* BFD_RELOC_SH_IMM8: howto manager. (line 867) -* BFD_RELOC_SH_IMM8BY2: howto manager. (line 868) -* BFD_RELOC_SH_IMM8BY4: howto manager. (line 869) -* BFD_RELOC_SH_IMMS10: howto manager. (line 921) -* BFD_RELOC_SH_IMMS10BY2: howto manager. (line 922) -* BFD_RELOC_SH_IMMS10BY4: howto manager. (line 923) -* BFD_RELOC_SH_IMMS10BY8: howto manager. (line 924) -* BFD_RELOC_SH_IMMS16: howto manager. (line 925) -* BFD_RELOC_SH_IMMS6: howto manager. (line 918) -* BFD_RELOC_SH_IMMS6BY32: howto manager. (line 919) -* BFD_RELOC_SH_IMMU16: howto manager. (line 926) -* BFD_RELOC_SH_IMMU5: howto manager. (line 917) -* BFD_RELOC_SH_IMMU6: howto manager. (line 920) -* BFD_RELOC_SH_IMM_HI16: howto manager. (line 933) -* BFD_RELOC_SH_IMM_HI16_PCREL: howto manager. (line 934) -* BFD_RELOC_SH_IMM_LOW16: howto manager. (line 927) -* BFD_RELOC_SH_IMM_LOW16_PCREL: howto manager. (line 928) -* BFD_RELOC_SH_IMM_MEDHI16: howto manager. (line 931) -* BFD_RELOC_SH_IMM_MEDHI16_PCREL: howto manager. (line 932) -* BFD_RELOC_SH_IMM_MEDLOW16: howto manager. (line 929) -* BFD_RELOC_SH_IMM_MEDLOW16_PCREL: howto manager. (line 930) -* BFD_RELOC_SH_JMP_SLOT: howto manager. (line 884) -* BFD_RELOC_SH_JMP_SLOT64: howto manager. (line 909) -* BFD_RELOC_SH_LABEL: howto manager. (line 879) -* BFD_RELOC_SH_LOOP_END: howto manager. (line 881) -* BFD_RELOC_SH_LOOP_START: howto manager. (line 880) -* BFD_RELOC_SH_PCDISP12BY2: howto manager. (line 855) -* BFD_RELOC_SH_PCDISP8BY2: howto manager. (line 854) -* BFD_RELOC_SH_PCRELIMM8BY2: howto manager. (line 870) -* BFD_RELOC_SH_PCRELIMM8BY4: howto manager. (line 871) -* BFD_RELOC_SH_PLT_HI16: howto manager. (line 898) -* BFD_RELOC_SH_PLT_LOW16: howto manager. (line 895) -* BFD_RELOC_SH_PLT_MEDHI16: howto manager. (line 897) -* BFD_RELOC_SH_PLT_MEDLOW16: howto manager. (line 896) -* BFD_RELOC_SH_PT_16: howto manager. (line 935) -* BFD_RELOC_SH_RELATIVE: howto manager. (line 885) -* BFD_RELOC_SH_RELATIVE64: howto manager. (line 910) -* BFD_RELOC_SH_SHMEDIA_CODE: howto manager. (line 916) -* BFD_RELOC_SH_SWITCH16: howto manager. (line 872) -* BFD_RELOC_SH_SWITCH32: howto manager. (line 873) -* BFD_RELOC_SH_TLS_DTPMOD32: howto manager. (line 941) -* BFD_RELOC_SH_TLS_DTPOFF32: howto manager. (line 942) -* BFD_RELOC_SH_TLS_GD_32: howto manager. (line 936) -* BFD_RELOC_SH_TLS_IE_32: howto manager. (line 939) -* BFD_RELOC_SH_TLS_LDO_32: howto manager. (line 938) -* BFD_RELOC_SH_TLS_LD_32: howto manager. (line 937) -* BFD_RELOC_SH_TLS_LE_32: howto manager. (line 940) -* BFD_RELOC_SH_TLS_TPOFF32: howto manager. (line 943) -* BFD_RELOC_SH_USES: howto manager. (line 874) +* BFD_RELOC_RX_16U: howto manager. (line 1730) +* BFD_RELOC_RX_16_OP: howto manager. (line 1726) +* BFD_RELOC_RX_24U: howto manager. (line 1731) +* BFD_RELOC_RX_24_OP: howto manager. (line 1727) +* BFD_RELOC_RX_32_OP: howto manager. (line 1728) +* BFD_RELOC_RX_8U: howto manager. (line 1729) +* BFD_RELOC_RX_ABS16: howto manager. (line 1741) +* BFD_RELOC_RX_ABS16U: howto manager. (line 1745) +* BFD_RELOC_RX_ABS16UL: howto manager. (line 1747) +* BFD_RELOC_RX_ABS16UW: howto manager. (line 1746) +* BFD_RELOC_RX_ABS16_REV: howto manager. (line 1742) +* BFD_RELOC_RX_ABS32: howto manager. (line 1743) +* BFD_RELOC_RX_ABS32_REV: howto manager. (line 1744) +* BFD_RELOC_RX_ABS8: howto manager. (line 1740) +* BFD_RELOC_RX_DIFF: howto manager. (line 1733) +* BFD_RELOC_RX_DIR3U_PCREL: howto manager. (line 1732) +* BFD_RELOC_RX_GPRELB: howto manager. (line 1734) +* BFD_RELOC_RX_GPRELL: howto manager. (line 1736) +* BFD_RELOC_RX_GPRELW: howto manager. (line 1735) +* BFD_RELOC_RX_NEG16: howto manager. (line 1723) +* BFD_RELOC_RX_NEG24: howto manager. (line 1724) +* BFD_RELOC_RX_NEG32: howto manager. (line 1725) +* BFD_RELOC_RX_NEG8: howto manager. (line 1722) +* BFD_RELOC_RX_OP_NEG: howto manager. (line 1739) +* BFD_RELOC_RX_OP_SUBTRACT: howto manager. (line 1738) +* BFD_RELOC_RX_RELAX: howto manager. (line 1748) +* BFD_RELOC_RX_SYM: howto manager. (line 1737) +* BFD_RELOC_SCORE16_BRANCH: howto manager. (line 1851) +* BFD_RELOC_SCORE16_JMP: howto manager. (line 1849) +* BFD_RELOC_SCORE_BCMP: howto manager. (line 1853) +* BFD_RELOC_SCORE_BRANCH: howto manager. (line 1843) +* BFD_RELOC_SCORE_CALL15: howto manager. (line 1857) +* BFD_RELOC_SCORE_DUMMY2: howto manager. (line 1840) +* BFD_RELOC_SCORE_DUMMY_HI16: howto manager. (line 1858) +* BFD_RELOC_SCORE_GOT15: howto manager. (line 1855) +* BFD_RELOC_SCORE_GOT_LO16: howto manager. (line 1856) +* BFD_RELOC_SCORE_GPREL15: howto manager. (line 1838) +* BFD_RELOC_SCORE_IMM30: howto manager. (line 1845) +* BFD_RELOC_SCORE_IMM32: howto manager. (line 1847) +* BFD_RELOC_SCORE_JMP: howto manager. (line 1841) +* BFD_RELOC_SH_ALIGN: howto manager. (line 881) +* BFD_RELOC_SH_CODE: howto manager. (line 882) +* BFD_RELOC_SH_COPY: howto manager. (line 887) +* BFD_RELOC_SH_COPY64: howto manager. (line 912) +* BFD_RELOC_SH_COUNT: howto manager. (line 880) +* BFD_RELOC_SH_DATA: howto manager. (line 883) +* BFD_RELOC_SH_DISP12: howto manager. (line 863) +* BFD_RELOC_SH_DISP12BY2: howto manager. (line 864) +* BFD_RELOC_SH_DISP12BY4: howto manager. (line 865) +* BFD_RELOC_SH_DISP12BY8: howto manager. (line 866) +* BFD_RELOC_SH_DISP20: howto manager. (line 867) +* BFD_RELOC_SH_DISP20BY8: howto manager. (line 868) +* BFD_RELOC_SH_FUNCDESC: howto manager. (line 955) +* BFD_RELOC_SH_GLOB_DAT: howto manager. (line 888) +* BFD_RELOC_SH_GLOB_DAT64: howto manager. (line 913) +* BFD_RELOC_SH_GOT10BY4: howto manager. (line 916) +* BFD_RELOC_SH_GOT10BY8: howto manager. (line 917) +* BFD_RELOC_SH_GOT20: howto manager. (line 949) +* BFD_RELOC_SH_GOTFUNCDESC: howto manager. (line 951) +* BFD_RELOC_SH_GOTFUNCDESC20: howto manager. (line 952) +* BFD_RELOC_SH_GOTOFF20: howto manager. (line 950) +* BFD_RELOC_SH_GOTOFFFUNCDESC: howto manager. (line 953) +* BFD_RELOC_SH_GOTOFFFUNCDESC20: howto manager. (line 954) +* BFD_RELOC_SH_GOTOFF_HI16: howto manager. (line 907) +* BFD_RELOC_SH_GOTOFF_LOW16: howto manager. (line 904) +* BFD_RELOC_SH_GOTOFF_MEDHI16: howto manager. (line 906) +* BFD_RELOC_SH_GOTOFF_MEDLOW16: howto manager. (line 905) +* BFD_RELOC_SH_GOTPC: howto manager. (line 891) +* BFD_RELOC_SH_GOTPC_HI16: howto manager. (line 911) +* BFD_RELOC_SH_GOTPC_LOW16: howto manager. (line 908) +* BFD_RELOC_SH_GOTPC_MEDHI16: howto manager. (line 910) +* BFD_RELOC_SH_GOTPC_MEDLOW16: howto manager. (line 909) +* BFD_RELOC_SH_GOTPLT10BY4: howto manager. (line 918) +* BFD_RELOC_SH_GOTPLT10BY8: howto manager. (line 919) +* BFD_RELOC_SH_GOTPLT32: howto manager. (line 920) +* BFD_RELOC_SH_GOTPLT_HI16: howto manager. (line 899) +* BFD_RELOC_SH_GOTPLT_LOW16: howto manager. (line 896) +* BFD_RELOC_SH_GOTPLT_MEDHI16: howto manager. (line 898) +* BFD_RELOC_SH_GOTPLT_MEDLOW16: howto manager. (line 897) +* BFD_RELOC_SH_GOT_HI16: howto manager. (line 895) +* BFD_RELOC_SH_GOT_LOW16: howto manager. (line 892) +* BFD_RELOC_SH_GOT_MEDHI16: howto manager. (line 894) +* BFD_RELOC_SH_GOT_MEDLOW16: howto manager. (line 893) +* BFD_RELOC_SH_IMM3: howto manager. (line 861) +* BFD_RELOC_SH_IMM3U: howto manager. (line 862) +* BFD_RELOC_SH_IMM4: howto manager. (line 869) +* BFD_RELOC_SH_IMM4BY2: howto manager. (line 870) +* BFD_RELOC_SH_IMM4BY4: howto manager. (line 871) +* BFD_RELOC_SH_IMM8: howto manager. (line 872) +* BFD_RELOC_SH_IMM8BY2: howto manager. (line 873) +* BFD_RELOC_SH_IMM8BY4: howto manager. (line 874) +* BFD_RELOC_SH_IMMS10: howto manager. (line 926) +* BFD_RELOC_SH_IMMS10BY2: howto manager. (line 927) +* BFD_RELOC_SH_IMMS10BY4: howto manager. (line 928) +* BFD_RELOC_SH_IMMS10BY8: howto manager. (line 929) +* BFD_RELOC_SH_IMMS16: howto manager. (line 930) +* BFD_RELOC_SH_IMMS6: howto manager. (line 923) +* BFD_RELOC_SH_IMMS6BY32: howto manager. (line 924) +* BFD_RELOC_SH_IMMU16: howto manager. (line 931) +* BFD_RELOC_SH_IMMU5: howto manager. (line 922) +* BFD_RELOC_SH_IMMU6: howto manager. (line 925) +* BFD_RELOC_SH_IMM_HI16: howto manager. (line 938) +* BFD_RELOC_SH_IMM_HI16_PCREL: howto manager. (line 939) +* BFD_RELOC_SH_IMM_LOW16: howto manager. (line 932) +* BFD_RELOC_SH_IMM_LOW16_PCREL: howto manager. (line 933) +* BFD_RELOC_SH_IMM_MEDHI16: howto manager. (line 936) +* BFD_RELOC_SH_IMM_MEDHI16_PCREL: howto manager. (line 937) +* BFD_RELOC_SH_IMM_MEDLOW16: howto manager. (line 934) +* BFD_RELOC_SH_IMM_MEDLOW16_PCREL: howto manager. (line 935) +* BFD_RELOC_SH_JMP_SLOT: howto manager. (line 889) +* BFD_RELOC_SH_JMP_SLOT64: howto manager. (line 914) +* BFD_RELOC_SH_LABEL: howto manager. (line 884) +* BFD_RELOC_SH_LOOP_END: howto manager. (line 886) +* BFD_RELOC_SH_LOOP_START: howto manager. (line 885) +* BFD_RELOC_SH_PCDISP12BY2: howto manager. (line 860) +* BFD_RELOC_SH_PCDISP8BY2: howto manager. (line 859) +* BFD_RELOC_SH_PCRELIMM8BY2: howto manager. (line 875) +* BFD_RELOC_SH_PCRELIMM8BY4: howto manager. (line 876) +* BFD_RELOC_SH_PLT_HI16: howto manager. (line 903) +* BFD_RELOC_SH_PLT_LOW16: howto manager. (line 900) +* BFD_RELOC_SH_PLT_MEDHI16: howto manager. (line 902) +* BFD_RELOC_SH_PLT_MEDLOW16: howto manager. (line 901) +* BFD_RELOC_SH_PT_16: howto manager. (line 940) +* BFD_RELOC_SH_RELATIVE: howto manager. (line 890) +* BFD_RELOC_SH_RELATIVE64: howto manager. (line 915) +* BFD_RELOC_SH_SHMEDIA_CODE: howto manager. (line 921) +* BFD_RELOC_SH_SWITCH16: howto manager. (line 877) +* BFD_RELOC_SH_SWITCH32: howto manager. (line 878) +* BFD_RELOC_SH_TLS_DTPMOD32: howto manager. (line 946) +* BFD_RELOC_SH_TLS_DTPOFF32: howto manager. (line 947) +* BFD_RELOC_SH_TLS_GD_32: howto manager. (line 941) +* BFD_RELOC_SH_TLS_IE_32: howto manager. (line 944) +* BFD_RELOC_SH_TLS_LDO_32: howto manager. (line 943) +* BFD_RELOC_SH_TLS_LD_32: howto manager. (line 942) +* BFD_RELOC_SH_TLS_LE_32: howto manager. (line 945) +* BFD_RELOC_SH_TLS_TPOFF32: howto manager. (line 948) +* BFD_RELOC_SH_USES: howto manager. (line 879) * BFD_RELOC_SIZE32: howto manager. (line 69) * BFD_RELOC_SIZE64: howto manager. (line 70) * BFD_RELOC_SPARC13: howto manager. (line 125) @@ -12645,378 +12713,385 @@ BFD Index * BFD_RELOC_SPU_PCREL9b: howto manager. (line 215) * BFD_RELOC_SPU_PPU32: howto manager. (line 219) * BFD_RELOC_SPU_PPU64: howto manager. (line 220) -* BFD_RELOC_THUMB_PCREL_BLX: howto manager. (line 721) -* BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. (line 732) -* BFD_RELOC_THUMB_PCREL_BRANCH20: howto manager. (line 733) -* BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. (line 734) -* BFD_RELOC_THUMB_PCREL_BRANCH25: howto manager. (line 735) -* BFD_RELOC_THUMB_PCREL_BRANCH7: howto manager. (line 730) -* BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. (line 731) -* BFD_RELOC_TIC30_LDP: howto manager. (line 1370) -* BFD_RELOC_TIC54X_16_OF_23: howto manager. (line 1384) -* BFD_RELOC_TIC54X_23: howto manager. (line 1382) -* BFD_RELOC_TIC54X_MS7_OF_23: howto manager. (line 1388) -* BFD_RELOC_TIC54X_PARTLS7: howto manager. (line 1374) -* BFD_RELOC_TIC54X_PARTMS9: howto manager. (line 1378) -* BFD_RELOC_TILEGX_BROFF_X1: howto manager. (line 2821) -* BFD_RELOC_TILEGX_COPY: howto manager. (line 2817) -* BFD_RELOC_TILEGX_DEST_IMM8_X1: howto manager. (line 2828) -* BFD_RELOC_TILEGX_GLOB_DAT: howto manager. (line 2818) -* BFD_RELOC_TILEGX_HW0: howto manager. (line 2810) -* BFD_RELOC_TILEGX_HW0_LAST: howto manager. (line 2814) -* BFD_RELOC_TILEGX_HW1: howto manager. (line 2811) -* BFD_RELOC_TILEGX_HW1_LAST: howto manager. (line 2815) -* BFD_RELOC_TILEGX_HW2: howto manager. (line 2812) -* BFD_RELOC_TILEGX_HW2_LAST: howto manager. (line 2816) -* BFD_RELOC_TILEGX_HW3: howto manager. (line 2813) -* BFD_RELOC_TILEGX_IMM16_X0_HW0: howto manager. (line 2837) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT: howto manager. (line 2865) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST: howto manager. (line 2845) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT: howto manager. (line 2873) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL: howto manager. (line 2859) +* BFD_RELOC_THUMB_PCREL_BLX: howto manager. (line 726) +* BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. (line 737) +* BFD_RELOC_THUMB_PCREL_BRANCH20: howto manager. (line 738) +* BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. (line 739) +* BFD_RELOC_THUMB_PCREL_BRANCH25: howto manager. (line 740) +* BFD_RELOC_THUMB_PCREL_BRANCH7: howto manager. (line 735) +* BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. (line 736) +* BFD_RELOC_TIC30_LDP: howto manager. (line 1399) +* BFD_RELOC_TIC54X_16_OF_23: howto manager. (line 1413) +* BFD_RELOC_TIC54X_23: howto manager. (line 1411) +* BFD_RELOC_TIC54X_MS7_OF_23: howto manager. (line 1417) +* BFD_RELOC_TIC54X_PARTLS7: howto manager. (line 1403) +* BFD_RELOC_TIC54X_PARTMS9: howto manager. (line 1407) +* BFD_RELOC_TILEGX_BROFF_X1: howto manager. (line 2859) +* BFD_RELOC_TILEGX_COPY: howto manager. (line 2855) +* BFD_RELOC_TILEGX_DEST_IMM8_X1: howto manager. (line 2866) +* BFD_RELOC_TILEGX_GLOB_DAT: howto manager. (line 2856) +* BFD_RELOC_TILEGX_HW0: howto manager. (line 2848) +* BFD_RELOC_TILEGX_HW0_LAST: howto manager. (line 2852) +* BFD_RELOC_TILEGX_HW1: howto manager. (line 2849) +* BFD_RELOC_TILEGX_HW1_LAST: howto manager. (line 2853) +* BFD_RELOC_TILEGX_HW2: howto manager. (line 2850) +* BFD_RELOC_TILEGX_HW2_LAST: howto manager. (line 2854) +* BFD_RELOC_TILEGX_HW3: howto manager. (line 2851) +* BFD_RELOC_TILEGX_IMM16_X0_HW0: howto manager. (line 2875) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT: howto manager. (line 2903) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST: howto manager. (line 2883) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT: howto manager. (line 2911) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL: howto manager. (line 2897) * BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL: howto manager. - (line 2893) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD: howto manager. (line 2887) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE: howto manager. (line 2899) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE: howto manager. (line 2883) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL: howto manager. (line 2851) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL: howto manager. (line 2867) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD: howto manager. (line 2879) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE: howto manager. (line 2891) -* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE: howto manager. (line 2881) -* BFD_RELOC_TILEGX_IMM16_X0_HW1: howto manager. (line 2839) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST: howto manager. (line 2847) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT: howto manager. (line 2875) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL: howto manager. (line 2861) + (line 2931) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD: howto manager. (line 2925) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE: howto manager. (line 2937) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE: howto manager. (line 2921) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL: howto manager. (line 2889) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL: howto manager. (line 2905) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD: howto manager. (line 2917) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE: howto manager. (line 2929) +* BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE: howto manager. (line 2919) +* BFD_RELOC_TILEGX_IMM16_X0_HW1: howto manager. (line 2877) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST: howto manager. (line 2885) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT: howto manager. (line 2913) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL: howto manager. (line 2899) * BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL: howto manager. - (line 2895) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD: howto manager. (line 2889) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE: howto manager. (line 2901) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE: howto manager. (line 2885) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL: howto manager. (line 2853) -* BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL: howto manager. (line 2869) -* BFD_RELOC_TILEGX_IMM16_X0_HW2: howto manager. (line 2841) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST: howto manager. (line 2849) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL: howto manager. (line 2863) + (line 2933) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD: howto manager. (line 2927) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE: howto manager. (line 2939) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE: howto manager. (line 2923) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL: howto manager. (line 2891) +* BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL: howto manager. (line 2907) +* BFD_RELOC_TILEGX_IMM16_X0_HW2: howto manager. (line 2879) +* BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST: howto manager. (line 2887) +* BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL: howto manager. (line 2901) * BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL: howto manager. - (line 2897) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL: howto manager. (line 2855) -* BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL: howto manager. (line 2871) -* BFD_RELOC_TILEGX_IMM16_X0_HW3: howto manager. (line 2843) -* BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL: howto manager. (line 2857) -* BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL: howto manager. (line 2877) -* BFD_RELOC_TILEGX_IMM16_X1_HW0: howto manager. (line 2838) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT: howto manager. (line 2866) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST: howto manager. (line 2846) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT: howto manager. (line 2874) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL: howto manager. (line 2860) + (line 2935) +* BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL: howto manager. (line 2893) +* BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL: howto manager. (line 2909) +* BFD_RELOC_TILEGX_IMM16_X0_HW3: howto manager. (line 2881) +* BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL: howto manager. (line 2895) +* BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL: howto manager. (line 2915) +* BFD_RELOC_TILEGX_IMM16_X1_HW0: howto manager. (line 2876) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT: howto manager. (line 2904) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST: howto manager. (line 2884) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT: howto manager. (line 2912) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL: howto manager. (line 2898) * BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL: howto manager. - (line 2894) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD: howto manager. (line 2888) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE: howto manager. (line 2900) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE: howto manager. (line 2884) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL: howto manager. (line 2852) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL: howto manager. (line 2868) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD: howto manager. (line 2880) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE: howto manager. (line 2892) -* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE: howto manager. (line 2882) -* BFD_RELOC_TILEGX_IMM16_X1_HW1: howto manager. (line 2840) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST: howto manager. (line 2848) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT: howto manager. (line 2876) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL: howto manager. (line 2862) + (line 2932) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD: howto manager. (line 2926) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE: howto manager. (line 2938) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE: howto manager. (line 2922) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL: howto manager. (line 2890) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL: howto manager. (line 2906) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD: howto manager. (line 2918) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE: howto manager. (line 2930) +* BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE: howto manager. (line 2920) +* BFD_RELOC_TILEGX_IMM16_X1_HW1: howto manager. (line 2878) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST: howto manager. (line 2886) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT: howto manager. (line 2914) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL: howto manager. (line 2900) * BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL: howto manager. - (line 2896) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD: howto manager. (line 2890) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE: howto manager. (line 2902) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE: howto manager. (line 2886) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL: howto manager. (line 2854) -* BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL: howto manager. (line 2870) -* BFD_RELOC_TILEGX_IMM16_X1_HW2: howto manager. (line 2842) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST: howto manager. (line 2850) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL: howto manager. (line 2864) + (line 2934) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD: howto manager. (line 2928) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE: howto manager. (line 2940) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE: howto manager. (line 2924) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL: howto manager. (line 2892) +* BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL: howto manager. (line 2908) +* BFD_RELOC_TILEGX_IMM16_X1_HW2: howto manager. (line 2880) +* BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST: howto manager. (line 2888) +* BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL: howto manager. (line 2902) * BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL: howto manager. - (line 2898) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL: howto manager. (line 2856) -* BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL: howto manager. (line 2872) -* BFD_RELOC_TILEGX_IMM16_X1_HW3: howto manager. (line 2844) -* BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL: howto manager. (line 2858) -* BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL: howto manager. (line 2878) -* BFD_RELOC_TILEGX_IMM8_X0: howto manager. (line 2824) -* BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD: howto manager. (line 2915) -* BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD: howto manager. (line 2910) -* BFD_RELOC_TILEGX_IMM8_X1: howto manager. (line 2826) -* BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD: howto manager. (line 2916) -* BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD: howto manager. (line 2911) -* BFD_RELOC_TILEGX_IMM8_Y0: howto manager. (line 2825) -* BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD: howto manager. (line 2917) -* BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD: howto manager. (line 2912) -* BFD_RELOC_TILEGX_IMM8_Y1: howto manager. (line 2827) -* BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD: howto manager. (line 2918) -* BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD: howto manager. (line 2913) -* BFD_RELOC_TILEGX_JMP_SLOT: howto manager. (line 2819) -* BFD_RELOC_TILEGX_JUMPOFF_X1: howto manager. (line 2822) -* BFD_RELOC_TILEGX_JUMPOFF_X1_PLT: howto manager. (line 2823) -* BFD_RELOC_TILEGX_MF_IMM14_X1: howto manager. (line 2830) -* BFD_RELOC_TILEGX_MMEND_X0: howto manager. (line 2832) -* BFD_RELOC_TILEGX_MMSTART_X0: howto manager. (line 2831) -* BFD_RELOC_TILEGX_MT_IMM14_X1: howto manager. (line 2829) -* BFD_RELOC_TILEGX_RELATIVE: howto manager. (line 2820) -* BFD_RELOC_TILEGX_SHAMT_X0: howto manager. (line 2833) -* BFD_RELOC_TILEGX_SHAMT_X1: howto manager. (line 2834) -* BFD_RELOC_TILEGX_SHAMT_Y0: howto manager. (line 2835) -* BFD_RELOC_TILEGX_SHAMT_Y1: howto manager. (line 2836) -* BFD_RELOC_TILEGX_TLS_DTPMOD32: howto manager. (line 2906) -* BFD_RELOC_TILEGX_TLS_DTPMOD64: howto manager. (line 2903) -* BFD_RELOC_TILEGX_TLS_DTPOFF32: howto manager. (line 2907) -* BFD_RELOC_TILEGX_TLS_DTPOFF64: howto manager. (line 2904) -* BFD_RELOC_TILEGX_TLS_GD_CALL: howto manager. (line 2909) -* BFD_RELOC_TILEGX_TLS_IE_LOAD: howto manager. (line 2914) -* BFD_RELOC_TILEGX_TLS_TPOFF32: howto manager. (line 2908) -* BFD_RELOC_TILEGX_TLS_TPOFF64: howto manager. (line 2905) -* BFD_RELOC_TILEPRO_BROFF_X1: howto manager. (line 2734) -* BFD_RELOC_TILEPRO_COPY: howto manager. (line 2730) -* BFD_RELOC_TILEPRO_DEST_IMM8_X1: howto manager. (line 2741) -* BFD_RELOC_TILEPRO_GLOB_DAT: howto manager. (line 2731) -* BFD_RELOC_TILEPRO_IMM16_X0: howto manager. (line 2744) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT: howto manager. (line 2760) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA: howto manager. (line 2766) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI: howto manager. (line 2764) -* BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO: howto manager. (line 2762) -* BFD_RELOC_TILEPRO_IMM16_X0_HA: howto manager. (line 2750) -* BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL: howto manager. (line 2758) -* BFD_RELOC_TILEPRO_IMM16_X0_HI: howto manager. (line 2748) -* BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL: howto manager. (line 2756) -* BFD_RELOC_TILEPRO_IMM16_X0_LO: howto manager. (line 2746) -* BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL: howto manager. (line 2754) -* BFD_RELOC_TILEPRO_IMM16_X0_PCREL: howto manager. (line 2752) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD: howto manager. (line 2782) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA: howto manager. (line 2788) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI: howto manager. (line 2786) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO: howto manager. (line 2784) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE: howto manager. (line 2790) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA: howto manager. (line 2796) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI: howto manager. (line 2794) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO: howto manager. (line 2792) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE: howto manager. (line 2801) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA: howto manager. (line 2807) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI: howto manager. (line 2805) -* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO: howto manager. (line 2803) -* BFD_RELOC_TILEPRO_IMM16_X1: howto manager. (line 2745) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT: howto manager. (line 2761) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA: howto manager. (line 2767) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI: howto manager. (line 2765) -* BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO: howto manager. (line 2763) -* BFD_RELOC_TILEPRO_IMM16_X1_HA: howto manager. (line 2751) -* BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL: howto manager. (line 2759) -* BFD_RELOC_TILEPRO_IMM16_X1_HI: howto manager. (line 2749) -* BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL: howto manager. (line 2757) -* BFD_RELOC_TILEPRO_IMM16_X1_LO: howto manager. (line 2747) -* BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL: howto manager. (line 2755) -* BFD_RELOC_TILEPRO_IMM16_X1_PCREL: howto manager. (line 2753) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD: howto manager. (line 2783) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA: howto manager. (line 2789) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI: howto manager. (line 2787) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO: howto manager. (line 2785) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE: howto manager. (line 2791) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA: howto manager. (line 2797) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI: howto manager. (line 2795) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO: howto manager. (line 2793) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE: howto manager. (line 2802) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA: howto manager. (line 2808) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI: howto manager. (line 2806) -* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO: howto manager. (line 2804) -* BFD_RELOC_TILEPRO_IMM8_X0: howto manager. (line 2737) -* BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD: howto manager. (line 2777) -* BFD_RELOC_TILEPRO_IMM8_X1: howto manager. (line 2739) -* BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD: howto manager. (line 2778) -* BFD_RELOC_TILEPRO_IMM8_Y0: howto manager. (line 2738) -* BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD: howto manager. (line 2779) -* BFD_RELOC_TILEPRO_IMM8_Y1: howto manager. (line 2740) -* BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD: howto manager. (line 2780) -* BFD_RELOC_TILEPRO_JMP_SLOT: howto manager. (line 2732) -* BFD_RELOC_TILEPRO_JOFFLONG_X1: howto manager. (line 2735) -* BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT: howto manager. (line 2736) -* BFD_RELOC_TILEPRO_MF_IMM15_X1: howto manager. (line 2743) -* BFD_RELOC_TILEPRO_MMEND_X0: howto manager. (line 2769) -* BFD_RELOC_TILEPRO_MMEND_X1: howto manager. (line 2771) -* BFD_RELOC_TILEPRO_MMSTART_X0: howto manager. (line 2768) -* BFD_RELOC_TILEPRO_MMSTART_X1: howto manager. (line 2770) -* BFD_RELOC_TILEPRO_MT_IMM15_X1: howto manager. (line 2742) -* BFD_RELOC_TILEPRO_RELATIVE: howto manager. (line 2733) -* BFD_RELOC_TILEPRO_SHAMT_X0: howto manager. (line 2772) -* BFD_RELOC_TILEPRO_SHAMT_X1: howto manager. (line 2773) -* BFD_RELOC_TILEPRO_SHAMT_Y0: howto manager. (line 2774) -* BFD_RELOC_TILEPRO_SHAMT_Y1: howto manager. (line 2775) -* BFD_RELOC_TILEPRO_TLS_DTPMOD32: howto manager. (line 2798) -* BFD_RELOC_TILEPRO_TLS_DTPOFF32: howto manager. (line 2799) -* BFD_RELOC_TILEPRO_TLS_GD_CALL: howto manager. (line 2776) -* BFD_RELOC_TILEPRO_TLS_IE_LOAD: howto manager. (line 2781) -* BFD_RELOC_TILEPRO_TLS_TPOFF32: howto manager. (line 2800) -* bfd_reloc_type_lookup: howto manager. (line 2937) -* BFD_RELOC_V850_16_GOT: howto manager. (line 1346) -* BFD_RELOC_V850_16_GOTOFF: howto manager. (line 1362) -* BFD_RELOC_V850_16_PCREL: howto manager. (line 1326) -* BFD_RELOC_V850_16_S1: howto manager. (line 1338) -* BFD_RELOC_V850_16_SPLIT_OFFSET: howto manager. (line 1336) -* BFD_RELOC_V850_17_PCREL: howto manager. (line 1328) -* BFD_RELOC_V850_22_PCREL: howto manager. (line 1280) -* BFD_RELOC_V850_22_PLT_PCREL: howto manager. (line 1350) -* BFD_RELOC_V850_23: howto manager. (line 1330) -* BFD_RELOC_V850_32_ABS: howto manager. (line 1334) -* BFD_RELOC_V850_32_GOT: howto manager. (line 1348) -* BFD_RELOC_V850_32_GOTOFF: howto manager. (line 1364) -* BFD_RELOC_V850_32_GOTPCREL: howto manager. (line 1344) -* BFD_RELOC_V850_32_PCREL: howto manager. (line 1332) -* BFD_RELOC_V850_32_PLT_PCREL: howto manager. (line 1352) -* BFD_RELOC_V850_9_PCREL: howto manager. (line 1278) -* BFD_RELOC_V850_ALIGN: howto manager. (line 1321) -* BFD_RELOC_V850_CALLT_15_16_OFFSET: howto manager. (line 1342) -* BFD_RELOC_V850_CALLT_16_16_OFFSET: howto manager. (line 1315) -* BFD_RELOC_V850_CALLT_6_7_OFFSET: howto manager. (line 1313) -* BFD_RELOC_V850_CODE: howto manager. (line 1366) -* BFD_RELOC_V850_COPY: howto manager. (line 1354) -* BFD_RELOC_V850_DATA: howto manager. (line 1368) -* BFD_RELOC_V850_GLOB_DAT: howto manager. (line 1356) -* BFD_RELOC_V850_JMP_SLOT: howto manager. (line 1358) -* BFD_RELOC_V850_LO16_S1: howto manager. (line 1340) -* BFD_RELOC_V850_LO16_SPLIT_OFFSET: howto manager. (line 1323) -* BFD_RELOC_V850_LONGCALL: howto manager. (line 1317) -* BFD_RELOC_V850_LONGJUMP: howto manager. (line 1319) -* BFD_RELOC_V850_RELATIVE: howto manager. (line 1360) -* BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. (line 1284) -* BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. (line 1282) -* BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET: howto manager. (line 1307) -* BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. (line 1300) -* BFD_RELOC_V850_TDA_4_4_OFFSET: howto manager. (line 1305) -* BFD_RELOC_V850_TDA_4_5_OFFSET: howto manager. (line 1302) -* BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. (line 1292) -* BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. (line 1298) -* BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. (line 1295) -* BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. (line 1289) -* BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. (line 1287) -* BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. (line 1310) -* BFD_RELOC_VAX_GLOB_DAT: howto manager. (line 2240) -* BFD_RELOC_VAX_JMP_SLOT: howto manager. (line 2241) -* BFD_RELOC_VAX_RELATIVE: howto manager. (line 2242) -* BFD_RELOC_VPE4KMATH_DATA: howto manager. (line 1843) -* BFD_RELOC_VPE4KMATH_INSN: howto manager. (line 1844) -* BFD_RELOC_VTABLE_ENTRY: howto manager. (line 1847) -* BFD_RELOC_VTABLE_INHERIT: howto manager. (line 1846) -* BFD_RELOC_X86_64_32S: howto manager. (line 540) -* BFD_RELOC_X86_64_COPY: howto manager. (line 535) -* BFD_RELOC_X86_64_DTPMOD64: howto manager. (line 541) -* BFD_RELOC_X86_64_DTPOFF32: howto manager. (line 546) -* BFD_RELOC_X86_64_DTPOFF64: howto manager. (line 542) -* BFD_RELOC_X86_64_GLOB_DAT: howto manager. (line 536) -* BFD_RELOC_X86_64_GOT32: howto manager. (line 533) -* BFD_RELOC_X86_64_GOT64: howto manager. (line 551) -* BFD_RELOC_X86_64_GOTOFF64: howto manager. (line 549) -* BFD_RELOC_X86_64_GOTPC32: howto manager. (line 550) -* BFD_RELOC_X86_64_GOTPC32_TLSDESC: howto manager. (line 556) -* BFD_RELOC_X86_64_GOTPC64: howto manager. (line 553) -* BFD_RELOC_X86_64_GOTPCREL: howto manager. (line 539) -* BFD_RELOC_X86_64_GOTPCREL64: howto manager. (line 552) -* BFD_RELOC_X86_64_GOTPLT64: howto manager. (line 554) -* BFD_RELOC_X86_64_GOTTPOFF: howto manager. (line 547) -* BFD_RELOC_X86_64_IRELATIVE: howto manager. (line 559) -* BFD_RELOC_X86_64_JUMP_SLOT: howto manager. (line 537) -* BFD_RELOC_X86_64_PC32_BND: howto manager. (line 560) -* BFD_RELOC_X86_64_PLT32: howto manager. (line 534) -* BFD_RELOC_X86_64_PLT32_BND: howto manager. (line 561) -* BFD_RELOC_X86_64_PLTOFF64: howto manager. (line 555) -* BFD_RELOC_X86_64_RELATIVE: howto manager. (line 538) -* BFD_RELOC_X86_64_TLSDESC: howto manager. (line 558) -* BFD_RELOC_X86_64_TLSDESC_CALL: howto manager. (line 557) -* BFD_RELOC_X86_64_TLSGD: howto manager. (line 544) -* BFD_RELOC_X86_64_TLSLD: howto manager. (line 545) -* BFD_RELOC_X86_64_TPOFF32: howto manager. (line 548) -* BFD_RELOC_X86_64_TPOFF64: howto manager. (line 543) -* BFD_RELOC_XC16X_PAG: howto manager. (line 2235) -* BFD_RELOC_XC16X_POF: howto manager. (line 2236) -* BFD_RELOC_XC16X_SEG: howto manager. (line 2237) -* BFD_RELOC_XC16X_SOF: howto manager. (line 2238) -* BFD_RELOC_XGATE_24: howto manager. (line 1990) -* BFD_RELOC_XGATE_GPAGE: howto manager. (line 1988) -* BFD_RELOC_XGATE_IMM3: howto manager. (line 2002) -* BFD_RELOC_XGATE_IMM4: howto manager. (line 2004) -* BFD_RELOC_XGATE_IMM5: howto manager. (line 2006) -* BFD_RELOC_XGATE_IMM8_HI: howto manager. (line 1999) -* BFD_RELOC_XGATE_IMM8_LO: howto manager. (line 1996) -* BFD_RELOC_XGATE_LO16: howto manager. (line 1985) -* BFD_RELOC_XGATE_PCREL_10: howto manager. (line 1994) -* BFD_RELOC_XGATE_PCREL_9: howto manager. (line 1992) -* BFD_RELOC_XGATE_RL_GROUP: howto manager. (line 1981) -* BFD_RELOC_XGATE_RL_JUMP: howto manager. (line 1978) -* BFD_RELOC_XSTORMY16_12: howto manager. (line 2229) -* BFD_RELOC_XSTORMY16_24: howto manager. (line 2230) -* BFD_RELOC_XSTORMY16_FPTR16: howto manager. (line 2231) -* BFD_RELOC_XSTORMY16_REL_12: howto manager. (line 2228) -* BFD_RELOC_XTENSA_ASM_EXPAND: howto manager. (line 2385) -* BFD_RELOC_XTENSA_ASM_SIMPLIFY: howto manager. (line 2389) -* BFD_RELOC_XTENSA_DIFF16: howto manager. (line 2336) -* BFD_RELOC_XTENSA_DIFF32: howto manager. (line 2337) -* BFD_RELOC_XTENSA_DIFF8: howto manager. (line 2335) -* BFD_RELOC_XTENSA_GLOB_DAT: howto manager. (line 2327) -* BFD_RELOC_XTENSA_JMP_SLOT: howto manager. (line 2328) -* BFD_RELOC_XTENSA_OP0: howto manager. (line 2380) -* BFD_RELOC_XTENSA_OP1: howto manager. (line 2381) -* BFD_RELOC_XTENSA_OP2: howto manager. (line 2382) -* BFD_RELOC_XTENSA_PLT: howto manager. (line 2331) -* BFD_RELOC_XTENSA_RELATIVE: howto manager. (line 2329) -* BFD_RELOC_XTENSA_RTLD: howto manager. (line 2323) -* BFD_RELOC_XTENSA_SLOT0_ALT: howto manager. (line 2363) -* BFD_RELOC_XTENSA_SLOT0_OP: howto manager. (line 2344) -* BFD_RELOC_XTENSA_SLOT10_ALT: howto manager. (line 2373) -* BFD_RELOC_XTENSA_SLOT10_OP: howto manager. (line 2354) -* BFD_RELOC_XTENSA_SLOT11_ALT: howto manager. (line 2374) -* BFD_RELOC_XTENSA_SLOT11_OP: howto manager. (line 2355) -* BFD_RELOC_XTENSA_SLOT12_ALT: howto manager. (line 2375) -* BFD_RELOC_XTENSA_SLOT12_OP: howto manager. (line 2356) -* BFD_RELOC_XTENSA_SLOT13_ALT: howto manager. (line 2376) -* BFD_RELOC_XTENSA_SLOT13_OP: howto manager. (line 2357) -* BFD_RELOC_XTENSA_SLOT14_ALT: howto manager. (line 2377) -* BFD_RELOC_XTENSA_SLOT14_OP: howto manager. (line 2358) -* BFD_RELOC_XTENSA_SLOT1_ALT: howto manager. (line 2364) -* BFD_RELOC_XTENSA_SLOT1_OP: howto manager. (line 2345) -* BFD_RELOC_XTENSA_SLOT2_ALT: howto manager. (line 2365) -* BFD_RELOC_XTENSA_SLOT2_OP: howto manager. (line 2346) -* BFD_RELOC_XTENSA_SLOT3_ALT: howto manager. (line 2366) -* BFD_RELOC_XTENSA_SLOT3_OP: howto manager. (line 2347) -* BFD_RELOC_XTENSA_SLOT4_ALT: howto manager. (line 2367) -* BFD_RELOC_XTENSA_SLOT4_OP: howto manager. (line 2348) -* BFD_RELOC_XTENSA_SLOT5_ALT: howto manager. (line 2368) -* BFD_RELOC_XTENSA_SLOT5_OP: howto manager. (line 2349) -* BFD_RELOC_XTENSA_SLOT6_ALT: howto manager. (line 2369) -* BFD_RELOC_XTENSA_SLOT6_OP: howto manager. (line 2350) -* BFD_RELOC_XTENSA_SLOT7_ALT: howto manager. (line 2370) -* BFD_RELOC_XTENSA_SLOT7_OP: howto manager. (line 2351) -* BFD_RELOC_XTENSA_SLOT8_ALT: howto manager. (line 2371) -* BFD_RELOC_XTENSA_SLOT8_OP: howto manager. (line 2352) -* BFD_RELOC_XTENSA_SLOT9_ALT: howto manager. (line 2372) -* BFD_RELOC_XTENSA_SLOT9_OP: howto manager. (line 2353) -* BFD_RELOC_XTENSA_TLSDESC_ARG: howto manager. (line 2394) -* BFD_RELOC_XTENSA_TLSDESC_FN: howto manager. (line 2393) -* BFD_RELOC_XTENSA_TLS_ARG: howto manager. (line 2398) -* BFD_RELOC_XTENSA_TLS_CALL: howto manager. (line 2399) -* BFD_RELOC_XTENSA_TLS_DTPOFF: howto manager. (line 2395) -* BFD_RELOC_XTENSA_TLS_FUNC: howto manager. (line 2397) -* BFD_RELOC_XTENSA_TLS_TPOFF: howto manager. (line 2396) -* BFD_RELOC_Z80_DISP8: howto manager. (line 2401) -* BFD_RELOC_Z8K_CALLR: howto manager. (line 2405) -* BFD_RELOC_Z8K_DISP7: howto manager. (line 2403) -* BFD_RELOC_Z8K_IMM4L: howto manager. (line 2407) + (line 2936) +* BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL: howto manager. (line 2894) +* BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL: howto manager. (line 2910) +* BFD_RELOC_TILEGX_IMM16_X1_HW3: howto manager. (line 2882) +* BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL: howto manager. (line 2896) +* BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL: howto manager. (line 2916) +* BFD_RELOC_TILEGX_IMM8_X0: howto manager. (line 2862) +* BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD: howto manager. (line 2953) +* BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD: howto manager. (line 2948) +* BFD_RELOC_TILEGX_IMM8_X1: howto manager. (line 2864) +* BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD: howto manager. (line 2954) +* BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD: howto manager. (line 2949) +* BFD_RELOC_TILEGX_IMM8_Y0: howto manager. (line 2863) +* BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD: howto manager. (line 2955) +* BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD: howto manager. (line 2950) +* BFD_RELOC_TILEGX_IMM8_Y1: howto manager. (line 2865) +* BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD: howto manager. (line 2956) +* BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD: howto manager. (line 2951) +* BFD_RELOC_TILEGX_JMP_SLOT: howto manager. (line 2857) +* BFD_RELOC_TILEGX_JUMPOFF_X1: howto manager. (line 2860) +* BFD_RELOC_TILEGX_JUMPOFF_X1_PLT: howto manager. (line 2861) +* BFD_RELOC_TILEGX_MF_IMM14_X1: howto manager. (line 2868) +* BFD_RELOC_TILEGX_MMEND_X0: howto manager. (line 2870) +* BFD_RELOC_TILEGX_MMSTART_X0: howto manager. (line 2869) +* BFD_RELOC_TILEGX_MT_IMM14_X1: howto manager. (line 2867) +* BFD_RELOC_TILEGX_RELATIVE: howto manager. (line 2858) +* BFD_RELOC_TILEGX_SHAMT_X0: howto manager. (line 2871) +* BFD_RELOC_TILEGX_SHAMT_X1: howto manager. (line 2872) +* BFD_RELOC_TILEGX_SHAMT_Y0: howto manager. (line 2873) +* BFD_RELOC_TILEGX_SHAMT_Y1: howto manager. (line 2874) +* BFD_RELOC_TILEGX_TLS_DTPMOD32: howto manager. (line 2944) +* BFD_RELOC_TILEGX_TLS_DTPMOD64: howto manager. (line 2941) +* BFD_RELOC_TILEGX_TLS_DTPOFF32: howto manager. (line 2945) +* BFD_RELOC_TILEGX_TLS_DTPOFF64: howto manager. (line 2942) +* BFD_RELOC_TILEGX_TLS_GD_CALL: howto manager. (line 2947) +* BFD_RELOC_TILEGX_TLS_IE_LOAD: howto manager. (line 2952) +* BFD_RELOC_TILEGX_TLS_TPOFF32: howto manager. (line 2946) +* BFD_RELOC_TILEGX_TLS_TPOFF64: howto manager. (line 2943) +* BFD_RELOC_TILEPRO_BROFF_X1: howto manager. (line 2772) +* BFD_RELOC_TILEPRO_COPY: howto manager. (line 2768) +* BFD_RELOC_TILEPRO_DEST_IMM8_X1: howto manager. (line 2779) +* BFD_RELOC_TILEPRO_GLOB_DAT: howto manager. (line 2769) +* BFD_RELOC_TILEPRO_IMM16_X0: howto manager. (line 2782) +* BFD_RELOC_TILEPRO_IMM16_X0_GOT: howto manager. (line 2798) +* BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA: howto manager. (line 2804) +* BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI: howto manager. (line 2802) +* BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO: howto manager. (line 2800) +* BFD_RELOC_TILEPRO_IMM16_X0_HA: howto manager. (line 2788) +* BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL: howto manager. (line 2796) +* BFD_RELOC_TILEPRO_IMM16_X0_HI: howto manager. (line 2786) +* BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL: howto manager. (line 2794) +* BFD_RELOC_TILEPRO_IMM16_X0_LO: howto manager. (line 2784) +* BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL: howto manager. (line 2792) +* BFD_RELOC_TILEPRO_IMM16_X0_PCREL: howto manager. (line 2790) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD: howto manager. (line 2820) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA: howto manager. (line 2826) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI: howto manager. (line 2824) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO: howto manager. (line 2822) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE: howto manager. (line 2828) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA: howto manager. (line 2834) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI: howto manager. (line 2832) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO: howto manager. (line 2830) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE: howto manager. (line 2839) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA: howto manager. (line 2845) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI: howto manager. (line 2843) +* BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO: howto manager. (line 2841) +* BFD_RELOC_TILEPRO_IMM16_X1: howto manager. (line 2783) +* BFD_RELOC_TILEPRO_IMM16_X1_GOT: howto manager. (line 2799) +* BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA: howto manager. (line 2805) +* BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI: howto manager. (line 2803) +* BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO: howto manager. (line 2801) +* BFD_RELOC_TILEPRO_IMM16_X1_HA: howto manager. (line 2789) +* BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL: howto manager. (line 2797) +* BFD_RELOC_TILEPRO_IMM16_X1_HI: howto manager. (line 2787) +* BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL: howto manager. (line 2795) +* BFD_RELOC_TILEPRO_IMM16_X1_LO: howto manager. (line 2785) +* BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL: howto manager. (line 2793) +* BFD_RELOC_TILEPRO_IMM16_X1_PCREL: howto manager. (line 2791) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD: howto manager. (line 2821) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA: howto manager. (line 2827) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI: howto manager. (line 2825) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO: howto manager. (line 2823) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE: howto manager. (line 2829) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA: howto manager. (line 2835) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI: howto manager. (line 2833) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO: howto manager. (line 2831) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE: howto manager. (line 2840) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA: howto manager. (line 2846) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI: howto manager. (line 2844) +* BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO: howto manager. (line 2842) +* BFD_RELOC_TILEPRO_IMM8_X0: howto manager. (line 2775) +* BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD: howto manager. (line 2815) +* BFD_RELOC_TILEPRO_IMM8_X1: howto manager. (line 2777) +* BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD: howto manager. (line 2816) +* BFD_RELOC_TILEPRO_IMM8_Y0: howto manager. (line 2776) +* BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD: howto manager. (line 2817) +* BFD_RELOC_TILEPRO_IMM8_Y1: howto manager. (line 2778) +* BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD: howto manager. (line 2818) +* BFD_RELOC_TILEPRO_JMP_SLOT: howto manager. (line 2770) +* BFD_RELOC_TILEPRO_JOFFLONG_X1: howto manager. (line 2773) +* BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT: howto manager. (line 2774) +* BFD_RELOC_TILEPRO_MF_IMM15_X1: howto manager. (line 2781) +* BFD_RELOC_TILEPRO_MMEND_X0: howto manager. (line 2807) +* BFD_RELOC_TILEPRO_MMEND_X1: howto manager. (line 2809) +* BFD_RELOC_TILEPRO_MMSTART_X0: howto manager. (line 2806) +* BFD_RELOC_TILEPRO_MMSTART_X1: howto manager. (line 2808) +* BFD_RELOC_TILEPRO_MT_IMM15_X1: howto manager. (line 2780) +* BFD_RELOC_TILEPRO_RELATIVE: howto manager. (line 2771) +* BFD_RELOC_TILEPRO_SHAMT_X0: howto manager. (line 2810) +* BFD_RELOC_TILEPRO_SHAMT_X1: howto manager. (line 2811) +* BFD_RELOC_TILEPRO_SHAMT_Y0: howto manager. (line 2812) +* BFD_RELOC_TILEPRO_SHAMT_Y1: howto manager. (line 2813) +* BFD_RELOC_TILEPRO_TLS_DTPMOD32: howto manager. (line 2836) +* BFD_RELOC_TILEPRO_TLS_DTPOFF32: howto manager. (line 2837) +* BFD_RELOC_TILEPRO_TLS_GD_CALL: howto manager. (line 2814) +* BFD_RELOC_TILEPRO_TLS_IE_LOAD: howto manager. (line 2819) +* BFD_RELOC_TILEPRO_TLS_TPOFF32: howto manager. (line 2838) +* bfd_reloc_type_lookup: howto manager. (line 2983) +* BFD_RELOC_V850_16_GOT: howto manager. (line 1375) +* BFD_RELOC_V850_16_GOTOFF: howto manager. (line 1391) +* BFD_RELOC_V850_16_PCREL: howto manager. (line 1355) +* BFD_RELOC_V850_16_S1: howto manager. (line 1367) +* BFD_RELOC_V850_16_SPLIT_OFFSET: howto manager. (line 1365) +* BFD_RELOC_V850_17_PCREL: howto manager. (line 1357) +* BFD_RELOC_V850_22_PCREL: howto manager. (line 1309) +* BFD_RELOC_V850_22_PLT_PCREL: howto manager. (line 1379) +* BFD_RELOC_V850_23: howto manager. (line 1359) +* BFD_RELOC_V850_32_ABS: howto manager. (line 1363) +* BFD_RELOC_V850_32_GOT: howto manager. (line 1377) +* BFD_RELOC_V850_32_GOTOFF: howto manager. (line 1393) +* BFD_RELOC_V850_32_GOTPCREL: howto manager. (line 1373) +* BFD_RELOC_V850_32_PCREL: howto manager. (line 1361) +* BFD_RELOC_V850_32_PLT_PCREL: howto manager. (line 1381) +* BFD_RELOC_V850_9_PCREL: howto manager. (line 1307) +* BFD_RELOC_V850_ALIGN: howto manager. (line 1350) +* BFD_RELOC_V850_CALLT_15_16_OFFSET: howto manager. (line 1371) +* BFD_RELOC_V850_CALLT_16_16_OFFSET: howto manager. (line 1344) +* BFD_RELOC_V850_CALLT_6_7_OFFSET: howto manager. (line 1342) +* BFD_RELOC_V850_CODE: howto manager. (line 1395) +* BFD_RELOC_V850_COPY: howto manager. (line 1383) +* BFD_RELOC_V850_DATA: howto manager. (line 1397) +* BFD_RELOC_V850_GLOB_DAT: howto manager. (line 1385) +* BFD_RELOC_V850_JMP_SLOT: howto manager. (line 1387) +* BFD_RELOC_V850_LO16_S1: howto manager. (line 1369) +* BFD_RELOC_V850_LO16_SPLIT_OFFSET: howto manager. (line 1352) +* BFD_RELOC_V850_LONGCALL: howto manager. (line 1346) +* BFD_RELOC_V850_LONGJUMP: howto manager. (line 1348) +* BFD_RELOC_V850_RELATIVE: howto manager. (line 1389) +* BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. (line 1313) +* BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. (line 1311) +* BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET: howto manager. (line 1336) +* BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. (line 1329) +* BFD_RELOC_V850_TDA_4_4_OFFSET: howto manager. (line 1334) +* BFD_RELOC_V850_TDA_4_5_OFFSET: howto manager. (line 1331) +* BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. (line 1321) +* BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. (line 1327) +* BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. (line 1324) +* BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. (line 1318) +* BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. (line 1316) +* BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. (line 1339) +* BFD_RELOC_VAX_GLOB_DAT: howto manager. (line 2278) +* BFD_RELOC_VAX_JMP_SLOT: howto manager. (line 2279) +* BFD_RELOC_VAX_RELATIVE: howto manager. (line 2280) +* BFD_RELOC_VISIUM_HI16: howto manager. (line 2973) +* BFD_RELOC_VISIUM_HI16_PCREL: howto manager. (line 2977) +* BFD_RELOC_VISIUM_IM16: howto manager. (line 2975) +* BFD_RELOC_VISIUM_IM16_PCREL: howto manager. (line 2979) +* BFD_RELOC_VISIUM_LO16: howto manager. (line 2974) +* BFD_RELOC_VISIUM_LO16_PCREL: howto manager. (line 2978) +* BFD_RELOC_VISIUM_REL16: howto manager. (line 2976) +* BFD_RELOC_VPE4KMATH_DATA: howto manager. (line 1881) +* BFD_RELOC_VPE4KMATH_INSN: howto manager. (line 1882) +* BFD_RELOC_VTABLE_ENTRY: howto manager. (line 1885) +* BFD_RELOC_VTABLE_INHERIT: howto manager. (line 1884) +* BFD_RELOC_X86_64_32S: howto manager. (line 545) +* BFD_RELOC_X86_64_COPY: howto manager. (line 540) +* BFD_RELOC_X86_64_DTPMOD64: howto manager. (line 546) +* BFD_RELOC_X86_64_DTPOFF32: howto manager. (line 551) +* BFD_RELOC_X86_64_DTPOFF64: howto manager. (line 547) +* BFD_RELOC_X86_64_GLOB_DAT: howto manager. (line 541) +* BFD_RELOC_X86_64_GOT32: howto manager. (line 538) +* BFD_RELOC_X86_64_GOT64: howto manager. (line 556) +* BFD_RELOC_X86_64_GOTOFF64: howto manager. (line 554) +* BFD_RELOC_X86_64_GOTPC32: howto manager. (line 555) +* BFD_RELOC_X86_64_GOTPC32_TLSDESC: howto manager. (line 561) +* BFD_RELOC_X86_64_GOTPC64: howto manager. (line 558) +* BFD_RELOC_X86_64_GOTPCREL: howto manager. (line 544) +* BFD_RELOC_X86_64_GOTPCREL64: howto manager. (line 557) +* BFD_RELOC_X86_64_GOTPLT64: howto manager. (line 559) +* BFD_RELOC_X86_64_GOTTPOFF: howto manager. (line 552) +* BFD_RELOC_X86_64_IRELATIVE: howto manager. (line 564) +* BFD_RELOC_X86_64_JUMP_SLOT: howto manager. (line 542) +* BFD_RELOC_X86_64_PC32_BND: howto manager. (line 565) +* BFD_RELOC_X86_64_PLT32: howto manager. (line 539) +* BFD_RELOC_X86_64_PLT32_BND: howto manager. (line 566) +* BFD_RELOC_X86_64_PLTOFF64: howto manager. (line 560) +* BFD_RELOC_X86_64_RELATIVE: howto manager. (line 543) +* BFD_RELOC_X86_64_TLSDESC: howto manager. (line 563) +* BFD_RELOC_X86_64_TLSDESC_CALL: howto manager. (line 562) +* BFD_RELOC_X86_64_TLSGD: howto manager. (line 549) +* BFD_RELOC_X86_64_TLSLD: howto manager. (line 550) +* BFD_RELOC_X86_64_TPOFF32: howto manager. (line 553) +* BFD_RELOC_X86_64_TPOFF64: howto manager. (line 548) +* BFD_RELOC_XC16X_PAG: howto manager. (line 2273) +* BFD_RELOC_XC16X_POF: howto manager. (line 2274) +* BFD_RELOC_XC16X_SEG: howto manager. (line 2275) +* BFD_RELOC_XC16X_SOF: howto manager. (line 2276) +* BFD_RELOC_XGATE_24: howto manager. (line 2028) +* BFD_RELOC_XGATE_GPAGE: howto manager. (line 2026) +* BFD_RELOC_XGATE_IMM3: howto manager. (line 2040) +* BFD_RELOC_XGATE_IMM4: howto manager. (line 2042) +* BFD_RELOC_XGATE_IMM5: howto manager. (line 2044) +* BFD_RELOC_XGATE_IMM8_HI: howto manager. (line 2037) +* BFD_RELOC_XGATE_IMM8_LO: howto manager. (line 2034) +* BFD_RELOC_XGATE_LO16: howto manager. (line 2023) +* BFD_RELOC_XGATE_PCREL_10: howto manager. (line 2032) +* BFD_RELOC_XGATE_PCREL_9: howto manager. (line 2030) +* BFD_RELOC_XGATE_RL_GROUP: howto manager. (line 2019) +* BFD_RELOC_XGATE_RL_JUMP: howto manager. (line 2016) +* BFD_RELOC_XSTORMY16_12: howto manager. (line 2267) +* BFD_RELOC_XSTORMY16_24: howto manager. (line 2268) +* BFD_RELOC_XSTORMY16_FPTR16: howto manager. (line 2269) +* BFD_RELOC_XSTORMY16_REL_12: howto manager. (line 2266) +* BFD_RELOC_XTENSA_ASM_EXPAND: howto manager. (line 2423) +* BFD_RELOC_XTENSA_ASM_SIMPLIFY: howto manager. (line 2427) +* BFD_RELOC_XTENSA_DIFF16: howto manager. (line 2374) +* BFD_RELOC_XTENSA_DIFF32: howto manager. (line 2375) +* BFD_RELOC_XTENSA_DIFF8: howto manager. (line 2373) +* BFD_RELOC_XTENSA_GLOB_DAT: howto manager. (line 2365) +* BFD_RELOC_XTENSA_JMP_SLOT: howto manager. (line 2366) +* BFD_RELOC_XTENSA_OP0: howto manager. (line 2418) +* BFD_RELOC_XTENSA_OP1: howto manager. (line 2419) +* BFD_RELOC_XTENSA_OP2: howto manager. (line 2420) +* BFD_RELOC_XTENSA_PLT: howto manager. (line 2369) +* BFD_RELOC_XTENSA_RELATIVE: howto manager. (line 2367) +* BFD_RELOC_XTENSA_RTLD: howto manager. (line 2361) +* BFD_RELOC_XTENSA_SLOT0_ALT: howto manager. (line 2401) +* BFD_RELOC_XTENSA_SLOT0_OP: howto manager. (line 2382) +* BFD_RELOC_XTENSA_SLOT10_ALT: howto manager. (line 2411) +* BFD_RELOC_XTENSA_SLOT10_OP: howto manager. (line 2392) +* BFD_RELOC_XTENSA_SLOT11_ALT: howto manager. (line 2412) +* BFD_RELOC_XTENSA_SLOT11_OP: howto manager. (line 2393) +* BFD_RELOC_XTENSA_SLOT12_ALT: howto manager. (line 2413) +* BFD_RELOC_XTENSA_SLOT12_OP: howto manager. (line 2394) +* BFD_RELOC_XTENSA_SLOT13_ALT: howto manager. (line 2414) +* BFD_RELOC_XTENSA_SLOT13_OP: howto manager. (line 2395) +* BFD_RELOC_XTENSA_SLOT14_ALT: howto manager. (line 2415) +* BFD_RELOC_XTENSA_SLOT14_OP: howto manager. (line 2396) +* BFD_RELOC_XTENSA_SLOT1_ALT: howto manager. (line 2402) +* BFD_RELOC_XTENSA_SLOT1_OP: howto manager. (line 2383) +* BFD_RELOC_XTENSA_SLOT2_ALT: howto manager. (line 2403) +* BFD_RELOC_XTENSA_SLOT2_OP: howto manager. (line 2384) +* BFD_RELOC_XTENSA_SLOT3_ALT: howto manager. (line 2404) +* BFD_RELOC_XTENSA_SLOT3_OP: howto manager. (line 2385) +* BFD_RELOC_XTENSA_SLOT4_ALT: howto manager. (line 2405) +* BFD_RELOC_XTENSA_SLOT4_OP: howto manager. (line 2386) +* BFD_RELOC_XTENSA_SLOT5_ALT: howto manager. (line 2406) +* BFD_RELOC_XTENSA_SLOT5_OP: howto manager. (line 2387) +* BFD_RELOC_XTENSA_SLOT6_ALT: howto manager. (line 2407) +* BFD_RELOC_XTENSA_SLOT6_OP: howto manager. (line 2388) +* BFD_RELOC_XTENSA_SLOT7_ALT: howto manager. (line 2408) +* BFD_RELOC_XTENSA_SLOT7_OP: howto manager. (line 2389) +* BFD_RELOC_XTENSA_SLOT8_ALT: howto manager. (line 2409) +* BFD_RELOC_XTENSA_SLOT8_OP: howto manager. (line 2390) +* BFD_RELOC_XTENSA_SLOT9_ALT: howto manager. (line 2410) +* BFD_RELOC_XTENSA_SLOT9_OP: howto manager. (line 2391) +* BFD_RELOC_XTENSA_TLSDESC_ARG: howto manager. (line 2432) +* BFD_RELOC_XTENSA_TLSDESC_FN: howto manager. (line 2431) +* BFD_RELOC_XTENSA_TLS_ARG: howto manager. (line 2436) +* BFD_RELOC_XTENSA_TLS_CALL: howto manager. (line 2437) +* BFD_RELOC_XTENSA_TLS_DTPOFF: howto manager. (line 2433) +* BFD_RELOC_XTENSA_TLS_FUNC: howto manager. (line 2435) +* BFD_RELOC_XTENSA_TLS_TPOFF: howto manager. (line 2434) +* BFD_RELOC_Z80_DISP8: howto manager. (line 2439) +* BFD_RELOC_Z8K_CALLR: howto manager. (line 2443) +* BFD_RELOC_Z8K_DISP7: howto manager. (line 2441) +* BFD_RELOC_Z8K_IMM4L: howto manager. (line 2445) * bfd_rename_section: section prototypes. (line 167) -* bfd_scan_arch: Architectures. (line 511) +* bfd_scan_arch: Architectures. (line 517) * bfd_scan_vma: Miscellaneous. (line 124) -* bfd_seach_for_target: bfd_target. (line 527) +* bfd_seach_for_target: bfd_target. (line 524) * bfd_sections_find_if: section prototypes. (line 197) * bfd_section_already_linked: Writing the symbol table. (line 55) * bfd_section_list_clear: section prototypes. (line 7) * bfd_set_archive_head: Archives. (line 74) -* bfd_set_arch_info: Architectures. (line 552) +* bfd_set_arch_info: Architectures. (line 558) * bfd_set_assert_handler: Error reporting. (line 143) -* bfd_set_default_target: bfd_target. (line 466) +* bfd_set_default_target: bfd_target. (line 463) * bfd_set_error: Error reporting. (line 57) * bfd_set_error_handler: Error reporting. (line 100) * bfd_set_error_program_name: Error reporting. (line 109) @@ -13033,7 +13108,7 @@ BFD Index (line 63) * bfd_symbol_info: symbol handling functions. (line 135) -* bfd_target_list: bfd_target. (line 518) +* bfd_target_list: bfd_target. (line 515) * bfd_write_bigendian_4byte_int: Internal. (line 12) * bfd_zalloc: Opening and Closing. (line 256) @@ -13052,7 +13127,7 @@ BFD Index (line 322) * separate_debug_file_exists: Opening and Closing. (line 313) -* struct bfd_iovec: Miscellaneous. (line 367) +* struct bfd_iovec: Miscellaneous. (line 364) * target vector (_bfd_final_link): Performing the Final Link. (line 6) * target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table. @@ -13074,61 +13149,61 @@ Node: BFD information loss6247 Node: Canonical format8788 Node: BFD front end13165 Node: typedef bfd13589 -Node: Error reporting24511 -Node: Miscellaneous29373 -Node: Memory Usage46634 -Node: Initialization47865 -Node: Sections48324 -Node: Section Input48807 -Node: Section Output50176 -Node: typedef asection52663 -Node: section prototypes78829 -Node: Symbols89097 -Node: Reading Symbols90700 -Node: Writing Symbols91808 -Node: Mini Symbols93552 -Node: typedef asymbol94526 -Node: symbol handling functions100568 -Node: Archives105906 -Node: Formats109934 -Node: Relocations112885 -Node: typedef arelent113612 -Node: howto manager129268 -Node: Core Files242348 -Node: Targets244386 -Node: bfd_target246361 -Node: Architectures269576 -Node: Opening and Closing296910 -Node: Internal311225 -Node: File Caching317574 -Node: Linker Functions319492 -Node: Creating a Linker Hash Table321166 -Node: Adding Symbols to the Hash Table322905 -Node: Differing file formats323805 -Node: Adding symbols from an object file325530 -Node: Adding symbols from an archive327680 -Node: Performing the Final Link330609 -Node: Information provided by the linker331850 -Node: Relocating the section contents333004 -Node: Writing the symbol table334756 -Node: Hash Tables339142 -Node: Creating and Freeing a Hash Table340340 -Node: Looking Up or Entering a String341590 -Node: Traversing a Hash Table342843 -Node: Deriving a New Hash Table Type343632 -Node: Define the Derived Structures344698 -Node: Write the Derived Creation Routine345779 -Node: Write Other Derived Routines348403 -Node: BFD back ends349718 -Node: What to Put Where349988 -Node: aout350168 -Node: coff356511 -Node: elf385122 -Node: mmo385523 -Node: File layout386393 -Node: Symbol-table392307 -Node: mmo section mapping396070 -Node: GNU Free Documentation License399724 -Node: BFD Index424788 +Node: Error reporting24596 +Node: Miscellaneous29458 +Node: Memory Usage46595 +Node: Initialization47826 +Node: Sections48285 +Node: Section Input48768 +Node: Section Output50137 +Node: typedef asection52624 +Node: section prototypes78790 +Node: Symbols89058 +Node: Reading Symbols90661 +Node: Writing Symbols91769 +Node: Mini Symbols93513 +Node: typedef asymbol94487 +Node: symbol handling functions100529 +Node: Archives105867 +Node: Formats109895 +Node: Relocations112846 +Node: typedef arelent113573 +Node: howto manager129229 +Node: Core Files243926 +Node: Targets245964 +Node: bfd_target247939 +Node: Architectures271024 +Node: Opening and Closing298616 +Node: Internal312931 +Node: File Caching319280 +Node: Linker Functions321198 +Node: Creating a Linker Hash Table322872 +Node: Adding Symbols to the Hash Table324611 +Node: Differing file formats325511 +Node: Adding symbols from an object file327236 +Node: Adding symbols from an archive329386 +Node: Performing the Final Link331732 +Node: Information provided by the linker332973 +Node: Relocating the section contents334127 +Node: Writing the symbol table335879 +Node: Hash Tables340265 +Node: Creating and Freeing a Hash Table341463 +Node: Looking Up or Entering a String342713 +Node: Traversing a Hash Table343966 +Node: Deriving a New Hash Table Type344755 +Node: Define the Derived Structures345821 +Node: Write the Derived Creation Routine346902 +Node: Write Other Derived Routines349526 +Node: BFD back ends350841 +Node: What to Put Where351111 +Node: aout351291 +Node: coff357634 +Node: elf386320 +Node: mmo386721 +Node: File layout387591 +Node: Symbol-table393505 +Node: mmo section mapping397268 +Node: GNU Free Documentation License400922 +Node: BFD Index425986  End Tag Table diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo index 040b8d8ff..edcc4d1f3 100644 --- a/bfd/doc/bfd.texinfo +++ b/bfd/doc/bfd.texinfo @@ -1,6 +1,6 @@ \input texinfo.tex @setfilename bfd.info -@c Copyright (C) 1988-2014 Free Software Foundation, Inc. +@c Copyright (C) 1988-2015 Free Software Foundation, Inc. @c @synindex fn cp @@ -14,7 +14,7 @@ @copying This file documents the BFD library. -Copyright @copyright{} 1991-2014 Free Software Foundation, Inc. +Copyright @copyright{} 1991-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -62,7 +62,7 @@ included in the section entitled ``GNU Free Documentation License''. @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991-2014 Free Software Foundation, Inc. +Copyright @copyright{} 1991-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi index a138b0eb1..ebd8b70ee 100644 --- a/bfd/doc/bfdint.texi +++ b/bfd/doc/bfdint.texi @@ -1,5 +1,5 @@ \input texinfo -@c Copyright (C) 1988-2014 Free Software Foundation, Inc. +@c Copyright (C) 1988-2015 Free Software Foundation, Inc. @setfilename bfdint.info @settitle BFD Internals @@ -14,7 +14,7 @@ @copying This file documents the internals of the BFD library. -Copyright @copyright{} 1988-2014 Free Software Foundation, Inc. +Copyright @copyright{} 1988-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. Permission is granted to copy, distribute and/or modify this document @@ -1548,7 +1548,7 @@ following: Define either @samp{TARGET_BIG_SYM} or @samp{TARGET_LITTLE_SYM}, or both, to a unique C name to use for the target vector. This name should appear in the list of target vectors in @file{targets.c}, and will also -have to appear in @file{config.bfd} and @file{configure.in}. Define +have to appear in @file{config.bfd} and @file{configure.ac}. Define @samp{TARGET_BIG_SYM} for a big-endian processor, @samp{TARGET_LITTLE_SYM} for a little-endian processor, and define both for a bi-endian processor. diff --git a/bfd/doc/bfdsumm.texi b/bfd/doc/bfdsumm.texi index 1616be44e..389164ddc 100644 --- a/bfd/doc/bfdsumm.texi +++ b/bfd/doc/bfdsumm.texi @@ -1,5 +1,5 @@ @c This summary of BFD is shared by the BFD and LD docs. -@c Copyright (C) 2012-2014 Free Software Foundation, Inc. +@c Copyright (C) 2012-2015 Free Software Foundation, Inc. When an object file is opened, BFD subroutines automatically determine the format of the input object file. They then build a descriptor in diff --git a/bfd/doc/bfdt.texi b/bfd/doc/bfdt.texi index c60881b69..3d8f10412 100644 --- a/bfd/doc/bfdt.texi +++ b/bfd/doc/bfdt.texi @@ -21,9 +21,6 @@ enum bfd_direction struct bfd @{ - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -46,17 +43,17 @@ struct bfd /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ - flagword flags; + flagword flags : 17; /* Values that may appear in the flags field of a BFD. These also appear in the object_flags field of the bfd_target structure, where @@ -115,26 +112,23 @@ struct bfd struct. */ #define BFD_IN_MEMORY 0x800 - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 - /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ @@ -145,6 +139,42 @@ struct bfd (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + /* 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. */ @@ -169,17 +199,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -194,12 +228,12 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union @{ + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + @} link; /* Used by the back end to hold private data. */ union @@ -251,39 +285,6 @@ struct bfd struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; - - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; @}; /* See note beside bfd_set_section_userdata. */ @@ -730,12 +731,12 @@ The following functions exist but have not yet been 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)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -784,9 +785,6 @@ The following functions exist but have not yet been documented. #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) diff --git a/bfd/doc/bfdver.texi b/bfd/doc/bfdver.texi index 5a3e1b56d..2494664b6 100644 --- a/bfd/doc/bfdver.texi +++ b/bfd/doc/bfdver.texi @@ -1,4 +1,4 @@ -@set VERSION 2.24.51 +@set VERSION 2.25.51 @set VERSION_PACKAGE (GNU Binutils) -@set UPDATED October 2014 +@set UPDATED February 2015 @set BUGURL @uref{http://www.sourceware.org/bugzilla/} diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c index 1f81caeb4..af7c01b0a 100644 --- a/bfd/doc/chew.c +++ b/bfd/doc/chew.c @@ -1,5 +1,5 @@ /* chew - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Contributed by steve chamberlain @cygnus This file is part of BFD, the Binary File Descriptor library. @@ -265,6 +265,19 @@ skip_white_and_stars (src, idx) return idx; } +static unsigned int +skip_past_newline_1 (ptr, idx) + string_type *ptr; + unsigned int idx; +{ + while (at (ptr, idx) + && at (ptr, idx) != '\n') + idx++; + if (at (ptr, idx) == '\n') + return idx + 1; + return idx; +} + /***********************************************************************/ string_type stack[STACK]; @@ -474,8 +487,10 @@ remove_noncomments (src, dst) static void print_stack_level () { - fprintf (stderr, "current string stack depth = %ld, ", tos - stack); - fprintf (stderr, "current integer stack depth = %ld\n", isp - istack); + fprintf (stderr, "current string stack depth = %ld, ", + (long) (tos - stack)); + fprintf (stderr, "current integer stack depth = %ld\n", + (long) (isp - istack)); pc++; } @@ -601,10 +616,12 @@ outputdots () while (at (tos, idx)) { - if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.') + /* Every iteration begins at the start of a line. */ + if (at (tos, idx) == '.') { char c; - idx += 2; + + idx++; while ((c = at (tos, idx)) && c != '\n') { @@ -624,11 +641,13 @@ outputdots () idx++; } } + if (c == '\n') + idx++; catchar (&out, '\n'); } else { - idx++; + idx = skip_past_newline_1 (tos, idx); } } @@ -1093,10 +1112,7 @@ icatstr () static void skip_past_newline () { - while (at (ptr, idx) - && at (ptr, idx) != '\n') - idx++; - idx++; + idx = skip_past_newline_1 (ptr, idx); pc++; } @@ -1562,7 +1578,7 @@ main (ac, av) if (tos != stack) { fprintf (stderr, "finishing with current stack level %ld\n", - tos - stack); + (long) (tos - stack)); return 1; } return 0; diff --git a/bfd/doc/coffcode.texi b/bfd/doc/coffcode.texi index fe21c512c..bbf04699b 100644 --- a/bfd/doc/coffcode.texi +++ b/bfd/doc/coffcode.texi @@ -272,7 +272,7 @@ The hidden information for an @code{asymbol} is described in a typedef struct coff_ptr_struct @{ /* Remembers the offset from the first symbol in the file for - this symbol. Generated by coff_renumber_symbols. */ + this symbol. Generated by coff_renumber_symbols. */ unsigned int offset; /* Should the value of this symbol be renumbered. Used for @@ -280,15 +280,15 @@ typedef struct coff_ptr_struct unsigned int fix_value : 1; /* Should the tag field of this symbol be renumbered. - Created by coff_pointerize_aux. */ + Created by coff_pointerize_aux. */ unsigned int fix_tag : 1; /* Should the endidx field of this symbol be renumbered. - Created by coff_pointerize_aux. */ + Created by coff_pointerize_aux. */ unsigned int fix_end : 1; /* Should the x_csect.x_scnlen field be renumbered. - Created by coff_pointerize_aux. */ + Created by coff_pointerize_aux. */ unsigned int fix_scnlen : 1; /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the @@ -296,12 +296,15 @@ typedef struct coff_ptr_struct unsigned int fix_line : 1; /* The container for the symbol structure as read and translated - from the file. */ + from the file. */ union @{ union internal_auxent auxent; struct internal_syment syment; @} u; + + /* Selector for the union above. */ + bfd_boolean is_sym; @} combined_entry_type; diff --git a/bfd/doc/linker.texi b/bfd/doc/linker.texi index 8cc22ba03..81c208b3b 100644 --- a/bfd/doc/linker.texi +++ b/bfd/doc/linker.texi @@ -184,28 +184,16 @@ to the linker hash table instead.) @findex _bfd_generic_link_add_archive_symbols In most cases the work of looking through the symbols in the archive should be done by the -@code{_bfd_generic_link_add_archive_symbols} function. This -function builds a hash table from the archive symbol table and -looks through the list of undefined symbols to see which -elements should be included. +@code{_bfd_generic_link_add_archive_symbols} function. @code{_bfd_generic_link_add_archive_symbols} is passed a function to call to make the final decision about adding an archive element to the link and to do the actual work of adding the -symbols to the linker hash table. - -The function passed to -@code{_bfd_generic_link_add_archive_symbols} must read the -symbols of the archive element and decide whether the archive -element should be included in the link. If the element is to +symbols to the linker hash table. If the element is to be included, the @code{add_archive_element} linker callback routine must be called with the element as an argument, and the element's symbols must be added to the linker hash table just as though the element had itself been passed to the -@code{_bfd_link_add_symbols} function. The @code{add_archive_element} -callback has the option to indicate that it would like to -replace the element archive with a substitute BFD, in which -case it is the symbols of that substitute BFD that must be -added to the linker hash table instead. +@code{_bfd_link_add_symbols} function. When the a.out @code{_bfd_link_add_symbols} function receives an archive, it calls @code{_bfd_generic_link_add_archive_symbols} @@ -262,7 +250,7 @@ it sets up some data structures for the function to use. The @code{input_bfds} field of the @code{bfd_link_info} structure will point to a list of all the input files included in the -link. These files are linked through the @code{link_next} field +link. These files are linked through the @code{link.next} field of the @code{bfd} structure. Each section in the output file will have a list of diff --git a/bfd/doc/makefile.vms b/bfd/doc/makefile.vms index 26feca60f..23cb37800 100644 --- a/bfd/doc/makefile.vms +++ b/bfd/doc/makefile.vms @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/bfd/doc/reloc.texi b/bfd/doc/reloc.texi index 7e006d954..864774446 100644 --- a/bfd/doc/reloc.texi +++ b/bfd/doc/reloc.texi @@ -884,6 +884,12 @@ Relocation against a MIPS literal section. @deffnx {} BFD_RELOC_MICROMIPS_16_PCREL_S1 microMIPS PC-relative relocations. @end deffn +@deffn {} BFD_RELOC_MIPS_21_PCREL_S2 +@deffnx {} BFD_RELOC_MIPS_26_PCREL_S2 +@deffnx {} BFD_RELOC_MIPS_18_PCREL_S3 +@deffnx {} BFD_RELOC_MIPS_19_PCREL_S2 +MIPS PC-relative relocations. +@end deffn @deffn {} BFD_RELOC_MICROMIPS_GPREL16 @deffnx {} BFD_RELOC_MICROMIPS_HI16 @deffnx {} BFD_RELOC_MICROMIPS_HI16_S @@ -1883,6 +1889,13 @@ for PIC @deffnx {} BFD_RELOC_NDS32_15_FIXED @deffnx {} BFD_RELOC_NDS32_17_FIXED @deffnx {} BFD_RELOC_NDS32_25_FIXED +@deffnx {} BFD_RELOC_NDS32_LONGCALL4 +@deffnx {} BFD_RELOC_NDS32_LONGCALL5 +@deffnx {} BFD_RELOC_NDS32_LONGCALL6 +@deffnx {} BFD_RELOC_NDS32_LONGJUMP4 +@deffnx {} BFD_RELOC_NDS32_LONGJUMP5 +@deffnx {} BFD_RELOC_NDS32_LONGJUMP6 +@deffnx {} BFD_RELOC_NDS32_LONGJUMP7 for relax @end deffn @deffn {} BFD_RELOC_NDS32_PLTREL_HI20 @@ -1943,12 +1956,32 @@ If fp were omitted, fp can used as another gp. @deffnx {} BFD_RELOC_NDS32_DIFF16 @deffnx {} BFD_RELOC_NDS32_DIFF32 @deffnx {} BFD_RELOC_NDS32_DIFF_ULEB128 -@deffnx {} BFD_RELOC_NDS32_25_ABS -@deffnx {} BFD_RELOC_NDS32_DATA +@deffnx {} BFD_RELOC_NDS32_EMPTY +relaxation relative relocation types +@end deffn +@deffn {} BFD_RELOC_NDS32_25_ABS +This is a 25 bit absolute address. +@end deffn +@deffn {} BFD_RELOC_NDS32_DATA @deffnx {} BFD_RELOC_NDS32_TRAN @deffnx {} BFD_RELOC_NDS32_17IFC_PCREL @deffnx {} BFD_RELOC_NDS32_10IFCU_PCREL -relaxation relative relocation types +For ex9 and ifc using. +@end deffn +@deffn {} BFD_RELOC_NDS32_TPOFF +@deffnx {} BFD_RELOC_NDS32_TLS_LE_HI20 +@deffnx {} BFD_RELOC_NDS32_TLS_LE_LO12 +@deffnx {} BFD_RELOC_NDS32_TLS_LE_ADD +@deffnx {} BFD_RELOC_NDS32_TLS_LE_LS +@deffnx {} BFD_RELOC_NDS32_GOTTPOFF +@deffnx {} BFD_RELOC_NDS32_TLS_IE_HI20 +@deffnx {} BFD_RELOC_NDS32_TLS_IE_LO12S2 +@deffnx {} BFD_RELOC_NDS32_TLS_TPOFF +@deffnx {} BFD_RELOC_NDS32_TLS_LE_20 +@deffnx {} BFD_RELOC_NDS32_TLS_LE_15S0 +@deffnx {} BFD_RELOC_NDS32_TLS_LE_15S1 +@deffnx {} BFD_RELOC_NDS32_TLS_LE_15S2 +For TLS. @end deffn @deffn {} BFD_RELOC_V850_9_PCREL This is a 9-bit reloc @@ -2416,6 +2449,18 @@ assuming no relaxation. The relocation encodes the position of the second symbol so the linker can determine whether to adjust the field value. @end deffn +@deffn {} BFD_RELOC_AVR_LDS_STS_16 +This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. +@end deffn +@deffn {} BFD_RELOC_AVR_PORT6 +This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions +@end deffn +@deffn {} BFD_RELOC_AVR_PORT5 +This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions +@end deffn @deffn {} BFD_RELOC_RL78_NEG8 @deffnx {} BFD_RELOC_RL78_NEG16 @deffnx {} BFD_RELOC_RL78_NEG24 @@ -3954,6 +3999,15 @@ Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) @deffn {} BFD_RELOC_EPIPHANY_IMM8 Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. @end deffn +@deffn {} BFD_RELOC_VISIUM_HI16 +@deffnx {} BFD_RELOC_VISIUM_LO16 +@deffnx {} BFD_RELOC_VISIUM_IM16 +@deffnx {} BFD_RELOC_VISIUM_REL16 +@deffnx {} BFD_RELOC_VISIUM_HI16_PCREL +@deffnx {} BFD_RELOC_VISIUM_LO16_PCREL +@deffnx {} BFD_RELOC_VISIUM_IM16_PCREL +Visium Relocations. +@end deffn @example diff --git a/bfd/doc/targets.texi b/bfd/doc/targets.texi index 890f31bad..31be515ea 100644 --- a/bfd/doc/targets.texi +++ b/bfd/doc/targets.texi @@ -335,12 +335,12 @@ BFD_JUMP_TABLE macros. NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ @@ -357,14 +357,14 @@ BFD_JUMP_TABLE macros. void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, symbol_info *); #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) + (bfd *, struct bfd_symbol *, bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma, const char **, const char **, unsigned int *, unsigned int *); bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, struct bfd_symbol *, @@ -418,7 +418,6 @@ BFD_JUMP_TABLE macros. NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ @@ -445,16 +444,14 @@ BFD_JUMP_TABLE macros. struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) void (*_bfd_copy_link_hash_symbol_type) diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c index 7a5382d08..9fef833f5 100644 --- a/bfd/dwarf1.c +++ b/bfd/dwarf1.c @@ -1,5 +1,5 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). @@ -449,8 +449,8 @@ dwarf1_unit_find_nearest_line (struct dwarf1_debug* stash, bfd_boolean _bfd_dwarf1_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 5e322ce14..118092c5a 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -1,5 +1,5 @@ /* DWARF 2 support. - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -222,6 +222,9 @@ struct comp_unit /* The abbrev hash table. */ struct abbrev_info **abbrevs; + /* DW_AT_language. */ + int lang; + /* Note that an error was found by comp_unit_find_nearest_line. */ int error; @@ -745,7 +748,10 @@ read_alt_indirect_ref (struct comp_unit * unit, static bfd_uint64_t read_address (struct comp_unit *unit, bfd_byte *buf) { - int signed_vma = get_elf_backend_data (unit->abfd)->sign_extend_vma; + int signed_vma = 0; + + if (bfd_get_flavour (unit->abfd) == bfd_target_elf_flavour) + signed_vma = get_elf_backend_data (unit->abfd)->sign_extend_vma; if (signed_vma) { @@ -911,6 +917,14 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash) return abbrevs; } +/* Returns true if the form is one which has a string value. */ + +static inline bfd_boolean +is_str_attr (enum dwarf_form form) +{ + return form == DW_FORM_string || form == DW_FORM_strp || form == DW_FORM_GNU_strp_alt; +} + /* Read an attribute value described by an attribute form. */ static bfd_byte * @@ -1092,6 +1106,33 @@ read_attribute (struct attribute *attr, return info_ptr; } +/* Return whether DW_AT_name will return the same as DW_AT_linkage_name + for a function. */ + +static bfd_boolean +non_mangled (int lang) +{ + switch (lang) + { + default: + return FALSE; + + case DW_LANG_C89: + case DW_LANG_C: + case DW_LANG_Ada83: + case DW_LANG_Cobol74: + case DW_LANG_Cobol85: + case DW_LANG_Fortran77: + case DW_LANG_Pascal83: + case DW_LANG_C99: + case DW_LANG_Ada95: + case DW_LANG_PLI: + case DW_LANG_UPC: + case DW_LANG_C11: + return TRUE; + } +} + /* Source line information table routines. */ #define FILE_ALLOC_CHUNK 5 @@ -1150,14 +1191,15 @@ struct funcinfo struct funcinfo *caller_func; /* Source location file name where caller_func inlines this func. */ char *caller_file; - /* Source location line number where caller_func inlines this func. */ - int caller_line; /* Source location file name. */ char *file; + /* Source location line number where caller_func inlines this func. */ + int caller_line; /* Source location line number. */ int line; int tag; - char *name; + bfd_boolean is_linkage; + const char *name; struct arange arange; /* Where the symbol is defined. */ asection *sec; @@ -1981,7 +2023,7 @@ read_debug_ranges (struct comp_unit *unit) /* Function table functions. */ -/* If ADDR is within UNIT's function tables, set FUNCTIONNAME_PTR, and return +/* If ADDR is within UNIT's function tables, set FUNCTION_PTR, and return TRUE. Note that we need to find the function that has the smallest range that contains ADDR, to handle inlined functions without depending upon them being ordered in TABLE by increasing range. */ @@ -1989,8 +2031,7 @@ read_debug_ranges (struct comp_unit *unit) static bfd_boolean lookup_address_in_function_table (struct comp_unit *unit, bfd_vma addr, - struct funcinfo **function_ptr, - const char **functionname_ptr) + struct funcinfo **function_ptr) { struct funcinfo* each_func; struct funcinfo* best_fit = NULL; @@ -2019,14 +2060,10 @@ lookup_address_in_function_table (struct comp_unit *unit, if (best_fit) { - *functionname_ptr = best_fit->name; *function_ptr = best_fit; return TRUE; } - else - { - return FALSE; - } + return FALSE; } /* If SYM at ADDR is within function table of UNIT, set FILENAME_PTR @@ -2117,7 +2154,8 @@ lookup_symbol_in_variable_table (struct comp_unit *unit, static char * find_abstract_instance_name (struct comp_unit *unit, - struct attribute *attr_ptr) + struct attribute *attr_ptr, + bfd_boolean *is_linkage) { bfd *abfd = unit->abfd; bfd_byte *info_ptr; @@ -2168,7 +2206,7 @@ find_abstract_instance_name (struct comp_unit *unit, (*_bfd_error_handler) (_("Dwarf Error: Unable to read alt ref %u."), die_ref); bfd_set_error (bfd_error_bad_value); - return name; + return NULL; } /* FIXME: Do we need to locate the correct CU, in a similar fashion to the code in the DW_FORM_ref_addr case above ? */ @@ -2201,15 +2239,25 @@ find_abstract_instance_name (struct comp_unit *unit, case DW_AT_name: /* Prefer DW_AT_MIPS_linkage_name or DW_AT_linkage_name over DW_AT_name. */ - if (name == NULL) - name = attr.u.str; + if (name == NULL && is_str_attr (attr.form)) + { + name = attr.u.str; + if (non_mangled (unit->lang)) + *is_linkage = TRUE; + } break; case DW_AT_specification: - name = find_abstract_instance_name (unit, &attr); + name = find_abstract_instance_name (unit, &attr, is_linkage); break; case DW_AT_linkage_name: case DW_AT_MIPS_linkage_name: - name = attr.u.str; + /* PR 16949: Corrupt debug info can place + non-string forms into these attributes. */ + if (is_str_attr (attr.form)) + { + name = attr.u.str; + *is_linkage = TRUE; + } break; default: break; @@ -2375,19 +2423,30 @@ scan_unit_for_symbols (struct comp_unit *unit) case DW_AT_abstract_origin: case DW_AT_specification: - func->name = find_abstract_instance_name (unit, &attr); + func->name = find_abstract_instance_name (unit, &attr, + &func->is_linkage); break; case DW_AT_name: /* Prefer DW_AT_MIPS_linkage_name or DW_AT_linkage_name over DW_AT_name. */ - if (func->name == NULL) - func->name = attr.u.str; + if (func->name == NULL && is_str_attr (attr.form)) + { + func->name = attr.u.str; + if (non_mangled (unit->lang)) + func->is_linkage = TRUE; + } break; case DW_AT_linkage_name: case DW_AT_MIPS_linkage_name: - func->name = attr.u.str; + /* PR 16949: Corrupt debug info can place + non-string forms into these attributes. */ + if (is_str_attr (attr.form)) + { + func->name = attr.u.str; + func->is_linkage = TRUE; + } break; case DW_AT_low_pc: @@ -2675,6 +2734,10 @@ parse_comp_unit (struct dwarf2_debug *stash, break; } + case DW_AT_language: + unit->lang = attr.u.val; + break; + default: break; } @@ -2719,7 +2782,7 @@ comp_unit_contains_address (struct comp_unit *unit, bfd_vma addr) /* 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 + FUNCTION_PTR, and LINENUMBER_PTR, are pointers to the objects to be filled in. Returns the range of addresses covered by the entry that was used @@ -2729,13 +2792,12 @@ static bfd_vma comp_unit_find_nearest_line (struct comp_unit *unit, bfd_vma addr, const char **filename_ptr, - const char **functionname_ptr, + struct funcinfo **function_ptr, unsigned int *linenumber_ptr, unsigned int *discriminator_ptr, struct dwarf2_debug *stash) { bfd_boolean func_p; - struct funcinfo *function; if (unit->error) return FALSE; @@ -2764,11 +2826,10 @@ comp_unit_find_nearest_line (struct comp_unit *unit, } } - function = NULL; - func_p = lookup_address_in_function_table (unit, addr, - &function, functionname_ptr); - if (func_p && (function->tag == DW_TAG_inlined_subroutine)) - stash->inliner_chain = function; + *function_ptr = NULL; + func_p = lookup_address_in_function_table (unit, addr, function_ptr); + if (func_p && (*function_ptr)->tag == DW_TAG_inlined_subroutine) + stash->inliner_chain = *function_ptr; return lookup_address_in_line_info_table (unit->line_table, addr, filename_ptr, @@ -3588,19 +3649,19 @@ _bfd_dwarf2_slurp_debug_info (bfd *abfd, bfd *debug_bfd, field and in the abbreviation offset, or zero to indicate that the default value should be used. */ -static bfd_boolean -find_line (bfd *abfd, - const struct dwarf_debug_section *debug_sections, - asection *section, - bfd_vma offset, - asymbol *symbol, - asymbol **symbols, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *linenumber_ptr, - unsigned int *discriminator_ptr, - unsigned int addr_size, - void **pinfo) +bfd_boolean +_bfd_dwarf2_find_nearest_line (bfd *abfd, + asymbol **symbols, + asymbol *symbol, + asection *section, + bfd_vma offset, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *linenumber_ptr, + unsigned int *discriminator_ptr, + const struct dwarf_debug_section *debug_sections, + unsigned int addr_size, + void **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, @@ -3614,6 +3675,7 @@ find_line (bfd *abfd, /* What address are we looking for? */ bfd_vma addr; struct comp_unit* each; + struct funcinfo *function = NULL; bfd_boolean found = FALSE; bfd_boolean do_line; @@ -3631,21 +3693,18 @@ find_line (bfd *abfd, stash = (struct dwarf2_debug *) *pinfo; - do_line = (section == NULL - && offset == 0 - && functionname_ptr == NULL - && symbol != NULL); + do_line = symbol != NULL; if (do_line) { - addr = symbol->value; + BFD_ASSERT (section == NULL && offset == 0 && functionname_ptr == NULL); section = bfd_get_section (symbol); + addr = symbol->value; } - else if (section != NULL - && functionname_ptr != NULL - && symbol == NULL) - addr = offset; else - abort (); + { + BFD_ASSERT (section != NULL && functionname_ptr != NULL); + addr = offset; + } if (section->output_section) addr += section->output_section->vma + section->output_offset; @@ -3699,7 +3758,7 @@ find_line (bfd *abfd, { bfd_vma min_range = (bfd_vma) -1; const char * local_filename = NULL; - const char * local_functionname = NULL; + struct funcinfo *local_function = NULL; unsigned int local_linenumber = 0; unsigned int local_discriminator = 0; @@ -3711,7 +3770,7 @@ find_line (bfd *abfd, || comp_unit_contains_address (each, addr)) && (range = comp_unit_find_nearest_line (each, addr, & local_filename, - & local_functionname, + & local_function, & local_linenumber, & local_discriminator, stash)) != 0); @@ -3732,8 +3791,8 @@ find_line (bfd *abfd, { if (filename_ptr && local_filename) * filename_ptr = local_filename; - if (functionname_ptr && local_functionname) - * functionname_ptr = local_functionname; + if (local_function) + function = local_function; if (discriminator_ptr && local_discriminator) * discriminator_ptr = local_discriminator; if (local_linenumber) @@ -3835,10 +3894,10 @@ find_line (bfd *abfd, || comp_unit_contains_address (each, addr)) && comp_unit_find_nearest_line (each, addr, filename_ptr, - functionname_ptr, + &function, linenumber_ptr, discriminator_ptr, - stash)) > 0; + stash) != 0); if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr) == stash->sec->size) @@ -3854,51 +3913,25 @@ find_line (bfd *abfd, } done: + if (function) + { + if (!function->is_linkage + && _bfd_elf_find_function (abfd, symbols, section, offset, + *filename_ptr ? NULL : filename_ptr, + functionname_ptr)) + { + function->name = *functionname_ptr; + function->is_linkage = TRUE; + } + else + *functionname_ptr = function->name; + } if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) unset_sections (stash); return found; } -/* The DWARF2 version of find_nearest_line. - Return TRUE if the line is found without error. */ - -bfd_boolean -_bfd_dwarf2_find_nearest_line (bfd *abfd, - const struct dwarf_debug_section *debug_sections, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *linenumber_ptr, - unsigned int *discriminator_ptr, - unsigned int addr_size, - void **pinfo) -{ - return find_line (abfd, debug_sections, section, offset, NULL, symbols, - filename_ptr, functionname_ptr, linenumber_ptr, - discriminator_ptr, addr_size, pinfo); -} - -/* The DWARF2 version of find_line. - Return TRUE if the line is found without error. */ - -bfd_boolean -_bfd_dwarf2_find_line (bfd *abfd, - asymbol **symbols, - asymbol *symbol, - const char **filename_ptr, - unsigned int *linenumber_ptr, - unsigned int *discriminator_ptr, - unsigned int addr_size, - void **pinfo) -{ - return find_line (abfd, dwarf_debug_sections, NULL, 0, symbol, symbols, - filename_ptr, NULL, linenumber_ptr, discriminator_ptr, - addr_size, pinfo); -} - bfd_boolean _bfd_dwarf2_find_inliner_info (bfd *abfd ATTRIBUTE_UNUSED, const char **filename_ptr, @@ -4010,3 +4043,109 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd, void **pinfo) if (stash->alt_bfd_ptr) bfd_close (stash->alt_bfd_ptr); } + +/* Find the function to a particular section and offset, + for error reporting. */ + +bfd_boolean +_bfd_elf_find_function (bfd *abfd, + asymbol **symbols, + asection *section, + bfd_vma offset, + const char **filename_ptr, + const char **functionname_ptr) +{ + struct elf_find_function_cache + { + asection *last_section; + asymbol *func; + const char *filename; + bfd_size_type func_size; + } *cache; + + if (symbols == NULL) + return FALSE; + + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + return FALSE; + + cache = elf_tdata (abfd)->elf_find_function_cache; + if (cache == NULL) + { + cache = bfd_zalloc (abfd, sizeof (*cache)); + elf_tdata (abfd)->elf_find_function_cache = cache; + if (cache == NULL) + return FALSE; + } + if (cache->last_section != section + || cache->func == NULL + || offset < cache->func->value + || offset >= cache->func->value + cache->func_size) + { + asymbol *file; + bfd_vma low_func; + asymbol **p; + /* ??? Given multiple file symbols, it is impossible to reliably + choose the right file name for global symbols. File symbols are + local symbols, and thus all file symbols must sort before any + global symbols. The ELF spec may be interpreted to say that a + file symbol must sort before other local symbols, but currently + ld -r doesn't do this. So, for ld -r output, it is possible to + make a better choice of file name for local symbols by ignoring + file symbols appearing after a given local symbol. */ + enum { nothing_seen, symbol_seen, file_after_symbol_seen } state; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + + file = NULL; + low_func = 0; + state = nothing_seen; + cache->filename = NULL; + cache->func = NULL; + cache->func_size = 0; + cache->last_section = section; + + for (p = symbols; *p != NULL; p++) + { + asymbol *sym = *p; + bfd_vma code_off; + bfd_size_type size; + + if ((sym->flags & BSF_FILE) != 0) + { + file = sym; + if (state == symbol_seen) + state = file_after_symbol_seen; + continue; + } + + size = bed->maybe_function_sym (sym, section, &code_off); + if (size != 0 + && code_off <= offset + && (code_off > low_func + || (code_off == low_func + && size > cache->func_size))) + { + cache->func = sym; + cache->func_size = size; + cache->filename = NULL; + low_func = code_off; + if (file != NULL + && ((sym->flags & BSF_LOCAL) != 0 + || state != file_after_symbol_seen)) + cache->filename = bfd_asymbol_name (file); + } + if (state == nothing_seen) + state = symbol_seen; + } + } + + if (cache->func == NULL) + return FALSE; + + if (filename_ptr) + *filename_ptr = cache->filename; + if (functionname_ptr) + *functionname_ptr = bfd_asymbol_name (cache->func); + + return TRUE; +} diff --git a/bfd/ecoff.c b/bfd/ecoff.c index ed163d683..f4f45a4a8 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -1,5 +1,5 @@ /* Generic ECOFF (Extended-COFF) routines. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -615,6 +615,9 @@ _bfd_ecoff_slurp_symbolic_info (bfd *abfd, external_fdr_size = backend->debug_swap.external_fdr_size; fdr_ptr = debug->fdr; fraw_src = (char *) debug->external_fdr; + /* PR 17512: file: 3372-1243-0.004. */ + if (fraw_src == NULL && internal_symhdr->ifdMax > 0) + return FALSE; fraw_end = fraw_src + internal_symhdr->ifdMax * external_fdr_size; for (; fraw_src < fraw_end; fraw_src += external_fdr_size, fdr_ptr++) (*backend->debug_swap.swap_fdr_in) (abfd, (void *) fraw_src, fdr_ptr); @@ -891,12 +894,18 @@ _bfd_ecoff_slurp_symbol_table (bfd *abfd) EXTR internal_esym; (*swap_ext_in) (abfd, (void *) eraw_src, &internal_esym); + + /* PR 17512: file: 3372-1000-0.004. */ + if (internal_esym.asym.iss >= ecoff_data (abfd)->debug_info.symbolic_header.issExtMax) + return FALSE; + internal_ptr->symbol.name = (ecoff_data (abfd)->debug_info.ssext + internal_esym.asym.iss); if (!ecoff_set_symbol_info (abfd, &internal_esym.asym, &internal_ptr->symbol, 1, internal_esym.weakext)) return FALSE; + /* The alpha uses a negative ifd field for section symbols. */ if (internal_esym.ifd >= 0) internal_ptr->fdr = (ecoff_data (abfd)->debug_info.fdr @@ -938,6 +947,20 @@ _bfd_ecoff_slurp_symbol_table (bfd *abfd) } } + /* PR 17512: file: 3372-3080-0.004. + A discrepancy between ecoff_data (abfd)->debug_info.symbolic_header.isymMax + and ecoff_data (abfd)->debug_info.symbolic_header.ifdMax can mean that + we have fewer symbols than we were expecting. Allow for this by updating + the symbol count and warning the user. */ + if (internal_ptr - internal < (ptrdiff_t) bfd_get_symcount (abfd)) + { + bfd_get_symcount (abfd) = internal_ptr - internal; + (*_bfd_error_handler) + (_("%B: warning: isymMax (%ld) is greater than ifdMax (%d)\n"), + abfd, ecoff_data (abfd)->debug_info.symbolic_header.isymMax, + ecoff_data (abfd)->debug_info.symbolic_header.ifdMax); + } + ecoff_data (abfd)->canonical_symbols = internal; return TRUE; @@ -1704,12 +1727,13 @@ _bfd_ecoff_canonicalize_reloc (bfd *abfd, bfd_boolean _bfd_ecoff_find_nearest_line (bfd *abfd, + asymbol **symbols ATTRIBUTE_UNUSED, asection *section, - asymbol **ignore_symbols ATTRIBUTE_UNUSED, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *retline_ptr) + unsigned int *retline_ptr, + unsigned int *discriminator_ptr) { const struct ecoff_debug_swap * const debug_swap = &ecoff_backend (abfd)->debug_swap; @@ -1730,8 +1754,10 @@ _bfd_ecoff_find_nearest_line (bfd *abfd, if (ecoff_data (abfd)->find_line_info == NULL) return FALSE; } - line_info = ecoff_data (abfd)->find_line_info; + if (discriminator_ptr) + *discriminator_ptr = 0; + line_info = ecoff_data (abfd)->find_line_info; return _bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap, line_info, filename_ptr, functionname_ptr, retline_ptr); @@ -3497,171 +3523,29 @@ ecoff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) return FALSE; } -/* Factored out from ecoff_link_check_archive_element. */ - -static bfd_boolean -read_ext_syms_and_strs (HDRR **symhdr, bfd_size_type *external_ext_size, - bfd_size_type *esize, void **external_ext, char **ssext, bfd *abfd, - const struct ecoff_backend_data * const backend) -{ - if (! ecoff_slurp_symbolic_header (abfd)) - return FALSE; - - /* If there are no symbols, we don't want it. */ - if (bfd_get_symcount (abfd) == 0) - return TRUE; - - *symhdr = &ecoff_data (abfd)->debug_info.symbolic_header; - - *external_ext_size = backend->debug_swap.external_ext_size; - *esize = (*symhdr)->iextMax * *external_ext_size; - *external_ext = bfd_malloc (*esize); - if (*external_ext == NULL && *esize != 0) - return FALSE; - - if (bfd_seek (abfd, (file_ptr) (*symhdr)->cbExtOffset, SEEK_SET) != 0 - || bfd_bread (*external_ext, *esize, abfd) != *esize) - return FALSE; - - *ssext = (char *) bfd_malloc ((bfd_size_type) (*symhdr)->issExtMax); - if (*ssext == NULL && (*symhdr)->issExtMax != 0) - return FALSE; - - if (bfd_seek (abfd, (file_ptr) (*symhdr)->cbSsExtOffset, SEEK_SET) != 0 - || (bfd_bread (*ssext, (bfd_size_type) (*symhdr)->issExtMax, abfd) - != (bfd_size_type) (*symhdr)->issExtMax)) - return FALSE; - return TRUE; -} - -static bfd_boolean -reread_ext_syms_and_strs (HDRR **symhdr, bfd_size_type *external_ext_size, - bfd_size_type *esize, void **external_ext, char **ssext, bfd *abfd, - const struct ecoff_backend_data * const backend) -{ - if (*external_ext != NULL) - free (*external_ext); - *external_ext = NULL; - if (*ssext != NULL) - free (*ssext); - *ssext = NULL; - return read_ext_syms_and_strs (symhdr, external_ext_size, esize, - external_ext, ssext, abfd, backend); -} - /* This is called if we used _bfd_generic_link_add_archive_symbols because we were not dealing with an ECOFF archive. */ static bfd_boolean ecoff_link_check_archive_element (bfd *abfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h, + const char *name, bfd_boolean *pneeded) { - const struct ecoff_backend_data * const backend = ecoff_backend (abfd); - void (* const swap_ext_in) (bfd *, void *, EXTR *) - = backend->debug_swap.swap_ext_in; - HDRR *symhdr; - bfd_size_type external_ext_size = 0; - void * external_ext = NULL; - bfd_size_type esize = 0; - char *ssext = NULL; - char *ext_ptr; - char *ext_end; - *pneeded = FALSE; - /* Read in the external symbols and external strings. */ - if (!read_ext_syms_and_strs (&symhdr, &external_ext_size, &esize, - &external_ext, &ssext, abfd, backend)) - goto error_return; - - /* If there are no symbols, we don't want it. */ - if (bfd_get_symcount (abfd) == 0) - goto successful_return; - - /* Look through the external symbols to see if they define some - symbol that is currently undefined. */ - ext_ptr = (char *) external_ext; - ext_end = ext_ptr + esize; - for (; ext_ptr < ext_end; ext_ptr += external_ext_size) - { - EXTR esym; - bfd_boolean def; - const char *name; - bfd *oldbfd; - struct bfd_link_hash_entry *h; - - (*swap_ext_in) (abfd, (void *) ext_ptr, &esym); - - /* See if this symbol defines something. */ - if (esym.asym.st != stGlobal - && esym.asym.st != stLabel - && esym.asym.st != stProc) - continue; - - switch (esym.asym.sc) - { - case scText: - case scData: - case scBss: - case scAbs: - case scSData: - case scSBss: - case scRData: - case scCommon: - case scSCommon: - case scInit: - case scFini: - case scRConst: - def = TRUE; - break; - default: - def = FALSE; - break; - } - - if (! def) - continue; - - name = ssext + esym.asym.iss; - h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); - - /* Unlike the generic linker, we do not pull in elements because - of common symbols. */ - if (h == NULL - || h->type != bfd_link_hash_undefined) - continue; - - /* Include this element. */ - oldbfd = abfd; - if (!(*info->callbacks - ->add_archive_element) (info, abfd, name, &abfd)) - goto error_return; - /* Potentially, the add_archive_element hook may have set a - substitute BFD for us. */ - if (abfd != oldbfd - && !reread_ext_syms_and_strs (&symhdr, &external_ext_size, &esize, - &external_ext, &ssext, abfd, backend)) - goto error_return; - if (! ecoff_link_add_externals (abfd, info, external_ext, ssext)) - goto error_return; + /* Unlike the generic linker, we do not pull in elements because + of common symbols. */ + if (h->type != bfd_link_hash_undefined) + return TRUE; - *pneeded = TRUE; - goto successful_return; - } + /* Include this element. */ + if (!(*info->callbacks->add_archive_element) (info, abfd, name, &abfd)) + return FALSE; + *pneeded = TRUE; - successful_return: - if (external_ext != NULL) - free (external_ext); - if (ssext != NULL) - free (ssext); - return TRUE; - error_return: - if (external_ext != NULL) - free (external_ext); - if (ssext != NULL) - free (ssext); - return FALSE; + return ecoff_link_add_object_symbols (abfd, info); } /* Add the symbols from an archive file to the global hash table. @@ -4447,7 +4331,7 @@ _bfd_ecoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info) /* Accumulate the debugging symbols from each input BFD. */ for (input_bfd = info->input_bfds; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_boolean ret; diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c index 33cdffd5b..4f0b463db 100644 --- a/bfd/ecofflink.c +++ b/bfd/ecofflink.c @@ -1,5 +1,5 @@ /* Routines to link ECOFF debugging information. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/ecoffswap.h b/bfd/ecoffswap.h index e567fa93e..525229444 100644 --- a/bfd/ecoffswap.h +++ b/bfd/ecoffswap.h @@ -1,5 +1,5 @@ /* Generic ECOFF swapping routines, for BFD. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c index cd0cbcaa5..d06825e31 100644 --- a/bfd/elf-attrs.c +++ b/bfd/elf-attrs.c @@ -1,5 +1,5 @@ /* ELF attributes support (based on ARM EABI attributes). - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -430,9 +430,13 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) { bfd_byte *contents; bfd_byte *p; + bfd_byte *p_end; bfd_vma len; const char *std_sec; + /* PR 17512: file: 2844a11d. */ + if (hdr->sh_size == 0) + return; contents = (bfd_byte *) bfd_malloc (hdr->sh_size); if (!contents) return; @@ -443,11 +447,14 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) return; } p = contents; + p_end = p + hdr->sh_size; std_sec = get_elf_backend_data (abfd)->obj_attrs_vendor; + if (*(p++) == 'A') { len = hdr->sh_size - 1; - while (len > 0) + + while (len > 0 && p < p_end - 4) { unsigned namelen; bfd_vma section_len; @@ -455,6 +462,8 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) section_len = bfd_get_32 (abfd, p); p += 4; + if (section_len == 0) + break; if (section_len > len) section_len = len; len -= section_len; @@ -475,7 +484,7 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) } p += namelen; - while (section_len > 0) + while (section_len > 0 && p < p_end) { int tag; unsigned int n; @@ -483,15 +492,23 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) bfd_vma subsection_len; bfd_byte *end; - tag = read_unsigned_leb128 (abfd, p, &n); + tag = safe_read_leb128 (abfd, p, &n, FALSE, p_end); p += n; - subsection_len = bfd_get_32 (abfd, p); + if (p < p_end - 4) + subsection_len = bfd_get_32 (abfd, p); + else + subsection_len = 0; p += 4; + if (subsection_len == 0) + break; if (subsection_len > section_len) subsection_len = section_len; section_len -= subsection_len; subsection_len -= n + 4; end = p + subsection_len; + /* PR 17512: file: 0e8c0c90. */ + if (end > p_end) + end = p_end; switch (tag) { case Tag_File: @@ -499,25 +516,25 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) { int type; - tag = read_unsigned_leb128 (abfd, p, &n); + tag = safe_read_leb128 (abfd, p, &n, FALSE, end); p += n; type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag); switch (type & (ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_STR_VAL)) { case ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_STR_VAL: - val = read_unsigned_leb128 (abfd, p, &n); + val = safe_read_leb128 (abfd, p, &n, FALSE, end); p += n; bfd_elf_add_obj_attr_int_string (abfd, vendor, tag, - val, (char *)p); + val, (char *) p); p += strlen ((char *)p) + 1; break; case ATTR_TYPE_FLAG_STR_VAL: bfd_elf_add_obj_attr_string (abfd, vendor, tag, - (char *)p); + (char *) p); p += strlen ((char *)p) + 1; break; case ATTR_TYPE_FLAG_INT_VAL: - val = read_unsigned_leb128 (abfd, p, &n); + val = safe_read_leb128 (abfd, p, &n, FALSE, end); p += n; bfd_elf_add_obj_attr_int (abfd, vendor, tag, val); break; diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 1bbe771cf..da7c52207 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1,5 +1,5 @@ /* BFD back-end data structures for ELF files. - Copyright (C) 1992-2014 Free Software Foundation, Inc. + Copyright (C) 1992-2015 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -196,6 +196,8 @@ struct elf_link_hash_entry unsigned int pointer_equality_needed : 1; /* Symbol is a unique global symbol. */ unsigned int unique_global : 1; + /* Symbol is defined with non-default visibility. */ + unsigned int protected_def : 1; /* String table index in .dynstr if this is a dynamic symbol. */ unsigned long dynstr_index; @@ -280,7 +282,9 @@ struct eh_cie_fde If REMOVED == 0, this is the CIE that we have chosen to use for the output FDE. The CIE's REMOVED field is also 0, but the CIE - might belong to a different .eh_frame input section from the FDE. */ + might belong to a different .eh_frame input section from the FDE. + + May be NULL to signify that the FDE should be discarded. */ struct eh_cie_fde *cie_inf; struct eh_cie_fde *next_for_section; } fde; @@ -372,6 +376,7 @@ struct eh_frame_sec_info struct eh_frame_array_ent { bfd_vma initial_loc; + bfd_size_type range; bfd_vma fde; }; @@ -383,10 +388,6 @@ struct eh_frame_hdr_info asection *hdr_sec; unsigned int fde_count, array_count; struct eh_frame_array_ent *array; - /* TRUE if we should try to merge CIEs between input sections. */ - bfd_boolean merge_cies; - /* TRUE if all .eh_frames have been parsd. */ - bfd_boolean parsed_eh_frames; /* TRUE if .eh_frame_hdr should contain the sorted search table. We build it if we successfully read all .eh_frame input sections and recognize them. */ @@ -1110,6 +1111,11 @@ struct elf_backend_data unsigned int (*elf_backend_count_relocs) (struct bfd_link_info *, asection *); + /* Say whether to sort relocs output by ld -r and ld --emit-relocs, + by r_offset. If NULL, default to true. */ + bfd_boolean (*sort_relocs_p) + (asection *); + /* This function, if defined, is called when an NT_PRSTATUS note is found in a core file. */ bfd_boolean (*elf_backend_grok_prstatus) @@ -1773,6 +1779,8 @@ extern bfd_boolean _bfd_elf_copy_private_bfd_data (bfd *, bfd *); extern bfd_boolean _bfd_elf_print_private_bfd_data (bfd *, void *); +const char * _bfd_elf_get_symbol_version_string + (bfd *, asymbol *, bfd_boolean *); extern void bfd_elf_print_symbol (bfd *, void *, asymbol *, bfd_print_symbol_type); @@ -1816,7 +1824,7 @@ extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create (bfd *); extern void _bfd_elf_link_hash_table_free - (struct bfd_link_hash_table *); + (bfd *); extern void _bfd_elf_link_hash_copy_indirect (struct bfd_link_info *, struct elf_link_hash_entry *, struct elf_link_hash_entry *); @@ -1899,20 +1907,14 @@ extern alent *_bfd_elf_get_lineno extern bfd_boolean _bfd_elf_set_arch_mach (bfd *, enum bfd_architecture, unsigned long); extern bfd_boolean _bfd_elf_find_nearest_line - (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, - unsigned int *); -extern bfd_boolean _bfd_elf_find_nearest_line_discriminator - (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, - unsigned int *, unsigned int *); + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); extern bfd_boolean _bfd_elf_find_line (bfd *, asymbol **, asymbol *, const char **, unsigned int *); -extern bfd_boolean _bfd_elf_find_line_discriminator - (bfd *, asymbol **, asymbol *, const char **, unsigned int *, unsigned int *); -#define _bfd_generic_find_line _bfd_elf_find_line -#define _bfd_generic_find_nearest_line_discriminator \ - _bfd_elf_find_nearest_line_discriminator extern bfd_boolean _bfd_elf_find_inliner_info (bfd *, const char **, const char **, unsigned int *); +extern bfd_boolean _bfd_elf_find_function + (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers @@ -1968,13 +1970,8 @@ extern bfd_boolean _bfd_elf_strtab_emit extern void _bfd_elf_strtab_finalize (struct elf_strtab_hash *); -extern void _bfd_elf_begin_eh_frame_parsing - (struct bfd_link_info *info); extern void _bfd_elf_parse_eh_frame (bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *); -extern void _bfd_elf_end_eh_frame_parsing - (struct bfd_link_info *info); - extern bfd_boolean _bfd_elf_discard_section_eh_frame (bfd *, struct bfd_link_info *, asection *, bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *); @@ -1997,8 +1994,6 @@ extern long _bfd_elf_link_lookup_local_dynindx (struct bfd_link_info *, bfd *, long); extern bfd_boolean _bfd_elf_compute_section_file_positions (bfd *, struct bfd_link_info *); -extern void _bfd_elf_assign_file_positions_for_relocs - (bfd *); extern file_ptr _bfd_elf_assign_file_position_for_section (Elf_Internal_Shdr *, file_ptr, bfd_boolean); @@ -2033,7 +2028,7 @@ extern bfd_boolean _bfd_elf_link_output_relocs struct elf_link_hash_entry **); extern bfd_boolean _bfd_elf_adjust_dynamic_copy - (struct elf_link_hash_entry *, asection *); + (struct bfd_link_info *, struct elf_link_hash_entry *, asection *); extern bfd_boolean _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean); @@ -2390,6 +2385,9 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *, struct elf_link_hash_entry *, struct elf_dyn_relocs **, unsigned int, unsigned int, unsigned int); +extern long _bfd_elf_ifunc_get_synthetic_symtab + (bfd *, long, asymbol **, long, asymbol **, asymbol **, asection *, + bfd_vma *(*) (bfd *, asymbol **, asection *, asection *)); extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *); extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *); diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 0f0a56352..faa04617e 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1,5 +1,5 @@ /* .eh_frame section optimization. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -46,7 +46,6 @@ struct cie } sym; unsigned int reloc_index; } personality; - asection *output_sec; struct eh_cie_fde *cie_inf; unsigned char per_encoding; unsigned char lsda_encoding; @@ -232,7 +231,8 @@ cie_eq (const void *e1, const void *e2) && c1->augmentation_size == c2->augmentation_size && memcmp (&c1->personality, &c2->personality, sizeof (c1->personality)) == 0 - && c1->output_sec == c2->output_sec + && (c1->cie_inf->u.cie.u.sec->output_section + == c2->cie_inf->u.cie.u.sec->output_section) && c1->per_encoding == c2->per_encoding && c1->lsda_encoding == c2->lsda_encoding && c1->fde_encoding == c2->fde_encoding @@ -266,7 +266,7 @@ cie_compute_hash (struct cie *c) h = iterative_hash_object (c->ra_column, h); h = iterative_hash_object (c->augmentation_size, h); h = iterative_hash_object (c->personality, h); - h = iterative_hash_object (c->output_sec, h); + h = iterative_hash_object (c->cie_inf->u.cie.u.sec->output_section, h); h = iterative_hash_object (c->per_encoding, h); h = iterative_hash_object (c->lsda_encoding, h); h = iterative_hash_object (c->fde_encoding, h); @@ -452,18 +452,6 @@ make_pc_relative (unsigned char encoding, unsigned int ptr_size) return encoding | DW_EH_PE_pcrel; } -/* Called before calling _bfd_elf_parse_eh_frame on every input bfd's - .eh_frame section. */ - -void -_bfd_elf_begin_eh_frame_parsing (struct bfd_link_info *info) -{ - struct eh_frame_hdr_info *hdr_info; - - hdr_info = &elf_hash_table (info)->eh_info; - hdr_info->merge_cies = !info->relocatable; -} - /* Try to parse .eh_frame section SEC, which belongs to ABFD. Store the information in the section's sec_info field on success. COOKIE describes the relocations in SEC. */ @@ -494,8 +482,6 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, htab = elf_hash_table (info); hdr_info = &htab->eh_info; - if (hdr_info->parsed_eh_frames) - return; if (sec->size == 0 || sec->sec_info_type != SEC_INFO_TYPE_NONE) @@ -570,10 +556,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, /* FIXME: octets_per_byte. */ #define ENSURE_NO_RELOCS(buf) \ - REQUIRE (!(cookie->rel < cookie->relend \ - && (cookie->rel->r_offset \ - < (bfd_size_type) ((buf) - ehbuf)) \ - && cookie->rel->r_info != 0)) + while (cookie->rel < cookie->relend \ + && (cookie->rel->r_offset \ + < (bfd_size_type) ((buf) - ehbuf))) \ + { \ + REQUIRE (cookie->rel->r_info == 0); \ + cookie->rel++; \ + } /* FIXME: octets_per_byte. */ #define SKIP_RELOCS(buf) \ @@ -639,7 +628,6 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, cie->cie_inf = this_inf; cie->length = hdr_length; - cie->output_sec = sec->output_section; start = buf; REQUIRE (read_byte (&buf, end, &cie->version)); @@ -741,6 +729,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, /* For shared libraries, try to get rid of as many RELATIVE relocs as possible. */ if (info->shared + && !info->relocatable && (get_elf_backend_data (abfd) ->elf_backend_can_make_relative_eh_frame (abfd, info, sec))) @@ -777,10 +766,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, buf += initial_insn_length; ENSURE_NO_RELOCS (buf); - if (hdr_info->merge_cies) - this_inf->u.cie.u.full_cie = cie; - this_inf->u.cie.per_encoding_relative - = (cie->per_encoding & 0x70) == DW_EH_PE_pcrel; + if (!info->relocatable) + { + /* Keep info for merging cies. */ + this_inf->u.cie.u.full_cie = cie; + this_inf->u.cie.per_encoding_relative + = (cie->per_encoding & 0x70) == DW_EH_PE_pcrel; + } } else { @@ -822,6 +814,16 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, length = get_DW_EH_PE_width (cie->fde_encoding, ptr_size); REQUIRE (skip_bytes (&buf, end, 2 * length)); + SKIP_RELOCS (buf - length); + if (!GET_RELOC (buf - length) + && read_value (abfd, buf - length, length, FALSE) == 0) + { + (*info->callbacks->minfo) + (_("discarding zero address range FDE in %B(%A).\n"), + abfd, sec); + this_inf->u.fde.cie_inf = NULL; + } + /* Skip the augmentation size, if present. */ if (cie->augmentation[0] == 'z') REQUIRE (read_uleb128 (&buf, end, &length)); @@ -911,8 +913,9 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, elf_section_data (sec)->sec_info = sec_info; sec->sec_info_type = SEC_INFO_TYPE_EH_FRAME; - if (hdr_info->merge_cies) + if (!info->relocatable) { + /* Keep info for merging cies. */ sec_info->cies = local_cies; local_cies = NULL; } @@ -933,17 +936,6 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, #undef REQUIRE } -/* Finish a pass over all .eh_frame sections. */ - -void -_bfd_elf_end_eh_frame_parsing (struct bfd_link_info *info) -{ - struct eh_frame_hdr_info *hdr_info; - - hdr_info = &elf_hash_table (info)->eh_info; - hdr_info->parsed_eh_frames = TRUE; -} - /* Mark all relocations against CIE or FDE ENT, which occurs in .eh_frame section SEC. COOKIE describes the relocations in SEC; its "rel" field can be changed freely. */ @@ -983,7 +975,7 @@ _bfd_elf_gc_mark_fdes (struct bfd_link_info *info, asection *sec, /* At this stage, all cie_inf fields point to local CIEs, so we can use the same cookie to refer to them. */ cie = fde->u.fde.cie_inf; - if (!cie->u.cie.gc_mark) + if (cie != NULL && !cie->u.cie.gc_mark) { cie->u.cie.gc_mark = 1; if (!mark_entry (info, eh_frame, cie, gc_mark_hook, cookie)) @@ -1085,6 +1077,7 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec, if (per_binds_local && info->shared + && !info->relocatable && (cie->per_encoding & 0x70) == DW_EH_PE_absptr && (get_elf_backend_data (abfd) ->elf_backend_can_make_relative_eh_frame (abfd, info, sec))) @@ -1095,7 +1088,6 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec, } /* See if we can merge this CIE with an earlier one. */ - cie->output_sec = sec->output_section; cie_compute_hash (cie); if (hdr_info->cies == NULL) { @@ -1162,7 +1154,7 @@ _bfd_elf_discard_section_eh_frame /* There should only be one zero terminator, on the last input file supplying .eh_frame (crtend.o). Remove any others. */ ent->removed = sec->map_head.s != NULL; - else if (!ent->cie) + else if (!ent->cie && ent->u.fde.cie_inf != NULL) { bfd_boolean keep; if ((sec->flags & SEC_LINKER_CREATED) != 0 && cookie->rels == NULL) @@ -1195,7 +1187,7 @@ _bfd_elf_discard_section_eh_frame since it is affected by runtime relocations. */ hdr_info->table = FALSE; (*info->callbacks->einfo) - (_("%P: fde encoding in %B(%A) prevents .eh_frame_hdr" + (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr" " table being created.\n"), abfd, sec); } ent->removed = 0; @@ -1406,6 +1398,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, struct eh_frame_hdr_info *hdr_info; unsigned int ptr_size; struct eh_cie_fde *ent; + bfd_size_type sec_size; if (sec->sec_info_type != SEC_INFO_TYPE_EH_FRAME) /* FIXME: octets_per_byte. */ @@ -1592,6 +1585,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, value = ((ent->new_offset + sec->output_offset + 4) - (cie->new_offset + cie->u.cie.u.sec->output_offset)); bfd_put_32 (abfd, value, buf); + if (info->relocatable) + continue; buf += 4; width = get_DW_EH_PE_width (ent->fde_encoding, ptr_size); value = read_value (abfd, buf, width, @@ -1657,6 +1652,8 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, if (sizeof (address) > 4 && ptr_size == 4) address &= 0xffffffff; hdr_info->array[hdr_info->array_count].initial_loc = address; + hdr_info->array[hdr_info->array_count].range + = read_value (abfd, buf + width, width, FALSE); hdr_info->array[hdr_info->array_count++].fde = (sec->output_section->vma + sec->output_offset @@ -1727,7 +1724,11 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, the pointer size. _bfd_elf_discard_section_eh_frame should have padded CIE/FDE records to multiple of pointer size with size_of_output_cie_fde. */ - if ((sec->size % ptr_size) != 0) + sec_size = sec->size; + if (sec_info->count != 0 + && sec_info->entry[sec_info->count - 1].size == 4) + sec_size -= 4; + if ((sec_size % ptr_size) != 0) abort (); /* FIXME: octets_per_byte. */ @@ -1748,6 +1749,10 @@ vma_compare (const void *a, const void *b) return 1; if (p->initial_loc < q->initial_loc) return -1; + if (p->range > q->range) + return 1; + if (p->range < q->range) + return -1; return 0; } @@ -1836,20 +1841,43 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) sizeof (*hdr_info->array), vma_compare); for (i = 0; i < hdr_info->fde_count; i++) { - bfd_put_32 (abfd, - hdr_info->array[i].initial_loc - - sec->output_section->vma, - contents + EH_FRAME_HDR_SIZE + i * 8 + 4); - bfd_put_32 (abfd, - hdr_info->array[i].fde - sec->output_section->vma, - contents + EH_FRAME_HDR_SIZE + i * 8 + 8); + bfd_vma val; + + val = hdr_info->array[i].initial_loc - sec->output_section->vma; + val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000; + if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64 + && (hdr_info->array[i].initial_loc + != sec->output_section->vma + val)) + (*info->callbacks->einfo) + (_("%X%P: .eh_frame_hdr table[%u] PC overflow.\n"), i); + bfd_put_32 (abfd, val, contents + EH_FRAME_HDR_SIZE + i * 8 + 4); + + val = hdr_info->array[i].fde - sec->output_section->vma; + val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000; + if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64 + && (hdr_info->array[i].fde + != sec->output_section->vma + val)) + (*info->callbacks->einfo) + (_("%X%P: .eh_frame_hdr table[%u] FDE overflow.\n"), i); + bfd_put_32 (abfd, val, contents + EH_FRAME_HDR_SIZE + i * 8 + 8); + + if (i != 0 + && (hdr_info->array[i].initial_loc + < (hdr_info->array[i - 1].initial_loc + + hdr_info->array[i - 1].range))) + (*info->callbacks->einfo) + (_("%X%P: .eh_frame_hdr table[%u] FDE at %V overlaps " + "table[%u] FDE at %V.\n"), + i - 1, hdr_info->array[i - 1].fde, + i, hdr_info->array[i].fde); } } /* FIXME: octets_per_byte. */ - retval = bfd_set_section_contents (abfd, sec->output_section, contents, - (file_ptr) sec->output_offset, - sec->size); + if (!bfd_set_section_contents (abfd, sec->output_section, contents, + (file_ptr) sec->output_offset, + sec->size)) + retval = FALSE; free (contents); } if (hdr_info->array != NULL) diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index 5ee7de81a..5e647962e 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1,5 +1,5 @@ /* Common code for PA ELF implementations. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c index dd8992bf8..f54c90b50 100644 --- a/bfd/elf-ifunc.c +++ b/bfd/elf-ifunc.c @@ -1,5 +1,5 @@ /* ELF STT_GNU_IFUNC support. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -273,3 +273,128 @@ keep: return TRUE; } + +/* Similar to _bfd_elf_get_synthetic_symtab, optimized for unsorted PLT + entries. PLT is the PLT section. PLT_SYM_VAL is a function pointer + which returns an array of PLT entry symbol values. */ + +long +_bfd_elf_ifunc_get_synthetic_symtab + (bfd *abfd, long symcount ATTRIBUTE_UNUSED, + asymbol **syms ATTRIBUTE_UNUSED, long dynsymcount, asymbol **dynsyms, + asymbol **ret, asection *plt, + bfd_vma *(*get_plt_sym_val) (bfd *, asymbol **, asection *, asection *)) +{ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + asection *relplt; + asymbol *s; + const char *relplt_name; + bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); + arelent *p; + long count, i, n; + size_t size; + Elf_Internal_Shdr *hdr; + char *names; + bfd_vma *plt_sym_val; + + *ret = NULL; + + if (plt == NULL) + return 0; + + if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0) + return 0; + + if (dynsymcount <= 0) + return 0; + + relplt_name = bed->relplt_name; + if (relplt_name == NULL) + relplt_name = bed->rela_plts_and_copies_p ? ".rela.plt" : ".rel.plt"; + relplt = bfd_get_section_by_name (abfd, relplt_name); + if (relplt == NULL) + return 0; + + hdr = &elf_section_data (relplt)->this_hdr; + if (hdr->sh_link != elf_dynsymtab (abfd) + || (hdr->sh_type != SHT_REL && hdr->sh_type != SHT_RELA)) + return 0; + + slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; + if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE)) + return -1; + + count = relplt->size / hdr->sh_entsize; + size = count * sizeof (asymbol); + p = relplt->relocation; + for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel) + { + size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); + if (p->addend != 0) + { +#ifdef BFD64 + size += sizeof ("+0x") - 1 + 8 + 8 * (bed->s->elfclass == ELFCLASS64); +#else + size += sizeof ("+0x") - 1 + 8; +#endif + } + } + + plt_sym_val = get_plt_sym_val (abfd, dynsyms, plt, relplt); + if (plt_sym_val == NULL) + return -1; + + s = *ret = (asymbol *) bfd_malloc (size); + if (s == NULL) + { + free (plt_sym_val); + return -1; + } + + names = (char *) (s + count); + p = relplt->relocation; + n = 0; + for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel) + { + size_t len; + bfd_vma addr; + + addr = plt_sym_val[i]; + if (addr == (bfd_vma) -1) + continue; + + *s = **p->sym_ptr_ptr; + /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since + we are defining a symbol, ensure one of them is set. */ + if ((s->flags & BSF_LOCAL) == 0) + s->flags |= BSF_GLOBAL; + s->flags |= BSF_SYNTHETIC; + s->section = plt; + s->value = addr - plt->vma; + s->name = names; + s->udata.p = NULL; + len = strlen ((*p->sym_ptr_ptr)->name); + memcpy (names, (*p->sym_ptr_ptr)->name, len); + names += len; + if (p->addend != 0) + { + char buf[30], *a; + + memcpy (names, "+0x", sizeof ("+0x") - 1); + names += sizeof ("+0x") - 1; + bfd_sprintf_vma (abfd, buf, p->addend); + for (a = buf; *a == '0'; ++a) + ; + len = strlen (a); + memcpy (names, a, len); + names += len; + } + memcpy (names, "@plt", sizeof ("@plt")); + names += sizeof ("@plt"); + ++s, ++n; + } + + free (plt_sym_val); + + return n; +} diff --git a/bfd/elf-linux-psinfo.h b/bfd/elf-linux-psinfo.h index 5760cc713..dbaef92de 100644 --- a/bfd/elf-linux-psinfo.h +++ b/bfd/elf-linux-psinfo.h @@ -1,5 +1,5 @@ /* Definitions for PRPSINFO structures under ELF on GNU/Linux. - Copyright (C) 2013-2014 Free Software Foundation, Inc. + Copyright (C) 2013-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index 86872b772..70926861e 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -1,5 +1,5 @@ /* Matsushita 10200 specific support for 32-bit ELF - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 68307de65..6a18b44ea 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -1,5 +1,5 @@ /* Matsushita 10300 specific support for 32-bit ELF - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2679,7 +2679,7 @@ mn10300_elf_relax_section (bfd *abfd, /* Iterate over all the input bfds. */ for (input_bfd = link_info->input_bfds; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { /* We're going to need all the symbols for each bfd. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -3022,7 +3022,7 @@ mn10300_elf_relax_section (bfd *abfd, a "call" instruction. */ for (input_bfd = link_info->input_bfds; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { /* We're going to need all the local symbols for each bfd. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -4598,6 +4598,21 @@ _bfd_mn10300_copy_indirect_symbol (struct bfd_link_info * info, _bfd_elf_link_hash_copy_indirect (info, dir, ind); } +/* Destroy an mn10300 ELF linker hash table. */ + +static void +elf32_mn10300_link_hash_table_free (bfd *obfd) +{ + struct elf32_mn10300_link_hash_table *ret + = (struct elf32_mn10300_link_hash_table *) obfd->link.hash; + + obfd->link.hash = &ret->static_hash_table->root.root; + _bfd_elf_link_hash_table_free (obfd); + obfd->is_linker_output = TRUE; + obfd->link.hash = &ret->root.root; + _bfd_elf_link_hash_table_free (obfd); +} + /* Create an mn10300 ELF linker hash table. */ static struct bfd_link_hash_table * @@ -4610,17 +4625,6 @@ elf32_mn10300_link_hash_table_create (bfd *abfd) if (ret == NULL) return NULL; - if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, - elf32_mn10300_link_hash_newfunc, - sizeof (struct elf32_mn10300_link_hash_entry), - MN10300_ELF_DATA)) - { - free (ret); - return NULL; - } - - ret->tls_ldm_got.offset = -1; - amt = sizeof (struct elf_link_hash_table); ret->static_hash_table = bfd_zmalloc (amt); if (ret->static_hash_table == NULL) @@ -4638,21 +4642,25 @@ elf32_mn10300_link_hash_table_create (bfd *abfd) free (ret); return NULL; } - return & ret->root.root; -} -/* Free an mn10300 ELF linker hash table. */ + abfd->is_linker_output = FALSE; + abfd->link.hash = NULL; + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + elf32_mn10300_link_hash_newfunc, + sizeof (struct elf32_mn10300_link_hash_entry), + MN10300_ELF_DATA)) + { + abfd->is_linker_output = TRUE; + abfd->link.hash = &ret->static_hash_table->root.root; + _bfd_elf_link_hash_table_free (abfd); + free (ret); + return NULL; + } + ret->root.root.hash_table_free = elf32_mn10300_link_hash_table_free; -static void -elf32_mn10300_link_hash_table_free (struct bfd_link_hash_table *hash) -{ - struct elf32_mn10300_link_hash_table *ret - = (struct elf32_mn10300_link_hash_table *) hash; + ret->tls_ldm_got.offset = -1; - _bfd_elf_link_hash_table_free - ((struct bfd_link_hash_table *) ret->static_hash_table); - _bfd_elf_link_hash_table_free - ((struct bfd_link_hash_table *) ret); + return & ret->root.root; } static unsigned long @@ -5016,7 +5024,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (struct bfd_link_info * info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Set the sizes of the dynamic sections. */ @@ -5581,8 +5589,6 @@ mn10300_elf_mkobject (bfd *abfd) mn10300_elf_get_relocated_section_contents #define bfd_elf32_bfd_link_hash_table_create \ elf32_mn10300_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free \ - elf32_mn10300_link_hash_table_free #ifndef elf_symbol_leading_char #define elf_symbol_leading_char '_' diff --git a/bfd/elf-nacl.c b/bfd/elf-nacl.c index b6c9dc2ea..df41ee2a6 100644 --- a/bfd/elf-nacl.c +++ b/bfd/elf-nacl.c @@ -1,5 +1,5 @@ /* Native Client support for ELF - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-nacl.h b/bfd/elf-nacl.h index ec3f4499b..6b84298fa 100644 --- a/bfd/elf-nacl.h +++ b/bfd/elf-nacl.h @@ -1,5 +1,5 @@ /* Native Client support for ELF - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-s390-common.c b/bfd/elf-s390-common.c index dd35c40bc..6fd102729 100644 --- a/bfd/elf-s390-common.c +++ b/bfd/elf-s390-common.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for ELF 32 and 64 bit functions - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Andreas Krebbel. This file is part of BFD, the Binary File Descriptor library. @@ -234,8 +234,10 @@ elf_s390_add_symbol_hook (bfd *abfd, asection **secp ATTRIBUTE_UNUSED, bfd_vma *valp ATTRIBUTE_UNUSED) { - if ((abfd->flags & DYNAMIC) == 0 - && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; return TRUE; diff --git a/bfd/elf-strtab.c b/bfd/elf-strtab.c index c016c8bda..4d38e04e9 100644 --- a/bfd/elf-strtab.c +++ b/bfd/elf-strtab.c @@ -1,5 +1,5 @@ /* ELF strtab with GC and suffix merging support. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-vxworks.c b/bfd/elf-vxworks.c index 77dfd02b7..acc25c044 100644 --- a/bfd/elf-vxworks.c +++ b/bfd/elf-vxworks.c @@ -1,5 +1,5 @@ /* VxWorks support for ELF - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf-vxworks.h b/bfd/elf-vxworks.h index fa57a27a7..7bed0a87d 100644 --- a/bfd/elf-vxworks.h +++ b/bfd/elf-vxworks.h @@ -1,5 +1,5 @@ /* VxWorks support for ELF - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf.c b/bfd/elf.c index 3f377d1e9..0aa5f8e47 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1,6 +1,6 @@ /* ELF executable support for BFD. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -297,13 +297,14 @@ bfd_elf_get_str_section (bfd *abfd, unsigned int shindex) /* Allocate and clear an extra byte at the end, to prevent crashes in case the string table is not terminated. */ if (shstrtabsize + 1 <= 1 - || (shstrtab = (bfd_byte *) bfd_alloc (abfd, shstrtabsize + 1)) == NULL - || bfd_seek (abfd, offset, SEEK_SET) != 0) + || bfd_seek (abfd, offset, SEEK_SET) != 0 + || (shstrtab = (bfd_byte *) bfd_alloc (abfd, shstrtabsize + 1)) == NULL) shstrtab = NULL; else if (bfd_bread (shstrtab, shstrtabsize, abfd) != shstrtabsize) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_file_truncated); + bfd_release (abfd, shstrtab); shstrtab = NULL; /* Once we've failed to read it, make sure we don't keep trying. Otherwise, we'll keep allocating space for @@ -332,9 +333,19 @@ bfd_elf_string_from_elf_section (bfd *abfd, hdr = elf_elfsections (abfd)[shindex]; - if (hdr->contents == NULL - && bfd_elf_get_str_section (abfd, shindex) == NULL) - return NULL; + if (hdr->contents == NULL) + { + if (hdr->sh_type != SHT_STRTAB && hdr->sh_type < SHT_LOOS) + { + /* PR 17512: file: f057ec89. */ + _bfd_error_handler (_("%B: attempt to load strings from a non-string section (number %d)"), + abfd, shindex); + return NULL; + } + + if (bfd_elf_get_str_section (abfd, shindex) == NULL) + return NULL; + } if (strindex >= hdr->sh_size) { @@ -608,9 +619,10 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) if (shdr->contents == NULL) { _bfd_error_handler - (_("%B: Corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size); + (_("%B: corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size); bfd_set_error (bfd_error_bad_value); - return FALSE; + -- num_group; + continue; } memset (shdr->contents, 0, amt); @@ -618,7 +630,16 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 || (bfd_bread (shdr->contents, shdr->sh_size, abfd) != shdr->sh_size)) - return FALSE; + { + _bfd_error_handler + (_("%B: invalid size field in group section header: 0x%lx"), abfd, shdr->sh_size); + bfd_set_error (bfd_error_bad_value); + -- num_group; + /* PR 17510: If the group contents are even partially + corrupt, do not allow any of the contents to be used. */ + memset (shdr->contents, 0, amt); + continue; + } /* Translate raw contents, a flag word followed by an array of elf section indices all in target byte order, @@ -626,6 +647,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) pointers. */ src = shdr->contents + shdr->sh_size; dest = (Elf_Internal_Group *) (shdr->contents + amt); + while (1) { unsigned int idx; @@ -651,6 +673,21 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) } } } + + /* PR 17510: Corrupt binaries might contain invalid groups. */ + if (num_group != (unsigned) elf_tdata (abfd)->num_group) + { + elf_tdata (abfd)->num_group = num_group; + + /* If all groups are invalid then fail. */ + if (num_group == 0) + { + elf_tdata (abfd)->group_sect_ptr = NULL; + elf_tdata (abfd)->num_group = num_group = -1; + (*_bfd_error_handler) (_("%B: no valid group sections found"), abfd); + bfd_set_error (bfd_error_bad_value); + } + } } } @@ -716,6 +753,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) { (*_bfd_error_handler) (_("%B: no group info for section %A"), abfd, newsect); + return FALSE; } return TRUE; } @@ -1227,8 +1265,13 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg) swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in; extdyn = dynbuf; + /* PR 17512: file: 6f427532. */ + if (s->size < extdynsize) + goto error_return; extdynend = extdyn + s->size; - for (; extdyn < extdynend; extdyn += extdynsize) + /* PR 17512: file: id:000006,sig:06,src:000000,op:flip4,pos:5664. + Fix range check. */ + for (; extdyn <= (extdynend - extdynsize); extdyn += extdynsize) { Elf_Internal_Dyn dyn; const char *name = ""; @@ -1396,6 +1439,53 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg) return FALSE; } +/* Get version string. */ + +const char * +_bfd_elf_get_symbol_version_string (bfd *abfd, asymbol *symbol, + bfd_boolean *hidden) +{ + const char *version_string = NULL; + if (elf_dynversym (abfd) != 0 + && (elf_dynverdef (abfd) != 0 || elf_dynverref (abfd) != 0)) + { + unsigned int vernum = ((elf_symbol_type *) symbol)->version; + + *hidden = (vernum & VERSYM_HIDDEN) != 0; + vernum &= VERSYM_VERSION; + + if (vernum == 0) + version_string = ""; + else if (vernum == 1) + version_string = "Base"; + else if (vernum <= elf_tdata (abfd)->cverdefs) + version_string = + elf_tdata (abfd)->verdef[vernum - 1].vd_nodename; + else + { + Elf_Internal_Verneed *t; + + version_string = ""; + for (t = elf_tdata (abfd)->verref; + t != NULL; + t = t->vn_nextref) + { + Elf_Internal_Vernaux *a; + + for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) + { + if (a->vna_other == vernum) + { + version_string = a->vna_nodename; + break; + } + } + } + } + } + return version_string; +} + /* Display ELF-specific fields of a symbol. */ void @@ -1422,6 +1512,8 @@ bfd_elf_print_symbol (bfd *abfd, const struct elf_backend_data *bed; unsigned char st_other; bfd_vma val; + const char *version_string; + bfd_boolean hidden; section_name = symbol->section ? symbol->section->name : "(*none*)"; @@ -1447,45 +1539,12 @@ bfd_elf_print_symbol (bfd *abfd, bfd_fprintf_vma (abfd, file, val); /* If we have version information, print it. */ - if (elf_dynversym (abfd) != 0 - && (elf_dynverdef (abfd) != 0 - || elf_dynverref (abfd) != 0)) + version_string = _bfd_elf_get_symbol_version_string (abfd, + symbol, + &hidden); + if (version_string) { - unsigned int vernum; - const char *version_string; - - vernum = ((elf_symbol_type *) symbol)->version & VERSYM_VERSION; - - if (vernum == 0) - version_string = ""; - else if (vernum == 1) - version_string = "Base"; - else if (vernum <= elf_tdata (abfd)->cverdefs) - version_string = - elf_tdata (abfd)->verdef[vernum - 1].vd_nodename; - else - { - Elf_Internal_Verneed *t; - - version_string = ""; - for (t = elf_tdata (abfd)->verref; - t != NULL; - t = t->vn_nextref) - { - Elf_Internal_Vernaux *a; - - for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) - { - if (a->vna_other == vernum) - { - version_string = a->vna_nodename; - break; - } - } - } - } - - if ((((elf_symbol_type *) symbol)->version & VERSYM_HIDDEN) == 0) + if (!hidden) fprintf (file, " %-11s", version_string); else { @@ -1552,38 +1611,74 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) Elf_Internal_Ehdr *ehdr; const struct elf_backend_data *bed; const char *name; + bfd_boolean ret = TRUE; + static bfd_boolean * sections_being_created = NULL; + static bfd * sections_being_created_abfd = NULL; + static unsigned int nesting = 0; if (shindex >= elf_numsections (abfd)) return FALSE; + if (++ nesting > 3) + { + /* PR17512: A corrupt ELF binary might contain a recursive group of + sections, with each the string indicies pointing to the next in the + loop. Detect this here, by refusing to load a section that we are + already in the process of loading. We only trigger this test if + we have nested at least three sections deep as normal ELF binaries + can expect to recurse at least once. + + FIXME: It would be better if this array was attached to the bfd, + rather than being held in a static pointer. */ + + if (sections_being_created_abfd != abfd) + sections_being_created = NULL; + if (sections_being_created == NULL) + { + /* FIXME: It would be more efficient to attach this array to the bfd somehow. */ + sections_being_created = (bfd_boolean *) + bfd_zalloc (abfd, elf_numsections (abfd) * sizeof (bfd_boolean)); + sections_being_created_abfd = abfd; + } + if (sections_being_created [shindex]) + { + (*_bfd_error_handler) + (_("%B: warning: loop in section dependencies detected"), abfd); + return FALSE; + } + sections_being_created [shindex] = TRUE; + } + hdr = elf_elfsections (abfd)[shindex]; ehdr = elf_elfheader (abfd); name = bfd_elf_string_from_elf_section (abfd, ehdr->e_shstrndx, hdr->sh_name); if (name == NULL) - return FALSE; + goto fail; bed = get_elf_backend_data (abfd); switch (hdr->sh_type) { case SHT_NULL: /* Inactive section. Throw it away. */ - return TRUE; + goto success; - case SHT_PROGBITS: /* Normal section with contents. */ - case SHT_NOBITS: /* .bss section. */ - case SHT_HASH: /* .hash section. */ - case SHT_NOTE: /* .note section. */ + case SHT_PROGBITS: /* Normal section with contents. */ + case SHT_NOBITS: /* .bss section. */ + case SHT_HASH: /* .hash section. */ + case SHT_NOTE: /* .note section. */ case SHT_INIT_ARRAY: /* .init_array section. */ case SHT_FINI_ARRAY: /* .fini_array section. */ case SHT_PREINIT_ARRAY: /* .preinit_array section. */ case SHT_GNU_LIBLIST: /* .gnu.liblist section. */ case SHT_GNU_HASH: /* .gnu.hash section. */ - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + goto success; case SHT_DYNAMIC: /* Dynamic linking information. */ if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) - return FALSE; + goto fail; + if (hdr->sh_link > elf_numsections (abfd)) { /* PR 10478: Accept Solaris binaries with a sh_link @@ -1597,11 +1692,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) break; /* Otherwise fall through. */ default: - return FALSE; + goto fail; } } else if (elf_elfsections (abfd)[hdr->sh_link] == NULL) - return FALSE; + goto fail; else if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_STRTAB) { Elf_Internal_Shdr *dynsymhdr; @@ -1630,24 +1725,26 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) } } } - break; + goto success; - case SHT_SYMTAB: /* A symbol table */ + case SHT_SYMTAB: /* A symbol table. */ if (elf_onesymtab (abfd) == shindex) - return TRUE; + goto success; if (hdr->sh_entsize != bed->s->sizeof_sym) - return FALSE; + goto fail; + if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size) { if (hdr->sh_size != 0) - return FALSE; + goto fail; /* Some assemblers erroneously set sh_info to one with a zero sh_size. ld sees this as a global symbol count of (unsigned) -1. Fix it here. */ hdr->sh_info = 0; - return TRUE; + goto success; } + BFD_ASSERT (elf_onesymtab (abfd) == 0); elf_onesymtab (abfd) = shindex; elf_tdata (abfd)->symtab_hdr = *hdr; @@ -1664,7 +1761,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) && (abfd->flags & DYNAMIC) != 0 && ! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) - return FALSE; + goto fail; /* Go looking for SHT_SYMTAB_SHNDX too, since if there is one we can't read symbols without that section loaded as well. It @@ -1690,26 +1787,29 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) break; } if (i != shindex) - return bfd_section_from_shdr (abfd, i); + ret = bfd_section_from_shdr (abfd, i); } - return TRUE; + goto success; - case SHT_DYNSYM: /* A dynamic symbol table */ + case SHT_DYNSYM: /* A dynamic symbol table. */ if (elf_dynsymtab (abfd) == shindex) - return TRUE; + goto success; if (hdr->sh_entsize != bed->s->sizeof_sym) - return FALSE; + goto fail; + if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size) { if (hdr->sh_size != 0) - return FALSE; + goto fail; + /* Some linkers erroneously set sh_info to one with a zero sh_size. ld sees this as a global symbol count of (unsigned) -1. Fix it here. */ hdr->sh_info = 0; - return TRUE; + goto success; } + BFD_ASSERT (elf_dynsymtab (abfd) == 0); elf_dynsymtab (abfd) = shindex; elf_tdata (abfd)->dynsymtab_hdr = *hdr; @@ -1718,34 +1818,38 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* Besides being a symbol table, we also treat this as a regular section, so that objcopy can handle it. */ - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + goto success; - case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections */ + case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections. */ if (elf_symtab_shndx (abfd) == shindex) - return TRUE; + goto success; BFD_ASSERT (elf_symtab_shndx (abfd) == 0); elf_symtab_shndx (abfd) = shindex; elf_tdata (abfd)->symtab_shndx_hdr = *hdr; elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->symtab_shndx_hdr; - return TRUE; + goto success; - case SHT_STRTAB: /* A string table */ + case SHT_STRTAB: /* A string table. */ if (hdr->bfd_section != NULL) - return TRUE; + goto success; + if (ehdr->e_shstrndx == shindex) { elf_tdata (abfd)->shstrtab_hdr = *hdr; elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->shstrtab_hdr; - return TRUE; + goto success; } + if (elf_elfsections (abfd)[elf_onesymtab (abfd)]->sh_link == shindex) { symtab_strtab: elf_tdata (abfd)->strtab_hdr = *hdr; elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->strtab_hdr; - return TRUE; + goto success; } + if (elf_elfsections (abfd)[elf_dynsymtab (abfd)]->sh_link == shindex) { dynsymtab_strtab: @@ -1754,8 +1858,9 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) elf_elfsections (abfd)[shindex] = hdr; /* We also treat this as a regular section, so that objcopy can handle it. */ - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, - shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, + shindex); + goto success; } /* If the string table isn't one of the above, then treat it as a @@ -1773,9 +1878,9 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) { /* Prevent endless recursion on broken objects. */ if (i == shindex) - return FALSE; + goto fail; if (! bfd_section_from_shdr (abfd, i)) - return FALSE; + goto fail; if (elf_onesymtab (abfd) == i) goto symtab_strtab; if (elf_dynsymtab (abfd) == i) @@ -1783,7 +1888,8 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) } } } - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + goto success; case SHT_REL: case SHT_RELA: @@ -1798,7 +1904,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) if (hdr->sh_entsize != (bfd_size_type) (hdr->sh_type == SHT_REL ? bed->s->sizeof_rel : bed->s->sizeof_rela)) - return FALSE; + goto fail; /* Check for a bogus link to avoid crashing. */ if (hdr->sh_link >= num_sec) @@ -1806,8 +1912,9 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) ((*_bfd_error_handler) (_("%B: invalid link %lu for reloc section %s (index %u)"), abfd, hdr->sh_link, name, shindex)); - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, - shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, + shindex); + goto success; } /* For some incomprehensible reason Oracle distributes @@ -1848,7 +1955,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) if ((elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_SYMTAB || elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_DYNSYM) && ! bfd_section_from_shdr (abfd, hdr->sh_link)) - return FALSE; + goto fail; /* If this reloc section does not use the main symbol table we don't treat it as a reloc section. BFD can't adequately @@ -1863,14 +1970,18 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) || hdr->sh_info >= num_sec || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA) - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, - shindex); + { + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, + shindex); + goto success; + } if (! bfd_section_from_shdr (abfd, hdr->sh_info)) - return FALSE; + goto fail; + target_sect = bfd_section_from_elf_index (abfd, hdr->sh_info); if (target_sect == NULL) - return FALSE; + goto fail; esdt = elf_section_data (target_sect); if (hdr->sh_type == SHT_RELA) @@ -1878,11 +1989,13 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) else p_hdr = &esdt->rel.hdr; - BFD_ASSERT (*p_hdr == NULL); + /* PR 17512: file: 0b4f81b7. */ + if (*p_hdr != NULL) + goto fail; amt = sizeof (*hdr2); hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); if (hdr2 == NULL) - return FALSE; + goto fail; *hdr2 = *hdr; *p_hdr = hdr2; elf_elfsections (abfd)[shindex] = hdr2; @@ -1898,46 +2011,55 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) target_sect->use_rela_p = 1; } abfd->flags |= HAS_RELOC; - return TRUE; + goto success; } case SHT_GNU_verdef: elf_dynverdef (abfd) = shindex; elf_tdata (abfd)->dynverdef_hdr = *hdr; - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + goto success; case SHT_GNU_versym: if (hdr->sh_entsize != sizeof (Elf_External_Versym)) - return FALSE; + goto fail; + elf_dynversym (abfd) = shindex; elf_tdata (abfd)->dynversym_hdr = *hdr; - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + goto success; case SHT_GNU_verneed: elf_dynverref (abfd) = shindex; elf_tdata (abfd)->dynverref_hdr = *hdr; - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + goto success; case SHT_SHLIB: - return TRUE; + goto success; case SHT_GROUP: if (! IS_VALID_GROUP_SECTION_HEADER (hdr, GRP_ENTRY_SIZE)) - return FALSE; + goto fail; + if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) - return FALSE; + goto fail; + if (hdr->contents != NULL) { Elf_Internal_Group *idx = (Elf_Internal_Group *) hdr->contents; - unsigned int n_elt = hdr->sh_size / GRP_ENTRY_SIZE; + unsigned int n_elt = hdr->sh_size / sizeof (* idx); asection *s; + if (n_elt == 0) + goto fail; if (idx->flags & GRP_COMDAT) hdr->bfd_section->flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; /* We try to keep the same section order as it comes in. */ idx += n_elt; + while (--n_elt != 0) { --idx; @@ -1951,7 +2073,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) } } } - break; + goto success; default: /* Possibly an attributes section. */ @@ -1959,14 +2081,14 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) || hdr->sh_type == bed->obj_attrs_section_type) { if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) - return FALSE; + goto fail; _bfd_elf_parse_attributes (abfd, hdr); - return TRUE; + goto success; } /* Check for any processor-specific section types. */ if (bed->elf_backend_section_from_shdr (abfd, hdr, name, shindex)) - return TRUE; + goto success; if (hdr->sh_type >= SHT_LOUSER && hdr->sh_type <= SHT_HIUSER) { @@ -1978,9 +2100,12 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) "specific section `%s' [0x%8x]"), abfd, name, hdr->sh_type); else - /* Allow sections reserved for applications. */ - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, - shindex); + { + /* Allow sections reserved for applications. */ + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, + shindex); + goto success; + } } else if (hdr->sh_type >= SHT_LOPROC && hdr->sh_type <= SHT_HIPROC) @@ -2001,8 +2126,11 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) "`%s' [0x%8x]"), abfd, name, hdr->sh_type); else - /* Otherwise it should be processed. */ - return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + { + /* Otherwise it should be processed. */ + ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); + goto success; + } } else /* FIXME: We should handle this section. */ @@ -2010,10 +2138,20 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) (_("%B: don't know how to handle section `%s' [0x%8x]"), abfd, name, hdr->sh_type); - return FALSE; + goto fail; } - return TRUE; + fail: + ret = FALSE; + success: + if (sections_being_created && sections_being_created_abfd == abfd) + sections_being_created [shindex] = FALSE; + if (-- nesting == 0) + { + sections_being_created = NULL; + sections_being_created_abfd = abfd; + } + return ret; } /* Return the local symbol specified by ABFD, R_SYMNDX. */ @@ -3873,6 +4011,11 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) last_size = 0; phdr_index = 0; maxpagesize = bed->maxpagesize; + /* PR 17512: file: c8455299. + Avoid divide-by-zero errors later on. + FIXME: Should we abort if the maxpagesize is zero ? */ + if (maxpagesize == 0) + maxpagesize = 1; writable = FALSE; dynsec = bfd_get_section_by_name (abfd, ".dynamic"); if (dynsec != NULL @@ -5124,7 +5267,6 @@ assign_file_positions_except_relocs (bfd *abfd, { struct elf_obj_tdata *tdata = elf_tdata (abfd); Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); - file_ptr off; const struct elf_backend_data *bed = get_elf_backend_data (abfd); if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 @@ -5134,6 +5276,7 @@ assign_file_positions_except_relocs (bfd *abfd, unsigned int num_sec = elf_numsections (abfd); Elf_Internal_Shdr **hdrpp; unsigned int i; + file_ptr off; /* Start after the ELF header. */ off = i_ehdrp->e_ehsize; @@ -5157,6 +5300,8 @@ assign_file_positions_except_relocs (bfd *abfd, else off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); } + + elf_next_file_pos (abfd) = off; } else { @@ -5203,17 +5348,8 @@ assign_file_positions_except_relocs (bfd *abfd, if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0 || bed->s->write_out_phdrs (abfd, tdata->phdr, alloc) != 0) return FALSE; - - off = elf_next_file_pos (abfd); } - /* Place the section headers. */ - off = align_file_position (off, 1 << bed->s->log_file_align); - i_ehdrp->e_shoff = off; - off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize; - - elf_next_file_pos (abfd) = off; - return TRUE; } @@ -5298,7 +5434,7 @@ prep_headers (bfd *abfd) elf_tdata (abfd)->shstrtab_hdr.sh_name = (unsigned int) _bfd_elf_strtab_add (shstrtab, ".shstrtab", FALSE); if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 - || elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 + || elf_tdata (abfd)->strtab_hdr.sh_name == (unsigned int) -1 || elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1) return FALSE; @@ -5306,14 +5442,16 @@ prep_headers (bfd *abfd) } /* Assign file positions for all the reloc sections which are not part - of the loadable file image. */ + of the loadable file image, and the file position of section headers. */ -void +static void _bfd_elf_assign_file_positions_for_relocs (bfd *abfd) { file_ptr off; unsigned int i, num_sec; Elf_Internal_Shdr **shdrpp; + Elf_Internal_Ehdr *i_ehdrp; + const struct elf_backend_data *bed; off = elf_next_file_pos (abfd); @@ -5328,6 +5466,12 @@ _bfd_elf_assign_file_positions_for_relocs (bfd *abfd) off = _bfd_elf_assign_file_position_for_section (shdrp, off, TRUE); } +/* Place the section headers. */ + i_ehdrp = elf_elfheader (abfd); + bed = get_elf_backend_data (abfd); + off = align_file_position (off, 1 << bed->s->log_file_align); + i_ehdrp->e_shoff = off; + off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize; elf_next_file_pos (abfd) = off; } @@ -7168,26 +7312,30 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bfd_boolean default_imported_symver) hdr = &elf_tdata (abfd)->dynverref_hdr; - elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) - bfd_zalloc2 (abfd, hdr->sh_info, sizeof (Elf_Internal_Verneed)); - if (elf_tdata (abfd)->verref == NULL) - goto error_return; - - elf_tdata (abfd)->cverrefs = hdr->sh_info; - - contents = (bfd_byte *) bfd_malloc (hdr->sh_size); - if (contents == NULL) + if (hdr->sh_info == 0 || hdr->sh_size < sizeof (Elf_External_Verneed)) { +error_return_bad_verref: + (*_bfd_error_handler) + (_("%B: .gnu.version_r invalid entry"), abfd); + bfd_set_error (bfd_error_bad_value); error_return_verref: elf_tdata (abfd)->verref = NULL; elf_tdata (abfd)->cverrefs = 0; goto error_return; } + + contents = (bfd_byte *) bfd_malloc (hdr->sh_size); + if (contents == NULL) + goto error_return_verref; + if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 || bfd_bread (contents, hdr->sh_size, abfd) != hdr->sh_size) goto error_return_verref; - if (hdr->sh_info && hdr->sh_size < sizeof (Elf_External_Verneed)) + elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) + bfd_zalloc2 (abfd, hdr->sh_info, sizeof (Elf_Internal_Verneed)); + + if (elf_tdata (abfd)->verref == NULL) goto error_return_verref; BFD_ASSERT (sizeof (Elf_External_Verneed) @@ -7209,7 +7357,7 @@ error_return_verref: bfd_elf_string_from_elf_section (abfd, hdr->sh_link, iverneed->vn_file); if (iverneed->vn_filename == NULL) - goto error_return_verref; + goto error_return_bad_verref; if (iverneed->vn_cnt == 0) iverneed->vn_auxptr = NULL; @@ -7224,7 +7372,7 @@ error_return_verref: if (iverneed->vn_aux > (size_t) (contents_end - (bfd_byte *) everneed)) - goto error_return_verref; + goto error_return_bad_verref; evernaux = ((Elf_External_Vernaux *) ((bfd_byte *) everneed + iverneed->vn_aux)); @@ -7237,36 +7385,42 @@ error_return_verref: bfd_elf_string_from_elf_section (abfd, hdr->sh_link, ivernaux->vna_name); if (ivernaux->vna_nodename == NULL) - goto error_return_verref; + goto error_return_bad_verref; + if (ivernaux->vna_other > freeidx) + freeidx = ivernaux->vna_other; + + ivernaux->vna_nextptr = NULL; + if (ivernaux->vna_next == 0) + { + iverneed->vn_cnt = j + 1; + break; + } if (j + 1 < iverneed->vn_cnt) ivernaux->vna_nextptr = ivernaux + 1; - else - ivernaux->vna_nextptr = NULL; if (ivernaux->vna_next > (size_t) (contents_end - (bfd_byte *) evernaux)) - goto error_return_verref; + goto error_return_bad_verref; evernaux = ((Elf_External_Vernaux *) ((bfd_byte *) evernaux + ivernaux->vna_next)); - - if (ivernaux->vna_other > freeidx) - freeidx = ivernaux->vna_other; } + iverneed->vn_nextref = NULL; + if (iverneed->vn_next == 0) + break; if (i + 1 < hdr->sh_info) iverneed->vn_nextref = iverneed + 1; - else - iverneed->vn_nextref = NULL; if (iverneed->vn_next > (size_t) (contents_end - (bfd_byte *) everneed)) - goto error_return_verref; + goto error_return_bad_verref; everneed = ((Elf_External_Verneed *) ((bfd_byte *) everneed + iverneed->vn_next)); } + elf_tdata (abfd)->cverrefs = i; free (contents); contents = NULL; @@ -7285,15 +7439,24 @@ error_return_verref: hdr = &elf_tdata (abfd)->dynverdef_hdr; + if (hdr->sh_info == 0 || hdr->sh_size < sizeof (Elf_External_Verdef)) + { + error_return_bad_verdef: + (*_bfd_error_handler) + (_("%B: .gnu.version_d invalid entry"), abfd); + bfd_set_error (bfd_error_bad_value); + error_return_verdef: + elf_tdata (abfd)->verdef = NULL; + elf_tdata (abfd)->cverdefs = 0; + goto error_return; + } + contents = (bfd_byte *) bfd_malloc (hdr->sh_size); if (contents == NULL) - goto error_return; + goto error_return_verdef; if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 || bfd_bread (contents, hdr->sh_size, abfd) != hdr->sh_size) - goto error_return; - - if (hdr->sh_info && hdr->sh_size < sizeof (Elf_External_Verdef)) - goto error_return; + goto error_return_verdef; BFD_ASSERT (sizeof (Elf_External_Verdef) >= sizeof (Elf_External_Verdaux)); @@ -7311,12 +7474,17 @@ error_return_verref: { _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem); + if ((iverdefmem.vd_ndx & ((unsigned) VERSYM_VERSION)) == 0) + goto error_return_bad_verdef; if ((iverdefmem.vd_ndx & ((unsigned) VERSYM_VERSION)) > maxidx) maxidx = iverdefmem.vd_ndx & ((unsigned) VERSYM_VERSION); + if (iverdefmem.vd_next == 0) + break; + if (iverdefmem.vd_next > (size_t) (contents_end_def - (bfd_byte *) everdef)) - goto error_return; + goto error_return_bad_verdef; everdef = ((Elf_External_Verdef *) ((bfd_byte *) everdef + iverdefmem.vd_next)); @@ -7329,10 +7497,11 @@ error_return_verref: else freeidx = ++maxidx; } + elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) - bfd_zalloc2 (abfd, maxidx, sizeof (Elf_Internal_Verdef)); + bfd_zalloc2 (abfd, maxidx, sizeof (Elf_Internal_Verdef)); if (elf_tdata (abfd)->verdef == NULL) - goto error_return; + goto error_return_verdef; elf_tdata (abfd)->cverdefs = maxidx; @@ -7347,12 +7516,7 @@ error_return_verref: _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem); if ((iverdefmem.vd_ndx & VERSYM_VERSION) == 0) - { -error_return_verdef: - elf_tdata (abfd)->verdef = NULL; - elf_tdata (abfd)->cverdefs = 0; - goto error_return; - } + goto error_return_bad_verdef; iverdef = &iverdefarr[(iverdefmem.vd_ndx & VERSYM_VERSION) - 1]; memcpy (iverdef, &iverdefmem, sizeof (Elf_Internal_Verdef)); @@ -7372,7 +7536,7 @@ error_return_verdef: if (iverdef->vd_aux > (size_t) (contents_end_aux - (bfd_byte *) everdef)) - goto error_return_verdef; + goto error_return_bad_verdef; everdaux = ((Elf_External_Verdaux *) ((bfd_byte *) everdef + iverdef->vd_aux)); @@ -7385,16 +7549,20 @@ error_return_verdef: bfd_elf_string_from_elf_section (abfd, hdr->sh_link, iverdaux->vda_name); if (iverdaux->vda_nodename == NULL) - goto error_return_verdef; + goto error_return_bad_verdef; + iverdaux->vda_nextptr = NULL; + if (iverdaux->vda_next == 0) + { + iverdef->vd_cnt = j + 1; + break; + } if (j + 1 < iverdef->vd_cnt) iverdaux->vda_nextptr = iverdaux + 1; - else - iverdaux->vda_nextptr = NULL; if (iverdaux->vda_next > (size_t) (contents_end_aux - (bfd_byte *) everdaux)) - goto error_return_verdef; + goto error_return_bad_verdef; everdaux = ((Elf_External_Verdaux *) ((bfd_byte *) everdaux + iverdaux->vda_next)); @@ -7403,10 +7571,11 @@ error_return_verdef: if (iverdef->vd_cnt) iverdef->vd_nodename = iverdef->vd_auxptr->vda_nodename; + iverdef->vd_nextdef = NULL; + if (iverdef->vd_next == 0) + break; if ((size_t) (iverdef - iverdefarr) + 1 < maxidx) iverdef->vd_nextdef = iverdef + 1; - else - iverdef->vd_nextdef = NULL; everdef = ((Elf_External_Verdef *) ((bfd_byte *) everdef + iverdef->vd_next)); @@ -7449,14 +7618,13 @@ error_return_verdef: if (iverdef->vd_nodename == NULL) goto error_return_verdef; iverdef->vd_nextdef = NULL; - iverdef->vd_auxptr = (struct elf_internal_verdaux *) - bfd_alloc (abfd, sizeof (Elf_Internal_Verdaux)); + iverdef->vd_auxptr = ((struct elf_internal_verdaux *) + bfd_zalloc (abfd, sizeof (Elf_Internal_Verdaux))); if (iverdef->vd_auxptr == NULL) goto error_return_verdef; iverdaux = iverdef->vd_auxptr; iverdaux->vda_nodename = iverdef->vd_nodename; - iverdaux->vda_nextptr = NULL; } return TRUE; @@ -7471,16 +7639,12 @@ asymbol * _bfd_elf_make_empty_symbol (bfd *abfd) { elf_symbol_type *newsym; - bfd_size_type amt = sizeof (elf_symbol_type); - newsym = (elf_symbol_type *) bfd_zalloc (abfd, amt); + newsym = (elf_symbol_type *) bfd_zalloc (abfd, sizeof * newsym); if (!newsym) return NULL; - else - { - newsym->symbol.the_bfd = abfd; - return &newsym->symbol; - } + newsym->symbol.the_bfd = abfd; + return &newsym->symbol; } void @@ -7543,163 +7707,34 @@ _bfd_elf_set_arch_mach (bfd *abfd, return bfd_default_set_arch_mach (abfd, arch, machine); } -/* Find the function to a particular section and offset, - for error reporting. */ - -static bfd_boolean -elf_find_function (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr) -{ - struct elf_find_function_cache - { - asection *last_section; - asymbol *func; - const char *filename; - bfd_size_type func_size; - } *cache; - - if (symbols == NULL) - return FALSE; - - cache = elf_tdata (abfd)->elf_find_function_cache; - if (cache == NULL) - { - cache = bfd_zalloc (abfd, sizeof (*cache)); - elf_tdata (abfd)->elf_find_function_cache = cache; - if (cache == NULL) - return FALSE; - } - if (cache->last_section != section - || cache->func == NULL - || offset < cache->func->value - || offset >= cache->func->value + cache->func_size) - { - asymbol *file; - bfd_vma low_func; - asymbol **p; - /* ??? Given multiple file symbols, it is impossible to reliably - choose the right file name for global symbols. File symbols are - local symbols, and thus all file symbols must sort before any - global symbols. The ELF spec may be interpreted to say that a - file symbol must sort before other local symbols, but currently - ld -r doesn't do this. So, for ld -r output, it is possible to - make a better choice of file name for local symbols by ignoring - file symbols appearing after a given local symbol. */ - enum { nothing_seen, symbol_seen, file_after_symbol_seen } state; - const struct elf_backend_data *bed = get_elf_backend_data (abfd); - - file = NULL; - low_func = 0; - state = nothing_seen; - cache->filename = NULL; - cache->func = NULL; - cache->func_size = 0; - cache->last_section = section; - - for (p = symbols; *p != NULL; p++) - { - asymbol *sym = *p; - bfd_vma code_off; - bfd_size_type size; - - if ((sym->flags & BSF_FILE) != 0) - { - file = sym; - if (state == symbol_seen) - state = file_after_symbol_seen; - continue; - } - - size = bed->maybe_function_sym (sym, section, &code_off); - if (size != 0 - && code_off <= offset - && (code_off > low_func - || (code_off == low_func - && size > cache->func_size))) - { - cache->func = sym; - cache->func_size = size; - cache->filename = NULL; - low_func = code_off; - if (file != NULL - && ((sym->flags & BSF_LOCAL) != 0 - || state != file_after_symbol_seen)) - cache->filename = bfd_asymbol_name (file); - } - if (state == nothing_seen) - state = symbol_seen; - } - } - - if (cache->func == NULL) - return FALSE; - - if (filename_ptr) - *filename_ptr = cache->filename; - if (functionname_ptr) - *functionname_ptr = bfd_asymbol_name (cache->func); - - return TRUE; -} - /* Find the nearest line to a particular section and offset, for error reporting. */ bfd_boolean _bfd_elf_find_nearest_line (bfd *abfd, - asection *section, asymbol **symbols, + asection *section, bfd_vma offset, const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) -{ - return _bfd_elf_find_nearest_line_discriminator (abfd, section, symbols, - offset, filename_ptr, - functionname_ptr, - line_ptr, - NULL); -} - -bfd_boolean -_bfd_elf_find_nearest_line_discriminator (bfd *abfd, - asection *section, - asymbol **symbols, - bfd_vma offset, - const char **filename_ptr, - const char **functionname_ptr, - unsigned int *line_ptr, - unsigned int *discriminator_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { bfd_boolean found; - if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - line_ptr)) - { - if (!*functionname_ptr) - elf_find_function (abfd, section, symbols, offset, - *filename_ptr ? NULL : filename_ptr, - functionname_ptr); - - return TRUE; - } - - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, discriminator_ptr, 0, - &elf_tdata (abfd)->dwarf2_find_line_info)) + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, + &elf_tdata (abfd)->dwarf2_find_line_info) + || _bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset, + filename_ptr, functionname_ptr, + line_ptr)) { if (!*functionname_ptr) - elf_find_function (abfd, section, symbols, offset, - *filename_ptr ? NULL : filename_ptr, - functionname_ptr); - + _bfd_elf_find_function (abfd, symbols, section, offset, + *filename_ptr ? NULL : filename_ptr, + functionname_ptr); return TRUE; } @@ -7714,8 +7749,8 @@ _bfd_elf_find_nearest_line_discriminator (bfd *abfd, if (symbols == NULL) return FALSE; - if (! elf_find_function (abfd, section, symbols, offset, - filename_ptr, functionname_ptr)) + if (! _bfd_elf_find_function (abfd, symbols, section, offset, + filename_ptr, functionname_ptr)) return FALSE; *line_ptr = 0; @@ -7728,20 +7763,10 @@ bfd_boolean _bfd_elf_find_line (bfd *abfd, asymbol **symbols, asymbol *symbol, const char **filename_ptr, unsigned int *line_ptr) { - return _bfd_elf_find_line_discriminator (abfd, symbols, symbol, - filename_ptr, line_ptr, - NULL); -} - -bfd_boolean -_bfd_elf_find_line_discriminator (bfd *abfd, asymbol **symbols, asymbol *symbol, - const char **filename_ptr, - unsigned int *line_ptr, - unsigned int *discriminator_ptr) -{ - return _bfd_dwarf2_find_line (abfd, symbols, symbol, - filename_ptr, line_ptr, discriminator_ptr, 0, - &elf_tdata (abfd)->dwarf2_find_line_info); + return _bfd_dwarf2_find_nearest_line (abfd, symbols, symbol, NULL, 0, + filename_ptr, NULL, line_ptr, NULL, + dwarf_debug_sections, 0, + &elf_tdata (abfd)->dwarf2_find_line_info); } /* After a call to bfd_find_nearest_line, successive calls to @@ -9334,7 +9359,7 @@ elfcore_write_lwpstatus (bfd *abfd, lwpstat.pr_lwpid = pid >> 16; lwpstat.pr_cursig = cursig; #if defined (HAVE_LWPSTATUS_T_PR_REG) - memcpy (lwpstat.pr_reg, gregs, sizeof (lwpstat.pr_reg)); + memcpy (&lwpstat.pr_reg, gregs, sizeof (lwpstat.pr_reg)); #elif defined (HAVE_LWPSTATUS_T_PR_CONTEXT) #if !defined(gregs) memcpy (lwpstat.pr_context.uc_mcontext.gregs, @@ -9685,32 +9710,38 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset) return TRUE; case bfd_core: - if (CONST_STRNEQ (in.namedata, "NetBSD-CORE")) - { - if (! elfcore_grok_netbsd_note (abfd, &in)) - return FALSE; - } - else if (CONST_STRNEQ (in.namedata, "OpenBSD")) - { - if (! elfcore_grok_openbsd_note (abfd, &in)) - return FALSE; - } - else if (CONST_STRNEQ (in.namedata, "QNX")) - { - if (! elfcore_grok_nto_note (abfd, &in)) - return FALSE; - } - else if (CONST_STRNEQ (in.namedata, "SPU/")) + { +#define GROKER_ELEMENT(S,F) {S, sizeof (S) - 1, F} + struct { - if (! elfcore_grok_spu_note (abfd, &in)) - return FALSE; + const char * string; + size_t len; + bfd_boolean (* func)(bfd *, Elf_Internal_Note *); } - else + grokers[] = { - if (! elfcore_grok_note (abfd, &in)) - return FALSE; - } - break; + GROKER_ELEMENT ("", elfcore_grok_note), + GROKER_ELEMENT ("NetBSD-CORE", elfcore_grok_netbsd_note), + GROKER_ELEMENT ( "OpenBSD", elfcore_grok_openbsd_note), + GROKER_ELEMENT ("QNX", elfcore_grok_nto_note), + GROKER_ELEMENT ("SPU/", elfcore_grok_spu_note) + }; +#undef GROKER_ELEMENT + int i; + + for (i = ARRAY_SIZE (grokers); i--;) + { + if (in.namesz >= grokers[i].len + && strncmp (in.namedata, grokers[i].string, + grokers[i].len) == 0) + { + if (! grokers[i].func (abfd, & in)) + return FALSE; + break; + } + } + break; + } case bfd_object: if (in.namesz == sizeof "GNU" && strcmp (in.namedata, "GNU") == 0) @@ -9744,10 +9775,14 @@ elf_read_notes (bfd *abfd, file_ptr offset, bfd_size_type size) if (bfd_seek (abfd, offset, SEEK_SET) != 0) return FALSE; - buf = (char *) bfd_malloc (size); + buf = (char *) bfd_malloc (size + 1); if (buf == NULL) return FALSE; + /* PR 17512: file: ec08f814 + 0-termintate the buffer so that string searches will not overflow. */ + buf[size] = 0; + if (bfd_bread (buf, size, abfd) != size || !elf_parse_notes (abfd, buf, size, offset)) { diff --git a/bfd/elf32-am33lin.c b/bfd/elf32-am33lin.c index c28308d9e..3cffb1811 100644 --- a/bfd/elf32-am33lin.c +++ b/bfd/elf32-am33lin.c @@ -1,5 +1,5 @@ /* Matsushita AM33/2.0 support for 32-bit GNU/Linux ELF - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index e528e66bf..15116ca89 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1,5 +1,5 @@ /* ARC-specific support for 32-bit ELF - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -172,7 +172,11 @@ arc_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_ARC_max); + if (r_type >= (unsigned int) R_ARC_max) + { + _bfd_error_handler (_("%A: invalid ARC reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_arc_howto_table[r_type]; } diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 526d4f849..75ea1d488 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2172,7 +2172,7 @@ static const bfd_vma elf32_thumb2_plt0_entry [] = an instruction maybe encoded to one or two array elements. */ 0xf8dfb500, /* push {lr} */ 0x44fee008, /* ldr.w lr, [pc, #8] */ - /* add lr, pc */ + /* add lr, pc */ 0xff08f85e, /* ldr.w pc, [lr, #8]! */ 0x00000000, /* &GOT[0] - . */ }; @@ -2187,7 +2187,7 @@ static const bfd_vma elf32_thumb2_plt_entry [] = 0x0c00f2c0, /* movt ip, #0xNNNN */ 0xf8dc44fc, /* add ip, pc */ 0xbf00f000 /* ldr.w pc, [ip] */ - /* nop */ + /* nop */ }; /* The format of the first entry in the procedure linkage table @@ -2283,6 +2283,8 @@ static const bfd_vma elf32_arm_nacl_plt_entry [] = #define THM_MAX_BWD_BRANCH_OFFSET (-(1 << 22) + 4) #define THM2_MAX_FWD_BRANCH_OFFSET (((1 << 24) - 2) + 4) #define THM2_MAX_BWD_BRANCH_OFFSET (-(1 << 24) + 4) +#define THM2_MAX_FWD_COND_BRANCH_OFFSET (((1 << 20) -2) + 4) +#define THM2_MAX_BWD_COND_BRANCH_OFFSET (-(1 << 20) + 4) enum stub_insn_type { @@ -3523,6 +3525,18 @@ elf32_arm_copy_indirect_symbol (struct bfd_link_info *info, _bfd_elf_link_hash_copy_indirect (info, dir, ind); } +/* Destroy an ARM elf linker hash table. */ + +static void +elf32_arm_link_hash_table_free (bfd *obfd) +{ + struct elf32_arm_link_hash_table *ret + = (struct elf32_arm_link_hash_table *) obfd->link.hash; + + bfd_hash_table_free (&ret->stub_hash_table); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create an ARM elf linker hash table. */ static struct bfd_link_hash_table * @@ -3558,25 +3572,14 @@ elf32_arm_link_hash_table_create (bfd *abfd) if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc, sizeof (struct elf32_arm_stub_hash_entry))) { - free (ret); + _bfd_elf_link_hash_table_free (abfd); return NULL; } + ret->root.root.hash_table_free = elf32_arm_link_hash_table_free; return &ret->root.root; } -/* Free the derived linker hash table. */ - -static void -elf32_arm_hash_table_free (struct bfd_link_hash_table *hash) -{ - struct elf32_arm_link_hash_table *ret - = (struct elf32_arm_link_hash_table *) hash; - - bfd_hash_table_free (&ret->stub_hash_table); - _bfd_elf_link_hash_table_free (hash); -} - /* Determine what kind of NOPs are available. */ static bfd_boolean @@ -3666,7 +3669,8 @@ arm_type_of_stub (struct bfd_link_info *info, /* ST_BRANCH_TO_ARM is nonsense to thumb-only targets when we are considering a function call relocation. */ - if (thumb_only && (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24) + if (thumb_only && (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24 + || r_type == R_ARM_THM_JUMP19) && branch_type == ST_BRANCH_TO_ARM) branch_type = ST_BRANCH_TO_THUMB; @@ -3710,7 +3714,7 @@ arm_type_of_stub (struct bfd_link_info *info, branch_offset = (bfd_signed_vma)(destination - location); if (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24 - || r_type == R_ARM_THM_TLS_CALL) + || r_type == R_ARM_THM_TLS_CALL || r_type == R_ARM_THM_JUMP19) { /* Handle cases where: - this call goes too far (different Thumb/Thumb2 max @@ -3726,10 +3730,15 @@ arm_type_of_stub (struct bfd_link_info *info, || (thumb2 && (branch_offset > THM2_MAX_FWD_BRANCH_OFFSET || (branch_offset < THM2_MAX_BWD_BRANCH_OFFSET))) + || (thumb2 + && (branch_offset > THM2_MAX_FWD_COND_BRANCH_OFFSET + || (branch_offset < THM2_MAX_BWD_COND_BRANCH_OFFSET)) + && (r_type == R_ARM_THM_JUMP19)) || (branch_type == ST_BRANCH_TO_ARM && (((r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_TLS_CALL) && !globals->use_blx) - || (r_type == R_ARM_THM_JUMP24)) + || (r_type == R_ARM_THM_JUMP24) + || (r_type == R_ARM_THM_JUMP19)) && !use_plt)) { if (branch_type == ST_BRANCH_TO_THUMB) @@ -4436,7 +4445,7 @@ elf32_arm_setup_section_lists (bfd *output_bfd, /* Count the number of input BFDs and find the top input section id. */ for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_count += 1; for (section = input_bfd->sections; @@ -5045,7 +5054,7 @@ elf32_arm_size_stubs (bfd *output_bfd, num_a8_fixes = 0; for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; asection *section; @@ -5346,7 +5355,8 @@ elf32_arm_size_stubs (bfd *output_bfd, /* For historical reasons, use the existing names for ARM-to-Thumb and Thumb-to-ARM stubs. */ if ((r_type == (unsigned int) R_ARM_THM_CALL - || r_type == (unsigned int) R_ARM_THM_JUMP24) + || r_type == (unsigned int) R_ARM_THM_JUMP24 + || r_type == (unsigned int) R_ARM_THM_JUMP19) && branch_type == ST_BRANCH_TO_ARM) sprintf (stub_entry->output_name, THUMB2ARM_GLUE_ENTRY_NAME, sym_name); @@ -7521,6 +7531,8 @@ elf32_arm_allocate_plt_entry (struct bfd_link_info *info, first entry. */ if (splt->size == 0) splt->size += htab->plt_header_size; + + htab->next_tls_desc_index++; } /* Allocate the PLT entry itself, including any leading Thumb stub. */ @@ -7533,7 +7545,10 @@ elf32_arm_allocate_plt_entry (struct bfd_link_info *info, { /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ - arm_plt->got_offset = sgotplt->size - 8 * htab->num_tls_desc; + if (is_iplt_entry) + arm_plt->got_offset = sgotplt->size; + else + arm_plt->got_offset = sgotplt->size - 8 * htab->num_tls_desc; sgotplt->size += 4; } } @@ -7754,7 +7769,7 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info, else if (using_thumb_only (htab)) { /* PR ld/16017: Generate thumb only PLT entries. */ - if (!using_thumb2 (htab)) + if (!using_thumb2 (htab)) { /* FIXME: We ought to be able to generate thumb-1 PLT instructions... */ @@ -9119,6 +9134,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, bfd_signed_vma reloc_signed_max = 0xffffe; bfd_signed_vma reloc_signed_min = -0x100000; bfd_signed_vma signed_check; + enum elf32_arm_stub_type stub_type = arm_stub_none; + struct elf32_arm_stub_hash_entry *stub_entry; + struct elf32_arm_link_hash_entry *hash; /* Need to refetch the addend, reconstruct the top three bits, and squish the two 11 bit pieces together. */ @@ -9150,8 +9168,25 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, *unresolved_reloc_p = FALSE; } - /* ??? Should handle interworking? GCC might someday try to - use this for tail calls. */ + hash = (struct elf32_arm_link_hash_entry *)h; + + stub_type = arm_type_of_stub (info, input_section, rel, + st_type, &branch_type, + hash, value, sym_sec, + input_bfd, sym_name); + if (stub_type != arm_stub_none) + { + stub_entry = elf32_arm_get_stub_entry (input_section, + sym_sec, h, + rel, globals, + stub_type); + if (stub_entry != NULL) + { + value = (stub_entry->stub_offset + + stub_entry->stub_sec->output_offset + + stub_entry->stub_sec->output_section->vma); + } + } relocation = value + signed_addend; relocation -= (input_section->output_section->vma @@ -10911,7 +10946,7 @@ elf32_arm_fix_exidx_coverage (asection **text_section_order, /* Walk over all EXIDX sections, and create backlinks from the corrsponding text sections. */ - for (inp = info->input_bfds; inp != NULL; inp = inp->link_next) + for (inp = info->input_bfds; inp != NULL; inp = inp->link.next) { asection *sec; @@ -11665,6 +11700,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) static const int order_021[3] = {0, 2, 1}; int i; bfd_boolean result = TRUE; + const char *sec_name = get_elf_backend_data (ibfd)->obj_attrs_section; /* Skip the linker stubs file. This preserves previous behavior of accepting unknown attributes in the first input file - but @@ -11672,6 +11708,12 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) if (ibfd->flags & BFD_LINKER_CREATED) return TRUE; + /* Skip any input that hasn't attribute section. + This enables to link object files without attribute section with + any others. */ + if (bfd_get_section_by_name (ibfd, sec_name) == NULL) + return TRUE; + if (!elf_known_obj_attributes_proc (obfd)[0].i) { /* This is the first object. Copy the attributes. */ @@ -11711,10 +11753,14 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) /* This needs to happen before Tag_ABI_FP_number_model is merged. */ if (in_attr[Tag_ABI_VFP_args].i != out_attr[Tag_ABI_VFP_args].i) { - /* Ignore mismatches if the object doesn't use floating point. */ - if (out_attr[Tag_ABI_FP_number_model].i == 0) + /* Ignore mismatches if the object doesn't use floating point or is + floating point ABI independent. */ + if (out_attr[Tag_ABI_FP_number_model].i == AEABI_FP_number_model_none + || (in_attr[Tag_ABI_FP_number_model].i != AEABI_FP_number_model_none + && out_attr[Tag_ABI_VFP_args].i == AEABI_VFP_args_compatible)) out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i; - else if (in_attr[Tag_ABI_FP_number_model].i != 0) + else if (in_attr[Tag_ABI_FP_number_model].i != AEABI_FP_number_model_none + && in_attr[Tag_ABI_VFP_args].i != AEABI_VFP_args_compatible) { _bfd_error_handler (_("error: %B uses VFP register arguments, %B does not"), @@ -11743,7 +11789,9 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) { int secondary_compat = -1, secondary_compat_out = -1; unsigned int saved_out_attr = out_attr[i].i; - static const char *name_table[] = { + int arch_attr; + static const char *name_table[] = + { /* These aren't real CPU names, but we can't guess that from the architecture version alone. */ "Pre v4", @@ -11765,10 +11813,17 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) /* Merge Tag_CPU_arch and Tag_also_compatible_with. */ secondary_compat = get_secondary_compatible_arch (ibfd); secondary_compat_out = get_secondary_compatible_arch (obfd); - out_attr[i].i = tag_cpu_arch_combine (ibfd, out_attr[i].i, - &secondary_compat_out, - in_attr[i].i, - secondary_compat); + arch_attr = tag_cpu_arch_combine (ibfd, out_attr[i].i, + &secondary_compat_out, + in_attr[i].i, + secondary_compat); + + /* Return with error if failed to merge. */ + if (arch_attr == -1) + return FALSE; + + out_attr[i].i = arch_attr; + set_secondary_compatible_arch (obfd, secondary_compat_out); /* Merge Tag_CPU_name and Tag_CPU_raw_name. */ @@ -11904,7 +11959,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) when it's 0. It might mean absence of FP hardware if Tag_FP_arch is zero, otherwise it is effectively SP + DP. */ -#define VFP_VERSION_COUNT 8 +#define VFP_VERSION_COUNT 9 static const struct { int ver; @@ -11918,7 +11973,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) {3, 16}, {4, 32}, {4, 16}, - {8, 32} + {8, 32}, + {8, 16} }; int ver; int regs; @@ -12494,7 +12550,7 @@ elf32_arm_gc_sweep_hook (bfd * abfd, && (sec->flags & SEC_ALLOC) != 0) { if (h == NULL - && (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI)) + && elf32_arm_howto_from_type (r_type)->pc_relative) { call_reloc_p = TRUE; may_need_local_target_p = TRUE; @@ -12705,6 +12761,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, default: tls_type = GOT_NORMAL; break; } + if (!info->executable && (tls_type & GOT_TLS_IE)) + info->flags |= DF_STATIC_TLS; + if (h != NULL) { h->got.refcount++; @@ -12817,7 +12876,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, && (sec->flags & SEC_ALLOC) != 0) { if (h == NULL - && (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI)) + && elf32_arm_howto_from_type (r_type)->pc_relative) { /* In shared libraries and relocatable executables, we treat local relative references as calls; @@ -12963,7 +13022,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, p->pc_count = 0; } - if (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI) + if (elf32_arm_howto_from_type (r_type)->pc_relative) p->pc_count += 1; p->count += 1; } @@ -12991,7 +13050,7 @@ elf32_arm_gc_mark_extra_sections (struct bfd_link_info *info, while (again) { again = FALSE; - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { asection *o; @@ -13036,8 +13095,8 @@ elf32_arm_is_target_special_symbol (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym) static bfd_boolean arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED, - asection * section, asymbol ** symbols, + asection * section, bfd_vma offset, const char ** filename_ptr, const char ** functionname_ptr) @@ -13098,31 +13157,33 @@ arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED, static bfd_boolean elf32_arm_find_nearest_line (bfd * abfd, - asection * section, asymbol ** symbols, + asection * section, bfd_vma offset, const char ** filename_ptr, const char ** functionname_ptr, - unsigned int * line_ptr) + unsigned int * line_ptr, + unsigned int * discriminator_ptr) { bfd_boolean found = FALSE; - /* We skip _bfd_dwarf1_find_nearest_line since no known ARM toolchain uses it. */ - - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, 0, + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, & elf_tdata (abfd)->dwarf2_find_line_info)) { if (!*functionname_ptr) - arm_elf_find_function (abfd, section, symbols, offset, + arm_elf_find_function (abfd, symbols, section, offset, *filename_ptr ? NULL : filename_ptr, functionname_ptr); return TRUE; } + /* Skip _bfd_dwarf1_find_nearest_line since no known ARM toolchain + uses DWARF1. */ + if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, & found, filename_ptr, functionname_ptr, line_ptr, @@ -13135,7 +13196,7 @@ elf32_arm_find_nearest_line (bfd * abfd, if (symbols == NULL) return FALSE; - if (! arm_elf_find_function (abfd, section, symbols, offset, + if (! arm_elf_find_function (abfd, symbols, section, offset, filename_ptr, functionname_ptr)) return FALSE; @@ -13282,7 +13343,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -13359,8 +13420,6 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf) h->target_internal = ST_BRANCH_TO_ARM; } - htab->next_tls_desc_index++; - /* VxWorks executables have a second set of relocations for each PLT entry. They go in a separate relocation section, which is processed by the kernel loader. */ @@ -13544,12 +13603,12 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf) if (info->shared || htab->root.is_relocatable_executable) { - /* The only relocs that use pc_count are R_ARM_REL32 and - R_ARM_REL32_NOI, which will appear on something like - ".long foo - .". We want calls to protected symbols to resolve - directly to the function rather than going via the plt. If people - want function pointer comparisons to work as expected then they - should avoid writing assembly like ".long foo - .". */ + /* Relocs that use pc_count are PC-relative forms, which will appear + on something like ".long foo - ." or "movw REG, foo - .". We want + calls to protected symbols to resolve directly to the function + rather than going via the plt. If people want function pointer + comparisons to work as expected then they should avoid writing + assembly like ".long foo - .". */ if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf_dyn_relocs **pp; @@ -13729,7 +13788,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -13906,7 +13965,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, elf_link_hash_traverse (& htab->root, allocate_dynrelocs_for_symbol, info); /* Here we rummage through the found bfds to collect glue information. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { if (! is_arm_elf (ibfd)) continue; @@ -14664,7 +14723,7 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT && ((i_ehdrp->e_type == ET_DYN) || (i_ehdrp->e_type == ET_EXEC))) { int abi = bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_VFP_args); - if (abi) + if (abi == AEABI_VFP_args_vfp) i_ehdrp->e_flags |= EF_ARM_ABI_FLOAT_HARD; else i_ehdrp->e_flags |= EF_ARM_ABI_FLOAT_SOFT; @@ -15072,7 +15131,7 @@ elf32_arm_output_arch_local_syms (bfd *output_bfd, mapping symbols. */ for (input_bfd = info->input_bfds; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { if ((input_bfd->flags & (BFD_LINKER_CREATED | HAS_SYMS)) == HAS_SYMS) for (osi.sec = input_bfd->sections; @@ -15230,7 +15289,7 @@ elf32_arm_output_arch_local_syms (bfd *output_bfd, elf_link_hash_traverse (&htab->root, elf32_arm_output_plt_map, &osi); for (input_bfd = info->input_bfds; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { struct arm_local_iplt_info **local_iplt; unsigned int i, num_syms; @@ -15861,9 +15920,10 @@ elf32_arm_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym, const char **namep, flagword *flagsp, asection **secp, bfd_vma *valp) { - if ((abfd->flags & DYNAMIC) == 0 - && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; if (elf32_arm_hash_table (info) == NULL) @@ -15908,6 +15968,26 @@ const struct elf_size_info elf32_arm_size_info = bfd_elf32_swap_reloca_out }; +static bfd_vma +read_code32 (const bfd *abfd, const bfd_byte *addr) +{ + /* V7 BE8 code is always little endian. */ + if ((elf_elfheader (abfd)->e_flags & EF_ARM_BE8) != 0) + return bfd_getl32 (addr); + + return bfd_get_32 (abfd, addr); +} + +static bfd_vma +read_code16 (const bfd *abfd, const bfd_byte *addr) +{ + /* V7 BE8 code is always little endian. */ + if ((elf_elfheader (abfd)->e_flags & EF_ARM_BE8) != 0) + return bfd_getl16 (addr); + + return bfd_get_16 (abfd, addr); +} + /* Return size of plt0 entry starting at ADDR or (bfd_vma) -1 if size can not be determined. */ @@ -15917,7 +15997,7 @@ elf32_arm_plt0_size (const bfd *abfd, const bfd_byte *addr) bfd_vma first_word; bfd_vma plt0_size; - first_word = H_GET_32 (abfd, addr); + first_word = read_code32 (abfd, addr); if (first_word == elf32_arm_plt0_entry[0]) plt0_size = 4 * ARRAY_SIZE (elf32_arm_plt0_entry); @@ -15942,17 +16022,17 @@ elf32_arm_plt_size (const bfd *abfd, const bfd_byte *start, bfd_vma offset) const bfd_byte *addr = start + offset; /* PLT entry size if fixed on Thumb-only platforms. */ - if (H_GET_32(abfd, start) == elf32_thumb2_plt0_entry[0]) + if (read_code32 (abfd, start) == elf32_thumb2_plt0_entry[0]) return 4 * ARRAY_SIZE (elf32_thumb2_plt_entry); /* Respect Thumb stub if necessary. */ - if (H_GET_16(abfd, addr) == elf32_arm_plt_thumb_stub[0]) + if (read_code16 (abfd, addr) == elf32_arm_plt_thumb_stub[0]) { plt_size += 2 * ARRAY_SIZE(elf32_arm_plt_thumb_stub); } /* Strip immediate from first add. */ - first_insn = H_GET_32(abfd, addr + plt_size) & 0xffffff00; + first_insn = read_code32 (abfd, addr + plt_size) & 0xffffff00; #ifdef FOUR_WORD_PLT if (first_insn == elf32_arm_plt_entry[0]) @@ -16093,7 +16173,7 @@ elf32_arm_get_synthetic_symtab (bfd *abfd, #ifdef __QNXTARGET__ #define ELF_MAXPAGESIZE 0x1000 #else -#define ELF_MAXPAGESIZE 0x8000 +#define ELF_MAXPAGESIZE 0x10000 #endif #define ELF_MINPAGESIZE 0x1000 #define ELF_COMMONPAGESIZE 0x1000 @@ -16105,7 +16185,6 @@ elf32_arm_get_synthetic_symtab (bfd *abfd, #define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data #define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free elf32_arm_hash_table_free #define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup #define bfd_elf32_bfd_reloc_name_lookup elf32_arm_reloc_name_lookup #define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line @@ -16244,8 +16323,6 @@ elf32_arm_nacl_plt_sym_val (bfd_vma i, const asection *plt, #undef elf_backend_plt_sym_val #define elf_backend_plt_sym_val elf32_arm_nacl_plt_sym_val -#undef ELF_MAXPAGESIZE -#define ELF_MAXPAGESIZE 0x10000 #undef ELF_MINPAGESIZE #undef ELF_COMMONPAGESIZE diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index 45710a1b1..adcf1a3c9 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -1,5 +1,5 @@ /* AVR-specific support for 32-bit ELF - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by Denis Chertykov This file is part of BFD, the Binary File Descriptor library. @@ -33,13 +33,8 @@ static bfd_boolean debug_relax = FALSE; static bfd_boolean debug_stubs = FALSE; static bfd_reloc_status_type -bfd_elf_avr_diff_reloc (bfd *abfd, - arelent *reloc_entry, - asymbol *symbol, - void *data, - asection *input_section, - bfd *output_bfd, - char **error_message); +bfd_elf_avr_diff_reloc (bfd *, arelent *, asymbol *, void *, + asection *, bfd *, char **); /* Hash table initialization and handling. Code is taken from the hppa port and adapted to the needs of AVR. */ @@ -566,45 +561,86 @@ static reloc_howto_type elf_avr_howto_table[] = 0xffffff, /* src_mask */ 0xffffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AVR_DIFF8, /* 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_avr_diff_reloc, /* special_function */ - "R_AVR_DIFF8", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_AVR_DIFF16, /* 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_avr_diff_reloc, /* special_function */ - "R_AVR_DIFF16", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_AVR_DIFF32, /* 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_avr_diff_reloc, /* special_function */ - "R_AVR_DIFF32", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE) /* pcrel_offset */ + HOWTO (R_AVR_DIFF8, /* 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_avr_diff_reloc, /* special_function */ + "R_AVR_DIFF8", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_AVR_DIFF16, /* 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_avr_diff_reloc,/* special_function */ + "R_AVR_DIFF16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_AVR_DIFF32, /* 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_avr_diff_reloc,/* special_function */ + "R_AVR_DIFF32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* 7 bit immediate for LDS/STS in Tiny core. */ + HOWTO (R_AVR_LDS_STS_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AVR_LDS_STS_16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_AVR_PORT6, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 6, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AVR_PORT6", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_AVR_PORT5, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AVR_PORT5", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE) /* pcrel_offset */ }; /* Map BFD reloc types to AVR ELF reloc types. */ @@ -649,7 +685,10 @@ static const struct avr_reloc_map avr_reloc_map[] = { BFD_RELOC_AVR_8_HLO, R_AVR_8_HLO8 }, { BFD_RELOC_AVR_DIFF8, R_AVR_DIFF8 }, { BFD_RELOC_AVR_DIFF16, R_AVR_DIFF16 }, - { BFD_RELOC_AVR_DIFF32, R_AVR_DIFF32 } + { BFD_RELOC_AVR_DIFF32, R_AVR_DIFF32 }, + { BFD_RELOC_AVR_LDS_STS_16, R_AVR_LDS_STS_16}, + { BFD_RELOC_AVR_PORT6, R_AVR_PORT6}, + { BFD_RELOC_AVR_PORT5, R_AVR_PORT5} }; /* Meant to be filled one day with the wrap around address for the @@ -711,6 +750,24 @@ elf32_avr_link_hash_newfunc (struct bfd_hash_entry * entry, return _bfd_elf_link_hash_newfunc (entry, table, string); } +/* Free the derived linker hash table. */ + +static void +elf32_avr_link_hash_table_free (bfd *obfd) +{ + struct elf32_avr_link_hash_table *htab + = (struct elf32_avr_link_hash_table *) obfd->link.hash; + + /* Free the address mapping table. */ + if (htab->amt_stub_offsets != NULL) + free (htab->amt_stub_offsets); + if (htab->amt_destination_addr != NULL) + free (htab->amt_destination_addr); + + bfd_hash_table_free (&htab->bstab); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create the derived linker hash table. The AVR ELF port uses the derived hash table to keep information specific to the AVR ELF linker (without using static variables). */ @@ -737,29 +794,15 @@ elf32_avr_link_hash_table_create (bfd *abfd) /* Init the stub hash table too. */ if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc, sizeof (struct elf32_avr_stub_hash_entry))) - return NULL; + { + _bfd_elf_link_hash_table_free (abfd); + return NULL; + } + htab->etab.root.hash_table_free = elf32_avr_link_hash_table_free; return &htab->etab.root; } -/* Free the derived linker hash table. */ - -static void -elf32_avr_link_hash_table_free (struct bfd_link_hash_table *btab) -{ - struct elf32_avr_link_hash_table *htab - = (struct elf32_avr_link_hash_table *) btab; - - /* Free the address mapping table. */ - if (htab->amt_stub_offsets != NULL) - free (htab->amt_stub_offsets); - if (htab->amt_destination_addr != NULL) - free (htab->amt_destination_addr); - - bfd_hash_table_free (&htab->bstab); - _bfd_elf_link_hash_table_free (btab); -} - /* Calculates the effective distance of a pc relative jump/call. */ static int @@ -816,7 +859,11 @@ avr_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_AVR_max); + if (r_type >= (unsigned int) R_AVR_max) + { + _bfd_error_handler (_("%A: invalid AVR reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_avr_howto_table[r_type]; } @@ -1223,6 +1270,37 @@ avr_final_link_relocate (reloc_howto_type * howto, r = bfd_reloc_ok; break; + case R_AVR_LDS_STS_16: + contents += rel->r_offset; + srel = (bfd_signed_vma) relocation + rel->r_addend; + if ((srel & 0xFFFF) < 0x40 || (srel & 0xFFFF) > 0xbf) + return bfd_reloc_outofrange; + srel = srel & 0x7f; + x = bfd_get_16 (input_bfd, contents); + x |= (srel & 0x0f) | ((srel & 0x30) << 5) | ((srel & 0x40) << 2); + bfd_put_16 (input_bfd, x, contents); + break; + + case R_AVR_PORT6: + contents += rel->r_offset; + srel = (bfd_signed_vma) relocation + rel->r_addend; + if ((srel & 0xffff) > 0x3f) + return bfd_reloc_outofrange; + x = bfd_get_16 (input_bfd, contents); + x = (x & 0xf9f0) | ((srel & 0x30) << 5) | (srel & 0x0f); + bfd_put_16 (input_bfd, x, contents); + break; + + case R_AVR_PORT5: + contents += rel->r_offset; + srel = (bfd_signed_vma) relocation + rel->r_addend; + if ((srel & 0xffff) > 0x1f) + return bfd_reloc_outofrange; + x = bfd_get_16 (input_bfd, contents); + x = (x & 0xff07) | ((srel & 0x1f) << 3); + bfd_put_16 (input_bfd, x, contents); + break; + default: r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, @@ -1435,12 +1513,15 @@ bfd_elf_avr_final_write_processing (bfd *abfd, case bfd_mach_avrxmega7: val = E_AVR_MACH_XMEGA7; break; + + case bfd_mach_avrtiny: + val = E_AVR_MACH_AVRTINY; + break; } elf_elfheader (abfd)->e_machine = EM_AVR; elf_elfheader (abfd)->e_flags &= ~ EF_AVR_MACH; elf_elfheader (abfd)->e_flags |= val; - elf_elfheader (abfd)->e_flags |= EF_AVR_LINKRELAX_PREPARED; } /* Set the right machine number. */ @@ -1525,6 +1606,10 @@ elf32_avr_object_p (bfd *abfd) case E_AVR_MACH_XMEGA7: e_set = bfd_mach_avrxmega7; break; + + case E_AVR_MACH_AVRTINY: + e_set = bfd_mach_avrtiny; + break; } } return bfd_default_set_arch_mach (abfd, bfd_arch_avr, @@ -1541,9 +1626,9 @@ elf32_avr_is_diff_reloc (Elf_Internal_Rela *irel) || ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF32); } -/* Reduce the diff value written in the section by count if the shrinked - insn address happens to fall between the two symbols for which this - diff reloc was emitted. */ +/* Reduce the diff value written in the section by count if the shrinked + insn address happens to fall between the two symbols for which this + diff reloc was emitted. */ static void elf32_avr_adjust_diff_reloc_value (bfd *abfd, @@ -1598,11 +1683,11 @@ elf32_avr_adjust_diff_reloc_value (bfd *abfd, bfd_vma end_address = symval + irel->r_addend; bfd_vma start_address = end_address - x; - /* Reduce the diff value by count bytes and write it back into section + /* Reduce the diff value by count bytes and write it back into section contents. */ - if (shrinked_insn_address >= start_address && - shrinked_insn_address <= end_address) + if (shrinked_insn_address >= start_address + && shrinked_insn_address <= end_address) { switch (ELF32_R_TYPE (irel->r_info)) { @@ -1799,10 +1884,22 @@ elf32_avr_relax_delete_bytes (bfd *abfd, isymend = isym + symtab_hdr->sh_info; for (; isym < isymend; isym++) { - if (isym->st_shndx == sec_shndx - && isym->st_value > addr - && isym->st_value < toaddr) - isym->st_value -= count; + if (isym->st_shndx == sec_shndx) + { + if (isym->st_value > addr + && isym->st_value <= toaddr) + isym->st_value -= count; + + if (isym->st_value <= addr + && isym->st_value + isym->st_size > addr) + { + /* If this assert fires then we have a symbol that ends + part way through an instruction. Does that make + sense? */ + BFD_ASSERT (isym->st_value + isym->st_size >= addr + count); + isym->st_size -= count; + } + } } } @@ -1816,11 +1913,22 @@ elf32_avr_relax_delete_bytes (bfd *abfd, struct elf_link_hash_entry *sym_hash = *sym_hashes; if ((sym_hash->root.type == bfd_link_hash_defined || sym_hash->root.type == bfd_link_hash_defweak) - && sym_hash->root.u.def.section == sec - && sym_hash->root.u.def.value > addr - && sym_hash->root.u.def.value < toaddr) + && sym_hash->root.u.def.section == sec) { - sym_hash->root.u.def.value -= count; + if (sym_hash->root.u.def.value > addr + && sym_hash->root.u.def.value <= toaddr) + sym_hash->root.u.def.value -= count; + + if (sym_hash->root.u.def.value <= addr + && (sym_hash->root.u.def.value + sym_hash->size > addr)) + { + /* If this assert fires then we have a symbol that ends + part way through an instruction. Does that make + sense? */ + BFD_ASSERT (sym_hash->root.u.def.value + sym_hash->size + >= addr + count); + sym_hash->size -= count; + } } } @@ -1945,8 +2053,8 @@ elf32_avr_relax_section (bfd *abfd, bfd_vma symval; if ( ELF32_R_TYPE (irel->r_info) != R_AVR_13_PCREL - && ELF32_R_TYPE (irel->r_info) != R_AVR_7_PCREL - && ELF32_R_TYPE (irel->r_info) != R_AVR_CALL) + && ELF32_R_TYPE (irel->r_info) != R_AVR_7_PCREL + && ELF32_R_TYPE (irel->r_info) != R_AVR_CALL) continue; /* Get the section contents if we haven't done so already. */ @@ -2373,7 +2481,7 @@ elf32_avr_relax_section (bfd *abfd, { Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - + rel = elf_section_data (isec)->relocs; if (rel == NULL) rel = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, TRUE); @@ -2822,7 +2930,7 @@ elf32_avr_setup_section_lists (bfd *output_bfd, /* Count the number of input BFDs and find the top input section id. */ for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_count += 1; for (section = input_bfd->sections; @@ -2896,7 +3004,7 @@ get_local_syms (bfd *input_bfd, struct bfd_link_info *info) export stubs. */ for (bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; @@ -2973,7 +3081,7 @@ elf32_avr_size_stubs (bfd *output_bfd, bfd_hash_traverse (&htab->bstab, avr_mark_stub_not_to_be_necessary, htab); for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; asection *section; @@ -3249,7 +3357,6 @@ elf32_avr_build_stubs (struct bfd_link_info *info) #define TARGET_LITTLE_NAME "elf32-avr" #define bfd_elf32_bfd_link_hash_table_create elf32_avr_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free elf32_avr_link_hash_table_free #define elf_info_to_howto avr_info_to_howto_rela #define elf_info_to_howto_rel NULL diff --git a/bfd/elf32-avr.h b/bfd/elf32-avr.h index 8c3386858..6eb315411 100644 --- a/bfd/elf32-avr.h +++ b/bfd/elf32-avr.h @@ -1,5 +1,5 @@ /* AVR-specific support for 32-bit ELF. - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. Written by Bjoern Haase diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index 692875bf2..079248320 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -1,5 +1,5 @@ /* ADI Blackfin BFD support for 32-bit ELF. - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index f16f1c628..dafbc0855 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -1,5 +1,5 @@ /* BFD back-end for National Semiconductor's CR16 ELF - Copyright (C) 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2015 Free Software Foundation, Inc. Written by M R Swami Reddy. This file is part of BFD, the Binary File Descriptor library. @@ -2437,7 +2437,7 @@ _bfd_cr16_elf_adjust_dynamic_symbol (struct bfd_link_info * info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Set the sizes of the dynamic sections. */ diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c index cf4503c9f..db908f0a4 100644 --- a/bfd/elf32-cr16c.c +++ b/bfd/elf32-cr16c.c @@ -1,5 +1,5 @@ /* BFD back-end for National Semiconductor's CR16C ELF - Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -180,7 +180,11 @@ elf_cr16c_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, { unsigned int r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) RINDEX_16C_MAX); + if (r_type >= RINDEX_16C_MAX) + { + _bfd_error_handler (_("%A; invalid CR16C reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_howto_table[r_type]; } diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 9b2b956c8..d9a317842 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -1,5 +1,5 @@ /* CRIS-specific support for 32-bit ELF. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Axis Communications AB. Written by Hans-Peter Nilsson, based on elf32-fr30.c PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c. @@ -461,7 +461,11 @@ cris_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, enum elf_cris_reloc_type r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_CRIS_max); + if (r_type >= R_CRIS_max) + { + _bfd_error_handler (_("%A: invalid CRIS reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & cris_elf_howto_table [r_type]; } @@ -3054,7 +3058,7 @@ elf_cris_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Adjust our "subclass" elements for an indirect symbol. */ diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c index f2925f55f..90948bcfb 100644 --- a/bfd/elf32-crx.c +++ b/bfd/elf32-crx.c @@ -1,5 +1,5 @@ /* BFD back-end for National Semiconductor's CRX ELF - Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2015 Free Software Foundation, Inc. Written by Tomer Levi, NSC, Israel. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c index f45e2db5f..df9bb8919 100644 --- a/bfd/elf32-d10v.c +++ b/bfd/elf32-d10v.c @@ -1,5 +1,5 @@ /* D10V-specific support for 32-bit ELF - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -228,7 +228,11 @@ d10v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_D10V_max); + if (r_type >= (unsigned int) R_D10V_max) + { + _bfd_error_handler (_("%A: invalid D10V reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_d10v_howto_table[r_type]; } diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c index 211a673ac..36e2bc4db 100644 --- a/bfd/elf32-d30v.c +++ b/bfd/elf32-d30v.c @@ -1,5 +1,5 @@ /* D30V-specific support for 32-bit ELF - Copyright (C) 1997-2014 Free Software Foundation, Inc. + Copyright (C) 1997-2015 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -516,7 +516,11 @@ d30v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_D30V_max); + if (r_type >= (unsigned int) R_D30V_max) + { + _bfd_error_handler (_("%A: invalid D30V reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_d30v_howto_table[r_type]; } @@ -530,7 +534,11 @@ d30v_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_D30V_max); + if (r_type >= (unsigned int) R_D30V_max) + { + _bfd_error_handler (_("%A: invalid D30V reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_d30v_howto_table[r_type]; } diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c index 91441aa84..917a8b315 100644 --- a/bfd/elf32-dlx.c +++ b/bfd/elf32-dlx.c @@ -1,5 +1,5 @@ /* DLX specific support for 32-bit ELF - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -546,7 +546,11 @@ dlx_rtype_to_howto (unsigned int r_type) case R_DLX_RELOC_16_LO: return & elf_dlx_reloc_16_lo; default: - BFD_ASSERT (r_type < (unsigned int) R_DLX_max); + if (r_type >= (unsigned int) R_DLX_max) + { + _bfd_error_handler (_("Invalid DLX reloc number: %d"), r_type); + r_type = 0; + } return & dlx_elf_howto_table[r_type]; } } diff --git a/bfd/elf32-epiphany.c b/bfd/elf32-epiphany.c index 8d95cc9da..d3461b7d6 100644 --- a/bfd/elf32-epiphany.c +++ b/bfd/elf32-epiphany.c @@ -1,5 +1,5 @@ /* Adapteva epiphany specific support for 32-bit ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Embecosm on behalf of Adapteva, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -370,6 +370,11 @@ epiphany_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); + if (r_type >= (unsigned int) R_EPIPHANY_max) + { + _bfd_error_handler (_("%A: invalid Epiphany reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & epiphany_elf_howto_table [r_type]; } diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c index 022a0a9ff..620a43fd4 100644 --- a/bfd/elf32-fr30.c +++ b/bfd/elf32-fr30.c @@ -1,5 +1,5 @@ /* FR30-specific support for 32-bit ELF. - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -375,7 +375,11 @@ fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_FR30_max); + if (r_type >= (unsigned int) R_FR30_max) + { + _bfd_error_handler (_("%A: invalid FR30 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & fr30_elf_howto_table [r_type]; } diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index 46f299b7a..ca0f78d00 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -1,5 +1,5 @@ /* FRV-specific support for 32-bit ELF. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2557,6 +2557,11 @@ frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, break; default: + if (r_type >= (unsigned int) R_FRV_max) + { + _bfd_error_handler (_("%A: invalid FRV reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & elf32_frv_howto_table [r_type]; break; } diff --git a/bfd/elf32-gen.c b/bfd/elf32-gen.c index 412fefd16..32a83fb1b 100644 --- a/bfd/elf32-gen.c +++ b/bfd/elf32-gen.c @@ -1,5 +1,5 @@ /* Generic support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index e9eae944b..d6d315dab 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -1,5 +1,5 @@ /* BFD back-end for Renesas H8/300 ELF binaries. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 1cc419c77..af512a7aa 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1,5 +1,5 @@ /* BFD back-end for HP PA-RISC ELF files. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Original code by Center for Software Science @@ -407,6 +407,18 @@ hppa_link_hash_newfunc (struct bfd_hash_entry *entry, return entry; } +/* Free the derived linker hash table. */ + +static void +elf32_hppa_link_hash_table_free (bfd *obfd) +{ + struct elf32_hppa_link_hash_table *htab + = (struct elf32_hppa_link_hash_table *) obfd->link.hash; + + bfd_hash_table_free (&htab->bstab); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create the derived linker hash table. The PA ELF port uses the derived hash table to keep information specific to the PA ELF linker (without using static variables). */ @@ -432,25 +444,17 @@ elf32_hppa_link_hash_table_create (bfd *abfd) /* Init the stub hash table too. */ if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc, sizeof (struct elf32_hppa_stub_hash_entry))) - return NULL; + { + _bfd_elf_link_hash_table_free (abfd); + return NULL; + } + htab->etab.root.hash_table_free = elf32_hppa_link_hash_table_free; htab->text_segment_base = (bfd_vma) -1; htab->data_segment_base = (bfd_vma) -1; return &htab->etab.root; } -/* Free the derived linker hash table. */ - -static void -elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *btab) -{ - struct elf32_hppa_link_hash_table *htab - = (struct elf32_hppa_link_hash_table *) btab; - - bfd_hash_table_free (&htab->bstab); - _bfd_elf_link_hash_table_free (btab); -} - /* Build a name for an entry in the stub hash table. */ static char * @@ -1911,7 +1915,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info, sec = htab->sdynbss; - return _bfd_elf_adjust_dynamic_copy (eh, sec); + return _bfd_elf_adjust_dynamic_copy (info, eh, sec); } /* Allocate space in the .plt for entries that won't have relocations. @@ -2228,7 +2232,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got and .plt offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -2503,7 +2507,7 @@ elf32_hppa_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) /* Count the number of input BFDs and find the top input section id. */ for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_count += 1; for (section = input_bfd->sections; @@ -2694,7 +2698,7 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info) export stubs. */ for (bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; @@ -2868,7 +2872,7 @@ elf32_hppa_size_stubs for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; asection *section; @@ -4625,7 +4629,6 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) /* Stuff for the BFD linker. */ #define bfd_elf32_bfd_final_link elf32_hppa_final_link #define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free elf32_hppa_link_hash_table_free #define elf_backend_adjust_dynamic_symbol elf32_hppa_adjust_dynamic_symbol #define elf_backend_copy_indirect_symbol elf32_hppa_copy_indirect_symbol #define elf_backend_check_relocs elf32_hppa_check_relocs diff --git a/bfd/elf32-hppa.h b/bfd/elf32-hppa.h index 1b3c5efa0..d00dc5dda 100644 --- a/bfd/elf32-hppa.h +++ b/bfd/elf32-hppa.h @@ -4,7 +4,7 @@ in the Stratus FTX/Golf Object File Format (SED-1762) dated February 1994. - Copyright (C) 1990-2014 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Written by: diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index c9ed6e026..d4ff51588 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1,5 +1,5 @@ /* i370-specific support for 32-bit ELF - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas for i370 linas@linas.org @@ -534,7 +534,7 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Increment the index of a dynamic symbol by a given amount. Called diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index cbee90d48..a6c8faab9 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1,5 +1,5 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -379,7 +379,9 @@ elf_i386_rtype_to_howto (bfd *abfd, unsigned r_type) abfd, (int) r_type); indx = R_386_NONE; } - BFD_ASSERT (elf_howto_table [indx].type == r_type); + /* PR 17512: file: 0f67f69d. */ + if (elf_howto_table [indx].type != r_type) + return NULL; return &elf_howto_table[indx]; } @@ -580,6 +582,24 @@ static const bfd_byte elf_i386_pic_plt_entry[PLT_ENTRY_SIZE] = 0, 0, 0, 0 /* replaced with offset to start of .plt. */ }; +/* Entries in the GOT procedure linkage table look like this. */ + +static const bfd_byte elf_i386_got_plt_entry[8] = +{ + 0xff, 0x25, /* jmp indirect */ + 0, 0, 0, 0, /* replaced with offset of this symbol in .got. */ + 0x66, 0x90 /* xchg %ax,%ax */ +}; + +/* Entries in the PIC GOT procedure linkage table look like this. */ + +static const bfd_byte elf_i386_pic_got_plt_entry[8] = +{ + 0xff, 0xa3, /* jmp *offset(%ebx) */ + 0, 0, 0, 0, /* replaced with offset of this symbol in .got. */ + 0x66, 0x90 /* xchg %ax,%ax */ +}; + /* .eh_frame covering the .plt section. */ static const bfd_byte elf_i386_eh_frame_plt[] = @@ -736,6 +756,10 @@ struct elf_i386_link_hash_entry (GOT_TLS_GD_P (type) || GOT_TLS_GDESC_P (type)) unsigned char tls_type; + /* Information about the GOT PLT entry. Filled when there are both + GOT and PLT relocations against the same function. */ + union gotplt_union plt_got; + /* Offset of the GOTPLT entry reserved for the TLS descriptor, starting at the end of the jump table. */ bfd_vma tlsdesc_got; @@ -785,6 +809,7 @@ struct elf_i386_link_hash_table asection *sdynbss; asection *srelbss; asection *plt_eh_frame; + asection *plt_got; union { @@ -826,7 +851,7 @@ struct elf_i386_link_hash_table == I386_ELF_DATA ? ((struct elf_i386_link_hash_table *) ((p)->hash)) : NULL) #define elf_i386_compute_jump_table_size(htab) \ - ((htab)->next_tls_desc_index * 4) + ((htab)->elf.srelplt->reloc_count * 4) /* Create an entry in an i386 ELF linker hash table. */ @@ -854,6 +879,7 @@ elf_i386_link_hash_newfunc (struct bfd_hash_entry *entry, eh = (struct elf_i386_link_hash_entry *) entry; eh->dyn_relocs = NULL; eh->tls_type = GOT_UNKNOWN; + eh->plt_got.offset = (bfd_vma) -1; eh->tlsdesc_got = (bfd_vma) -1; } @@ -922,11 +948,27 @@ elf_i386_get_local_sym_hash (struct elf_i386_link_hash_table *htab, ret->elf.indx = sec->id; ret->elf.dynstr_index = ELF32_R_SYM (rel->r_info); ret->elf.dynindx = -1; + ret->plt_got.offset = (bfd_vma) -1; *slot = ret; } return &ret->elf; } +/* Destroy an i386 ELF linker hash table. */ + +static void +elf_i386_link_hash_table_free (bfd *obfd) +{ + struct elf_i386_link_hash_table *htab + = (struct elf_i386_link_hash_table *) obfd->link.hash; + + if (htab->loc_hash_table) + htab_delete (htab->loc_hash_table); + if (htab->loc_hash_memory) + objalloc_free ((struct objalloc *) htab->loc_hash_memory); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create an i386 ELF linker hash table. */ static struct bfd_link_hash_table * @@ -955,28 +997,14 @@ elf_i386_link_hash_table_create (bfd *abfd) ret->loc_hash_memory = objalloc_create (); if (!ret->loc_hash_table || !ret->loc_hash_memory) { - free (ret); + elf_i386_link_hash_table_free (abfd); return NULL; } + ret->elf.root.hash_table_free = elf_i386_link_hash_table_free; return &ret->elf.root; } -/* Destroy an i386 ELF linker hash table. */ - -static void -elf_i386_link_hash_table_free (struct bfd_link_hash_table *hash) -{ - struct elf_i386_link_hash_table *htab - = (struct elf_i386_link_hash_table *) hash; - - if (htab->loc_hash_table) - htab_delete (htab->loc_hash_table); - if (htab->loc_hash_memory) - objalloc_free ((struct objalloc *) htab->loc_hash_memory); - _bfd_elf_link_hash_table_free (hash); -} - /* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and .rel.bss sections in DYNOBJ, and set up shortcuts to them in our hash table. */ @@ -1417,6 +1445,7 @@ elf_i386_check_relocs (bfd *abfd, const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; + bfd_boolean use_plt_got; if (info->relocatable) return TRUE; @@ -1427,6 +1456,10 @@ elf_i386_check_relocs (bfd *abfd, if (htab == NULL) return FALSE; + use_plt_got = (!get_elf_i386_backend_data (abfd)->is_vxworks + && (get_elf_i386_backend_data (abfd) + == &elf_i386_arch_bed)); + symtab_hdr = &elf_symtab_hdr (abfd); sym_hashes = elf_sym_hashes (abfd); @@ -1818,6 +1851,39 @@ do_size: default: break; } + + if (use_plt_got + && h != NULL + && h->plt.refcount > 0 + && h->got.refcount > 0 + && htab->plt_got == NULL) + { + /* Create the GOT procedure linkage table. */ + unsigned int plt_got_align; + const struct elf_backend_data *bed; + + bed = get_elf_backend_data (info->output_bfd); + BFD_ASSERT (sizeof (elf_i386_got_plt_entry) == 8 + && (sizeof (elf_i386_got_plt_entry) + == sizeof (elf_i386_pic_got_plt_entry))); + plt_got_align = 3; + + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + htab->plt_got + = bfd_make_section_anyway_with_flags (htab->elf.dynobj, + ".plt.got", + (bed->dynamic_sec_flags + | SEC_ALLOC + | SEC_CODE + | SEC_LOAD + | SEC_READONLY)); + if (htab->plt_got == NULL + || !bfd_set_section_alignment (htab->elf.dynobj, + htab->plt_got, + plt_got_align)) + return FALSE; + } } return TRUE; @@ -2163,7 +2229,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info, s = htab->sdynbss; - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2190,6 +2256,24 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) plt_entry_size = GET_PLT_ENTRY_SIZE (info->output_bfd); + /* We can't use the GOT PLT if pointer equality is needed since + finish_dynamic_symbol won't clear symbol value and the dynamic + linker won't update the GOT slot. We will get into an infinite + loop at run-time. */ + if (htab->plt_got != NULL + && h->type != STT_GNU_IFUNC + && !h->pointer_equality_needed + && h->plt.refcount > 0 + && h->got.refcount > 0) + { + /* Don't use the regular PLT if there are both GOT and GOTPLT + reloctions. */ + h->plt.offset = (bfd_vma) -1; + + /* Use the GOT PLT. */ + eh->plt_got.refcount = 1; + } + /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it here if it is defined and referenced in a non-shared object. */ if (h->type == STT_GNU_IFUNC @@ -2198,8 +2282,10 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) plt_entry_size, plt_entry_size, 4); else if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && (h->plt.refcount > 0 || eh->plt_got.refcount > 0)) { + bfd_boolean use_plt_got = eh->plt_got.refcount > 0; + /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 @@ -2213,13 +2299,17 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->elf.splt; + asection *got_s = htab->plt_got; /* If this is the first .plt entry, make room for the special first entry. */ if (s->size == 0) s->size = plt_entry_size; - h->plt.offset = s->size; + if (use_plt_got) + eh->plt_got.offset = got_s->size; + else + h->plt.offset = s->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 @@ -2229,20 +2319,36 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) if (! info->shared && !h->def_regular) { - h->root.u.def.section = s; - h->root.u.def.value = h->plt.offset; + if (use_plt_got) + { + /* We need to make a call to the entry of the GOT PLT + instead of regular PLT entry. */ + h->root.u.def.section = got_s; + h->root.u.def.value = eh->plt_got.offset; + } + else + { + h->root.u.def.section = s; + h->root.u.def.value = h->plt.offset; + } } /* Make room for this entry. */ - s->size += plt_entry_size; + if (use_plt_got) + got_s->size += sizeof (elf_i386_got_plt_entry); + else + { + s->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. */ - htab->elf.sgotplt->size += 4; + /* We also need to make an entry in the .got.plt section, + which will be placed in the .got section by the linker + script. */ + htab->elf.sgotplt->size += 4; - /* We also need to make an entry in the .rel.plt section. */ - htab->elf.srelplt->size += sizeof (Elf32_External_Rel); - htab->elf.srelplt->reloc_count++; + /* We also need to make an entry in the .rel.plt section. */ + htab->elf.srelplt->size += sizeof (Elf32_External_Rel); + htab->elf.srelplt->reloc_count++; + } if (get_elf_i386_backend_data (info->output_bfd)->is_vxworks && !info->shared) @@ -2532,7 +2638,7 @@ elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec, /* Nothing to do if there are no codes, no relocations or no output. */ if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC) || sec->reloc_count == 0 - || discarded_section (sec)) + || bfd_is_abs_section (sec->output_section)) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -2579,6 +2685,7 @@ elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec, /* STT_GNU_IFUNC must keep R_386_GOT32 relocation. */ if (ELF_ST_TYPE (isym->st_info) != STT_GNU_IFUNC + && irel->r_offset >= 2 && bfd_get_8 (input_bfd, contents + irel->r_offset - 2) == 0x8b) { @@ -2608,6 +2715,7 @@ elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec, && h->type != STT_GNU_IFUNC && h != htab->elf.hdynamic && SYMBOL_REFERENCES_LOCAL (link_info, h) + && irel->r_offset >= 2 && bfd_get_8 (input_bfd, contents + irel->r_offset - 2) == 0x8b) { @@ -2686,7 +2794,7 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -2883,6 +2991,7 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) else if (s == htab->elf.sgotplt || s == htab->elf.iplt || s == htab->elf.igotplt + || s == htab->plt_got || s == htab->plt_eh_frame || s == htab->sdynbss) { @@ -3180,15 +3289,17 @@ elf_i386_relocate_section (bfd *output_bfd, reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; + struct elf_i386_link_hash_entry *eh; Elf_Internal_Sym *sym; asection *sec; - bfd_vma off, offplt; + bfd_vma off, offplt, plt_offset; bfd_vma relocation; bfd_boolean unresolved_reloc; bfd_reloc_status_type r; unsigned int indx; int tls_type; bfd_vma st_size; + asection *resolved_plt; r_type = ELF32_R_TYPE (rel->r_info); if (r_type == R_386_GNU_VTINHERIT @@ -3662,7 +3773,9 @@ elf_i386_relocate_section (bfd *output_bfd, if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1 + eh = (struct elf_i386_link_hash_entry *) h; + if ((h->plt.offset == (bfd_vma) -1 + && eh->plt_got.offset == (bfd_vma) -1) || htab->elf.splt == NULL) { /* We didn't make a PLT entry for this symbol. This @@ -3671,9 +3784,20 @@ elf_i386_relocate_section (bfd *output_bfd, break; } - relocation = (htab->elf.splt->output_section->vma - + htab->elf.splt->output_offset - + h->plt.offset); + if (h->plt.offset != (bfd_vma) -1) + { + resolved_plt = htab->elf.splt; + plt_offset = h->plt.offset; + } + else + { + resolved_plt = htab->plt_got; + plt_offset = eh->plt_got.offset; + } + + relocation = (resolved_plt->output_section->vma + + resolved_plt->output_offset + + plt_offset); unresolved_reloc = FALSE; break; @@ -4424,6 +4548,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd, struct elf_i386_link_hash_table *htab; unsigned plt_entry_size; const struct elf_i386_backend_data *abed; + struct elf_i386_link_hash_entry *eh; htab = elf_i386_hash_table (info); if (htab == NULL) @@ -4432,6 +4557,8 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd, abed = get_elf_i386_backend_data (output_bfd); plt_entry_size = GET_PLT_ENTRY_SIZE (output_bfd); + eh = (struct elf_i386_link_hash_entry *) h; + if (h->plt.offset != (bfd_vma) -1) { bfd_vma plt_index; @@ -4596,21 +4723,65 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd, plt->contents + h->plt.offset + abed->plt->plt_plt_offset); } + } + else if (eh->plt_got.offset != (bfd_vma) -1) + { + bfd_vma got_offset, plt_offset; + asection *plt, *got, *gotplt; + const bfd_byte *got_plt_entry; + + /* Offset of displacement of the indirect jump. */ + bfd_vma plt_got_offset = 2; + + /* Set the entry in the GOT procedure linkage table. */ + plt = htab->plt_got; + got = htab->elf.sgot; + gotplt = htab->elf.sgotplt; + got_offset = h->got.offset; - if (!h->def_regular) + if (got_offset == (bfd_vma) -1 + || plt == NULL + || got == NULL + || gotplt == NULL) + abort (); + + /* Fill in the entry in the GOT procedure linkage table. */ + if (! info->shared) + { + got_plt_entry = elf_i386_got_plt_entry; + got_offset += got->output_section->vma + got->output_offset; + } + else { - /* Mark the symbol as undefined, rather than as defined in - the .plt section. Leave the value if there were any - relocations where pointer equality matters (this is a clue - for the dynamic linker, to make function pointer - comparisons work between an application and shared - library), otherwise set it to zero. If a function is only - called from a binary, there is no need to slow down - shared libraries because of that. */ - sym->st_shndx = SHN_UNDEF; - if (!h->pointer_equality_needed) - sym->st_value = 0; + got_plt_entry = elf_i386_pic_got_plt_entry; + got_offset += (got->output_section->vma + + got->output_offset + - gotplt->output_section->vma + - gotplt->output_offset); } + + plt_offset = eh->plt_got.offset; + memcpy (plt->contents + plt_offset, got_plt_entry, + sizeof (elf_i386_got_plt_entry)); + bfd_put_32 (output_bfd, got_offset, + plt->contents + plt_offset + plt_got_offset); + } + + if (!h->def_regular + && (h->plt.offset != (bfd_vma) -1 + || eh->plt_got.offset != (bfd_vma) -1)) + { + /* Mark the symbol as undefined, rather than as defined in + the .plt section. Leave the value if there were any + relocations where pointer equality matters (this is a clue + for the dynamic linker, to make function pointer + comparisons work between an application and shared + library), otherwise set it to zero. If a function is only + called from a binary, there is no need to slow down + shared libraries because of that. */ + sym->st_shndx = SHN_UNDEF; + if (!h->pointer_equality_needed) + sym->st_value = 0; } if (h->got.offset != (bfd_vma) -1 @@ -4975,46 +5146,91 @@ elf_i386_finish_dynamic_sections (bfd *output_bfd, return TRUE; } -/* Return address in section PLT for the Ith GOTPLT relocation, for - relocation REL or (bfd_vma) -1 if it should not be included. */ +/* Return an array of PLT entry symbol values. */ -static bfd_vma -elf_i386_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel) +static bfd_vma * +elf_i386_get_plt_sym_val (bfd *abfd, asymbol **dynsyms, asection *plt, + asection *relplt) { - bfd *abfd; - const struct elf_i386_backend_data *bed; + bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); + arelent *p; + long count, i; + bfd_vma *plt_sym_val; bfd_vma plt_offset; + bfd_byte *plt_contents; + const struct elf_i386_backend_data *bed + = get_elf_i386_backend_data (abfd); + Elf_Internal_Shdr *hdr; + + /* Get the .plt section contents. */ + plt_contents = (bfd_byte *) bfd_malloc (plt->size); + if (plt_contents == NULL) + return NULL; + if (!bfd_get_section_contents (abfd, (asection *) plt, + plt_contents, 0, plt->size)) + { +bad_return: + free (plt_contents); + return NULL; + } - /* Only match R_386_JUMP_SLOT and R_386_IRELATIVE. */ - if (rel->howto->type != R_386_JUMP_SLOT - && rel->howto->type != R_386_IRELATIVE) - return (bfd_vma) -1; + slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; + if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE)) + goto bad_return; - abfd = plt->owner; - bed = get_elf_i386_backend_data (abfd); - plt_offset = bed->plt->plt_entry_size; + hdr = &elf_section_data (relplt)->this_hdr; + count = relplt->size / hdr->sh_entsize; + + plt_sym_val = (bfd_vma *) bfd_malloc (sizeof (bfd_vma) * count); + if (plt_sym_val == NULL) + goto bad_return; - if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU) - return plt->vma + (i + 1) * plt_offset; + for (i = 0; i < count; i++, p++) + plt_sym_val[i] = -1; - while (plt_offset < plt->size) + plt_offset = bed->plt->plt_entry_size; + p = relplt->relocation; + for (i = 0; i < count; i++, p++) { - bfd_vma reloc_offset; - bfd_byte reloc_offset_raw[4]; - - if (!bfd_get_section_contents (abfd, (asection *) plt, - reloc_offset_raw, - plt_offset + bed->plt->plt_reloc_offset, - sizeof (reloc_offset_raw))) - return (bfd_vma) -1; - - reloc_offset = H_GET_32 (abfd, reloc_offset_raw); - if (reloc_offset == i * sizeof (Elf32_External_Rel)) - return plt->vma + plt_offset; + long reloc_index; + + /* Skip unknown relocation. PR 17512: file: bc9d6cf5. */ + if (p->howto == NULL) + continue; + + if (p->howto->type != R_386_JUMP_SLOT + && p->howto->type != R_386_IRELATIVE) + continue; + + reloc_index = H_GET_32 (abfd, (plt_contents + plt_offset + + bed->plt->plt_reloc_offset)); + reloc_index /= sizeof (Elf32_External_Rel); + if (reloc_index >= count) + abort (); + plt_sym_val[reloc_index] = plt->vma + plt_offset; plt_offset += bed->plt->plt_entry_size; } - abort (); + free (plt_contents); + + return plt_sym_val; +} + +/* Similar to _bfd_elf_get_synthetic_symtab. */ + +static long +elf_i386_get_synthetic_symtab (bfd *abfd, + long symcount, + asymbol **syms, + long dynsymcount, + asymbol **dynsyms, + asymbol **ret) +{ + asection *plt = bfd_get_section_by_name (abfd, ".plt"); + return _bfd_elf_ifunc_get_synthetic_symtab (abfd, symcount, syms, + dynsymcount, dynsyms, ret, + plt, + elf_i386_get_plt_sym_val); } /* Return TRUE if symbol should be hashed in the `.gnu.hash' section. */ @@ -5035,16 +5251,17 @@ elf_i386_hash_symbol (struct elf_link_hash_entry *h) static bfd_boolean elf_i386_add_symbol_hook (bfd * abfd, - struct bfd_link_info * info ATTRIBUTE_UNUSED, + struct bfd_link_info * info, Elf_Internal_Sym * sym, const char ** namep ATTRIBUTE_UNUSED, flagword * flagsp ATTRIBUTE_UNUSED, asection ** secp ATTRIBUTE_UNUSED, bfd_vma * valp ATTRIBUTE_UNUSED) { - if ((abfd->flags & DYNAMIC) == 0 - && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; return TRUE; @@ -5073,9 +5290,9 @@ elf_i386_add_symbol_hook (bfd * abfd, #define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free elf_i386_link_hash_table_free #define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup #define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup +#define bfd_elf32_get_synthetic_symtab elf_i386_get_synthetic_symtab #define elf_backend_adjust_dynamic_symbol elf_i386_adjust_dynamic_symbol #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible @@ -5095,7 +5312,6 @@ elf_i386_add_symbol_hook (bfd * abfd, #define elf_backend_always_size_sections elf_i386_always_size_sections #define elf_backend_omit_section_dynsym \ ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) -#define elf_backend_plt_sym_val elf_i386_plt_sym_val #define elf_backend_hash_symbol elf_i386_hash_symbol #define elf_backend_add_symbol_hook elf_i386_add_symbol_hook @@ -5120,8 +5336,11 @@ elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info) _bfd_elf_post_process_headers (abfd, info); #ifdef OLD_FREEBSD_ABI_LABEL - /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ - memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); + { + /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ + Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); + memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); + } #endif } diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c index de900c18a..505c1c0fb 100644 --- a/bfd/elf32-i860.c +++ b/bfd/elf32-i860.c @@ -1,5 +1,5 @@ /* Intel i860 specific support for 32-bit ELF. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Full i860 support contributed by Jason Eckhardt . diff --git a/bfd/elf32-i960.c b/bfd/elf32-i960.c index c6fbbb8c4..0fd00e0f9 100644 --- a/bfd/elf32-i960.c +++ b/bfd/elf32-i960.c @@ -1,5 +1,5 @@ /* Intel 960 specific support for 32-bit ELF - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -132,7 +132,13 @@ elf32_i960_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, enum elf_i960_reloc_type type; type = (enum elf_i960_reloc_type) ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (type < R_960_max); + + /* PR 17521: file: 9609b8d6. */ + if (type >= R_960_max) + { + _bfd_error_handler (_("%A; invalid i960 reloc number: %d"), abfd, type); + type = 0; + } cache_ptr->howto = &elf_howto_table[(int) type]; } diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c index 79e1eccf3..755da5781 100644 --- a/bfd/elf32-ip2k.c +++ b/bfd/elf32-ip2k.c @@ -1,5 +1,5 @@ /* Ubicom IP2xxx specific support for 32-bit ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1239,6 +1239,11 @@ ip2k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); + if (r_type >= (unsigned int) R_IP2K_max) + { + _bfd_error_handler (_("%A: invalid IP2K reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & ip2k_elf_howto_table [r_type]; } diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c index a6bf8d2e6..aae9af54f 100644 --- a/bfd/elf32-iq2000.c +++ b/bfd/elf32-iq2000.c @@ -1,5 +1,5 @@ /* IQ2000-specific support for 32-bit ELF. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -435,6 +435,11 @@ iq2000_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, break; default: + if (r_type >= (unsigned int) R_IQ2000_max) + { + _bfd_error_handler (_("%A: invalid IQ2000 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & iq2000_elf_howto_table [r_type]; break; } diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index 98db714f3..9acebe0fc 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -1,5 +1,5 @@ /* Lattice Mico32-specific support for 32-bit ELF - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. Contributed by Jon Beniston This file is part of BFD, the Binary File Descriptor library. @@ -588,7 +588,11 @@ lm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_LM32_max); + if (r_type >= (unsigned int) R_LM32_max) + { + _bfd_error_handler (_("%A: invalid LM32 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &lm32_elf_howto_table[r_type]; } @@ -1892,7 +1896,7 @@ lm32_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2146,7 +2150,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -2324,7 +2328,7 @@ lm32_elf_size_dynamic_sections (bfd *output_bfd, int r32_count = 0; int rgot_count = 0; /* Look for deleted sections. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { for (s = ibfd->sections; s != NULL; s = s->next) { diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index ed7df9ab6..3ddab6e8d 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -1,5 +1,5 @@ /* M16C/M32C specific support for 32-bit ELF. - Copyright (C) 2005-2014 Free Software Foundation, Inc. + Copyright (C) 2005-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -297,7 +297,11 @@ m32c_info_to_howto_rela unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_M32C_max); + if (r_type >= (unsigned int) R_M32C_max) + { + _bfd_error_handler (_("%A: invalid M32C reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & m32c_elf_howto_table [r_type]; } @@ -1110,7 +1114,7 @@ m32c_elf_relax_plt_section (asection *splt, /* Likewise for local symbols, though that's somewhat less convenient as we have to walk the list of input bfds and swap in symbol data. */ - for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next) { bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd); Elf_Internal_Shdr *symtab_hdr; @@ -1184,7 +1188,7 @@ m32c_elf_relax_plt_section (asection *splt, elf_link_hash_traverse (elf_hash_table (info), m32c_relax_plt_realloc, &entry); - for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next) { bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd); unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info; diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 9c59c0209..9d746998e 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1,5 +1,5 @@ /* M32R-specific support for 32-bit ELF. - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1280,7 +1280,11 @@ m32r_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (ELF32_R_TYPE(dst->r_info) <= (unsigned int) R_M32R_GNU_VTENTRY); + if (r_type > (unsigned int) R_M32R_GNU_VTENTRY) + { + _bfd_error_handler (_("%A: invalid M32R reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &m32r_elf_howto_table[r_type]; } @@ -1919,7 +1923,7 @@ m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2177,7 +2181,7 @@ m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index 4b2c16e07..5cda8f78f 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -1,5 +1,5 @@ /* Motorola 68HC11-specific support for 32-bit ELF - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) @@ -384,7 +384,11 @@ m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max); + if (r_type >= (unsigned int) R_M68HC11_max) + { + _bfd_error_handler (_("%A: invalid M68HC11 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; } @@ -1305,8 +1309,6 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] = #define bfd_elf32_bfd_link_hash_table_create \ m68hc11_elf_bfd_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free \ - m68hc11_elf_bfd_link_hash_table_free #define bfd_elf32_bfd_merge_private_bfd_data \ _bfd_m68hc11_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c index f643c37fe..38e0e30c1 100644 --- a/bfd/elf32-m68hc12.c +++ b/bfd/elf32-m68hc12.c @@ -1,5 +1,5 @@ /* Motorola 68HC12-specific support for 32-bit ELF - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) @@ -504,7 +504,11 @@ m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max); + if (r_type >= (unsigned int) R_M68HC11_max) + { + _bfd_error_handler (_("%A: invalid M68HC12 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; } @@ -655,8 +659,6 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] = #define bfd_elf32_bfd_link_hash_table_create \ m68hc12_elf_bfd_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free \ - m68hc11_elf_bfd_link_hash_table_free #define bfd_elf32_bfd_merge_private_bfd_data \ _bfd_m68hc11_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index 747dafc72..b64592d20 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -1,5 +1,5 @@ /* Motorola 68HC11/HC12-specific support for 32-bit ELF - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) This file is part of BFD, the Binary File Descriptor library. @@ -58,6 +58,19 @@ struct m68hc11_scan_param }; +/* Destroy a 68HC11/68HC12 ELF linker hash table. */ + +static void +m68hc11_elf_bfd_link_hash_table_free (bfd *obfd) +{ + struct m68hc11_elf_link_hash_table *ret + = (struct m68hc11_elf_link_hash_table *) obfd->link.hash; + + bfd_hash_table_free (ret->stub_hash_table); + free (ret->stub_hash_table); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create a 68HC11/68HC12 ELF linker hash table. */ struct m68hc11_elf_link_hash_table* @@ -84,29 +97,21 @@ m68hc11_elf_hash_table_create (bfd *abfd) ret->stub_hash_table = (struct bfd_hash_table*) bfd_malloc (amt); if (ret->stub_hash_table == NULL) { - free (ret); + _bfd_elf_link_hash_table_free (abfd); return NULL; } if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc, sizeof (struct elf32_m68hc11_stub_hash_entry))) - return NULL; + { + free (ret->stub_hash_table); + _bfd_elf_link_hash_table_free (abfd); + return NULL; + } + ret->root.root.hash_table_free = m68hc11_elf_bfd_link_hash_table_free; return ret; } -/* Free the derived linker hash table. */ - -void -m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash) -{ - struct m68hc11_elf_link_hash_table *ret - = (struct m68hc11_elf_link_hash_table *) hash; - - bfd_hash_table_free (ret->stub_hash_table); - free (ret->stub_hash_table); - _bfd_elf_link_hash_table_free (hash); -} - /* Assorted hash table functions. */ /* Initialize an entry in the stub hash table. */ @@ -254,7 +259,7 @@ elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) text_section = 0; for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_count += 1; for (section = input_bfd->sections; @@ -342,7 +347,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd, /* Count the number of input BFDs and find the top input section id. */ for (input_bfd = info->input_bfds, bfd_count = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) bfd_count += 1; /* We want to read in symbol extension records only once. To do this @@ -356,7 +361,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd, /* Walk over all the input BFDs, swapping in local symbols. */ for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; @@ -386,7 +391,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd, for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry ** sym_hashes; diff --git a/bfd/elf32-m68hc1x.h b/bfd/elf32-m68hc1x.h index 1d1f28814..f191f8ea4 100644 --- a/bfd/elf32-m68hc1x.h +++ b/bfd/elf32-m68hc1x.h @@ -1,5 +1,5 @@ /* Motorola 68HC11/68HC12-specific support for 32-bit ELF - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) This file is part of BFD, the Binary File Descriptor library. @@ -136,7 +136,6 @@ struct m68hc11_elf_link_hash_table extern struct m68hc11_elf_link_hash_table* m68hc11_elf_hash_table_create (bfd*); -extern void m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table*); extern void m68hc11_elf_get_bank_parameters (struct bfd_link_info*); diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 44e302a74..0d04b4e9c 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -1,5 +1,5 @@ /* Motorola 68k series support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -940,6 +940,23 @@ elf_m68k_link_hash_newfunc (struct bfd_hash_entry *entry, return ret; } +/* Destroy an m68k ELF linker hash table. */ + +static void +elf_m68k_link_hash_table_free (bfd *obfd) +{ + struct elf_m68k_link_hash_table *htab; + + htab = (struct elf_m68k_link_hash_table *) obfd->link.hash; + + if (htab->multi_got_.bfd2got != NULL) + { + htab_delete (htab->multi_got_.bfd2got); + htab->multi_got_.bfd2got = NULL; + } + _bfd_elf_link_hash_table_free (obfd); +} + /* Create an m68k ELF linker hash table. */ static struct bfd_link_hash_table * @@ -960,29 +977,13 @@ elf_m68k_link_hash_table_create (bfd *abfd) free (ret); return NULL; } + ret->root.root.hash_table_free = elf_m68k_link_hash_table_free; ret->multi_got_.global_symndx = 1; return &ret->root.root; } -/* Destruct local data. */ - -static void -elf_m68k_link_hash_table_free (struct bfd_link_hash_table *_htab) -{ - struct elf_m68k_link_hash_table *htab; - - htab = (struct elf_m68k_link_hash_table *) _htab; - - if (htab->multi_got_.bfd2got != NULL) - { - htab_delete (htab->multi_got_.bfd2got); - htab->multi_got_.bfd2got = NULL; - } - _bfd_elf_link_hash_table_free (_htab); -} - /* Set the right machine number. */ static bfd_boolean @@ -3236,7 +3237,7 @@ elf_m68k_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Set the sizes of the dynamic sections. */ @@ -4841,9 +4842,10 @@ elf_m68k_add_symbol_hook (bfd *abfd, asection **secp ATTRIBUTE_UNUSED, bfd_vma *valp ATTRIBUTE_UNUSED) { - if ((abfd->flags & DYNAMIC) == 0 - && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; return TRUE; @@ -4857,9 +4859,6 @@ elf_m68k_add_symbol_hook (bfd *abfd, _bfd_elf_create_dynamic_sections #define bfd_elf32_bfd_link_hash_table_create \ elf_m68k_link_hash_table_create -/* ??? Should it be this macro or bfd_elfNN_bfd_link_hash_table_create? */ -#define bfd_elf32_bfd_link_hash_table_free \ - elf_m68k_link_hash_table_free #define bfd_elf32_bfd_final_link bfd_elf_final_link #define elf_backend_check_relocs elf_m68k_check_relocs diff --git a/bfd/elf32-m88k.c b/bfd/elf32-m88k.c index 487cc0cca..d03e8e115 100644 --- a/bfd/elf32-m88k.c +++ b/bfd/elf32-m88k.c @@ -1,5 +1,5 @@ /* Motorola 88k-specific support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index 903d37966..01b136aa9 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -1,5 +1,5 @@ /* Motorola MCore specific support for 32-bit ELF - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c index 548359f4e..e3d1bc045 100644 --- a/bfd/elf32-mep.c +++ b/bfd/elf32-mep.c @@ -1,5 +1,5 @@ /* MeP-specific support for 32-bit ELF. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -400,6 +400,11 @@ mep_info_to_howto_rela unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); + if (r_type >= R_MEP_max) + { + _bfd_error_handler (_("%A: invalid MEP reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & mep_elf_howto_table [r_type]; } diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c index d1d4b414b..dab6bf390 100644 --- a/bfd/elf32-metag.c +++ b/bfd/elf32-metag.c @@ -1,5 +1,5 @@ /* Meta support for 32-bit ELF - Copyright (C) 2013-2014 Free Software Foundation, Inc. + Copyright (C) 2013-2015 Free Software Foundation, Inc. Contributed by Imagination Technologies Ltd. This file is part of BFD, the Binary File Descriptor library. @@ -896,7 +896,11 @@ metag_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_METAG_MAX); + if (r_type >= (unsigned int) R_METAG_MAX) + { + _bfd_error_handler (_("%A: invalid METAG reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & elf_metag_howto_table [r_type]; } @@ -1017,6 +1021,18 @@ metag_link_hash_newfunc (struct bfd_hash_entry *entry, return entry; } +/* Free the derived linker hash table. */ + +static void +elf_metag_link_hash_table_free (bfd *obfd) +{ + struct elf_metag_link_hash_table *htab + = (struct elf_metag_link_hash_table *) obfd->link.hash; + + bfd_hash_table_free (&htab->bstab); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create the derived linker hash table. The Meta ELF port uses the derived hash table to keep information specific to the Meta ELF linker (without using static variables). */ @@ -1043,23 +1059,15 @@ elf_metag_link_hash_table_create (bfd *abfd) /* Init the stub hash table too. */ if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc, sizeof (struct elf_metag_stub_hash_entry))) - return NULL; + { + _bfd_elf_link_hash_table_free (abfd); + return NULL; + } + htab->etab.root.hash_table_free = elf_metag_link_hash_table_free; return &htab->etab.root; } -/* Free the derived linker hash table. */ - -static void -elf_metag_link_hash_table_free (struct bfd_link_hash_table *btab) -{ - struct elf_metag_link_hash_table *htab - = (struct elf_metag_link_hash_table *) btab; - - bfd_hash_table_free (&htab->bstab); - _bfd_elf_link_hash_table_free (btab); -} - /* Section name for stubs is the associated section name plus this string. */ #define STUB_SUFFIX ".stub" @@ -2583,7 +2591,7 @@ elf_metag_adjust_dynamic_symbol (struct bfd_link_info *info, s = htab->sdynbss; - return _bfd_elf_adjust_dynamic_copy (eh, s); + return _bfd_elf_adjust_dynamic_copy (info, eh, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2847,7 +2855,7 @@ elf_metag_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -3725,7 +3733,7 @@ elf_metag_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) /* Count the number of input BFDs and find the top input section id. */ for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_count += 1; for (section = input_bfd->sections; @@ -3907,7 +3915,7 @@ get_local_syms (bfd *output_bfd ATTRIBUTE_UNUSED, bfd *input_bfd, /* Walk over all the input BFDs, swapping in local symbols. */ for (bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; @@ -4004,7 +4012,7 @@ elf_metag_size_stubs(bfd *output_bfd, bfd *stub_bfd, for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; asection *section; @@ -4295,7 +4303,6 @@ elf_metag_plt_sym_val (bfd_vma i, const asection *plt, #define bfd_elf32_bfd_is_local_label_name elf_metag_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create \ elf_metag_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free elf_metag_link_hash_table_free #define elf_backend_relocate_section elf_metag_relocate_section #define elf_backend_gc_mark_hook elf_metag_gc_mark_hook #define elf_backend_gc_sweep_hook elf_metag_gc_sweep_hook diff --git a/bfd/elf32-metag.h b/bfd/elf32-metag.h index 57f9e951f..9d2a779a9 100644 --- a/bfd/elf32-metag.h +++ b/bfd/elf32-metag.h @@ -1,5 +1,5 @@ /* Meta support for 32-bit ELF - Copyright (C) 2013-2014 Free Software Foundation, Inc. + Copyright (C) 2013-2015 Free Software Foundation, Inc. Contributed by Imagination Technologies Ltd. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index 9837b18aa..ab102b35c 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -1,6 +1,6 @@ /* Xilinx MicroBlaze-specific support for 32-bit ELF - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2973,7 +2973,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 1de302f0e..201c41ae7 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -1,5 +1,5 @@ /* MIPS-specific support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -716,6 +716,99 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (52), + EMPTY_HOWTO (53), + EMPTY_HOWTO (54), + EMPTY_HOWTO (55), + EMPTY_HOWTO (56), + EMPTY_HOWTO (57), + EMPTY_HOWTO (58), + EMPTY_HOWTO (59), + + HOWTO (R_MIPS_PC21_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 21, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC21_S2", /* name */ + TRUE, /* partial_inplace */ + 0x001fffff, /* src_mask */ + 0x001fffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC26_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC26_S2", /* name */ + TRUE, /* partial_inplace */ + 0x03ffffff, /* src_mask */ + 0x03ffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC18_S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC18_S3", /* name */ + TRUE, /* partial_inplace */ + 0x0003ffff, /* src_mask */ + 0x0003ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC19_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC19_S2", /* name */ + TRUE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCHI16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCHI16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCLO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCLO16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ }; /* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This @@ -1905,7 +1998,13 @@ static const struct elf_reloc_map mips_reloc_map[] = { BFD_RELOC_MIPS_TLS_TPREL32, R_MIPS_TLS_TPREL32 }, { BFD_RELOC_MIPS_TLS_TPREL64, R_MIPS_TLS_TPREL64 }, { BFD_RELOC_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_HI16 }, - { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 } + { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 }, + { BFD_RELOC_MIPS_21_PCREL_S2, R_MIPS_PC21_S2 }, + { BFD_RELOC_MIPS_26_PCREL_S2, R_MIPS_PC26_S2 }, + { BFD_RELOC_MIPS_18_PCREL_S3, R_MIPS_PC18_S3 }, + { BFD_RELOC_MIPS_19_PCREL_S2, R_MIPS_PC19_S2 }, + { BFD_RELOC_HI16_S_PCREL, R_MIPS_PCHI16 }, + { BFD_RELOC_LO16_PCREL, R_MIPS_PCLO16 } }; static const struct elf_reloc_map mips16_reloc_map[] = @@ -2315,6 +2414,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_collect TRUE #define elf_backend_type_change_ok TRUE #define elf_backend_can_gc_sections TRUE +#define elf_backend_gc_mark_extra_sections \ + _bfd_mips_elf_gc_mark_extra_sections #define elf_info_to_howto mips_info_to_howto_rela #define elf_info_to_howto_rel mips_info_to_howto_rel #define elf_backend_sym_is_global mips_elf_sym_is_global @@ -2372,6 +2473,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_write_section _bfd_mips_elf_write_section #define elf_backend_mips_irix_compat elf32_mips_irix_compat #define elf_backend_mips_rtype_to_howto mips_elf32_rtype_to_howto +#define elf_backend_sort_relocs_p _bfd_mips_elf_sort_relocs_p + #define bfd_elf32_bfd_is_local_label_name \ mips_elf_is_local_label_name #define bfd_elf32_bfd_is_target_special_symbol \ diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c index 1f685b9c2..51b0cfcb4 100644 --- a/bfd/elf32-moxie.c +++ b/bfd/elf32-moxie.c @@ -1,8 +1,8 @@ /* moxie-specific support for 32-bit ELF. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Copied from elf32-fr30.c which is.. - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -131,7 +131,11 @@ moxie_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_MOXIE_max); + if (r_type >= (unsigned int) R_MOXIE_max) + { + _bfd_error_handler (_("%A: invalid Moxie reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & moxie_elf_howto_table [r_type]; } @@ -367,6 +371,7 @@ moxie_elf_check_relocs (bfd *abfd, #define ELF_ARCH bfd_arch_moxie #define ELF_MACHINE_CODE EM_MOXIE +#define ELF_MACHINE_ALT1 EM_MOXIE_OLD #define ELF_MAXPAGESIZE 0x1 #define TARGET_BIG_SYM moxie_elf32_be_vec diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index 2f55c538d..2157eb0c5 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -1,5 +1,5 @@ /* MSP430-specific support for 32-bit ELF - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. Contributed by Dmitry Diky This file is part of BFD, the Binary File Descriptor library. @@ -617,12 +617,20 @@ msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (uses_msp430x_relocs (abfd)) { - BFD_ASSERT (r_type < (unsigned int) R_MSP430x_max); + if (r_type >= (unsigned int) R_MSP430x_max) + { + _bfd_error_handler (_("%A: invalid MSP430X reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = elf_msp430x_howto_table + r_type; return; } - BFD_ASSERT (r_type < (unsigned int) R_MSP430_max); + if (r_type >= (unsigned int) R_MSP430_max) + { + _bfd_error_handler (_("%A: invalid MSP430 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_msp430_howto_table[r_type]; } @@ -1760,7 +1768,6 @@ msp430_elf_relax_section (bfd * abfd, asection * sec, bfd_byte * contents = NULL; Elf_Internal_Sym * isymbuf = NULL; - /* Assume nothing changes. */ *again = FALSE; @@ -1958,10 +1965,6 @@ msp430_elf_relax_section (bfd * abfd, asection * sec, *again = TRUE; } - if (! uses_msp430x_relocs (abfd)) - /* Now perform the relocations that shrink the code size. - We only do this for non msp430x as gas only generates the RL - reloc for the msp430. */ for (irel = internal_relocs; irel < irelend; irel++) { bfd_vma symval; @@ -2040,7 +2043,8 @@ msp430_elf_relax_section (bfd * abfd, asection * sec, /* Try to turn a 16bit pc-relative branch into a 10bit pc-relative branch. */ /* Paranoia? paranoia... */ - if (ELF32_R_TYPE (irel->r_info) == (int) R_MSP430_RL_PCREL) + if (! uses_msp430x_relocs (abfd) + && ELF32_R_TYPE (irel->r_info) == (int) R_MSP430_RL_PCREL) { bfd_vma value = symval; @@ -2150,6 +2154,62 @@ msp430_elf_relax_section (bfd * abfd, asection * sec, *again = TRUE; } } + + /* Try to turn a 16-bit absolute branch into a 10-bit pc-relative + branch. */ + if (uses_msp430x_relocs (abfd) + && ELF32_R_TYPE (irel->r_info) == R_MSP430X_ABS16) + { + bfd_vma value = symval; + + value -= irel->r_offset; + value += irel->r_addend; + + /* See if the value will fit in 10 bits, note the high value is + 1016 as the target will be two bytes closer if we are + able to relax. */ + if ((long) value < 1016 && (long) value > -1016) + { + int code2; + + /* Get the opcode. */ + code2 = bfd_get_16 (abfd, contents + irel->r_offset - 2); + if (code2 != 0x4030) + continue; + /* FIXME: check r4 and r3 ? */ + /* FIXME: Handle 0x4010 as well ? */ + + /* Note that we've changed the relocs, section contents, etc. */ + elf_section_data (sec)->relocs = internal_relocs; + elf_section_data (sec)->this_hdr.contents = contents; + symtab_hdr->contents = (unsigned char *) isymbuf; + + /* Fix the relocation's type. */ + if (uses_msp430x_relocs (abfd)) + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_MSP430X_10_PCREL); + } + else + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_MSP430_10_PCREL); + } + + /* Fix the opcode right way. */ + bfd_put_16 (abfd, 0x3c00, contents + irel->r_offset - 2); + irel->r_offset -= 2; + + /* Delete bytes. */ + if (!msp430_elf_relax_delete_bytes (abfd, sec, + irel->r_offset + 2, 2)) + goto error_return; + + /* That will change things, so, we should relax again. + Note that this is not required, and it may be slow. */ + *again = TRUE; + } + } } if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c index 6df1521e7..5c9970c1d 100644 --- a/bfd/elf32-mt.c +++ b/bfd/elf32-mt.c @@ -1,5 +1,5 @@ /* Morpho Technologies MT specific support for 32-bit ELF - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -236,6 +236,11 @@ mt_info_to_howto_rela unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); + if (r_type >= (unsigned int) R_MT_max) + { + _bfd_error_handler (_("%A: invalid MT reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & mt_elf_howto_table [r_type]; } diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c index 873a00f36..7f53191e2 100644 --- a/bfd/elf32-nds32.c +++ b/bfd/elf32-nds32.c @@ -1,5 +1,5 @@ /* NDS32-specific support for 32-bit ELF. - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. Contributed by Andes Technology Corporation. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA.*/ + 02110-1301, USA. */ #include "sysdep.h" @@ -97,6 +97,7 @@ static bfd_boolean nds32_elf_finish_dynamic_sections static bfd_boolean nds32_elf_finish_dynamic_symbol (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *); +static bfd_boolean nds32_elf_mkobject (bfd *); /* Nds32 helper functions. */ static bfd_reloc_status_type nds32_elf_final_sda_base @@ -111,15 +112,21 @@ static bfd_vma calculate_memory_address static int nds32_get_section_contents (bfd *, asection *, bfd_byte **); static bfd_boolean nds32_elf_ex9_build_hash_table (bfd *, asection *, struct bfd_link_info *); +static bfd_boolean nds32_elf_ex9_itb_base (struct bfd_link_info *); +static void nds32_elf_ex9_import_table (struct bfd_link_info *); +static void nds32_elf_ex9_finish (struct bfd_link_info *); +static void nds32_elf_ex9_reloc_jmp (struct bfd_link_info *); static void nds32_elf_get_insn_with_reg - (Elf_Internal_Rela *, unsigned long, unsigned long *); + (Elf_Internal_Rela *, uint32_t, uint32_t *); static int nds32_get_local_syms (bfd *, asection *ATTRIBUTE_UNUSED, Elf_Internal_Sym **); static bfd_boolean nds32_elf_ex9_replace_instruction (struct bfd_link_info *, bfd *, asection *); static bfd_boolean nds32_elf_ifc_calc (struct bfd_link_info *, bfd *, asection *); +static bfd_boolean nds32_elf_ifc_finish (struct bfd_link_info *); static bfd_boolean nds32_elf_ifc_replace (struct bfd_link_info *); +static bfd_boolean nds32_elf_ifc_reloc (void); static bfd_boolean nds32_relax_fp_as_gp (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *internal_relocs, Elf_Internal_Rela *irelend, @@ -127,6 +134,13 @@ static bfd_boolean nds32_relax_fp_as_gp static bfd_boolean nds32_fag_remove_unused_fpbase (bfd *abfd, asection *sec, Elf_Internal_Rela *internal_relocs, Elf_Internal_Rela *irelend); +static bfd_byte * +nds32_elf_get_relocated_section_contents (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols); enum { @@ -181,13 +195,31 @@ enum #define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */ #define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */ +/* These are macros used to get the relocation accurate value. */ +#define ACCURATE_8BIT_S1 (0x100) +#define ACCURATE_U9BIT_S1 (0x400) +#define ACCURATE_12BIT_S1 (0x2000) +#define ACCURATE_14BIT_S1 (0x4000) +#define ACCURATE_19BIT (0x40000) + +/* These are macros used to get the relocation conservative value. */ +#define CONSERVATIVE_8BIT_S1 (0x100 - 4) +#define CONSERVATIVE_14BIT_S1 (0x4000 - 4) +#define CONSERVATIVE_16BIT_S1 (0x10000 - 4) +#define CONSERVATIVE_24BIT_S1 (0x1000000 - 4) +/* These must be more conservative because the address may be in + different segment. */ +#define CONSERVATIVE_15BIT (0x4000 - 0x1000) +#define CONSERVATIVE_15BIT_S1 (0x8000 - 0x1000) +#define CONSERVATIVE_15BIT_S2 (0x10000 - 0x1000) +#define CONSERVATIVE_19BIT (0x40000 - 0x1000) +#define CONSERVATIVE_20BIT (0x80000 - 0x1000) + /* Size of small data/bss sections, used to calculate SDA_BASE. */ static long got_size = 0; static int is_SDA_BASE_set = 0; static int is_ITB_BASE_set = 0; -static int relax_active = 0; - /* Convert ELF-VER in eflags to string for debugging purpose. */ static const char *const nds32_elfver_strtab[] = { @@ -243,6 +275,12 @@ struct elf_nds32_link_hash_entry /* Track dynamic relocs copied for this symbol. */ struct elf_nds32_dyn_relocs *dyn_relocs; + + /* For checking relocation type. */ +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_IE 2 + unsigned int tls_type; }; /* Get the nds32 ELF linker hash table from a link_info structure. */ @@ -251,6 +289,32 @@ struct elf_nds32_link_hash_entry static int check_start_export_sym = 0; static size_t ex9_relax_size = 0; /* Save ex9 predicted reducing size. */ +/* The offset for executable tls relaxation. */ +#define TP_OFFSET 0x0 + +struct elf_nds32_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; +}; + +#define elf_nds32_tdata(bfd) \ + ((struct elf_nds32_obj_tdata *) (bfd)->tdata.any) + +#define elf32_nds32_local_got_tls_type(bfd) \ + (elf_nds32_tdata (bfd)->local_got_tls_type) + +#define elf32_nds32_hash_entry(ent) ((struct elf_nds32_link_hash_entry *)(ent)) + +static bfd_boolean +nds32_elf_mkobject (bfd *abfd) +{ + return bfd_elf_allocate_object (abfd, sizeof (struct elf_nds32_obj_tdata), + NDS32_ELF_DATA); +} + /* Relocations used for relocation. */ static reloc_howto_type nds32_elf_howto_table[] = { @@ -1704,6 +1768,234 @@ static reloc_howto_type nds32_elf_howto_table[] = 0x1ff, /* src_mask */ 0x1ff, /* dst_mask */ TRUE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS entry for the symbol. */ + HOWTO (R_NDS32_TLS_LE_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_TLS_LE_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS entry for the symbol. */ + HOWTO (R_NDS32_TLS_IE_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_TLS_IE_LO12S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_LO12S2", /* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Mark a TLS IE entry in GOT. */ + HOWTO (R_NDS32_TLS_TPOFF, /* 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_NDS32_TLS_TPOFF", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* A 20 bit address. */ + HOWTO (R_NDS32_TLS_LE_20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_TLS_LE_15S0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S0", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_TLS_LE_15S1, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S1", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_TLS_LE_15S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S2", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for unconditional call sequence */ + HOWTO (R_NDS32_LONGCALL4, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_LONGCALL4", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional call sequence. */ + HOWTO (R_NDS32_LONGCALL5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_LONGCALL5", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional call sequence. */ + HOWTO (R_NDS32_LONGCALL6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_LONGCALL6", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for unconditional branch sequence. */ + HOWTO (R_NDS32_LONGJUMP4, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_LONGJUMP4", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO (R_NDS32_LONGJUMP5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_LONGJUMP5", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO (R_NDS32_LONGJUMP6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_LONGJUMP6", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relax hint for conditional branch sequence. */ + HOWTO (R_NDS32_LONGJUMP7, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_LONGJUMP7", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* Relocations used for relaxation. */ @@ -1956,6 +2248,45 @@ static reloc_howto_type nds32_elf_relax_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_TLS_LE_ADD, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_TLS_LE_ADD", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_TLS_LE_LS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_TLS_LE_LS", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO (R_NDS32_EMPTY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + nds32_elf_ignore_reloc, /* special_function */ + "R_NDS32_EMPTY", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; @@ -1967,7 +2298,7 @@ nds32_insertion_sort (void *base, size_t nmemb, size_t size, int (*compar) (const void *lhs, const void *rhs)) { char *ptr = (char *) base; - unsigned int i, j; + int i, j; char *tmp = alloca (size); /* If i is less than j, i is inserted before j. @@ -1977,14 +2308,16 @@ nds32_insertion_sort (void *base, size_t nmemb, size_t size, sorted unsorted */ - for (i = 1; i < nmemb; i++) + for (i = 1; i < (int) nmemb; i++) { - for (j = 0; j < i; j++) - if (compar (ptr + i * size, ptr + j * size) < 0) + for (j = (i - 1); j >= 0; j--) + if (compar (ptr + i * size, ptr + j * size) >= 0) break; + j++; + if (i == j) - continue; /* j is in order. */ + continue; /* i is in order. */ memcpy (tmp, ptr + i * size, size); memmove (ptr + (j + 1) * size, ptr + j * size, (i - j) * size); @@ -2065,7 +2398,8 @@ nds32_elf_9_pcrel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, static bfd_reloc_status_type nds32_elf_do_9_pcrel_reloc (bfd *abfd, reloc_howto_type *howto, asection *input_section, bfd_byte *data, - bfd_vma offset, asection *symbol_section ATTRIBUTE_UNUSED, + bfd_vma offset, + asection *symbol_section ATTRIBUTE_UNUSED, bfd_vma symbol_value, bfd_vma addend) { bfd_signed_vma relocation; @@ -2084,7 +2418,7 @@ nds32_elf_do_9_pcrel_reloc (bfd *abfd, reloc_howto_type *howto, before doing pcrel calculations. */ relocation -= (offset & -(bfd_vma) 2); - if (relocation < -0x100 || relocation > 0xff) + if (relocation < -ACCURATE_8BIT_S1 || relocation >= ACCURATE_8BIT_S1) status = bfd_reloc_overflow; else status = bfd_reloc_ok; @@ -2495,9 +2829,16 @@ static const struct nds32_reloc_map_entry nds32_reloc_map[] = {BFD_RELOC_NDS32_LONGCALL1, R_NDS32_LONGCALL1}, {BFD_RELOC_NDS32_LONGCALL2, R_NDS32_LONGCALL2}, {BFD_RELOC_NDS32_LONGCALL3, R_NDS32_LONGCALL3}, + {BFD_RELOC_NDS32_LONGCALL4, R_NDS32_LONGCALL4}, + {BFD_RELOC_NDS32_LONGCALL5, R_NDS32_LONGCALL5}, + {BFD_RELOC_NDS32_LONGCALL6, R_NDS32_LONGCALL6}, {BFD_RELOC_NDS32_LONGJUMP1, R_NDS32_LONGJUMP1}, {BFD_RELOC_NDS32_LONGJUMP2, R_NDS32_LONGJUMP2}, {BFD_RELOC_NDS32_LONGJUMP3, R_NDS32_LONGJUMP3}, + {BFD_RELOC_NDS32_LONGJUMP4, R_NDS32_LONGJUMP4}, + {BFD_RELOC_NDS32_LONGJUMP5, R_NDS32_LONGJUMP5}, + {BFD_RELOC_NDS32_LONGJUMP6, R_NDS32_LONGJUMP6}, + {BFD_RELOC_NDS32_LONGJUMP7, R_NDS32_LONGJUMP7}, {BFD_RELOC_NDS32_LOADSTORE, R_NDS32_LOADSTORE}, {BFD_RELOC_NDS32_9_FIXED, R_NDS32_9_FIXED_RELA}, {BFD_RELOC_NDS32_15_FIXED, R_NDS32_15_FIXED_RELA}, @@ -2538,6 +2879,7 @@ static const struct nds32_reloc_map_entry nds32_reloc_map[] = {BFD_RELOC_NDS32_RELAX_REGION_END, R_NDS32_RELAX_REGION_END}, {BFD_RELOC_NDS32_MINUEND, R_NDS32_MINUEND}, {BFD_RELOC_NDS32_SUBTRAHEND, R_NDS32_SUBTRAHEND}, + {BFD_RELOC_NDS32_EMPTY, R_NDS32_EMPTY}, {BFD_RELOC_NDS32_DIFF8, R_NDS32_DIFF8}, {BFD_RELOC_NDS32_DIFF16, R_NDS32_DIFF16}, @@ -2548,6 +2890,17 @@ static const struct nds32_reloc_map_entry nds32_reloc_map[] = {BFD_RELOC_NDS32_TRAN, R_NDS32_TRAN}, {BFD_RELOC_NDS32_17IFC_PCREL, R_NDS32_17IFC_PCREL_RELA}, {BFD_RELOC_NDS32_10IFCU_PCREL, R_NDS32_10IFCU_PCREL_RELA}, + {BFD_RELOC_NDS32_TLS_LE_HI20, R_NDS32_TLS_LE_HI20}, + {BFD_RELOC_NDS32_TLS_LE_LO12, R_NDS32_TLS_LE_LO12}, + {BFD_RELOC_NDS32_TLS_LE_ADD, R_NDS32_TLS_LE_ADD}, + {BFD_RELOC_NDS32_TLS_LE_LS, R_NDS32_TLS_LE_LS}, + {BFD_RELOC_NDS32_TLS_IE_HI20, R_NDS32_TLS_IE_HI20}, + {BFD_RELOC_NDS32_TLS_IE_LO12S2, R_NDS32_TLS_IE_LO12S2}, + {BFD_RELOC_NDS32_TLS_TPOFF, R_NDS32_TLS_TPOFF}, + {BFD_RELOC_NDS32_TLS_LE_20, R_NDS32_TLS_LE_20}, + {BFD_RELOC_NDS32_TLS_LE_15S0, R_NDS32_TLS_LE_15S0}, + {BFD_RELOC_NDS32_TLS_LE_15S1, R_NDS32_TLS_LE_15S1}, + {BFD_RELOC_NDS32_TLS_LE_15S2, R_NDS32_TLS_LE_15S2}, }; /* Patch tag. */ @@ -2612,7 +2965,11 @@ nds32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, enum elf_nds32_reloc_type r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (ELF32_R_TYPE (dst->r_info) <= R_NDS32_GNU_VTENTRY); + if (r_type > R_NDS32_GNU_VTENTRY) + { + _bfd_error_handler (_("%A: invalid NDS32 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type); } @@ -2802,7 +3159,7 @@ nds32_elf_add_symbol_hook (bfd *abfd, static asection *sda_rela_sec = NULL; -#define SDA_SECTION_NUM 11 +#define SDA_SECTION_NUM 10 static bfd_reloc_status_type nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, @@ -2811,6 +3168,7 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, int relax_fp_as_gp; struct elf_nds32_link_hash_table *table; struct bfd_link_hash_entry *h, *h2; + long unsigned int total = 0; h = bfd_link_hash_lookup (info->hash, "_SDA_BASE_", FALSE, FALSE, TRUE); if (!h || (h->type != bfd_link_hash_defined && h->type != bfd_link_hash_defweak)) @@ -2823,7 +3181,7 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, static const char sec_name[SDA_SECTION_NUM][10] = { ".data", ".got", ".sdata_d", ".sdata_w", ".sdata_h", ".sdata_b", - ".sbss_b", ".sbss_h", ".sbss_w", ".sbss_d", ".bss" + ".sbss_b", ".sbss_h", ".sbss_w", ".sbss_d" }; size_t i = 0; @@ -2834,24 +3192,49 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, } /* Get the first and final section. */ - while (i < sizeof (sec_name) / 10) + while (i < sizeof (sec_name) / sizeof (sec_name [0])) { temp = bfd_get_section_by_name (output_bfd, sec_name[i]); if (temp && !first && (temp->size != 0 || temp->rawsize != 0)) first = temp; if (temp && (temp->size != 0 || temp->rawsize != 0)) final = temp; + + /* Summarize the sections in order to check if joining .bss. */ + if (temp && temp->size != 0) + total += temp->size; + else if (temp && temp->rawsize != 0) + total += temp->rawsize; + i++; } + /* Check .bss size. */ + temp = bfd_get_section_by_name (output_bfd, ".bss"); + if (temp) + { + if (temp->size != 0) + total += temp->size; + else if (temp->rawsize != 0) + total += temp->rawsize; + + if (total < 0x80000) + { + if (!first && (temp->size != 0 || temp->rawsize != 0)) + first = temp; + if ((temp->size != 0 || temp->rawsize != 0)) + final = temp; + } + } + if (first && final) { /* The middle of data region. */ - sda_base = (final->vma + final->rawsize + first->vma) / 2; + sda_base = final->vma / 2 + final->rawsize / 2 + first->vma / 2; /* Find the section sda_base located. */ i = 0; - while (i < sizeof (sec_name) / 10) + while (i < sizeof (sec_name) / sizeof (sec_name [0])) { final = bfd_get_section_by_name (output_bfd, sec_name[i]); if (final && (final->size != 0 || final->rawsize != 0) @@ -2876,7 +3259,7 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, *psb = elf_gp (output_bfd); return bfd_reloc_ok; } - sda_base = first->vma; + sda_base = first->vma + first->rawsize; } sda_base -= first->vma; @@ -2963,6 +3346,7 @@ nds32_elf_link_hash_newfunc (struct bfd_hash_entry *entry, eh = (struct elf_nds32_link_hash_entry *) ret; eh->dyn_relocs = NULL; + eh->tls_type = GOT_UNKNOWN; } return (struct bfd_hash_entry *) ret; @@ -3453,6 +3837,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { asection *s; bfd_boolean dyn; + int tls_type = elf32_nds32_hash_entry (h)->tls_type; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -3463,9 +3848,15 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) } s = htab->sgot; - h->got.offset = s->size; - s->size += 4; + + if (tls_type == GOT_UNKNOWN) + abort (); + else if (tls_type == GOT_NORMAL + || tls_type == GOT_TLS_IE) + /* Need a GOT slot. */ + s->size += 4; + dyn = htab->root.dynamic_sections_created; if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)) htab->srelgot->size += sizeof (Elf32_External_Rela); @@ -3599,7 +3990,7 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -4060,6 +4451,15 @@ nds32_elf_output_symbol_hook (struct bfd_link_info *info, section, which means that the addend must be adjusted accordingly. */ +static bfd_vma +dtpoff_base (struct bfd_link_info *info) +{ + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) + return 0; + return elf_hash_table (info)->tls_sec->vma; +} + static bfd_boolean nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info * info, @@ -4113,6 +4513,15 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, return FALSE; } + if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON) + if (!nds32_elf_ifc_reloc ()) + (*_bfd_error_handler) (_("error: IFC relocation error.")); + + /* Relocation for .ex9.itable. */ + if (table->target_optimize & NDS32_RELAX_EX9_ON + || (table->ex9_import_file && table->update_ex9_table)) + nds32_elf_ex9_reloc_jmp (info); + /* Use gp as fp to prevent truncated fit. Because in relaxation time the fp value is set as gp, and it has be reverted for instruction setting fp. */ @@ -4153,7 +4562,8 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, || r_type == R_NDS32_RELA_GNU_VTINHERIT || (r_type >= R_NDS32_INSN16 && r_type <= R_NDS32_25_FIXED_RELA) || r_type == R_NDS32_DATA - || r_type == R_NDS32_TRAN) + || r_type == R_NDS32_TRAN + || (r_type >= R_NDS32_LONGCALL4 && r_type <= R_NDS32_LONGJUMP6)) continue; /* If we enter the fp-as-gp region. Resolve the address of best fp-base. */ @@ -4581,8 +4991,8 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, if (info->shared) { (*_bfd_error_handler) - (_("%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared mode."), - bfd_get_filename (input_bfd)); + (_("%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared " + "mode."), bfd_get_filename (input_bfd)); return FALSE; } break; @@ -4616,7 +5026,8 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, } else r = _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, offset, relocation, addend); + contents, offset, relocation, + addend); } goto check_reloc; @@ -4789,6 +5200,101 @@ handle_sda: /* do nothing */ break; + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: + case R_NDS32_TLS_LE_20: + case R_NDS32_TLS_LE_15S0: + case R_NDS32_TLS_LE_15S1: + case R_NDS32_TLS_LE_15S2: + if (elf_hash_table (info)->tls_sec != NULL) + relocation -= (elf_hash_table (info)->tls_sec->vma + TP_OFFSET); + break; + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + { + /* Relocation is to the entry for this symbol in the global + offset table. */ + unsigned int tls_type; + asection *srelgot; + Elf_Internal_Rela outrel; + bfd_vma off; + bfd_byte *loc; + int indx = 0; + + BFD_ASSERT (sgot != NULL); + if (h != NULL) + { + bfd_boolean dyn; + + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) - 1); + dyn = htab->root.dynamic_sections_created; + tls_type = ((struct elf_nds32_link_hash_entry *) h)->tls_type; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + && (!info->shared + || !SYMBOL_REFERENCES_LOCAL (info, h))) + indx = h->dynindx; + } + else + { + /* Never happen currently. */ + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) - 1); + + off = local_got_offsets[r_symndx]; + + tls_type = elf32_nds32_local_got_tls_type (input_bfd)[r_symndx]; + } + relocation = sgot->output_section->vma + sgot->output_offset + off; + + if (r_type == R_NDS32_TLS_IE_LO12S2) + break; + + /* The offset must always be a multiple of 4. We use + the least significant bit to record whether we have + already processed this entry. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_boolean need_relocs = FALSE; + srelgot = htab->srelgot; + if ((info->shared || indx != 0) + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) + { + need_relocs = TRUE; + BFD_ASSERT (srelgot != NULL); + } + if (tls_type & GOT_TLS_IE) + { + if (need_relocs) + { + if (h->dynindx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + + off); + outrel.r_info = + ELF32_R_INFO (h->dynindx, R_NDS32_TLS_TPOFF); + + loc = srelgot->contents; + loc += + srelgot->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + ++srelgot->reloc_count; + } + else + bfd_put_32 (output_bfd, h->root.u.def.value - TP_OFFSET, + sgot->contents + off); + } + } + } + break; + /* DON'T fall through. */ default: @@ -4855,8 +5361,16 @@ handle_sda: case R_NDS32_PLT_GOTREL_LO20: case R_NDS32_17IFC_PCREL_RELA: case R_NDS32_10IFCU_PCREL_RELA: + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_LE_20: + case R_NDS32_TLS_LE_15S0: + case R_NDS32_TLS_LE_15S1: + case R_NDS32_TLS_LE_15S2: /* Instruction related relocs must handle endian properly. */ - /* NOTE: PIC IS NOT HANDLE YET; DO IT LATER */ + /* NOTE: PIC IS NOT HANDLE YET; DO IT LATER. */ r = nds32_elf_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, @@ -5845,6 +6359,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, enum elf_nds32_reloc_type r_type; struct elf_link_hash_entry *h; unsigned long r_symndx; + int tls_type, old_tls_type; r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); @@ -5858,7 +6373,9 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, h = (struct elf_link_hash_entry *) h->root.u.i.link; } - /* Some relocs require a global offset table. */ + /* Some relocs require a global offset table. We create + got section here, since these relocation need got section + and it is not created yet. */ if (htab->sgot == NULL) { switch (r_type) @@ -5878,6 +6395,8 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_NDS32_GOTPC_HI20: case R_NDS32_GOTPC_LO12: case R_NDS32_GOT20: + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: if (dynobj == NULL) htab->root.dynobj = dynobj = abfd; if (!create_got_section (dynobj, info)) @@ -5896,8 +6415,23 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_NDS32_GOT_LO15: case R_NDS32_GOT_LO19: case R_NDS32_GOT20: + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + switch (r_type) + { + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + tls_type = GOT_TLS_IE; + break; + default: + tls_type = GOT_NORMAL; + break; + } if (h != NULL) - h->got.refcount += 1; + { + old_tls_type = elf32_nds32_hash_entry (h)->tls_type; + h->got.refcount += 1; + } else { bfd_signed_vma *local_got_refcounts; @@ -5917,9 +6451,24 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, elf_local_got_refcounts (abfd) = local_got_refcounts; } local_got_refcounts[r_symndx] += 1; + old_tls_type = elf32_nds32_local_got_tls_type (abfd)[r_symndx]; } - break; + /* We will already have issued an error message if there + is a TLS/non-TLS mismatch, based on the symbol + type. So just combine any TLS types needed. */ + if (old_tls_type != GOT_UNKNOWN && old_tls_type != GOT_NORMAL + && tls_type != GOT_NORMAL) + tls_type |= old_tls_type; + + if (old_tls_type != tls_type) + { + if (h != NULL) + elf32_nds32_hash_entry (h)->tls_type = tls_type; + else + elf32_nds32_local_got_tls_type (abfd)[r_symndx] = tls_type; + } + break; case R_NDS32_9_PLTREL: case R_NDS32_25_PLTREL: case R_NDS32_PLTREL_HI20: @@ -5944,6 +6493,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (h->forced_local) break; + elf32_nds32_hash_entry (h)->tls_type = GOT_NORMAL; h->needs_plt = 1; h->plt.refcount += 1; break; @@ -6602,7 +7152,8 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn) && N32_IMM15S (insn) > -32) { - insn16 = N16_TYPE45 (SUBI45, N32_RT54 (insn), 0 - N32_IMM15S (insn)); + insn16 = N16_TYPE45 (SUBI45, N32_RT54 (insn), + 0 - N32_IMM15S (insn)); insn_type = NDS32_INSN_SUBI45; } else if (mach >= MACH_V2 && N32_RT5 (insn) == REG_SP @@ -6727,7 +7278,8 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, else if (mach >= MACH_V2 && N32_IS_RT4 (insn) && N32_RA5 (insn) == REG_R8 && -32 <= N32_IMM15S (insn) && N32_IMM15S (insn) < 0) { - insn16 = N16_TYPE45 (LWI45_FE, N32_RT54 (insn), N32_IMM15S (insn) + 32); + insn16 = N16_TYPE45 (LWI45_FE, N32_RT54 (insn), + N32_IMM15S (insn) + 32); insn_type = NDS32_INSN_LWI45_FE; } break; @@ -6741,7 +7293,8 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, else if (N32_IS_RT3 (insn) && N32_IS_RA3 (insn) && IS_WITHIN_U (N32_IMM15S (insn), 3)) { - insn16 = N16_TYPE333 (SWI333, N32_RT5 (insn), N32_RA5 (insn), N32_IMM15S (insn)); + insn16 = N16_TYPE333 (SWI333, N32_RT5 (insn), N32_RA5 (insn), + N32_IMM15S (insn)); insn_type = NDS32_INSN_SWI333; } else if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_FP @@ -6863,7 +7416,8 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, insn16 = N16_TYPE38 (BEQZ38, N32_RT5 (insn), N32_IMM16S (insn)); insn_type = NDS32_INSN_BEQZ38; } - else if (N32_RT5 (insn) == REG_R15 && IS_WITHIN_S (N32_IMM16S (insn), 8)) + else if (N32_RT5 (insn) == REG_R15 + && IS_WITHIN_S (N32_IMM16S (insn), 8)) { insn16 = N16_TYPE8 (BEQZS8, N32_IMM16S (insn)); insn_type = NDS32_INSN_BEQZS8; @@ -6876,7 +7430,8 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, insn16 = N16_TYPE38 (BNEZ38, N32_RT5 (insn), N32_IMM16S (insn)); insn_type = NDS32_INSN_BNEZ38; } - else if (N32_RT5 (insn) == REG_R15 && IS_WITHIN_S (N32_IMM16S (insn), 8)) + else if (N32_RT5 (insn) == REG_R15 + && IS_WITHIN_S (N32_IMM16S (insn), 8)) { insn16 = N16_TYPE8 (BNEZS8, N32_IMM16S (insn)); insn_type = NDS32_INSN_BNEZS8; @@ -7026,71 +7581,88 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) switch (__GF (insn16, 9, 6)) { case 0x4: /* add45 */ - insn = N32_ALU1 (ADD, N16_RT4 (insn16), N16_RT4 (insn16), N16_RA5 (insn16)); + insn = N32_ALU1 (ADD, N16_RT4 (insn16), N16_RT4 (insn16), + N16_RA5 (insn16)); goto done; case 0x5: /* sub45 */ - insn = N32_ALU1 (SUB, N16_RT4 (insn16), N16_RT4 (insn16), N16_RA5 (insn16)); + insn = N32_ALU1 (SUB, N16_RT4 (insn16), N16_RT4 (insn16), + N16_RA5 (insn16)); goto done; case 0x6: /* addi45 */ - insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); + insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), + N16_IMM5U (insn16)); goto done; case 0x7: /* subi45 */ - insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), -N16_IMM5U (insn16)); + insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), + -N16_IMM5U (insn16)); goto done; case 0x8: /* srai45 */ - insn = N32_ALU1 (SRAI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); + insn = N32_ALU1 (SRAI, N16_RT4 (insn16), N16_RT4 (insn16), + N16_IMM5U (insn16)); goto done; case 0x9: /* srli45 */ - insn = N32_ALU1 (SRLI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); + insn = N32_ALU1 (SRLI, N16_RT4 (insn16), N16_RT4 (insn16), + N16_IMM5U (insn16)); goto done; - case 0xa: /* slli333 */ - insn = N32_ALU1 (SLLI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_ALU1 (SLLI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0xc: /* add333 */ - insn = N32_ALU1 (ADD, N16_RT3 (insn16), N16_RA3 (insn16), N16_RB3 (insn16)); + insn = N32_ALU1 (ADD, N16_RT3 (insn16), N16_RA3 (insn16), + N16_RB3 (insn16)); goto done; case 0xd: /* sub333 */ - insn = N32_ALU1 (SUB, N16_RT3 (insn16), N16_RA3 (insn16), N16_RB3 (insn16)); + insn = N32_ALU1 (SUB, N16_RT3 (insn16), N16_RA3 (insn16), + N16_RB3 (insn16)); goto done; case 0xe: /* addi333 */ - insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0xf: /* subi333 */ - insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), -N16_IMM3U (insn16)); + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), + -N16_IMM3U (insn16)); goto done; - case 0x10: /* lwi333 */ - insn = N32_TYPE2 (LWI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (LWI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0x12: /* lhi333 */ - insn = N32_TYPE2 (LHI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (LHI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0x13: /* lbi333 */ - insn = N32_TYPE2 (LBI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (LBI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0x11: /* lwi333.bi */ - insn = N32_TYPE2 (LWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (LWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0x14: /* swi333 */ - insn = N32_TYPE2 (SWI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (SWI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0x16: /* shi333 */ - insn = N32_TYPE2 (SHI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (SHI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0x17: /* sbi333 */ - insn = N32_TYPE2 (SBI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (SBI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; case 0x15: /* swi333.bi */ - insn = N32_TYPE2 (SWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); + insn = N32_TYPE2 (SWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), + N16_IMM3U (insn16)); goto done; - case 0x18: /* addri36.sp */ - insn = N32_TYPE2 (ADDI, REG_SP, N16_RT3 (insn16), N16_IMM6U (insn16) << 2); + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), REG_SP, + N16_IMM6U (insn16) << 2); goto done; - case 0x19: /* lwi45.fe */ - insn = N32_TYPE2 (LWI, N16_RT4 (insn16), REG_R8, (32 - N16_IMM5U (insn16)) << 2); + insn = N32_TYPE2 (LWI, N16_RT4 (insn16), REG_R8, + (N16_IMM5U (insn16) - 32)); goto done; case 0x1a: /* lwi450 */ insn = N32_TYPE2 (LWI, N16_RT4 (insn16), N16_RA5 (insn16), 0); @@ -7099,7 +7671,7 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) insn = N32_TYPE2 (SWI, N16_RT4 (insn16), N16_RA5 (insn16), 0); goto done; - /* These are r15 implied instructions. */ + /* These are r15 implied instructions. */ case 0x30: /* slts45 */ insn = N32_ALU1 (SLTS, REG_TA, N16_RT4 (insn16), N16_RA5 (insn16)); goto done; @@ -7132,30 +7704,35 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) goto done; case 0x3f: /* MISC33 */ - switch (insn & 0x7) + switch (insn16 & 0x7) { case 2: /* neg33 */ insn = N32_TYPE2 (SUBRI, N16_RT3 (insn16), N16_RA3 (insn16), 0); break; case 3: /* not33 */ - insn = N32_ALU1 (NOR, N16_RT3 (insn16), N16_RA3 (insn16), N16_RA3 (insn16)); + insn = N32_ALU1 (NOR, N16_RT3 (insn16), N16_RA3 (insn16), + N16_RA3 (insn16)); break; case 4: /* mul33 */ - insn = N32_ALU2 (MUL, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + insn = N32_ALU2 (MUL, N16_RT3 (insn16), N16_RT3 (insn16), + N16_RA3 (insn16)); break; case 5: /* xor33 */ - insn = N32_ALU1 (XOR, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + insn = N32_ALU1 (XOR, N16_RT3 (insn16), N16_RT3 (insn16), + N16_RA3 (insn16)); break; case 6: /* and33 */ - insn = N32_ALU1 (AND, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + insn = N32_ALU1 (AND, N16_RT3 (insn16), N16_RT3 (insn16), + N16_RA3 (insn16)); break; case 7: /* or33 */ - insn = N32_ALU1 (OR, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); + insn = N32_ALU1 (OR, N16_RT3 (insn16), N16_RT3 (insn16), + N16_RA3 (insn16)); break; } goto done; - case 0xb: /* ... */ + case 0xb: switch (insn16 & 0x7) { case 0: /* zeb33 */ @@ -7178,11 +7755,11 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) break; case 6: /* bmski33 */ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16), - 1 << N16_IMM3U (insn16)); + 1 << __GF (insn16, 3, 3)); break; case 7: /* fexti33 */ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16), - (1 << (N16_IMM3U (insn16) + 1)) - 1); + (1 << (__GF (insn16, 3, 3) + 1)) - 1); break; } goto done; @@ -7193,9 +7770,9 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) case 0x0: /* mov55 or ifret16 */ if (mach >= MACH_V3 && N16_RT5 (insn16) == REG_SP && N16_RT5 (insn16) == N16_RA5 (insn16)) - insn = N32_JREG (JR, 0, 0, 0, 3); + insn = N32_JREG (JR, 0, 0, 0, 3); else - insn = N32_TYPE2 (ADDI, N16_RT5 (insn16), N16_RA5 (insn16), 0); + insn = N32_TYPE2 (ADDI, N16_RT5 (insn16), N16_RA5 (insn16), 0); goto done; case 0x1: /* movi55 */ insn = N32_TYPE1 (MOVI, N16_RT5 (insn16), N16_IMM5S (insn16)); @@ -7582,7 +8159,7 @@ is_convert_32_to_16 (bfd *abfd, asection *sec, /* Find the first relocation of the same relocation-type, so we iteratie them forward. */ pc_rel = reloc; - while ((pc_rel - 1) > internal_relocs && pc_rel[-1].r_offset == offset) + while ((pc_rel - 1) >= internal_relocs && pc_rel[-1].r_offset == offset) pc_rel--; for (; pc_rel < irelend && pc_rel->r_offset == offset; pc_rel++) @@ -7594,19 +8171,29 @@ is_convert_32_to_16 (bfd *abfd, asection *sec, { off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr, &pic_ext_target); - if (off > 0xff || off < -0x100 || off == 0) + if (off >= ACCURATE_8BIT_S1 || off < -ACCURATE_8BIT_S1 + || off == 0) return FALSE; break; } else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_20_RELA) { /* movi => movi55 */ - mem_addr = calculate_memory_address (abfd, pc_rel, isymbuf, symtab_hdr); - /* mem_addr is unsigned, but the value should be between [-16, 15]. */ + mem_addr = calculate_memory_address (abfd, pc_rel, isymbuf, + symtab_hdr); + /* mem_addr is unsigned, but the value should + be between [-16, 15]. */ if ((mem_addr + 0x10) >> 5) return FALSE; break; } + else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_TLS_LE_20) + || (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_TLS_LE_LO12)) + { + /* It never happen movi to movi55 for R_NDS32_TLS_LE_20, + because it can be relaxed to addi for TLS_LE_ADD. */ + return FALSE; + } else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA15S2_RELA || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA17S2_RELA) && (reloc->r_addend & R_NDS32_INSN16_FP7U2_FLAG) @@ -7624,9 +8211,18 @@ is_convert_32_to_16 (bfd *abfd, asection *sec, || ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_LOADSTORE) && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_DWARF2_OP1_RELA))) { - /* Prevent unresolved addi instruction translate to addi45 or addi333. */ + /* Prevent unresolved addi instruction translate + to addi45 or addi333. */ return FALSE; } + else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17IFC_PCREL_RELA)) + { + off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr, + &pic_ext_target); + if (off >= ACCURATE_U9BIT_S1 || off <= 0) + return FALSE; + break; + } } return TRUE; @@ -7669,6 +8265,9 @@ nds32_elf_write_16 (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *contents, || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_SDA17S2_RELA) pc_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_SDA_FP7U2_RELA); + else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17IFC_PCREL_RELA)) + pc_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (pc_rel->r_info), R_NDS32_10IFCU_PCREL_RELA); } } @@ -7695,7 +8294,7 @@ find_relocs_at_address (Elf_Internal_Rela *reloc, if (ELF32_R_TYPE (rel_t->r_info) == reloc_type) return rel_t; - /* We didn't find it backward. Try find it forward. */ + /* We didn't find it backward. Try find it forward. */ for (rel_t = reloc; rel_t < irelend && rel_t->r_offset == reloc->r_offset; rel_t++) @@ -7985,7 +8584,7 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, nds32_elf_blank_t *blank_p) { Elf_Internal_Shdr *symtab_hdr; /* Symbol table header of this bfd. */ - Elf_Internal_Sym *isym = NULL; /* Symbol table of this bfd. */ + Elf_Internal_Sym *isym = NULL; /* Symbol table of this bfd. */ Elf_Internal_Sym *isymend; /* Symbol entry iterator. */ unsigned int sec_shndx; /* The section the be relaxed. */ bfd_byte *contents; /* Contents data of iterating section. */ @@ -8066,18 +8665,28 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, && isym[ELF32_R_SYM (irel->r_info)].st_shndx == sec_shndx) { unsigned long val = 0; - unsigned long before, between; + unsigned long mask; + long before, between; + long offset; switch (ELF32_R_TYPE (irel->r_info)) { case R_NDS32_DIFF8: - val = bfd_get_8 (abfd, contents + irel->r_offset); + offset = bfd_get_8 (abfd, contents + irel->r_offset); break; case R_NDS32_DIFF16: - val = bfd_get_16 (abfd, contents + irel->r_offset); + offset = bfd_get_16 (abfd, contents + irel->r_offset); break; case R_NDS32_DIFF32: val = bfd_get_32 (abfd, contents + irel->r_offset); + /* Get the signed bit and mask for the high part. The + gcc will alarm when right shift 32-bit since the + type size of long may be 32-bit. */ + mask = 0 - (val >> 31); + if (mask) + offset = (val | (mask - 0xffffffff)); + else + offset = val; break; default: BFD_ASSERT (0); @@ -8090,23 +8699,28 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, -- before ---| ***************** --------------------- between ---| - We only care how much data are relax between DIFF, marked as ***. */ + We only care how much data are relax between DIFF, + marked as ***. */ before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0); - between = get_nds32_elf_blank_total (&blank_t, irel->r_addend + val, 0); + between = get_nds32_elf_blank_total (&blank_t, + irel->r_addend + offset, 0); if (between == before) goto done_adjust_diff; switch (ELF32_R_TYPE (irel->r_info)) { case R_NDS32_DIFF8: - bfd_put_8 (abfd, val - (between - before), contents + irel->r_offset); + bfd_put_8 (abfd, offset - (between - before), + contents + irel->r_offset); break; case R_NDS32_DIFF16: - bfd_put_16 (abfd, val - (between - before), contents + irel->r_offset); + bfd_put_16 (abfd, offset - (between - before), + contents + irel->r_offset); break; case R_NDS32_DIFF32: - bfd_put_32 (abfd, val - (between - before), contents + irel->r_offset); + bfd_put_32 (abfd, offset - (between - before), + contents + irel->r_offset); break; } } @@ -8118,10 +8732,12 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, unsigned long before, between; bfd_byte *endp, *p; - val = read_unsigned_leb128 (abfd, contents + irel->r_offset, &len); + val = read_unsigned_leb128 (abfd, contents + irel->r_offset, + &len); before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0); - between = get_nds32_elf_blank_total (&blank_t, irel->r_addend + val, 0); + between = get_nds32_elf_blank_total (&blank_t, + irel->r_addend + val, 0); if (between == before) goto done_adjust_diff; @@ -8138,14 +8754,17 @@ done_adjust_diff: if (sec == sect) { raddr = irel->r_offset; - irel->r_offset -= get_nds32_elf_blank_total (&blank_t2, irel->r_offset, 1); + irel->r_offset -= get_nds32_elf_blank_total (&blank_t2, + irel->r_offset, 1); if (ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE) continue; if (blank_t2 && blank_t2->next - && (blank_t2->offset > raddr || blank_t2->next->offset <= raddr)) - (*_bfd_error_handler) (_("%B: %s\n"), abfd, - "Error: search_nds32_elf_blank reports wrong node"); + && (blank_t2->offset > raddr + || blank_t2->next->offset <= raddr)) + (*_bfd_error_handler) + (_("%B: %s\n"), abfd, + "Error: search_nds32_elf_blank reports wrong node"); /* Mark reloc in deleted portion as NONE. For some relocs like R_NDS32_LABEL that doesn't modify the @@ -8197,9 +8816,11 @@ done_adjust_diff: isym->st_value -= ahead; /* Adjust function size. */ - if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC && isym->st_size > 0) - isym->st_size -= get_nds32_elf_blank_total - (&blank_t, orig_addr + isym->st_size, 0) - ahead; + if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC + && isym->st_size > 0) + isym->st_size -= + get_nds32_elf_blank_total + (&blank_t, orig_addr + isym->st_size, 0) - ahead; } } } @@ -8228,8 +8849,9 @@ done_adjust_diff: /* Adjust function size. */ if (sym_hash->type == STT_FUNC) - sym_hash->size -= get_nds32_elf_blank_total - (&blank_t, orig_addr + sym_hash->size, 0) - ahead; + sym_hash->size -= + get_nds32_elf_blank_total + (&blank_t, orig_addr + sym_hash->size, 0) - ahead; } } @@ -8323,8 +8945,9 @@ nds32_get_local_syms (bfd *abfd, asection *sec ATTRIBUTE_UNUSED, } /* Range of small data. */ -static bfd_vma sdata_range[5][2]; -static bfd_vma const sdata_init_range[5] = { 0x2000, 0x4000, 0x8000, 0x10000, 0x40000 }; +static bfd_vma sdata_range[2][2]; +static bfd_vma const sdata_init_range[2] = +{ ACCURATE_12BIT_S1, ACCURATE_19BIT }; static int nds32_elf_insn_size (bfd *abfd ATTRIBUTE_UNUSED, @@ -8348,9 +8971,9 @@ relax_range_measurement (bfd *abfd) /* For upper bound. */ bfd_vma maxpgsz = get_elf_backend_data (abfd)->maxpagesize; bfd_vma align; - bfd_vma init_range; static int decide_relax_range = 0; int i; + int range_number = sizeof (sdata_init_range) / sizeof (sdata_init_range[0]); if (decide_relax_range) return; @@ -8359,7 +8982,7 @@ relax_range_measurement (bfd *abfd) if (sda_rela_sec == NULL) { /* Since there is no data sections, we assume the range is page size. */ - for (i = 0; i < 5; i++) + for (i = 0; i < range_number; i++) { sdata_range[i][0] = sdata_init_range[i] - 0x1000; sdata_range[i][1] = sdata_init_range[i] - 0x1000; @@ -8380,12 +9003,11 @@ relax_range_measurement (bfd *abfd) /* I guess we can not determine the section before gp located section, so we assume the align is max page size. */ - for (i = 0; i < 5; i++) + for (i = 0; i < range_number; i++) { - init_range = sdata_init_range[i]; - sdata_range[i][1] = init_range - align; + sdata_range[i][1] = sdata_init_range[i] - align; BFD_ASSERT (sdata_range[i][1] <= sdata_init_range[i]); - sdata_range[i][0] = init_range - maxpgsz; + sdata_range[i][0] = sdata_init_range[i] - maxpgsz; BFD_ASSERT (sdata_range[i][0] <= sdata_init_range[i]); } } @@ -8397,2561 +9019,3284 @@ relax_range_measurement (bfd *abfd) #define IS_OPTIMIZE(addend) ((addend) & 0x40000000) #define IS_16BIT_ON(addend) ((addend) & 0x20000000) +/* Relax LONGCALL1 relocation for nds32_elf_relax_section. */ + static bfd_boolean -nds32_elf_relax_section (bfd *abfd, asection *sec, - struct bfd_link_info *link_info, bfd_boolean *again) -{ - nds32_elf_blank_t *relax_blank_list = NULL; - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *irel; - Elf_Internal_Rela *irelend; - Elf_Internal_Sym *isymbuf = NULL; - bfd_byte *contents = NULL; - bfd_boolean result = TRUE; - int optimize = 0; - int optimize_for_space ATTRIBUTE_UNUSED = 0; - int optimize_for_space_no_align ATTRIBUTE_UNUSED = 0; - int insn_opt = 0; - int i; +nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGCALL1 + case 4-4-2; 16-bit on, optimize off or optimize for space + sethi ta, hi20(symbol) ; LONGCALL1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral5 ta ; + + case 4-4-4; 16-bit off, optimize don't care + sethi ta, hi20(symbol) ; LONGCALL1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + + case 4-4-4; 16-bit on, optimize for speed + sethi ta, hi20(symbol) ; LONGCALL1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + Check code for -mlong-calls output. */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ uint32_t insn; + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; uint16_t insn16; - bfd_vma local_sda; - - /* Target dependnet option. */ - struct elf_nds32_link_hash_table *table; - int load_store_relax; - int relax_round; - relax_blank_list = NULL; - - *again = FALSE; + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; - /* Nothing to do for - * relocatable link or - * non-relocatable section or - * non-code section or - * empty content or - * no reloc entry. */ - if (link_info->relocatable - || (sec->flags & SEC_RELOC) == 0 - || (sec->flags & SEC_EXCLUDE) == 1 - || (sec->flags & SEC_CODE) == 0 - || sec->size == 0) - return TRUE; + hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); + lo_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, + laddr + 4); - /* 09.12.11 Workaround. */ - /* We have to adjust align for R_NDS32_LABEL if needed. - The adjust approach only can fix 2-byte align once. */ - if (sec->alignment_power > 2) + if (hi_irelfn == irelend || lo_irelfn == irelend) { (*_bfd_error_handler) - (_("%B(%A): warning: relax is suppressed for sections " - "of alignment %d-bytes > 4-byte."), - abfd, sec, sec->alignment_power); - return TRUE; + ("%B: warning: R_NDS32_LONGCALL1 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; } - /* The optimization type to do. */ + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, + &pic_ext_target); - table = nds32_elf_hash_table (link_info); - relax_round = table->relax_round; - switch (relax_round) - { - case NDS32_RELAX_JUMP_IFC_ROUND: - /* Here is the entrance of ifc jump relaxation. */ - if (!nds32_elf_ifc_calc (link_info, abfd, sec)) - return FALSE; - return TRUE; + /* This condition only happened when symbol is undefined. */ + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; - case NDS32_RELAX_EX9_BUILD_ROUND: - /* Here is the entrance of ex9 relaxation. There are two pass of - ex9 relaxation. The one is to traverse all instructions and build - the hash table. The other one is to compare instructions and replace - it by ex9.it. */ - if (!nds32_elf_ex9_build_hash_table (abfd, sec, link_info)) - return FALSE; - return TRUE; + /* Relax to: jal symbol; 25_PCREL */ + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Replace the long call with a jal. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_25_PCREL_RELA); + irel->r_addend = hi_irelfn->r_addend; + + /* We don't resolve this here but resolve it in relocate_section. */ + insn = INSN_JAL; + bfd_putb32 (insn, contents + irel->r_offset); + + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); + *insn_len = 4; + + if (seq_len & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + return TRUE; +} - case NDS32_RELAX_EX9_REPLACE_ROUND: - if (!nds32_elf_ex9_replace_instruction (link_info, abfd, sec)) - return FALSE; - return TRUE; +#define CONVERT_CONDITION_CALL(insn) (((insn) & 0xffff0000) ^ 0x90000) +/* Relax LONGCALL2 relocation for nds32_elf_relax_section. */ - default: - if (sec->reloc_count == 0) - return TRUE; - break; - } +static bfd_boolean +nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* bltz rt, .L1 ; LONGCALL2 + jal symbol ; 25_PCREL + .L1: */ - /* The begining of general relaxation. */ + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ - if (is_SDA_BASE_set == 0) - { - bfd_vma gp; - is_SDA_BASE_set = 1; - nds32_elf_final_sda_base (sec->output_section->owner, link_info, &gp, FALSE); - relax_range_measurement (abfd); - } + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *i1_irelfn, *cond_irelfn, *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; - if (is_ITB_BASE_set == 0) + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + i1_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_25_PCREL_RELA, laddr + 4); + + if (i1_irelfn == irelend) { - /* Set the _ITB_BASE_. */ - if (!nds32_elf_ex9_itb_base (link_info)) - { - (*_bfd_error_handler) (_("%B: error: Cannot set _ITB_BASE_"), abfd); - bfd_set_error (bfd_error_bad_value); - } + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL2 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; } - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - /* Relocations MUST be kept in memory, because relaxation adjust them. */ - internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, - TRUE /* keep_memory */); - if (internal_relocs == NULL) - goto error_return; + insn = bfd_getb32 (contents + laddr); - irelend = internal_relocs + sec->reloc_count; - irel = - find_relocs_at_address (internal_relocs, internal_relocs, irelend, - R_NDS32_RELAX_ENTRY); - /* If 31th bit of addend of R_NDS32_RELAX_ENTRY is set, - this section is already relaxed. */ - if (irel == irelend) - return TRUE; + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, i1_irelfn, isymbuf, symtab_hdr, + &pic_ext_target); - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY) - { - if (irel->r_addend & R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG) - return TRUE; + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; - if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG) - optimize = 1; + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ + + /* Convert to complimentary conditional call. */ + insn = CONVERT_CONDITION_CALL (insn); + + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ + + /* Clean unnessary relocations. */ + i1_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), R_NDS32_NONE); + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + if (cond_irelfn != irelend) + cond_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), R_NDS32_NONE); + + /* Replace the long call with a bgezal. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), + R_NDS32_17_PCREL_RELA); + irel->r_addend = i1_irelfn->r_addend; + + bfd_putb32 (insn, contents + irel->r_offset); + + *insn_len = 4; + return TRUE; +} - if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FOR_SPACE_FLAG) - optimize_for_space = 1; +/* Relax LONGCALL3 relocation for nds32_elf_relax_section. */ + +static bfd_boolean +nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGCALL3 + case 4-4-4-2; 16-bit on, optimize off or optimize for space + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral5 ta ; + $1 + + case 4-4-4-4; 16-bit off, optimize don't care + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + $1 + + case 4-4-4-4; 16-bit on, optimize for speed + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jral ta ; + $1 */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + uint32_t insn; + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; + uint16_t insn16; + + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + + hi_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr + 4); + lo_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, laddr + 8); + + if (hi_irelfn == irelend || lo_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL3 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; } - relax_active = 1; - load_store_relax = table->load_store_relax; + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, + &pic_ext_target); - /* Get symbol table and section content. */ - if (!nds32_get_section_contents (abfd, sec, &contents) - || !nds32_get_local_syms (abfd, sec, &isymbuf)) - goto error_return; + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; - /* Do relax loop only when finalize is not done. - Take care of relaxable relocs except INSN16. */ - for (irel = internal_relocs; irel < irelend; irel++) + insn = bfd_getb32 (contents + laddr); + if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) { - bfd_vma laddr; - unsigned long comp_insn = 0; - unsigned short comp_insn16 = 0; - unsigned long i_mask = 0xffffffff; - int seq_len; /* Original length of instruction sequence. */ - int insn_len = 0; /* Final length of instruction sequence. */ - int convertible; /* 1st insn convertible. */ - int insn16_on; /* 16-bit on/off. */ - Elf_Internal_Rela *hi_irelfn = NULL; - Elf_Internal_Rela *lo_irelfn = NULL; - Elf_Internal_Rela *i1_irelfn = NULL; - Elf_Internal_Rela *i2_irelfn = NULL; - Elf_Internal_Rela *cond_irelfn = NULL; - int i1_offset = 0; - int i2_offset = 0; - bfd_signed_vma foff; - unsigned long reloc = R_NDS32_NONE; - int hi_off; - int insn_off; - int pic_ext_target = 0; - bfd_vma access_addr = 0; - bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */ + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ - insn = 0; - insn16 = 0; - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL - && (irel->r_addend & 0x1f) >= 2) - optimize = 1; + /* Convert to complimentary conditional call. */ + insn = CONVERT_CONDITION_CALL (insn); + bfd_putb32 (insn, contents + irel->r_offset); - /* Relocation Types - R_NDS32_LONGCALL1 53 - R_NDS32_LONGCALL2 54 - R_NDS32_LONGCALL3 55 - R_NDS32_LONGJUMP1 56 - R_NDS32_LONGJUMP2 57 - R_NDS32_LONGJUMP3 58 - R_NDS32_LOADSTORE 59 */ - if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL1 - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LOADSTORE) + *insn_len = 4; + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); + + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + if (cond_irelfn != irelend) { - seq_len = GET_SEQ_LEN (irel->r_addend); - insn_opt = IS_OPTIMIZE (irel->r_addend); - convertible = IS_1ST_CONVERT (irel->r_addend); - insn16_on = IS_16BIT_ON (irel->r_addend); - laddr = irel->r_offset; + cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_17_PCREL_RELA); + cond_irelfn->r_addend = hi_irelfn->r_addend; } - /* Relocation Types - R_NDS32_LO12S0_RELA 30 - R_NDS32_LO12S1_RELA 29 - R_NDS32_LO12S2_RELA 28 - R_NDS32_LO12S2_SP_RELA 71 - R_NDS32_LO12S2_DP_RELA 70 - R_NDS32_GOT_LO12 46 - R_NDS32_GOTOFF_LO12 50 - R_NDS32_PLTREL_LO12 65 - R_NDS32_PLT_GOTREL_LO12 67 - R_NDS32_GOT_SUFF 193 - R_NDS32_GOTOFF_SUFF 194 - R_NDS32_PLT_GOT_SUFF 195 - R_NDS32_MULCALL_SUFF 196 - R_NDS32_PTR 197 */ - else if ((ELF32_R_TYPE (irel->r_info) <= R_NDS32_LO12S0_RELA - && ELF32_R_TYPE (irel->r_info) >= R_NDS32_LO12S2_RELA) - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_SP_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_DP_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12 - || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12 - || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLTREL_LO12 - || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12 - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_GOT_SUFF - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_PTR) - || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLTBLOCK - || ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA) + + if (seq_len & 0x2) { - seq_len = 0; - insn_opt = IS_OPTIMIZE (irel->r_addend) > 0; - convertible = 0; - insn16_on = 0; - laddr = irel->r_offset; + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_INSN16); + hi_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + insn_len += 2; } - else - continue; + } + else if (foff >= -CONSERVATIVE_24BIT_S1 && foff < CONSERVATIVE_24BIT_S1) + { + /* Relax to the following instruction sequence + bltz rt, $1 ; LONGCALL2 + jal symbol ; 25_PCREL + $1 */ + *insn_len = 8; + insn = INSN_JAL; + bfd_putb32 (insn, contents + hi_irelfn->r_offset); - insn_len = seq_len; + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_25_PCREL_RELA); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGCALL2); + + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - if (laddr + seq_len > (bfd_vma) sec->size) + if (seq_len & 0x2) { - char *s = NULL; - int pass_check = 0; + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + insn_len += 2; + } + } + return TRUE; +} - if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL1 - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LONGJUMP3) - { - for (i1_irelfn = irel; - i1_irelfn < irelend && i1_irelfn->r_offset < (laddr + seq_len - 4); - i1_irelfn++) - ; - - for (; - i1_irelfn < irelend && i1_irelfn->r_offset == (laddr + seq_len - 4); - i1_irelfn++) - if (ELF32_R_TYPE (i1_irelfn->r_info) == R_NDS32_INSN16) - { - pass_check = 1; - break; - } - i1_irelfn = NULL; - } +/* Relax LONGJUMP1 relocation for nds32_elf_relax_section. */ - if (pass_check == 0) - { - reloc_howto_type *howto = - bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE - (irel->r_info)); - s = howto->name; +static bfd_boolean +nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGJUMP1 + case 4-4-2; 16-bit bit on, optimize off or optimize for space + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + + case 4-4-4; 16-bit off, optimize don't care + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; + + case 4-4-4; 16-bit on, optimize for speed + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + int insn16_on; /* 16-bit on/off. */ + uint32_t insn; + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; + uint16_t insn16; + unsigned long reloc; - (*_bfd_error_handler) - ("%B: warning: %s points to unrecognized insns at 0x%lx.", - abfd, s, (long) irel->r_offset); + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + insn16_on = IS_16BIT_ON (irel->r_addend); + + hi_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); + lo_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, laddr + 4); + if (hi_irelfn == irelend || lo_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP1 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - continue; - } - } + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, + &pic_ext_target); - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LONGCALL1) - { - /* There are 3 variations for LONGCALL1 - case 4-4-2; 16-bit on, optimize off or optimize for space - sethi ta, hi20(symbol) ; LONGCALL1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jral5 ta ; - - case 4-4-4; 16-bit off, optimize don't care - sethi ta, hi20(symbol) ; LONGCALL1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; - - case 4-4-4; 16-bit on, optimize for speed - sethi ta, hi20(symbol) ; LONGCALL1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; (INSN16) - Check code for -mlong-calls output. */ - - /* Get the reloc for the address from which the register is - being loaded. This reloc will tell us which function is - actually being called. */ - hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_HI20_RELA, laddr); - lo_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_LO12S0_ORI_RELA, - laddr + 4); - i1_offset = 8; - - if (hi_irelfn == irelend || lo_irelfn == irelend) - { - hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_20_RELA, laddr); - i1_offset = 4; - if (hi_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_LONGCALL1 points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); - continue; - } - } + if (pic_ext_target || foff == 0 || foff >= CONSERVATIVE_24BIT_S1 + || foff < -CONSERVATIVE_24BIT_S1) + return FALSE; - i1_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_INSN16, - laddr + i1_offset); + if (insn16_on && foff >= -ACCURATE_8BIT_S1 + && foff < ACCURATE_8BIT_S1 && (seq_len & 0x2)) + { + /* j8 label */ + /* 16-bit on, but not optimized for speed. */ + reloc = R_NDS32_9_PCREL_RELA; + insn16 = INSN_J8; + bfd_putb16 (insn16, contents + irel->r_offset); + *insn_len = 2; + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + } + else + { + /* j label */ + reloc = R_NDS32_25_PCREL_RELA; + insn = INSN_J; + bfd_putb32 (insn, contents + irel->r_offset); + *insn_len = 4; + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_INSN16); + irel->r_addend = 0; + } - /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - /* This condition only happened when symbol is undefined. */ - if (pic_ext_target || foff == 0) - continue; - if (foff < -0x1000000 || foff >= 0x1000000) + if ((seq_len & 0x2) && ((*insn_len & 2) == 0)) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), + R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + return TRUE; +} + +/* Revert condition branch. This function does not check if the input + instruction is condition branch or not. */ + +static void +nds32_elf_convert_branch (uint16_t insn16, uint32_t insn, + uint16_t *re_insn16, uint32_t *re_insn) +{ + uint32_t comp_insn = 0; + uint16_t comp_insn16 = 0; + + if (insn) + { + if (N32_OP6 (insn) == N32_OP6_BR1) + { + /* beqs label. */ + comp_insn = (insn ^ 0x4000) & 0xffffc000; + if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5) { - continue; + /* Insn can be contracted to 16-bit implied r5. */ + comp_insn16 = + (comp_insn & 0x4000) ? INSN_BNES38 : INSN_BEQS38; + comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; } - - /* Relax to - jal symbol ; 25_PCREL */ - /* For simplicity of coding, we are going to modify the section - contents, the section relocs, and the BFD symbol table. We - must tell the rest of the code not to free up this - information. It would be possible to instead create a table - of changes which have to be made, as is done in coff-mips.c; - that would be more work, but would require less memory when - the linker is run. */ - - /* Replace the long call with a jal. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_25_PCREL_RELA); - irel->r_addend = hi_irelfn->r_addend; - - /* We don't resolve this here but resolve it in relocate_section. */ - insn = INSN_JAL; - - bfd_putb32 (insn, contents + irel->r_offset); - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - insn_len = 4; - if (i1_irelfn != irelend) + } + else if (N32_OP6 (insn) == N32_OP6_BR3) + { + /* bnec $ta, imm11, label. */ + comp_insn = (insn ^ 0x80000) & 0xffffff00; + } + else + { + comp_insn = (insn ^ 0x10000) & 0xffffc000; + if (N32_BR2_SUB (insn) == N32_BR2_BEQZ + || N32_BR2_SUB (insn) == N32_BR2_BNEZ) { - if (!insn_opt - && (i1_irelfn->r_addend & R_NDS32_INSN16_CONVERT_FLAG)) + if (N32_IS_RT3 (insn)) { - /* The instruction pointed by R_NDS32_INSN16 is already - turned into 16-bit instruction, so the total length of - this sequence is decreased by 2. */ - seq_len = seq_len - 2; + /* Insn can be contracted to 16-bit. */ + comp_insn16 = + (comp_insn & 0x10000) ? INSN_BNEZ38 : INSN_BEQZ38; + comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; + } + else if (N32_RT5 (insn) == REG_R15) + { + /* Insn can be contracted to 16-bit. */ + comp_insn16 = + (comp_insn & 0x10000) ? INSN_BNES38 : INSN_BEQS38; } - i1_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), R_NDS32_NONE); - } - if (seq_len & 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), - R_NDS32_INSN16); - lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - insn_len += 2; } } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LONGCALL2) + } + else + { + switch ((insn16 & 0xf000) >> 12) { - /* bltz rt, $1 ; LONGCALL2 - jal symbol ; 25_FIXED - $1: */ - /* Get the reloc for the address from which the register is - being loaded. This reloc will tell us which function is - actually being called. */ - i1_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_25_PCREL_RELA, laddr + 4); + case 0xc: + /* beqz38 or bnez38 */ + comp_insn16 = (insn16 ^ 0x0800) & 0xff00; + comp_insn = (comp_insn16 & 0x0800) ? INSN_BNEZ : INSN_BEQZ; + comp_insn |= ((comp_insn16 & 0x0700) >> 8) << 20; + break; - if (i1_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_LONGCALL2 points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); + case 0xd: + /* beqs38 or bnes38 */ + comp_insn16 = (insn16 ^ 0x0800) & 0xff00; + comp_insn = (comp_insn16 & 0x0800) ? INSN_BNE : INSN_BEQ; + comp_insn |= (((comp_insn16 & 0x0700) >> 8) << 20) + | (REG_R5 << 15); + break; - continue; - } + case 0xe: + /* beqzS8 or bnezS8 */ + comp_insn16 = (insn16 ^ 0x0100) & 0xff00; + comp_insn = (comp_insn16 & 0x0100) ? INSN_BNEZ : INSN_BEQZ; + comp_insn |= REG_R15 << 20; + break; - insn = bfd_getb32 (contents + laddr); + default: + break; + } + } + if (comp_insn && re_insn) + *re_insn = comp_insn; + if (comp_insn16 && re_insn16) + *re_insn16 = comp_insn16; +} - /* Get the value of the symbol referred to by the reloc. */ - foff = - calculate_offset (abfd, sec, i1_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); - if (foff == 0) - continue; - if (foff < -0x10000 - 4 || foff >= 0x10000 - 4) - /* After all that work, we can't shorten this function call. */ - continue; +/* Relax LONGJUMP2 relocation for nds32_elf_relax_section. */ - /* Relax to bgezal rt, label ; 17_PCREL - or bltzal rt, label ; 17_PCREL */ +static bfd_boolean +nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 3 variations for LONGJUMP2 + case 2-4; 1st insn convertible, 16-bit on, + optimize off or optimize for space + bnes38 rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1: + + case 4-4; 1st insn not convertible + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1: + + case 4-4; 1st insn convertible, 16-bit on, optimize for speed + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1: */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + Elf_Internal_Rela *i2_irelfn, *cond_irelfn, *irelend; + int pic_ext_target = 0, first_size; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc, cond_reloc; - /* Convert to complimentary conditional call. */ - insn &= 0xffff0000; - insn ^= 0x90000; + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA }; - /* For simplicity of coding, we are going to modify the section - contents, the section relocs, and the BFD symbol table. We - must tell the rest of the code not to free up this - information. It would be possible to instead create a table - of changes which have to be made, as is done in coff-mips.c; - that would be more work, but would require less memory when - the linker is run. */ + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; + first_size = (seq_len == 6) ? 2 : 4; + + i2_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, + irelend, R_NDS32_25_PCREL_RELA, + laddr + first_size); + + for (i = 0; i < sizeof (checked_types) / sizeof(checked_types[0]); i++) + { + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irelfn != irelend) + break; + } - /* Replace the long call with a bgezal. */ - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), - R_NDS32_17_PCREL_RELA); + if (i2_irelfn == irelend || cond_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP2 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - bfd_putb32 (insn, contents + irel->r_offset); + /* Get the value of the symbol referred to by the reloc. */ + foff = + calculate_offset (abfd, sec, i2_irelfn, isymbuf, symtab_hdr, + &pic_ext_target); + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; - i1_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), R_NDS32_NONE); - cond_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_17_PCREL_RELA, laddr); - if (cond_irelfn != irelend) - { - cond_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), - R_NDS32_17_PCREL_RELA); - cond_irelfn->r_addend = i1_irelfn->r_addend; - } - insn_len = 4; - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LONGCALL3) - { - /* There are 3 variations for LONGCALL3 - case 4-4-4-2; 16-bit on, optimize off or optimize for space - bltz rt, $1 ; LONGCALL3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jral5 ta ; - $1 - - case 4-4-4-4; 16-bit off, optimize don't care - bltz rt, $1 ; LONGCALL3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; - $1 - - case 4-4-4-4; 16-bit on, optimize for speed - bltz rt, $1 ; LONGCALL3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; (INSN16) - $1 */ - - /* Get the reloc for the address from which the register is - being loaded. This reloc will tell us which function is - actually being called. */ - hi_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_HI20_RELA, laddr + 4); - lo_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_LO12S0_ORI_RELA, laddr + 8); - i2_offset = 12; + /* Get the all corresponding instructions. */ + if (first_size == 4) + { + insn = bfd_getb32 (contents + laddr); + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); + } + else + { + insn16 = bfd_getb16 (contents + laddr); + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } - if (hi_irelfn == irelend || lo_irelfn == irelend) - { - i2_offset = 8; - hi_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_20_RELA, laddr + 4); + if (re_insn16 && foff >= -(ACCURATE_8BIT_S1 - first_size) + && foff < ACCURATE_8BIT_S1 - first_size) + { + if (first_size == 4) + { + /* Don't convert it to 16-bit now, keep this as relaxable for + ``label reloc; INSN16''. */ - if (hi_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_LONGCALL3 points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); - continue; - } - } + /* Save comp_insn32 to buffer. */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = (N32_OP6 (re_insn) == N32_OP6_BR1) ? + R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_INSN16; + } + else + { + bfd_putb16 (re_insn16, contents + irel->r_offset); + *insn_len = 2; + reloc = R_NDS32_9_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + } + else if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -(ACCURATE_14BIT_S1 - first_size) + && foff < ACCURATE_14BIT_S1 - first_size)) + { + /* beqs label ; 15_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_15_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 + && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + else + return FALSE; - i2_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_INSN16, laddr + i2_offset); + /* Set all relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), reloc); + irel->r_addend = i2_irelfn->r_addend; - /* Get the value of the symbol referred to by the reloc. */ - foff = - calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); - if (pic_ext_target || foff == 0) - continue; - if (foff < -0x1000000 || foff >= 0x1000000) - continue; + cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), + cond_reloc); + cond_irelfn->r_addend = 0; - insn = bfd_getb32 (contents + laddr); - if (foff >= -0x10000 - 4 && foff < 0x10000 - 4) - { - /* Relax to bgezal rt, label ; 17_PCREL - or bltzal rt, label ; 17_PCREL */ + if ((seq_len ^ *insn_len ) & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + 4); + i2_irelfn->r_offset = 4; + i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), + R_NDS32_INSN16); + i2_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + else + i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), + R_NDS32_NONE); + return TRUE; +} - /* Convert to complimentary conditional call. */ - insn &= 0xffff0000; - insn ^= 0x90000; - bfd_putb32 (insn, contents + irel->r_offset); +/* Relax LONGJUMP3 relocation for nds32_elf_relax_section. */ - insn_len = 4; - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_NONE); - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - if (i2_irelfn != irelend) - { - if (!insn_opt - && (i2_irelfn->r_addend & R_NDS32_INSN16_CONVERT_FLAG)) - { - /* The instruction pointed by R_NDS32_INSN16 is already - turned into 16-bit instruction, so the total length - of this sequence is decreased by 2. */ - seq_len = seq_len - 2; - } - i2_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_NONE); - } - cond_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_17_PCREL_RELA, laddr); - if (cond_irelfn != irelend) - { - cond_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_17_PCREL_RELA); - cond_irelfn->r_addend = hi_irelfn->r_addend; - } +static bfd_boolean +nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 5 variations for LONGJUMP3 + case 1: 2-4-4-2; 1st insn convertible, 16-bit on, + optimize off or optimize for space + bnes38 rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + $1: ; + + case 2: 2-4-4-2; 1st insn convertible, 16-bit on, optimize for speed + bnes38 rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + $1: ; LABEL + + case 3: 4-4-4-2; 1st insn not convertible, 16-bit on, + optimize off or optimize for space + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; + $1: ; + + case 4: 4-4-4-4; 1st insn don't care, 16-bit off, optimize don't care + 16-bit off if no INSN16 + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; + $1: ; + + case 5: 4-4-4-4; 1st insn not convertible, 16-bit on, optimize for speed + 16-bit off if no INSN16 + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; + $1: ; LABEL */ + + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA }; + + int reloc_off = 0, cond_removed = 0, convertible; + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend; + int pic_ext_target = 0, first_size; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc, cond_reloc; - if (seq_len & 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_INSN16); - hi_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - insn_len += 2; - } - } - else - { - /* Relax to the following instruction sequence - bltz rt, $1 ; LONGCALL2 - jal symbol ; 25_PCREL - $1 - */ - insn = (insn & 0xffff0000) | 4; - bfd_putb32 (insn, contents + irel->r_offset); - /* This relax is incorrect. Review, fix and test it. - Check 6a726f0f for the oringnal code. */ - BFD_ASSERT (0); - - bfd_putb32 (insn, contents + irel->r_offset + 4); - insn_len = 8; - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_25_PCREL_RELA); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGCALL2); + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - if (i2_irelfn != irelend) - { - i2_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_NONE); - } - if (seq_len & 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), - R_NDS32_INSN16); - lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - insn_len += 2; - } - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LONGJUMP1) - { - /* There are 3 variations for LONGJUMP1 - case 4-4-2; 16-bit bit on, optimize off or optimize for space - sethi ta, hi20(symbol) ; LONGJUMP1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; + convertible = IS_1ST_CONVERT (irel->r_addend); - case 4-4-4; 16-bit off, optimize don't care - sethi ta, hi20(symbol) ; LONGJUMP1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; + if (convertible) + first_size = 2; + else + first_size = 4; + + /* Get all needed relocations. */ + hi_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr + first_size); + lo_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LO12S0_ORI_RELA, + laddr + first_size + 4); + + for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++) + { + cond_irelfn = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irelfn != irelend) + break; + } - case 4-4-4; 16-bit on, optimize for speed - sethi ta, hi20(symbol) ; LONGJUMP1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; INSN16 */ + if (hi_irelfn == irelend || lo_irelfn == irelend || cond_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP3 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - /* Get the reloc for the address from which the register is - being loaded. This reloc will tell us which function is - actually being called. */ - hi_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_HI20_RELA, laddr); - lo_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_LO12S0_ORI_RELA, laddr + 4); - i1_offset = 8; + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, + &pic_ext_target); - if (hi_irelfn == irelend || lo_irelfn == irelend) - { - hi_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_20_RELA, laddr); - i1_offset = 4; + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; - if (hi_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_LONGJUMP1 points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); + /* Get the all corresponding instructions. */ + if (first_size == 4) + { + insn = bfd_getb32 (contents + laddr); + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); + } + else + { + insn16 = bfd_getb16 (contents + laddr); + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } - continue; - } - } + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ - i1_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_INSN16, laddr + i1_offset); + if (re_insn16 && foff >= -ACCURATE_8BIT_S1 - first_size + && foff < ACCURATE_8BIT_S1 - first_size) + { + if (!(seq_len & 0x2)) + { + /* Don't convert it to 16-bit now, keep this as relaxable + for ``label reloc; INSN1a''6. */ + /* Save comp_insn32 to buffer. */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = (N32_OP6 (re_insn) == N32_OP6_BR1) ? + R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_INSN16; + } + else + { + /* Not optimize for speed; convert sequence to 16-bit. */ + /* Save comp_insn16 to buffer. */ + bfd_putb16 (re_insn16, contents + irel->r_offset); + *insn_len = 2; + reloc = R_NDS32_9_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + } + cond_removed = 1; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -(ACCURATE_14BIT_S1 - first_size) + && foff < ACCURATE_14BIT_S1 - first_size)) + { + /* beqs label ; 15_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_15_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + cond_removed = 1; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 + && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL */ + bfd_putb32 (re_insn, contents + irel->r_offset); + *insn_len = 4; + reloc = R_NDS32_17_PCREL_RELA; + cond_reloc = R_NDS32_NONE; + cond_removed = 1; + } + else if (foff >= -CONSERVATIVE_24BIT_S1 - reloc_off + && foff < CONSERVATIVE_24BIT_S1 - reloc_off) + { + /* Relax to one of the following 3 variations + + case 2-4; 1st insn convertible, 16-bit on, optimize off or optimize + for space + bnes38 rt, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1 + + case 4-4; 1st insn not convertible, others don't care + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1 + + case 4-4; 1st insn convertible, 16-bit on, optimize for speed + bne rt, ra, $1 ; LONGJUMP2 + j label ; 25_PCREL + $1 */ + + /* Offset for first instruction. */ + + /* Use j label as second instruction. */ + *insn_len = 4 + first_size; + insn = INSN_J; + bfd_putb32 (insn, contents + hi_irelfn->r_offset); + reloc = R_NDS32_LONGJUMP2; + cond_reloc = R_NDS32_25_PLTREL; + } + else + return FALSE; - /* Get the value of the symbol referred to by the reloc. */ - foff = - calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); - if (pic_ext_target || foff == 0) - continue; + if (cond_removed == 1) + { + /* Set all relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc); + irel->r_addend = hi_irelfn->r_addend; + + cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), + cond_reloc); + cond_irelfn->r_addend = 0; + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + R_NDS32_NONE); + } + else + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + irel->r_addend = irel->r_addend; + hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), + cond_reloc); + } - if (foff >= -0x1000000 && foff < 0x1000000) - { - /* j label */ - if (!insn_opt && insn16_on && foff >= -0x100 && foff < 0x100 - && (seq_len & 0x2)) - { - /* 16-bit on, but not optimized for speed. */ - reloc = R_NDS32_9_PCREL_RELA; - insn16 = INSN_J8; - bfd_putb16 (insn16, contents + irel->r_offset); - insn_len = 2; - } - else - { - reloc = R_NDS32_25_PCREL_RELA; - insn = INSN_J; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 4; - } - } - else - { - continue; - } + if ((seq_len ^ *insn_len ) & 0x2) + { + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + irel->r_offset + *insn_len); + lo_irelfn->r_offset = *insn_len; + lo_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), + R_NDS32_INSN16); + lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + *insn_len += 2; + } + else + lo_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), + R_NDS32_NONE); + return TRUE; +} - /* For simplicity of coding, we are going to modify the section - contents, the section relocs, and the BFD symbol table. We - must tell the rest of the code not to free up this - information. It would be possible to instead create a table - of changes which have to be made, as is done in coff-mips.c; - that would be more work, but would require less memory when - the linker is run. */ +/* Relax LONGCALL4 relocation for nds32_elf_relax_section. */ - if (insn == 4) - { - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_INSN16); - irel->r_addend = 0; - } - else - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); +static bfd_boolean +nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGCALL4. Support for function cse. + sethi ta, hi20(symbol) ; LONGCALL4/HI20 + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jral ta ; PTR_RES/EMPTY/INSN16 */ - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - if (i1_irelfn != irelend) - { - if (!insn_opt - && (i1_irelfn->r_addend & R_NDS32_INSN16_CONVERT_FLAG)) - { - /* The instruction pointed by R_NDS32_INSN16 is already - turned into 16-bit instruction, so the total length - of this sequence is decreased by 2. */ - seq_len = seq_len - 2; - i1_irelfn->r_addend = 0; - } - i1_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), R_NDS32_NONE); - } + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *hi_irel, *ptr_irel, *insn_irel, *em_irel, *call_irel; + Elf_Internal_Rela *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; - if ((seq_len & 0x2) && ((insn_len & 2) == 0)) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), - R_NDS32_INSN16); - lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - insn_len += 2; - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LONGJUMP2) - { - /* There are 3 variations for LONGJUMP2 - case 2-4; 1st insn convertible, 16-bit on, optimize off or optimize for space - bnes38 rt, ra, $1 ; LONGJUMP2 - j label ; 25_PCREL - $1: - - case 4-4; 1st insn not convertible - bne rt, ra, $1 ; LONGJUMP2 - j label ; 25_PCREL - $1: - - case 4-4; 1st insn convertible, 16-bit on, optimize for speed - bne rt, ra, $1 ; LONGJUMP2/INSN16 - j label ; 25_PCREL - $1: */ - - /* Get the reloc for the address from which the register is - being loaded. This reloc will tell us which function is - actually being called. */ - enum elf_nds32_reloc_type checked_types[] = - { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA }; - hi_off = (seq_len == 6) ? 2 : 4; - i2_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_25_PCREL_RELA, - laddr + hi_off); + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; - for (i = 0; i < 2; i++) - { - cond_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - checked_types[i], laddr); - if (cond_irelfn != irelend) - break; - } - if (i2_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_LONGJUMP2 points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + hi_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); - continue; - } + if (hi_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - i1_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_INSN16, laddr); + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr, + &pic_ext_target); - if (i1_irelfn != irelend && !insn_opt - && (i1_irelfn->r_addend & R_NDS32_INSN16_CONVERT_FLAG)) - { - /* The instruction pointed by R_NDS32_INSN16 is already turned - into 16-bit instruction, so the total length of this sequence - is decreased by 2. */ - seq_len = seq_len - 2; - } + /* This condition only happened when symbol is undefined. */ + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; - if (seq_len == 8) - { - /* possible cases - 1. range is outside of +/-256 bytes - 2. optimize is on with INSN16 - 3. optimize is off */ - insn_off = 4; - insn = bfd_getb32 (contents + laddr); - if (!insn16_on) - { - /* 16-bit is off, can't convert to 16-bit. */ - comp_insn16 = 0; - } - else if (N32_OP6 (insn) == N32_OP6_BR1) - { - /* beqs label ; 15_PCREL (INSN16) */ - comp_insn = (insn ^ 0x4000) & 0xffffc000; - i_mask = 0xffffc000; - if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5) - { - /* Insn can be contracted to 16-bit. */ - comp_insn16 = - (insn & 0x4000) ? INSN_BNES38 : INSN_BEQS38; - comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; - } - else - { - /* No conversion. */ - comp_insn16 = 0; - } - } - else - { - comp_insn = (insn ^ 0x10000) & 0xffffc000; - i_mask = 0xffff0000; - if (N32_BR2_SUB (insn) == N32_BR2_BEQZ - || N32_BR2_SUB (insn) == N32_BR2_BNEZ) - { - if (N32_IS_RT3 (insn)) - { - /* Insn can be contracted to 16-bit. */ - comp_insn16 = - (insn & 0x10000) ? INSN_BNEZ38 : INSN_BEQZ38; - comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; - } - else if (N32_RT5 (insn) == REG_R15) - { - /* Insn can be contracted to 16-bit. */ - comp_insn16 = - (insn & 0x10000) ? INSN_BNES38 : INSN_BEQS38; - } - else - { - /* No conversion. */ - comp_insn16 = 0; - } - } - else - { - /* No conversion. */ - comp_insn16 = 0; - } - } - } - else - { - /* First instruction is 16-bit. */ - insn_off = 2; - insn16 = bfd_getb16 (contents + laddr); - switch ((insn16 & 0xf000) >> 12) - { - case 0xc: - /* beqz38 or bnez38 */ - comp_insn = (insn16 & 0x0800) ? INSN_BNEZ : INSN_BEQZ; - comp_insn |= ((insn16 & 0x0700) >> 8) << 20; - comp_insn16 = (insn16 ^ 0x0800) & 0xff00; - insn = (insn16 & 0x0800) ? INSN_BEQZ : INSN_BNEZ; - insn |= ((insn16 & 0x0700) >> 8) << 20; - i_mask = 0xffff0000; - break; + /* Relax to: jal symbol; 25_PCREL */ + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ - case 0xd: - /* beqs38 or bnes38 */ - comp_insn = (insn16 & 0x0800) ? INSN_BNE : INSN_BEQ; - comp_insn |= (((insn16 & 0x0700) >> 8) << 20) - | (REG_R5 << 15); - comp_insn16 = (insn16 ^ 0x0800) & 0xff00; - insn = (insn16 & 0x0800) ? INSN_BEQ : INSN_BNE; - insn |= (((insn16 & 0x0700) >> 8) << 20) | (REG_R5 << 15); - i_mask = 0xffffc000; - break; + ptr_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); - case 0xe: - /* beqzS8 or bnezS8 */ - comp_insn = (insn16 & 0x0100) ? INSN_BNEZ : INSN_BEQZ; - comp_insn |= REG_R15 << 20; - comp_insn16 = (insn16 ^ 0x0100) & 0xff00; - insn = (insn16 & 0x0100) ? INSN_BEQZ : INSN_BNEZ; - insn |= REG_R15 << 20; - i_mask = 0xffff0000; - break; + if (ptr_irel == irelend || em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + /* Check these is enough space to insert jal in R_NDS32_EMPTY. */ + insn = bfd_getb32 (contents + irel->r_addend); + if (insn & 0x80000000) + return FALSE; - default: - comp_insn16 = 0; - insn = 0; - break; - } - } + /* Replace the long call with a jal. */ + em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), + R_NDS32_25_PCREL_RELA); + ptr_irel->r_addend = 1; - /* Get the value of the symbol referred to by the reloc. */ - foff = - calculate_offset (abfd, sec, i2_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); - if (pic_ext_target || foff == 0) - continue; + /* We don't resolve this here but resolve it in relocate_section. */ + insn = INSN_JAL; + bfd_putb32 (insn, contents + em_irel->r_offset); - if (comp_insn16 - && foff >= -0x100 - insn_off && foff < 0x100 - insn_off) - { - if (insn_opt || seq_len == 8) - { - /* Don't convert it to 16-bit now, keep this as relaxable for - ``label reloc; INSN16''. */ + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - /* Save comp_insn32 to buffer. */ - insn = comp_insn; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 4; - reloc = (N32_OP6 (comp_insn) == N32_OP6_BR1) ? - R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA; + /* If there is function cse, HI20 can not remove now. */ + call_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LONGCALL4, laddr); + if (call_irel == irelend) + { + *insn_len = 0; + hi_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irel->r_info), R_NDS32_NONE); + } - if (cond_irelfn != irelend) - { - cond_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), - R_NDS32_INSN16); - cond_irelfn->r_addend = 0; - } - } - else - { - /* Not optimize for speed; convert sequence to 16-bit. */ + insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_addend); + if (insn_irel != irelend) + insn_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - /* Save comp_insn16 to buffer. */ - insn16 = comp_insn16; - bfd_putb16 (insn16, contents + irel->r_offset); - insn_len = 2; - reloc = R_NDS32_9_PCREL_RELA; - } + return TRUE; +} - /* Change relocs. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), reloc); - irel->r_addend = i2_irelfn->r_addend; +/* Relax LONGCALL5 relocation for nds32_elf_relax_section. */ - i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_NONE); - } - else if (N32_OP6 (insn) == N32_OP6_BR1 - && (foff >= -0x4000 - insn_off && foff < 0x4000 - insn_off)) - { - /* beqs label ; 15_PCREL */ - insn = comp_insn; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 4; - - /* Change relocs. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_15_PCREL_RELA); - irel->r_addend = i2_irelfn->r_addend; - if (i1_irelfn != irelend) - i1_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), - R_NDS32_NONE); - - if (seq_len & 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - i2_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_INSN16); - i2_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - insn_len += 2; - } - } - else if (N32_OP6 (insn) == N32_OP6_BR2 && foff >= -0x10000 && foff < 0x10000) - { - /* beqz label ; 17_PCREL */ - insn = comp_insn; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 4; - - /* Change relocs. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_17_PCREL_RELA); - irel->r_addend = i2_irelfn->r_addend; - if (i1_irelfn != irelend) - i1_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), - R_NDS32_NONE); - if (seq_len & 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_INSN16); - i2_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - insn_len += 2; - } - } - else - continue; +static bfd_boolean +nds32_elf_relax_longcall5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGCALL5. + bltz rt, .L1 ; LONGCALL5/17_PCREL + jal symbol ; 25_PCREL + .L1: */ - if (cond_irelfn != irelend) - cond_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irelfn->r_info), - R_NDS32_NONE); - - - /* For simplicity of coding, we are going to modify the section - contents, the section relocs, and the BFD symbol table. We - must tell the rest of the code not to free up this - information. It would be possible to instead create a table - of changes which have to be made, as is done in coff-mips.c; - that would be more work, but would require less memory when - the linker is run. */ - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LONGJUMP3) - { - int reloc_off = 0, cond_removed = 0; - /* Get the reloc for the address from which the register is - being loaded. This reloc will tell us which function is - actually being called. */ - enum elf_nds32_reloc_type checked_types[] = - { R_NDS32_15_PCREL_RELA, R_NDS32_9_PCREL_RELA }; - - /* There are 5 variations for LONGJUMP3 - case 1: 2-4-4-2; 1st insn convertible, 16-bit on, - optimize off or optimize for space - bnes38 rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; - $1: ; - - case 2: 2-4-4-2; 1st insn convertible, 16-bit on, optimize for speed - bnes38 rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; - $1: ; LABEL - - case 3: 4-4-4-2; 1st insn not convertible, 16-bit on, - optimize off or optimize for space - bne rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; - $1: ; - - case 4: 4-4-4-4; 1st insn don't care, 16-bit off, optimize don't care - 16-bit off if no INSN16 - bne rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; - $1: ; - - case 5: 4-4-4-4; 1st insn not convertible, 16-bit on, optimize for speed - 16-bit off if no INSN16 - bne rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; INSN16 - $1: ; LABEL - */ - - if (convertible) - { - hi_off = 2; - if (insn_opt) - reloc_off = 2; - } - else - { - hi_off = 4; - } + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *cond_irel, *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; - hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_HI20_RELA, - laddr + hi_off); - lo_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_LO12S0_ORI_RELA, - laddr + hi_off + 4); - i2_offset = 8; + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); - if (hi_irelfn == irelend || lo_irelfn == irelend) - { - hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_20_RELA, - laddr + hi_off); - i2_offset = 4; + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_25_PCREL_RELA, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL5 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - if (hi_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_LONGJUMP3 points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); - continue; - } - } + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr, + &pic_ext_target); - i2_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_INSN16, - laddr + hi_off + i2_offset); - - /* Get the value of the symbol referred to by the reloc. */ - foff = - calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); - if (pic_ext_target || foff == 0) - continue; + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; - /* Set offset adjustment value. */ - /* Check instruction type and set complimentary instruction. */ - if (hi_off == 2) - { - /* First instruction is 16-bit. */ - insn_off = 2; - insn16 = bfd_getb16 (contents + laddr); - switch ((insn16 & 0xf000) >> 12) - { - case 0xc: - /* beqz38 or bnez38 */ - comp_insn = (insn16 & 0x0800) ? INSN_BNEZ : INSN_BEQZ; - comp_insn |= ((insn16 & 0x0700) >> 8) << 20; - comp_insn16 = (insn16 ^ 0x0800) & 0xff00; - insn = (insn16 & 0x0800) ? INSN_BEQZ : INSN_BNEZ; - insn |= ((insn16 & 0x0700) >> 8) << 20; - i_mask = 0xffff0000; - break; + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ - case 0xd: - /* beqs38 or bnes38 */ - comp_insn = (insn16 & 0x0800) ? INSN_BNE : INSN_BEQ; - comp_insn |= (((insn16 & 0x0700) >> 8) << 20) - | (REG_R5 << 15); - comp_insn16 = (insn16 ^ 0x0800) & 0xff00; - insn = (insn16 & 0x0800) ? INSN_BEQ : INSN_BNE; - insn |= (((insn16 & 0x0700) >> 8) << 20) | (REG_R5 << 15); - i_mask = 0xffffc000; - break; + /* Convert to complimentary conditional call. */ + insn = CONVERT_CONDITION_CALL (insn); - case 0xe: - /* beqzS8 or bnezS8 */ - comp_insn = (insn16 & 0x0100) ? INSN_BNEZ : INSN_BEQZ; - comp_insn |= REG_R15 << 20; - comp_insn16 = (insn16 ^ 0x0100) & 0xff00; - insn = (insn16 & 0x0100) ? INSN_BEQZ : INSN_BNEZ; - insn |= REG_R15 << 20; - i_mask = 0xffff0000; - break; - } - } - else - { - /* First instruction is 32-bit. */ - insn_off = 4; - insn = bfd_getb32 (contents + laddr); - if (!insn16_on) - { - /* 16-bit is off */ - comp_insn16 = 0; - } - else if (N32_OP6 (insn) == N32_OP6_BR1) - { - /* +/-16K range */ - comp_insn = insn ^ 0x4000; - i_mask = 0xffffc000; - if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5) - { - /* This instruction can turn to 16-bit. */ - comp_insn16 = - (insn & 0x4000) ? INSN_BNES38 : INSN_BEQS38; - comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; - } - else - { - /* no conversion */ - comp_insn16 = 0; - } - } - else - { - /* +/-64K range */ - comp_insn = insn ^ 0x10000; - i_mask = 0xffff0000; - if (N32_BR2_SUB (insn) == N32_BR2_BEQZ - || N32_BR2_SUB (insn) == N32_BR2_BNEZ) - { - if (N32_IS_RT3 (insn)) - { - /* This instruction can turn to 16-bit. */ - comp_insn16 = - (insn & 0x10000) ? INSN_BNEZ38 : INSN_BEQZ38; - comp_insn16 |= (N32_RT5 (insn) & 0x7) << 8; - } - else if (N32_RT5 (insn) == REG_R15) - { - /* This instruction can turn to 16-bit. */ - comp_insn16 = - (insn & 0x10000) ? INSN_BNEZS8 : INSN_BEQZS8; - } - else - { - /* No conversion. */ - comp_insn16 = 0; - } - } - else - { - /* No conversion. */ - comp_insn16 = 0; - } - } - } + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ - if (foff < -0x1000000 && foff >= 0x1000000) - continue; + /* Modify relocation and contents. */ + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_17_PCREL_RELA); - if (i2_irelfn != irelend) - { - if (insn_opt == 0 - && (i2_irelfn->r_addend & R_NDS32_INSN16_CONVERT_FLAG)) - { - /* The instruction pointed by R_NDS32_INSN16 is already - turned into 16-bit instruction, so the total length - of this sequence is decreased by 2. */ - seq_len = seq_len - 2; - i2_irelfn->r_addend = 0; - } - } + /* Replace the long call with a bgezal. */ + bfd_putb32 (insn, contents + cond_irel->r_offset); + *insn_len = 0; - /* For simplicity of coding, we are going to modify the section - contents, the section relocs, and the BFD symbol table. We - must tell the rest of the code not to free up this - information. It would be possible to instead create a table - of changes which have to be made, as is done in coff-mips.c; - that would be more work, but would require less memory when - the linker is run. */ + /* Clean unnessary relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - if (comp_insn16 - && foff >= -0x100 - insn_off && foff < 0x100 - insn_off) - { - if (insn_opt || (seq_len & 0x2) == 0) - { - /* Don't convert it to 16-bit now, keep this as relaxable - for ``label reloc; INSN1a''6. */ - /* Save comp_insn32 to buffer. */ - insn = comp_insn; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 4; - reloc = (N32_OP6 (comp_insn) == N32_OP6_BR1) ? - R_NDS32_15_PCREL_RELA : R_NDS32_17_PCREL_RELA; - - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_INSN16); - } - else - { - /* Not optimize for speed; convert sequence to 16-bit. */ - /* Save comp_insn16 to buffer. */ - insn16 = comp_insn16; - bfd_putb16 (insn16, contents + irel->r_offset); - insn_len = 2; - reloc = R_NDS32_9_PCREL_RELA; - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_NONE); - } + cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); - /* Change relocs. */ - for (i = 0; i < 2; i++) - { - cond_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, - irelend, checked_types[i], - laddr); + return TRUE; +} - if (cond_irelfn != irelend) - { - cond_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc); - cond_irelfn->r_addend = hi_irelfn->r_addend; - } - } - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - cond_removed = 1; - } - else if (N32_OP6 (insn) == N32_OP6_BR1 - && foff >= -0x4000 - insn_off && foff < 0x4000 - insn_off) - { - /* Relax to `beq label ; 15_PCREL'. */ +/* Relax LONGCALL6 relocation for nds32_elf_relax_section. */ - /* Save comp_insn to buffer. */ - insn = comp_insn; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 4; - reloc = R_NDS32_15_PCREL_RELA; +static bfd_boolean +nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGCALL6. + bltz rt, .L1 ; LONGCALL6/17_PCREL + sethi ta, hi20(symbol) ; HI20/PTR + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jral ta ; PTR_RES/EMPTY/INSN16 + .L1 */ + + bfd_vma laddr; + uint32_t insn; + Elf_Internal_Rela *em_irel, *cond_irel, *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; - /* Change relocs. */ - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - if (seq_len & 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_INSN16); - hi_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - if (hi_off == 2) - hi_irelfn->r_offset += 2; - insn_len += 2; - } - cond_removed = 1; - } - else if (N32_OP6 (insn) == N32_OP6_BR2 - && foff >= -0x10000 - insn_off - && foff < 0x10000 - insn_off) - { - /* Relax to `beqz label ; 17_PCREL'. */ + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; - /* Save comp_insn to buffer. */ - insn = comp_insn; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 4; - reloc = R_NDS32_17_PCREL_RELA; + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); - /* Change relocs. */ - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - if (seq_len & 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), - R_NDS32_INSN16); - lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - if (hi_off == 2) - hi_irelfn->r_offset += 2; - insn_len += 2; - } - cond_removed = 1; - } - else if (foff >= -0x1000000 - reloc_off - && foff < 0x1000000 - reloc_off) - { - /* Relax to one of the following 3 variations - - case 2-4; 1st insn convertible, 16-bit on, optimize off or optimize for space - bnes38 rt, $1 ; LONGJUMP2 - j label ; 25_PCREL - $1 - - case 4-4; 1st insn not convertible, others don't care - bne rt, ra, $1 ; LONGJUMP2 - j label ; 25_PCREL - $1 - - case 4-4; 1st insn convertible, 16-bit on, optimize for speed - bne rt, ra, $1 ; LONGJUMP2/INSN16 - j label ; 25_PCREL - $1 - */ + if (em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - /* Offset for first instruction. */ + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr, + &pic_ext_target); - if (hi_off == 2) - { - /* First instruction is 16-bit. */ - if (hi_irelfn != irelend) - { - /* INSN16 exists so this is optimized for speed. */ - /* Convert this instruction to 32-bit for label alignment. */ - insn = (insn & i_mask) | 4; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 8; - hi_irelfn->r_offset += 2; - } - else - { - /* Not optimized for speed. */ - insn16 = (insn16 & 0xff00) | 3; - bfd_putb16 (insn16, contents + irel->r_offset); - insn_len = 6; - } - } - else - { - /* First instruction is 32-bit. */ - insn = (insn & i_mask) | 4; - bfd_putb32 (insn, contents + irel->r_offset); - insn_len = 8; - } + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; - /* Use j label as second instruction. */ - insn = INSN_J; - bfd_putb32 (insn, contents + irel->r_offset); - - /* Change relocs. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGJUMP2); - hi_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_25_PCREL_RELA); - lo_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), R_NDS32_NONE); - if (((seq_len ^ insn_len) & 0x2) != 0x2) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + insn_len); - lo_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (lo_irelfn->r_info), - R_NDS32_INSN16); - lo_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - lo_irelfn->r_offset = hi_irelfn->r_offset + 4; - insn_len += 2; - } - } + /* Check these is enough space to insert jal in R_NDS32_EMPTY. */ + insn = bfd_getb32 (contents + irel->r_addend); + if (insn & 0x80000000) + return FALSE; - if (cond_removed) - { - for (i = 0; i < 2; i++) - { - cond_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, - irelend, checked_types[i], - laddr); + insn = bfd_getb32 (contents + laddr); + if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) + { + /* Relax to bgezal rt, label ; 17_PCREL + or bltzal rt, label ; 17_PCREL */ - if (cond_irelfn != irelend) - break; - } - if (cond_irelfn != irelend) - { - cond_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), reloc); - cond_irelfn->r_addend = hi_irelfn->r_addend; - } - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LOADSTORE) + /* Convert to complimentary conditional call. */ + *insn_len = 0; + insn = CONVERT_CONDITION_CALL (insn); + bfd_putb32 (insn, contents + em_irel->r_offset); + + em_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), R_NDS32_17_PCREL_RELA); + + /* Set resolved relocation. */ + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + if (cond_irel == irelend) { - int eliminate_sethi = 0, ls_range_type; - enum elf_nds32_reloc_type checked_types[] = - { R_NDS32_HI20_RELA, R_NDS32_GOT_HI20, - R_NDS32_GOTPC_HI20, R_NDS32_GOTOFF_HI20, - R_NDS32_PLTREL_HI20, R_NDS32_PLT_GOTREL_HI20 - }; + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + cond_irel->r_addend = 1; - insn_len = seq_len; + /* Clear relocations. */ - for (i = 0; i < 6; i++) - { - hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, - checked_types[i], laddr); - if (hi_irelfn != irelend) - break; - } + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - if (hi_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_LOADSTORE points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); - continue; - } + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_17_PCREL_RELA, laddr); + if (cond_irel != irelend) + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); - ls_range_type = (irel->r_addend >> 8) & 0x3f; + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_addend); + if (cond_irel != irelend) + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); - nds32_elf_final_sda_base (sec->output_section->owner, link_info, - &local_sda, FALSE); - switch (ELF32_R_TYPE (hi_irelfn->r_info)) - { - case R_NDS32_HI20_RELA: - insn = bfd_getb32 (contents + laddr); - access_addr = - calculate_memory_address (abfd, hi_irelfn, isymbuf, - symtab_hdr); + } + else if (foff >= -CONSERVATIVE_24BIT_S1 && foff < CONSERVATIVE_24BIT_S1) + { + /* Relax to the following instruction sequence + bltz rt, .L1 ; LONGCALL2/17_PCREL + jal symbol ; 25_PCREL/PTR_RES + .L1 */ + *insn_len = 4; + /* Convert instruction. */ + insn = INSN_JAL; + bfd_putb32 (insn, contents + em_irel->r_offset); - if ((ls_range_type & 0x3f) == 0x20) - { - if ((access_addr < 0x7f000)) - { - eliminate_sethi = 1; - break; - } - else - { - /* This is avoid to relax symbol address which is fixed - relocations. Ex: _stack. */ - struct elf_link_hash_entry *h; - int indx; - indx = ELF32_R_SYM (hi_irelfn->r_info) - symtab_hdr->sh_info; - if (indx >= 0) - { - h = elf_sym_hashes (abfd)[indx]; - if (h && bfd_is_abs_section (h->root.u.def.section)) - break; - } - } - } + /* Convert relocations. */ + em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), + R_NDS32_25_PCREL_RELA); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_LONGCALL5); - if (!load_store_relax) - continue; + /* Set resolved relocation. */ + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGCALL6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } + cond_irel->r_addend = 1; - if (((insn >> 20) & 0x1f) == REG_GP) - break; + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_addend); + if (cond_irel != irelend) + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); + } + return TRUE; +} - if (ls_range_type & 0x8 || ls_range_type & 0x10) - { - range_l = sdata_range[0][0]; - range_h = sdata_range[0][1]; - } - else - { - range_l = sdata_range[4][0]; - range_h = sdata_range[4][1]; - } - break; +/* Relax LONGJUMP4 relocation for nds32_elf_relax_section. */ - case R_NDS32_GOT_HI20: - access_addr = - calculate_got_memory_address (abfd, link_info, hi_irelfn, - symtab_hdr); - - /* If this symbol is not in .got, the return value will be -1. - Since the gp value is set to SDA_BASE but not GLOBAL_OFFSET_TABLE, - a negative offset is allowed. */ - if ((bfd_signed_vma) (access_addr - local_sda) < 0x7f000 - && (bfd_signed_vma) (access_addr - local_sda) >= -0x7f000) - eliminate_sethi = 1; - break; +static bfd_boolean +nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* The pattern for LONGJUMP4. + sethi ta, hi20(symbol) ; LONGJUMP4/HI20 + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jr ta ; PTR_RES/INSN16/EMPTY */ + + bfd_vma laddr; + int seq_len; /* Original length of instruction sequence. */ + uint32_t insn; + Elf_Internal_Rela *hi_irel, *ptr_irel, *em_irel, *call_irel, *irelend; + int pic_ext_target = 0; + bfd_signed_vma foff; - case R_NDS32_PLT_GOTREL_HI20: - access_addr = - calculate_plt_memory_address (abfd, link_info, isymbuf, - hi_irelfn, symtab_hdr); + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; - if ((bfd_signed_vma) (access_addr - local_sda) < 0x7f000 - && (bfd_signed_vma) (access_addr - local_sda) >= -0x7f000) - eliminate_sethi = 1; - break; + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ - case R_NDS32_GOTOFF_HI20: - access_addr = - calculate_memory_address (abfd, hi_irelfn, isymbuf, - symtab_hdr); + hi_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_HI20_RELA, laddr); - if ((bfd_signed_vma) (access_addr - local_sda) < 0x7f000 - && (bfd_signed_vma) (access_addr - local_sda) >= -0x7f000) - eliminate_sethi = 1; - break; + if (hi_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - case R_NDS32_GOTPC_HI20: - for (i1_irelfn = irel; - i1_irelfn->r_offset <= irel->r_offset + 4 - && i1_irelfn < irelend; i1_irelfn++) - if (ELF32_R_TYPE (i1_irelfn->r_info) == R_NDS32_GOTPC_LO12) - break; - if (i1_irelfn == irelend - || i1_irelfn->r_offset != irel->r_offset + 4) - continue; + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr, + &pic_ext_target); - access_addr = sec->output_section->vma + sec->output_offset - + irel->r_offset; - if ((bfd_signed_vma) (local_sda - access_addr) < 0x7f000 - && (bfd_signed_vma) (local_sda - access_addr) >= -0x7f000) - { - /* Turn into MOVI. */ - insn = bfd_getb32 (contents + laddr + 4); - if (((insn & 0x1f00000) >> 20) != REG_GP) - continue; - - hi_irelfn->r_addend = ((int) hi_irelfn->r_addend) < -4 - ? (hi_irelfn->r_addend + 4) : (hi_irelfn->r_addend); - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_GOTPC20); - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - i1_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), - R_NDS32_NONE); - insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); - bfd_putb32 (insn, contents + laddr); - insn_len = 4; - seq_len = 8; - } - break; + if (pic_ext_target || foff == 0 || foff >= CONSERVATIVE_24BIT_S1 + || foff < -CONSERVATIVE_24BIT_S1) + return FALSE; - default: - continue; - } - if (eliminate_sethi == 1 - || (local_sda <= access_addr && (access_addr - local_sda) < range_h) - || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) - { - hi_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - insn_len = 0; - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA) - { - foff = calculate_offset (abfd, sec, irel, isymbuf, symtab_hdr, - &pic_ext_target); - if (pic_ext_target || foff == 0) - continue; - if (foff < 1022 && foff >= 0) - { - reloc = R_NDS32_10IFCU_PCREL_RELA; - insn16 = INSN_IFCALL9; - bfd_putb16 (insn16, contents + irel->r_offset); - insn_len = 2; - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_10IFCU_PCREL_RELA); - *again = TRUE; + /* Convert it to "j label", it may be converted to j8 in the final + pass of relaxation. Therefore, we do not consider this currently. */ + ptr_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); - i2_irelfn = find_relocs_at_address (irel, internal_relocs, - irelend, R_NDS32_INSN16); - if (i2_irelfn < irelend) - { - insn16 = NDS32_NOP16; - bfd_putb16 (insn16, contents + irel->r_offset + 2); - i2_irelfn->r_addend = R_NDS32_INSN16_CONVERT_FLAG; - i2_irelfn->r_offset += 2; - insn_len += 2; - } - else - { - ((*_bfd_error_handler) - ("%s: 0x%lx: warning: R_NDS32_17IFC points to unrecognized reloc at 0x%lx", - bfd_get_filename (abfd), (long) irel->r_offset)); - } - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S1_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_DP_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_SP_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_RELA) - { - nds32_elf_final_sda_base (sec->output_section->owner, link_info, - &local_sda, FALSE); + if (ptr_irel == irelend || em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP4 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - insn = bfd_getb32 (contents + laddr); + em_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), R_NDS32_25_PCREL_RELA); + ptr_irel->r_addend = 1; - if (!is_sda_access_insn (insn) - && N32_OP6 (insn) != N32_OP6_ORI) - continue; + /* Write instruction. */ + insn = INSN_J; + bfd_putb32 (insn, contents + em_irel->r_offset); - access_addr = - calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); - insn_len = seq_len = 4; + /* Clear relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - /* This is avoid to relax symbol address which is fixed - relocations. Ex: _stack. */ - if (N32_OP6 (insn) == N32_OP6_ORI && access_addr >= 0x7f000) - { - struct elf_link_hash_entry *h; - int indx; - indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; - if (indx >= 0) - { - h = elf_sym_hashes (abfd)[indx]; - if (h && bfd_is_abs_section (h->root.u.def.section)) - continue; - } - } + /* If there is function cse, HI20 can not remove now. */ + call_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_LONGJUMP4, laddr); + if (call_irel == irelend) + { + *insn_len = 0; + hi_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irel->r_info), R_NDS32_NONE); + } - if (N32_OP6 (insn) == N32_OP6_ORI && access_addr < 0x7f000) - { - reloc = R_NDS32_20_RELA; - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); - insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); - bfd_putb32 (insn, contents + laddr); - } - else if (load_store_relax) - { - range_l = sdata_range[4][0]; - range_h = sdata_range[4][1]; - switch (ELF32_R_TYPE (irel->r_info)) - { - case R_NDS32_LO12S0_RELA: - reloc = R_NDS32_SDA19S0_RELA; - break; - case R_NDS32_LO12S1_RELA: - reloc = R_NDS32_SDA18S1_RELA; - break; - case R_NDS32_LO12S2_RELA: - reloc = R_NDS32_SDA17S2_RELA; - break; - case R_NDS32_LO12S2_DP_RELA: - range_l = sdata_range[0][0]; - range_h = sdata_range[0][1]; - reloc = R_NDS32_SDA12S2_DP_RELA; - break; - case R_NDS32_LO12S2_SP_RELA: - range_l = sdata_range[0][0]; - range_h = sdata_range[0][1]; - reloc = R_NDS32_SDA12S2_SP_RELA; - break; - default: - break; - } - - /* There are range_h and range_l because linker has to promise - all sections move cross one page together. */ - if ((local_sda <= access_addr && (access_addr - local_sda) < range_h) - || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) - { - if (N32_OP6 (insn) == N32_OP6_ORI && N32_RT5 (insn) == REG_GP) - { - /* Maybe we should add R_NDS32_INSN16 reloc type here - or manually do some optimization. sethi can't be - eliminated when updating $gp so the relative ori - needs to be preserved. */ - continue; - } - if (!turn_insn_to_sda_access (insn, ELF32_R_TYPE (irel->r_info), - &insn)) - continue; - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); - bfd_putb32 (insn, contents + laddr); - } - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12 - || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12 - || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLTREL_LO12 - || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12) - { - nds32_elf_final_sda_base (sec->output_section->owner, link_info, - &local_sda, FALSE); - - insn = bfd_getb32 (contents + laddr); - - if (N32_OP6 (insn) != N32_OP6_ORI) - continue; + return TRUE; +} - insn_len = seq_len = 4; - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12) - { - foff = calculate_got_memory_address (abfd, link_info, irel, - symtab_hdr) - local_sda; - reloc = R_NDS32_GOT20; - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12) - { - foff = calculate_plt_memory_address (abfd, link_info, isymbuf, irel, - symtab_hdr) - local_sda; - reloc = R_NDS32_PLT_GOTREL_LO20; - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12) - { - foff = calculate_memory_address (abfd, irel, isymbuf, - symtab_hdr) - local_sda; - reloc = R_NDS32_GOTOFF; - } - else - continue; +/* Relax LONGJUMP5 relocation for nds32_elf_relax_section. */ - if ((foff < 0x7f000) && (foff >= -0x7f000)) - { - /* Turn into MOVI. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); - insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); - bfd_putb32 (insn, contents + laddr); - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_PTR) - { - i1_irelfn = - find_relocs_at_address_addr (irel, internal_relocs, irelend, - R_NDS32_PTR_RESOLVED, irel->r_addend); +static bfd_boolean +nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 2 variations for LONGJUMP5 + case 2-4; 1st insn convertible, 16-bit on. + bnes38 rt, ra, .L1 ; LONGJUMP5/9_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + $1: + + case 4-4; 1st insn not convertible + bne rt, ra, .L1 ; LONGJUMP5/15_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + .L1: */ + + bfd_vma laddr; + Elf_Internal_Rela *cond_irel, *irelend; + int pic_ext_target = 0; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc; - if (i1_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_PTR points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); - continue; - } + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_17_PCREL_RELA, R_NDS32_15_PCREL_RELA, + R_NDS32_9_PCREL_RELA, R_NDS32_INSN16 }; - if (i1_irelfn->r_addend & 1) - { - /* Pointed target is relaxed and no longer needs this void *, - change the type to NONE. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; - i1_irelfn = - find_relocs_at_address (irel, internal_relocs, irelend, - R_NDS32_PTR_COUNT); + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ - if (i1_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: no R_NDS32_PTR_COUNT coexist with R_NDS32_PTR at 0x%lx.", - abfd, (long) irel->r_offset); - continue; - } + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_25_PCREL_RELA, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP5 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - if (--i1_irelfn->r_addend > 0) - continue; + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr, + &pic_ext_target); - /* If the PTR_COUNT is already 0, remove current instruction. */ - seq_len = nds32_elf_insn_size (abfd, contents, irel->r_offset); - insn_len = 0; - } - else - continue; - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOT_SUFF) - { - /* FIXME: It's a little trouble to turn JRAL5 to JAL since - we need additional space. It might be help if we could - borrow some space from instructions to be eliminated - such as sethi, ori, add. */ + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + || foff >= CONSERVATIVE_16BIT_S1) + return FALSE; - insn = bfd_getb32 (contents + laddr); - if (insn & 0x80000000) - continue; + /* Get the all corresponding instructions. */ + insn = bfd_getb32 (contents + laddr); + /* Check instruction size. */ + if (insn & 0x80000000) + { + *seq_len = 0; + insn16 = insn >> 16; + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } + else + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); - if (nds32_elf_check_dup_relocs - (irel, internal_relocs, irelend, R_NDS32_PLT_GOT_SUFF)) - continue; + if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -CONSERVATIVE_14BIT_S1 && foff < CONSERVATIVE_14BIT_S1)) + { + /* beqs label ; 15_PCREL. */ + bfd_putb32 (re_insn, contents + cond_irel->r_offset); + reloc = R_NDS32_15_PCREL_RELA; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL. */ + bfd_putb32 (re_insn, contents + cond_irel->r_offset); + reloc = R_NDS32_17_PCREL_RELA; + } + else if ( N32_OP6 (re_insn) == N32_OP6_BR3 + && foff >= -CONSERVATIVE_8BIT_S1 && foff < CONSERVATIVE_8BIT_S1) + { + /* beqc label ; 9_PCREL. */ + bfd_putb32 (re_insn, contents + cond_irel->r_offset); + reloc = R_NDS32_WORD_9_PCREL_RELA; + } + else + return FALSE; - seq_len = insn_len = 4; - i1_irelfn = - find_relocs_at_address (irel, internal_relocs, irelend, - R_NDS32_PTR_RESOLVED); - - /* FIXIT 090606 - The boundary should be reduced since the .plt section hasn't - been created and the address of specific entry is still unknown - Maybe the range between the function call and the begin of the - .text section can be used to decide if the .plt is in the range - of function call. */ - - if (N32_OP6 (insn) == N32_OP6_ALU1 - && N32_SUB5 (insn) == N32_ALU1_ADD_SLLI - && N32_SH5 (insn) == 0) - { - /* Get the value of the symbol referred to by the reloc. */ - nds32_elf_final_sda_base (sec->output_section->owner, link_info, - &local_sda, FALSE); - foff = (bfd_signed_vma) (calculate_plt_memory_address - (abfd, link_info, isymbuf, irel, - symtab_hdr) - local_sda); - /* This condition only happened when symbol is undefined. */ - if (foff == 0) - continue; + /* Set all relocations. */ + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), reloc); - if (foff < -0x3f000 || foff >= 0x3f000) - continue; - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), - R_NDS32_PLT_GOTREL_LO19); - /* addi.gp */ - insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); - } - else if (N32_OP6 (insn) == N32_OP6_JREG - && N32_SUB5 (insn) == N32_JREG_JRAL) + /* Clean relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++) + { + cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irel != irelend) + { + if (*seq_len == 0 + && (ELF32_R_TYPE (cond_irel->r_info) == R_NDS32_INSN16)) { - /* Get the value of the symbol referred to by the reloc. */ - foff = - calculate_plt_offset (abfd, sec, link_info, isymbuf, irel, - symtab_hdr); - /* This condition only happened when symbol is undefined. */ - if (foff == 0) - continue; - if (foff < -0x1000000 || foff >= 0x1000000) - continue; - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_25_PLTREL); - insn = INSN_JAL; + /* If the branch instruction is 2 byte, it cannot remove + directly. Only convert it to nop16 and remove it after + checking alignment issue. */ + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + laddr); + cond_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG; } else - continue; - - bfd_putb32 (insn, contents + laddr); - if (i1_irelfn != irelend) - { - i1_irelfn->r_addend |= 1; - *again = TRUE; - } + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_NONE); } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_SUFF) - { + } + *insn_len = 0; - insn = bfd_getb32 (contents + laddr); - if (insn & 0x80000000) - continue; + return TRUE; +} - if (nds32_elf_check_dup_relocs - (irel, internal_relocs, irelend, R_NDS32_GOT_SUFF)) - continue; +/* Relax LONGJUMP6 relocation for nds32_elf_relax_section. */ - seq_len = insn_len = 4; - i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, - R_NDS32_PTR_RESOLVED); +static bfd_boolean +nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 5 variations for LONGJUMP6 + case : 2-4-4-4; 1st insn convertible, 16-bit on. + bnes38 rt, ra, .L1 ; LONGJUMP6/15_PCREL/INSN16 + sethi ta, hi20(symbol) ; HI20/PTR + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jr ta ; PTR_RES/INSN16/EMPTY + .L1: + + case : 4-4-4-4; 1st insn not convertible, 16-bit on. + bne rt, ra, .L1 ; LONGJUMP6/15_PCREL/INSN16 + sethi ta, hi20(symbol) ; HI20/PTR + ori ta, ta, lo12(symbol) ; LO12S0_ORI/PTR + jr ta ; PTR_RES/INSN16/EMPTY + .L1: */ + + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_17_PCREL_RELA, R_NDS32_15_PCREL_RELA, + R_NDS32_9_PCREL_RELA, R_NDS32_INSN16 }; + + int reloc_off = 0, cond_removed = 0; + bfd_vma laddr; + Elf_Internal_Rela *cond_irel, *em_irel, *irelend, *insn_irel; + int pic_ext_target = 0; + unsigned int i; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16, re_insn16 = 0; + unsigned long reloc; - foff = calculate_got_memory_address (abfd, link_info, irel, - symtab_hdr) - local_sda; + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; - if (foff < 0x3f000 && foff >= -0x3f000) - { - /* Turn LW to LWI.GP. Change relocation type to R_NDS32_GOT_REL. */ - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_GOT17S2_RELA); - } - else - continue; + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ + em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_EMPTY, irel->r_addend); - bfd_putb32 (insn, contents + laddr); - if (i1_irelfn != irelend) - { - i1_irelfn->r_addend |= 1; - *again = TRUE; - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_SUFF) - { - int opc_insn_gotoff; + if (em_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP6 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - insn = bfd_getb32 (contents + laddr); - if (insn & 0x80000000) - continue; + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr, + &pic_ext_target); - if (nds32_elf_check_dup_relocs - (irel, internal_relocs, irelend, R_NDS32_GOTOFF_SUFF)) - continue; + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + || foff >= CONSERVATIVE_24BIT_S1) + return FALSE; - seq_len = insn_len = 4; + insn = bfd_getb32 (contents + laddr); + /* Check instruction size. */ + if (insn & 0x80000000) + { + *seq_len = 0; + insn16 = insn >> 16; + nds32_elf_convert_branch (insn16, 0, &re_insn16, &re_insn); + } + else + nds32_elf_convert_branch (0, insn, &re_insn16, &re_insn); - i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, - R_NDS32_PTR_RESOLVED); - nds32_elf_final_sda_base (sec->output_section->owner, link_info, - &local_sda, FALSE); - access_addr = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); - foff = access_addr - local_sda; + /* For simplicity of coding, we are going to modify the section + contents, the section relocs, and the BFD symbol table. We + must tell the rest of the code not to free up this + information. It would be possible to instead create a table + of changes which have to be made, as is done in coff-mips.c; + that would be more work, but would require less memory when + the linker is run. */ - if (foff >= 0x3f000 || foff < -0x3f000) - continue; + if (N32_OP6 (re_insn) == N32_OP6_BR1 + && (foff >= -CONSERVATIVE_14BIT_S1 && foff < CONSERVATIVE_14BIT_S1)) + { + /* beqs label ; 15_PCREL */ + bfd_putb32 (re_insn, contents + em_irel->r_offset); + reloc = R_NDS32_15_PCREL_RELA; + cond_removed = 1; + } + else if (N32_OP6 (re_insn) == N32_OP6_BR2 + && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) + { + /* beqz label ; 17_PCREL */ + bfd_putb32 (re_insn, contents + em_irel->r_offset); + reloc = R_NDS32_17_PCREL_RELA; + cond_removed = 1; + } + else if (foff >= -CONSERVATIVE_24BIT_S1 - reloc_off + && foff < CONSERVATIVE_24BIT_S1 - reloc_off) + { + /* Relax to one of the following 2 variations - /* Concatenate opcode and sub-opcode for switch case. - It may be MEM or ALU1. */ - opc_insn_gotoff = (N32_OP6 (insn) << 8) | (insn & 0xff); - switch (opc_insn_gotoff) - { - case (N32_OP6_MEM << 8) | N32_MEM_LW: - /* 4-byte aligned. */ - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA); - break; - case (N32_OP6_MEM << 8) | N32_MEM_SW: - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (7, 17, 3)); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA); - break; - case (N32_OP6_MEM << 8) | N32_MEM_LH: - /* 2-byte aligned. */ - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), 0); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); - break; - case (N32_OP6_MEM << 8) | N32_MEM_LHS: - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18)); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); - break; - case (N32_OP6_MEM << 8) | N32_MEM_SH: - insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19)); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); - break; - case (N32_OP6_MEM << 8) | N32_MEM_LB: - /* 1-byte aligned. */ - insn = N32_TYPE1 (LBGP, N32_RT5 (insn), 0); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); - break; - case (N32_OP6_MEM << 8) | N32_MEM_LBS: - insn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19)); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); - break; - case (N32_OP6_MEM << 8) | N32_MEM_SB: - insn = N32_TYPE1 (SBGP, N32_RT5 (insn), 0); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); - break; - case (N32_OP6_ALU1 << 8) | N32_ALU1_ADD_SLLI: - if (N32_SH5 (insn) != 0) - continue; - insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); - break; - default: - continue; - } + case 2-4; 1st insn convertible, 16-bit on. + bnes38 rt, ra, .L1 ; LONGJUMP5/9_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + $1: - bfd_putb32 (insn, contents + laddr); - if (i1_irelfn != irelend) - { - i1_irelfn->r_addend |= 1; - *again = TRUE; - } - if ((i2_irelfn = - find_relocs_at_address (irel, internal_relocs, irelend, - R_NDS32_INSN16)) != irelend) - i2_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_MULCALL_SUFF) - { - /* The last bit of r_addend indicates its a two instruction block. */ - i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, - R_NDS32_PTR_RESOLVED); - if ((i1_irelfn != irelend && (i1_irelfn->r_addend & 1)) - || (nds32_elf_insn_size (abfd, contents, irel->r_offset) != 4 - && !(i1_irelfn != irelend && (i1_irelfn->r_addend & 2)))) - continue; + case 4-4; 1st insn not convertible + bne rt, ra, .L1 ; LONGJUMP5/15_PCREL/INSN16 + j label ; 25_PCREL/INSN16 + .L1: */ - /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, irel, isymbuf, symtab_hdr, - &pic_ext_target); + /* Use j label as second instruction. */ + insn = INSN_J; + reloc = R_NDS32_25_PCREL_RELA; + bfd_putb32 (insn, contents + em_irel->r_offset); + } + else + return FALSE; - /* This condition only happened when symbol is undefined. */ - if (pic_ext_target || foff == 0) - continue; - if (foff < -0x1000000 || foff >= 0x1000000) - continue; + /* Set all relocations. */ + em_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (em_irel->r_info), reloc); - if (i1_irelfn != irelend && (i1_irelfn->r_addend & 2)) - { - seq_len = nds32_elf_insn_size (abfd, contents, irel->r_offset); - seq_len += nds32_elf_insn_size (abfd, contents, - irel->r_offset + seq_len); - } - else - seq_len = 4; - insn_len = 4; + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, em_irel->r_offset); + cond_irel->r_addend = 1; - insn = INSN_JAL; - bfd_putb32 (insn, contents + laddr); - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_25_PCREL_RELA); + /* Use INSN16 of first branch instruction to distinguish if keeping + INSN16 of final instruction or not. */ + insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_offset); + if (insn_irel == irelend) + { + /* Clean the final INSN16. */ + insn_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, em_irel->r_offset); + insn_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_NONE); + } + + if (cond_removed == 1) + { + *insn_len = 0; + + /* Clear relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - if (i1_irelfn != irelend) + for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++) + { + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (cond_irel != irelend) { - i1_irelfn->r_addend |= 1; - *again = TRUE; + if (*seq_len == 0 + && (ELF32_R_TYPE (cond_irel->r_info) == R_NDS32_INSN16)) + { + /* If the branch instruction is 2 byte, it cannot remove + directly. Only convert it to nop16 and remove it after + checking alignment issue. */ + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + laddr); + cond_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG; + } + else + cond_irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), R_NDS32_NONE); } - while (i1_irelfn != irelend - && irel->r_offset == i1_irelfn->r_offset) - i1_irelfn++; - for (; - i1_irelfn != irelend - && i1_irelfn->r_offset < irel->r_offset + 4; i1_irelfn++) - i1_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), R_NDS32_NONE); } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_PLTBLOCK) - { - i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, - R_NDS32_PLT_GOTREL_HI20); + } + else + { + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_NDS32_LONGJUMP5); + } - if (i1_irelfn == irelend) - { - (*_bfd_error_handler) - ("%B: warning: R_NDS32_PLTBLOCK points to unrecognized reloc at 0x%lx.", - abfd, (long) irel->r_offset); - continue; - } + return TRUE; +} - nds32_elf_final_sda_base (sec->output_section->owner, link_info, - &local_sda, FALSE); - foff = - calculate_plt_offset (abfd, sec, link_info, isymbuf, hi_irelfn, - symtab_hdr); +/* Relax LONGJUMP7 relocation for nds32_elf_relax_section. */ - if (foff < -0x1000000 || foff >= 0x1000000) - { - foff = (bfd_signed_vma) (calculate_plt_memory_address - (abfd, link_info, isymbuf, hi_irelfn, - symtab_hdr) - local_sda); - if (foff >= -0x4000 && foff < 0x4000) - { - /* addi $rt, $gp, lo15(Sym - SDA_BASE) - jral $rt */ +static bfd_boolean +nds32_elf_relax_longjump7 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + /* There are 2 variations for LONGJUMP5 + case 2-4; 1st insn convertible, 16-bit on. + movi55 ta, imm11 ; LONGJUMP7/INSN16 + beq rt, ta, label ; 15_PCREL + + case 4-4; 1st insn not convertible + movi55 ta, imm11 ; LONGJUMP7/INSN16 + beq rt, ta, label ; 15_PCREL */ + + bfd_vma laddr; + Elf_Internal_Rela *cond_irel, *irelend, *insn_irel; + int pic_ext_target = 0; + bfd_signed_vma foff; + uint32_t insn, re_insn = 0; + uint16_t insn16; + uint32_t imm11; - /* TODO: We can use add.gp here, once ISA V1 is obsolete. */ - insn = N32_TYPE2 (ADDI, N32_RT5 (insn), REG_GP, 0); - bfd_putb32 (insn, contents + irel->r_offset + 8); + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; - i1_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_PLT_GOTREL_LO15); - i1_irelfn->r_addend = hi_irelfn->r_addend; + /* Get the reloc for the address from which the register is + being loaded. This reloc will tell us which function is + actually being called. */ - seq_len = 8; - } - else if (foff >= -0x80000 && foff < 0x80000) - { - /* movi $rt, lo20(Sym - SDA_BASE) PLT_GOTREL_LO20 - add $rt, $gp, $rt INSN16 - jral $rt INSN16 */ - - for (i1_irelfn = irel; - i1_irelfn->r_offset < irel->r_offset + 4; i1_irelfn++) - ; - for (; i1_irelfn->r_offset < irel->r_offset + 8; i1_irelfn++) - if (ELF32_R_TYPE (i1_irelfn->r_info) != R_NDS32_PLT_GOTREL_LO12) - i2_irelfn = i1_irelfn; - else if (ELF32_R_TYPE (i1_irelfn->r_info) != R_NDS32_LABEL) - i1_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i1_irelfn->r_info), - R_NDS32_NONE); - if (i2_irelfn) - { - insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); - bfd_putb32 (insn, contents + irel->r_offset + 4); - i2_irelfn->r_info = - ELF32_R_INFO (ELF32_R_SYM (i2_irelfn->r_info), - R_NDS32_PLT_GOTREL_LO20); - } - seq_len = 4; - } - else - continue; + cond_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_15_PCREL_RELA, irel->r_addend); + if (cond_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LONGJUMP7 points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - } - else - { - /* jal Sym INSN16/25_PLTREL */ - for (i1_irelfn = irel; - i1_irelfn->r_offset < irel->r_offset + 12; i1_irelfn++) - ; - - i2_irelfn = i1_irelfn - 1; - i2_irelfn->r_offset = i1_irelfn->r_offset; - i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), - R_NDS32_25_PLTREL); - i2_irelfn->r_addend = hi_irelfn->r_addend; - insn = INSN_JAL; - bfd_putb32 (insn, contents + irel->r_offset + 12); - seq_len = 12; - } + /* Get the value of the symbol referred to by the reloc. */ + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr, + &pic_ext_target); - insn_len = 0; - } - else - continue; + if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_8BIT_S1 + || foff >= CONSERVATIVE_8BIT_S1) + return FALSE; - if (seq_len - insn_len > 0) - { - if (!insert_nds32_elf_blank - (&relax_blank_list, irel->r_offset + insn_len, - seq_len - insn_len)) - goto error_return; - *again = TRUE; - } + /* Get the first instruction for its size. */ + insn = bfd_getb32 (contents + laddr); + if (insn & 0x80000000) + { + *seq_len = 0; + /* Get the immediate from movi55. */ + imm11 = N16_IMM5S (insn >> 16); + } + else + { + /* Get the immediate from movi. */ + imm11 = N32_IMM20S (insn); } - calc_nds32_blank_total (relax_blank_list); + /* Get the branch instruction. */ + insn = bfd_getb32 (contents + irel->r_addend); + /* Convert instruction to BR3. */ + if ((insn >> 14) & 0x1) + re_insn = N32_BR3 (BNEC, N32_RT5 (insn), imm11, 0); + else + re_insn = N32_BR3 (BEQC, N32_RT5 (insn), imm11, 0); - if (table->relax_fp_as_gp) - { - if (!nds32_relax_fp_as_gp (link_info, abfd, sec, internal_relocs, - irelend, isymbuf)) - goto error_return; + bfd_putb32 (re_insn, contents + cond_irel->r_offset); - if (*again == FALSE) + /* Set all relocations. */ + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_WORD_9_PCREL_RELA); + + /* Clean relocations. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + insn_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_INSN16, irel->r_offset); + if (insn_irel != irelend) + { + if (*seq_len == 0) { - if (!nds32_fag_remove_unused_fpbase (abfd, sec, internal_relocs, - irelend)) - goto error_return; + /* If the first insntruction is 16bit, convert it to nop16. */ + insn16 = NDS32_NOP16; + bfd_putb16 (insn16, contents + laddr); + insn_irel->r_addend = R_NDS32_INSN16_CONVERT_FLAG; } + else + cond_irel->r_info = ELF32_R_INFO (ELF32_R_SYM (cond_irel->r_info), + R_NDS32_NONE); } + *insn_len = 0; - if (*again == FALSE) - { - /* This code block is used to adjust 4-byte alignment by relax a pair - of instruction a time. + return TRUE; +} - It recognizes three types of relocations. - 1. R_NDS32_LABEL - a aligment. - 2. R_NDS32_INSN16 - relax a 32-bit instruction to 16-bit. - 3. is_16bit_NOP () - remove a 16-bit instruction. +#define GET_LOADSTORE_RANGE(addend) (((addend) >> 8) & 0x3f) - FIXME: It seems currently implementation only support 4-byte aligment. - We should handle any-aligment. */ +/* Relax LOADSTORE relocation for nds32_elf_relax_section. */ - Elf_Internal_Rela *insn_rel = NULL; - Elf_Internal_Rela *label_rel = NULL; - Elf_Internal_Rela *tmp_rel, tmp2_rel, *tmp3_rel = NULL; +static bfd_boolean +nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, int load_store_relax) +{ + int eliminate_sethi = 0, range_type, i; + bfd_vma local_sda, laddr; + int seq_len; /* Original length of instruction sequence. */ + uint32_t insn; + Elf_Internal_Rela *hi_irelfn = NULL, *irelend; + bfd_vma access_addr = 0; + bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */ + enum elf_nds32_reloc_type checked_types[] = + { R_NDS32_HI20_RELA, R_NDS32_GOT_HI20, + R_NDS32_GOTPC_HI20, R_NDS32_GOTOFF_HI20, + R_NDS32_PLTREL_HI20, R_NDS32_PLT_GOTREL_HI20, + R_NDS32_TLS_LE_HI20 + }; - /* Checking for branch relaxation relies on the relocations to - be sorted on 'r_offset'. This is not guaranteed so we must sort. */ - nds32_insertion_sort (internal_relocs, sec->reloc_count, - sizeof (Elf_Internal_Rela), compar_reloc); + irelend = internal_relocs + sec->reloc_count; + seq_len = GET_SEQ_LEN (irel->r_addend); + laddr = irel->r_offset; + *insn_len = seq_len; - nds32_elf_final_sda_base (sec->output_section->owner, link_info, - &local_sda, FALSE); + /* Get the high part relocation. */ + for (i = 0; (unsigned) i < sizeof (checked_types); i++) + { + hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, + checked_types[i], laddr); + if (hi_irelfn != irelend) + break; + } - /* Force R_NDS32_LABEL before R_NDS32_INSN16. */ - /* FIXME: Can we generate the right order in assembler? - So we don't have to swapping them here. */ - for (label_rel = internal_relocs, insn_rel = internal_relocs; - label_rel < irelend; label_rel++) - { - if (ELF32_R_TYPE (label_rel->r_info) != R_NDS32_LABEL) - continue; + if (hi_irelfn == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_LOADSTORE points to unrecognized" + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; + } - /* Find the first reloc has the same offset with label_rel. */ - while (insn_rel < irelend && insn_rel->r_offset < label_rel->r_offset) - insn_rel++; + range_type = GET_LOADSTORE_RANGE (irel->r_addend); + nds32_elf_final_sda_base (sec->output_section->owner, + link_info, &local_sda, FALSE); - for (; - insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset; - insn_rel++) - /* Check if there were R_NDS32_INSN16 and R_NDS32_LABEL at the same - address. */ - if (ELF32_R_TYPE (insn_rel->r_info) == R_NDS32_INSN16) - break; + switch (ELF32_R_TYPE (hi_irelfn->r_info)) + { + case R_NDS32_HI20_RELA: + insn = bfd_getb32 (contents + laddr); + access_addr = + calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); + + if (range_type == NDS32_LOADSTORE_IMM) + { + struct elf_link_hash_entry *h = NULL; + int indx; - if (insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset - && insn_rel < label_rel) + if (ELF32_R_SYM (hi_irelfn->r_info) >= symtab_hdr->sh_info) { - /* Swap the two reloc if the R_NDS32_INSN16 is before R_NDS32_LABEL. */ - memcpy (&tmp2_rel, insn_rel, sizeof (Elf_Internal_Rela)); - memcpy (insn_rel, label_rel, sizeof (Elf_Internal_Rela)); - memcpy (label_rel, &tmp2_rel, sizeof (Elf_Internal_Rela)); + indx = ELF32_R_SYM (hi_irelfn->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; } - } - label_rel = NULL; - insn_rel = NULL; - /* If there were a sequence of R_NDS32_LABEL end up with .align 2 or higher, - remove other R_NDS32_LABEL with lower alignment. - If an R_NDS32_INSN16 in between R_NDS32_LABELs must be converted, - then the R_NDS32_LABEL sequence is broke. */ - for (tmp_rel = internal_relocs; tmp_rel < irelend; tmp_rel++) - { - if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_LABEL) + if ((access_addr < CONSERVATIVE_20BIT) + && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0))) { - if (label_rel == NULL) - { - if (tmp_rel->r_addend < 2) - label_rel = tmp_rel; - continue; - } - else if (tmp_rel->r_addend > 1) - { - for (tmp3_rel = label_rel; tmp3_rel < tmp_rel; tmp3_rel++) - { - if (ELF32_R_TYPE (tmp3_rel->r_info) == R_NDS32_LABEL - && tmp3_rel->r_addend < 2) - tmp3_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (tmp3_rel->r_info), R_NDS32_NONE); - } - label_rel = NULL; - } + eliminate_sethi = 1; + break; } - else if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16) + + /* This is avoid to relax symbol address which is fixed + relocations. Ex: _stack. */ + if (h && bfd_is_abs_section (h->root.u.def.section)) + return FALSE; + } + + if (!load_store_relax) + return FALSE; + + /* Case for set gp register. */ + if (N32_RT5 (insn) == REG_GP) + break; + + if (range_type == NDS32_LOADSTORE_FLOAT_S + || range_type == NDS32_LOADSTORE_FLOAT_S) + { + range_l = sdata_range[0][0]; + range_h = sdata_range[0][1]; + } + else + { + range_l = sdata_range[1][0]; + range_h = sdata_range[1][1]; + } + break; + + case R_NDS32_GOT_HI20: + access_addr = + calculate_got_memory_address (abfd, link_info, hi_irelfn, symtab_hdr); + + /* If this symbol is not in .got, the return value will be -1. + Since the gp value is set to SDA_BASE but not GLOBAL_OFFSET_TABLE, + a negative offset is allowed. */ + if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_PLT_GOTREL_HI20: + access_addr = calculate_plt_memory_address (abfd, link_info, isymbuf, + hi_irelfn, symtab_hdr); + + if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_GOTOFF_HI20: + access_addr = + calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); + + if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_GOTPC_HI20: + /* The access_addr must consider r_addend of hi_irel. */ + access_addr = sec->output_section->vma + sec->output_offset + + irel->r_offset + hi_irelfn->r_addend; + + if ((bfd_signed_vma) (local_sda - access_addr) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (local_sda - access_addr) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + case R_NDS32_TLS_LE_HI20: + access_addr = + calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + access_addr -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + if ((range_type == NDS32_LOADSTORE_IMM) + && (bfd_signed_vma) (access_addr) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (access_addr) >= -CONSERVATIVE_20BIT) + eliminate_sethi = 1; + break; + + default: + return FALSE; + } + + /* Delete sethi instruction. */ + if (eliminate_sethi == 1 + || (local_sda <= access_addr && (access_addr - local_sda) < range_h) + || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) + { + hi_irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (hi_irelfn->r_info), R_NDS32_NONE); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + *insn_len = 0; + } + return TRUE; +} + +/* Relax LO12 relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, bfd_byte *contents, + Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr) +{ + uint32_t insn; + bfd_vma local_sda, laddr; + unsigned long reloc; + bfd_vma access_addr; + bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */ + Elf_Internal_Rela *irelfn = NULL, *irelend; + struct elf_link_hash_entry *h = NULL; + int indx; + + /* For SDA base relative relaxation. */ + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + if (!is_sda_access_insn (insn) && N32_OP6 (insn) != N32_OP6_ORI) + return; + + access_addr = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + + if (ELF32_R_SYM (irel->r_info) >= symtab_hdr->sh_info) + { + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + } + + if (N32_OP6 (insn) == N32_OP6_ORI && access_addr < CONSERVATIVE_20BIT + && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0))) + { + reloc = R_NDS32_20_RELA; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); + bfd_putb32 (insn, contents + laddr); + } + /* This is avoid to relax symbol address which is fixed + relocations. Ex: _stack. */ + else if (N32_OP6 (insn) == N32_OP6_ORI + && h && bfd_is_abs_section (h->root.u.def.section)) + return; + else + { + range_l = sdata_range[1][0]; + range_h = sdata_range[1][1]; + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_LO12S0_RELA: + reloc = R_NDS32_SDA19S0_RELA; + break; + case R_NDS32_LO12S1_RELA: + reloc = R_NDS32_SDA18S1_RELA; + break; + case R_NDS32_LO12S2_RELA: + reloc = R_NDS32_SDA17S2_RELA; + break; + case R_NDS32_LO12S2_DP_RELA: + range_l = sdata_range[0][0]; + range_h = sdata_range[0][1]; + reloc = R_NDS32_SDA12S2_DP_RELA; + break; + case R_NDS32_LO12S2_SP_RELA: + range_l = sdata_range[0][0]; + range_h = sdata_range[0][1]; + reloc = R_NDS32_SDA12S2_SP_RELA; + break; + default: + return; + } + + /* There are range_h and range_l because linker has to promise + all sections move cross one page together. */ + if ((local_sda <= access_addr && (access_addr - local_sda) < range_h) + || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) + { + if (N32_OP6 (insn) == N32_OP6_ORI && N32_RT5 (insn) == REG_GP) { - if (label_rel - && label_rel->r_offset != tmp_rel->r_offset - && (is_convert_32_to_16 (abfd, sec, tmp_rel, internal_relocs, - irelend, &insn16) - || is_16bit_NOP (abfd, sec, tmp_rel))) - { - label_rel = NULL; - } + /* Maybe we should add R_NDS32_INSN16 reloc type here + or manually do some optimization. sethi can't be + eliminated when updating $gp so the relative ori + needs to be preserved. */ + return; } + if (!turn_insn_to_sda_access (insn, ELF32_R_TYPE (irel->r_info), + &insn)) + return; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + bfd_putb32 (insn, contents + laddr); + + irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_INSN16); + /* SDA17 must keep INSN16 for converting fp_as_gp. */ + if (irelfn != irelend && reloc != R_NDS32_SDA17S2_RELA) + irelfn->r_info = + ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_NDS32_NONE); + } - label_rel = NULL; - insn_rel = NULL; + } + return; +} - /* Optimized for speed and nothing has not been relaxed. - It's time to align labels. - We may convert a 16-bit instruction right before a label to - 32-bit, in order to align the label if necessary - all reloc entries has been sorted by r_offset. */ - for (irel = internal_relocs; irel < irelend; irel++) +/* Relax low part of PIC instruction pattern. */ + +static void +nds32_elf_relax_piclo12 (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + uint32_t insn; + bfd_vma local_sda, laddr; + bfd_signed_vma foff; + unsigned long reloc; + + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + if (N32_OP6 (insn) != N32_OP6_ORI) + return; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12) + { + foff = calculate_got_memory_address (abfd, link_info, irel, + symtab_hdr) - local_sda; + reloc = R_NDS32_GOT20; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12) + { + foff = calculate_plt_memory_address (abfd, link_info, isymbuf, irel, + symtab_hdr) - local_sda; + reloc = R_NDS32_PLT_GOTREL_LO20; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12) + { + foff = calculate_memory_address (abfd, irel, isymbuf, + symtab_hdr) - local_sda; + reloc = R_NDS32_GOTOFF; + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTPC_LO12) + { + foff = local_sda - sec->output_section->vma + sec->output_offset + + irel->r_offset + irel->r_addend; + reloc = R_NDS32_GOTPC20; + } + else + return; + + if ((foff < CONSERVATIVE_20BIT) && (foff >= -CONSERVATIVE_20BIT)) + { + /* Turn into MOVI. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); + bfd_putb32 (insn, contents + laddr); + } +} + +/* Relax low part of LE TLS instruction pattern. */ + +static void +nds32_elf_relax_letlslo12 (struct bfd_link_info *link_info, bfd *abfd, + Elf_Internal_Rela *irel, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr) +{ + uint32_t insn; + bfd_vma laddr; + bfd_signed_vma foff; + unsigned long reloc; + + laddr = irel->r_offset; + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + insn = bfd_getb32 (contents + laddr); + + if ( (bfd_signed_vma) (foff) < CONSERVATIVE_20BIT + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_20BIT) + { + /* Pattern sethi-ori transform to movi. */ + reloc = R_NDS32_TLS_LE_20; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); + bfd_putb32 (insn, contents + laddr); + } +} + +/* Relax LE TLS calculate address instruction pattern. */ + +static void +nds32_elf_relax_letlsadd (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + /* Local TLS non-pic + sethi ta, hi20(symbol@tpoff) ; TLS_LE_HI20 + ori ta, ta, lo12(symbol@tpoff) ; TLS_LE_LO12 + add ra, ta, tp ; TLS_LE_ADD */ + + uint32_t insn; + bfd_vma laddr; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + + /* The range is +/-16k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT) + { + /* Transform add to addi. */ + insn = N32_TYPE2 (ADDI, N32_RT5 (insn), N32_RB5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S0); + + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + } +} + +/* Relax LE TLS load store instruction pattern. */ + +static void +nds32_elf_relax_letlsls (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + + uint32_t insn; + bfd_vma laddr; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + int success = 0; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); + foff -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); + + switch ((N32_OP6 (insn) << 8) | (insn & 0xff)) + { + case (N32_OP6_MEM << 8) | N32_MEM_LB: + case (N32_OP6_MEM << 8) | N32_MEM_SB: + case (N32_OP6_MEM << 8) | N32_MEM_LBS: + /* The range is +/-16k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT) + { + insn = + ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S0); + success = 1; + break; + } + case (N32_OP6_MEM << 8) | N32_MEM_LH: + case (N32_OP6_MEM << 8) | N32_MEM_SH: + case (N32_OP6_MEM << 8) | N32_MEM_LHS: + /* The range is +/-32k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT_S1 + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT_S1) { - if (ELF32_R_TYPE (irel->r_info) != R_NDS32_INSN16 - && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL) - continue; + insn = + ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S1); + success = 1; + break; + } + case (N32_OP6_MEM << 8) | N32_MEM_LW: + case (N32_OP6_MEM << 8) | N32_MEM_SW: + /* The range is +/-64k. */ + if ((bfd_signed_vma) (foff) < CONSERVATIVE_15BIT_S2 + && (bfd_signed_vma) (foff) >= -CONSERVATIVE_15BIT_S2) + { + insn = + ((insn & 0xff) << 25) | (insn & 0x1f00000) | ((insn & 0x7c00) << 5); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_TLS_LE_15S2); + success = 1; + break; + } + default: + break; + } - /* Search for INSN16 reloc. */ - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_INSN16) - { - if (label_rel) - { - /* Previous LABEL reloc exists. Try to resolve it. */ - if (label_rel->r_offset == irel->r_offset) - { - /* LABEL and INSN are at the same addr. */ - if ((irel->r_offset - - get_nds32_elf_blank_total (&relax_blank_list, - irel->r_offset, - 1)) & 0x02) - { - if (irel->r_addend > 1) - { - /* Force to relax. */ - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), - R_NDS32_NONE); - if (is_convert_32_to_16 - (abfd, sec, irel, internal_relocs, irelend, - &insn16)) - { - nds32_elf_write_16 (abfd, contents, irel, - internal_relocs, irelend, - insn16); - - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, irel->r_offset + 2, - 2)) - goto error_return; - } - else if (is_16bit_NOP (abfd, sec, irel)) - { - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, irel->r_offset, 2)) - goto error_return; - } - } - else - { - if (is_convert_32_to_16 - (abfd, sec, irel, internal_relocs, irelend, - &insn16) - || is_16bit_NOP (abfd, sec, irel)) - insn_rel = irel; - } - label_rel = NULL; - continue; - } - else - { - /* Already aligned, reset LABEL and keep INSN16. */ - } - } - else - { - /* No INSN16 to relax, we don't want to insert 16-bit. */ - /* Nop here, just signal the algorithm is wrong. */ - } - label_rel = NULL; - } - /* A new INSN16 found, resize the old one. */ - else if (insn_rel) - { - if (!is_convert_32_to_16 - (abfd, sec, irel, internal_relocs, irelend, - &insn16) - && !is_16bit_NOP (abfd, sec, irel)) - { - irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), - R_NDS32_NONE); - continue; - } - /* Previous INSN16 reloc exists, reduce its size to 16-bit. */ - if (is_convert_32_to_16 - (abfd, sec, insn_rel, internal_relocs, irelend, - &insn16)) - { - nds32_elf_write_16 (abfd, contents, insn_rel, - internal_relocs, irelend, insn16); + if (success) + { + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + } +} - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, insn_rel->r_offset + 2, 2)) - goto error_return; - } - else if (is_16bit_NOP (abfd, sec, insn_rel)) - { - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, insn_rel->r_offset, 2)) - goto error_return; - } - insn_rel->r_info = - ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), - R_NDS32_NONE); - insn_rel = NULL; - } +/* Relax PTR relocation for nds32_elf_relax_section. */ - if (is_convert_32_to_16 - (abfd, sec, irel, internal_relocs, irelend, &insn16) - || is_16bit_NOP (abfd, sec, irel)) - { - insn_rel = irel; - } - /* Save the new one for later use. */ - } - /* Search for label. */ - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL) - { - /* Label on 16-bit instruction, just reset this reloc. */ - insn16 = bfd_getb16 (contents + irel->r_offset); - if ((irel->r_addend & 0x1f) < 2 && (insn16 & 0x8000)) - { - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - continue; - } +static bfd_boolean +nds32_elf_relax_ptr (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, int *insn_len, + int *seq_len, bfd_byte *contents) +{ + Elf_Internal_Rela *ptr_irel, *irelend, *count_irel, *re_irel; - if (!optimize && (irel->r_addend & 0x1f) < 2) - { - irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - continue; - } + irelend = internal_relocs + sec->reloc_count; - /* Try to align this label. */ - if (insn_rel) - { - int force_relax = 0; + re_irel = + find_relocs_at_address_addr (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED, irel->r_addend); - /* If current location is .align 2, we can't relax previous 32-bit inst. */ - /* Or the alignment constraint is broke. */ - if ((irel->r_addend & 0x1f) < 2) - { - /* Label_rel always seats before insn_rel after our sort. */ + if (re_irel == irelend) + { + (*_bfd_error_handler) + ("%B: warning: R_NDS32_PTR points to unrecognized reloc at 0x%lx.", + abfd, (long) irel->r_offset); + return FALSE; + } - /* INSN16 and LABEL at different location. */ - /* Search for INSN16 at LABEL location. */ - for (tmp_rel = irel; - tmp_rel < irelend && tmp_rel->r_offset == irel->r_offset; - tmp_rel++) - { - if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16) - break; - } + if (re_irel->r_addend != 1) + return FALSE; - if (tmp_rel < irelend - && tmp_rel->r_offset == irel->r_offset) - { - if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16) - { - if (is_convert_32_to_16 - (abfd, sec, tmp_rel, internal_relocs, - irelend, &insn16) - || is_16bit_NOP (abfd, sec, tmp_rel)) - force_relax = 1; - } - } - } + /* Pointed target is relaxed and no longer needs this void *, + change the type to NONE. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - if ((irel->r_offset - - get_nds32_elf_blank_total (&relax_blank_list, - irel->r_offset, 1)) & 0x01) - { - /* Can't align on byte, BIG ERROR. */ - } - else + /* Find PTR_COUNT to decide remove it or not. If PTR_COUNT does + not exist, it means only count 1 and remove it directly. */ + /* TODO: I hope we can obsolate R_NDS32_COUNT in the future. */ + count_irel = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_COUNT); + ptr_irel = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR); + if (count_irel != irelend) + { + if (--count_irel->r_addend > 0) + return FALSE; + } + + if (ptr_irel != irelend) + return FALSE; + + /* If the PTR_COUNT is already 0, remove current instruction. */ + *seq_len = nds32_elf_insn_size (abfd, contents, irel->r_offset); + *insn_len = 0; + return TRUE; +} + +/* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + uint32_t insn; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + bfd_vma local_sda, laddr; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + /* FIXME: It's a little trouble to turn JRAL5 to JAL since + we need additional space. It might be help if we could + borrow some space from instructions to be eliminated + such as sethi, ori, add. */ + if (insn & 0x80000000) + return; + + if (nds32_elf_check_dup_relocs + (irel, internal_relocs, irelend, R_NDS32_PLT_GOT_SUFF)) + return; + + i1_irelfn = + find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + + /* FIXIT 090606 + The boundary should be reduced since the .plt section hasn't + been created and the address of specific entry is still unknown + Maybe the range between the function call and the begin of the + .text section can be used to decide if the .plt is in the range + of function call. */ + + if (N32_OP6 (insn) == N32_OP6_ALU1 + && N32_SUB5 (insn) == N32_ALU1_ADD) + { + /* Get the value of the symbol referred to by the reloc. */ + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + foff = (bfd_signed_vma) (calculate_plt_memory_address + (abfd, link_info, isymbuf, irel, + symtab_hdr) - local_sda); + /* This condition only happened when symbol is undefined. */ + if (foff == 0) + return; + + if (foff < -CONSERVATIVE_19BIT || foff >= CONSERVATIVE_19BIT) + return; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_NDS32_PLT_GOTREL_LO19); + /* addi.gp */ + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); + } + else if (N32_OP6 (insn) == N32_OP6_JREG + && N32_SUB5 (insn) == N32_JREG_JRAL) + { + /* Get the value of the symbol referred to by the reloc. */ + foff = + calculate_plt_offset (abfd, sec, link_info, isymbuf, irel, symtab_hdr); + /* This condition only happened when symbol is undefined. */ + if (foff == 0) + return; + if (foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) + return; + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_25_PLTREL); + insn = INSN_JAL; + } + else + return; + + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } +} + +/* Relax GOT_SUFF relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_got_suff (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Shdr *symtab_hdr, + bfd_boolean *again) +{ + uint32_t insn; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *irelend; + bfd_vma local_sda, laddr; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + if (insn & 0x80000000) + return; + + if (nds32_elf_check_dup_relocs + (irel, internal_relocs, irelend, R_NDS32_GOT_SUFF)) + return; + + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + foff = calculate_got_memory_address (abfd, link_info, irel, + symtab_hdr) - local_sda; + + if (foff < CONSERVATIVE_19BIT && foff >= -CONSERVATIVE_19BIT) + { + /* Turn LW to LWI.GP. Change relocation type to R_NDS32_GOT_REL. */ + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_GOT17S2_RELA); + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + } +} + +/* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + int opc_insn_gotoff; + uint32_t insn; + bfd_signed_vma foff; + Elf_Internal_Rela *i1_irelfn, *i2_irelfn, *irelend; + bfd_vma local_sda, laddr; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + if (insn & 0x80000000) + return; + + if (nds32_elf_check_dup_relocs + (irel, internal_relocs, irelend, R_NDS32_GOTOFF_SUFF)) + return; + + i1_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + foff = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + foff = foff - local_sda; + + if (foff >= CONSERVATIVE_19BIT || foff < -CONSERVATIVE_19BIT) + return; + + /* Concatenate opcode and sub-opcode for switch case. + It may be MEM or ALU1. */ + opc_insn_gotoff = (N32_OP6 (insn) << 8) | (insn & 0xff); + switch (opc_insn_gotoff) + { + case (N32_OP6_MEM << 8) | N32_MEM_LW: + /* 4-byte aligned. */ + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_SW: + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (7, 17, 3)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA17S2_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LH: + /* 2-byte aligned. */ + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LHS: + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (18)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_SH: + insn = N32_TYPE1 (HWGP, N32_RT5 (insn), __BIT (19)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA18S1_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LB: + /* 1-byte aligned. */ + insn = N32_TYPE1 (LBGP, N32_RT5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_LBS: + insn = N32_TYPE1 (LBGP, N32_RT5 (insn), __BIT (19)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + case (N32_OP6_MEM << 8) | N32_MEM_SB: + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), 0); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + case (N32_OP6_ALU1 << 8) | N32_ALU1_ADD: + insn = N32_TYPE1 (SBGP, N32_RT5 (insn), __BIT (19)); + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_SDA19S0_RELA); + break; + default: + return; + } + + bfd_putb32 (insn, contents + laddr); + if (i1_irelfn != irelend) + { + i1_irelfn->r_addend |= 1; + *again = TRUE; + } + if ((i2_irelfn = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_INSN16)) != irelend) + i2_irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + +} + +static bfd_boolean +nds32_relax_adjust_label (bfd *abfd, asection *sec, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, + nds32_elf_blank_t **relax_blank_list, + int optimize, int opt_size) +{ + /* This code block is used to adjust 4-byte alignment by relax a pair + of instruction a time. + + It recognizes three types of relocations. + 1. R_NDS32_LABEL - a aligment. + 2. R_NDS32_INSN16 - relax a 32-bit instruction to 16-bit. + 3. is_16bit_NOP () - remove a 16-bit instruction. */ + + /* TODO: It seems currently implementation only support 4-byte aligment. + We should handle any-aligment. */ + + Elf_Internal_Rela *insn_rel = NULL, *label_rel = NULL, *irel; + Elf_Internal_Rela *tmp_rel, *tmp2_rel = NULL; + Elf_Internal_Rela rel_temp; + Elf_Internal_Rela *irelend; + bfd_vma address; + uint16_t insn16; + + /* Checking for branch relaxation relies on the relocations to + be sorted on 'r_offset'. This is not guaranteed so we must sort. */ + nds32_insertion_sort (internal_relocs, sec->reloc_count, + sizeof (Elf_Internal_Rela), compar_reloc); + + irelend = internal_relocs + sec->reloc_count; + + /* Force R_NDS32_LABEL before R_NDS32_INSN16. */ + /* FIXME: Can we generate the right order in assembler? + So we don't have to swapping them here. */ + + for (label_rel = internal_relocs, insn_rel = internal_relocs; + label_rel < irelend; label_rel++) + { + if (ELF32_R_TYPE (label_rel->r_info) != R_NDS32_LABEL) + continue; + + /* Find the first reloc has the same offset with label_rel. */ + while (insn_rel < irelend && insn_rel->r_offset < label_rel->r_offset) + insn_rel++; + + for (;insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset; + insn_rel++) + /* Check if there were R_NDS32_INSN16 and R_NDS32_LABEL at the same + address. */ + if (ELF32_R_TYPE (insn_rel->r_info) == R_NDS32_INSN16) + break; + + if (insn_rel < irelend && insn_rel->r_offset == label_rel->r_offset + && insn_rel < label_rel) + { + /* Swap the two reloc if the R_NDS32_INSN16 is + before R_NDS32_LABEL. */ + memcpy (&rel_temp, insn_rel, sizeof (Elf_Internal_Rela)); + memcpy (insn_rel, label_rel, sizeof (Elf_Internal_Rela)); + memcpy (label_rel, &rel_temp, sizeof (Elf_Internal_Rela)); + } + } + + label_rel = NULL; + insn_rel = NULL; + /* If there were a sequence of R_NDS32_LABEL end up with .align 2 + or higher, remove other R_NDS32_LABEL with lower alignment. + If an R_NDS32_INSN16 in between R_NDS32_LABELs must be converted, + then the R_NDS32_LABEL sequence is broke. */ + for (tmp_rel = internal_relocs; tmp_rel < irelend; tmp_rel++) + { + if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_LABEL) + { + if (label_rel == NULL) + { + if (tmp_rel->r_addend < 2) + label_rel = tmp_rel; + continue; + } + else if (tmp_rel->r_addend > 1) + { + /* Remove all LABEL relocation from label_rel to tmp_rel + including relocations with same offset as tmp_rel. */ + for (tmp2_rel = label_rel; tmp2_rel < tmp_rel + || tmp2_rel->r_offset == tmp_rel->r_offset; tmp2_rel++) + { + if (ELF32_R_TYPE (tmp2_rel->r_info) == R_NDS32_LABEL + && tmp2_rel->r_addend < 2) + tmp2_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (tmp2_rel->r_info), + R_NDS32_NONE); + } + label_rel = NULL; + } + } + else if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16 && label_rel) + { + /* A new INSN16 which can be converted, so clear label_rel. */ + if (is_convert_32_to_16 (abfd, sec, tmp_rel, internal_relocs, + irelend, &insn16) + || is_16bit_NOP (abfd, sec, tmp_rel)) + label_rel = NULL; + } + } + + label_rel = NULL; + insn_rel = NULL; + /* Optimized for speed and nothing has not been relaxed. + It's time to align labels. + We may convert a 16-bit instruction right before a label to + 32-bit, in order to align the label if necessary + all reloc entries has been sorted by r_offset. */ + for (irel = internal_relocs; irel < irelend; irel++) + { + if (ELF32_R_TYPE (irel->r_info) != R_NDS32_INSN16 + && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL) + continue; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_INSN16) + { + /* A new INSN16 found, resize the old one. */ + if (is_convert_32_to_16 + (abfd, sec, irel, internal_relocs, irelend, &insn16) + || is_16bit_NOP (abfd, sec, irel)) + { + if (insn_rel) + { + /* Previous INSN16 reloc exists, reduce its + size to 16-bit. */ + if (is_convert_32_to_16 (abfd, sec, insn_rel, internal_relocs, + irelend, &insn16)) { - if (force_relax - || ((irel->r_offset - - get_nds32_elf_blank_total - (&relax_blank_list, irel->r_offset, 1)) - & 0x02) - || irel->r_addend == 1) - { - if (insn_rel != NULL) - { - /* Label not aligned. */ - /* Previous reloc exists, reduce its size to 16-bit. */ - if (is_convert_32_to_16 - (abfd, sec, insn_rel, internal_relocs, - irelend, &insn16)) - { - nds32_elf_write_16 (abfd, contents, insn_rel, - internal_relocs, irelend, - insn16); - - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, - insn_rel->r_offset + 2, 2)) - goto error_return; - } - else if (is_16bit_NOP (abfd, sec, insn_rel)) - { - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, insn_rel->r_offset, - 2)) - goto error_return; - } - else - { - goto error_return; - } - } - } + nds32_elf_write_16 (abfd, contents, insn_rel, + internal_relocs, irelend, insn16); + + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset + 2, 2)) + return FALSE; + } + else if (is_16bit_NOP (abfd, sec, insn_rel)) + { + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset, 2)) + return FALSE; + } + insn_rel->r_info = + ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), R_NDS32_NONE); + } + /* Save the new one for later use. */ + insn_rel = irel; + } + else + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + R_NDS32_NONE); + } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL) + { + /* Search for label. */ + int force_relax = 0; + + /* Label on 16-bit instruction or optimization + needless, just reset this reloc. */ + insn16 = bfd_getb16 (contents + irel->r_offset); + if ((irel->r_addend & 0x1f) < 2 && (!optimize || (insn16 & 0x8000))) + { + irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); + continue; + } + + address = + irel->r_offset - get_nds32_elf_blank_total (relax_blank_list, + irel->r_offset, 1); + + if (!insn_rel) + { + /* Check if there is case which can not be aligned. */ + if (irel->r_addend == 2 && address & 0x2) + return FALSE; + continue; + } + + /* Try to align this label. */ + + if ((irel->r_addend & 0x1f) < 2) + { + /* Check if there is a INSN16 at the same address. + Label_rel always seats before insn_rel after + our sort. */ + + /* Search for INSN16 at LABEL location. If INSN16 is at + same location and this LABEL alignment is lower than 2, + the INSN16 can be converted to 2-byte. */ + for (tmp_rel = irel; + tmp_rel < irelend && tmp_rel->r_offset == irel->r_offset; + tmp_rel++) + { + if (ELF32_R_TYPE (tmp_rel->r_info) == R_NDS32_INSN16 + && (is_convert_32_to_16 + (abfd, sec, tmp_rel, internal_relocs, + irelend, &insn16) + || is_16bit_NOP (abfd, sec, tmp_rel))) + { + force_relax = 1; + break; + } + } + } + + if (force_relax || irel->r_addend == 1 || address & 0x2) + { + /* Label not aligned. */ + /* Previous reloc exists, reduce its size to 16-bit. */ + if (is_convert_32_to_16 (abfd, sec, insn_rel, + internal_relocs, irelend, &insn16)) + { + nds32_elf_write_16 (abfd, contents, insn_rel, + internal_relocs, irelend, insn16); + + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset + 2, 2)) + return FALSE; + } + else if (is_16bit_NOP (abfd, sec, insn_rel)) + { + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset, 2)) + return FALSE; + } + + } + /* INSN16 reloc is used. */ + insn_rel = NULL; + } + } + + address = + sec->size - get_nds32_elf_blank_total (relax_blank_list, sec->size, 0); + if (insn_rel && (address & 0x2 || opt_size)) + { + if (is_convert_32_to_16 (abfd, sec, insn_rel, internal_relocs, + irelend, &insn16)) + { + nds32_elf_write_16 (abfd, contents, insn_rel, internal_relocs, + irelend, insn16); + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset + 2, 2)) + return FALSE; + insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), + R_NDS32_NONE); + } + else if (is_16bit_NOP (abfd, sec, insn_rel)) + { + if (!insert_nds32_elf_blank_recalc_total + (relax_blank_list, insn_rel->r_offset, 2)) + return FALSE; + insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), + R_NDS32_NONE); + } + } + insn_rel = NULL; + return TRUE; +} + +/* Pick relaxation round. */ + +static int +nds32_elf_pick_relax (bfd_boolean init, asection *sec, bfd_boolean *again, + struct elf_nds32_link_hash_table *table, + struct bfd_link_info *link_info) +{ + static asection *final_sec; + static bfd_boolean set = FALSE; + static bfd_boolean first = TRUE; + int round_table[] = { + NDS32_RELAX_NORMAL_ROUND, + NDS32_RELAX_JUMP_IFC_ROUND, + NDS32_RELAX_EX9_BUILD_ROUND, + NDS32_RELAX_EX9_REPLACE_ROUND, + }; + static int pass = 0; + static int relax_round; + + if (first) + { + /* Run an empty run to get the final section. */ + relax_round = NDS32_RELAX_EMPTY_ROUND; + + /* It has to enter relax again because we can + not make sure what the final turn is. */ + *again = TRUE; + first = FALSE; + } + + if (!set && *again) + { + /* It is reentered when again is FALSE. */ + final_sec = sec; + return relax_round; + } + + /* The second round begins. */ + set = TRUE; + + relax_round = round_table[pass]; + + if (!init && final_sec == sec) + { + switch (relax_round) + { + case NDS32_RELAX_NORMAL_ROUND: + if (!*again) + { + /* Normal relaxation done. */ + if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON) + { + pass++; + *again = TRUE; + } + else if (table->target_optimize & NDS32_RELAX_EX9_ON) + { + pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */ + *again = TRUE; + } + else if (table->ex9_import_file) + { + /* Import ex9 table. */ + if (table->update_ex9_table) + pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */ + else + pass += 3; /* NDS32_RELAX_EX9_REPLACE_ROUND */ + nds32_elf_ex9_import_table (link_info); + *again = TRUE; + } + } + break; + case NDS32_RELAX_JUMP_IFC_ROUND: + if (!nds32_elf_ifc_finish (link_info)) + (*_bfd_error_handler) (_("error: Jump IFC Fail.")); + if (table->target_optimize & NDS32_RELAX_EX9_ON) + { + pass++; + *again = TRUE; + } + break; + case NDS32_RELAX_EX9_BUILD_ROUND: + nds32_elf_ex9_finish (link_info); + pass++; + *again = TRUE; + break; + case NDS32_RELAX_EX9_REPLACE_ROUND: + if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON) + { + /* Do jump IFC optimization again. */ + if (!nds32_elf_ifc_finish (link_info)) + (*_bfd_error_handler) (_("error: Jump IFC Fail.")); + } + break; + default: + break; + } + } + + return relax_round; +} + +static bfd_boolean +nds32_elf_relax_section (bfd *abfd, asection *sec, + struct bfd_link_info *link_info, bfd_boolean *again) +{ + nds32_elf_blank_t *relax_blank_list = NULL; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *irel; + Elf_Internal_Rela *irelend; + Elf_Internal_Sym *isymbuf = NULL; + bfd_byte *contents = NULL; + bfd_boolean result = TRUE; + int optimize = 0; + int opt_size = 0; + uint32_t insn; + uint16_t insn16; + + /* Target dependnet option. */ + struct elf_nds32_link_hash_table *table; + int load_store_relax; + int relax_round; + + relax_blank_list = NULL; + + *again = FALSE; + + /* Nothing to do for + * relocatable link or + * non-relocatable section or + * non-code section or + * empty content or + * no reloc entry. */ + if (link_info->relocatable + || (sec->flags & SEC_RELOC) == 0 + || (sec->flags & SEC_EXCLUDE) == 1 + || (sec->flags & SEC_CODE) == 0 + || sec->size == 0) + return TRUE; + + /* 09.12.11 Workaround. */ + /* We have to adjust align for R_NDS32_LABEL if needed. + The adjust approach only can fix 2-byte align once. */ + if (sec->alignment_power > 2) + return TRUE; + + /* The optimization type to do. */ + + table = nds32_elf_hash_table (link_info); + relax_round = nds32_elf_pick_relax (TRUE, sec, again, table, link_info); + switch (relax_round) + { + case NDS32_RELAX_JUMP_IFC_ROUND: + /* Here is the entrance of ifc jump relaxation. */ + if (!nds32_elf_ifc_calc (link_info, abfd, sec)) + return FALSE; + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + + case NDS32_RELAX_EX9_BUILD_ROUND: + /* Here is the entrance of ex9 relaxation. There are two pass of + ex9 relaxation. The one is to traverse all instructions and build + the hash table. The other one is to compare instructions and replace + it by ex9.it. */ + if (!nds32_elf_ex9_build_hash_table (abfd, sec, link_info)) + return FALSE; + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + + case NDS32_RELAX_EX9_REPLACE_ROUND: + if (!nds32_elf_ex9_replace_instruction (link_info, abfd, sec)) + return FALSE; + return TRUE; + + case NDS32_RELAX_EMPTY_ROUND: + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + return TRUE; + + case NDS32_RELAX_NORMAL_ROUND: + default: + if (sec->reloc_count == 0) + return TRUE; + break; + } + + /* The begining of general relaxation. */ + + if (is_SDA_BASE_set == 0) + { + bfd_vma gp; + is_SDA_BASE_set = 1; + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &gp, FALSE); + relax_range_measurement (abfd); + } + + if (is_ITB_BASE_set == 0) + { + /* Set the _ITB_BASE_. */ + if (!nds32_elf_ex9_itb_base (link_info)) + { + (*_bfd_error_handler) (_("%B: error: Cannot set _ITB_BASE_"), abfd); + bfd_set_error (bfd_error_bad_value); + } + } + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + TRUE /* keep_memory */); + if (internal_relocs == NULL) + goto error_return; + + irelend = internal_relocs + sec->reloc_count; + irel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); + + if (irel == irelend) + return TRUE; + + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY) + { + if (irel->r_addend & R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG) + return TRUE; + + if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG) + optimize = 1; + + if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FOR_SPACE_FLAG) + opt_size = 1; + } + + load_store_relax = table->load_store_relax; + + /* Get symbol table and section content. */ + if (!nds32_get_section_contents (abfd, sec, &contents) + || !nds32_get_local_syms (abfd, sec, &isymbuf)) + goto error_return; + + /* Do relax loop only when finalize is not done. + Take care of relaxable relocs except INSN16. */ + for (irel = internal_relocs; irel < irelend; irel++) + { + int seq_len; /* Original length of instruction sequence. */ + int insn_len = 0; /* Final length of instruction sequence. */ + bfd_boolean removed; + + insn = 0; + if (ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL + && (irel->r_addend & 0x1f) >= 2) + optimize = 1; + + /* Relocation Types + R_NDS32_LONGCALL1 53 + R_NDS32_LONGCALL2 54 + R_NDS32_LONGCALL3 55 + R_NDS32_LONGJUMP1 56 + R_NDS32_LONGJUMP2 57 + R_NDS32_LONGJUMP3 58 + R_NDS32_LOADSTORE 59 */ + if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL1 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LOADSTORE) + seq_len = GET_SEQ_LEN (irel->r_addend); + + /* Relocation Types + R_NDS32_LONGCALL4 107 + R_NDS32_LONGCALL5 108 + R_NDS32_LONGCALL6 109 + R_NDS32_LONGJUMP4 110 + R_NDS32_LONGJUMP5 111 + R_NDS32_LONGJUMP6 112 + R_NDS32_LONGJUMP7 113 */ + else if (ELF32_R_TYPE (irel->r_info) >= R_NDS32_LONGCALL4 + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_LONGJUMP7) + seq_len = 4; + + /* Relocation Types + R_NDS32_LO12S0_RELA 30 + R_NDS32_LO12S1_RELA 29 + R_NDS32_LO12S2_RELA 28 + R_NDS32_LO12S2_SP_RELA 71 + R_NDS32_LO12S2_DP_RELA 70 + R_NDS32_GOT_LO12 46 + R_NDS32_GOTOFF_LO12 50 + R_NDS32_PLTREL_LO12 65 + R_NDS32_PLT_GOTREL_LO12 67 + R_NDS32_17IFC_PCREL_RELA 96 + R_NDS32_GOT_SUFF 193 + R_NDS32_GOTOFF_SUFF 194 + R_NDS32_PLT_GOT_SUFF 195 + R_NDS32_MULCALL_SUFF 196 + R_NDS32_PTR 197 */ + else if ((ELF32_R_TYPE (irel->r_info) <= R_NDS32_LO12S0_RELA + && ELF32_R_TYPE (irel->r_info) >= R_NDS32_LO12S2_RELA) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_SP_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_DP_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOT_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTOFF_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_GOTPC_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLTREL_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_PLT_GOTREL_LO12 + || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_GOT_SUFF + && ELF32_R_TYPE (irel->r_info) <= R_NDS32_PTR) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LO12 + || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_ADD + || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LS) + seq_len = 0; + else + continue; + + insn_len = seq_len; + removed = FALSE; + + switch (ELF32_R_TYPE (irel->r_info)) + { + case R_NDS32_LONGCALL1: + removed = nds32_elf_relax_longcall1 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL2: + removed = nds32_elf_relax_longcall2 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL3: + removed = nds32_elf_relax_longcall3 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP1: + removed = nds32_elf_relax_longjump1 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP2: + removed = nds32_elf_relax_longjump2 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP3: + removed = nds32_elf_relax_longjump3 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL4: + removed = nds32_elf_relax_longcall4 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL5: + removed = nds32_elf_relax_longcall5 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGCALL6: + removed = nds32_elf_relax_longcall6 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP4: + removed = nds32_elf_relax_longjump4 (abfd, sec, irel, internal_relocs, + &insn_len, contents, isymbuf, + symtab_hdr); + break; + case R_NDS32_LONGJUMP5: + removed = nds32_elf_relax_longjump5 (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents, + isymbuf, symtab_hdr); + break; + case R_NDS32_LONGJUMP6: + removed = nds32_elf_relax_longjump6 (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents, + isymbuf, symtab_hdr); + break; + case R_NDS32_LONGJUMP7: + removed = nds32_elf_relax_longjump7 (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents, + isymbuf, symtab_hdr); + break; + case R_NDS32_LOADSTORE: + removed = nds32_elf_relax_loadstore (link_info, abfd, sec, irel, + internal_relocs, &insn_len, + contents, isymbuf, symtab_hdr, + load_store_relax); + break; + case R_NDS32_LO12S0_RELA: + case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S2_DP_RELA: + case R_NDS32_LO12S2_SP_RELA: + case R_NDS32_LO12S2_RELA: + /* Relax for low part. */ + nds32_elf_relax_lo12 (link_info, abfd, sec, irel, internal_relocs, + contents, isymbuf, symtab_hdr); + + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_GOT_LO12: + case R_NDS32_GOTOFF_LO12: + case R_NDS32_PLTREL_LO12: + case R_NDS32_PLT_GOTREL_LO12: + case R_NDS32_GOTPC_LO12: + /* Relax for PIC gp-relative low part. */ + nds32_elf_relax_piclo12 (link_info, abfd, sec, irel, contents, + isymbuf, symtab_hdr); - if (force_relax) - { - label_rel = irel; - } + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_TLS_LE_LO12: + /* Relax for LE TLS low part. */ + nds32_elf_relax_letlslo12 (link_info, abfd, irel, contents, + isymbuf, symtab_hdr); - /* INSN16 reloc is used. */ - insn_rel = NULL; - } - } - } + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_TLS_LE_ADD: + nds32_elf_relax_letlsadd (link_info, abfd, sec, irel, internal_relocs, + contents, isymbuf, symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_TLS_LE_LS: + nds32_elf_relax_letlsls (link_info, abfd, sec, irel, internal_relocs, + contents, isymbuf, symtab_hdr, again); + continue; + case R_NDS32_PTR: + removed = nds32_elf_relax_ptr (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents); + break; + case R_NDS32_PLT_GOT_SUFF: + nds32_elf_relax_pltgot_suff (link_info, abfd, sec, irel, + internal_relocs, contents, + isymbuf, symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_GOT_SUFF: + nds32_elf_relax_got_suff (link_info, abfd, sec, irel, + internal_relocs, contents, + symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + case R_NDS32_GOTOFF_SUFF: + nds32_elf_relax_gotoff_suff (link_info, abfd, sec, irel, + internal_relocs, contents, + isymbuf, symtab_hdr, again); + /* It is impossible to delete blank, so just continue. */ + continue; + default: + continue; + + } + if (removed && seq_len - insn_len > 0) + { + if (!insert_nds32_elf_blank + (&relax_blank_list, irel->r_offset + insn_len, + seq_len - insn_len)) + goto error_return; + *again = TRUE; } + } + + calc_nds32_blank_total (relax_blank_list); + + if (table->relax_fp_as_gp) + { + if (!nds32_relax_fp_as_gp (link_info, abfd, sec, internal_relocs, + irelend, isymbuf)) + goto error_return; - if (insn_rel) + if (*again == FALSE) { - if (((sec->size - get_nds32_elf_blank_total (&relax_blank_list, sec->size, 0)) - - ((sec->size - get_nds32_elf_blank_total (&relax_blank_list, sec->size, 0)) - & (0xffffffff << sec->alignment_power)) == 2) - || optimize_for_space) - { - if (is_convert_32_to_16 - (abfd, sec, insn_rel, internal_relocs, irelend, - &insn16)) - { - nds32_elf_write_16 (abfd, contents, insn_rel, internal_relocs, - irelend, insn16); - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, insn_rel->r_offset + 2, 2)) - goto error_return; - insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), - R_NDS32_NONE); - } - else if (is_16bit_NOP (abfd, sec, insn_rel)) - { - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, insn_rel->r_offset, 2)) - goto error_return; - insn_rel->r_info = ELF32_R_INFO (ELF32_R_SYM (insn_rel->r_info), - R_NDS32_NONE); - } - } - insn_rel = NULL; + if (!nds32_fag_remove_unused_fpbase (abfd, sec, internal_relocs, + irelend)) + goto error_return; } } - /* It doesn't matter optimize_for_space_no_align anymore. + + nds32_elf_pick_relax (FALSE, sec, again, table, link_info); + + if (*again == FALSE) + { + if (!nds32_relax_adjust_label (abfd, sec, internal_relocs, contents, + &relax_blank_list, optimize, opt_size)) + goto error_return; + } + + /* It doesn't matter optimize_for_space_no_align anymore. If object file is assembled with flag '-Os', the we don't adjust jump-destination on 4-byte boundary. */ @@ -10984,8 +12329,8 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, sec->size += 4; } - tmp_rel = find_relocs_at_address (internal_relocs, internal_relocs, irelend, - R_NDS32_RELAX_ENTRY); + tmp_rel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); if (tmp_rel != irelend) tmp_rel->r_addend |= R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG; @@ -11096,8 +12441,9 @@ bfd_elf32_nds32_set_target_option (struct bfd_link_info *link_info, optimization. */ #define FAG_THRESHOLD 3 /* At least 3 gp-access. */ -#define FAG_BUMPER 8 /* Leave some space to avoid aligment issues. */ -#define FAG_WINDOW (512 - FAG_BUMPER) /* lwi37.fp covers 512 bytes. */ +/* lwi37.fp covers 508 bytes, but there may be 32-byte padding between + the read-only section and read-write section. */ +#define FAG_WINDOW (508 - 32) /* An nds32_fag represent a gp-relative access. We find best fp-base by using a sliding window @@ -11204,19 +12550,13 @@ nds32_fag_free_list (struct nds32_fag *head) } } -static bfd_boolean -nds32_fag_isempty (struct nds32_fag *head) -{ - return head->next == NULL; -} - /* Find the best fp-base address. The relocation associated with that address is returned, so we can track the symbol instead of a fixed address. When relaxation, the address of an datum may change, because a text section is shrinked, so the data section - moves forward. If the aligments of text and data section + moves forward. If the aligments of text and data section are different, their distance may change too. Therefore, tracking a fixed address is not appriate. */ @@ -11235,8 +12575,11 @@ nds32_fag_find_base (struct nds32_fag *head, struct nds32_fag **bestpp) and accumulate following fags which are inside the window, untill we each the end. */ - if (nds32_fag_isempty (head)) - return 0; + if (head->next == NULL) + { + *bestpp = NULL; + return 0; + } /* Initialize base. */ base = head->next; @@ -11250,22 +12593,22 @@ nds32_fag_find_base (struct nds32_fag *head, struct nds32_fag **bestpp) /* Record the best base in each iteration. */ while (base->next) - { - accu -= base->count; - base = base->next; - /* Account fags in window. */ - for (/* Nothing. */; - last && last->addr < base->addr + FAG_WINDOW; - last = last->next) - accu += last->count; - - /* A better fp-base? */ - if (accu > baccu) - { - best = base; - baccu = accu; - } - } + { + accu -= base->count; + base = base->next; + /* Account fags in window. */ + for (/* Nothing. */; + last && last->addr < base->addr + FAG_WINDOW; + last = last->next) + accu += last->count; + + /* A better fp-base? */ + if (accu > baccu) + { + best = base; + baccu = accu; + } + } if (bestpp) *bestpp = best; @@ -11291,8 +12634,8 @@ nds32_fag_mark_relax (struct bfd_link_info *link_info, nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); best_fpbase = best_fag->addr; - if (best_fpbase > gp + sdata_range[4][1] - || best_fpbase < gp - sdata_range[4][0]) + if (best_fpbase > gp + sdata_range[1][1] + || best_fpbase < gp - sdata_range[1][0]) return FALSE; /* Mark these inside the window R_NDS32_INSN16_FP7U2_FLAG flag, @@ -11322,6 +12665,34 @@ nds32_fag_mark_relax (struct bfd_link_info *link_info, return TRUE; } +/* Reset INSN16 to clean fp as gp. */ + +static void +nds32_fag_unmark_relax (struct nds32_fag *fag, + Elf_Internal_Rela *internal_relocs, + Elf_Internal_Rela *irelend) +{ + struct nds32_fag *ifag; + int i; + Elf_Internal_Rela *insn16_rel; + Elf_Internal_Rela *fag_rel; + + for (ifag = fag; ifag; ifag = ifag->next) + { + for (i = 0; i < ifag->count; i++) + { + fag_rel = ifag->relas[i]; + + /* Restore the INSN16 relocation. */ + insn16_rel = find_relocs_at_address + (fag_rel, internal_relocs, irelend, R_NDS32_INSN16); + + if (insn16_rel != irelend) + insn16_rel->r_addend &= ~R_NDS32_INSN16_FP7U2_FLAG; + } + } +} + /* This is the main function of fp-as-gp optimization. It should be called by relax_section. */ @@ -11337,6 +12708,7 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, struct nds32_fag fag_head; Elf_Internal_Shdr *symtab_hdr; bfd_byte *contents; + bfd_boolean ifc_inside = FALSE; /* FIXME: Can we bfd_elf_link_read_relocs for the relocs? */ @@ -11385,12 +12757,13 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, begin_rel = irel; nds32_fag_init (&fag_head); + ifc_inside = FALSE; } else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END && (irel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) { int accu; - struct nds32_fag *best_fag; + struct nds32_fag *best_fag, *tmp_fag; int dist; /* End of the region. @@ -11404,6 +12777,10 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, accu = nds32_fag_find_base (&fag_head, &best_fag); + /* Clean FP7U2_FLAG because they may set ever. */ + tmp_fag = fag_head.next; + nds32_fag_unmark_relax (tmp_fag, internal_relocs, irelend); + /* Check if it is worth, and FP_BASE is near enough to SDA_BASE. */ if (accu < FAG_THRESHOLD || !nds32_fag_mark_relax (link_info, abfd, best_fag, @@ -11426,13 +12803,14 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, BFD_ASSERT (dist > 0 && dist < 0xffffff); /* Use high 16 bits of addend to record the _FP_BASE_ matched relocation. And get the base value when relocating. */ + begin_rel->r_addend &= (0x1 << 16) - 1; begin_rel->r_addend |= dist << 16; nds32_fag_free_list (&fag_head); begin_rel = NULL; } - if (begin_rel == NULL) + if (begin_rel == NULL || ifc_inside) /* Skip if we are not in the region of fp-as-gp. */ continue; @@ -11456,6 +12834,12 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, { begin_rel = NULL; } + else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA + || ELF32_R_TYPE (irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) + { + /* Suppress fp as gp when encounter ifc. */ + ifc_inside = TRUE; + } } return TRUE; @@ -11559,6 +12943,138 @@ error_return: result = FALSE; goto finish; } + +/* This is a version of bfd_generic_get_relocated_section_contents. + We need this variety because relaxation will modify the dwarf + infomation. When there is undefined symbol reference error mesage, + linker need to dump line number where the symbol be used. However + the address is be relaxed, it can not get the original dwarf contents. + The variety only modify function call for reading in the section. */ + +static bfd_byte * +nds32_elf_get_relocated_section_contents (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols) +{ + bfd *input_bfd = link_order->u.indirect.section->owner; + asection *input_section = link_order->u.indirect.section; + long reloc_size; + arelent **reloc_vector; + long reloc_count; + + reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); + if (reloc_size < 0) + return NULL; + + /* Read in the section. */ + if (!nds32_get_section_contents (input_bfd, input_section, &data)) + return NULL; + + if (reloc_size == 0) + return data; + + reloc_vector = (arelent **) bfd_malloc (reloc_size); + if (reloc_vector == NULL) + return NULL; + + reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, + reloc_vector, symbols); + if (reloc_count < 0) + goto error_return; + + if (reloc_count > 0) + { + arelent **parent; + for (parent = reloc_vector; *parent != NULL; parent++) + { + char *error_message = NULL; + asymbol *symbol; + bfd_reloc_status_type r; + + symbol = *(*parent)->sym_ptr_ptr; + if (symbol->section && discarded_section (symbol->section)) + { + bfd_byte *p; + static reloc_howto_type none_howto + = HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, + "unused", FALSE, 0, 0, FALSE); + + p = data + (*parent)->address * bfd_octets_per_byte (input_bfd); + _bfd_clear_contents ((*parent)->howto, input_bfd, input_section, + p); + (*parent)->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; + (*parent)->addend = 0; + (*parent)->howto = &none_howto; + r = bfd_reloc_ok; + } + else + r = bfd_perform_relocation (input_bfd, *parent, data, + input_section, + relocatable ? abfd : NULL, + &error_message); + + if (relocatable) + { + asection *os = input_section->output_section; + + /* A partial link, so keep the relocs. */ + os->orelocation[os->reloc_count] = *parent; + os->reloc_count++; + } + + if (r != bfd_reloc_ok) + { + switch (r) + { + case bfd_reloc_undefined: + if (!((*link_info->callbacks->undefined_symbol) + (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), + input_bfd, input_section, (*parent)->address, TRUE))) + goto error_return; + break; + case bfd_reloc_dangerous: + BFD_ASSERT (error_message != NULL); + if (!((*link_info->callbacks->reloc_dangerous) + (link_info, error_message, input_bfd, input_section, + (*parent)->address))) + goto error_return; + break; + case bfd_reloc_overflow: + if (!((*link_info->callbacks->reloc_overflow) + (link_info, NULL, + bfd_asymbol_name (*(*parent)->sym_ptr_ptr), + (*parent)->howto->name, (*parent)->addend, + input_bfd, input_section, (*parent)->address))) + goto error_return; + break; + case bfd_reloc_outofrange: + /* PR ld/13730: + This error can result when processing some partially + complete binaries. Do not abort, but issue an error + message instead. */ + link_info->callbacks->einfo + (_("%X%P: %B(%A): relocation \"%R\" goes out of range\n"), + abfd, input_section, * parent); + goto error_return; + + default: + abort (); + break; + } + } + } + } + + free (reloc_vector); + return data; + +error_return: + free (reloc_vector); + return NULL; +} /* Link-time IFC relaxation. In this optimization, we chains jump instructions @@ -11682,7 +13198,7 @@ nds32_elf_ifc_calc (struct bfd_link_info *info, Elf_Internal_Rela *irel; Elf_Internal_Shdr *symtab_hdr; bfd_byte *contents = NULL; - unsigned long insn, insn_with_reg; + uint32_t insn, insn_with_reg; unsigned long r_symndx; struct elf_link_hash_entry *h; struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); @@ -11788,9 +13304,9 @@ nds32_elf_ifc_filter (struct bfd_link_info *info) } else { - /* Global symbol. We have to get the absolute address - and decide whether to keep it or not.*/ - + /* Global symbol. */ + /* We have to get the absolute address and decide + whether to keep it or not. */ while (irel_ptr) { address = (irel_ptr->irel->r_offset @@ -11803,11 +13319,13 @@ nds32_elf_ifc_filter (struct bfd_link_info *info) irel_ptr = ptr->irel_head; while (irel_ptr) { + /* Sort by address. */ struct elf_nds32_ifc_irel_list *irel_dest = irel_ptr; struct elf_nds32_ifc_irel_list *irel_temp = irel_ptr; struct elf_nds32_ifc_irel_list *irel_ptr_prev = NULL; struct elf_nds32_ifc_irel_list *irel_dest_prev = NULL; + /* Get the smallest one. */ while (irel_temp->next) { if (irel_temp->next->addr < irel_dest->addr) @@ -11817,6 +13335,7 @@ nds32_elf_ifc_filter (struct bfd_link_info *info) } irel_temp = irel_temp->next; } + if (irel_dest != irel_ptr) { if (irel_ptr_prev) @@ -11846,7 +13365,7 @@ nds32_elf_ifc_filter (struct bfd_link_info *info) } } - /* Ex9 enable. Reserve it for ex9. */ + /* Ex9 enable. Reserve it for ex9. */ if ((target_optimize & NDS32_RELAX_EX9_ON) && ptr->irel_head != irel_keeper) ptr->enable = 0; @@ -11932,7 +13451,8 @@ nds32_elf_ifc_replace (struct bfd_link_info *info) /* Traverse the ifc gather list, and replace the filter entries by ifcall9. */ if ((!(relax_status & NDS32_RELAX_JUMP_IFC_DONE) && ptr->enable == 1) - || ((relax_status & NDS32_RELAX_JUMP_IFC_DONE) && ptr->ex9_enable == 1)) + || ((relax_status & NDS32_RELAX_JUMP_IFC_DONE) + && ptr->ex9_enable == 1)) { irel_ptr = ptr->irel_head; if (ptr->h == NULL) @@ -11942,17 +13462,19 @@ nds32_elf_ifc_replace (struct bfd_link_info *info) (ptr->sec->owner, ptr->sec, NULL, NULL, TRUE /* keep_memory */); irelend = internal_relocs + ptr->sec->reloc_count; - if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec, &contents)) + if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec, + &contents)) return FALSE; while (irel_ptr) { if (irel_ptr->keep == 0 && irel_ptr->next) { - /* The one can be replaced. We have to check whether + /* The one can be replaced. We have to check whether there is any alignment point in the region. */ irel = irel_ptr->irel; - while (((irel_ptr->next->keep == 0 && irel < irel_ptr->next->irel) + while (((irel_ptr->next->keep == 0 + && irel < irel_ptr->next->irel) || (irel_ptr->next->keep == 1 && irel < irelend)) && !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL && (irel->r_addend & 0x1f) == 2)) @@ -11960,9 +13482,9 @@ nds32_elf_ifc_replace (struct bfd_link_info *info) if (irel >= irelend || !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL && (irel->r_addend & 0x1f) == 2 - && ((irel->r_offset - - get_nds32_elf_blank_total - (&relax_blank_list, irel->r_offset, 1)) & 0x02) == 0)) + && ((irel->r_offset - get_nds32_elf_blank_total + (&relax_blank_list, irel->r_offset, 1)) + & 0x02) == 0)) { /* Replace by ifcall9. */ bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); @@ -11970,7 +13492,8 @@ nds32_elf_ifc_replace (struct bfd_link_info *info) (&relax_blank_list, irel_ptr->irel->r_offset + 2, 2)) return FALSE; irel_ptr->irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), R_NDS32_TRAN); + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_10IFCU_PCREL_RELA); } } irel_ptr = irel_ptr->next; @@ -12029,7 +13552,8 @@ nds32_elf_ifc_replace (struct bfd_link_info *info) irel_ptr->sec, relax_blank_list); irel_ptr->irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), R_NDS32_TRAN); + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_10IFCU_PCREL_RELA); relax_blank_list = NULL; } } @@ -12046,7 +13570,7 @@ nds32_elf_ifc_replace (struct bfd_link_info *info) /* Relocate ifcall. */ -bfd_boolean +static bfd_boolean nds32_elf_ifc_reloc (void) { struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; @@ -12054,14 +13578,20 @@ nds32_elf_ifc_reloc (void) struct elf_nds32_ifc_irel_list *irel_keeper = NULL; bfd_vma relocation, address; unsigned short insn16; - bfd_byte *contents = NULL; + static bfd_boolean done = FALSE; + + if (done) + return TRUE; + + done = TRUE; while (ptr) { + /* Check the entry is enable ifcall. */ if (ptr->enable == 1 || ptr->ex9_enable == 1) { - /* Check the entry is enable ifcall. */ + /* Get the reserve jump. */ irel_ptr = ptr->irel_head; while (irel_ptr) { @@ -12083,7 +13613,7 @@ nds32_elf_ifc_reloc (void) while (irel_ptr) { if (irel_ptr->keep == 0 - && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_TRAN) + && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) { relocation = irel_keeper->irel->r_offset; relocation = relocation - irel_ptr->irel->r_offset; @@ -12114,7 +13644,9 @@ nds32_elf_ifc_reloc (void) if (!irel_keeper) return FALSE; } - + irel_ptr->irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_NONE); insn16 = INSN_IFCALL9 | (relocation >> 1); bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); } @@ -12127,8 +13659,9 @@ nds32_elf_ifc_reloc (void) while (irel_ptr) { if (irel_ptr->keep == 0 - && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_TRAN) + && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) { + /* Get the distance between ifcall and jump. */ relocation = (irel_keeper->irel->r_offset + irel_keeper->sec->output_section->vma + irel_keeper->sec->output_offset); @@ -12136,6 +13669,8 @@ nds32_elf_ifc_reloc (void) + irel_ptr->sec->output_section->vma + irel_ptr->sec->output_offset); relocation = relocation - address; + + /* The distance is over ragne, find callee again. */ while (irel_keeper && relocation > 1022) { irel_keeper = irel_keeper->next; @@ -12170,10 +13705,13 @@ nds32_elf_ifc_reloc (void) return FALSE; } if (!nds32_get_section_contents - (irel_ptr->sec->owner, irel_ptr->sec, &contents)) - return FALSE; - insn16 = INSN_IFCALL9 | (relocation >> 1); - bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); + (irel_ptr->sec->owner, irel_ptr->sec, &contents)) + return FALSE; + insn16 = INSN_IFCALL9 | (relocation >> 1); + bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); + irel_ptr->irel->r_info = + ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), + R_NDS32_NONE); } irel_ptr =irel_ptr->next; } @@ -12569,92 +14107,31 @@ static void nds32_elf_order_insn_times (struct bfd_link_info *info) { struct elf_nds32_insn_times_entry *ex9_insn; - struct elf_nds32_insn_times_entry *temp; + struct elf_nds32_insn_times_entry *temp = NULL; struct elf_nds32_link_hash_table *table; - char *insn; int ex9_limit; - int number = 0, total = 0; - struct bfd_link_hash_entry *bh; + int number = 0; + + if (ex9_insn_head == NULL) + return; /* The max number of entries is 512. */ ex9_insn = ex9_insn_head; table = nds32_elf_hash_table (info); ex9_limit = table->ex9_limit; - /* Get the minimun one of ex9 list and limitation. */ - while (ex9_insn) - { - total++; - ex9_insn = ex9_insn->next; - } - total = MIN (total, ex9_limit); - - temp = bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - temp->string = bfd_malloc (sizeof (char) * 10); - temp->times = 0; - temp->sec = NULL; - temp->m_list = NULL; - temp->irel = NULL; - temp->next = NULL; - /* Since the struct elf_nds32_insn_times_entry string is const char, - it has to allocate another space to write break 0xea. */ - insn = bfd_malloc (sizeof (char) * 10); - snprintf (insn, sizeof (char) * 10, "%08x", INSN_BREAK_EA); - temp->string = (const char *) insn; - ex9_insn = ex9_insn_head; - while (ex9_insn != NULL && number <= ex9_limit) + while (ex9_insn != NULL && number < ex9_limit) { - /* Save 234th entry for break 0xea, because trace32 need to use - break16 0xea. If the number of entry is less than 234, adjust - the address of _ITB_BASE_ backward. */ - if (total < 234) - { - ex9_insn->order = number + 234 - total; - if (!ex9_insn->next) - { - /* Link break 0xea entry into list. */ - ex9_insn->next = temp; - temp->next = NULL; - temp ->order = number + 235 - total; - ex9_insn = NULL; - break; - } - } - else - ex9_insn->order = number; - + ex9_insn->order = number; number++; - - if (number == 234) - { - /* Link break 0xea entry into list. */ - temp->next = ex9_insn->next; - ex9_insn->next = temp; - temp->order = number; - number++; - ex9_insn = ex9_insn->next; - } - - if (number > ex9_limit) - { - temp = ex9_insn; - ex9_insn = ex9_insn->next; - temp->next = NULL; - break; - } + temp = ex9_insn; ex9_insn = ex9_insn->next; } - if (total < 234) - { - /* Adjust the address of _ITB_BASE_. */ - bh = bfd_link_hash_lookup (info->hash, "_ITB_BASE_", - FALSE, FALSE, FALSE); - if (bh) - bh->u.def.value = (total - 234) * 4; - } + if (ex9_insn && temp) + temp->next = NULL; while (ex9_insn != NULL) { @@ -12677,7 +14154,7 @@ nds32_elf_ex9_build_itable (struct bfd_link_info *link_info) bfd_byte *contents = NULL; for (it_abfd = link_info->input_bfds; it_abfd != NULL; - it_abfd = it_abfd->link_next) + it_abfd = it_abfd->link.next) { /* Find the section .ex9.itable, and put all entries into it. */ table_sec = bfd_get_section_by_name (it_abfd, ".ex9.itable"); @@ -12692,13 +14169,7 @@ nds32_elf_ex9_build_itable (struct bfd_link_info *link_info) table_sec->size = number * 4; if (number == 0) - { - /* There is no insntruction effective enough to convert to ex9. - Only add break 0xea into ex9 table. */ - table_sec->size = 4; - bfd_putb32 ((bfd_vma) INSN_BREAK_EA, (char *) contents); - return; - } + return; elf_elfheader (link_info->output_bfd)->e_flags |= E_NDS32_HAS_EX9_INST; number = 0; @@ -12719,7 +14190,7 @@ nds32_elf_ex9_build_itable (struct bfd_link_info *link_info) static void nds32_elf_get_insn_with_reg (Elf_Internal_Rela *irel, - unsigned long insn, unsigned long *insn_with_reg) + uint32_t insn, uint32_t *insn_with_reg) { reloc_howto_type *howto = NULL; @@ -12808,8 +14279,7 @@ nds32_elf_ex9_relocation_check (struct bfd_link_info *info, Elf_Internal_Rela **irel, Elf_Internal_Rela *irelend, nds32_elf_blank_t *relax_blank_list, - asection *sec, - long unsigned int *off, + asection *sec,bfd_vma *off, bfd_byte *contents) { /* Suppress ex9 if `.no_relax ex9' or inner loop. */ @@ -12864,8 +14334,7 @@ nds32_elf_ex9_relocation_check (struct bfd_link_info *info, && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) nested_loop = FALSE; } - else if (relax_blank_list - && ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_LABEL + else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_LABEL && ((*irel)->r_addend & 0x1f) == 2) { /* Alignment exist in the region. */ @@ -12888,7 +14357,7 @@ nds32_elf_ex9_relocation_check (struct bfd_link_info *info, break; case R_NDS32_LABEL: - if (relax_blank_list && ((*irel)->r_addend & 0x1f) == 2) + if (((*irel)->r_addend & 0x1f) == 2) { /* Check this point is align and decide to do ex9 or not. */ result |= CLEAN_PRE; @@ -12948,7 +14417,8 @@ nds32_elf_ex9_relocation_check (struct bfd_link_info *info, default: /* Not support relocations. */ if (ELF32_R_TYPE ((*irel)->r_info) < ARRAY_SIZE (nds32_elf_howto_table) - && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_NONE) + && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_NONE + && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_INSN16) { /* Note: To optimize aggressively, it maybe can ignore R_NDS32_INSN16 here. But we have to consider if there is any side-effect. */ @@ -12983,6 +14453,27 @@ nds32_elf_ex9_relocation_check (struct bfd_link_info *info, return result; } +/* Replace with ex9 instruction. */ + +static bfd_boolean +nds32_elf_ex9_push_insn (uint16_t insn16, bfd_byte *contents, bfd_vma pre_off, + nds32_elf_blank_t **relax_blank_list, + struct elf_nds32_irel_entry *pre_irel_ptr, + struct elf_nds32_irel_entry **irel_list) +{ + if (insn16 != 0) + { + /* Implement the ex9 relaxation. */ + bfd_putb16 (insn16, contents + pre_off); + if (!insert_nds32_elf_blank_recalc_total (relax_blank_list, + pre_off + 2, 2)) + return FALSE; + if (pre_irel_ptr != NULL) + nds32_elf_insert_irel_entry (irel_list, pre_irel_ptr); + } + return TRUE; +} + /* Replace input file instruction which is in ex9 itable. */ static bfd_boolean @@ -12990,11 +14481,11 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti { struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head; bfd_byte *contents = NULL; - long unsigned int off; - unsigned short insn16, insn_ex9; + bfd_vma off; + uint16_t insn16, insn_ex9; /* `pre_*' are used to track previous instruction that can use ex9.it. */ - unsigned int pre_off = -1; - unsigned short pre_insn16 = 0; + bfd_vma pre_off = -1; + uint16_t pre_insn16 = 0; struct elf_nds32_irel_entry *pre_irel_ptr = NULL; Elf_Internal_Rela *internal_relocs; Elf_Internal_Rela *irel; @@ -13002,30 +14493,32 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Sym *isym = NULL; nds32_elf_blank_t *relax_blank_list = NULL; - unsigned long insn = 0; - unsigned long insn_with_reg = 0; - unsigned long it_insn; - unsigned long it_insn_with_reg; + uint32_t insn = 0; + uint32_t insn_with_reg = 0; + uint32_t it_insn; + uint32_t it_insn_with_reg; unsigned long r_symndx; asection *isec; struct elf_nds32_irel_entry *irel_list = NULL; struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); int data_flag, do_replace, save_irel; + struct elf_link_hash_entry_list *h_list; + /* Load section instructions, relocations, and symbol table. */ if (!nds32_get_section_contents (abfd, sec, &contents) || !nds32_get_local_syms (abfd, sec, &isym)) return FALSE; - internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, - TRUE /* keep_memory */); + internal_relocs = + _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, TRUE /* keep_memory */); irelend = internal_relocs + sec->reloc_count; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; off = 0; /* Check if the object enable ex9. */ - irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend, - R_NDS32_RELAX_ENTRY); + irel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); /* Check this section trigger ex9 relaxation. */ if (irel == NULL @@ -13051,19 +14544,10 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti relax_blank_list, sec, &off, contents); if (data_flag & PUSH_PRE) - { - if (pre_insn16 != 0) - { - /* Implement the ex9 relaxation. */ - bfd_putb16 (pre_insn16, contents + pre_off); - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, pre_off + 2, 2)) - return FALSE; - if (pre_irel_ptr != NULL) - nds32_elf_insert_irel_entry (&irel_list, - pre_irel_ptr); - } - } + if (!nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, + &relax_blank_list, pre_irel_ptr, + &irel_list)) + return FALSE; if (data_flag & CLEAN_PRE) { @@ -13102,10 +14586,12 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg); if (ex9_insn->irel != NULL) - nds32_elf_get_insn_with_reg (ex9_insn->irel, it_insn, &it_insn_with_reg); + nds32_elf_get_insn_with_reg (ex9_insn->irel, it_insn, + &it_insn_with_reg); if (ex9_insn->irel != NULL - && ELF32_R_TYPE (irel->r_info) == ELF32_R_TYPE (ex9_insn->irel->r_info) + && (ELF32_R_TYPE (irel->r_info) == + ELF32_R_TYPE (ex9_insn->irel->r_info)) && (insn_with_reg == it_insn_with_reg)) { /* Insn relocation and format is the same as table entry. */ @@ -13146,13 +14632,12 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti h = sym_hashes[r_symndx - symtab_hdr->sh_info]; if (ex9_insn->m_list) { - struct elf_link_hash_entry_list *h_list; - h_list = ex9_insn->m_list->h_list; while (h_list) { if (h == h_list->h - && ex9_insn->m_list->irel->r_addend == irel->r_addend) + && (ex9_insn->m_list->irel->r_addend == + irel->r_addend)) { do_replace = 1; save_irel = 1; @@ -13190,12 +14675,13 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti while (m_list) { - struct elf_link_hash_entry_list *h_list = m_list->h_list; + h_list = m_list->h_list; while (h_list) { if (h == h_list->h - && m_list->irel->r_addend == irel->r_addend) + && (m_list->irel->r_addend + == irel->r_addend)) { do_replace = 1; save_irel = 1; @@ -13234,19 +14720,19 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti h = sym_hashes[r_symndx - symtab_hdr->sh_info]; if ((h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) - && (h->root.u.def.section != NULL - && h->root.u.def.section->output_section != NULL) + && h->root.u.def.section != NULL + && h->root.u.def.section->output_section != NULL && h->root.u.def.section->gc_mark == 1 - && strcmp (h->root.u.def.section->name, - BFD_ABS_SECTION_NAME) == 0 + && bfd_is_abs_section (h->root.u.def.section) && h->root.u.def.value > sec->size) { - relocation = (h->root.u.def.value + - h->root.u.def.section->output_section->vma + - h->root.u.def.section->output_offset); + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; relocation += irel->r_addend; - insn = insn_with_reg | ((relocation >> 1) & 0xffffff); - snprintf (code, sizeof (code), "%08lx", insn); + insn = insn_with_reg + | ((relocation >> 1) & 0xffffff); + snprintf (code, sizeof (code), "%08x", insn); if (strcmp (code, ex9_insn->string) == 0) { do_replace = 1; @@ -13257,7 +14743,8 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti } } else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN - || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END + || ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE) { /* These relocations do not have to relocate contens, so it can be regard as instruction without relocation. */ @@ -13283,15 +14770,10 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti insn_ex9 = INSN_EX9_IT_1; insn16 = insn_ex9 | ex9_insn->order; - if (pre_insn16 != 0) - { - bfd_putb16 (pre_insn16, contents + pre_off); - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, pre_off + 2, 2)) - return FALSE; - if (pre_irel_ptr != NULL) - nds32_elf_insert_irel_entry (&irel_list, pre_irel_ptr); - } + /* Insert ex9 instruction. */ + nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, + &relax_blank_list, pre_irel_ptr, + &irel_list); pre_off = off; pre_insn16 = insn16; @@ -13313,16 +14795,10 @@ nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asecti off += 4; } - if (pre_insn16 != 0) - { - /* Implement the ex9 relaxation. */ - bfd_putb16 (pre_insn16, contents + pre_off); - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, pre_off + 2, 2)) - return FALSE; - if (pre_irel_ptr != NULL) - nds32_elf_insert_irel_entry (&irel_list, pre_irel_ptr); - } + /* Insert ex9 instruction. */ + nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, + &relax_blank_list, pre_irel_ptr, + &irel_list); /* Delete the redundant code. */ if (relax_blank_list) @@ -13416,8 +14892,6 @@ nds32_elf_ex9_total_relax (struct bfd_link_info *info) void nds32_elf_ex9_finish (struct bfd_link_info *link_info) { - struct elf_nds32_link_hash_table *table; - nds32_elf_code_hash_traverse (nds32_elf_examine_insn_times); nds32_elf_order_insn_times (link_info); nds32_elf_ex9_total_relax (link_info); @@ -13425,9 +14899,6 @@ nds32_elf_ex9_finish (struct bfd_link_info *link_info) nds32_elf_code_hash_traverse (nds32_elf_count_insn_times); nds32_elf_order_insn_times (link_info); nds32_elf_ex9_build_itable (link_info); - table = nds32_elf_hash_table (link_info); - if (table) - table->relax_round = NDS32_RELAX_EX9_REPLACE_ROUND; } /* Relocate the entries in ex9 table. */ @@ -13438,19 +14909,21 @@ nds32_elf_ex9_reloc_insn (struct elf_nds32_insn_times_entry *ptr, { Elf_Internal_Sym *isym = NULL; bfd_vma relocation = -1; + struct elf_link_hash_entry *h; if (ptr->m_list != NULL) { /* Global symbol. */ - if ((ptr->m_list->h_list->h->root.type == bfd_link_hash_defined - || ptr->m_list->h_list->h->root.type == bfd_link_hash_defweak) - && (ptr->m_list->h_list->h->root.u.def.section != NULL - && ptr->m_list->h_list->h->root.u.def.section->output_section != NULL)) + h = ptr->m_list->h_list->h; + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section != NULL + && h->root.u.def.section->output_section != NULL) { - relocation = (ptr->m_list->h_list->h->root.u.def.value + - ptr->m_list->h_list->h->root.u.def.section->output_section->vma + - ptr->m_list->h_list->h->root.u.def.section->output_offset); + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; relocation += ptr->m_list->irel->r_addend; } else @@ -13505,7 +14978,7 @@ nds32_elf_ex9_reloc_insn (struct elf_nds32_insn_times_entry *ptr, void nds32_elf_ex9_import_table (struct bfd_link_info *info) { - int count = 0, num = 1; + int num = 0; bfd_byte *contents; unsigned long insn; FILE *ex9_import_file; @@ -13514,30 +14987,21 @@ nds32_elf_ex9_import_table (struct bfd_link_info *info) table = nds32_elf_hash_table (info); ex9_import_file = table->ex9_import_file; + rewind (table->ex9_import_file); contents = bfd_malloc (sizeof (bfd_byte) * 4); - /* Count the number of input file instructions. */ - while (!feof (ex9_import_file)) - { - fgetc (ex9_import_file); - count++; - } - count = count / 4; - rewind (ex9_import_file); /* Read instructions from the input file and build the list. */ - while (count != 0) + while (!feof (ex9_import_file)) { char *code; struct elf_nds32_insn_times_entry *ptr; size_t nread; nread = fread (contents, sizeof (bfd_byte) * 4, 1, ex9_import_file); - if (nread < sizeof (bfd_byte) * 4) - { - (*_bfd_error_handler) ("Unexpected size of imported ex9 table."); - break; - } + /* Ignore the final byte 0x0a. */ + if (nread < 1) + break; insn = bfd_getb32 (contents); code = bfd_malloc (sizeof (char) * 9); snprintf (code, 9, "%08lx", insn); @@ -13553,7 +15017,6 @@ nds32_elf_ex9_import_table (struct bfd_link_info *info) ptr->irel = NULL; ptr->next = NULL; nds32_elf_ex9_insert_entry (ptr); - count--; num++; } @@ -13585,14 +15048,14 @@ nds32_elf_ex9_export (struct bfd_link_info *info, /* Adjust relocations of J and JAL in ex9.itable. Export ex9 table. */ -void +static void nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) { asection *table_sec = NULL; struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head; struct elf_nds32_insn_times_entry *temp_ptr, *temp_ptr2; bfd *it_abfd; - unsigned long insn, insn_with_reg, source_insn; + uint32_t insn, insn_with_reg, source_insn; bfd_byte *contents = NULL, *source_contents = NULL; int size = 0; bfd_vma gp; @@ -13601,7 +15064,13 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) Elf_Internal_Rela rel_backup; unsigned short insn_ex9; struct elf_nds32_link_hash_table *table; - FILE *ex9_export_file, *ex9_import_file; + FILE *ex9_export_file; + static bfd_boolean done = FALSE; + + if (done) + return; + + done = TRUE; table = nds32_elf_hash_table (link_info); if (table) @@ -13613,7 +15082,7 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) if (update_ex9_table == 0) { for (it_abfd = link_info->input_bfds; it_abfd != NULL; - it_abfd = it_abfd->link_next) + it_abfd = it_abfd->link.next) { table_sec = bfd_get_section_by_name (it_abfd, ".ex9.itable"); if (table_sec != NULL) @@ -13623,7 +15092,6 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) if (table_sec != NULL) { bfd *output_bfd; - struct bfd_link_hash_entry *bh = NULL; output_bfd = table_sec->output_section->owner; nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); @@ -13632,10 +15100,6 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) if (!nds32_get_section_contents (it_abfd, table_sec, &contents)) return; - /* Get the offset between _ITB_BASE_ and .ex9.itable. */ - bh = bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_", - FALSE, FALSE, FALSE); - offset = bh->u.def.value; } } else @@ -13677,7 +15141,7 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) insn = insn_with_reg | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4 + offset); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); } else if ((ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA15S3 && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA15S0) @@ -13692,27 +15156,27 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) insn = insn_with_reg | (((relocation - gp) >> shift) & nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4 + offset); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); } else if (ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_HI20_RELA) { /* Sethi may be multiple entry for one insn. */ - if (ex9_insn->next && ((ex9_insn->m_list && ex9_insn->m_list == ex9_insn->next->m_list) - || (ex9_insn->m_list && ex9_insn->next->order == 234 - && ex9_insn->next->next - && ex9_insn->m_list == ex9_insn->next->next->m_list))) + if (ex9_insn->next && ex9_insn->m_list + && ex9_insn->m_list == ex9_insn->next->m_list) { struct elf_link_hash_entry_mul_list *m_list; struct elf_nds32_ex9_refix *fix_ptr; + struct elf_link_hash_entry *h; temp_ptr = ex9_insn; temp_ptr2 = ex9_insn; m_list = ex9_insn->m_list; while (m_list) { - relocation = (m_list->h_list->h->root.u.def.value + - m_list->h_list->h->root.u.def.section->output_section->vma + - m_list->h_list->h->root.u.def.section->output_offset); + h = m_list->h_list->h; + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; relocation += m_list->irel->r_addend; if (relocation < min_relocation) @@ -13724,26 +15188,19 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) /* Put insntruction into ex9 table. */ insn = insn_with_reg | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4 + offset); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); relocation = relocation + 0x1000; /* hi20 */ - while (ex9_insn->next && ((ex9_insn->m_list && ex9_insn->m_list == ex9_insn->next->m_list) - || (ex9_insn->m_list && ex9_insn->next->order == 234 - && ex9_insn->next->next - && ex9_insn->m_list == ex9_insn->next->next->m_list))) + while (ex9_insn->next && ex9_insn->m_list + && ex9_insn->m_list == ex9_insn->next->m_list) { /* Multiple sethi. */ ex9_insn = ex9_insn->next; size += 4; - if (ex9_insn->order == 234) - { - ex9_insn = ex9_insn->next; - size += 4; - } insn = insn_with_reg | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4 + offset); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); relocation = relocation + 0x1000; /* hi20 */ } @@ -13761,21 +15218,16 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) break; /* Set source insn. */ - relocation = (fix_ptr->h->root.u.def.value + - fix_ptr->h->root.u.def.section->output_section->vma + - fix_ptr->h->root.u.def.section->output_offset); + relocation = + fix_ptr->h->root.u.def.value + + fix_ptr->h->root.u.def.section->output_section->vma + + fix_ptr->h->root.u.def.section->output_offset; relocation += fix_ptr->irel->r_addend; /* sethi imm is imm20s. */ source_insn = insn_with_reg | ((relocation >> shift) & 0xfffff); while (temp_ptr) { - if (temp_ptr->order == 234) - { - temp_ptr = temp_ptr->next; - continue; - } - /* Match entry and source code. */ insn = bfd_getb32 (contents + (temp_ptr->order) * 4 + offset); if (insn == source_insn) @@ -13814,7 +15266,7 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info); insn = insn_with_reg | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4 + offset); + bfd_putb32 (insn, contents + (ex9_insn->order) * 4); } } } @@ -13831,20 +15283,19 @@ nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) ex9_export_file = table->ex9_export_file; if (ex9_export_file != NULL) - nds32_elf_ex9_export (link_info, contents + 4, table_sec->size - 4); + nds32_elf_ex9_export (link_info, contents, table_sec->size); else if (update_ex9_table == 1) { - ex9_import_file = table->ex9_import_file; - ex9_export_file = ex9_import_file; - rewind (ex9_export_file); - nds32_elf_ex9_export (link_info, contents + 4, size); + table->ex9_export_file = table->ex9_import_file; + rewind (table->ex9_export_file); + nds32_elf_ex9_export (link_info, contents, size); } } /* Generate ex9 hash table. */ static bfd_boolean -nds32_elf_ex9_build_hash_table (bfd * abfd, asection * sec, +nds32_elf_ex9_build_hash_table (bfd *abfd, asection *sec, struct bfd_link_info *link_info) { Elf_Internal_Rela *internal_relocs; @@ -13857,10 +15308,9 @@ nds32_elf_ex9_build_hash_table (bfd * abfd, asection * sec, asection *isec; struct elf_link_hash_entry **sym_hashes; bfd_byte *contents = NULL; - long unsigned int off = 0; + bfd_vma off = 0; unsigned long r_symndx; - unsigned long insn; - unsigned long insn_with_reg; + uint32_t insn, insn_with_reg; struct elf_link_hash_entry *h; int data_flag, shift, align; bfd_vma relocation; @@ -13902,8 +15352,8 @@ nds32_elf_ex9_build_hash_table (bfd * abfd, asection * sec, while (irel != NULL && irel < irelend && irel->r_offset < off) irel++; - data_flag = nds32_elf_ex9_relocation_check (link_info, &irel, irelend, NULL, - sec, &off, contents); + data_flag = nds32_elf_ex9_relocation_check (link_info, &irel, irelend, + NULL, sec, &off, contents); if (data_flag & DATA_EXIST) { /* We save the move offset in the highest byte. */ @@ -13974,8 +15424,9 @@ nds32_elf_ex9_build_hash_table (bfd * abfd, asection * sec, h, sym_sec, relocation, unresolved_reloc, warned, ignored); relocation += irel->r_addend; - if (h->type != bfd_link_hash_defined - && h->type != bfd_link_hash_defweak) + if ((h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + || strcmp (h->root.root.string, "_FP_BASE_") == 0) { off += 4; continue; @@ -14025,7 +15476,8 @@ nds32_elf_ex9_build_hash_table (bfd * abfd, asection * sec, | ((relocation >> shift) & nds32_elf_irel_mask (irel)); } else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN - || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END + || ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE) { /* These relocations do not have to relocate contens, so it can be regard as instruction without relocation. */ @@ -14037,7 +15489,7 @@ nds32_elf_ex9_build_hash_table (bfd * abfd, asection * sec, } } - snprintf (code, sizeof (code), "%08lx", insn); + snprintf (code, sizeof (code), "%08x", insn); /* Copy "code". */ entry = (struct elf_nds32_code_hash_entry*) bfd_hash_lookup (&ex9_code_table, code, TRUE, TRUE); @@ -14162,19 +15614,20 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) asection *sec; bfd *output_bfd = NULL; struct bfd_link_hash_entry *bh = NULL; - int target_optimize; - struct elf_nds32_link_hash_table *table; if (is_ITB_BASE_set == 1) return TRUE; is_ITB_BASE_set = 1; - table = nds32_elf_hash_table (link_info); - target_optimize = table->target_optimize; + bh = bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_", FALSE, FALSE, TRUE); + + if (bh && (bh->type == bfd_link_hash_defined + || bh->type == bfd_link_hash_defweak)) + return TRUE; for (abfd = link_info->input_bfds; abfd != NULL; - abfd = abfd->link_next) + abfd = abfd->link.next) { sec = bfd_get_section_by_name (abfd, ".ex9.itable"); if (sec != NULL) @@ -14195,9 +15648,7 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) FALSE, FALSE, TRUE); return (_bfd_generic_link_add_one_symbol (link_info, output_bfd, "_ITB_BASE_", - BSF_GLOBAL | BSF_WEAK, sec, - /* We don't know its value yet, set it to 0. */ - (target_optimize & NDS32_RELAX_EX9_ON) ? 0 : (-234 * 4), + BSF_GLOBAL | BSF_WEAK, sec, 0, (const char *) NULL, FALSE, get_elf_backend_data (output_bfd)->collect, &bh)); } /* End EX9.IT */ @@ -14206,6 +15657,7 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) #define ELF_ARCH bfd_arch_nds32 #define ELF_MACHINE_CODE EM_NDS32 #define ELF_MAXPAGESIZE 0x1000 +#define ELF_TARGET_ID NDS32_ELF_DATA #define TARGET_BIG_SYM nds32_elf32_be_vec #define TARGET_BIG_NAME "elf32-nds32be" @@ -14221,6 +15673,7 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) #define bfd_elf32_bfd_relax_section nds32_elf_relax_section #define bfd_elf32_bfd_set_private_flags nds32_elf_set_private_flags +#define bfd_elf32_mkobject nds32_elf_mkobject #define elf_backend_action_discarded nds32_elf_action_discarded #define elf_backend_add_symbol_hook nds32_elf_add_symbol_hook #define elf_backend_check_relocs nds32_elf_check_relocs @@ -14241,6 +15694,8 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) #define elf_backend_object_p nds32_elf_object_p #define elf_backend_final_write_processing nds32_elf_final_write_processing #define elf_backend_special_sections nds32_elf_special_sections +#define bfd_elf32_bfd_get_relocated_section_contents \ + nds32_elf_get_relocated_section_contents #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 diff --git a/bfd/elf32-nds32.h b/bfd/elf32-nds32.h index 9aec0fc52..210a4d31e 100644 --- a/bfd/elf32-nds32.h +++ b/bfd/elf32-nds32.h @@ -1,5 +1,5 @@ /* NDS32-specific support for 32-bit ELF. - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. Contributed by Andes Technology Corporation. This file is part of BFD, the Binary File Descriptor library. @@ -46,6 +46,7 @@ /* Relocation flags for R_NDS32_INSN16. */ +/* Tag the nop16 can be removed. */ #define R_NDS32_INSN16_CONVERT_FLAG (1 << 0) /* Convert a gp-relative access (e.g., lwi.gp) to fp-as-gp access (lwi37.fp). @@ -67,15 +68,28 @@ in this region due to performance drop. */ #define R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG (1 << 4) +/* Tag range for LOADSTORE relocation. */ +enum +{ + NDS32_LOADSTORE_NONE = 0x0, + NDS32_LOADSTORE_BYTE = 0x1, + NDS32_LOADSTORE_HALF = 0x2, + NDS32_LOADSTORE_WORD = 0x4, + NDS32_LOADSTORE_FLOAT_S = 0x8, + NDS32_LOADSTORE_FLOAT_D = 0x10, + NDS32_LOADSTORE_IMM = 0x20 +}; + /* Relax tag for nds32_elf_relax_section, we have to specify which optimization do in this round. */ enum { NDS32_RELAX_NONE_ROUND = 0, - NDS32_RELAX_JUMP_IFC_ROUND = 1, + NDS32_RELAX_NORMAL_ROUND, + NDS32_RELAX_JUMP_IFC_ROUND, NDS32_RELAX_EX9_BUILD_ROUND, - NDS32_RELAX_EX9_REPLACE_ROUND - + NDS32_RELAX_EX9_REPLACE_ROUND, + NDS32_RELAX_EMPTY_ROUND }; /* Optimization status mask. */ @@ -85,29 +99,23 @@ enum /* Optimization turn on mask. */ #define NDS32_RELAX_JUMP_IFC_ON (1 << 0) #define NDS32_RELAX_EX9_ON (1 << 1) - -/* The break 0xea defined for ex9 table to keep for trace32 to use 0xeaea. */ -#define INSN_BREAK_EA 0x64001d4a extern void nds32_insertion_sort (void *, size_t, size_t, int (*) (const void *, const void *)); extern int nds32_elf_ex9_init (void); -extern void nds32_elf_ex9_reloc_jmp (struct bfd_link_info *); -extern void nds32_elf_ex9_finish (struct bfd_link_info *); -extern bfd_boolean nds32_elf_ex9_itb_base (struct bfd_link_info *); -extern void nds32_elf_ex9_import_table (struct bfd_link_info *); -extern bfd_boolean nds32_elf_ifc_reloc (void); -extern bfd_boolean nds32_elf_ifc_finish (struct bfd_link_info *); extern int nds32_convert_32_to_16 (bfd *, uint32_t, uint16_t *, int *); extern int nds32_convert_16_to_32 (bfd *, uint16_t, uint32_t *); -extern void bfd_elf32_nds32_set_target_option (struct bfd_link_info *, int, int, - FILE *, int, int, int, int, FILE *, FILE *, - int, int, bfd_boolean, bfd_boolean); +extern void bfd_elf32_nds32_set_target_option (struct bfd_link_info *, + int, int, FILE *, int, + int, int, int, FILE *, + FILE *, int, int, + bfd_boolean, bfd_boolean); #define nds32_elf_hash_table(info) \ (elf_hash_table_id ((struct elf_link_hash_table *) ((info)->hash)) \ - == NDS32_ELF_DATA ? ((struct elf_nds32_link_hash_table *) ((info)->hash)) : NULL) + == NDS32_ELF_DATA ? \ + ((struct elf_nds32_link_hash_table *) ((info)->hash)) : NULL) /* Hash table structure for target nds32. There are some members to save target options passed from nds32elf.em to bfd. */ diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c index f33b38a71..5877d8fff 100644 --- a/bfd/elf32-nios2.c +++ b/bfd/elf32-nios2.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for Nios II. - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. Contributed by Nigel Gray (ngray@altera.com). Contributed by Mentor Graphics, Inc. @@ -1383,7 +1383,7 @@ nios2_elf32_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) /* Count the number of input BFDs and find the top input section id. */ for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_count += 1; for (section = input_bfd->sections; @@ -1718,7 +1718,7 @@ get_local_syms (bfd *output_bfd ATTRIBUTE_UNUSED, bfd *input_bfd, /* Walk over all the input BFDs, swapping in local symbols. */ for (bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; @@ -1783,7 +1783,7 @@ nios2_elf32_size_stubs (bfd *output_bfd, bfd *stub_bfd, for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; asection *section; @@ -4891,7 +4891,7 @@ nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -5104,6 +5104,17 @@ nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, return TRUE; } +/* Free the derived linker hash table. */ +static void +nios2_elf32_link_hash_table_free (bfd *obfd) +{ + struct elf32_nios2_link_hash_table *htab + = (struct elf32_nios2_link_hash_table *) obfd->link.hash; + + bfd_hash_table_free (&htab->bstab); + _bfd_elf_link_hash_table_free (obfd); +} + /* Implement bfd_elf32_bfd_link_hash_table_create. */ static struct bfd_link_hash_table * nios2_elf32_link_hash_table_create (bfd *abfd) @@ -5128,22 +5139,15 @@ nios2_elf32_link_hash_table_create (bfd *abfd) /* Init the stub hash table too. */ if (!bfd_hash_table_init (&ret->bstab, stub_hash_newfunc, sizeof (struct elf32_nios2_stub_hash_entry))) - return NULL; + { + _bfd_elf_link_hash_table_free (abfd); + return NULL; + } + ret->root.root.hash_table_free = nios2_elf32_link_hash_table_free; return &ret->root.root; } -/* Free the derived linker hash table. */ -static void -nios2_elf32_link_hash_table_free (struct bfd_link_hash_table *btab) -{ - struct elf32_nios2_link_hash_table *htab - = (struct elf32_nios2_link_hash_table *) btab; - - bfd_hash_table_free (&htab->bstab); - _bfd_elf_link_hash_table_free (btab); -} - /* Implement elf_backend_reloc_type_class. */ static enum elf_reloc_type_class nios2_elf32_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, @@ -5250,8 +5254,6 @@ const struct bfd_elf_special_section elf32_nios2_special_sections[] = #define bfd_elf32_bfd_link_hash_table_create \ nios2_elf32_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free \ - nios2_elf32_link_hash_table_free /* Relocation table lookup macros. */ diff --git a/bfd/elf32-nios2.h b/bfd/elf32-nios2.h index 1307802f7..d3e7a7d40 100644 --- a/bfd/elf32-nios2.h +++ b/bfd/elf32-nios2.h @@ -1,5 +1,5 @@ /* Nios II support for 32-bit ELF - Copyright (C) 2013-2014 Free Software Foundation, Inc. + Copyright (C) 2013-2015 Free Software Foundation, Inc. Contributed by Mentor Graphics This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c index 956ec387e..e80a2d9f1 100644 --- a/bfd/elf32-or1k.c +++ b/bfd/elf32-or1k.c @@ -1,5 +1,5 @@ /* Or1k-specific support for 32-bit ELF. - Copyright 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org PIC parts added by Stefan Kristiansson, stefan.kristiansson@saunalahti.fi, @@ -738,7 +738,11 @@ or1k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_OR1K_max); + if (r_type >= (unsigned int) R_OR1K_max) + { + _bfd_error_handler (_("%A: invalid OR1K reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = & or1k_elf_howto_table[r_type]; } @@ -907,10 +911,7 @@ or1k_elf_relocate_section (bfd *output_bfd, dyn = htab->root.dynamic_sections_created; if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic - || h->dynindx == -1 - || h->forced_local) - && h->def_regular)) + && SYMBOL_REFERENCES_LOCAL (info, h))) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -1015,11 +1016,8 @@ or1k_elf_relocate_section (bfd *output_bfd, && (h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT || h->root.type != bfd_link_hash_undefweak) - && (!howto->pc_relative - || (h != NULL - && h->dynindx != -1 - && (!info->symbolic - || !h->def_regular)))) + && (howto->type != R_OR1K_INSN_REL_26 + || !SYMBOL_CALLS_LOCAL (info, h))) || (!info->shared && h != NULL && h->dynindx != -1 @@ -1613,7 +1611,7 @@ or1k_elf_check_relocs (bfd *abfd, && (sec->flags & SEC_ALLOC) != 0 && (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26 || (h != NULL - && (! info->symbolic + && (!SYMBOLIC_BIND (info, h) || h->root.type == bfd_link_hash_defweak || !h->def_regular)))) || (!info->shared @@ -1991,11 +1989,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd, the symbol was forced to be local because of a version file. The entry in the global offset table will already have been initialized in the relocate_section function. */ - if (info->shared - && (info->symbolic - || h->dynindx == -1 - || h->forced_local) - && h->def_regular) + if (info->shared && SYMBOL_REFERENCES_LOCAL (info, h)) { rela.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE); rela.r_addend = (h->root.u.def.value @@ -2197,7 +2191,7 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2327,9 +2321,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) if (info->shared) { - if (h->def_regular - && (h->forced_local - || info->symbolic)) + if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf_or1k_dyn_relocs **pp; @@ -2464,7 +2456,7 @@ or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; diff --git a/bfd/elf32-pj.c b/bfd/elf32-pj.c index 84b61f9bb..2d041e5da 100644 --- a/bfd/elf32-pj.c +++ b/bfd/elf32-pj.c @@ -1,5 +1,5 @@ /* picoJava specific support for 32-bit ELF - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Contributed by Steve Chamberlan of Transmeta (sac@pobox.com). This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 344845d76..a17ff12ed 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1,5 +1,5 @@ /* PowerPC-specific support for 32-bit ELF - Copyright (C) 1994-2014 Free Software Foundation, Inc. + Copyright (C) 1994-2015 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -2629,7 +2629,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) apuinfo_list_init (); /* Read in the input sections contents. */ - for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link_next) + for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link.next) { unsigned long datum; @@ -3636,9 +3636,10 @@ ppc_elf_add_symbol_hook (bfd *abfd, *valp = sym->st_size; } - if ((abfd->flags & DYNAMIC) == 0 - && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; return TRUE; @@ -4017,7 +4018,7 @@ ppc_elf_check_relocs (bfd *abfd, case R_PPC_GOT_TPREL16_LO: case R_PPC_GOT_TPREL16_HI: case R_PPC_GOT_TPREL16_HA: - if (!info->executable) + if (info->shared) info->flags |= DF_STATIC_TLS; tls_type = TLS_TLS | TLS_TPREL; goto dogottls; @@ -4308,7 +4309,7 @@ ppc_elf_check_relocs (bfd *abfd, case R_PPC_TPREL16_LO: case R_PPC_TPREL16_HI: case R_PPC_TPREL16_HA: - if (!info->executable) + if (info->shared) info->flags |= DF_STATIC_TLS; goto dodyn; @@ -4828,7 +4829,7 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, --secure-plt and we never see REL16 relocs. */ if (plt_type == PLT_UNSET) plt_type = PLT_OLD; - for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next) if (is_ppc_elf (ibfd)) { if (ppc_elf_tdata (ibfd)->has_rel16) @@ -5197,7 +5198,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, notify relocate_section that optimization can be done, and adjust got and plt refcounts. */ for (pass = 0; pass < 2; ++pass) - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { Elf_Internal_Sym *locsyms = NULL; Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (ibfd); @@ -5506,9 +5507,24 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, will go to this object, or will remain undefined. */ h->plt.plist = NULL; h->needs_plt = 0; + h->pointer_equality_needed = 0; } else { + /* Taking a function's address in a read/write section + doesn't require us to define the function symbol in the + executable on a plt call stub. A dynamic reloc can + be used instead. */ + if (h->pointer_equality_needed + && h->type != STT_GNU_IFUNC + && !htab->is_vxworks + && !ppc_elf_hash_entry (h)->has_sda_refs + && !readonly_dynrelocs (h)) + { + h->pointer_equality_needed = 0; + h->non_got_ref = 0; + } + /* After adjust_dynamic_symbol, non_got_ref set in the non-shared case means that we have allocated space in .dynbss for the symbol and thus dyn_relocs for this @@ -5518,12 +5534,12 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, relocations against this symbol to the PLT entry. Allow dynamic relocs if the reference is weak, and the dynamic relocs will not cause text relocation. */ - if (!h->ref_regular_nonweak - && h->non_got_ref - && h->type != STT_GNU_IFUNC - && !htab->is_vxworks - && !ppc_elf_hash_entry (h)->has_sda_refs - && !readonly_dynrelocs (h)) + else if (!h->ref_regular_nonweak + && h->non_got_ref + && h->type != STT_GNU_IFUNC + && !htab->is_vxworks + && !ppc_elf_hash_entry (h)->has_sda_refs + && !readonly_dynrelocs (h)) h->non_got_ref = 0; } return TRUE; @@ -5612,7 +5628,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Generate a symbol to mark plt call stubs. For non-PIC code the sym is @@ -6130,7 +6146,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -6304,6 +6320,16 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd, sda->root.u.def.section = htab->elf.hgot->root.u.def.section; sda->root.u.def.value = htab->elf.hgot->root.u.def.value; } + if (info->emitrelocations) + { + struct elf_link_hash_entry *sda = htab->sdata[0].sym; + + if (sda != NULL && sda->ref_regular) + sda->root.u.def.section->flags |= SEC_KEEP; + sda = htab->sdata[1].sym; + if (sda != NULL && sda->ref_regular) + sda->root.u.def.section->flags |= SEC_KEEP; + } if (htab->glink != NULL && htab->glink->size != 0 @@ -6396,12 +6422,15 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd, || s == htab->sgotplt || s == htab->sbss || s == htab->dynbss - || s == htab->dynsbss - || s == htab->sdata[0].section - || s == htab->sdata[1].section) + || s == htab->dynsbss) { /* Strip these too. */ } + else if (s == htab->sdata[0].section + || s == htab->sdata[1].section) + { + strip_section = (s->flags & SEC_KEEP) == 0; + } else if (CONST_STRNEQ (bfd_get_section_name (htab->elf.dynobj, s), ".rela")) { @@ -7137,7 +7166,7 @@ ppc_elf_relax_section (bfd *abfd, bfd_vma pagesize = (bfd_vma) 1 << htab->params->pagesize_p2; addr = isec->output_section->vma + isec->output_offset; - end_addr = addr + trampoff - 1; + end_addr = addr + trampoff; addr &= -pagesize; crossings = ((end_addr & -pagesize) - addr) >> htab->params->pagesize_p2; if (crossings != 0) @@ -7145,7 +7174,7 @@ ppc_elf_relax_section (bfd *abfd, /* Keep space aligned, to ensure the patch code itself does not cross a page. Don't decrease size calculated on a previous pass as otherwise we might never settle on a layout. */ - newsize = 15 - (end_addr & 15); + newsize = 15 - ((end_addr - 1) & 15); newsize += crossings * 16; if (relax_info->workaround_size < newsize) { @@ -10298,11 +10327,12 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define ELF_MACHINE_CODE EM_PPC #ifdef __QNXTARGET__ #define ELF_MAXPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x1000 #else #define ELF_MAXPAGESIZE 0x10000 +#define ELF_COMMONPAGESIZE 0x10000 #endif #define ELF_MINPAGESIZE 0x1000 -#define ELF_COMMONPAGESIZE 0x1000 #define elf_info_to_howto ppc_elf_info_to_howto #ifdef EM_CYGNUS_POWERPC diff --git a/bfd/elf32-ppc.h b/bfd/elf32-ppc.h index 07dc4c842..2feeec900 100644 --- a/bfd/elf32-ppc.h +++ b/bfd/elf32-ppc.h @@ -1,5 +1,5 @@ /* PowerPC-specific support for 64-bit ELF. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c index 5e62edd30..795a281be 100644 --- a/bfd/elf32-rl78.c +++ b/bfd/elf32-rl78.c @@ -1,5 +1,5 @@ /* Renesas RL78 specific support for 32-bit ELF. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -276,7 +276,11 @@ rl78_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_RL78_max); + if (r_type >= (unsigned int) R_RL78_max) + { + _bfd_error_handler (_("%A: invalid RL78 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = rl78_elf_howto_table + r_type; } @@ -1370,7 +1374,7 @@ rl78_elf_relax_plt_section (bfd *dynobj, /* Likewise for local symbols, though that's somewhat less convenient as we have to walk the list of input bfds and swap in symbol data. */ - for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next) { bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd); Elf_Internal_Shdr *symtab_hdr; @@ -1444,7 +1448,7 @@ rl78_elf_relax_plt_section (bfd *dynobj, elf_link_hash_traverse (elf_hash_table (info), rl78_relax_plt_realloc, &entry); - for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next) { bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd); unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info; @@ -2199,7 +2203,7 @@ rl78_elf_relax_section 61 F3 EF ad SKNH ; BR $rel8 */ - if (irel->r_addend & RL78_RELAXA_BRA) + if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_BRA) { /* SKIP opcodes that skip non-branches will have a relax tag but no corresponding symbol to relax against; we just @@ -2334,7 +2338,7 @@ rl78_elf_relax_section } - if (irel->r_addend & RL78_RELAXA_ADDR16) + if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_ADDR16) { /*----------------------------------------------------------------------*/ /* Some insns have both a 16-bit address operand and an 8-bit diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c index 5d09f21bd..1bbaeba43 100644 --- a/bfd/elf32-rx.c +++ b/bfd/elf32-rx.c @@ -1,5 +1,5 @@ /* Renesas RX specific support for 32-bit ELF. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -307,7 +307,11 @@ rx_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_RX_max); + if (r_type >= (unsigned int) R_RX_max) + { + _bfd_error_handler (_("%A: invalid RX reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = rx_elf_howto_table + r_type; } diff --git a/bfd/elf32-rx.h b/bfd/elf32-rx.h index 377938838..465942665 100644 --- a/bfd/elf32-rx.h +++ b/bfd/elf32-rx.h @@ -1,5 +1,5 @@ /* Renesas RX specific support for 32-bit ELF. - Copyright (C) 2014 Free Software Foundation, Inc. + Copyright (C) 2014-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 09b1fcafb..ff89b3412 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 32-bit ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. This file is part of BFD, the Binary File Descriptor library. @@ -1250,6 +1250,12 @@ elf_s390_check_relocs (bfd *abfd, /* Fall through. */ case R_390_TLS_LE32: + /* For static linking and executables this reloc will be + calculated at linktime otherwise a TLS_TPOFF runtime + reloc will be generated. */ + if (r_type == R_390_TLS_LE32 && info->pie) + break; + if (!info->shared) break; info->flags |= DF_STATIC_TLS; @@ -1756,7 +1762,7 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info, s = htab->sdynbss; - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2045,7 +2051,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -3104,7 +3110,7 @@ elf_s390_relocate_section (bfd *output_bfd, break; case R_390_TLS_LE32: - if (info->shared) + if (info->shared && !info->pie) { /* Linking a shared library with non-fpic code requires a R_390_TLS_TPOFF relocation. */ @@ -3903,7 +3909,7 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, ->this_hdr.sh_entsize = 4; } /* Finish dynamic symbol for local IFUNC symbols. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { struct plt_entry *local_plt; Elf_Internal_Sym *isym; diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index 3223d4610..1ecc9ffee 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for S+core. - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. Contributed by Brain.lin (brain.lin@sunplusct.com) Mei Ligang (ligang@sunnorth.com.cn) @@ -3199,7 +3199,7 @@ s3_bfd_score_elf_always_size_sections (bfd *output_bfd, /* Calculate the total loadable size of the output. That will give us the maximum number of GOT_PAGE entries required. */ - for (sub = info->input_bfds; sub; sub = sub->link_next) + for (sub = info->input_bfds; sub; sub = sub->link.next) { asection *subsection; diff --git a/bfd/elf32-score.h b/bfd/elf32-score.h index f71436d50..9034ded3a 100644 --- a/bfd/elf32-score.h +++ b/bfd/elf32-score.h @@ -1,5 +1,5 @@ /* 32-bit ELF support for S+core. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Contributed by Brain.lin (brain.lin@sunplusct.com) Mei Ligang (ligang@sunnorth.com.cn) diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c index c24107771..8c4b69f49 100644 --- a/bfd/elf32-score7.c +++ b/bfd/elf32-score7.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for S+core. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Contributed by Brain.lin (brain.lin@sunplusct.com) Mei Ligang (ligang@sunnorth.com.cn) @@ -3006,7 +3006,7 @@ s7_bfd_score_elf_always_size_sections (bfd *output_bfd, /* Calculate the total loadable size of the output. That will give us the maximum number of GOT_PAGE entries required. */ - for (sub = info->input_bfds; sub; sub = sub->link_next) + for (sub = info->input_bfds; sub; sub = sub->link.next) { asection *subsection; diff --git a/bfd/elf32-sh-relocs.h b/bfd/elf32-sh-relocs.h index fb54c9a66..8f1db0f68 100644 --- a/bfd/elf32-sh-relocs.h +++ b/bfd/elf32-sh-relocs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2014 Free Software Foundation, Inc. +/* Copyright (C) 2006-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-sh-symbian.c b/bfd/elf32-sh-symbian.c index 5239de31f..fc2d36b73 100644 --- a/bfd/elf32-sh-symbian.c +++ b/bfd/elf32-sh-symbian.c @@ -1,5 +1,5 @@ /* Renesas / SuperH specific support for Symbian 32-bit ELF files - Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2015 Free Software Foundation, Inc. Contributed by Red Hat This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 259ddf08a..04e588d1b 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -1,5 +1,5 @@ /* Renesas / SuperH SH specific support for 32-bit ELF - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Contributed by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -702,10 +702,10 @@ sh_elf_relax_section (bfd *abfd, asection *sec, elf_section_data (sec)->this_hdr.contents = contents; symtab_hdr->contents = (unsigned char *) isymbuf; - /* Replace the jsr with a bsr. */ + /* Replace the jmp/jsr with a bra/bsr. */ /* Change the R_SH_USES reloc into an R_SH_IND12W reloc, and - replace the jsr with a bsr. */ + replace the jmp/jsr with a bra/bsr. */ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_SH_IND12W); /* We used to test (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info) here, but that only checks if the symbol is an external symbol, @@ -716,7 +716,10 @@ sh_elf_relax_section (bfd *abfd, asection *sec, /* We can't fully resolve this yet, because the external symbol value may be changed by future relaxing. We let the final link phase handle it. */ - bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset); + if (bfd_get_16 (abfd, contents + irel->r_offset) & 0x0020) + bfd_put_16 (abfd, (bfd_vma) 0xa000, contents + irel->r_offset); + else + bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset); irel->r_addend = -4; @@ -2916,7 +2919,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -3341,7 +3344,7 @@ sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -3676,7 +3679,9 @@ sh_elf_osec_to_segment (bfd *output_bfd, asection *osec) { Elf_Internal_Phdr *p = NULL; - if (output_bfd->xvec->flavour == bfd_target_elf_flavour) + if (output_bfd->xvec->flavour == bfd_target_elf_flavour + /* PR ld/17110: Do not look for output segments in an input bfd. */ + && output_bfd->direction != read_direction) p = _bfd_elf_find_segment_containing_section (output_bfd, osec); /* FIXME: Nothing ever says what this index is relative to. The kernel diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c index 500050613..192ecdfa6 100644 --- a/bfd/elf32-sh64-com.c +++ b/bfd/elf32-sh64-com.c @@ -1,5 +1,5 @@ /* SuperH SH64-specific support for 32-bit ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 9042081bb..0e696b308 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -1,5 +1,5 @@ /* SuperH SH64-specific support for 32-bit ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-sh64.h b/bfd/elf32-sh64.h index 4aee0c5f1..0820f52cf 100644 --- a/bfd/elf32-sh64.h +++ b/bfd/elf32-sh64.h @@ -1,5 +1,5 @@ /* SH ELF support for BFD. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index f714a5e4c..88efe9e4c 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -173,16 +173,17 @@ elf32_sparc_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, static bfd_boolean elf32_sparc_add_symbol_hook (bfd * abfd, - struct bfd_link_info * info ATTRIBUTE_UNUSED, + struct bfd_link_info * info, Elf_Internal_Sym * sym, const char ** namep ATTRIBUTE_UNUSED, flagword * flagsp ATTRIBUTE_UNUSED, asection ** secp ATTRIBUTE_UNUSED, bfd_vma * valp ATTRIBUTE_UNUSED) { - if ((abfd->flags & DYNAMIC) == 0 - && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; return TRUE; } @@ -209,8 +210,6 @@ elf32_sparc_add_symbol_hook (bfd * abfd, _bfd_sparc_elf_reloc_name_lookup #define bfd_elf32_bfd_link_hash_table_create \ _bfd_sparc_elf_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free \ - _bfd_sparc_elf_link_hash_table_free #define bfd_elf32_bfd_relax_section _bfd_sparc_elf_relax_section #define bfd_elf32_new_section_hook _bfd_sparc_elf_new_section_hook #define elf_backend_copy_indirect_symbol \ diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index ac9c184ea..ace7c29dc 100644 --- a/bfd/elf32-spu.c +++ b/bfd/elf32-spu.c @@ -1,6 +1,6 @@ /* SPU specific support for 32-bit ELF - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -555,7 +555,7 @@ spu_elf_create_sections (struct bfd_link_info *info) struct spu_link_hash_table *htab = spu_hash_table (info); bfd *ibfd; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) if (bfd_get_section_by_name (ibfd, SPU_PTNOTE_SPUNAME) != NULL) break; @@ -1520,7 +1520,7 @@ process_stubs (struct bfd_link_info *info, bfd_boolean build) struct spu_link_hash_table *htab = spu_hash_table (info); bfd *ibfd; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { extern const bfd_target spu_elf32_vec; Elf_Internal_Shdr *symtab_hdr; @@ -1828,6 +1828,18 @@ ovl_mgr_pread (struct bfd *abfd ATTRIBUTE_UNUSED, return count; } +static int +ovl_mgr_stat (struct bfd *abfd ATTRIBUTE_UNUSED, + void *stream, + struct stat *sb) +{ + struct _ovl_stream *os = (struct _ovl_stream *) stream; + + memset (sb, 0, sizeof (*sb)); + sb->st_size = (const char *) os->end - (const char *) os->start; + return 0; +} + bfd_boolean spu_elf_open_builtin_lib (bfd **ovl_bfd, const struct _ovl_stream *stream) { @@ -1837,7 +1849,7 @@ spu_elf_open_builtin_lib (bfd **ovl_bfd, const struct _ovl_stream *stream) (void *) stream, ovl_mgr_pread, NULL, - NULL); + ovl_mgr_stat); return *ovl_bfd != NULL; } @@ -2936,7 +2948,7 @@ discover_functions (struct bfd_link_info *info) bfd_boolean gaps = FALSE; bfd_idx = 0; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) bfd_idx++; psym_arr = bfd_zmalloc (bfd_idx * sizeof (*psym_arr)); @@ -2948,7 +2960,7 @@ discover_functions (struct bfd_link_info *info) for (ibfd = info->input_bfds, bfd_idx = 0; ibfd != NULL; - ibfd = ibfd->link_next, bfd_idx++) + ibfd = ibfd->link.next, bfd_idx++) { extern const bfd_target spu_elf32_vec; Elf_Internal_Shdr *symtab_hdr; @@ -3056,7 +3068,7 @@ discover_functions (struct bfd_link_info *info) relocations. */ for (ibfd = info->input_bfds, bfd_idx = 0; ibfd != NULL; - ibfd = ibfd->link_next, bfd_idx++) + ibfd = ibfd->link.next, bfd_idx++) { asection *sec; @@ -3070,7 +3082,7 @@ discover_functions (struct bfd_link_info *info) for (ibfd = info->input_bfds, bfd_idx = 0; ibfd != NULL; - ibfd = ibfd->link_next, bfd_idx++) + ibfd = ibfd->link.next, bfd_idx++) { Elf_Internal_Shdr *symtab_hdr; asection *sec; @@ -3109,7 +3121,7 @@ discover_functions (struct bfd_link_info *info) } } - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { extern const bfd_target spu_elf32_vec; asection *sec; @@ -3152,7 +3164,7 @@ discover_functions (struct bfd_link_info *info) for (ibfd = info->input_bfds, bfd_idx = 0; ibfd != NULL; - ibfd = ibfd->link_next, bfd_idx++) + ibfd = ibfd->link.next, bfd_idx++) { if (psym_arr[bfd_idx] == NULL) continue; @@ -3181,7 +3193,7 @@ for_each_node (bfd_boolean (*doit) (struct function_info *, { bfd *ibfd; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { extern const bfd_target spu_elf32_vec; asection *sec; @@ -3330,7 +3342,7 @@ build_call_tree (struct bfd_link_info *info) bfd *ibfd; unsigned int depth; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { extern const bfd_target spu_elf32_vec; asection *sec; @@ -3707,7 +3719,7 @@ auto_ovl_lib_functions (struct bfd_link_info *info, unsigned int lib_size) memset (&dummy_caller, 0, sizeof (dummy_caller)); lib_count = 0; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { extern const bfd_target spu_elf32_vec; asection *sec; @@ -4252,7 +4264,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info) goto err_exit; bfd_count = 0; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) ++bfd_count; bfd_arr = bfd_malloc (bfd_count * sizeof (*bfd_arr)); if (bfd_arr == NULL) @@ -4262,7 +4274,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info) count = 0; bfd_count = 0; total_overlay_size = 0; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { extern const bfd_target spu_elf32_vec; asection *sec; @@ -5395,7 +5407,7 @@ spu_elf_size_sections (bfd * output_bfd, struct bfd_link_info *info) bfd *ibfd; size_t size; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { asection *isec; diff --git a/bfd/elf32-spu.h b/bfd/elf32-spu.h index 2330e1395..0832d861e 100644 --- a/bfd/elf32-spu.h +++ b/bfd/elf32-spu.h @@ -1,6 +1,6 @@ /* SPU specific support for 32-bit ELF. - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index e3e897c58..f29a06df0 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for TI C6X - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Contributed by Joseph Myers Bernd Schmidt @@ -1919,7 +1919,7 @@ elf32_tic6x_gc_mark_extra_sections (struct bfd_link_info *info, while (again) { again = FALSE; - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { asection *o; @@ -2168,7 +2168,7 @@ elf32_tic6x_adjust_dynamic_symbol (struct bfd_link_info *info, s = htab->sdynbss; - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } static bfd_boolean @@ -3309,7 +3309,7 @@ elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -4051,7 +4051,7 @@ elf32_tic6x_fix_exidx_coverage (asection **text_section_order, /* Walk over all EXIDX sections, and create backlinks from the corrsponding text sections. */ - for (inp = info->input_bfds; inp != NULL; inp = inp->link_next) + for (inp = info->input_bfds; inp != NULL; inp = inp->link.next) { asection *sec; diff --git a/bfd/elf32-tic6x.h b/bfd/elf32-tic6x.h index 12024b870..b539ad949 100644 --- a/bfd/elf32-tic6x.h +++ b/bfd/elf32-tic6x.h @@ -1,5 +1,5 @@ /* 32-bit ELF support for TI C6X - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-tilegx.c b/bfd/elf32-tilegx.c index bc5752c29..b16bece2a 100644 --- a/bfd/elf32-tilegx.c +++ b/bfd/elf32-tilegx.c @@ -1,5 +1,5 @@ /* TILE-Gx-specific support for 32-bit ELF. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-tilegx.h b/bfd/elf32-tilegx.h index abcec80fb..7080c7e97 100644 --- a/bfd/elf32-tilegx.h +++ b/bfd/elf32-tilegx.h @@ -1,5 +1,5 @@ /* TILE-Gx-specific support for 32-bit ELF. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c index 4e6561db2..3d2bbde7e 100644 --- a/bfd/elf32-tilepro.c +++ b/bfd/elf32-tilepro.c @@ -1,5 +1,5 @@ /* TILEPro-specific support for 32-bit ELF. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2189,7 +2189,7 @@ tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, htab->sdynbss); + return _bfd_elf_adjust_dynamic_copy (info, h, htab->sdynbss); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2472,7 +2472,7 @@ tilepro_elf_size_dynamic_sections (bfd *output_bfd, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; diff --git a/bfd/elf32-tilepro.h b/bfd/elf32-tilepro.h index 3d2aa87a6..6f3961091 100644 --- a/bfd/elf32-tilepro.h +++ b/bfd/elf32-tilepro.h @@ -1,5 +1,5 @@ /* TILEPro-specific support for 32-bit ELF. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 2589a2525..31cbcc975 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -1,5 +1,5 @@ /* V850-specific support for 32-bit ELF - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1896,7 +1896,11 @@ v850_elf_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_V850_max); + if (r_type >= (unsigned int) R_V850_max) + { + _bfd_error_handler (_("%A: invalid V850 reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &v850_elf_howto_table[r_type]; } diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index c28cacadd..cae0bb2ae 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -1,5 +1,5 @@ /* VAX series support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Contributed by Matt Thomas . This file is part of BFD, the Binary File Descriptor library. @@ -1043,7 +1043,7 @@ elf_vax_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* This function is called via elf_link_hash_traverse. It resets GOT @@ -1221,7 +1221,7 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) continue; /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size); + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size); if (s->contents == NULL) return FALSE; } diff --git a/bfd/elf32-visium.c b/bfd/elf32-visium.c new file mode 100644 index 000000000..5e304674c --- /dev/null +++ b/bfd/elf32-visium.c @@ -0,0 +1,903 @@ +/* Visium-specific support for 32-bit ELF. + + Copyright (C) 2003-2015 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 3 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., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#include "sysdep.h" +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/visium.h" + +static bfd_reloc_status_type visium_elf_howto_parity_reloc + (bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **); + +static reloc_howto_type visium_elf_howto_table[] = { + /* This reloc does nothing. */ + HOWTO (R_VISIUM_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_VISIUM_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 8 bit absolute relocation. */ + HOWTO (R_VISIUM_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_VISIUM_8", /* name */ + FALSE, /* partial_inplace */ + 0x00, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit absolute relocation. */ + HOWTO (R_VISIUM_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_VISIUM_16", /* name */ + FALSE, /* partial_inplace */ + 0x0000, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 32 bit absolute relocation. */ + HOWTO (R_VISIUM_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_VISIUM_32", /* name */ + FALSE, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + + /* A 8 bit PC relative relocation. */ + HOWTO (R_VISIUM_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_VISIUM_8_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0x00, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 16 bit PC relative relocation. */ + HOWTO (R_VISIUM_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_VISIUM_16_PCREL", /* name */ + FALSE, /* partial inplace */ + 0x0000, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 32-bit PC relative relocation. */ + HOWTO (R_VISIUM_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_VISIUM_32_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 16-bit PC word relative offset, relative to start of instruction + and always in the second half of the instruction. */ + HOWTO (R_VISIUM_PC16, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + visium_elf_howto_parity_reloc, /* special_function */ + "R_VISIUM_PC16", /* name */ + FALSE, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The high 16 bits of symbol value. */ + HOWTO (R_VISIUM_HI16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + visium_elf_howto_parity_reloc, /* special_function */ + "R_VISIUM_HI16", /* name */ + FALSE, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* The low 16 bits of symbol value. */ + HOWTO (R_VISIUM_LO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + visium_elf_howto_parity_reloc, /* special_function */ + "R_VISIUM_LO16", /* name */ + FALSE, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit immediate value. */ + HOWTO (R_VISIUM_IM16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + visium_elf_howto_parity_reloc, /* special_function */ + "R_VISIUM_IM16", /* name */ + FALSE, /* partial_inplace */ + 0x0000000, /* src_mask */ + 0x000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* The high 16 bits of symbol value, pc relative. */ + HOWTO (R_VISIUM_HI16_PCREL, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + visium_elf_howto_parity_reloc, /* special_function */ + "R_VISIUM_HI16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* The low 16 bits of symbol value, pc relative. */ + HOWTO (R_VISIUM_LO16_PCREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + visium_elf_howto_parity_reloc, /* special_function */ + "R_VISIUM_LO16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* A 16 bit immediate value, pc relative. */ + HOWTO (R_VISIUM_IM16_PCREL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned, /* complain_on_overflow */ + visium_elf_howto_parity_reloc, /* special_function */ + "R_VISIUM_IM16_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0x0000000, /* src_mask */ + 0x000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + +}; + +/* GNU extension to record C++ vtable hierarchy. */ +static reloc_howto_type visium_elf_vtinherit_howto = + HOWTO (R_VISIUM_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_VISIUM_GNU_VTINHERIT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE); /* pcrel_offset */ + +/* GNU extension to record C++ vtable member usage. */ +static reloc_howto_type visium_elf_vtentry_howto = + HOWTO (R_VISIUM_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 */ + NULL, /* special_function */ + "R_VISIUM_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE); /* pcrel_offset */ + +/* Map BFD reloc types to VISIUM ELF reloc types. */ +struct visium_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned int visium_reloc_val; +}; + +static const struct visium_reloc_map visium_reloc_map[] = { + {BFD_RELOC_NONE, R_VISIUM_NONE}, + {BFD_RELOC_8, R_VISIUM_8}, + {BFD_RELOC_16, R_VISIUM_16}, + {BFD_RELOC_32, R_VISIUM_32}, + {BFD_RELOC_8_PCREL, R_VISIUM_8_PCREL}, + {BFD_RELOC_16_PCREL, R_VISIUM_16_PCREL}, + {BFD_RELOC_32_PCREL, R_VISIUM_32_PCREL}, + {BFD_RELOC_VISIUM_REL16, R_VISIUM_PC16}, + {BFD_RELOC_VISIUM_HI16, R_VISIUM_HI16}, + {BFD_RELOC_VISIUM_LO16, R_VISIUM_LO16}, + {BFD_RELOC_VISIUM_IM16, R_VISIUM_IM16}, + {BFD_RELOC_VISIUM_HI16_PCREL, R_VISIUM_HI16_PCREL}, + {BFD_RELOC_VISIUM_LO16_PCREL, R_VISIUM_LO16_PCREL}, + {BFD_RELOC_VISIUM_IM16_PCREL, R_VISIUM_IM16_PCREL}, + {BFD_RELOC_VTABLE_INHERIT, R_VISIUM_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_VISIUM_GNU_VTENTRY}, +}; + +/* Return the parity bit for INSN shifted to its final position. */ + +static bfd_vma +visium_parity_bit (bfd_vma insn) +{ + bfd_vma p = 0; + int i; + + for (i = 0; i < 31; i++) + { + p ^= (insn & 1); + insn >>= 1; + } + + return p << 31; +} + +/* This "special function" will only be used when the input and + output files have different formats ie. when generating S-records + directly using "--oformat srec". Otherwise we use + _bfd_final_link_relocate which uses a howto structure, but does + not use the special_function field. + + It sets instruction parity to even. This cannot be done by a howto. */ + +static bfd_reloc_status_type +visium_elf_howto_parity_reloc (bfd * input_bfd, arelent *reloc_entry, + asymbol *symbol, PTR data, + asection *input_section, bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) +{ + bfd_reloc_status_type ret; + bfd_vma relocation; + bfd_byte *inplace_address; + bfd_vma insn; + const bfd_vma signmask = 0xffff8000; + + /* This part is from bfd_elf_generic_reloc. + If we're relocating, and this an external symbol, we don't want + to change anything. */ + if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + /* Now do the reloc in the usual way. */ + + /* Sanity check the address (offset in section). */ + if (reloc_entry->address > bfd_get_section_limit (input_bfd, input_section)) + return bfd_reloc_outofrange; + + ret = bfd_reloc_ok; + if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL) + ret = bfd_reloc_undefined; + + if (bfd_is_com_section (symbol->section) || output_bfd != (bfd *) NULL) + relocation = 0; + else + relocation = symbol->value; + + /* Only do this for a final link. */ + if (output_bfd == (bfd *) NULL) + { + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + } + + relocation += reloc_entry->addend; + inplace_address = (bfd_byte *) data + reloc_entry->address; + insn = bfd_get_32 (input_bfd, inplace_address); + + if (reloc_entry->howto->pc_relative) + { + relocation -= input_section->output_section->vma + + input_section->output_offset; + relocation -= reloc_entry->address; + } + + switch (reloc_entry->howto->type) + { + case R_VISIUM_PC16: + relocation >>= 2; + if (ret == bfd_reloc_ok && (relocation & signmask) != 0 + && (relocation & signmask) != signmask) + ret = bfd_reloc_overflow; + relocation &= 0xffff; + break; + case R_VISIUM_HI16: + case R_VISIUM_HI16_PCREL: + relocation = (relocation >> 16) & 0xffff; + break; + case R_VISIUM_LO16: + case R_VISIUM_LO16_PCREL: + relocation &= 0xffff; + break; + case R_VISIUM_IM16: + case R_VISIUM_IM16_PCREL: + if (ret == bfd_reloc_ok && (relocation & 0xffff0000) != 0) + ret = bfd_reloc_overflow; + relocation &= 0xffff; + break; + } + insn = (insn & 0x7fff0000) | relocation; + insn |= visium_parity_bit (insn); + bfd_put_32 (input_bfd, insn, inplace_address); + + if (output_bfd != (bfd *) NULL) + reloc_entry->address += input_section->output_offset; + + return ret; +} + +static reloc_howto_type * +visium_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + /* Note that the visium_elf_howto_table is indexed by the R_ + constants. Thus, the order that the howto records appear in the + table *must* match the order of the relocation types defined in + include/elf/visium.h. */ + switch (code) + { + case BFD_RELOC_NONE: + return &visium_elf_howto_table[(int) R_VISIUM_NONE]; + case BFD_RELOC_8: + return &visium_elf_howto_table[(int) R_VISIUM_8]; + case BFD_RELOC_16: + return &visium_elf_howto_table[(int) R_VISIUM_16]; + case BFD_RELOC_32: + return &visium_elf_howto_table[(int) R_VISIUM_32]; + case BFD_RELOC_8_PCREL: + return &visium_elf_howto_table[(int) R_VISIUM_8_PCREL]; + case BFD_RELOC_16_PCREL: + return &visium_elf_howto_table[(int) R_VISIUM_16_PCREL]; + case BFD_RELOC_32_PCREL: + return &visium_elf_howto_table[(int) R_VISIUM_32_PCREL]; + case BFD_RELOC_VISIUM_REL16: + return &visium_elf_howto_table[(int) R_VISIUM_PC16]; + case BFD_RELOC_VISIUM_HI16: + return &visium_elf_howto_table[(int) R_VISIUM_HI16]; + case BFD_RELOC_VISIUM_LO16: + return &visium_elf_howto_table[(int) R_VISIUM_LO16]; + case BFD_RELOC_VISIUM_IM16: + return &visium_elf_howto_table[(int) R_VISIUM_IM16]; + case BFD_RELOC_VISIUM_HI16_PCREL: + return &visium_elf_howto_table[(int) R_VISIUM_HI16_PCREL]; + case BFD_RELOC_VISIUM_LO16_PCREL: + return &visium_elf_howto_table[(int) R_VISIUM_LO16_PCREL]; + case BFD_RELOC_VISIUM_IM16_PCREL: + return &visium_elf_howto_table[(int) R_VISIUM_IM16_PCREL]; + case BFD_RELOC_VTABLE_INHERIT: + return &visium_elf_vtinherit_howto; + case BFD_RELOC_VTABLE_ENTRY: + return &visium_elf_vtentry_howto; + default: + return NULL; + } +} + +static reloc_howto_type * +visium_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < (sizeof (visium_elf_howto_table) + / sizeof (visium_elf_howto_table[0])); i++) + if (visium_elf_howto_table[i].name != NULL + && strcasecmp (visium_elf_howto_table[i].name, r_name) == 0) + return &visium_elf_howto_table[i]; + + if (strcasecmp (visium_elf_vtinherit_howto.name, r_name) == 0) + return &visium_elf_vtinherit_howto; + if (strcasecmp (visium_elf_vtentry_howto.name, r_name) == 0) + return &visium_elf_vtentry_howto; + + return NULL; +} + +/* Set the howto pointer for a VISIUM ELF reloc. */ + +static void +visium_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + + switch (r_type) + { + case R_VISIUM_GNU_VTINHERIT: + cache_ptr->howto = &visium_elf_vtinherit_howto; + break; + + case R_VISIUM_GNU_VTENTRY: + cache_ptr->howto = &visium_elf_vtentry_howto; + break; + + default: + if (r_type >= (unsigned int) R_VISIUM_max) + { + _bfd_error_handler (_("%A: invalid Visium reloc number: %d"), abfd, r_type); + r_type = 0; + } + cache_ptr->howto = &visium_elf_howto_table[r_type]; + break; + } +} + +/* 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 bfd_boolean +visium_elf_check_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; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + + if (info->relocatable) + return TRUE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + + 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]; + 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; + } + + switch (ELF32_R_TYPE (rel->r_info)) + { + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_VISIUM_GNU_VTINHERIT: + if (!bfd_elf_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_VISIUM_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; + break; + } + } + + return TRUE; +} + +/* Relocate a VISIUM ELF section. */ + +static bfd_boolean +visium_elf_relocate_section (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) +{ + 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; + + 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; + bfd_vma insn; + + r_type = ELF32_R_TYPE (rel->r_info); + + if (r_type == R_VISIUM_GNU_VTINHERIT || r_type == R_VISIUM_GNU_VTENTRY) + continue; + + r_symndx = ELF32_R_SYM (rel->r_info); + + howto = visium_elf_howto_table + ELF32_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + /* This is a local symbol. */ + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + + 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; + } + else + { + bfd_boolean unresolved_reloc; + bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned, ignored); + + name = h->root.root.string; + } + + if (sec != NULL && discarded_section (sec)) + { + /* For relocs against symbols from removed linkonce sections, + or sections discarded by a linker script, we just want the + section contents zeroed. Avoid any special processing. */ + _bfd_clear_contents (howto, input_bfd, input_section, + contents + rel->r_offset); + + rel->r_info = 0; + rel->r_addend = 0; + continue; + } + + if (info->relocatable) + continue; + + switch (r_type) + { + case R_VISIUM_PC16: + case R_VISIUM_HI16: + case R_VISIUM_LO16: + case R_VISIUM_IM16: + case R_VISIUM_HI16_PCREL: + case R_VISIUM_LO16_PCREL: + case R_VISIUM_IM16_PCREL: + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); + + /* For instruction relocations, the parity needs correcting. */ + if (r == bfd_reloc_ok) + { + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn = (insn & 0x7fffffff) | visium_parity_bit (insn); + bfd_put_32 (input_bfd, insn, contents + rel->r_offset); + } + break; + + default: + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); + break; + } + + if (r != bfd_reloc_ok) + { + const char *msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + r = info->callbacks->reloc_overflow + (info, (h ? &h->root : NULL), 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; +} + +/* This function is called during section gc to discover the section a + to which a particular relocation refers. Return the section that + should be marked against GC for a given relocation. */ + +static asection * +visium_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info, + 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_VISIUM_GNU_VTINHERIT: + case R_VISIUM_GNU_VTENTRY: + return NULL; + } + + return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); +} + +static void +visium_elf_post_process_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + Elf_Internal_Ehdr *i_ehdrp = elf_elfheader (abfd); + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_STANDALONE; + i_ehdrp->e_ident[EI_ABIVERSION] = 1; +} + +/* Function to set the ELF flag bits. */ + +static bfd_boolean +visium_elf_set_private_flags (bfd *abfd, flagword 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 bfd_boolean +visium_elf_copy_private_bfd_data (bfd *ibfd, bfd *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; + + /* Copy object attributes. */ + _bfd_elf_copy_obj_attributes (ibfd, obfd); + + return TRUE; +} + +/* Merge backend specific data from an object + file to the output object file when linking. */ + +static bfd_boolean +visium_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) +{ + flagword old_flags; + flagword new_flags; + flagword mismatch; + const char *opt_arch = NULL; + const char *new_opt_with = NULL; + const char *old_opt_with = NULL; + const char *with = "with"; + const char *without = "without"; + const char *mcm = "mcm"; + const char *mcm24 = "mcm24"; + const char *gr6 = "gr6"; + + 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; + elf_elfheader (obfd)->e_flags = new_flags; + } + else + { + mismatch = (new_flags ^ old_flags) + & (EF_VISIUM_ARCH_MCM | EF_VISIUM_ARCH_MCM24 | EF_VISIUM_ARCH_GR6); + if (mismatch & EF_VISIUM_ARCH_GR6) + { + opt_arch = gr6; + new_opt_with = new_flags & EF_VISIUM_ARCH_GR6 ? with : without; + old_opt_with = old_flags & EF_VISIUM_ARCH_GR6 ? with : without; + } + else if (mismatch & EF_VISIUM_ARCH_MCM) + { + opt_arch = mcm; + new_opt_with = new_flags & EF_VISIUM_ARCH_MCM ? with : without; + old_opt_with = old_flags & EF_VISIUM_ARCH_MCM ? with : without; + } + else if (mismatch & EF_VISIUM_ARCH_MCM24) + { + opt_arch = mcm24; + new_opt_with = new_flags & EF_VISIUM_ARCH_MCM24 ? with : without; + old_opt_with = old_flags & EF_VISIUM_ARCH_MCM24 ? with : without; + } + + if (mismatch) + _bfd_error_handler + (_ + ("%s: compiled %s -mtune=%s and linked with modules" + " compiled %s -mtune=%s"), + bfd_get_filename (ibfd), new_opt_with, opt_arch, old_opt_with, + opt_arch); + } + + return TRUE; +} + +static bfd_boolean +visium_elf_print_private_bfd_data (bfd *abfd, void *ptr) +{ + FILE *file = (FILE *) ptr; + flagword flags; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + /* Print normal ELF private data. */ + _bfd_elf_print_private_bfd_data (abfd, ptr); + + flags = elf_elfheader (abfd)->e_flags; + fprintf (file, _("private flags = 0x%lx:"), (long) flags); + + if (flags & EF_VISIUM_ARCH_GR6) + fprintf (file, " -mtune=gr6"); + else if (flags & EF_VISIUM_ARCH_MCM) + fprintf (file, " -mtune=mcm"); + else if (flags & EF_VISIUM_ARCH_MCM24) + fprintf (file, " -mtune=mcm24"); + + fputc ('\n', file); + return TRUE; +} + +#define ELF_ARCH bfd_arch_visium +#define ELF_MACHINE_CODE EM_VISIUM +#define ELF_MAXPAGESIZE 1 + +#define TARGET_BIG_SYM visium_elf32_vec +#define TARGET_BIG_NAME "elf32-visium" + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto visium_info_to_howto_rela +#define elf_backend_relocate_section visium_elf_relocate_section +#define elf_backend_gc_mark_hook visium_elf_gc_mark_hook +#define elf_backend_check_relocs visium_elf_check_relocs +#define elf_backend_rela_normal 1 + +#define elf_backend_can_gc_sections 1 + +#define bfd_elf32_bfd_reloc_type_lookup visium_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup visium_reloc_name_lookup + +#define bfd_elf32_bfd_set_private_flags visium_elf_set_private_flags +#define bfd_elf32_bfd_copy_private_bfd_data visium_elf_copy_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data visium_elf_merge_private_bfd_data +#define bfd_elf32_bfd_print_private_bfd_data visium_elf_print_private_bfd_data +#define elf_backend_post_process_headers visium_elf_post_process_headers + +#include "elf32-target.h" diff --git a/bfd/elf32-xc16x.c b/bfd/elf32-xc16x.c index 9e7decab2..dcce94105 100644 --- a/bfd/elf32-xc16x.c +++ b/bfd/elf32-xc16x.c @@ -1,5 +1,5 @@ /* Infineon XC16X-specific support for 16-bit ELF. - Copyright (C) 2006-2014 Free Software Foundation, Inc. + Copyright (C) 2006-2015 Free Software Foundation, Inc. Contributed by KPIT Cummins Infosystems This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf32-xgate.c b/bfd/elf32-xgate.c index 87d06c874..59b019758 100644 --- a/bfd/elf32-xgate.c +++ b/bfd/elf32-xgate.c @@ -1,5 +1,5 @@ /* Freescale XGATE-specific support for 32-bit ELF - Copyright (C) 2010-2014 Free Software Foundation, Inc. + Copyright (C) 2010-2015 Free Software Foundation, Inc. Contributed by Sean Keys(skeys@ipdatasys.com) This file is part of BFD, the Binary File Descriptor library. @@ -422,24 +422,28 @@ xgate_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT(r_type < (unsigned int) R_XGATE_max); + if (r_type >= (unsigned int) R_XGATE_max) + { + _bfd_error_handler (_("%A: invalid XGate reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_xgate_howto_table[r_type]; } -/* Free the derived linker hash table. */ +/* Destroy an XGATE ELF linker hash table. */ -void -xgate_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash) +static void +xgate_elf_bfd_link_hash_table_free (bfd *obfd) { struct xgate_elf_link_hash_table *ret = - (struct xgate_elf_link_hash_table *) hash; + (struct xgate_elf_link_hash_table *) obfd->link.hash; bfd_hash_table_free (ret->stub_hash_table); free (ret->stub_hash_table); - _bfd_elf_link_hash_table_free (hash); + _bfd_elf_link_hash_table_free (obfd); } -/* Create a XGATE ELF linker hash table. */ +/* Create an XGATE ELF linker hash table. */ static struct bfd_link_hash_table* xgate_elf_bfd_link_hash_table_create (bfd *abfd) @@ -464,7 +468,7 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd) ret->stub_hash_table = (struct bfd_hash_table*) bfd_zmalloc (amt); if (ret->stub_hash_table == NULL) { - free (ret); + _bfd_elf_link_hash_table_free (abfd); return NULL; } @@ -472,9 +476,10 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd) sizeof(struct elf32_xgate_stub_hash_entry))) { free (ret->stub_hash_table); - free (ret); + _bfd_elf_link_hash_table_free (abfd); return NULL; } + ret->root.root.hash_table_free = xgate_elf_bfd_link_hash_table_free; return &ret->root.root; } @@ -717,7 +722,6 @@ elf32_xgate_post_process_headers (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_in #define elf_backend_add_symbol_hook elf32_xgate_add_symbol_hook #define bfd_elf32_bfd_link_hash_table_create xgate_elf_bfd_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free xgate_elf_bfd_link_hash_table_free #define bfd_elf32_bfd_merge_private_bfd_data _bfd_xgate_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags _bfd_xgate_elf_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data _bfd_xgate_elf_print_private_bfd_data diff --git a/bfd/elf32-xgate.h b/bfd/elf32-xgate.h index 8a178c22b..7a6752f73 100644 --- a/bfd/elf32-xgate.h +++ b/bfd/elf32-xgate.h @@ -1,5 +1,5 @@ /* Freescale XGATE-specific support for 32-bit ELF - Copyright (C) 2012-2014 Free Software Foundation, Inc. + Copyright (C) 2012-2015 Free Software Foundation, Inc. Contributed by Sean Keys (skeys@ipdatasys.com) (Heavily copied from the HC11 port by Stephane Carrez (stcarrez@nerim.fr)) @@ -100,7 +100,6 @@ struct xgate_elf_link_hash_table extern struct xgate_elf_link_hash_table* xgate_elf_hash_table_create (bfd *); -extern void xgate_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *); extern void xgate_elf_get_bank_parameters (struct bfd_link_info *); diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 74adf6487..7eae51ca4 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -1,5 +1,5 @@ /* Xstormy16-specific support for 32-bit ELF. - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -610,7 +610,7 @@ xstormy16_elf_relax_section (bfd *dynobj, /* Likewise for local symbols, though that's somewhat less convenient as we have to walk the list of input bfds and swap in symbol data. */ - for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next) { bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd); Elf_Internal_Shdr *symtab_hdr; @@ -684,7 +684,7 @@ xstormy16_elf_relax_section (bfd *dynobj, elf_link_hash_traverse (elf_hash_table (info), xstormy16_relax_plt_realloc, &entry); - for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd ; ibfd = ibfd->link.next) { bfd_vma *local_plt_offsets = elf_local_got_offsets (ibfd); unsigned int nlocals = elf_tdata (ibfd)->symtab_hdr.sh_info; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index adc0a0221..59a1c094c 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -1,5 +1,5 @@ /* Xtensa-specific support for 32-bit ELF. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -479,7 +479,11 @@ elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, { unsigned int r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_XTENSA_max); + if (r_type >= (unsigned int) R_XTENSA_max) + { + _bfd_error_handler (_("%A: invalid XTENSA reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_howto_table[r_type]; } @@ -1561,7 +1565,7 @@ elf_xtensa_allocate_local_got_size (struct bfd_link_info *info) if (htab == NULL) return; - for (i = info->input_bfds; i; i = i->link_next) + for (i = info->input_bfds; i; i = i->link.next) { bfd_signed_vma *local_got_refcounts; bfd_size_type j, cnt; @@ -1700,7 +1704,7 @@ elf_xtensa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, literal tables. */ sgotloc = htab->sgotloc; sgotloc->size = spltlittbl->size; - for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next) { if (abfd->flags & DYNAMIC) continue; @@ -6746,14 +6750,14 @@ analyze_relocations (struct bfd_link_info *link_info) bfd_boolean is_relaxable = FALSE; /* Initialize the per-section relaxation info. */ - for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next) + for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next) for (sec = abfd->sections; sec != NULL; sec = sec->next) { init_xtensa_relax_info (sec); } /* Mark relaxable sections (and count relocations against each one). */ - for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next) + for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next) for (sec = abfd->sections; sec != NULL; sec = sec->next) { if (!find_relaxable_sections (abfd, sec, link_info, &is_relaxable)) @@ -6765,7 +6769,7 @@ analyze_relocations (struct bfd_link_info *link_info) return TRUE; /* Allocate space for source_relocs. */ - for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next) + for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next) for (sec = abfd->sections; sec != NULL; sec = sec->next) { xtensa_relax_info *relax_info; @@ -6782,7 +6786,7 @@ analyze_relocations (struct bfd_link_info *link_info) } /* Collect info on relocations against each relaxable section. */ - for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next) + for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next) for (sec = abfd->sections; sec != NULL; sec = sec->next) { if (!collect_source_relocs (abfd, sec, link_info)) @@ -6790,7 +6794,7 @@ analyze_relocations (struct bfd_link_info *link_info) } /* Compute the text actions. */ - for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link_next) + for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next) for (sec = abfd->sections; sec != NULL; sec = sec->next) { if (!compute_text_actions (abfd, sec, link_info)) @@ -7124,10 +7128,43 @@ is_resolvable_asm_expansion (bfd *abfd, || is_reloc_sym_weak (abfd, irel))) return FALSE; - self_address = (sec->output_section->vma - + sec->output_offset + irel->r_offset + 3); - dest_address = (target_sec->output_section->vma - + target_sec->output_offset + target_offset); + if (target_sec->output_section != sec->output_section) + { + /* If the two sections are sufficiently far away that relaxation + might take the call out of range, we can't simplify. For + example, a positive displacement call into another memory + could get moved to a lower address due to literal removal, + but the destination won't move, and so the displacment might + get larger. + + If the displacement is negative, assume the destination could + move as far back as the start of the output section. The + self_address will be at least as far into the output section + as it is prior to relaxation. + + If the displacement is postive, assume the destination will be in + it's pre-relaxed location (because relaxation only makes sections + smaller). The self_address could go all the way to the beginning + of the output section. */ + + dest_address = target_sec->output_section->vma; + self_address = sec->output_section->vma; + + if (sec->output_section->vma > target_sec->output_section->vma) + self_address += sec->output_offset + irel->r_offset + 3; + else + dest_address += bfd_get_section_limit (abfd, target_sec->output_section); + /* Call targets should be four-byte aligned. */ + dest_address = (dest_address + 3) & ~3; + } + else + { + + self_address = (sec->output_section->vma + + sec->output_offset + irel->r_offset + 3); + dest_address = (target_sec->output_section->vma + + target_sec->output_offset + target_offset); + } *is_reachable_p = pcrel_reloc_fits (direct_call_opcode, 0, self_address, dest_address); diff --git a/bfd/elf32.c b/bfd/elf32.c index 1e6ae4a26..e9c5e5791 100644 --- a/bfd/elf32.c +++ b/bfd/elf32.c @@ -1,5 +1,5 @@ /* ELF 32-bit executable support for BFD. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 403e43697..0ffe3fada 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1,5 +1,5 @@ /* Alpha specific support for 64-bit ELF - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Contributed by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -1442,17 +1442,19 @@ elf64_alpha_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name) } static bfd_boolean -elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols, - bfd_vma offset, const char **filename_ptr, +elf64_alpha_find_nearest_line (bfd *abfd, asymbol **symbols, + asection *section, bfd_vma offset, + const char **filename_ptr, const char **functionname_ptr, - unsigned int *line_ptr) + unsigned int *line_ptr, + unsigned int *discriminator_ptr) { asection *msec; - if (_bfd_dwarf2_find_nearest_line (abfd, dwarf_debug_sections, - section, symbols, offset, + if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset, filename_ptr, functionname_ptr, - line_ptr, NULL, 0, + line_ptr, discriminator_ptr, + dwarf_debug_sections, 0, &elf_tdata (abfd)->dwarf2_find_line_info)) return TRUE; @@ -1532,9 +1534,9 @@ elf64_alpha_find_nearest_line (bfd *abfd, asection *section, asymbol **symbols, /* Fall back on the generic ELF find_nearest_line routine. */ - return _bfd_elf_find_nearest_line (abfd, section, symbols, offset, + return _bfd_elf_find_nearest_line (abfd, symbols, section, offset, filename_ptr, functionname_ptr, - line_ptr); + line_ptr, discriminator_ptr); } /* Structure used to pass information to alpha_elf_output_extsym. */ @@ -2481,7 +2483,7 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info, consisting of all of the input files. */ if (got_list == NULL) { - for (i = info->input_bfds; i ; i = i->link_next) + for (i = info->input_bfds; i ; i = i->link.next) { bfd *this_got; diff --git a/bfd/elf64-gen.c b/bfd/elf64-gen.c index d8afcfa35..4a8a7c6ee 100644 --- a/bfd/elf64-gen.c +++ b/bfd/elf64-gen.c @@ -1,5 +1,5 @@ /* Generic support for 64-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index b57497d4b..2ee93ad60 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -1,5 +1,5 @@ /* Support for HPPA 64-bit ELF - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1580,7 +1580,7 @@ elf64_hppa_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) /* Set up DLT, PLT and OPD offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_dlt; bfd_signed_vma *end_local_dlt; diff --git a/bfd/elf64-hppa.h b/bfd/elf64-hppa.h index 198b44674..37537947d 100644 --- a/bfd/elf64-hppa.h +++ b/bfd/elf64-hppa.h @@ -1,6 +1,6 @@ /* ELF64/HPPA support - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c index 069340aed..b1b9f4645 100644 --- a/bfd/elf64-ia64-vms.c +++ b/bfd/elf64-ia64-vms.c @@ -1,5 +1,5 @@ /* IA-64 support for OpenVMS - Copyright (C) 1998-2014 Free Software Foundation, Inc. + Copyright (C) 1998-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -975,40 +975,6 @@ elf64_ia64_local_htab_eq (const void *ptr1, const void *ptr2) return entry1->id == entry2->id && entry1->r_sym == entry2->r_sym; } -/* 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 * -elf64_ia64_hash_table_create (bfd *abfd) -{ - struct elf64_ia64_link_hash_table *ret; - - ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret)); - if (!ret) - return NULL; - - if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, - elf64_ia64_new_elf_hash_entry, - sizeof (struct elf64_ia64_link_hash_entry), - IA64_ELF_DATA)) - { - free (ret); - return NULL; - } - - ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash, - elf64_ia64_local_htab_eq, NULL); - ret->loc_hash_memory = objalloc_create (); - if (!ret->loc_hash_table || !ret->loc_hash_memory) - { - free (ret); - return NULL; - } - - return &ret->root.root; -} - /* Free the global elf64_ia64_dyn_sym_info array. */ static bfd_boolean @@ -1057,10 +1023,10 @@ elf64_ia64_local_dyn_info_free (void **slot, /* Destroy IA-64 linker hash table. */ static void -elf64_ia64_hash_table_free (struct bfd_link_hash_table *hash) +elf64_ia64_link_hash_table_free (bfd *obfd) { struct elf64_ia64_link_hash_table *ia64_info - = (struct elf64_ia64_link_hash_table *) hash; + = (struct elf64_ia64_link_hash_table *) obfd->link.hash; if (ia64_info->loc_hash_table) { htab_traverse (ia64_info->loc_hash_table, @@ -1071,7 +1037,42 @@ elf64_ia64_hash_table_free (struct bfd_link_hash_table *hash) objalloc_free ((struct objalloc *) ia64_info->loc_hash_memory); elf_link_hash_traverse (&ia64_info->root, elf64_ia64_global_dyn_info_free, NULL); - _bfd_elf_link_hash_table_free (hash); + _bfd_elf_link_hash_table_free (obfd); +} + +/* 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 * +elf64_ia64_hash_table_create (bfd *abfd) +{ + struct elf64_ia64_link_hash_table *ret; + + ret = bfd_zmalloc ((bfd_size_type) sizeof (*ret)); + if (!ret) + return NULL; + + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + elf64_ia64_new_elf_hash_entry, + sizeof (struct elf64_ia64_link_hash_entry), + IA64_ELF_DATA)) + { + free (ret); + return NULL; + } + + ret->loc_hash_table = htab_try_create (1024, elf64_ia64_local_htab_hash, + elf64_ia64_local_htab_eq, NULL); + ret->loc_hash_memory = objalloc_create (); + if (!ret->loc_hash_table || !ret->loc_hash_memory) + { + elf64_ia64_link_hash_table_free (abfd); + return NULL; + } + ret->root.root.hash_table_free = elf64_ia64_link_hash_table_free; + + return &ret->root.root; } /* Traverse both local and global hash tables. */ @@ -2818,7 +2819,7 @@ elf64_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, return FALSE; /* Add entries for shared libraries. */ - for (abfd = info->input_bfds; abfd; abfd = abfd->link_next) + for (abfd = info->input_bfds; abfd; abfd = abfd->link.next) { char *soname; size_t soname_len; @@ -5458,8 +5459,6 @@ static const struct elf_size_info elf64_ia64_vms_size_info = { /* Stuff for the BFD linker: */ #define bfd_elf64_bfd_link_hash_table_create \ elf64_ia64_hash_table_create -#define bfd_elf64_bfd_link_hash_table_free \ - elf64_ia64_hash_table_free #define elf_backend_create_dynamic_sections \ elf64_ia64_create_dynamic_sections #define elf_backend_check_relocs \ diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 9d50a795b..017efac8b 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -1,5 +1,5 @@ /* MIPS-specific support for 64-bit ELF - Copyright (C) 1996-2014 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. @@ -805,6 +805,100 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0x0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (52), + EMPTY_HOWTO (53), + EMPTY_HOWTO (54), + EMPTY_HOWTO (55), + EMPTY_HOWTO (56), + EMPTY_HOWTO (57), + EMPTY_HOWTO (58), + EMPTY_HOWTO (59), + + HOWTO (R_MIPS_PC21_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 21, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC21_S2", /* name */ + TRUE, /* partial_inplace */ + 0x001fffff, /* src_mask */ + 0x001fffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC26_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC26_S2", /* name */ + TRUE, /* partial_inplace */ + 0x03ffffff, /* src_mask */ + 0x03ffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC18_S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC18_S3", /* name */ + TRUE, /* partial_inplace */ + 0x0003ffff, /* src_mask */ + 0x0003ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC19_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC19_S2", /* name */ + TRUE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCHI16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCHI16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCLO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCLO16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + }; /* The relocation table used for SHT_RELA sections. */ @@ -1492,6 +1586,100 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0x0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (52), + EMPTY_HOWTO (53), + EMPTY_HOWTO (54), + EMPTY_HOWTO (55), + EMPTY_HOWTO (56), + EMPTY_HOWTO (57), + EMPTY_HOWTO (58), + EMPTY_HOWTO (59), + + HOWTO (R_MIPS_PC21_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 21, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC21_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x001fffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC26_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC26_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x03ffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC18_S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC18_S3", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0003ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC19_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC19_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0007ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCHI16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCLO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCLO16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + }; static reloc_howto_type mips16_elf64_howto_table_rel[] = @@ -3202,7 +3390,13 @@ static const struct elf_reloc_map mips_reloc_map[] = { BFD_RELOC_MIPS_TLS_TPREL32, R_MIPS_TLS_TPREL32 }, { BFD_RELOC_MIPS_TLS_TPREL64, R_MIPS_TLS_TPREL64 }, { BFD_RELOC_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_HI16 }, - { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 } + { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 }, + { BFD_RELOC_MIPS_21_PCREL_S2, R_MIPS_PC21_S2 }, + { BFD_RELOC_MIPS_26_PCREL_S2, R_MIPS_PC26_S2 }, + { BFD_RELOC_MIPS_18_PCREL_S3, R_MIPS_PC18_S3 }, + { BFD_RELOC_MIPS_19_PCREL_S2, R_MIPS_PC19_S2 }, + { BFD_RELOC_HI16_S_PCREL, R_MIPS_PCHI16 }, + { BFD_RELOC_LO16_PCREL, R_MIPS_PCLO16 } }; static const struct elf_reloc_map mips16_reloc_map[] = @@ -4185,6 +4379,8 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_collect TRUE #define elf_backend_type_change_ok TRUE #define elf_backend_can_gc_sections TRUE +#define elf_backend_gc_mark_extra_sections \ + _bfd_mips_elf_gc_mark_extra_sections #define elf_info_to_howto mips_elf64_info_to_howto_rela #define elf_info_to_howto_rel mips_elf64_info_to_howto_rel #define elf_backend_object_p mips_elf64_object_p @@ -4248,6 +4444,7 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_sign_extend_vma TRUE #define elf_backend_write_section _bfd_mips_elf_write_section +#define elf_backend_sort_relocs_p _bfd_mips_elf_sort_relocs_p /* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit MIPS-specific function only applies to IRIX5, which had no 64-bit diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index ad6757f51..244f90a7e 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1,5 +1,5 @@ /* MMIX-specific support for 64-bit ELF. - Copyright (C) 2001-2014 Free Software Foundation, Inc. + Copyright (C) 2001-2015 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson This file is part of BFD, the Binary File Descriptor library. @@ -1259,7 +1259,11 @@ mmix_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF64_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_MMIX_max); + if (r_type >= (unsigned int) R_MMIX_max) + { + _bfd_error_handler (_("%A: invalid MMIX reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_mmix_howto_table[r_type]; } @@ -2322,7 +2326,7 @@ _bfd_mmix_before_linker_allocation (bfd *abfd ATTRIBUTE_UNUSED, bfd *ibfd; /* Set the initial size of sections. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) bfd_map_over_sections (ibfd, mmix_set_relaxable_size, info); /* The bpo_greg_owner bfd is supposed to have been set by diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index b8d74658b..1101e3d51 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -1,5 +1,5 @@ /* PowerPC64-specific support for 64-bit ELF. - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2015 Free Software Foundation, Inc. Written by Linus Nordberg, Swox AB , based on elf32-ppc.c by Ian Lance Taylor. Largely rewritten by Alan Modra. @@ -64,7 +64,7 @@ static bfd_vma opd_entry_value #define ELF_TARGET_ID PPC64_ELF_DATA #define ELF_MACHINE_CODE EM_PPC64 #define ELF_MAXPAGESIZE 0x10000 -#define ELF_COMMONPAGESIZE 0x1000 +#define ELF_COMMONPAGESIZE 0x10000 #define elf_info_to_howto ppc64_elf_info_to_howto #define elf_backend_want_got_sym 0 @@ -84,7 +84,6 @@ static bfd_vma opd_entry_value #define bfd_elf64_bfd_print_private_bfd_data ppc64_elf_print_private_bfd_data #define bfd_elf64_new_section_hook ppc64_elf_new_section_hook #define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create -#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free #define bfd_elf64_get_synthetic_symtab ppc64_elf_get_synthetic_symtab #define bfd_elf64_bfd_link_just_syms ppc64_elf_link_just_syms @@ -236,6 +235,19 @@ static bfd_vma opd_entry_value #ifndef NO_OPD_RELOCS #define NO_OPD_RELOCS 0 #endif + +static inline int +abiversion (bfd *abfd) +{ + return elf_elfheader (abfd)->e_flags & EF_PPC64_ABI; +} + +static inline void +set_abiversion (bfd *abfd, int ver) +{ + elf_elfheader (abfd)->e_flags &= ~EF_PPC64_ABI; + elf_elfheader (abfd)->e_flags |= ver & EF_PPC64_ABI; +} #define ONES(n) (((bfd_vma) 1 << ((n) - 1) << 1) - 1) @@ -2488,6 +2500,29 @@ ppc64_elf_branch_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + symbol->section->output_section->vma + symbol->section->output_offset); } + else + { + elf_symbol_type *elfsym = (elf_symbol_type *) symbol; + + if (symbol->section->owner != abfd + && abiversion (symbol->section->owner) >= 2) + { + unsigned int i; + + for (i = 0; i < symbol->section->owner->symcount; ++i) + { + asymbol *symdef = symbol->section->owner->outsymbols[i]; + + if (strcmp (symdef->name, symbol->name) == 0) + { + elfsym = (elf_symbol_type *) symdef; + break; + } + } + } + reloc_entry->addend + += PPC64_LOCAL_ENTRY_OFFSET (elfsym->internal_elf_sym.st_other); + } return bfd_reloc_continue; } @@ -2919,7 +2954,9 @@ struct _ppc64_elf_section_data union { - /* An array with one entry for each opd function descriptor. */ + /* An array with one entry for each opd function descriptor, + and some spares since opd entries may be either 16 or 24 bytes. */ +#define OPD_NDX(OFF) ((OFF) >> 4) struct _opd_sec_data { /* Points to the function code section for local opd entries. */ @@ -2976,19 +3013,6 @@ get_opd_info (asection * sec) return &ppc64_elf_section_data (sec)->u.opd; return NULL; } - -static inline int -abiversion (bfd *abfd) -{ - return elf_elfheader (abfd)->e_flags & EF_PPC64_ABI; -} - -static inline void -set_abiversion (bfd *abfd, int ver) -{ - elf_elfheader (abfd)->e_flags &= ~EF_PPC64_ABI; - elf_elfheader (abfd)->e_flags |= ver & EF_PPC64_ABI; -} /* Parameters for the qsort hook. */ static bfd_boolean synthetic_relocatable; @@ -3763,7 +3787,8 @@ enum ppc_stub_type { ppc_stub_plt_branch, ppc_stub_plt_branch_r2off, ppc_stub_plt_call, - ppc_stub_plt_call_r2save + ppc_stub_plt_call_r2save, + ppc_stub_global_entry }; struct ppc_stub_hash_entry { @@ -3937,7 +3962,7 @@ struct ppc_link_hash_table bfd_size_type got_reli_size; /* Statistics. */ - unsigned long stub_count[ppc_stub_plt_call_r2save]; + unsigned long stub_count[ppc_stub_global_entry]; /* Number of stubs against global syms. */ unsigned long stub_globals; @@ -4142,6 +4167,21 @@ tocsave_htab_eq (const void *p1, const void *p2) return e1->sec == e2->sec && e1->offset == e2->offset; } +/* Destroy a ppc64 ELF linker hash table. */ + +static void +ppc64_elf_link_hash_table_free (bfd *obfd) +{ + struct ppc_link_hash_table *htab; + + htab = (struct ppc_link_hash_table *) obfd->link.hash; + if (htab->tocsave_htab) + htab_delete (htab->tocsave_htab); + bfd_hash_table_free (&htab->branch_hash_table); + bfd_hash_table_free (&htab->stub_hash_table); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create a ppc64 ELF linker hash table. */ static struct bfd_link_hash_table * @@ -4166,7 +4206,7 @@ ppc64_elf_link_hash_table_create (bfd *abfd) if (!bfd_hash_table_init (&htab->stub_hash_table, stub_hash_newfunc, sizeof (struct ppc_stub_hash_entry))) { - _bfd_elf_link_hash_table_free ((struct bfd_link_hash_table *) htab); + _bfd_elf_link_hash_table_free (abfd); return NULL; } @@ -4175,7 +4215,7 @@ ppc64_elf_link_hash_table_create (bfd *abfd) sizeof (struct ppc_branch_hash_entry))) { bfd_hash_table_free (&htab->stub_hash_table); - _bfd_elf_link_hash_table_free ((struct bfd_link_hash_table *) htab); + _bfd_elf_link_hash_table_free (abfd); return NULL; } @@ -4185,11 +4225,10 @@ ppc64_elf_link_hash_table_create (bfd *abfd) NULL); if (htab->tocsave_htab == NULL) { - bfd_hash_table_free (&htab->branch_hash_table); - bfd_hash_table_free (&htab->stub_hash_table); - _bfd_elf_link_hash_table_free ((struct bfd_link_hash_table *) htab); + ppc64_elf_link_hash_table_free (abfd); return NULL; } + htab->elf.root.hash_table_free = ppc64_elf_link_hash_table_free; /* Initializing two fields of the union is just cosmetic. We really only care about glist, but when compiled on a 32-bit host the @@ -4207,20 +4246,6 @@ ppc64_elf_link_hash_table_create (bfd *abfd) return &htab->elf.root; } -/* Free the derived linker hash table. */ - -static void -ppc64_elf_link_hash_table_free (struct bfd_link_hash_table *hash) -{ - struct ppc_link_hash_table *htab = (struct ppc_link_hash_table *) hash; - - bfd_hash_table_free (&htab->stub_hash_table); - bfd_hash_table_free (&htab->branch_hash_table); - if (htab->tocsave_htab) - htab_delete (htab->tocsave_htab); - _bfd_elf_link_hash_table_free (hash); -} - /* Create sections for linker generated code. */ static bfd_boolean @@ -4782,22 +4807,35 @@ ppc64_elf_add_symbol_hook (bfd *ibfd, const char **name, flagword *flags ATTRIBUTE_UNUSED, asection **sec, - bfd_vma *value ATTRIBUTE_UNUSED) + bfd_vma *value) { - if ((ibfd->flags & DYNAMIC) == 0 - && ELF_ST_BIND (isym->st_info) == STB_GNU_UNIQUE) + if ((ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (isym->st_info) == STB_GNU_UNIQUE) + && (ibfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; - if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) + if (*sec != NULL + && strcmp ((*sec)->name, ".opd") == 0) { - if ((ibfd->flags & DYNAMIC) == 0) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + asection *code_sec; + + if (!(ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC + || ELF_ST_TYPE (isym->st_info) == STT_FUNC)) + isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC); + + /* If the symbol is a function defined in .opd, and the function + code is in a discarded group, let it appear to be undefined. */ + if (!info->relocatable + && (*sec)->reloc_count != 0 + && opd_entry_value (*sec, *value, &code_sec, NULL, + FALSE) != (bfd_vma) -1 + && discarded_section (code_sec)) + { + *sec = bfd_und_section_ptr; + isym->st_shndx = SHN_UNDEF; + } } - else if (ELF_ST_TYPE (isym->st_info) == STT_FUNC) - ; - else if (*sec != NULL - && strcmp ((*sec)->name, ".opd") == 0) - isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC); if ((STO_PPC64_LOCAL_MASK & isym->st_other) != 0) { @@ -4939,81 +4977,77 @@ ppc64_elf_before_check_relocs (bfd *ibfd, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; struct ppc_link_hash_entry **p, *eh; + asection *opd = bfd_get_section_by_name (ibfd, ".opd"); - if (!is_ppc64_elf (info->output_bfd)) - return TRUE; - htab = ppc_hash_table (info); - if (htab == NULL) - return FALSE; - - if (is_ppc64_elf (ibfd)) + if (opd != NULL && opd->size != 0) { - asection *opd = bfd_get_section_by_name (ibfd, ".opd"); - - if (opd != NULL && opd->size != 0) + if (abiversion (ibfd) == 0) + set_abiversion (ibfd, 1); + else if (abiversion (ibfd) == 2) { - if (abiversion (ibfd) == 0) - set_abiversion (ibfd, 1); - else if (abiversion (ibfd) == 2) - { - info->callbacks->einfo (_("%P: %B .opd not allowed in ABI" - " version %d\n"), - ibfd, abiversion (ibfd)); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - - if ((ibfd->flags & DYNAMIC) == 0 - && (opd->flags & SEC_RELOC) != 0 - && opd->reloc_count != 0 - && !bfd_is_abs_section (opd->output_section)) - { - /* Garbage collection needs some extra help with .opd sections. - We don't want to necessarily keep everything referenced by - relocs in .opd, as that would keep all functions. Instead, - if we reference an .opd symbol (a function descriptor), we - want to keep the function code symbol's section. This is - easy for global symbols, but for local syms we need to keep - information about the associated function section. */ - bfd_size_type amt; - asection **opd_sym_map; - - amt = opd->size * sizeof (*opd_sym_map) / 8; - opd_sym_map = bfd_zalloc (ibfd, amt); - if (opd_sym_map == NULL) - return FALSE; - ppc64_elf_section_data (opd)->u.opd.func_sec = opd_sym_map; - BFD_ASSERT (ppc64_elf_section_data (opd)->sec_type == sec_normal); - ppc64_elf_section_data (opd)->sec_type = sec_opd; - } + info->callbacks->einfo (_("%P: %B .opd not allowed in ABI" + " version %d\n"), + ibfd, abiversion (ibfd)); + bfd_set_error (bfd_error_bad_value); + return FALSE; } - /* For input files without an explicit abiversion in e_flags - we should have flagged any with symbol st_other bits set - as ELFv1 and above flagged those with .opd as ELFv2. - Set the output abiversion if not yet set, and for any input - still ambiguous, take its abiversion from the output. - Differences in ABI are reported later. */ - if (abiversion (info->output_bfd) == 0) - set_abiversion (info->output_bfd, abiversion (ibfd)); - else if (abiversion (ibfd) == 0) - set_abiversion (ibfd, abiversion (info->output_bfd)); - - p = &htab->dot_syms; - while ((eh = *p) != NULL) + if ((ibfd->flags & DYNAMIC) == 0 + && (opd->flags & SEC_RELOC) != 0 + && opd->reloc_count != 0 + && !bfd_is_abs_section (opd->output_section)) { - *p = NULL; - if (&eh->elf == htab->elf.hgot) - ; - else if (htab->elf.hgot == NULL - && strcmp (eh->elf.root.root.string, ".TOC.") == 0) - htab->elf.hgot = &eh->elf; - else if (!add_symbol_adjust (eh, info)) + /* Garbage collection needs some extra help with .opd sections. + We don't want to necessarily keep everything referenced by + relocs in .opd, as that would keep all functions. Instead, + if we reference an .opd symbol (a function descriptor), we + want to keep the function code symbol's section. This is + easy for global symbols, but for local syms we need to keep + information about the associated function section. */ + bfd_size_type amt; + asection **opd_sym_map; + + amt = OPD_NDX (opd->size) * sizeof (*opd_sym_map); + opd_sym_map = bfd_zalloc (ibfd, amt); + if (opd_sym_map == NULL) return FALSE; - p = &eh->u.next_dot_sym; + ppc64_elf_section_data (opd)->u.opd.func_sec = opd_sym_map; + BFD_ASSERT (ppc64_elf_section_data (opd)->sec_type == sec_normal); + ppc64_elf_section_data (opd)->sec_type = sec_opd; } } + if (!is_ppc64_elf (info->output_bfd)) + return TRUE; + htab = ppc_hash_table (info); + if (htab == NULL) + return FALSE; + + /* For input files without an explicit abiversion in e_flags + we should have flagged any with symbol st_other bits set + as ELFv1 and above flagged those with .opd as ELFv2. + Set the output abiversion if not yet set, and for any input + still ambiguous, take its abiversion from the output. + Differences in ABI are reported later. */ + if (abiversion (info->output_bfd) == 0) + set_abiversion (info->output_bfd, abiversion (ibfd)); + else if (abiversion (ibfd) == 0) + set_abiversion (ibfd, abiversion (info->output_bfd)); + + p = &htab->dot_syms; + while ((eh = *p) != NULL) + { + *p = NULL; + if (&eh->elf == htab->elf.hgot) + ; + else if (htab->elf.hgot == NULL + && strcmp (eh->elf.root.root.string, ".TOC.") == 0) + htab->elf.hgot = &eh->elf; + else if (!add_symbol_adjust (eh, info)) + return FALSE; + p = &eh->u.next_dot_sym; + } + /* Clear the list for non-ppc64 input files. */ p = &htab->dot_syms; while ((eh = *p) != NULL) @@ -5305,7 +5339,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_PPC64_GOT_TPREL16_LO_DS: case R_PPC64_GOT_TPREL16_HI: case R_PPC64_GOT_TPREL16_HA: - if (!info->executable) + if (info->shared) info->flags |= DF_STATIC_TLS; tls_type = TLS_TLS | TLS_TPREL; goto dogottls; @@ -5535,7 +5569,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_PPC64_TPREL64: tls_type = TLS_EXPLICIT | TLS_TLS | TLS_TPREL; - if (!info->executable) + if (info->shared) info->flags |= DF_STATIC_TLS; goto dotlstoc; @@ -5613,8 +5647,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_PPC64_TPREL16_HIGHESTA: if (info->shared) { - if (!info->executable) - info->flags |= DF_STATIC_TLS; + info->flags |= DF_STATIC_TLS; goto dodyn; } break; @@ -5645,7 +5678,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, s = bfd_section_from_elf_index (abfd, isym->st_shndx); if (s != NULL && s != sec) - opd_sym_map[rel->r_offset / 8] = s; + opd_sym_map[OPD_NDX (rel->r_offset)] = s; } } /* Fall through. */ @@ -5882,7 +5915,8 @@ ppc64_elf_print_private_bfd_data (bfd *abfd, void *ptr) } /* OFFSET in OPD_SEC specifies a function descriptor. Return the address - of the code entry point, and its section. */ + of the code entry point, and its section, which must be in the same + object as OPD_SEC. Returns (bfd_vma) -1 on error. */ static bfd_vma opd_entry_value (asection *opd_sec, @@ -5965,32 +5999,10 @@ opd_entry_value (asection *opd_sec, && ELF64_R_TYPE ((look + 1)->r_info) == R_PPC64_TOC) { unsigned long symndx = ELF64_R_SYM (look->r_info); - asection *sec; - - if (symndx < symtab_hdr->sh_info - || elf_sym_hashes (opd_bfd) == NULL) - { - Elf_Internal_Sym *sym; - - sym = (Elf_Internal_Sym *) symtab_hdr->contents; - if (sym == NULL) - { - size_t symcnt = symtab_hdr->sh_info; - if (elf_sym_hashes (opd_bfd) == NULL) - symcnt = symtab_hdr->sh_size / symtab_hdr->sh_entsize; - sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, symcnt, - 0, NULL, NULL, NULL); - if (sym == NULL) - break; - symtab_hdr->contents = (bfd_byte *) sym; - } + asection *sec = NULL; - sym += symndx; - val = sym->st_value; - sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx); - BFD_ASSERT ((sec->flags & SEC_MERGE) == 0); - } - else + if (symndx >= symtab_hdr->sh_info + && elf_sym_hashes (opd_bfd) != NULL) { struct elf_link_hash_entry **sym_hashes; struct elf_link_hash_entry *rh; @@ -6004,24 +6016,48 @@ opd_entry_value (asection *opd_sec, || rh->root.type == bfd_link_hash_defweak); val = rh->root.u.def.value; sec = rh->root.u.def.section; + if (sec->owner != opd_bfd) + { + sec = NULL; + val = (bfd_vma) -1; + } + } + } + + if (sec == NULL) + { + Elf_Internal_Sym *sym; + + if (symndx < symtab_hdr->sh_info) + { + sym = (Elf_Internal_Sym *) symtab_hdr->contents; + if (sym == NULL) + { + size_t symcnt = symtab_hdr->sh_info; + sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, + symcnt, 0, + NULL, NULL, NULL); + if (sym == NULL) + break; + symtab_hdr->contents = (bfd_byte *) sym; + } + sym += symndx; } else { - /* Handle the odd case where we can be called - during bfd_elf_link_add_symbols before the - symbol hashes have been fully populated. */ - Elf_Internal_Sym *sym; - - sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, 1, - symndx, NULL, NULL, NULL); + sym = bfd_elf_get_elf_syms (opd_bfd, symtab_hdr, + 1, symndx, + NULL, NULL, NULL); if (sym == NULL) break; - - val = sym->st_value; - sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx); - free (sym); } + sec = bfd_section_from_elf_index (opd_bfd, sym->st_shndx); + if (sec == NULL) + break; + BFD_ASSERT ((sec->flags & SEC_MERGE) == 0); + val = sym->st_value; } + val += look->r_addend; if (code_off != NULL) *code_off = val; @@ -6032,7 +6068,7 @@ opd_entry_value (asection *opd_sec, else *code_sec = sec; } - if (sec != NULL && sec->output_section != NULL) + if (sec->output_section != NULL) val += sec->output_section->vma + sec->output_offset; } break; @@ -6309,7 +6345,7 @@ ppc64_elf_gc_mark_hook (asection *sec, { rsec->gc_mark = 1; - rsec = opd->func_sec[(sym->st_value + rel->r_addend) / 8]; + rsec = opd->func_sec[OPD_NDX (sym->st_value + rel->r_addend)]; } } @@ -6971,9 +7007,22 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, { h->plt.plist = NULL; h->needs_plt = 0; + h->pointer_equality_needed = 0; } else if (abiversion (info->output_bfd) == 2) { + /* Taking a function's address in a read/write section + doesn't require us to define the function symbol in the + executable on a global entry stub. A dynamic reloc can + be used instead. */ + if (h->pointer_equality_needed + && h->type != STT_GNU_IFUNC + && !readonly_dynrelocs (h)) + { + h->pointer_equality_needed = 0; + h->non_got_ref = 0; + } + /* After adjust_dynamic_symbol, non_got_ref set in the non-shared case means that we have allocated space in .dynbss for the symbol and thus dyn_relocs for this @@ -6983,10 +7032,10 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, relocations against this symbol to the PLT entry. Allow dynamic relocs if the reference is weak, and the dynamic relocs will not cause text relocation. */ - if (!h->ref_regular_nonweak - && h->non_got_ref - && h->type != STT_GNU_IFUNC - && !readonly_dynrelocs (h)) + else if (!h->ref_regular_nonweak + && h->non_got_ref + && h->type != STT_GNU_IFUNC + && !readonly_dynrelocs (h)) h->non_got_ref = 0; /* If making a plt entry, then we don't need copy relocs. */ @@ -7072,7 +7121,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, s = htab->dynbss; - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* If given a function descriptor symbol, hide both the function code @@ -7357,7 +7406,7 @@ adjust_opd_syms (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) opd = get_opd_info (sym_sec); if (opd != NULL && opd->adjust != NULL) { - long adjust = opd->adjust[eh->elf.root.u.def.value / 8]; + long adjust = opd->adjust[OPD_NDX (eh->elf.root.u.def.value)]; if (adjust == -1) { /* This entry has been deleted. */ @@ -7558,15 +7607,14 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) if (htab == NULL) return FALSE; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { asection *sec; Elf_Internal_Rela *relstart, *rel, *relend; Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Sym *local_syms; - bfd_vma offset; struct _opd_sec_data *opd; - bfd_boolean need_edit, add_aux_fields; + bfd_boolean need_edit, add_aux_fields, broken; bfd_size_type cnt_16b = 0; if (!is_ppc64_elf (ibfd)) @@ -7598,8 +7646,8 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) /* First run through the relocs to check they are sane, and to determine whether we need to edit this opd section. */ need_edit = FALSE; + broken = FALSE; need_pad = sec; - offset = 0; relend = relstart + sec->reloc_count; for (rel = relstart; rel < relend; ) { @@ -7608,13 +7656,14 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) asection *sym_sec; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; + bfd_vma offset; - /* .opd contains a regular array of 16 or 24 byte entries. We're + /* .opd contains an array of 16 or 24 byte entries. We're only interested in the reloc pointing to a function entry point. */ - if (rel->r_offset != offset - || rel + 1 >= relend - || (rel + 1)->r_offset != offset + 8) + offset = rel->r_offset; + if (rel + 1 == relend + || rel[1].r_offset != offset + 8) { /* If someone messes with .opd alignment then after a "ld -r" we might have padding in the middle of .opd. @@ -7624,7 +7673,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) broken_opd: (*_bfd_error_handler) (_("%B: .opd is not a regular array of opd entries"), ibfd); - need_edit = FALSE; + broken = TRUE; break; } @@ -7634,7 +7683,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) (*_bfd_error_handler) (_("%B: unexpected reloc type %u in .opd section"), ibfd, r_type); - need_edit = FALSE; + broken = TRUE; break; } @@ -7655,7 +7704,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) (*_bfd_error_handler) (_("%B: undefined sym `%s' in .opd section"), ibfd, sym_name); - need_edit = FALSE; + broken = TRUE; break; } @@ -7671,39 +7720,33 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) need_edit = TRUE; rel += 2; - if (rel == relend - || (rel + 1 == relend && rel->r_offset == offset + 16)) + if (rel + 1 == relend + || (rel + 2 < relend + && ELF64_R_TYPE (rel[2].r_info) == R_PPC64_TOC)) + ++rel; + + if (rel == relend) { if (sec->size == offset + 24) { need_pad = NULL; break; } - if (rel == relend && sec->size == offset + 16) + if (sec->size == offset + 16) { cnt_16b++; break; } goto broken_opd; } - - if (rel->r_offset == offset + 24) - offset += 24; - else if (rel->r_offset != offset + 16) - goto broken_opd; else if (rel + 1 < relend && ELF64_R_TYPE (rel[0].r_info) == R_PPC64_ADDR64 && ELF64_R_TYPE (rel[1].r_info) == R_PPC64_TOC) { - offset += 16; - cnt_16b++; - } - else if (rel + 2 < relend - && ELF64_R_TYPE (rel[1].r_info) == R_PPC64_ADDR64 - && ELF64_R_TYPE (rel[2].r_info) == R_PPC64_TOC) - { - offset += 24; - rel += 1; + if (rel[0].r_offset == offset + 16) + cnt_16b++; + else if (rel[0].r_offset != offset + 24) + goto broken_opd; } else goto broken_opd; @@ -7711,18 +7754,16 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) add_aux_fields = htab->params->non_overlapping_opd && cnt_16b > 0; - if (need_edit || add_aux_fields) + if (!broken && (need_edit || add_aux_fields)) { Elf_Internal_Rela *write_rel; Elf_Internal_Shdr *rel_hdr; bfd_byte *rptr, *wptr; bfd_byte *new_contents; - bfd_boolean skip; - long opd_ent_size; bfd_size_type amt; new_contents = NULL; - amt = sec->size * sizeof (long) / 8; + amt = OPD_NDX (sec->size) * sizeof (long); opd = &ppc64_elf_section_data (sec)->u.opd; opd->adjust = bfd_zalloc (sec->owner, amt); if (opd->adjust == NULL) @@ -7760,123 +7801,134 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) new_contents = bfd_malloc (sec->size + cnt_16b * 8); if (new_contents == NULL) return FALSE; - need_pad = FALSE; + need_pad = NULL; } wptr = new_contents; rptr = sec->contents; - write_rel = relstart; - skip = FALSE; - offset = 0; - opd_ent_size = 0; - for (rel = relstart; rel < relend; rel++) + for (rel = relstart; rel < relend; ) { unsigned long r_symndx; asection *sym_sec; struct elf_link_hash_entry *h; + struct ppc_link_hash_entry *fdh = NULL; Elf_Internal_Sym *sym; + long opd_ent_size; + Elf_Internal_Rela *next_rel; + bfd_boolean skip; r_symndx = ELF64_R_SYM (rel->r_info); if (!get_sym_h (&h, &sym, &sym_sec, NULL, &local_syms, r_symndx, ibfd)) goto error_ret; - if (rel->r_offset == offset) + next_rel = rel + 2; + if (next_rel + 1 == relend + || (next_rel + 2 < relend + && ELF64_R_TYPE (next_rel[2].r_info) == R_PPC64_TOC)) + ++next_rel; + + /* See if the .opd entry is full 24 byte or + 16 byte (with fd_aux entry overlapped with next + fd_func). */ + opd_ent_size = 24; + if (next_rel == relend) { - struct ppc_link_hash_entry *fdh = NULL; - - /* See if the .opd entry is full 24 byte or - 16 byte (with fd_aux entry overlapped with next - fd_func). */ - opd_ent_size = 24; - if ((rel + 2 == relend && sec->size == offset + 16) - || (rel + 3 < relend - && rel[2].r_offset == offset + 16 - && rel[3].r_offset == offset + 24 - && ELF64_R_TYPE (rel[2].r_info) == R_PPC64_ADDR64 - && ELF64_R_TYPE (rel[3].r_info) == R_PPC64_TOC)) + if (sec->size == rel->r_offset + 16) opd_ent_size = 16; + } + else if (next_rel->r_offset == rel->r_offset + 16) + opd_ent_size = 16; - if (h != NULL - && h->root.root.string[0] == '.') - { - fdh = lookup_fdh ((struct ppc_link_hash_entry *) h, htab); - if (fdh != NULL - && fdh->elf.root.type != bfd_link_hash_defined - && fdh->elf.root.type != bfd_link_hash_defweak) - fdh = NULL; - } + if (h != NULL + && h->root.root.string[0] == '.') + { + fdh = lookup_fdh ((struct ppc_link_hash_entry *) h, htab); + if (fdh != NULL + && fdh->elf.root.type != bfd_link_hash_defined + && fdh->elf.root.type != bfd_link_hash_defweak) + fdh = NULL; + } - skip = (sym_sec->owner != ibfd - || sym_sec->output_section == bfd_abs_section_ptr); - if (skip) + skip = (sym_sec->owner != ibfd + || sym_sec->output_section == bfd_abs_section_ptr); + if (skip) + { + if (fdh != NULL && sym_sec->owner == ibfd) { - if (fdh != NULL && sym_sec->owner == ibfd) - { - /* Arrange for the function descriptor sym - to be dropped. */ - fdh->elf.root.u.def.value = 0; - fdh->elf.root.u.def.section = sym_sec; - } - opd->adjust[rel->r_offset / 8] = -1; + /* Arrange for the function descriptor sym + to be dropped. */ + fdh->elf.root.u.def.value = 0; + fdh->elf.root.u.def.section = sym_sec; } - else - { - /* We'll be keeping this opd entry. */ + opd->adjust[OPD_NDX (rel->r_offset)] = -1; - if (fdh != NULL) - { - /* Redefine the function descriptor symbol to - this location in the opd section. It is - necessary to update the value here rather - than using an array of adjustments as we do - for local symbols, because various places - in the generic ELF code use the value - stored in u.def.value. */ - fdh->elf.root.u.def.value = wptr - new_contents; - fdh->adjust_done = 1; - } + if (NO_OPD_RELOCS || info->relocatable) + rel = next_rel; + else + while (1) + { + if (!dec_dynrel_count (rel->r_info, sec, info, + NULL, h, sym)) + goto error_ret; - /* Local syms are a bit tricky. We could - tweak them as they can be cached, but - we'd need to look through the local syms - for the function descriptor sym which we - don't have at the moment. So keep an - array of adjustments. */ - opd->adjust[rel->r_offset / 8] - = (wptr - new_contents) - (rptr - sec->contents); - - if (wptr != rptr) - memcpy (wptr, rptr, opd_ent_size); - wptr += opd_ent_size; - if (add_aux_fields && opd_ent_size == 16) - { - memset (wptr, '\0', 8); - wptr += 8; - } - } - rptr += opd_ent_size; - offset += opd_ent_size; - } + if (++rel == next_rel) + break; - if (skip) - { - if (!NO_OPD_RELOCS - && !info->relocatable - && !dec_dynrel_count (rel->r_info, sec, info, - NULL, h, sym)) - goto error_ret; + r_symndx = ELF64_R_SYM (rel->r_info); + if (!get_sym_h (&h, &sym, &sym_sec, NULL, &local_syms, + r_symndx, ibfd)) + goto error_ret; + } } else { + /* We'll be keeping this opd entry. */ + long adjust; + + if (fdh != NULL) + { + /* Redefine the function descriptor symbol to + this location in the opd section. It is + necessary to update the value here rather + than using an array of adjustments as we do + for local symbols, because various places + in the generic ELF code use the value + stored in u.def.value. */ + fdh->elf.root.u.def.value = wptr - new_contents; + fdh->adjust_done = 1; + } + + /* Local syms are a bit tricky. We could + tweak them as they can be cached, but + we'd need to look through the local syms + for the function descriptor sym which we + don't have at the moment. So keep an + array of adjustments. */ + adjust = (wptr - new_contents) - (rptr - sec->contents); + opd->adjust[OPD_NDX (rel->r_offset)] = adjust; + + if (wptr != rptr) + memcpy (wptr, rptr, opd_ent_size); + wptr += opd_ent_size; + if (add_aux_fields && opd_ent_size == 16) + { + memset (wptr, '\0', 8); + wptr += 8; + } + /* We need to adjust any reloc offsets to point to the - new opd entries. While we're at it, we may as well - remove redundant relocs. */ - rel->r_offset += opd->adjust[(offset - opd_ent_size) / 8]; - if (write_rel != rel) - memcpy (write_rel, rel, sizeof (*rel)); - ++write_rel; + new opd entries. */ + for ( ; rel != next_rel; ++rel) + { + rel->r_offset += adjust; + if (write_rel != rel) + memcpy (write_rel, rel, sizeof (*rel)); + ++write_rel; + } } + + rptr += opd_ent_size; } sec->size = wptr - new_contents; @@ -8105,7 +8157,7 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info) and plt refcounts. */ toc_ref = NULL; for (pass = 0; pass < 2; ++pass) - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { Elf_Internal_Sym *locsyms = NULL; asection *toc = bfd_get_section_by_name (ibfd, ".toc"); @@ -8296,7 +8348,10 @@ ppc64_elf_tls_optimize (struct bfd_link_info *info) else value = sym->st_value; value += rel->r_addend; - BFD_ASSERT (value < toc->size && value % 8 == 0); + if (value % 8 != 0) + continue; + BFD_ASSERT (value < toc->size + && toc->output_offset % 8 == 0); toc_ref_index = (value + toc->output_offset) / 8; if (r_type == R_PPC64_TLS || r_type == R_PPC64_TLSGD @@ -8602,7 +8657,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info) htab->do_toc_opt = 1; toc_inf.global_toc_syms = TRUE; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { asection *toc, *sec; Elf_Internal_Shdr *symtab_hdr; @@ -9662,7 +9717,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { struct got_entry **lgot_ents; struct got_entry **end_lgot_ents; @@ -9784,7 +9839,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, elf_link_hash_traverse (&htab->elf, size_global_entry_stubs, info); first_tlsld = NULL; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { struct got_entry *ent; @@ -9892,7 +9947,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, return FALSE; } - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { if (!is_ppc64_elf (ibfd)) continue; @@ -10159,7 +10214,7 @@ plt_stub_pad (struct ppc_link_hash_table *htab, bfd_vma stub_off = stub_entry->stub_sec->size; if (((stub_off + stub_size - 1) & -stub_align) - (stub_off & -stub_align) - > (stub_size & -stub_align)) + > ((stub_size - 1) & -stub_align)) return stub_align - (stub_off & (stub_align - 1)); return 0; } @@ -11071,7 +11126,7 @@ ppc64_elf_setup_section_lists (struct bfd_link_info *info) /* Find the top input section id. */ for (input_bfd = info->input_bfds, top_id = 3; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { for (section = input_bfd->sections; section != NULL; @@ -11252,7 +11307,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) elf_link_hash_traverse (&htab->elf, merge_global_got, info); /* And tlsld_got. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { struct got_entry *ent, *ent2; @@ -11263,7 +11318,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) if (!ent->is_indirect && ent->got.offset != (bfd_vma) -1) { - for (ibfd2 = ibfd->link_next; ibfd2 != NULL; ibfd2 = ibfd2->link_next) + for (ibfd2 = ibfd->link.next; ibfd2 != NULL; ibfd2 = ibfd2->link.next) { if (!is_ppc64_elf (ibfd2)) continue; @@ -11285,7 +11340,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) htab->elf.irelplt->size -= htab->got_reli_size; htab->got_reli_size = 0; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { asection *got, *relgot; @@ -11305,7 +11360,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) /* Now reallocate the got, local syms first. We don't need to allocate section contents again since we never increase size. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { struct got_entry **lgot_ents; struct got_entry **end_lgot_ents; @@ -11362,7 +11417,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) elf_link_hash_traverse (&htab->elf, reallocate_got, info); - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { struct got_entry *ent; @@ -11386,7 +11441,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) done_something = htab->elf.irelplt->rawsize != htab->elf.irelplt->size; if (!done_something) - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { asection *got; @@ -11539,7 +11594,7 @@ toc_adjusting_stub_needed (struct bfd_link_info *info, asection *isec) { long adjust; - adjust = opd->adjust[sym->st_value / 8]; + adjust = opd->adjust[OPD_NDX (sym->st_value)]; if (adjust == -1) /* Assume deleted functions won't ever be called. */ continue; @@ -11755,7 +11810,7 @@ group_sections (struct ppc_link_hash_table *htab, bfd_boolean suppress_size_errors; suppress_size_errors = FALSE; - stub14_group_size = stub_group_size; + stub14_group_size = stub_group_size >> 10; if (stub_group_size == 1) { /* Default values. */ @@ -11859,7 +11914,8 @@ static const unsigned char glink_eh_frame_cie[] = 65, /* RA reg. */ 1, /* Augmentation size. */ DW_EH_PE_pcrel | DW_EH_PE_sdata4, /* FDE encoding. */ - DW_CFA_def_cfa, 1, 0 /* def_cfa: r1 offset 0. */ + DW_CFA_def_cfa, 1, 0, /* def_cfa: r1 offset 0. */ + 0, 0, 0, 0 }; /* Stripping output sections is normally done before dynamic section @@ -11916,12 +11972,20 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) /* libanl */ "getaddrinfo_a", /* libgomp */ + "GOMP_parallel", "GOMP_parallel_start", + "GOMP_parallel_loop_static", "GOMP_parallel_loop_static_start", + "GOMP_parallel_loop_dynamic", "GOMP_parallel_loop_dynamic_start", + "GOMP_parallel_loop_guided", "GOMP_parallel_loop_guided_start", + "GOMP_parallel_loop_runtime", "GOMP_parallel_loop_runtime_start", + "GOMP_parallel_sections", "GOMP_parallel_sections_start", + /* libgo */ + "__go_go", }; unsigned i; @@ -11953,7 +12017,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; asection *section; @@ -12106,7 +12170,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) if (hash == NULL && opd->adjust != NULL) { - long adjust = opd->adjust[sym_value / 8]; + long adjust = opd->adjust[OPD_NDX (sym_value)]; if (adjust == -1) continue; code_value += adjust; @@ -12291,7 +12355,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) stub_sec != NULL; stub_sec = stub_sec->next) if ((stub_sec->flags & SEC_LINKER_CREATED) == 0) - size += 20; + size += 24; if (htab->glink != NULL && htab->glink->size != 0) size += 24; if (size != 0) @@ -12331,6 +12395,89 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) (*htab->params->layout_sections_again) (); } + if (htab->glink_eh_frame != NULL + && htab->glink_eh_frame->size != 0) + { + bfd_vma val; + bfd_byte *p, *last_fde; + size_t last_fde_len, size, align, pad; + asection *stub_sec; + + p = bfd_zalloc (htab->glink_eh_frame->owner, htab->glink_eh_frame->size); + if (p == NULL) + return FALSE; + htab->glink_eh_frame->contents = p; + last_fde = p; + + memcpy (p, glink_eh_frame_cie, sizeof (glink_eh_frame_cie)); + /* CIE length (rewrite in case little-endian). */ + last_fde_len = sizeof (glink_eh_frame_cie) - 4; + bfd_put_32 (htab->elf.dynobj, last_fde_len, p); + p += sizeof (glink_eh_frame_cie); + + for (stub_sec = htab->params->stub_bfd->sections; + stub_sec != NULL; + stub_sec = stub_sec->next) + if ((stub_sec->flags & SEC_LINKER_CREATED) == 0) + { + last_fde = p; + last_fde_len = 20; + /* FDE length. */ + bfd_put_32 (htab->elf.dynobj, 20, p); + p += 4; + /* CIE pointer. */ + val = p - htab->glink_eh_frame->contents; + bfd_put_32 (htab->elf.dynobj, val, p); + p += 4; + /* Offset to stub section, written later. */ + p += 4; + /* stub section size. */ + bfd_put_32 (htab->elf.dynobj, stub_sec->size, p); + p += 4; + /* Augmentation. */ + p += 1; + /* Pad. */ + p += 7; + } + if (htab->glink != NULL && htab->glink->size != 0) + { + last_fde = p; + last_fde_len = 20; + /* FDE length. */ + bfd_put_32 (htab->elf.dynobj, 20, p); + p += 4; + /* CIE pointer. */ + val = p - htab->glink_eh_frame->contents; + bfd_put_32 (htab->elf.dynobj, val, p); + p += 4; + /* Offset to .glink, written later. */ + p += 4; + /* .glink size. */ + bfd_put_32 (htab->elf.dynobj, htab->glink->size - 8, p); + p += 4; + /* Augmentation. */ + p += 1; + + *p++ = DW_CFA_advance_loc + 1; + *p++ = DW_CFA_register; + *p++ = 65; + *p++ = 12; + *p++ = DW_CFA_advance_loc + 4; + *p++ = DW_CFA_restore_extended; + *p++ = 65; + } + /* Subsume any padding into the last FDE if user .eh_frame + sections are aligned more than glink_eh_frame. Otherwise any + zero padding will be seen as a terminator. */ + size = p - htab->glink_eh_frame->contents; + align = 1; + align <<= htab->glink_eh_frame->output_section->alignment_power; + align -= 1; + pad = ((size + align) & ~align) - size; + htab->glink_eh_frame->size = size + pad; + bfd_put_32 (htab->elf.dynobj, last_fde_len + pad, last_fde); + } + maybe_strip_output (info, htab->brlt); if (htab->glink_eh_frame != NULL) maybe_strip_output (info, htab->glink_eh_frame); @@ -12395,15 +12542,24 @@ ppc64_elf_set_toc (struct bfd_link_info *info, bfd *obfd) _bfd_set_gp_value (obfd, TOCstart); - if (info != NULL && s != NULL && is_ppc64_elf (obfd)) + if (info != NULL && s != NULL) { struct ppc_link_hash_table *htab = ppc_hash_table (info); - if (htab != NULL - && htab->elf.hgot != NULL) + if (htab != NULL) + { + if (htab->elf.hgot != NULL) + { + htab->elf.hgot->root.u.def.value = TOC_BASE_OFF; + htab->elf.hgot->root.u.def.section = s; + } + } + else { - htab->elf.hgot->root.u.def.value = TOC_BASE_OFF; - htab->elf.hgot->root.u.def.section = s; + struct bfd_link_hash_entry *bh = NULL; + _bfd_generic_link_add_one_symbol (info, obfd, ".TOC.", BSF_GLOBAL, + s, TOC_BASE_OFF, NULL, FALSE, + FALSE, &bh); } } return TOCstart; @@ -12460,6 +12616,32 @@ build_global_entry_stubs (struct elf_link_hash_entry *h, void *inf) htab->stub_error = TRUE; } + htab->stub_count[ppc_stub_global_entry - 1] += 1; + if (htab->params->emit_stub_syms) + { + size_t len = strlen (h->root.root.string); + char *name = bfd_malloc (sizeof "12345678.global_entry." + len); + + if (name == NULL) + return FALSE; + + sprintf (name, "%08x.global_entry.%s", s->id, h->root.root.string); + h = elf_link_hash_lookup (&htab->elf, name, TRUE, FALSE, FALSE); + if (h == NULL) + return FALSE; + if (h->root.type == bfd_link_hash_new) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = s; + h->root.u.def.value = p - s->contents; + h->ref_regular = 1; + h->def_regular = 1; + h->ref_regular_nonweak = 1; + h->forced_local = 1; + h->non_elf = 0; + } + } + if (PPC_HA (off) != 0) { bfd_put_32 (s->owner, ADDIS_R12_R12 | PPC_HA (off), p); @@ -12638,7 +12820,7 @@ ppc64_elf_build_stubs (struct bfd_link_info *info, elf_link_hash_traverse (&htab->elf, build_global_entry_stubs, info); } - if (htab->brlt->size != 0) + if (htab->brlt != NULL && htab->brlt->size != 0) { htab->brlt->contents = bfd_zalloc (htab->brlt->owner, htab->brlt->size); @@ -12653,117 +12835,6 @@ ppc64_elf_build_stubs (struct bfd_link_info *info, return FALSE; } - if (htab->glink_eh_frame != NULL - && htab->glink_eh_frame->size != 0) - { - bfd_vma val; - bfd_byte *last_fde; - size_t last_fde_len, size, align, pad; - - p = bfd_zalloc (htab->glink_eh_frame->owner, htab->glink_eh_frame->size); - if (p == NULL) - return FALSE; - htab->glink_eh_frame->contents = p; - last_fde = p; - - htab->glink_eh_frame->rawsize = htab->glink_eh_frame->size; - - memcpy (p, glink_eh_frame_cie, sizeof (glink_eh_frame_cie)); - /* CIE length (rewrite in case little-endian). */ - last_fde_len = sizeof (glink_eh_frame_cie) - 4; - bfd_put_32 (htab->elf.dynobj, last_fde_len, p); - p += sizeof (glink_eh_frame_cie); - - for (stub_sec = htab->params->stub_bfd->sections; - stub_sec != NULL; - stub_sec = stub_sec->next) - if ((stub_sec->flags & SEC_LINKER_CREATED) == 0) - { - last_fde = p; - last_fde_len = 16; - /* FDE length. */ - bfd_put_32 (htab->elf.dynobj, 16, p); - p += 4; - /* CIE pointer. */ - val = p - htab->glink_eh_frame->contents; - bfd_put_32 (htab->elf.dynobj, val, p); - p += 4; - /* Offset to stub section. */ - val = (stub_sec->output_section->vma - + stub_sec->output_offset); - val -= (htab->glink_eh_frame->output_section->vma - + htab->glink_eh_frame->output_offset); - val -= p - htab->glink_eh_frame->contents; - if (val + 0x80000000 > 0xffffffff) - { - info->callbacks->einfo - (_("%P: %s offset too large for .eh_frame sdata4 encoding"), - stub_sec->name); - return FALSE; - } - bfd_put_32 (htab->elf.dynobj, val, p); - p += 4; - /* stub section size. */ - bfd_put_32 (htab->elf.dynobj, stub_sec->rawsize, p); - p += 4; - /* Augmentation. */ - p += 1; - /* Pad. */ - p += 3; - } - if (htab->glink != NULL && htab->glink->size != 0) - { - last_fde = p; - last_fde_len = 20; - /* FDE length. */ - bfd_put_32 (htab->elf.dynobj, 20, p); - p += 4; - /* CIE pointer. */ - val = p - htab->glink_eh_frame->contents; - bfd_put_32 (htab->elf.dynobj, val, p); - p += 4; - /* Offset to .glink. */ - val = (htab->glink->output_section->vma - + htab->glink->output_offset - + 8); - val -= (htab->glink_eh_frame->output_section->vma - + htab->glink_eh_frame->output_offset); - val -= p - htab->glink_eh_frame->contents; - if (val + 0x80000000 > 0xffffffff) - { - info->callbacks->einfo - (_("%P: %s offset too large for .eh_frame sdata4 encoding"), - htab->glink->name); - return FALSE; - } - bfd_put_32 (htab->elf.dynobj, val, p); - p += 4; - /* .glink size. */ - bfd_put_32 (htab->elf.dynobj, htab->glink->size - 8, p); - p += 4; - /* Augmentation. */ - p += 1; - - *p++ = DW_CFA_advance_loc + 1; - *p++ = DW_CFA_register; - *p++ = 65; - *p++ = 12; - *p++ = DW_CFA_advance_loc + 4; - *p++ = DW_CFA_restore_extended; - *p++ = 65; - } - /* Subsume any padding into the last FDE if user .eh_frame - sections are aligned more than glink_eh_frame. Otherwise any - zero padding will be seen as a terminator. */ - size = p - htab->glink_eh_frame->contents; - align = 1; - align <<= htab->glink_eh_frame->output_section->alignment_power; - align -= 1; - pad = ((size + align) & ~align) - size; - htab->glink_eh_frame->size = size + pad; - bfd_put_32 (htab->elf.dynobj, last_fde_len + pad, last_fde); - } - /* Build the stubs as directed by the stub hash table. */ bfd_hash_traverse (&htab->stub_hash_table, ppc_build_one_stub, info); @@ -12789,6 +12860,9 @@ ppc64_elf_build_stubs (struct bfd_link_info *info, break; } + /* Note that the glink_eh_frame check here is not only testing that + the generated size matched the calculated size but also that + bfd_elf_discard_info didn't make any changes to the section. */ if (stub_sec != NULL || (htab->glink_eh_frame != NULL && htab->glink_eh_frame->rawsize != htab->glink_eh_frame->size)) @@ -12812,7 +12886,8 @@ ppc64_elf_build_stubs (struct bfd_link_info *info, " long branch %lu\n" " long toc adj %lu\n" " plt call %lu\n" - " plt call toc %lu"), + " plt call toc %lu\n" + " global entry %lu"), stub_sec_count, stub_sec_count == 1 ? "" : "s", htab->stub_count[ppc_stub_long_branch - 1], @@ -12820,7 +12895,8 @@ ppc64_elf_build_stubs (struct bfd_link_info *info, htab->stub_count[ppc_stub_plt_branch - 1], htab->stub_count[ppc_stub_plt_branch_r2off - 1], htab->stub_count[ppc_stub_plt_call - 1], - htab->stub_count[ppc_stub_plt_call_r2save - 1]); + htab->stub_count[ppc_stub_plt_call_r2save - 1], + htab->stub_count[ppc_stub_global_entry - 1]); } return TRUE; } @@ -13006,7 +13082,8 @@ ppc64_elf_relocate_section (bfd *output_bfd, opd = get_opd_info (sec); if (opd != NULL && opd->adjust != NULL) { - long adjust = opd->adjust[(sym->st_value + rel->r_addend) / 8]; + long adjust = opd->adjust[OPD_NDX (sym->st_value + + rel->r_addend)]; if (adjust == -1) relocation = 0; else @@ -13545,6 +13622,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, . addi 2,2,.TOC.@l if .TOC. is in range. */ if (!info->shared + && !info->traditional_format && h != NULL && &h->elf == htab->elf.hgot && rel + 1 < relend && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_REL16_LO) @@ -13712,10 +13790,17 @@ ppc64_elf_relocate_section (bfd *output_bfd, if (!can_plt_call) { - info->callbacks->einfo - (_("%P: %H: call to `%T' lacks nop, can't restore toc; " - "recompile with -fPIC\n"), - input_bfd, input_section, rel->r_offset, sym_name); + if (stub_entry->stub_type == ppc_stub_plt_call + || stub_entry->stub_type == ppc_stub_plt_call_r2save) + info->callbacks->einfo + (_("%P: %H: call to `%T' lacks nop, can't restore toc; " + "recompile with -fPIC\n"), + input_bfd, input_section, rel->r_offset, sym_name); + else + info->callbacks->einfo + (_("%P: %H: call to `%T' lacks nop, can't restore toc; " + "(-mcmodel=small toc adjust stub)\n"), + input_bfd, input_section, rel->r_offset, sym_name); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -14765,7 +14850,7 @@ ppc64_elf_output_symbol_hook (struct bfd_link_info *info, if (!info->relocatable) value -= input_sec->output_section->vma; - adjust = opd->adjust[value / 8]; + adjust = opd->adjust[OPD_NDX (value)]; if (adjust == -1) return 2; @@ -15053,18 +15138,86 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, NULL)) return FALSE; - if (htab->glink_eh_frame != NULL - && htab->glink_eh_frame->sec_info_type == SEC_INFO_TYPE_EH_FRAME - && !_bfd_elf_write_section_eh_frame (output_bfd, info, - htab->glink_eh_frame, - htab->glink_eh_frame->contents)) - return FALSE; + && htab->glink_eh_frame->size != 0) + { + bfd_vma val; + bfd_byte *p; + asection *stub_sec; + + p = htab->glink_eh_frame->contents + sizeof (glink_eh_frame_cie); + for (stub_sec = htab->params->stub_bfd->sections; + stub_sec != NULL; + stub_sec = stub_sec->next) + if ((stub_sec->flags & SEC_LINKER_CREATED) == 0) + { + /* FDE length. */ + p += 4; + /* CIE pointer. */ + p += 4; + /* Offset to stub section. */ + val = (stub_sec->output_section->vma + + stub_sec->output_offset); + val -= (htab->glink_eh_frame->output_section->vma + + htab->glink_eh_frame->output_offset + + (p - htab->glink_eh_frame->contents)); + if (val + 0x80000000 > 0xffffffff) + { + info->callbacks->einfo + (_("%P: %s offset too large for .eh_frame sdata4 encoding"), + stub_sec->name); + return FALSE; + } + bfd_put_32 (dynobj, val, p); + p += 4; + /* stub section size. */ + p += 4; + /* Augmentation. */ + p += 1; + /* Pad. */ + p += 7; + } + if (htab->glink != NULL && htab->glink->size != 0) + { + /* FDE length. */ + p += 4; + /* CIE pointer. */ + p += 4; + /* Offset to .glink. */ + val = (htab->glink->output_section->vma + + htab->glink->output_offset + + 8); + val -= (htab->glink_eh_frame->output_section->vma + + htab->glink_eh_frame->output_offset + + (p - htab->glink_eh_frame->contents)); + if (val + 0x80000000 > 0xffffffff) + { + info->callbacks->einfo + (_("%P: %s offset too large for .eh_frame sdata4 encoding"), + htab->glink->name); + return FALSE; + } + bfd_put_32 (dynobj, val, p); + p += 4; + /* .glink size. */ + p += 4; + /* Augmentation. */ + p += 1; + /* Ops. */ + p += 7; + } + + if (htab->glink_eh_frame->sec_info_type == SEC_INFO_TYPE_EH_FRAME + && !_bfd_elf_write_section_eh_frame (output_bfd, info, + htab->glink_eh_frame, + htab->glink_eh_frame->contents)) + return FALSE; + } /* We need to handle writing out multiple GOT sections ourselves, since we didn't add them to DYNOBJ. We know dynobj is the first bfd. */ - while ((dynobj = dynobj->link_next) != NULL) + while ((dynobj = dynobj->link.next) != NULL) { asection *s; diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index 1a3f8f756..8c627a4ed 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -1,5 +1,5 @@ /* PowerPC64-specific support for 64-bit ELF. - Copyright (C) 2002-2014 Free Software Foundation, Inc. + Copyright (C) 2002-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -72,7 +72,7 @@ bfd_boolean ppc64_elf_edit_toc bfd_boolean ppc64_elf_has_small_toc_reloc (asection *); bfd_vma ppc64_elf_set_toc -(struct bfd_link_info *, bfd *); + (struct bfd_link_info *, bfd *); int ppc64_elf_setup_section_lists (struct bfd_link_info *); void ppc64_elf_start_multitoc_partition diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 831c4a2dc..cdbe6caa5 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 64-bit ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of BFD, the Binary File Descriptor library. @@ -1183,6 +1183,12 @@ elf_s390_check_relocs (bfd *abfd, /* Fall through */ case R_390_TLS_LE64: + /* For static linking and executables this reloc will be + calculated at linktime otherwise a TLS_TPOFF runtime + reloc will be generated. */ + if (r_type == R_390_TLS_LE64 && info->pie) + break; + if (!info->shared) break; info->flags |= DF_STATIC_TLS; @@ -1701,7 +1707,7 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info, s = htab->sdynbss; - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -1995,7 +2001,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -3074,7 +3080,7 @@ elf_s390_relocate_section (bfd *output_bfd, break; case R_390_TLS_LE64: - if (info->shared) + if (info->shared && !info->pie) { /* Linking a shared library with non-fpic code requires a R_390_TLS_TPOFF relocation. */ @@ -3717,7 +3723,7 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, } /* Finish dynamic symbol for local IFUNC symbols. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { struct plt_entry *local_plt; Elf_Internal_Sym *isym; diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 311d7c3e8..bc48b0ef7 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -1,5 +1,5 @@ /* SuperH SH64-specific support for 64-bit ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2259,31 +2259,10 @@ sh_elf64_set_private_flags (bfd *abfd, flagword flags) static bfd_boolean sh_elf64_copy_private_data_internal (bfd *ibfd, bfd *obfd) { - Elf_Internal_Shdr **o_shdrp; - asection *isec; - asection *osec; - if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return TRUE; - o_shdrp = elf_elfsections (obfd); - for (osec = obfd->sections; osec; osec = osec->next) - { - int oIndex = ((struct bfd_elf_section_data *) elf_section_data (osec))->this_idx; - for (isec = ibfd->sections; isec; isec = isec->next) - { - if (strcmp (osec->name, isec->name) == 0) - { - /* Note that we're not disallowing mixing data and code. */ - if ((elf_section_data (isec)->this_hdr.sh_flags - & SHF_SH5_ISA32) != 0) - o_shdrp[oIndex]->sh_flags |= SHF_SH5_ISA32; - break; - } - } - } - /* Copy object attributes. */ _bfd_elf_copy_private_bfd_data (ibfd, obfd); @@ -3381,7 +3360,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* This function is called via sh_elf_link_hash_traverse if we are diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 6f995c5cf..26e664efc 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for 64-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -97,7 +97,9 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect, else relent->address = rela.r_offset - asect->vma; - if (ELF64_R_SYM (rela.r_info) == STN_UNDEF) + if (ELF64_R_SYM (rela.r_info) == STN_UNDEF + /* PR 17512: file: 996185f8. */ + || ELF64_R_SYM (rela.r_info) > bfd_get_symcount (abfd)) relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; else { @@ -424,9 +426,10 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, { static const char *const stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" }; - if ((abfd->flags & DYNAMIC) == 0 - && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER) @@ -864,8 +867,6 @@ const struct elf_size_info elf64_sparc_size_info = _bfd_sparc_elf_plt_sym_val #define bfd_elf64_bfd_link_hash_table_create \ _bfd_sparc_elf_link_hash_table_create -#define bfd_elf64_bfd_link_hash_table_free \ - _bfd_sparc_elf_link_hash_table_free #define elf_info_to_howto \ _bfd_sparc_elf_info_to_howto #define elf_backend_copy_indirect_symbol \ diff --git a/bfd/elf64-tilegx.c b/bfd/elf64-tilegx.c index f388e72c2..8dee9a45e 100644 --- a/bfd/elf64-tilegx.c +++ b/bfd/elf64-tilegx.c @@ -1,5 +1,5 @@ /* TILE-Gx-specific support for 64-bit ELF. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf64-tilegx.h b/bfd/elf64-tilegx.h index 12aec464f..263d6d0a6 100644 --- a/bfd/elf64-tilegx.h +++ b/bfd/elf64-tilegx.h @@ -1,5 +1,5 @@ /* TILE-Gx-specific support for 64-bit ELF. - Copyright (C) 2011-2014 Free Software Foundation, Inc. + Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 2caffb338..6b7d3c9a5 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1,5 +1,5 @@ /* X86-64 specific support for ELF - Copyright (C) 2000-2014 Free Software Foundation, Inc. + Copyright (C) 2000-2015 Free Software Foundation, Inc. Contributed by Jan Hubicka . This file is part of BFD, the Binary File Descriptor library. @@ -302,7 +302,7 @@ elf_x86_64_reloc_type_lookup (bfd *abfd, return elf_x86_64_rtype_to_howto (abfd, x86_64_reloc_map[i].elf_reloc_val); } - return 0; + return NULL; } static reloc_howto_type * @@ -757,8 +757,19 @@ struct elf_x86_64_link_hash_entry (GOT_TLS_GD_P (type) || GOT_TLS_GDESC_P (type)) unsigned char tls_type; + /* TRUE if a weak symbol with a real definition needs a copy reloc. + When there is a weak symbol with a real definition, the processor + independent code will have arranged for us to see the real + definition first. We need to copy the needs_copy bit from the + real definition and check it when allowing copy reloc in PIE. */ + unsigned int needs_copy : 1; + /* TRUE if symbol has at least one BND relocation. */ - bfd_boolean has_bnd_reloc; + unsigned int has_bnd_reloc : 1; + + /* Information about the GOT PLT entry. Filled when there are both + GOT and PLT relocations against the same function. */ + union gotplt_union plt_got; /* Information about the second PLT entry. Filled when has_bnd_reloc is set. */ @@ -815,6 +826,7 @@ struct elf_x86_64_link_hash_table asection *srelbss; asection *plt_eh_frame; asection *plt_bnd; + asection *plt_got; union { @@ -892,8 +904,10 @@ elf_x86_64_link_hash_newfunc (struct bfd_hash_entry *entry, eh = (struct elf_x86_64_link_hash_entry *) entry; eh->dyn_relocs = NULL; eh->tls_type = GOT_UNKNOWN; - eh->has_bnd_reloc = FALSE; + eh->needs_copy = 0; + eh->has_bnd_reloc = 0; eh->plt_bnd.offset = (bfd_vma) -1; + eh->plt_got.offset = (bfd_vma) -1; eh->tlsdesc_got = (bfd_vma) -1; } @@ -962,11 +976,27 @@ elf_x86_64_get_local_sym_hash (struct elf_x86_64_link_hash_table *htab, ret->elf.indx = sec->id; ret->elf.dynstr_index = htab->r_sym (rel->r_info); ret->elf.dynindx = -1; + ret->plt_got.offset = (bfd_vma) -1; *slot = ret; } return &ret->elf; } +/* Destroy an X86-64 ELF linker hash table. */ + +static void +elf_x86_64_link_hash_table_free (bfd *obfd) +{ + struct elf_x86_64_link_hash_table *htab + = (struct elf_x86_64_link_hash_table *) obfd->link.hash; + + if (htab->loc_hash_table) + htab_delete (htab->loc_hash_table); + if (htab->loc_hash_memory) + objalloc_free ((struct objalloc *) htab->loc_hash_memory); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create an X86-64 ELF linker hash table. */ static struct bfd_link_hash_table * @@ -1012,28 +1042,14 @@ elf_x86_64_link_hash_table_create (bfd *abfd) ret->loc_hash_memory = objalloc_create (); if (!ret->loc_hash_table || !ret->loc_hash_memory) { - free (ret); + elf_x86_64_link_hash_table_free (abfd); return NULL; } + ret->elf.root.hash_table_free = elf_x86_64_link_hash_table_free; return &ret->elf.root; } -/* Destroy an X86-64 ELF linker hash table. */ - -static void -elf_x86_64_link_hash_table_free (struct bfd_link_hash_table *hash) -{ - struct elf_x86_64_link_hash_table *htab - = (struct elf_x86_64_link_hash_table *) hash; - - if (htab->loc_hash_table) - htab_delete (htab->loc_hash_table); - if (htab->loc_hash_memory) - objalloc_free ((struct objalloc *) htab->loc_hash_memory); - _bfd_elf_link_hash_table_free (hash); -} - /* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and .rela.bss sections in DYNOBJ, and set up shortcuts to them in our hash table. */ @@ -1052,13 +1068,28 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj, return FALSE; htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss"); - if (!info->shared) - htab->srelbss = bfd_get_linker_section (dynobj, ".rela.bss"); - - if (!htab->sdynbss - || (!info->shared && !htab->srelbss)) + if (!htab->sdynbss) abort (); + if (info->executable) + { + /* Always allow copy relocs for building executables. */ + asection *s = bfd_get_linker_section (dynobj, ".rela.bss"); + if (s == NULL) + { + const struct elf_backend_data *bed = get_elf_backend_data (dynobj); + s = bfd_make_section_anyway_with_flags (dynobj, + ".rela.bss", + (bed->dynamic_sec_flags + | SEC_READONLY)); + if (s == NULL + || ! bfd_set_section_alignment (dynobj, s, + bed->s->log_file_align)) + return FALSE; + } + htab->srelbss = s; + } + if (!info->no_ld_generated_unwind_info && htab->plt_eh_frame == NULL && htab->elf.splt != NULL) @@ -1513,6 +1544,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; + bfd_boolean use_plt_got; if (info->relocatable) return TRUE; @@ -1523,6 +1555,8 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (htab == NULL) return FALSE; + use_plt_got = get_elf_x86_64_backend_data (abfd) == &elf_x86_64_arch_bed; + symtab_hdr = &elf_symtab_hdr (abfd); sym_hashes = elf_sym_hashes (abfd); @@ -1628,13 +1662,18 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_X86_64_PC32_BND: case R_X86_64_PLT32_BND: + case R_X86_64_PC32: + case R_X86_64_PLT32: + case R_X86_64_32: + case R_X86_64_64: /* MPX PLT is supported only if elf_x86_64_arch_bed is used in 64-bit mode. */ if (ABI_64_P (abfd) - && (get_elf_x86_64_backend_data (abfd) - == &elf_x86_64_arch_bed)) + && info->bndplt + && (get_elf_x86_64_backend_data (abfd) + == &elf_x86_64_arch_bed)) { - elf_x86_64_hash_entry (h)->has_bnd_reloc = TRUE; + elf_x86_64_hash_entry (h)->has_bnd_reloc = 1; /* Create the second PLT for Intel MPX support. */ if (htab->plt_bnd == NULL) @@ -1643,17 +1682,10 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, const struct elf_backend_data *bed; bed = get_elf_backend_data (info->output_bfd); - switch (sizeof (elf_x86_64_bnd_plt2_entry)) - { - case 8: - plt_bnd_align = 3; - break; - case 16: - plt_bnd_align = 4; - break; - default: - abort (); - } + BFD_ASSERT (sizeof (elf_x86_64_bnd_plt2_entry) == 8 + && (sizeof (elf_x86_64_bnd_plt2_entry) + == sizeof (elf_x86_64_legacy_plt2_entry))); + plt_bnd_align = 3; if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; @@ -1674,11 +1706,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, } case R_X86_64_32S: - case R_X86_64_32: - case R_X86_64_64: - case R_X86_64_PC32: case R_X86_64_PC64: - case R_X86_64_PLT32: case R_X86_64_GOTPCREL: case R_X86_64_GOTPCREL64: if (htab->elf.dynobj == NULL) @@ -1751,14 +1779,6 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (h != NULL) { - if (r_type == R_X86_64_GOTPLT64) - { - /* This relocation indicates that we also need - a PLT entry, as this is a function. We don't need - a PLT entry for local symbols. */ - h->needs_plt = 1; - h->plt.refcount += 1; - } h->got.refcount += 1; old_tls_type = elf_x86_64_hash_entry (h)->tls_type; } @@ -2052,6 +2072,39 @@ do_size: default: break; } + + if (use_plt_got + && h != NULL + && h->plt.refcount > 0 + && h->got.refcount > 0 + && htab->plt_got == NULL) + { + /* Create the GOT procedure linkage table. */ + unsigned int plt_got_align; + const struct elf_backend_data *bed; + + bed = get_elf_backend_data (info->output_bfd); + BFD_ASSERT (sizeof (elf_x86_64_legacy_plt2_entry) == 8 + && (sizeof (elf_x86_64_bnd_plt2_entry) + == sizeof (elf_x86_64_legacy_plt2_entry))); + plt_got_align = 3; + + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + htab->plt_got + = bfd_make_section_anyway_with_flags (htab->elf.dynobj, + ".plt.got", + (bed->dynamic_sec_flags + | SEC_ALLOC + | SEC_CODE + | SEC_LOAD + | SEC_READONLY)); + if (htab->plt_got == NULL + || !bfd_set_section_alignment (htab->elf.dynobj, + htab->plt_got, + plt_got_align)) + return FALSE; + } } return TRUE; @@ -2180,8 +2233,6 @@ elf_x86_64_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, case R_X86_64_GOTPLT64: if (h != NULL) { - if (r_type == R_X86_64_GOTPLT64 && h->plt.refcount > 0) - h->plt.refcount -= 1; if (h->got.refcount > 0) h->got.refcount -= 1; if (h->type == STT_GNU_IFUNC) @@ -2330,7 +2381,11 @@ elf_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, h->root.u.def.section = h->u.weakdef->root.u.def.section; h->root.u.def.value = h->u.weakdef->root.u.def.value; if (ELIMINATE_COPY_RELOCS || info->nocopyreloc) - h->non_got_ref = h->u.weakdef->non_got_ref; + { + eh = (struct elf_x86_64_link_hash_entry *) h; + h->non_got_ref = h->u.weakdef->non_got_ref; + eh->needs_copy = h->u.weakdef->needs_copy; + } return TRUE; } @@ -2341,7 +2396,7 @@ elf_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, 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) + if (!info->executable) return TRUE; /* If there are no references to this symbol that do not use the @@ -2402,7 +2457,7 @@ elf_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, s = htab->sdynbss; - return _bfd_elf_adjust_dynamic_copy (h, s); + return _bfd_elf_adjust_dynamic_copy (info, h, s); } /* Allocate space in .plt, .got and associated reloc sections for @@ -2430,6 +2485,24 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) bed = get_elf_backend_data (info->output_bfd); plt_entry_size = GET_PLT_ENTRY_SIZE (info->output_bfd); + /* We can't use the GOT PLT if pointer equality is needed since + finish_dynamic_symbol won't clear symbol value and the dynamic + linker won't update the GOT slot. We will get into an infinite + loop at run-time. */ + if (htab->plt_got != NULL + && h->type != STT_GNU_IFUNC + && !h->pointer_equality_needed + && h->plt.refcount > 0 + && h->got.refcount > 0) + { + /* Don't use the regular PLT if there are both GOT and GOTPLT + reloctions. */ + h->plt.offset = (bfd_vma) -1; + + /* Use the GOT PLT. */ + eh->plt_got.refcount = 1; + } + /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it here if it is defined and referenced in a non-shared object. */ if (h->type == STT_GNU_IFUNC @@ -2457,8 +2530,10 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) return FALSE; } else if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && (h->plt.refcount > 0 || eh->plt_got.refcount > 0)) { + bfd_boolean use_plt_got = eh->plt_got.refcount > 0; + /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 @@ -2473,15 +2548,21 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) { asection *s = htab->elf.splt; asection *bnd_s = htab->plt_bnd; + asection *got_s = htab->plt_got; /* If this is the first .plt entry, make room for the special first entry. */ if (s->size == 0) s->size = plt_entry_size; - h->plt.offset = s->size; - if (bnd_s) - eh->plt_bnd.offset = bnd_s->size; + if (use_plt_got) + eh->plt_got.offset = got_s->size; + else + { + h->plt.offset = s->size; + if (bnd_s) + eh->plt_bnd.offset = bnd_s->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 @@ -2491,36 +2572,49 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) if (! info->shared && !h->def_regular) { - if (bnd_s) + if (use_plt_got) { - /* We need to make a call to the entry of the second - PLT instead of regular PLT entry. */ - h->root.u.def.section = bnd_s; - h->root.u.def.value = eh->plt_bnd.offset; + /* We need to make a call to the entry of the GOT PLT + instead of regular PLT entry. */ + h->root.u.def.section = got_s; + h->root.u.def.value = eh->plt_got.offset; } else { - h->root.u.def.section = s; - h->root.u.def.value = h->plt.offset; + if (bnd_s) + { + /* We need to make a call to the entry of the second + PLT instead of regular PLT entry. */ + h->root.u.def.section = bnd_s; + h->root.u.def.value = eh->plt_bnd.offset; + } + else + { + h->root.u.def.section = s; + h->root.u.def.value = h->plt.offset; + } } } /* Make room for this entry. */ - s->size += plt_entry_size; - if (bnd_s) + if (use_plt_got) + got_s->size += sizeof (elf_x86_64_legacy_plt2_entry); + else { - BFD_ASSERT (sizeof (elf_x86_64_bnd_plt2_entry) - == sizeof (elf_x86_64_legacy_plt2_entry)); - bnd_s->size += sizeof (elf_x86_64_legacy_plt2_entry); - } + s->size += plt_entry_size; + if (bnd_s) + bnd_s->size += sizeof (elf_x86_64_legacy_plt2_entry); - /* We also need to make an entry in the .got.plt section, which - will be placed in the .got section by the linker script. */ - htab->elf.sgotplt->size += GOT_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. */ + htab->elf.sgotplt->size += GOT_ENTRY_SIZE; - /* We also need to make an entry in the .rela.plt section. */ - htab->elf.srelplt->size += bed->s->sizeof_rela; - htab->elf.srelplt->reloc_count++; + /* We also need to make an entry in the .rela.plt + section. */ + htab->elf.srelplt->size += bed->s->sizeof_rela; + htab->elf.srelplt->reloc_count++; + } } else { @@ -2634,20 +2728,38 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) /* Also discard relocs on undefined weak syms with non-default visibility. */ - if (eh->dyn_relocs != NULL - && h->root.type == bfd_link_hash_undefweak) + if (eh->dyn_relocs != NULL) { - if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) - eh->dyn_relocs = NULL; - - /* Make sure undefined weak symbols are output as a dynamic - symbol in PIEs. */ - else if (h->dynindx == -1 - && ! h->forced_local - && ! bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; - } + if (h->root.type == bfd_link_hash_undefweak) + { + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) + eh->dyn_relocs = NULL; + + /* Make sure undefined weak symbols are output as a dynamic + symbol in PIEs. */ + else if (h->dynindx == -1 + && ! h->forced_local + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + /* For PIE, discard space for pc-relative relocs against + symbols which turn out to need copy relocs. */ + else if (info->executable + && (h->needs_copy || eh->needs_copy) + && h->def_dynamic + && !h->def_regular) + { + struct elf_dyn_relocs **pp; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { + if (p->pc_count != 0) + *pp = p->next; + else + pp = &p->next; + } + } + } } else if (ELIMINATE_COPY_RELOCS) { @@ -2776,7 +2888,7 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec, /* Nothing to do if there are no codes, no relocations or no output. */ if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC) || sec->reloc_count == 0 - || discarded_section (sec)) + || bfd_is_abs_section (sec->output_section)) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -2823,6 +2935,7 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec, /* STT_GNU_IFUNC must keep R_X86_64_GOTPCREL relocation. */ if (ELF_ST_TYPE (isym->st_info) != STT_GNU_IFUNC + && irel->r_offset >= 2 && bfd_get_8 (input_bfd, contents + irel->r_offset - 2) == 0x8b) { @@ -2853,6 +2966,7 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec, && h->type != STT_GNU_IFUNC && h != htab->elf.hdynamic && SYMBOL_REFERENCES_LOCAL (link_info, h) + && irel->r_offset >= 2 && bfd_get_8 (input_bfd, contents + irel->r_offset - 2) == 0x8b) { @@ -2935,7 +3049,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd, /* Set up .got offsets for local syms, and space for local dynamic relocs. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; @@ -3137,6 +3251,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd, || s == htab->elf.iplt || s == htab->elf.igotplt || s == htab->plt_bnd + || s == htab->plt_got || s == htab->plt_eh_frame || s == htab->sdynbss) { @@ -3717,12 +3832,7 @@ elf_x86_64_relocate_section (bfd *output_bfd, case R_X86_64_GOTPCREL64: /* Use global offset table entry as symbol value. */ case R_X86_64_GOTPLT64: - /* This is the same as GOT64 for relocation purposes, but - indicates the existence of a PLT entry. The difficulty is, - that we must calculate the GOT slot offset from the PLT - offset, if this symbol got a PLT entry (it was global). - Additionally if it's computed from the PLT entry, then that - GOT offset is relative to .got.plt, not to .got. */ + /* This is obsolete and treated the the same as GOT64. */ base_got = htab->elf.sgot; if (htab->elf.sgot == NULL) @@ -3907,7 +4017,8 @@ elf_x86_64_relocate_section (bfd *output_bfd, if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1 + if ((h->plt.offset == (bfd_vma) -1 + && eh->plt_got.offset == (bfd_vma) -1) || htab->elf.splt == NULL) { /* We didn't make a PLT entry for this symbol. This @@ -3916,15 +4027,24 @@ elf_x86_64_relocate_section (bfd *output_bfd, break; } - if (htab->plt_bnd != NULL) + if (h->plt.offset != (bfd_vma) -1) { - resolved_plt = htab->plt_bnd; - plt_offset = eh->plt_bnd.offset; + if (htab->plt_bnd != NULL) + { + resolved_plt = htab->plt_bnd; + plt_offset = eh->plt_bnd.offset; + } + else + { + resolved_plt = htab->elf.splt; + plt_offset = h->plt.offset; + } } else { - resolved_plt = htab->elf.splt; - plt_offset = h->plt.offset; + /* Use the GOT PLT. */ + resolved_plt = htab->plt_got; + plt_offset = eh->plt_got.offset; } relocation = (resolved_plt->output_section->vma @@ -3960,10 +4080,12 @@ elf_x86_64_relocate_section (bfd *output_bfd, defined locally or for a branch. */ fail = !h->def_regular && !branch; } - else + else if (!(info->executable + && (h->needs_copy || eh->needs_copy))) { - /* Symbol isn't referenced locally. We only allow - branch to symbol with non-default visibility. */ + /* Symbol doesn't need copy reloc and isn't referenced + locally. We only allow branch to symbol with + non-default visibility. */ fail = (!branch || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT); } @@ -4017,7 +4139,13 @@ direct: if ((input_section->flags & SEC_ALLOC) == 0) break; + /* Don't copy a pc-relative relocation into the output file + if the symbol needs copy reloc. */ if ((info->shared + && !(info->executable + && h != NULL + && (h->needs_copy || eh->needs_copy) + && IS_X86_64_PCREL_TYPE (r_type)) && (h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT || h->root.type != bfd_link_hash_undefweak) @@ -4280,17 +4408,27 @@ direct: else if (ELF32_R_TYPE (rel->r_info) == R_X86_64_GOTTPOFF) { /* IE->LE transition: - Originally it can be one of: + For 64bit, originally it can be one of: movq foo@gottpoff(%rip), %reg addq foo@gottpoff(%rip), %reg We change it into: movq $foo, %reg leaq foo(%reg), %reg - addq $foo, %reg. */ + addq $foo, %reg. + For 32bit, originally it can be one of: + movq foo@gottpoff(%rip), %reg + addl foo@gottpoff(%rip), %reg + We change it into: + movq $foo, %reg + leal foo(%reg), %reg + addl $foo, %reg. */ unsigned int val, type, reg; - val = bfd_get_8 (input_bfd, contents + roff - 3); + if (roff >= 3) + val = bfd_get_8 (input_bfd, contents + roff - 3); + else + val = 0; type = bfd_get_8 (input_bfd, contents + roff - 2); reg = bfd_get_8 (input_bfd, contents + roff - 1); reg >>= 3; @@ -4310,8 +4448,8 @@ direct: } else if (reg == 4) { - /* addq -> addq - addressing with %rsp/%r12 is - special */ + /* addq/addl -> addq/addl - addressing with %rsp/%r12 + is special */ if (val == 0x4c) bfd_put_8 (output_bfd, 0x49, contents + roff - 3); @@ -4325,7 +4463,7 @@ direct: } else { - /* addq -> leaq */ + /* addq/addl -> leaq/leal */ if (val == 0x4c) bfd_put_8 (output_bfd, 0x4d, contents + roff - 3); @@ -4729,6 +4867,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, struct elf_x86_64_link_hash_table *htab; const struct elf_x86_64_backend_data *abed; bfd_boolean use_plt_bnd; + struct elf_x86_64_link_hash_entry *eh; htab = elf_x86_64_hash_table (info); if (htab == NULL) @@ -4741,6 +4880,8 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, ? &elf_x86_64_bnd_arch_bed : get_elf_x86_64_backend_data (output_bfd)); + eh = (struct elf_x86_64_link_hash_entry *) h; + if (h->plt.offset != (bfd_vma) -1) { bfd_vma plt_index; @@ -4750,6 +4891,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, bfd_byte *loc; asection *plt, *gotplt, *relplt, *resolved_plt; const struct elf_backend_data *bed; + bfd_vma plt_got_pcrel_offset; /* When building a static executable, use .iplt, .igot.plt and .rela.iplt sections for STT_GNU_IFUNC symbols. */ @@ -4807,8 +4949,6 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, { /* Use the second PLT with BND relocations. */ const bfd_byte *plt_entry, *plt2_entry; - struct elf_x86_64_link_hash_entry *eh - = (struct elf_x86_64_link_hash_entry *) h; if (eh->has_bnd_reloc) { @@ -4854,14 +4994,20 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, /* Put offset the PC-relative instruction referring to the GOT entry, subtracting the size of that instruction. */ - bfd_put_32 (output_bfd, - (gotplt->output_section->vma - + gotplt->output_offset - + got_offset - - resolved_plt->output_section->vma - - resolved_plt->output_offset - - plt_offset - - plt_got_insn_size), + plt_got_pcrel_offset = (gotplt->output_section->vma + + gotplt->output_offset + + got_offset + - resolved_plt->output_section->vma + - resolved_plt->output_offset + - plt_offset + - plt_got_insn_size); + + /* Check PC-relative offset overflow in PLT entry. */ + if ((plt_got_pcrel_offset + 0x80000000) > 0xffffffff) + info->callbacks->einfo (_("%F%B: PC-relative offset overflow in PLT entry for `%s'\n"), + output_bfd, h->root.root.string); + + bfd_put_32 (output_bfd, plt_got_pcrel_offset, resolved_plt->contents + plt_offset + plt_got_offset); /* Fill in the entry in the global offset table, initially this @@ -4900,32 +5046,101 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, /* Don't fill PLT entry for static executables. */ if (plt == htab->elf.splt) { + bfd_vma plt0_offset = h->plt.offset + plt_plt_insn_end; + /* Put relocation index. */ bfd_put_32 (output_bfd, plt_index, plt->contents + h->plt.offset + abed->plt_reloc_offset); - /* Put offset for jmp .PLT0. */ - bfd_put_32 (output_bfd, - (h->plt.offset + plt_plt_insn_end), + + /* Put offset for jmp .PLT0 and check for overflow. We don't + check relocation index for overflow since branch displacement + will overflow first. */ + if (plt0_offset > 0x80000000) + info->callbacks->einfo (_("%F%B: branch displacement overflow in PLT entry for `%s'\n"), + output_bfd, h->root.root.string); + bfd_put_32 (output_bfd, - plt0_offset, plt->contents + h->plt.offset + plt_plt_offset); } bed = get_elf_backend_data (output_bfd); loc = relplt->contents + plt_index * bed->s->sizeof_rela; bed->s->swap_reloca_out (output_bfd, &rela, loc); + } + else if (eh->plt_got.offset != (bfd_vma) -1) + { + bfd_vma got_offset, plt_offset, plt_got_offset, plt_got_insn_size; + asection *plt, *got; + bfd_boolean got_after_plt; + int32_t got_pcrel_offset; + const bfd_byte *got_plt_entry; + + /* Set the entry in the GOT procedure linkage table. */ + plt = htab->plt_got; + got = htab->elf.sgot; + got_offset = h->got.offset; + + if (got_offset == (bfd_vma) -1 + || h->type == STT_GNU_IFUNC + || plt == NULL + || got == NULL) + abort (); - if (!h->def_regular) + /* Use the second PLT entry template for the GOT PLT since they + are the identical. */ + plt_got_insn_size = elf_x86_64_bnd_arch_bed.plt_got_insn_size; + plt_got_offset = elf_x86_64_bnd_arch_bed.plt_got_offset; + if (eh->has_bnd_reloc) + got_plt_entry = elf_x86_64_bnd_plt2_entry; + else { - /* Mark the symbol as undefined, rather than as defined in - the .plt section. Leave the value if there were any - relocations where pointer equality matters (this is a clue - for the dynamic linker, to make function pointer - comparisons work between an application and shared - library), otherwise set it to zero. If a function is only - called from a binary, there is no need to slow down - shared libraries because of that. */ - sym->st_shndx = SHN_UNDEF; - if (!h->pointer_equality_needed) - sym->st_value = 0; + got_plt_entry = elf_x86_64_legacy_plt2_entry; + + /* Subtract 1 since there is no BND prefix. */ + plt_got_insn_size -= 1; + plt_got_offset -= 1; } + + /* Fill in the entry in the GOT procedure linkage table. */ + plt_offset = eh->plt_got.offset; + memcpy (plt->contents + plt_offset, + got_plt_entry, sizeof (elf_x86_64_legacy_plt2_entry)); + + /* Put offset the PC-relative instruction referring to the GOT + entry, subtracting the size of that instruction. */ + got_pcrel_offset = (got->output_section->vma + + got->output_offset + + got_offset + - plt->output_section->vma + - plt->output_offset + - plt_offset + - plt_got_insn_size); + + /* Check PC-relative offset overflow in GOT PLT entry. */ + got_after_plt = got->output_section->vma > plt->output_section->vma; + if ((got_after_plt && got_pcrel_offset < 0) + || (!got_after_plt && got_pcrel_offset > 0)) + info->callbacks->einfo (_("%F%B: PC-relative offset overflow in GOT PLT entry for `%s'\n"), + output_bfd, h->root.root.string); + + bfd_put_32 (output_bfd, got_pcrel_offset, + plt->contents + plt_offset + plt_got_offset); + } + + if (!h->def_regular + && (h->plt.offset != (bfd_vma) -1 + || eh->plt_got.offset != (bfd_vma) -1)) + { + /* Mark the symbol as undefined, rather than as defined in + the .plt section. Leave the value if there were any + relocations where pointer equality matters (this is a clue + for the dynamic linker, to make function pointer + comparisons work between an application and shared + library), otherwise set it to zero. If a function is only + called from a binary, there is no need to slow down + shared libraries because of that. */ + sym->st_shndx = SHN_UNDEF; + if (!h->pointer_equality_needed) + sym->st_value = 0; } if (h->got.offset != (bfd_vma) -1 @@ -5291,85 +5506,98 @@ elf_x86_64_finish_dynamic_sections (bfd *output_bfd, return TRUE; } -/* Return address in section PLT for the Ith GOTPLT relocation, for - relocation REL or (bfd_vma) -1 if it should not be included. */ +/* Return an array of PLT entry symbol values. */ -static bfd_vma -elf_x86_64_plt_sym_val (bfd_vma i, const asection *plt, - const arelent *rel) +static bfd_vma * +elf_x86_64_get_plt_sym_val (bfd *abfd, asymbol **dynsyms, asection *plt, + asection *relplt) { - bfd *abfd; - const struct elf_x86_64_backend_data *bed; + bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); + arelent *p; + long count, i; + bfd_vma *plt_sym_val; bfd_vma plt_offset; + bfd_byte *plt_contents; + const struct elf_x86_64_backend_data *bed; + Elf_Internal_Shdr *hdr; + asection *plt_bnd; - /* Only match R_X86_64_JUMP_SLOT and R_X86_64_IRELATIVE. */ - if (rel->howto->type != R_X86_64_JUMP_SLOT - && rel->howto->type != R_X86_64_IRELATIVE) - return (bfd_vma) -1; - - abfd = plt->owner; - bed = get_elf_x86_64_backend_data (abfd); - plt_offset = bed->plt_entry_size; - - if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU) - return plt->vma + (i + 1) * plt_offset; + /* Get the .plt section contents. PLT passed down may point to the + .plt.bnd section. Make sure that PLT always points to the .plt + section. */ + plt_bnd = bfd_get_section_by_name (abfd, ".plt.bnd"); + if (plt_bnd) + { + if (plt != plt_bnd) + abort (); + plt = bfd_get_section_by_name (abfd, ".plt"); + if (plt == NULL) + abort (); + bed = &elf_x86_64_bnd_arch_bed; + } + else + bed = get_elf_x86_64_backend_data (abfd); - while (plt_offset < plt->size) + plt_contents = (bfd_byte *) bfd_malloc (plt->size); + if (plt_contents == NULL) + return NULL; + if (!bfd_get_section_contents (abfd, (asection *) plt, + plt_contents, 0, plt->size)) { - bfd_vma reloc_index; - bfd_byte reloc_index_raw[4]; - - if (!bfd_get_section_contents (abfd, (asection *) plt, - reloc_index_raw, - plt_offset + bed->plt_reloc_offset, - sizeof (reloc_index_raw))) - return (bfd_vma) -1; - - reloc_index = H_GET_32 (abfd, reloc_index_raw); - if (reloc_index == i) - return plt->vma + plt_offset; - plt_offset += bed->plt_entry_size; +bad_return: + free (plt_contents); + return NULL; } - abort (); -} + slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; + if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE)) + goto bad_return; -/* Return offset in .plt.bnd section for the Ith GOTPLT relocation with - PLT section, or (bfd_vma) -1 if it should not be included. */ + hdr = &elf_section_data (relplt)->this_hdr; + count = relplt->size / hdr->sh_entsize; -static bfd_vma -elf_x86_64_plt_sym_val_offset_plt_bnd (bfd_vma i, const asection *plt) -{ - const struct elf_x86_64_backend_data *bed = &elf_x86_64_bnd_arch_bed; - bfd *abfd = plt->owner; - bfd_vma plt_offset = bed->plt_entry_size; + plt_sym_val = (bfd_vma *) bfd_malloc (sizeof (bfd_vma) * count); + if (plt_sym_val == NULL) + goto bad_return; - if (elf_elfheader (abfd)->e_ident[EI_OSABI] != ELFOSABI_GNU) - return i * sizeof (elf_x86_64_legacy_plt2_entry); + for (i = 0; i < count; i++, p++) + plt_sym_val[i] = -1; - while (plt_offset < plt->size) + plt_offset = bed->plt_entry_size; + p = relplt->relocation; + for (i = 0; i < count; i++, p++) { - bfd_vma reloc_index; - bfd_byte reloc_index_raw[4]; + long reloc_index; - if (!bfd_get_section_contents (abfd, (asection *) plt, - reloc_index_raw, - plt_offset + bed->plt_reloc_offset, - sizeof (reloc_index_raw))) - return (bfd_vma) -1; + /* Skip unknown relocation. */ + if (p->howto == NULL) + continue; - reloc_index = H_GET_32 (abfd, reloc_index_raw); - if (reloc_index == i) + if (p->howto->type != R_X86_64_JUMP_SLOT + && p->howto->type != R_X86_64_IRELATIVE) + continue; + + reloc_index = H_GET_32 (abfd, (plt_contents + plt_offset + + bed->plt_reloc_offset)); + if (reloc_index >= count) + abort (); + if (plt_bnd) { /* This is the index in .plt section. */ long plt_index = plt_offset / bed->plt_entry_size; - /* Return the offset in .plt.bnd section. */ - return (plt_index - 1) * sizeof (elf_x86_64_legacy_plt2_entry); + /* Store VMA + the offset in .plt.bnd section. */ + plt_sym_val[reloc_index] = + (plt_bnd->vma + + (plt_index - 1) * sizeof (elf_x86_64_legacy_plt2_entry)); } + else + plt_sym_val[reloc_index] = plt->vma + plt_offset; plt_offset += bed->plt_entry_size; } - abort (); + free (plt_contents); + + return plt_sym_val; } /* Similar to _bfd_elf_get_synthetic_symtab, with .plt.bnd section @@ -5383,108 +5611,15 @@ elf_x86_64_get_synthetic_symtab (bfd *abfd, asymbol **dynsyms, asymbol **ret) { - const struct elf_backend_data *bed = get_elf_backend_data (abfd); - asection *relplt; - asymbol *s; - bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); - arelent *p; - long count, i, n; - size_t size; - Elf_Internal_Shdr *hdr; - char *names; - asection *plt, *plt_push; - - plt_push = bfd_get_section_by_name (abfd, ".plt"); - if (plt_push == NULL) - return 0; - - plt = bfd_get_section_by_name (abfd, ".plt.bnd"); - /* Use the generic ELF version if there is no .plt.bnd section. */ + /* Pass the .plt.bnd section to _bfd_elf_ifunc_get_synthetic_symtab + as PLT if it exists. */ + asection *plt = bfd_get_section_by_name (abfd, ".plt.bnd"); if (plt == NULL) - return _bfd_elf_get_synthetic_symtab (abfd, symcount, syms, - dynsymcount, dynsyms, ret); - - *ret = NULL; - - if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0) - return 0; - - if (dynsymcount <= 0) - return 0; - - relplt = bfd_get_section_by_name (abfd, ".rela.plt"); - if (relplt == NULL) - return 0; - - hdr = &elf_section_data (relplt)->this_hdr; - if (hdr->sh_link != elf_dynsymtab (abfd) - || (hdr->sh_type != SHT_REL && hdr->sh_type != SHT_RELA)) - return 0; - - slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; - if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE)) - return -1; - - count = relplt->size / hdr->sh_entsize; - size = count * sizeof (asymbol); - p = relplt->relocation; - for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel) - { - size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); - if (p->addend != 0) - size += sizeof ("+0x") - 1 + 8 + 8; - } - - s = *ret = (asymbol *) bfd_malloc (size); - if (s == NULL) - return -1; - - names = (char *) (s + count); - p = relplt->relocation; - n = 0; - for (i = 0; i < count; i++, p++) - { - bfd_vma offset; - size_t len; - - if (p->howto->type != R_X86_64_JUMP_SLOT - && p->howto->type != R_X86_64_IRELATIVE) - continue; - - offset = elf_x86_64_plt_sym_val_offset_plt_bnd (i, plt_push); - - *s = **p->sym_ptr_ptr; - /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since - we are defining a symbol, ensure one of them is set. */ - if ((s->flags & BSF_LOCAL) == 0) - s->flags |= BSF_GLOBAL; - s->flags |= BSF_SYNTHETIC; - s->section = plt; - s->value = offset; - s->name = names; - s->udata.p = NULL; - len = strlen ((*p->sym_ptr_ptr)->name); - memcpy (names, (*p->sym_ptr_ptr)->name, len); - names += len; - if (p->addend != 0) - { - char buf[30], *a; - - memcpy (names, "+0x", sizeof ("+0x") - 1); - names += sizeof ("+0x") - 1; - bfd_sprintf_vma (abfd, buf, p->addend); - for (a = buf; *a == '0'; ++a) - ; - len = strlen (a); - memcpy (names, a, len); - names += len; - } - memcpy (names, "@plt", sizeof ("@plt")); - names += sizeof ("@plt"); - ++s, ++n; - } - - return n; + plt = bfd_get_section_by_name (abfd, ".plt"); + return _bfd_elf_ifunc_get_synthetic_symtab (abfd, symcount, syms, + dynsymcount, dynsyms, ret, + plt, + elf_x86_64_get_plt_sym_val); } /* Handle an x86-64 specific section when reading an object file. This @@ -5538,9 +5673,10 @@ elf_x86_64_add_symbol_hook (bfd *abfd, return TRUE; } - if ((abfd->flags & DYNAMIC) == 0 - && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE)) + if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC + || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + && (abfd->flags & DYNAMIC) == 0 + && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; return TRUE; @@ -5719,8 +5855,6 @@ static const struct bfd_elf_special_section #define bfd_elf64_bfd_link_hash_table_create \ elf_x86_64_link_hash_table_create -#define bfd_elf64_bfd_link_hash_table_free \ - elf_x86_64_link_hash_table_free #define bfd_elf64_bfd_reloc_type_lookup elf_x86_64_reloc_type_lookup #define bfd_elf64_bfd_reloc_name_lookup \ elf_x86_64_reloc_name_lookup @@ -5744,7 +5878,6 @@ static const struct bfd_elf_special_section #define elf_backend_size_dynamic_sections elf_x86_64_size_dynamic_sections #define elf_backend_always_size_sections elf_x86_64_always_size_sections #define elf_backend_init_index_section _bfd_elf_init_1_index_section -#define elf_backend_plt_sym_val elf_x86_64_plt_sym_val #define elf_backend_object_p elf64_x86_64_elf_object_p #define bfd_elf64_mkobject elf_x86_64_mkobject #define bfd_elf64_get_synthetic_symtab elf_x86_64_get_synthetic_symtab @@ -5818,8 +5951,6 @@ static const struct bfd_elf_special_section #include "elf64-target.h" -#undef bfd_elf64_get_synthetic_symtab - /* Native Client support. */ static bfd_boolean @@ -5992,14 +6123,14 @@ elf32_x86_64_nacl_elf_object_p (bfd *abfd) #define bfd_elf32_bfd_link_hash_table_create \ elf_x86_64_link_hash_table_create -#define bfd_elf32_bfd_link_hash_table_free \ - elf_x86_64_link_hash_table_free #define bfd_elf32_bfd_reloc_type_lookup \ elf_x86_64_reloc_type_lookup #define bfd_elf32_bfd_reloc_name_lookup \ elf_x86_64_reloc_name_lookup #define bfd_elf32_mkobject \ elf_x86_64_mkobject +#define bfd_elf32_get_synthetic_symtab \ + elf_x86_64_get_synthetic_symtab #undef elf_backend_object_p #define elf_backend_object_p \ diff --git a/bfd/elf64.c b/bfd/elf64.c index 975262db4..74726648f 100644 --- a/bfd/elf64.c +++ b/bfd/elf64.c @@ -1,5 +1,5 @@ /* ELF 64-bit executable support for BFD. - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elfcode.h b/bfd/elfcode.h index ec53c3bbd..1a9d30451 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1,5 +1,5 @@ /* ELF executable support for BFD. - Copyright (C) 1991-2014 Free Software Foundation, Inc. + Copyright (C) 1991-2015 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -1214,10 +1214,9 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic) for (isym = isymbuf + 1, sym = symbase; isym < isymend; isym++, sym++) { memcpy (&sym->internal_elf_sym, isym, sizeof (Elf_Internal_Sym)); - sym->symbol.the_bfd = abfd; + sym->symbol.the_bfd = abfd; sym->symbol.name = bfd_elf_sym_name (abfd, hdr, isym, NULL); - sym->symbol.value = isym->st_value; if (isym->st_shndx == SHN_UNDEF) @@ -1501,7 +1500,9 @@ elf_slurp_reloc_table (bfd *abfd, rel_hdr2 = d->rela.hdr; reloc_count2 = rel_hdr2 ? NUM_SHDR_ENTRIES (rel_hdr2) : 0; - BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2); + /* PR 17512: file: 0b4f81b7. */ + if (asect->reloc_count != reloc_count + reloc_count2) + return FALSE; BFD_ASSERT ((rel_hdr && asect->rel_filepos == rel_hdr->sh_offset) || (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset)); diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 97fd7abd2..c4e5b43c6 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -1,5 +1,5 @@ /* ELF core file support for BFD. - Copyright (C) 1995-2014 Free Software Foundation, Inc. + Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/bfd/elflink.c b/bfd/elflink.c index 6756fb131..73d236060 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1,5 +1,5 @@ /* ELF linking support for BFD. - Copyright (C) 1995-2014 Free Software Foundation, Inc. + Copyright (C) 1995-2015 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -20,6 +20,7 @@ #include "sysdep.h" #include "bfd.h" +#include "bfd_stdint.h" #include "bfdlink.h" #include "libbfd.h" #define ARCH_SIZE 0 @@ -84,6 +85,7 @@ _bfd_elf_define_linkage_sym (bfd *abfd, h = (struct elf_link_hash_entry *) bh; h->def_regular = 1; h->non_elf = 0; + h->root.linker_def = 1; h->type = STT_OBJECT; if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL) h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN; @@ -851,48 +853,29 @@ _bfd_elf_link_renumber_dynsyms (bfd *output_bfd, static void elf_merge_st_other (bfd *abfd, struct elf_link_hash_entry *h, - Elf_Internal_Sym *isym, bfd_boolean definition, - bfd_boolean dynamic) + const Elf_Internal_Sym *isym, + bfd_boolean definition, bfd_boolean dynamic) { const struct elf_backend_data *bed = get_elf_backend_data (abfd); /* If st_other has a processor-specific meaning, specific - code might be needed here. We never merge the visibility - attribute with the one from a dynamic object. */ + code might be needed here. */ if (bed->elf_backend_merge_symbol_attribute) (*bed->elf_backend_merge_symbol_attribute) (h, isym, definition, dynamic); - /* If this symbol has default visibility and the user has requested - we not re-export it, then mark it as hidden. */ - if (definition - && !dynamic - && (abfd->no_export - || (abfd->my_archive && abfd->my_archive->no_export)) - && ELF_ST_VISIBILITY (isym->st_other) != STV_INTERNAL) - isym->st_other = (STV_HIDDEN - | (isym->st_other & ~ELF_ST_VISIBILITY (-1))); - - if (!dynamic && ELF_ST_VISIBILITY (isym->st_other) != 0) - { - unsigned char hvis, symvis, other, nvis; - - /* Only merge the visibility. Leave the remainder of the - st_other field to elf_backend_merge_symbol_attribute. */ - other = h->other & ~ELF_ST_VISIBILITY (-1); - - /* Combine visibilities, using the most constraining one. */ - hvis = ELF_ST_VISIBILITY (h->other); - symvis = ELF_ST_VISIBILITY (isym->st_other); - if (! hvis) - nvis = symvis; - else if (! symvis) - nvis = hvis; - else - nvis = hvis < symvis ? hvis : symvis; + if (!dynamic) + { + unsigned symvis = ELF_ST_VISIBILITY (isym->st_other); + unsigned hvis = ELF_ST_VISIBILITY (h->other); - h->other = other | nvis; + /* Keep the most constraining visibility. Leave the remainder + of the st_other field to elf_backend_merge_symbol_attribute. */ + if (symvis - 1 < hvis - 1) + h->other = symvis | (h->other & ~ELF_ST_VISIBILITY (-1)); } + else if (definition && ELF_ST_VISIBILITY (isym->st_other) != STV_DEFAULT) + h->protected_def = 1; } /* This function is called when we want to merge a new symbol with an @@ -1853,7 +1836,9 @@ _bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h, if (!h->def_dynamic || h->def_regular || h->dynindx == -1 - || h->verinfo.verdef == NULL) + || h->verinfo.verdef == NULL + || (elf_dyn_lib_class (h->verinfo.verdef->vd_bfd) + & (DYN_AS_NEEDED | DYN_DT_NEEDED | DYN_NO_NEEDED))) return TRUE; /* See if we already know about this version. */ @@ -2655,7 +2640,8 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data) DYNBSS. */ bfd_boolean -_bfd_elf_adjust_dynamic_copy (struct elf_link_hash_entry *h, +_bfd_elf_adjust_dynamic_copy (struct bfd_link_info *info, + struct elf_link_hash_entry *h, asection *dynbss) { unsigned int power_of_two; @@ -2694,6 +2680,15 @@ _bfd_elf_adjust_dynamic_copy (struct elf_link_hash_entry *h, /* Increment the size of DYNBSS to make room for the symbol. */ dynbss->size += h->size; + if (h->protected_def) + { + info->callbacks->einfo + (_("%P: copy reloc against protected `%T' is invalid\n"), + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } @@ -2952,13 +2947,6 @@ elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef) if (! bfd_check_format (abfd, bfd_object)) return FALSE; - /* If we have already included the element containing this symbol in the - link then we do not need to include it again. Just claim that any symbol - it contains is not a definition, so that our caller will not decide to - (re)include this element. */ - if (abfd->archive_pass) - return FALSE; - /* Select the appropriate symbol table. */ if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0) hdr = &elf_tdata (abfd)->symtab_hdr; @@ -3114,7 +3102,8 @@ static bfd_boolean on_needed_list (const char *soname, struct bfd_link_needed_list *needed) { for (; needed != NULL; needed = needed->next) - if (strcmp (soname, needed->name) == 0) + if ((elf_dyn_lib_class (needed->by) & DYN_AS_NEEDED) == 0 + && strcmp (soname, needed->name) == 0) return TRUE; return FALSE; @@ -3327,7 +3316,7 @@ _bfd_elf_notice_as_needed (bfd *ibfd, struct bfd_link_info *info, enum notice_asneeded_action act) { - return (*info->callbacks->notice) (info, NULL, ibfd, NULL, act, 0, NULL); + return (*info->callbacks->notice) (info, NULL, NULL, ibfd, NULL, act, 0); } /* Add symbols from an ELF object file to the linker hash table. */ @@ -3366,6 +3355,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) bfd_size_type old_dynstr_size = 0; size_t tabsize = 0; asection *s; + bfd_boolean just_syms; htab = elf_hash_table (info); bed = get_elf_backend_data (abfd); @@ -3469,15 +3459,20 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) } } + just_syms = ((s = abfd->sections) != NULL + && s->sec_info_type == SEC_INFO_TYPE_JUST_SYMS); + add_needed = TRUE; if (! dynamic) { /* If we are creating a shared library, create all the dynamic sections immediately. We need to attach them to something, so we attach them to this BFD, provided it is the right - format. FIXME: If there are no input BFD's of the same - format as the output, we can't make a shared library. */ - if (info->shared + format and is not from ld --just-symbols. FIXME: If there + are no input BFD's of the same format as the output, we can't + make a shared library. */ + if (!just_syms + && info->shared && is_elf_hash_table (htab) && info->output_bfd->xvec == abfd->xvec && !htab->dynamic_sections_created) @@ -3497,8 +3492,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) /* ld --just-symbols and dynamic objects don't mix very well. ld shouldn't allow it. */ - if ((s = abfd->sections) != NULL - && s->sec_info_type == SEC_INFO_TYPE_JUST_SYMS) + if (just_syms) abort (); /* If this dynamic lib was specified on the command line with @@ -4095,6 +4089,16 @@ error_free_dyn: name = newname; } + /* If this symbol has default visibility and the user has + requested we not re-export it, then mark it as hidden. */ + if (definition + && !dynamic + && (abfd->no_export + || (abfd->my_archive && abfd->my_archive->no_export)) + && ELF_ST_VISIBILITY (isym->st_other) != STV_INTERNAL) + isym->st_other = (STV_HIDDEN + | (isym->st_other & ~ELF_ST_VISIBILITY (-1))); + if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value, sym_hash, &old_bfd, &old_weak, &old_alignment, &skip, &override, @@ -4939,20 +4943,8 @@ _bfd_elf_archive_symbol_lookup (bfd *abfd, } /* Add symbols from an ELF archive file to the linker hash table. We - don't use _bfd_generic_link_add_archive_symbols because of a - problem which arises on UnixWare. The UnixWare libc.so is an - archive which includes an entry libc.so.1 which defines a bunch of - symbols. The libc.so archive also includes a number of other - object files, which also define symbols, some of which are the same - as those defined in libc.so.1. Correct linking requires that we - consider each object file in turn, and include it if it defines any - symbols we need. _bfd_generic_link_add_archive_symbols does not do - this; it looks through the list of undefined symbols, and includes - any object file which defines them. When this algorithm is used on - UnixWare, it winds up pulling in libc.so.1 early and defining a - bunch of symbols. This means that some of the other objects in the - archive are not included in the link, which is incorrect since they - precede libc.so.1 in the archive. + don't use _bfd_generic_link_add_archive_symbols because we need to + handle versioned symbols. Fortunately, ELF archive handling is simpler than that done by _bfd_generic_link_add_archive_symbols, which has to allow for a.out @@ -4967,8 +4959,7 @@ static bfd_boolean elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) { symindex c; - bfd_boolean *defined = NULL; - bfd_boolean *included = NULL; + unsigned char *included = NULL; carsym *symdefs; bfd_boolean loop; bfd_size_type amt; @@ -4992,11 +4983,10 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) if (c == 0) return TRUE; amt = c; - amt *= sizeof (bfd_boolean); - defined = (bfd_boolean *) bfd_zmalloc (amt); - included = (bfd_boolean *) bfd_zmalloc (amt); - if (defined == NULL || included == NULL) - goto error_return; + amt *= sizeof (*included); + included = (unsigned char *) bfd_zmalloc (amt); + if (included == NULL) + return FALSE; symdefs = bfd_ardata (abfd)->symdefs; bed = get_elf_backend_data (abfd); @@ -5021,7 +5011,7 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) struct bfd_link_hash_entry *undefs_tail; symindex mark; - if (defined[i] || included[i]) + if (included[i]) continue; if (symdef->file_offset == last) { @@ -5056,7 +5046,8 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) else if (h->root.type != bfd_link_hash_undefined) { if (h->root.type != bfd_link_hash_undefweak) - defined[i] = TRUE; + /* Symbol must be defined. Don't check it again. */ + included[i] = TRUE; continue; } @@ -5068,16 +5059,6 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) if (! bfd_check_format (element, bfd_object)) goto error_return; - /* Doublecheck that we have not included this object - already--it should be impossible, but there may be - something wrong with the archive. */ - if (element->archive_pass != 0) - { - bfd_set_error (bfd_error_bad_value); - goto error_return; - } - element->archive_pass = 1; - undefs_tail = info->hash->undefs_tail; if (!(*info->callbacks @@ -5115,14 +5096,11 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) } while (loop); - free (defined); free (included); return TRUE; error_return: - if (defined != NULL) - free (defined); if (included != NULL) free (included); return FALSE; @@ -5488,7 +5466,7 @@ _bfd_elf_size_group_sections (struct bfd_link_info *info) { bfd *ibfd; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour && !_bfd_elf_fixup_group_sections (ibfd, bfd_abs_section_ptr)) return FALSE; @@ -5615,7 +5593,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, for (inputobj = info->input_bfds; inputobj; - inputobj = inputobj->link_next) + inputobj = inputobj->link.next) { asection *s; @@ -5881,7 +5859,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, asection *o; for (sub = info->input_bfds; sub != NULL; - sub = sub->link_next) + sub = sub->link.next) if (bfd_get_flavour (sub) == bfd_target_elf_flavour) for (o = sub->sections; o != NULL; o = o->next) if (elf_section_data (o)->this_hdr.sh_type @@ -6711,7 +6689,7 @@ _bfd_elf_merge_sections (bfd *abfd, struct bfd_link_info *info) if (!is_elf_hash_table (info->hash)) return FALSE; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) if ((ibfd->flags & DYNAMIC) == 0) for (sec = ibfd->sections; sec != NULL; sec = sec->next) if ((sec->flags & SEC_MERGE) != 0 @@ -6901,6 +6879,7 @@ _bfd_elf_link_hash_table_create (bfd *abfd) free (ret); return NULL; } + ret->root.hash_table_free = _bfd_elf_link_hash_table_free; return &ret->root; } @@ -6908,13 +6887,15 @@ _bfd_elf_link_hash_table_create (bfd *abfd) /* Destroy an ELF linker hash table. */ void -_bfd_elf_link_hash_table_free (struct bfd_link_hash_table *hash) +_bfd_elf_link_hash_table_free (bfd *obfd) { - struct elf_link_hash_table *htab = (struct elf_link_hash_table *) hash; + struct elf_link_hash_table *htab; + + htab = (struct elf_link_hash_table *) obfd->link.hash; if (htab->dynstr != NULL) _bfd_elf_strtab_free (htab->dynstr); _bfd_merge_sections_free (htab->merge_info); - _bfd_generic_link_hash_table_free (hash); + _bfd_generic_link_hash_table_free (obfd); } /* This is a hook for the ELF emulation code in the generic linker to @@ -7990,6 +7971,138 @@ bfd_elf_perform_complex_relocation (bfd *input_bfd, return r; } +/* qsort comparison functions sorting external relocs by r_offset. */ + +static int +cmp_ext32l_r_offset (const void *p, const void *q) +{ + union aligned32 + { + uint32_t v; + unsigned char c[4]; + }; + const union aligned32 *a + = (const union aligned32 *) ((const Elf32_External_Rel *) p)->r_offset; + const union aligned32 *b + = (const union aligned32 *) ((const Elf32_External_Rel *) q)->r_offset; + + uint32_t aval = ( (uint32_t) a->c[0] + | (uint32_t) a->c[1] << 8 + | (uint32_t) a->c[2] << 16 + | (uint32_t) a->c[3] << 24); + uint32_t bval = ( (uint32_t) b->c[0] + | (uint32_t) b->c[1] << 8 + | (uint32_t) b->c[2] << 16 + | (uint32_t) b->c[3] << 24); + if (aval < bval) + return -1; + else if (aval > bval) + return 1; + return 0; +} + +static int +cmp_ext32b_r_offset (const void *p, const void *q) +{ + union aligned32 + { + uint32_t v; + unsigned char c[4]; + }; + const union aligned32 *a + = (const union aligned32 *) ((const Elf32_External_Rel *) p)->r_offset; + const union aligned32 *b + = (const union aligned32 *) ((const Elf32_External_Rel *) q)->r_offset; + + uint32_t aval = ( (uint32_t) a->c[0] << 24 + | (uint32_t) a->c[1] << 16 + | (uint32_t) a->c[2] << 8 + | (uint32_t) a->c[3]); + uint32_t bval = ( (uint32_t) b->c[0] << 24 + | (uint32_t) b->c[1] << 16 + | (uint32_t) b->c[2] << 8 + | (uint32_t) b->c[3]); + if (aval < bval) + return -1; + else if (aval > bval) + return 1; + return 0; +} + +#ifdef BFD_HOST_64_BIT +static int +cmp_ext64l_r_offset (const void *p, const void *q) +{ + union aligned64 + { + uint64_t v; + unsigned char c[8]; + }; + const union aligned64 *a + = (const union aligned64 *) ((const Elf64_External_Rel *) p)->r_offset; + const union aligned64 *b + = (const union aligned64 *) ((const Elf64_External_Rel *) q)->r_offset; + + uint64_t aval = ( (uint64_t) a->c[0] + | (uint64_t) a->c[1] << 8 + | (uint64_t) a->c[2] << 16 + | (uint64_t) a->c[3] << 24 + | (uint64_t) a->c[4] << 32 + | (uint64_t) a->c[5] << 40 + | (uint64_t) a->c[6] << 48 + | (uint64_t) a->c[7] << 56); + uint64_t bval = ( (uint64_t) b->c[0] + | (uint64_t) b->c[1] << 8 + | (uint64_t) b->c[2] << 16 + | (uint64_t) b->c[3] << 24 + | (uint64_t) b->c[4] << 32 + | (uint64_t) b->c[5] << 40 + | (uint64_t) b->c[6] << 48 + | (uint64_t) b->c[7] << 56); + if (aval < bval) + return -1; + else if (aval > bval) + return 1; + return 0; +} + +static int +cmp_ext64b_r_offset (const void *p, const void *q) +{ + union aligned64 + { + uint64_t v; + unsigned char c[8]; + }; + const union aligned64 *a + = (const union aligned64 *) ((const Elf64_External_Rel *) p)->r_offset; + const union aligned64 *b + = (const union aligned64 *) ((const Elf64_External_Rel *) q)->r_offset; + + uint64_t aval = ( (uint64_t) a->c[0] << 56 + | (uint64_t) a->c[1] << 48 + | (uint64_t) a->c[2] << 40 + | (uint64_t) a->c[3] << 32 + | (uint64_t) a->c[4] << 24 + | (uint64_t) a->c[5] << 16 + | (uint64_t) a->c[6] << 8 + | (uint64_t) a->c[7]); + uint64_t bval = ( (uint64_t) b->c[0] << 56 + | (uint64_t) b->c[1] << 48 + | (uint64_t) b->c[2] << 40 + | (uint64_t) b->c[3] << 32 + | (uint64_t) b->c[4] << 24 + | (uint64_t) b->c[5] << 16 + | (uint64_t) b->c[6] << 8 + | (uint64_t) b->c[7]); + if (aval < bval) + return -1; + else if (aval > bval) + return 1; + return 0; +} +#endif + /* When performing a relocatable link, the input relocations are preserved. But, if they reference global symbols, the indices referenced must be updated. Update all the relocations found in @@ -7997,7 +8110,8 @@ bfd_elf_perform_complex_relocation (bfd *input_bfd, static void elf_link_adjust_relocs (bfd *abfd, - struct bfd_elf_section_reloc_data *reldata) + struct bfd_elf_section_reloc_data *reldata, + bfd_boolean sort) { unsigned int i; const struct elf_backend_data *bed = get_elf_backend_data (abfd); @@ -8053,6 +8167,35 @@ elf_link_adjust_relocs (bfd *abfd, | (irela[j].r_info & r_type_mask)); (*swap_out) (abfd, irela, erela); } + + if (sort) + { + int (*compare) (const void *, const void *); + + if (bed->s->arch_size == 32) + { + if (abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE) + compare = cmp_ext32l_r_offset; + else if (abfd->xvec->header_byteorder == BFD_ENDIAN_BIG) + compare = cmp_ext32b_r_offset; + else + abort (); + } + else + { +#ifdef BFD_HOST_64_BIT + if (abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE) + compare = cmp_ext64l_r_offset; + else if (abfd->xvec->header_byteorder == BFD_ENDIAN_BIG) + compare = cmp_ext64b_r_offset; + else +#endif + abort (); + } + qsort (reldata->hdr->contents, count, reldata->hdr->sh_entsize, compare); + free (reldata->hashes); + reldata->hashes = NULL; + } } struct elf_link_sort_rela @@ -9085,7 +9228,9 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) if (!h->def_regular) { - if (h->verinfo.verdef == NULL) + if (h->verinfo.verdef == NULL + || (elf_dyn_lib_class (h->verinfo.verdef->vd_bfd) + & (DYN_AS_NEEDED | DYN_DT_NEEDED | DYN_NO_NEEDED))) iversym.vs_vers = 0; else iversym.vs_vers = h->verinfo.verdef->vd_exp_refno + 1; @@ -10469,7 +10614,6 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) unsigned int i; Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_shndx_hdr; - Elf_Internal_Shdr *symstrtab_hdr; const struct elf_backend_data *bed = get_elf_backend_data (abfd); struct elf_outext_info eoinfo; bfd_boolean merged; @@ -10726,12 +10870,10 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) esdo->rela.count = 0; } - _bfd_elf_assign_file_positions_for_relocs (abfd); - /* We have now assigned file positions for all the sections except - .symtab and .strtab. We start the .symtab section at the current - file position, and write directly to it. We build the .strtab - section in memory. */ + .symtab, .strtab, and non-loaded reloc sections. We start the + .symtab section at the current file position, and write directly + to it. We build the .strtab section in memory. */ bfd_get_symcount (abfd) = 0; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* sh_name is set in prep_headers. */ @@ -10929,7 +11071,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) we could write the relocs out and then read them again; I don't know how bad the memory loss will be. */ - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) sub->output_has_begun = FALSE; for (o = abfd->sections; o != NULL; o = o->next) { @@ -10991,7 +11133,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) /* Free symbol buffer if needed. */ if (!info->reduce_memory_overheads) { - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) if (bfd_get_flavour (sub) == bfd_target_elf_flavour && elf_tdata (sub)->symbuf) { @@ -11172,25 +11314,28 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) } - /* Finish up and write out the symbol string table (.strtab) - section. */ - symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; - /* sh_name was set in prep_headers. */ - symstrtab_hdr->sh_type = SHT_STRTAB; - symstrtab_hdr->sh_flags = 0; - symstrtab_hdr->sh_addr = 0; - symstrtab_hdr->sh_size = _bfd_stringtab_size (flinfo.symstrtab); - symstrtab_hdr->sh_entsize = 0; - symstrtab_hdr->sh_link = 0; - symstrtab_hdr->sh_info = 0; - /* sh_offset is set just below. */ - symstrtab_hdr->sh_addralign = 1; - - off = _bfd_elf_assign_file_position_for_section (symstrtab_hdr, off, TRUE); - elf_next_file_pos (abfd) = off; - if (bfd_get_symcount (abfd) > 0) { + /* Finish up and write out the symbol string table (.strtab) + section. */ + Elf_Internal_Shdr *symstrtab_hdr; + + symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; + /* sh_name was set in prep_headers. */ + symstrtab_hdr->sh_type = SHT_STRTAB; + symstrtab_hdr->sh_flags = 0; + symstrtab_hdr->sh_addr = 0; + symstrtab_hdr->sh_size = _bfd_stringtab_size (flinfo.symstrtab); + symstrtab_hdr->sh_entsize = 0; + symstrtab_hdr->sh_link = 0; + symstrtab_hdr->sh_info = 0; + /* sh_offset is set just below. */ + symstrtab_hdr->sh_addralign = 1; + + off = _bfd_elf_assign_file_position_for_section (symstrtab_hdr, + off, TRUE); + elf_next_file_pos (abfd) = off; + if (bfd_seek (abfd, symstrtab_hdr->sh_offset, SEEK_SET) != 0 || ! _bfd_stringtab_emit (abfd, flinfo.symstrtab)) return FALSE; @@ -11200,13 +11345,15 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) for (o = abfd->sections; o != NULL; o = o->next) { struct bfd_elf_section_data *esdo = elf_section_data (o); + bfd_boolean sort; if ((o->flags & SEC_RELOC) == 0) continue; + sort = bed->sort_relocs_p == NULL || (*bed->sort_relocs_p) (o); if (esdo->rel.hdr != NULL) - elf_link_adjust_relocs (abfd, &esdo->rel); + elf_link_adjust_relocs (abfd, &esdo->rel, sort); if (esdo->rela.hdr != NULL) - elf_link_adjust_relocs (abfd, &esdo->rela); + elf_link_adjust_relocs (abfd, &esdo->rela, sort); /* Set the reloc_count field to 0 to prevent write_relocs from trying to swap the relocs out itself. */ @@ -11677,7 +11824,7 @@ _bfd_elf_gc_mark_hook (asection *sec, { bfd *i; - for (i = info->input_bfds; i; i = i->link_next) + for (i = info->input_bfds; i; i = i->link.next) { sec = bfd_get_section_by_name (i, sec_name); if (sec) @@ -11716,6 +11863,12 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec, || ELF_ST_BIND (cookie->locsyms[r_symndx].st_info) != STB_LOCAL) { h = cookie->sym_hashes[r_symndx - cookie->extsymoff]; + if (h == NULL) + { + info->callbacks->einfo (_("%F%P: corrupt input: %B\n"), + sec->owner); + return 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; @@ -11818,6 +11971,47 @@ _bfd_elf_gc_mark (struct bfd_link_info *info, return ret; } +/* Scan and mark sections in a special or debug section group. */ + +static void +_bfd_elf_gc_mark_debug_special_section_group (asection *grp) +{ + /* Point to first section of section group. */ + asection *ssec; + /* Used to iterate the section group. */ + asection *msec; + + bfd_boolean is_special_grp = TRUE; + bfd_boolean is_debug_grp = TRUE; + + /* First scan to see if group contains any section other than debug + and special section. */ + ssec = msec = elf_next_in_group (grp); + do + { + if ((msec->flags & SEC_DEBUGGING) == 0) + is_debug_grp = FALSE; + + if ((msec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) != 0) + is_special_grp = FALSE; + + msec = elf_next_in_group (msec); + } + while (msec != ssec); + + /* If this is a pure debug section group or pure special section group, + keep all sections in this group. */ + if (is_debug_grp || is_special_grp) + { + do + { + msec->gc_mark = 1; + msec = elf_next_in_group (msec); + } + while (msec != ssec); + } +} + /* Keep debug and special sections. */ bfd_boolean @@ -11826,7 +12020,7 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info, { bfd *ibfd; - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { asection *isec; bfd_boolean some_kept; @@ -11858,13 +12052,17 @@ _bfd_elf_gc_mark_extra_sections (struct bfd_link_info *info, continue; /* Keep debug and special sections like .comment when they are - not part of a group, or when we have single-member groups. */ + not part of a group. Also keep section groups that contain + just debug sections or special sections. */ for (isec = ibfd->sections; isec != NULL; isec = isec->next) - if ((elf_next_in_group (isec) == NULL - || elf_next_in_group (isec) == isec) - && ((isec->flags & SEC_DEBUGGING) != 0 - || (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)) - isec->gc_mark = 1; + { + if ((isec->flags & SEC_GROUP) != 0) + _bfd_elf_gc_mark_debug_special_section_group (isec); + else if (((isec->flags & SEC_DEBUGGING) != 0 + || (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0) + && elf_next_in_group (isec) == NULL) + isec->gc_mark = 1; + } if (! debug_frag_seen) continue; @@ -11954,7 +12152,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) unsigned long section_sym_count; struct elf_gc_sweep_symbol_info sweep_info; - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { asection *o; @@ -12194,6 +12392,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) bfd *sub; elf_gc_mark_hook_fn gc_mark_hook; const struct elf_backend_data *bed = get_elf_backend_data (abfd); + struct elf_link_hash_table *htab; if (!bed->can_gc_sections || !is_elf_hash_table (info->hash)) @@ -12203,11 +12402,11 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) } bed->gc_keep (info); + htab = elf_hash_table (info); /* Try to parse each bfd's .eh_frame section. Point elf_eh_frame_section at the .eh_frame section if we can mark the FDEs individually. */ - _bfd_elf_begin_eh_frame_parsing (info); - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { asection *sec; struct elf_reloc_cookie cookie; @@ -12223,31 +12422,24 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) sec = bfd_get_next_section_by_name (sec); } } - _bfd_elf_end_eh_frame_parsing (info); /* Apply transitive closure to the vtable entry usage info. */ - elf_link_hash_traverse (elf_hash_table (info), - elf_gc_propagate_vtable_entries_used, - &ok); + elf_link_hash_traverse (htab, elf_gc_propagate_vtable_entries_used, &ok); if (!ok) return FALSE; /* Kill the vtable relocations that were not used. */ - elf_link_hash_traverse (elf_hash_table (info), - elf_gc_smash_unused_vtentry_relocs, - &ok); + elf_link_hash_traverse (htab, elf_gc_smash_unused_vtentry_relocs, &ok); if (!ok) return FALSE; /* Mark dynamically referenced symbols. */ - if (elf_hash_table (info)->dynamic_sections_created) - elf_link_hash_traverse (elf_hash_table (info), - bed->gc_mark_dynamic_ref, - info); + if (htab->dynamic_sections_created) + elf_link_hash_traverse (htab, bed->gc_mark_dynamic_ref, info); /* Grovel through relocs to find out who stays ... */ gc_mark_hook = bed->gc_mark_hook; - for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { asection *o; @@ -12556,7 +12748,7 @@ bfd_elf_gc_common_finalize_got_offsets (bfd *abfd, gotoff = bed->got_header_size; /* Do the local .got entries first. */ - for (i = info->input_bfds; i; i = i->link_next) + for (i = info->input_bfds; i; i = i->link.next) { bfd_signed_vma *local_got; bfd_size_type j, locsymcount; @@ -12645,10 +12837,10 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie) if ((h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) - && discarded_section (h->root.u.def.section)) + && (h->root.u.def.section->owner != rcookie->abfd + || h->root.u.def.section->kept_section != NULL + || discarded_section (h->root.u.def.section))) return TRUE; - else - return FALSE; } else { @@ -12661,7 +12853,9 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie) /* Need to: get the symbol; get the section. */ isym = &rcookie->locsyms[r_symndx]; isec = bfd_section_from_elf_index (rcookie->abfd, isym->st_shndx); - if (isec != NULL && discarded_section (isec)) + if (isec != NULL + && (isec->kept_section != NULL + || discarded_section (isec))) return TRUE; } return FALSE; @@ -12670,94 +12864,105 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie) } /* Discard unneeded references to discarded sections. - Returns TRUE if any section's size was changed. */ -/* This function assumes that the relocations are in sorted order, - which is true for all known assemblers. */ + Returns -1 on error, 1 if any section's size was changed, 0 if + nothing changed. This function assumes that the relocations are in + sorted order, which is true for all known assemblers. */ -bfd_boolean +int bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) { struct elf_reloc_cookie cookie; - asection *stab, *eh; - const struct elf_backend_data *bed; + asection *o; bfd *abfd; - bfd_boolean ret = FALSE; + int changed = 0; if (info->traditional_format || !is_elf_hash_table (info->hash)) - return FALSE; + return 0; - _bfd_elf_begin_eh_frame_parsing (info); - for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) + o = bfd_get_section_by_name (output_bfd, ".stab"); + if (o != NULL) { - if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) - continue; - - bed = get_elf_backend_data (abfd); + asection *i; - eh = NULL; - if (!info->relocatable) + for (i = o->map_head.s; i != NULL; i = i->map_head.s) { - eh = bfd_get_section_by_name (abfd, ".eh_frame"); - while (eh != NULL - && (eh->size == 0 - || bfd_is_abs_section (eh->output_section))) - eh = bfd_get_next_section_by_name (eh); - } - - stab = bfd_get_section_by_name (abfd, ".stab"); - if (stab != NULL - && (stab->size == 0 - || bfd_is_abs_section (stab->output_section) - || stab->sec_info_type != SEC_INFO_TYPE_STABS)) - stab = NULL; + if (i->size == 0 + || i->reloc_count == 0 + || i->sec_info_type != SEC_INFO_TYPE_STABS) + continue; - if (stab == NULL - && eh == NULL - && bed->elf_backend_discard_info == NULL) - continue; + abfd = i->owner; + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + continue; - if (!init_reloc_cookie (&cookie, info, abfd)) - return FALSE; + if (!init_reloc_cookie_for_section (&cookie, info, i)) + return -1; - if (stab != NULL - && stab->reloc_count > 0 - && init_reloc_cookie_rels (&cookie, info, abfd, stab)) - { - if (_bfd_discard_section_stabs (abfd, stab, - elf_section_data (stab)->sec_info, + if (_bfd_discard_section_stabs (abfd, i, + elf_section_data (i)->sec_info, bfd_elf_reloc_symbol_deleted_p, &cookie)) - ret = TRUE; - fini_reloc_cookie_rels (&cookie, stab); + changed = 1; + + fini_reloc_cookie_for_section (&cookie, i); } + } + + o = bfd_get_section_by_name (output_bfd, ".eh_frame"); + if (o != NULL) + { + asection *i; - while (eh != NULL - && init_reloc_cookie_rels (&cookie, info, abfd, eh)) + for (i = o->map_head.s; i != NULL; i = i->map_head.s) { - _bfd_elf_parse_eh_frame (abfd, info, eh, &cookie); - if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, + if (i->size == 0) + continue; + + abfd = i->owner; + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + continue; + + if (!init_reloc_cookie_for_section (&cookie, info, i)) + return -1; + + _bfd_elf_parse_eh_frame (abfd, info, i, &cookie); + if (_bfd_elf_discard_section_eh_frame (abfd, info, i, bfd_elf_reloc_symbol_deleted_p, &cookie)) - ret = TRUE; - fini_reloc_cookie_rels (&cookie, eh); - eh = bfd_get_next_section_by_name (eh); + changed = 1; + + fini_reloc_cookie_for_section (&cookie, i); } + } - if (bed->elf_backend_discard_info != NULL - && (*bed->elf_backend_discard_info) (abfd, &cookie, info)) - ret = TRUE; + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next) + { + const struct elf_backend_data *bed; + + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + continue; - fini_reloc_cookie (&cookie, abfd); + bed = get_elf_backend_data (abfd); + + if (bed->elf_backend_discard_info != NULL) + { + if (!init_reloc_cookie (&cookie, info, abfd)) + return -1; + + if ((*bed->elf_backend_discard_info) (abfd, &cookie, info)) + changed = 1; + + fini_reloc_cookie (&cookie, abfd); + } } - _bfd_elf_end_eh_frame_parsing (info); if (info->eh_frame_hdr && !info->relocatable && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info)) - ret = TRUE; + changed = 1; - return ret; + return changed; } bfd_boolean @@ -13041,17 +13246,24 @@ _bfd_elf_make_dynamic_reloc_section (asection * sec, return reloc_sec; } -/* Copy the ELF symbol type associated with a linker hash entry. */ +/* Copy the ELF symbol type and other attributes for a linker script + assignment from HSRC to HDEST. Generally this should be treated as + if we found a strong non-dynamic definition for HDEST (except that + ld ignores multiple definition errors). */ void -_bfd_elf_copy_link_hash_symbol_type (bfd *abfd ATTRIBUTE_UNUSED, - struct bfd_link_hash_entry * hdest, - struct bfd_link_hash_entry * hsrc) +_bfd_elf_copy_link_hash_symbol_type (bfd *abfd, + struct bfd_link_hash_entry *hdest, + struct bfd_link_hash_entry *hsrc) { - struct elf_link_hash_entry *ehdest = (struct elf_link_hash_entry *)hdest; - struct elf_link_hash_entry *ehsrc = (struct elf_link_hash_entry *)hsrc; + struct elf_link_hash_entry *ehdest = (struct elf_link_hash_entry *) hdest; + struct elf_link_hash_entry *ehsrc = (struct elf_link_hash_entry *) hsrc; + Elf_Internal_Sym isym; ehdest->type = ehsrc->type; ehdest->target_internal = ehsrc->target_internal; + + isym.st_other = ehsrc->other; + elf_merge_st_other (abfd, ehdest, &isym, TRUE, FALSE); } /* Append a RELA relocation REL to section S in BFD. */ diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index c37ff9d05..08fbd4825 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -1,5 +1,5 @@ /* MIPS-specific support for 32-bit ELF - Copyright (C) 1993-2014 Free Software Foundation, Inc. + Copyright (C) 1993-2015 Free Software Foundation, Inc. Most of the information added by Ian Lance Taylor, Cygnus Support, . @@ -770,6 +770,100 @@ static reloc_howto_type elf_mips_howto_table_rel[] = 0x0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (52), + EMPTY_HOWTO (53), + EMPTY_HOWTO (54), + EMPTY_HOWTO (55), + EMPTY_HOWTO (56), + EMPTY_HOWTO (57), + EMPTY_HOWTO (58), + EMPTY_HOWTO (59), + + HOWTO (R_MIPS_PC21_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 21, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC21_S2", /* name */ + TRUE, /* partial_inplace */ + 0x001fffff, /* src_mask */ + 0x001fffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC26_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC26_S2", /* name */ + TRUE, /* partial_inplace */ + 0x03ffffff, /* src_mask */ + 0x03ffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC18_S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC18_S3", /* name */ + TRUE, /* partial_inplace */ + 0x0003ffff, /* src_mask */ + 0x0003ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC19_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC19_S2", /* name */ + TRUE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCHI16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCHI16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCLO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCLO16", /* name */ + TRUE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + }; /* The relocation table used for SHT_RELA sections. */ @@ -1458,6 +1552,100 @@ static reloc_howto_type elf_mips_howto_table_rela[] = 0x0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (52), + EMPTY_HOWTO (53), + EMPTY_HOWTO (54), + EMPTY_HOWTO (55), + EMPTY_HOWTO (56), + EMPTY_HOWTO (57), + EMPTY_HOWTO (58), + EMPTY_HOWTO (59), + + HOWTO (R_MIPS_PC21_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 21, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC21_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x001fffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC26_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC26_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x03ffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC18_S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC18_S3", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0003ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PC19_S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PC19_S2", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0007ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCHI16, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCHI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO (R_MIPS_PCLO16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_mips_elf_generic_reloc, /* special_function */ + "R_MIPS_PCLO16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0x0000ffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + }; static reloc_howto_type elf_mips16_howto_table_rel[] = @@ -3018,7 +3206,13 @@ static const struct elf_reloc_map mips_reloc_map[] = { BFD_RELOC_MIPS_TLS_TPREL32, R_MIPS_TLS_TPREL32 }, { BFD_RELOC_MIPS_TLS_TPREL64, R_MIPS_TLS_TPREL64 }, { BFD_RELOC_MIPS_TLS_TPREL_HI16, R_MIPS_TLS_TPREL_HI16 }, - { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 } + { BFD_RELOC_MIPS_TLS_TPREL_LO16, R_MIPS_TLS_TPREL_LO16 }, + { BFD_RELOC_MIPS_21_PCREL_S2, R_MIPS_PC21_S2 }, + { BFD_RELOC_MIPS_26_PCREL_S2, R_MIPS_PC26_S2 }, + { BFD_RELOC_MIPS_18_PCREL_S3, R_MIPS_PC18_S3 }, + { BFD_RELOC_MIPS_19_PCREL_S2, R_MIPS_PC19_S2 }, + { BFD_RELOC_HI16_S_PCREL, R_MIPS_PCHI16 }, + { BFD_RELOC_LO16_PCREL, R_MIPS_PCLO16 } }; static const struct elf_reloc_map mips16_reloc_map[] = @@ -3410,6 +3604,8 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = { #define elf_backend_collect TRUE #define elf_backend_type_change_ok TRUE #define elf_backend_can_gc_sections TRUE +#define elf_backend_gc_mark_extra_sections \ + _bfd_mips_elf_gc_mark_extra_sections #define elf_info_to_howto mips_info_to_howto_rela #define elf_info_to_howto_rel mips_info_to_howto_rel #define elf_backend_sym_is_global mips_elf_sym_is_global diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index d917c7e51..3554a87c8 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -1,5 +1,5 @@ /* AArch64-specific support for NN-bit ELF. - Copyright (C) 2009-2014 Free Software Foundation, Inc. + Copyright (C) 2009-2015 Free Software Foundation, Inc. Contributed by ARM Ltd. This file is part of BFD, the Binary File Descriptor library. @@ -1431,6 +1431,14 @@ elfNN_aarch64_bfd_reloc_from_type (unsigned int r_type) if (r_type == R_AARCH64_NONE || r_type == R_AARCH64_NULL) return BFD_RELOC_AARCH64_NONE; + /* PR 17512: file: b371e70a. */ + if (r_type >= R_AARCH64_end) + { + _bfd_error_handler (_("Invalid AArch64 reloc number: %d"), r_type); + bfd_set_error (bfd_error_bad_value); + return BFD_RELOC_AARCH64_NONE; + } + return BFD_RELOC_AARCH64_RELOC_START + offsets[r_type]; } @@ -1611,6 +1619,12 @@ static const uint32_t aarch64_long_branch_stub[] = 0x00000000, }; +static const uint32_t aarch64_erratum_835769_stub[] = +{ + 0x00000000, /* Placeholder for multiply accumulate. */ + 0x14000000, /* b